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.11956v1
2023-02-23T12:10:59
2023-02-23T12:10:59
An Adam-enhanced Particle Swarm Optimizer for Latent Factor Analysis
Digging out the latent information from large-scale incomplete matrices is a key issue with challenges. The Latent Factor Analysis (LFA) model has been investigated in depth to an alyze the latent information. Recently, Swarm Intelligence-related LFA models have been proposed and adopted widely to improve the optimization process of LFA with high efficiency, i.e., the Particle Swarm Optimization (PSO)-LFA model. However, the hyper-parameters of the PSO-LFA model have to tune manually, which is inconvenient for widely adoption and limits the learning rate as a fixed value. To address this issue, we propose an Adam-enhanced Hierarchical PSO-LFA model, which refines the latent factors with a sequential Adam-adjusting hyper-parameters PSO algorithm. First, we design the Adam incremental vector for a particle and construct the Adam-enhanced evolution process for particles. Second, we refine all the latent factors of the target matrix sequentially with our proposed Adam-enhanced PSO's process. The experimental results on four real datasets demonstrate that our proposed model achieves higher prediction accuracy with its peers.
[ "Jia Chen", "Renyu Zhang", "Yuanyi Liu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11956v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11956v1", "@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" ]
An Adam-enhanced Particle Swarm Optimizer for Latent Factor Analysis Jia Chen School of Cyber Science and Technology Beihang University Beijing, China [email protected] Renyu Zhang School of Cyber Science and Technology Beihang University Beijing, China [email protected] Yuanyi Liu* School of Cyber Science and Technology Beihang University Beijing, China [email protected] Abstract- Digging out the latent information from large-scale incomplete matrices is a key issue with challenges. The Latent Factor Analysis (LFA) model has been investigated in depth to an alyze the latent information. Recently, Swarm Intelligence-related LFA models have been proposed and adopted widely to improve the optimization process of LFA with high efficiency, i.e., the Particle Swarm Optimization (PSO)-LFA model. However, the hyper-parameters of the PSO-LFA model have to tune manually, which is inconvenient for widely adoption and limits the learning rate as a fixed value. To address this issue, we propose an Adam-enhanced Hierarchical PSO-LFA model, which refines the latent factors with a sequential Adam-adjusting hyper-parameters PSO algorithm. First, we design the Adam incremental vector for a particle and construct the Adam-enhanced evolution process for particles. Second, we refine all the latent factors of the target matrix sequentially with our proposed Adam-enhanced PSO's process. The experimental results on four real datasets demonstrate that our proposed model achieves higher prediction accuracy with its peers. Keywords-High-dimensional and Incomplete (HDI) Matrix, Latent Factor Analysis (LFA) model, Adam algorithm, Particle Swarm Optimization (PSO) algorithm. I. INTRODUCTION With the smart applications and services becoming more complex and more widespread, there have generated and accumulated massive of High-Dimensional and Incomplete (HDI) data [1-7]. These data involve extremely useful latent information for analyzing the features of real entities and their relationships. Digging out the latent information from the HDI data is a challenging and interesting issue, which can help the smart applications and services provide better recommendation to the customers. To analyze the HDI data effectively, the Latent Factor Analysis (LFA) model has been widely investigated [8-11]. The LFA model focuses on analyzing the latent factors of involved entities, which can represent the relationships between two entities and the latent characteristics of entities. The input data of an LFA model is generally an HDI matrix. The LFA model maps the target HDI matrix into a low-dimensional latent factor space, builds a low rank approximate matrix based on the already known HDI data, and resolves the unknown data in the approximate matrix via the iterative optimization process [12-17]. The iterative optimization process is quite important in LFA analysis, which is widely used together with optimization algorithms, such as the SGD, Adam, AdaGrad and AdaDelta etc. [18-21]. Among them, SGD is the most classical algorithm with high prediction accuracy. However, SGD algorithm needs to tune learning rate value for various datasets. To adjust the learning rate adaptively, the Adam, AdaGrad and AdaDelta algorithms are adopted recently. Although they obtain relatively high accuracy w/o tunning learning rate manually, much running time is needed to adjust the learning rate in each optimization iteration. To further improve the optimization process, Luo et al.[22-25] introduce the Swarm Intelligence algorithms into the LFA model analysis. In this field, they have proposed a series of state-of-the-art models, i.e., the Particle Swarm Optimization (PSO)- LFA models, the Differential Evolution (DE)-LFA models, and the Beetle Antennae Search (BAS)-LFA models. Among them, the Hierarchical Position-transitional Particle Swarm Optimization-based LFA (HPL) model is an outstanding one, which optimizes the latent factors with two innovative PSO algorithms sequentially [24]. First, the Position-transitional Particle Swarm Optimization-based LFA (PLFA) model is adopted to optimize latent factors fast with adjusting the SGD's learning rate adaptively [22]. Second, the Mini-Batch PSO (MPSO) algorithm is adopted to refine the latent factors, which can achieve higher accuracy with acceptable additional time cost. However, the HPL model has to tune PSO's hyper-parameters for refining the latent factors of various datasets. That causes two problems. One is consuming lots of tunning time for various datasets, The other is the hyper-parameters can't be changed during the optimization process. To resolve these two problems, we propose an Adam-enhanced HPL (ADHPL) model to refine the latent factors with adjusting the PSO's hyper-parameters adaptively. The proposed model first constructs a new gradient vector with the particle's velocity increment. Then, it adopts Adam to construct the first and second moment gradient vectors and update each particle with Adam algorithm. Last, the ADHPL model refines the latent factors with Adam-adjusting PSO algorithm. Our main contributions are listed as follows: a) An ADHPL model. We incorporate the Adam-enhanced PSO evolution algorithm into the PSO's refinement process of HPL. Thereby, the proposed model refines all the latent factors w/o presetting the hyper-parameters. Compared with HPL, the proposed model obtains higher prediction accuracy with almost the same time cost. Corresponding author: Yuanyi Liu. b) An Adam-enhanced PSO's evolution algorithm. The classical PSO model updates each particle's velocity and position iteratively based on its velocity increment. We replace it with the designed Adam incremental vector and construct the Adam- enhanced evolution process for particles. The designed vector is based on the particle's velocity increment vector. Thereby, the proposed parametric adaptive evolution algorithm can simulate the evolution scheme of PSO effectively. Section II describes the related definitions and algorithms. Section III proposes our innovative ADHPL model. Section IV describes experimental data and results. Finally, Section V concludes this paper and plans for the future work. II. PRELIMINARIES First, we summarize the mainly adopted symbols in Table I. Then we review the working mechanisms of an SGD-based LFA model, an ADAM algorithm and an HPL model. A. An LFA Model for HiDS Matrices Let Z|U|×|I| represents an HiDS matrix, which denotes the relationships between two large entity sets U and I. Each element zu,i∈Z represents a specific relationship value between two specific entities u∈U and i∈I. Besides, Zun denotes the unknown entity set of Z while Zkn denotes the known entity set. For an HiDS matrix, the number of entities in Zkn is much smaller than in Zun, |Zkn|≪|Zun|. To predict Zun, an LFA model constructs a F-rank approximate matrix Ẑ=PQT, where P|U|×F and Q|I|×F denote the F- dimensional latent factor matrices for U and I, respectively. Then, an objective function estimating the Euclidean distance between Z and Ẑ is given as [26-32], which is usually combined with linear biases for P and Q, and an L2-norm-based regularization item. The objective function is formulated as: (1) where bu and ci denote the specific bias vector for U and I, λ is regularization constant, respectively. Because (1) is non-convex and not analytically solvable, an LFA model commonly adopts SGD to optimize its latent factor set {P, Q, b, c} with the preset gradient iteratively. Recently, the PSO-related LFA models becomes popular, which incorporates the classical PSO algorithm into LFA's optimization process. Among them, the HPL model is an outstanding one. Thereby, we select it as the basic model. A. An HPL Model An HPL model has a two-layer structure. The first layer adopts a PLFA model to pre-train latent factors, which adjusting SGD's learning rate by a P2SO algorithm. Then the second layer refines latent factors with a Mini-batch PSO (MPSO) algorithm. It separates all the latent factors into (|U|+|I|) mini-batch groups and optimize each group with PSO algorithm sequentially. For each group [pu,bu], ∀u∈|U|, the MPSO algorithm constructs a swarm consisting of S particles. Each particle's initial position vector xu s(0) consists of a vector nearby or TABLE I. MAINLY ADOPTED SYMBOLS WITH THEIR DESCRIPTIONS Symbol Description b, bu Bias vector of large entity set U, and its u-th element. s (τ) s-th particle's position with b and c at the τ-th iteration. s (τ) s-th particle's velocity with b and c at the τ-th iteration. Bias vector of large entity set I, and its i-th element. Fitness function of the PSO algorithm. bu s (τ), cu s (τ), ċu ḃu c, ci F(∙) F, f Max and active dimension number of the LF space. ğ(τ) h̆ s m(τ) m̂ (τ) S, s Max particle number in a particle swarm and the active one. P, pu,f An LF matrix for U, and its element in u-th row and f-column. Best position vector at the τ-th iteration in a particle swarm. The s-th particle's historical best position vector. The moving averages of gradient ∇ε(τ). The corrected moving averages of gradient ∇ε(τ). pu ṗu pu s (τ), qu s (τ), q̇ u Q, qf,i An LF matrix for I, and its element in f-th row and i-column. The u-th row vector of matrix P. s-th particle's position with pu and qi at the τ-th iteration. s-th particle's velocity with pu and qi at the τ-th iteration. s (τ) s (τ) The i-th row vector of matrix Q. qi Τ, τ Max iteration count of optimization algorithm, the current iteration. U, u I, i s (τ), vu xu Large entity set one and its active element. Large entity set two and its active element. s-th particle's position and velocity vector consisting of [pu, bu] at the τ-th iteration. s-th particle's position and velocity vector consisting of [qi, ci] at the τ-th iteration. s(τ), vi xi s(τ) s (τ) ()====−−−++++,,2,,,12222,,111,,,2.2uiknuiknFuiuffiuizZfFFuffiuizZffεPQzpqbcλpqbcbc Z, zu,i An HiDS matrix consists of the relationship value for two entity sets U and I, and each element in Z. Zkn, Zun Known and unknown entry set in Z. Ẑ, ẑu,i The approximation matrix of Z, and each element in Ẑ. ∇εu,i(∙) Γ, Λ ε() η, λ A partial derivative operator of the objective function to a specific relationship element between the u-th and the i-th entities. Training dataset and testing dataset of Z. Objective function estimating the distance between Z and Ẑ. Learning rate and regularization constant for a LFA model. equal to [pu,bu]. Each particle's position xu s(τ) and velocity vectors vu s(τ) at the τ-th iteration are represented as: s (τ), b u s (τ) denote the velocity of pu, bu at the τ-th iteration for the s-th particle, where p u denote their corresponding velocities. Then, the MPSO algorithm updates each [pu, bu] with traditional PSO and obtain the next iteration value. Velocity vu s(τ+1) at the (τ+1)-th iteration is updated as: and (2) (3) where γ1 and γ2 are the two acceleration coefficients. rd1 and rd2 are two random parameters between [0, 1], respectively. Then, the position xu s(τ+1) of each [pu, bu] is updated as: To measure the accuracy of all the updated positions, the fitness function is constructed as: (4) With (5), each particle's updated fitness value is compared with its historical best one. The comparison formula at the (τ+1)- th iteration is given as: (5) Then, the global best position ğu(τ+1) can be updated as: (6) (7) With the above evolution process, the total |U| [pu, bu] are refined sequentially to resolve the pre-mature problem in the PSO-LFA model. After all the |U| mini-batch [pu, bu] are refined, the |I| mini-batch [qi, ci] are refined sequentially. The HPL model achieves the balance of prediction accuracy and running efficiency. B. An Adam Algorithm The working mechanism of Adam is to adjust the instant learning rate at each iteration by calculating the ratio of moving averages of the gradient ∇ε(τ) and the squared moving averages of the gradient ∇ε(τ)2. Specifically, at the (τ+1)-th iteration, the moving averages m(τ+1) and the squared moving averages v(τ+1) are calculated as: where β1 and β2 is the exponential decay rate parameter of m and v at the previous iteration, respectively. At the first iteration, m(0) and v(0) are initialized to 0 according to [18]. Besides, β1 and β2 are commonly set as 0.9 and 0.999 as in [18]. Then the corrected parameters m̂ (τ+1) and v̂ (τ+1) are formulated as: (8) With the updated m̂ (τ+1) and v̂ (τ+1), the partial derivative operator ∇ε(τ+1) can be updated as: (9) ==()(),(),()(),(),uuuuuussssssττbτtτbτxpvp()usτp()usbτ()()()()+=+−+−=+−+−11221122(1)()()()()()(),()()(),()()(),(),uuuussssuusuuuuusssssuuussτωτγrdττγrdττωτbτγrdττbτγrdττbτvvhxgxphpgp+=++(1)()(1),uuusssτττxxv()()()+=−−−++,2221,1(1).22uiknusuiuiuiuuzZλFxτzqbcbpp()()+++=11(1), if (1)(),(1)(), otherwise,uuusssususτFτFτττxxhhh()++=+1(1)(1)argmin(1).usuusττFτhgh+=+−+=+−11222(1)()(1)(),(1)()(1)(),mτβmτβετvτβvτβετ+=+−+=+−12ˆ(1)(1)/(1),ˆ(1)(1)/(1),mτmτβvτvτβ where α denotes the step-size setting, ψ denotes a parameter avoiding denominator becoming zero. Then, each parameter in the objective function updates with ∇ε iteratively. The above Adam algorithm has been widely adopted in deep learning, graph learning and HiDS matrices analysis. The Adam algorithm improves the accuracy w/o tunning the learning rate manually. Thereby, we incorporate Adam into an HPL model. The proposed ADHPL model does not only adjusts the hyper-parameters automatically, but also promotes the prediction accuracy. (10) III. METHODOLOGY An ADHPL model first reconstructs each particle's velocity updating formula with Adam, then apply the Adam-MPSO algorithm to refine the latent factors in the HiDS matrices. The specific working mechanism is introduced in detail as described the next two sub-sections. A. Construct the Adam incremental vector for a particle The first job is to construct a (F+1)-dimensional gradient vector ∇ε(τ), which is the base incremental element for the Adam- and each particle's best position adjusting velocity. To do so, we adopt the combination of the global best position in (3) as the (F+1)-dimensional gradient vector ∇ε(τ). The ∇ε(τ) can be represented as: (11) Note that the constructed gradient vector ∇ε(τ) equals to the incremental velocity vector between vu s(τ) in (3). Thereby, the ∇ε(τ) can also represent the particle's velocity evolution during two adjacent iterations. Next, we build the first and second moment moving average parameters gradient vectors m(τ+1) and v(τ+1). The formulas can be reformulated from (8) as: s(τ+1) and vu The corrected parameters m̂ (τ+1) and v̂ (τ+1) are given as: (12) (13) By adding (13) into (10), we reformulate the gradient ∇ε(τ+1) in the next iteration with m(τ), v(τ) and ∇ε(τ) as: With the above (F+1)-dimensional gradient vector ∇ε(τ) and ∇ε(τ+1) consists of particle swarm's global best position and each particle's best position, we can update the particles' velocity and positions with Adam. Besides, the constructed incremental vector uses the PSO's original incremental elements, which can remain the PSO's characteristics. (14) +=+++ˆˆ(1)(1)/((1)),aaεταmτvτψ()uτg()usτh()()=−+−=−+−1212()(()())(()())()(),()()(),().uuuusssuuussuuussετrdττrdττrdττbτrdττbτhxgxhpgp()()()()+=+−−=+−+−+=+−−=+−+−111112222,21222(1)()(1)()()()()(1),()()(1)()(1)()()()()(1).()()uusuussuiuusuussτβτβετrdττβτβrdτττβτβετrdττβτβrdττmmgxmhxvvgxvhx()()()()()()+=+−=−+=−+−+−+=+−=−+=−+−+−1111112222222212ˆ(1)(1)/(1)()/(1)()()/(1)()()()(),ˆ(1)(1)/(1)()/(1)()()/(1)()()()().uuuussuuuussττββτβετβτβrdττrdττττββτβετβτβrdττrdττmmmmgxhxvvvvgxhx()()()()()()−++=−++−+−+−=−+−+−+11222111222212()/(1)()(1)()/(1)()()/(1)()()()().()/(1)()()()()uuuussuuuussβτβετεταβτβετψαβτβrdττrdττβτβrdττrdττψmvmgxhxvgxhx B. Refine the latent factors in MPSO with Adam We construct ADHPL model by updating all the particles' positions with Adam in the MPSO algorithm. All the preset hyper-parameters are substituted with the Adam incremental vector. First, we construct and initialize the particle swarms for each mini-batch group [pu, bu], ∀u∈|U| and [qi,ci], ∀i∈|I| consisting of S particles. For a specific s-th particle, the velocity vu (0) and position xu s(0) are both initialized as a vector nearby the vector [pu, bu]. Besides, the first and second moment moving average parameters m(0) and v(0) are preset. Second, we set velocity vu s(τ+1) as ∇ε(τ+1), which substitutes the formula in (3). We represent the new formula as: s (15) With the updated velocity vu s(τ+1), the new position of the s-th particle xu s(τ+1) is updated as: (16) Based on the above update scheme, each [pu, bu] is updated with Adam until reaches the convergence conditions. After refining all the |U| [pu, bu], the ADHPL model continues refining all the |I| [qi,ci] until reaches the convergence conditions. C. Algorithm Design and Analysis With the above latent factor refining process, we can construct an ADHPL model. It can be seen as a sequential Adam-PSO refining process for all the latent factors in the target HDI matrix. The workflow of the ADHPL model is depicted in Fig. 1. First, all the pre-trained latent factors are grouped by rows and columns. Thereby, all the latent factors are separated as the |U| row groups and |I| column groups. Each row group contains a latent factor pair [pu, bu], and each column group contains a latent factor pair [qi, ci]. Second, for each [pu, bu], ∀u≤|U|, we perform the Adam-PSO to refine the latent factors while fixing the others. Each refined latent factor is transferred back to P, b. Third, for each [qi, ci], ∀i≤|I|, we perform the Adam-PSO to refine the latent factors while fixing the others. Each refined latent factor is transferred back to Q, c. Finally, after all the groups in {P, Q, b, c} have been refined on training dataset once, calculate RMSE value on validation dataset. If the model converges on validation dataset, stop the refinement process and evaluate its RMSE value on testing dataset, otherwise continue refinement. Based on the above steps, the proposed ADHPL model can refine all the latent factors in a target HiDS matrix sequentially with Adam-adjusting PSO algorithm. A. General Settings IV. EXPERIMENTAL RESULTS AND ANALYSIS Evaluation Protocol. To compare our proposed model's prediction accuracy and efficiency with some state-of-the-art models, we choose RMSE to measure the prediction accuracy. We choose the CPU running time cost to measure the models' efficiency. We perform all the experiments on a workstation that has a 32GB RAM and a 3.91 GHz Xeon CPU. The formulas of RMSE are given as: where Λ represents the testing set disjoint with the training and validation sets. Dataset. We adopt four datasets ML10M[33], Flixster[34], +=+=++(1)(1)(1),(1),uuusssτεττbτvp()()()()()()+=++=+++−+−−=++−+−+−112122122(1)()(1)()(1)()()()()()1[(),()].()()()()()1uuuussssuuuussuussuuuussττττεταβτrdττrdττβpτbτβτrdττrdττψβxxvxmgxhxvgxhx(),2,,1ˆ().uiuiuirRMSErr=− Fig.1 Flow Chart of the ADHPL Model Douban[35] and ExtEpinion[36] to perform our models. We divide each dataset as training, validation and testing sub-datasets, which are 70%, 10% and 20%, respectively. Model Settings. We adopt the SGD-based LFA, Adam-based LFA, PLFA with biases, A2BAS-PLFA[37], HPL and SGDE- PLFA models as the comparison models. The dimension of LF space f is set as 20. The regularization coefficient is preset the same value for all the involved models. All the other hyper-parameters are set as the original settings. B. Performance comparison The lowest RMSE value and Friedman rank of all the involved models on four datasets are given in Table II. The time cost is given in Table III. 1) Comparison of prediction accuracy From Table II, we summarize the ADHPL model achieves relatively higher prediction accuracy compared with its peers. Two specific conclusions can be summarized as follows: a) The Adam-HPL's prediction accuracy evaluated by RMSE is the highest of all the involved models, except for the SGDE- PLFA. For instance, the ADHPL's RMSE on ExtEpinion equals to 0.5279, which is 0.25% lower than SGDE-PLFA's 0.5292, 1.16% lower than HPL's 0.5341, and even much lower than other models. The ADHPL's RMSE on Flixster equals to 0.8599, which is 0.13% lower than SGDE-PLFA's 0.8610, 0.19% lower than A2BAS-PLFA's 0.8615, and much lower than other models. One exception is the SGDE-PLFA model. Our proposed ADHPL outperforms two datasets compared with SGDE-PLFA, performs equally well on one dataset, and performs worse on one dataset. For instance, on ML10M, the ADHPL's RMSE value equals to 0.7840, which is 0.04% higher than the SGDE-PLFA's 0.7837, while this value is lower than all the others. Besides, on Douban, the ADHPL performs as well as SGDE-PLFA, while they all outperform the others. b) The ADHPL's prediction accuracy gain is statistically significant compared with its peers. The Win/Loss results are recorded in the next-to-last row of Table II, from which we can observe that the ADHPL and SGDE-PLFA both TABLE II. COMPARISON RESULTS IN RMSE, INCLUDING WIN/LOSS COUNTS STATISTIC AND FRIEDMAN TEST, WHERE * INDICATES THE MODEL HAS A LOWERE RMSE THAN THE COMPARISON MODELS. Test Cases SGD-based LFA ExtEpinion Flixster Douban ML10M Win/Loss F-rank 0.7358 0.9433 0.7176 0.7872 4/0 6.25 Adam-based LFA 0.7342 0.9464 PLFA with Biases 0.5361 0.8720 0.7213 0.7901 4/0 6.75 0.7076 0.7854 4/0 5.0 A2BAS-PLFA SGDE-PLFA HPL 0.5327 0.8615 0.7063 0.7843 4/0 3.25 0.5292 0.8610 0.7027* 0.7837* 3/1 1.5 0.5341 0.8656 0.7028 0.7850 4/0 3.75 ADHPL 0.5279* 0.8599* 0.7027* 0.7840 -- 1.5 * A lower Friedman rank value indicates higher rating prediction accuracy. Dataset SGD-based LFA Adam-based LFA PLFA with Biases A2BAS PLFA SGDE-PLFA HPL Adam HPL TABLE III. COMPARISON RESULTS IN TIME COST ML10M ExtEpinion Flixster Douban 874 1152 451 1193 891 4331 3393 2064 157 369 91 340 115 1462 331 298 280 700 212 541 249 438 222 476 235 426 252 482 win the others on all the datasets. The Friedman test results are recorded in the last row of Table II. Both ADHPL and SGDE- PLFA's F-rank value equal to 1.5, which is much less than other models. 2) Comparison of computational efficiency From Table III, we summarize three conclusions of the ADHPL model's time cost: a) It costs much less than the SGD-based LFA and Adam-based LFA. For instance, the ADHPL costs only 482s on Douban, which is 59.6% lower than SGD-based LFA's 1193s, 76.65% lower than Adam-based LFA's 2064s. b) It costs about the same amount of time with other Swarm Intelligence-related LFA models, i.e., A2BAS-PLFA, HPL and SGDE-PLFA. Furthermore, they all cost considerably more time than PLFA model. The reason is that they all refine the latent factors after the PLFA model convergences. However, the extra time of about a hundred seconds is worthy for promoting the prediction accuracy. According to the above analysis, we conclude that the ADHPL model obtains superiority in terms of prediction accuracy, while convergences relatively fast. V. CONCLUSIONS This paper focuses on refining the latent factors with an Adam-enhanced HPL model. In this model, we design a base gradient with particle's velocity increment. With the proposed gradient, we propose an Adam-PSO algorithm, which can remain the characteristics of PSO w/o tunning PSO's hyper-parameters. Using this algorithm, we construct the ADHPL model to refine the latent factors sequentially with row and column sub-groups. The experimental results from four industrial datasets verify its high prediction accuracy. In future, we plan to investigate an ensemble model with various Swarm Intelligence-related LFA models, which can dynamically schedule these models considering various situations or datasets. REFERENCES [1] X. Luo, Z. Liu, L. Jin, Y. Zhou and M. Zhou, "Symmetric Nonnegative Matrix Factorization-Based Community Detection Models and Their Convergence Analysis," IEEE Transactions on Neural Networks and Learning Systems, vol. 33, no. 3, pp. 1203-1215, March 2022. [2] 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, vol. 34, no. 6, pp. 2525-2538, June 2022. [3] 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, vol. 15, no. 2, pp. 793-805, 1 March 2022. [4] X. Luo, Y. Zhou, ZG. Liu, and MC. 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. [5] X. Luo, H. Wu, and ZC. 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. [6] X. Luo, H. Wu, Z. Wang, JJ. Wang, and DY. Meng*, "A Novel Approach to Large-Scale Dynamically Weighted Directed Network Representation," IEEE Transactions on Pattern Analysis and Machine Intelligence, doi: 10.1109/TPAMI.2021.3132503. [7] 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, vol. 8, no. 2, pp. 420-431, 1 April 2022. [8] D. Wu, M. Shang, X. Luo and Z. Wang, "An L1-and-L2-Norm-Oriented Latent Factor Model for Recommender Systems," IEEE Transactions on Neural Networks and Learning Systems, doi: 10.1109/TNNLS.2021.3071392. J. Chen, Y. Yuan, R. Tao, J. Chen, T. R. and X. Luo, "Hyper-Parameter-Evolutionary Latent Factor Analysis for High-Dimensional and Sparse Data from Recommender Systems," Neurocomputing, vol. 421, pp. 316-328, Jan. 2021. [9] [10] D. Chen, S. Li, D. Wu and X. Luo, "New Disturbance Rejection Constraint for Redundant Robot Manipulators: An Optimization Perspective," IEEE Transactions on Industrial Informatics, vol. 16, no. 4, pp. 2221-2232, 2020. [11] H. Wu, X. Luo, and MC. Zhou. "Discovering Hidden Pattern in Large-scale Dynamically Weighted Directed Network via Latent Factorization of Tensors," In Proc. of the 17th IEEE Int. Conf. on Automation Science and Engineering (CASE 2021) (Regular), doi: 10.1109/CASE49439.2021.9551506. [12] X. Wang, Q. Kang, M. Zhou, L. Pan, A. Abusorrah, Multiscale Drift Detection Test to Enable Fast Learning in Non-stationary Environments, IEEE Transactions on Cybernetics, vol. 51, no. 7, pp. 3483-3495, Jul. 2021. [13] X. Luo, Z. You, S. Li, Y. Xia and H. Leung, "Improving Network Topology-Based Protein Interactome Mapping via Collaborative Filtering," Knowledge- Based Systems, vol. 90, pp. 23-32, 2015. [14] X. Luo, MC. Zhou, S. Li, Y. Xia, ZH. You, Q. Zhu, and H. Leung, "Incorporation of Efficient Second-order Solvers into Latent Factor Models for Accurate Prediction of Missing QoS Data," IEEE Transactions on Cybernetics, vol. 48, no. 4, pp. 1216-1228, 2017. [15] X. Luo, H. Wu, H. Yuan and M. Zhou, "Temporal pattern-aware QoS prediction via biased non-negative latent factorization of tensors," IEEE Transactions on Cybernetics, vol. 50, no. 5, pp. 1798-1809, 2019. [16] Q. Deng, Q. Kang, L. Zhang, M. Zhou, "An Objective Space-based Population Generation to Accelerate Evolutionary Algorithms for Large-scale Many- objective Optimization," IEEE Transactions on Evolutionary Computation, doi: 10.1109/TEVC.2022.3166815, 2022. [17] X. Luo, M. Shang and S. Li, "Efficient extraction of non-negative latent factors from high-dimensional and sparse matrices in industrial applications," IEEE 16th International Conference on Data Mining, vol. 51, pp. 311-319, 2016. [18] D. Wu, and X. Luo*, "Robust Latent Factor Analysis for Precise Representation of High-dimensional and Sparse Data," IEEE/CAA Journal of Automatica Sinica, vol. 8, no. 4, pp. 796-805, 2021. [19] H. Wu, X. Luo, MC. Zhou, "Advancing non-negative latent factorization of tensors with diversified regularizations," IEEE Transactions on Services Computing, vol. 15, no. 3, pp. 1334-1344, 1 May-June 2022. [20] Z. Liu, X. Luo, Z. Wang, "Convergence analysis of single latent factor-dependent, nonnegative, and multiplicative update-based nonnegative latent factor models," IEEE Transactions on Neural Networks and Learning Systems, vol. 32, no. 4, pp. 1737-1749, 2020. [21] M. Shang, Y. Yuan, X. Luo, MC. Zhou, "An α-β-divergence-generalized recommender for highly accurate predictions of missing user preferences," IEEE Transactions on Cybernetics, vol. 52, no. 8, pp. 8006-8018, Aug. 2022. [22] X. Luo, Y. Yuan, S. Chen, N. Zeng, and Z. Wang, "Position-Transitional Particle Swarm Optimization-incorporated Latent Factor Analysis," IEEE Transactions on Knowledge and Data Engineering, vol. 34, no. 8, pp. 3958-3970, 1 Aug. 2022. [23] L. Xin, Y. Yuan, M. Zhou, Z. Liu and M. Shang, "Non-negative latent factor model based on β-divergence for recommender systems," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 8, pp. 4612-4623, 2019. [24] 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, doi: 10.1109/TBDATA.2021.3090905. [25] J. Chen, R. Wang, D. Wu and X. Luo, "A Differential Evolution-Enhanced Position-Transitional Approach to Latent Factor Analysis," IEEE Transactions on Emerging Topics in Computational Intelligence, 2022, doi: 10.1109/TETCI.2022.3186673. [26] X. Luo, Z. Liu, S. Li, M. Shang and Z. Wang, "A Fast Non-Negative Latent Factor Model Based on Generalized Momentum Method," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 1, pp. 610-620, Jan. 2021. [27] X. Luo, M. Zhou, S. Li, M. Shang, "An inherently non‐negative latent factor model for high‐dimensional and sparse matrices from industrial applications". IEEE Transactions on Industrial Informatics, vol. 14, no. 5, pp. 2011‐2022, 2018. [28] X. Luo, Z. Wang and M. Shang, "An Instance-Frequency-Weighted Regularization Scheme for Non-Negative Latent Factor Analysis on High- Dimensional and Sparse Data," IEEE Transactions on Systems, [29] Man, and Cybernetics: Systems, vol. 51, no. 6, pp. 3522-3532, Jun. 2021. [30] H. Wu, X. Luo, M. Zhou, M. J. Rawa, K. Sedraoui and A. Albeshri, "A PID-incorporated Latent Factorization of Tensors Approach to Dynamically Weighted Directed Network Analysis," in IEEE/CAA Journal of Automatica Sinica, vol. 9, no. 3, pp. 533-546, March 2022. [31] D. Wu, Y. He, X. Luo, MC. Zhou, "A latent factor analysis-based approach to online sparse streaming feature selection," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 52, no. 11, pp. 6744-6758, Nov. 2022. [32] H. Wu, X. Luo, "Instance-Frequency-Weighted Regularized, Nonnegative and Adaptive Latent Factorization of Tensors for Dynamic QoS Analysis," In Proc. of the 2021 IEEE Int. Conf. on Web Services, doi: 10.1109/ICWS53863.2021.00077. [33] H. Wu, X. Luo and MC. Zhou, "Neural Latent Factorization of Tensors for Dynamically Weighted Directed Networks Analysis," In Proc. of the 2021 IEEE Int. Conf. on Systems, Man, and Cybernetics (SMC2021), doi: 10.1109/SMC52423.2021.9659145. [34] J.-A Konstan, B.-N. Miller, D. Maltz, J. L Herlocker, L.-R Gordon, and J. Riedl, "Grouplens: applying collaborative filtering to usenet news," Communications of the ACM, vol. 40, no. 3, pp. 77-87, 1997. [35] J. Mohsen, and E. Martin, "A Matrix Factorization Technique with Trust Propagation for Recommendation in Social Networks," in Proc. of the 4th ACM Conf. on Recommender Systems, Barcelona, Spain, 2010, pp. 135-142. [36] H. Ma, I. King, and M.-R Lyu, "Learning to Recommend with Social Trust Ensemble," in Proc. of the 32nd Int. ACM SIGIR Conf. on Research and Development in Information Retrieval, Boston, MA, USA, Jul. 2009, pp. 203-210. [37] P. Massa, and P. Avesani, "Trust-aware Recommender Systems," in Proc. of the 1st ACM Conf. on Recommender Systems, Minneapolis, MN, USA, Oct. 2007, pp. 17-24. [38] Y. Liu, J. Chen and D. Wu, "An Adam-adjusting-antennae BAS Algorithm for Latent Factor Analysis Refinement", arXiv e-prints, 2022.
http://arxiv.org/abs/2302.11954v1
2023-02-23T12:03:59
2023-02-23T12:03:59
A Dynamic-Neighbor Particle Swarm Optimizer for Accurate Latent Factor Analysis
High-Dimensional and Incomplete matrices, which usually contain a large amount of valuable latent information, can be well represented by a Latent Factor Analysis model. The performance of an LFA model heavily rely on its optimization process. Thereby, some prior studies employ the Particle Swarm Optimization to enhance an LFA model's optimization process. However, the particles within the swarm follow the static evolution paths and only share the global best information, which limits the particles' searching area to cause sub-optimum issue. To address this issue, this paper proposes a Dynamic-neighbor-cooperated Hierarchical PSO-enhanced LFA model with two-fold main ideas. First is the neighbor-cooperated strategy, which enhances the randomly chosen neighbor's velocity for particles' evolution. Second is the dynamic hyper-parameter tunning. Extensive experiments on two benchmark datasets are conducted to evaluate the proposed DHPL model. The results substantiate that DHPL achieves a higher accuracy without hyper-parameters tunning than the existing PSO-incorporated LFA models in representing an HDI matrix.
[ "Jia Chen", "Yixian Chun", "Yuanyi Liu", "Renyu Zhang", "Yang Hu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11954v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11954v1", "@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" ]
A Dynamic-Neighbor Particle Swarm Optimizers for Accurate Latent Factor Analysis Jia Chen School of Cyber Science and Technology, Beihang University Beijing, China [email protected] Yuanyi Liu School of Cyber Science and Technology, Beihang University Beijing, China [email protected] Xianchun Yi School of Cyber Science and Technology, Beihang University Beijing, China [email protected] Renyu Zhang* School of Cyber Science and Technology, Beihang University Beijing, China [email protected] Yang Hu* School of Cyber Science and Technology, Beihang University Beijing, China [email protected] Abstract-High-Dimensional and Incomplete (HDI) matrices, which usually contain a large amount of valuable latent information, can be well represented by a Latent Factor Analysis (LFA) model. The performance of an LFA model heavily rely on its optimization process. Thereby, some prior studies employ the Particle Swarm Optimization (PSO) to enhance an LFA model's optimization process. However, the particles within the swarm follow the static evolution paths and only share the global best information, which limits the particles' searching area to cause sub-optimum issue. To address this issue, this paper proposes a Dynamic-neighbor- cooperated Hierarchical PSO-enhanced LFA (DHPL) model with two-fold main ideas. First is the neighbor-cooperated strategy, which enhances the randomly chosen neighbor's velocity for particles' evolution. Second is the dynamic hyper-parameter tunning. Extensive experiments on two benchmark datasets are conducted to evaluate the proposed DHPL model. The results substantiate that DHPL achieves a higher accuracy without hyper-parameters tunning than the existing PSO-incorporated LFA models in representing an HDI matrix. Keywords-Latent Factor Analysis, Particle Swarm Optimization, High-dimensional and Incomplete Matrix, Dynamic Neighbor Cooperation. I. INTRODUCTION In recent years, a large amount of High-Dimensional and Incomplete (HDI) matrices are generated and accumulated rapidly by the network services, industrial applications, and big-data-related information systems[1-2]. These HDI matrices contain many unknown useful latent information, and their data are extremely incomplete. This means the HDI matrices are difficult to extract and analyze, while they are worthy to analyze[3-7]. How to extract the latent information from HDI matrices and analyze them accurately has become a popular research issue[8-11]. According to previous studies[12-21], the Latent Factor Analysis (LFA) model process the HDI matrices efficiently. An LFA model first maps two high-dimensional entities involved in the target HDI matrix to a low-dimensional latent factor space. Second, it adopts the latent factors to construct a low rank approximation of the HDI matrix and corresponding objective function to measure the error between the original HDI matrix and its approximation. Third, the optimization algorithm is used to approximate the optimal latent factors by minimizing the objective function. Previous research works have demonstrated that the stochastic gradient descent (SGD) algorithm can optimize the latent factors in an LFA model accurately[22-24]. Some classical algorithms are proposed to improve the learning rate self-adaption of SGD algorithm[25-28]. Duchi et al.[25] propose the AdaGrad algorithm to adjust the learning rate by calculating the sum squares of gradients. Zeiler et al.[26] propose the AdaDelta algorithm, which uses the decaying average of all past squared gradients to adjust the learning rate. García-Galán et al.[28] propose the Adam algorithm to adjust the learning rate with the exponentially decaying average and the exponentially decaying square average of past stochastic gradients. These algorithms can effectively optimize the latent factors adaptively via improving the SGD algorithm. However, these optimization process costs much more time for adjusting the learning rate at each iteration. To address this issue, Luo et al.[3] incorporates the classical Particle Swarm Optimization (PSO) algorithm into the optimization process of an LFA model. The PSO algorithm has been proven as an effective method in processing the large-scale data[29-31]. Luo et al. propose a position-transitional PSO-based LFA model, which uses the dynamic PSO algorithm to adjust the SGD's learning rate. To further improve accuracy of the PSO-based LFA model, Chen et al.[29] propose a hierarchical PSO-LFA (HPL) model, which refines the latent factors have been optimized by previous model with a newly proposed Mini-batch PSO (MPSO) algorithm and achieves higher accuracy. However, when the PSO algorithm refines the latent factors, each particle evolves following its particular path and only the global best information shares within the swarm. This work mechanism limits the particle swarm's searching area and causes the sub-optimum issue. This research is supported by the CAAIHuawei MindSpore Open Fund under Grant CAAIXSJLJJ-2021-035A. (Corresponding author: Y. Hu, R. Zhang) To expand the searching area and share more information among the particles, this work proposes a Dynamic-neighbor- cooperated Hierarchical PSO-enhanced LFA (DHPL) model, which improves the accuracy and self-adaption of an HPL model. The paper makes the following contributions: a) A neighbor-cooperated MPSO algorithm. The neighbor particle's velocities are randomly added into the MPSO's evolution, which injects the disturbance into the original particle update process. b) Adjust the hyper-parameters in the MPSO algorithm dynamically. Linearly decreasing inertia weight algorithm is adoptd to adjust hyper-parameters ω, γ1, and γ2 in MPSO. Empirical studies on two HDI matrices demonstrate that the proposed DHPL model outperforms the state-of-the-art LFA models. This paper is structured as follows. Section II gives the preliminaries. Section III shows the methods. Section IV provides and analyses the empirical results. Finally, section V summarizes the algorithm proposed and discusses future work. In this section, we first define the notations and formulas required in the paper. Then, we recall the fundamental models II. PRELIMINARIES adopted in the paper. A. Notation The notations used in this paper are listed in Table I below. B. Problem Setup 1) An HDI Matrix We use U and I to denote the large entity sets of users and items. Let us assume that R|U|×|I| represents a HDI matrix when |RΛ|≪|RΓ|. Given an entry ru,i denote the relationship value, where u∈U and i∈I. 2) An LFA Model We assume that R̂ =PQT denotes the estimation of low-dimensional latent factors for R. The latent feature matrices of U and I are defined by P|U|×f and Q|I|×f , respectively. Euclidean distance is the objective function to estimate the difference between R̂ and R. Furthermore, in order to improve its generalization ability and mitigate the magnitude effect, this work integrates a regularization term and linear bias. Therefore, an objective function is given as follow: where bu and ci represent linear biases for u and i, f represents the dimension of LF space, respectively [32, 33]. The regularization coefficient parameter is λ. According to (1), the latent factors {P, Q, b, c} are updated iteratively with SGD[34, 35] as follows: (1) (2) where m and (m-1) denote the m-th and (m-1)-th iteration, η represents the learning rate. Notation U, I u, i R, ru,i R̂ , r̂ u,i RΛ , RΓ P, pu,f pu Q,qf,i qi TABLE I. NOTATION MEANING AND DESCRIPTION Description Involved entity sets. An element of U and I. An |U|× |I| HDI matrix and its single element. R's rank-f approximation, and its single element. Known and unknown entry sets of R, and |RΛ|≪|RΓ|. An |U|×f latent factor matrix for U, and its single element. The u-th row vector of P. A f×|I| latent factor matrix for I, and its single element. The i-th row vector of Q. ,,2,,,R12222,,R111(,,,)()2(),2uiuifuiukkiuirkffukkiuirkkPQrpqbcpqbc====−−−++++bc,11,,,,11,,,,11,11,,(1,2,...,):(),(),(),(),uimmmukukuiukmmmkikiuikimmmuuuiummmiiuiirRkfpppqqqbbbccc−−−−−−−−=−=−=−=− b, bu c, ci f σ λ η V1, V2 yk(n), lk(n) l rd1(n), l rd2(n) yu k (n), lu k (n) yi k(n), l i k (n) k (n), qi pu k(n) k (n), q̇ i ṗu k(n) bu k (n), ci k(n) k (n), ċ i ḃ u k(n) K, k D, d γ1, γ2, γ3 r1, r2, r3 p̃k g̃ A vector of bias for U, and its u-th single element. A vector of bias for I, and its i-th single element. Dimension of the LF space. A generalized loss function defined on RΛ. A regulation parameter for SGD-based LFA model. A learning rate parameter for SGD-based LFA model. Two particle vector sub-spaces. V1 consists of latent factors in P and b, and V2 consists of latent factors in Q and c. The k-th particle's velocity, position at the n-th iteration. The k-th particle's position of neighbors at the n-th iteration. The k-th particle's velocity and position with the u-th parameter subset [pu,bu]⊂S1 at the n-th iteration. The k-th particle's velocity and position with the i-th parameter subset [qi,ci]⊂S2 at the t-th iteration. Position of k-th particle with pu in V1, qi in V2 at n-th iteration. Velocity of k-th particle with pu in V1, qi in V2 at n-th iteration. Position of k-th particle with bu in V1, with ci in V2 at the t-th iteration, respectively. Velocity of k-th particle with bu in V1, with ci in V2 at the t-th iteration, respectively. Max number of particles and its k-th single element. Dimension number of particles, and its d-th single element. Three acceleration coefficients for the PSO algorithm. Three uniform random parameters for PSO algorithm. Historical best position vector of the k-th particle. The best position vector in the particle swarm. Vectorization of P, Q. C. An HPL Model The HPL model contains a two-layer structure and focuses on the second refinement layer. The second layer uses the pre- trained latent factors as input and refines them to achieve the higher accuracy, which solves the problem of premature convergence efficiently. The refinement algorithm is a Mini-Batch PSO (MPSO) algorithm which refines all the latent factors sequentially. For each latent factor, a specific particle swarm is constructed and optimized. The swarm is firstly constructed by mapping latent factors in two sub-vectors, which are defined as follows: where V is the particle vector space. It is divided into two mini-batch sub-vectors V1 and V2, respectively. With (3), the MPSO constructs the |U| swarms containing K particles to optimize each sub-vector [pu, bu],∀u∈U, and |I| swarms with K particles to optimize each sub-vector [qi, ci], ∀i∈I, which are represented by the following equations: (3) (4-a) (4-b) k (n), ḃu where ṗu k-th particle of qi k(n) and ci The update equation can be denoted as: k (n) are the velocities of k-th particle of pu k (n) and bu k(n) at the t-th iteration. The specific yu k (n) at the t-th iteration. q̇ i k(n) are the velocities of k (n) are updated with the PSO algorithm independently. k(n) and ċi k (n) and lu (5) where p̃k is historical best position vector of k-th particle, and g̃ is the best position vector in the whole particle swarm. The following fitness function is used for yu k (n) and lu k (n): With (6), the historical best position p̃u k (n) and the global best position g̃(n) at the t-th iteration is updated. With the above process, the swarm evolution for each [pu, bu] or [qi, ci] continues independently till g̃(n) converges or the maximum iteration count reaches. Based on the MPSO algorithm, the HPL model refines the latent factors with considerable time cost. In this paper, we design the dynamic-neighbor-cooporated algorithm and incorporate it into the HPL model, then use the linearly decreasing inertia weight strategy to adjust the hyper-parameters in the HPL model. (6) ,PQ12,,,,,,,TTTTVPVPQVQ===bbcc(),,(),,uuuuuukkkkkknbnb==lpyp(),,(),,iiiiiikkkkkkncnc==lqyq()()()()()()()()()()()112211111,1,uuukkkkukuuukkknnrnnrnnnnn=−+−−−+−−−=−+yypygllly(),222,()1()+.22uiuuiuiuiuuruFrqbcb=−−−+pp III. PROPOSED APPROACH We propose a DHPL model, which incorporates the dynamic neighbor-cooperated MPSO algorithm and linearly decreasing inertia weight strategy into HPL. In this section, we focus on the dynamic neighbor-cooperated MPSO algorithm and linearly decreasing inertia weight strategy. A. A Dynamic Neighbor-Cooperated MPSO Algorithm In the standard PSO algorithm, each particle updates the current velocity and position based on its latest position and velocity, its historical best position, and the global best position in the particle swarm. A particle's current velocity and position don't only dependent on itself but is also influenced by the whole swarm. Inspired by the global information sharing strategy, we add the velocity information of neighbors into the velocity update formula of PSO algorithm. Use a specific row vector u as an example, the update formulas for each particle's current velocity and position are presented as below: (7) where lrd1(n) and lrd2(n) represent two randomly selected neighbors. We add their latest velocities into the velocity update formula. Thereby, the velocities of neighbors can be shared at each iteration and more global information are transfered to aovid the premature convergence at sub-optimum. Then, the particle's historical local best position is updated as follows: (8) The global best position can be updated after calculating all the particles' local best positions, which is formulated as: (9) Furthermore, each particle's velocity is limited in a proper range. Maximum and minimum values of the paticle's velocity are constrained as follows: (10) where βmax and βmin denote the upper and lower ratio of velocity. In our work, the above dynamic neighbor-coorperated PSO updated formulas are incorporated into the MPSO algorithm, thereby constructing the DHPL model. The newly proposed DHPL model adopts the following two fitness functions: (11-a) (11-b) where |∙|abs represents the absolute value of a given value. We adopt the (11-a) as the fitness function for evaluation protocol RMSE, and (11-b) as the fitness function for evaluation protocol MAE. B. Linearly decreasing inertia weight strategy The hyper-parameters in the MPSO algorithm are tunned manually, which can be updated with the proper algorithm. Because Shi et.al. has proven that the linearly decreasing weight strategy can promote the local earching ability [36]. We adopt the linearly decreasing weight strategy in our proposed DHPL model. We adjust the hyper-parameters with the linearly decreasing inertia weight strategy, which are formulated as: where ωmax and ωmin are the maximal and minimal values of the inertia weight parameters, G represents the maximum number of training iterations. γmax and γmin denote the maximal and minimal values of two acceleration coefficients. (12) ()()()11223312()(1)(1)(1)(1)(1)(1)(1),()(1)(),uuukkkkukrdrduuukkknnrnnrnnrnnnnn=−+−−−+−−−+−−−=−+yyplgllllly()()(),if ()(1),()(1),otherwise.uukkkkknFnFnnn−=−yyppp()()()=argmin().kknnFnpgpmaxmaxminmin(), ()(),()(), ()(),uuukkkukuuukkknifnnnnifnn=lylylyl(),2221,()()+,uiuiuiuiuurRuFrqbcb=−−−+pp(),2,()+,uiuiuiuiiirRuFrpbcc=−−−+qqmaxmaxmin1maxmaxmin2minmaxmin()/,()/,()/,nGnGnG=−−=−−=−− C. Algorithm Procedure and Time Cost analysis Based on the above analysis, we design the DHPL model. As shown in Algorithm 1, we calculate the time cost of each row vector in the dynamic neighbor-coorperated MPSO algorithm, which can be calculated as follows: (13) Thereby, the time cost of the dynamic neighbor-coorperated MPSO algorithm can be calculated as the M times of the optimization for each row vector and column vector, which can be calculated as follows: ALGORITHM: each row vector optimization Input: U, I, RΛ Operation Initialize: N = Maximum number of iterations Initialize: P|U|×f, Q|I|×f, b, c Initialize: λ, f, D = f + 1, K = Particle number for u to |U|: k , g̃u Initialize: p̃u Initialize: yk, lk while n ≤ N and not converge for k=1 to K for d=1 to D Computing yk, lk according to (7) end for for u=1 to |RΛ(U)| Computing F1(lu k) according to (11) end for if F1(lu p̃u end if if F1(lu k ) < F1(p̃u k ) < F1(g̃u) k = lu k k ) g̃u = lu k end if end for k end while [pu, bu] = g̃u end for Output: P|U|×f, b Cost Θ(1) Θ(|U|+|I|+f) Θ(1) ×|U| Θ(1) Θ(K×D) ×N ×K ×D Θ(1) -- ×RΛ(U) Θ(f) -- Θ(1) Θ(1) -- Θ(1) Θ(1) -- -- -- Θ(1) -- Based on (14), we have the time cost of the whole DHPL model as follows: (14) (15) where TPLFA and KPLFA represent the number of iterations and particles in PLFA model. From (15), it is obvious that the algorithm is linear in complexity and can be used in practice. Besides, its time cost is similar with the HPL model. The next section focuses on describing the experiments and analyzing the experimental results. IV. EXPERIMENTAL RESULTS AND ANALYSIS A. Experimental Settings Datasets. ML10M[37] and Flixster[38] are chosen as the experimental datasets. We adopt 70%-10%-20% train-validation- test settings. Evaluation Protocol. In this paper, we choose RMSE and MAE as our evaluation protocols. All experiments are performed on a MacBook pro with a 2.6 GHz Intel core CPU and 16 GB RAM. The formulas of RMSE and MAE are given as follows: where τ represents the testing set disjoint with the training and validation sets. Model Settings. We compared the DHPL model with various methods, including SGD-based LFA, Adam-based LFA, ()1.CRNKf=().DNCRNKfM=()(),DPLFAPLFADNPLFAPLFACCCRTKfRTKfM−=+=+(),,2,,,,ˆˆ,,uiuiuiuiuiuirRrRRMSErrMAErr=−=− (a) RMSE on ML10M (b) RMSE on Flixste Fig. 1. RMSE of DHPL as K increases. (a) MAE on ML10M (b) MAE on Flixster Fig. 2. MAE of DHPL as K increases. (a) Iterations on ML10M (b) Iterations on Flixster Fig.3. Converging iteration countS of DHPL as K increases. (a) Time Cost on ML10M (b) Time Cost on Flixster Fig. 4. Time cost of DHPL as K increases. PLFA with biases and HPL. In this work, we set the hyper-parameters of Adam and HPL as the values has been widely used in previous studies. The regularization coefficient λ is tuned for each dataset. B. Result comparison This sub-section compares the DHPL's performance with various swarm size, and the performance compared with other models. 1) Comparison of swarm size The Swarm size K influences the performance of DHPL. We perform a series of experiments to analyze the performance of the DHPL model with K∈{5, 10, 15, 20, 25, 30} on ML10M and Flixster. Fig. 1 and Fig. 2 depict DHPL's RMSE and MAE with various K, respectively. Fig. 3 and Fig. 4 depict the converging iteration counts with various K, respectively. For HPL and SGDE-PLFA, their involved PLFA model and the refinement process both converge with TABLE II. COMPARISON RESULTS IN RMSE/MAE, INCLUDING WIN/LOSS COUNTS STATISTIC AND FRIEDMAN TEST Dataset SGD-based LFA Adam-based LFA PLFA with Biases ML10M Flixster Win/Loss F-rank 0.7872/ 0.6069 0.9433/ 0.6653 2/0 5 0.7901/ 0.6087 0.9464/ 0.6661 2/0 4 0.7854/ 0.6044 0.8720/ 0.6512 2/0 3 HPL 0.7851/ 0.5998 0.8656/ 0.6394 2/0 2 TABLE III. COMPARISON RESULTS IN TIME COST Dataset ML10M Flixster SGD-based LFA Adam-based LFA PLFA with Biases 874 451 891 3393 157 91 HPL 249 222 DHPL 0.7845/ 0.6009 0.8613/ 0.6299 -- 1 DHPL 262 154 the same termination criterion as others, i.e., the error difference of two adjacent iterations is smaller than 10-4. From the results depicted from these figures, we conclude the following key findings: a) The accuracy of the DHPL model is insensitive to K. In Fig. 1, the standard deviations of DHPL's RMSE on ML10M and Flixster are 6.30E-5 and 4.82E-4, respectively. In Fig. 2, the standard deviations of DHPL's MAE on ML10M and Flixster are 2.96E-4 and 1.45E-4, respectively. b) The DHPL model convergencs fast. For instance, a DHPL model converges less than 8 iterations for RMSE with all the K values, which is depicted in Fig. 3(a). Obviously seen from Fig. 3(b), the DHPL model converges at 5 iterations with all the K values. c) Time cost varies linearly with the amount of K. For instance, when RMSE is chosen, on ML10M, the time cost increases linearly from 105.39 to 341.13 seconds with K increasing from 5 to 30. On Flixster, the similar situation can be observed from Fig. 4(b). Since the accuracy of DHPL is insensitive to K, and its CPU running time is linearly proportional to K, we select a small K value for the next experiments, i. e., five. 2) Model Performance Analysis This sub-section compares the performance of DHPL with all the involved models. The lowest RMSE/MAE and Friedman Rank are recorded in Table II. Time cost is recorded in Table III. According to the experimental results, we have the following findings: a) A DHPL model's prediction is higher than that of its peers. For instance, as shown in Table II, the RMSE with K=5 is 0.8613 on Flixster, which is 8.99% lower than Adam's 0.9464, 1.23% lower than PLFA's 0.8720, and 0.5% lower than HPL's 0.8656, respectively. Besides, the DHPL has the lowest F-rank value among its peers, which indicates it has the best prediction accuracy. b) A DHPL model's time cost is much lower than SGD-based model and Adam-based model, while its time cost is similar to HPL. Obviously seen from Table III, the proposed DHPL consumes 262 seconds on ML10M, which is about 5.22% higher than HPL's 249 seconds. While on Flixster, DHPL consumes 154 seconds to converge, which is about 30.63% lower than HPL's 222 seconds. Note that the PLFA model is the first layer of both HPL and DHPL, thereby its time cost is the lowest among the involved models. From the above analysis, we conclude that the DHPL model can achieve higher accuracy with a little more time. V. CONCLUSIONS In this work, we propose a Dynamic-neighbor-cooperated PSO-enhanced LFA (DHPL) model. This model has two characteristics. One is incorporating the velocities of two randomly selected neighbors into the MPSO's iterative optimization process, the other is adopting the linearly decreasing inertia weight strategy to tune the hyper-parameters. With these two innovative approaches, the proposed DHPL model can expand the searching area and share more information among the particles, which increases the accuracy effectively. Empirical studies on two HDI matrices demonstrate that the proposed DHPL model outperforms the state-of-the-art LFA models. In future, we will investigate the method of choosing the neighbors, discuss the influence on the number of neighbors, and incorporate some more state-of-the-art algorithms for tunning the hyper-parameters in DHPL model automatically. REFERENCES [1] 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, vol. 8, no. 2, pp. 402-411, 2021. [2] D. Chen, S. Li, D. Wu and X. Luo, "New disturbance rejection constraint for redundant robot manipulators: an optimization perspective," IEEE Transactions on Industrial Informatics, vol. 16, no. 4, pp. 2221-2232, 2020. [3] X. Luo, Y. Yuan, S. Chen, N. Zeng and Z. Wang, "Position-Transitional Particle Swarm Optimization-incorporated Latent Factor Analysis," IEEE Transactions on Knowledge and Data Engineering, doi: 10.1109/TKDE.2020.3033324. [4] S. Chou, J. Jang and Y. Yang, "Fast Tensor Factorization for Large-Scale Context-Aware Recommendation from Implicit Feedback," IEEE Transactions on Big Data, vol. 6, no. 1, pp. 201-208, March 2020. [5] X. Luo, M. Zhou, S. Li, D. Wu, Z. Liu and M. Shang, "Algorithms of Unconstrained Non-negative Latent Factor Analysis for Recommender Systems," IEEE Transactions on Big Data, vol. 7, no. 1, pp. 227-240, Mar. 2021. [6] 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 Systems, Man, and Cybernetics: Systems, vol. 51, no. 7, pp. 4285-4296, Jul. 2021. [7] X. Luo, D. Wang, M. Zhou and H. Yuan, "Latent Factor-Based Recommenders Relying on Extended Stochastic Gradient Descent Algorithms," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 2, pp. 916-926, Feb. 2021. [8] X. Luo, M. Shang and S. Li, "Efficient Extraction of Non-negative Latent Factors from High-Dimensional and Sparse Matrices in Industrial Applications," 2016 IEEE 16th International Conference on Data Mining, pp. 311-319, 2016. [9] X. Luo, Z. Wang and M. Shang, "An instance-frequency-weighted regularization scheme for non-negative latent factor analysis on high-dimensional and sparse data," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 6, pp. 3522-3532, 2021. [10] H. Wu, X. Luo and M. Zhou, "Advancing non-negative latent factorization of tensors with diversified regularizations schemes," IEEE Transactions on Services Computing, vol. 15, no. 3, pp. 1334-1344, 1 May-June 2022. [11] Z. Liu, X. Luo and Z. Wang, "Convergence analysis of single latent factor-dependent, nonnegative, and multiplicative update-based nonnegative latent factor models," IEEE Transactions on Neural Networks and Learning Systems, vol. 32, no. 4, pp. 1737-1749, Apr. 2021. [12] J. Chen, X. Luo and M. Zhou, "Accurate Latent Factor Analysis via Particle Swarm Optimizers," 2021 IEEE International Conference on Systems, Man, and Cybernetics, 2021, pp. 2930-2935, doi: 10.1109/SMC52423.2021.9659218. [13] X. Luo, M. Zhou, Z. Wang, Y. Xia and Q. Zhu, "An effective QoS estimating scheme via alternating direction method‐based matrix factorization," IEEE Transactions on Services Computing, vol. 12, no. 4, pp. 503‐518, Nov. 2019. [14] X. Luo, M. Zhou, S. Li and M. Shang, "An inherently non‐negative latent factor model for high‐dimensional and sparse matrices from industrial applications". IEEE Transactions on Industrial Informatics, vol. 14, no. 5, pp. 2011‐2022, 2018. [15] J. Wu, L. Chen, Y. Feng, Z. Zheng, M Zhou and Z. Wu, "Predicting quality of service for selection by neighborhood‐based collaborative filtering," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 43, no. 2, pp. 428‐439, 2013. [16] Y. Koren and R. Bell, "Advances in collaborative-filtering," Recommender Systems Handbook, F. Ricci, L. Rokach, B. Shapira, and P. B. Kantor, Eds. New York, USA: Springer, 2011, pp. 145-186. [17] 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, vol. 8, no. 2, pp. 402-411, Feb. 2021. [18] X. Luo, Z. Wang and M. Shang, "An Instance-Frequency-Weighted Regularization Scheme for Non-Negative Latent Factor Analysis on High- Dimensional and Sparse Data," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 6, pp. 3522-3532, Jun. 2021. [19] D. Wu, M. Shang, X. Luo and Y. He, "A data-characteristic-aware latent factor model for web service QoS prediction," IEEE Transactions on Knowledge and Data Engineering, 2020, doi: 10.1109/TKDE. 2020.3014302. [20] D. Wu, M. Shang, X. Luo and Z. Wang, "An L1-and-L2-Norm-Oriented Latent Factor Model for Recommender Systems," IEEE Transactions on Neural Networks and Learning Systems, doi: 10.1109/TNNLS.2021.3071392. [21] D. Wu, Q. He, X. Luo, M. Shang and G. Wang, "A posterior-neighborhood-regularized latent factor model for highly accurate web service QOS prediction," IEEE Transactions on Services Computing, doi: 10.1109/TCST.2019.2963017. [22] X. Luo, M. Zhou, S. Li, M. Shang, "An inherently non‐negative latent factor model for high‐dimensional and sparse matrices from industrial applications". IEEE Transactions on Industrial Informatics, vol. 14, no. 5, pp. 2011‐2022, 2018. [23] Y. Koren, R. Bell, and C. Volinsky, "Matrix factorization techniques for recommender systems," IEEE Computer, vol. 42, no. 8, pp. 30‐37, August 2009. [24] G. Takács, I. Pilászy, Bottyán Németh, and D. Tikky, "Scalable collaborative filtering approaches for large recommender systems," Journal of Machine Learning Research, vol. 10, pp. 623‐656, 2009. [25] J. Duchi, E. Hazan, and Y. Singer, "Adaptive subgradient methods for online learning and stochastic optimization," Journal of Machine Learning Research, vol. 12, no. 7, pp. 2121-2159, 2011. [26] M. Zeiler, "ADADELTA: An Adaptive Learning Rate Method," Computer Science, 2012. [27] D. Li, C. Chen, Q. Lv, H. Gu, T. Lu, L. Shang, N. Gu, and M. Stephen, "AdaError: An Adaptive Learning Rate Method for Matrix Approximation-based Collaborative Filtering," the 27th World Wide Web Conference, 2018, pp. 741-751. [28] S. García-Galán, R. Prado, and J. Expósito, "Swarm Fuzzy Systems: Knowledge Acquisition in Fuzzy Systems and Its Applications in Grid Computing," IEEE Transactions on Knowledge and Data Engineering, vol. 26, no. 7, pp. 1791-1804, 2014. [29] 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, doi: 10.1109/TBDATA.2021.3090905 [30] Q. Wang, S. Chen, and X. Luo, "An adaptive latent factor model via particle swarm optimization," Neurocomputing, vol. 369, pp. 176-184, Dec. 2019. [31] J. Chen, Y. Yuan, R. Tao, J. Chen, T. R. and X. Luo, "Hyper-parameter-evolutionary latent factor analysis for high-dimensional and sparse data from recommender systems," Neurocomputing, vol. 421, pp. 316-328, Jan. 2021. [32] X. Luo, Z. Liu, S. Li, M. Shang and Z. Wang, "A Fast Non-Negative Latent Factor Model Based on Generalized Momentum Method," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 1, pp. 610-620, Jan. 2021. [33] X. Luo, Y. Yuan, M. Zhou, Z. Liu and M. Shang, "Non-Negative Latent Factor Model Based on β-Divergence for Recommender Systems," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 8, pp. 4612-4623, Aug. 2021. [34] X. Luo, Y. Xia, Q. Zhu and Y. Li, "Boosting the K-Nearest-Neighborhood based incremental collaborative filtering," Knowledge-Based Systems, vol. 53, pp. 90-99, 2013. [35] X. Luo, H. Liu, G. Gou, Y. Xia and Q. Zhu, "A Parallel Matrix Factorization-Based Recommender by Alternating Stochastic Gradient Decent," Engineering Applications of Artificial Intelligence, vol. 25, no. 7, 2012. [36] Y. Shi and R. Eberhart, "Empirical study of particle swarm optimization," the 1999 Congress on Evolutionary Computation-CEC99, 1999, vol. 3, pp. 1945-1950. [37] J. Mohsen and E. Martin, "A matrix factorization technique with trust propagation for recommendation in social networks," the 4th ACM Conference on Recommender Systems, Barcelona, Spain, 2010, pp. 135‐142. [38] H. Ma, I. King, and M. Lyu, "Learning to recommend with social trust ensemble," the 32nd Int. ACM SIGIR Conference on Research and Development in Information Retrieval, Boston, MA, USA, Jul. 2009, pp. 203-210. [39] J. Demšar, "Statistical comparisons of classifiers over multiple data sets," Journal of Machine Learning Research, vol. 7, no. 4, pp. 1-30, Janurary 2006. [40] K. Gao, Z. Cao, L. Zhang, Z. Chen, Y. Han and Q. Pan, "A review on swarm intelligence and evolutionary algorithms for solving flexible job shop scheduling problems," IEEE/CAA Journal of Automatica Sinica, vol. 6, no. 4, pp. 875-887, Jul. 2019. [41] S. Gao, Y. Yu, Y. Wang, J. Wang, J. Cheng and M. Zhou, "Chaotic Local Search-Based Differential Evolution Algorithms for Optimization," IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 51, no. 6, pp. 3954-3967, Jun. 2021. [42] A. Khan, X. Cao, S. Li, V. Katsikis and L. Liao, "BAS-ADAM: an ADAM based approach to improve the performance of beetle antennae search optimizer," IEEE/CAA Journal of Automatica Sinica, vol. 7, no. 2, pp. 461-471, Mar. 2020. [43] Y. Cao, et al., "Comprehensive Learning Particle Swarm Optimization Algorithm with Local Search for Multimodal Functions," IEEE Transactions on Evolutionary Computation, vol. 23, no. 4, pp. 718-731, Aug. 2019. [44] W. Dong and M. Zhou, "Gaussian Classifier-Based Evolutionary Strategy for Multimodal Optimization," IEEE Transactions on Neural Networks and Learning Systems, vol. 25, no. 6, pp. 1200-1216, Jun. 2014. [45] G. Wei, Q. Wu and M. Zhou, "A Hybrid Probabilistic Multi objective Evolutionary Algorithm for Commercial Recommendation Systems," IEEE Transactions on Computational Social Systems, vol. 8, no. 3, pp. 589-598, Jun. 2021.
http://arxiv.org/abs/2302.11953v2
2023-03-21T18:38:10
2023-02-23T12:02:49
MFBE: Leveraging Multi-Field Information of FAQs for Efficient Dense Retrieval
In the domain of question-answering in NLP, the retrieval of Frequently Asked Questions (FAQ) is an important sub-area which is well researched and has been worked upon for many languages. Here, in response to a user query, a retrieval system typically returns the relevant FAQs from a knowledge-base. The efficacy of such a system depends on its ability to establish semantic match between the query and the FAQs in real-time. The task becomes challenging due to the inherent lexical gap between queries and FAQs, lack of sufficient context in FAQ titles, scarcity of labeled data and high retrieval latency. In this work, we propose a bi-encoder-based query-FAQ matching model that leverages multiple combinations of FAQ fields (like, question, answer, and category) both during model training and inference. Our proposed Multi-Field Bi-Encoder (MFBE) model benefits from the additional context resulting from multiple FAQ fields and performs well even with minimal labeled data. We empirically support this claim through experiments on proprietary as well as open-source public datasets in both unsupervised and supervised settings. Our model achieves around 27% and 20% better top-1 accuracy for the FAQ retrieval task on internal and open datasets, respectively over the best performing baseline.
[ "Debopriyo Banerjee", "Mausam Jain", "Ashish Kulkarni" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11953v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11953v2", "@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.LG" ]
3 2 0 2 r a M 1 2 ] R I . s c [ 2 v 3 5 9 1 1 . 2 0 3 2 : v i X r a MFBE: Leveraging Multi-Field Information of FAQs for Efficient Dense Retrieval Debopriyo Banerjee†, Mausam Jain†, Ashish Kulkarni Rakuten Institute of Technology, Rakuten India Enterprise Pvt. Ltd. {debopriyo.banerjee, mausam.jain, ashish.kulkarni}@rakuten.com Abstract. In the domain of question-answering in NLP, the retrieval of Frequently Asked Questions (FAQ) is an important sub-area which is well researched and has been worked upon for many languages. Here, in response to a user query, a retrieval system typically returns the relevant FAQs from a knowledge-base. The efficacy of such a system depends on its ability to establish semantic match between the query and the FAQs in real-time. The task becomes challenging due to the inherent lexical gap between queries and FAQs, lack of sufficient context in FAQ titles, scarcity of labeled data and high retrieval latency. In this work, we pro- pose a bi-encoder-based query-FAQ matching model that leverages mul- tiple combinations of FAQ fields (like, question, answer, and category) both during model training and inference. Our proposed Multi-Field Bi- Encoder (MFBE) model benefits from the additional context resulting from multiple FAQ fields and performs well even with minimal labeled data. We empirically support this claim through experiments on propri- etary as well as open-source public datasets in both unsupervised and supervised settings. Our model achieves around 27% and 23% better top-1 accuracy for the FAQ retrieval task on internal and open datasets, respectively over the best performing baseline. Keywords: Information Retrieval * FAQ Retrieval * Question-Answering * Multi-field * BERT * Bi-encoder. 1 Introduction Customer support (CS) is critical to any business and plays an important role in customer retention, new customer acquisition, branding, and in driving a better experience. In a typical online customer support setting, customers reach out with their queries and are attended to by human agents. This requires busi- nesses to hire and maintain a team of CS agents that scales as a function of the query volume and the productivity of agents that, in turn, translates to oper- ational cost for the business. Customer support automation [19] can help save on this operational cost by providing automated responses to queries and by improving support agent productivity. One of the ways businesses typically try † These authors contributed equally to this work 2 Banerjee, Jain, Kulkarni to achieve this is by automatically responding to customer queries from a repos- itory of frequently asked questions (FAQs), thereby, insulating human agents from high query volumes. The success of such a system, measured as the frac- tion of customer queries that it automatically responds to, then depends on the effectiveness of the user query to FAQ matching. Given a collection of FAQs where, each FAQ is a multi-field tuple (cid:104)Q, A, C(cid:105) of question Q, answer A, and question category C, the problem of FAQ retrieval [24,6,25,9] is to retrieve the top-k FAQs in response to a user query q. Similar to a typical retrieval problem, FAQ retrieval too suffers from the problem of lexical gap between a user query expressed in natural language and the corresponding matching FAQs. This is typically addressed by learning a relevance function between user queries and FAQs using labeled query-FAQ pairs for supervision. Unfortunately, such labeled data is often unavailable or scarce, especially in low- resource settings like Japanese query-FAQ retrieval, which is the domain of our interest. Curating large amounts of such labeled data through manual labeling is often expensive and requires domain knowledge for labeling. The main contributions of this paper are summarized as follows: – We propose a bi-encoder based retrieval model - MFBE that leverages multi- field information (question, answer and/or categories) in FAQs. – We use different combinations of user query and FAQ fields to create an extended set of pseudo-positive pairs for training. – We employ multiple FAQ representations during inference for query-FAQ scoring. 2 Related Work Question answering [16,10] task has been the area of interest in NLP community for a long time and shares the concepts of Information Retrieval (IR) where relevant information from a corpus of documents is retrieved in response to a search query. FAQ retrieval is an example of IR which is the focus of this work. Traditional retrieval methods [23,12] mainly depend on lexical features for the retrieval task which limits them to capture the semantics of the query. In order to address the challenge of lexical gap between user queries and answers, there is a body of work [3,17,29] that trains a semantic retrieval model from labeled data in the form of user queries and matching responses. In recent years, there has been an increasing research [8,14] on unsupervised learning techniques for text-encoder training eliminating the need for annotated data. They propose augmentation techniques based on paraphrases of input sentences to generate positive and negative samples for an anchor that are then used to train the retrieval model using a contrastive learning strategy [4]. The performance of FAQ retrieval task depends upon the (i) choice and design of model architecture and (ii) retrieval and re-ranking algorithms used. A combination of bi-encoder and cross-encoder is seen in [13,20], where the authors start with an unsupervised setting with zero labelled data. Then they iterate between bi-encoder and cross-encoder models generating more labelled MFBE 3 Fig. 1: Example of an FAQ in Japanese Language (JA). samples in each iteration. This gives a powerful text-encoder model along with annotated dataset. The retriever and the re-ranker can also be jointly trained with the goal of achieving mutual improvement [22]. Previous works [24,25,6] on FAQ retrieval problem focused on query-question (q-Q) similarity using BM25 [23] and query-answer (q-A) similarity using BERT [5], where the BERT model parameters are fine-tuned on FAQ question-answer (Q-A) pairs. Sakata et al. [24] (close to our work) employ a two-stage method where they first retrieve a set of FAQs based on q-Q similarity and then re-rank these based on q-A similarity to obtain the final list of top-k FAQs as response. Here, question (Q) and answer (A) are typically referred to as fields. Fields can vary depending upon the dataset. For example, Wikipedia page title, content, abstract, etc. have been considered as fields in [16]. Dutta et al. [6] propose a seq-2seq model for extracting keywords in user queries to identify the intent of a user query for better retrieval of relevant FAQs. Another close work by Assem et al. [2] uses two separate deep learning architectures. They first learn latent lexical relationships between FAQ questions and their paraphrases to generate top-k most relevant similar questions from the collection. These top-k candidates are then fed to an LSTM-based architecture that captures fine-grained differences in semantic context between FAQ questions and their paraphrases thereby improving the accuracy@1. Liu et al. [15] discuss the difficulty in determining the relevance of query-answer pairs due to their heterogeneity in terms of syntax and semantics and propose to use synthetic data for increasing the positive training examples. Tseng et al. [26] cites that existing methods fail to attend to the global information specifically about an FAQ task and propose a graph convolution network-based method to cater to all relations of question and words to generate richer embeddings. They also explore domain specific knowledge graphs for improving question and query representations. Some unsupervised sentence embedding methods that closely aligns with our work are [14] and [8], which are based on contrastive learning using augmentation techniques. Alternate representations of input sentences provide strong positives to the model. [11] is a self-supervised fine-tuning of BERT, which redesigned the contrastive learning objective to account for different views of the input sentence. 4 Banerjee, Jain, Kulkarni 3 FAQ Retrieval for User Queries FAQs are a pre-defined list of question-answer pairs available on web portals (e.g., banking, e-commerce, telecom, etc.) that help in addressing user queries without human intervention. In some cases, FAQs are also associated with some hierarchical categories or tags. Fig. 1 shows a sample FAQ that consists of ques- tion (or title), answer (or description) and hierarchical categories. In this paper, we mainly focus on improving the retrieval of FAQs conditioned on user queries using a neural text encoder [7]. In general, neural text encoders can be cate- gorized into two types: bi-encoders [18] and cross-encoders [28]. Bi-Encoder (BE): It consists of two encoder branches (with optional weight sharing), where two sentences Sa and Sb are independently passed through each branch, result- ing into two sentence embeddings fa and fb respectively. Their similarity can then be computed using a distance metric like cosine or dot-product of fa and fb. Cross-Encoder (CE): The two sentences are first concatenated and then passed through an encoder. The resulting embedding vector is input to a classification head that is typically implemented as a shallow feed forward network. Here, com- putation of similarity between the two input sentences is modelled as a binary classification task with 1 (0) indicating as similar (not similar). Generally, cross-encoders outperform bi-encoders in performance by lever- aging the mutual attention among all the words in the concatenated sentence, but they also suffer from high inference latency. The bi-encoder architecture is inherently suited for the FAQ retrieval task as it allows for pre-computation and indexing of sentence embeddings of the FAQs before-hand, which is not possible with cross-encoders. We introduce Multi-Field Bi-Encoders (MFBE) with the aim of improving the performance of bi-encoders for the FAQ retrieval task by leveraging additional context from FAQ titles, description and categories. In this section, we first explain the notations, followed by our proposed approach. Notations - Let F = {Fi}N i=1 be the set of FAQs, where each FAQ Fi consists of a 3-tuple (cid:104)Q, A, C(cid:105) of question (or title) Q, answer (or description) A and categories (or tags) C. We define M = {Q, A, QA, QC, CA, QCA} as the set of fields, where, each field m ∈ M is obtained by concatenating one or more of Q, A or/and C. Let Ms = {Q, QC} ⊂ M be a subset of fields present in M and Q be the set of all user queries. For a query q ∈ Q, let F and ̃F denote the matching and non-matching FAQs, respectively, such that (q, F ) forms a matching query FAQ pair and (q, ̃F ) corresponds to a non-matching pair. We denote the field m (or ms) of an FAQ as F m (or F ms ). For example, the field QA of an FAQ is denoted by F QA. In this case, for a query q, (q, F QA) and (q, ̃F QA) are the matching and non-matching query FAQ pairs. We denote the text encoder as E(*), which maps any text to a d-dimensional real-valued vector. For every FAQ field F m i ) = f m i and stack them in a matrix Tm, where row i in Tm corresponds to vector f m . For a query q the corresponding embedding i is computed as E(q) = fq. , we compute E(F m i MFBE 5 Fig. 2: Illustration of the working of MFBE model across different stages - training, pre-computation and inference. Proposed Approach - We propose to learn the relevance function rel(x, y; θ) (where x ∈ {q, F ms }; when x = q, then y ∈ ∪m∈M Fm, else y ∈ ∪m∈M \Ms F m) using a pre-trained neural language model [7] as the text encoder with θ as the model parameters. As shown in Fig. 2, MFBE consists of Language-agnostic BERT Sentence Embedding (LaBSE) [7] model as text encoder in two branches with shared weights. We compute the similarity between a query q and an FAQ field F m using the cosine-similarity, i.e., sim(q, F m) = cosineSim(fq, f m). As mentioned in [9], the similarity function should be decomposable and facilitate the pre-computation of representations of the FAQs. L2, inner product and cosine-similarity are some of the widely used similarity functions that are decomposable in nature. We choose cosine-similarity function, which is equivalent to inner product for normalized vectors. Training Stage - The goal is to learn a latent space following metric learning [27], where matching query and FAQ pairs shall have smaller distance compared to the non-matching pairs. Let Dtrain = {(xi, y+ i=1 be the train- ing data that consists of N instances, where each instance contains one query or an FAQ field xi ∈ {qi, F ms i ∈ ∪m∈M F m , i when xi = qi (or y+ ), along with n non- matching (negative) FAQ fields y− i,j. }, a matching (positive) FAQ field y+ i ∈ ∪m∈M \Ms F m i , when xi = F ms i,1, . . . , y− i,n)}N i , y− i i We employ the contrastive loss function (Eq. 1) for fine-tuning the parameters of the MFBE. L(xi, y+ i , y− i,1, . . . , y− i,n) = −log esim(xi,y+ i ) j esim(xi,y− i ) + (cid:80) i,j ) esim(xi,y+ (1) LaBSEPoolingContrastive LossTrainingDB (FAQ Embeddings)Pre-computationLaBSEPoolingLaBSELaBSEPoolingPoolingTop-k FAQsInference...Shared weightscached 6 Banerjee, Jain, Kulkarni We train three variants of unsupervised and supervised MFBE models - MFBEunsup, MFBEsup, and MFBEsup∗ . Triplets used for each variant are as follows: tripletsunsup = (cid:91) ms∈Ms {(F A, F ms, ̃F ms), (F ms, F A, ̃F ms)} tripletssup = (cid:91) m∈M {(q, F m, ̃F m), (F m, q, ̃F m)} tripletssup∗ = tripletsunsup ∪ tripletsup (2) (3) (4) Positive and Negative FAQs - In FAQ datasets, positive examples are explic- itly present from the manual annotation of query-FAQ, i.e., (q, F m) pairs. For boosting the number of training samples, we consider both the pairs (F Q, F A) and (F QC, F A) from an FAQ as proxy for (q, F m). But, negative examples are not explicitly present. However, the choice of negative samples play a decisive role in learning an effective text encoder. So, we consider Gold negatives [9], i.e., positive FAQs paired with other non-matching queries that appear in the train- ing set. In order to make the training computation more efficient, we make use of Gold FAQs from the same mini-batch as negatives, termed as in-batch neg- atives [9]. In addition, we consider one negative FAQ sample for each matching query-FAQ pair. Pre-computation of FAQ Embeddings - After training the text-encoder E(*), we use it to pre-compute and store Tm (Eq. 5) corresponding to the field m. We use the best performing field mbest ∈ M (Eq. 6), in terms of Acc (accuracy@1, Eq. 7), evaluated on the test set Dtest for the query-FAQ matching task. Tm = (cid:2)f m 1 f m 2 . . . f m N (cid:3)T where f m i = E(F m i ), for i = 1, 2, . . . , N . mbest = arg max m∈M Acc(Dtest) (5) (6) In Eq. 6, test set Dtest = {(q, F )|F ∈ F is a matching FAQ for query q ∈ Qtest}, where Qtest ⊂ Q. As each FAQ consists of different FAQ fields F m (∀m ∈ M ), we define Acc(*) as below. Acc(Dtest) = 1 |Qtest| (cid:88) q∈Qtest 1[{arg max i cosineSim(fq, f m i )} ∩ gt(q) (cid:54)= Φ] (7) Here, gt(q) denotes the set of FAQ indexes present in the ground truth labels corresponding to query q. Inference - During inference stage, for a given query q, we first compute the input query embedding fq. Then, we calculate cosine similarity scores of fq and row vectors of Tmbest (which are pre-computed embeddings of FAQs) and return the top-k candidates, sorted in descending order of their scores. MFBE 7 Table 1: Datasets used in this paper. For open datasets queries are separated into five folds. (JA=Japanese, EN=English) Type Name Language #FAQs #Queries #Avg. sentence length Train Test Query FAQ-Q FAQ-A Internal IDS1 IDS2 IDS3 IDS4 Open LocalGov Stack-FAQ COUGH JA JA JA JA JA EN EN 795 510 1129 661 1786 125 7115 1782 825 139 481 152 528 145 505 749 1249 1201 28.5 28.6 14.9 17.6 26.1 73.3 74.4 24.8 31.3 33.1 33.4 31.1 55.7 76.5 166.6 514.6 473.8 471.8 357.2 513.8 711.7 4 Experiments, Implementation and Results Datasets - We conduct experiments on both internal proprietary and open datasets. Table 1 shows the list of datasets and their details used in this work. Internal datasets - IDS1, IDS2, IDS3 and IDS4 are Japanese language com- pany internal datasets related to e-commerce, leisure, communication and pay- ment domains respectively. These are carefully prepared by majority voting by five native Japanese speakers across query-FAQ annotations. Open datasets - LocalGov, introduced in [24], is a Japanese language dataset which is constructed from Japanese administrative municipality domain. Stack- FAQ is described in [1] as an English language dataset prepared from threads in StackExchange website concerning web apps domain. COUGH is another English dataset [30] constructed by scraping data from 55 websites (like, CDC and WHO) containing user queries and FAQs about Covid-19. Implementation Details - We use single NVIDIA A100 GPU with 40G VRAM for all experiments. In all our experiments, we set maximum sequence length as 256 (for training and testing) and batch size as 32 which are constrained by the choice of GPU. For all datasets, the number of training epochs is set as 15. The choice of optimizer, learning rate and embedding dimension follows from [21] for all the experiments except for multi-domain fine-tuning experiments (Table 4 last 4 rows) where learning rate is set as 2e − 7. We set weight decay ω = 1e − 5 by employing grid search between 1e-1 and 1e-10 (reducing by 0.1x). For each matching query-FAQ pair, we consider 10 negative FAQs (i.e., n=10 after experimenting with other values, such as 5, 10, and 20). All our baseline experiments follow same settings as the proposed models and are initialized with LaBSE checkpoint†. Code and relevant material of this work can be found here†. Results and Discussion - We report accuracy@1 (Acc), mean reciprocal rank @5 (MRR) and normalized discounted cumulative gain @5 (NDCG) and compare our proposed models with multiple baselines, such as, BM25 (lexical † https://huggingface.co/sentence-transformers/LaBSE/tree/main † https://github.com/mausamsion/MFBE 8 Banerjee, Jain, Kulkarni Table 2: Results on internal datasets. IDS1 IDS2 IDS3 IDS4 Acc MRR NDCG Acc MRR NDCG Acc MRR NDCG Acc MRR NDCG 23.5 29.8 29.9 38.6 41.5 51.7 30.6 40.1 20.5 36.0 43.2 36.0 48.4 47.5 55.9 30.3 35.8 34.6 38.2 47.3 49.3 59.2 46.7 57.9 31.7 41.7 37.0 35.9 46.0 51.0 59.0 46.9 57.9 31.8 40.4 35.3 Model Baselines BM25 [23] LaBSE [7] DPR [9] Proposed 46.2 MFBEunsup 33.2 43.9 51.0 60.6 MFBEsup 62.4 59.2 66.4 66.8 MFBEsup∗ 51.1 60.3 44.7 60.4 71.3 58.1 55.1 61.2 69.8 43.8 51.3 59.7 57.9 67.8 52.8 57.9 68.9 53.9 43.3 51.0 61.7 64.1 72.2 54.9 65.5 74.9 57.8 Table 3: Results on open datasets. LocalGov Stack-FAQ COUGH Acc MRR NDCG Acc MRR NDCG Acc MRR NDCG 26.4 33.4 26.3 35.9 46.5 55.2 26.5 28.8 44.7 40.0 49.1 43.6 55.6 88.8 91.9 52.9 60.6 93.0 39.1 48.0 23.0 31.7 42.8 51.5 26.1 17.7 29.3 Model Baselines BM25 [23] LaBSE [7] DPR [9] Proposed 54.9 MFBEunsup 53.8 63.5 61.3 72.0 MFBEsup 64.8 62.9 72.3 65.7 MFBEsup∗ 85.9 91.0 92.8 98.0 98.8 99.0 98.5 96.5 98.0 46.0 57.7 35.5 53.1 65.2 40.3 37.7 50.1 61.0 feature-based IR model), LaBSE (heavy-weight dense multilingual text encoder), and DPR (dense bi-encoder with independently learned encoders). Across all baselines, we keep the train settings related to field combinations same as our MFBEsup∗ model. From Table 2, BM25 is the worst performing model, because of dependence on lexical features, hence fails to capture semantics among queries and FAQs. MFBEsup∗ outperforms all baselines across different datasets. In Ta- ble 3, we report 5-fold cross validation results. MFBEsup and MFBEsup∗ shows the best performance across all the baselines. MFBEunsup, which has zero query knowledge, performs better than DPR, which is the best performing baseline of all, in two datasets out of three. Table 5 illustrates sample input query and output top-1 prediction of DPR and MFBEunsup models where we see that DPR fails to capture the semantic meaning of the input thus returning irrelevant re- sponse. Cross-domain - Table 4 shows the cross-domain results of MFBEsup∗ where the model is trained on one dataset and evaluated on completely unknown ones (zero-shot setting). For example, the first row corresponds to the case where MFBEsup∗ is trained on IDS1 and evaluated on IDS2, IDS3, and IDS4. We observe that the zero-shot performance of MFBEsup∗ is the best, when trained on IDS1, compared to others. This is because IDS1 consists of a large number of labelled user queries (nearly 1.7k) in the train split. Multi-domain - Here MFBEsup∗ model is trained on all the internal datasets IDS[1-4] denoted as IDS∗. The average drop in Acc is only 4%, compared to the MFBE 9 Table 4: Results of cross- and multi-domain experiments using MFBEsup∗ model. Model IDS1 IDS2 IDS3 IDS4 Acc MRR NDCG Acc MRR NDCG Acc MRR NDCG Acc MRR NDCG - Cross-domain IDS1 IDS2 IDS3 IDS4 37.3 48.3 42.4 53.1 40.5 51.9 - - 50.3 55.5 54.3 47.5 62.2 - - 44.6 57.0 44.6 58.5 55.2 - 44.2 44.8 55.3 66.0 47.4 56.9 - - 50.0 61.4 53.0 39.2 - 46.1 53.1 65.7 48.3 58.3 57.2 63.6 - - 53.6 40.5 45.8 - Multi-domain IDS∗ 55.5 64.2 65.5 62.6 71.2 54.8 55.3 66.2 50.8 59.3 67.9 50.8 Cross and Multi-domain IDS∗ 65.2 55.0 64.0 1 IDS∗ 64.7 54.4 63.3 2 IDS∗ 65.1 54.8 63.8 3 IDS∗ 64.2 54.2 63.0 4 62.6 71.3 63.3 71.9 61.9 70.5 61.2 70.3 54.9 55.4 54.5 53.4 55.3 66.2 54.6 65.6 55.9 67.1 56.6 67.0 50.7 50.6 51.4 50.6 59.3 68.0 59.3 68.2 57.9 67.2 61.4 69.8 50.7 51.6 51.0 52.9 Table 5: Example input and outputs from COUGH (EN) and LocalGov (JA) datasets of two baseline models and our MFBEsup∗ model. In all the examples, MFBEsup∗ returns the most relevant response in top-1. Input Top FAQ (question) prediction DPR MFBEsup∗ Is personal protective equip- ment sufficient to protect oth- ers? How should i adjust my feeling during pendemic period? Are there exemptions to who has to wear a face covering? Are cloth face coverings the same as personal protective equipment (PPE)? I traveled and have been sick ever since I got back. What should I do? During this time, it is impor- tant to be S.M.A.R.T. about staying active 国民年金の納付書を誤って捨てて しまいました。 どうしたらいいで しょうか? 【児童手当現況届】間違って記入 した場合は、 どうしたらいいです か。 国民年金保険料を支払いたいので すが納付書をなくしてしまいまし た。 納税証明書が必要なのですが、 ど こで入手できますか? 介護保険料の納付書を紛失してし まった。 再交付してほしいのです が? 納税証明書(法人市民税、 事業所 税を除く)を取得したい。 last row of Table 2. The model trained on IDS∗ is more robust across multiple domains with better performance in some cases (e.g., IDS2), making it useful for leveraging cross-domain knowledge. Cross and Multi-domain - In this case, the model is first trained on IDS∗, then fine-tuned on one dataset, and finally evaluated on all datasets. For example, the sixth row corresponds to the case, where MFBEsup∗ is first trained on IDS∗, then fine-tuned on IDS1 (denoted as IDS∗ 1), and finally evaluated on all the datasets, i.e., IDS[1-4] (same for the last three rows). There is no significant change in performance when compared to results of fifth row because of prior exposure to the corresponding datasets. Ablation experiments - We train MFBEsup∗ , ∀m ∈ M (taking one at a time) and varying the number of labelled queries. In figure 3-(a) and (b) we show the performance of our model as FAQ field combinations are changed (which consis- 10 Banerjee, Jain, Kulkarni Fig. 3: Ablation experiments with MFBEsup∗ model. (a) Variation across multi-field combinations on internal datasets (b) Variation across multi-field combinations on open datasets (c) Variation in the number of training query-FAQ pairs tent at both training and testing). It is observed that using category information adds noise and degrades performance which can be due to the inefficient usage of this field. The category field has keywords and hierarchy which needs to be lever- aged but in this work, for simplicity, we concatenated these keywords to other input fields making it as a part of input string. The 'proposed' numbers are the best numbers across all of our proposed models (as discussed in Table 2 and 3). From figure 3-(c) it is observed that our MFBEsup∗ model is a good candidate for the scenarios where there is less annotated data with the accuracy flattening after around 300 query-FAQ pairs. This makes it suitable for bootstrapping to new domains where there are FAQ documents and no or less query-FAQ pairs. 5 Conclusion In this paper, we proposed MFBE, a bi-encoder based retrieval model that make use of information from multiple fields in FAQs to improve the text embedding quality and thus better sentence matching. We also create an extended set of pseudo-positive training pairs by using various combinations of user-query and FAQ fields. Then we use these multiple FAQ representations to make inference on input queries. Our model outperforms the baselines by 27% and 23% (in terms of accuracy@1) on internal and open-datasets, respectively. Cross-domain experiment results for the MFBEsup∗ model over our internal datasets shows the MFBE 11 potential of this kind of proposed approach to be useful in cold-start settings, which is common in real-world scenarios. Also, multi-domain experiment proves the possibility of multi-domain knowledge sharing using a single model which performs good across most of the datasets it is trained on. We also do ablation on semi-supervised setting (queries variation) and effect of FAQ field combinations. References 1. Paraphrase-focused learning to rank for domain-specific frequently asked questions retrieval. Expert Systems with Applications 91, 418–433 (2018) 2. Assem, H., Dutta, S., Burgin, E.: Dtafa: decoupled training architecture for efficient faq retrieval. In: Proc. of the 2021 Annual Meeting of the Special Interest Group on Discourse and Dialogue. pp. 423–430 3. Bian, N., Han, X., Chen, B., Sun, L.: Benchmarking knowledge-enhanced com- monsense question answering via knowledge-to-text transformation. In: Proc. of the 2021 AAAI Conf. on Artificial Intelligence. vol. 35, pp. 12574–12582 4. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for con- trastive learning of visual representations. In: Proc. of the 2020 Intl. Conf. on Machine Learning. pp. 1597–1607 5. Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: BERT: Pre-training of deep bidirectional transformers for language understanding. In: Proc. of the 2019 Conf. of the NAACL: HLT, Vol. 1 (Long and Short Papers) (2019) 6. Dutta, S., Assem, H., Burgin, E.: Sequence-to-sequence learning on keywords for efficient faq retrieval. arXiv preprint arXiv:2108.10019 (2021) 7. Feng, F., Yang, Y., Cer, D., Arivazhagan, N., Wang, W.: Language-agnostic BERT sentence embedding. In: Proc. of the 2022 Annual Meeting of the Association for Computational Linguistics. pp. 878–891 8. Gao, T., Yao, X., Chen, D.: SimCSE: Simple contrastive learning of sentence em- beddings. In: Proc. of the 2021 Conf. on Empirical Methods in Natural Language Processing. pp. 6894–6910 9. Karpukhin, V., Oguz, B., Min, S., Lewis, P., Wu, L., Edunov, S., Chen, D., Yih, W.t.: Dense passage retrieval for open-domain question answering. In: Proc. of the 2020 Conf. on Empirical Methods in NLP. pp. 6769–6781 10. Khattab, O., Potts, C., Zaharia, M.: Relevance-guided supervision for OpenQA with ColBERT. Transactions of the Assoc. for Computational Linguistics 9, 929– 944 (2021) 11. Kim, T., Yoo, K.M., Lee, S.g.: Self-guided contrastive learning for bert sentence representations. arXiv preprint arXiv:2106.07345 (2021) 12. Kuzi, S., Zhang, M., Li, C., Bendersky, M., Najork, M.: Leveraging semantic and lexical matching to improve the recall of document retrieval systems: A hybrid approach. ArXiv abs/2010.01195 (2020) 13. Liu, F., Jiao, Y., Massiah, J., Yilmaz, E., Havrylov, S.: Trans-encoder: Unsuper- vised sentence-pair modelling through self-and mutual-distillations. arXiv preprint arXiv:2109.13059 (2021) 14. Liu, F., Vulić, I., Korhonen, A., Collier, N.: Fast, effective, and self-supervised: Transforming masked language models into universal lexical and sentence encoders. In: Proc. of the 2021 Conf. on Empirical Methods in NLP. pp. 1442–1459 15. Liu, L., Wu, Q., Chen, G.: Improving dense faq retrieval with synthetic training. In: Proc. of the 7th IEEE Intl. Conf. on Network Intelligence and Digital Content. pp. 304–308 12 Banerjee, Jain, Kulkarni 16. Liu, Y., Hashimoto, K., Zhou, Y., Yavuz, S., Xiong, C., Yu, P.: Dense hierarchi- cal retrieval for open-domain question answering. In: Findings of the Assoc. for Computational Linguistics: EMNLP 2021. pp. 188–200 (2021) 17. Manzoor, A., Jannach, D.: Towards retrieval-based conversational recommenda- tion. CoRR abs/2109.02311 (2021) 18. Mazaré, P.E., Humeau, S., Raison, M., Bordes, A.: Training millions of personalized dialogue agents. arXiv preprint arXiv:1809.01984 (2018) 19. Mesquita, T., Martins, B., Almeida, M.: Dense template retrieval for customer support. In: Proc. of the 2022 Intl. Conf. on Computational Linguistics. pp. 1106– 1115 20. Qu, Y., Ding, Y., Liu, J., Liu, K., Ren, R., Zhao, W.X., Dong, D., Wu, H., Wang, H.: Rocketqa: An optimized training approach to dense passage retrieval for open- domain question answering. In: Proc. of the 2021 Conf. of the NAACL: HLT. pp. 5835–5847 21. Reimers, N., Gurevych, I.: Sentence-BERT: Sentence embeddings using Siamese BERT-networks. In: Proc. of the 2019 Conf. on Empirical Methods in NLP and the 9th Intl. Joint Conf. on NLP (EMNLP-IJCNLP). pp. 3982–3992 22. Ren, R., Qu, Y., Liu, J., Zhao, W.X., She, Q., Wu, H., Wang, H., Wen, J.R.: Rocketqav2: A joint training method for dense passage retrieval and passage re- ranking. In: Proc. of the 2021 Conf. on Empirical Methods in NLP. pp. 2825–2835 23. Robertson, S.E., Zaragoza, H.: The probabilistic relevance framework: BM25 and beyond. Found. Trends Inf. Retr. 3(4), 333–389 (2009) 24. Sakata, W., Shibata, T., Tanaka, R., Kurohashi, S.: Faq retrieval using query- question similarity and bert-based query-answer relevance. In: Proc. of the 2019 Intl. ACM SIGIR Conf. on Research and Development in Inf. Retr. pp. 1113–1116 25. Seo, J., Lee, T., Moon, H., Park, C., Eo, S., Aiyanyo, I.D., Park, K., So, A., Ahn, S., Park, J.: Dense-to-question and sparse-to-answer: Hybrid retriever system for industrial frequently asked questions. Mathematics 10(8) (2022) 26. Tseng, W.T., Wu, C.Y., Hsu, Y.C., Chen, B.: Faq retrieval using question-aware graph convolutional network and contextualized language model. In: Proc. of the 2021 Asia-Pacific Signal and Information Processing Association Annual Summit and Conference. pp. 2006–2012 27. Wohlwend, J., Elenberg, E.R., Altschul, S., Henry, S., Lei, T.: Metric learning for dynamic text classification. In: Proc. of the 2019 Workshop on Deep Learning Approaches for Low-Resource NLP. pp. 143–152 28. Wolf, T., Sanh, V., Chaumond, J., Delangue, C.: Transfertransfo: A transfer learning approach for neural network based conversational agents. arXiv preprint arXiv:1901.08149 (2019) 29. Yamada, I., Asai, A., Hajishirzi, H.: Efficient passage retrieval with hashing for open-domain question answering. CoRR abs/2106.00882 (2021) 30. Zhang, X.F., Sun, H., Yue, X., Lin, S., Sun, H.: COUGH: A challenge dataset and models for COVID-19 FAQ retrieval. In: Proc. of the 2021 Conf. on Empirical Methods in NLP. pp. 3759–3769
http://arxiv.org/abs/2302.11950v1
2023-02-23T12:00:15
2023-02-23T12:00:15
Evaluating the Efficacy of Skincare Product: A Realistic Short-Term Facial Pore Simulation
Simulating the effects of skincare products on face is a potential new way to communicate the efficacy of skincare products in skin diagnostics and product recommendations. Furthermore, such simulations enable one to anticipate his/her skin conditions and better manage skin health. However, there is a lack of effective simulations today. In this paper, we propose the first simulation model to reveal facial pore changes after using skincare products. Our simulation pipeline consists of 2 steps: training data establishment and facial pore simulation. To establish training data, we collect face images with various pore quality indexes from short-term (8-weeks) clinical studies. People often experience significant skin fluctuations (due to natural rhythms, external stressors, etc.,), which introduces large perturbations in clinical data. To address this problem, we propose a sliding window mechanism to clean data and select representative index(es) to represent facial pore changes. Facial pore simulation stage consists of 3 modules: UNet-based segmentation module to localize facial pores; regression module to predict time-dependent warping hyperparameters; and deformation module, taking warping hyperparameters and pore segmentation labels as inputs, to precisely deform pores accordingly. The proposed simulation is able to render realistic facial pore changes. And this work will pave the way for future research in facial skin simulation and skincare product developments.
[ "Ling Li", "Bandara Dissanayake", "Tatsuya Omotezako", "Yunjie Zhong", "Qing Zhang", "Rizhao Cai", "Qian Zheng", "Dennis Sng", "Weisi Lin", "Yufei Wang", "Alex C Kot" ]
10.2352/EI.2023.35.7.IMAGE-276
[ { "@title": "doi", "@href": "http://dx.doi.org/10.2352/EI.2023.35.7.IMAGE-276", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.11950v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11950v1", "@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" ]
Evaluating the Efficacy of Skincare Product: A Realistic Short- Term Facial Pore Simulation Ling Li1, Bandara Dissanayake2, Tatsuya Omotezako2, Yunjie Zhong1, Qing Zhang3, Rizhao Cai1, Qian Zheng4, Dennis Sng1, Weisi Lin1, Yufei Wang5, Alex C Kot1; 1 Nanyang Technological University, Singapore; 2 The Procter & Gamble Company; 3 East China Normal University, China; 4 Zhejiang University, China; 5 China-Singapore International Joint Research Institute, China 3 2 0 2 b e F 3 2 ] V C . s c [ 1 v 0 5 9 1 1 . 2 0 3 2 : v i X r a Abstract Simulating the effects of skincare products on face is a po- tential new way to communicate the efficacy of skincare products in skin diagnostics and product recommendations. Furthermore, such simulations enable one to anticipate his/her skin conditions and better manage skin health. However, there is a lack of ef- fective simulations today. In this paper, we propose the first sim- ulation model to reveal facial pore changes after using skincare products. Our simulation pipeline consists of 2 steps: training data establishment and facial pore simulation. To establish train- ing data, we collect face images with various pore quality indexes from short-term (8-weeks) clinical studies. People often experi- ence significant skin fluctuations (due to natural rhythms, exter- nal stressors, etc.,), which introduces large perturbations in clin- ical data. To address this problem, we propose a sliding window mechanism to clean data and select representative index(es) to represent facial pore changes. Facial pore simulation stage con- sists of 3 modules: UNet-based segmentation module to localize facial pores; regression module to predict time-dependent warp- ing hyperparameters; and deformation module, taking warping hyperparameters and pore segmentation labels as inputs, to pre- cisely deform pores accordingly. The proposed simulation is able to render realistic facial pore changes. And this work will pave the way for future research in facial skin simulation and skincare product developments. Introduction Consumers prefer smooth and flawless skin that makes them look youthful and healthy. Skin texture plays a key role in the perception of human facial beauty [1, 2]. However, skin texture can appear rough and bumpy when facial pores enlarge. There are various exogenous and endogenous factors, such as gender, race, aging, and hormones that cause enlarged facial pores. Higher ca- sual sebum levels in the nose and medial cheek area explain larger pores observed from these areas [3, 4]. Skincare products for pore care are widely available. Although there is a number of skin- care diagnostic and recommendation capabilities available, to our knowledge, there is a lack of effective simulations today that re- flect true facial pore transformation using available skincare prod- ucts. Therefore, this paper proposes a complete pipeline to sim- ulate the facial pore changes across a short-term period. Tem- poral analyses of changes in facial pores and simulation of these changes are helpful for the consumers to dynamically understand their skin and evaluate the potential benefit of skincare products. Such a realistic simulation not only guides customers to buy the right skincare products but also helps develop effective skincare technologies. Additionally, facial pore simulation can play a role, for example, in simulating the elongated effect of facial pores dur- ing the aging process. It enriches aging signs and contributes to the development of better aging models. A realistic short-term simulation of the efficacy of skincare products builds upon truthful clinical studies. Similar to [5], clin- ical studies were conducted on 60 young Japanese females to re- veal facial pore changes after applying specific skincare products A and B (in product code). The eMR Pro devices, designed for portable self-facial imaging with constant positioning and bright- ness [5], were provided for participants to capture side-face im- ages three times a day (morning after wake up; morning after face wash; and evening after face wash). Facial pore changes correlate with the initial skin condition, which varies among the 60 partic- ipants. Following [6], various indexes are used to evaluate facial pore condition and we observe large perturbations in the index values due to daily skin fluctuations [5]. Based on this complex clinical data, we expect first to select valuable index(es) that re- flect facial pore changes before and after using skincare products, regardless of different initial skin conditions. We further propose a sliding window mechanism to reduce the data perturbations ef- ficiently and get the data ready for training. Our next step is to perform a facial pore simulation. To real- istically simulate changes in facial pores while maintaining image fidelity, we need to pay attention to three aspects: morphological modification of all facial pores, precise control of the modifica- tion to reflect the real changes, and the non-pore areas remain- ing unchanged. Nowadays, GAN-based architectures [7, 8, 9] are famous for generating high-quality images. However, these methods have limitations in maintaining non-pore facial region features. And the facial pore transformations after using skincare products correlate with the initial condition, which is also chal- lenging for GAN-based methods to capture such changes. From Figure 1, we can see that GAN-based architecture is weak at sim- ulating the detailed variation of facial pores (blurring effect in the cheek area) and maintaining the non-pore facial features. To address the above-mentioned challenges, we propose a facial pore simulation model that consists of three modules: seg- mentation module, regression module, and deformation module. The segmentation module is to provide accurate spatial informa- tion by detecting and localizing visible and enlarged facial pores. Existing pore detection works [6, 10, 11, 12, 13, 14] take tradi- tional approaches: setting threshold values carefully to segment facial pore features. Clinical imaging devices, such as, Visia-CR [6, 12] and Dermascore [11] are used to capture high-resolution images at the same time to control lighting conditions and posture. [10, 11, 12, 13, 14] are also limited to processing only small skin regions instead of full faces due to the threshold mechanism. By contrast, our UNet-based segmentation model is trained to learn robust facial pore features and to detect visible and enlarged pores in full side-face images. Our data-driven model detects pores with different sizes & shapes, and it can handle images with different lighting to a certain extent. In parallel, a random forest regres- sion model is expected to learn the pattern of facial pore changes over time from the training data and to further predict the time- dependent warping hyperparameter. The warping hyperparame- ter is to control the degree of facial pore deformation. Lastly, in the deformation module, the local scaling warp method [33] is modified to calculate a flow-field grid with taking pore segmenta- tion labels and warping hyperparameters as inputs. The flow-field grid assures that only facial pores are deformed, leaving the non- pore facial region unchanged. The original input image is then deformed accordingly to simulate facial pore changes after using specific skincare products. To summarize, the contributions of this work are as follows: • We propose a suite of customized analytical tools to process complex facial pore clinical data. We demonstrate that the sliding window mechanism helps clean the data by reducing perturbations due to significant skin fluctuations. • We propose a facial pore simulation that consists of three modules: segmentation module, regression module, and de- formation module. We show that by incorporating facial pore segmentation labels and predicted warping hyperpa- rameters, the deformation module can precisely deform fa- cial pores with accurate control, while leaving the rest of the face unchanged. • We propose a complete simulation pipeline that has two steps: training data establishment and facial pore sim- ulation. Our results show that the simulation produces high-quality images which demonstrate realistic facial pore changes over time. Related Work Facial Pore detection Facial pore detection is a challenging task as facial pores are delicate with different shapes (circular or elongated) [12, 18] & sizes (from 50 μm to 500 μm) [16]. It requires images to be sharp enough to contain pore-level features. Existing works [6, 11, 12, 13, 14, 15, 18, 19] require professional equipment to capture high-quality facial skin in a fixed pose under consistent light. [17, 19] only output the overall grading of facial pores. Tra- ditional approaches are mainly used to detect facial pores: mark pores on melanin layers derived from digital images [16, 20]; us- ing the difference of Gaussian (DoG) filters [6]; based on Fast fuzzy c-mean algorithm [14]. However, these methods are con- strained to work on skin patches, and often perform poorly on images with varied lighting. Our proposed UNet-based model is capable of detecting skin pores on full side-face images with sat- isfactory performance and addresses different lighting problems. Figure 1: Sample results using a GAN-based method. Face Simulation Existing GAN-based works [21, 22, 23, 24, 25, 26] focus on simulating the human face aging process. For instance, facial at- tributes are used to guide wavelet-based GANs [24] to simulate aging effect. [25] learns about people's age progression by un- raveling subject-specific features and age-specific effects. Triple- GAN [26] proposes to learn the interrelationships between differ- ent age groups. Aging simulation is at a larger scale than simulat- ing skin changes. To the best of our knowledge, no work has been done to simulate the efficacy of skincare products on the face. Methodology Training Data Establishment 8-week clinical studies have been conducted on 60 young Japanese females from 22 to 34 years old: they used product A and/or B on the left/right side of their faces. Participants used eMR Pro devices [5] connected to smartphones to capture side- face images three times a day: morning after wake-up; morning after face wash; evening after face wash. Various pore statistics were measured using the method from [6]: pore count; total pore area; mean pore area; pore shape; orientation; mean L*/a*/b*- channel value in CIELAB color space. [5] examines the notice- able fluctuations in the skin that people experience every day, es- pecially with facial pores. We use similar approaches from [5] to analyze these measured indexes while focusing on the 4-week observation period with applying products A and B. Our dataset consists of 12,531 images in total, and participants have different initial skin conditions with diverse pore size scales (from grade 0 to grade 5) [18]. To observe the facial pore changes among participants equally, we first normalize index value for every par- ticipant. On each observation day, a mean value of each index is computed to represent facial pore condition among the group. This averaging operation is designed to consider the different ini- tial skin conditions of 60 participants. Linear regression analysis is then conducted to study index patterns before and after using skincare products. Valuable index(es) are to be selected to repre- sent facial pore changes. Considering people have different de- grees of skin fluctuation across days, we propose a n-day sliding window mechanism to reduce the data perturbations: gradually group n-day values in 1-day steps and then remove extreme val- ues by the n-day mean and standard deviation. In addition, we observe that facial pore changes are developed slowly over the 4- week period of using skincare products, and we propose to split the 4-week observational duration into 3 discrete time windows to investigate skincare efficacy. The cleaned dataset contains 3,025 images and each participant has multiple sets of images to reflect their facial pore changes across time windows, which is used as the training set to develop a facial pore simulation model. GAN-based modelInput Figure 2: Pore Area total index analysis. Facial Pore Simulation UNet-based Facial Pore Segmentation Pore segmentation labels lay the foundation for developing a good simulation of facial pore changes. In contrast with exist- ing threshold-based traditional works [6, 10, 11, 12, 13, 14], we propose a deep learning-based data-driven model to detect visible and enlarged facial pores on side-face images captured by smart- phones. We use 9,506 out of 12,531 images as the segmentation training set. It is time-consuming and labor-intensive if we were to manually annotate facial pores. Additionally, the simulation does not require exhaustive detection of facial pores. Hence, we propose a new approach to generate satisfactory labels to improve productivity. Inspired by [31], we use the Photocopy filter to ex- tract facial details and then apply various post-processing opera- tions to reduce excessive noise: morphological dilation and ero- sion; setting thresholds for pore area, size [16], and shape [12, 18]. Lastly, the pore segmentation labels were manually checked and the necessary refinements were made. Witnessing the outstanding performance of UNet-based ar- chitectures in medical image segmentation, we train a pore seg- mentation model on 9,506 images using UNet [32] architecture. By measuring the similarity between the predicted segmentation label and the true segmentation label, the loss function penalizes the model to learn in the optimal direction. We add cross entropy loss and F1 score to form our loss function: L = Cross Entropy + F1 Score. (1) Our selfie images are captured at 1920 x 1080 pixels. To avoid large memory overhead over training, images are cropped into patches with size of 256 x 256 with batch size of 24. RMSProp optimization algorithm is used with learning rate = 1e-5, weight decay = 1e-8, and momentum = 0.9. Random Forest Regression The regression module is to build up the relationship be- tween the selected index and time window statistically. Our data indicate that participants experience different facial pore transfor- mations with varied initial skin conditions, making it challenging to build an appropriate regression model. In addition, our data are considerably large in size. Therefore, we exploit Random Forest [28] as our regression model. Random Forest consists of a forest Figure 3: Qualitative results of Facial Pore Segmentation models. of classifying decision trees: it selects a subset of data randomly over training at each split and efficiently improves accuracy and controls over-fitting by using average values based on all aggre- gations [29, 30]. Facial Pore Deformation Local scaling warp from [33] creates the possibility for pre- cise manipulation. It achieves pixel-wisely manipulation by map- ping points from input space to warping space without changing the colors, and the mapping is computed by: (cid:32) fs(r) = 1 − (cid:19)2 − 1 (cid:33) a r. (cid:18) r rmax (2) One minimum enclosing circle is found for each detected pore and the radius of each enclosing circle is rmax. Variable r mea- sures the distance between the target pixel and the center of the enclosing circle, and parameter a controls the degree of deforma- tion. Instead of implementing this method in an interactive man- ner, a well-fit random forest regression model is trained to pre- dict parameter a. Based on Equation 2, mappings for all detected pores are gathered to compute a flow-field grid. Each size-2 vec- tor in the flow-field grid is used to interpolate the corresponding output value. The bilinear interpolation method is used here and border values are used for out-of-bound grid locations. The face deformation operation is also optimized and it takes only about 5-10 seconds to manipulate one full side-face image of size 1920 x 1080. Results Our complete simulation pipeline consists of 2 stages: train- ing data establishment and facial pore simulation. First, we show the analytical patterns of facial skin quality indexes over time. Next, we present the evaluation for facial pore segmentation, ran- dom regression, and facial pore simulation. Training Data Establishment Various indexes were measured in digital images. People's skin fluctuates a lot within a day and/or from day to day, and we can observe large data perturbations in pore quality index val- ues. After careful analysis of the statistics, we observe that index BaselineperiodObservation periodBaselineperiodObservation periodMorning after wake-upNormalized Index valueEvening after face washBaselineperiodObservation periodBaselineperiodObservation periodDayBaselineperiodObservation periodBaselineperiodObservation periodBaselineperiodObservation periodBaselineperiodObservation periodBaselineperiodObservation periodDayDayDayDayDayDayDayDayDayMorning after face washMorning after wake-upEvening after face washMorning after face washMorning after wake-upEvening after face washNormalized Index valueNormalized Index valueNormalized Index valueNormalized Index valueNormalized Index valueNormalized Index valueNormalized Index valueNormalized Index valueMorning after face washNoSlidingWindow3-day SlidingWindow5-day SlidingWindowUNet-basedDoG- basedInput Figure 4: Qualitative result of Facial Pore Simulation. Pore Area total demonstrates a jittery decreasing pattern across 3 time windows (shown in the first column in Figure 2), and this pattern is consistent with the visual analysis by domain experts. Index Pore Area total is then selected as the representative index to reflect facial pore changes after skincare. With implementing the sliding window mechanism in the observation period, outliers are removed, and the data display fewer perturbations (shown in the second and third columns of Figure 2). The 3-day slid- ing window mechanism retains most data and it is then utilized to clean the data. After splitting the 4 observation week into 3 time windows, we further investigate the changes in value of in- dex Pore Area total. The box plot also shows a jittery decreasing pattern in Figure 2, and it supports our observation. Table 1: Qualitative Evaluation in Face Pore Segmentation Metrics Dice IoU Precision Accuracy UNet-based 0.6663 0.5139 0.6790 0.9936 DoG-based 0.4418 0.2851 0.4388 0.9896 Facial Pore Simulation UNet-based Facial Pore Segmentation A test set of 30 images is manually annotated for quantita- tive evaluation of facial pore segmentation. These test images are carefully selected from the cleaned facial pore simulation train- ing set (consisting of 3,025 images), which considers different facial pore conditions and lighting conditions. As existing works are implemented in traditional threshold-based methods, we only compare our UNet-based pore segmentation model with the DoG- based method [6]. Multiple standard metric results in Table 1 show that the UNet-based segmentation model outperforms the DoG-based methods by a large margin. Figure 3 shows the visual comparison and we can conclude that our UNet-based segmenta- tion model is capable of segmenting facial pores of different sizes and shapes. The model is also performing well in facial cheek area where we can observe specular effect in the first two input images in Figure 3. Random Forest Regression Random forest regression is trained to learn the relationship between metric Pore Area total and time windows. R2 Score and Mean Average Error (MAE) are utilized here to evaluate regres- sion performance. The results in Table 2 show the random forest regression model fits well with low error. Table 2: Random Forest Regression Analysis Metrics R2 Score MAE Time Window 1 0.9905 0.6344±2.20 Time Window 2 0.9941 0.6039±1.85 Time Window 3 0.9564 1.3498±5.12 Table 3: Quantitative Evaluation on Simulation Image Quality Metrics PIQE NIQE Simulation images 11.86 3.41 Facial Pore Deformation As we have discussed previously, existing face simulation methods focus on age regression and their evaluation metrics are not applicable here. Similar to image super-resolution [34, 35], face image quality is a significant factor to develop a high-quality simulation system. In our dataset, side-face images are inevitably misaligned even with using the eMR Pro devices [5]. In addition, image registration methods do not work well for side-face images. Therefore, we use No-Reference Image Quality Assessment (NR- IQA) for evaluation: NIQE [36] and PIQE [37]. The detailed re- sults in Table 3 indicate the high quality of the simulated images. In Figure 4, we show qualitative results of our model simulating the facial pore changes of 3 subjects after using skincare prod- ucts. For each subject, the leftmost image shows the condition of his skin before using skin care products. Real images shown in the top row demonstrate his real skin condition after 10/20/30 days of skincare. Correspondingly, the bottom row presents the simulated skin condition of the facial pores for each time window (TW10, TW20, TW30). As can be seen, our model captures the delicate facial pore changes across the three time windows and modifies the input image to reflect realistically his facial pore changes over time. We can also observe that the model only modifies facial pore appearance while leaving other facial features unchanged, as shown in Figure 4. Perception Study We further conduct a perception study to evaluate our UNet- based segmentation model and facial pore simulation model. To be fair, we selected 40 images of facial pore segmentation results with diverse pore conditions under different light conditions. Sim- ilarly, 20 sets of simulation images were prepared. We invited 30 respondents to this study: 15 women and 15 men, from ethnicity: Chinese and Indian. From the age range graph in Figure 5, we can see that more than 90% of the respon- Subject ASubject BSubject CTime Window:TW10TW20TW30TW10TW20TW30TW10TW20TW30 Figure 5: Meta information of respondents. Figure 6: Respondents' Score on Facial Pore Segmentation. Figure 7: Respondents' Score on Facial Pore Simulation. dents are in their 20s, which is consistent with the young Japanese participants in our clinical studies. In addition, we asked the re- spondents to carefully self-assess their facial pore status with ref- erence to a clinical standardized scale of pore size from [18]. The pore size scale pie chart in Figure 5 shows that the facial pore sta- tus is diverse among the 30 respondents, which shares a similar distribution to our clinical study. Facial Pore Segmentation Respondents were to ask 3 questions when observing 40 pore segmentation results: * Q1: How do you observe the overall detection results? (Choose one: Very Good; Good; Bad) * Q2: Are there any incorrectly detected pores? (Choose one: A few; Moderate; Many) * Q3: Overall, how does the algorithm perform? (Choose one: Very Good; Good; Fair; Poor; Very Poor) The first and second questions are to evaluate the perfor- mance of the UNet-based pore segmentation model in terms of false negative and false positive respectively. Respondents an- swered Q1 and Q2 for each image and grade the overall perfor- mance in Q3 after viewing 40 images. As shown in Figure 6, 95% of the responses show satisfaction with our pore detection results (54% Very Good; 41% Good; and 5% Bad). In Q2, 60% of re- sponses indicate there are a few false positives in segmentation results and 35% indicate a moderate number of false positives. Overall, more than 75% of the respondents feel good or very good at facial pore segmentation, with no negative comments. Facial Pore Simulation Our simulation progressively predicts facial pore changes at each time window. Respondents were invited to answer 3 ques- tions by seeing 20 sets of images to evaluate each time window as well as the entire process. * Q1: Do the simulated images conform with the real im- ages at TW10 (i.e., Time Window of 10-day using skin- care)/TW20/TW30? (Choose one: Very Similar; Similar; Different) * Q2: Are you satisfied with the simulation of facial pore changes over time? (Choose one: Very Satisfied; Satisfied; Ambiguous; Unsatisfied; Very unsatisfied) * Q3: Overall, how does the simulation perform? (Choose one: Very Good; Good; Fair; Poor; Very Poor) In Q1, respondents compared real and simulated images at each time window and scored their similarity in terms of facial pore condition only. And Q2 focused on whether the simulation model captured the pattern of facial pore changes across time. Respondents then graded the overall performance after viewing 20 sets of images in Q3. Figure 7 shows that more than 90% of the responses vote that the simulated images are similar or very similar to the real images at each time window. Over 80% of re- spondents rate the simulated facial pore changes as satisfied or very satisfied by looking at the 1-month duration. The bottom plot from Figure 7 shows that 90% of the respondents (27 per- sons) perceive that this simulation faithfully reflected the facial pore changes over 4 weeks of skincare use. Conclusion In this paper, we present a realistic short-term facial pore simulation model to evaluate the efficacy of skincare products. We demonstrate that the sliding window mechanism is useful in reducing data perturbations caused by daily fluctuations in skin. The complex facial pore clinical data is then reorganized and pre- pared for training. Moreover, to achieve a realistic simulation on facial pores while maintaining image fidelity (i.e., the non-pore facial areas remain unchanged), we propose a facial pore sim- ulation that precisely localizes visible and enlarged facial pores and further modify facial pores morphologically to reflect facial pore changes after applying skincare product over a short-term. Our method delivers promising results for facial pore segmenta- tion and facial pore simulation. Acknowledgements This work was carried out at the Rapid-Rich Object Search (ROSE) Lab, Nanyang Technological University (NTU), Singa- pore. The research is supported in part by A*STAR under it's A*STAR MBRC Strategic Positioning Fund (SPF) – A*STAR- P&G Collaboration (Award APG2013/113) and in part by China- Singapore International Joint Research Institute under Grant 206- A018001. Any opinions, findings and conclusions or recommen- dations expressed in this material are those of the author(s) and do not reflect the views of the A*STAR. 50%,Male, 15 pax50%, Female, 15 paxGenderFemaleMaleGrade 04pax13.33%Grade 111pax36.67%Grade 27pax23.33%Grade 36pax20.00%Grade 41pax3.33%Grade 51pax3.33%Respondents Pore Size Scale Grade 0Grade 1Grade 2Grade 3Grade 4Grade 510pax18pax1pax1pax0.00%10.00%20.00%30.00%40.00%50.00%60.00%70.00%20-2425-2930-3435-39Number of RespondentAge ScopeAge Range0.00%0.00%16.67%73.33%3.33%0.00%10.00%20.00%30.00%40.00%50.00%60.00%70.00%80.00%Very poorPoorFairGoodVery goodQuestion 3: Overall, how does the algorithm perform?Bad5%Good41%Very good54%Question 1: How do you observe the overall detection result?BadGoodVery goodMany5%Moderate35%A few60%Question 2: Are there any incorrectly detected pores?ManyModerateA few0.00%0.00%10.00%73.33%16.67%0.00%10.00%20.00%30.00%40.00%50.00%60.00%70.00%80.00%Very poorPoorFairGoodVery goodQuestion 3: Overall, How does the simulation perform?71.33%57.17%51.17%24.83%36.33%42.00%3.83%6.50%6.83%0%20%40%60%80%100%TW10TW20TW30Question 1: Do the simulated image conform with the real image at TW10 / TW20 / TW30? Very similarSimilarDifferentVery unsatisfied1%Unsatisfied4%Ambiguous14%Satisfied44%Very satisfied37%Question 2: Are you satisfied with the simulation of facial pore changes over time?Very unsatisfiedUnsatisfiedAmbiguousSatisfiedVery satisfied References [1] B. Fink, K. Grammer, and R. Thornhill, "Human (Homo sapiens) facial attractiveness in relation to skin texture and color.," Journal of comparative psychology, 2001. [19] F. Flament et al., 'An automatic procedure that grades some facial skin structural signs: agreements and validation with clinical assess- ments made by dermatologists', Int J Cosmet Sci, vol. 41, no. 5, pp. 472–478, Oct. 2019. [2] S. Humphrey, S. Manson Brown, S. J. Cross, and R. Mehta, "Defin- ing Skin Quality: Clinical Relevance, Terminology, and Assessment," Dermatol Surg, vol. 47, no. 7, pp. 974–981, Jul. 2021. [20] Z. Wang and R. Li, 'Facial Pore Detection Based on Characteristics of Skin Pigment Distribution', in 2019 IEEE International Confer- ence on Image Processing (ICIP), Sep. 2019, pp. 4439–4443. [3] S. J. Lee, J. Seok, S. Y. Jeong, K. Y. Park, K. Li, and S. J. Seo, "Facial Pores: Definition, Causes, and Treatment Options," Dermatol Surg, vol. 42, no. 3, pp. 277–285, Mar. 2016. [21] C. Shi, J. Zhang, Y. Yao, Y. Sun, H. Rao, and X. Shu, 'CAN-GAN: Conditioned-attention normalized GAN for face age synthesis', Pat- tern Recognition Letters, vol. 138, pp. 520–526, Oct. 2020. [4] E. Uhoda, C. Pi ́erard-Franchimont, L. Petit, and G. E. Pi ́erard, "The Conundrum of Skin Pores in Dermocosmetology," DRM, vol. 210, no. 1, pp. 3–7, 2005. [22] X. Wu, Y. Zhang, Q. Li, Y. Qi, J. Wang, and Y. Guo, 'Face aging with pixel-level alignment GAN', Appl Intell, vol. 52, no. 13, pp. 14665–14678, Oct. 2022. [5] K. Miyamoto, B. Dissanayake, T. Omotezako, M. Takemura, G. Tsuji, and M. Furue, "Daily Fluctuation of Facial Pore Area, Rough- ness and Redness among Young Japanese Women; Beneficial Ef- fects of Galactomyces Ferment Filtrate Containing Antioxidative Skin Care Formula," Journal of Clinical Medicine, vol. 10, no. 11, Art. no. 11, Jan. 2021. [6] B. Dissanayake, K. Miyamoto, A. Purwar, R. Chye, and A. Mat- subara, 'New image analysis tool for facial pore characterization and assessment', Skin Research and Technology, vol. 25, no. 5, pp. 631–638, 2019. [7] T. Karras, S. Laine, and T. Aila, 'A Style-Based Generator Architec- ture for Generative Adversarial Networks'. arXiv, Mar. 29, 2019. [8] T. Karras, S. Laine, M. Aittala, J. Hellsten, J. Lehtinen, and T. Aila, 'Analyzing and Improving the Image Quality of StyleGAN'. arXiv, Mar. 23, 2020. [9] T. Karras et al., 'Alias-Free Generative Adversarial Networks'. arXiv, Oct. 18, 2021. [10] Z. Wang, R. Li, and C. Bi, 'Image-based facial pore detection and visualization in skin health evaluation', J. Vis., 2019. [11] G. Franc ̧ois, A. Maudet, D. McDaniel, F. Giron, and R. Bazin, 'Quantification of Facial Pores Using Image Analysis', Cosmetic Dermatology, vol. 22, no. 9, pp. 457–465, 2009. [12] S. I. Jang, E. J. Kim, and H. K. Lee, 'A method of evaluating fa- cial pores using optical 2D images and analysis of age-dependent changes in facial pores in Koreans', Skin Res Technol, vol. 24, no. 2, pp. 304–308, May 2018. [13] J. Y. Sun, S. W. Kim, S. H. Lee, J. E. Choi, and S. J. Ko, 'Automatic facial pore analysis system using multi-scale pore detection', Skin Res Technol, vol. 23, no. 3, pp. 354–362, Aug. 2017. [14] Q. Zhang and T. Whangbo, 'Skin Pores Detection for Image- Based Skin Analysis', in Intelligent Data Engineering and Automated Learning – IDEAL 2008, Berlin, Heidelberg, 2008, pp. 233–240. [15] B. Kim, J. Choi, K. Park, and S. Youn, 'Sebum, acne, skin elasticity, and gender difference - which is the major influencing factor for facial pores?', Skin Res Technol, vol. 19, no. 1, pp. e45–e53, Feb. 2013. [16] V. Carlos, C. Joan, and V. C. Rodrigo, 'Using Skin Melanin Layer for Facial Pore Identification in RGB Digital Images', IJETAE, vol. 4, no. 8, Aug. 2014. [17] F. Flament et al., 'Artificial Intelligence analysis of over half a mil- lion European and Chinese women reveals striking differences in the facial skin ageing process', Acad Dermatol Venereol, vol. 36, no. 7, pp. 1136–1142, Jul. 2022. [18] A. Shaiek et al., 'A new tool to quantify the geometrical characteris- tics of facial skin pores. Changes with age and a making-up procedure in Caucasian women', Skin Res Technol, vol. 23, no. 2, pp. 249–257, May 2017. [23] F. Makhmudkhujaev, S. Hong, and I. K. Park, 'Re-Aging GAN: To- ward Personalized Face Age Transformation', presented at the Pro- ceedings of the IEEE/CVF International Conference on Computer Vi- sion, 2021, pp. 3908–3917. [24] Y. Liu, Q. Li, and Z. Sun, 'Attribute-Aware Face Aging With Wavelet-Based Generative Adversarial Networks', in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recogni- tion, pp. 11877–11886, 2019. [25] H. Yang, D. Huang, Y. Wang, and A. K. Jain, 'Learning Face Age Progression: A Pyramid Architecture of GANs', in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 31–39, 2018. [26] H. Fang, W. Deng, Y. Zhong, and J. Hu, 'Triple-GAN: Progres- sive Face Aging With Triple Translation Loss', in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 804–805, 2020. [27] V. Martin, R. S ́eguier, A. Porcheron, and F. Morizot, 'Face aging simulation with a new wrinkle oriented active appearance model', Multimed Tools Appl, vol. 78, no. 5, pp. 6309–6327, Mar. 2019, [28] L. Breiman, 'Random Forests', Machine Learning, vol. 45, no. 1, pp. 5–32, Oct. 2001, [29] M. Fernandez-Delgado, E. Cernadas, S. Barro, and D. Amorim, 'Do we Need Hundreds of Classifiers to Solve Real World Classification Problems?', p. 49. [30] J. L. Speiser, M. E. Miller, J. Tooze, and E. Ip, 'A comparison of random forest variable selection methods for classification prediction modeling', Expert Systems with Applications, vol. 134, pp. 93–101, Nov. 2019, [31] S.-Y. Chen, W. Su, L. Gao, S. Xia, and H. Fu, 'Deep Generation of Face Images from Sketches'. arXiv, Jun. 04, 2020. [32] O. Ronneberger, P. Fischer, and T. Brox, 'U-Net: Convolutional Net- works for Biomedical Image Segmentation'. arXiv, May 18, 2015. [33] A. Gustafsson, 'Interactive Image Warping', p. 65. [34] W. Zhang, Y. Liu, C. Dong, and Y. Qiao, 'RankSRGAN: Generative Adversarial Networks With Ranker for Image Super-Resolution'. [35] Q. Meng, S. Zhao, Z. Huang, and F. Zhou, 'MagFace: A Univer- sal Representation for Face Recognition and Quality Assessment', in 2021 IEEE/CVF Conference on Computer Vision and Pattern Recog- nition (CVPR), Nashville, TN, USA, Jun. 2021, pp. 14220–14229. [36] A. Mittal, R. Soundararajan, and A. C. Bovik, 'Making a "Com- pletely Blind" Image Quality Analyzer', IEEE Signal Process. Lett., vol. 20, no. 3, pp. 209–212, Mar. 2013, [37] V. N, P. D, M. C. Bh, S. S. Channappayya, and S. S. Medasani, 'Blind image quality evaluation using perception based features', in 2015 Twenty First National Conference on Communications (NCC), Feb. 2015, pp. 1–6.
http://arxiv.org/abs/2302.11947v1
2023-02-23T11:44:43
2023-02-23T11:44:43
Real-Time Damage Detection in Fiber Lifting Ropes Using Convolutional Neural Networks
The health and safety hazards posed by worn crane lifting ropes mandate periodic inspection for damage. This task is time-consuming, prone to human error, halts operation, and may result in the premature disposal of ropes. Therefore, we propose using deep learning and computer vision methods to automate the process of detecting damaged ropes. Specifically, we present a novel vision-based system for detecting damage in synthetic fiber rope images using convolutional neural networks (CNN). We use a camera-based apparatus to photograph the lifting rope's surface, while in operation, and capture the progressive wear-and-tear as well as the more significant degradation in the rope's health state. Experts from Konecranes annotate the collected images in accordance with the rope's condition; normal or damaged. Then, we pre-process the images, design a CNN model in a systematic manner, evaluate its detection and prediction performance, analyze its computational complexity, and compare it with various other models. Experimental results show the proposed model outperforms other techniques with 96.4% accuracy, 95.8% precision, 97.2% recall, 96.5% F1-score, and 99.2% AUC. Besides, they demonstrate the model's real-time operation, low memory footprint, robustness to various environmental and operational conditions, and adequacy for deployment in industrial systems.
[ "Tuomas Jalonen", "Mohammad Al-Sa'd", "Roope Mellanen", "Serkan Kiranyaz", "Moncef Gabbouj" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11947v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11947v1", "@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" ]
Real-Time Damage Detection in Fiber Lifting Ropes Using Convolutional Neural Networks Tuomas Jalonen, Mohammad Al-Sa'd, Senior Member, IEEE, Roope Mellanen, Serkan Kiranyaz, Senior Member, IEEE, and Moncef Gabbouj, Fellow, IEEE 1 3 2 0 2 b e F 3 2 ] V C . s c [ 1 v 7 4 9 1 1 . 2 0 3 2 : v i X r a Abstract-The health and safety hazards posed by worn crane lifting ropes mandate periodic inspection for damage. This task is time-consuming, prone to human error, halts operation, and may result in the premature disposal of ropes. Therefore, we propose using deep learning and computer vision methods to automate the process of detecting damaged ropes. Specifically, we present a novel vision-based system for detecting damage in synthetic fiber rope images using convolutional neural networks (CNN). We use a camera-based apparatus to photograph the lifting rope's surface, while in operation, and capture the progressive wear-and-tear as well as the more significant degradation in the rope's health state. Experts from Konecranes annotate the collected images in accordance with the rope's condition; normal or damaged. Then, we pre-process the images, design a CNN model in a systematic manner, evaluate its detection and prediction performance, analyze its computational complexity, and compare it with various other models. Experimental results show the proposed model outperforms other techniques with 96.4% accuracy, 95.8% precision, 97.2% recall, 96.5% F1-score, and 99.2% AUC. Besides, they demonstrate the model's real- time operation, low memory footprint, robustness to various environmental and operational conditions, and adequacy for deployment in industrial systems. Index Terms-Computer vision, damage detection, deep learn- ing, fiber rope, industrial safety. I. INTRODUCTION T RADITIONAL industries are transitioning to smart man- ufacturing under the Industry 4.0 paradigm [1], [2]. This transition allows the use of recent advances in artificial intelligence and computer vision to increase productivity and improve manufacturing safety [3], [4]. Nonetheless, lifting heavy payloads is still a major health and safety hazard in many manufacturing environments [5]. For example, cranes such as the one shown in Fig. 1 can move objects weighing several metric tons; hence, inspecting its ropes for damage is paramount to prevent serious accidents, injuries, and additional costs [6]. More specifically, lifting ropes are major points of This work was funded by Konecranes Plc as part of Business Finland and DIMECC Intelligent Industrial Data Program. (Corresponding author: Tuomas Jalonen.) Tuomas Jalonen and Moncef Gabbouj are with the Faculty of Information Technology and Communication Sciences, Tampere University, 33720 Tam- pere, Finland (e-mail: [email protected]; [email protected]). Mohammad Al-Sa'd is with the Faculty of Medicine, University of Helsinki, 00014 Helsinki, Finland (e-mail: [email protected]) and the Faculty of Information Technology and Communication Sciences, Tampere University, 33720 Tampere, Finland [email protected]). Roope Mellanen is with Konecranes Plc, 05830 Hyvink ̈a ̈a, Finland (e-mail: [email protected]). Serkan Kiranyaz is with the Department of Electrical Engineering, Qatar University, 2713 Doha, Qatar (e-mail: [email protected]). Fig. 1. The fiber rope cranes used in this work. Photos are published with permission from Konecranes [7]. failure that require periodic inspection and replacement [8]. However, manual inspection procedures are labor intensive, time consuming, subjective, and often require halting the production process [9], [10], [11]. Therefore, we propose a novel real-time damage detection system for synthetic fiber lifting ropes based on deep learning and computer vision techniques. The main contributions of this paper are: • Developing the first fiber lifting rope image dataset. • Proposing a deep learning based system for detecting damage in fiber lifting rope images. • Designing an industrial solution that achieves high per- formance with a light memory footprint. Lifting ropes are commonly manufactured from steel wires or lately using synthetic fibers such as polyethylene [12]. Synthetic lifting ropes have many benefits over traditional steel wire ropes. For example, they demonstrate higher resistance to corrosion, do not require greasing, and are easier to install [13]. Moreover, despite their higher purchase price, synthetic fiber ropes are lightweight which allows utilizing smaller cranes; leading to cost reductions [14]. However, synthetic ropes, just as steel wires, do suffer from wear-and-tear and get damaged over time. Common damage types in fiber ropes are: strand cuts, abrasion, melting, compression damage, pulled strands and inconsistent diameter. In contrast to steel wires which tend to break from the inside [15], synthetic rope damages manifest on the rope's surface and can be visually inspected by an expert [14]. Currently, monitoring the condition of synthetic fiber ropes is performed manually by inspectors following the ISO-9554 standard [9], [10]. Although it this procedure is cumbersome, discontinuous in time, interrupts operation, and may result in the premature disposal of ropes [11]. Therefore, automatic is the standard practice, 2 damage detection by leveraging the recent advancements in computer vision, image processing, and deep learning tech- niques is needed [14]. On the one hand, image processing and related feature extraction methods utilize expert knowledge and attempt to characterize damage in rope images similar to the ones identified by expert inspectors [16]. These techniques generally perform well in a controlled environment, but they poorly integrate the varying conditions and operations found in a real-life setting e.g., noise, lighting conditions, oil residue, and dust [17], [18]. On the other hand, deep learning tools discard the notion of hand-crafted features by learning abstrac- tions that maximize the detection of damaged ropes. In fact, they yield discriminatory features without predisposition to the standard markings and can accommodate a wider range of environmental and/or operational conditions [17]. Therefore, deep learning techniques are more suited to detect damage in synthetic fiber rope images compared to engineering-based feature extraction methods. The construct of damage indicators in fiber ropes was first articulated in [11] where changes in the rope's width and length were found to be important. This particular finding was verified in [19] using computer vision and thermal imaging; however, explicit identification for damaged ropes was not performed. In fact, detecting damage in synthetic fiber rope images has received less attention in the literature compared to steel wire cables. Fortunately, these detection techniques are suitable for adoption due to the similarity between the two problems; they both deal with detecting damaged yarns or strands in rope images. For instance, the health condi- tion of balancing tail ropes was monitored in [20] using a convolutional neural network (CNN). The rope image was to classify its captured and then fed to the CNN model health state as either normal, or if it suffers from one out of eight common damage types. Moreover, a CNN-based approach was designed in [21] to detect surface defects in steel wire rope images. The model classified the acquired images into normal, broken, or damaged, and achieved a 99.7% overall accuracy. The same problem was tackled in [22] using support vector machines trained with texture-based hand-crafted features. The proposed system achieved a 93.3% classification accuracy and it was further improved in [23] to reach 95.9%. Nonetheless, the limited sample size and the reliance on hand-crafted features hampered robustness in noisy environments. This was evidenced in [24] which showed that the model accuracy drops to 80.5% when training/testing with a different dataset. Moreover, the utility of CNNs combined with image processing techniques was shown to increase the accuracy of the model in [22] from 93.3% to 95.5% [18]. This has motivated us to design a CNN-based solution for detecting damage in synthetic fiber rope images. However, our proposed solution will be developed to have both high performance and low computational requirements, allowing for easy integration into industrial systems and efficient deployment [25]. The rest of this paper is organized as follows: section II describes our methodology for building the experimental setup, collecting data, designing the damage detection system, and evaluating its performance. Afterwards, we present and discuss the system's performance and compare it to various other models in section III. Finally, section IV concludes the paper and suggests topics for future research. II. METHODOLOGY The proposed fiber rope damage detection system is overviewed in Fig. 2 and consists of the following stages: 1) Setup an experimental apparatus with a three-camera circular array to photograph the ropes' surface area. 2) Collect the captured images and label them as normal or damaged according to the ropes' health condition. 3) Preprocess the collected images to enhance contrast and down-sample to reduce computational complexity. 4) Split the pre-processed images into train and test sets in a 5-fold cross-validation fashion. 5) Train and test a classification model on the train and test folds, respectively, and repeat for every data split. 6) Evaluate and analyze the model's fold-averaged perfor- mance using various metrics. The design process undertaken in this work is governed by the following requirements: • High performance in detecting damaged ropes and ro- bustness to different environmental and operational con- ditions. • Lightweight for implementation and deployment. • Remote sensing by neither interfering with the crane operation nor the rope structure. • Modularity to facilitate maintenance, upgrades, and com- patibility with IoT and edge devices. The remaining subsections discuss and detail each stage in the proposed system. A. Experimental setup The experimental setup was built and operated by Konecranes and the following experiment was repeated for three different synthetic fiber ropes; see Table I for the ropes' properties. First, the crane illustrated in Fig. 1 was set to continuously lift a payload of 5 metric tons in a controlled setting. The payload lifting height was approximately 5 meters and during a lifting cycle, the crane was stopped at the top and bottom (payload resting on the floor). After that, a circular camera array, comprised of three RGB cameras placed at 120° apart, was used to capture approximately 13 mm of the lifting rope. The camera framerate was selected such that subsequent rope images have roughly 1/3 spatial overlap, resulting in 20 meters of rope being photographed during a lifting cycle. Finally, the crane lifting and rope imaging steps were repeated for weeks to cover the ropes' lifespan; from new to unusable. B. Data collection The rope imaging experiment generated 4,984,000 high- resolution photos; each being tagged with a timestamp and the rope's imaged position. The raw photos were then screened for duplicates by discarding images that examined the same rope position. In other words, we ensured that images for the same rope position would be distinct by capturing different health 3 Fig. 2. The proposed vision-based damage detection system for synthetic fiber lifting ropes. The system is comprised of the following stages: (1) experimental setup with a three-camera circular array to capture rope images; (2) collection and annotation of the captured images; (3) preprocessing to enhance quality and down-sampling to reduce complexity; (4) data splitting into 5-fold training and testing sets; (5) training/testing the proposed deep learning model; and (6) evaluating and analyzing the system's performance and computational complexity. TABLE I THE FIBER LIFTING ROPE PROPERTIES. Diameter 12 mm Material Ultra high molecule weight polyethylene Type Strength Weight Coating 12-strand braided rope 15.4 metric tons (ISO 2307) 8.8 kg / 100 meters Abrasion and ultra-violet resistance conditions. This is important to avoid cross-contamination in data splits. After that, we selected 143,000 random samples and experts from Konecranes labeled them as normal or damaged according to the lifting rope health condition. Out of those images, 10,000 samples were labeled as damaged. Finally, to avoid data imbalance issues, we formed a balanced dataset containing 20,000 samples; 10,000 images from each class. The collected dataset is available from Konecranes and it was used under license for this study1. C. Preprocessing and data splitting The annotated high-resolution rope images were down- sampled to 256 × 256 × 3 pixels. After that, we enhanced the photos' contrast via histogram equalization [26]; see Fig. 3 for a sample, and we standardized the pixel values to range between 0 and 1. Finally, the pre-processed images were randomly divided into five equally sized portions while maintaining class balance (5-fold stratified cross-validation); see stage 4 in Fig. 2. In other words, each split had 16,000 (8,000 damaged and 8,000 normal) and 4,000 (2,000 damaged and 2,000 normal) images for training and testing, respectively. Fig. 4 demonstrates samples of normal and damaged ropes 1Please contact Roope Mellanen at [email protected] for data inquiry. (a) Raw sample. (b) Histogram equalized sample. Fig. 3. Histogram equalization for an example rope image. from the acquired dataset. By examining the images, one notes a significant variation in the clarity of the rope's health state and in the severity of the damage. For example, Fig. 4a conveys a more damaged rope when compared to the one presented in Fig. 4e. However, the damage can also be minuscule without clear visual indications as presented in Fig. 4d. Finally, the dirt and oil stains found in most rope images present a challenge for any vision-based tool. D. Proposed deep learning model The collected rope images constitute an over-complete de- scription for the rope as a whole; hence, the problem of dam- age detection reduces to classifying each image independently. We designed a lightweight CNN architecture to classify the fiber lifting rope images, and we tested different variants to find the best performing model. The architecture design starts with a convolutional layer (3×3 kernel with ReLU activation) to extract preliminary feature maps from the input images. After that, those initial features are passed through a number of blocks each consisting of the following sequential elements: (1) convolutional layer to Experimental SetupData CollectionPreprocessing1Proposed Deep Learning ModelData SplittingTestTrainSplit 1Fold1Fold 2Fold 3Fold 4Fold 5Split 2Fold 1Fold 2Fold 3Fold 4Fold 5Split 3Fold 1Fold 2Fold 3Fold 4Fold 5Split 4Fold 1Fold 2Fold 3Fold 4Fold 5Split 5Fold 1Fold 2Fold 3Fold 4Fold 52345Performance Evaluation and Analysis6 4 (a) Damaged. (b) Damaged. (c) Damaged. (d) Damaged. (e) Damaged. (f) Normal. (g) Normal. (h) Normal. (i) Normal. (j) Normal. Fig. 4. Example images from the acquired dataset show significant variation in the severity and clarity of damages because of dirt and oil stains. The first row (a)-(e) show damaged ropes while the second row (f)-(j) present some healthy samples. extract features (3 × 3 kernel with ReLU activation), (2) Max Pooling to down-sample the features (2 × 2 kernel), (3) and dropout to regularize the network by reducing the neurons' interdependent learning (0.4 rate). Finally, the learned ab- stractions are flattened and passed through a dropout layer (0.4 rate), a fully connected layer (20 nodes), another dropout layer (0.2 rate), and lastly, a binary classification layer with a Softmax activation function. In this work, 16 model variants were generated from this architecture by altering the number of blocks (1, 2, or 3), input image sizes (16 × 16, 32 × 32, or 64 × 64), and the input image color state (color or grayscale); see Appendix A for the model variants' structure and Table II for details on the variant that we selected for further analysis and comparison. The models' training was performed for 200 epochs using an Adam optimizer [27] to minimize the cross-entropy loss regularized by a weight decay to reduce overfitting [28], [29], i.e.: L = −y log(ˆy) − (1 − y) log(1 − ˆy) + λ||w||2 2 , (1) where L denotes the regularized loss, y and ˆy are the true and predicted labels, respectively, λ = 5 × 10−4 is the selected L2 regularization rate, and w is the network's weight matrix [28]. Moreover, the training batch size was set to 32 and to ensure convergence the learning rate was decayed by [30]: η(n) =    10−3 10−4 10−5 10−6 : n ≤ 120 : 120 < n ≤ 150 : 150 < n ≤ 180 : 180 < n ≤ 200 , (2) where η is the learning rate and n is the epoch number. This training process was conducted for each model using the train set in each data split (five training sets). Additionally, TABLE II THE CNN9 MODEL VARIANT ARCHITECTURE. Block # Layer Information Output shape Parameters - 1 2 - Conv Conv MaxPool Dropout Conv L2 Kernel reg. = 0.0005 Kernel = 3 × 3 Activation = ReLU L2 Kernel reg. = 0.0005 Kernel = 3 × 3 Activation = ReLU 30 × 30 × 64 1,792 28 × 28 × 64 36,928 Pool = 2 × 2 14 × 14 × 64 Rate = 0.4 14 × 14 × 64 0 0 L2 Kernel reg. = 0.0005 Kernel = 3 × 3 Activation = ReLU 12 × 12 × 64 36,928 MaxPool Pool = 2 × 2 Dropout Flatten Dropout Dense Dropout Rate = 0.4 - Rate = 0.4 Activation = ReLU Rate = 0.2 Dense Activation = Softmax Total number of parameters 6 × 6 × 64 6 × 6 × 64 2,304 2,304 20 20 2 0 0 0 0 46,100 0 42 121,790 apart from the generated variants, we also trained the following three baseline models for comparison; Zhou et al. (2019) [21], Zhou et al. (2021) [18], and Schuler et al. (2022) [31]. Detailed description on these models can be found in Appendixes B-D. E. Performance evaluation and analysis The trained models were evaluated using the test set in each data split (five test sets). Their performance was analyzed by various tools and metrics to quantify their fold-averaged detection, prediction, and misclassification outcomes. 1) Classification: we quantified the models' classification performance by accuracy, precision, recall, false positive rate (FPR), and the F1-score, i.e.: other words, given large enough training samples, if the Grad- CAM and t-SNE show genuine learning and clear separability, one may infer the model adequacy for unseen samples. 5 Accuracy = T P + T N T P + T N + F P + F N , Precision = T P T P + F P , Recall = FPR = T P T P + F N , F P F P + T N , F1-score = 2 (cid:18) Precision × Recall Precision + Recall (cid:19) , (3) (4) (5) (6) (7) where T P , T N , F P , and F N are true positives, true neg- atives, false positives, and false negatives, respectively (posi- tive/negative denotes a damaged/normal rope). Moreover, we used the area under the averaged receiver operating curve (AUC) and confusion matrices to fully char- acterize the classification quality. The AUC was computed by averaging linearly interpolated receiver operating curves. 2) Prediction: we assessed the models' predictive capacity using Gradient-weighted Class Activation Mapping (Grad- CAM) which uses gradients of the last convolutional layer to measure the relevance of the input image pixels for classifi- cation [32]. Specifically, Grad-CAM yields a distribution with high values for pixels that contributed more to the outcome. Furthermore, we utilized t-Distributed Stochastic Neighbor Embedding (t-SNE); a dimensionality reduction method that clusters similar high dimensional samples and departs dissim- ilar ones in two- or three-dimensional space [33]. In specific, given an array of learned features x = [x1, x2, * * * , xN ], the similarity between features i and j can be measured by: pij = pj|i + pi|j 2N , pj|i = (cid:40) exp(−||xi−xj ||2/2σ2 i ) (cid:80) k(cid:54)=i exp(−||xi−xk||2/2σ2 i ) 0 (8) (9) : i (cid:54)= j : i = j , i,j pij = 1, (cid:80) where pij is a probabilistic measure for the similarity between xi and xj, (cid:80) j pj|i = 1, and σi is the adaptive Gaussian kernel bandwidth. Now, t-SNE aims to learn the two- or three-dimensional map y = [y1, y2, * * * , yN ] with a probabilistic similarity qij that resembles pij, i.e. [33]: qij = (cid:80) (1 + ||yi − yj||2)−1 k(cid:54)=l(1 + ||yk − yl||2)−1 . (10) The similarity matching between qij and pij in t-SNE is maximized by minimizing the Kullback–Leibler divergence of pij from qij via gradient descent, i.e.:  (cid:88)  i(cid:54)=j min yi pij log  (cid:19)  . (cid:18) pij qij (11) Both the Grad-CAM and t-SNE help in characterizing the models' predictive power when supplied with new data. In 3) Misclassification: visualizing the model's misclassified samples is paramount for interpretability and for outlining performance caps. Moreover, it enables a better understanding for the model's weaknesses and for identifying human errors in annotation. For example, by assuming some error in the labeling process, the performance of a genuine model will be limited, or capped, by the labels' quality. F. Computational complexity The complexity of the models was assessed by their total number of trainable parameters, required input image size, the models' memory size requirement, processing time, and their processing rate (frame rate). We analyzed their computational complexity by Monte-Carlo simulations where we fed the models with 4,000 test samples, predicted their health state (normal or damaged), and repeated the process ten times for validation. Note that this process does not include the imaging, data loading, nor preprocessing stages. It only quantifies the models' inference complexity. We used an Apple MacBook Pro with an ARM-based M1 Pro chip, 10-core CPU, integrated 16-core GPU, 16-core neural engine, and 16 GB of RAM. The experiments' codes were written in Python 3.9.7 using Tensorflow 2.7.0 and are publicly available. III. RESULTS AND DISCUSSION A. Model selection The best model, out of the 16 generated variants, was selected based on its ability to balance between precision and recall with minimum computational requirements. By examining the results in Table III, one notes that the model variants CNN9 and CNN15 yield the highest 5-fold averaged precision/recall balance (96.5% average). Besides, they are the top-2 models in terms of accuracy, precision, F1-score, and AUC. Nevertheless, due to the apparent disparity in computational resources (input image sizes: 32 × 32 × 3 v.s. 64×64×3), we opted for model CNN9 and used it for further analysis and comparison. Note that "Proposed CNN" refers to the CNN9 variant in the remaining of this paper. B. Performance analysis Fig. 5 compares the training and testing accuracy/loss curves (averaged over the data splits) of the proposed CNN to the three baseline models. The results show the curves converging successfully after epoch 150, and the learning rate decay, scheduled at epoch 151, has ensured stability by suppress- ing perturbation. This indicates that the training phase was executed long enough and was not terminated prematurely. Moreover, by examining the difference between the training and testing accuracy/loss curves one notes that the three baseline models exhibit further overfitting when compared to the proposed network, with Schuler et al. (2022) being the extreme case, followed by Zhou et al. (2019), and lastly, Zhou 6 (a) Zhou et al. (2019). (b) Zhou et al. (2021). (c) Schuler et al. (2022). (d) Proposed CNN. Fig. 5. Comparing the models' training and testing accuracy/loss curves averaged over the data splits in solid/dotted lines. TABLE III THE PROPOSED CNN MODEL VARIANTS' TESTING PERFORMANCE IN TERMS OF ACCURACY, PRECISION, RECALL, FNR, F1-SCORE, AND AUC. THE RESULTS ARE SUMMARIZED BY THEIR 5-FOLD AVERAGED PERCENTAGES, ± STANDARD DEVIATIONS, AND THE SELECTED BEST MODEL VARIANT IS HIGHLIGHTED IN BOLD. Variant # Accuracy Precision Recall FNR F1-score AUC CNN1 CNN2 CNN3 CNN4 CNN5 CNN6 CNN7 CNN8 CNN9 CNN10 CNN11 CNN12 CNN13 CNN14 CNN15 CNN16 94.8 ± 0.4 93.9 ± 0.2 95.9 ± 0.7 4.1 ± 0.7 94.9 ± 0.4 98.4 ± 0.1 94.0 ± 0.5 93.8 ± 1.0 94.2 ± 0.8 5.8 ± 0.8 94.0 ± 0.4 98.1 ± 0.2 96.0 ± 0.4 95.8 ± 0.3 96.3 ± 0.8 3.7 ± 0.8 96.1 ± 0.4 99.1 ± 0.1 95.7 ± 0.3 95.2 ± 0.7 96.3 ± 0.5 3.7 ± 0.5 95.7 ± 0.3 99.0 ± 0.1 95.2 ± 0.2 95.0 ± 0.3 95.5 ± 0.5 4.5 ± 0.5 95.2 ± 0.2 98.5 ± 0.1 95.7 ± 0.3 95.1 ± 0.5 96.4 ± 0.1 3.6 ± 0.1 95.8 ± 0.3 98.8 ± 0.1 94.3 ± 0.6 91.7 ± 1.5 97.5 ± 0.7 2.5 ± 0.7 94.5 ± 0.5 98.6 ± 0.1 96.4 ± 0.3 95.8 ± 0.4 97.0 ± 0.4 3.0 ± 0.4 96.4 ± 0.3 99.0 ± 0.2 96.4 ± 0.5 95.8 ± 0.5 97.2 ± 0.8 2.8 ± 0.8 96.5 ± 0.5 99.2 ± 0.1 96.1 ± 0.3 95.5 ± 0.2 96.9 ± 0.6 3.1 ± 0.6 96.2 ± 0.3 99.1 ± 0.2 95.0 ± 0.1 94.6 ± 0.5 95.5 ± 0.4 4.5 ± 0.4 95.0 ± 0.1 98.4 ± 0.1 95.9 ± 0.2 95.2 ± 0.5 96.7 ± 0.5 3.3 ± 0.5 95.9 ± 0.2 98.8 ± 0.2 95.4 ± 0.5 93.7 ± 1.0 97.3 ± 0.8 2.7 ± 0.8 95.4 ± 0.4 98.9 ± 0.1 96.2 ± 0.4 95.9 ± 0.6 96.5 ± 0.4 3.5 ± 0.4 96.2 ± 0.4 99.0 ± 0.2 96.5 ± 0.3 95.8 ± 0.5 97.2 ± 0.3 2.8 ± 0.3 96.5 ± 0.3 99.1 ± 0.2 96.4 ± 0.2 94.9 ± 0.4 98.0 ± 0.5 2.0 ± 0.5 96.4 ± 0.2 99.2 ± 0.1 et al. (2021). We argue that this is caused by the unnecessary high number of parameters which hinder generalization. The models' testing performance for detecting damaged rope images is demonstrated in Table IV and Fig. 6. The measures in Table IV show that the Zhou et al. (2021) model has the highest recall at 97.9%, which is the most important metric in order to prevent accidents. However, its precision, at 90.3%, is relatively low suggesting that the model labels most rope images as damaged, making it unpractical for a real-life setting. Moreover, both the Schuler et al. (2022) and the proposed models yield similar recall levels (97.1% and 97.2%, respectively). Nevertheless, the proposed CNN results in higher accuracy, precision, and F1-score with 2.3, 4.2, and 2.2 percentage point gains, respectively. In addition, it demonstrates a better precision/recall trade-off, which is reflected by the averaged ROC curve in Fig. 6 along with its AUC value (99.2%). Finally, the results suggest that the Zhou et al. (2019) and Schuler et al. (2022) models are not the best in any of the six metrics. Fig. 6. The models' 5-fold averaged ROC curves alongside their computed AUC values. The corner portion is magnified to ease visualization. C. Computational complexity analysis Table V summarizes the complexity analysis results which indicate that the proposed model is the fastest one requiring approximately 19 milliseconds per input image and running in real-time at 54 fps. Nonetheless, it is important to note that Zhou et al. (2019) and (2021) models are comparatively fast, but the Schuler et al. (2022) operates below real-time the listed prediction speeds could be at 12 fps. Besides, the further improved by running them in C++. However, most notable and important difference is the proposed model's lighter memory footprint. In specific, our model accepts small- sized images and requires less disk space for storage. These advantages can lead to savings in equipment and operational costs, improve latency, and mitigate privacy issues by not using cloud services. D. The Grad-CAM and t-SNE analysis The Grad-CAM and t-SNE results are depicted in Figs. 7 and 8, respectively. In Fig. 7, we generated the Grad-CAM heatmap for two example images showing damaged ropes that were correctly classified by the proposed model. The results show that our CNN model is indeed focusing on the intuitively relevant parts of the input image, which are the broken strands. One also notes that the network does not focus on the ropes' oil and dirt residue as demonstrated in Fig. 7b. This suggests genuine learning by the model and robustness to environmental 0255075100125150175200Epoch0.500.550.600.650.700.750.800.850.900.951.00Accuracy0.00.10.20.30.40.50.60.70.80.91.0Categorical CrossentropyTraining AccuracyTesting AccuracyTraining LossTesting Loss0255075100125150175200Epoch0.500.550.600.650.700.750.800.850.900.951.00Accuracy0.00.10.20.30.40.50.60.70.80.91.0Categorical CrossentropyTraining AccuracyTesting AccuracyTraining LossTesting Loss0255075100125150175200Epoch0.500.550.600.650.700.750.800.850.900.951.00Accuracy0.00.10.20.30.40.50.60.70.80.91.0Categorical CrossentropyTraining AccuracyTesting AccuracyTraining LossTesting Loss0255075100125150175200Epoch0.500.550.600.650.700.750.800.850.900.951.00Accuracy0.00.10.20.30.40.50.60.70.80.91.0Categorical CrossentropyTraining AccuracyTesting AccuracyTraining LossTesting Loss0.00.20.40.60.81.0False positive rate0.00.20.40.60.81.0True positive rateProposed CNN, AUC = 0.992Zhou et al. (2019), AUC = 0.971Zhou et al. (2021), AUC = 0.986Schuler et al. (2022), AUC = 0.987 TABLE IV THE MODELS' TESTING PERFORMANCE IN TERMS OF T P , T N , F P , AND F N PRESENTED IN A CONFUSION MATRIX FASHION, ALONG WITH THEIR ACCURACY, PRECISION, RECALL, FNR, AND F1-SCORE. THE CONFUSION MATRIX ENTRIES ARE ACCUMULATED FROM THE 5-FOLDS, THE REMAINING RESULTS ARE SUMMARIZED BY THEIR 5-FOLD AVERAGE PERCENTAGES, ± STANDARD DEVIATIONS, AND THE BEST OUTCOMES ARE SHOWN IN BOLD. 7 Zhou et al. (2019) Zhou et al. (2021) Schuler et al. (2022) Proposed CNN T N F N F P T P 8,641 355 1,359 9,645 8,933 215 1,067 9,785 9,107 293 893 9,707 9,570 281 430 9,719 Accuracy Precision Recall FNR F1-score AUC 91.4 ± 2.7 87.7 ± 3.1 96.4 ± 2.5 3.6 ± 2.5 91.9 ± 2.6 97.1 ± 2.4 93.6 ± 1.7 90.3 ± 3.5 97.9 ± 1.0 2.2 ± 1.0 93.9 ± 1.53 98.6 ± 0.1 94.1 ± 1.1 91.6 ± 2.2 97.1 ± 1.0 2.9 ± 1.0 94.3 ± 0.9 98.7 ± 0.2 96.4 ± 0.5 95.8 ± 0.5 97.2 ± 0.8 2.8 ± 0.8 96.5 ± 0.5 99.2 ± 0.1 TABLE V THE MODELS' COMPUTATIONAL COMPLEXITY IN TERMS OF THEIR TOTAL NUMBER OF PARAMETERS, INPUT IMAGE SIZE REQUIREMENT, MODEL SIZE, AVERAGE PROCESSING TIME ± STANDARD DEVIATION IN MILLISECONDS, AVERAGE PROCESSING RATE IN FPS, AND AVERAGE TRAINING TIME PER EPOCH ± STANDARD DEVIATION IN SECONDS. Zhou et al. (2019) Zhou et al. (2021) Schuler et al. (2022) Proposed CNN No. of parameters Image size Model size 12.8 M 3.57 KB 154 MB 498 K 7.46 KB 6.28 MB 371 K 2.84 KB 18.5 MB 122 K 2.84 KB 1.73 MB Processing time 20.7 ± 4.2 ms 20.1 ± 4.2 ms 82.7 ± 18.0 ms 18.7 ± 3.6 ms Processing rate 48.3 fps 49.8 fps 12.1 fps 53.5 fps Training time per epoch 17.7 ± 0.39 s 18.3 ± 0.11 s 183.4 ± 4.47 s 14.8 ± 0.06 s (a) Example 1. (b) Example 2. Fig. 7. The proposed CNN Grad-CAM heatmaps for two correctly classified damaged ropes. The heatmaps indicate the model's adequacy by focusing on the pixels that are relevant for detecting damage. We used the model's last convolutional layer features as input to the Grad-Cam algorithm. and operational conditions. However, it is important to note that the CNN still slightly focuses on the image background. Moreover, the t-SNE results in Fig. 8 demonstrate good class separation, but they also show a need for verifying some ground-truth labels. In specific, the t-SNE shows few rope images labeled as normal within the damaged rope support. E. Misclassifications Two example prediction errors by our CNN are presented in Fig. 9. The rope in Fig. 9a is labeled as damaged, but Fig. 8. The proposed CNN t-SNE results showing good separation between the two classes. We used the model's last layer features (FC[20] in Table A.1) as input to the t-SNE algorithm. predicted as normal, while the one in Fig. 9b is labeled as normal, but predicted as damaged. Such instances pose a challenge for the system because they are clearly in between the two classes; they are slightly worn with a few broken strings, but strictly not damaged, according to our experts. Despite that, these ropes are not likely to break at these spots and they would be classified as damaged after more wear. Moreover, the similarities between the two images suggest 0.00.20.40.60.81.00.00.20.40.60.81.0NormalDamaged 8 (a) True: Damaged, Predicted: Normal. (b) True: Normal, Predicted: Damaged. Fig. 9. Two example misclassification samples by the proposed CNN. possible annotation errors which may prevent the proposed model from reaching its full potential. Nonetheless, human errors are expected, and the model outcome still shows good potential and applicability. IV. CONCLUSIONS Damaged lifting ropes are a major safety hazard in manufac- turing, cargo loading/unloading, and construction because they can lead to serious accidents, injuries, and financial losses. The visual inspection of damage in synthetic lifting ropes is a time- consuming task, interrupts operation, and may result in the premature disposal of ropes. Therefore, combining computer vision and deep learning techniques is intuitive for automation and advancement. This work presents a novel vision-based deep learning so- lution for detecting damage in fiber lifting rope images. First, we built a three-camera circular array apparatus to photograph the rope's surface. Afterward, the rope surface images were collected in a database, annotated by experts, preprocessed to improve contrast, and split into train and test sets in a 5-fold cross-validation fashion. Moreover, we systematically designed a CNN-based model to classify damaged rope im- ages, evaluated its detection and prediction performance using various tools, and compared it to three different baseline mod- els. Additionally, we analyzed its computational complexity in terms of processing time and memory footprint. In summary, the results indicated various performance and computational advantages for using the proposed system when compared to similar solutions. Specifically, the system testing yielded 96.4% accuracy, 95.8% precision, 97.2% recall, 96.5% F1- score, 99.2% AUC, and a significant generalization capability. Besides, it runs at 54 fps, occupies 1.7 MB in memory, and requires low-resolution input images; thus, making the pro- posed system a real-time lightweight solution. The developed system was also found robust to various environmental and operational conditions e.g., oil residue and dust. The proposed model's main drawback is not determining the rope health state as a whole but assessing each image individually. Besides, the system's output is binary and does not directly communicate the rope's health condition. These limitations propose extending the developed solution in various ways such as: (1) collecting a larger training dataset with different rope sizes and types to improve generalization; (2) investigating other machine learning solutions and techniques; (3) including the cost of the imaging apparatus in the design process, e.g., using cheaper cameras; (4) extending the model's output to multiple classes e.g., normal, worn, and damaged, or to a continuous score indicating the rope's health condition (regression); and (5) incorporating the proposed solution to automate or recommend spare-part ordering. ACKNOWLEDGMENT We would like to thank Konecranes and Juhani Kerovuori for their collaboration on this project. APPENDIX A THE PROPOSED MODEL VARIANTS Table A.1 summarizes the proposed CNN model variants' architecture for implementation. The variants were generated by altering the number of blocks, input image sizes, and input image color state. APPENDIX B THE ZHOU ET AL. (2019) AND (2021) MODELS The proposed damage detection solution was compared to the Zhou et al. (2019) [21] and Zhou et al. (2021)2 [18] models in terms of performance and computational require- ments. These models were originally designed to detect surface damage in steel wire rope images with high performance. Although the rope material is different from our experiments (steel v.s. fiber), these detection models are still suitable for adoption due to the similarity between the two problems; they both deal with detecting damaged yarns or strands in rope images. The Zhou et al. (2019) and (2021) architectures accept grayscale input images of size 64×64 and 96×96, and produce outputs of size 3 and 2, respectively. In this work, we changed the Zhou et al. (2019) output shape to 2 in order to match our problem definition, and we added six dropout layers (0.5 rate) to mitigate overfitting. Moreover, we increased the Zhou et al. (2021) original two dropout rates to 0.6 and added three more dropout layers to avoid overfitting. APPENDIX C THE SCHULER ET AL. (2022) MODEL The proposed damage detection solution was also compared to the Schuler et al. (2022)3 [31] model; a highly efficient CNN-based classifier. The Schuler et al. (2022) model was designed in a clever manner to reduce the number of required parameters while maintaining high performance; the accuracy drop was 2% for a 55% reduction in parameters when tested on the CIFAR-10 dataset [31]. Therefore, we opted for this architecture for comparison because it is aligned with our design requirements; high efficiency and performance. The Schuler et al. (2022) model accepts colored input images of size 32 × 32 × 3, and in this work, we used its original implementation. Nonetheless, we reduced its output size from 10 to 2 in order to match our problem definition, and added dropout layers (0.4 rate) to minimize overfitting. 2The adopted Zhou et al. (2021) model is named WRIPDCNN1 in [18]. 3The adopted Schuler et al. (2022) model is named kDenseNet-BC L100 12ch in [31]. 9 TABLE A.1 THE PROPOSED CNN MODEL VARIANTS' STRUCTURE. N C[k × k] DENOTES A CONVOLUTIONAL LAYER WITH N KERNELS EACH OF SIZE k × k, MP[k × k] IS MAX POOLING WITH A k × k KERNEL, D[k] IS DROPOUT WITH RATE k, AND FC[N ] IS A FULLY CONNECTED LAYER WITH N NODES. THE SELECTED MODEL VARIANT (CNN9) IS HIGHLIGHTED IN BOLD. Variant # Input Image Size Preliminary First Block Second Block Third Block Fully Connected CNN1 CNN2 CNN3 CNN4 CNN5 CNN6 CNN7 CNN8 CNN9 CNN10 CNN11 CNN12 CNN13 CNN14 CNN15 CNN16 16x16x1 16x16x1 16x16x3 16x16x3 32x32x1 32x32x1 32x32x1 32x32x3 32x32x3 32x32x3 64x64x1 64x64x1 64x64x1 64x64x3 64x64x3 64x64x3 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] - 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] - 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] - 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] - - - - - - Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] - 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] - - Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] - 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] - - Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] - 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] - - Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] 64C[3x3] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] 64C[3x3]-MP[2x2]-D[0.4] Flatten-D[0.4]-FC[20]-D[0.2]-Output[2] APPENDIX D BASELINE TRAINING AND EVALUATION SETTINGS The baseline models' training followed the same procedure described in section II-D using the train set in each data split (five training sets), but with no weight decay. Besides, their performance was evaluated using the test set in each data split (five test sets) and quantified by the measures described in section II-E. Note that the Schuler model has caused out-of- memory issues when trained with a batch size above 32 using the equipment described in section II-F. REFERENCES [1] Z. Liu, K. Xie, L. Li, and Y. Chen, "A paradigm of safety management in industry 4.0," Systems Research and Behavioral Science, vol. 37, no. 4, pp. 632–645, 2020. [2] I. Ahmed, G. Jeon, and F. Piccialli, "From Artificial Intelligence to Explainable Artificial Intelligence in Industry 4.0: A Survey on What, How, and Where," IEEE Transactions on Industrial Informatics, vol. 18, no. 8, pp. 5031–5042, 2022. [3] Z. Xu and J. H. Saleh, "Machine learning for reliability engineering and safety applications: Review of current status and future opportunities," Reliability Engineering & System Safety, vol. 211, p. 107530, 2021. [4] T. Jalonen, F. Laakom, M. Gabbouj, and T. Puoskari, "Visual Product Tracking System Using Siamese Neural Networks," IEEE Access, vol. 9, pp. 76 796–76 805, 2021. [5] J. Lee, I. Phillips, and Z. Lynch, "Causes and prevention of mobile crane- related accidents in South Korea," International Journal of Occupational Safety and Ergonomics, pp. 469–478, 2020. [6] Konecranes, "Smart cranes by Konecranes," Steel Times International, vol. [Online]. Available: 32, Nov https://www.proquest.com/scholarly-journals/smart-cranes-konecranes/ docview/2376650666/se-2 2019. 43, no. 8, p. [7] KONECRANES, KONECRANES S-Series Crane: The new standard in lifting. [Online]. Available: https://www.konecranes.com/sites/default/ files/2020-12/S series crane flyer en Konecranes 2019 0.pdf [8] I. Mupende, F. Lukasch, and P. Tonnier, "Experiences with Fibre Ropes as Hoist Ropes in Crane Applications," innoTRAC Journal, vol. 1, pp. 9–18, Dec. 2020. [9] ISO 9554:2019 Fibre ropes - General specifications, Sustainable [Online]. Available: https://www.iso.org/ Development Goals Std. standard/72077.html [10] A. Schmieder and M. Golder, "Investigating the Lifetime of Fibre Ropes," innoTRAC Journal, vol. 1, pp. 1–8, Dec. 2020. [11] S. Falconer, A. Gromsrud, E. Oland, and G. Grasmo, "Preliminary Results on Condition Monitoring of Fiber Ropes using Automatic Width and Discrete Length Measurements," in Annual Conference of the PHM Society, vol. 9, no. 1, 2017. [12] M. Yousri, G. Jacobs, and S. Neumann, "Impact of fiber versus steel ropes on the lifetime of crane winches," Modeling, Identification and Control, vol. 41, no. 3, pp. 129–139, 2020. [13] G. P. Foster, "Advantages of Fiber Rope Over Wire Rope," Journal of Industrial Textiles, vol. 32, no. 1, pp. 67–75, 2002. [14] E. Oland, R. Schlanbusch, and S. Falconer, "Condition Monitoring Technologies for Synthetic Fiber Ropes-a Review," International Journal of Prognostics and Health Management, vol. 8, no. 2, 2017. [15] R. Schlanbusch, E. Oland, and E. R. Bechhoefer, "Condition Monitoring Technologies for Steel Wire Ropes–A Review," International Journal of Prognostics and Health Management, vol. 8, no. 1, 2017. [16] P. Zhou, G. Zhou, Z. Zhu, Z. He, X. Ding, and C. Tang, "A Review of Non-Destructive Damage Detection Methods for Steel Wire Ropes," Applied Sciences, vol. 9, no. 13, 2019. [17] X. Huang, Z. Liu, X. Zhang, J. Kang, M. Zhang, and Y. Guo, "Surface damage detection for steel wire ropes using deep learning and computer vision techniques," Measurement, vol. 161, p. 107843, 2020. [18] P. Zhou, G. Zhou, H. Wang, D. Wang, and Z. He, "Automatic Detection of Industrial Wire Rope Surface Damage Using Deep Learning-Based Visual Perception Technology," IEEE Transactions on Instrumentation and Measurement, vol. 70, pp. 1–11, 2021. [19] S. Falconer, E. Nordg ̊ard-Hansen, and G. Grasmo, "Computer vision and thermal monitoring of HMPE fibre rope condition during CBOS testing," Applied Ocean Research, vol. 102, p. 102248, 2020. [20] P. Zhou, G. Zhou, Z. Zhu, C. Tang, Z. He, W. Li, and F. Jiang, "Health Monitoring for Balancing Tail Ropes of a Hoisting System Using a Convolutional Neural Network," Applied Sciences, vol. 8, no. 8, 2018. [21] Z. Ping, Z. Gongbo, L. Yingming, and H. Zhenzhi, "Surface defect detection for wire ropes based on deep convolutional neural network," in 2019 14th IEEE International Conference on Electronic Measurement Instruments (ICEMI), 2019, pp. 855–860. [22] P. Zhou, G. Zhou, Z. He, C. Tang, Z. Zhu, and W. Li, "A novel texture- based damage detection method for wire ropes," Measurement, vol. 148, p. 106954, 2019. [23] P. Zhou, G. Zhou, Y. Li, Z. He, and Y. Liu, "A Hybrid Data-Driven Method for Wire Rope Surface Defect Detection," IEEE Sensors Jour- nal, vol. 20, no. 15, pp. 8297–8306, 2020. [24] G. Zhang, Z. Tang, J. Zhang, and W. Gui, "Convolutional Autoencoder- Based Flaw Detection for Steel Wire Ropes," Sensors, vol. 20, no. 22, 2020. 10 [25] M. Verhelst and B. Moons, "Embedded Deep Neural Network Process- ing: Algorithmic and Processor Techniques Bring Deep Learning to IoT and Edge Devices," IEEE Solid-State Circuits Magazine, vol. 9, no. 4, pp. 55–65, 2017. [26] W. A. Mustafa and M. A. Kader, "A Review of Histogram Equalization Techniques in Image Enhancement Application," Journal of Physics: Conference Series, vol. 1019, p. 012026, June 2018. [27] D. P. Kingma and J. Ba, "Adam: A method for stochastic optimization," [Online]. Available: https: arXiv preprint arXiv:1412.6980, 2014. //doi.org/10.48550/arXiv.1412.6980Focustolearnmore [28] Z. Zhang and M. Sabuncu, "Generalized Cross Entropy Loss for Training Deep Neural Networks with Noisy Labels," in Advances in Neural Information Processing Systems, S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, Eds., vol. 31. Curran Associates, Inc., 2018. [Online]. Available: https://proceedings.neurips. cc/paper/2018/hash/f2925f97bc13ad2852a7a551802feea0-Abstract.html [29] T. Van Laarhoven, "L2 regularization versus batch and weight normal- ization," arXiv preprint arXiv:1706.05350, 2017. [30] R. Ge, S. M. Kakade, R. Kidambi, and P. Netrapalli, "The Step Decay Schedule: A Near Optimal, Geometrically Decaying Learning Rate Procedure For Least Squares," in Advances in Neural Information Processing Systems, H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alch ́e-Buc, E. Fox, and R. Garnett, Eds., vol. 32. Curran Associates, Inc., 2019. [Online]. Available: https://proceedings.neurips. cc/paper/2019/file/2f4059ce1227f021edc5d9c6f0f17dc1-Paper.pdf [31] J. P. Schwarz Schuler, S. Roman ́ı, M. Abdel-nasser, H. Rashwan, and D. Puig, "Grouped Pointwise Convolutions Reduce Parameters in Convolutional Neural Networks," Mendel, vol. 28, pp. 23–31, 06 2022. [32] R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and D. Batra, "Grad-CAM: Visual Explanations From Deep Networks via Gradient-Based Localization," in Proceedings of the IEEE International Conference on Computer Vision (ICCV), Oct. 2017, pp. 618–626. [On- line]. Available: https://openaccess.thecvf.com/content iccv 2017/html/ Selvaraju Grad-CAM Visual Explanations ICCV 2017 paper.html [33] L. van der Maaten and G. Hinton, "Visualizing data using t-SNE," Journal of Machine Learning Research, vol. 9, no. 86, pp. 2579–2605, 2008. [Online]. Available: https://jmlr.org/papers/v9/vandermaaten08a. html Tuomas Jalonen received the B.Sc. and M.Sc. degrees in mechanical engineering from Tampere University, Finland, in 2017 and 2019, respectively. He is currently pursuing the Ph.D. degree with the Faculty of Information Technology and Commu- nication Sciences of Tampere University, Finland. His research interest includes the development of machine learning applications for manufacturing. Mohammad Al-Sa'd (Senior Member, IEEE) re- ceived his B.Sc. and M.Sc. degrees in Electrical En- gineering from Qatar University, Qatar, in 2012 and 2016 respectively, and his PhD degree in Electrical Engineering and Computing Sciences from Tampere University, Finland, in 2022. He specialized in signal processing and he is currently pursuing his postdoc- toral fellowship at the Department of Neuroscience, University of Helsinki, Finland. He has served as a technical reviewer for several journals, including IEEE transactions on signal processing, digital signal processing, signal processing, biomedical signal processing and control, and IEEE Access. His research interests include time-frequency signal theory, machine learning, electroencephalogram analysis and processing, information flow and theory, signal modeling, and optimization. Roope Mellanen received the B.Sc. and M.Sc. degrees in automation from Tampere University of Technology, Finland, in 2016 and 2018, respectively. He is currently working as a Research Specialist for Konecranes Corporation. His research interest includes machine learning, computer vision, and signal processing and analytics. Serkan Kiranyaz (Senior Member, IEEE) is a Professor with Qatar University, Doha, Qatar. He published two books, five book chapters, more than 80 journal articles in high impact journals, and 100 articles in international conferences. He made contributions on evolutionary optimization, machine learning, bio-signal analysis, computer vision with applications to recognition, classification, and signal processing. He has coauthored the articles which have nominated or received the "Best Paper Award" in ICIP 2013, ICPR 2014, ICIP 2015, and IEEE Transactions on Signal Processing (TSP) 2018. He had the most-popular articles in the years 2010 and 2016, and most-cited article in 2018 in IEEE Transactions on Biomedical Engineering. From 2010 to 2015, he authored the 4th most-cited article of the Neural Networks journal. His research team has won the second and first places in PhysioNet Grand Challenges 2016 and 2017, among 48 and 75 international teams, respectively. His theoretical contributions to advance the current state of the art in modeling and repre- sentation, targeting high long-term impact, while algorithmic, system level design and implementation issues target medium and long-term challenges for the next five to ten years. He in particular aims at investigating scientific questions and inventing cutting-edge solutions in "personalized biomedicine" which is in one of the most dynamic areas where science combines with technology to produce efficient signal and information processing systems. Moncef Gabbouj (Fellow Member, IEEE) received the B.S. degree from Oklahoma State University, Stillwater, OK, USA, in 1985, and the M.S. and Ph.D. degrees from Purdue University, in 1986 and 1989, respectively, all in electrical engineering. He is a Professor of signal processing with the Depart- ment of Computing Sciences, Tampere University, Tampere, Finland. He was an Academy of Finland Professor from 2011 to 2015. His research inter- ests include big data analytics, multimedia content- based analysis, indexing and retrieval, artificial in- telligence, machine learning, pattern recognition, nonlinear signal and image processing and analysis, voice conversion, and video processing and coding. Dr. Gabbouj is a member of the Academia Europaea and the Finnish Academy of Science and Letters. He is the past Chairman of the IEEE CAS TC on DSP and the Committee Member of the IEEE Fourier Award for Signal Processing. He served as an Associate Editor and the Guest Editor of many IEEE, and international journals and a Distinguished Lecturer for the IEEE CASS. He is the Finland Site Director of the NSF IUCRC funded Center for Visual and Decision Informatics (CVDI) and leads the Artificial Intelligence Research Task Force of the Ministry of Economic Affairs and Employment funded Research Alliance on Autonomous Systems (RAAS).
http://arxiv.org/abs/2302.11944v3
2023-10-16T15:08:43
2023-02-23T11:41:21
Counterfactual Situation Testing: Uncovering Discrimination under Fairness given the Difference
We present counterfactual situation testing (CST), a causal data mining framework for detecting discrimination in classifiers. CST aims to answer in an actionable and meaningful way the intuitive question "what would have been the model outcome had the individual, or complainant, been of a different protected status?" It extends the legally-grounded situation testing of Thanh et al. (2011) by operationalizing the notion of fairness given the difference using counterfactual reasoning. For any complainant, we find and compare similar protected and non-protected instances in the dataset used by the classifier to construct a control and test group, where a difference between the decision outcomes of the two groups implies potential individual discrimination. Unlike situation testing, which builds both groups around the complainant, we build the test group on the complainant's counterfactual generated using causal knowledge. The counterfactual is intended to reflect how the protected attribute when changed affects the seemingly neutral attributes used by the classifier, which is taken for granted in many frameworks for discrimination. Under CST, we compare similar individuals within each group but dissimilar individuals across both groups due to the possible difference between the complainant and its counterfactual. Evaluating our framework on two classification scenarios, we show that it uncovers a greater number of cases than situation testing, even when the classifier satisfies the counterfactual fairness condition of Kusner et al. (2017).
[ "Jose M. Alvarez", "Salvatore Ruggieri" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11944v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11944v3", "@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.CY", "cs.LG" ]
Counterfactual Situation Testing: Uncovering Discrimination under Fairness given the Difference JOSE M. ALVAREZ, Scuola Normale Superiore, University of Pisa, Italy SALVATORE RUGGIERI, University of Pisa, Italy We present counterfactual situation testing (CST), a causal data mining framework for detecting individual discrimination in a dataset of classifier decisions. CST answers the question "what would have been the model outcome had the individual, or complainant, been of a different protected status?" in an actionable and meaningful way. It extends the legally-grounded situation testing of Thanh et al. [62] by operationalizing the notion of fairness given the difference of Kohler-Hausmann [38] using counterfactual reasoning. In standard situation testing we find for each complainant similar protected and non-protected instances in the dataset; construct respectively a control and test group; and compare the groups such that a difference in decision outcomes implies a case of potential individual discrimination. In CST we avoid this idealized comparison by establishing the test group on the complainant's counterfactual generated via the steps of abduction, action, and prediction. The counterfactual reflects how the protected attribute, when changed, affects the other seemingly neutral attributes of the complainant. Under CST we, thus, test for discrimination by comparing similar individuals within each group but dissimilar individuals across both groups for each complainant. Evaluating it on two classification scenarios, CST uncovers a greater number of cases than ST, even when the classifier is counterfactually fair. CCS Concepts: • Computing methodologies → Classification; Machine learning. Additional Key Words and Phrases: discrimination discovery, structural causal models, counterfactual fairness 1 INTRODUCTION Automated decision making (ADM) is becoming ubiquitous and its societal discontents clearer [4, 19, 31]. There is a shared urgency by regulators [21, 65] and researchers [37, 57] to develop frameworks that can asses these classifiers for potential discrimination based on protected attributes such as gender, race, or religion. Discrimination is often conceived as a causal claim on the effect of the protected attribute over an individual decision outcome [24, 30]. It is, in particular, a conception based on counterfactual reasoning-what would have been the model outcome if the individual, or complainant, were of a different protected status?-where we "manipulate" the protected attribute of the individual. Kohler-Hausmann [38] calls such conceptualization the counterfactual causal model of discrimination (CMD). Several frameworks for proving ADM discrimination are based on CMD [38]. Central to these frameworks is defining "similar" instances to the complainant; arranging them based on their protected status into control and test groups; and comparing the decision outcomes of these groups to detect the effect of the protected attribute. Among the available tools [12, 41, 52], however, there is a need for one that is both actionable and meaningful. We consider a framework to be actionable if it can rule out random circumstances for the individual discrimination claim as often required by courts (e.g., [23, 24, 45]), and meaningful if it can account for known links between the protected attribute and all other attributes when manipulating the former as often demanded by social scientists (e.g., [11, 34, 61]). In this paper we present counterfactual situation testing (CST), a causal data mining framework for detecting instances of individual discrimination in the dataset used by a classifier. It combines (structural)1 counterfactuals [46, 47] with situation testing [62, 70]. Counterfactuals answer to counterfactual reasoning and are generated via structural causal models. Under the right causal knowledge, counterfactuals reflect at the individual level how changing the protected attribute affects other seemingly neutral attributes of a complainant. Situation testing is a data mining method, based 1Not to be confused with counterfactual explanations [64] from the XAI literature, which are not based on structural causal models. Other works like [33] use "structural" to differentiate counterfactuals from counterfactual explanations. In this paper, counterfactuals are structural. 1 3 2 0 2 t c O 6 1 ] L M . t a t s [ 3 v 4 4 9 1 1 . 2 0 3 2 : v i X r a Alvarez and Ruggieri on the homonymous legal tool [7, 54]. For each complainant, under some search algorithm and distance function for measuring similarity, it finds and compares a control and test group of similar protected and non-protected instances in the dataset, where a difference between the decision outcomes of the groups implies potential discrimination. CST follows the situation testing pipeline with the important exception that it constructs the test group around the complainant's counterfactual instead of the complainant. An illustrative example. Consider the scenario in Fig. 1 (used later in Section 4.1) where a bank uses a classifier to accept or reject ( ˆY ) individual loan applications based on annual salary (X1) and account balance (X2). Suppose a female applicant (A = 1) with x1 = 35000 and x2 = 7048 gets rejected and files for discrimination. The bank is using non-sensitive information to calculate ˆY , but according to Fig. 1 there is also a known link between A and {X1, X2} that questions the neutrality of such information. Under situation testing, we would find a number of female (protected) and male (non-protected) instances with similar characteristics to the complainant. The resulting control and test groups to be compared would both have similar X1 and X2 to the complainant. On one hand, comparing multiple instances allows to check whether the complainant's claim is an isolated event or representative of an unfavorable pattern toward female applicants by the model (i.e., actionability). On the other hand, knowing what we know about A and its influence, would it be fair to compare the similar female and male instances? As argued by previous works [32, 38], the answer is no. This idealized comparison takes for granted the effect of gender on annual salary and account balance. Under counterfactual situation testing, instead, we would generate the complainant's counterfactual under the causal knowledge provided, creating a "male" applicant with a higher x1 = 50796 and x2 = 13852, and use it rather than the complainant to find similar male instances. The resulting control and test groups would have different X1 and X2 between them. This disparate comparison embodies fairness given the difference, explicitly acknowledging the lack of neutrality when looking at X1 and X2 based on A (i.e., meaningfulness). Here, the control group represents the observed factual world while the test group the hypothetical counterfactual world of the complainant. In addition, with counterfactual situation testing we propose an actionable extension to counterfactual fairness by Kusner et al. [39], which remains the leading causal fairness framework [41]. A classifier is counterfactually fair when the complainant's and its counterfactual's decision outcomes are the same. These are the same two instances used by CST to construct, respectively, the control and test groups, which allows to equip this fairness definition with measures for uncertainty. Hence, CST links counterfactual fairness claims with notions of statistical significance. Further, by looking at the control and test groups rather than the literal comparison of the factual versus counterfactual instances, CST evaluates whether the counterfactual claim is representative of similar instances. Hence, CST detects cases of individual discrimination that are also counterfactually fair, capturing the realistic scenario where a deployed model tends to discriminate when asked to evaluate a borderline instance multiple times. Based on two case studies using synthetic and real data, we evaluate the CST framework using a k-nearest neighbor implementation, k-NN CST, and compare it to its situation testing counterpart, k-NN ST [62], as well as to counterfactual fairness [39]. Here, k denotes the number of instances we wish to find for each control and test groups. The experiments show that CST detects a higher number of individual cases of discrimination across the different k sizes. Further, the results also show that individual discrimination can occur even when the model is counterfactually fair. The results hold when dealing with multiple protected attributes as well as different implementation parameters. Our main contributions with CST are: (1) a meaningful and actionable framework for detecting individual discrimi- nation; (2) a first operationalization of fairness given the difference for discrimination analysis; and (3) an actionable extension of counterfactual fairness equipped with confidence intervals. With this in mind, Section 2 explores the role 2 Counterfactual Situation Testing of causal knowledge in CST. Section 3 presents the CST framework and its k-NN implementation, while Section 4 showcases CST via two classification scenarios. Section 5 concludes the paper. 1.1 Related Work We position CST with current works along the goals of actionability and meaningfulness. Regarding actionability, when proving discrimination, it is important to insure that the framework accounts for sources of randomness in the decision process. Popular non-algorithmic frameworks-such as natural [26] and field [8] experiments, audit [22] and correspondence [9, 53] studies-address this issue by using multiple observations to build inferential statistics. Similar statistics are sometimes asked in court for proving discrimination (e.g., [23, Section 6.3]). Few algorithmic frameworks, instead, address this issue due to model complexity preventing formal inference [5]. An exception are data mining frameworks for discrimination discovery [48, 58] that operationalize the non-algorithmic notions, including situation testing [62, 70]. These frameworks (e.g., [2, 25, 51]) keep the focus on comparing multiple control-test instances for making individual claims, providing evidence similar to that produced by the quantitative tools used in court [38]. To the best of our knowledge, it remains unclear if the same can be said about existing causal fair machine learning methods [41] as these have yet to be used beyond academic circles. Regarding meaningfulness, situation testing and the other methods have been criticized for their handling of the counterfactual question behind the causal model of discrimination [32, 34, 38]. In particular, these actionable methods take for granted the influence of the protected attribute on all other attributes. This can be seen, e.g., in how situation testing constructs the test group, which is equivalent to changing the protected attribute while keeping everything else equal. Such approach goes against how most social scientists interpret the protected attribute and its role as a social construct when proving discrimination [11, 28, 55, 61]. It is in that regard where structural causal models [46] and their ability for conceiving counterfactuals (e.g., [13, 69]), including counterfactual fairness [39], have an advantage. What the criticisms on counterfactuals [32, 34] overlook here is that generating counterfactuals, as long as the causal knowledge is properly specified, accounts modeling-wise for the effects of changing the protected attribute on all other observed attributes. A framework like counterfactual fairness, relative to situation testing and these other methods, is more meaningful in its handling of protected attributes. The novelty in CST is bridging these two lines of work, borrowing the actionability aspects from situation testing and the meaningful aspects from counterfactual fairness. 2 CAUSAL KNOWLEDGE FOR DISCRIMINATION Counterfactual situation testing requires access to the dataset of decision records of interest, D, and the algorithmic decision-maker that produced it, b (). Let D contain the set of relevant attributes X , the set of protected attributes A, and the decision outcome ˆY = b (X ). We describe D as a collection of n tuples, each (xi, ai, yi ) representing the (cid:98) ith individual profile, with i ∈ [1, n]. ˆY is binary with ˆY = 1 denoting the positive outcome (e.g., loan granted). For illustrative purposes, we assume a single binary A with A = 1 denoting the protected status (e.g., female), though we relax this assumption in the experiments of Section 4.2. We also require causal knowledge in the form of a structural causal model that describes the data generating model behind D. We view this requirement as an input space for experts as these models are a convenient way for organizing assumptions on the source of the discrimination, facilitating stakeholder participation and supporting collaborative reasoning about contested concepts [44]. 3 Alvarez and Ruggieri 2.1 Structural Causal Models and Counterfactuals A structural causal model (SCM) [46] M = {S, PU} describes how the set of p variables W = X ∪ A is determined based on corresponding sets of structural equations S and latent variables U with prior distribution PU. Each Wj ∈ W is assigned a value through a deterministic function fj ∈ S of its causal parents Wpa ( j ) ⊆ W \ {Wj } and noise variable U j with distribution P (U j ) ∈ PU. Formally, for Wj ∈ W we have that Wj ← fj (Wpa ( j ), U j ), indicating the flow of information in terms of child-parent or cause-effect pairs. We consider the associated causal graph G = (V, E), where a node Vj ∈ V represents a Wj variable and a directed edge E ( j,j ′ ) ∈ E a causal relation. We make two assumptions on M common within the causal fairness literature [41]. First, we assume causal sufficiency, meaning there are no hidden common causes in M, or confounders. Second, we assume G to be acyclical, which turns G into a directed acyclical graph (DAG), allowing for no feedback loops. We write M under these assumptions as: M = (S, PU ), S = {Wj ← fj (Wpa ( j ), U j )} p j=1, PU = P (U1) × * * * × P (Up ) (1) where these assumptions are necessary for generating counterfactuals. The causal sufficiency assumption is particularly deceitful as it is difficult to both test and account for a hidden confounder [18, 40, 43]. The risk of a hidden confounder is a general problem to modeling fairness. Here, the dataset D delimits our context. We expect it to contain all relevant information used by the decision-maker b (). Input from several stakeholders is needed to derive (1). We see it as a necessary collaborative effort: before we implement CST, we first need to agree over a worldview for the discrimination context. Based on D, a domain-expert motivates a causal graph G. A modelling-expert then translates this graphical information into a SCM M, making model specification decisions on S. We do not cover this process here, but this is how we envision the initial implementation stage of counterfactual situation testing. For a given SCM M we want to run counterfactual queries to build the test group for a complainant. Counterfactual queries answer to what would have been if questions. In CST, we wish to ask such questions around the protected attribute A, by setting A to the non-protected status α using the do-operator do (A := α) [46] to capture the individual- level effects A has on X according to (1). Let XCF denote the set of counterfactual variables obtained via the three step procedure by Pearl et al. [47]. Abduction: for each prior distribution P (Ui ) that describes Ui , we compute its posterior distribution given the evidence, or P (Ui | X, A). Action: we intervene A by changing its structural equation to A := α, which gives way to a new SCM M′. Prediction: we generate the counterfactual distribution P (XCF A←α (U ) | X, A) by propagating the abducted P (Ui | X, A) through the revised structural equations in M′. Note that generating counterfactuals and, thus, CST, unlike, e.g., counterfactual explanations [64] and discrimination frameworks like the FlipTest [10], does not require a change in the individual decision outcome. It is possible for (cid:98)Y = (cid:98)Y CF after manipulating A. We include a working example on generating counterfactuals in the Appendix. 2.2 Conceiving Discrimination The legal setting of interest is indirect discrimination under EU law. It occurs when an apparently neutral practice disadvantages individuals that belong to a protected group. Following [27], we focus on indirect discrimination for three reasons. First, unlike disparate impact under US law [6], the decision-maker can still be liable for it despite lack of premeditation and, thus, all practices need to consider potential indirect discrimination implications. Second, many ADM models are not allowed to use the protected attribute as input, making it difficult for regulators to use the 4 Counterfactual Situation Testing direct discrimination setting. Third, we conceive discrimination as a product of a biased society where b () continues to perpetuate the bias reflected in D because it cannot escape making a decision based on X to derive ˆY . We view the indirect setting as the one that best describes how biased information can still be an issue for an ADM that never uses the protected attribute. Previous causal works [13, 36, 50] have focused more on whether the paths between A and ˆY are direct or indirect. Here, the causal setting is much simpler. We know that b () only uses X , and are more interested in how information from A is carried by X and how can we account for these links using causal knowledge. That said, this does not mean that CST cannot be implemented in other discrimination settings. We simply acknowledge that it was developed with the EU legal framework in mind. Proxy discrimination [63], e.g., is one setting that overlaps with the one we have considered. Finally, we note that an open legal concern for CST is detecting algorithmic discrimination for various protected attributes, or |A| > 1. Two kinds of discrimination, multiple and intersectional, can occur. Consider, e.g., a black female as the complainant. On what protected attribute is she being potentially discriminated on? In multiple discrimination, we would need to detect separately whether the complainant was discriminated as a black and female individual. In intersectional discrimination, we would instead need to detect simultaneously if the complainant was discriminated as a black-female individual. Only multiple discrimination is currently recognized by EU law, which is an issue as an individual can be free from multiple discrimination but fall victim of intersectional discrimination [68]. CST can account operationally for both scenarios. 2.3 Fairness given the Difference: the Kohler-Hausmann Critique Here, we make the case-very briefly-that the causal knowledge required for CST makes it a meaningful framework with respect to situation testing [62, 70] and other tools [52] for detecting discrimination. The reference work is Kohler-Hausmann [38]. We refer to the phrase fairness given the difference,2 which best captures her overall critique toward the causal model of discrimination, as the Kohler-Hausmann Critique (KHC). CST aims to be meaningful by operationalizing the KHC. It builds the test group on the complainant's counterfactual, letting XCF reflect the effects of changing A instead of assuming X = XCF . This is because we view the test group as a representation of the hypothetical counterfactual world of the complainant. As argued by [38] and others before [11, 61], it is difficult to deny that most protected attributes, if not all of them, are social constructs. That is, these attributes were used to classify and divide groups of people in a systematic way that conditioned the material opportunities of multiple generations [42, 55]. Thus, recognizing A as a social constructs means recognizing that its effects can be reflected in seemingly neutral variables in X . It is recognizing that A, the attribute, cannot capture alone the meaning of belonging to A and that we might, as a minimum, have to link it with other attributes to better capture this, such as A → X where A and X change in unison. These attributes summarize the historical processes that fairness researchers are trying to address today and should not be treated lightly.3 The notion of fairness given the difference centers on how A is treated in the counterfactual causal model of discrimi- nation (CM). The critique goes beyond the standard manipulation concern [3] in which A is an inmutable attribute. Instead, granted that we can or, more precisely, have to manipulate A for running a discrimination analysis, the critique goes against how most discrimination frameworks operationalize such manipulation. The KCH emphasizes that when A changes, X should change as well. 2A phrase by Kohler-Hausmann during a panel discussion at NeurIPS 2021 workshop on 'Algorithmic Fairness through the Lens of Causal Reasoning. 3A clear example of this would be the use of race by US policy makers during the early post-WWII era. See, e.g., the historical evidence provided by Rothstein [56] (for housing), Schneider [60] (for narcotics), and Adler [1] (for policing). 5 Alvarez and Ruggieri Based on KHC, we consider two types of manipulations that summarize existing frameworks. The ceteris paribus (CP), or all else equal, manipulation in which A changes but X remains the same. Examples of it include situation testing [62, 70] but also, e.g., the famous correspondence study by Bertrand and Mullainathan [9]. The mutatis mutandis (MM), or changing what needs to be changed, manipulation in which X changes when we manipulate A based on some additional knowledge, like a structural causal model, that explicitly links A to X . Counterfactual fairness [39], e.g, uses this manipulation. The MM is clearly preferred over the CP manipulation when we view A as a social construct. 3 COUNTERFACTUAL SITUATION TESTING The objective of CST is to construct and compare a control and test group for each c protected individual, or complainant, yc ) ∈ D denote the tuple of interest on which the individual in D in a meaningful and actionable way. Let (xc, ac, (cid:98) discrimination claim focuses on, where c ∈ [1, n]. We assume access to the ADM b (), the dataset D, and a structural causal model M describing the discrimination context. There are three key inputs to consider: the number of instances per group, k; the similarity distance function of choice, d; and the strength of the evidence for rejecting the discrimination claim, α. A fourth key input that we fix in this paper is the search algorithm of choice, φ, which we set as the k-nearest neighbors algorithm (k-NN) [29]. We do so as the k-NN is intuitive, easy to implement, and commonly used by existing situation testing frameworks. We discuss the CST implementation used in Section 3.4, including the choice of d. 3.1 Building Control and Test Groups For complainant c, the control and test groups are built on the search spaces and search centers for each group. The search spaces are derived and, thus, delimited by D: we are looking for individuals that have gone through the same decision process as the complainant. The search centers, however, are derived separately: the one for the control group comes from D, while the one for the test group comes from the corresponding counterfactual dataset DCF . The test search center represents the what would have been if of the complainant under a mutatis mutandis (MM) manipulation of the protected attribute A that motivates the discrimination claim. Definition 3.1 (Search Spaces). Under a binary A, where A = 1 denotes the protected status, we partition D into the control search space Dc = {(xi, ai, yi ) ∈ D : ai = 1} and the test search space Dt = {(xi, ai, (cid:98) yi ) ∈ D : ai = 0}. (cid:98) Definition 3.2 (Counterfactual Dataset). The counterfactual dataset DCF represents the counterfactual mapping of each instance in the dataset D, with known decision maker b () and SCM M, via the abduction, action, and prediction steps [47] when setting a binary A to the non-protected value, or do(A := 0). To obtain DCF , we consider an SCM M, as in (1), where A has no causal parents, or is a root node, A affects only the elements of X considered by the expert(s), and ˆY = b (X ). Therefore, when generating the counterfactuals on A (Section 2.1), under the indirect discrimination setting (Section 2.2), the resulting XCF in DCF should reflect an MM manipulation (Section 2.3). Under this structural representation, if A changes then X changes too. See, e.g., Fig. 1 and Fig. 3. The counterfactual dataset represents the world that the complainants would have experienced under A = 0 given our worldview. All three definitions extend to |A| > 1. Definition 3.3 (Search Centers). For a complainant c, we use xc from the tuple of interest (xc, ac, ˆyc ) ∈ D as the from the tuple of interest's generated counterfactual control search center for exploring Dc ⊂ D, and use xCF (xCF c ) ∈ DCF as the test search center for exploring Dt ⊂ D. , ˆyCF c , aCF c c 6 Counterfactual Situation Testing Given the factual D and counterfactual DCF datasets, we construct the control and test groups for c using the k-NN algorithm under some distance function d (x, x ′) to measure similarity between two tuples x and x ′. We want each group or neighborhood to have a size k. For the control group (k-ctr) we use the (factual) tuple of interest (xc, ac, ˆyc ) ∈ D as search center to explore the protected search space Dc : k-ctr = {(xi, ai, yi ) ∈ Dc : rankd (xc, xi ) ≤ k } (cid:98) (2) where rankd (xc, xi ) is the rank position of xi among tuples in Dc with respect to the ascending distance d from xCF . c For the test group (k-tst) we use the counterfactual tuple of interest (xCF ) ∈ DCF as search center to explore c the non-protected search space Dt : yCF c (cid:98) , aCF c , k-tst = {(xi, ai, yi ) ∈ Dt : rankd (xCF c (cid:98) , xi ) ≤ k } (3) where rankd (xCF , xi ) is the rank position of xi among tuples in Dt with respect to the ascending distance d from xCF . c We use the same distance function d for each group. Neither A nor ˆY are used for constructing the groups. Both (2) and (3) can be expanded by including additional constraints, such as a maximum allowed distance. c c The choice of search centers (Def. 3.3) is what operationalizes fairness given the difference for counterfactual situation testing, making it a meaningful framework for testing individual discrimination. To build k-ctr and k-tst using, respectively, xc and xCF is a statement on how we perceive within group ordering as imposed by the protected attribute A. This is because the search centers must reflect the A-specific ordering of the search spaces that each center targets. Let us consider our illustrative example from Section 1. If being a female (A = 1) in this society imposes certain systematic limitations that hinder xc , then comparing c to other female instances in the protected search space preserves the group ordering prescribed by X |A = 1 as all instances involved experience A in the same way. Therefore, given our worldview, the generated counterfactual male instance for c should then reflect the group ordering prescribed by X |A = 0. We expect xc ≠ xCF as the test search center would allow us to compare c to other male tuples in the non-protected search space without having to reduce A to a phenotype. given what we know about the effects of A on X . Using xCF c c One way to look at the previous statement is by considering the notion of effort. If being female requires a higher individual effort to achieve the same xc , then it is fair to compare c to other female instances. However, it is unfair to compare c to other male instances without adjusting for the extra effort not incurred by the male instances for being males. The counterfactual xCF individual fairness [20] notions. should reflect said adjustment. See [14, 15] on a similar, more formal critique on c 3.2 Detecting Discrimination For a complainant c, we compare the control and test groups by looking at the difference in proportion of negative decision outcomes, or Δp = pc − pt , such that: |{(xi, ai, pc = yi ) ∈ k-ctr : ˆyi = 0}| (cid:98) k |{(xi, ai, pt = yi ) ∈ k-tst : ˆyi = 0}| (cid:98) k (4) where pc and pt represents the count of tuples with a negative decision outcome ( ˆY = 0), respectively, in the control and test group. Note that only ˆY is used for deriving the proportions. We compute Δp for all protected tuples in D regardless of the their decision outcome ˆY . CST has the option to include or exclude the search centers when calculating (4). If we exclude them, then pc and pt are counted in pc and pt , leading to a denominator in both of k + 1. remain as is; if we include them, then ˆyc and ˆyCF c 7 Alvarez and Ruggieri We add this option to be able to compare CST against standard situation testing [62, 70], which excludes the search centers, and counterfactual fairness [39], which only uses the search centers. Since Δp is a proportion comparison, it is known to be asymptotically normally distributed, which allows to build Wald confidence intervals (CI) around it [62]. Let zα/2 be the 1 − α/2 quantile of the standard normal distribution N for a significance level of α (or, conversely, a confidence level (1 − α) * 100%). We write the two-sided CI for Δp of c as: [Δp − wα, Δp + wα ], with wα = zα/2 √︂ pc (1 − pc ) − pt (1 − pt ) k (5) The confidence interval (5) responds to the hypothesis that there is individual discrimination, providing a measure of certainty on Δp through a range of possible values. For a given claim, if the CI contains the minimum accepted deviation τ, we cannot reject the hypothesis of no discrimination with (1 − α) * 100% confidence. In other words, the null hypothesis H0 : π = τ cannot be rejected in favor of the alternative hypothesis H1 : π > τ, where π is the true difference in proportion of negative decision outcomes. τ, with a default choice of τ = 0, represents the minimum amount of difference between pc and pt that we need to observe to claim individual discrimination. The overall choice of α and τ will depend on the context of the discrimination claim. It can be motivated, for instance, by legal requirements (set, e.g., by the court [62]), or technical requirements (set, e.g., via power analysis [16]), or both. Definition 3.4 (Individual Discrimination). There is potential4 individual discrimination toward the complainant c if Δp = pc − pt > τ, meaning the negative decision outcomes rate for the control group is greater than for the test group by some minimum deviation τ ∈ R+. We do not view Def. 3.4 as a matter of individual versus group fairness. When we test whether b () discriminates against c, we inevitably pass judgement onto the classifier b () in fear that this behaviour has happened before. In D we have more than one potential discrimination claim to consider under CST, allowing to draw individual-level conclusions while motivating group-level ones. If b () discriminated against c, it also discriminated against what c represents in terms of membership to A. Definition 3.5 (Confidence on the Individual Discrimination Claim). The Wald CI (5) gives a measure of certainty on Δp, which is (asymptotically) normally distributed. For a significance level α, we are (1 − α)% confident on Δp. The claim is said to be statistically valid if the Wald CI excludes τ. This is a statistical inference extension of Def. 3.4. The many-to-many comparison behind Δp is what makes counterfactual situation testing an actionable framework for testing individual discrimination. Here, the notion of repetition and its relation to representativeness and certainty concerns is important. For proving individual discrimination a single comparison is not enough [23, Sec. 6.3]. This is because we want to ensure, one, that the individual claim is representative of the population, and two, be certain about the individual claim. Implicit to both concerns is finding a pattern of unfavorable decisions against the protected group to which the individual complainant belongs to, i.e., discrimination. Ideally, we would repeat the decision process multiple times for the discriminatory pattern to become apparent. This is not possible in practice. Back to our illustrative example from Section 1, we cannot ask the female complainant to apply multiple times to the same bank. We instead can look at other similar instances under the same process. This is what pc and pt (4) and Def. 3.4 represent. Similarly, if the bank's b () is shown to discriminate against the female complainant, what rules out that it has not done it before or that this one time was an exception? Again, we 4Or prima facie. In practice, discrimination needs to be argued against/for. CST alone, as with any other discrimination analysis tool, cannot claim to prove discrimination. It can, however, provide evidence against/for a discrimination case [52]. 8 Counterfactual Situation Testing cannot repeat the decision process until we are certain of the individual discrimination claim. We instead can assume a theoretical distribution of comparisons with π to account for potential randomness in what we detect from the single point estimate that is Δp. This is what the CI (5) and Def. 3.5 represent. 3.3 Connection to Counterfactual Fairness There is a clear link between CST and counterfactual fairness [39]. A decision maker is counterfactually fair if it outputs the same outcome for the factual tuple as for its counterfactual tuple, where the latter is generated based on the abduction, action, and prediction steps and the intervention on the protected attribute.5 The factual (xc, ac, ˆyc ) and counterfactual (xCF ) tuples for c used in CST are also the ones used for counterfactual fairness. We view CST, when including the search centers, as an actionable extension of counterfactual fairness. , ˆyCF c , aCF c c Proposition 3.6 (On Actionable Counterfactual Fairness). Counterfactual fairness does not imply nor it is implied by Individual Discrimination (Def. 3.4). We present a sketch of proof to Prop. 3.6 the in Appendix. Intuitively, it is possible to handle borderline cases where the tuple of interest and its counterfactual both get rejected by b (), though the latter is close to the decision boundary. The model b () would be considered counterfactually fair, but would that disprove the individual discrimination claim? CST, by constructing the control and test groups around this single comparison, accounts for this actionability concern. CST further equips counterfactual fairness with confidence intervals. Previous works have addressed uncertainty in counterfactual fairness [35, 59], but with a focus on the structure of the SCM M. We instead address certainty on the literal comparison that motivates the counterfactual fairness definition. 3.4 An Implementation: k-NN CST Finally, we propose an implementation to our counterfactual situation testing framework. We already defined the search algorithm φ as the k-NN algorithm. We define as the similarity measure d the same distance function between two tuples, d (x, x ′), used in the k-NN situation testing implementation (k-NN ST) [62]. We do so because we want to compare our implementation, k-NN CST, against its standard counterpart, k-NN ST. We summarize the current algorithmic CST implementation in the Appendix. Let us define the distance between two tuples as: d (x, x ′) = (cid:205)|X | i=1 di (xi − x ′ i ) |X | (6) where (6) averages the sum of the per-attribute distances across X . A lower (6) implies a higher similarity between the tuples x and x ′. Here, di equals the overlap measurement (ol) if the attribute Xi is categorical; otherwise, it equals the normalized Manhattan distance (md) if the attribute Xi is continuous, ordinal, or interval. We define each md (xi, xi′ ) = |xi − xi′ |/(max(X ) − min(X )), and ol (xi, xi′ ) = 1 if xi = xi′ and 0 otherwise. CST can handle non- normalized attributes but, unless specified, we normalize them to insure comparable per-attribute distances. The choice of (6) is not restrictive. In subsequent works we hope to explore other distance options like , e.g., heterogeneous distance functions [67], as well as probability-based options, e.g., propensity score weighting [51]. CST is, above all, a framework for detecting discrimination. The choice of d as well as φ are specific to the implemen- tation of CST. What is important is that the test group is established around the complainant's counterfactual while the control group, like in other discrimination frameworks, is established around the complainant. 5Formally, P ( ˆYA←a (U ) = y | X , A) = P ( ˆYA←a′ (U ) = y | X , A), where the left side is the factual A = a and the right side the counterfactual A = a′. 9 Alvarez and Ruggieri A X1 X2 (cid:98)Y A ← UA X1 ← f1 (A) + U1 X2 ← f2 (X1, A) + U2 M    (cid:98)Y = b (X1, X2) Fig. 1. The causal knowledge with corresponding SCM M and DAG G behind our (illustrative example) loan application dataset. Let A denote an individual's gender, X1 annual salary, X2 bank balance, and (cid:98)Y the loan decision based on the bank's ADM b (). 4 EXPERIMENTS We now showcase the counterfactual situation testing (CST) framework via its k-NN implementation using synthetic (Section 4.1) and real (Section 4.2) datasets. We contrast it to its situation testing counterpart (k-NN ST) [62], and to counterfactual fairness (CF) [39]. Here, for the structural equations S we assume additive noise. This is a convenient but not necessary assumption that simplifies the abduction step when generating the counterfactuals.6 We use a significance level of α = 5%, a minimum deviation of τ = 0.0, and a set of k group sizes in {15, 30, 50, 100} for CST runs that include and exclude the search centers. Also for comparison, we define individual discrimination as Δp > τ (Def. 3.4) for a single protected attribute. We still, though, demonstrate the use of confidence intervals (Def. 3.5) and how it would affect the final results. Finally, we assume M and G in both ADM scenarios.7 4.1 An Illustrative Example We create a synthetic dataset D based on the scenario in Fig. 1. It is a modified version of Karimi et al. [33, Fig. 1], where we include the protected attribute gender A. Here, gender directly affects both an individual's annual salary X1 and bank balance X2, which are used by the bank's ADM b () for approving ((cid:98)Y = 1) or rejecting ((cid:98)Y = 0) a loan application. We generate D for n = 5000 under A ∼ Ber(0.45) with A = 1 if the individual is female and A = 0 otherwise, and assume: X1 ← (−$1500) * Poi(10) * A + U1; X2 ← (−$300) * X2 (4) * A + (3/10) * X1 + U2; and (cid:98)Y = 1{X1 + 5 * X2 > 225000} with U1 ∼ $10000 * Poi(10) and U2 ∼ $2500 * N (0, 1). Here, D represents a known biased scenario.8 With A we introduce a systematic bias onto the relevant decision attributes for female applicants. To run CST we first generate the counterfactual dataset DCF based on the intervention do (A := 0), or what would have happened had all loan applicants been male? Comparing D to DCF already highlights the unwanted systematic effects of A. This can be seen, for instance, in Fig. 2 by the rightward shift experienced in X2 for all female applicants when going from the factual to the counterfactual world. The loan rejection rate for females drops from 60.9% in D to 38.7% in DCF , which is now closer to the loan rejection rate of 39.2% experienced by males in both worlds. We run CST for all k sizes. Results are shown in Table 1, where w/o refers to "without search centers" for CST. Does b () discriminate against female applicants? As Table 1 shows, all three methods detect a number of individual discrimination cases. On one hand, the bank clearly uses information that is neutral and needed for approving a loan request; on the other hand, this information is tainted by the effects of gender on such information and the bank, in turn, continues to perpetuate biases against women in this scenario. The results show how these neutral provisions are harmful toward female applicants, and uncover potential individual discrimination cases. 6Formally, we assume S = {Wj ← fj (Wpa ( j ) ) + U j } 7The code and data are available at https://github.com/cc-jalvarez/counterfactual-situation-testing. 8Such "penalties", e.g., capture the financial burdens female professionals face in the present after having been discouraged in the past from pursuing high-paying, male-oriented fields [17]. p j =1 for W = X ∪ A. 10 Counterfactual Situation Testing Fig. 2. Left. Account balance (X2) distribution for females in the factual D and counterfactual DCF datasets. Right. A comparison on X2 of the ST and CST (w/o) control group (ctr) versus the ST (tst-st) and CST (w/o) (tst-cf) test groups for five randomly chosen complainants detected by both methods, showing the fairness given the difference behind CST as tst-st is closer to ctr than tst-cf. Table 1. Number (and %) of detected individual discrimination cases for the illustrative example based on gender. Method CST (w/o) ST [62] CST CF [39] k = 0 0 0 0 376 (22%) k = 15 288 (16.8%) 55 (3.2%) 420 (24.5%) 376 (22%) k = 30 313 (18.3%) 65 (3.8%) 434 (25.4%) 376 (22%) k = 50 342 (20%) 84 (5%) 453 (26.5%) 376 (22%) k = 100 395 (23.1%) 107 (6.3%) 480 (28%) 376 (22%) CST relative to situation testing (ST). Here, consider the CST version without the search centers as ST excludes them. What is clear from Table 1 is that CST finds more individual discrimination cases than ST for all k sizes. For k = 50, e.g., CST (w/o) detects 20% while ST just 5%. These results highlight the impact of operationalizing fairness given the difference, as the main difference between the two frameworks is how each individual test group is constructed based on the choice of search center. The control group is constructed the same way for both ST and CST. The choice of the test search centers is what sets CST apart from ST. Note that ST performs an idealized comparison. Consider, e.g., the tuple (x1 = 35000, x2 = 7948, a = 1) as the complainant c. With c as the test search center, the most similar male profiles to the complainant under any distance d would be tuples similar to (x1 = 35000, x2 = 7948, a = 0). CST, conversely, performs a more flexible comparison under fairness given the difference. With the corresponding 2 = 13852, aCF = 0) as the test search center, the most similar male profiles to the counterfactual tuple (xCF complainant under the same d would be tuples similar to the counterfactual itself. Hence, the test group we construct 1 = 50796, xCF under CST will probably not be similar to the one we construct under ST nor to the same control group we construct for both ST and CST. Fig. 2, for instance, shows clearly this result for k = 15. We randomly chose five complainants that were discriminated by b () according to both ST and CST and plot the distribution of X2 for the control group (ctr), the ST test group (tst-st), and the CST test group (tst-cf). In this scenario, all 55 ST cases are also detected by CST. yc = 0 becomes (cid:98) CST relative to counterfactual fairness (CF). Here, consider the CST version including the search centers (though CST w/o is of interest also), as these represent the instances used by CF. We define CF discrimination as a case where the factual = 1 after the intervention of A. Under this definition, we detect 376 cases of CF discrimination in D, or 22% of female applicants. CF is independent from k as the framework applies only to the individual comparison of the factual and counterfactual tuples for complainant c. Table 1 show that CST detects a higher number of individual discrimination cases for each k size (while CST w/o only passes CF at k = 100). In fact, in this scenario, all cases detected by CF are contained in CST. yCF c (cid:98) 11 Alvarez and Ruggieri What sets CST apart from CF is twofold. First, CST equips the CF comparison with certainty measures. This point is illustrated in Table 2 where we show individual cases of discrimination detected by both CF and CST along with confidence intervals (CI) (5) provided by the CST framework. Second, CST detects cases of individual discrimination that are counterfactually fair. This point is illustrated in Table 3 where we show individual cases that pass CF but still exhibit a discriminatory pattern when looking at Δp. Such results highlight why legal stakeholder require multiple comparisons to insure that c's experience is representative of the discrimination claim. Table 2. Subset of individual discrimination cases detected by both CST (k = 15) and CF with CI under α = 5% Table 3. Subset of individual discrimination cases detected by CST (k = 15) but not by CF with CI under α = 5%. Comp. (ID) 44 55 150 203 218 pc 1.00 0.81 1.00 1.00 0.56 pt 0.00 0.00 0.94 0.88 0.00 Δp 1.00* 0.81* 0.06 0.13 0.56* CI (α = 5%) [1.00, 1.00] [0.65, 0.97] [-0.04, 0.16] [-0.01, 0.26] [0.36, 0.77] Comp. (ID) 5 147 435 1958 2926 pc 0.06 0.50 0.38 0.13 0.75 pt 0.0 0.0 0.0 0.0 0.0 Δp 0.06 0.5* 0.38* 0.13 0.75* CI (α = 5%) [-0.04, 0.16] [0.29, 0.71] [0.18, 0.58] [-0.01, 0.26] [0.57, 0.93] Confidence in results. Finally, notice that Tables 2 and 3 include cases where τ = 0 falls within the individual CI. We detected these cases under Δp > τ (Def. 3.4). Under α = 5%, we would reject these cases as individual discrimination claims with confidence level of 95% since the minimum deviation is covered by the CIs (Def. 3.5). These are cases with small Δp's that are too close to call. We denote those statistically significant cases with the asterisk on Δp. 4.2 Law School Admissions Based on the Law School Success example popularized by Kusner et al. [39, Fig. 2] using US data from the Law School Admission Council survey [66], we create an admissions scenario to a top law school. We consider as protected attributes an applicant's gender, male/female, (G) and race, white/non-white, (R). We add an ADM b () that considers the applicant's undergraduate grade-point average (UGPA) and law school admissions test scores (LSAT) for admission. If an applicant is successful, (cid:98)Y = 1; otherwise (cid:98)Y = 0. We summarize the scenario in Fig. 3. For b (), we use the median entry requirements for the top US law school to derive the cutoff ψ .9 The cutoff is the weighted sum of 60% 3.93 over 4.00 in UGPA and 40% 46.1 over 48 LSAT, giving a total of 20.8; the maximum possible score under b () is 22 for an applicant. The structural equations follow (1), as in [39], with bU and bL denoting the intercepts; β1, β2, λ1, λ2 the weights; and U GPA ∼ N and LSAT ∼ Poi. the probability distributions. G R UGPA LSAT (cid:98)Y M ← UR ← UG R  G U GPA ← bU + β1 * R + λ1 * G + U1,  LSAT ← exp{bL + β2 * R + λ2 * G + U2},  (cid:98)Y = 1{(0.6 * U GPA + 0.4 * LSAT ) > ψ } Fig. 3. The causal knowledge with corresponding SCM M and DAG G behind the law school admissions dataset, with R denoting race (R = 1 for non-white) and G denoting gender (G = 1 for female). 9That being Yale University Law School: https://www.ilrg.com/rankings/law/index/1/asc/Accept 12 Counterfactual Situation Testing The dataset D contains n = 21790 applicants, 43.8% are females and 16.1% are non-whites. Despite the ADM b () being externally imposed by us for the purpose of illustrating the CST framework, under b () only 1.88% of the female applicants are successful compared to 2.65% of the male applicants; similarly, only 0.94% of the non-white applicants are successful compared to 2.58% of the white applicants. Therefore, is b () discriminatory toward non-white and female applicants? We run CST along with ST and CF for each protected attribute. We generate the counterfactual dataset DCF for each R–what would have been the outcome had all applicants been white?–and G–what would have been the outcome had all applicants been male?–and present the results, respectively, in Table 4 and Table 5. Both tables show CST detecting more individual cases of discrimination than ST and CF. Table 4. Number (and %) of individual discrimination cases for the law school admissions scenario based on race. Method CST (w/o) ST [62] CST CF [39] k = 0 0 0 0 231 (6.59%) k = 15 256 (7.3%) 33 (0.94%) 286 (8.16%) 231 (6.59%) k = 30 309 (8.81%) 51 (1.45%) 309 (8.81%) 231 (6.59%) k = 50 337 (9.61%) 61 (1.74%) 337 (9.61%) 231 (6.59%) k = 100 400 (11.41%) 64 (1.83%) 400 (11.41%) 231 (6.59%) Table 5. Number (and %) of individual discrimination cases in for the law school admissions scenario based on gender. Method CST (w/o) ST [62] CST CF [39] k = 0 0 0 0 56 (0.59%) k = 15 78 (0.82%) 77 (0.81%) 99 (1.04%) 56 (0.59%) k = 30 120 (1.26%) 101 (1.06%) 129 (1.35%) 56 (0.59%) k = 50 253 (2.65%) 229 (2.4%) 267 (2.80%) 56 (0.59%) k = 100 296 (3.10%) 258 (2.71%) 296 (3.10%) 56 (0.59%) A similar analysis of Tables 4 and 5 for CST (w/o) versus ST and CST versus CF as in Section 4.1 follows. What the results here highlight, though, is how the two versions of CST compare to each other. In both tables, as k increases, CST (w/o) catches on to CST in the number of cases. This is likely related to how the observations for female/male and non-white/white are distributed in the dataset; though, it also relates to the fact that the difference in size between the groups in each version is just one instance: k versus k + 1. We should observe the same trend in Table 1 if we continued to increase k. These results show that the different runs of CST can eventually reach the same conclusions under a certain k size. In practice, it means that we could implement one of the two versions of CST without compromising the number of detected individual discrimination cases, though further research is needed. 5 CONCLUSION We presented counterfactual situation testing (CST), a new framework for detecting individual discrimination in a dataset of classifier decisions. Compared to other methods, CST uncovers more cases even when the classifier is counterfactually fair. It also equips counterfactual fairness with uncertainty measures. CST acknowledges the pervasive effects of the protected attribute by comparing individual instances in the dataset that are observably different in the factual world but hypothetically similar in the counterfactual world. Thus, the results are not too surprising as CST operationalizes fairness given the difference, which is a more flexible take on similarity between individuals for testing discrimination than the standard, idealized comparison of two individuals that only differ on their protected status. 13 Alvarez and Ruggieri Implementation. CST is, above all, a framework for detecting discrimination that advocates for building the test group on the generated counterfactual of the complainant. How similarity is defined, e.g., obviously conditions the implementation. We presented a k-NN version with d as (6); other implementations are possible and still loyal to CST as long as the construction of the control and test groups follows fairness given the difference. Similarly, detecting discrimination is a difficult, context-specific task. That is why for CST we emphasized the role of the expert in constructing the causal graph necessary for generating the counterfactual instances. Indeed, this step could be optimized using, e.g., causal discovery methods [49], but proving discrimination is time consuming and should remain as such given its sensitive role in our society. Further, we are aware that, e.g., the experimental setting could be pushed further by considering higher dimensions or more complex causal structures. What is the point in doing so, though, if that is not the case with current ADM tools being deployed and audited in real life like the recent Dutch scandal [31]? Proving discrimination is not a problem exclusive to (causal) modeling. With CST we wanted to create a framework aware of the multiple angles to the problem of proving discrimination. The cases we have tackled here are intended to showcase what is possible implementation-wise. Limitations. As future work, promising directions include extending the framework to cases where causal sufficiency does not hold, which is a common risk, and to cases where the decision maker b () is non-binary or of a specific type (e.g., a decision tree). Here, we have also focused on tabular data. Future work should push CST further into more complex datasets to explore the scalability and robustness of the framework. Research Ethics. In this work we used anonymized benchmark (and synthetic) data designed for public use, complying with applicable legal and ethical rules. We disclosed all details of our method in line with the transparency mandates of the ACM Code of Ethics. ACKNOWLEDGMENTS Many thanks to Alejandra Bringas and Ioanna Papageorgiou from NoBIAS for their legal commentary. This work has received funding from the European Union's Horizon 2020 research and innovation program under Marie Sklodowska- Curie Actions (grant agreement number 860630) for the project "NoBIAS - Artificial Intelligence without Bias". This work reflects only the authors' views and the European Research Executive Agency (REA) is not responsible for any use that may be made of the information it contains. REFERENCES [1] [2] Aniya Aggarwal, Pranay Lohia, Seema Nagar, Kuntal Dey, and Diptikalyan Saha. 2018. Automated Test Generation to Detect Individual Discrimination Jeffrey S Adler. 2019. Murder in New Orleans: the creation of Jim Crow policing. University of Chicago Press. in AI Models. CoRR abs/1809.03260 (2018). Joshua D Angrist and Jörn-Steffen Pischke. 2008. Mostly Harmless Econometrics. Princeton University Press. Julia Angwin, Jef Larson, Surya Mattu, and Lauren Kirchner. 2016. Machine Bias. ProPublica (2016). [3] [4] [5] Susan Athey and Guido W Imbens. 2019. Machine learning methods that economists should know about. Annual Review of Economics 11 (2019), 685–725. [6] Solon Barocas and Andrew D Selbst. 2016. Big data's disparate impact. California Law Review 104, 3 (2016), 671–732. [7] Marc Bendick. 2007. Situation Testing for Employment Discrimination in the United States of America. Horizons stratégiques 3, 5 (2007), 17–39. [8] Marianne Bertrand and Esther Duflo. 2017. Field Experiments on Discrimination. Handbook of Economic Field Experiments 1 (2017), 309–393. [9] Marianne Bertrand and Sendhil Mullainathan. 2004. Are Emily and Greg More Employable than Lakisha and Jamal? A Field Experiment on Labor Market Discrimination. The American Economic Review 94, 4 (2004), 991–1013. [10] Emily Black, Samuel Yeom, and Matt Fredrikson. 2020. FlipTest: fairness testing via optimal transport. In FAT*. ACM, 111–121. [11] Eduardo Bonilla-Silva. 1997. Rethinking Racism: Toward a structural interpretation. American Sociological Review (1997), 465–480. [12] Alycia N. Carey and Xintao Wu. 2022. The Causal Fairness Field Guide: Perspectives From Social and Formal Sciences. Frontiers Big Data 5 (2022), 892837. 14 Counterfactual Situation Testing [13] Silvia Chiappa. 2019. Path-Specific Counterfactual Fairness. In AAAI. AAAI Press, 7801–7808. [14] Evgenii Chzhen, Christophe Denis, Mohamed Hebiri, Luca Oneto, and Massimiliano Pontil. 2020. Fair regression with Wasserstein barycenters. In NeurIPS. [15] Evgenii Chzhen and Nicolas Schreuder. 2022. A minimax framework for quantifying risk-fairness trade-off in regression. The Annals of Statistics 50, 4 (2022), 2416–2442. Jacob Cohen. 2013. Statistical power analysis for the behavioral sciences. Routledge. [16] [17] Caroline Criado-Perez. 2019. Invisible Women. Vintage. [18] Alexander D'Amour. 2019. On Multi-Cause Causal Inference with Unobserved Confounding: Counterexamples, Impossibility, and Alternatives. CoRR abs/1902.10286 (2019). Jeffrey Dastin. 2018. Amazon scraps secret AI recruiting tool that showed bias against women. Reuters (2018). [19] [20] Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard S. Zemel. 2012. Fairness through awareness. In ITCS. ACM, 214–226. [21] European Commission. 2021. The Artificial Intelligence Act. https://artificialintelligenceact.eu/. Accessed on January 2nd, 2023. [22] Michael Fix and Raymond J. Struyk. 1993. Clear and Convincing Evidence: Measurement of Discrimination in America. Urban Institute Press. [23] European Union Agency for Fundamental Rights and Council of Europe. 2018. Handbook on European non-discrimination law. https://fra.europa.eu. Downloaded in 2023.. [24] S. R. Foster. 2004. Causation in antidiscrimination law: Beyond intent versus impact. Houston Law Review 41, 5 (2004), 1469–1548. [25] Sainyam Galhotra, Yuriy Brun, and Alexandra Meliou. 2017. Fairness testing: testing software for discrimination. In ESEC/SIGSOFT FSE. ACM, 498–510. [26] Claudia Goldin and Cecilia Rouse. 2000. Orchestrating Impartiality: The Impact of "Blind" Auditions on Female Musicians. American Economic Review 90, 4 (September 2000), 715–741. [27] Philipp Hacker. 2018. Teaching fairness to artificial intelligence: Existing and novel strategies against algorithmic discrimination under EU law. Common Market Law Review 55, 4 (2018). [28] Alex Hanna, Emily Denton, Andrew Smart, and Jamila Smith-Loud. 2020. Towards a critical race methodology in algorithmic fairness. In FAT*. ACM, 501–512. [29] Trevor Hastie, Robert Tibshirani, Jerome H Friedman, and Jerome H Friedman. 2009. The elements of statistical learning: data mining, inference, and prediction. Vol. 2. Springer. James J Heckman. 1998. Detecting Discrimination. Journal of Economic Perspectives 12, 2 (1998), 101–116. [30] [31] Melissa Heikkila. 2022. Dutch scandal serves as a warning for Europe over risks of using algorithms. POLITICO (2022). [32] Lily Hu and Issa Kohler-Hausmann. 2020. What's sex got to do with machine learning?. In FAT*. ACM, 513. [33] Amir-Hossein Karimi, Bernhard Schölkopf, and Isabel Valera. 2021. Algorithmic Recourse: from Counterfactual Explanations to Interventions. In FAccT. ACM, 353–362. [34] Atoosa Kasirzadeh and Andrew Smart. 2021. The Use and Misuse of Counterfactuals in Ethical Machine Learning. In FAccT. ACM, 228–236. [35] Niki Kilbertus, Philip J. Ball, Matt J. Kusner, Adrian Weller, and Ricardo Silva. 2019. The Sensitivity of Counterfactual Fairness to Unmeasured Confounding. In UAI (Proceedings of Machine Learning Research, Vol. 115). AUAI Press, 616–626. [36] Niki Kilbertus, Mateo Rojas-Carulla, Giambattista Parascandolo, Moritz Hardt, Dominik Janzing, and Bernhard Schölkopf. 2017. Avoiding [37] [38] Discrimination through Causal Reasoning. In NIPS. 656–666. Jon M. Kleinberg, Jens Ludwig, Sendhil Mullainathan, and Cass R. Sunstein. 2019. Discrimination in the Age of Algorithms. CoRR abs/1902.03731 (2019). Issa Kohler-Hausmann. 2018. Eddie Murphy and the Dangers of Counterfactual Causal Thinking about Detecting Racial Discrimination. Nw. UL Rev. 113 (2018), 1163. [39] Matt J. Kusner, Joshua R. Loftus, Chris Russell, and Ricardo Silva. 2017. Counterfactual Fairness. In NIPS. 4066–4076. [40] Christos Louizos, Uri Shalit, Joris M. Mooij, David A. Sontag, Richard S. Zemel, and Max Welling. 2017. Causal Effect Inference with Deep Latent-Variable Models. In NIPS. 6446–6456. [41] Karima Makhlouf, Sami Zhioua, and Catuscia Palamidessi. 2020. Survey on Causal-based Machine Learning Fairness Notions. CoRR abs/2010.09553 (2020). [42] Ron Mallon. 2007. A field guide to social construction. Philosophy Compass 2, 1 (2007), 93–108. [43] Lawrence C McCandless, Paul Gustafson, and Adrian Levy. 2007. Bayesian sensitivity analysis for unmeasured confounding in observational studies. Statistics in Medicine 26, 11 (2007), 2331–2347. [44] Deirdre Mulligan. 2022. Invited Talk: Fairness and Privacy. https://www.afciworkshop.org/afcp2022. At the NeurIPS 2022 Workshop on Algorithmic Fairness through the Lens of Causality and Privacy.. [45] Thomas B Nachbar. 2021. Algorithmic fairness, algorithmic discrimination. Florida State University Law Review 48 (2021), 50. Judea Pearl. 2009. Causality: Models, Reasoning, and Inference (2nd ed.). Cambridge University Press. [46] [47] Judea Pearl, Madelyn Glymour, and Noicholas P. Jewell. 2016. Causal Inference in Statistics: A Primer. John Wiley & Sons. [48] Dino Pedreschi, Salvatore Ruggieri, and Franco Turini. 2008. Discrimination-aware data mining. In KDD. ACM, 560–568. [49] [50] Drago Plecko and Elias Bareinboim. 2022. Causal Fairness Analysis. CoRR abs/2207.11385 (2022). Jonas Peters, Dominik Janzing, and Bernhard Schölkopf. 2017. Elements of Causal Inference: Foundations and Learning Algorithms. The MIT Press. 15 Alvarez and Ruggieri [51] Bilal Qureshi, Faisal Kamiran, Asim Karim, Salvatore Ruggieri, and Dino Pedreschi. 2020. Causal inference for social discrimination reasoning. J. Intell. Inf. Syst. 54, 2 (2020), 425–437. [52] Andrea Romei and Salvatore Ruggieri. 2014. A multidisciplinary survey on discrimination analysis. Knowl. Eng. Rev. 29, 5 (2014), 582–638. [53] Dan-Olof Rooth. 2021. Correspondence testing studies. IZA World of Labor 58 (2021). [54] Isabelle Rorive. 2009. Proving Discrimination Cases: The Role of Situation Testing. Centre for Equal Rights and MPG (2009). https://ec.europa.eu/ migrant-integration/library-document/proving-discrimination-cases-role-situation-testing_en [55] Evan K. Rose. 2022. A Constructivist Perspective on Empirical Discrimination Research. Working Manuscript (2022). https://ekrose.github.io/files/ constructivism.pdf [56] Richard Rothstein. 2017. The Color of Law: A Forgotten History of How our Government Segregated America. Liveright Publishing. [57] Salvatore Ruggieri, José M. Álvarez, Andrea Pugnana, Laura State, and Franco Turini. 2023. Can We Trust Fair-AI?. In AAAI. AAAI Press, 15421–15430. [58] Salvatore Ruggieri, Dino Pedreschi, and Franco Turini. 2010. Data mining for discrimination discovery. ACM Trans. Knowl. Discov. Data 4, 2 (2010), 9:1–9:40. [59] Chris Russell, Matt J. Kusner, Joshua R. Loftus, and Ricardo Silva. 2017. When Worlds Collide: Integrating Different Counterfactual Assumptions in Fairness. In NIPS. 6414–6423. [60] Eric C Schneider. 2008. Smack: Heroin and the American city. University of Pennsylvania Press. [61] Maya Sen and Omar Wasow. 2016. Race as a bundle of sticks: Designs that estimate effects of seemingly immutable characteristics. Annual Review of Political Science 19, 1 (2016), 499–522. [62] Binh Luong Thanh, Salvatore Ruggieri, and Franco Turini. 2011. k-NN as an implementation of situation testing for discrimination discovery and prevention. In KDD. ACM, 502–510. [63] Michael Carl Tschantz. 2022. What is Proxy Discrimination?. In FAccT. ACM, 1993–2003. [64] Sandra Wachter, Brent Mittelstadt, and Chris Russell. 2017. Counterfactual explanations without opening the black box: Automated decisions and the GDPR. Harv. JL & Tech. 31 (2017), 841. [65] White House. 2022. Blueprint for an AI Bill of Rights. https://www.whitehouse.gov/ostp/ai-bill-of-rights/. Accessed on January 2nd, 2023. [66] Linda F Wightman. 1998. LSAC national longitudinal bar passage study. Law School Admission Council. [67] D. Randall Wilson and Tony R. Martinez. 1997. Improved Heterogeneous Distance Functions. J. Artif. Intell. Res. 6 (1997), 1–34. [68] Raphaële Xenidis. 2020. Tuning EU equality law to algorithmic discrimination: Three pathways to resilience. Maastricht Journal of European and Comparative Law 27, 6 (2020), 736–758. [69] Ke Yang, Joshua R. Loftus, and Julia Stoyanovich. 2021. Causal Intersectionality and Fair Ranking. In FORC (LIPIcs, Vol. 192). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 7:1–7:20. [70] Lu Zhang, Yongkai Wu, and Xintao Wu. 2016. Situation Testing-Based Discrimination Discovery: A Causal Inference Approach. In IJCAI. IJCAI/AAAI Press, 2718–2724. 16 Counterfactual Situation Testing A SUPPLEMENTARY MATERIAL A.1 Working example for generating counterfactuals We present a simple working example for counterfactual generation. Given the assumptions we undertake for (1) plus p the additional assumption of an additive noise model (ANM)-i.e., S = {X j ← fj (Xpa ( j ) ) + U j } j=1-the generating procedure is straightforward. The ANM assumption is also assumed in Section 4 for the classification scenarios. It is a common model specification assumption that allows to identify more easily the non-random parts of the equation. Suppose we have the following structural causal model M and corresponding directed acyclical graph G: X2 X1 X3 M X1 ← U1 X2 ← α * X1 + U2 X3 ← β1 * X1 + β2 * X2 + U3    where U1, U2, U3 represent the latent variables, X1, X2, X3 the observed variables, and α, β1, β2 the coefficient for the causal effect of, respectively, X1 → X2, X1 → X3, and X2 → X3. Suppose we want to generate the counterfactual for X3, i.e., XCF , had X1 been equal to x1 ∈ X1. In the abduction step, we estimate U1, U2, and U3 given the evidence or what is observed under the specified structural equations: 3 ˆU1 = X1 ˆU2 = X2 − α * X1 ˆU3 = X3 − β1 * X1 + β2 * X2 We can generalize this step for (1) as U j = X j − fj (Xpa ( j ) ) ∀X j ∈ X . This step is an individual-level statement on the residual variation under SCM M. It accounts for all that our assignment functions fj , which are at the population level, cannot explain, or the error terms. In the action step, we intervene X1 and set all of its instances equal to x1 via do (X1 := x1) and obtaining the intervened DAG G′ and SCM M′: X2 do (x1) X3 X1 = x1 X2 ← α * x1 + U2 X3 ← β1 * x1 + β2 * X2 + U3 M′    where no edges come out from X1 as it has been fixed to x1. Finally, in the prediction step, we combine these two steps to calculate XCF under the set of ˆU and the intervened M′: 3 3 ← β1 * x1 + β2 * X2 + ˆU3 XCF ← β1 * x1 + β2 * (α * x1 + ˆU2) + ˆU3 which is done for all instances in X3. This is what is done at a larger scale, for example, in [33] and [47], and also in this paper. The same three steps can apply to X2 (also for X1, though it would be trivial as it is a root note). We can view this approach as a frequentist 10 one for generating counterfactuals, in particular, with regard to the Abduction step. A more Bayesian approach is what is done by [39] where they use a Monte Carlo Markov Chain (MCMC) to draw ˆU by updating its prior distribution with the evidence X to then proceed with the other two steps. In 10This is not a formal distinction, but based on talks with other researchers in counterfactual generation. Such a distinction, to the best of our knowledge, remains an open question. 17 Section 4.2, we used both approaches for generating the counterfactuals and found no difference in the results. We only present in this paper the first approach as it is less computationally expensive. A.2 Sketch of Proof for Proposition 3.6 Alvarez and Ruggieri yCF yc = (cid:98) c (cid:98) yc = 0) and assume the generated counterfactual is (xCF (cid:98) yCF c = 0). Consider the factual tuple (xc, ac = 1, (cid:98) Since , this is a case where counterfactual fairness holds. However, the decision boundary of the model b () can be purposely set such that the k-nearest neighbors of xc are all within the decision ˆY = 0, and less than 1 − τ fraction of are within the decision ˆY = 0. This leads to a Δp > 1 − (1 − τ) = τ, showing that there the k-nearest neighbors of xCF but the sets of k-nearest is individual discrimination. The other way can be shown similarly by assuming c = 0, , aCF c c yCF yc ≠ (cid:98) c (cid:98) neighbors have rates of negative decisions whose difference is lower than τ. B ALGORITHMS FOR K-NN CST IMPLEMENTATION We present the relevant algorithms for the k-NN CST implementation (Section 3.4). The algorithm 1 performs CST while algorithm 2 returns the indices of the top-k tuples with respect to the search centers based on the distance function d. Notice that the main difference in algorithm 1 when creating the neighborhoods is that the search centers are drawn from the factual dataset for the control group D and the counterfactual dataset DCF for the test group. Further, notice that we use the same c (i.e., index) for both as these two data-frames have the same structure by construction. Algorithm 1: run_CST : D, DCF , k Input Output : [pc − pt ] prot _condition ← D [:, prot _attribute ] == prot _value Dc ← D [prot _condition] Dt ← D [¬ prot _condition] prot _idx ← Dc .index .to_list ( ); di f f _list = [ ] for c, row ∈ prot _idx do // get protected (control) search space // get non-protected (test) search space // get idx for all complainants // idx of the top-k tuples for control group // idx of the top-k tuples for test group res_1 ← get _top_k ( D [c, :], Dc, k ); res_2 ← get _top_k ( DCF [c, :], Dt , k ); pc ← sum ( D [res1, target _attribute ] == negative_outcome ) / len (res_1) pt ← sum ( D [res2, target _attribute ] == negative_outcome ) / len (res_2) di f f _list [c ] ← pc − pt end return di f f _list Algorithm 2: get_top_k :t , t _set , k Input Output : [indices ] (idx, dist ) ← k_N N (t, t _set, k + 1); if without search centers then remove (t, idx, dist ); end idx ′ ← sort (idx, dist ); return idx ′ Received 10 May 2023; revised 5 September 2023; accepted 20 September 2023 18 // run k-NN algorithm with k + 1 // remove the center t from idx // sort idx by the distance
http://arxiv.org/abs/2302.11940v1
2023-02-23T11:38:55
2023-02-23T11:38:55
Uncertainty Guided Ensemble Self-Training for Semi-Supervised Global Field Reconstruction
Recovering a globally accurate complex physics field from limited sensor is critical to the measurement and control in the aerospace engineering. General reconstruction methods for recovering the field, especially the deep learning with more parameters and better representational ability, usually require large amounts of labeled data which is unaffordable. To solve the problem, this paper proposes Uncertainty Guided Ensemble Self-Training (UGE-ST), using plentiful unlabeled data to improve reconstruction performance. A novel self-training framework with the ensemble teacher and pretraining student designed to improve the accuracy of the pseudo-label and remedy the impact of noise is first proposed. On the other hand, uncertainty-guided learning is proposed to encourage the model to focus on the highly confident regions of pseudo-labels and mitigate the effects of wrong pseudo-labeling in self-training, improving the performance of the reconstruction model. Experiments include the pressure velocity field reconstruction of airfoil and the temperature field reconstruction of aircraft system indicate that our UGE-ST can save up to 90% of the data with the same accuracy as supervised learning.
[ "Yunyang Zhang", "Zhiqiang Gong", "Xiaoyu Zhao", "Wen Yao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11940v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11940v1", "@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" ]
Uncertainty Guided Ensemble Self-Training for Semi-Supervised Global Field Reconstruction Yunyang Zhang, Zhiqiang Gong, Xiaoyu Zhao, Wen Yao∗ Defense Innovation Institute, Chinese Academy of Military Science, Beijing, China 3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 0 4 9 1 1 . 2 0 3 2 : v i X r a Abstract Recovering a globally accurate complex physics field from limited sensor is critical to the measurement and control in the aerospace engineering. General reconstruction methods for recovering the field, especially the deep learning with more parameters and better representational ability, usually require large amounts of labeled data which is unaffordable. To solve the problem, this paper proposes Uncertainty Guided Ensemble Self-Training (UGE-ST), using plentiful unlabeled data to improve reconstruction performance. A novel self- training framework with the ensemble teacher and pretraining student designed to improve the accuracy of the pseudo-label and remedy the impact of noise is first proposed. On the other hand, uncertainty-guided learning is proposed to encourage the model to focus on the highly confident regions of pseudo-labels and mitigate the effects of wrong pseudo-labeling in self-training, improving the performance of the reconstruction model. Experiments include the pressure velocity field reconstruction of airfoil and the temperature field reconstruction of aircraft system indicate that our UGE-ST can save up to 90% of the data with the same accuracy as supervised learning. Keywords: Semi-supervised learning, Global physics field reconstruction, Ensemble teacher, Uncertainty-guided learning, Pre-training student 1. Introduction Fast and accurate acquisition of global physics field in aerospace engineering is of great significance for stable operation of monitoring system, smooth control of the process. Since aircraft systems are required to operate in severe environments, the direct measurement of global physics field is extremely difficult. Therefore, developing reconstruction of the global physics field based on sensor observations is essential for the measurement and control in the aerospace engineering [1, 2]. Traditional reconstruction methods, including principal component regression, partial least squares (PLS) regression, support vector machine (SVM), and artificial neural network (ANN) [3, 4, 5, 6, 7], is usually data-driven. However, these methods are limited by the complexity of aircraft systems, these methods are typical shallow methods with limited representational ability which can no longer be adequate for reconstructing global fields from a limited number of sensors in high-dimensional nonlinear complex physics, such as fluid dynamics [8], thermodynamics [9], electromagnetism [10], and solid mechanics [11]. ∗Corresponding author Preprint submitted to Journal of LATEX Templates February 24, 2023 Deep learning with multiple layers has shown their potential in strong high-dimensional nonlinear problems. It can automatically learn abstract and subtle features from large amounts of data, and already demonstrated their good performance applying to physics field reconstruction [1]. Generally, the good performance is highly depended on plentiful labeled data. However, obtaining plentiful training samples for the current task is impossible. Although massive amounts of data are accumulated during industrial processes, these data are mostly unlabeled and cannot be used directly under supervised paradigms. Therefore, it is significance for industrial processes to efficiently utilize these abundant unlabeled data to improve reconstruction performance. The semi-supervised learning (SSL) method can use only limited labeled and abundant unlabeled data to train the model, and has been successfully applied in computer vision [12], natural language processing [13], and other fields. SSL methods can be loosely classified into consistency based SSL and pseudo-label based SSL [14, 15, 16]. The former SSL is mainly based on the smoothness assumption, which is not reasonable for regression probem, and therefore cannot be applied in such a typical regression problem of global field reconstruction. On the contrary, the pseudo-label based SSL, such as self-training method [17, 18] which employ the teacher model to label the abundant unlabeled data and provides the student model for training, is flexible and not constrained by specific assumptions. Since self-training is well adapted to the task at hand, this paper mainly focuses on the self-training global physics field reconstruction. Despite the good performance of the self-training method, it still mainly suffers from overfitting and noise interference. Especially in the reconstruction problem, the noise in the pseudo-label has a serious erosion on the prediction. Therefore, the unsolved question is how to avoid the effect of inaccurate pseudo-labeling on the model performance? To address the problem, this paper firstly improves the accuracy of the pseudo-label so as to reduce the damage of the pseudo-label noise on the performance of the student model. Specifically, this paper using ensemble teacher to jointly guide the training of student models. The errors in pseudo-label created by a single teacher model can be mitigated by the "collective voting" of multiple teacher models, resulting in high- quality pseudo-labels. Secondly, the student model is guided to concentrate on the ground truth or the areas without noise, thereby eliminating noise interference and improving the performance of the student model. During the training, the uncertainty in the pseudo-label is quantified based on the ensemble teacher, which is further used as a guided information of noise in the pseudo-label. Based on uncertainty guided learning, the student model ignores the noise region in the pseudo-label during the training process, thus avoiding the propagation and accumulation of noise between the teacher and student model. Then, in order to further reduce the interference of noise to the student model, pre-training student separates the pseudo-label from the labeled data during the training. So that the noise in the pseudo-label can be "forgetten", and the student model is forced to focus on the ground-truth to obtain higher performance. Based on the above strategy, Uncertainty Guided Ensemble Self-Training (UGE-ST) is proposed in this paper, including ensemble teacher, uncertainty guided learning and pre-training student. The innovations of this paper are summarized as follows: 1. This paper proposes a novel self-training framework designed to improve the reconstruction accuracy of 2 unlabeled training data with the ensemble teacher and pre-training student that reduce the damage of the pseudo-label noise on the student model. 2. This paper proposes uncertainty-guided learning for self-training to improve the performance of the model, which uses the uncertainty as the guided information of the student and supervises the learning process by reducing the effects of noise pseudo label. 3. Two physics field reconstruction problems verify the effectiveness of the proposed method. Experiments show that the proposed UGE-ST in this paper is able to substantially improve model performance with limited labeled data, and is in an advanced position compared to supervision and other semi-supervised methods. The layout of this paper is given as follows. In Section II, the problem definition and the self-training framework are shortly overviewed. Then, the proposed UGE-ST are illustrated in detail, including ensemble teacher, uncertainty guided learning and pre-training student. After that, the effectiveness and feasibility of proposed approach are demonstrated in two case in Section III. Finally, conclusion is made. 2. Methods 2.1. Problem Definition Consider an two-dimensional discretized physical field Γ described by the governing partial differential equations: ̇wx = f (wx, t; θ) , x ∈ Γ (1) where wx is the state vector in point x of physical field Γ that depends on parameters θ and time t; f represents the nonlinear function that governs the physical field Γ. In practice, due to the complexity of the physical system, the state w of the whole system is usually unavailable. But the state of system on limited points can be observed by the sensors. We denote a(t; θ) as the observed state at time t. The purpose of physical field reconstruction is to reconstruct a complete state w(t; θ) of physical field from a limited observed state a(t; θ), w(t; θ) = F (a(t; θ)) (2) where a(t; θ) = {ay, y ∈ Λ ⊆ Γ}, Λ is the set of observed points; F is the required reconstruction model which is deep neural network in this paper. It is worth mentioning that, although the physical system is time-dependent, the reconstruction model only relies on the observed state at the current step for predicting the system states. In order to construct the deep reconstruction model, we take the limited observation state a(t; θ) as the input of model and the complete state w(t; θ) as the output of model. 3 Figure 1: Self-training method. 2.2. Self-training Framework Generally, the performance of the deep learning model is significantly influenced by the amount of labeled data that is manually annotated. However, collecting large amounts of data is labor-intensive and time- consuming. Semi-supervised learning is considered a promising technology to mitigate the demand for label data, thereby reducing the cost of deep learning model applications in practical engineering. and abundant unlabeled data Dul = {(xul Semi-supervised learning aims to generalize from a combination set of limited labeled data Dl = {(xl i)}N i=1 i=1, where M (cid:29) N . Self-training is a classic semi-supervised learning method based on the idea of pseudo-label. The main steps are divided into two steps, as shown in i , yul i )}M i, yl the Fig. 1: 1. Firstly, a small amount of labeled data Dl is used to train the teacher model M T with L1 loss, which is formulated as: Lsup = 1 |Dl| (cid:88) xl∈Dl 1 HW HW (cid:88) i=0 (cid:12) (cid:12)yl i − ˆyT i (cid:12) (cid:12) (3) where yl i and ˆyT i represent the ground truth and the prediction of teacher model, W and H represent the width and height of physical field. 2. Secondly, training the student model M S through the teacher model M T . The teacher model M T is used to predict the unlabeled data Dul, and the predictions are adopted as the pseudo-label of unlabeled data. At the same time, labeled data is combined with pseudo-label to train the student model. The constraint can be formulated as: Lsemi = 1 |Dl| (cid:88) xl∈Dl 1 HW + 1 |Dul| (cid:88) xul∈Dul 1 HW HW (cid:88) i=0 HW (cid:88) i=0 (cid:12) (cid:12)yl i − ˆyS i (cid:12) (cid:12) (cid:12) (cid:12)yp i − ˆyS i (cid:12) (cid:12) 4 (4) Step 2Step 1labeled datalDTeacher ModelTMPredictionsˆTyPredictionsˆTyGround truthlyGround truthlysup011ˆlllHWiixDilTLyyDHW==−Teacher ModelTMTeacher ModelTMunlabeled dataulDlabeled datalDlabeled datalDunlabeled dataulDunlabeled dataulDGround truthlys001111ˆˆllululHWHWemiiiiixDixulSipSDllLyyyyDHWDHW===−+−Pseudo-labelpyPseudo-labelpyPredictionsˆSyPredictionsˆSyStudent ModelSMStudent ModelSM where ˆyS i is the prediction of student model. Discussion about self-training. Unlike the consistency regularization method, the self-training method does not depend on the smoothness assumption and is simple and versatile. However, the student model is trained based on the pseudo-label predicted by the teacher model. When there is a large noise in the pseudo-label, the performance of the student model is affected. In order to avoid the influence of false label noise on the student model, we improve the self-training method in two aspects. The direct idea is to improve the accuracy of pseudo labels as much as possible so that the noise in pseudo labels is as small as possible to avoid noise's influence on the performance degradation of student models. Another idea is to prevent the effect of noise in pseudo labels on student model as much as possible when the accuracy of pseudo labels is determined. Figure 2: Uncertainty guided ensemble self-training method. 2.3. Uncertainty Guided Ensemble Self-Training This paper proposes UGE-ST including ensemble teacher, uncertainty guided learning, and pre-training student to improve the performance of reconstruction. The pre-training student and the uncertainty-guided 5 Step 2Step 1Ground truthlyGround truthlysup011ˆlllHWiixDilTLyyDHW==−Pseudo-labelpyPseudo-labelpyPredictionsˆSyPredictionsˆSyStudent ModelSMStudent ModelSMunlabeled dataulDunlabeled dataulDUncertainty weight1()pWNormU=−Step 3Student ModelSMStudent ModelSMStudent ModelSM()un011ˆululHWiixDilSupLWiyyDHW==−sup011ˆlllHWiixDilSLyyDHW==−Ensemble TeachereTMEnsemble TeachereTMPredictionsˆeTyPredictionsˆeTylabeled datalDlabeled datalDEnsemble TeachereTMEnsemble TeachereTMUncertaintypUUncertaintypUlabeled datalDlabeled datalDGround truthlyGround truthlyPredictionsˆSyPredictionsˆSy learning improve the performance of the student model by avoiding the influence of noise in pseudo-label as much as possible. While the ensemble teachers directly improve the accuracy of pseudo-label, further enhances the performance of the student model. The proposed method framework is shown in Fig. 2. Compared with the basic self-training method, our method consists of three steps: 1. Firstly, a small amount of labeled data Dl is used to train the ensemble teacher model M eT with L1 loss, which is formulated in Eq. 3. 2. Secondly, similar with basis self-training, the student model M S is trained by the ensemble teacher M eT . The predictions of the ensemble teacher M eT on the unlabeled data Dul are adopted as the pseudo-label. Then, the uncertainty of the pseudo-label is quantified and normalized as weights to be multiplied with pseudo-label supervision constraint, getting the uncertainty-guided learning constraint Lun. 3. Thirdly, a small amount of labeled data Dl is employed to re-train the student model M S with L1 loss. 2.3.1. Ensemble teacher Ensemble learning is a classic idea in deep learning, which combines multiple weakly supervised models in order to obtain a better and more comprehensive, strongly supervised model. The potential idea of ensemble learning is that even if a weak model gets a wrong prediction, other models can correct the error. Generally speaking, the performance of the model obtained by ensemble learning is better than that of a single model. Due to the scarcity of labeled data for teacher model training, the performance of a single teacher model is poor, resulting in large pseudo-label noise. Here we combine ensemble learning with self-training, using ensemble learning to train and combine multiple teacher models to obtain a more accurate pseudo-label. Specifically, We first initialize multiple teacher models (cid:8)M T 1 , M T 2 , * * * , M T n (cid:9). Multiple teacher models are trained by labeled data Dl follow the supervised loss as shown in Eq. 3 to obtain ensemble teachers (cid:9). The unlabeled data Dul is predicted by ensmeble teachers M eT acquiring results M eT = (cid:8)M T (cid:8)ˆyeT T (Dul). Then, average multiple predictions to obtain pseudo-label yp for 1 , ˆyeT i = Mi 1 , M T 2 , * * * , ˆyeT n (cid:9), where ˆyeT 2 , * * * , M T n the unlabeled data as follows: 2.3.2. Uncertainty guided learning yp = mean (cid:0)ˆyeT i (cid:1) , i = 1, 2, ..., n (5) Although using ensemble teachers can improve the accuracy of pseudo-label, noise still exists and affects the training of student model. We expect to filter out the noise in the pseudo-label so that the student model can learn more areas with low or no noise. Here we propose using uncertainty to guide student model training. Uncertainty can reflect the noise in the model prediction results, usually, the area with large noise is also (cid:9) can be obtained for the same sample by uncertain. Since multiple different predictions (cid:8)ˆyeT 1 , ˆyeT ensemble teachers M eT , we naturally use variance to measure the uncertainty of pseudo-label yp predicted by 2 , * * * , ˆyeT n the teacher model as follows: Up = var (cid:0)ˆyeT i (cid:1) , i = 1, 2, ..., n (6) Then, this study normalizes the uncertainty Up into range (0, 1), and weight the pixel value according to the uncertainty of each pixel in the pseudo-label. Among them, regions with larger uncertainty are given smaller 6 weights, and areas with smaller uncertainty are given larger weights. The large weights force the model to learn more areas with smaller noise, while the smaller weights ignore regions with larger noise, thus avoiding the influence of noise on the model during the learning process. This paper defines the uncertainty weights as follows: In the end, combining uncertainty weights and pseudo-label loss to obtain uncertainty guided learning loss: W = 1 − N orm(Up) (7) Lun = 1 |Dul| (cid:88) xul∈Dul 1 HW HW (cid:88) i=0 W (i) (cid:12) (cid:12)yp i − ˆyS i (cid:12) (cid:12) (8) 2.3.3. Pre-training student The training of neural networks relies on empirical risk minimization. The more data used for training, the more consistent the distribution of datasets with that of all data, and the closer the empirical risk is to the expected risk. When the amount of data is small, the empirical risk effect is not ideal because empirical risk minimization tends to bring about overfitting. Therefore, it is necessary to expand the dataset so that the training data distribution is as consistent as possible with the full data distribution. Although the self- training introduces a large amount of pseudo-label data, the presence of noise in the pseudo-label mistake the distribution with that of the real data, which eventually causes the empirical risk minimization to fail. In order to avoid the interference of pseudo-label, this paper proposes a two-stage approach to train the student model, namely pre-training student. The idea is to exploit the catastrophic forgetting phenomenon in neural networks. First, the student model M S is pre-trained using pseudo-label yp, and the loss function is shown as Eq. 9. The student model M S is then retrained using a small amount of labeled data Dl, the constraint can be formulated as: Lsup = 1 |Dl| (cid:88) xl∈Dl 1 HW HW (cid:88) i=0 (cid:12) (cid:12)yl i − ˆyS i (cid:12) (cid:12) (9) 3. Experiments In this section, the effectiveness of the proposed STP method was verified through its application to two study cases. The first case is the airfoil velocity and pressure field reconstruction, and the second is the electronic devices temperature field reconstruction. In order to demonstrate the superiority of the proposed UGE-ST, the fully and semi supervised learning methods based on deep learning is implemented to compare performance, where the semi supervised methods include Mean teacher [19], co-training[20], and the vanilla self-training [18], and the rest remains unified. 3.1. Airfoil velocity and pressure field reconstruction 3.1.1. Background and experimental setting Reconstructing the pressure and velocity field of airfoil based on the finite sensors is significant to the design of the airfoil. This section adopts airfoil data [21] to verify the validity of proposed method. The 7 convolutional neural network (CNN) is employed to implement the proposed UGE-ST method. CNN is the popularly deep learning model, which is widely used in computer vision [22, 23]. Compared with Multilayer Perceptron (MLP), CNN with smaller parameters has the ability to process spatial information. Thus it is suitable for processing regular physical field data. Here we adopt U-net [24] as the backbone of model. U-net is an effective CNN structure for image-to-image regression. It can capture the overall and detailed features of the image, and has the advantages of multi-scale fusion and processing large images. Figure 3: Voronoi tessellation and global pressure field. To use a CNN framework, the sparse observation data needs to be projected into an image in an appropriate manner. Similar to [1], this paper maps local measurements to the spatial domain via Voronoi tessellation [25] as shown in the left of Fig. 3. The grey dots in the figure indicate the placed sensors. Compared with the form of sparse measurement as input directly, voronoi tessellation can retain the spatial information of the sensor measurement points. Besides, the output of deep learning model is the global velocity or pressure field of airfoil as shown in the right of Fig. 3. In this case, a total of 1200 labeled data and 800 unlabeled data are generated using finite element sim- ulation. In order to fully verify the applicability of the proposed method, we divides the labeled data into different scale partition protocols include 25, 50, 100, 200, 400, and 800. In addition, 400 labeled samples are set aside as test data. In order to evaluate the performance of methods, we employ the Mean Absolute Error (MAE) as the evaluation metric, which is expressed as: MAE = 1 N N (cid:88) i=1 |ˆyi − yi| (10) where yi is the ground truth, ˆy is the prediction, N is the number of samples. All experiments are implemented based on the Pytorch framework. The model training is completed on a high-performance computer server, and its computing resource allocation is Intel(R) Xeon(R) Gold 6242 CPU @ 2.80 GHz, Nvidia GTX 3090 GPU with 24GB vRAM, and 500 GB RAM. We initialize the weights of whole network randomly and train the models with AdamW optimizer. In order to ensure the fairness, the parameters of the optimizer used in experiments are consistent. The initial learning rate is η = 0.001. Besides, Cosine Annealing Warm Restarts scheduler is selected as our learning rate policy. In all experiments, the epoch is fixed as 100, the batch size is set to 8 for both labeled and unlabeled samples. 8 Voronoi tessellationGlobal pressure field 3.1.2. Prediction Results and Analysis Table 1: Performance comparison under different number of labeled data for the airfoils velocity and pressure field. Number of labeled data 25 50 100 200 400 800 Pressure 2.350 0.745 0.599 0.442 0.402 0.376 Supervision x-axis velocity 0.543 0.170 0.105 0.087 0.072 0.065 y-axis velocity 0.128 0.508 0.034 0.024 0.021 0.020 Pressure 14.71 6.510 2.570 1.091 0.853 0.890 Mean teacher x-axis velocity 2.049 0.684 0.297 0.155 0.139 0.127 y-axis velocity 0.842 0.391 0.125 0.059 0.056 0.042 Pressure 2.495 0.875 0.745 0.614 0.515 0.443 Co-training x-axis velocity 0.549 0.168 0.118 0.105 0.093 0.095 y-axis velocity 0.138 0.056 0.035 0.027 0.024 0.027 Pressure 2.298 0.714 0.531 0.385 0.347 0.337 Self-training x-axis velocity 0.538 0.161 0.097 0.079 0.063 0.059 y-axis velocity 0.125 0.048 0.029 0.021 0.017 0.017 Pressure 1.637 0.690 0.425 0.298 0.277 0.281 UGE-ST(Ours) x-axis velocity 0.429 0.121 0.064 0.047 0.037 0.042 y-axis velocity 0.128 0.032 0.019 0.014 0.013 0.013 The prediction results concerning MAE are tabulated in Tab. 1, and the main purpose is to compare the prediction performances of different methods. The results shows that the proposed UGE-ST significantly exceeds the supervised baseline and other semi-supervised methods regardless of the number of labels. Taking pressure field prediction as an example, the performance of UGE-ST surpass the supervised baseline by 30%, 29%, 33%, 31%, and 25%, under 25, 100, 200, 400, and 800 labeled data respectively. Compared with the self-training, UGE-ST acquired 29%, 20%, 23%, 20%, and 17% improvements, respectively. As for the velocity in x and y axis, our method also achieves a better performance. Besides, the results also shows that the number of labeled data affects the model prediction accuracy, and the performance of all models decays significantly with decreasing of labels number. It is worth mentioning that other semi-supervised methods, such as Mean teacher and Co-training, achieve poor prediction accuracy, even worse than the supervised baseline. The reason is that such end-to-end methods receive poor performance during the training process's early stage, further spoilt pseudo-label with large noise. As the iterative learning process proceeds, the noise in the pseudo-label accumulates, disrupting the learning process of the model and eventually leading to a degradation of the model's performance. The self-training is a two-stage training approach, in which the teacher model is first trained with labeled data, and then the student model is guided by the teacher model. As the trained teacher model contains less noise than that in the early training stage, the performance degradation caused by error accumulation is mitigated. In other 9 words, although there is still noise affecting the student model, this two-stage training approach ensures the performance of student is theoretically not lower than that of the teacher model. And our method can further improve the performance of the teacher model with the help of ensemble learning on the base of self-training, while avoiding the noise in the teacher model to affect the learning of the student model by the uncertainty guided learning and the pre-training student. Figure 4: Visualization of predictions and errors for pressure field. The predictions and errors visualization of supervision, self-training and UGE-ST for the pressure field are shown in Fig. 4. As seen from that, all three methods can predict the trend of the pressure field, and our approach can achieve less error. As shown in row six of Fig. 4, the predictions of the self-training and 10 PredictionsErrorsUE-ST(Ours)SupervisionSelf-trainingPredictionsPredictionsPredictionsErrorsErrorsErrors supervised methods have large errors around the airfoil, while our approach suppresses the errors well. 3.2. Electronic devices temperature field reconstruction 3.2.1. Background and experimental setting The normal work of aircraft systems highly depends on the stable environment temperature and heat dissipation is essential to guarantee the working environment due to the internally generated heat. Thermal management of aircraft systems is an effective way to guarantee the proper working environment. Temperature field reconstruction [26] is a base task to obtain the real-time working environment of aircraft systems, which is adopt to verify the performance of our method. Figure 5: Sensors location and temperature field. To verify the generality of the proposed method, in this case we employ another classical neural network, viz. MLP, to implement our UGE-ST. The temperature field data is shown in the Fig. 5. The grey dots in the figure indicate the placed sensors. MLP directly accepts sparse observations of the temperature field as model inputs while outputting the temperature value of points in the whole field. The temperature field data size used in this paper is 200 ∗ 200, the number of placed sensors are 20, and we construct a MLP with 5 layers whose structure is shown in the Tab. 2 . Layers Input layer Hidden layer 1 Hidden layer 2 Hidden layer 3 Output layer Table 2: The structure of MLP. Number of neurons 20 128 1280 4800 40000 In this case, a total of 1500 labeled data and 2000 unlabeled data are generated using finite element simulation. Similar to the first study case, we divides the labeled data into different scale partition protocols include 25, 50, 100, 200, 500, and 1000. Besides, 500 labeled samples are set aside as test data. This section also uses MAE as the evaluation metric. All experimental settings are consistent with the first case, except that the epoch is set to 80. 11 Temperature fieldElectronic components layout 3.2.2. Prediction Results and Analysis The prediction results concerning MAE are tabulated in Tab. 3, and the main purpose is to test the generalization and superiority of our method. The results shows that the proposed UGE-ST significantly exceeds other methods in different cases. The performance of UGE-ST surpass the supervised baseline by 33%, 35%, 36%, 30%, 25%, and 24%, under 25, 50, 100, 200, 500, and 1000 labeled data, respectively. Compared with the self-training, UGE-ST acquired 31%, 29%, 25%, 17%, 20%, and 14% improvements, respectively. Besides, the results also shows that with the decrease of labeled data numbers, the gain obtained by our method is increasing. In another words, our method can also achieve competitive results in the case of few shot. From the perspective of changes in the number of labeled data, our method achieves an accuracy of 6.018e- 03 with 100 samples, lower than 6.948e-03 acquired by the supervised method under 1000 samples. The observation shows that our approach can greatly reduce the amount of labeled data required for training with the same performance. The proposed method can save ten times the number of samples in some cases and at least two times the number of samples. The predictions and errors visualization of supervision, self-training and UGE-ST for the temperature field are shown in Fig. 6. Although supervision and self-training can predict the trend of the temperature field, large errors still exist. In comparison, the proposed method can outstandingly reduce the error in these regions. As shown in row six of Fig. 6, the predictions of the self-training and supervised methods have large errors in the lower left corner, while our approach suppresses the errors well. Table 3: Performance comparison under different number of labeled data for the temperature field. Number of labeled data 25 50 100 200 500 1000 Supervision 1.718e-02 1.224e-02 9.403e-03 7.887e-03 7.241e-03 6.948e-03 Mean teacher 2.178e-02 1.974e-02 1.315e-02 1.033e-02 9.225e-03 6.779e-03 Co-training 2.085e-02 1.207e-02 8.550e-03 6.717e-03 6.124e-03 6.580e-03 Self-training 1.654e-02 1.120e-02 8.054e-03 6.624e-03 6.786e-03 6.087e-03 UGE-ST(Ours) 1.146e-02 7.942e-03 6.018e-03 5.529e-03 5.431e-03 5.262e-03 3.3. Ablation Studies This section conducts the ablation studies to exhibit the roles of ensemble teachers, uncertainty guided learning and pre-training student. All the experiments are run based on the temperature field reconstruction task with 200 labeled data. 3.3.1. The influence of ensemble teachers number The effect of the ensemble teachers is shown in Fig. 7. We set the number of ensemble teachers to 1 (means no ensemble), 2, 3, and 5, respectively. Pseudo-label means the prediction provided by the ensemble teachers. PT student represent the pre-training student model supervised by the ensemble teachers but without 12 Figure 6: Visualization of predictions and errors for temperature field 13 UE-ST(Ours)SupervisionSelf-trainingPredictionsPredictionsPredictionsErrorsErrorsErrors uncertainty guided learning. UGE-ST is the model trained only with labeled data based on the pre-training student. The results indicate that with the increase of ensemble teachers number, the accuracy of pseudo-label is significantly improved, further leading to the performance increase of PT student. Although the UGE-ST is trained based on PT student, the performance is slightly improved. The reason is that this paper uses pseudo-label and labeled data to train the model successively, which reduces the influence of noise on the student model and also reduces the impact of pseudo-label on the final performance of the student model. We finally chose the ensemble number of 3 to balance the accuracy and training cost. Figure 7: MAE changes with the number of ensemble teachers 3.3.2. The influence of pre-training student The effect of the pre-training is shown in Tab. 4. We set the ensemble number to 1 to avoid the influence of ensemble teachers. Pseudo-label means the prediction provided by the one teacher. PT student represent the pre-training student model supervised by the one teacher but without uncertainty guided learning. UGE-ST is the model trained only with labeled data based on the PT student. The results show that the method of pre- training student can well avoid the influence of noise in pseudo-label to the student model. In comparison, the MAE of self-training which combine labeled data and pseudo-label is 6.624e-03, while our method is 5.763e-03. Table 4: The influence of the pre-training student. models Pseudo-label Self-training PT student UGE-ST MAE 7.887e-03 6.624e-03 7.647e-03 5.763e-03 14 3.3.3. The influence of uncertainty guided learning The influence of uncertainty guided learning is shown in Tab. 5. PT student and UGE-ST achieve better performance when guided by uncertainty. It is worth noting that the gain of PT student from uncertainty guided learning is greater than that of UGE-ST. The pre-training also causes this phenomenon; the impact of the pseudo-label on the final performance of the student model is damped due to the successive training of pseudo-label and labeled data. Table 5: The influence of uncertainty guided learning under different number of ensemle teachers. Number of ensemle teachers 2 3 5 w/o uncertainty PT student 6.926e-03 6.750e-03 6.365e-03 UGE-ST 5.641e-03 5.538e-03 5.531e-03 w/ uncertainty PT student 6.4e-03 6.446e-03 6.243e-03 UGE-ST 5.618e-03 5.529e-03 5.434e-03 4. Conclusion In this paper, we propose a semi-supervised method, uncertainty-guided integrated self-training (UGE- ST), which aims to improve the reconstruction performance with few labeled data. UGE-ST consists of ensemble teachers, uncertainty-guided learning, and pre-trained students. The ensemble teachers employ ensemble learning to construct multiple teacher models to guide the training of student models jointly and the "collective voting" of the ensemble teachers to mitigate the pseudo-label errors generated by individual teacher models, resulting in the accurate pseudo-label. Uncertainty-guided learning is based on ensemble teachers to quantify the uncertainty in pseudo-label, forcing students to learn regions with less noise in pseudo-label and avoiding the propagation and accumulation of noise in the student. Pre-trained student train the student model separately using pseudo-labeled and labeled data, enabling the student model to forget the noise in the pre-learned pseudo-label. Experiments show that the uncertainty-guided ensemble self-training method proposed in this paper can substantially improve the reconstruction performance of the global physics field with limited labeled data. Conflict of interest statement On behalf of all authors, the corresponding author states that there is no conflict of interest. Replication of results The code of the proposed method is publicly available at https://github.com/meitounao110/UGE-ST 15 References [1] K. Fukami, R. Maulik, N. Ramachandra, K. Fukagata, K. Taira, Global field reconstruction from sparse sensors with voronoi tessellation-assisted deep learning, Nature Machine Intelligence 3 (11) (2021) 945– 951. [2] W. Yan, D. Tang, Y. Lin, A data-driven soft sensor modeling method based on deep learning and its application, IEEE Transactions on Industrial Electronics 64 (5) (2016) 4237–4245. [3] K. Pearson, Liii. on lines and planes of closest fit to systems of points in space, The London, Edinburgh, and Dublin philosophical magazine and journal of science 2 (11) (1901) 559–572. [4] H. Wold, Estimation of principal components and related models by iterative least squares, Multivariate analysis (1966) 391–420. [5] Q. Jiang, X. Yan, H. Yi, F. Gao, Data-driven batch-end quality modeling and monitoring based on optimized sparse partial least squares, IEEE Transactions on Industrial Electronics 67 (5) (2019) 4098– 4107. [6] W. Yan, H. Shao, X. Wang, Soft sensing modeling based on support vector machine and bayesian model selection, Computers & chemical engineering 28 (8) (2004) 1489–1498. [7] K. Desai, Y. Badhe, S. S. Tambe, B. D. Kulkarni, Soft-sensor development for fed-batch bioreactors using support vector regression, Biochemical Engineering Journal 27 (3) (2006) 225–239. [8] D. Kochkov, J. A. Smith, A. Alieva, Q. Wang, M. P. Brenner, S. Hoyer, Machine learning–accelerated com- putational fluid dynamics, Proceedings of the National Academy of Sciences 118 (21) (2021) e2101784118. [9] Q. Hernandez, A. Badias, D. Gonzalez, F. Chinesta, E. Cueto, Deep learning of thermodynamics-aware reduced-order models from data, Computer Methods in Applied Mechanics and Engineering 379 (2021) 113763. [10] V. Puzyrev, Deep learning electromagnetic inversion with convolutional neural networks, Geophysical Journal International 218 (2) (2019) 817–832. [11] E. Haghighat, M. Raissi, A. Moure, H. Gomez, R. Juanes, A physics-informed deep learning framework for inversion and surrogate modeling in solid mechanics, Computer Methods in Applied Mechanics and Engineering 379 (2021) 113741. [12] Y. Zhang, Z. Gong, X. Zheng, X. Zhao, W. Yao, Semi-supervision semantic segmentation with uncertainty- guided self cross supervision, arXiv preprint arXiv:2203.05118. [13] C.-I. Lai, Y.-S. Chuang, H.-Y. Lee, S.-W. Li, J. Glass, Semi-supervised spoken language understanding via self-supervised speech and language model pretraining, in: ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), IEEE, 2021, pp. 7468–7472. 16 [14] J. E. Van Engelen, H. H. Hoos, A survey on semi-supervised learning, Machine Learning 109 (2) (2020) 373–440. [15] D. Berthelot, N. Carlini, I. Goodfellow, N. Papernot, A. Oliver, C. A. Raffel, Mixmatch: A holistic approach to semi-supervised learning, Advances in neural information processing systems 32. [16] X. Zhai, A. Oliver, A. Kolesnikov, L. Beyer, S4l: Self-supervised semi-supervised learning, in: Proceedings of the IEEE/CVF International Conference on Computer Vision, 2019, pp. 1476–1485. [17] Y. Zou, Z. Yu, X. Liu, B. Kumar, J. Wang, Confidence regularized self-training, in: Proceedings of the IEEE/CVF International Conference on Computer Vision, 2019, pp. 5982–5991. [18] L. Yang, W. Zhuo, L. Qi, Y. Shi, Y. Gao, St++: Make self-training work better for semi-supervised semantic segmentation, in: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022, pp. 4268–4277. [19] A. Tarvainen, H. Valpola, Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results, Advances in neural information processing systems 30. [20] A. Blum, T. Mitchell, Combining labeled and unlabeled data with co-training, in: Proceedings of the eleventh annual conference on Computational learning theory, 1998, pp. 92–100. [21] N. Thuerey, K. Weissenow, L. Prantl, X. Hu, Deep learning methods for reynolds-averaged navier–stokes simulations of airfoil flows, AIAA Journal 58 (1) (2020) 25–36. [22] Z. Gong, P. Zhong, W. Hu, Statistical loss and analysis for deep learning in hyperspectral image classifi- cation, IEEE transactions on neural networks and learning systems 32 (1) (2020) 322–333. [23] Z. Gong, P. Zhong, Y. Yu, W. Hu, S. Li, A cnn with multiscale convolution and diversified metric for hyperspectral image classification, IEEE Transactions on Geoscience and Remote Sensing 57 (6) (2019) 3599–3618. [24] O. Ronneberger, P. Fischer, T. Brox, U-net: Convolutional networks for biomedical image segmentation, in: International Conference on Medical image computing and computer-assisted intervention, Springer, 2015, pp. 234–241. [25] G. Vorono ̈ı, New applications of continuous parameters to the theory of quadratic forms, Z. Reine Angew. Math 134 (1908) 198. [26] X. Chen, Z. Gong, X. Zhao, W. Zhou, W. Yao, A machine learning modelling benchmark for temperature field reconstruction of heat-source systems, arXiv preprint arXiv:2108.08298. 17
http://arxiv.org/abs/2302.11939v6
2023-10-15T05:07:17
2023-02-23T11:37:39
One Fits All:Power General Time Series Analysis by Pretrained LM
Although we have witnessed great success of pre-trained models in natural language processing (NLP) and computer vision (CV), limited progress has been made for general time series analysis. Unlike NLP and CV where a unified model can be used to perform different tasks, specially designed approach still dominates in each time series analysis task such as classification, anomaly detection, forecasting, and few-shot learning. The main challenge that blocks the development of pre-trained model for time series analysis is the lack of a large amount of data for training. In this work, we address this challenge by leveraging language or CV models, pre-trained from billions of tokens, for time series analysis. Specifically, we refrain from altering the self-attention and feedforward layers of the residual blocks in the pre-trained language or image model. This model, known as the Frozen Pretrained Transformer (FPT), is evaluated through fine-tuning on all major types of tasks involving time series. Our results demonstrate that pre-trained models on natural language or images can lead to a comparable or state-of-the-art performance in all main time series analysis tasks, as illustrated in Figure 1. We also found both theoretically and empirically that the self-attention module behaviors similarly to principle component analysis (PCA), an observation that helps explains how transformer bridges the domain gap and a crucial step towards understanding the universality of a pre-trained transformer.The code is publicly available at https://github.com/DAMO-DI-ML/One_Fits_All.
[ "Tian Zhou", "PeiSong Niu", "Xue Wang", "Liang Sun", "Rong Jin" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11939v6", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11939v6", "@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 t c O 5 1 ] G L . s c [ 6 v 9 3 9 1 1 . 2 0 3 2 : v i X r a One Fits All: Power General Time Series Analysis by Pretrained LM Tian Zhou∗ Peisong Niu∗ Xue Wang∗ Liang Sun Rong Jin† {tian.zt,niupeisong.nps,xue.w,liang.sun,jinrong.jr}@alibaba-inc.com Abstract Although we have witnessed great success of pre-trained models in natural language processing (NLP) and computer vision (CV), limited progress has been made for general time series analysis. Unlike NLP and CV where a unified model can be used to perform different tasks, specially designed approach still dominates in each time series analysis task such as classification, anomaly detection, forecasting, and few-shot learning. The main challenge that blocks the development of pre-trained model for time series analysis is the lack of a large amount of data for training. In this work, we address this challenge by leveraging language or CV models, pre-trained from billions of tokens, for time series analysis. Specifically, we refrain from altering the self-attention and feedforward layers of the residual blocks in the pre-trained language or image model. This model, known as the Frozen Pretrained Transformer (FPT), is evaluated through fine-tuning on all major types of tasks involving time series. Our results demonstrate that pre-trained models on natural language or images can lead to a comparable or state-of-the-art performance in all main time series analysis tasks, as illustrated in Figure 1. We also found both theoretically and empirically that the self-attention module behaviors similarly to principle component analysis (PCA), an observation that helps explains how transformer bridges the domain gap and a crucial step towards understanding the universality of a pre-trained transformer. The code is publicly available at https://github.com/DAMO-DI-ML/One_Fits_All. 1 Introduction Time series analysis is a fundamental problem Hyndman & Athanasopoulos (2021) that has played an important role in many real-world applications Wen et al. (2022), such as retail sales forecasting Böse et al. (2017); Courty & Li (1999) , imputation of missing data for economic time series Friedman (1962) anomaly detection for industrial maintenance Gao et al. (2020), and classification of time series from various domain Ismail Fawaz et al. (2019). Numerous statistical and machine learning methods have been developed for time series analysis in the past. Inspired by its great success in natural language processing and computer vision Vaswani et al. (2017); Devlin et al. (2019); Dosovitskiy et al. (2021); Rao et al. (2021), transformer has been introduced to various time series tasks with promising results Wen et al. (2023), especially for time series forecasting Lim et al. (2021); Zhou et al. (2022, 2021); Wu et al. (2021); Nie et al. (2022). We have recently witnessed the rapid development of foundation models in NLP. The key idea is to pre-train a large language model from billions of tokens to facilitate model training for downstream tasks, particularly when we have a few, sometimes even zero, labeled instances. Another advantage of ∗ Equal contribution † Corresponding authors 37th Conference on Neural Information Processing Systems (NeurIPS 2023). Figure 1: Model performance comparison on various tasks. foundation models is that they provide a unified framework for handling diverse tasks, which contrasts conventional wisdom where each task requires a specially designed algorithm. However, so far, little progress has been made to exploit pre-trained or foundation models for time series analysis. One main challenge is the lack of the large amount of data to train a foundation model for time series analysis. The largest data sets for time series analysis is less than 10GB Godahewa et al. (2021), which is much smaller than that for NLP. To address this challenge, we propose to leverage pre-trained language models for general time series analysis. Our approach provides a unified framework for diverse time series tasks, such as classification, anomaly detection, forecasting, and few-shot or zero-shot learning. As shown in Figure 1, using the same backbone, our approach performs either on-par or better than the state-of-the-art methods for all main time series analysis tasks. Besides extensive empirical studies, we also investigate why a transformer model pre-trained from the language domain can be adapted to time series analysis with almost no change. Our analysis indicates that the self-attention modules in the pre-trained transformer acquire the ability to perform certain non-data-dependent operations through training. These operations are closely linked to principal component analysis over the input patterns. We believe it is this generic function performed by the self-attention module that allows trained transformer models to be so-called universal compute engine Lu et al. (2022) or general computation calculator Giannou et al. (2023). We support our claims by conducting an empirical investigation of the resemblance in model behaviors when self-attention is substituted with PCA, and by providing a theoretical analysis of their correlation. Here we summarize our key contributions as follows: 1. We propose a unified framework that uses a frozen pre-trained language model to achieve a SOTA or comparable performance in all major types of time series analysis tasks supported by thorough and extensive experiments, including time series classification, short/long-term forecasting, imputation, anomaly detection, few-shot and zero-sample forecasting. 2. We found, both theoretically and empirically, that self-attention performs a function similar to PCA, which helps explain the universality of transformer models. 3. We demonstrate the universality of our approach by exploring a pre-trained transformer model from another backbond model (BERT) or modality (computer vision) to power the time series forecasting. The remainder of this paper is structured as follows. Section 2 briefly summarizes the related work. Section 3 presents the proposed detailed model structure. In Section 4, we conduct a thorough and extensive evaluation of the performance of cross-modality time series analysis using our proposed method in seven main time series analysis tasks compared to various SOTA baseline models. Section 5 2 GPT2-backboneTimesNetPatchTSTETSformerLightTSDLinearStationaryFEDformerAutoformerInformerReformerLong-term ForecastingShort-term ForecastingAnomaly DetectionImputationClassification74.00Zero-shotFew-shot87.000.040.3016.0011.500.4020.500.2276.0065.002.1034.002.201.4016.500.1480.0069.001.3026.00 presents various ablation studies, and Section 6 demonstrates the universality of our proposed method using pre-trained models with another structure or pre-trained from another modality. In Section 7, we provide a theoretical explanation of the connection between self-attention and PCA. Finally, in Section 8, we discuss our results and future directions. Due to space limit, more extensive discussion of related work, experimental results, and theoretical analysis are provided in the Appendix. 2 Related Work In this section, we provide short reviews of literature in the areas of time series analysis, in-modality transfer learning, and cross-modality knowledge transfer learning. We postpone the discussion of works for end-to-end time series analysis to Appendix B, due to the limited space. In-modality Transfer Learning through pre-trained models In recent years, a large number of research works have verified the effectiveness of the pre-trained model from NLP, CV to Vision- and-Language (VL). Latest studies for NLP focus on learning contextual word embeddings for downstream tasks. With the increase of computing power, the very deep transformer models have shown powerful representation ability in various language tasks. Among them, BERT Devlin et al. (2019) uses transformer encoders and employs masked language modeling task that aims to recover the random masked tokens within a text. OpenAI proposed GPT Radford & Narasimhan (2018) that trains transformer decoders on a large language corpus and then fine-tunes on task-specific data. GPT2 Radford et al. (2019) is trained on larger datasets with much more parameters and can be transferred to various downstream tasks. Since transformer models can adapt to various inputs, the idea of pre-training can also be well adapted to visual tasks. DEiT Touvron et al. (2021) proposed a teacher-student strategy for transformers with convolution neural networks (CNNs) as the teacher model and achieves competitive performance. BEiT Bao et al. (2022) converts images as visual tokens and successfully uses the BERT model in CV. However, because of the insufficient training sample, there is little research on pre-trained models on general time series analysis that cover all major tasks like CV or NLP domain. Cross-modality knowledge transfer Since transformers can handle different modal tasks through tokenizing the inputs to embeddings, it is also an interesting topic whether the transformers have universal representation ability and can be used for transferring between various domains. The VL pre-trained model VLMo Bao et al. (2021) proposed a stagewise pre-training strategy that utilizes frozen attention blocks pre-trained by image-only data to train the language expert. One of the most related works which transfer knowledge from a pre-trained language model to other domains is Lu et al. (2022), which studies the strong performance of a frozen pre-trained language model (LM) compared to an end-to-end transformer alternative learned from other domains' data. Another relative work for knowledge transfer to the time series is the Voice2series Yang et al. (2021), which leverages a pre-trained speech processing model for time series classification and achieves superior performance. To the best of our knowledge, no previous research has investigated cross-modality knowledge transfer for the time series forecasting task, let alone general time series analysis. 3 Methodology 3.1 Model Structure The architecture we employ is depicted in Figure 2. We utilize parameters from NLP pretrained transformer models for time series analysis, with a focus on the GPT2 model Radford et al. (2019). We also experiment with other models, such as BERT Devlin et al. (2019) and BEiT Bao et al. (2022), to further demonstrate that the universal performance of cross-domain knowledge transfer exists in a wide range of pre-trained models. Frozen Pretrained Block Our architecture retains the positional embedding layers and self-attention blocks from the pre-trained models. As self-attention layers and FFN (Feedforward Neural Networks) contain the majority of learned knowledge from pre-trained language models, we opt to freeze the self-attention blocks while fine-tuning. Positional Embeddings and Layer Normalization To enhance downstream tasks with minimal effort, we fine-tune the positional embeddings and layer normalization layer, which is considered a 3 Figure 2: Model architecture. Pre-trained parameters are transferred to the time series forecasting tasks. Self-attention and Feedforward layers in the transformer blocks are frozen while only the embedding layer, normalization layers, and output layer require training. standard practiceLu et al. (2022); Houlsby et al. (2019). As a result, we retrain these components during fine-tuning. Input Embedding Given our goal of applying the NLP pre-trained model to various tasks and a new modality, we must redesign and train the input embedding layer. This layer is responsible for projecting the time-series data to the required dimensions of the specific pre-trained model. To accomplish this, we use linear probing, which also reduces the number of parameters required for training. Normalization Data normalization is crucial for pre-trained models across various modalities. In addition to the layer norm utilized in pre-trained LM, we also incorporate a simple data normalization block, reverse instance norm Kim et al. (2022), to further facilitate knowledge transfer. This normalization block simply normalizes the input time series using mean and variance, and then adds them back to the output. Patching To extract local semantic information, we utilize patching Nie et al. (2022) by aggregating adjacent time steps to form a single patch-based token. Patching enables a significant increase in the input historical time horizon while maintaining the same token length and reducing infor- mation redundancy for transformer models. In our architecture, we apply patching after instance normalization. 4 Main Time Series Analysis Tasks Our proposed method excels in various downstream time series analysis tasks through fine-tuning. To demonstrate the effectiveness of our approach, we conduct extensive experiments on major types of downstream tasks, including time series classification, anomaly detection, imputation, short/long-term forecasting and few-shot/zero-shot forecasting. To ensure a fair comparison, we use GPT2-backbone FPT and adhere to the experimental settings of TimesNet Wu et al. (2023). Due to the space limit, only the summarized results are presented below except zero-shot forecasting. Full experimental results of the other six downstream tasks can be found in Appendix D.3, D.2, D.7, H.6, H.7, H.8, H.9 respectively. Baselines We select representative baselines and cite their results from Wu et al. (2023), which includes the most recent and quite extensive empirical studies of time series. The baselines in- clude CNN-based models: TimesNet Wu et al. (2023); MLP-based models: LightTS Zhang et al. (2022) and DLinear Zeng et al. (2023); Transformer-based models: Reformer Kitaev et al. (2020), Informer Zhou et al. (2021), Autoformer Wu et al. (2021), FEDformer Zhou et al. (2022), Non- stationary Transformer Liu et al. (2022), ETSformer Woo et al. (2022), PatchTST Nie et al. (2022). Besides, N-HiTS Challu et al. (2022) and N-BEATS Oreshkin et al. (2019) are used for short-term forecasting. Anomaly Transformer Xu et al. (2021) is used for anomaly detection. XGBoost Chen & Guestrin (2016), Rocket Dempster et al. (2020), LSTNet Lai et al. (2018), LSSL Gu et al. (2021), 4 Instance Norm + PatchingPositional EmbeddingsInput EmbeddingOutput Linear LayerFrozenTransformer BlocksMulti-Head AttentionAdd & Layer NormFeed ForwardAdd & Layer Norm❄""❄"×"Pretrained ParamsFine-tune!Frozen❄ Pyraformer Liu et al. (2021), TCN Franceschi et al. (2019) and Flowformer Huang et al. (2022) are used for classification. 4.1 Main Results Overall, as shown in Figure 1, GPT2-backbone FPT outperforms other models in most tasks, including long/short-term forecasting, classification, anomaly detection, imputation, and fow-shot/zero-short forecasting. This confirms that time series tasks can also take advantage of cross-modality transferred knowledge. In the following, we use GPT2(K) to represent GPT2-backbone with first K Layers. 4.2 Imputation Setups We conduct experiments on six popular real-world datasets, including 4 ETT datasets Zhou et al. (2021) (ETTh1, ETTh2, ETTm1, ETTm2), Electricity and Weather, where the data-missing is common. Following the settings of TimesNet, different random mask ratios ({12.5%, 25%, 37.5%, 50%}) of time points are selected for the evaluation on various proportions of missing data. Results The results are shown in Table 1 that GPT2(3) FPT achieves the best performance on most datasets. Particularly, compared to the previous SOTA TimesNet, GPT2(3) FPT yields a relative 11.5% MSE reduction on ETTh1,and a 4.1% MSE reduction on average on six benchmark datasets. It verifies that the proposed method can also effectively mine temporal patterns of incomplete time series. Table 1: Imputation task. We randomly mask {12.5%, 25%, 37.5%, 50%} time points of 96-length time series. The results are averaged from 4 different mask ratios. Black: best, Red: second best. Appendix H.8 shows the full results. Methods GPT2(3) DLinear MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE Stationary Autoformer FEDformer ETSformer PatchTST TimesNet Reformer Informer LightTS ETTm1 0.028 0.105 0.027 0.107 0.047 0.140 0.120 0.253 0.104 0.218 0.093 0.206 0.062 0.177 0.036 0.126 0.051 0.150 0.071 0.188 0.055 0.166 ETTm2 0.021 0.084 0.022 0.088 0.029 0.102 0.208 0.327 0.046 0.151 0.096 0.208 0.101 0.215 0.026 0.099 0.029 0.105 0.156 0.292 0.157 0.280 0.069 0.173 0.078 0.187 0.115 0.224 0.202 0.329 0.284 0.373 0.201 0.306 0.117 0.246 0.094 0.201 0.103 0.214 0.161 0.279 0.122 0.245 ETTh1 0.048 0.141 0.049 0.146 0.065 0.163 0.367 0.436 0.119 0.250 0.142 0.259 0.163 0.279 0.053 0.152 0.055 0.156 0.337 0.452 0.234 0.352 ETTh2 0.090 0.207 0.092 0.210 0.072 0.183 0.214 0.339 0.131 0.262 0.132 0.260 0.130 0.259 0.100 0.218 0.101 0.225 0.222 0.328 0.200 0.313 ECL Weather 0.031 0.056 0.030 0.054 0.034 0.055 0.076 0.171 0.055 0.117 0.052 0.110 0.099 0.203 0.032 0.059 0.031 0.057 0.045 0.104 0.038 0.087 Average 0.047 0.127 0.049 0.132 0.060 0.144 0.197 0.309 0.123 0.228 0.119 0.224 0.112 0.229 0.056 0.142 0.061 0.151 0.165 0.273 0.134 0.240 4.3 Time Series Classification Setups To evaluate the model's capacity for high-level representation learning, we employ sequence-level clas- sification. Specifically, we follow the same setting as TimesNet: For classification, 10 multivariate UEA clas- sification datasets Bagnall et al. (2018) are selected for evaluation, including gesture, action, audio recognition medical diagnosis and other practical tasks. Results As shown in Figure 3, GPT2(6) FPT achieves an average accuracy of 74.00%, surpassing all baselines including TimesNet (73.60%). Specifically, compared to recent published patch-transformer-based models Nie et al. (2022) , GPT2(6) FPT surpasses it by a large margin 9.0% which shows the prior NLP transfer knowledge can indeed help in time series representation. 4.4 Time Series Anomaly Detection Figure 3: Model comparison in classi- fication. The results are averaged from 10 subsets of UEA. Appendix H.6 shows the full results. Setups Detecting anomalies in time series is vital in industrial applications, ranging from health mon- itoring to space & earth exploration. We compare models on five commonly used datasets, including https://archive.ics.uci.edu/ml/datasets/ElectricityLoadDiagrams 20112014 https://www.bgc-jena.mpg.de/wetter/ 5 AverageAccuracy(%)XGBoostDLinearPatchTSTTCNLightTS.FEDformerPyraformerLSSLETSformerAutoformerReformerLSTNetTransformerInformerRocketStationaryFlowformerTimesNetGPT2(6)66.0067.5067.9070.3070.4070.7070.8070.9071.0071.1071.5071.8071.9072.1072.5072.7073.0073.6074.00 SMDSu et al. (2019), MSLHundman et al. (2018), SMAPHundman et al. (2018), SWaTMathur & Tippenhauer (2016) and PSMAbdulaal et al. (2021). To perform a fair comparison, only the classical reconstruction error is used for all baseline models to the make the setting the same as TimesNet. Results Table 2 demonstrates that GPT2(6) FPT also achieves the best performance with the averaged F1-score 86.72%, surpassing previous SOTA method TimesNet by 1.7%. Thus, in addition to its proficiency in representing complete sequences for classification purposes, GPT2(6) FPT is capable of detecting infrequent anomalies within time series. Table 2: Anomaly detection task. We calculate the F1-score (as %) for each dataset. ∗. in the Transformers indicates the name of ∗former. Black: best, Red: second best. Appendix H.7 shows the full results. Methods GPT2(6) Ours SMD MSL SMAP SWaT PSM 86.89 82.45 72.88 94.23 97.13 TimesNet* PatchTS. ETS. FED. LightTS DLinear Stationary Auto. Pyra. Anomaly.** In. Re. LogTrans. Trans. 84.61 81.84 69.39 93.02 97.34 84.62 78.70 68.82 85.72 96.08 83.13 85.08 85.03 78.57 69.50 70.76 84.91 93.19 91.76 97.23 82.53 78.95 69.21 93.33 97.15 77.10 84.88 69.26 87.52 93.55 84.72 77.50 71.09 79.88 97.29 85.11 83.04 79.05 84.86 71.12 71.09 92.74 91.78 93.29 82.08 85.49 83.31 71.18 83.10 79.40 81.65 75.32 84.06 84.40 69.92 70.40 81.43 82.80 77.10 73.61 76.21 79.57 69.97 80.52 76.74 76.60 79.56 78.68 69.70 80.37 76.07 76.88 86.72 Average * We reproduce the results of TimesNet by https://github.com/thuml/Time-Series-Library. ** We replace the joint criterion in Anomaly Transformer with reconstruction error for fair comparison. 84.26 82.57 82.87 84.97 82.46 84.23 82.08 82.79 85.24 80.50 78.83 77.31 4.5 Long-term Forecasting Setups Eight popular real-world benchmark datasets Wu et al. (2023), including Weather, Traffic , Electricity, ILI , and 4 ETT datasets (ETTh1, ETTh2, ETTm1, ETTm2), are used for long-term forecasting evaluation. Additional information regarding the discussion on the input length setting can be found in the appendix H.10. Results As shown in Table 3, GPT2(6) FPT achieves comparable performance with PatchTST and outperforms other baselines. Specifically, compared with recent published SOTA method TimesNet, GPT2(6) FPT yields a relative 9.3% average MSE reduction. Table 3: Long-term forecasting task. All the results are averaged from 4 different prediction lengths, that is {24, 36, 48, 60} for ILI and {96, 192, 336, 720} for the others. Black: best, Red: second best. Appendix D.3 shows the full results. Methods GPT2(6) FEDformer MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE Stationary Autoformer ETSformer PatchTST TimesNet Reformer Informer LightTS DLinear Weather 0.237 0.270 0.259 0.287 0.271 0.334 0.261 0.312 0.249 0.300 0.309 0.360 0.225 0.264 0.288 0.314 0.338 0.382 0.634 0.548 0.803 0.656 0.427 0.426 0.458 0.450 0.542 0.510 0.491 0.479 0.423 0.437 0.440 0.460 0.413 0.430 0.570 0.537 0.496 0.487 1.040 0.795 1.029 0.915 ETTh1 0.346 0.394 0.414 0.427 0.439 0.452 0.602 0.543 0.431 0.447 0.437 0.449 0.330 0.379 0.526 0.516 0.450 0.459 4.431 1.729 6.736 2.191 ETTh2 ETTm1 0.352 0.383 0.400 0.406 0.429 0.425 0.435 0.437 0.357 0.378 0.448 0.452 0.351 0.387 0.481 0.456 0.588 0.517 0.961 0.734 0.799 0.671 ETTm2 0.266 0.326 0.291 0.333 0.293 0.342 0.409 0.436 0.267 0.334 0.305 0.349 0.255 0.315 0.306 0.347 0.327 0.371 1.410 0.810 1.479 0.915 1.925 0.903 2.139 0.931 2.497 1.004 7.382 2.003 2.169 1.041 2.847 1.144 1.443 0.798 2.077 0.914 3.006 1.161 5.137 1.544 4.724 1.445 0.167 0.263 0.192 0.295 0.208 0.323 0.229 0.329 0.166 0.263 0.214 0.327 0.161 0.253 0.193 0.296 0.227 0.338 0.311 0.397 0.338 0.422 0.414 0.294 0.620 0.336 0.621 0.396 0.622 0.392 0.434 0.295 0.610 0.376 0.390 0.264 0.624 0.340 0.628 0.379 0.764 0.416 0.741 0.422 ILI ECL Traffic Average 0.516 0.407 0.596 0.433 0.662 0.473 1.303 0.616 0.562 0.436 0.701 0.489 0.446 0.386 0.633 0.465 0.757 0.511 1.836 0.871 2.081 0.954 4.6 Short-term Forecasting Setups To fully evaluate different algorithms in forecasting tasks, we also conduct short-term forecasting (with relatively short forecasting horizon) experiments on M4 Makridakis et al. (2018), contains marketing data of various frequencies. Results The results in Table 4 show that the performance of GPT2-backbone (6) FPT is superior to advanced Transformer-based and MLP-based models, and comparable to TimesNet and N-BEATS. 4.7 Few-shot Forecasting The large language model (LLM) has demonstrated remarkable performance in both few-shot and zero-shot learning settings Brown et al. (2020); OpenAI (2023). It can be argued that few-shot and http://pems.dot.ca.gov https://gis.cdc.gov/grasp/fluview/fluportaldashboard.html 6 Table 4: Short-term forecasting task on M4. The prediction lengths are in [6, 48] and results are weighted averaged from several datasets under different sample intervals. Black: best, Red: second best. Appendix H.9 shows the full results. Methods GPT2(6) TimesNet PatchTST N-HiTS N-BEATS ETSformer LightTS DLinear FEDformer Stationary Autoformer Informer Reformer SMAPE 11.991 1.600 MASE OWA 0.861 11.829 1.585 0.851 12.059 1.623 0.869 11.927 1.613 0.861 11.851 1.599 0.855 14.718 2.408 1.172 13.525 2.111 1.051 13.639 2.095 1.051 12.840 1.701 0.918 12.780 1.756 0.930 12.909 1.771 0.939 14.086 2.718 1.230 18.200 4.223 1.775 zero-shot learning also represent the ultimate tasks for a universal time series forecasting model. To extensively evaluate the representation power of the GPT2(6) for time series analysis, we conduct experiments under few-shot and zero-shot learning settings. Similar to traditional experimental settings, each time series is split into three parts: training data, validation data, and test data. For few-shot learning, only a certain percentage (10%, 5%) timesteps of training data are used. The results of 10% few-shot learning are shown in Table 5. Compared to TimesNet, DLinear, PatchTST and other methods, GPT2(6) FPT achieves the best performance. Traditionally, CNN- based and single MLP-based models are considered more data-efficient for training and suitable for few-shot learning methods. In comparison to convolution-based TimesNet and MLP-based DLinear models, GPT2(6) FPT demonstrates a relative average MSE reduction of 33.3% and 13.5% respectively. We add a comparison with traditional algorithms (ETS, ARIMA, NaiveDrift) in the Appendix D.5 as well, and GTP2(6)FPT also surpass all those traditional methods. Table 5: Few-shot learning task on 10% data. All the results are averaged from 4 different prediction lengths ({96, 192, 336, 720}). Black: best, Red: second best. Appendix D.2 shows the detailed results of 10% and 5% data. Methods GPT2(6) Autoformer MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE FEDformer ETSformer Stationary PatchTST TimesNet Reformer Informer LightTS DLinear Weather 0.238 0.275 0.279 0.301 0.301 0.283 0.284 0.324 0.241 0.279 0.300 0.342 0.318 0.322 0.317 0.359 0.289 0.322 0.597 0.494 0.545 0.469 0.590 0.524 0.869 0.628 0.691 0.599 0.638 0.561 0.633 0.542 0.701 0.596 0.914 0.639 1.179 0.833 1.375 0.877 1.199 0.808 1.249 0.833 ETTh1 ETTh2 0.397 0.421 0.479 0.465 0.608 0.538 0.466 0.475 0.415 0.431 0.488 0.499 0.461 0.454 0.893 0.713 2.655 1.159 3.871 1.512 3.485 1.485 ETTm1 0.464 0.441 0.676 0.537 0.411 0.429 0.721 0.605 0.501 0.466 0.802 0.628 0.797 0.577 0.979 0.714 0.970 0.704 1.192 0.820 1.425 0.856 ETTm2 0.293 0.335 0.319 0.353 0.316 0.368 0.463 0.488 0.296 0.343 1.341 0.930 0.332 0.366 0.447 0.487 0.987 0.755 3.369 1.439 3.977 1.586 0.176 0.269 0.323 0.392 0.180 0.280 0.346 0.428 0.180 0.269 0.431 0.478 0.443 0.479 0.659 0.617 0.441 0.488 1.194 0.890 0.965 0.768 0.440 0.309 0.951 0.535 0.496 0.371 0.663 0.425 0.430 0.305 0.749 0.446 1.453 0.815 1.913 0.936 1.247 0.684 1.534 0.811 1.550 0.821 ECL Traffic Average 0.371 0.367 0.556 0.458 0.429 0.409 0.511 0.472 0.385 0.376 0.687 0.559 0.674 0.522 0.912 0.665 1.137 0.712 1.850 0.967 1.888 0.974 4.8 Zero-shot forecasting This task is used to evaluate the cross datasets adaption ability of our proposed algorithm, i.e. how well a model is able to perform on dataset A (without any training data from A) when it is trained from dataset B. The results are summarized in Table 6. The GPT2(6) FPT model consistently outperforms all recent state-of-the-art transformer and MLP-based time series forecasting methods. Compared to recently published state-of-the-art MLP-based method Dlinear, convolution-based method Timesnet, and transformer-based method Patchtst, GPT2(6)FPT demonstrates a relative average metric reduction of 13.1%,13.6% and 7.3%, respectively. Also, the proposed method is comparable to N-BEATS without any meta-learning design and outperforms N-BEATS in the ELECTR dataset. We attribute this to the knowledge transfer capability from the FPT model. 5 Ablations In this section, we conduct several ablations on model selection and effectiveness of pre-training. The detailed results are shown in Appendix H. We introduce several variants, GPT2(0) FPT, GPT2(6) without freezing and GPT2(6) without pre-training. Model Selection We separately analyze the number of GPT2 layers and the fine-tuning parameters selection. The results in Appendix H show that GPT2 with 6-layers is a sound choice compared to full or few layers and partially freezing can avoid catastrophic forgetting, enabling fine-tuning without overfitting. 7 Table 6: Zero-shot learning results. Dataset-specific metrics aggregated over each dataset. A lower value indicates better performance. The source dataset of M3, Tourism, Electricity are M4. For M4, the source data for N-BEATS is FRED, and M3 for other models. Black: best, Red: second best, Violet: third best. Appendix D.7 shows full results. Methods Metric M4 sMAPE M3 sMAPE TOURISM ELECTR N D × 100 MAPE Average N-BEATS DLinear TimesNet PatchTST ETSformer LightTS Stationary FEDformer Autoformer Informer Reformer GPT2(6) 11.70 15.33 13.55 13.22 27.74 13.62 13.32 15.04 20.02 19.04 14.09 13.12 12.44 14.03 14.17 13.06 16.03 17.90 15.29 13.53 15.87 15.82 13.37 13.06 18.82 28.51 28.84 27.10 180.40 66.99 43.75 31.55 40.39 35.82 25.48 22.14 17.8 17.6 19.3 17.3 44.2 19.6 22.0 18.4 33.9 21.2 21.6 17.2 15.19 18.86 18.96 17.67 67.09 29.52 23.59 19.63 27.54 22.97 18.63 16.38 Effectiveness of Pre-training The results are shown in Table 7, GPT2(6) FPT outperforms both GPT2(0) FPT and GPT2-random-initialized, suggesting that GPT2 with pre-training parameters can achieve improvement on times series tasks. Besides, GPT2(6) FPT performs better than GPT2- unfrozen, demonstrating that partially freezing also helps. Also, results in Appendix H.2 show that random initialized GPT2(6) with freezing performs poorly and the pre-trained knowledge is instrumental for time series tasks. Table 7: Ablation study on 10% data. All the results are averaged from 4 different prediction lengths. No Freeze represents GPT2(6) without freezing, No Pretrain represents GPT2(6) without pre-training. Black: best. Methods GPT2(6) GPT2(0) No Freeze No Pretrain MSE MAE MSE MAE MSE MAE MSE MAE Weather ETTh1 ETTh2 0.237 0.427 0.346 0.270 0.426 0.394 0.263 0.874 0.666 0.297 0.647 0.559 0.273 0.753 0.447 0.302 0.596 0.451 0.277 1.326 0.502 0.305 0.743 0.479 6 Exploring Transfer Learning from others: The Unexceptional Nature of GPT2-based-FPT We also present experiments on BERT-backbond FPT Devlin et al. (2019) model and the image- pretrained BEiT-backbone FPT model Bao et al. (2022) to illustrate the generality of pre-trained models for cross-domain knowledge transferring. The results in Table 8 demonstrate that the ability of knowledge transfer is not exclusive to GPT2-based pre-trained language models. Subsequently, our theoretical analysis will shed light on the universality of this phenomenon. Table 8: Results of frozen pretrained transformer variants on 5% ETTh2 and ETTm2. All the results are averaged from 4 different prediction lengths. Black: best. Appendix H.5 shows the full results. Methods GPT2(6) DLinear MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE Autoformer FEDformer PatchTST BERT(6) BEiT(6) ETTh2 ETTm2 0.400 0.308 0.433 0.346 0.452 0.318 0.451 0.357 0.459 0.315 0.454 0.357 0.827 0.399 0.615 0.426 0.439 0.314 0.448 0.352 0.441 0.381 0.457 0.404 0.470 0.388 0.489 0.433 7 Training/Inferencing Cost Analysis of computational cost is helpful for investigating the practicality of the LLM-based model. The results can be found in table 9. Each baseline model comes in two variants, featuring model 8 Table 9: Training parameters and Training/Inference Cost Comparison Model Training Params Training Params Percentages Training Time for 1 step(s) Inference Time for 1 Batch(s) FEDformer-32 TimesNet-32 PatchTST-32 FEDformer-768 TimesNet-768 PatchTST-768 GPT-2(3)-768 GPT-2(6)-768 44k 2M 543K 33M 42M 20M 4M 4M 100 100 100 100 100 100 6.12 4.6 0.889 0.747 0.043 0.208 5.723 0.457 0.093 0.104 0.170 0.302 0.022 0.056 2.162 0.123 0.032 0.054 hidden dimensions of 32 and 768, which align with GPT-2's specifications. Furthermore, the majority of the baseline models consist of three layers. We assessed the computational cost using a batch from ETTh2 (with a batch size of 128) on a 32G V100 GPU. The results indicate that GPT-2(3) has substantially enhanced time efficiency and reduced parameter quantity compared to baselines with the same model dimension. This was a surprise since we initially anticipated that this large language model might be slower. However, we surmise that the efficient optimization of huggingface's GPT model implementation primarily accounts for such a significant improvement in time costs. Furthermore, GPT-2(3) and GPT-2(6) demonstrate a mere 6.12% and 4.60% proportion of learnable parameters among the overall parameter size, respectively. 8 Towards Understanding the Universality of Transformer: Connecting Self-Attention with PCA The observation, i.e. we can directly use a trained LM for time series forecasting without having to modify its model, makes us believe that the underlying model is doing something very generic and independent from texts despite it being trained from text data. Our analysis aims to show that part of this generic function can be related to PCA, as minimizing the gradient with respect to the self-attention layer seems to do something similar to PCA. In this section, we take the first step towards revealing the generality of self-attention by connecting the self-attention with principal component analysis (PCA). Moreover, when coming the question of why fine-tuning is restricted to the embedding layer and layer norm, following our hypothesis that the pre-trained LM as a whole performs something generic, partially fine-tuning any of its components may break the generic function and lead to relatively poor performance for time series analysis. For each layer, we calculate and perform statistical analysis of the pairwise token similarity values. Specifically, we denote each output feature map with shape of (b, n, d), where b is the batch size, n is the number of tokens, and d is the dimension of each token feature. We calculate the cosine similarity, and the resulting pairwise similarity matrix of shape (b, n, n). Next we count the number of occurrences of similarity values within each interval as a simple statistical analysis. Our analysis is motivated by the observation that the within-layer token similarity increases with deeper layers in transformer. We report the layer-wise average token cosine similarity on ETTh2 dataset in Figure 4 (a, c), where we mix weights from pre-trained LM with weights randomly sampled from Gaussian distribution. Here we summarize our observations: a) in a randomly initialed GPT2 (6) model, the token similarity is low among all layers (0.1 − 0.2); b) when gradually switched to the pretrained GPT2 model, the token similarity significantly increases in the deep layers and eventually reaches more than 0.9 in the last layer. One potential explanation for the increasing token similarity is that all the token vectors are projected into the low-dimensional top eigenvector space of input patterns. To verify this idea, we further conduct experiments where we replace the self-attention module with PCA and find token similarity patterns remain unchanged according to Figure 4 (b), which further justifies the potential connection between PCA and self-attention. To build the theoretical connection between PCA and self-attention, we first analyze the gradi- ent structure of self-attention. Let X = (x1, . . . , xN )⊤ ∈ RN ×D be the input pattern, and let f (X) = (f1(X), . . . , fN (x))⊤ : RN ×D (cid:55)→ RN ×D be the function for self-attention, i.e., fi(X) = softmax(XAX ⊤)X where A = WQW ⊤ K ∈ RD×D. 9 Figure 4: (a, c) The performance and token similarity within samples with respect to each layer with different random mixed ratio. Pre-trained parameters are mixed with random initial parameters according to certain proportions. (b) Token similarity within samples when replacing the attention with PCA. Lemma 8.1. Let the Jacobian J = (cid:104) ∂fi(X) ∂xj (cid:105)N i,j=1 input pattern, then we have (cid:12) (cid:12)xj − (cid:80)N (cid:12) |J|2 ≤ |A|2 (cid:12) 2 (cid:12) (cid:12) (cid:80)N i=1 + |A|2 2 (cid:80)N (cid:0)Pi,i + 1 (cid:80)N i̸=j Pi,j ∆ = |A|2 i Axk) . This lemma reveals an important gradient structure of J. The proof of essentially follows the analysis in Kim et al. (2021), and we include it in Appendix G for completeness. k=1 Pi,kxk and Pi,j = j=1 |xi|2 (cid:80)N represent (cid:1) (cid:12) (cid:12)xi − (cid:80)N (cid:12) 2 the gradient f (X) w.r.t the j=1 Pi,jxj + ∆ where 2 (cid:12) (cid:12) (cid:12) exp(x⊤ k=1 exp(x⊤ i Axj ) Using the gradient structure revealed in Lemma 8.1, we can connect self-attention with PCA. In order to minimize the norm of gradient |J|2, we essentially need to make (cid:80)N j=1 Pi,jxj|2 small. When A is small and all the input patterns are centered at 0 (i.e. (cid:80)N i=1 xi = 0), we have (cid:80)N i=1 |xi − X ⊤XAxi|2. i=1 |xi − X ⊤Pi,:|2 ≈ (cid:80)N i=1 |xi − (cid:80)N The theorem below shows that A minimizing the objective (cid:80)N largest m eigenvectors of X ⊤X where m is the rank of A. Theorem 1. Let WQ and WK be matrices of size D × m. Let λ1 ≥ λ2 ≥ ... ≥ λD be the eigenvalues of X ⊤X ranked in descending order, and let vi ∈ RD, i = 1, . . . , D be the corresponding eigenvectors. The optimal solution A∗ that minimizes (cid:80)N i=1 |xi − X ⊤XAxi|2 is given by A = (cid:80)m i=1 |xi − X ⊤XAxi|2 contains the 1 λi viv⊤ i . i=1 The proof of Theorem 1 can be found in Appendix G. Following Theorem 1, through the training of pushing gradient to zero, self-attention learns to perform a function closely related to PCA. 9 Conclusions In this paper, we developed a foundation model for time series analysis, based on pre-trained model from NLP or CV, that can (a) facilitate the model training for downstream tasks, and (b) provide unified framework for diverse time series analysis tasks. Our empirical studies show that the proposed method performs on par or better than the state-of-the-art approaches on almost all time series tasks. We also examine the universality of transformer by connecting self-attention with PCA, an important step towards understanding how generative models work in practice. On the other hand, we do recognize some limitations of our work: the zero-shot performance of our approach is still behind N-beat on several datasets, and our analysis of the generality of transformer is still in the early stage. Moving forward, we plan to improve the performance of our approach by exploiting the parameter efficient fine-tuning approaches which usually introduce additional structures into the pre-trained model for better adaption. To better understand the universality of transformer, we also plan to examine it from the viewpoint of n-gram language model, an approach that is taken by Elhage et al. (2021); Olsson et al. (2022). In Appendix F, we include our initial analysis along this direction. 10 Random添加(label是反的)Random Ratio 100%Random Ratio 90%Random Ratio 80%Random Ratio 40%Random Ratio 20%Random Ratio 0%(b) Token Similarity: PCA as Attention(c) Token Similarity: Different Replace RatiosReplace Ratio (%)(a) Performance: Different Replace Ratios Acknowledgement We would like to express our sincere gratitude to Ziqing Ma, Qingsong Wen, Mengni Ye, and Tao Yao for their valuable suggestions and proofreading assistance throughout the development of this paper. Their insightful feedback and attention to detail greatly improved the quality and clarity of our work. References Abdulaal, A., Liu, Z., and Lancewicki, T. Practical approach to asynchronous multivariate time series anomaly detection and localization. In Proceedings of the 27th ACM SIGKDD conference on knowledge discovery & data mining, pp. 2485–2494, 2021. Bagnall, A., Dau, H. A., Lines, J., Flynn, M., Large, J., Bostrom, A., Southam, P., and Keogh, E. The uea multivariate time series classification archive, 2018. arXiv preprint arXiv:1811.00075, 2018. Bao, H., Wang, W., Dong, L., Liu, Q., Mohammed, O. K., Aggarwal, K., Som, S., and Wei, F. Vlmo: Unified vision-language pre-training with mixture-of-modality-experts. arXiv preprint arXiv:2111.02358, 2021. Bao, H., Dong, L., Piao, S., and Wei, F. BEit: BERT pre-training of image transformers. In International Conference on Learning Representations, 2022. Böse, J.-H., Flunkert, V., Gasthaus, J., Januschowski, T., Lange, D., Salinas, D., Schelter, S., Seeger, M., and Wang, Y. Probabilistic demand forecasting at scale. Proceedings of the VLDB Endowment, 10(12):1694–1705, 2017. Box, G. E. and Jenkins, G. M. Some recent advances in forecasting and control. Journal of the Royal Statistical Society. Series C (Applied Statistics), 17(2):91–109, 1968. Box, G. E. and Pierce, D. A. Distribution of residual autocorrelations in autoregressive-integrated moving average time series models. Journal of the American statistical Association, 65(332): 1509–1526, 1970. Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T. J., Child, R., Ramesh, A., Ziegler, D. M., Wu, J., Winter, C., Hesse, C., Chen, M., Sigler, E., Litwin, M., Gray, S., Chess, B., Clark, J., Berner, C., McCandlish, S., Radford, A., Sutskever, I., and Amodei, D. Language models are few-shot learners. ArXiv, abs/2005.14165, 2020. Challu, C., Olivares, K. G., Oreshkin, B. N., Garza, F., Mergenthaler, M., and Dubrawski, A. N-hits: Neural hierarchical interpolation for time series forecasting. arXiv preprint arXiv:2201.12886, 2022. Chen, T. and Guestrin, C. Xgboost: A scalable tree boosting system. KDD '16, 2016. Chung, J., Gulcehre, C., Cho, K., and Bengio, Y. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014. Courty, P. and Li, H. Timing of seasonal sales. The Journal of Business, 72(4):545–572, 1999. 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. Devlin, J., Chang, M., Lee, K., and Toutanova, K. BERT: pre-training of deep bidirectional trans- formers for language understanding. In Proceedings of the 2019 Conference of the North Ameri- can Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), Minneapolis, MN, USA, June 2-7, 2019, pp. 4171–4186, 2019. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., and Houlsby, N. An image is worth 16x16 words: Transformers for image recognition at scale. In 9th International Conference on Learning Representations (ICLR), Austria, May 3-7, 2021, 2021. 11 Elhage, N., Nanda, N., Olsson, C., Henighan, T., Joseph, N., Mann, B., Askell, A., Bai, Y., Chen, A., Conerly, T., DasSarma, N., Drain, D., Ganguli, D., Hatfield-Dodds, Z., Hernandez, D., Jones, A., Kernion, J., Lovitt, L., Ndousse, K., Amodei, D., Brown, T., Clark, J., Kaplan, J., McCandlish, S., and Olah, C. A mathematical framework for transformer circuits. Transformer Circuits Thread, 2021. https://transformer-circuits.pub/2021/framework/index.html. Franceschi, J.-Y., Dieuleveut, A., and Jaggi, M. Unsupervised scalable representation learning for multivariate time series. Advances in neural information processing systems, 32, 2019. Friedman, M. The interpolation of time series by related series. J. Amer. Statist. Assoc, 1962. Gao, J., Song, X., Wen, Q., Wang, P., Sun, L., and Xu, H. RobustTAD: Robust time series anomaly detection via decomposition and convolutional neural networks. KDD Workshop on Mining and Learning from Time Series (KDD-MileTS'20), 2020. Giannou, A., Rajput, S., Sohn, J.-y., Lee, K., Lee, J. D., and Papailiopoulos, D. Looped Transformers as Programmable Computers. arXiv e-prints, art. arXiv:2301.13196, January 2023. doi: 10.48550/ arXiv.2301.13196. Godahewa, R., Bergmeir, C., Webb, G. I., Hyndman, R. J., and Montero-Manso, P. Monash time series forecasting archive. In Neural Information Processing Systems Track on Datasets and Benchmarks, 2021. Gu, A., Goel, K., and Ré, C. Efficiently modeling long sequences with structured state spaces. arXiv preprint arXiv:2111.00396, 2021. Hochreiter, S. and Schmidhuber, J. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. Houlsby, N., Giurgiu, A., Jastrzebski, S., Morrone, B., De Laroussilhe, Q., Gesmundo, A., Attariyan, M., and Gelly, S. Parameter-efficient transfer learning for nlp. In International Conference on Machine Learning, pp. 2790–2799. PMLR, 2019. Huang, Z., Shi, X., Zhang, C., Wang, Q., Cheung, K. C., Qin, H., Dai, J., and Li, H. Flowformer: A transformer architecture for optical flow. In Computer Vision–ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23–27, 2022, Proceedings, Part XVII, pp. 668–685. Springer, 2022. Hundman, K., Constantinou, V., Laporte, C., Colwell, I., and Soderstrom, T. Detecting spacecraft anomalies using lstms and nonparametric dynamic thresholding. In Proceedings of the 24th ACM SIGKDD international conference on knowledge discovery & data mining, pp. 387–395, 2018. Hyndman, R. and Athanasopoulos, G. Forecasting: Principles and Practice. OTexts, Australia, 3rd edition, 2021. Ismail Fawaz, H., Forestier, G., Weber, J., Idoumghar, L., and Muller, P.-A. Deep learning for time series classification: a review. Data Mining and Knowledge Discovery, 33(4):917–963, 2019. Kim, H., Papamakarios, G., and Mnih, A. The lipschitz constant of self-attention. In International Conference on Machine Learning, pp. 5562–5571. PMLR, 2021. Kim, T., Kim, J., Tae, Y., Park, C., Choi, J.-H., and Choo, J. Reversible instance normalization for accurate time-series forecasting against distribution shift. In International Conference on Learning Representations, 2022. Kitaev, N., Kaiser, L., and Levskaya, A. Reformer: The efficient transformer. arXiv preprint arXiv:2001.04451, 2020. Lacoste-Julien, S., Schmidt, M., and Bach, F. A simpler approach to obtaining an o (1/t) convergence rate for the projected stochastic subgradient method. arXiv preprint arXiv:1212.2002, 2012. Lai, G., Chang, W.-C., Yang, Y., and Liu, H. Modeling long-and short-term temporal patterns with deep neural networks. In The 41st international ACM SIGIR conference on research & development in information retrieval, pp. 95–104, 2018. 12 Lim, B., Arık, S. Ö., Loeff, N., and Pfister, T. Temporal fusion transformers for interpretable multi-horizon time series forecasting. International Journal of Forecasting, 2021. Liu, S., Yu, H., Liao, C., Li, J., Lin, W., Liu, A. X., and Dustdar, S. Pyraformer: Low-complexity pyra- midal attention for long-range time series modeling and forecasting. In International conference on learning representations, 2021. Liu, Y., Wu, H., Wang, J., and Long, M. Non-stationary transformers: Exploring the stationarity in time series forecasting. In Advances in Neural Information Processing Systems, 2022. Lu, K., Grover, A., Abbeel, P., and Mordatch, I. Frozen pretrained transformers as universal computation engines. Proceedings of the AAAI Conference on Artificial Intelligence, 36(7): 7628–7636, Jun. 2022. Makridakis, S., Spiliotis, E., and Assimakopoulos, V. The m4 competition: Results, findings, conclusion and way forward. International Journal of Forecasting, 34(4):802–808, 2018. Mathur, A. P. and Tippenhauer, N. O. Swat: A water treatment testbed for research and training on ics security. In 2016 international workshop on cyber-physical systems for smart water networks (CySWater), pp. 31–36. IEEE, 2016. Nie, Y., Nguyen, N. H., Sinthong, P., and Kalagnanam, J. A time series is worth 64 words: Long-term forecasting with transformers. ArXiv, abs/2211.14730, 2022. Olsson, C., Elhage, N., Nanda, N., Joseph, N., DasSarma, N., Henighan, T., Mann, B., Askell, A., Bai, Y., Chen, A., Conerly, T., Drain, D., Ganguli, D., Hatfield-Dodds, Z., Hernandez, D., Johnston, S., Jones, A., Kernion, J., Lovitt, L., Ndousse, K., Amodei, D., Brown, T., Clark, J., Kaplan, J., McCandlish, S., and Olah, C. In-context learning and induction heads. Transformer Circuits Thread, 2022. https://transformer-circuits.pub/2022/in-context-learning-and-induction-heads/index.html. OpenAI. Gpt-4 technical report. ArXiv, abs/2303.08774, 2023. Oreshkin, B. N., Carpov, D., Chapados, N., and Bengio, Y. N-beats: Neural basis expansion analysis for interpretable time series forecasting. arXiv preprint arXiv:1905.10437, 2019. Oreshkin, B. N., Carpov, D., Chapados, N., and Bengio, Y. Meta-learning framework with applica- tions to zero-shot time-series forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, number 10, pp. 9242–9250, 2021. Radford, A. and Narasimhan, K. Improving language understanding by generative pre-training. 2018. Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., and Sutskever, I. Language models are unsupervised multitask learners. 2019. Rao, Y., Zhao, W., Zhu, Z., Lu, J., and Zhou, J. Global filter networks for image classification. Advances in Neural Information Processing Systems (NeurIPS), 34, 2021. Su, Y., Zhao, Y., Niu, C., Liu, R., Sun, W., and Pei, D. Robust anomaly detection for multivariate time series through stochastic recurrent neural network. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, pp. 2828–2837, 2019. Touvron, H., Cord, M., Douze, M., Massa, F., Sablayrolles, A., and Jégou, H. Training data-efficient image transformers & distillation through attention. In International Conference on Machine Learning, pp. 10347–10357. PMLR, 2021. Vardi, G., Yehudai, G., and Shamir, O. On the optimal memorization power of relu neural networks. arXiv preprint arXiv:2110.03187, 2021. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser Lukasz, and Polosukhin, I. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017. Wang, P., Wang, X., Wang, F., Lin, M., Chang, S., Li, H., and Jin, R. Kvt: k-nn attention for boosting vision transformers. In Computer Vision–ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23–27, 2022, Proceedings, Part XXIV, pp. 285–302. Springer, 2022. 13 Wang, T. and Isola, P. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. ArXiv, abs/2005.10242, 2020. Wen, Q., Yang, L., Zhou, T., and Sun, L. Robust time series analysis and applications: An industrial perspective. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 4836–4837, 2022. Wen, Q., Zhou, T., Zhang, C., Chen, W., Ma, Z., Yan, J., and Sun, L. Transformers in time series: A survey. In International Joint Conference on Artificial Intelligence(IJCAI), 2023. Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., Cistac, P., Rault, T., Louf, R., Funtowicz, M., Davison, J., Shleifer, S., von Platen, P., Ma, C., Jernite, Y., Plu, J., Xu, C., Scao, T. L., Gugger, S., Drame, M., Lhoest, Q., and Rush, A. M. 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, Online, October 2020. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/2020. emnlp-demos.6. Woo, G., Liu, C., Sahoo, D., Kumar, A., and Hoi, S. Etsformer: Exponential smoothing transformers for time-series forecasting. arXiv preprint arXiv:2202.01381, 2022. Wu, H., Xu, J., Wang, J., and Long, M. Autoformer: Decomposition transformers with auto- correlation for long-term series forecasting. In Advances in Neural Information Processing Systems (NeurIPS), pp. 101–112, 2021. Wu, H., Hu, T., Liu, Y., Zhou, H., Wang, J., and Long, M. Timesnet: Temporal 2d-variation modeling for general time series analysis. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=ju_Uqw384Oq. Xu, J., Wu, H., Wang, J., and Long, M. Anomaly transformer: Time series anomaly detection with association discrepancy. arXiv preprint arXiv:2110.02642, 2021. Yang, C.-H. H., Tsai, Y.-Y., and Chen, P.-Y. Voice2series: Reprogramming acoustic models for time series classification. In International Conference on Machine Learning, pp. 11808–11819, 2021. Yun, C., Chang, Y.-W., Bhojanapalli, S., Rawat, A. S., Reddi, S., and Kumar, S. O (n) connections are expressive enough: Universal approximability of sparse transformers. Advances in Neural Information Processing Systems, 33:13783–13794, 2020. Zeng, A., Chen, M., Zhang, L., and Xu, Q. Are transformers effective for time series forecasting? 2023. Zhang, T., Zhang, Y., Cao, W., Bian, J., Yi, X., Zheng, S., and Li, J. Less is more: Fast mul- tivariate time series forecasting with light sampling-oriented mlp structures. arXiv preprint arXiv:2207.01186, 2022. Zhou, H., Zhang, S., Peng, J., Zhang, S., Li, J., Xiong, H., and Zhang, W. Informer: Beyond efficient transformer for long sequence time-series forecasting. In Proceedings of AAAI, 2021. Zhou, T., Ma, Z., Wen, Q., Wang, X., Sun, L., and Jin, R. FEDformer: Frequency enhanced decomposed transformer for long-term series forecasting. In Proc. 39th International Conference on Machine Learning (ICML 2022), 2022. 14 A Visualization In order to clarify the representation ability more clearly, Figure 5 provides showcases of imputation, long-term forecasting and few-shot forecasting. Especially for few-shot learning, GPT2(6) can accurately forecast, while TimesNet and DLinear fail in this task. Figure 5: Visualization of imputation, long-term forecasting and few-shot forecasting. B Related Works We have presented a novel general time series analysis model in this paper, and to the best of our knowledge, there has been limited work on similar comprehensive methods for time series analysis. The most closely related field is time series forecasting, where transformer models have gained widespread popularity. Therefore, our focus in this related work will primarily be on introducing the end-to-end time series forecasting method. Time series forecasting models can be roughly divided into three categories, ranging from the classic ARIMA models to the most recent transformer models. The first generation of well-discussed models can be dated back to auto-regressive family, such as ARIMA Box & Jenkins (1968); Box & Pierce (1970) that follows the Markov process and recursively execute sequential forecasting. However, it is limited to stationary sequences while most time series is non-stationary. Additionally, with the bloom of deep neural networks, recurrent neural networks (RNNs), such as LSTM Hochreiter & Schmidhuber (1997) and GRU Chung et al. (2014), were designed for sequential tasks. Yet the recurrent model is inefficient for training and long-term dependencies are still under resolved. Recently, transformer models have achieve great progress in NLP Vaswani et al. (2017); Devlin et al. (2019); Radford et al. (2019) and CV Dosovitskiy et al. (2021); Bao et al. (2022) tasks. Also, a large amount of transformer models are proposed to apply to time series forecasting Wen et al. (2023). In the following, we briefly introduce several representative algorithms. Informer Zhou et al. (2021) 15 (a) Imputation on ETTh1 12.5%GPT2(3)TimesNetDLinear(b) Long-term forecasting on ETTm1GPT2(6)TimesNetDLinear(c) Few-shot forecasting on ETTh2GPT2(6)TimesNetDLinear proposes a probability sparse attention mechanism to deal with long-term dependencies. Autoformer Wu et al. (2021) introduces a decomposition transformer architecture and replaces the attention module with an Auto-Correlation mechanism. FEDformer Zhou et al. (2022) uses Fourier enhanced structure to improve computational efficiency and achieves linear complexity. Similar to patching in ViT Dosovitskiy et al. (2021), PatchTST Nie et al. (2022) employs segmentation of time series that divide a sequence into patches to increase input length and reduce information redundancy. Besides, a simple MLP-based model DLinear Zeng et al. (2023) outperforms most transformer models and it validates channel-independence works well in time series forecasting. Recently, TimesNet Wu et al. (2023) has treated time series as a 2D signal and utilized a convolution-based inception net backbone to function as a comprehensive time series analysis model. This work is closely related to our tasks in this paper. C Dataset Details In this section, we separately summarize dataset details long/short-term forecasting and few-shot/zero- shot forecasting. Datasets of Long-term Forecasting and Few-shot Learning The details of datasets are shown as follows: 1) ETT datasets Zhou et al. (2021) contain electricity load of various resolutions (ETTh & ETTm) from two electricity stations. 2) Weather contains 21 meteorological indicators of Germany within 1 year; 3) Illness contains the influenza-like illness patients in the United States; 4) Electricity dataset contains the electricity consumption; 5) Traffic dataset contains the occupation rate of freeway system across the State of California. Table 10 summarizes details of feature statistics. Similar to PatchTST Nie et al. (2022), Exchange is not contained. Zeng et al. (2023) shows that simply repeating the last value in the look-back window can outperform or be comparable to the best results. Also, ILI is not used for few-shot learning for the limited quantity that is hard to follow the definition of few-shot. Table 10: Dataset details of few-shot learning. Dataset Length Dimension Frequency ETTh ETTm Weather ILI Electricity Traffic 17420 69680 52696 966 26304 17544 7 7 22 7 321 862 1 hour 15 min 10 min 7 days 1 hour 1 hour Datasets of Short-term Forecasting and Zero-shot Learning The details of short-term forecasting and zero-shot learning datasets are shown as follows: 1) M4 is a large and diverse dataset that contains time series of various frequencies and fields, including business, financial and economic forecasting; 2) M3 is smaller than M4, but also contains time series from diverse domains and frequencies; 3) TOURISM is the dataset of tourism activities with different frequencies and contains a much higher fraction of erratic series compared with M4; 4) ELECTR represents the electricity usage monitoring of 370 customers over three years. Table 6 summarizes details of the datasets and zero-shot mapping between source and target. D Experimental Details All the deep learning networks are implemented in PyTorch and trained on NVIDIA V100 32GB GPUs. We use the pre-trained models from Wolf et al. (2020) for experiments. For few-shot learning, an early stopping counter is employed to stop the training process after three epochs if no loss degradation on the valid set is observed. Plus, we convert the multivariate data into univariate data. Specifically, we treat each feature of the sequence as a single time series. This is mainly for memory efficiency after patching of GPT2(6) and previous works, DLinear and PatchTST, have proved the effectiveness of channel-independence. 16 Table 11: Datasets and mapping details of zero-shot learning. M3 Yearly M3 Quarterly M3 Monthly M3 Others M4 Yearly M4 Quarterly M4 Monthly M4 Weekly M4 Daily M4 Hourly TOURISM Yearly TOURISM Quarterly TOURISM Monthly Dataset Length Horizon Mapping M4 M3 645 756 1428 174 23000 24000 48000 359 4227 414 518 427 366 6 8 18 8 6 8 18 13 14 48 4 8 24 Yearly Quarterly Monthly Monthly - - - - - - - - - - Yearly Quarterly Monthly Monthly Monthly Monthly Yearly Yearly Quarterly Quarterly Monthly Monthly ELECTR 1311 168 Hourly Monthly D.1 Accuracy Metrics For long-term/short-term forecasting and few-shot forecasting, we use mean square error (MSE) and mean absolute error (MAE) as metrics. For zero-shot learning, mean absolute percentage error (MAPE) is used for TOURISM; symmetric MAPE (sMAPE) is used for M3 and M4; normalized deviation (ND) is used for ELECTR. All experiments are repeated 3 times and the mean of the metrics is used in the final results. D.2 Detailed Definition and Results for Few-shot and Long-term Forecasting Task Definition Since Zeng et al. (2023) and Nie et al. (2022) have verified that channel-independence works well for time series datasets, we treat each multivariate series as multiple independent univariate series. Similar to traditional experimental settings, each time series is split into three parts: training data, validation data, and test data. For the few-shot forecasting task, only a certain percentage (5%, 10%) timesteps of training data are used, and the other two parts remain unchanged. The evaluation metrics remain the same as for classic multivariate time series forecasting. We repeat this experiment 3 times and report the average metrics in the following experiments. Detail Experiment Tables for Few-shot Time-Series Forecasting in Table 12 and Table 13 17 W 1 h T T E 2 h T T E 1 m T T E 2 m T T E L C E Table 12: Few-shot learning results on 5% data. We use prediction length O ∈ {96, 192, 336, 720}. A lower MSE indicates better performance, and the best results are highlighted in bold. '-' means that 5% time series is not sufficient to constitute a training set. Methods GPT2(6) GPT2(0) DLinear PatchTST TimesNet FEDformer Autoformer Stationary ETSformer LightTS Informer Reformer Metric MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE r 96 e h t a e 0.175 0.230 0.191 0.243 0.184 0.242 0.171 0.224 0.207 0.253 0.229 0.309 0.227 0.299 0.215 0.252 0.218 0.295 0.230 0.285 0.497 0.497 0.406 0.435 192 0.227 0.276 0.244 0.289 0.228 0.283 0.230 0.277 0.272 0.307 0.265 0.317 0.278 0.333 0.290 0.307 0.294 0.331 0.274 0.323 0.620 0.545 0.446 0.450 336 0.286 0.322 0.303 0.332 0.279 0.322 0.294 0.326 0.313 0.328 0.353 0.392 0.351 0.393 0.353 0.348 0.359 0.398 0.318 0.355 0.649 0.547 0.465 0.459 720 0.366 0.379 0.391 0.393 0.364 0.388 0.384 0.387 0.400 0.385 0.391 0.394 0.387 0.389 0.452 0.407 0.461 0.461 0.401 0.418 0.570 0.522 0.471 0.468 Avg. 0.263 0.301 0.282 0.314 0.263 0.308 0.269 0.303 0.298 0.318 0.309 0.353 0.310 0.353 0.327 0.328 0.333 0.371 0.305 0.345 0.584 0.527 0.447 0.453 0.543 0.506 0.825 0.638 0.547 0.503 0.557 0.519 0.892 0.625 0.593 0.529 0.681 0.570 0.952 0.650 1.169 0.832 1.483 0.91 1.225 0.812 1.198 0.795 96 192 0.748 0.580 1.220 0.778 0.720 0.604 0.711 0.570 0.940 0.665 0.652 0.563 0.725 0.602 0.943 0.645 1.221 0.853 1.525 0.93 1.249 0.828 1.273 0.853 336 0.754 0.595 1.852 0.965 0.984 0.727 0.816 0.619 0.945 0.653 0.731 0.594 0.761 0.624 0.935 0.644 1.179 0.832 1.347 0.87 1.202 0.811 1.254 0.857 720 - Avg. 0.681 0.560 1.299 0.793 0.750 0.611 0.694 0.569 0.925 0.647 0.658 0.562 0.722 0.598 0.943 0.646 1.189 0.839 1.451 0.903 1.225 0.817 1.241 0.835 - - - - - - - - - - - - - - - - - - - - - - - 96 0.376 0.421 0.551 0.507 0.442 0.456 0.401 0.421 0.409 0.420 0.390 0.424 0.428 0.468 0.408 0.423 0.678 0.619 2.022 1.006 3.837 1.508 3.753 1.518 192 0.418 0.441 0.765 0.610 0.617 0.542 0.452 0.455 0.483 0.464 0.457 0.465 0.496 0.504 0.497 0.468 0.845 0.697 3.534 1.348 3.975 1.933 3.516 1.473 336 0.408 0.439 0.767 0.614 1.424 0.849 0.464 0.469 0.499 0.479 0.477 0.483 0.486 0.496 0.507 0.481 0.905 0.727 4.063 1.451 3.956 1.520 3.312 1.427 720 - Avg. 0.400 0.433 0.694 0.577 0.827 0.615 0.439 0.448 0.463 0.454 0.441 0.457 0.47 0.489 0.470 0.457 0.809 0.681 3.206 1.268 3.922 1.653 3.527 1.472 - - - - - - - - - - - - - - - - - - - - - - - 96 0.386 0.405 0.582 0.512 0.332 0.374 0.399 0.414 0.606 0.518 0.628 0.544 0.726 0.578 0.823 0.587 1.031 0.747 1.048 0.733 1.130 0.775 1.234 0.798 192 0.440 0.438 0.632 0.536 0.358 0.390 0.441 0.436 0.681 0.539 0.666 0.566 0.750 0.591 0.844 0.591 1.087 0.766 1.097 0.756 1.150 0.788 1.287 0.839 336 0.485 0.459 0.767 0.584 0.402 0.416 0.499 0.467 0.786 0.597 0.807 0.628 0.851 0.659 0.870 0.603 1.138 0.787 1.147 0.775 1.198 0.809 1.288 0.842 720 0.577 0.499 1.334 0.742 0.511 0.489 0.767 0.587 0.796 0.593 0.822 0.633 0.857 0.655 0.893 0.611 1.245 0.831 1.200 0.799 1.175 0.794 1.247 0.828 Avg. 0.472 0.450 0.828 0.593 0.400 0.417 0.526 0.476 0.717 0.561 0.730 0.592 0.796 0.620 0.857 0.598 1.125 0.782 1.123 0.765 1.163 0.791 1.264 0.826 96 0.199 0.280 0.282 0.347 0.236 0.326 0.206 0.288 0.220 0.299 0.229 0.320 0.232 0.322 0.238 0.316 0.404 0.485 1.108 0.772 3.599 1.478 3.883 1.545 192 0.256 0.316 0.346 0.383 0.306 0.373 0.264 0.324 0.311 0.361 0.394 0.361 0.291 0.357 0.298 0.349 0.479 0.521 1.317 0.850 3.578 1.475 3.553 1.484 336 0.318 0.353 0.429 0.427 0.380 0.423 0.334 0.367 0.338 0.366 0.378 0.427 0.478 0.517 0.353 0.380 0.552 0.555 1.415 0.879 3.561 1.473 3.446 1.460 720 0.460 0.436 0.751 0.568 0.674 0.583 0.454 0.432 0.509 0.465 0.523 0.510 0.553 0.538 0.475 0.445 0.701 0.627 1.822 0.984 3.896 1.533 3.445 1.460 Avg. 0.308 0.346 0.452 0.431 0.399 0.426 0.314 0.352 0.344 0.372 0.381 0.404 0.388 0.433 0.341 0.372 0.534 0.547 1.415 0.871 3.658 1.489 3.581 1.487 0.143 0.241 0.147 0.246 0.150 0.251 0.145 0.244 0.315 0.389 0.235 0.322 0.297 0.367 0.484 0.518 0.697 0.638 0.639 0.609 1.265 0.919 1.414 0.855 96 192 0.159 0.255 0.163 0.260 0.163 0.263 0.163 0.260 0.318 0.396 0.247 0.341 0.308 0.375 0.501 0.531 0.718 0.648 0.772 0.678 1.298 0.939 1.240 0.919 336 0.179 0.274 0.182 0.278 0.175 0.278 0.183 0.281 0.340 0.415 0.267 0.356 0.354 0.411 0.574 0.578 0.758 0.667 0.901 0.745 1.302 0.942 1.253 0.921 720 0.233 0.323 0.239 0.329 0.219 0.311 0.233 0.323 0.635 0.613 0.318 0.394 0.426 0.466 0.952 0.786 1.028 0.788 1.200 0.871 1.259 0.919 1.249 0.921 Avg. 0.178 0.273 0.182 0.278 0.176 0.275 0.181 0.277 0.402 0.453 0.266 0.353 0.346 0.404 0.627 0.603 0.800 0.685 0.878 0.725 1.281 0.929 1.289 0.904 c 96 0.419 0.298 0.468 0.354 0.427 0.304 0.404 0.286 0.854 0.492 0.670 0.421 0.795 0.481 1.468 0.821 1.643 0.855 1.157 0.636 1.557 0.821 1.586 0.841 192 0.434 0.305 0.479 0.352 0.447 0.315 0.412 0.294 0.894 0.517 0.653 0.405 0.837 0.503 1.509 0.838 1.856 0.928 1.688 0.848 1.596 0.834 1.602 0.844 336 0.449 0.313 0.477 0.345 0.478 0.333 0.439 0.310 0.853 0.471 0.707 0.445 0.867 0.523 1.602 0.860 2.080 0.999 1.826 0.903 1.621 0.841 1.668 0.868 720 - Avg. 0.434 0.305 0.474 0.350 0.450 0.317 0.418 0.296 0.867 0.493 0.676 0.423 0.833 0.502 1.526 0.839 1.859 0.927 1.557 0.795 1.591 0.832 1.618 0.851 - - - - - - - - - - - - - - - - - - - - - - - i f f a r T Average 0.377 0.375 0.575 0.465 0.441 0.413 0.392 0.383 0.552 0.464 0.483 0.445 0.537 0.480 0.697 0.537 0.909 0.675 1.341 0.789 1.878 0.994 1.819 0.966 18 W 1 h T T E 2 h T T E 1 m T T E 2 m T T E L C E Table 13: Few-shot learning results on 10% data. We use prediction length O ∈ {96, 192, 336, 720}. A lower MSE indicates better performance, and the best results are highlighted in bold. '-' means that 10% time series is not sufficient to constitute a training set. Methods GPT2(6) GPT2(0) DLinear PatchTST TimesNet FEDformer Autoformer Stationary ETSformer LightTS Informer Reformer Metric MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE r 96 e h t a e 0.163 0.215 0.190 0.240 0.171 0.224 0.165 0.215 0.184 0.230 0.188 0.253 0.221 0.297 0.192 0.234 0.199 0.272 0.217 0.269 0.374 0.401 0.335 0.380 192 0.210 0.254 0.243 0.284 0.215 0.263 0.210 0.257 0.245 0.283 0.250 0.304 0.270 0.322 0.269 0.295 0.279 0.332 0.259 0.304 0.552 0.478 0.522 0.462 336 0.256 0.292 0.270 0.305 0.258 0.299 0.259 0.297 0.305 0.321 0.312 0.346 0.320 0.351 0.370 0.357 0.356 0.386 0.303 0.334 0.724 0.541 0.715 0.535 720 0.321 0.339 0.348 0.359 0.320 0.346 0.332 0.346 0.381 0.371 0.387 0.393 0.390 0.396 0.441 0.405 0.437 0.448 0.377 0.382 0.739 0.558 0.611 0.500 Avg. 0.238 0.275 0.263 0.297 0.241 0.283 0.242 0.279 0.279 0.301 0.284 0.324 0.300 0.342 0.318 0.323 0.318 0.360 0.289 0.322 0.597 0.495 0.546 0.469 0.458 0.456 0.601 0.536 0.492 0.495 0.516 0.485 0.861 0.628 0.512 0.499 0.613 0.552 0.918 0.639 1.112 0.806 1.298 0.838 1.179 0.792 1.184 0.790 96 192 0.570 0.516 0.709 0.587 0.565 0.538 0.598 0.524 0.797 0.593 0.624 0.555 0.722 0.598 0.915 0.629 1.155 0.823 1.322 0.854 1.199 0.806 1.295 0.850 336 0.608 0.535 0.801 0.635 0.721 0.622 0.657 0.550 0.941 0.648 0.691 0.574 0.750 0.619 0.939 0.644 1.179 0.832 1.347 0.870 1.202 0.811 1.294 0.854 720 0.725 0.591 1.385 0.831 0.986 0.743 0.762 0.610 0.877 0.641 0.728 0.614 0.721 0.616 0.887 0.645 1.273 0.874 1.534 0.947 1.217 0.825 1.223 0.838 Avg. 0.590 0.525 0.874 0.647 0.691 0.600 0.633 0.542 0.869 0.628 0.639 0.561 0.702 0.596 0.915 0.639 1.180 0.834 1.375 0.877 1.199 0.809 1.249 0.833 96 0.331 0.374 0.539 0.495 0.357 0.411 0.353 0.389 0.378 0.409 0.382 0.416 0.413 0.451 0.389 0.411 0.678 0.619 2.022 1.006 3.837 1.508 3.788 1.533 192 0.402 0.411 0.675 0.555 0.569 0.519 0.403 0.414 0.490 0.467 0.478 0.474 0.474 0.477 0.473 0.455 0.785 0.666 2.329 1.104 3.856 1.513 3.552 1.483 336 0.406 0.433 0.718 0.580 0.671 0.572 0.426 0.441 0.537 0.494 0.504 0.501 0.547 0.543 0.507 0.480 0.839 0.694 2.453 1.122 3.952 1.526 3.395 1.526 720 0.449 0.464 0.732 0.605 0.824 0.648 0.477 0.480 0.510 0.491 0.499 0.509 0.516 0.523 0.477 0.472 1.273 0.874 3.816 1.407 3.842 1.503 3.205 1.401 Avg. 0.397 0.421 0.666 0.559 0.605 0.538 0.415 0.431 0.479 0.465 0.466 0.475 0.488 0.499 0.462 0.455 0.894 0.713 2.655 1.160 3.872 1.513 3.485 1.486 96 0.390 0.404 0.610 0.508 0.352 0.392 0.410 0.419 0.583 0.501 0.578 0.518 0.774 0.614 0.761 0.568 0.911 0.688 0.921 0.682 1.162 0.785 1.442 0.847 192 0.429 0.423 0.666 0.540 0.382 0.412 0.437 0.434 0.630 0.528 0.617 0.546 0.754 0.592 0.781 0.574 0.955 0.703 0.957 0.701 1.172 0.793 1.444 0.862 336 0.469 0.439 0.895 0.615 0.419 0.434 0.476 0.454 0.725 0.568 0.998 0.775 0.869 0.677 0.803 0.587 0.991 0.719 0.998 0.716 1.227 0.908 1.450 0.866 720 0.569 0.498 0.916 0.646 0.490 0.477 0.681 0.556 0.769 0.549 0.693 0.579 0.810 0.630 0.844 0.581 1.062 0.747 1.007 0.719 1.207 0.797 1.366 0.850 Avg. 0.464 0.441 0.772 0.577 0.411 0.429 0.501 0.466 0.677 0.537 0.722 0.605 0.802 0.628 0.797 0.578 0.980 0.714 0.971 0.705 1.192 0.821 1.426 0.856 96 0.188 0.269 0.283 0.344 0.213 0.303 0.191 0.274 0.212 0.285 0.291 0.399 0.352 0.454 0.229 0.308 0.331 0.430 0.813 0.688 3.203 1.407 4.195 1.628 192 0.251 0.309 0.353 0.384 0.278 0.345 0.252 0.317 0.270 0.323 0.307 0.379 0.694 0.691 0.291 0.343 0.400 0.464 1.008 0.768 3.112 1.387 4.042 1.601 336 0.307 0.346 0.420 0.422 0.338 0.385 0.306 0.353 0.323 0.353 0.543 0.559 2.408 1.407 0.348 0.376 0.469 0.498 1.031 0.775 3.255 1.421 3.963 1.585 720 0.426 0.417 0.553 0.491 0.436 0.440 0.433 0.427 0.474 0.449 0.712 0.614 1.913 1.166 0.461 0.438 0.589 0.557 1.096 0.791 3.909 1.543 3.711 1.532 Avg. 0.293 0.335 0.402 0.410 0.316 0.368 0.296 0.343 0.320 0.353 0.463 0.488 1.342 0.930 0.332 0.366 0.447 0.487 0.987 0.756 3.370 1.440 3.978 1.587 0.139 0.237 0.142 0.240 0.150 0.253 0.140 0.238 0.299 0.373 0.231 0.323 0.261 0.348 0.420 0.466 0.599 0.587 0.350 0.425 1.259 0.919 0.993 0.784 96 192 0.156 0.252 0.158 0.254 0.164 0.264 0.160 0.255 0.305 0.379 0.261 0.356 0.338 0.406 0.411 0.459 0.620 0.598 0.376 0.448 1.160 0.873 0.938 0.753 336 0.175 0.270 0.175 0.271 0.181 0.282 0.180 0.276 0.319 0.391 0.360 0.445 0.410 0.474 0.434 0.473 0.662 0.619 0.428 0.485 1.157 0.872 0.925 0.745 720 0.233 0.317 0.230 0.315 0.223 0.321 0.241 0.323 0.369 0.426 0.530 0.585 0.715 0.685 0.510 0.521 0.757 0.664 0.611 0.597 1.203 0.898 1.004 0.790 Avg. 0.176 0.269 0.176 0.270 0.180 0.280 0.180 0.273 0.323 0.392 0.346 0.427 0.431 0.478 0.444 0.480 0.660 0.617 0.441 0.489 1.195 0.891 0.965 0.768 c 96 0.414 0.297 0.478 0.368 0.419 0.298 0.403 0.289 0.719 0.416 0.639 0.400 0.672 0.405 1.412 0.802 1.643 0.855 1.157 0.636 1.557 0.821 1.527 0.815 192 0.426 0.301 0.481 0.363 0.434 0.305 0.415 0.296 0.748 0.428 0.637 0.416 0.727 0.424 1.419 0.806 1.641 0.854 1.207 0.661 1.454 0.765 1.538 0.817 336 0.434 0.303 0.488 0.365 0.449 0.313 0.426 0.304 0.853 0.471 0.655 0.427 0.749 0.454 1.443 0.815 1.711 0.878 1.334 0.713 1.521 0.812 1.550 0.819 720 0.487 0.337 0.537 0.386 0.484 0.336 0.474 0.331 1.485 0.825 0.722 0.456 0.847 0.499 1.539 0.837 2.660 1.157 1.292 0.726 1.605 0.846 1.588 0.833 Avg. 0.440 0.310 0.496 0.371 0.447 0.313 0.430 0.305 0.951 0.535 0.663 0.425 0.749 0.446 1.453 0.815 1.914 0.936 1.248 0.684 1.534 0.811 1.551 0.821 i f f a r T Average 0.371 0.367 0.521 0.447 0.413 0.401 0.385 0.376 0.556 0.458 0.511 0.472 0.687 0.559 0.674 0.522 0.912 0.665 1.137 0.712 1.850 0.967 1.888 0.974 19 D.3 Long-term Time-series Forecasting Here we investigate whether our architecture performs consistently well with more training data. Thus, we follow the classical experiment settings of Nie et al. (2022) and conduct experiments on full data. The results are shown in Table 14. Overall, GPT2(6) FPT achieves comparable performance to PatchTST, Dlinear and outperforms other baselines by a large margin. Compared with the second best transformer-based baseline method FEDformer, GPT2(6) FPT yields an overall 18.7% relatively MSE reduction. It verifies the effectiveness of NLP pretrained model in time series forecasting, not limited to the few-shot setting. Detail Experiment Table for Long-term Time-Series Forecasting in table 14 Table 14: Full results on full data. We use prediction length O ∈ {96, 192, 336, 720} for ILI and O ∈ {24, 36, 48, 60} for others. A lower MSE indicates better performance. Black: best, Red: second best. Methods GPT2(6) GPT2(0) DLinear PatchTST TimesNet FEDformer Autoformer Stationary ETSformer LightTS Informer Reformer Metric MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE r 96 e h t a e 0.162 0.212 0.181 192 0.204 0.248 0.222 336 0.254 0.286 0.270 720 0.326 0.337 0.338 Avg 0.237 0.270 0.252 W 1 h T T E 2 h T T E 1 m T T E 2 m T T E I L I L C E 96 0.376 0.397 0.422 192 0.416 0.418 0.466 336 0.442 0.433 0.488 720 0.477 0.456 0.485 Avg 0.427 0.426 0.465 96 0.285 0.342 0.318 192 0.354 0.389 0.383 336 0.373 0.407 0.406 720 0.406 0.441 0.420 Avg 0.354 0.394 0.381 96 0.292 0.346 0.330 192 0.332 0.372 0.371 336 0.366 0.394 0.398 720 0.417 0.421 0.454 Avg 0.352 0.383 0.388 96 0.173 0.262 0.192 192 0.229 0.301 0.245 336 0.286 0.341 0.302 720 0.378 0.401 0.399 Avg 0.266 0.326 0.284 24 2.063 0.881 2.723 36 1.868 0.892 2.027 48 1.790 0.884 2.206 1.979 0.957 1.976 60 Avg 1.925 0.903 2.233 96 0.139 0.238 0.138 192 0.153 0.251 0.152 336 0.169 0.266 0.168 720 0.206 0.297 0.207 Avg 0.167 0.263 0.166 c 96 0.388 0.282 0.390 192 0.407 0.290 0.403 336 0.412 0.294 0.413 720 0.450 0.312 0.447 Avg 0.414 0.294 0.413 i f f a r T 0.232 0.266 0.299 0.345 0.285 0.428 0.450 0.464 0.478 0.455 0.368 0.407 0.427 0.446 0.412 0.372 0.394 0.409 0.440 0.403 0.281 0.317 0.352 0.408 0.339 1.099 0.966 1.022 0.983 1.017 0.234 0.247 0.263 0.295 0.259 0.272 0.276 0.280 0.298 0.281 0.176 0.237 0.149 0.198 0.172 0.220 0.217 0.296 0.266 0.336 0.173 0.223 0.197 0.281 0.182 0.242 0.300 0.384 0.689 0.596 0.220 0.282 0.194 0.241 0.219 0.261 0.276 0.336 0.307 0.367 0.245 0.285 0.237 0.312 0.227 0.287 0.598 0.544 0.752 0.638 0.265 0.319 0.245 0.282 0.280 0.306 0.339 0.380 0.359 0.395 0.321 0.338 0.298 0.353 0.282 0.334 0.578 0.523 0.639 0.596 0.333 0.362 0.314 0.334 0.365 0.359 0.403 0.428 0.419 0.428 0.414 0.410 0.352 0.288 0.352 0.386 1.059 0.741 1.130 0.792 0.248 0.300 0.225 0.264 0.259 0.287 0.309 0.360 0.338 0.382 0.288 0.314 0.271 0.334 0.261 0.312 0.634 0.548 0.803 0.656 0.375 0.399 0.370 0.399 0.384 0.402 0.376 0.419 0.449 0.459 0.513 0.491 0.494 0.479 0.424 0.432 0.865 0.713 0.837 0.728 0.405 0.416 0.413 0.421 0.436 0.429 0.420 0.448 0.500 0.482 0.534 0.504 0.538 0.504 0.475 0.462 1.008 0.792 0.923 0.766 0.439 0.443 0.422 0.436 0.491 0.469 0.459 0.465 0.521 0.496 0.588 0.535 0.574 0.521 0.518 0.488 1.107 0.809 1.097 0.835 0.472 0.490 0.447 0.466 0.521 0.500 0.506 0.507 0.514 0.512 0.643 0.616 0.562 0.535 0.547 0.533 1.181 0.865 1.257 0.889 0.422 0.437 0.413 0.430 0.458 0.450 0.440 0.460 0.496 0.487 0.570 0.537 0.542 0.510 0.491 0.479 1.040 0.795 1.029 0.805 0.289 0.353 0.274 0.336 0.340 0.374 0.358 0.397 0.346 0.388 0.476 0.458 0.340 0.391 0.397 0.437 3.755 1.525 2.626 1.317 0.383 0.418 0.339 0.379 0.402 0.414 0.429 0.439 0.456 0.452 0.512 0.493 0.430 0.439 0.520 0.504 5.602 1.931 11.12 2.979 0.448 0.465 0.329 0.380 0.452 0.452 0.496 0.487 0.482 0.486 0.552 0.551 0.485 0.479 0.626 0.559 4.721 1.835 9.323 2.769 0.605 0.551 0.379 0.422 0.462 0.468 0.463 0.474 0.515 0.511 0.562 0.560 0.500 0.497 0.863 0.672 3.647 1.625 3.874 1.697 0.431 0.446 0.330 0.379 0.414 0.427 0.437 0.449 0.450 0.459 0.526 0.516 0.439 0.452 0.602 0.543 4.431 1.729 6.736 2.191 0.299 0.343 0.290 0.342 0.338 0.375 0.379 0.419 0.505 0.475 0.386 0.398 0.375 0.398 0.374 0.400 0.672 0.571 0.538 0.528 0.335 0.365 0.332 0.369 0.374 0.387 0.426 0.441 0.553 0.496 0.459 0.444 0.408 0.410 0.400 0.407 0.795 0.669 0.658 0.592 0.369 0.386 0.366 0.392 0.410 0.411 0.445 0.459 0.621 0.537 0.495 0.464 0.435 0.428 0.438 0.438 1.212 0.871 0.898 0.721 0.425 0.421 0.416 0.420 0.478 0.450 0.543 0.490 0.671 0.561 0.585 0.516 0.499 0.462 0.527 0.502 1.166 0.823 1.102 0.841 0.357 0.378 0.351 0.380 0.400 0.406 0.448 0.452 0.588 0.517 0.481 0.456 0.429 0.425 0.435 0.437 0.961 0.734 0.799 0.671 0.167 0.269 0.165 0.255 0.187 0.267 0.203 0.287 0.255 0.339 0.192 0.274 0.189 0.280 0.209 0.308 0.365 0.453 0.658 0.619 0.224 0.303 0.220 0.292 0.249 0.309 0.269 0.328 0.281 0.340 0.280 0.339 0.253 0.319 0.311 0.382 0.533 0.563 1.078 0.827 0.281 0.342 0.274 0.329 0.321 0.351 0.325 0.366 0.339 0.372 0.334 0.361 0.314 0.357 0.442 0.466 1.363 0.887 1.549 0.972 0.397 0.421 0.362 0.385 0.408 0.403 0.421 0.415 0.433 0.432 0.417 0.413 0.414 0.413 0.675 0.587 3.379 1.338 2.631 1.242 0.267 0.333 0.255 0.315 0.291 0.333 0.305 0.349 0.327 0.371 0.306 0.347 0.293 0.342 0.409 0.436 1.410 0.810 1.479 0.915 2.215 1.081 1.319 0.754 2.317 0.934 3.228 1.260 3.483 1.287 2.294 0.945 2.527 1.020 8.313 2.144 5.764 1.677 4.400 1.382 1.963 0.963 1.430 0.834 1.972 0.920 2.679 1.080 3.103 1.148 1.825 0.848 2.615 1.007 6.631 1.902 4.755 1.467 4.783 1.448 2.130 1.024 1.553 0.815 2.238 0.940 2.622 1.078 2.669 1.085 2.010 0.900 2.359 0.972 7.299 1.982 4.763 1.469 4.832 1.465 2.368 1.096 1.470 0.788 2.027 0.928 2.857 1.157 2.770 1.125 2.178 0.963 2.487 1.016 7.283 1.985 5.264 1.564 4.882 1.483 2.169 1.041 1.443 0.797 2.139 0.931 2.847 1.144 3.006 1.161 2.077 0.914 2.497 1.004 7.382 2.003 5.137 1.544 4.724 1.445 0.140 0.237 0.129 0.222 0.168 0.272 0.193 0.308 0.201 0.317 0.169 0.273 0.187 0.304 0.207 0.307 0.274 0.368 0.312 0.402 0.153 0.249 0.157 0.240 0.184 0.289 0.201 0.315 0.222 0.334 0.182 0.286 0.199 0.315 0.213 0.316 0.296 0.386 0.348 0.433 0.169 0.267 0.163 0.259 0.198 0.300 0.214 0.329 0.231 0.338 0.200 0.304 0.212 0.329 0.230 0.333 0.300 0.394 0.350 0.433 0.203 0.301 0.197 0.290 0.220 0.320 0.246 0.355 0.254 0.361 0.222 0.321 0.233 0.345 0.265 0.360 0.373 0.439 0.340 0.420 0.166 0.263 0.161 0.252 0.192 0.295 0.214 0.327 0.227 0.338 0.193 0.296 0.208 0.323 0.229 0.329 0.311 0.397 0.338 0.422 0.410 0.282 0.360 0.249 0.593 0.321 0.587 0.366 0.613 0.388 0.612 0.338 0.607 0.392 0.615 0.391 0.719 0.391 0.732 0.423 0.423 0.287 0.379 0.256 0.617 0.336 0.604 0.373 0.616 0.382 0.613 0.340 0.621 0.399 0.601 0.382 0.696 0.379 0.733 0.420 0.436 0.296 0.392 0.264 0.629 0.336 0.621 0.383 0.622 0.337 0.618 0.328 0.622 0.396 0.613 0.386 0.777 0.420 0.742 0.420 0.466 0.315 0.432 0.286 0.640 0.350 0.626 0.382 0.660 0.408 0.653 0.355 0.632 0.396 0.658 0.407 0.864 0.472 0.755 0.423 0.433 0.295 0.390 0.263 0.620 0.336 0.610 0.376 0.628 0.379 0.624 0.340 0.621 0.396 0.622 0.392 0.764 0.416 0.741 0.422 Average 0.516 0.407 0.573 0.0.431 0.562 0.436 0.446 0.386 0.596 0.433 0.701 0.489 0.757 0.511 0.633 0.465 0.662 0.473 1.303 0.616 1.836 0.871 2.081 0.954 20 D.4 Mean and STD for Few-shot Learning Table 15 lists both mean and STD for GPT2(6), DLinear and PatchTST with 3 runs on 5% ETTh2 and ETTm2. The results show a small variance in performance of GPT2(6) that represents the stability of GPT2(6). Table 15: A subset of results showing both Mean and STD on 5% datasets. Methods Metric 2 96 h 192 T 336 T E 720 2 96 m 192 T 336 T E 720 GPT2-backbone(6 Layers) MAE MSE 0.376 ± 0.0072 0.418 ± 0.0013 0.408 ± 0.0006 - 0.199 ± 0.0040 0.256 ± 0.0030 0.318 ± 0.0046 0.460 ± 0.0132 0.421 ± 0.0054 0.441 ± 0.0014 0.439 ± 0.0002 - 0.280 ± 0.0042 0.316 ± 0.0017 0.353 ± 0.0032 0.436 ± 0.0066 D.5 Comparison with Traditional Methods on Few-shot Learning Since deep learning methods are more advantageous than traditional methods when applied to large datasets. For few-shot learning, traditional methods should also consider. The results are shown in Table 16 that GPT2(6) also achieves best performance. Table 16: Comparison with traditional methods. Methods Metric GPT2(6) 5% GPT2(6) 10% MSE MAE MSE MAE ETS ARIMA NaiveDrift MSE MAE MSE MAE MSE MAE 96 192 96 192 0.376 0.418 0.386 0.440 0.421 0.441 0.405 0.438 0.331 0.402 0.390 0.429 0.374 0.411 0.404 0.423 2.954 10.226 52.237 186.445 0.742 1.212 2.689 4.654 0.481 0.585 0.693 0.710 0.443 0.495 0.547 0.557 0.764 1.560 1.539 2.869 0.561 0.785 0.913 1.215 2 h T T E 1 m T T E D.6 Baselines with Instance Normalization Instance normalization Kim et al. (2022) is a plug-in for time series for distribution shift. Most baselines, such as Autoformer and FEDformer are not equipped with instance normalization. Thus, for a fair comparison, we add the experiment, as in Table 17, for baselines w/o instance normalization and GPT(6) can also perform superior. Table 17: Comparison on 5% data. Autoformer and FEDformer are equiped with instance normaliza- tion. Methods Metric GPT2(6) PatchTST DLinear Autoformer Autoformer(Revin) FEDformer FEDformer(Revin) MSE MAE MSE MAE MSE MAE MSE MAE MSE 96 192 0.199 0.256 0.280 0.316 0.206 0.264 0.288 0.324 0.236 0.306 0.326 0.373 0.232 0.291 0.322 0.357 0.224 0.296 2 m T T E MAE 0.300 0.343 MSE MAE MSE 0.229 0.294 0.320 0.361 0.223 0.288 MAE 0.298 0.336 D.7 Detailed Definition and Results of Zero-shot Learning Task Definition Each experiment contains two distinct datasets, source, and target datasets. The source dataset is used to train the model and then forecasts without fine-tuning in the target dataset. The target dataset is split into non-overlapping historical and test sequences. We use the historical sequence as input to the model, and the obtained output is used to calculate errors with the test sequences. Besides meta-learning-based models like N-BEATS, evaluated models' parameters are not allowed any adjustment using the forecasting phase. Also, same as Oreshkin et al. (2021), each data set adopts a specific metric (M4: sMAPE; M3: sMAPE; TOURISM: MAPE; ELECTR: ND) 21 Detailed Results Here, we list detailed performance of zero-shot learning in Table 18, Table 19 and Table 20. For each dataset, we separately list the performance of models under diverse frequency. Compared to the most recent published method DLinear, GPT2(6) performs superior in most situations. Also, GPT2(6) does not use any information from the test data, but achieves a comparable performance of meta-leaning based N-BEATS. Table 18: Zero-shot performance on M4 (sMAPE). Yearly Quarterly Monthly Others Average (100k) (48k) (23k) (24k) (5k) N-BEATS-FR 13.267 9.596 DLinear-M3 TimesNet-M3 PatchTST-M3 ETSformer-M3 LightTS-M3 Stationary-M3 FEDformer-M3 Autoformer-M3 Informer-M3 Reformer-M3 GPT(6)-M3 14.193 15.655 13.966 27.846 13.787 14.988 13.887 14.552 18.542 15.652 13.740 18.856 11.877 10.929 36.134 11.289 11.686 11.513 17.341 16.907 11.051 10.787 12.676 14.765 16.165 14.664 25.114 15.181 16.098 18.154 25.063 23.454 15.604 14.630 4.696 9.194 6.863 7.087 12.338 9.117 6.977 7.529 9.666 7.348 7.001 7.081 11.675 15.337 14.553 13.228 27.748 13.623 14.327 15.047 20.022 19.047 14.092 13.125 Table 19: Zero-shot performance on M3 (sMAPE). Yearly Quarterly Monthly Others Average (3003) (1428) (645) (756) (174) N-BEATS-M4 N-BEATS-FR DLinear-M4 TimesNet-M4 PatchTST-M4 ETSformer-M4 LightTS-M4 Stationary-M4 FEDformer-M4 Autoformer-M4 Informer-M4 Reformer-M4 GPT2(6)-M4 15.07 16.43 17.43 18.75 15.99 20.56 15.63 17.05 16.00 16.18 19.70 16.03 16.42 9.07 9.05 9.74 12.26 9.62 11.65 9.40 12.56 9.48 13.92 13.00 9.76 10.13 13.19 13.30 15.65 14.01 14.71 16.97 24.60 16.82 15.12 16.91 15.91 14.80 14.10 4.29 4.51 6.81 6.88 9.44 10.57 8.28 8.13 8.94 14.68 13.03 7.53 4.81 12.38 12.61 14.03 14.17 13.39 16.03 17.90 15.29 13.53 15.87 15.82 13.37 13.06 E Proof In our numerical experiments, we obtain two interesting observations. First, the token similarity within a sample is larger in pretrained LM. We report the layer-wise average token cosine similarity in ETTh2 experiment in Figure 7. In particular, Figure 7 (a) shows that in a fine-tuned random initialed GPT2(6) model, the token similarity is around 0.1-0.2 among different layers. When switching to the frozen pre-trained GPT2-FPT model, the token similarity significantly increases in the deep layers and eventually reaches more than 0.9 in the last layer. The ETTh2 dataset contains high volatility hourly information related to the electricity transformer temperature. In this situation, higher token similarity implies the high-frequency noise in the data is eased and only low-frequency information will be reserved. In other words, after going through the pretrained GPT2-FPT model, the signal-noise ratio is enhanced. We use the following theorem to characterize this behavior. 22 Table 20: Zero-shot performance on Tourism (MAPE). Yearly Quarterly Monthly Average (1311) (518) (427) (366) N-BEATS-M4 N-BEATS-FR DLinear-M4 TimesNet-M4 PatchTST-M4 ETSformer-M4 LightTS-M4 Stationary-M4 FEDformer-M4 Autoformer-M4 Informer-M4 Reformer-M4 23.57 23.43 39.59 35.59 33.23 391.60 138.22 35.42 43.41 51.19 41.16 33.86 GPT2(6)-M4 27.17 14.66 14.45 18.30 19.22 19.27 35.56 16.28 35.15 19.88 34.95 30.98 16.85 16.21 19.32 20.47 24.76 30.54 27.57 50.47 25.34 65.58 28.39 31.47 33.92 23.71 21.92 18.82 19.46 28.51 28.84 27.10 180.40 66.99 43.75 31.55 40.39 35.82 25.48 22.14 E.1 Theorem E.1 Theorem E.1 (informal). We consider the self-attention for l-th query token. Let's assume the input token xi are bounded with mean μ for i = 1, 2, ..., n. Under mild conditions, with high probability, the output value token Vl converges to μWv on the order of O(n−1/2), where Wv is the parameter matrix to compute the value token. The Theorem E.1 describes the self-attention structure can efficiently make output value token Vl converge its mean value μWv. In the time series forecasting task, each token represents several adjacent points in a time series. When the time series has some periodical or translation invariant structures, by comparing a given token with other tokens, one could have a higher chance to figure out those invariant structures. This phenomenon is especially important in few-shot forecasting tasks. Without enough token noise distillation ability, the model will more likely tend to overfit due to insufficient training data. We denote xi as i-th element of vector x, Wij as the element at i-th row and j-th column of matrix W , and Wj as the j-th row of matrix W . Moreover, we denote xi as the i-th patch (token) of the inputs with xi = Xi. Before given the formal statement of the Theorem E.1, we first show the assumptions. 1. The token xi is the sub-gaussian random vector with mean μi and variance (σ2/d)I for i = 1, 2, ..., n. 2. μ follows a discrete distribution with finite values μ ∈ V. Moreover, there exist 0 < Kμi ∈ [ν2, ν4] for all i and ν1, 0 < ν2 < ν4 such that a) ∥μi∥ = ν1, and b) μiWQW T |μiWQW ⊤ j | ≤ ν2 for all μi ̸= μj ∈ V. Kμ⊤ 3. WV and WQW ⊤ ν5 and |(WQW ⊤ K are element-wise bounded with ν5 and ν6 respectively, that is, |W (ij) K)(ij)| ≤ ν6, for all i, j from 1 to d. V | ≤ In the above assumptions, we ensure that for a given query patch, the difference between the clustering center and noises are large enough to be distinguished. Theorem E.2 (formal statement of Theorem E.1). Let patch xi be σ2-subgaussian random variable with mean μi and all n patches follow the same clustering center of query l. Per Assumptions aforementioned, when d ≥ 3(ψ(δ, d) + ν2 + ν4), then with probability 1 − 5δ, we have √ 23 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:16) 1√ (cid:80)n i=1 exp (cid:80)n j=1 exp (cid:17) k xi d xlWQW ⊤ (cid:16) 1√ d xlWQW ⊤ Kxj (cid:19) xiWV (cid:17) (cid:21) (cid:20) + 7 exp (cid:18) ν2 − ν4 + ψ(δ, d) √ d − 1 ∥μlWV ∥∞, − μlWV (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)∞ ≤ 4 exp (cid:19) (cid:18) ψ(δ, d) √ d σν5 (cid:115) 2 dn log (cid:19) (cid:18) 2d δ where ψ(δ, d) = 2σν1ν6 (cid:113) 2 log (cid:0) 1 δ (cid:1) + 2σ2ν6 log (cid:0) d δ (cid:1). Proof. See the proof of Lemma 2 in Wang et al. (2022) with k1 = k = n. ■ E.2 Theorem E.4 We first give the formal statement of Theorem E.4. Theorem E.3 (formal statement of Theorem E.4). Let gi ∈ Rd and yi ∈ RT be the feature map vector and forecasting targets for the sample i = 1, 2, ..., N respectively, and we assume i ⪰ σI for some σ > 0. We want to learn a matrix W ∈ Rd×T from the following 1 i=1 gig⊤ N optimization problem: (cid:80)N W = arg min 1 2N N (cid:88) i=1 ∥W gi − yi∥2 2. (1) If we apply stochastic gradient descent with diminishing step sizes ηt = 1 t = ̃O(ε−1σ−1) steps to reach N (cid:88) t (cid:88) N (cid:88) (cid:32) (cid:33) 1 t 1 2N j=1 i=1 1 2N i=1 ∥Wjgi − yi∥2 2 − ∥W ∗gi − yi∥2 2 ≤ ε, (2) σt at step t, we will need where W ∗ is the optimal solution and Wj is the j step's solution and ̃O we suppress the logarithmic dependence. (cid:80)T Proof. As we assume 1 i ⪰ σI, the hessian of optimization problem in (1) is also N positive definite, which is equivalent to the optimization problem in (1) is strongly convex with parameter proportional to σ. Then via standard stochastic gradient decent analysis (e.g., section 3.1 in Lacoste-Julien et al. (2012)), we obtain: i=1 gig⊤ 1 t (cid:32) t (cid:88) j=1 1 2N N (cid:88) i=1 (cid:33) ∥Wjgi − yi∥2 2 − 1 2N N (cid:88) i=1 ∥W ∗gi − yi∥2 2 ≤ O (cid:19) (cid:18) log t σt = ̃O(σ−1t−1). (3) Therefore, to reach ε optimization gap, we just need to set t = ̃O(σ−1ε−1). ■ The second observation is that for the pretrained GPT2-FPT model, the last transformer layer's outputs, i.e., feature maps, are spread widely throughout the feature space. We report the t-SNE visualization of the feature maps for GPT2-FPT and an end-to-end model PatchTST in Figure 8. In Figure 8 (a) and (b), we color the samples chunked from the one single time series into the same color and the same configuration of the T-SNE is applied. One may observe that the feature maps of GPT2-FPT has less concentration compared to PatchTST. It implies the GPT2-FPT's feature maps corresponding to different samples are more distinctive which eventually facilitates the learning ability of the last MLP layer. Researchers Wang & Isola (2020) have found that contrastive learning-based representation learning may result in a uniform distribution of training data, and such behavior plays an important role in its good downstream task performance. We use the following theorem to justify it. Theorem E.4 (informal). Let gi and yi be the feature map vector and forecasting targets for the sample i = 1, 2, ..., N respectively, and we assume 1 i ⪰ σI for some σ > 0. Under mild N conditions, if we train an MLP layer that maps feature maps to forecasting targets via the stochastic gradient descent, the total step to reach some optimization tolerance is on the order of O(σ−1). i=1 gig⊤ (cid:80)N 24 Figure 6: The performance and token similarity within samples with respect to each layer with different random replace ratios. Pretrained parameters are replaced by random initial parameters according to certain proportions. Figure 7: The token similarity within samples with respect to each layer. (a) GPT2-noPretrain-model; (b) GPT2-Pretrained-model; (c) Pretrained attention is replaced by PCA. The Theorem E.4 considers the covariate matrix of feature maps being positive definite that indicates the set of all feature maps {gi} spans the whole feature spaces, and the higher spread level gives a larger σ. In this case, if we only want to learn an MLP layer, the problem reduces to a well-conditioned least-squared regression problem. Then the fast convergence rate is achieved. Efficiently learning the last MLP layer plays a very important role in time series forecasting and can substantially impact the prediction performance. In Zeng et al. (2023), the authors show that learning a single MLP layer can also bring very promising performance. In few-shot forecasting, the pre-trained GPT2 model may still preserve highly diverse feature maps than end-to-end type models and eventually leads to fast learning speed on the last MLP layer. Another possible benefit of wide spared feature maps is enhancing the model memorization ability when using a multi-layer decoder structure. In the literature on network memorization ability (e.g., Vardi et al. (2021); Yun et al. (2020)), the deep learning model tends to have better memorization ability when feature maps are well separated. In forecasting tasks, capturing extreme or rare behavior is very important. The pretrained GPT gains more capacity in the decoder to correctly forecast uncommon time series. F N-gram Explanation for Universality Why does the proposed pretrained-frozen-model work so effectively? We have achieved state-of- the-art performance in time series analysis using a language model that is mostly trained on natural language data. The answer lies in the universality of the frozen structure, which includes attention layers and Feed Forward layers. We can represent images and time series forecasting tasks as an n-gram estimation problem, akin to text analysis, by employing a patching approach. This method treats subsequences of time series or image patches as individual tokens. Central to sequential prediction is the n-order Markov process, and a simple way to capture the n-order Markov process is n-gram language model. To predict next token w0, we need to compute p(w0|w1, . . . , wn−1), which can be further computed as p(w0w1 . . . wn−1)/p(w1 . . . wn−1). Hence, the core of n-gram 25 Replace添加Replace Ratio 100%Replace Ratio 80%Replace Ratio 60%Replace Ratio 40%Replace Ratio 20%Replace Ratio 0%Replace Ratio (%)(a) Random Initialization(b) Pretrained Parameters(c) PCA as Attention Figure 8: The t-SNE visualization of sample feature maps for (a) GPT-backbone, (b) end-to-end- PatchTST-model. (c) The token similarity within samples within different continuous sequence lengths. language model is to estimate the probability of observing a sequence of n tokens. When n is large, most of n token sequences will not be observed from data, leading to the sparse data problem, a common challenge faced by n-gram language model. As a result, a large body of research in n-gram language model is focused on how to effectively estimate probability of having n-token sequences even when they are NOT observed from data. We hypothesize that the transformer model pretrained by GPT-2 essentially allows us to estimate p(w0w1 . . . wn−1) from observations of significantly shorter token sequences. In this section, we will show that the function of estimating probabilities of longer sequences from observation of shorter sequences is universal and is independent from domain as long as data exhibit a skew distribution (e.g., follows a power law). We note that our work is closely related to the discussion presented in Elhage et al. (2021); Olsson et al. (2022), where the authors also connect the function of transformer to compute of n-grams. We however note that our key result is to show the universality in computing probability of longer sequences from observations of shorter sequences, which can't be found in any existing studies. Although the discussion is restricted to discrete tokens, it should be generalized to continuous signals as we can always quantize continuous signals into a finite number of discrete tokens, similar to what BEiT Bao et al. (2022) did. To gain a better understanding, let's start by examining a "zero-layer" Transformer model. This model operates by taking a token, embedding it, and transforming it back to produce logits that predict the subsequent token. Because it cannot transfer information from other tokens, it relies solely on the current token to predict the next one. Consequently, the optimal behavior of this model is to closely resemble the bigram log-likelihood. Then we move on to the so-called "attention-only" transformer, which doesn't have MLP layers. As discussed in a recent work Elhage et al. (2021), one-layer attention-only Transformers can be comprehended as a combination of a bigram model and multiple "skip-trigram" models (impacting the probabilities of sequences "A. . . BC"). This can be intuitively understood as each attention head having the ability to selectively attend from the current token ("B") to a previous token ("A") and transfer relevant information to fine-tune the probability of potential subsequent tokens ("C"). Olsson et al. (2022) further discusses a multi-layer transformer can do more complex n-gram estimation using an induction heads mechanism. To be more precise, induction heads employ a straightforward principle: the '[A][B] ... [A] → [B]' rule, which elevates the likelihood of generating the subsequent token 'B' given the current token 'A' if there is a fuzzy match of the AB bigram in the historical context. This rule seems to largely decouple A and B, which means they do not memorize a fixed table of n-gram statistics. The rule [A][B] . . . [A] → [B] applies regardless of what A and B are, which can abstract to new patterns. Building upon these discussions, we are now prepared to substantiate the following argument: For sequential data following a power law, there is a potentially universal solution to the final estimation of n-gram probabilities. That's the reason behind the universality of pretrained LM's performance in cross-domain tasks. For simplicity, we assume that n is so large that we are unable to observe any occurrence of n-gram from data, and we only observe the occurrence of n′-grams with n′ < n. We denote by sn j appears i the ith unique n-gram, and by the notation sn′ i if n′-gram sn′ j ∈ sn 26 (a) GPT2-backbone(b) PatchTST(c) Token similarity in sn i , the ith n-gram. Let mn be the number of unique n-grams. According to the maximum entropy model, our estimation of n-gram probabilities can be cast into the following optimization problem: min (cid:80)mn i=1 p(sn i ) log p(sn i ) bility of observing pattern sn′ j For each constraint for (cid:98)p(sn′ tion problem as follows: i:sn′ j ∈sn i p(sn i ) = (cid:98)p(sn′ s. t. (cid:80) from the data and j ∈ [mn′], n′ ∈ [n − 1]. j ), we introduce a Lagrangian dual variable λn′ j ) where (cid:98)p(sn′ minλ log (cid:16)(cid:80)mn i=1 exp (cid:16)(cid:80) (n′,j):sn′ j ∈sn i (cid:17)(cid:17) λn′ j − (cid:80)n−1 n′=1 (cid:80)mn′ j=1 λn′ j (cid:98)p(sn′ j ), (cid:16)(cid:80) where n-gram probability p(sn (cid:80)mn i=1 exp((cid:80) λn′ j ) (n′,j):sn′ j ∈sn i j ) is given as p(sn j ) = 1 Z(λ) exp (n′,j):sn′ j ∈sn i (cid:17) λn′ j and Z(λ) = j ) represents the proba- j , and rewrite the optimiza- In the case that all n-grams follow a power law, for each n′ ∈ [n − 1], we divide n′-gram into two groups: the group Vn′ includes the high frequency n′-gram and the group Un′ including the low frequency of n′-gram. For simplicity, we assume that the probability for all the high frequency n′-grams are roughly αn′ ∈ [0, 1] and the probability for all the low frequency n′-grams are roughly βn′ ∈ [0, 1]. By assuming that all the patterns in Vn′ and Un′ share similar appearance frequency, we simplify the optimization problem by only introducing two dual variables for each n′-gram, i.e. λn′ a for high-frequency patterns and λn′ for low-frequency patterns as follow Using these notations, we b have the optimization problem simplified as minλ where gn′ = (cid:80) Furthermore, let qn′ and qn′ log((cid:80)mn b I(sn′ +λn′ (cid:80) n′=1 a I(sn′ λn′ j ∈sn i (cid:16) a gn′ + λn′ λn′ i=1 exp((cid:80)n−1 j:sn′ j ∈ Un′))) − (cid:80)n−1 j ∈Vn′ (cid:98)p(sn′ sn′ a be the probability to observe a high frequency n′-gram appearing in any n-gram, j ∈ Vn′) (cid:17) b hn′ , j ∈Un′ (cid:98)p(sn′ j ). sn′ hn′ = (cid:80) j ) and n′=1 b be the probability to observe a low frequency n′-gram appearing in any n-gram, we have (cid:80)mn i=1 exp((cid:80)n−1 (cid:81)n−1 j ∈ Vn′) + λn′ b exp(λn′ b I(sn′ b )) + O (cid:0)√ a I(sn′ λn′ a ))(1 + qn′ j ∈ Un′)) (cid:1) . mn n′=1 = mn (cid:80) j:sn′ j ∈sn i a exp(λn′ n′=1(1 + qn′ √ By skipping the term O( (cid:16) 1 + qn′ (cid:80)n−1 minλ n′=1 log mn), we further simplify the optimization problem as a exp(λn′ a ) (cid:17) − + (cid:80)n−1 n′=1 log (cid:16) 1 + qn′ b exp(λn′ b (cid:17) − λn′ b hn′, which is equivalent to (cid:16) (cid:17) 1 + qn′ 1 + qn′ a exp(λ) (cid:17) b exp(λ) − λg′ n − λh′ n. a , qn′ b will only depend on statistics qn′ λa n′ = minλ log (cid:16) λb n′ = minλ log λn′ a and λn′ b , gn′ and hn′. They are independent from the detailed statistics (cid:98)p(sn′ j ) and how each n′-gram appears in different n-gram. Thus, this simple analysis does indicate, to some degree, that the solution obtained from the maximum entropy model can be universal, as long as n-grams follow skewed distributions like power law. As illustrated by the above analysis, dual variables We informally demonstrate that transformer models utilize attention mechanisms to perform a sophisticated form of n-gram estimation, and the generation rule for such n-gram distributions could be universal. This is how universality is achieved in our proposed cross-domain knowledge transfer. However, we currently lack a concrete metric to evaluate the performance of knowledge transfer between different domains, which requires further investigation. Nonetheless, in our experimental study, we demonstrate that a transformer model (beit) Bao et al. (2022) trained on images can perform well on cross-domain time series forecasting tasks. 27 G Connection between self-attention and Principle component analysis Understand the Gradient Structure of Self-Attention Let X = (x1, . . . , xN )⊤ ∈ RN ×D be the input pattern, and let f (X) = (f1(X), . . . , fN (x))⊤ : RN ×D (cid:55)→ RN ×D be the function for self-attention, i.e. fi(X) = softmax(XAX ⊤)X where A = WQW ⊤ with respect to input pattern. The lemma below shows an important structure of J. K ∈ RD×D. Let the Jacobian J = i,j=1 represent the gradient f (X) (cid:104) ∂fi(X) ∂xj (cid:105)N Lemma G.1. |J|2 ≤ |A|2 (cid:80)N i=1 (cid:0)Pi,i + 1 2 (cid:1) (cid:12) (cid:12)xi − (cid:80)N (cid:12) j=1 Pi,jxj (cid:12) 2 (cid:12) (cid:12) + ∆ where Pi,j = ∆ = |A|2 (cid:80)N i̸=j Pi,j (cid:12) (cid:12)xj − (cid:80)N (cid:12) k=1 Pi,kxk 2 (cid:12) (cid:12) (cid:12) + |A|2 2 (cid:80)N j=1 |xi|2 and i Axj ) exp(x⊤ k=1 exp(x⊤ i Axk) (cid:80)N Proof. According to the analysis from the work, we have the gradient Ji,j = ∂fi(X) is given by xj Ji,j = Pi,jI + X ⊤Qi (cid:0)XAδi,j + Ej,iXA⊤(cid:1) where Qi = diag(Pi,:) − Pi,:P ⊤ i,: Here Pi,: ∈ + represents the i-th row of matrix P . We thus have |J|2 ≤ (cid:80)N ≤ (cid:80)N RN i,j=1 |Ji,j|2 i,j=1 Pi,j + (cid:80)N i=1 |X ⊤QiX|2|A|2 + (cid:80)N (cid:18) (cid:80)N (cid:80)N (cid:80)N ≤ N + |A|2 i=1 ≤ N + |A|2 (cid:80)N i=1 (cid:80)N ≤ |A|2 (cid:80)N i=1 (cid:0)Pi,i + 1 2 (cid:12) (cid:12) j=1 Pi,j|xj|2 − (cid:12) (cid:12) (cid:12)xj − (cid:80)N (cid:12) (cid:12) (cid:12) (cid:1) (cid:12) (cid:12)xi − X ⊤Pi,: 2 j=1 Pi,j i,j=1 |X ⊤QiEj,iX|2|A|2 (cid:80)N 2(cid:19) + |A|2 (cid:12) (cid:12) (cid:12) j=1 Pi,jxj 2 (cid:80)N i,j=1 Pi,j k=1 Pi,kxk (cid:12) (cid:12) (cid:12) + |A|2 N (cid:88) (cid:12) (cid:12)x⊤ i i,j=1 |X ⊤Qiejx⊤ i | (cid:0)xj − X ⊤Pi,: |A|2 2 N (cid:88) + (cid:12) (cid:12) 2 j=1 (cid:123)(cid:122) :=∆ (cid:125) + N + |A|2 Pi,j (cid:12) (cid:12)xj − X ⊤Pi,: |xi|2 i̸=j (cid:124) (cid:1)(cid:12) (cid:12) ■ As indicated by Lemma 1, one of the key components in the upper bound of Jacobian is |xi − (cid:80)N j=1 Pi,jxj|2. Thus, through the optimization, we like to reduce the size of the gradient and therefore may prefer to reduce the quantity to (cid:80)N j=1 Pi,jxj|2. Hence, it will be interesting to understand the choice of W Q and W K that leads to the minimization of (cid:80)N j=1 Pi,jxj|2, 2 i=1 |xi −(cid:80)N i=1 |xi −(cid:80)N (cid:80)N i=1 (cid:12) (cid:12)xi − (cid:80)N (cid:12) j=1 Pi,jxj (cid:12) (cid:12) (cid:12) where ρ is introduced i.e. the following optimization problem min |A|F ≤ρ to control the size of A. Connection between Self-Attention and Principal Component Analysis ̄x as i=1 (cid:80)N N x⊤ small, we consider Let proximate Pi,j i=1 |xi − X ⊤Pi,:|2 = (cid:80)N the optimization problem in (G) when ρ is N + 1 Pi,j ≈ 1 i Axj (cid:12) (cid:12)xi − ̄x − X ⊤XAxi can ap- X ⊤1/N . We have 2 By assuming that all the input patterns are i=1 |xi − X ⊤XAxi|2 = tr (cid:0)(I − X ⊤XA)2X ⊤X(cid:1) The i=1 |xi − X ⊤XAxi|2 contains the largest zero centralized, we have ̄x = 0 and (cid:80)N theorem below shows that A minimizing the objective (cid:80)N m eigenvectors of X ⊤X where m is the rank of A. Theorem 2. Let WQ and WK be matrices of size D × m. Let λ1 ≥ λ2 ≥ ... ≥ λD be the eigenvalues of X ⊤X ranked in descending order, and let vi ∈ RD, i = 1, . . . , D be the corre- sponding eigenvectors. The optimal solution A∗ that minimizes (cid:80)N i=1 |xi − X ⊤XAxi|2 is given by Define (cid:12) (cid:12) = A = (cid:80)m i=1 1 λi viv⊤ i Proof. Since WQ, WK ∈ RD×m where m < D, we know that A is a matrix of rank m. Hence, we know min k=m+1 λk We also know that by choosing A as A A = (cid:80)m 1 i=1 λi i=1 |xi − X ⊤XAxi|2 ≥ (cid:80)N i we have viv⊤ (cid:80)N 28 (cid:80)N i=1 |xi − X ⊤XAxi|2 = tr (cid:16)(cid:0)I − (cid:80)m i=1 viv⊤ i (cid:1)2 X ⊤X (cid:17) = (cid:80)D k=m+1 λk Hence, the solution A for minimizing (cid:80)N i=1 |xi − X ⊤XAxi|2 is essential a weighted combination of top eigenvectors of X ⊤X. Since a small gradient will prefer a small quantity of (cid:80)N i=1 |xi − X ⊤XAxi|2, by minimizing through the self-attention layer, we essentially choose weight matrix ■ WQ and WK to be aligned with the principal directions of X ⊤X. H Experiment Analysis and Other Key Results H.1 Experiment analysis of GPT2-FPT model In this section, we conduct experiments to analyze whether the self-attention frozen pre-trained model improves performance compared with overall fine-tuning and random initialization. Firstly, we compare GPT2(6) FPT with the same model without freezing (No Freeze) and random initial model (No Pre-train). For the end-to-end paradigm No Pre-train GPT2-backbone (6 Layers), we directly train all parameters of the model. We summarize the results in Table 21 and Table 22. Then we analyze the performance of various layers to clarify our selection of GPT2(6) FPT. Table 21: Model analysis results on 5% data. We use prediction length O ∈ {96, 192, 336, 720} for ILI and O ∈ {24, 36, 48, 60} for others. Methods GPT2(6) No Freeze No Pretrain Metric MSE MAE MSE MAE MSE MAE r 96 e h 192 t a 336 e 720 W 1 96 h 192 T 336 T E 720 2 96 h 192 T 336 T E 720 1 96 m 192 T 336 T E 720 2 96 m 192 T 336 T E 720 0.175 0.227 0.286 0.366 0.543 0.748 0.754 - 0.376 0.418 0.408 - 0.386 0.440 0.485 0.557 0.199 0.256 0.318 0.460 0.230 0.276 0.322 0.379 0.506 0.580 0.595 - 0.421 0.441 0.439 - 0.405 0.438 0.459 0.499 0.280 0.316 0.353 0.439 0.183 0.275 0.297 0.380 0.671 0.907 0.931 - 0.440 0.503 0.691 - 0.429 0.496 0.535 0.786 0.217 0.300 0.331 0.460 0.229 0.300 0.331 0.388 0.564 0.632 0.655 - 0.449 0.478 0.572 - 0.432 0.470 0.489 0.592 0.293 0.350 0.368 0.436 0.199 0.262 0.326 0.405 0.882 1.389 2.968 - 0.465 0.614 0.596 - 0.394 0.432 0.491 0.564 0.301 0.321 0.371 0.659 0.254 0.302 0.345 0.396 0.643 0.817 1.149 - 0.457 0.536 0.529 - 0.410 0.432 0.464 0.503 0.353 0.365 0.398 0.528 Fine-tune More Parameters Compared with fine-tuning all parameters, self-attention frozen pre- trained model GPT2(6) FPT achieves better performance on most datasets and yields an overall 12.7% relative MSE reduction on 5% data and 11.5% relative MSE reduction on 10% data. It verifies that frozen pre-trained attention layers are effective for time series forecasting. Parameters Initialization Compared with the random initial model, self-attention frozen pre-trained model GPT2(6) FPT achieves better performance on most datasets and yields an overall 21.2% relative MSE reduction on 5% data and 14.3% relative MSE reduction on 10% data. It again suggests that a model pre-trained on cross-domain data can achieve significant performance improvement in time series forecasting. The Number of GPT2 Layers For most transformer-based methods in time-series forecasting Zhou et al. (2022); Wu et al. (2021); Nie et al. (2022), no more than 3 encoder layers are included. However, most pre-trained models with at least 12 layers may suffer from overfitting in time series forecasting. To better balance performance and computational efficiency, we test using various numbers of layers on ETTh2. Additionally, we train a completely random initialized non-pretrained GPT2 as a comparison. The results are shown in Figure 9, for both 5% and 10% data, the pre-trained model is unable to do well with few layers but significantly outperforms non-pre-trained GPT2 with more attention blocks transferred from NLP. It indicates that pre-trained attention layers produce 29 Table 22: No Pretrain and No Freeze results on 10% data. We use prediction length O ∈ {96, 192, 336, 720} for ILI and O ∈ {24, 36, 48, 60} for others. Methods GPT2(6) No Freeze No Pretrain Metric MSE MAE MSE MAE MSE MAE r 96 e h 192 t a 336 e 720 W 1 96 h 192 T 336 T E 720 2 96 h 192 T 336 T E 720 1 96 m 192 T 336 T E 720 2 96 m 192 T 336 T E 720 0.163 0.210 0.256 0.321 0.458 0.570 0.608 0.725 0.331 0.402 0.406 0.449 0.390 0.429 0.469 0.569 0.188 0.251 0.307 0.426 0.215 0.254 0.292 0.339 0.456 0.516 0.535 0.591 0.374 0.411 0.433 0.464 0.404 0.423 0.439 0.498 0.269 0.309 0.346 0.417 0.168 0.238 0.289 0.398 0.605 0.713 0.747 0.945 0.369 0.464 0.420 0.535 0.429 0.463 0.510 0.780 0.243 0.307 0.337 0.471 0.221 0.286 0.318 0.383 0.532 0.579 0.586 0.688 0.394 0.455 0.439 0.515 0.430 0.446 0.470 0.591 0.311 0.352 0.364 0.440 0.175 0.244 0.301 0.390 0.680 0.738 0.893 2.994 0.422 0.482 0.540 0.564 0.385 0.426 0.506 0.576 0.244 0.318 0.409 0.473 0.229 0.287 0.325 0.378 0.560 0.602 0.641 1.169 0.433 0.466 0.496 0.519 0.401 0.421 0.455 0.505 0.315 0.363 0.412 0.450 a great benefit in time series forecasting. Also, the pre-trained model achieves better performance between 3 and 9 layers. Thus GPT2 with 6 layers is chosen as our default architecture. Figure 9: Comparison of pre-trained and non-pre-trained GPT2 with various layers on ETTh2. Color represents various prediction length O ∈ {96, 192} and line style means different models . H.2 No Pre-training but Freezing For comprehensively ablation on pre-training and freezing strategies, we also add experiment for random initialized GPT2(6) with freezing. The results in Table 23 shows that only input and output modules can not work and pre-trained knowledge play an importance part in time series tasks. Table 23: Ablation on random initialized model with freezing. Methods Metric GPT2(6) No Freeze No Pretrain No Pretrain + Freeze MSE MAE MSE MAE MSE MAE MSE 2 h T T E 96 192 0.376 0.418 0.421 0.441 0.440 0.503 0.449 0.478 0.465 0.614 0.457 0.536 0.540 0.721 30 MAE 0.497 0.580 H.3 Fine-Tuning Parameters Selection In this section, we conduct ablation experiments to study which parameters are important to fine-tune. Since the input embedding and output layers are randomly initialized for adapting to a new domain, they must be trained. Then, we study adding layer normalization and positional embeddings to the list of fine-tuning parameters. Table 24 shows the results that re-train parameters of layer normalization and positional embeddings can bring certain benefits, especially in longer prediction lengths. Thus, we follow the standard practice to re-train positional embeddings and layer normalization. Table 24: Ablation by fixing positional embeddings or layer normalization on 5% ETTm1 and ETTm2. Parameters of GPT2(6) are successively added to the list of fine-tuned parameters. Methods Input & Output + LN + POS Metric MSE MAE MSE MAE MSE MAE 1 96 m 192 T 336 T E 720 2 96 m 192 T 336 T E 720 0.395 0.444 0.510 0.607 0.198 0.261 0.336 0.473 0.410 0.438 0.472 0.517 0.282 0.324 0.377 0.444 0.392 0.436 0.495 0.564 0.198 0.263 0.322 0.457 0.409 0.435 0.467 0.503 0.279 0.325 0.356 0.435 0.386 0.440 0.485 0.557 0.199 0.256 0.318 0.460 0.405 0.438 0.459 0.499 0.280 0.316 0.353 0.436 H.4 Analysis of Data Volume Results of few-shot learning show that GPT2(6) FPT shows SOTA performance in few-shot learning tasks in which the model is trained on 5% data and 10% data. Plus, it has comparable performance with the SOTA baselines PatchTST and Dlinear on full sample forecasting setting as well. This phenomenon raises a question that how performance changes with an increase in data sample size. Thus, we conduct experiments on various percentages P ∈ {5%, 10%, 20%, 50%, 80%, 100%} of ETTh2. Figure 10 shows that the performance improvement for GPT2(6) FPT is almost flattened. These results illustrate that such a cross-domain FPT model is extremely efficient in few-shot time series forecasting and only requires a few fine-tuning samples to reach a SOTA performance. For more complete data, end-to-end training models start to catch up, but still, a GPT2(6) FPT model can be comparable to those SOTA end-to-end training algorithms. Figure 10: Results on various percentages of ETTh2. Line color represents different models and line style means various prediction lengths O ∈ {96, 192}. 31 H.5 Knowledge transfer with other Pre-trained Transformer Models We investigate how other pre-trained transformer models perform and whether other domains can also help. Another NLP pre-trained model BERT Devlin et al. (2019) and the CV pre-trained model BEiT Bao et al. (2022) are trained on 5% ETTh2 and 5% ETTm2. Similar to GPT2, we only reserve 6 layers and freeze attention blocks. Our results are shown in Table 25 that BERT(6) FPT and BEiT(6) FPT are comparable to PatchTST and remarkably surpass other baselines. We come to the conclusion that the universality of our proposed architecture holds across other pre-trained-transformer models. Moreover, the domain of successful knowledge transfer in time series forecasting is not limited to natural language. Knowledge from the CV domain can also help, supported by BEiT's experimental results. Table 25: Results of frozen pretrained transformer variants on 5% ETTh2 and ETTm2. We use prediction length O ∈ {96, 192, 336, 720}. A lower MSE indicates better performance. Black: best, Red: second best, Violet: third best. '-' means that 5% time series is not sufficient to constitute a training set. Methods Metric 96 ETTh2 192 336 ETTm2 720 96 192 336 720 GPT2-backbone(6 Layers) BERT-backbond(6 Layers) BEiT-backbond(6 Layers) DLinearZeng et al. (2023) PatchTSTNie et al. (2022) FEDformerZhou et al. (2022) AutoformerWu et al. (2021) MSE 0.376 0.421 0.408 MAE 0.419 0.441 0.439 MSE 0.397 0.480 0.481 MAE 0.418 0.465 0.472 MSE 0.405 0.448 0.524 MAE 0.418 0.446 0.500 MSE 0.442 0.617 1.424 MAE 0.456 0.542 0.849 MSE 0.401 0.452 0.464 MAE 0.421 0.455 0.469 MSE 0.390 0.457 0.477 MAE 0.424 0.465 0.483 MSE 0.428 0.496 0.486 MAE 0.468 0.504 0.496 - - - - - - - - - - - - - - 0.199 0.256 0.318 0.460 0.280 0.316 0.353 0.436 0.222 0.281 0.331 0.441 0.300 0.335 0.367 0.428 0.208 0.272 0.331 0.452 0.291 0.326 0.362 0.433 0.236 0.306 0.380 0.674 0.326 0.373 0.423 0.583 0.206 0.264 0.334 0.454 0.288 0.324 0.367 0.483 0.299 0.290 0.378 0.523 0.320 0.361 0.427 0.510 0.232 0.291 0.478 0.533 0.322 0.357 0.517 0.538 H.6 Full Results of Classification Table 26: Full results for the classification task. ∗. in the Transformers indicates the name of ∗former. Methods EthanolConcentration FaceDetection Handwriting Heartbeat JapaneseVowels PEMS-SF SelfRegulationSCP1 SelfRegulationSCP2 SpokenArabicDigits UWaveGestureLibrary Average TCN RNN Classical methods XGBoost Rocket LSTNet LSSL 28.9 31.1 52.8 66.7 53.3 24.6 75.6 72.7 98.9 98.4 68.8 86.1 84.6 90.8 52.2 55.6 100.0 95.6 88.4 85.9 70.3 70.9 39.9 65.7 25.8 77.1 98.1 86.7 84.0 52.8 100.0 87.8 71.8 45.2 64.7 58.8 75.6 96.2 75.1 90.8 53.3 71.2 94.4 72.5 43.7 63.3 15.8 73.2 86.5 98.3 84.6 48.9 69.6 75.9 66.0 Transformers MLP Trans. Re. 32.7 67.3 32.0 76.1 98.7 82.1 92.2 53.9 98.4 85.6 71.9 In. 31.6 31.9 31.6 68.4 68.6 67.0 36.7 27.4 32.8 74.6 77.1 80.5 96.2 97.8 98.9 82.7 82.7 81.5 84.0 90.4 90.1 56.7 53.3 50.6 97.0 100.0 99.6 100.0 85.9 85.6 85.6 71.1 71.5 72.1 Pyra. Auto. Station. FED. ETS. Flow. DLinear LightTS. 30.8 65.7 29.4 75.6 98.4 83.2 88.1 53.3 33.8 28.1 31.2 67.6 66.3 66.0 33.8 32.5 28.0 77.6 71.2 73.7 98.9 95.9 98.4 83.8 86.0 80.9 92.5 89.6 88.7 54.4 56.1 55.0 100.0 100.0 98.8 86.6 85.0 85.3 73.0 71.0 70.7 29.7 67.5 26.1 75.1 96.2 88.4 89.8 51.1 100.0 80.3 70.4 32.7 68.0 31.6 73.7 99.2 87.3 89.4 57.2 100.0 87.5 72.7 32.6 68.0 27.0 75.1 96.2 75.1 87.3 50.5 81.4 82.1 67.5 83.4 70.8 TimesNet GPT2(6) 35.7 68.6 32.1 78.0 98.4 89.6 91.8 57.2 99.0 85.3 73.6 34.2 69.2 32.7 77.2 98.6 87.9 93.2 59.4 99.2 88.1 74.0 H.7 Full Results of Anomaly Detection H.8 Full Results of Imputation H.9 Full Results of Short-term Forecasting H.10 Input Length Setting Discussion The consideration of input length is of great importance. It is widely believed that longer input lengths have the potential to generate superior results. However, in practice, certain algorithms might fall short in effectively utilizing long input signals due to overfitting issues either. Here, we conducted long-term forecasting experiments by comparing our approach with the best reported values from different baseline papers. This was done to avoid any biases stemming from selective tuning of baseline parameters. While some may argue in favor of a fairer comparison using a fixed input length, 32 Table 27: Full results for the anomaly detection. Methods Metrics SMD R P F1 P MSL R F1 P SMAP R F1 P GPT(6) TimesNet* PatchTST ETSformer FEDformer LightTS DLinear Stationary Autoformer Pyraformer 88.89 87.91 87.26 87.44 87.95 87.10 83.62 88.33 88.06 85.61 Anomaly Transformer** 88.91 86.60 82.58 83.46 83.58 86.89 84.61 84.62 83.13 85.08 82.53 77.10 84.62 85.11 83.04 85.49 81.65 75.32 76.21 79.56 * We reproduce the results of TimesNet by https://github.com/thuml/Time-Series-Library. ** We replace the joint criterion in Anomaly Transformer with reconstruction error for fair comparison. 82.45 81.84 78.70 85.03 78.57 78.95 84.88 77.50 79.05 84.86 83.31 84.06 84.40 79.57 78.68 82.91 75.36 70.96 84.93 80.07 75.78 85.42 89.14 80.92 85.93 87.37 86.48 83.31 87.37 87.37 84.98 81.54 82.14 79.23 82.39 78.42 71.52 81.21 82.35 80.61 82.23 77.23 69.24 70.13 76.13 90.60 90.14 90.64 92.25 90.47 92.58 92.32 89.37 90.40 92.54 91.85 90.11 90.91 89.15 89.37 60.95 56.40 55.46 55.75 58.10 55.27 55.41 59.02 58.62 57.71 58.11 57.13 57.44 57.59 57.12 72.88 69.39 68.82 69.50 70.76 69.21 69.26 71.09 71.12 71.09 71.18 69.92 70.40 69.97 69.70 82.00 89.54 88.34 85.13 77.14 82.40 84.34 68.55 77.27 83.81 79.61 81.77 85.51 73.05 71.57 Informer Reformer LogTransformer Transformer 92.20 90.75 91.10 90.02 90.17 91.98 80.91 68.03 89.85 87.92 72.51 70.29 72.50 68.67 68.84 SWaT R 96.34 95.40 80.94 80.36 96.42 94.72 95.30 96.75 95.81 96.00 97.32 96.75 96.53 97.32 96.53 F1 94.23 93.02 85.72 84.91 93.19 93.33 87.52 79.88 92.74 91.78 83.10 81.43 82.80 80.52 80.37 P 98.62 98.51 98.84 99.31 97.31 98.37 98.28 97.82 99.08 71.67 68.35 64.27 59.93 63.06 62.75 PSM R 95.68 96.20 93.47 85.28 97.16 95.97 89.26 96.76 88.15 96.02 94.72 96.33 95.38 98.00 96.56 F1 97.13 97.34 96.08 91.76 97.23 97.15 93.55 97.29 93.29 82.08 79.40 77.10 73.61 76.74 76.07 Avg F1 % 86.72 85.24 82.79 82.87 84.97 84.23 82.46 82.08 84.26 82.57 80.50 78.83 77.31 76.60 76.88 Table 28: Full results for the imputation task. Methods GPT2(3) TimesNet PatchTST ETSformer LightTS DLinear FEDformer Stationary Autoformer Informer Reformer Mask Ratio MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE 1 m T T E 2 m T T E 1 h T T E 2 h T T E L C E 12.5% 0.017 0.085 0.023 0.101 0.041 0.130 0.096 0.229 0.093 0.206 0.080 0.193 0.052 0.166 0.032 0.119 0.046 0.144 0.063 0.180 0.042 0.146 25% 0.022 0.096 0.023 0.101 0.044 0.135 0.096 0.229 0.093 0.206 0.080 0.193 0.052 0.166 0.032 0.119 0.046 0.144 0.063 0.180 0.042 0.146 37.5% 0.029 0.111 0.029 0.111 0.049 0.143 0.133 0.271 0.113 0.231 0.103 0.219 0.069 0.191 0.039 0.131 0.057 0.161 0.079 0.200 0.063 0.182 50% 0.040 0.128 0.036 0.124 0.055 0.151 0.186 0.323 0.134 0.255 0.132 0.248 0.089 0.218 0.047 0.145 0.067 0.174 0.093 0.218 0.082 0.208 0.028 0.105 0.027 0.107 0.047 0.140 0.120 0.253 0.104 0.218 0.093 0.206 0.062 0.177 0.036 0.126 0.051 0.150 0.071 0.188 0.055 0.166 Avg 12.5% 0.017 0.076 0.018 0.080 0.026 0.094 0.108 0.239 0.034 0.127 0.062 0.166 0.056 0.159 0.021 0.088 0.023 0.092 0.133 0.270 0.108 0.228 25% 0.020 0.080 0.020 0.085 0.028 0.099 0.164 0.294 0.042 0.143 0.085 0.196 0.080 0.195 0.024 0.096 0.026 0.101 0.135 0.272 0.136 0.262 37.5% 0.022 0.087 0.023 0.091 0.030 0.104 0.237 0.356 0.051 0.159 0.106 0.222 0.110 0.231 0.027 0.103 0.030 0.108 0.155 0.293 0.175 0.300 50% 0.025 0.095 0.026 0.098 0.034 0.110 0.323 0.421 0.059 0.174 0.131 0.247 0.156 0.276 0.030 0.108 0.035 0.119 0.200 0.333 0.211 0.329 0.021 0.084 0.022 0.088 0.029 0.102 0.208 0.327 0.046 0.151 0.096 0.208 0.101 0.215 0.026 0.099 0.029 0.105 0.156 0.292 0.157 0.280 Avg 12.5% 0.043 0.140 0.057 0.159 0.093 0.201 0.126 0.263 0.240 0.345 0.151 0.267 0.070 0.190 0.060 0.165 0.074 0.182 0.114 0.234 0.074 0.194 25% 0.054 0.156 0.069 0.178 0.107 0.217 0.169 0.304 0.265 0.364 0.180 0.292 0.106 0.236 0.080 0.189 0.090 0.203 0.140 0.262 0.102 0.227 37.5% 0.072 0.180 0.084 0.196 0.120 0.230 0.220 0.347 0.296 0.382 0.215 0.318 0.124 0.258 0.102 0.212 0.109 0.222 0.174 0.293 0.135 0.261 50% 0.107 0.216 0.102 0.215 0.141 0.248 0.293 0.402 0.334 0.404 0.257 0.347 0.165 0.299 0.133 0.240 0.137 0.248 0.215 0.325 0.179 0.298 0.069 0.173 0.078 0.187 0.115 0.224 0.202 0.329 0.284 0.373 0.201 0.306 0.117 0.246 0.094 0.201 0.103 0.214 0.161 0.279 0.122 0.245 Avg 12.5% 0.039 0.125 0.040 0.130 0.057 0.152 0.187 0.319 0.101 0.231 0.100 0.216 0.095 0.212 0.042 0.133 0.044 0.138 0.305 0.431 0.163 0.289 25% 0.044 0.135 0.046 0.141 0.061 0.158 0.279 0.390 0.115 0.246 0.127 0.247 0.137 0.258 0.049 0.147 0.050 0.149 0.322 0.444 0.206 0.331 37.5% 0.051 0.147 0.052 0.151 0.067 0.166 0.400 0.465 0.126 0.257 0.158 0.276 0.187 0.304 0.056 0.158 0.060 0.163 0.353 0.462 0.252 0.370 50% 0.059 0.158 0.060 0.162 0.073 0.174 0.602 0.572 0.136 0.268 0.183 0.299 0.232 0.341 0.065 0.170 0.068 0.173 0.369 0.472 0.316 0.419 0.048 0.141 0.049 0.146 0.065 0.163 0.367 0.436 0.119 0.250 0.142 0.259 0.163 0.279 0.053 0.152 0.055 0.156 0.337 0.452 0.234 0.352 Avg 12.5% 0.080 0.194 0.085 0.202 0.055 0.160 0.196 0.321 0.102 0.229 0.092 0.214 0.107 0.237 0.093 0.210 0.089 0.210 0.218 0.326 0.190 0.308 25% 0.087 0.203 0.089 0.206 0.065 0.175 0.207 0.332 0.121 0.252 0.118 0.247 0.120 0.251 0.097 0.214 0.096 0.220 0.219 0.326 0.197 0.312 37.5% 0.094 0.211 0.094 0.213 0.076 0.189 0.219 0.344 0.141 0.273 0.144 0.276 0.136 0.266 0.102 0.220 0.104 0.229 0.222 0.328 0.203 0.315 50% 0.101 0.220 0.100 0.221 0.091 0.208 0.235 0.357 0.160 0.293 0.175 0.305 0.158 0.284 0.108 0.228 0.113 0.239 0.228 0.331 0.210 0.319 0.090 0.207 0.092 0.210 0.072 0.183 0.214 0.339 0.131 0.262 0.132 0.260 0.130 0.259 0.100 0.218 0.101 0.225 0.222 0.328 0.200 0.313 Avg r 12.5% 0.026 0.049 0.025 0.045 0.029 0.049 0.057 0.141 0.047 0.101 0.039 0.084 0.041 0.107 0.027 0.051 0.026 0.047 0.037 0.093 0.031 0.076 e 25% 0.028 0.052 0.029 0.052 0.031 0.053 0.065 0.155 0.052 0.111 0.048 0.103 0.064 0.163 0.029 0.056 0.030 0.054 0.042 0.100 0.035 0.082 h t 37.5% 0.033 0.060 0.031 0.057 0.035 0.058 0.081 0.180 0.058 0.121 0.057 0.117 0.107 0.229 0.033 0.062 0.032 0.060 0.049 0.111 0.040 0.091 a e 50% 0.037 0.065 0.034 0.062 0.038 0.063 0.102 0.207 0.065 0.133 0.066 0.134 0.183 0.312 0.037 0.068 0.037 0.067 0.053 0.114 0.046 0.099 0.031 0.056 0.030 0.054 0.060 0.144 0.076 0.171 0.055 0.117 0.052 0.110 0.099 0.203 0.032 0.059 0.031 0.057 0.045 0.104 0.038 0.087 Avg W we are starting to shift our focus towards pursuing more accurate algorithms that possess enhanced capabilities for handling longer inputs. Instead of restricting the input length to a fixed small value, it is pragmatic to tune both the input length and model parameters based on performance, as it is often the primary concern in practical usage. Exploring the utilization of extremely long inputs, such as Chatgpt or LLM, is among our future research directions. 33 Table 29: Full results of short-term forecasting. Methods GPT2(6) TimesNet PatchTST N-HiTS N-BEATS ETSformer LightTS DLinear FEDformer Stationary Autoformer Informer Reformer y SMAPE 13.531 13.387 13.477 13.418 13.436 18.009 14.247 16.965 13.728 13.717 13.974 14.727 16.169 l r a e Y MASE OWA 3.015 0.793 2.996 0.786 y l r e t r a u Q SMAPE 10.177 10.100 MASE OWA 1.194 0.898 1.182 0.890 3.019 0.792 10.38 1.233 0.921 3.045 0.793 3.043 0.794 4.487 1.115 3.109 0.827 4.283 1.058 3.048 0.803 3.078 0.807 3.134 0.822 3.418 0.881 3.800 0.973 10.202 10.124 13.376 11.364 12.145 10.792 10.958 11.338 11.360 13.313 1.194 0.899 1.169 0.886 1.906 1.302 1.328 1.000 1.520 1.106 1.283 0.958 1.325 0.981 1.365 1.012 1.401 1.027 1.775 1.252 y SMAPE 12.894 l h t n o M MASE 0.956 0.897 OWA s SMAPE r e h t O MASE OWA 4.940 3.228 1.029 e SMAPE 11.991 g a r e v A MASE 1.600 OWA 0.861 12.670 12.959 12.791 12.677 14.588 14.014 13.514 14.260 13.917 13.958 14.062 20.128 0.933 0.878 4.891 3.302 1.035 0.970 0.905 4.952 3.347 1.049 0.969 0.899 5.061 3.216 1.040 0.937 0.880 4.925 3.391 1.053 1.368 1.149 7.267 5.240 1.591 1.053 0.981 1.037 0.956 15.880 6.709 11.434 4.953 3.474 1.487 1.102 1.012 4.954 3.264 1.036 1.097 0.998 6.302 4.064 1.304 1.103 1.002 5.485 3.865 1.187 1.141 1.024 2.614 1.927 24.460 32.491 20.960 33.355 5.879 8.679 11.829 12.059 11.927 11.851 14.718 13.525 13.639 12.840 12.780 12.909 14.086 18.200 1.585 0.851 1.623 0.869 1.613 0.861 1.599 0.855 2.408 1.172 2.111 1.051 2.095 1.051 1.701 0.918 1.756 0.930 1.771 0.939 2.718 1.230 4.223 1.775 34
http://arxiv.org/abs/2302.12653v1
2023-02-23T11:11:55
2023-02-23T11:11:55
MesoGraph: Automatic Profiling of Malignant Mesothelioma Subtypes from Histological Images
Malignant mesothelioma is classified into three histological subtypes, Epithelioid, Sarcomatoid, and Biphasic according to the relative proportions of epithelioid and sarcomatoid tumor cells present. Biphasic tumors display significant populations of both cell types. This subtyping is subjective and limited by current diagnostic guidelines and can differ even between expert thoracic pathologists when characterising the continuum of relative proportions of epithelioid and sarcomatoid components using a three class system. In this work, we develop a novel dual-task Graph Neural Network (GNN) architecture with ranking loss to learn a model capable of scoring regions of tissue down to cellular resolution. This allows quantitative profiling of a tumor sample according to the aggregate sarcomatoid association score of all the cells in the sample. The proposed approach uses only core-level labels and frames the prediction task as a dual multiple instance learning (MIL) problem. Tissue is represented by a cell graph with both cell-level morphological and regional features. We use an external multi-centric test set from Mesobank, on which we demonstrate the predictive performance of our model. We validate our model predictions through an analysis of the typical morphological features of cells according to their predicted score, finding that some of the morphological differences identified by our model match known differences used by pathologists. We further show that the model score is predictive of patient survival with a hazard ratio of 2.30. The code for the proposed approach, along with the dataset, is available at: https://github.com/measty/MesoGraph.
[ "Mark Eastwood", "Heba Sailem", "Silviu Tudor", "Xiaohong Gao", "Judith Offman", "Emmanouil Karteris", "Angeles Montero Fernandez", "Danny Jonigk", "William Cookson", "Miriam Moffatt", "Sanjay Popat", "Fayyaz Minhas", "Jan Lukas Robertus" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12653v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12653v1", "@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" ]
http://arxiv.org/abs/2302.11917v1
2023-02-23T10:48:09
2023-02-23T10:48:09
Diverse Policy Optimization for Structured Action Space
Enhancing the diversity of policies is beneficial for robustness, exploration, and transfer in reinforcement learning (RL). In this paper, we aim to seek diverse policies in an under-explored setting, namely RL tasks with structured action spaces with the two properties of composability and local dependencies. The complex action structure, non-uniform reward landscape, and subtle hyperparameter tuning due to the properties of structured actions prevent existing approaches from scaling well. We propose a simple and effective RL method, Diverse Policy Optimization (DPO), to model the policies in structured action space as the energy-based models (EBM) by following the probabilistic RL framework. A recently proposed novel and powerful generative model, GFlowNet, is introduced as the efficient, diverse EBM-based policy sampler. DPO follows a joint optimization framework: the outer layer uses the diverse policies sampled by the GFlowNet to update the EBM-based policies, which supports the GFlowNet training in the inner layer. Experiments on ATSC and Battle benchmarks demonstrate that DPO can efficiently discover surprisingly diverse policies in challenging scenarios and substantially outperform existing state-of-the-art methods.
[ "Wenhao Li", "Baoxiang Wang", "Shanchao Yang", "Hongyuan Zha" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11917v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11917v1", "@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 7 1 9 1 1 . 2 0 3 2 : v i X r a Diverse Policy Optimization for Structured Action Space Wenhao Li The Chinese University of Hong Kong, Shenzhen Shenzhen, China [email protected] Shanchao Yang The Chinese University of Hong Kong, Shenzhen Shenzhen, China [email protected] ABSTRACT Enhancing the diversity of policies is beneficial for robustness, ex- ploration, and transfer in reinforcement learning (RL). In this paper, we aim to seek diverse policies in an under-explored setting, namely RL tasks with structured action spaces with the two properties of composability and local dependencies. The complex action struc- ture, non-uniform reward landscape, and subtle hyperparameter tuning due to the properties of structured actions prevent existing approaches from scaling well. We propose a simple and effective RL method, Diverse Policy Optimization (DPO), to model the policies in structured action space as the energy-based models (EBM) by fol- lowing the probabilistic RL framework. A recently proposed novel and powerful generative model, GFlowNet, is introduced as the efficient, diverse EBM-based policy sampler. DPO follows a joint optimization framework: the outer layer uses the diverse policies sampled by the GFlowNet to update the EBM-based policies, which supports the GFlowNet training in the inner layer. Experiments on ATSC and Battle benchmarks demonstrate that DPO can efficiently discover surprisingly diverse policies in challenging scenarios and substantially outperform existing state-of-the-art methods. KEYWORDS Reinforcement Learning; Generative Model; Diversity; Robustness ACM Reference Format: Wenhao Li, Baoxiang Wang, Shanchao Yang, and Hongyuan Zha. 2023. Diverse Policy Optimization for Structured Action Space. In Proc. of the 22nd International Conference on Autonomous Agents and Multiagent Systems (AAMAS 2023), London, United Kingdom, May 29 – June 2, 2023, IFAAMAS, 18 pages. 1 INTRODUCTION The history of human civilization can be seen as a chronicle of creative capacity, i.e., the diversity of solutions to the same puz- zle [63]. Counter-intuitively, a popular consensus in deep learning with theoretical justifications [50] that most local optimas to a non- convex optimization problem are very close to the global optimum has led mainstream AI research to focus on finding a single local ∗Corresponding author 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. Baoxiang Wang The Chinese University of Hong Kong, Shenzhen Shenzhen, China [email protected] Hongyuan Zha∗ The Chinese University of Hong Kong, Shenzhen, Shenzhen Institute of AI and Robotics for Society Shenzhen, China [email protected] solution to a given optimization problem, rather than on which local optimum is dicovered [103]. It is no coincidence that most methods in reinforcement learning (RL) are also designed to seek a single reward-maximizing policy [59, 71, 76]. However, different local optima in the policy space can corre- spond to strategies that differ in nature, which makes the above consensus problematic in RL tasks where the environment is unsta- ble. For example, in adaptive traffic signal control (ATSC) [81, 89, 90] (conceptual diagram and more examples are included in Figure 1), if two traffic flows are desired to reach the target points from the departure points quickly, multiple control strategies with similar average commuting times may exist due to the combinatorial na- ture of traffic lights. The performance of a single policy obtained by reward maximization is bound to be affected if the subsequent traffic volumes on other sections of the road network associated with the traveled section of that traffic change. Moreover, if our goal is to discover a diverse set of policies, some of these may prove more valuable than others in different situations. Therefore, celebrating the diversity of policies is beneficial for many RL applications. In addition to ATSC and the simple game in Figure 1, these RL application areas include but are not limited to conversation generation in intelligent customer service [41], drug discovery in smart healthcare [67], and simulator design in automated machine learning (AutoML) [86]. Furthermore, in addi- tion to robustness, a set of diverse policies can also be useful for exploration [66], transfer [38], and hierarchy [1] in RL. There is no doubt that RL researchers have demonstrated their creative ability in discovering diverse policies. The majority of the literature has been done in the field of neuroevolution methods inspired by Quality-Diversity (QD), which typically maintains a collection of policies and adapts it using evolutionary algorithms to balance the QD trade-off [16, 24, 45, 62, 65, 70]. In another part of the work, intrinsic rewards have been used for learning diversity in terms of the discriminability of different trajectory-specific quan- tities [1, 18, 25, 26, 29, 72, 97], or have been used as a regularizer when maximizing the extrinsic reward [23, 40, 55, 73, 100]. There is also a small body of work that transforms the problem into a Constrained Markov Decision Process (CMDP) [15, 75, 98, 103], or implicitly induce diversity to learn policies that maximize the set robustness to the worst-possible reward [38, 95]. This paper considers a more complex, realistic, less focused, and under-explored setting, namely RL tasks with structured action spaces. We define structured actions as actions with the following Figure 1: Robustness of diverse policies in two non-stationary environments: (Left) the adaptive traffic signal control and (Right) the predator-prey. In these tasks, diverse policies can quickly adapt to changes in the external environment. two properties: composability, i.e., environmental actions consist of a large number of atomic actions with complete functionality and local dependencies, i.e., there are local physical or logical correlations between atomic actions1. For example, in ATSC, the phases of all traffic signals on all intersections in the entire road network must be redetermined at certain intervals, and atomic actions are phases of each signal and interact with each other through the physical road network. In addition, for the predator-prey task in Figure 1, the atomic actions are the decisions of each predator, and there is a local spatial, logical association. The high dimensionality of the RL agent's policy due to the com- posability of structured actions prevents existing methods from scaling well. Specifically, the combinability will make the underly- ing reward landscape of the RL problem particularly non-uniform, which may make QD-like methods require substantially large pop- ulation sizes to fully explore the policy space and prevent the algo- rithm from collapsing to visually identical policies [77, 103]. Also, due to composability, the complex soft objective introduced by in- trinsic reward or CMDP-driven methods will result in non-trivial and subtle hyperparameter tuning [55, 65]. In addition, the existing agents' policies are mainly parameterized categorical distributions or Gaussian distributions. Their extension to structured actions with independent assumptions on atomic actions will prevent the agent from effectively using the structural information of environ- mental actions to achieve an efficient search for the policy space. We propose a simple and effective RL method, Diverse Policy Optimization (DPO), to discover a diverse set of policies in tasks with structured action spaces. We follow the probabilistic reinforce- ment learning (PRL) framework [40] to transform reinforcement learning problems under stochastic dynamics into variational in- ference problems on probabilistic graphical models and model the policies of RL agents as the energy-based models (EBM). The action distribution induced by this EBM in a structured action space is highly multimodal, and sampling from such a high-dimensional distribution is intractable. To this end, we introduce a recently proposed novel and powerful generative model, Generative Flow Networks (GFlowNet) [4, 5, 33, 99], as the efficient diverse policy sam- pler. GFlowNet can be regarded as amortized Monte-Carlo Markov chains (MCMC), which gradually builds composable environmental actions through the single but trained generative pass of "building blocks (i.e., atomic actions)", so that the final sampled environmen- tal actions obey a given energy-based policy distribution. Notably, our method does not simply introduce the GFlowNet to RL with structured action spaces. Since in the PRL framework, with the update of the soft Q function, the energy-based policy distribution is also constantly changing. This violates the assump- tion of the fixed energy model in GFlowNet and makes DPO face a more complex optimization problem. Therefore, we model DPO as a joint optimization problem: the outer layer uses the diverse policies sampled by the GFlowNet to update the soft Q function, and the inner layer trains the GFlowNet through an EBM based on the soft Q function (see Figure 3). Furthermore, a two-timescale alternating optimization method is proposed to solve it efficiently. We empirically validate DPO on ATSC tasks [2] where atomic ac- tions have local physical dependencies, and more generally, Battle scenarios [102] where atomic actions have logical local dependen- cies. Experiments demonstrate that DPO can reliably and efficiently discover surprisingly diverse strategies in all these challenging scenarios and substantially outperform existing baselines. The con- tributions can be summarized as follows: (1) We propose a novel algorithm, Diverse Policy Optimization, for discovering diverse policies for structured action spaces. The GFlowNet-based sampler can efficiently sample diverse policies from the high-dimensional multimodal distribution induced by structured action spaces. (2) We propose an efficient joint training framework to interleaved optimize the soft-Q-function-based EBM and the reward-conditional GFlowNet-based sampler. (3) Our algorithm is general and effective across structured action spaces with physical and logical local dependencies. 2 PRELIMINARIES AND NOTATIONS The proposed DPO follows the PRL to model policies as a high- dimensional multimodal energy-based probability distribution and introduces GFlowNet to efficiently sample policies with diversity from this distribution. Below, we briefly review the PRL and GFlowNet. 2.1 Probabilistic Reinforcement Learning PRL aims to learn the maximum entropy optimal policy: (st e,at e )∼ρπ (cid:2)r (cid:0)st e, at e (cid:1) + αH (cid:0)π (cid:0)* | st e (cid:1)(cid:1)(cid:3) , π ∗ ent = arg maxπ ∑︁ E t e ∈ Se and at where st e ∈ Ae denotes the state and action respec- tively. The subscript e represents the "environment", which is used to distinguish related concepts in RL from GFlowNets, and the α is the coefficient to trade off between entropy and reward. Function H denotes the entropy term. By defining the soft Q function as: 1In this paper, only pairwise relationships between atomic actions are considered. Q∗ soft e, at (cid:0)st e (cid:1) := rt e + Est +l e ∼ρπ (cid:2)(cid:205)∞ l=1 γ l (cid:0)r t +l e + αH (cid:0)π ∗ ent (cid:0)* | st +l e (cid:1) (cid:1)(cid:1)(cid:3) . (1) Increasedtraffic flowLandformchangesShort CommuteLong CommutePlan APlan BPlan A The optimal maximum entropy policy can be proved as in [40] π ∗ ent = exp (cid:18) 1 α (cid:16) Q∗ soft e, at (cid:0)st e (cid:1) − V ∗ soft (cid:0)st e (cid:1) (cid:17)(cid:19) , where the soft value function V ∗ soft is defined by V ∗ soft (cid:0)st e (cid:1) = α log ∫ exp Ae (cid:18) 1 α Q∗ soft (cid:0)st e, a′ e (cid:1) (cid:19) da′ e . (2) (3) Thus the policy learning can be treated as the approximation to the Boltzmann-like distribution of optimal Q function. Taking the soft Q-Learning (SQL) [27] method as an example, it provides the optimal Q is the fixed point of soft Bellman backup, which satisfies the soft Bellman equation (cid:1) = rt (cid:104) V ∗ (cid:16) st +1 e e, at (cid:0)st e e + γEst +1 Q∗ (4) (cid:17)(cid:105) . e ∼pse soft soft Due to the infinite set of states and actions, it takes parameterized Q and uses a function π as an approximate sampler of Boltzmann-like distribution of Q. Specifically, it updates Q and π as: minθ JQ (θ ) := Est e,at e,r t e ,st +1 e ∼D (cid:20) 1 2 (cid:16) e + V ̄θ (cid:0)st +1 r t e (cid:1) − Qθ (cid:0)st e, at e (cid:1)(cid:17)2(cid:21) minφ Jπ (cid:0)φ; st e (cid:1) := KL (cid:16) πφ (cid:0)*|st e (cid:1) ∥ exp (cid:16) 1 α (cid:16) Qθ (cid:0)st e, *(cid:1) − V θ (st e ) (cid:17)(cid:17) (cid:17)    where function V θ is denoted as V θ (cid:0)st e (cid:1) := α log Ea′ e ∼qa′ e (cid:20) exp (cid:18) 1 α Qθ (cid:0)st e, a′ e (cid:1) (cid:19) /qa′ e (a′ e ) (cid:21) , , , (5) (6) and θ, ̄θ, φ denote the parameters of critic, target critic and policy respectively; qa′ is an arbitrary policy distribution. The policy dis- tribution induced by the EBM (i.e., the Boltzmann-like distribution of Q) under structured action spaces is highly multimodal, and sam- pling from such a high-dimensional distribution is intractable. In this paper, DPO introduces a powerful generative model, Generative Flow Networks (GFlowNet), as the efficient diverse policies sampler. 2.2 Generative Flow Networks Generative flow networks, which are trainable generative policies, model the generation or sampling process of composite objects x ∈ X by a sequence of discrete actions that incrementally modify a partially constructed object (state). Note that action and state here do not refer to the concepts in RL [99]. In this paper, we model actions in RL problems with structured action spaces as states in GFlowNet, and actions in GFlowNet correspond to the atomic actions that compose structured actions. In other words, the composite object x generated by the GFlowNet is ae , and X is equivalent to Ae . The partially constructed object and corresponding action sequence space can be represented by a directed acyclic graph (DAG, See the DAG consisting of traffic lights and roads in Figure 2) G = (Sg, Ag), where the subscript g denotes the "GFlowNet". The vertices in Sg are states and the edges in Ag are actions that modify one state to another. The tails of incoming edges and the heads of outgoing edges of a state are denoted as the parents and childrens, respectively. The sampling process of the composite object ae starts from the g and transits to the terminal state sn initial state s0 g ∈ Ae , which is a state without outgoing edges, after n ∈ (0,T ] steps and T is the maximum length. Note that the same terminal state may correspond to multiple action sequences. g g → s1 g → . . . → sn A complete trajectory is a state sequence from a initial state to a terimal state s0 g , where each transi- tion st g → st +1 is an action in Ag. A trajectory flow is a unnor- malized density or a non-negative function, F : T → R≥0, on the set of all complete trajectories T . The flow is called Markov- ian if there exist distributions PF (* | sg) over the children of every non-terminal state sg and a constant Z , such that for any complete trajectory τ we have PF (τ) = F (τ)/Z with PF (τ) = (cid:16) g | sn−1 sn PF is called a g forward policy, which is used to sample the composite object ae from the density F . PT (ae ) then denotes the probability that a complete trajectory sampled from PF terminates in ae . (cid:16) g | s0 s1 g (cid:16) g | s1 s2 g (cid:16) st +1 g . . . PF | st g . PF PF (cid:17) (cid:17) (cid:17) (cid:17) The problem we are interested in is fitting a Markovian flow to a fixed energy function on Ae . Given an energy function E (ae ) := − log R(ae ) and the associated non-negative reward function (again, not a reward in RL) Rg : Ae → R≥0, one seeks a Markovian flow F such that the likelihood of a complete trajectory sampled from F terminating in a given ae is proportional to Rg (ae ), i.e., PT (ae ) ∝ Rg (ae ). This F can be obtained by imposing the reward-matching constraint: Rg (ae ) = (cid:205) F (τ). The details of how (cid:16) g→...→sn s0 g to parameterize a GFlowNet and train a Markovian flow F that satisfies the reward matching constraint will be explained soon. g =ae τ= ,sn (cid:17) 3 DIVERSE POLICY OPTIMIZATION This section proposes a simple and effective RL method, Diverse Policy Optimization (DPO), to discover diverse policies in structured action spaces. We follow the probabilistic reinforcement learning (PRL) framework [40] to transform RL problems under stochas- tic dynamics into variational inference problems on probabilistic graphical models and model the policies of RL agents as EBMs. PRL framework corresponds to a maximum entropy variant of reinforce- ment learning or optimal control, where the optimal policy aims to maximize the expected reward and maintain high entropy. Due to the maximum entropy objective, some existing works [27, 28] have proposed algorithms for low-dimensional continuous action spaces to discover diverse policies based on this framework. Our method is an instance of the maximum entropy actor-critic algorithm in the PRL framework, which adopts a message-passing approach and can produce lower-variance estimates. In addition, to make the policy still scalable in the structured action space, we do not use an explicit policy parameterization but fit only the message, i.e., the Q-value function, similar to soft Q-learning [27]. Specifi- cally, we opt for using general energy-based policies π (ae | se ) ∝ exp (−E (se, ae )) , where E is an energy function. Furthermore, we set E (se, ae ) = − 1 α Qsoft (se, ae ), then the optimal maximum en- tropy policy is an EBM that satisfies Equation (2). However, The action distribution induced by this EBM in a struc- tured action space is highly multimodal, and sampling from such a high-dimensional distribution is intractable. Fortunately, the com- posability and local dependencies of the structured action space make generative flow networks naturally suitable for efficiently sampling diverse and high-quality policies from it. And we only need to set the energy function that needs to be fitted by the Markov- ian flow F (ae ) (where the action ae corresponding to the composite Figure 2: A GFlowNet iteratively constructs an composite object, e.g., a traffic light network. st represents the state of the partially constructed object, at represents the action taken by the GFLowNet to transition to state st +1 = T (st , at ). The GFlowNet take a 3-lights traffic network as input and determines an action to take. This process repeats until an exit action is sampled or maximum light number is achieved and the sample is complete. object x) to be (−1/α) *Qsoft (se, ae ), and its associated reward func- tion Rg (ae ) to be set to exp ((1/α) * Qsoft (se, ae )), we can elegantly introduce GFlowNet as an efficient and diverse sampler. Nevertheless, the unreasonable part of the above modeling is that there is no place left for the environment state se in the input of the Markovian flow and the reward function. The reason is that π in the PRL framework is a conditional distribution, but GFlowNet is an unconditional sampler. To this end, we will introduce a variant of GFlowNet, namely reward-conditional GFlowNet, to model the policy of RL agents, and details will be explained shortly. Since in the PRL framework, with the update of the Qsoft, the energy-based policy distribution is also constantly changing. DPO adopts a joint training framework where the EBM and the GFlowNet are optimized alternately, similar with [99]: The energy function serves as the negative log-reward function for the GFlowNet, which is trained with the trajectory balance [54] objective to sample from the evolving energy-based policies. In contrast, the energy function is trained with soft Bellman backup, where the GFlowNet provides diverse samples. The schematic diagram of RL based on reward- conditional GFlowNet as the agent's policy and the joint training framework are shown in Figure 3 and Algorithm 1. In the following, we will explain the generation process of struc- tured action, the parameterization and training of reward-conditional GFlowNet, and its interleaved update with EBM, respectively. 3.1 Structured Action Generative Process The framework of diverse policy optimization is introduced in the previous section, and this section will describe the process of generating structured actions based on the reward-conditional GFlowNet. The local dependencies of structured actions indicate that there may be two correlations between atomic actions: locally physical and locally logical correlations. The former is a typical graph, while the latter belongs to a typical set. For the unity of the framework, this paper only considers the physical correlation between atomic actions. It transforms the logical correlation into the physical correlation without loss of generality. Expressly, we assume that atomic actions with local logical cor- relations have a fixed influence range with a radius d in Euclidean space. An atomic action can then establish a physical correlation Figure 3: The schematic diagram of RL based on GFlowNet as the agent's policy and the joint training framework. with others within its influence range. Of course, other types of topologies, such as fully connected, star, hierarchical, etc., can also be used in addition to adjacency topologies. This paper adopts the adjacency topology to make a trade-off between efficiency and per- formance. The experimental results also show that the algorithm performance is not sensitive to the influence radius d. In the structured action space, the action consists of N atomic actions in K-dimensional discrete space, i.e., ae ∈ Ae ≜ [K]N , where [K] ≜ {0, . . . , K − 1}. ae could be a phase configuration of N traffic lights, and each traffic light contains K phases or the joint action of N predators, and each predator can go in K directions. We model the generation or sampling of vectors in Ae by a reward- conditional GFlowNet. The state space of GFlowNet is denoted as (cid:111) Sg, and we have Sg ≜ (cid:110)(cid:16) g, . . . , sN , s1 g where the void symbol ⊘ represents a yet unspecified atomic action. The DAG structure on Sg is the N -th Cartesian power of the DAG with states [K] ∪ ⊘, where [K] are children of ⊘. Concretely, the g ∈ [K] ∪ ⊘, n = 1, . . . , N | sn (cid:17) Light 1 Phase 2Light 2 Phase 4Light 3 Phase 2GFlowNet draw = "Add a new light connected to Light 2, and set light phase to Phase 3"Light 1 Phase 2Light 2 Phase 4Light 3 Phase 2 determines Light 4 Phase 3GFlowNet draw = "..."...Agent: Incrementally modify a partially constructed environment action with atomic actionsEnvironmentStructured action State Reward Conditional GFlowNet Energy-based Model Training with trajectorcy-balance loss Diverse SamplingTraining with soft Bellman backupExecutionTraining (cid:17) (cid:16) g, . . . , sN children of a state sg = s1 are vectors that can be obtained g from sg by changing any one atomic action sn g from ⊘ to [K], and its parents are states that can be obtained by changing a single atomic action sn g ∈ [K] to ⊘. (cid:111) Moreover, Ae is naturally identified with {sg ∈ Sg : |sg | = D } g ∈ [K], n = 1, . . . , N (cid:110) g | sn sn where |sg | ≜ # . Similarly, the initial g ≜ (⊘, ⊘, . . . , ⊘), which means that the reward- state is denoted as s0 conditional GFlowNet-based RL policy needs to take N steps to sample a structured action, i.e., constructing a trajectory from s0 g to ae ∈ Ae . The forward policy PF |e (*|sg, se ) of a reward-conditional GFlowNet (will explained soon), extends from §2.2, is a distribution over all paths to select a position with a void atomic action in sg and a value k ∈ [K] to assign to this atomic action based on the environmental state se ∈ Se . Thus the action space for a state sg has size K (N − |sg |). Since k ≪ N , the action space of the forward policy (same as the backward policy below) grows linearly with the atomic actions increase, so DPO has a good scalability. Corre- spondingly, the backward policy PB |e (*|sg, se ) is a distribution over the |sg | paths to select a position with a nonvoid atomic action in sg. More efficient generation. As we mentioned earlier, as an amor- tized version of MCMC, GFlowNets can alleviate the mix-moding problem [34, 69] of the MCMC method, thereby improving the sam- pling efficiency of diverse samples. However, if the two modes are close enough, the MCMC method will have higher sampling effi- ciency because it only perturbs the previous sample slightly. How- ever, GFlowNets, for this case, need to rebuild the entire structured action sequentially, although only a minimal number of atomic ac- tions have changed. To this end, we introduce a small trick: adding a termination action in the action space. GFlowNets are trained to successfully sample from two close modes by deciding to terminate at different modes at different runs. Since the physical meaning of the termination action is quite different from other actions, we use a different output head to predict it separately, as shown in Figure 4. Once the forward policy PF |e (*|sg, se ) decides to take the termination action, the output of the other head will be ignored. Experiments show that this small trick can significantly improve the learning efficiency of the algorithm in some tasks. 3.2 GFlowNet Parameterization After showing how to sample structured actions using the GFlowNet, this section elaborates on how to parameterize it and train a Mar- kovian flow F that satisfies the reward matching constraint. As stated earlier, if we take the form of the GFlowNet in §2.2, there will be no place for the environment state se in the forward policy PF as well as in the backward policy PB. Thus, we use an extended version of flow networks by conditioning each component on some information, which is external to the flow network but influences the terminating flows. In our setting, the external information is RL's environmental state se . Since the external information se af- fects the reward function Rg in §2.2, this conditional GFlowNet is also called reward-conditional GFlowNet [5, Definition 29]. Since reward-conditional GFlowNets are defined using the same components as the unconditional one, they inherit from all the properties of the GFlowNet for all DAGs Ge = (Sg, Ag, Se ) and flow functions Fe : T × Se → R≥0, where e represents the "en- vironment" in RL again. In particular, we can directly extend no- tions of §2.2 to reward-conditional GFlowNets with forward pol- icy PF |e (*|sg, se ), backward policy PB |e (*|sg, se ), energy function E (ae |e) := − log R (g|e)(ae |se ) and the associated non-negative re- ward function Rg |e : Ae × Se → R≥0; The only difference is that now every term explicitly depends of the conditioning variable, environmental state se ∈ Se under the RL context. In our experiments, we parameterize the forward and backward policy with deep neural networks PF |e (θF ) and PB |e (θB) respec- tively, and for convenience, we omit the input without introducing ambiguity. As PF incrementally builds structured actions, its ac- tion space gradually decreases, similar to the traveling salesman problem (TSP) [64]. Considering the effectiveness of the pointer net- work [84] in dealing with such problems, we introduce the modified graph pointer network (GPN, [49]) as the forward and backward policy (see Figure 2) to further model the structured information of the action space. The forward process of the modified GPN can be divided into the following three stages: Environmental state encoding: In this stage, the i-th row of the adjency matrix li and local observed information oi of each atomic action are concatenated as si |e = [li ∥oi ], and then si |e is embedded into a higher dimensional vector ̃si |e ∈ Rd by a shared feed-forward network, where d is the hidden dimension. The context information is then obtained by encoding all atomic actions' embeddings se via a graph neural network (GNN, [37, 92]), where se = [ ̃s⊤ N |e ]⊤. 1|e Each layer of the GNN is expressed as: , . . . , ̃s⊤ (cid:19) (cid:18) , (cid:111) (7) (cid:110) sl−1 j |e j ∈N (i)∪{i } sl i |e = γsl−1 i |e Θ + (1 − γ)φθ 1 |N (i)| i |e ∈ Rdl is the l-th layer variable with l ∈ {1, . . . , L}, where sl i |e = si |e , γ is a trainable parameter, Θ ∈ Rdl −1×dl is a trainable s0 weight matrix, N (i) is the adjacency set of atomic action i, and φθ : Rdl −1 → Rdl is the aggregation function [37], which is represented by a neural network in our experiments. GFlowNet state encoding: In this stage, we use the vectors point- ing from the newly added atomic action to all others as the embed- ding of sg, which is similar with Ma et al. [49]. Specifically, for the newly added atomic action ̃si |e , suppose sE|i = RN ×d is a matrix with identical rows ̃s1|e . We define sg = sL (cid:104) s⊤ i |g , . . . , ̃s⊤ ∈ i |e i |e −sE|i = ∈ RN ×d . Then sg is passed into the GNN again and the embedding of each atomic action after GFlowNet state encoding is denoted as sL Atomic action selection: The atomic action selector is based on the Linear Transformer [35], which has the advantage of not suffer- ing from the quadratic scaling in the input size. This architecture relies on a linearized attention mechanism, defined as g WQ K = sL Q = sL (cid:104) ̃s⊤ i |e , . . . , s⊤ i |g. N |g (cid:105) ⊤ (cid:105) ⊤ g WV , g WK V = sL (cid:0)ψ (Qk )⊤ ψ (cid:0)Kj (cid:1)(cid:1) Vj ψ (Qk )⊤ ψ (cid:0)Kj (cid:1) (cid:205)N j=1 (cid:205)N (8) , j=1 where ψ (*) is a non-linear feature map, and Q, K, and V are lin- ear transformations of sL g corresponding to the queries, keys, and LinAttnk (sL g ) = Figure 4: The parameterized forward and backward policy based on the modified graph pointer network. values respectively, as is standard with Transformers. The pointer vector outputted by the Linear Transformer is first masked by the mask m associated with the physical dependencies in structured action space and is then passed to a softmax layer to generate a distribution over the next candidate intersections. Similar to pointer networks [84], the masked pointer vector ui is defined as: ( j) u i = (cid:40) if j ≠ σ (k), ∀k < j, ( j) u i −∞ otherwise, (9) ( j) where σ (k) denotes k-th processed atomic action and u i j-th entry of the vector ui . is the 3.3 Reward-Conditional GFlowNet Training After parameterizing the GFlowNet, we now describe how reward- conditional GFlowNets could be trained toward matching a given conditional reward. Recall from §2.2, §3 and §3.1, given a non- negtive conditional reward function Rg |e : Ae × Se → R≥0, a reward-conditional GFlowNet can be trained so that its terminating probability distribution matches the associated energy-based model. To be precise, the marginal likelihood that a trajectory sampled from the forward policy PF |e (*|sg, se ) terminates at a given struc- tured action is propotional to the action's soft Q value PT (ae |se ) ∝ exp ((1/α) * Qsoft (se, ae )), where ae ∈ Ae and se ∈ Se . To train the parameters θF and θB of the reward-conditional GFlowNet, we use the trajectory balance objective [54] that opti- mizes the following objective along complete trajectories τ = (s0 g → g → . . . → . . . → sn s1 g ): (cid:17) 2 (cid:16) st +1 g , (cid:17) R PF PB (10)        , se ; θB (cid:16) sn g |se |st g, se ; θF (cid:16) g |st +1g st LΘ (τ |se ) =    log     Z (se ; θZ ) (cid:206)n−1 t =0 (cid:17) (cid:206)n−1 t =0 where Θ ≜ {θF , θB, θZ }. The scalar function Z (*) is parametrized in the log domain, as suggested by Malkin et al. [54]. With the trajec- tory balance objective, we train the reward-conditional GFlowNet with stochastic gradient Eτ∼πΘ (τ |se ) [∇ΘLΘ (τ |se )] with some train- ing trajectory distribution πΘ (τ). Akin to RL settings, we take πΘ to be the distribution over trajectories sampled from a tempered version of current forward policy PF |e (*|sg, se ). That is, τ is sampled with st +1 g, se ) starting from s0 e , mixed with a uniform action policy to ensure πΘ has full support. g ∼ PF |e (*|st Learning about total flow Z . Experiments show that learning the scalar function Z (*) end-to-end is very difficult. Since Z represents the total flow in the entire flow network, many samples are required for an accurate estimation. Unlike the original work of trajectory balance [54], in our setting, the scalar function Z needs to condi- tion on the external environmental state se thus has higher sample complexity. Interestingly, since the target EBM of GFlowNets is derived from the PRL framework in our method, Z has an addi- tional physical meaning, i.e., the soft value function V ∗ (*) in §2.1. soft Since the soft value function is dependent on the soft Q value, Z can be updated by a mechanism similar to the bootstrap learning adopted by RL, thereby improving the sample efficiency. To this end, in addition to end-to-end training of Z using Equation (10), we estimate V ∗ (*) in the same way as in Haarnoja et al. [27] and soft fit Z to it. The experimental results show that this form of mixed gradient update can improve the learning efficiency of Z. 3.4 Joint Training with EBM Reward-conditional GFlowNets' training relies on a given func- tion Rg |e (ae |sg, se ) to provide reward signals. However, in the PRL framework, the energy-based policy distribution is also constantly changing with the update of the soft Q function. Therefore, we propose a joint training framework (Algorithm 1), where the EBM and the reward-conditional GFlowNet are optimized alternately: (1) GFlowNet updating step: the soft Q function serves as the reward function for the GFlowNet, which is trained with the trajectory balance objective to sample from the evolving EBM; the EBM is trained with soft Q itera- tion [27, §3.1] where the GFlowNet provides diverse samples. Moreover, again inspired by soft Q-learning [27], we find it advan- tageous to evaluate the forward policy, backward policy and total flow function in (10) with a separate target network, where the parameters ̄θF , ̄θB and ̄θZ are updated softly [44]. (2) EBM updating step: 4 EXPERIMENTS In this section, we will empirically validate DPO on two RL prob- lems with structured action space, which include ATSC tasks [2] where atomic actions have physical local dependencies; and more generally, Battle scenarios [102] where atomic actions have logical local dependencies (see Appendix for more environment details). It is worth noting that we did not use the population diversity (PD) proposed by Parker-Holder et al. [65] or the modified PD proposed by Zhou et al. [103] as one of the evaluation metrics. In our ex- periments, we find that due to the high dimensionality and local dependencies of structured actions, PD, a locality indicator, cannot well reflect the diversity of policies. Therefore, we evaluate different global metrics for different tasks to verify the diversity. 1234MLPCoordFeatureEmbedding12341234...GNN x L12341234...GNN x L=-Linear Transformer MaskSoftmax1234PoolSigmoid1234TerminateStateTopologyLinear Transformer Algorithm 1 Joint Training Framework of DPO 1: {θQ, θF , θB, θZ } ∼ some initialization distributions, assign tar- get parameters { ̄θQ, ̄θF , ̄θB, ̄θZ }, D ← empty replay buffer; 4: 2: for each epoch until some convergence conditions do for each timestep t until the maximum limitation do 3: e ; θF ); e, rt e, st +1 e i=0 ∼ D. Sample an structured action at Save the new experience: D ← D ∪ (cid:8)(cid:0)st Sample a minibatch: {(s (i) EBM updating step: e via PF |e (*|*, st e, at (i) )}N e , a (i) e , r (i) e , s ′ e 5: 6: (cid:1) (cid:9); Update θQ according to computed empirical gradient in (5) and empirical soft values in (6); GFlowNet updating step: Update {θF , θB, θZ } with computed empirical gradient of (10), update θZ with MSE loss with computed empirical soft values additionally; Update target parameters similar with Lillicrap et al. [44]. 7: 8: 9: 10: 11: 4.1 Adaptive Signal Traffic Control We choose the following algorithms as baselines, mainly including the state-of-the-art methods for the ASTC task and for encouraging policy diversity: Max-Pressure control (MP) where the phase com- bination with the maximal joint pressure is enabled as described in [9]; MPLight-implementation is based on the FRAP open source implementation [101] along with the ChainerRL [22] DQN imple- mentation and pressure sensing; DvD [65] is a population-based RL method for effective diversity; SQL [27] method is the skeleton of the proposed DPO, which can obtain diverse policies in the low- dimensional continuous action space; Recent proposed RSPO [103] transforms the problem of seeking diversity policies into a con- strained Markov decision process. Table 1: Performance (↓) on the ATSC benchmark. MP Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue SQL Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue MPLight Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue Ing. Reg. Col. Reg. DvD 22.06 59.64 86.02 197.23 5.46 20.19 0.8 0.38 Ing. Reg. Col. Reg. RSPO 58.32 67.65 116.29 205.44 30.01 26.45 1.15 2.06 Ing. Reg. Col. Reg. DPO 60.42 78.16 123.93 215.72 30.34 34.57 2.33 1.48 Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue 55.91 115.54 28.35 2.28 Ing. Reg. Col. Reg. 73.22 212.81 31.36 1.42 Ing. Reg. Col. Reg. 90.42 226.5 44.16 1.74 Ing. Reg. Col. Reg. 57.2 192.75 18.26 0.65 57.28 120.53 28.19 2.59 20.28 81.42 4.77 0.32 Figure 5: Learning curves of decay (↓) on the ATSC. From the experimental results in Table 1 and Figure 5, it can be seen that DPO achieves state-of-the-art (SOTA) performance and convergence speed on two coordinated control tasks in TAPAS Cologne and InTAS scenarios. It is worth noting that classical MP methods based on heuristic rules and expert knowledge also show good results. DPO can outperform the MP method through a rein- forcement learning mechanism, showing its superiority in solving the ATSC problem. While among the three algorithms that encour- age policy diversity, the DvD performs the worst, which we believe is due to the limitations of how it computes the distance between two policies on complex problems. The other two algorithms, SQL and RSPO, can show near-SOTA performance on small-scale prob- lems, i.e., the TAPAS Cologne scenario where a structured action consists of 8 atomic actions. However, in the larger-scale InTAS scenario, its performance drops sharply, which shows that existing algorithms that encourage policy diversity have certain limitations when dealing with structured action spaces. Figure 6: Comparison of policy diversity between DPO and RSPO under the ATSC benchmark. Different colors repre- sent different commute times. Figure 6 shows the comparison of the policy diversity between RSPO and DPO (see the appendix for more results). We ignore the atomic action level, that is, the diversity of each traffic light's phase selection strategy, but the diversity of the entire road network's traf- fic control strategy. To this end, we calculate the average commute time of the main road under multiple random seeds for different algorithms in different scenarios. Furthermore, for visualization convenience, we normalized each algorithm separately. Red indi- cates longer commute time; otherwise, it is shown in blue. As seen from the figure, DPO learns policies with sufficient diversity in structured action spaces of different scales, but RSPO only shows some effect in small-scale tasks. 024681012Episodes (x100)5075100125150175200225Delay (s)Ingolstadt RegionMPSQLMPLightDvDRSPODPO024681012Episodes (x100)255075100125150175Delay (s)Cologne RegionMPSQLMPLightDvDRSPODPOI-RSPODPORSPOCologneRSPODPOIngolstadt 4.2 Battle Scenario In the Battle scenario, the atomic action is each agent's action, and we transform the logical correlation between each agent into the physical correlation without loss of generality. Expressly, we assume that atomic actions with local logical correlations have a fixed influence range with a radius d = 4 in Euclidean space. In this benchmark, we additionally select IDQN, the built-in algorithm in the MAgent, and MFQ [93], the state-of-the-art algorithm on the Battle as baselines. Figure 7: Boxplot of average kill number (↑) and average agent reward (↑) of 50 runs on Battle Game. Results compares the average agent number of blue army killed by red army (left part of each figure) and the average individual rewards of each agent (right part of each figure) respectively. We first train the IDQN in a self-play way and the blue agent loads the checkpoint and fixes the model parameters. The red agent is then trained with different algorithms, and the final result is shown in Figure 7. It is worth noting that DvD, SQL, and RSPO are less scalable. So in the Battle scenario, we combine independent learning to obtain I-DvD, I-SQL, and I-RSPO variants. Independent learning does not constrain the algorithm's performance, while the IDQN algorithm also shows promising results. As seen from the figure, the three algorithms that encourage policy diversity do not show good results in large-scale structured action spaces, while DPO can still stably approach the performance of SOTA. Figure 8 shows the diversity of policies between I-RSPO and DPO in the early and middle stages of the game (see appendix for more results). As seen from the figure, the policies learned by DPO show a variety of deployment strategies in the early stage; in the middle stage, the enemy can be surrounded by different formations to maximize the attack power. Although I-RSPO based on independent learning shows a specific diversity at the individual level, it is not easy to generate different policies as a whole. Diverse policies are more difficult to be exploited by opponents in competitive scenarios and can better adapt to changes in opponents' policies. In order to verify the above point, we let the red agents trained based on different algorithms compete against each other and count the average winning rate. The results are shown in Figure 9. As seen from the figure, DPO shows good robustness against different opponents. 5 CLOSING REMARKS In this paper, we aim to seek diverse policies in an under-explored setting, namely RL tasks with structured action spaces with the com- posability and local dependencies. The complex action structure, non-uniform reward landscape, and subtle hyperparameter tun- ing due to the structured actions prevent existing methods from Figure 8: Comparison of policy diversity between DPO and RSPO under the early and middle stages of the Battle. Figure 9: The heatmap of the (Left) win ratio (↑) and (Right) average steps to win (↓) among DPO and others of the testing phase of the Battle benchmark. scaling well. We propose a simple and effective method, Diverse Policy Optimization (DPO), to model the policies in structured action space as the energy-based models by following the probabilistic RL framework. DPO adopts a joint training framework, where the energy-based model, and the generative flow network, which is introduced as the efficient, diverse EBM-based policy sampler, are optimized alternately: The energy function serves as the negative log-reward function for the GFlowNet, which is trained with the trajectory balance objective to sample from the evolving energy- based policies. In contrast, the energy function is trained with soft Bellman backup, where the GFlowNet provides diverse samples. Experiments demonstrate that the proposed DPO is both general and practical across structured action spaces with physical and, more generally, logical local dependencies. Algorithms51015202530Kill_NumAlgorithms0.020.010.000.010.020.030.040.050.06Avg_RewardAlgorithms I-RSPOI-DvD I-SQLI-RSPOI-SQL I-DvDI-SQLI-DvDI-RSPOI-SQLI-DvDI-RSPOMFQAlgorithms61.461.661.862.062.262.462.6Kill_NumAlgorithmsDQNMFQMFQAlgorithms0.080.100.120.140.160.180.20Avg_RewardAlgorithmsDPODPODQN MFQ DPODPOI-DQNI-DQNI-RSPODPOEarly StageI-RSPODPOMid StageIDQNMFQI-DvDI-SQLI-RSPODPOIDQNMFQI-DvDI-SQLI-RSPODPO0.520.360.670.590.620.180.610.490.710.660.640.230.330.310.540.360.380.060.360.330.640.480.460.160.380.330.670.530.510.150.850.810.950.880.890.520.10.20.30.40.50.60.70.80.9win rateIDQNMFQI-DvDI-SQLI-RSPODPOIDQNMFQI-DvDI-SQLI-RSPODPO1531921271561251871261381151181181522532392032592463232482331962312373182302592082252413398889717471119100150200250300average steps to win ACKNOWLEDGMENTS This work was supported in part by Postdoctoral Science Foun- dation of China (2022M723039), NSFC (62106213, 72150002), SSTP (RCBS20210609104356063, JCYJ20210324120011032), and a grant from Shenzhen Institute of Artificial Intelligence and Robotics for Society. REFERENCES [1] Alver, S. and Precup, D. (2022). Constructing a good behavior basis for transfer using generalized policy updates. In ICLR. [2] Ault, J. and Sharon, G. (2021). Reinforcement learning benchmarks for traffic signal control. In NeurIPS. [3] Behrisch, M., Bieker, L., Erdmann, J. and Krajzewicz, D. simulation of urban mobility: an overview. In SIMUL 2011. (2011). Sumo– [4] Bengio, E., Jain, M., Korablyov, M., Precup, D. and Bengio, Y. (2021). Flow net- work based generative models for non-iterative diverse candidate generation. In NeurIPS. [5] Bengio, Y., Deleu, T., Hu, E. J., Lahlou, S., Tiwari, M. and Bengio, E. (2021). Gflownet foundations. arXiv preprint arXiv:2111.09266. [6] Berner, C., Brockman, G., Chan, B., Cheung, V., Dębiak, P., Dennison, C., Farhi, D., Fischer, Q., Hashme, S., Hesse, C. et al. (2019). Dota 2 with large scale deep reinforcement learning. arXiv preprint arXiv:1912.06680. [7] Bester, C. J., James, S. D. and Konidaris, G. D. (2019). Multi-pass q-networks for deep reinforcement learning with parameterised action spaces. arXiv preprint arXiv:1905.04388. [8] Chandak, Y., Theocharous, G., Kostas, J., Jordan, S. and Thomas, P. (2019). Learning action representations for reinforcement learning. In ICML. [9] Chen, C., Wei, H., Xu, N., Zheng, G., Yang, M., Xiong, Y., Xu, K. and Li, Z. (2020). Toward a thousand lights: Decentralized deep reinforcement learning for large- scale traffic signal control. In AAAI. [10] Chen, H., Dai, X., Cai, H., Zhang, W., Wang, X., Tang, R., Zhang, Y. and Yu, Y. (2019). Large-scale interactive recommendation with tree-structured policy gradient. In AAAI. [11] Conti, E., Madhavan, V., Petroski Such, F., Lehman, J., Stanley, K. and Clune, J. (2018). Improving exploration in evolution strategies for deep reinforcement learning via a population of novelty-seeking agents. In NeurIPS. [12] Cully, A., Clune, J., Tarapore, D. and Mouret, J.-B. (2015). Robots that can adapt like animals. Nature, 521 503–507. [13] Delalleau, O., Peter, M., Alonso, E. and Logut, A. (2019). Discrete and contin- uous action representation for practical rl in video games. arXiv preprint arXiv:1912.11077. [14] Delarue, A., Anderson, R. and Tjandraatmadja, C. (2020). Reinforcement learn- ing with combinatorial actions: An application to vehicle routing. In NeurIPS. [15] Derek, K. and Isola, P. (2021). Adaptable agent populations via a generative model of policies. In NeurIPS. [16] Duarte, M., Gomes, J., Oliveira, S. M. and Christensen, A. L. (2017). Evolution of repertoire-based control for robots with complex locomotor systems. IEEE Transactions on Evolutionary Computation, 22 314–328. [17] Dulac-Arnold, G., Evans, R., van Hasselt, H., Sunehag, P., Lillicrap, T., Hunt, J., Mann, T., Weber, T., Degris, T. and Coppin, B. (2015). Deep reinforcement learn- ing in large discrete action spaces. arXiv preprint arXiv:1512.07679. [18] Eysenbach, B., Gupta, A., Ibarz, J. and Levine, S. (2019). Diversity is all you need: Learning skills without a reward function. In ICLR. [19] Fan, Z., Su, R., Zhang, W. and Yu, Y. (2019). Hybrid actor-critic reinforcement learning in parameterized action space. In IJCAI. [20] Farquhar, G., Gustafson, L., Lin, Z., Whiteson, S., Usunier, N. and Synnaeve, G. (2020). Growing action spaces. In ICML. [21] Fu, H., Tang, H., Hao, J., Lei, Z., Chen, Y. and Fan, C. (2019). Deep multi-agent reinforcement learning with discrete-continuous hybrid action spaces. In IJCAI. [22] Fujita, Y., Nagarajan, P., Kataoka, T. and Ishikawa, T. (2021). Chainerrl: A deep reinforcement learning library. The Journal of Machine Learning Research, 22 3557–3570. [23] Gangwani, T., Liu, Q. and Peng, J. (2019). Learning self-imitating diverse policies. In ICLR. [24] Gangwani, T., Peng, J. and Zhou, Y. (2021). Harnessing distribution ratio esti- mators for learning agents with quality and diversity. In CoRL. [25] Goyal, A., Sodhani, S., Binas, J., Peng, X. B., Levine, S. and Bengio, Y. (2020). Re- inforcement learning with competitive ensembles of information-constrained primitives. In ICLR. [26] Gregor, K., Rezende, D. J. and Wierstra, D. (2016). Variational intrinsic control. arXiv preprint arXiv:1611.07507. [27] Haarnoja, T., Tang, H., Abbeel, P. and Levine, S. (2017). Reinforcement learning with deep energy-based policies. In ICML. [28] Haarnoja, T., Zhou, A., Abbeel, P. and Levine, S. (2018). Soft actor-critic: Off- policy maximum entropy deep reinforcement learning with a stochastic actor. In ICML. [29] Hartikainen, K., Geng, X., Haarnoja, T. and Levine, S. (2020). Dynamical dis- tance learning for semi-supervised and unsupervised skill discovery. In ICLR. [30] Hausknecht, M. and Stone, P. (2015). Deep reinforcement learning in parame- terized action space. arXiv preprint arXiv:1511.04143. [31] He, J., Chen, J., He, X., Gao, J., Li, L., Deng, L. and Ostendorf, M. (2015). Deep reinforcement learning with a natural language action space. arXiv preprint arXiv:1511.04636. [32] Hong, Z.-W., Shann, T.-Y., Su, S.-Y., Chang, Y.-H., Fu, T.-J. and Lee, C.-Y. (2018). Diversity-driven exploration strategy for deep reinforcement learning. In NeurIPS. [33] Jain, M., Bengio, E., Hernandez-Garcia, A., Rector-Brooks, J., Dossou, B. F., Ekbote, C. A., Fu, J., Zhang, T., Kilgour, M., Zhang, D. et al. (2022). Biological sequence design with gflownets. In ICML. [34] Jasra, A., Holmes, C. C. and Stephens, D. A. (2005). Markov chain monte carlo methods and the label switching problem in bayesian mixture modeling. Statis- tical Science, 20 50–67. [35] Katharopoulos, A., Vyas, A., Pappas, N. and Fleuret, F. (2020). Transformers are rnns: Fast autoregressive transformers with linear attention. In ICML. [36] Khadka, S., Majumdar, S., Nassar, T., Dwiel, Z., Tumer, E., Miret, S., Liu, Y. and Tumer, K. (2019). Collaborative evolutionary reinforcement learning. In ICML. [37] Kipf, T. N. and Welling, M. (2016). Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907. [38] Kumar, S., Kumar, A., Levine, S. and Finn, C. (2020). One solution is not all you need: Few-shot extrapolation via structured maxent rl. In NeurIPS. [39] Lehman, J. and Stanley, K. O. (2011). Evolving a diversity of virtual creatures through novelty search and local competition. In GECCO. [40] Levine, S. (2018). Reinforcement learning and control as probabilistic inference: Tutorial and review. ArXiv, abs/1805.00909. [41] Li, J., Monroe, W., Ritter, A., Jurafsky, D., Galley, M. and Gao, J. (2016). Deep reinforcement learning for dialogue generation. In EMNLP. [42] Li, W., Wang, X., Jin, B., Luo, D. and Zha, H. (2021). Structured cooperative rein- forcement learning with time-varying composite action space. IEEE Transactions on Pattern Analysis and Machine Intelligence. [43] Li, Y., Song, J. and Ermon, S. (2017). Infogail: Interpretable imitation learning from visual demonstrations. In NeurIPS. [44] Lillicrap, T. P., Hunt, J. J., Pritzel, A., Heess, N., Erez, T., Tassa, Y., Silver, D. and Wierstra, D. (2015). Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971. [45] Lim, B., Grillotti, L., Bernasconi, L. and Cully, A. (2022). Dynamics-aware quality-diversity for efficient learning of skill repertoires. In ICRA. [46] Liu, S., Lever, G., Merel, J., Tunyasuvunakool, S., Heess, N. and Graepel, T. (2019). Emergent coordination through competition. In ICLR. [47] Lobo, S. C., Neumeier, S., Fernandez, E. M. and Facchi, C. (2020). Intas–the in- golstadt traffic scenario for sumo. arXiv preprint arXiv:2011.11995. [48] Lupu, A.-S., Hu, H. and Foerster, J. N. (2021). Trajectory diversity for zero-shot coordination. In AAMAS. [49] Ma, Q., Ge, S., He, D., Thaker, D. and Drori, I. (2019). Combinatorial optimiza- tion by graph pointer networks and hierarchical reinforcement learning. arXiv preprint arXiv:1911.04936. [50] Ma, T. (2021). Why do local methods solve nonconvex problems? Beyond the Worst-Case Analysis of Algorithms 465. [51] Mahajan, A., Samvelyan, M., Mao, L., Makoviychuk, V., Garg, A., Kossaifi, J., Whiteson, S., Zhu, Y. and Anandkumar, A. (2021). Reinforcement learning in fac- tored action spaces using tensor decompositions. arXiv preprint arXiv:2110.14538. [52] Mahajan, A., Samvelyan, M., Mao, L., Makoviychuk, V., Garg, A., Kossaifi, J., Whiteson, S., Zhu, Y. and Anandkumar, A. (2021). Tesseract: Tensorised actors for multi-agent reinforcement learning. In ICML. [53] Majumdar, S., Khadka, S., Miret, S., McAleer, S. and Tumer, K. (2020). Evolu- tionary reinforcement learning for sample-efficient multiagent coordination. In ICML. [54] Malkin, N., Jain, M., Bengio, E., Sun, C. and Bengio, Y. (2022). Trajectory bal- ance: Improved credit assignment in gflownets. arXiv preprint arXiv:2201.13259. [55] Masood, M. A. and Doshi-Velez, F. (2019). Diversity-inducing policy gradient: Using maximum mean discrepancy to find a set of diverse policies. arXiv preprint arXiv:1906.00088. [56] Masson, W., Ranchod, P. and Konidaris, G. (2016). Reinforcement learning with parameterized actions. In AAAI. [57] Merel, J., Hasenclever, L., Galashov, A., Ahuja, A., Pham, V., Wayne, G., Teh, Y. W. and Heess, N. (2019). Neural probabilistic motor primitives for humanoid control. In ICLR. [58] Metz, L., Ibarz, J., Jaitly, N. and Davidson, J. (2017). Discrete sequential predic- tion of continuous actions for deep rl. arXiv preprint arXiv:1705.05035. [59] Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A. A., Veness, J., Bellemare, M. G., Graves, A., Riedmiller, M., Fidjeland, A. K., Ostrovski, G. et al. (2015). Human- level control through deep reinforcement learning. nature, 518 529–533. [60] Mouret, J.-B. and Clune, J. (2015). Illuminating search spaces by mapping elites. arXiv preprint arXiv:1504.04909. [61] Nieves, N. P., Yang, Y., Slumbers, O., Mguni, D. H. and Wang, J. (2021). Mod- elling behavioural diversity for learning in open-ended games. In ICML. [62] Nilsson, O. and Cully, A. (2021). Policy gradient assisted map-elites. In GECCO. [63] Osborn, A. F. (1953). Applied imagination. Scribner's. [64] Papadimitriou, C. H. (1977). The euclidean travelling salesman problem is np- complete. Theoretical computer science, 4 237–244. [65] Parker-Holder, J., Pacchiano, A., Choromanski, K. M. and Roberts, S. J. (2020). Effective diversity in population based reinforcement learning. In NeurIPS. [66] Peng, Z., Sun, H. and Zhou, B. (2020). Non-local policy optimization via diversity-regularized collaborative exploration. arXiv preprint arXiv:2006.07781. [67] Pereira, T., Abbasi, M., Ribeiro, B. and Arrais, J. P. (2021). Diversity oriented deep reinforcement learning for targeted molecule generation. Journal of Chem- informatics, 13. [68] PIERROT, T., Macé, V., Sevestre, J.-B., Monier, L., Laterre, A., Perrin, N., Beguir, K. and Sigaud, O. (2021). Factored action spaces in deep reinforcement learning. https://openreview.net/forum?id=naSAkn2Xo46 [69] Pompe, E., Holmes, C. and Łatuszyński, K. (2020). A framework for adaptive mcmc targeting multimodal distributions. The Annals of Statistics, 48 2930–2952. [70] Pugh, J. K., Soros, L. B. and Stanley, K. O. (2016). Quality diversity: A new fron- tier for evolutionary computation. Frontiers in Robotics and AI 40. [71] Schulman, J., Wolski, F., Dhariwal, P., Radford, A. and Klimov, O. (2017). Proxi- mal policy optimization algorithms. arXiv preprint arXiv:1707.06347. [72] Sharma, A., Ahn, M., Levine, S., Kumar, V., Hausman, K. and Gu, S. (2020). Emergent real-world robotic skills via unsupervised off-policy reinforcement learning. arXiv preprint arXiv:2004.12974. [73] Sharma, A., Gu, S., Levine, S., Kumar, V. and Hausman, K. (2020). Dynamics- aware unsupervised discovery of skills. In ICLR. [74] Sharma, M., Sharma, A., Rhinehart, N. and Kitani, K. M. (2019). Directed-info gail: Learning hierarchical policies from unsegmented demonstrations using directed information. In ICLR. [75] Sun, H., Peng, Z., Dai, B., Guo, J., Lin, D. and Zhou, B. (2020). Novel policy seeking with constrained optimization. arXiv preprint arXiv:2005.10696. [76] Sutton, R. S. and Barto, A. G. (2018). Reinforcement learning: An introduction. MIT press. [77] Tang, Z., Yu, C., Chen, B., Xu, H., Wang, X., Fang, F., Du, S. S., Wang, Y. and Wu, Y. (2021). Discovering diverse multi-agent strategic behavior via reward randomization. In ICLR. [78] Tavakoli, A., Pardo, F. and Kormushev, P. (2018). Action branching architectures for deep reinforcement learning. In AAAI. [79] Tennenholtz, G. and Mannor, S. (2019). The natural language of actions. In ICML. [80] Terry, J., Black, B., Grammel, N., Jayakumar, M., Hari, A., Santos, L. S., Dieffendahl, C., Horsch, C., Perez-Vicente, R. et al. Pettingzoo: Gym for multi-agent reinforcement learning. In NeurIPS. Sullivan, R., (2021). [81] Van der Pol, E. and Oliehoek, F. A. (2016). Coordinated deep reinforcement learners for traffic light control. Proceedings of learning, inference and control of multi-agent systems (at NIPS 2016), 1. [82] Varschen, C. and Wagner, P. (2006). Mikroskopische modellierung der person- enverkehrsnachfrage auf basis von zeitverwendungstagebüchern. Integrierte Mikro-Simulation von Raum-und Verkehrsentwicklung. Theorie, Konzepte, Modelle, Praxis, 81 63–69. [83] Vinyals, O., Babuschkin, I., Czarnecki, W. M., Mathieu, M., Dudzik, A., Chung, J., Choi, D. H., Powell, R., Ewalds, T., Georgiev, P. et al. (2019). Grand- master level in starcraft ii using multi-agent reinforcement learning. Nature, 575 350–354. [84] Vinyals, O., Fortunato, M. and Jaitly, N. (2015). Pointer networks. In NeurIPS. [85] Wang, H. and Yu, Y. (2016). Exploring multi-action relationship in reinforcement learning. In PRICAI. [86] Wang, R., Lehman, J., Clune, J. and Stanley, K. O. (2019). Poet: open-ended co- evolution of environments and their optimized solutions. GECCO. [87] Wang, Z., Merel, J. S., Reed, S. E., de Freitas, N., Wayne, G. and Heess, N. (2017). Robust imitation of diverse behaviors. In NeurIPS. [88] Wei, E., Wicke, D. and Luke, S. (2018). Hierarchical approaches for reinforce- ment learning in parameterized action space. arXiv preprint arXiv:1810.09656. [89] Wei, H., Chen, C., Zheng, G., Wu, K., Gayah, V., Xu, K. and Li, Z. (2019). Presslight: Learning max pressure control to coordinate traffic signals in arterial network. In KDD. [90] Wei, H., Zheng, G., Yao, H. and Li, Z. (2018). Intellilight: A reinforcement learn- ing approach for intelligent traffic light control. In KDD. [91] Xiong, J., Wang, Q., Yang, Z., Sun, P., Han, L., Zheng, Y., Fu, H., Zhang, T., Liu, J. and Liu, H. (2018). Parametrized deep q-networks learning: Reinforce- ment learning with discrete-continuous hybrid action space. arXiv preprint arXiv:1810.06394. [92] Xu, K., Hu, W., Leskovec, J. and Jegelka, S. (2019). How powerful are graph neural networks? In ICLR. [93] Yang, Y., Luo, R., Li, M., Zhou, M., Zhang, W. and Wang, J. (2018). Mean field multi-agent reinforcement learning. In ICML. [94] Yang, Y., Wen, Y., Wang, J., Chen, L., Shao, K., Mguni, D. and Zhang, W. (2020). Multi-agent determinantal q-learning. In ICML. [95] Zahavy, T., Barreto, A., Mankowitz, D. J., Hou, S., O'Donoghue, B., Kemaev, I. and Singh, S. (2021). Discovering a set of policies for the worst case reward. ArXiv, abs/2102.04323. [96] Zahavy, T., Haroush, M., Merlis, N., Mankowitz, D. J. and Mannor, S. (2018). Learn what not to learn: Action elimination with deep reinforcement learning. In NeurIPS. [97] Zahavy, T., Hasidim, A., Kaplan, H. and Mansour, Y. (2020). Planning in hierar- chical reinforcement learning: Guarantees for using local policies. In ALT. [98] Zahavy, T., Schroecker, Y., Behbahani, F. M. P., Baumli, K., Flennerhag, S., Hou, S. and Singh, S. (2022). Discovering policies with domino: Diversity opti- mization maintaining near optimality. ArXiv, abs/2205.13521. [99] Zhang, D., Malkin, N., Liu, Z., Volokhova, A., Courville, A. and Bengio, Y. (2022). Generative flow networks for discrete probabilistic modeling. In ICML. In [100] Zhang, Y., Yu, W. and Turk, G. (2019). Learning novel policies for tasks. ICML. [101] Zheng, G., Xiong, Y., Zang, X., Feng, J., Wei, H., Zhang, H., Li, Y., Xu, K. and Li, Z. (2019). Learning phase competition for traffic signal control. In CIKM. [102] Zheng, L., Yang, J., Cai, H., Zhou, M., Zhang, W., Wang, J. and Yu, Y. (2018). Ma- gent: A many-agent reinforcement learning platform for artificial collective intelligence. In AAAI. [103] Zhou, Z., Fu, W., Zhang, B. and Wu, Y. (2022). Continuously discovering novel strategies via reward-switching policy optimization. In ICLR. Supplementary Material for Diverse Policy Optimization for Structured Action Space A RELATED WORKS To the best of our knowledge, existing work on reinforcement learning rarely pursues both the quality as well as the diversity of optimal policies in sequential decision problems with large-scale, structured action spaces. Therefore, this section will briefly review the work in reinforcement learning focusing on the diversity of solutions and dealing with sequential decision problems with large-scale or structured action spaces, respectively. A.1 Diverse Solutions in RL Most of the literature on this problem has been done in the field of neuroevolution methods inspired by Quality-Diversity (QD), seeking to maximize the reward of a policy through approaches strongly motivated by natural biological processes. They typically work by perturbing a policy and either computing a gradient (as in Evolution Strategies) or selecting the top-performing perturbations (as in Genetic Algorithms). Neuroevolution methods comprise two leading families of algorithms: MAP-Elites [12, 60] and novelty search with local competition [39]. These methods typically maintain a collection of policies and adapt it using evolutionary algorithms to balance the QD trade-off [16, 24, 45, 62, 65, 70]. In another part of the work, intrinsic rewards have been used for learning diversity in terms of the discriminability of different trajectory- specific quantities [1, 18, 25, 26, 29, 72, 97]. These methods are similar in principle to novelty search without a reward signal but instead focus on diversity in behaviors defined by the states they visit. Other work implicitly induces diversity to learn policies that maximize the set robustness to the worst-possible reward [38, 95], or uses diversity as a regularizer when maximizing the extrinsic reward [23, 40, 55, 73, 100]. There is also a small body of work that transforms the problem of seeking diversity policies into a Constrained Markov Decision Process [15, 75, 98, 103]. In addition to getting policies with diversity in RL, some related work is encouraging policy diversity. In imitation learning, the problem of imitating diverse behaviors from expert demonstrations has been addressed in previous studies [43, 57, 74, 87]. In these methods, diverse behaviors are encoded in latent variables. However, these imitation learning methods assume the availability of observations of diverse behaviors performed by experts. Encouraging agents to diversify their exploration in the early stages of RL has also received significant attention in recent years [11, 32, 36, 46, 53, 66]. The diversity of policies in multi-agent reinforcement learning (MARL) is also crucial to improve the agent's robustness and their ability to zero-shot cooperate [48, 61, 77, 94]. A.2 Structured or Large-Scale Actions A large part of the current work on policy optimization for structured action spaces addresses one particular class of problems, namely, parametric action space problems, in which the action space has a particular master-slave structure. The difficulty in solving the parameterized action space lies in the heterogeneity of discrete master actions and continuous slave actions. Current methods either learn a continuous parameter policy for each discrete action [7, 56, 91]; or discrete actions are output in parallel with continuous actions and employ gradient post-processing techniques or improved value function networks to solve the master-slave action correspondence problem [19, 30]; or first, generate discrete actions, then generate continuous parameters based on that action and design sophisticated gradient update schemes for end-to-end training [6, 13, 88]. In contrast, there are fewer algorithms oriented towards structured action spaces in general, and in the tasks solved by these algorithms, there are no explicit dependencies between atomic actions. Thus, existing approaches are either based on the assumption of independence of the decomposed sub-actions [51, 78]; or they are based on the inductive bias to assign a conditional dependency structure to the decomposed sub-actions and pick up the actions one by one through an autoregressive form based on recurrent neural networks, which are finally spliced into the original actions [58, 68]. There are also a series of approaches that assume a game relationship between the decomposed sub-actions, model each sub-action as an agent, and use MARL methods to solve them [21, 42, 52, 83, 93]. However, the field of MARL is still in the preliminary exploration stage, and numerous theoretical problems remain unsolved. Thus modeling as a multi-agent problem will introduce more new challenges. To address the curse of dimensionality caused by (non-structured) large-scale action spaces, existing methods are based on the idea of reshaping the action space and thus reducing the dimensionality, e.g., some works perform dimensionality reduction by clustering the actions [8, 17, 31, 79, 85]. However, these approaches require the assumption that actions have dense semantic information, consist of natural language, and cannot be applied to general high-dimensional tasks. Some works propose solutions for generic large-scale action spaces, such as dividing the action space by using multiple hierarchical policies similar to a tree structure to reduce the action dimension of each layer of the policy [10, 14, 96]; or gradually increasing the action space employing curriculum learning so that the policy only needs to be optimized in a smaller action space in the early stage [20]. B TRAINING DETAILS B.1 Environments Adaptive Signal Traffic Control. This benchmark based on 2 well-established Simulation of Urban Mobility traffic simulator (SUMO) [3] scenarios, namely, "TAPAS Cologne" (8 lights) [82] and "InTAS" (21 lights) [47], which describe traffic within a real-world city, Cologne and Ingolstadt (Germany) respectively. There are 3 kinds of tasks in the original work [2], namely (a) controlling a single intersection, (b) controlling multiple intersections along an arterial corridor, and (c) coordinated control of multiple intersections within a congested area. We select the most complex coordinated control task (c) to demonstrate the advantage of DPO in finding diverse policies. In the coordinated control task, the atomic action is the selection of the signal light's phase at each intersection, and the physical dependencies are the roads between the intersections. The road network is shown in Figure 10. Figure 10: The road networks of coordinated control task [2] for TAPAS Cologne [82] and InTAS [47] respectively. Battle Scenario. This benchmark is based on the MAgent [102], a research platform for many-agent reinforcement learning. We selected the competitive task, Battle, as the simulation environment to highlight the advantages of the diverse policies. In Battle, n agents learn to fight against n enemies who have superior abilities than agents. (Figure 11). As the enemy's hit point is more than a single agent's damage, agents must continuously cooperate to kill the enemy. Figure 11: The snapshot of Battle in MAgent platform [102]. In our experiments on the ATSC and Battle benchmarks, all the environment settings, such as the definition of state, the definition of reward, etc., as well as the evaluation metrics, are kept the same as in Ault and Sharon [2]2 and Terry et al. [80]3 respectively. B.2 Methods Random seeds. Except as mentioned in the text, all experiments were run for 5 random seeds each. Graphs show the average (solid line) and std dev (shaded) performance over random seed throughout training. In the ATSC benchmark, the tables show the empirical mean of the relevant evaluation metrics. Hyperparameters. Table 2 shows the tuning range of hyperparameters used for all the experiments of our method and baselines. For all hyperparameters that need to be tuned, we use the Bayesian hyperparameter search method in the wandb platform4 for parallel tuning. During the parallel tuning, the platform will create a probabilistic model of a metric score as a function of the hyperparameters, and choose parameters with high probability of improving the metric. Bayesian hyperparameter search method uses a Gaussian Process to model the 2https://github.com/Pi-Star-Lab/RESCO . 3https://github.com/Farama-Foundation/PettingZoo. 4https://wandb.ai/ relationship between the parameters and the model metric and chooses parameters to optimize the probability of improvement. Hardware. The hardwares used in the experiment are a server with 128 cores, 128G memory and 4 NVIDIA GeForce RTX 1080Ti graphics cards with 11G video memory, and a server with 128 cores, 256G memory and 2 NVIDIA GeForce RTX 3090 graphics cards with 24G video memory. The Code of Baselines. The code and license of baselines are shown in following list: • IDQN [102]: https://github.com/geek-ai/MAgent, MIT License; • MFQ [93]: https://github.com/mlii/mfrl, MIT License; • Max-Pressure [9]: https://github.com/Pi-Star-Lab/RESCO, No License; • MPLight [101]: https://github.com/Pi-Star-Lab/RESCO, No License; • DvD [65]: https://github.com/jparkerholder/DvD_ES, Apache-2.0 license; • SQL [27]: https://github.com/haarnoja/softqlearning, No License; • RSPO [103]: https://github.com/footoredo/rspo-iclr-2022, No License. Table 2: Hyperparameters of all methods used in experiments. Name Tuning Range Name number of GPN layers hidden units of GPN dropout of GPN layers dropout of GPN attention layer alpha of GPN number of heads of GPN attention layer use residual in GPN norm layer in GPN number of GAT layers (soft-Q) hidden units of GAT (soft-Q) dropout of GAT layers (soft-Q) dropout of GAT attention layer (soft-Q) alpha of GAT (soft-Q) number of heads of GAT attention layer (soft-Q) use residual in GAT (soft-Q) norm layer in GAT (soft-Q) learning rate of GPN learning rate of Z learning rate of GAT Optimizers Replay Buffer Size γ replay start size minibatch size max gradient norm initial temperature (soft-Q) temperature learning rate soft update coefficient GPN update ratio number of GPN updates 3 {64, 128, 256} 0.6 0.5 (0, 1) 4 True {Layernorm, Batchnorm} 3 {64, 128, 256} 0.6 0.5 (0, 1) 4 True {Layernorm, Batchnorm} (1e-5, 1e-3) (1e-3, 1e-1) (1e-5, 1e-3) AdamW 1e6 (0.9, 0.99) 32 32 20 1.0 (1e-5, 3e-4) (2e-3, 5e-1) (2, 6) (1, 10) learning rate (IDQN) training frequency (IDQN) batch size (IDQN) target update (IDQN) memory size (IDQN) learning rate (IDQN) γ (IDQN) learning rate (MFQ) exploration decay (MFQ) γ (MFQ) batch size (MFQ) memory size (MFQ) batch size (MPLight) γ (MPLight) exploration decay (MPLight) target update (MPLight) demand shape (MPLight) σ (DvD) η (DvD) hidden units (DvD) ES-sensings (DvD) K (SQL) M (SQL) KV (SQL) alpha (RSPO) λint B λint R Initial learning rate (RSPO) Batch size (RSPO) PPO epochs (RSPO) (RSPO) (RSPO) Tuning Range 1e-3 5 256 1200 2e20 1e-4 0.99 1e-4 1.0 → 0.05, 2000 0.95 128 5e5 32 0.99 1.0 → 0.0, 220 500 1 (1e-4, 1e-2) (1e-4, 1e-2) {32, 64, 128} {200, 300, 400} (32, 100) (32, 100) 50 (0.1, 1.5) (0, 10) (0, 1) (1e-4, 1e-3) {512, 1600, 6400} (1, 10) (a) DPO. (b) Baselines. Learning curves are smoothed by the exponential moving average technique with coefficient 0.6. Source code is available at this anonymous code repository5, which is based on [49]6 and Zhang et al. [99]7. 5https://anonymous.4open.science/r/DPO. 6https://github.com/qiang-ma/graph-pointer-network. 7https://github.com/GFNOrg/EB_GFN. C MORE RESULTS Due to space constraints, we place some experimental results of the additional validation in the appendix section. These results consist of three main sections: one is a comparison of three algorithms that encourage policy diversity, DvD, SQL, and RSPO, with their respective independent learning variants; the second is ablation studies of the proposed DPO algorithm; Moreover, the third verify the robustness of different algorithms in the ATSC benchmark task under out-of-distribution traffic flow. Before giving these additional experimental results, we post the complete diversity visualization results here, as shown in Figure 12a, 12b, 13a and 13b. (a) The Ingostadt scenario. (b) The Cologne scenario. Figure 12: Comparison of policy diversity among DPO and other baselines under two scenarios in ATSC benchmark. Different colors represent different commute times. In addition to visualizing the global diversity of strategies obtained by different algorithms, we also show the proposed DPO's policy diversity at local intersections. In order to improve the interpretability of the visualization results, we selected the MP method based on heuristic rules and expert knowledge as a comparison, and the results are shown in Figure 14. It can be seen from the figure that the strategy output by the MP can better match the traffic flow, thereby reducing the average delay and other indicators. However, the DPO method does not simply perform local optimization but considers global information. This makes the diversity policies obtained from the DPO achieve a trade-off for allocating green light time at different times of a single intersection. C.1 Independent Learning Variants In the ATSC benchmark task, we find that the performance of the three algorithms DvD, SQL, and RSPO, which encourage policy diversity, showed a significant degradation in large-scale structured action space. This is why in larger scale Battle scenarios, we directly use these algorithms' corresponding independent learning variants. In this section, we further compare the DvD, SQL, and RSPO algorithms and their independent learning variants I-DvD, I-SQL, and I-RSPO in the TAPAS Cologne and InTAS scenarios of the ATSC benchmark, and the results are shown in Table 3a and 3b. The table shows that using the independent learning variant in a larger structured action space can lead to a more considerable performance improvement. However, the DvD algorithm still does not perform as well as expected. Independent learning encourages diversity of atomic actions, which will also prevent I-SQL and I-RSPO from getting a better diversity of policies in the structured action space. To verify this, we used the same visualization method as in the experimental part of the main text, and the final results are shown in Figure 15. As can be seen from the figure, in the small-scale structured action space, the independent learning variant does not bring significant performance improvement in terms of diversity; However, in the large-scale structured action space, the independent learning variant learns policies with more significant diversity. DPORSPOSQLDvDMPLightMPMPMPLightI-DvDI-SQLI-RSPODPO (a) The early stage. (b) The middle stage. Figure 13: Comparison of policy diversity among DPO and others under the early and middle stages of the Battle benchmark. Table 3: Performance (↓) of independent learning variants on two scenarios of the ATSC benchmark. I-DvD. Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue I-SQL Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue I-RSPO Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue SQL Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue Col. Reg. DvD 50.16 108.43 22.50 2.12 Col. Reg. 28.39 93.48 6.74 0.55 Col. Reg. RSPO 23.46 88.81 5.95 0.49 Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue Col. Reg. 55.91 115.54 28.35 2.28 Col. Reg. 58.32 116.29 30.01 2.06 Col. Reg. 57.28 120.53 28.19 2.59 (a) Performance of independent learning variants (TAPAS Cologne). Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue SQL Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue I-DvD. Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue I-SQL Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue I-RSPO Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue (b) Performance of independent learning variants (InTAS). Ing. Reg. DvD 74.58 215.07 32.48 1.45 Ing. Reg. 65.29 201.26 22.41 1.01 Ing. Reg. RSPO 86.59 215.25 39.76 1.58 Ing. Reg. 73.22 212.81 31.36 1.42 Ing. Reg. 67.65 205.44 26.45 1.15 Ing. Reg. 90.42 226.5 44.16 1.74 Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue C.2 Ablation Study In this section, we perform some ablation studies on the three critical implementations of the DPO algorithm, including the additional soft value regression (denoted as S) task introduced to accelerate the training of total flow Z , the additionally expanded termination action (denoted as T) to accelerate the training, and the action space design (denoted as P) of GFlowNet. For the last point, in the ATSC benchmark, we analyze the impact of the road network-based GFlowNet's action space design on performance; In the Battle benchmark, we analyze the impact of different physical topologies resulting from different influence ranges. IDQNMFQI-DvDI-SQLI-RSPODPOIDQNMFQI-DvDI-SQLI-RSPODPO Figure 14: The arrival rate of traffic in a specific direction at an intersection in a main road and the proportion of green lights generated by strategies output by different algorithms. Table 4: Ablation studies of the proposed DPO under two scenarios of the ATSC benchmark. Soft value regression Termination action Physical dependencies ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ Ing.Reg Trip Wait Queue 32.75 214.63 18.67 198.85 29.68 210.49 32.89 218.42 23.45 200.72 32.57 211.46 18.23 194.16 18.26 192.75 1.51 0.71 1.48 1.52 1.39 1.51 0.65 0.65 Delay 78.92 59.79 77.06 78.61 72.4 78.5 59.35 57.2 Epochs / ∼2.6× / / ∼2× / ∼2.6× 1× Delay 57.6 23.23 61.53 60.99 30.26 58.76 20.22 20.28 Col.Reg Trip Wait Queue 31.66 120.85 4.88 85.2 33.75 125.12 33.71 126.4 8.81 91.59 31.8 123.58 4.86 85.49 4.77 81.42 2.43 0.33 2.64 2.61 0.62 2.54 0.33 0.32 Epochs / ∼3.5× / / ∼1.7× / ∼3.2× 1× We first analyze the performance of the DPO algorithm on the ATSC benchmark, and the results are shown in Table 4, Figure 16a and 16b. As seen from the table, the soft value regression task plays a crucial role in the performance of the DPO. This is due to its operational guidance for training total flow Z , and the accuracy of Z estimation directly determines the diversity of the sampled structured actions. While the termination action and the road network-based GFlowNet's action space design have little impact, they can significantly improve the convergence speed of the algorithm. Overall, the results of the ablation study are consistent with our previous conjecture. The ablation studies on the DPO algorithm in the Battle benchmark task exhibited similar results, as shown in Table 5, Figure 16c and 16d. In our experiments, instead of picking a different range of influence, an alternative approach is used, i.e., the nearest k agents are chosen for implementation. As seen in Table 5, while choosing a more significant number of agents to form the physical dependencies provides a slight performance improvement, it also slows down the convergence of the algorithm because of the resulting larger GFlowNet action space. C.3 Robustness in ATSC benchmarks As explained in the §1, diversity of policies can improve the robustness of algorithms in non-stationary environments. Therefore, this section tests the robustness of different algorithms by perturbing the traffic distribution in the ATSC benchmark and verifies whether the diversity (a) The Ingostadt scenario. (b) The Cologne scenario. Figure 15: Comparison of policy diversity among baselines and their independent learning variants under two scenarios in ATSC benchmark. Different colors represent different commute times. (a) The Ingostadt scenario. (b) The Cologne scenario. (c) The Battle scenario. (d) The Battle scenario. Figure 16: Ablation studies on the ATSC and Battle benchmarks, where S denotes the additional soft value regression task introduced to accelerate the training of total flow Z , T) denotes the additionally expanded termination action accelerate the training, and P denotes the action space design of the GFlowNet. N denotes algorithms without above three techaniques. Table 5: Ablation studies of the proposed DPO under the Battle benchmark. Soft value regression Termination action Avg. # Kills Avg. # Reward Avg. Epochs ✓ ✓ 20.1(±3.9) 61.3(±0.4) 20.6(±4.2) 62.1(± 0.1) 0.013(±0.02) 0.135(±0.08) 0.015(±0.02) 0.142(± 0.19) / ∼3.7× / 1× ✓ ✓ # Nearest agents Avg. # Kills Avg. # Reward Avg. Epochs 3 4 5 6 61.3(±0.4) 62.1(± 0.1) 62.3(± 0.1) 58.6(± 0.1) 0.135(±0.08) 0.142(± 0.19) 0.146(± 0.23) 0.101(± 0.25) ∼1× 1× ∼1.7× ∼3.1× policies are effective against the non-stationary factors in the environment. Specifically, for the TAPAS Cologne (8 lights, 5 main roads) and InTAS (21 lights, 8 main roads) scenarios in the ATSC benchmark, we first randomly select 1 or 2 of the respective main roads, increase the traffic flow by 10%, and train all the algorithms for 50 episodes (about 3% of the standard training sample size). Since the DvD and MPLight algorithms have poor performance under ATSC and Battle benchmarks, we do not consider these two methods here. Also, considering the poor scalability of SQL and RSPO under large-scale structured action spaces, we only verify the robustness of the independent learning variants, i.e., I-SQL and I-RSPO. The average performance is shown in Table 6. RSPOSQLDvDI-DvDI-SQLI-RSPOI-DvDI-SQLI-RSPODvDSQLRSPO0510152025303540Episodes (x100)5075100125150175200225Delay (s)Ingolstadt Region Ablation StudyNSTPS+TT+PS+PS+T+P0510152025303540Episodes (x100)20406080100120140160Delay (s)Cologne Region Ablation StudyNSTPS+TT+PS+PS+T+P0510152025303540Episodes (x200)4003002001000100200300400Delay (s)Battle Ablation Study (w/o P)NSTS+T0510152025303540Episodes (x200)4003002001000100200300400Delay (s)Battle Ablation Study (for P)3-NN4-NN5-NN6-NN Table 6: The robustness of different algorithms after perturbing the traffic distribution in the ATSC benchmark. we randomly select 1 or 2 of the respective main roads, increase the traffic flow by 10%, and traine all the algorithms for 50 episodes (about 3% of the standard training sample size). MP Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue I-RSPO Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue Ing. Reg. Col. Reg. 1 road 70.24 235.77 23.46 0.83 2 roads 85.9 272.82 26.18 0.88 Ing. Reg. 1 road 88.54 246.73 30.63 1.15 2 roads 97.46 261.9 32.23 1.22 1 road 26.83 92.02 5.59 0.39 2 roads 31.4 113.25 6.31 0.43 Col. Reg. 1 road 35.51 126.99 7.08 0.47 2 roads 39.62 132.55 7.48 0.51 I-SQL Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue DPO Avg. Delay Avg. Trip Time Avg. Wait Avg. Queue Ing. Reg. Col. Reg. 1 road 91.36 258.09 32.31 1.26 2 roads 101.04 286.68 35.73 1.39 Ing. Reg. 1 road 60.27 211.82 19.17 0.69 2 roads 72.77 245.41 22.91 0.824 1 road 38.31 134.58 7.36 0.52 2 roads 44.59 143.06 7.87 0.59 Col. Reg. 1 road 21.45 86.6 5.04 0.34 2 roads 25.37 102.87 5.87 0.42 As seen from the table, DPO can quickly achieve good performance using only a small number of samples for fine-tuning. The lack of policy diversity in the other algorithms makes them have a significant performance gap with DPO.
http://arxiv.org/abs/2302.13782v1
2023-02-23T10:33:40
2023-02-23T10:33:40
Neural networks for learning personality traits from natural language
Personality is considered one of the most influential research topics in psychology, as it predicts many consequential outcomes such as mental and physical health and explains human behaviour. With the widespread use of social networks as a means of communication, it is becoming increasingly important to develop models that can automatically and accurately read the essence of individuals based solely on their writing. In particular, the convergence of social and computer sciences has led researchers to develop automatic approaches for extracting and studying "hidden" information in textual data on the internet. The nature of this thesis project is highly experimental, and the motivation behind this work is to present detailed analyses on the topic, as currently there are no significant investigations of this kind. The objective is to identify an adequate semantic space that allows for defining the personality of the object to which a certain text refers. The starting point is a dictionary of adjectives that psychological literature defines as markers of the five major personality traits, or Big Five. In this work, we started with the implementation of fully-connected neural networks as a basis for understanding how simple deep learning models can provide information on hidden personality characteristics. Finally, we use a class of distributional algorithms invented in 2013 by Tomas Mikolov, which consists of using a convolutional neural network that learns the contexts of words in an unsupervised way. In this way, we construct an embedding that contains the semantic information on the text, obtaining a kind of "geometry of meaning" in which concepts are translated into linear relationships. With this last experiment, we hypothesize that an individual writing style is largely coupled with their personality traits.
[ "Giorgia Adorni" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.13782v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.13782v1", "@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" ]
Università degli Studi di Milano-Bicocca Scuola di Scienze Dipartimento di Informatica, Sistemistica e Comunicazione Corso di Laurea in Informatica 3 2 0 2 b e F 3 2 ] L C . s c [ 1 v 2 8 7 3 1 . 2 0 3 2 : v i X r a RETI NEURALI PER L'APPRENDIMENTO DEI TRATTI DELLA PERSONALITÀ DAL LINGUAGGIO NATURALE Relatore: Prof. Stella Fabio Antonio Co-relatore: Dott. Marelli Marco Relazione della prova finale di: Giorgia Adorni Matricola 806787 Anno Accademico 2017-2018 A mio padre, per il suo sostegno quotidiano. Ad Elia, per tutto il supporto e l'amore dimostrato. i Ringraziamenti Grazie al mio relatore Fabio Stella, per avermi trasmesso la sua passione e per avermi fornito gli strumenti necessari per intraprendere questo percorso. Grazie ai ragazzi del Laboratorio MAD (Models and Algorithms for Data & Text Mining), per tutti i loro consigli. ii Abstract La personalità è considerata come uno degli argomenti di ricerca più influenti in psicologia poiché predittiva di molti esiti consequenziali come la salute mentale e fisica, ed è in grado di spiegare il comportamento umano. Grazie alla diffusione dei Social Network come mezzo di comunicazione, sta diventando sempre più importante sviluppare modelli che possano leggere automaticamente e con precisione l'essenza di individui basandosi esclusivamente sulla scrittura. In particolare, la convergenza tra scienze sociali e informatiche ha portato i ricercatori a sviluppare approcci automatici per estrarre e studiare le informazioni "nascoste" nei dati testuali presenti in rete. La natura di questo progetto di tesi è altamente sperimentale, e la motivazione alla base di questo lavoro è presentare delle analisi dettagliate sull'argomento, in quanto allo stato attuale non esistono importanti indagini che si basino interamente su testo in linguaggio naturale. L'obiettivo è identificare un adeguato spazio semantico che permetta di definire sia la personalità dell'oggetto a cui un determinato testo si riferisce, sia quella dell'autore. Punto di partenza è un dizionario di aggettivi che la letteratura psicologica definisce come marker dei cinque grandi tratti di personalità, i Big Five. In questo lavoro siamo partiti dall'implementazione di reti neurali fully-connected come base per capire come modelli semplici di Deep Learning possano fornire informazioni sulle caratteristiche nascoste della personalità. Infine, utilizziamo una classe di algoritmi distribuzionali inventati nel 2013 da Tomas Mikolov, che consistono nell'utilizzo di una rete neurale convoluzionale in grado di im- parare, in modo non supervisionato, i contesti delle parole. In questo modo costruiamo un embedding in cui sono contenute le informazioni semantiche del testo, ottenendo una sorta di "geometria del significato" in cui i concetti sono tradotti in relazioni lineari. Con quest'ultimo esperimento ipotizziamo che uno stile di scrittura individuale sia in gran parte accoppiato con i tratti della sua personalità. iii Indice Ringraziamenti Abstract Introduzione Motivazione . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contributi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Contesto 1.1 Big Five . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Reti Neurali 2.1 Modello . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Funzioni di attivazione . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Architetture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.1 Layer fully-connected . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.2 Layer convoluzionali . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.3 Layer di pooling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.4 Batch Normalization . . . . . . . . . . . . . . . . . . . . . . . . . . . ii iii viii ix ix 1 1 5 5 6 7 7 8 9 9 2.3 Apprendimento . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.3.1 Funzione di costo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.3.2 Algoritmi di ottimizzazione . . . . . . . . . . . . . . . . . . . . . . . 12 2.3.3 Paradigmi di apprendimento . . . . . . . . . . . . . . . . . . . . . . 13 2.4 Train, Validation e Test Sets . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.4.1 Evaluation metric . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.4.2 Overfitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 iv 3 Formulazione 17 3.1 Definizione del problema . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.2 Descrizione del dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.3 Calcolo della Ground Truth . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.4 Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.4.1 Natural Language Processing . . . . . . . . . . . . . . . . . . . . . . 18 4 Esperimenti e risultati 21 4.1 Spazi di rappresentazione . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.2 Esperimento 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.2.1 Input Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.2.2 Architettura della rete . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.2.3 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.3 Esperimento 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.3.1 Input Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.3.2 Architettura della rete . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.3.3 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.4 Esperimento 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4.4.1 Input Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4.4.2 Architettura della rete . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.4.3 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.5 Esperimento 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.5.1 Input Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.5.2 Architettura della rete . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.5.3 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5 Conclusioni Riferimenti bibliografici 37 42 v Elenco delle figure 2.1 Artificial Neuron Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Andamento di due funzioni di attivazione . . . . . . . . . . . . . . . . . . . 6 7 2.3 Visualizzazione di una matrice di confusione . . . . . . . . . . . . . . . . . . 16 3.1 Istogramma rappresentativo delle 30 parole più frequenti nel dizionario . . . 19 3.2 Visualizzazione del preprocessing . . . . . . . . . . . . . . . . . . . . . . . . 20 4.1 Visualizzazione del modello bag-of-words . . . . . . . . . . . . . . . . . . . . 22 4.2 Visualizzazione delle training loss dei tre modelli . . . . . . . . . . . . . . . 24 4.3 Visualizzazione del modello skip-gram . . . . . . . . . . . . . . . . . . . . . 26 4.4 Proiezione dell'embedding di Mikolov nello spazio 2-3 dimensionale, tramite la tecnica di riduzione della dimensionalità (t-SNE) [38] . . . . . . . . . . . 26 4.5 Esempio di architettura convoluzionale per la manipolazione del linguaggio naturale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.6 Visualizzazione delle training RMSE dei modelli . . . . . . . . . . . . . . . 30 4.7 Analisi della caratteristica Openness del "Modello 13" . . . . . . . . . . . . 35 4.8 Analisi della caratteristica Conscientiousness del "Modello 13" . . . . . . . 35 4.9 Analisi della caratteristica Extraversion del "Modello 13" . . . . . . . . . . 35 4.10 Analisi della caratteristica Agreeableness del "Modello 13" . . . . . . . . . . 36 4.11 Analisi della caratteristica Neuroticism del "Modello 13" . . . . . . . . . . . 36 vi Elenco delle tabelle 3.1 Esempio di dizionario OCEAN . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.1 Confronto delle architetture di tre differenti modelli . . . . . . . . . . . . . 23 4.2 Confronto dei risultati in termini di loss ottenuti dalle tre diverse reti . . . 23 4.3 Confronto dei risultati in termini di Root Mean Squared Error delle archi- tetture contro il modello basato sulla media di training . . . . . . . . . . . . 24 4.4 Confronto dei parametri della rete impostati per la realizzazione dell'embedding 27 4.5 Architetture implementate a partire dall'embedding 1 . . . . . . . . . . . . 28 4.6 Architetture implementate a partire dall'embedding 2 . . . . . . . . . . . . 28 4.7 Learning rate delle simulazioni effettuate nell'esperimento 2 . . . . . . . . . 29 4.8 Confronto dei risultati in termini di loss ottenuti nelle diverse reti con i due diversi embedding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.9 Confronto dei risultati in termini di Root Mean Squared Error delle archi- tetture sul test set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4.10 Architetture dei due modelli implementati a partire dall'embedding 3 . . . . 31 4.11 Confronto dei risultati in termini di loss ottenuti nell'implementazione dei due modelli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.12 Confronto dei risultati in termini di RMSE delle due architetture sul test set 32 4.13 Architetture implementate a partire dall'embedding 2 . . . . . . . . . . . . 33 4.14 Architetture implementate a partire dall'embedding 3 . . . . . . . . . . . . 33 4.15 Learning rate delle simulazioni effettuate nell'esperimento 2 . . . . . . . . . 33 4.16 Confronto delle loss ottenute nelle diverse reti con i due diversi embedding . 34 4.17 Confronto delle accuracy sul test set delle diverse architetture . . . . . . . . 34 vii Introduzione La personalità è un fattore chiave che influenza le interazioni, i comportamenti e le emozioni delle persone. Al giorno d'oggi, essa viene considera come uno degli argomenti di ricerca più influenti in psicologia. La crescente immersione negli ambienti digitali e la diffusione dei social network come mezzo di comunicazione, ha contribuito alla creazione di un enorme quantità di dati, anche chiamati Big Data, aprendo la necessità allo sviluppo di modelli automatici in grado di leggere con precisione l'essenza degli individui basandosi esclusivamente sulla scrittura. L'esigenza di produrre analisi sempre più velocemente ha imposto lo sviluppo di metodi meccanici per selezionare e interpretare i dati, favorendo la ricerca nel campo dell'apprendimento automatico o Machine Learning [1]. Nello specifico, il Data Mining è un approccio che consiste nell'individuazione d'informa- zioni significative tramite l'applicazione di algoritmi in grado di determinare le associazioni "nascoste" tra di esse [2, 3]. Una sua forma particolare è il Text Mining, nell'ambito del quale si sono sviluppate metodologie che consentono ai computer di confrontarsi con il linguaggio umano, di elaborarlo e comprenderlo [4]. L'interesse nello studio delle informazioni digitali e le abilità necessarie per farlo non sempre coincidono tra gli scienziati sociali. Di conseguenza, tale ricerca viene general- mente affidata a scienziati e ingegneri informatici, facilitando la scoperta di modelli che non sarebbe possibile individuare ed offrendo l'opportunità di instaurare collaborazioni interdisciplinari. La maggior parte degli attuali studi automatici di rilevamento della personalità si sono concentrati sulla teoria dei Big Five come quadro per studiare le caratteristiche intrinseche dell'essere umano [5]. Secondo questo modello esistono cinque dimensioni fondamentali dei tratti, stabili nel tempo e condivisi a livello interculturale. Le cinque caratteristiche, viii note appunto come i "Grandi Cinque", sono Openness (apertura all'esperienza), Con- scientiousness (coscienziosità), Extraversion (estroversione), Agreeableness (gradevolezza), Neuroticism (nevroticismo), riconosciuti dall'acronimo OCEAN. Sviluppare un modello accurato e aprire questa domanda di ricerca avrebbe implicazioni significative in diversi ambiti della sociologia, ma non solo. Struttura della tesi Di seguito si passano in rassegna gli argomenti affrontati capitolo per capitolo. Nel capitolo Contesto vengono introdotti i concetti teorici alla base del lavoro, in partico- lare viene introdotta la teoria dei Big Five. Nel capitolo Reti Neurali si descrivono le principali tecniche di Deep Learning, in parti- colare soffermandosi sulle architetture adottate negli esperimenti. Nel capitolo Formulazione viene definito il problema ed illustrati approcci e strumenti risolutivi. Nel capitolo Esperimenti e risultati viene presentata una panoramica degli esperimenti effettuati e una relativa analisi dei risultati. Nel capitolo Conclusioni vengono esposte le considerazioni finali. Motivazioni La natura di questo progetto di tesi è altamente sperimentale. Le motivazioni che hanno portato alla realizzazione di questo lavoro sono la presentazione di analisi dettagliate sull'argomento, in quanto allo stato attuale non esistono importanti indagini di questo tipo. Contributi I dati che verranno utilizzati per definire lo spazio semantico e testare la sua funzionalità sono messi a disposizione da Yelp Dataset Challenge, che contiene 5 200 000 recensioni relative a 174 000 attività commerciali di 11 aree metropolitane nel mondo. ix Capitolo 1 Contesto Con il termine personalità si intende l'insieme delle caratteristiche psichiche e dei compor- tamentali abituali - inclinazioni, interessi e passioni - che definiscono e differenziano ogni individuo, nei vari contesti ed ambienti in cui la condotta umana si sviluppa [6, 7]. La tradizione di studi psicologici relativi alla personalità è una delle più rilevanti della psicologia contemporanea, un campo in cui si susseguono studi empirici, teorici e storici, volti a comprendere la natura dell'identità personale nel contesto biologico e sociale di sviluppo. Essa tenta di spiegare le tendenze che sono alla base delle differenze comportamentali, ed ogni gruppo di pensiero tenta di concettualizzare la personalità entro modelli diversi - adoperando metodi, approcci, obiettivi e modalità d'analisi - anche molto dissonanti fra loro. Una significativa parte della psicologia che studia le differenze individuali, analizza e valuta la personalità attraverso specifici test volti ad individuarne i tratti. 1.1 Big Five Le teorie della personalità basate sui tratti definiscono la personalità come l'insieme delle caratteristiche che stabiliscono il comportamento di una persona. La teoria dei Grandi Cinque (o Big Five) risulta essere uno dei modelli più condivisi e testati, sia a livello teorico che empirico. McCrae e Costa identificano cinque grandi dimensioni in cui può essere suddivisa la personalità [8, 9]: • L'apertura all'esperienza o "openness" (creativo/curioso vs. coerente/cauto) è intesa come attitudine alla ricerca di stimoli culturali e di pensiero esterni al proprio contesto ordinario. Essa riflette il grado di curiosità intellettuale, la creatività o una preferenza per la novità; può inoltre essere percepita come imprevedibilità o 1 1 – Contesto mancanza di concentrazione. Individui con un'elevata apertura perseguono l'auto-realizzazione, cercando esperienze intense ed euforiche. Viceversa, coloro che hanno una bassa apertura cercano di ottenere soddisfazione attraverso la perseveranza. • La coscienziosità o "conscientiousness" (organizzato vs. negligente) è una tendenza caratterizzata dall'organizzazione, precisione e affidabilità. Un soggetto contraddi- stinto da questa attitudine, preferisce un comportamento pianificato piuttosto che spontaneo. Spesso l'alta coscienziosità viene percepita come testardaggine e ossessione, mentre la bassa coscienziosità è associata alla flessibilità e alla spontaneità, ma può anche apparire come mancanza di affidabilità. • L'estroversione o "extraversion" (estroverso/energetico vs. solitario/riservato) è intesa come grado di entusiasmo negli atteggiamenti che si adottano e tendenza a cercare la stimolazione in compagnia degli altri. L'alta estroversione è spesso percepita come una ricerca di attenzioni e prepotenza. La bassa estroversione causa una personalità riservata, riflessiva, che può essere avvertita come distaccata. • La gradevolezza o "agreeableness" (amichevole/compassionevole vs. provocatorio/- distaccato) è indicata come quantità e qualità delle relazioni interpersonali che la persona intraprende, orientate al prendersi cura dell'altro. È una tendenza ad essere compassionevoli e collaborativi piuttosto che sospettosi e antagonisti. L'alta gradevolezza è spesso vista come ingenuità o sottomissione. Le persone con scarsa gradevolezza sono spesso competitive o sfidanti, e possono essere intese come inaffidabili. • Il nevroticismo o "neuroticism" (sensibile/nervoso vs. sicuro/fiducioso), è una misura di resistenza a stress di tipo psicologico, come l'ansietà e l'irritabilità, ma si riferisce anche al grado di solidità emotiva e di controllo degli impulsi. Un'alta stabilità si manifesta in una personalità calma che però può essere vista come poco interessante e indifferente. Una bassa stabilità esprime reattività e dinamicità in individui che spesso possono essere percepiti come instabili o insicuri. Queste dimensioni sono state individuate a partire da studi psico-lessicali, secondo cui le cinque dimensioni corrisponderebbero alle macro-categorie più usate nel linguaggio per descrivere le diversità fra individui. 2 1.1 – Big Five Le regioni cerebrali che codificano i vari tratti di personalità sono spesso collegate alle regioni responsabili della comunicazione verbale e scritta. Un grande numero di prove di ricerca hanno supportato il modello a cinque fattori, che sembra essere condiviso a livello interculturale - Cina, Giappone, Italia, Ungheria, Turchia [10]. Le dimensioni di Big Five predicono accuratamente il comportamento e vengono utilizzate sempre più spesso per aiutare i ricercatori a comprendere l'estensione dei disturbi psicologici come ansia e depressione [11]. Uno dei vantaggi principali di questo approccio è che consente di concentrare l'attenzione solo sulle dimensioni di base piuttosto che studiare centinaia di tratti. 3 4 Capitolo 2 Reti Neurali Nel campo dell'apprendimento automatico, o machine learning, una rete neurale artifi- ciale in inglese Artificial Neural Network (ANN), è un modello matematico basato sulla semplificazione delle reti neurali biologiche [1]. Una rete neurale può essere considerata come un sistema dinamico avente la topologia di un grafo orientato, i cui nodi modellano i neuroni in un cervello biologico, mentre gli archi rappresentano le sinapsi (interconnessioni di informazioni). Ogni connessione può trasmettere un segnale da un neurone artificiale a un altro, i quali sono tipicamente aggregati in strati. Gli stimoli vengono ricevuti da un livello di nodi d'ingresso, detto unità di elaborazione, che elabora il segnale e lo trasmette ad altri neuroni ad esso collegati. 2.1 Modello Le reti neurali possono essere viste come semplici modelli matematici che definiscono una funzione f : X → Y . La funzione di rete di un neurone f (x) è definita come una composizione di altre funzioni gi(x), che possono a loro volta essere scomposte in altre funzioni. Una rappresentazione ampiamente utilizzata per la descrizione di ANN tradizionali è la somma ponderata, mostrata nell'equazione 2.1. f (x) = K (cid:19) wixi + b (cid:18) X i (2.1) Ogni segnale in ingresso xi viene moltiplicato ad un corrispondente peso wi, che assume valore positivo o negativo a seconda che si voglia eccitare o inibire il neurone. Il bias b varia secondo la propensione del neurone ad attivarsi, influenzandone l'uscita. Inoltre, viene 5 2 – Reti Neurali applicata una funzione predefinita K, detta anche funzione di attivazione, illustrata nella seguente sezione. Figura 2.1: Artificial Neuron Model 2.1.1 Funzioni di attivazione Una funzione di attivazione è una componente fondamentale del modello. Essa consente alla rete di imparare trasformazioni non lineari, in modo da essere in grado di calcolare problemi non banali utilizzando un limitato numero di nodi. Una delle funzioni più utilizzate è la sigmoide σ(x), la quale modella la frequenza degli stimoli emessi, da neurone inattivo, σ(x) = 0, a neurone completamente saturo con una frequenza di attivazione massima, σ(x) = 1. σ(x) = 1 1 + e−x (2.2) Negli ultimi anni è diventata molto popolare la Rectified Linear Unit (ReLU) [12, 13, 14, 15], definita dalla seguente equazione: f (x) = max(0, x) =   x se x > 0  0 altrimenti (2.3) Questa funzione azzera tutti i valori negativi, mentre ritorna invariati quelli positivi. Essa viene utilizzata per la sua capacità di accelerare notevolmente il processo di ottimizzazione, inoltre la sua implementazione risulta semplice ed efficiente. 6 2.2 – Architetture (a) Sigmoide (b) ReLU Figura 2.2: Andamento di due funzioni di attivazione 2.2 Architetture I neuroni vengono organizzati in una struttura detta architettura della rete. I dati, partendo da un livello iniziale, chiamato layer di input, attraversano i multipli strati interni della rete, gli hidden layer, raggiungendo l'ultimo livello detto layer di output. Quando i collegamenti tra i neuroni formano una struttura senza cicli si parla di reti feed-forward [16]. 2.2.1 Layer fully-connected Un'architettura molto comune nelle reti neurali è una struttura "densa", che utilizza layer fully-connected, in cui tutti i neuroni del livello precedente sono collegati ad ogni neurone dello strato successivo [17]. Lo scopo di un layer completamente connesso è imparare combinazioni non lineari di feature ad alto livello provenienti dal layer precedente. Una struttura di questo tipo è però caratterizzata da un numero di connessioni che cresce molto velocemente, causando un accrescimento del numero di parametri che la rete deve apprendere. Questo comporta un aumento del costo computazionale e un alto rischio di overfitting, approfondito nella Sezione 2.4.2. Per questo motivo questi vengono spesso sostituiti dai layer convoluzionali. 7 10.07.55.02.50.02.55.07.510.00.00.20.40.60.81.010.07.55.02.50.02.55.07.510.00246810 2 – Reti Neurali 2.2.2 Layer convoluzionali Una rete neurale convoluzionale, in inglese Convolutional Neural Network (CNN), è una classe di reti artificiali avanzate e feed-forward, composte da uno o più strati convoluzionali seguiti da una serie di livelli completamente connessi [18]. Una convoluzione può essere considerata come una funzione a finestra scorrevole, detta kernel o filtro, applicata a una matrice. Ogni livello applica filtri diversi, in genere centinaia o migliaia, e combina i loro risultati. Durante la fase di addestramento, una CNN impara automaticamente i valori dei suoi filtri in base all'attività che si desidera eseguire. Due parametri che definiscono il comportamento di un layer convoluzionale sono lo stride, che rappresenta il passo di convoluzione e viene utilizzato per ridurre le dimensioni spaziali dell'output e il padding, che definisce il comportamento dei neuroni lungo i bordi dei dati di input. Se viene scelto un padding valid, l'output contiene solo i neuroni la cui regione di convoluzione è completamente contenuta nei dati; nel caso di padding same, invece, l'output mantiene la stessa dimensione dell'input, utilizzando zero come valore per i dati mancanti. Le reti convoluzionali sono adatte per elaborare dati visivi e altri dati bidimensionali, ed hanno mostrato ottimi risultati nel riconoscimento di immagini e nella manipolazione del linguaggio naturale [19]. In quest'ultimo caso, l'input è costituito da frasi o documenti rappresentati come una matrice, in cui ogni riga corrisponde a un token, in genere una parola. Tipicamente, questi vettori sono dei word embeddings (rappresentazioni a bassa dimensione) come word2vec [20], ma potrebbero anche essere vettori unici che indicizzano la parola in un vocabolario. Nel Natural Language Processing (NLP) utilizziamo filtri che scorrono su righe complete della matrice (parole), pertanto, la loro "larghezza" è solitamente uguale alla quella della matrice di input. L'altezza, o la dimensione della regione, può variare, ma le finestre tipicamente scorrono su 2-5 parole per volta. Risulta che le CNN applicate ai problemi di NLP funzionino abbastanza bene, un esempio è il modello bag-of-words che è stato l'approccio standard per anni e ha portato a risultati piuttosto buoni [21]. Le CNN sono più facili da addestrare e hanno molti meno parametri da stimare. Il minor numero di connessioni e pesi di questa architettura, rende gli strati convoluzionali relativamente economici in termini di memoria e potenza di calcolo necessari. 8 2.2 – Architetture 2.2.3 Layer di pooling Il pooling è un processo alquanto comune nelle reti neurali, la cui funzione è ridurre progres- sivamente la dimensionalità spaziale per diminuire la quantità di parametri e la complessità computazionale della rete, mantenendo le informazioni più salienti e controllando anche l'overfitting. Il layer di pooling opera indipendentemente su ogni slice di profondità dell'input e lo ridimensiona spazialmente, usando l'operazione MAX sul risultato di ogni filtro [22]. Una proprietà del pool è che fornisce una matrice di output a dimensione fissa - in genere richiesta per la classificazione. Ciò consente di utilizzare frasi di dimensioni variabili e filtri di dimensioni variabili, ma ottenere sempre le stesse dimensioni di output da inserire in un classificatore. 2.2.4 Batch Normalization Durante la fase di addestramento del modello, i parametri di ogni substrato vengono ottimizzati al fine di minimizzare l'errore finale. Ad ogni iterazione, in ciascuno strato avviene una variazione dell'output, corrispondente ad una variazione nei valori in ingresso al livello successivo. Questo può rappresentare un problema per la rete, che deve adattare i propri strati ad un continuo cambiamento nell'input. Per aumentare la stabilità della rete neurale, velocizzare il training e migliorarne le performance, generalmente viene applicata ad ogni strato una Batch Normalization [23], la quale normalizza l'uscita di un precedente livello sottraendo il valore medio di un batch e dividendo il risultato per la sua deviazione standard. ˆx(k) = x(k) − E[x(k)] q Var[x(k)] (2.4) L'applicazione di questa operazione ad ogni input potrebbe cambiare ciò che il layer può rappresentare. Per questo motivo viene assicurato che la trasformazione inserita nella rete possa rappresentare l'identità, in modo da poter annullare il potenziale effetto della Batch Normalization, nel caso in cui fosse l'azione ottimale. Dunque viene prevista l'aggiunta di due parametri - "deviazione standard" γ e "media" β - che la rete impara assieme ai parametri del modello originale, come mostrato nell'equazione 2.5 y(k) = γ(k) ˆx(k) + β(k). (2.5) 9 2 – Reti Neurali La Batch Normalization può essere utilizzata sia su reti feed-forward, sia sulle reti convoluzionali. In questo secondo caso, media e varianza vengono calcolate per ogni filtro. 2.3 Apprendimento Per insegnare alla rete a risolvere un determinato problema, occorre una fase di addestra- mento in cui vengono condotte una serie di osservazioni per stabilire quali valori assegnare ad ogni parametro della rete e trovare un modello ottimale. Questo processo di apprendimento viene strutturato come un problema di ottimizzazione in cui lo scopo è minimizzare una funzione di costo, che misura la distanza tra una soluzione particolare ed una ottima. 2.3.1 Funzione di costo Una funzione di costo mappa un evento ad un numero reale, il quale ne rappresenta intuitivamente il "costo". Nella strategia adottata si utilizzeranno due diverse funzioni obiettivo: l'errore quadratico medio per risolvere il problema di regressione, e la Softmax Cross Entropy per il compito di classificazione. Mentre per la costruzione dell'embedding verrà applicata la Noise Contrastive estimation. Mean Squared Error Per il task il cui compito è prevedere dei valori reali è comune calcolare lo scostamento tra la quantità prevista dalla rete ( ˆY ) e i valori osservati Y (ground truth). L'errore quadratico medio (MSE) di uno stimatore misura la media dei quadrati degli errori, e viene calcolato come MSE = 1 n n X i=1 (Yi − ˆYi)2. (2.6) con n numero delle previsioni [24]. Softmax Cross Entropy Softmax è una funzione di loss comunemente utilizzata per la classificazione. In particolare viene applicata allo strato finale della rete ed addestrata in un regime di entropia incrociata [25]. 10 2.3 – Apprendimento L'entropia incrociata è un indicatore che può essere utilizzato per misurare l'accuratezza delle previsioni. Date due variabili casuali discrete p e q definiamo l'entropia nel modo seguente: H(p, q) = − X x p(x) log q(x) (2.7) in cui px è la "vera" probabilità o distribuzione, mentre qx è la distribuzione "innaturale" ottenuta a partire dal modello corrente. Nella pratica la Cross Entropy viene calcolata empiricamente ipotizzando l'equiproba- bilità degli eventi, poiché p è ignota. Di conseguenza, è ridefinibile come segue H(q) = − 1 N X x log q(x) (2.8) dove N è il numero di eventi osservati. L'obiettivo principale di questa funzione è rendere il risultato della Softmax campionata uguale a quella vera. L'algoritmo si concentra sulla selezione di campioni specifici dalla distribuzione data per ottenere la loss desiderata [26]. L'utilizzo della funzione Softmax ha un effetto considerevole sulle prestazioni. Noise Contrastive estimation La stima contrastiva del rumore è una strategia utilizzata nell'ambito della modellazione linguistica o per la generazione di word embedding dati in input dei corpus molto ampi. La funzione obiettivo del modello skip-gram cerca di trovare rappresentazioni di parole che siano utili per predire le parole circostanti, meglio chiamati contesti, in una frase o in un documento. Data una sequenza di parole di addestramento, la funzione obiettivo massimizza la probabilità media di log 1 T T X X t=1 −c≤j≤c,j /=0 log p(wt+j|wT ) (2.9) dove c è la dimensione del contesto di training [20]. Nell'implementazione del modello word2vec, la formulazione standard dello skip-gram definisce la precedente probabilità di log ricorrendo alla funzione Softmax: pθ(wO|wI ) = >vwI ) wO exp(v0 w=1 exp(v0 w PW >vwI ) 11 (2.10) 2 – Reti Neurali dove vw e v0 w sono le rappresentazione vettoriali di input e output e W è il numero delle parole del vocabolario [27]. In questo modo la previsione di una data parola a partire da un contesto risulta essere un compito computazionalmente intenso, poiché vi sono operazione che coinvolgono l'intero dizionario. Di conseguenza, un alternativa alla funzione Softmax è l'applicazione della Noise Contrastive estimation con campionamento negativo [28, 29]. Essa consente un allenamento più veloce e rappresentazioni vettoriali migliori per le parole frequenti. 2.3.2 Algoritmi di ottimizzazione Gli algoritmi di ottimizzazione sono necessari per minimizzare il risultato di una determinata funzione obiettivo, la quale dipende dai parametri che il modello deve imparare durante l'addestramento. Vengono utilizzate varie strategie e algoritmi di ottimizzazione per aggiornare e calcolare i valori appropriati e ottimali di tale modello, i quali influenzano fortemente l'efficacia del processo di apprendimento. L'entità dell'aggiornamento è determinata dal tasso di apprendimento η, in inglese learning rate, che garantisce la convergenza al minimo globale, per superfici di errore convesse, e ad un minimo locale, per superfici non convesse. Stochastic Gradient Descent La discesa del gradiente, in inglese Gradient Descent (GD), è un algoritmo iterativo per l'ottimizzazione di funzioni [30]. Viene utilizzato principalmente per eseguire gli aggiornamenti dei pesi in un modello di rete neurale nel seguente modo θ = θ − η∇J(θ) (2.11) dove η rappresenta il tasso di apprendimento, ∇J(θ) è il gradiente della funzione di loss J(θ) rispetto al parametro θ. La tradizionale discesa gradiente, o Batch Gradient Descent (GD), calcola il gradiente dell'intero set di dati, eseguendo un solo aggiornamento. Di conseguenza il processo di addestramento può risultare lento e difficile da controllare per i set di dati che sono molto grandi. I problemi che si verificano con questo algoritmo vengono risolti applicando una sua variante: la discesa stocastica del gradiente, in inglese Stochastic Gradient Descent (SGD). Questa tecnica esegue un aggiornamento alla volta dei parametri per ognuno degli esempi 12 2.3 – Apprendimento di training θ = θ − η∇J(θ; x(i); y(i)) (2.12) dove x(i) e y(i) sono le coppie di esempi usati per l'addestramento. Questa tecnica risulta essere molto più veloce di quella classica. A causa dei frequenti aggiornamenti, i parametri presentano un'alta varianza, inoltre la funzione loss oscilla tra diverse intensità. Questo favorisce la scoperta di nuovi minimi locali, complicando però la convergenza all'ottimo globale. Adagrad Adagrad è un metodo di apprendimento adattativo che aggiusta il learning rate sulla base dei parametri [31] . In questo algoritmo, la dimensione degli aggiornamenti è grande per parametri associati a caratteristiche poco ricorrenti e piccola per quelli più frequenti. Per questo motivo viene considerato adatto alla gestione di dati sparsi. Adagrad modifica il tasso di apprendimento generale η ad ogni istante di tempo t per ogni parametro θ(i), sulla base dei gradienti che sono stati calcolati per θ(i). Il vantaggio principale di questo metodo è che non è necessario regolare manualmente la frequenza di apprendimento e nella maggior parte delle implementazioni viene usato un valore predefinito - per esempio 0,001 - e lasciato invariato. La principale debolezza consiste nell'accumulo dei "gradienti quadrati" nel denominatore, finché ogni termine aggiunto è positivo [30]. Di conseguenza il tasso di apprendimento si riduce fino al punto in cui l'algoritmo non è più in grado di acquisire ulteriori conoscenze. 2.3.3 Paradigmi di apprendimento Gli algoritmi di apprendimento sono principalmente suddivisi in due categorie: supervisionato - alla rete viene presentato un training set preparato da un "insegnante esterno", composto da coppie significative di valori (input, output atteso). Quando alla rete neurale viene fornito l'input dall'ambiente, l'insegnante calco- la l'output desiderato corrispondente, addestrando la rete mediante un algoritmo (tipicamente quello di back propagation [32]). La rete impara a riconoscere la relazione incognita che lega le variabili di ingresso e uscita, in modo da prevedere il valore di output per qualsiasi valore di ingresso, basandosi solo su una casistica di corrispondenze (coppie input-output). 13 2 – Reti Neurali non supervisionato - alla rete vengono presentati solo i valori di input, mentre non sono messe a disposizione le informazioni di ritorno dell'ambiente sui valori obiettivo che si vogliono ottenere in risposta o riguardo la correttezza dell'output fornito. La rete è in grado di individuare da sola pattern, caratteristiche, similarità e re- golarità statistiche nei dati di input, acquisendo la capacità di dividerli in cluster rappresentativi che sviluppino delle rappresentazioni interne, senza usare confronti con output noti. In questo caso, gli algoritmi che modificano i pesi della rete fanno riferimento solo ai dati contenuti nelle variabili di ingresso. Questo è un tipo di apprendimento autonomo senza controllo esterno sull'errore. È un approccio adatto per ottimizzare le risorse nel caso in cui non si conoscano a priori i gruppi in cui dividere l'input. 2.4 Train, Validation e Test Sets Per misurare le prestazioni di una rete neurale dopo la fase di apprendimento, viene creato un test set formato da coppie non utilizzate per il training e validation set. Vengono generalmente definiti: • Training set - sul quale viene eseguito l'algoritmo di apprendimento. • Validation set - viene utilizzato per regolare i parametri, selezionare le features e prendere decisioni per quanto riguarda l'algoritmo di apprendimento. • Test set - si utilizza per valutare le performance dell'algoritmo, ma non per prendere decisioni su quale algoritmo di apprendimento o parametri utilizzare. Una volta definiti i set, ci si concentrerà sul miglioramento delle prestazioni del training e validation set. Generalmente la dimensione del test set è un terzo di quella del training. Esso è composto da input critici su cui la risposta della rete deve essere buona. Questo funziona bene quando sono messi a disposizione un numero limitato di esempi, ma nell'era dei Big Data, dove i problemi di apprendimento automatico consistono di più di un miliardo di campioni, la frazione di dati allocati agli insiemi di sviluppo e test è ridotta, nonostante il valore assoluto di esempi sia maggiore. Vengono utilizzate diverse tecniche statistiche per valutare la bontà di un modello. 14 2.4 – Train, Validation e Test Sets 2.4.1 Evaluation metric Le metriche di valutazione misurano le prestazioni di un modello, discriminando la bontà dei risultati ottenuti. Vengono presi in considerazione diversi tipi di metriche per valutare i modelli. La scelta della metrica dipende completamente dal tipo di modello e dal piano di implementazione. I modelli predittivi si distinguo in due principali categorie: si parla di regressione quando l'output da prevedere è continuo, o di classificazione nel caso in cui l'output sia nominale o binario. Regressione L'scarto quadratico medio, in inglese Root Mean Squared Error (RMSE), è la metrica di valutazione più popolare utilizzata nei problemi di regressione. Questo parametro aiuta a fornire risultati affidabili, mostrando correttamente la grandezza del termine di errore. La metrica RMSE è definita dalla seguente equazione RMSE = s PN i=1(Yi − ˆYi)2 N . (2.13) con ˆY quantità prevista dalla rete, Y i valori osservati e N numero delle previsioni. Classificazione Nei problemi di classificazione, in particolare quella binaria, gli output sono 0 o 1. Una matrice di confusione, nota anche come matrice di errore, è una tabella 2 × 2, generalizzabile ad una N × N per problemi ad N classi, che consente la visualizzazione delle prestazioni di un algoritmo di apprendimento supervisionato. Ogni colonna della matrice rappresenta le istanze previste di una classe mentre ciascuna riga quelle osservate. L'individuazione di falsi positivi (casi negativi identificati come positivi), falsi negativi (casi positivi identificati come negativi), veri positivi (casi positivi correttamente identifi- cati) e veri negativi (casi negativi correttamente identificati), mostrati nella Figura 2.3, consentono un'analisi più dettagliata della semplice proporzione di classificazioni corrette. È possibile estrarre da questa tabella le seguenti misure di performance: 15 2 – Reti Neurali Figura 2.3: Visualizzazione di una matrice di confusione • l'accuracy, o accuratezza, del modello, che consiste nella porzione rispetto al totale delle previsioni corrette True Positive + True Negative True Positive + True Negative + False Positive + False Negative (2.14) • la precision, o precisione, cioè la porzione dei casi positivi identificati correttamente True Positive True Positive + False Positive • la recall, ovvero la porzione dei casi positivi reali correttamente identificati True Positive True Positive + False Negative (2.15) (2.16) 2.4.2 Overfitting L'overfitting è "la produzione di un'analisi che corrisponde esattamente a un particolare insieme di dati o ne presenta forti similarità; può determinare l'impossibilità di adattamento a nuovi dati o compromettere l'affidabilità delle predizioni sulle osservazioni future". La rete neurale deve avere la capacità di comprensione del modello statistico dei dati. In presenza di overfitting essa memorizza i dati del training set e non è quindi in grado di generalizzare su nuovi dati. L'essenza di questo problema consiste nell'estrarre inconsapevolmente parte della variazione residua (cioè il rumore) come se quella variazione rappresentasse la sottostante struttura del modello [33]. Per ridurre la possibilità di overfitting esistono diverse tecniche, come la convalida incrociata (Cross Validation), la regolarizzazione o l'early stopping, che consiste nell'utilizzo di un validation set di coppie non usate nel training set per la misurazione dell'errore. 16 1010Classe previstaClasse osservataTrue PositiveTrue NegativeFalse PositiveFalse Negative Capitolo 3 Formulazione 3.1 Definizione del problema Partendo da materiale testuale presente in rete, in particolare un dataset messo a disposizio- ne da Yelp Dataset Challenge contenente 5 200 000 reviews relative a 174 000 business di 11 aree metropolitane nel mondo, l'obiettivo è quello di estrarre da questi dati caratteristiche di personalità. Il nostro scopo è di identificare un adeguato spazio semantico che permetta di definire la personalità dell'oggetto target a cui un determinato testo si riferisce. 3.2 Descrizione del dataset Come punto di partenza, viene messo a disposizione un dizionario di 637 aggettivi, che la letteratura psicologica definisce come marker dei cinque grandi tratti di personalità noti come Big Five. In particolare, questo vocabolario associa ad ogni aggettivo un vettore di cinque elementi in cui ogni elemento corrisponde al grado di presenza o assenza di una determinata caratteristica. Adjective Active Angry Boring . . . 0,053194 -0,004604 -0,069877 . . . 0,237406 -0,038453 -0,099754 . . . OCEAN 0,365915 0,020755 -0,478821 . . . 0,116700 -0,294754 -0,236462 . . . -0,058669 0,590114 0,118821 . . . Tabella 3.1: Esempio di dizionario OCEAN 17 3 – Formulazione 3.3 Calcolo della Ground Truth Per poter addestrare correttamente il modello è necessario avere una Ground Truth, ovvero una label associata ad ogni input della rete. Senza questa informazione sarebbe impossibile ottimizzare il modello e valutarne la validità. Si procede eliminando dal dataset tutte le sentences non contenenti almeno uno degli aggettivi presenti nel dizionario OCEAN. In seguito verranno utilizzati i dati contenuti all'interno del vocabolario per creare una mappatura diretta tra ogni frase e il corrispondente vettore di personalità, in cui ogni elemento sarà calcolato come la media del valore di ogni aggettivo presente nel testo. 3.4 Preprocessing Gli algoritmi di apprendimento automatico non sono in grado funzionare direttamente con il testo non elaborato, è quindi necessario eseguire in primis un preprocessamento del database di testi e in seguito convertire i dati in numeri, nello specifico, in vettori di numeri. Alla fine di questo processo il dataset ottenuto sarà suddiviso in tre corpora: • 70% training set : contenente 4 351 900 reviews utilizzate dalla rete per l'apprendi- mento; • 10% validation set: contenente 621 700 reviews; • 20% testing set: contenente 1 243 000 reviews. La divisione dei tre dataset dovrà mantenere una buona distribuzione fra le diverse classi. 3.4.1 Natural Language Processing Il Natural Language Processing (NLP) è un insieme di tecniche di computer science e linguistica che ricorrono a dei calcolatori per analizzare il linguaggio umano. Dal punto di vista sintattico, al dataset viene applicata la seguente serie di operazioni: • Rottura della frase: dato un pezzo di testo vengono trovati i limiti della frase, spesso contrassegnati da punti o altri segni di punteggiatura. • Stemming: alcune parole vengono ridotte alla loro forma radice (ad esempio "argue, argued, argues, arguing, and argus" sono mappati alla parola "argu"). 18 3.4 – Preprocessing • Segmentazione di parole: un blocco di testo o sentence viene separato in parole. Per una lingua come l'inglese, questo è abbastanza banale, poiché le parole sono solitamente separate da spazi. Dal punto di vista semantico invece si interviene nel seguente modo: • Semantica lessicale: tenta di comprendere il significato computazionale delle singole parole nel loro contesto. • Comprensione del linguaggio naturale: i blocchi di testo vengono convertiti in rappresentazioni più formali e più facili da manipolare per i computer. Ricorrendo, dove possibile, alle tecniche sopraelencate, è possibile costruire un dizionario delle 60 000 parole più frequenti nel corpus di training, basato sulla frequenza assoluta di una parola, avendo cura di eliminare tutti gli aggettivi presenti nel dataset OCEAN. Figura 3.1: Istogramma rappresentativo delle 30 parole più frequenti nel dizionario In questo modo non verrà influenzata la rete mostrando l'associazione tra gli aggettivi e le label associate, ed il modello sarà "costretto" ad imparare il legame esistente tra il contesto di una frase e il relativo valore del tratto di personalità. Inoltre sarà necessario anche rimuovere tutte le stopwords relative alla lingua inglese, ovvero parole considerate poco significative perché usate troppo frequentemente all'interno delle frasi - per esempio gli articoli e le congiunzioni - filtrando i termini comuni e senza uno specifico significato semantico dalle parole che trasportano vere informazioni. 19 'sn'tstafffoodserviceplacegoodgreatlikereallytimewouldgetonealwaysusalsolittlesuperevenwellgopeopleback'mcleangotcouldrestaurant'veWord index0100000200000300000400000500000Frequency 3 – Formulazione In seguito ogni parola del dizionario verrà codificata con un valore intero univoco, mentre quelle non presenti, tra cui gli aggettivi mappati nel vocabolario OCEAN, verranno indicizzati al valore "-1" e gli verrà associato il token "UNK" come mostrato nella Figura 3.2 Figura 3.2: Visualizzazione del preprocessing 20 the girl who took our order was friendlygirltookorder45334105 -1friendly Capitolo 4 Esperimenti e risultati La maggior parte degli attuali studi di previsione della personalità si sono concentrati sull'applicazione di tecniche generali di apprendimento automatico per predire i tratti di personalità Big Five. In particolare verranno utilizzate diverse strutture di rete, combinando differenti domini. 4.1 Spazi di rappresentazione Per affrontare questo problema di Text Mining, gli esperimenti si concentrano su due principali metodi per l'estrazione delle caratteristiche del testo: • Un approccio supervisionato, in cui viene utilizzato come strumento di generazione di feature un vettore bag-of-words o brevemente BoW, una rappresentazione di testo che descrive la presenza delle parole all'interno di un documento, in questo caso nel dizionario delle occorrenze [21]. • Un approccio non supervisionato, in cui viene costruito un embedding, tramite l'algoritmo word2vec di Tomas Mikolov [20]. Insegnando alla rete il significato delle parole e la relazione tra di esse, è possibile rappresentare, sotto forma di vettori, le mappature tra le parole e i contesti. In seguito viene posta l'attenzione su tre diverse architetture neurali: • Reti fully-connected; • Reti neurali convoluzionali CNN; • Classificatori multi-label binari. 21 4 – Esperimenti e risultati 4.2 Esperimento 1 4.2.1 Input Features Nel primo approccio proposto, per rappresentare i dati testuali viene utilizzato il modello bag-of-words, un tipo di descrizione semplificata, spesso utilizzata nell'elaborazione del linguaggio naturale e nel campo dell'Information Retrivial (IR). Sfruttando il dizionario delle occorrenze precedentemente costruito, il testo viene modellato come fosse una "borsa di parole", in cui grammatica e ordine delle parole vengono trascurate. Ogni frase viene ridotta ad un vettore in cui ogni elemento identifica una parola del dizionario. Nella posizione corrispondente ad un determinato termine vi sarà il valore 1 se la parola è contenuta nella frase, 0 altrimenti. Il modello riguarda solo le parole conosciute, di conseguenza i vocaboli che compaiono nel testo ma sono assenti nel dizionario vengono trascurati. Figura 4.1: Visualizzazione del modello bag-of-words 4.2.2 Architettura della rete Una volta estratte, le features posso essere passate in input alla rete neurale, che le elabora calcolando le risposte dei neuroni dal livello di input verso il livello di output. In questa prima strategia viene utilizzata una rete feed-forward con struttura densa o fully-connected. Per i dettagli di queste architetture si rimanda alla Sezione 2.2.1. Ad ogni livello viene applicata la funzione di attivazione non lineare ReLU, descritta nella Sezione 2.1.1. Inoltre, per accelerare l'apprendimento ed aumentare la stabilità della rete, viene effettuata dopo ogni layer una Batch Normalization, definita nella Sezione 2.2.4. Vengono presentate nella tabella 4.1 tre architetture implementate, con differenti strati e numero di neuroni che caratterizza ciascuno. 22 foodis1well go preparedfood is well preparednetbox 1 00 110 4.2 – Esperimento 1 Layer Modello 1 Modello 2 Modello 3 Input fc1 fc2 fc3 Output 60 000 300 200 - 5 60 000 300 200 100 5 60 000 100 50 20 5 Tabella 4.1: Confronto delle architetture di tre differenti modelli Tutte le simulazioni sono state addestrate per 10 epoche: la fase di addestramento viene in genere portata avanti fino a quando le performance sul test non producono alcun miglioramento. L'ottimizzatore scelto è Adagrad, introdotto nella Sezione 2.3.2, con learning rate 0,001. Come funzione di loss è stato scelto l'errore quadratico medio, in inglese Mean Squared Error (MSE), presentato nella Sezione 2.3.1. Mentre la metrica di valutazione utilizzata per misurare le prestazioni predittive del modello è la Root Mean Squared Error (RMSE), introdotta nella Sezione 2.4.1. In ogni epoca si alternano una fase di training ed una fase di test in modo tale da monitorare costantemente i miglioramenti o i peggioramenti del modello sul test set. 4.2.3 Performance Prendendo in considerazione le tre diverse architetture implementate, vengono presentati i risultati ottenuti in termini di loss. Train loss Test loss Tempo di training Modello 1 Modello 2 Modello 3 0,061 0,090 0,068 0,062 0,061 0,062 235 min 250 min 265 min Tabella 4.2: Confronto dei risultati in termini di loss ottenuti dalle tre diverse reti Per valutare l'efficacia di questi modelli, è fondamentale eseguire un analisi dettagliata, in particolare ponendo l'attenzione sui valori di RMSE per ogni tratto di personalità. Calcolando il valore medio assunto da ogni caratteristica durante la fase di addestramento, è possibile stabilire qual è il valore di Root Mean Squared Error di un modello concettuale, chiamato "Modello 0", che per ogni tratto predice sempre il suo valore medio. 23 4 – Esperimenti e risultati Modelli Root Mean Squared Error N E O A C Modello 1 Modello 2 Modello 3 Modello Modello 0 Modello Modello 0 Modello Modello 0 0,148 0,145 0,147 0,141 0,147 0,233 0,227 0,224 0,226 0,227 0,226 0,307 0,224 0,213 0,225 0,213 0,225 0,262 0,251 0,218 0,251 0,208 0,262 0,373 0,351 0,318 0,341 0,305 0,348 0,546 Tabella 4.3: Confronto dei risultati in termini di Root Mean Squared Error delle architetture contro il modello basato sulla media di training Figura 4.2: Visualizzazione delle training loss dei tre modelli Mettendo a confronto le due metriche, si nota che i modelli realmente implementati imparano nella maggioranza dei casi a predire un valore con lo stesso errore commesso dai modelli banali che calcolano la media. Risulta allora evidente che i risultati ottenuti non siano ottimali. Nonostante ciò, il terzo modello sembrerebbe essere leggermente migliore degli altri due, in particolare confrontandolo con il corrispondente modello nullo si nota la presenza di un piccolo margine di miglioramento. La scarsa efficienza di questi modelli potrebbe dipendere dall'efficacia con cui vengono codificate le feature in input alla rete. Infatti le limitazioni dell'approccio bag-of-words 24 00,250,50,7511250002500003750005000000modello 1modello 2modello 3 4.3 – Esperimento 2 derivano in parte dalla progettazione del vocabolario e della sua dimensione, che può causare una scarsa "descrizione" del documento. Scartare l'ordine delle parole e ignorare il contesto non consente di determinare la differenza tra le stesse parole disposte diversa- mente, i sinonimi ecc. Inoltre, un tipo di rappresentazione sparsa risulta più difficile da modellare quando si cercano modelli in grado di sfruttare poche informazioni in uno spazio rappresentativo ampio, sia per ragioni computazionali (spazio e complessità temporale) sia per ragioni di informazione. 4.3 Esperimento 2 Durante l'applicazione di tecniche di apprendimento automatico, tutte le "informazioni" vengono rappresentate per mezzo di identificativi unici e discreti. Nel caso dell'approccio BoW, la codifica utilizzata non fornisce alcuna informazione utile al sistema riguardo le relazioni che possono sussistere tra i singoli elementi. Ciò significa che quando sta elaborando i dati, il modello può sfruttare molto poco di ciò che ha appreso su un determinato termine. Inoltre la "raffigurazione" utilizzata nel precedente esperimento, ha portato alla creazione di dati sparsi. Di conseguenza, per ottenere un modello di successo, un'alternativa valida sarebbe quella di sfruttare modelli spaziali vettoriali, in inglese Vector Space Model (VSM), per rappresentare le parole in uno spazio continuo [34, 35]. Questi metodi dipendono dall'ipotesi distributiva, la quale afferma che le parole che appaiono negli stessi contesti condividono lo stesso significato semantico [36]. 4.3.1 Input Features Nel secondo approccio, viene applicato l'algoritmo non supervisionato word2vec di Tomas Mikolov [37]. Word2vec è un modello predittivo particolarmente efficiente dal punto di vista computazionale per l'apprendimento degli embedding di parole a partire dal testo non elaborato. Esso è basato su una rete neurale artificiale a due strati, addestrati a ricostruire i contesti linguistici delle parole. A partire dal corpus di testo, la rete prende in input un set formato dall'accoppiamento di ogni parola target e i contesti in cui appare e restituisce un insieme di vettori che rappresentano la distribuzione semantica delle parole nel testo. Viene considerato come "contesto" l'insieme delle "parole a sinistra" e delle "parole alla destra" dell'obiettivo, ovvero la finestra di dimensione 1 attorno all'elemento target. Ogni coppia di destinazione del contesto viene trattata come se fosse una nuova osservazione, incrementando le informazioni distribuzionali. Viene così prodotto uno spazio vettoriale di 25 4 – Esperimenti e risultati diverse centinaia di dimensioni, in cui ogni parola univoca viene assegnata a un vettore corrispondente nello spazio. Per l'implementazione viene utilizzato il modello skip-gram, una versione di word2vec che vuole predire le parole del contesto di origine (label) a partire dalle parole target (features). Figura 4.3: Visualizzazione del modello skip-gram In questo tipo di apprendimento, i vettori si posizionano nello spazio in modo tale che le parole che condividono contesti comuni nel corpo siano situate in stretta prossimità l'una dell'altra. Un esempio interessante viene illustrato nella Figura 4.4(b) - si ponga particolare attenzione alle parole "beautiful", "lovely", "chic", "trendy" ecc.. - in cui i vocaboli semanticamente simili si trovano vicini dello spazio. (a) Visualizzazione 2D (b) Dettaglio di una visualizzazione 3D Figura 4.4: Proiezione dell'embedding di Mikolov nello spazio 2-3 dimensionale, tramite la tecnica di riduzione della dimensionalità (t-SNE) [38] La funzione obiettivo utilizzata dalla rete per la costruzione dell'embedding viene definita sull'intero set di dati, ed ottimizzata con la Stochastic Gradient Descent (SGD), definita nella Sezione 2.3.2. Nella seguente tabella vengono presentati i due embedding realizzati e i relativi parametri. 26 i personally love crackers i personally love crackers (personally, i)(personally, love)([i, love], personally)i personally love crackers (love, personally)(love, crackers)([personally, crackers], love)clt 4.3 – Esperimento 2 Embedding Parameters Embedding Size Num Sampled Embedding 1 Embedding 2 40 250 20 50 Tabella 4.4: Confronto dei parametri della rete impostati per la realizzazione dell'embedding 4.3.2 Architettura della rete La rappresentazione spazio-vettoriale viene utilizzata come feature della modello che si andrà a costruire. In questo secondo approccio verrà utilizzata un rete convoluzionale, in cui ogni neurone è collegato solo a pochi neuroni vicini nel livello precedente, e lo stesso insieme di pesi viene utilizzato per ogni neurone. In questo tipo di rete, il modello di connessione locale e lo schema di peso condiviso pos- sono essere interpretati come un filtro (o un insieme di filtri) che accettano un sottoinsieme dei dati di input alla volta, ma vengono applicati all'intero input. Uno strato convoluzionale è molto più specializzato ed efficiente di uno completamente connesso. Figura 4.5: Esempio di architettura convoluzionale per la manipolazione del linguaggio naturale Le operazioni eseguite da questi strati vengono trasformate in "moltiplicazioni" non lineari tramite l'applicazione della funzione di attivazione ReLU, introdotta nella Sezio- ne 2.1.1. 27 wouldwelikeasandwichword embeddinglayer di convoluzionecon più filtri e mappa delle featurelayer di poolinglayer fully connectedoutput 4 – Esperimenti e risultati Ad ogni livello convoluzionale viene applicata una Batch Normalization, definita nel- la Sezione 2.2.4, utilizzata sull'input per il ridimensionamento delle funzionalità e la normalizzazione batch nei livelli nascosti. Dopo il primo strato convoluzionale viene inserito un layer di pooling, introdotto nella Sezione 2.2.3, necessario per ridurre in modo efficace i campioni dell'output del livello precedente, riducendo il numero di operazioni richieste per tutti i livelli successivi, ma passando comunque le informazioni valide. Come ultimo strato della rete viene scelto un layer fully-connected, definito nella Sezione 2.2.1, corrispondente ad un'operazione lineare sul vettore di input del livello che esegue una serie di trasformazioni sulla rappresentazione profonda al fine di emettere i punteggi di ogni classe. Layer Modello 4 Modello 5 Modello 6 conv1 mpool1 conv2 conv3 fcout 10×5, 10 18×18, 10 - 5×5, 150, same pad 4×4, stride 2, same pad 5×20, 100, same pad 1×20, 50, 1×1, 5 3×3, 100, same pad 3×20, 75, same pad 1×20, 50 Tabella 4.5: Architetture implementate a partire dall'embedding 1 Layer conv1 mpool1 conv2 conv3 fc1 fc2 fc3 fcout Modello 7 Modello 8 3×3, 100, stride 2, same pad 4×4, stride 2, same pad 3×63, 75, stride 2, same pad 1×32, 50, stride 2 - 1×32, 50, stride 2 1×32, 50, stride 2 1×1, 5 - - - - 1×1, 100 1×1, 50 1×1, 20 1×1, 5 Tabella 4.6: Architetture implementate a partire dall'embedding 2 Vengono presentate nelle tabelle 4.5 e 4.6 le diverse configurazioni dei layer convoluzio- nali delle architetture implementate per i due embedding. L'input della rete è costituito da un numero di caratteristiche pari a n × p dove n è la dimensione dell'embedding e p il numero delle parole di ogni sentence. 28 4.3 – Esperimento 2 Modelli Learning Rate Embedding 1 Embedding 2 Modello 4 Modello 5 Modello 6 Modello 7 Modello 8 0,001 0 0,000 1 0,005 0 0,005 0 0,000 1 Tabella 4.7: Learning rate delle simulazioni effettuate nell'esperimento 2 Come algoritmo di ottimizzazione viene scelto sempre Adagrad, illustrato nella Sezio- ne 2.3.2, mentre il valore di learning rate settato per ogni modello viene mostrato nella tabella 4.7. Viene mantenuta anche in questa simulazione la funzione di costo MSE, approfondita nella Sezione 2.3.1. Nel caso del secondo embedding si è voluto provare anche un modello che sfruttasse solo livelli di rete fully-connected, senza applicare alcuna convoluzione. 4.3.3 Performance Prendendo in considerazione i due diversi embedding, vengono messe a confronto a confronto le diverse architetture implementate, mostrando i risultati ottenuti in termini di loss. Modelli Train loss Test loss Tempo di training Embedding 1 Embedding 2 Modello 4 Modello 5 Modello 6 Modello 7 Modello 8 0,061 0,052 0,042 0,038 0,058 0,058 0,060 0,060 0,057 0,117 200 min 310 min 540 min 225 min 250 min Tabella 4.8: Confronto dei risultati in termini di loss ottenuti nelle diverse reti con i due diversi embedding Valutando le prestazioni su train e test set viene rilevato il "Modello 7" come il migliore tra quelli proposti, presentando i valori di loss più bassi. Oltre a ciò, anche rispetto al precedente approccio il "Modello 7" mostra una performance migliorata circa del 3%. Vengono analizzati anche i valori di RMSE, relativi ad ogni tratto di personalità, riassunti nella tabella 4.9, e viene inoltre visualizzata la curva RMSE nella Figura 4.6. 29 4 – Esperimenti e risultati Modelli Root Mean Squared Error N E O A C Embedding 1 Embedding 2 Modello 4 0,148 Modello 5 0,146 Modello 6 0,146 Modello 7 0,147 Modello 8 0,399 0,226 0,227 0,225 0,223 0,275 0,232 0,230 0,224 0,222 0,257 0,252 0,251 0,251 0,251 0,271 0,313 0,336 0,337 0,320 0,457 Tabella 4.9: Confronto dei risultati in termini di Root Mean Squared Error delle architetture sul test set Figura 4.6: Visualizzazione delle training RMSE dei modelli 4.4 Esperimento 3 Nel terzo approccio si decide di valutare una rappresentazione dell'input alternativa. 4.4.1 Input Features Ricorrendo nuovamente al modello skip-gram, l'input della rete questa volta comprende il set formato dall'accoppiamento tra gli aggettivi contenuti nel dizionario OCEAN e i loro contesti. La finestratura che si andrà a definire in torno al target sarà di dimensione 2 e considererà le due parole a sinistra e le due parole a destra dell'aggettivo. La window non sarà più 30 0,20,80,400,62,557,5010modello 4modello 5modello 6modello 7modello 8 4.4 – Esperimento 3 quindi incentrata su ogni elemento della sentence. Dunque nell'embedding che si andrà a costruire non verranno appresi i contesti di tutte le parole, ma solamente quelli di nostro interesse, ovvero relativi agli aggettivi. In questo esperimento viene realizzato un solo embedding, la cui dimensione è 250 e con numero di etichette negative da campionare pari a 50 [28]. 4.4.2 Architettura della rete Viene utilizzato l'embedding estratto per costruire due modelli di reti neurali, le cui architetture vengono presentate nella tabella 4.10. Come nel precedente esperimento si ricorrerà alle reti convoluzionali; si rimanda alla Sezione 4.3.2 per i dettagli. Layer conv1 mpool1 conv2 conv3 conv4 fcout Modello 9 Modello 10 7×5, 100, stride 2, same pad 3×3, 100, stride 2, same pad 4×4, stride 2, same pad 5×63, 75, stride 2, same pad 3×63, 75, stride 2, same pad 3×32, 50, stride 2, same pad 1×16, 25, stride 2 1×32, 50, stride 2 - 1×1, 5 Tabella 4.10: Architetture dei due modelli implementati a partire dall'embedding 3 L'algoritmo di apprendimento utilizzato è Adagrad, definito nella Sezione 2.3.2, con learning rate 0,000 5 per il "Modello 9" e 0,005 per il "Modello 10". La funzione di loss scelta è la MSE, introdotta nella Sezione 2.3.1. 4.4.3 Performance Vengono presentati nella tabella 4.11 i valori ottenuti dalla funzione obiettivo dei due modelli, mentre nella tabella 4.12 vengono riassunti i valori di RMSE per ogni tratto di personalità. Train loss Test loss Tempo di training Modello 9 Modello 10 0,043 0,050 0,060 0,059 18 h 17 h Tabella 4.11: Confronto dei risultati in termini di loss ottenuti nell'implementazione dei due modelli 31 4 – Esperimenti e risultati Modelli Root Mean Squared Error N E O A C Modello 9 0,146 Modello 10 0,147 0,223 0,225 0,223 0,224 0,251 0,252 0,331 0,339 Tabella 4.12: Confronto dei risultati in termini di RMSE delle due architetture sul test set Rispetto al precedente approccio non vengono ottenuti dei miglioramenti. 4.5 Esperimento 4 L'ultimo approccio provato riutilizza i precedenti metodi di estrazione di feature che hanno ottenuto le migliori prestazioni per realizzare un modello predittivo di classificazione. Nello specifico il problema viene trasformato in un compito di classificazione binaria multi-label, in cui si cercano di predire cinque diverse etichette per ogni istanza. Per ogni dimensione di personalità l'output della rete sarà "0", se il valore reale che assume un determinato tratto è inferiore a 0, o "1" altrimenti. Viene stabilito 0 come "punto di neutralità assoluta" perché corrisponde alla media dei valori osservati in ognuna delle caratteristiche. Adottando questo metodo, si assumerà di poter estrarre da questa funzione una misura di polarità, positiva o negativa, che indicherà un tratto più o meno accentuato. Il vantaggio effettivo di questo approccio consiste nella possibilità di valutare le perfor- mance in modo standard, visualizzando le matrici di confusione e misurandone l'accuratezza, argomenti trattati nella Sezione 2.4.1. 4.5.1 Input Features Vengono utilizzati come ingresso della rete due embedding di Mikolov realizzati negli esperimenti precedenti, ovvero l'"Embedding 2" e l'"Embedding 3". 4.5.2 Architettura della rete Le reti che vengono realizzate sono molto simili a quelle precedentemente implementate; i dettagli delle architetture vengono presentati nella tabella 4.13. Ad ogni livello della rete viene applicata la stessa procedura degli esperimenti precedenti. 32 4.5 – Esperimento 4 Layer Modello 11 Modello 12 Modello 13 conv1 mpool1 conv2 conv3 conv4 fcout 3×3, 100 4×4 3×63, 75 1×32, 50 - 1×1, 10 5×3, 100 4×4 3×63, 75 1×32, 50 1×16, 25 1×1, 10 7×5, 100 4×4 5×63, 75 3×32, 50 1×16, 25 1×1, 10 Tabella 4.13: Architetture implementate a partire dall'embedding 2 In ogni livello convoluzionale della rete si utilizzano uno stride di dimensione 2 e padding same, tranne che per l'ultimo livello convoluzionale con padding valid, per i dettagli si consiglia di visitare la sezione 2.2.2. Layer conv1 mpool1 conv2 conv3 conv4 conv5 fcout Modello 14 Modello 15 7×5, 100, stride 2, same pad 7×5, 100, stride 2, same pad 4×4, stride 2, same pad 4×4, stride 2, same pad 5×63, 75, stride 2, same pad 5×63, 75, stride 2, same pad 3×32, 50, stride 2, same pad 3×32, 50, stride 2, same pad 3×16, 25, stride 2, same pad 1×8, 16, stride 2 1×16, 25, stride 2 - 1×1, 10 Tabella 4.14: Architetture implementate a partire dall'embedding 3 In tutte le simulazioni l'ottimizzatore scelto è Adagrad, introdotto nella Sezione 2.3.2, il valore di learning rate di ogni modello viene mostrato nella tabella 4.15. Come funzione obiettivo viene utilizzata la Softamax Cross Entropy, presentata nella Sezione 2.3.1. Modelli Learning Rate Embedding 2 Embedding 3 Modello 11 Modello 12 Modello 13 Modello 14 Modello 15 0,000 1 0,000 5 0,000 5 0,000 5 0,000 5 Tabella 4.15: Learning rate delle simulazioni effettuate nell'esperimento 2 33 4 – Esperimenti e risultati 4.5.3 Performance Prendendo in considerazione le diverse architetture implementate, vengono presentati i risultati ottenuti in termini di loss. Modelli Train loss Test loss Tempo di training Embedding 2 Embedding 2 Modello 11 Modello 12 Modello 13 Modello 14 Modello 15 3,275 3,297 3,444 3,350 3,230 3,455 3,459 3,458 3,459 3,454 20 h 30 h 40 h 20 h 60 h Tabella 4.16: Confronto delle loss ottenute nelle diverse reti con i due diversi embedding Come già detto, l'utilizzo di questo approccio consente una valutazione non più solo in termini di loss ma se ne potrà analizzare anche l'accuratezza, introdotta nella Sezione 2.4.1. Modelli O Train/Test Accuracy [%] E A C N Embedding 2 Embedding 3 Modello 11 61/61 Modello 12 62/59 Modello 13 63/55 Modello 14 61/61 Modello 15 63/60 60/59 61/50 63/60 61/57 62/48 63/60 64/45 63/61 62/52 64/60 58/56 61/56 63/58 60/57 62/49 57/54 61/56 62/59 60/56 62/48 Tabella 4.17: Confronto delle accuracy sul test set delle diverse architetture Il "Modello 13" sembrerebbe il migliore tra quelli proposti poiché presenta valori di accuracy più alti e la differenza di prestazioni tra train e test set è una tra le più basse, dimostrando minore propensione all'overfitting. Viene presentata un analisi più dettagliata su questo modello, in particolare mostrando il grafico dell'accuratezza, su train e test set, e le matrici di confusione calcolate per ogni tratto di personalità. Come si può vedere chiaramente dalle matrici di confusione, le caratteristiche Con- scientiousness e Extraversion sono quelle che vengono predette nel modo peggiore. 34 4.5 – Esperimento 4 (a) Visualizzazione matrice di confusione (b) Visualizzazione accuratezza su train e test Figura 4.7: Analisi della caratteristica Openness del "Modello 13" (a) Visualizzazione matrice di confusione (b) Visualizzazione accuratezza su train e test Figura 4.8: Analisi della caratteristica Conscientiousness del "Modello 13" (a) Visualizzazione matrice di confusione (b) Visualizzazione accuratezza su train e test Figura 4.9: Analisi della caratteristica Extraversion del "Modello 13" 35 ObservedPredicted52% 48%42% 58%01010,540,510,640,570,602,557,5100train accuracy Otest accuracy OObservedPredicted94% 6%87% 13%01010,590,580,630,610,622,557,5100train accuracy Ctest accuracy C0101ObservedPredicted4% 96%2% 98%0,610,600,650,630,642,557,5100train accuracy Etest accuracy E 4 – Esperimenti e risultati (a) Visualizzazione matrice di confusione (b) Visualizzazione accuratezza su train e test Figura 4.10: Analisi della caratteristica Agreeableness del "Modello 13" (a) Visualizzazione matrice di confusione (b) Visualizzazione accuratezza su train e test Figura 4.11: Analisi della caratteristica Neuroticism del "Modello 13" 36 ObservedPredicted010156% 44%37% 63%0,560,530,630,580,612,557,5100train accuracy Atest accuracy AObservedPredicted010164% 36%45% 55%0,550,530,630,580,602,557,5100train accuracy Ntest accuracy N Capitolo 5 Conclusioni La natura di questo progetto di tesi è altamente sperimentale ed è volta a presentare analisi dettagliate sull'argomento, in quanto allo stato attuale non esistono importanti indagini che affrontino il problema dell'apprendimento dei tratti di personalità a partire da testo in linguaggio naturale. La domanda fondamentale che viene posta al fine di risolvere questo compito è quale sia la metodologia adatta alla rappresentazione del testo. Durante la sperimentazione, infatti, sono stati esaminati due principali approcci e ne è stata comparata l'efficacia. Siamo partiti da una rappresentazione semplificata del testo ricorrendo al modello bag-of-words. I risultati ottenuti sono sub-ottimali dal punto di vista della complessità. Inoltre la codifica utilizzata non fornisce alcuna informazione utile al sistema riguardo le relazioni che possono sussistere tra le parole di una frase. In seguito è stata sfruttata una classe di algoritmi distribuzionali per insegnare alla rete il significato e le relazioni sussistenti tra le parole. Sfruttando la versione skip-gram dell'algoritmo word2vec di Tomas Mikolov vengono rappresentate sotto forma di vettori le mappature tra parole e contesti nello spazio. Ricorrendo al secondo metodo i risultati ottenuti dimostrano come utilizzare un embedding sia la tecnica di estrazione di features più efficiente per filtrare le informazioni contenute in un testo. È emerso che un'evoluzione di questo progetto potrebbe affacciarsi alla valutazione di rappresentazioni alternative del testo, annotazioni, part-of-speech [39] e altre tecniche di NLP, per approfondire e migliorare ulteriormente l'indagine. 37 5 – Conclusioni Dal punto di vista delle architetture implementate, abbiamo iniziato dall'implementa- zione di reti neurali fully-connected come base per capire come modelli semplici di Deep Learning possano fornire informazioni sulle caratteristiche nascoste della personalità. Infine, ci addentriamo nelle reti neurali convoluzionali molto più specializzate e efficiente delle precedenti nell'ambito del Text Mining. Sviluppi futuri di questo lavoro potrebbero valutare una procedura di apprendimento alternativa, sfruttando altri modelli, quali le reti ricorrenti, per ottenere dei risultati più efficaci. La prima valutazione effettuata è definita come una regressione che tenta di prevedere l'esatto valore reale per ogni tratto di personalità. Il problema presentato è estremamente complesso, e le performance ottenute sono ancora lontane da quelle desiderate. Per questo motivo viene eseguita una seconda valutazione che trasforma il nostro compito in un problema di classificazione binaria multi-label. I risultati raggiunti questa volta, evincono che ottimizzare la funzione di loss di un modello predittivo di regressione è molto più difficoltoso rispetto ad ottimizzare una funzione di costo stabile come la Softmax. Questo è evidente poiché il modello di regressione tenta di produrre un esatto valore per ogni input, e i valori anomali predetti possono introdurre gradienti enormi. 38 Bibliografia [1] Arthur L Samuel. «Some studies in machine learning using the game of checkers». In: IBM Journal of research and development 3.3 (1959), pp. 210–229 (cit. alle pp. viii, 5). [2] Soumen Chakrabarti et al. «Data mining curriculum: A proposal (Version 1.0)». In: Intensive Working Group of ACM SIGKDD Curriculum Committee 140 (2006) (cit. a p. viii). [3] James Franklin. «The elements of statistical learning: data mining, inference and prediction». In: The Mathematical Intelligencer 27.2 (2005), pp. 83–85 (cit. a p. viii). [4] Ah-Hwee Tan et al. «Text mining: The state of the art and the challenges». In: Proceedings of the PAKDD 1999 Workshop on Knowledge Disocovery from Advanced Databases. Vol. 8. sn. 1999, pp. 65–70 (cit. a p. viii). [5] Murray R Barrick e Michael K Mount. «The big five personality dimensions and job performance: a meta-analysis». In: Personnel psychology 44.1 (1991), pp. 1–26 (cit. a p. viii). [6] Philip J Corr e Gerald Matthews. The Cambridge handbook of personality psychology. Cambridge University Press Cambridge, 2009 (cit. a p. 1). [7] Benjamin J Sadock, Virginia A Sadock e Pedro Ruiz. Comprehensive textbook of psychiatry. lippincott Williams & wilkins Philadelphia, 2000 (cit. a p. 1). [8] Lewis R Goldberg. «The structure of phenotypic personality traits.» In: American psychologist 48.1 (1993), p. 26 (cit. a p. 1). [9] Paul T Costa e Robert R McCrae. «The revised neo personality inventory (neo-pi-r)». In: The SAGE handbook of personality theory and assessment 2.2 (2008), pp. 179–198 (cit. a p. 1). 39 BIBLIOGRAFIA [10] Harry C. Triandis e Eunkook M. Suh. «Cultural Influences on Personality». In: Annual Review of Psychology 53.1 (2002), pp. 133–160. doi: 10.1146/annurev. psych.53.100901.135200. eprint: https://doi.org/10.1146/annurev.psych.53. 100901.135200 (cit. a p. 3). [11] Lisa M Saulsman e Andrew C Page. «The five-factor model and personality disorder empirical literature: A meta-analytic review». In: Clinical psychology review 23.8 (2004), pp. 1055–1085 (cit. a p. 3). [12] Vinod Nair e Geoffrey E Hinton. «Rectified linear units improve restricted boltzmann machines». In: Proceedings of the 27th International Conference on machine learning (ICML-10). 2010, pp. 807–814 (cit. a p. 6). [13] Richard Hahnloser et al. «Digital selection and analogue amplification coexist in a cortex-inspired silicon circuit». In: 405 (lug. 2000), pp. 947–51 (cit. a p. 6). [14] Richard Hahnloser e H. Sebastian Seung. «Permitted and Forbidden Sets in Symmetric Threshold-Linear Networks». In: Advances in Neural Information Processing Systems. A cura di T. Leen, T. Dietterich e V. Tresp. Vol. 13. MIT Press, 2000. url: https:// proceedings.neurips.cc/paper/2000/file/c8cbd669cfb2f016574e9d147092b5bb- Paper.pdf (cit. a p. 6). [15] Xavier Glorot, Antoine Bordes e Yoshua Bengio. «Deep sparse rectifier neural networks». In: Proceedings of the fourteenth international conference on artificial intelligence and statistics. 2011, pp. 315–323 (cit. a p. 6). [16] Daniel Svozil, Vladimir Kvasnicka e Jiri Pospichal. «Introduction to multi-layer feed-forward neural networks». In: Chemometrics and intelligent laboratory systems 39.1 (1997), pp. 43–62 (cit. a p. 7). [17] Tara N Sainath et al. «Convolutional, long short-term memory, fully connected deep neural networks». In: Acoustics, Speech and Signal Processing (ICASSP), 2015 IEEE International Conference on. IEEE. 2015, pp. 4580–4584 (cit. a p. 7). [18] Yoon Kim. «Convolutional neural networks for sentence classification». In: arXiv preprint arXiv:1408.5882 (2014) (cit. a p. 8). [19] Christopher D Manning, Christopher D Manning e Hinrich Schütze. Foundations of statistical natural language processing. MIT press, 1999 (cit. a p. 8). [20] Tomas Mikolov et al. «Distributed representations of words and phrases and their compositionality». In: Advances in neural information processing systems. 2013, pp. 3111–3119 (cit. alle pp. 8, 11, 21). 40 BIBLIOGRAFIA [21] Hanna M Wallach. «Topic modeling: beyond bag-of-words». In: Proceedings of the 23rd international conference on Machine learning. ACM. 2006, pp. 977–984 (cit. alle pp. 8, 21). [22] Andrej Karpathy. «Cs231n convolutional neural networks for visual recognition». In: Neural networks 1 (2016) (cit. a p. 9). [23] Sergey Ioffe e Christian Szegedy. «Batch normalization: Accelerating deep network training by reducing internal covariate shift». In: arXiv preprint arXiv:1502.03167 (2015) (cit. a p. 9). [24] Zhou Wang e Alan C Bovik. «Mean squared error: Love it or leave it? A new look at signal fidelity measures». In: IEEE signal processing magazine 26.1 (2009), pp. 98–117 (cit. a p. 10). [25] Yichuan Tang. «Deep learning using linear support vector machines». In: arXiv preprint arXiv:1306.0239 (2013) (cit. a p. 10). [26] Weiyang Liu et al. «Large-Margin Softmax Loss for Convolutional Neural Networks.» In: ICML. 2016, pp. 507–516 (cit. a p. 11). [27] Chris Dyer. «Notes on noise contrastive estimation and negative sampling». In: arXiv preprint arXiv:1410.8251 (2014) (cit. a p. 12). [28] Tongliang Liu e Dacheng Tao. «Classification with noisy labels by importance reweighting». In: IEEE Transactions on pattern analysis and machine intelligence 38.3 (2016), pp. 447–461 (cit. alle pp. 12, 31). [29] Chockalingam Viswesvaran e Deniz S Ones. «Measurement error in "Big Five Factors" personality assessment: Reliability generalization across studies and measures». In: Educational and Psychological Measurement 60.2 (2000), pp. 224–235 (cit. a p. 12). [30] Sebastian Ruder. «An overview of gradient descent optimization algorithms». In: arXiv preprint arXiv:1609.04747 (2016) (cit. alle pp. 12, 13). [31] John Duchi, Elad Hazan e Yoram Singer. «Adaptive subgradient methods for online learning and stochastic optimization». In: Journal of Machine Learning Research 12.Jul (2011), pp. 2121–2159 (cit. a p. 13). [32] S-I Horikawa, Takeshi Furuhashi e Yoshiki Uchikawa. «On fuzzy modeling using fuzzy neural networks with the back-propagation algorithm». In: IEEE transactions on Neural Networks 3.5 (1992), pp. 801–806 (cit. a p. 13). 41 BIBLIOGRAFIA [33] Kenneth P Burnham e David R Anderson. Model selection and multimodel inference: a practical information-theoretic approach. Springer Science & Business Media, 2003 (cit. a p. 16). [34] Tomas Mikolov, Wen-tau Yih e Geoffrey Zweig. «Linguistic regularities in continuous space word representations». In: Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. 2013, pp. 746–751 (cit. a p. 25). [35] Katrin Erk e Sebastian Padó. «A structured vector space model for word meaning in context». In: Proceedings of the Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics. 2008, pp. 897–906 (cit. a p. 25). [36] Marco Baroni, Georgiana Dinu e Germán Kruszewski. «Don't count, predict! A systematic comparison of context-counting vs. context-predicting semantic vectors». In: Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Vol. 1. 2014, pp. 238–247 (cit. a p. 25). [37] Tomas Mikolov et al. «Efficient estimation of word representations in vector space». In: arXiv preprint arXiv:1301.3781 (2013) (cit. a p. 25). [38] Laurens van der Maaten e Geoffrey Hinton. «Visualizing data using t-SNE». In: Journal of machine learning research 9.Nov (2008), pp. 2579–2605 (cit. a p. 26). [39] Roger W Brown. «Linguistic determinism and the part of speech.» In: The Journal of Abnormal and Social Psychology 55.1 (1957), p. 1 (cit. a p. 37). 42
http://arxiv.org/abs/2302.11905v1
2023-02-23T10:25:38
2023-02-23T10:25:38
The Geometry of Mixability
Mixable loss functions are of fundamental importance in the context of prediction with expert advice in the online setting since they characterize fast learning rates. By re-interpreting properness from the point of view of differential geometry, we provide a simple geometric characterization of mixability for the binary and multi-class cases: a proper loss function $\ell$ is $\eta$-mixable if and only if the superpredition set $\textrm{spr}(\eta \ell)$ of the scaled loss function $\eta \ell$ slides freely inside the superprediction set $\textrm{spr}(\ell_{\log})$ of the log loss $\ell_{\log}$, under fairly general assumptions on the differentiability of $\ell$. Our approach provides a way to treat some concepts concerning loss functions (like properness) in a ''coordinate-free'' manner and reconciles previous results obtained for mixable loss functions for the binary and the multi-class cases.
[ "Armando J. Cabrera Pacheco", "Robert C. Williamson" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11905v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11905v1", "@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 5 0 9 1 1 . 2 0 3 2 : v i X r a THE GEOMETRY OF MIXABILITY ARMANDO J. CABRERA PACHECO AND ROBERT C. WILLIAMSON Abstract. Mixable loss functions are of fundamental importance in the context of prediction with expert advice in the online setting since they characterize fast learning rates. By re-interpreting properness from the point of view of differential geometry, we provide a simple geometric char- acterization of mixability for the binary and multi-class cases: a proper loss function (cid:96) is η-mixable if and only if the superpredition set spr(η(cid:96)) of the scaled loss function η(cid:96) slides freely inside the superprediction set spr((cid:96)log) of the log loss (cid:96)log, under fairly general assumptions on the differentiability of (cid:96). Our approach provides a way to treat some concepts concerning loss functions (like properness) in a "coordinate-free" manner and reconciles previous results obtained for mixable loss functions for the binary and the multi-class cases. 1. Introduction In the context of prediction with expert advice as described by Vovk in [Vov98] and [Vov01], an information game is considered between three players: the learner, n N experts and nature. At each step t N, ∈ ∈ each expert makes a prediction which the learner is allowed to see, the learner makes a prediction, nature chooses an outcome, for a fixed loss function (cid:96), the cumulative loss is calculated for the learner and each of the experts. • • • • The goal is to minimize the difference between the learner's loss and the best expert's loss, which is often called the regret. 1.1. Mixable games and characterizations of mixable and fundamen- tal loss functions. For a wide class of games, called η-mixable games for η > 0, the Aggregating algorithm (see for example [Vov01]) ensures an optimal bound for the regret (η−1 ln n) independent of the trial t. Since the mixability of a game depends on the loss function (cid:96), a loss function (cid:96) is η-mixable if the corresponding game is mixable. Since arguably the aggregating algorithm is one of the most well founded and studied prediction algorithms, there is a natural interest in understanding properties and characterizations of mixable loss functions. 2 CABRERA PACHECO AND WILLIAMSON Examples of mixable loss functions include the log loss, relative entropy for binary outcomes [HKW98] and the Brier score [VZ09, vERW12]. Mixability of a loss function (cid:96) is characterized by a "stronger convexity" of the super- prediction set of (cid:96), which can be described as the convexity of the superpre- diction set of (cid:96) after an "exponential projection" (see (1.3) below and [Vov15] and [vERW12]). Unfortunately, this characterization of mixability lacks a transparent geometric interpretation. The main goal of this work is to provide such geometric interpretation. The motivation stems from an observation made by Vovk in [Vov15]: a η-mixable loss can be characterized as the positiveness of the infimum of the quotient of the curvatures of the a strictly proper loss function (cid:96) and the log loss (cid:96)log for binary outcomes. Here as usual, loss functions are defined on the 2-simplex ∆2 (see (1.1)). Moreover, he then proves that fundamentality (see Vovk [Vov15]) of a loss can be characterized as the finiteness of the supremum of the same quotient of curvatures. These two results suggest that these properties are geometric, meaning that they can be studied using differential geometry tools, and in this regard, mixability and fundamentality should not depend on the coordinates chosen to express them. Loosely speaking, in convex geometry a convex set L is said to slide freely inside a convex set K, if for any point x in the boundary of K, there is a translation vector y such that the translation of L by y (i.e., the Minkowski sum L + y, see (4.2)), intersects K at x, and L + y K. We provide the following geometric characterization of mixability and fundamentality, as a geometric comparison to the log loss (see Figure 1). Let spr((cid:96)) denote the superprediction set of a loss function (cid:96) (see (1.4)). ⊂ Theorem 1.1 (Informal statement). A continuously twice differentiable proper loss function is η-mixable if and only there is η > 0 such that spr(η(cid:96)) slides freely inside spr((cid:96)log). In addition, the same (cid:96) is fundamental if and only if there exists γ > 0 such that spr((cid:96)log) slides freely inside spr(γ(cid:96)). To obtain the previous theorem it is necessary to re-interpret properness from a differential geometry point of view, which constitutes a big part of this work. However, this technical effort pays off. In [vERW12], van Erven, Reid and Williamson characterized η-mixable (differentiable) loss functions for multi-class loss functions and moreover, related η to the Hessian of the Bayes risk of (cid:96) and the log loss (see Definition 1.3), which is interpreted as its curvature. By generalizing the tools developed here for the binary case, we were able to obtain a multi-class analog result to Theorem 1.1 and to build a bridge to the results in [vERW12]. THE GEOMETRY OF MIXABILITY 3 Figure 1. We abuse notation and denote the image of a loss function (cid:96) by simply (cid:96). The figure shows how the superprediction set of a translation of the scaling of (cid:96) slides freely inside the ∆2. spr((cid:96)log). The bullet points are located at the image of p ∈ 1.2. Description of results and structure of the article. Using the same setting as [vERW12], we obtain a geometric characterization of η-mixable loss functions in the sense of differential geometry. Loss functions are considered to be maps (cid:96) : ∆n ≥0, which under the conditions assumed in this work, give rise to submanifolds (cid:96)(relint(∆n)) of Rn whose geometric properties are determined by (cid:96) (see the relevant precise definitions below). We first discuss the case n = 2 (binary classification loss functions) since it is more instructive, and then the case n 2. We summarize the main results as follows. −→ Rn ≥ (1) We recast the notion of a (strictly) proper loss as a geometric property of the loss itself rather than its superprediction set. That is, proper- ness is no longer considered a parametrization dependent property, it is a statement about the geometric properties of the "loss surface" (cid:96)(relint(∆n)) (the boundary of the superprediction set). See lemmas 2.7 and 3.2. (2) A geometric comparison is performed. For n = 2 in terms of the curvature of the "loss curves" (see Section 1.5 below), and for n 2 in terms of the scalar second fundamental form of the "loss surfaces" (see Section 3 and Appendix A), which measure how they curve inside ≥ •llog•l•ηlspr(ηl+y)• 4 CABRERA PACHECO AND WILLIAMSON Rn. The precise statements are given in Lemma 2.13 and Lemma 3.6. Intuitively, these results tell us how the superprediction set of (cid:96) sits inside the superprediction set of the log loss. (3) Finally, we interpret our result from the point of view of convex analysis to give a new characterization of mixability. More precisely, We show that a (strictly) proper loss function (cid:96) is η-mixable if and only if the superprediction set of (cid:96) slides freely (see Definition 4.11) inside the superprediction set of the log loss. As byproducts, we obtain a general way to define mixability with respect to a fixed (strictly) proper loss function, further properties and consequences for binary classification loss functions, particularly for composite losses and canonical links, and a bridge to the results obtained in [vERW12]. Since we treat loss functions from the point of view of differential geometry and convex geometry, a considerable background in these topics is needed. We present this work as self-contained as possible and spend some time providing the intuition and motivation for the results (and sometimes the background) which naturally results in a longer exposition. In Section 2 we treat the binary case, in Section 3 the multi-class case to obtain the geometric interpretation of properness and mixability and perform the geometric comparison (in terms of curvature). In Section 4 we make the connections to convex geometry and obtain the geometric characterization of mixability in terms of the sliding freely conditions of superprediction sets. 1.3. Setup. Here we summarize our setup, for more details see [vERW12]. Denote by [n] the set of natural numbers . The set of probability = n distributions on a finite set with 1, ..., n { } N is given by ∈ n Y |Y| (1.1) ∆n = (p1, ..., pn) (cid:40) n R ∈ pi = 1 (cid:41) . − We note that ∆n is a manifold with (non-smooth) boundary of dimension 1. Moreover, ∆n is a hypersurface in Rn; we denote the interior (as n a manifold) of ∆n as int(∆n) which is the same set as the relative interior relint(∆n) of ∆n. We define the standard parametrization of ∆n as the map Φstd : ∆n−1 ∆n given by Rn−1 ⊂ −→ i=1 (cid:88) (cid:12) (cid:12) (cid:12) (cid:12) (1.2) Φstd(t1, ..., tn−1) = t1, ..., tn−1, 1 (cid:32) − ti . (cid:33) In particular, when n = 2 the standard parametrization of ∆2 is the map Φstd : [0, 1] ∆2 given by Φstd(t) = (t, 1 t). −→ − Definition 1.2. A loss function is a map (cid:96) : ∆n each k , k) : ∆n , the map (cid:96)( * R is continuous. ∈ Y −→ × Y −→ R≥0 such that for n−1 i=1 (cid:88) THE GEOMETRY OF MIXABILITY 5 Given a loss function (cid:96), p , the value (cid:96)(p, k) represents the ∈ penalty of predicting p upon observing k. We define the partial losses of a loss function (cid:96) as the maps (cid:96)i : ∆n R≥0 given by (cid:96)i(p) = (cid:96)(p, i). A loss function can be described in terms of its partial losses as ∈ Y −→ ∆n and k n (cid:96)(p, k) = [[k = i]](cid:96)i(p). Thus, we can identify a loss fuction (cid:96) with the map (cid:96) : ∆n i=1 (cid:88) mined by its partial losses Rn ≥0 deter- −→ (cid:96)(p) = ((cid:96)1(p), ..., (cid:96)n(p)) . In this work we follow this convention unless stated otherwise. Note that this way we can see a loss function (cid:96) as an embedding of int(∆n) into Rn ≥0 (assuming enough properties on (cid:96)). We will see later that properness ensures the image of this embedding to be a nice hypersurface of Rn with appealing geometric properties. Under the assumption that the outcomes are distributed with ∆n, we make the below definitions following [vERW12, RW10]. probability p Definition 1.3. Given a loss function (cid:96), we define the conditional risk as the map L : ∆n ∆n ∈ × −→ R as L(p, q) := (cid:96)(q), p (cid:105) (cid:104) , and the associated conditional Bayes risk as the map L : ∆n R given by −→ L(p) := inf q∈∆n L(p, q) = inf (cid:96)(q), p (cid:105) . q∈∆n(cid:104) Rn ≥0 is said to be proper if for any Definition 1.4. A loss function (cid:96) : ∆n p ∆n −→ ∈ for all q only minimum of L(p, ∈ (cid:96)(p), p (cid:104) ∆n. In other words, L(p, (cid:96)(q), p (cid:105) (cid:105) ≤ (cid:104) ) has a minimum at p. When p is the * ) we say that (cid:96) is strictly proper. * For our geometric considerations it will be useful to denote the image of ∆n under (cid:96) by M(cid:96), and impose enough differentiability conditions on (cid:96) so that M(cid:96) is (at least) a C 2-manifold. See Definitions 2.1 and 3.1 below. We now recall the definition of mixability (see for example, Vovk [Vov15, Rn be the η-exponential projection vERW12]). For η > 0, let Eη : Rn defined as −→ (1.3) Eη(y) := (e−ηy1, ..., e−ηyn). A loss function (cid:96) is called η-mixable if the image of its superprediction set, spr((cid:96)), given by (1.4) spr((cid:96)) := λ { ∈ [0, )n | ∞ there is q ∈ ∆n such that (cid:96)i(q) λi for i [n] , } ∈ ≤ 6 CABRERA PACHECO AND WILLIAMSON is convex under the η-exponential projection, that is Eη(spr((cid:96))) convex. We say that (cid:96) is mixable if (cid:96) is η-mixable for some η > 0. ⊂ [0, 1]n is Definition 1.5. Let (cid:96) be a mixable loss function. The mixability constant of (cid:96), η∗ (cid:96) , is defined as η∗ (cid:96) := sup η>0 { η > 0 (cid:96) is η-mixable } . | 1.4. Motivation. In this part we mainly discuss the case n = 2 since it is more illustrative. It has been made evident that there is a strong relation between properness and mixability. Here we make this relation more explicit and transparent from a geometric point of view. The basic motivation is as follows. It is commonly understood that properness is a property that depends on the parametrization of the boundary of the superprediction set of (cid:96) [Vov15]. It has been also shown that it is related to the "curvature" of the Bayes risk, since it requires that the superprediction set remains convex under the η- exponential projection given by (1.3) (with the standard parametrization of the simplex ∆2) [BSS05, RW10, vERW12]. Mixability is considered to be a stronger notion of convexity [Vov15], for some η > 0. The basic observation in this work is that it is possible recast properness from a geometric point of view, i.e., independent of the parametrization of ∆n. More precisely, we define properness in terms of the loss function viewed as a map (cid:96) : ∆n ≥0 rather than in terms of the superprediction set spr((cid:96)) (as it is usually defined). More precisely, to determine whether a given (cid:96) is proper or not, it is not enough to look at image (cid:96)(∆n) (as the boundary of spr((cid:96))) but rather how ∆n is mapped into Rn ≥0 by (cid:96) - since we will be using tools of differential geometry, we will assume C 2 differentiability (see Section 2). More precisely, restricting first to n = 2 (see Lemma 2.7 below), a given loss function (cid:96) : ∆2 ≥0 will be (strictly) proper if and only if −→ −→ Rn R2 (1) the normal vector to (cid:96)(∆n) at (cid:96)(p) is equal to and p p/ | | ± for all p ∈ int(∆2), (2) the curvature (see Section 1.5 below) at any point (cid:96)(p) with respect to int(∆2). is strictly positive for all p p the unit normal vector n = p/ | | ∈ As observed in Figure 2, spr((cid:96)1) = spr((cid:96)2), which implies that their bound- aries coincide (as a set). In particular, this implies that it is possible to "pa- rametrize" the boundary of (cid:96)2(∆2), ∂((cid:96)2(∆2)), in the same way as ∂((cid:96)1(∆2)) in order to have a proper loss. However, note that this changes the map (cid:96)2 and hence from the point of view of this work, this is a different loss function. In practice, one is given a loss function (cid:96) rather than a superprediction set spr((cid:96)), THE GEOMETRY OF MIXABILITY 7 Figure 2. Consider the two loss functions given by (cid:96)1(p1, p2) = log(p2)) and (cid:96)2(p1, p2) = ( ( log(p1)), for log(p1), − − ∆2. Although spr((cid:96)1) = spr((cid:96)2), (cid:96)2 is not proper p = (p1, p2) since the normal vector at (cid:96)2(p) is not for any p log(p2), − ∈ ∆2. − p p/ | | ± ∈ therefore we look at losses as individual maps from ∆2 to R2 ≥0 instead of look- ing at their superpredictions sets and obtaining a proper loss by choosing a convenient parametrization of ∂(spr((cid:96))). Remark 1.6. Our strength by characterizing proper loss functions in this way is that we will be able to apply techniques from differential geometry, however, these considerations only work for loss functions which are sufficiently differ- entiable. For a general set up, it is possible to characterize properness of a loss function in a fairly simple way via the convexity of its superprediction set. More precisely, the "loss surface" is the subgradient of the support function of the superprediction set. This was thoroughly studied by Williamson and Cranko in [WC22]. We briefly explore some connections to our work in Section 4. Al- ternative approaches to extending and better understanding mixability include [RFWM15] and [MW18]. 1.5. Comments about the curvature of planar curves. The second con- dition for (cid:96) to be proper mentioned above involves a condition on the curva- ture of (cid:96)(int(∆2)). We now make this notion precise. Recall that if α(t) = ∆2••••l1l2 8 CABRERA PACHECO AND WILLIAMSON Figure 3. For a regular curve α, at each point we have two normal unit vectors. (x1(t), x2(t)) is a C 2 curve with α(cid:48)(t) = (x(cid:48) = (0, 0) for all t in its domain, then its curvature can be seen a measurement of the variation of its unit normal vector at each point. We define the canonical normal vector at α(t), nc(t), as the unit normal vector in the direction obtained by rotating α(cid:48)(t) 90◦ counterclockwise. Then, the signed curvature of κ at t is defined as 1(t), x(cid:48) 2(t)) . ± 2(t) (1.5) κα(t) := 1(t)x(cid:48) x(cid:48)(cid:48) (x(cid:48) x(cid:48) 1(t)x(cid:48)(cid:48) 2(t) − 2(t)2)3/2 1(t)2 + x(cid:48) The interpretation of this number is as follows: κα(t) is positive if α "curves" in the direction of nc(t). However, note that at each point we have two normal nc(t). Thus, nc(t) and κα depend on the direction of α (i.e., α(cid:48)), and vectors: their values differ by a negative sign. Thus, we can talk about the curvature of α with respect to a chosen unit vector n (either choosing nc or nc for all points, assuming this is possible, which is the case for the curves we will α . In the case when n = nc, consider here, see Figure 3) and denote it by κ+ nc, then κ+ then κ+ κα. Since κα is invariant α = under reparametrizations (up to a sign), we can simply talk at the curvature of α at a given point p in the image of α. In Section 2 we make precise our choice in (2) above. For a summary of geometry of curves see Appendix A. α = κα, and when n = − − − Going back to loss functions, suppose (cid:96) : ∆2 ≥0 is a loss function. Since ∆2 is a 1-manifold, any parametrization around a point (of its interior) ∆2 for some a < b. Thus, can be assumed to be of the form Φ : (a, b) Φ is a curve in the local expression of (cid:96) under this parametrization R2. By changing Φ around the same point, we are reparametrizing (cid:96). Since curvature is independent of coordinates (i.e., of the Φ used) up to a sign, we can define the curvature of the loss curve (cid:96)(int(∆2)) with respect to a chosen (cid:96) = (cid:96) −→ −→ R2 ⊂ R (cid:101) ◦ (cid:101) •−ncncα′•nc−ncα′(cid:54) THE GEOMETRY OF MIXABILITY 9 unit normal vector (which will depend only on (cid:96)). To compute it from its definition in (1.5), we need to choose a parametrization Φ, and as we will see, many times it is convenient to take Φ = Φstd. Remark 1.7. One could avoid part of the technical complications above by choosing beforehand Φ = Φstd, as it is usually implicitly done, and then requir- ing (cid:96)1 and (cid:96)2 to be monotone (cf. [BSS05, RW10, SAM66, Vov15]) – essentially, this amounts to choosing "direction" for the admissible loss curves. Although this approach is appealing since the curve parameter (t in our case) can be directly interpreted as a probability, and moreover it simplifies calculations since in this case the convention can be chosen so that the signed curvature coincide with κ+ (see for example [Vov15]), when considering the multi-class case, the notion of "direction" breaks down and it is not clear which properties of M(cid:96) = (cid:96)(∆n) one should consider. The approach we consider here gives a concrete logical path to a generalization to the multi-class case (see Section 3). 1.6. Reconciling this point of view with previous works. In this part we explain how to "translate" the results we obtain here to previous results regarding proper losses and mixability. We do this in particular with [RW10] and [Vov15]. • • (cid:98) (cid:101) (cid:98) η) and (cid:96)−1( η in [RW10] η) correspond to (cid:96)2(t), respectively. Although the regularity assumption in [RW10] (cid:98) Reid–Williamson [RW10]. Let Φ = Φstd. The parameter corresponds to the parameter t here, (cid:96)1( (cid:96)1(t) and is initially only differentiability of the partial losses, when discussing the weight of a loss function they impose C 2 regularity. From Theo- (cid:101) rem 1 in [RW10], we see that a loss (cid:96) is proper if (in particular) (cid:96)(cid:48) −1 > 0 and (cid:96)(cid:48) 0 < 0. We can heuristically say that (cid:96) goes from "right" to "left". This means that in this case, κ+ (cid:96) ( η). The log loss in this case η), is (cid:96)log( η)). ln( − In [Vov15] the loss functions are defined as maps Vovk [Vov15]. (cid:98) (λ0(p), λ1(p)), with λ0 increasing and λ1 decreasing (infinite differ- entiable). In this case, heuristically, losses go from "left" to "right" so that κ+ λ (p) = κλ(p). To relate this convention to ours, we set t, t). Then the parameter p in [Vov15] corresponds to Φ(t) = (1 t and λ0 and λ1 correspond to (cid:96)2. The log loss is then given by ln(p)). λ(p) = ( (cid:96)1 and η) = ( η) = ln(1 ln(1 κ(cid:96)( p), − − − − (cid:98) (cid:98) (cid:98) (cid:98) − − − (cid:101) Therefore, from our point of view, in previous works there is an implicit choice of a parametrization of ∆2, particularly motivated to interpret the pa- rameter as a probability. However, it is well known that sometimes this might not be the case and a link function is needed [RW10] – this fits well with our approach as a link function for us is a different choice of parametrization; this will carefully explained in Section 2.7. In favor of the study of loss functions (cid:101) 10 CABRERA PACHECO AND WILLIAMSON using tools from differential geometry we are then motivated to eliminate this choice of parametrization and consider (cid:96) as a map between manifolds (namely, int(∆2) and (cid:96)(int(∆2)) as a submanifold of R2). Although picking a gen- eral parametrization of ∆2 complicates the interpretation of the parameter, it makes other properties of loss functions transparent. This approach has, to the knowledge of the authors, never been explored. We remark that, however, one can always set Φ = Φstd and reinterpret the results of this work as the parameter being a probability. With this geometric characterization of loss functions and properness at hand we continue to study mixability. 2. Properness and Mixability for Binary Classification | ∈ − ⊂ R2 R2 (p1, p2) { ≥0, where ∆2 = Φ) is a map from some interval I We first restrict our discussion to binary classification, i.e., setting n = 2. Thus, we consider maps (cid:96) : ∆2 p1 + p2 = −→ , with partial losses (cid:96)1(p) and (cid:96)2(p). In this case the standard parametriza- 1 } tion of ∆2 is given by Φstd(t) = (t, 1 [0, 1]. When a parametrization t) for t ∈ of ∆2, say Φ, is chosen, then the local expression of (cid:96) with respect to Φ R to R2, that is, a curve in the ( (cid:96) = (cid:96) ◦ plane R2. Dating back to [HKW95, Vov98] it has been established that properness of (cid:101) a loss function imposes strong conditions on the first and second derivatives of their partial losses. In [Vov15] these relations were expressed by means of the curvature of the loss curve. Moreover, in [BSS05, RW10] properness is related to the second derivative of its Bayes risk, which in a way can be interpreted as its curvature. However, in these works there is always an implicit choice of parametrization of ∆2, which in turn imposes certain restrictions on the "admissible" loss functions, particularly making the results parametrization dependent. In this section, we first recast properness as a geometric prop- erty which allows us to obtain results in a parametrization (or coordinate) independent way. Definition 2.1. An admissible loss function is a map (cid:96) : ∆2 that −→ R2 ≥0 such (i) (cid:96)(int(∆2)) ≥0 is a 1-manifold of class C 2, (ii) there exists a differentiable map n : (cid:96)(int(∆2)) R2 ⊂ n(cid:96)(p), where N (cid:96)(∆2) is the normal space of (cid:96)(∆2), and n(p) belongs to R2 (iii) n(p) or We denote the set of admissible loss functions as >0 for all p − ∈ → int(∆2). . L N (cid:96)(int(∆2)), n((cid:96)(p)) = Remark 2.2. We give the following interpretation of the previous definition. (i) simply says that the loss curve (once parametrized) is twice differentiable (ii) prevents some "anomalies" with continuous second partial derivatives. on (cid:96), for example, (cid:96) can not be constant on a neighborhood of a point. (iii) THE GEOMETRY OF MIXABILITY 11 defines a subfamily of loss curves which are not allowed to vary "too much". This definition should be compared to the definition of loss functions in Section 2 in [Vov15]. ∈ L . Let n : (cid:96)(int(∆2)) N (cid:96)(int(∆2)) be the map Definition 2.3. Let (cid:96) that assigns to each (cid:96)(p) the normal vector to M(cid:96) at (cid:96)(p) that lies in R2 ≥0. We denote by κ+ ) the signed curvature of α with respect to the unit normal α ( * ≥0. We refer to κ+ belonging to R2 ) as the curvature with respect to the unit α ( * normal vector pointing towards R2 ≥0. 2.1. Proper losses. → L Lemma 2.4. Suppose that (cid:96) in is strictly proper, then the signed curvature of the loss curve (cid:96)(∆2) has a sign. Moreover, its curvature, κ(cid:96), is positive with respect to unit normal vector (field) pointing towards R2 Proof. Let p0 ∈ around p0 = Φ(t0), for some t0 of ∆2 ∆2 be a parametrization of ∆2 I, which we use to obtain a parametrization ∆2 around (p0, p0)1. We consider the local expression of L given by int(∆2) and let Φ : I −→ ≥0. ⊂ R ∈ × L(t, s) = . (cid:96)(Φ(s)), Φ(t) (cid:105) (cid:104) Using strict properness we know that fixing t, the function minimum at s = t (and it is the only one), that is (cid:101) L(t, ) achieves a * (2.2) (2.1) 0 = ∂s (cid:96)(cid:48)(t), Φ(t) s=t = L(t, s) | (cid:104) s=t = L(t, s) 0 < ∂ss (cid:101) | (cid:105) (cid:96)(cid:48)(cid:48)(t), Φ(t) (cid:101) (cid:105) (cid:104) To compute the sign of the signed curvature of (cid:96)(∆2) it is enough to deter- (cid:96)(cid:48) 2(t). Without loss of generality, assuming (cid:101) (cid:96)(cid:48) (cid:96)(cid:48) 1(t)Φ1(t) + 2(t)Φ2(t), (cid:96)(cid:48)(cid:48) (cid:96)(cid:48)(cid:48) 2(t)Φ2(t). 1(t)Φ1(t) + = (cid:101) (cid:101) (cid:101) (cid:96)(cid:48) 1(t) (cid:101) (cid:96)(cid:48)(cid:48) 1(t) (cid:96)(cid:48)(cid:48) 2(t) = (cid:101) (cid:101) − = 0 on this coordinate neighborhood we can write mine the sign of Φ2 (cid:101) (cid:96)(cid:48)(cid:48) 2(t) (cid:96)(cid:48) 1(t) (cid:101) (cid:96)(cid:48)(cid:48) 1(t) (cid:101) (cid:101) (cid:96)(cid:48) (cid:96)(cid:48) 2(t) = 1(t) − (cid:101) (cid:101) (cid:101) (cid:101) = = (cid:96)(cid:48)(cid:48) 2(t) (cid:96)(cid:48)(cid:48) 1(t) − (cid:34)− (cid:101) (cid:96)(cid:48)(cid:48) 2(t)Φ2(t) + (cid:101) (cid:96)(cid:48)(cid:48)(t), Φ(t) (cid:105) (cid:104) (cid:101) (cid:101) (cid:96)(cid:48) 1(t) Φ2(t) (cid:101) (cid:96)(cid:48) 1(t) Φ2(t) (cid:101) (cid:104) (cid:96)(cid:48) 1(t)Φ1(t) Φ2(t) (cid:35) (cid:101) (cid:96)(cid:48)(cid:48) 1(t)Φ1(t) (cid:105) (cid:101) > 0, (cid:104) (cid:105) (cid:96)(cid:48) 1(t) = 0 for some t then where we have used (2.1) and (2.2). Notice that if (cid:96)(cid:48) (cid:96)(cid:48) necessarily 1 has a 2(t) = 0 by (2.1), which is impossible in sign and this sign determines the sign of the signed curvature of (cid:96)(∆2). (cid:101) (cid:101) 1Notice that this particular choice of coordinates around (p0, p0) suffices since we want to conclude something about the curvature of the curve loss (cid:96). . Therefore L (cid:101) (cid:101) (cid:54) 12 CABRERA PACHECO AND WILLIAMSON (cid:96)(cid:48) 1 and For the second statement, notice that again using (2.1) we know that (cid:96)(cid:48) (cid:96)(cid:48) 1 > 0, then that means 2 have different signs (and they do not change). If that the first coordinate increases and the second decreases, hence n(t) points towards R2 (cid:96)(cid:48) 1 < 0, then we are in the opposite case and in this (cid:101) (cid:101) case n(t) points to R2 (cid:101)(cid:96) < 0, thus the signed curvature with respect to ≥0 and κ (cid:3) (cid:101) n(t) (the unit normal pointing towards R2 From the proof of the previous theorem we obtain the following corollary. ≥0) is positive. (cid:101)(cid:96) > 0. If ≥0 and κ − (cid:101) Corollary 2.5. Let (cid:96) loss curve (cid:96)(∆2) at (cid:96)(p). ∈ L . If (cid:96) is proper, then p int(∆2) is normal to the ∈ Proof. It follows directly from (2.1), since for fixed p a minimum at p. ∈ int(∆2), (cid:96)(q), p (cid:105) (cid:104) attains (cid:3) Lemma 2.6. In , proper implies strictly proper. L Proof. Let p ∈ int(∆2), and suppose that there is p∗ = p in int(∆2), such that (cid:96)(p∗), p (cid:105) (cid:104) = inf q∈∆2(cid:104) (cid:96)(q), p (cid:105) . Using (2.1), we see that p∗ is normal to (cid:96) at (cid:96)(p), and hence p and p∗ are parallel. Since both belong to ∆2, it follows that p∗ = p, which is a contradiction. (cid:3) Therefore, in what follows (as long as we stay within and strictly proper interchangeably. ) we will use proper L Note that the converse of Lemma 2.4 does not hold. That is, there are (cid:96) ∈ L which have positive signed curvature (with respect to the unit normal pointing towards R2 ≥0), but are not proper. Indeed let (cid:96) be defined as ln(p2), (cid:96)(p) = ( ln(p1)). Taking the (standard) parametrization Φstd(t) = (t, 1 (cid:96) goes from left to right so n curve readily see that the (signed) curvature κ normal to − (cid:101)(cid:96)(t) points towards R2 t) we see that the loss ≥0. Moreover, we can (cid:101)(cid:96) is positive. However, Φstd(t) is not (cid:96)(t), thus by Corollary 2.5, (cid:96) can not be proper. (cid:96) at − − (cid:101) Therefore, we obtain the following characterization of proper losses in (cid:101) (cid:101) Lemma 2.7. Let (cid:96) loss curve (cid:96)(∆2) at (cid:96)(p) for all p with respect to the normal vector pointing towards R2 (cid:96)(p) for p . (cid:96) is strictly proper if and only if p is normal to the int(∆2) and the signed curvature of (cid:96)(∆2) ≥0 is positive at all points int(∆2). ∈ L ∈ . L ∈ Proof. The "if" part is Lemma 2.4. For the "only if" part, let (cid:96) that be such ∈ L (2.3) np = ± p p | , | (cid:54) THE GEOMETRY OF MIXABILITY 13 (2.4) κ+ (cid:96) > 0, where κ+ (cid:96) towards R2 readily see that (2.3) implies that is the signed curvature of (cid:96) with respect to the unit normal pointing int(∆2) and let Φ be a parametrization around p. We ≥0. Let p ∈ ∂s s=t = 0, L(t, s) | while (2.4) implies ∂ss that fixing t, Lemma 2.6, we conclude it is strictly proper. (cid:101) s=t > 0 by the proof of Lemma 2.4. This implies | L achieves its minimum at s = t. Then (cid:96) is proper and by (cid:3) L(t, s) (cid:101) (cid:101) Remark 2.8. Notice that to check whether a given loss function (cid:96) is proper or not, it suffices to do it in any coordinate system. That is, given Φ, we check conditions (2.3) and (2.4) for (cid:96) = (cid:96) ∈ L Φ. ◦ 2.2. Mixable loss functions. We say that a loss function (cid:96) is fair if (cid:96)1(p) as p tation when using the standard parametrization, see [RW10]). recall that a loss function (cid:96) 0 (1, 0) (this is motivated by the interpre- In addition, is proper if and only if (0, 1) and (cid:96)2(p) 0 as p → → → → (cid:101) |p| can be chosen, and ∈ L (i) n(cid:96)(p) = p (ii) κ+ (cid:96) (p) > 0 for all p int(∆2). ∈ Thus, a prototype of a fair proper loss function is shown in Figure 4. Figure 4. Prototype of a mixable fair proper loss function. ))n()∆2••lΦ(a,b)⊂Rel=l◦Φ 14 CABRERA PACHECO AND WILLIAMSON Figure 5. Diagram depicting how convexity of Eη(spr((cid:96))) is characterized by the principal curvatures of Eη (cid:96)(int(∆2)). ◦ Recall from Section 1 that mixability is defined in terms of the superpredic- tion set spr((cid:96)) of (cid:96). More precisely, for η > 0, consider the set Eη(y1, y2) = e−ηy1, e−ηy2 , where Eη : R2 mixable if and only if Eη(spr((cid:96))) is convex. ≥0 −→ (cid:0) [0, 1]2 is the exponential projection (1.3). Then, (cid:96) is η- (cid:1) Remark 2.9. We stress the fact that this definition depends on the superpre- diction set of (cid:96) rather than on (cid:96) itself – two different loss functions with the same superprediction set will be equally mixable. From our perspective, when talking about mixability of the map (cid:96) (i.e., without making reference to the su- perprediction set), we see that we can define it as follows. A loss (cid:96) is mixable 0. if the 1-dimensional manifold Eη We will adopt the latter version here. Although clearly these definitions are equivalent, it is useful to have this at hand to relate mixability with properness. For now on, when we say (cid:96) is mixable we mean in the latter way. See Figure 5. (cid:96)(int(∆2)) has signed curvature κ+ Eη◦(cid:96) ≤ ◦ Sln∆2••lΦ(a,b)⊂RelEηEη(Sl)(0,1)(0,0)(1,0) THE GEOMETRY OF MIXABILITY 15 We close this part by describing the log loss, which will play an important role. Let (cid:96)log : ∆2 (2.5) −→ Let Φ = Φstd. Then R2, given by (cid:96)log(p) = ( − ln(p1), − ln(p2)) . Since (cid:96)(cid:48) log(t) = ( (cid:101) − t−1, (1 (cid:101) − (cid:101)(cid:96)log(t) = n (cid:96)log(t) = ( ln(t), ln(1 t)) . − − − t)−1), its canonical normal vector is 1 t2 + (1 − (1 − t)2 t)−1, t−1 . The curvature with respect to (cid:112) R2 ≥0, is then given by n − − (cid:0) (cid:101)(cid:96)log(t), the normal vector pointing towards (cid:1) (2.6) κ+ (cid:101)(cid:96)log = κ (cid:101)(cid:96)log = − t(1 (t2 + (1 t) t)2)3/2 > 0. − − When there is no risk of confusion with denote κ+ (cid:101)(cid:96)log simply as κ+ log. 2.3. Mixability and curvature. Haussler, Kivinen and Warmuth in [HKW95] gave a characterization of the mixability constant of a mixable proper binary loss function (cid:96) in terms of the first and second derivatives of its partial losses. We reprove this characterization from a geometric point of view, that is, inde- pendent of the parametrization chosen for ∆n. ∈ L Let (cid:96) be proper and Φ a 1-chart parametrization2 of ∆2, then Eη(spr((cid:96))) will be convex if and only if the curve γ(t) = E((cid:96)(Φ(t))) has negative curvature with respect to the unit normal pointing towards R2 ≥0. Since (cid:96) is proper we can assume without loss of generality that κ(cid:96)(p) = κ+ (cid:96) (p) > 0. We are then interested in computing the signed curvature of g(t) = (g1(t), g2(t)) = E( (cid:96)1(t)), E( (cid:96)2(t)) = e−η(cid:101)(cid:96)1(t), e−η(cid:101)(cid:96)2(t) , and showing that κg (cid:16) 0. We have (cid:101) (cid:17) (cid:16) (cid:101) (cid:17) ≥ g(cid:48) 1(t) = g(cid:48)(cid:48) 1 (t) = η − 1(t)e−η(cid:101)(cid:96)1(t) (cid:96)(cid:48) 1(t)e−η(cid:101)(cid:96)1(t) + η2 (cid:96)(cid:48)(cid:48) (cid:101) 1(t)2 (cid:96)(cid:48) = ηe−η(cid:101)(cid:96)1(t) (cid:101) − η η − 1(t)2e−η(cid:101)(cid:96)1(t) (cid:96)(cid:48) (cid:96)(cid:48)(cid:48) 1(t) (cid:101) (cid:105) (cid:101) and (cid:104) η − 2This means that the map Φ : D g(cid:48) 2(t) = (cid:101) 2(t)e−η(cid:101)(cid:96)2(t) (cid:96)(cid:48) ∆2 is such that Φ(D) = ∆2. (cid:101) −→ 16 CABRERA PACHECO AND WILLIAMSON g(cid:48)(cid:48) 2 (t) = η − 2(t)e−η(cid:101)(cid:96)2(t) + η2 (cid:96)(cid:48)(cid:48) 2(t)2 (cid:96)(cid:48) η 2(t)2e−η(cid:101)(cid:96)2(t) (cid:96)(cid:48) (cid:96)(cid:48)(cid:48) 2(t) (cid:101) , = ηe−η(cid:101)(cid:96)2(t) (cid:101) − (cid:104) (cid:101) (cid:105) (cid:101) and thus we have 3/2 κg(t) 2(t)2 1(t)2 + g(cid:48) g(cid:48) 1(t)e−η(cid:101)(cid:96)1(t)ηe−η(cid:101)(cid:96)2(t) (cid:96)(cid:48) = η (cid:1) (cid:0) − ηe−η(cid:101)(cid:96)1(t) (cid:101) − =η2e−η(cid:101)(cid:96)1(t)e−η(cid:101)(cid:96)2(t) η 2(t)2 (cid:96)(cid:48) − (cid:96)(cid:48) 2(t) (cid:105) 2(t)e−η(cid:101)(cid:96)0(t) (cid:96)(cid:48) η (cid:101) − (cid:105) (cid:16) 2(t)2 + (cid:96)(cid:48) (cid:96)(cid:48) 1(t)η (cid:101) (cid:104) − (cid:96)(cid:48)(cid:48) 2(t) η 1(t)2 (cid:96)(cid:48) (cid:96)(cid:48)(cid:48) 1(t) (cid:101) (cid:104) (cid:104) (cid:96)(cid:48) 1(t) (cid:101) (cid:101) − (cid:96)(cid:48) (cid:96)(cid:48) (cid:96)(cid:48) 1(t) 1(t)( 2(t) η (cid:101) (cid:101) (cid:101) (cid:17) 1(t)2 (cid:96)(cid:48) (cid:96)(cid:48) 2(t)η − (cid:96)(cid:48) 2(t) (cid:96)(cid:48)(cid:48) 1(t) (cid:105) (cid:96)(cid:48)(cid:48) (cid:96)(cid:48) 2(t) 1(t) (cid:101) =η2e−η(cid:101)(cid:96)1(t)e−η(cid:101)(cid:96)2(t) (cid:96)(cid:48) 2(t)) + (cid:101) (cid:101) − (cid:105)(cid:105) (cid:104) (cid:104) (cid:96)(cid:48)(cid:48) (cid:96)(cid:48) (cid:96)(cid:48)(cid:48) (cid:96)(cid:48) (cid:101)(cid:96) is positive, 1(t) is the sign of κ 2(t) 2(t) 1(t) Note that the sign of (cid:101) (cid:101) (cid:101) (cid:101) (cid:101) (cid:96)(cid:48) (cid:96)(cid:48) 2(t) < 0, thus the first term in brackets 1(t) > 0 and then one can check that (cid:101) (cid:101) (cid:101) is necessarily negative. Thus by making η large κg(t) will become negative. Then we want (cid:101) (cid:101) (cid:96)(cid:48) 1(t) − (cid:101)(cid:96). If κ (cid:101) (cid:96)(cid:48) 2(t)) + (cid:96)(cid:48) 1(t)( (cid:96)(cid:48)(cid:48) 1(t) (cid:101) (cid:96)(cid:48) 2(t) (cid:101) (cid:96)(cid:48)(cid:48) 2(t) (cid:96)(cid:48) 1(t) (cid:96)(cid:48) 2(t) (cid:96)(cid:48) 2(t) (cid:101) − 0, (cid:101) (cid:101) η . that is, (cid:101) (cid:101) (cid:101) η ≤ − (cid:96)(cid:48)(cid:48) 1(t) (cid:105) ≥ − (cid:104) (cid:101) (cid:101) (cid:101) (cid:101) (cid:101) (cid:96)(cid:48) (cid:96)(cid:48) (cid:96)(cid:48)(cid:48) 1(t) 2(t) 2(t) − (cid:96)(cid:48) (cid:96)(cid:48) (cid:96)(cid:48) 1(t) 1(t))( 2(t) (cid:101) (cid:101) (cid:101) − (cid:101) ( − (cid:96)(cid:48)(cid:48) 1(t) (cid:96)(cid:48) 2(t)) . When considering the case when the signed curvature is negative, we have: (cid:101) is a proper loss function. Then, if (cid:96) is Lemma 2.10. Suppose that (cid:96) mixable, for any 1-chart parametrization Φ of ∆2, the mixability constant is given by (cid:101) ∈ L (cid:101) (cid:101) η∗ (cid:96) = (cid:96)(cid:48) (cid:96)(cid:48)(cid:48) 1(t) 2(t) (cid:96)(cid:48) (cid:96)(cid:48) 2(t)( 1(t) (cid:101) (cid:101) (cid:96)(cid:48) 2(t) − (cid:96)(cid:48) 1(t) (cid:101) − (2.7) inf t∈Φ−1(int(∆2)) (cid:12) (cid:12) (cid:12) Conversely, if (2.7) holds, then (cid:96) is mixable with mixability constant η∗ (cid:96) . (cid:12) (cid:101) (cid:12) (cid:101) By the local nature of curvature, it would be possible to consider a "local version" of Lemma 2.10, which would characterize a "local" notion of mixa- bility. This alternative will not be pursued here. (cid:101) . (cid:96)(cid:48)(cid:48) 1(t) (cid:96)(cid:48) 2(t))(cid:12) (cid:12) (cid:101) (cid:12) (cid:12) (cid:12) (cid:101) In [Vov15], Vovk observes that mixability for proper losses is equivalent to a quotient of curvatures being bounded away from zero. For the reader's convenience we prove this statement. To recover Vovk's statement observe that the properties he imposes on the loss functions imply that κ+ is the signed curvature (see Section 1.6). THE GEOMETRY OF MIXABILITY 17 Lemma 2.11. A proper loss function (cid:96) is mixable if and only if ∈ L > 0, inf p κ+ (cid:96) (p) κ+ log(p) where κ+ log denotes the curvature of (cid:96)log. Moreover, when this holds, η∗ (cid:96) = inf p κ+ (cid:96) (p) κ+ log(p) > 0, Proof. By Lemma 2.10, (cid:96) is proper with mixability constant η∗ if (cid:96) > 0 if and only η∗ (cid:96) = (cid:96)(cid:48)(cid:48) (cid:96)(cid:48) 2(t) 1(t) (cid:96)(cid:48) (cid:96)(cid:48) 1(t)( 2(t) (cid:101) (cid:101) for any given 1-chart parametrization Φ. Setting Φ = Φstd and using (2.6), we (cid:101) Φ−1(int(∆2)), have the following. For any t inf t∈Φ−1(int(∆2)) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:96)(cid:48)(cid:48) 1(t) (cid:96)(cid:48) 2(t))(cid:12) (cid:12) (cid:101) (cid:12) (cid:12) (cid:12) (cid:96)(cid:48) 2(t) − (cid:96)(cid:48) 1(t) (cid:101) − (cid:101) (cid:101) (cid:101) , ∈ 1(t)2 + (cid:96)(cid:48) 2(t)2 (cid:96)(cid:48) 3/2 1 (1−t)2 + 1 t2 1 t2 1 (1−t)2 3/2 (cid:17) 1 1 t2 (1−t)2 (cid:96)(cid:48) 1(t) (cid:96)(cid:48) 2(t) | (cid:96)(cid:48) 1(t)( (cid:96)(cid:48) 2(t)) | − (cid:17) 3/2 (cid:16) (cid:17) 1 1 t2 (1−t)2 (cid:96)(cid:48) 1(t) (cid:96)(cid:48) 1(t)( (cid:101) (cid:101) (cid:101) (cid:101) (cid:96)(cid:48) 2(t)) | − (cid:96)(cid:48)(cid:48) (cid:96)(cid:48) 1(t) 2(t) (cid:96)(cid:48) (cid:96)(cid:48) 1(t)( 2(t) (cid:101) (cid:101) (cid:96)(cid:48)(cid:48) (cid:96)(cid:48) 2(t) 1(t) (cid:101) (cid:101) (cid:96)(cid:48) 2(t) − (cid:96)(cid:48) 1(t) (cid:101) (cid:96)(cid:48) 2(t) − (cid:101) − (cid:96)(cid:48) (cid:96)(cid:48) 2(t)2 1(t)2 + (cid:101) (cid:101) (cid:96)(cid:48)(cid:48) 1(t) (cid:96)(cid:48) 2(t))(cid:12) (cid:12) (cid:101) (cid:12) (cid:12) (cid:96)(cid:48)(cid:48) 1(t) (cid:101) (cid:12) 3/2 (cid:12) (cid:16) (cid:12) (cid:12) (cid:101) (cid:12) (cid:12) (cid:17) (cid:12) 2(t)2 (cid:96)(cid:48) (cid:12) t2 (cid:33) (t) (cid:101) (t) (cid:32) 1(t)2 + (cid:96)(cid:48) (cid:101) (1−t)2 + 1 1 (cid:101) 1(t)2 (cid:96)(cid:48) (cid:101) 1 + t2 (1−t)2 (t) (t)  (cid:101) t2+(1−t)2 (cid:16) t2(1−t)2  , (t) (t) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) = (cid:12) (cid:12) (cid:12) (cid:101) (cid:12) (cid:12) (cid:16) κ+ (cid:12) (cid:12) (cid:101)(cid:96) κ+ (cid:101)(cid:96)log = = = κ+ (cid:101)(cid:96) κ+ (cid:101)(cid:96)log κ+ (cid:101)(cid:96) κ+ (cid:101)(cid:96)log 1 (1−t)2 + 1 t2 (cid:101) (cid:101) (cid:16) 3/2 (cid:96)(cid:48) 2(t) | 3/2 (cid:101) (cid:101) (cid:17)   t 1−t | 1 t2 1 (cid:101) (cid:101) (1−t)2 1(t)3(1 + t (cid:96)(cid:48) 1−t) | (cid:101) where we used that by properness (cid:96)(cid:48) 2(t) = t 1−t (cid:96)(cid:48) 1(t) (see (2.1)). − Since κ+ is independent of the parametrization, we obtain the result. (cid:3) (cid:101) (cid:101) Remark 2.12. Lemma 2.11 exemplifies the usefulness of Φstd. The curvature of (cid:96)log is easily computed with respect to the standard parametrization, by fixing Φ = Φstd we can easily recognize when the curvature of (cid:96)log appears in our computation. However, since curvature is a geometric quantity we know this relation between curvatures will hold for any parametrization too. 18 CABRERA PACHECO AND WILLIAMSON Using this point of view, the following observations enlighten why the weight function in [BSS05] and in [RW10] basically encodes all the relevant informa- tion in the binary case. Recall that given a proper loss function (cid:96), the weight of (cid:96) (with respect to a local parametrization Φ of ∆2) is defined as (2.8) w(cid:96)Φ(t) = (cid:96)(cid:48) 1(t) Φ2(t)(cid:12) (cid:12) (cid:101) (cid:12) We stress that the weight depends on the coordinates Φ of ∆ that we use, and (cid:12) (cid:12) hence we use the notation (cid:96)Φ. As observed in Remark 2.12, we sometimes set Φ = Φstd (as it is done in [BSS05, RW10]) to be able to recognize some terms. (cid:96)(cid:48) 2(t) Φ1(t)(cid:12) (cid:12) (cid:101) (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) = . be a proper loss and Φ a local parametrization of ∆2, (cid:96)Φ its local expression and by w(cid:96)Φ be its weight. Then we have for ∈ L Lemma 2.13. Let (cid:96) denote by any t Φ−1(int(∆2)), ∈ (cid:101) k+ (cid:101)(cid:96)Φ (t) = 1 w(cid:96)Φ(t) | Φ(cid:48) 1(t) | 1 Φ1(t)2 + Φ2(t)2 3/2 (cid:19) (cid:18) and moreover, if λ is another proper loss, (2.9) κ+ (cid:101)(cid:96)Φ κ+ (cid:101)λΦ (t) (t) = wλΦ(t) (t) w (cid:101)(cid:96)Φ . In particular, when Φ = Φstd, k+ (cid:101)(cid:96)std (t) = 1 w(cid:96)std(t) (t) (2.10) and if in addition, λ = (cid:96)log (with Φ = Φstd), k+ (cid:101)(cid:96)std κ+ (cid:101)(cid:96)log R2 Proof. Let (cid:96) : ∆2 of ∆2 around p. Let us compute κ+ (cid:101)(cid:96)Φ 1 w(cid:96)std(t) −→ t(1 (t) − = 1 1 t2 + (1 3/2 . t)2 (cid:19) − (cid:18) = t) w(cid:96)log(t) w(cid:96)std(t) . ≥2 be a proper loss and let Φ be any parametrization (assuming w.l.o.g. that κ+ , which (cid:101)(cid:96)Φ = κ (cid:101)(cid:96)Φ means (cid:96)(cid:48) 1 > 0 and Φ(cid:48) (cid:96)(cid:48) (cid:96)(cid:48)(cid:48) 1(t) 2(t) 1 < 0). (cid:96)(cid:48)(cid:48) 1(t) − (cid:96)(cid:48) (cid:96)(cid:48) 1(t)2 2(t)2 + (cid:101) (cid:101) κ+ (cid:101)(cid:96)Φ (t) = (cid:101) (cid:96)(cid:48) 2(t) 3/2 = = (cid:101) (cid:16) (cid:101) (cid:96)(cid:48) 1(t) (cid:101) (cid:96)(cid:48)(cid:48) 2(t) + (cid:18) (cid:96)(cid:48) 1(t) (cid:101) Φ2(t) (cid:101) 1 (cid:101) (cid:96)(cid:48) 1(t)3 (cid:16) (cid:101) (cid:101) (cid:17) (cid:96)(cid:48)(cid:48) 1(t) (cid:96)(cid:48) 1(t) Φ1(t) Φ2(t) Φ1(t)2 Φ2(t)2 (cid:101) (cid:101) (cid:96)(cid:48)(cid:48) 1(t) + Φ2(t) Φ1(t) (cid:19) (cid:18) (cid:96)(cid:48)(cid:48) 2(t) −3/2 1(t)2 + (cid:96)(cid:48) 1(t)2 (cid:96)(cid:48) Φ1(t)2 (cid:101) (cid:101) Φ2(t)2 + 1 (cid:17) (cid:18) (cid:19) −3/2 (cid:19) (cid:101) (cid:101) THE GEOMETRY OF MIXABILITY 19 Φ(cid:48) 1(t) 1(t) + Φ(cid:48) (cid:96)(cid:48) 2(t) (cid:96)(cid:48) 2(t) (cid:101) (cid:96)(cid:48) 1(t) 1(t) Φ(cid:48) Φ(cid:48) (cid:101) Φ1(t) 2(t) Φ2(t) − Φ(cid:48) 1(t) (cid:101) − Φ(cid:48) 2(t) Φ1(t) Φ2(t) Φ(cid:48) 1(t)Φ2(t) Φ(cid:48) − Φ2(t) −3/2 Φ1(t)2 Φ2(t)2 + 1 (cid:19) Φ1(t)2 Φ2(t)2 + 1 (cid:17) (cid:18) (cid:96)(cid:48) 1(t) (cid:101) (cid:19) (cid:18) Φ1(t)2 + Φ2(t)2 Φ2(t)2 (cid:19) −3/2 −3/2 (cid:19) (cid:18) 2(t)Φ1(t) (cid:19) Φ2(t)2 Φ1(t)2 + Φ2(t)2 3/2 (cid:19) (cid:19) (cid:18) 1(t)Φ2(t) Φ(cid:48) 2(t)Φ1(t)) − (cid:18) 1 Φ1(t)2 + Φ2(t)2 (cid:19) 3/2 3/2 (Φ(cid:48) 1(t)Φ2(t) + Φ(cid:48) 1(t)Φ1(t)) 1 Φ1(t)2 + Φ2(t)2 (cid:18) 1 Φ1(t)2 + Φ2(t)2 (cid:19) 3/2 , (cid:19) ( − Φ(cid:48) 1(t)) (Φ2(t) + Φ1(t)) (cid:18) (cid:16) (cid:18) 1 (cid:96)(cid:48) 1(t)3 1 (cid:101) (cid:96)(cid:48) 1(t)3 1 (cid:101) (cid:96)(cid:48) 1(t) (cid:18) 1 (cid:101) (cid:96)(cid:48) 1(t) (cid:18) (Φ(cid:48) (cid:101) (cid:96)(cid:48) 1(t) Φ2(t) (cid:101) (cid:96)(cid:48) 1(t) Φ2(t) (cid:101) 1 Φ2(t) = − = − = − = = = = 1 Φ2(t) − − Φ2(t) (cid:96)(cid:48) 1(t) 1 (cid:101) w(cid:96)Φ(t) 1 w(cid:96)Φ(t) − where we have used that by properness we know that which implies = t from the third to the fourth equality, and that Φ(cid:48) Φ(t) (cid:96)(cid:48)(t), Φ(t) = 0 ((2.1)), (cid:104) (cid:105) by differentiating with respect to 1(t) + Φ(cid:48) 2(t) = 0 since (cid:101) ∆2 from the third to last to the second to last equality. (cid:96)(cid:48)(cid:48)(t), Φ(t) (cid:105) (cid:104) (cid:96)(cid:48)(t), Φ(cid:48)(t) (cid:105) −(cid:104) (cid:101) (cid:101) Notice that in the last equation of the previous string of equalities, the (cid:96)(cid:48) 1 (or more precisely w(cid:96)Φ(t)) and the remaining terms only term involving (cid:96) is depend only on the parametrization Φ. Then we obtain ∈ (cid:101) κ+ (cid:101)(cid:96)Φ κ+ (cid:101)λΦ (t) (t) = wλΦ(t) w(cid:96)Φ(t) . The remaining statements follow from setting Φ = Φstd and (2.6). (cid:3) Remark 2.14. Combining Lemma 2.11 and (2.10), we recover the characteri- zation of the mixability constant in terms of the quotient of weights obtained by van Erven–Reid–Williamson in [vERW12, Section 4.1]. However for the cor- responding statement involving the quotient of second derivatives of the Bayes risks, the fact that ∆2 has an affine parametrization is important. Indeed, this relies on Corollary 3 in [RW10] that states that w(t) = (t). In general, it can be checked that (cid:48)(cid:48) L − (cid:48)(cid:48) L (t) Φ(cid:48)(cid:48) 1(t) Φ1(t) − (cid:20) (cid:101) (cid:48) L (t) = (cid:21) (cid:101) Φ2(t) − 1(t)2 (cid:96)(cid:48) 1 + (cid:18) (cid:101) (cid:101) Φ2(t)2 Φ1(t)2 (cid:19) 3/2 (cid:101)(cid:96)(t), κ 20 CABRERA PACHECO AND WILLIAMSON (cid:48)(cid:48) L − (t) when Φ = Φstd. From the point of view of which reduces to w(t) = the present work, L (or a quotient of them) is not a good quantity to consider since it strongly depends on coordinates. However, notice that if one restricts (cid:48)(cid:48) to affine parametrizations of ∆2 then (cid:101)(cid:96)(t) and L hence in view of Lemma 2.13 restricting to a fixed affine parametrization of ∆2 will make quotients of the second derivative of the Bayes risk well behaved. (cid:101) 1(t)2 and κ (cid:96)(cid:48) (t) depends on (cid:101) (cid:101) Let us remark some points about Lemma 2.13. • • • −→ Let (cid:96) : ∆2 R be a given strictly proper, fair, loss function. Given a parametrization, we obtain a weight w(cid:96)Φ given by (2.8), that is, the weight depends on the parametrization. The curvature of (cid:96) is independent of Φ up to a sign. However, when defining κ+ (cid:96) we made the choice of the sign in a uniform way, thus the curvature is independent of the parametrization for the family of losses considered here. Then it follows that the quotient of curvatures is independent of the parametrization and by (2.9), it also follows that the quotient of weights is also independent of the coordinates (despite the weights being coordinate dependent themselves). A corresponding notion of weight in higher dimensions (for the multi- class case) is way more complicated and it is unclear whether using them would lead to successful results. One higher dimensional analog of curvatures is readily seen to be the so called "principal curvatures" of a hypersurface in Euclidean space (see Appendix A). This will be the main motivation when dealing with the multi-class case (Section 3) Al- ternative ways to characterize proper higher dimensional loss functions have been studied in [WVR16]. −→ 2.4. Geometric comparison of loss functions. Fix a proper, fair loss func- tion λ : ∆2 R2. Given another proper, fair loss function (cid:96) = λ, how might we compare them? From the point of view of differential geometry, since given p the normal vectors at λ(p) and (cid:96)(p) coincide, it is natural to look at their curvatures. Motivated by Lemma 2.11, we impose (for the moment) the condition inf p∈∆2 = 1. κ+ (cid:96) (p) κ+ λ (p) κ+ λ (p) for all p (cid:96) (p) ≥ ∈ Note that this implies that κ+ ∆2. We divide the comparison in steps for clarity. (1) Expressing λ(∆2) as a function. Note that since λ is proper and fair, the normal vector to a point λ(p) can only be (1, 0) when p = (1, 0) (i.e., when evaluating λ at the boundary of ∆2). Thus, the set λ(int(∆2)) can be expressed as a graph over the x-axis. To obtain an explicit expression (cid:54) THE GEOMETRY OF MIXABILITY 21 let Φ = Φstd. We use the fact that infinity) is invertible. Then, we have that λ1 : (0, 1) −→ (0, l1) (where l1 could be λ(int(∆2)) = (cid:101) (x, f (x)) x | ∈ (0, l1) } { λ−1 1 (x)). where f (x) = λ2( λ−1 1 (x), 1 (2) Translating and parametrizing (cid:96)(∆2). Let p0 (cid:96) (p0) > κ+ R2 by λ (p0), if such p0 does not exist then (cid:96) = λ. We define (cid:96)0 : ∆2 (cid:96)0(p) = (cid:96)(p) + [λ(p0) (cid:96)(p0)], i.e., we translate (cid:96) so that it coincides with λ at λ(p0). ((cid:96)0 is not fair anymore, however, the curvature is invariant under translations.) int(∆2) with κ+ −→ − − ∈ (cid:101) (cid:101) (cid:96) (p0) > κ+ − λ (p0), we know that around x0 the graph of We now parametrize (cid:96)(∆2) as the graph of a function g defined on an interval I0 around x0 (the x-coordinate of λ(p0)), "aligning" it with λ (we can assume this interval to be maximal). We let g(x) = (cid:96)0 1)−1(x)). Since κ+ (cid:96)0 ( g is to the northeast of f . (3) Comparison. If the graph of g is to the northeast of f on the whole I0, (cid:101) then we see that the superprediction set of (cid:96)0 is contained in that of λ. If I0 such that f (x1) = g(x1), this does not hold, it means that there is x1 0 and w.l.o.g. we can assume x1 > x0. Thus we know that g(x) on [x0, x1] and g(x) , i.e., the boundary of [x0, x1]. { Define the second order operator which computes the curvature of the graph (x, h(x)) (see (A.1)): 1)−1(x), 1 (cid:96)0 f (x) = 0 on x0, x1 f (x) 2(( − ≥ − ∈ (cid:101) } L(h)(x) = κ+ h (x) = 1 (1 + h(cid:48)(x)2)3/2 h(cid:48)(cid:48)(x). (cid:96) (p0) > κ+ λ (p0), we see that L(g Since κ+ 0 on [x0, x1]. The max- imum principle now implies that the supremum of g f is attained at the boundary on [x0, x1], and hence we know that f (x) = g(x) on [x0, x1], which is a contradiction. Thus the superprediction set (cid:96) is contained in the superprediction set of λ (see Section 4). f ) − − ≥ More generally, if we assume instead that inf p∈∆2 κ+ (cid:96) (p) κ+ λ (p) = η, for some η > 0, we see that (see Appendix A) that (cid:96)η(p) = η(cid:96)(p) satisfies κ+ (p) (cid:96)η κ+ λ (p) inf p∈∆2 = 1. That is, we can reproduce the previous analysis with (cid:96)η instead of (cid:96). The previous discussion motivates right away a comparison between proper, fair loss functions. 22 CABRERA PACHECO AND WILLIAMSON Definition 2.15. Let λ : ∆2 call a base loss. We say that a proper, fair loss (cid:96) : ∆2 respect to λ if −→ R2 ≥0 be a proper, fair loss in −→ , which we R2 is mixable with L > 0. inf p∈∆2 κ+ (cid:96) (p) κ+ λ (p) 2.5. Mixability and fundamentality as comparison to the log loss. is proper and fair. Thus, in particular κ+ Now, suppose (cid:96) ∈ int(∆2). We want to think of mixability as a geometric comparison to the log loss as suggested by Vovk in [Vov15] and give a detailed interpretation of this comparison. We fix the standard parametrization of ∆2, Φ = Φstd : [0, 1] ∆2, given by (cid:96) (p) > 0 for all p ∈ L −→ The log loss in these coordinates is thus given by Φ(t) = (t, 1 t). − (cid:96)log(t) = ( ln(t), ln(1 t)), − − − and by (2.6), its curvature with respect to the unit normal pointing towards R2 ≥0 is given by (cid:101) κ+ (cid:101)(cid:96)log (t) = t(1 − t) t)2)3/2 . (t) (t2 + (1 (0, 1) and κ+ (cid:101)(cid:96)log − (t) > 0 for all t Notice that κ+ (cid:101)(cid:96)log Thus, clearly by Lemma 2.7, for any proper subinterval C of [0, 1] (cf. [Vov15, Corollary 2]), we have 0 as t 0 or t → → → 1. ∈ inf t∈C κ+ (cid:96) (t) κ+ (t) (cid:101)(cid:96)log > 0. Thus, whether a proper, fair loss function (cid:96) is mixable or not will depend of the behavior of the quotient κ+ log(p) as p approaches (0, 1) and (1, 0). More precisely, we have obtained the following. (cid:96) (p)/κ+ Lemma 2.16. Let (cid:96) ∈ L be a proper loss. Then (cid:96) is mixable if and only if lim p→(0,1) lim p→(1,0) κ+ (cid:96) (p) κ+ log(p) κ+ (cid:96) (p) κ+ log(p) > 0, and > 0. Motivated by this we make the following definition. , and Φ = Φstd be Definition 2.17. Let (cid:96) be a proper, fair loss function in the standard parametrization of ∆2. We say that is (cid:96) (B1, B2)-logarithmic at L THE GEOMETRY OF MIXABILITY 23 the boundary if lim t→0+ lim t→1− κ+ (cid:101)(cid:96) κ+ (cid:101)(cid:96)log κ+ (cid:101)(cid:96) κ+ (cid:101)(cid:96)log (t) (t) (t) (t) = B−1 1 > 0, and = B−1 2 > 0. Let us analyze what this means. Suppose that (cid:96) is proper and (B1, B2)- (0, 1), using (2.10) in Lemma 2.13 and (2.8), we logarithmic. Then for any t have ∈ κ+ (cid:101)(cid:96) κ+ (cid:101)(cid:96)log (t) (t) = 1 w (cid:101)(cid:96)std (t) t(1 1 − t) = Notice that as t 0+, → and similarly, B−1 1 = lim t→0+ 1 t 1 (cid:96)(cid:48) 1(t) | | (cid:101) = lim t→0+ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 t 1 (cid:96)(cid:48) 1(t)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1(t) (cid:12) (cid:12) (cid:12) (cid:12) (cid:101) (cid:12) ((cid:96)log)(cid:48) (cid:96)(cid:48) 1(t) . . (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 2(t) (cid:101) ((cid:96)log)(cid:48) (cid:96)(cid:48) 2(t) B−1 2 = lim t→1− 1 1 − t 1 (cid:96)(cid:48) 2(t) | | = lim t→1− (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) . (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) that is, we are only comparing the rate at which (cid:96)i, i = 1, 2, go to 0 (since they do by fairness) with the rate at which the log loss does. (cid:101) (cid:101) In [Vov15], Vovk defines a loss function λ∗ to be fundamental if given a Z∞ (computable, proper, mixable) loss function λ and a data sequence in ζ that is random under λ∗ with respect to a prediction algorithm F , then it is is random under λ with respect to F . He shows that a fair, mixable (cid:96) fundamental if and only if (using the notation in [Vov15]) ∈ L ∈ sup p∈[0,1] κ(cid:96)(p) κlog(p) < . ∞ Since we have seen that mixability can be regarded as a comparison of curvatures of the loss curve of (cid:96) and that of (cid:96)log and we have reinterpreted fundamentabiliy as a comparison of (cid:96) and (cid:96)log near the boundary building on Definition 2.15, we can easily come up with a notion of λ-fundamentality. Definition 2.18. Let λ be a proper, fair loss function in proper, fair loss function (cid:96) is λ-fundamental if . We say that a L (cid:96) is mixable with respect to λ, and ∈ L • 24 CABRERA PACHECO AND WILLIAMSON • when Φ = Φstd, we have lim t→0+ lim t→1− κ+ (cid:101)(cid:96) κ+ (cid:101)λ κ+ (cid:101)(cid:96) κ+ (cid:101)λ (t) (t) (t) (t) < ∞ < . ∞ Suppose now that a mixable loss function (cid:96) exist η, γ > 0 such that is fundamental. Then there ∈ L κ+ (cid:96) (p) κ+ log(p) ≤ γ, η ≤ int(∆2). This implies that η−1κ+ (cid:96) (p), int(∆2), which readily implies (Appendix A) that κ+ log(p) and κ+ γ−1κ+ log(p) (cid:96) (p) ≥ ≥ κ+ η(cid:96)(p) ≥ log(p) and κ+ κ+ log(p) κ+ γ(cid:96)(p), ≥ int(∆2). for all p for all p for all p ∈ ∈ ∈ Rephrasing the previous discussion we have obtained the following charac- terization of fundamentality. Theorem 2.19. A loss function (cid:96) ∈ L numbers η, γ > 0, such that for any p xp and yp in R2 ≥0 such that is fundamental if and only if there exist int(∆2), there are translation vectors ∈ spr(η(cid:96) + xp) spr((cid:96)log) ⊂ ⊂ spr(γ(cid:96) + yp). 2.6. Constructing new mixable losses from previous. We now observe how mixability helps us to construct new proper, fair and mixable functions from previous proper, fair and mixable losses. We first define a family of loses that will serve to illustrate the idea. We set Φ = Φstd and λ = (cid:96)log. Let a > 0 and define the loss function λa : ∆2 It can be readily checked that κ −→ λa(p) = aλ(p). (cid:102)λa(t) = a−1κ+ κ (cid:102)λa(t) κ+ λ (t) it follows that λa is 1-mixable for a 1 and it is not if a > 1. Note that λa is still proper and fair. Take then a < 1, we can readily see that there exists a proper, fair an mixable loss function λ∗ such that λ (t), thus since R2 ≥0 1 a ≤ = , λ = λa + λ∗. THE GEOMETRY OF MIXABILITY 25 Indeed, λ∗ = λ λa = λ1−a, which is fair, proper and 1-mixable. This process works in a more general setting than scalings of λ. Consider − for example the spherical loss σ defined in coordinates by σ(t) = 1 (cid:18) t √t2+(1−t)2 − , 1 + t √t2+(1−t)2 . (cid:19) It can be easily checked that this is bounded, proper and fair and that κ 1. Thus (cid:101) (cid:101)σ(t) = (t2 + (1 t(1 thus σ is 1-mixable. Thus, as before, there is a loss function (cid:96)∗ such that λ = σ + (cid:96)∗. Moreover, the loss function given (in coordinates) by t)2)3/2 t) κ+ (cid:101)σ (t) κ+ λ (t) − − > 1, = (cid:96)∗(t) = λ(t) σ(t) = ln(t) 1 + − which can be seen to be unbounded, proper, fair and mixable. − − − − − (cid:18) t √t2+(1−t)2 , ln(1 t) 1 t √t2+(1−t)2 − , (cid:19) We close this part with the following observation. Suppose that (cid:96) is a proper, fair, mixable loss function with mixability constant η > 0. Then the loss function (cid:96)η = η(cid:96) is 1-mixable. Thus, there exists a proper, fair, mixable loss (cid:96)∗ such that (cid:96)log = (cid:96)η + (cid:96)∗. As we will see in Section 4, the previous observation can be interpreted from the point of view of the superprediction sets of the involved loss functions and convex geometry: spr(η(cid:96)) slides freely inside spr(λ) (see Theorem 4.23). 2.7. Composite losses and the canonical link. In this part we discuss R be a composite losses following [RW10]. Let us recall their setting. Let V ⊂ set of prediction values. A link function is a continuous map ψ : [0, 1] . −→ V Given a loss function = R, if ψ is (cid:37) : −→ invertible, we define the composite loss (cid:37)ψ as R and assuming [0, 1] } × 0, 1 V { (cid:101) (cid:37)ψ(y, v) = (cid:37)(y, ψ−1(v)). Definition 2.20. A composite loss proper loss in the sense of [RW10]. (cid:101) (cid:37)ψ is a proper composite loss if (cid:101) (cid:37) is a (cid:101) Recall that in [RW10], Φ = Φstd is implicitly assumed. Then, given a loss (cid:37) (in the [RW10] sense), we can construct a loss function (cid:37) : ∆2 (cid:101) −→ (cid:37) ◦ (cid:101) Φ−1 std. Then, the composite loss (cid:37)ψ can be expressed as (cid:37)ψ(v) = ( (cid:37) (cid:101) = ((cid:37) (cid:101) (cid:37) = (cid:0) ◦ ◦ ◦ ψ−1)(v) Φstd ◦ (Φstd (cid:101) ψ−1)(p) ψ−1) (p) ◦ (cid:1) function R2 ≥0, by (cid:37) = (cid:101) 26 CABRERA PACHECO AND WILLIAMSON Φstd Ψ−1 = ◦ (cid:37), that is In other words, the composite loss to the parametrization Φ = Φstd of (cid:37) with respect to Φ by (cid:37)ψ is the local expression of (cid:37) with respect ψ−1 of ∆2. We denote the local expression (cid:37) := (cid:37) (cid:101) To show how this reconciliation of terms work, we obtain a result similar to (cid:37)ψ is given and it has Corollary 12 in [RW10]. Suppose that a composite loss (cid:98) differentiable partial losses (i.e., the corresponding loss (cid:37) is in ), furthermore, we assume that ψ is a diffeomorphism which in one dimension means it is (cid:37)ψ is strictly proper if and only if (cid:37) strictly monotonic. Then we know that is strictly proper (by definition). This implies that p is normal to (cid:37)(∆2) at int(∆2) and its curvature is positive (with respect to the unit (cid:37)(p) for all p ∈ normal pointing towards R2 ≥0). This means for all v Ψ−1 L (cid:101) (cid:101) (cid:98) (cid:101) (cid:37) ◦ ◦ ◦ , ∈ V 0 = = = (cid:37)(cid:48)(v), Φ(v) (cid:104) (cid:105) (cid:37)(cid:48) (cid:37)(cid:48) 2(v)Φ2(v) 1(v)Φ1(v) + (cid:98) 1(ψ−1(v))(ψ−1)(cid:48)(v)Φ1(v) + (cid:37)(cid:48) (cid:98) (cid:98) 1(ψ−1(v))Φ1(v) + (cid:37)(cid:48) (cid:101) 2(ψ−1(v))(ψ−1)(cid:48)(v)Φ2(v) (cid:37)(cid:48) (cid:1) (cid:101) − = 2(ψ−1(v))(1 (cid:37)(cid:48) where we have used that ψ is a diffeomorphism and that Φ1 + Φ2 = 1 for all parametrizations Φ of ∆2. Therefore, we have (cid:37)(cid:48) (cid:37)(cid:48) 1(ψ−1(v)) 2(ψ−1(v)) 2(ψ−1(v)), (cid:37)(cid:48) Φ1(v)), Φ1(v) − = (cid:101) (cid:101) (cid:101) − − that is (cid:0) (cid:101) ψ−1(v) = (cid:101) 2(ψ−1(v)) (cid:37)(cid:48) (cid:101) (cid:37)(cid:48) 1(ψ−1(v))) ( (cid:37)(cid:48) 2(ψ−1(v)) for all v (cid:101) Since we are working with valid reparametrizations the choice of Ψ will not ∈ V . (cid:101) affect the curvature of (cid:37). Hence we obtain Corollary 2.21. A composite loss strictly proper and ψ satisfies (cid:37)ψ is strictly proper if and only if (cid:37) is ∈ L ψ−1(v) = ( for all v R. ∈ 2(ψ−1(v)) (cid:37)(cid:48) (cid:101) (cid:37)(cid:48) 2(ψ−1(v)) (cid:37)(cid:48) 1(ψ−1(v))) − (cid:101) (cid:101) (cid:101) Remark 2.22. We have seen that whether a loss function (cid:96) is strictly proper or not, depends on whether conditions (2.3) and (2.4) hold or not. No- tice that under a (admissible) change of coordinates, for example given by a link ψ, (2.4) will not be modified. However, (2.3) might change (since in a way, we are changing the "velocity" at which we move on (cid:96)(∆2)). Hence, Corollary 2.21 is giving us a way to define the set of admissible links (or reparametrizations of ∆2) given a loss function (cid:96) and the standard parametrization of ∆2. In this case, the new parametrization is given by Φ = Φstd ψ−1. ∈ L ◦ THE GEOMETRY OF MIXABILITY 27 For applications, it is desired to be able to work with a given composite loss (cid:37)ψ 2 . From our R, so that (cid:37)ψ, and moreover, to have convexity of the partial losses point of view, we see (cid:37) := (cid:37) (Φstd Φ = (cid:37) (cid:101) (cid:37)ψ 1 and (cid:37)ψ as the local expression of some (cid:37) : ∆2 ψ−1 = Let us work with the partial losses separately: ψ−1) = ((cid:37) ψ−1. (cid:101) −→ (cid:101) Φstd) (cid:37) ◦ ◦ ◦ ◦ ◦ ◦ (cid:101) (cid:98) (cid:37)1(v) = 1(ψ−1(v))(ψ−1)(cid:48)(v) (cid:37)(cid:48) (cid:101) (cid:98) (cid:37)2(v) = (cid:101) 2(ψ−1(v))(ψ−1)(cid:48)(v) (cid:37)(cid:48) d dv d dv Proceeding as in the proof of Lemma 2.4, properness implies (cid:98) (cid:101) L(u, v) 0 = ∂v v=u | (cid:37)(cid:48) 1(ψ−1(v))(ψ−1)(cid:48)(v)Φ1(u) + = (cid:101) 2(ψ−1(v))(ψ−1)(cid:48)(v)Φ2(u) (cid:37)(cid:48) s=u | or, equivalently, (cid:101) (cid:101) 0 = (cid:37)(cid:48) 1(ψ−1(v))Φ1(v) + (cid:37)(cid:48) 2(ψ−1(v))Φ2(v). Therefore, we can define w as (cid:101) (cid:101)(cid:37)(Ψ−1(v)) = w(v) := w (cid:101) 2(ψ−1(v)) (cid:37)(cid:48) Φ1(v) = 1(ψ−1(v)) (cid:37)(cid:48) Φ2(v) , − (cid:37), we can rewrite the derivatives of the partial losses (cid:101) (cid:101) (cid:101)(cid:37) is the weight of (2.11) where w (cid:37) as of (cid:98) w(v)Φ2(v)(ψ−1)(cid:48)(v), − (v) = w(s)Φ1(v)(ψ−1)(cid:48)(v). (cid:101) (cid:37)1 d (v) = dv (cid:98) (cid:37)2 d dv (cid:98) Taking second derivatives we have − d2 (cid:37)1 dv2 (v) = (cid:98) d2 (cid:37)2 dv2 (v) = (cid:98) w(v)(ψ−1)(cid:48)(v) (cid:48) Φ2(v) w(v)(ψ−1)(cid:48)(v) Φ(cid:48) 2(v), − (cid:2) w(v)(ψ−1)(cid:48)(v) (cid:3) (cid:48) Φ1(v) + (cid:2) w(v)(ψ−1)(cid:48)(v) (cid:3) Φ(cid:48) 1(v). (cid:2) A way to guarantee both expressions are positive is as follows. Assume w.l.o.g. that (ψ−1)(cid:48) > 0. Since we are assuming w > 0, (cid:37)1 is decreasing (also we have Φ1 is increasing and Φ2 is decreasing). We readily see that imposing (cid:98) (cid:37)2 is increasing and (cid:98) (cid:3) (cid:3) (cid:2) w(v)(ψ−1)(cid:48)(v) = 1 28 CABRERA PACHECO AND WILLIAMSON for all v positive. ∈ R, is enough to guarantee both second derivatives to be strictly Definition 2.23. Given (cid:37) as the link defined by ∈ L strictly proper, we define the canonical link ψ (ψ−1)(cid:48)(v) = ψ−1(v) (cid:37)(cid:48) 2(ψ−1(v)) = 1 w(v) , , where w is defined in (2.11). (2.12) for v ∈ V (cid:101) The differential equation (2.12) can be seen as separable ordinary differential equation, which is solvable for loss functions in . L To give a geometric meaning, we look at the norm of the velocity of the loss curve α(v) = (cid:37)(v). α(cid:48)(v) | 2 = w(v)2(ψ−1)(cid:48)(v)2 | Φ1(v)2 + Φ2(v)2 (cid:98) By assuming w(s)(ψ−1)(cid:48)(s) = 1 and Φ = Ψ, we have (cid:2) (cid:3) 2 = α(s) | | Φ0(ψ−1(s))2 + Φ1(ψ−1(s))2 . (cid:3) (cid:2) Thus the canonical link gives a parametrization of ∆2 such that (cid:37) is a curve such that its velocity vector at v coincides with the length of the vector Φ(ψ−1(v)). In other words, it is a parametrization of the loss curve (cid:37)(int(∆2)) (cid:96)(int(∆2)), the tangent vector at the point has such that for (cid:37)(p) = length . We close this discussion with a charcterization of the canonical | link. (cid:98) be a stxrictly proper loss function and ψ its canon- Theorem 2.24. Let (cid:37) ical link. The reparametrization of (cid:37) determined by its canonical link is a parametrization of (cid:37)(int(∆2)) with weight equal to 1. (cid:37)(v) ∈ L p | ∈ (cid:98) (Φstd Proof. Let determined by the canonical link. Since (cid:37) = (cid:37) ψ−1) = (cid:37) ◦ ◦ ◦ ψ−1 be the reparametrization of (cid:37)(int(∆2)) (cid:98) (cid:37)(cid:48) 2(v) = (cid:101) 2(ψ−1(v))(ψ−1)(cid:48)(v), (cid:37)(cid:48) for all v ∈ V (2.13) , and from Definition 2.23 (cid:98) (cid:101) 2(ψ−1(v))) = (cid:37)(cid:48) ψ−1(v) (ψ−1)(cid:48)(v) , for all v ∈ V , we have (cid:101) 2(v) = ψ−1(v). (cid:37)(cid:48) Thus w (cid:98)(cid:37)(v) = (cid:98)(cid:37)(cid:48) 2(v) Φ1(v) = 1. (cid:98) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:3) THE GEOMETRY OF MIXABILITY 29 3. Mixability for Multi-Class Classification L Now we focus our attention on multi-class classification loss functions, that 0 given by the partial losses is, maps (cid:96) : ∆n Rn ≥ −→ (cid:96)(p) = ((cid:96)1(p), ..., (cid:96)n(p)). Our main goal is to interpret mixability as a geometric comparison of a given loss function (cid:96) to the log loss, as we did for the binary case. As suggested by the comments after Remark 2.11, the extra work of characterizing properness and mixability in a geometric way (coordinate independent) will pay off since to carry out the comparison we will look at the scalar second fundamental forms of (cid:96)(int(∆n)) and (cid:96)log(int(∆n)). The scalar second fundamental form measures how a Riemannian manifold curves inside an "ambient space", in this case how (cid:96)(int(∆n)) curves inside Rn (see Appendix A for details). The definition of (Definition 2.1) can be extended to higher dimensions. Definition 3.1. An admissible loss function is a map (cid:96) : ∆n that Rn ≥0 such −→ (i) (cid:96)(int(∆n)) ≥0 is a (n (ii) there exists a differentiable map n : (cid:96)(int(∆n)) 1)-manifold of class C 2, Rn − ⊂ n(cid:96)(p), where N (cid:96)(int((∆n)) is the normal space of (cid:96)(int((∆n)), and >0 for all p int(∆n). n(p) belongs to Rn (iii) n(p) or We denote the set of admissible loss functions as dimension is clear from context. n, or simply L L when the − ∈ N (cid:96)(int(∆n)), n((cid:96)(p)) = → We fix the log loss and denote it for convenience by λ := (cid:96)log : ∆n as the map Rn ≥0, −→ λ(p) = ( ∆n. ln(p1), ..., ln(pn)), − − for p = (p1, ..., pn) Let (cid:96) around p parametrization Φ ∈ L ∈ ∈ ∆n of ∆n n and consider a parametrization Φ : D int(∆n). The local expression of the conditional risk (using the Rn−1 −→ ⊂ Φ of ∆n × × ∆n around (p, p)) is given by L(t, s) = (cid:96)(s), Φ(t) (cid:105) (cid:104) n = (cid:96)k(s)Φk(t), k=1 (cid:88) (cid:101) D and (cid:96) = (cid:96) Φ. where t = (t1, ...tn−1), s = (s1, ..., sn−1) (cid:101) (cid:101) ∈ Imposing (cid:96) to be proper implies that when fixing t, s = t is a critical point L(t, ◦ of (cid:101) ), that is, * 0 = ∂si L(t, s=t = ) | * ∂si (cid:104) (cid:96)(t), Φ(t) (cid:105) . Note that since the tangent space of M(cid:96) at 1, ..., n 1 } (cid:96)(U ), is generated by (cid:96)(t), , we conclude that Φ(t) is a ∈ { (cid:96)(t), ..., ∂sn−1 − (cid:101) ∂s1 { (cid:101) (cid:96)(t) } (cid:101) (cid:101) (cid:101) (cid:101) (cid:101) for all i T (cid:101)(cid:96)(t) 30 CABRERA PACHECO AND WILLIAMSON normal vector. In other words, as before, we have n((cid:96)(p)) = , p p | | ± for all p int(∆n). ∈ The fact that L(t, ) achieves a minimum at s = t (at interior points) is * equivalent to requiring that the Hessian, D2 L, is positive definite at s = t. The Hessian of (cid:101) L(t, ) at s = t is given by * (cid:101) (cid:101) [D2 L]ij(t) = ∂sj si L(t, s=t = ) | * ∂2 sj si (cid:104) (cid:96)(t), Φ(t) (cid:105) . (cid:101) The next step is to relate [D2 L]ij(t) to the scalar second fundamental form h of M(cid:96) = (cid:96)(∆n) (see Appendix A for its definition). More precisely, we compute the h with respect to a local parametrization Φ of ∆n, i.e., we obtain the matrix [hij] representing h. To do this we need to compute the second derivatives of its parametrization Φ (Appendix A). Since, (cid:96) = (cid:96) (cid:101) (cid:101) (cid:101) ◦ we have ∂si (cid:96)(s) = (cid:101) (cid:96)(s) = ∂2 sj si (cid:101) ∂si (cid:16) (cid:96)1(s), ..., ∂si (cid:96)n−1(s) (cid:101) (cid:101) (cid:96)1(s), ..., ∂2 sj si ∂2 sj si (cid:17) (cid:96)n−1(s) The scalar second fundamental form (with respect to the normal vector point- ing towards Rn (cid:101) ≥0) is then given by (cid:101) (cid:101) (cid:16) (cid:17) hij(s) = h(∂si (cid:96)(s), ∂sj (cid:96)(s)) = (cid:101) (cid:101) = = = (3.1) ∂2 sj si (cid:104) ∂2 sj si (cid:104) (cid:96)(s), n( (cid:96)(s), (cid:101) 1 ∂2 (cid:101) sj si Φ(s) (cid:104) | 1 Φ(s) | [D2 | | (cid:96)(s)) (cid:105) Φ(s) (cid:101) Φ(s) | (cid:105) | (cid:96)(s), Φ(s) (cid:105) (cid:101) L]ij(s), − 1, thus if [D2 for i, j = 1, ..., n L]ij(s) is positive definite, then the matrix [hij](s) is positive definite. In this case its eigenvalues are strictly positive and hence, the principal curvatures of M(cid:96) at (cid:96)(s) (see Appendix A), κ+ i (s) (with (cid:101) respect to the unit normal pointing towards Rn ≥0) are all positive. Therefore, using a similar reasoning as we did in the case n = 2, we have obtained the following geometric characterization of properness (by following the same arguments as in Section 2). (cid:101) THE GEOMETRY OF MIXABILITY 31 Lemma 3.2. Let (cid:96) ∈ L and the principal curvatures of M(cid:96) at (cid:96)(p), κ+ int(∆n). positive for all p i (p) (i = 1, .., n − n. (cid:96) is strictly proper if and only if n(cid:96)(p) = p | | 1), are strictly p/ ± ∈ We briefly explain how the comparison of scalar second fundamental forms will be performed. We follow a similar procedure as the one described in Section 2.4 for the case n = 2. (1) We establish that given a proper loss function (cid:96) n, around every int(∆n), (cid:96)(int(∆n)) can be parametrized as a graph of a func- Rn such that p∗ tion f defined on a neighborhood around some x∗ (x∗, f (x∗)) = (cid:96)(p∗). We do this explicitly for the log loss λ. ∈ L ∈ ∈ (2) Since λ and (cid:96) are proper, the normal vector to λ(int(∆n)) and (cid:96)(int(∆n)) at λ(p∗) and (cid:96)(p∗), respectively, is p∗/ p∗ . Hence we can identify their | | tangent spaces at these points. We do so and fix the parametrizations given in step (1). (3) By assuming η-mixability of (cid:96), we look at the principal curvatures of Eη((cid:96)(int(∆n)) and prove an equivalent condition for them to be non- negative with respect to normal vector field pointing towards Eη(spr((cid:96))) (i.e., convexity). The condition to be satisfied is seen to be comparison of the scalar second fundamental forms of λ and (cid:96) that we can recognize by step (1). (4) We interpret this comparison as follows. Since the tangent spaces to (cid:96)(p∗) (and η(cid:96)(p∗)) and λ(p∗) coincide for the chosen point p∗, if we translate (cid:96) to coincide to λ at p∗, call this tangent space H (and note it can be indetified with the supporting plane of the loss functions at the given point). Then if we express (locally) η(cid:96)(int(∆n)) and λ(int(∆n)) over H, the graph of η(cid:96)(int(∆n)) lies above the graph of λ(int(∆n)). See Figure 6. 3.1. Representing proper loss functions as graphs over Euclidean 2), spaces. When restricting to the set of admissible loss functions we can represent losses as functions over Rn−1 (a similar approach was taken in [vERW12]; the difference relies on the fact that here we are after the com- parison of second fundamental forms), which allows us to represent geometric quantities in a simple way. This will be useful to recognize these quantities when comparing a proper loss function (cid:96) to the log loss λ, as we did for the binary case in Section 2. Let (cid:96) : ∆n n given by ≥0 be a proper loss in n (n ≥ L Rn −→ (cid:96)(p) = ((cid:96)1(p), ..., (cid:96)n(p)) . L 32 CABRERA PACHECO AND WILLIAMSON Figure 6. Geometric interpretation of η-mixability. Let Φ : ∆n−1 by Rn−1 ⊂ −→ ∆n be the standard parametrization of ∆n given n−1 Φ(s) = Φstd(s) = s1, ..., sn−1, 1 − (cid:32) si , (cid:33) i=1 (cid:88) where s = (s1, ..., sn) then given by projection Π : Rn (cid:101) ∈ (cid:96)(s) = ((cid:96) ∆n−1. The local expression of Φ)(s), so that n−1 ≥0 as Π(y1, ..., yn) = (y1, ..., yn−1). (cid:96)i(s) = ((cid:96)i (cid:101) ◦ ◦ R (cid:96) in these coordinates is Φ)(s). Also, we define the ∈ ∈ 0 ≥0 × { } (x1, .., xn) { −1p, for p | (as regular as M(cid:96) is). ≥0 −→ Recall that properness implies that the normal vector of M(cid:96) = (cid:96)(∆n) at (cid:96)(p) (cid:101) int(∆n). As a consequence, the normal can be chosen to be p | Rn , so that vector is never parallel to the hyperplane ∈ int(∆n), M(cid:96) can be written as a graph over around any point (cid:96)(p) with p Rn In general, the existence of this function is guaranteed by the implicit function theorem, however, in our case we can M(cid:96) is a map with give an explicit description of it as follows. The function Π | int(∆n), therefore, the injective derivative, say around (cid:96)(q) for a fixed q inverse function theorem ensures the existence (and differentiability) of a local −1 . This inverse map can be seen as a inverse, which we can denote by Π M(cid:96) | local parametrization of M(cid:96). Thus, the local expression of (cid:96) (viewed as a map from ∆n to M(cid:96)), (cid:96) : Dq Rn−1 (where the latter are small U(cid:96)(q) −→ neighborhoods around Φ−1(q) and Π((cid:96)(q)) respectively) is given by xn = 0 } Rn−1 ⊂ ⊂ ∈ | (cid:96)(s) = (Π (cid:96) ◦ ◦ Φ)(s) = (Π ◦ (cid:96))(s) = (cid:96)1(s), ..., (cid:96)n−1(s) . (cid:101) (cid:16) (cid:101) (cid:17) (cid:101) nHλ(int(∆n))ηl(int(∆n))• THE GEOMETRY OF MIXABILITY 33 This map is a diffeomorphism and its inverse (cid:96) −1 denoted by : U(cid:96)(q) −→ Dq, will be −1 (cid:96) (x) = (cid:96)−1 1 (x), ..., (cid:96)−1 n−1(s) . We warn the reader about this abuse of notation, (cid:96)i(s), it is a map satisfying (cid:101) (cid:101) (cid:16) (cid:17) (cid:96)−1 i (x) is not the inverse of (cid:101) (cid:101) ((cid:96) si = xi = (cid:96)i(s), (cid:96)−1 i (x), (cid:101) )(x) = x, (cid:101) (cid:96))(s) = s. −1 (cid:96) ◦ −1 ((cid:96) setting U(cid:96)(q) ◦ R such that graph(f ) We want to define f : U(cid:96)q −→ ⊂ ⊂ Π(M(cid:96)), so that it contains Π((cid:96)(q)), we arrive to −1 (cid:96) f (x) = ((cid:96)n )(x) = (x)). (cid:96)n((cid:96) Φ −1 We have obtained the following result. ◦ ◦ (cid:101) M(cid:96). We see that Lemma 3.3. Let (cid:96) exists an open set U admits the parametrization ∈ L ⊂ n be a strictly proper loss. Let q and a function f : U R n−1 ≥0 × { 0 } int(∆n). Then there R≥0 such that M(cid:96) ∈ −→ around (cid:96)(q). Φf (x) = (x, f (x)), Let (cid:96) and f be as in Lemma 3.3. The unit normal vector field (pointing towards Rn ≥0) is then given by (3.2) n(cid:96)(x) = 1 ( Df (x), 1) . 2 + 1 Df (x) | | We proceed to calculate the scalar second fundamental form. The first and second derivatives of Φf are given by (cid:112) − ∂kΦf (x) = (ek, ∂kf (x)), ∂kmΦf (x) = (0, ∂kmf (x)), 1, where ek denotes the canonical basis of Rn−1 and 0 is for k, m = 1, ..., n the 0 vector of Rn−1. Denote by h(cid:96) the scalar second fundamental form of M(cid:96). Thus with respect to this coordinates we have − (3.3) h(cid:96) km(x) = ∂kmΦf (x), n(cid:96)(x) (cid:105) (cid:104) = for k, m = 1, ..., n 1. − 1 2 + 1 Df (x) | | ∂kmf (x), (cid:112) 34 CABRERA PACHECO AND WILLIAMSON int(∆n). The local expres- 3.1.1. Mλ as a graph. Fix an arbitrary point q∗ sion of λ (with respect to the standard parametrization Φ = Φstd around q∗ and Π around (cid:96)(q∗)) is given by ∈ thus, we have λ(s) = ( − ln(s1), ..., − ln(sn−1)) , −1 λ (x) = e−x1, ..., e−xn−1 . Fix s∗ = Φ−1(q∗). Thus, around x∗ = Π(λ(q∗)), using Lemma 3.3, Mλ (cid:1) (cid:0) around (cid:96)(q) can be described as Φg(x) = (x, g(x)). Moreover, in this case we have the explicit expression g(x) = Notice that λ form hλ of λ at x∗. −1 (x∗) = s∗. We now compute the scalar second fundamental ln(1 (cid:80) − − n−1 i=1 e−xi). ∂kΦg(x) = ek, − (cid:32) 1 e−xk n−1 i=1 e−xi (cid:33) , ∂kmΦg(x) = 0, (cid:32) 1 − δkme−xk (cid:80) n−1 i=1 e−xi − (cid:80) + (1 e−xke−xm n i=1 e−xi)2 , (cid:33) − (cid:80) for k, m = 1, ..., n 1 (here δkm denotes the Kronecker delta). In particular, − ∂kΦg(x∗) = ek, − (cid:32) 1 s∗ k n−1 i=1 s∗ i (cid:33) , − δkms∗ (cid:80) k n−1 i=1 s∗ i + − 1, and since n((x∗, g(x∗)) = (cid:0) (cid:80) ∂kmΦg(x∗) = 0, (cid:32) 1 1 − ks∗ s∗ m n−1 i=1 s∗ i 1 (cid:1) 2 , (cid:33) (cid:80) √(cid:80)n−1 i=1 (s∗ i )2+(1−(cid:80)n−1 i=1 s∗ i )2 (s∗, 1 − for k, m = 1, ..., n n−1 i=1 s∗ i ) we have km(x∗) = hλ (3.4) (cid:80) (3.5) − = for k, m = 1, ..., n 1 (cid:112)(cid:80) − ∂kmΦg(x∗), n((x∗, g(x∗)) (cid:105) (cid:104) 1 i )2 + (1 n i=1(s∗ δkms∗ k + (cid:18) 1 n i=1 s∗ i )2 − (cid:80) ks∗ s∗ m n i=1 s∗ , i (cid:19) − (cid:80) Remark 3.4. Note that if instead of λ we would have used a translation of it, that is, for c ∈ Rn, define a loss function φ : ∆n φ(p) = λ(p) + c, Rn ≥0 by −→ we can repeat the previous computation. The only difference is that we would have a different point xc ∗ instead of x∗. THE GEOMETRY OF MIXABILITY 35 3.2. Geometric interpretation of mixability. Mixability is defined as a property of the superprediction set of a proper loss (cid:96) n. More precisely, (cid:96) is mixable if and only if Eη(spr((cid:96))) is convex for some η > 0. As before, we can determine whether Eη(spr((cid:96))) is convex by looking at its boundary ∂Eη(spr((cid:96))) = Eη((cid:96)(∆n)). Eη(spr((cid:96))) is convex if the principal curvatures of Eη((cid:96)(∆n) are non-negative (when defined with respect to the inner pointing normal vector) at all points. Since convexity is a global property that can be tested "locally everywhere", it makes sense to make the following definition. ∈ L n is η-mixable int(∆n) if Eη(M(cid:96)) has non-negative principal curvatures with respect to Definition 3.5 (η-Mixability at p at p the unit normal vector pointing towards Eη(spr((cid:96))) at Eη((cid:96)(p)). ∆n). We say that (cid:96) ∈ L ∈ ∈ ∈ ∈ L ∈ L Clearly, (cid:96) Let (cid:96), (cid:37) n is η-mixable at all p int(∆n) if and only if it is η-mixable. n be strictly proper. First, we note that properness implies that the second fundamental forms of (cid:96) and (cid:37) can be compared in the following ∆n, note that the normal vector to M(cid:96) and M(cid:37) can be sense. Given q∗ ∈ chosen to be q∗/ q∗ . A translation does not affect the geometric properties | | of M(cid:37) (since it is an isometry of Rn), thus we consider the translated loss (cid:37)(cid:96)(q∗) : ∆n Rn, given by (cid:37)(cid:96)(q∗)(p) = (cid:37)(p) + [(cid:96)(q∗) − i.e., we translate (cid:37) by the vector cq∗ = λ(q∗) (cid:96)(q∗) so that both (cid:37)q∗ and (cid:96) coincide when evaluated at q∗. Doing so allows us to identify the tangent spaces to M(cid:37)(cid:96)(q∗) and M(cid:96) at (cid:37)(cid:96)(q∗)(q∗) = (cid:96)(q∗). We will call (cid:37)(cid:96)(q∗) the translation of (cid:37) to (cid:96)(q∗). (cid:37)(q∗)] , − −→ n be strictly proper. Let h(cid:96) and hλ denote the scalar Lemma 3.6. Let (cid:96) second fundamental form of M(cid:96) and Mλ (the log loss), respectively. Then, (cid:96) is η-mixable at p int(∆n) if and only if ∈ L (3.6) ∈ h(cid:96)((cid:96)(p)) ηhλ(λ(p)) − is positive semi-definite, where h(cid:96) and hλ denote the second fundamental forms of (cid:96) and λ in the graphical coordintes described in Lemma 3.3. And therefore, (cid:96) is η-mixable if and only if (3.6) holds for all p int(∆n). Proof. Let (cid:96) : ∆n −→ Rn ≥0 be an admissible proper loss (cid:96)(p) = ((cid:96)1(p), ..., (cid:96)n(p)) . ∈ The η-exponential projection map Eη : Rn Rn is given by Eη(y) = (e−ηy1, ..., e−ηyn). −→ Let q∗ f over Rn−1, defined on an open set U f int(∆n) and write M(cid:96) around (cid:96)(q∗) as the graph of a function x∗ containing x∗, such that f (x∗) = ∈ 36 CABRERA PACHECO AND WILLIAMSON (cid:96)(q∗). We can directly give a parametrization of Eη(M(cid:96)) around Eη((cid:96)(q∗)) = Eη((x∗, f (x∗)) by Ψ(x) = e−ηx1, ..., e−ηxn−1, e−ηf (x) . We proceed to compute the second fundamental form of Eη(M(cid:96)) around Eη((cid:96)(q∗)) (with respect to the inward pointing unit normal vector). The first and second derivatives of Ψ are given by (cid:1) (cid:0) ∂kΨ(x) = ∂kmΨ(x) = ηe−ηxkek, − − η2δkme−ηxkek, (cid:0) η∂kf (x)e−ηf (x) η∂kmf (x)e−ηf (x) + η2∂kf (x)∂mf (x)e−ηf (x) (cid:1) − and noting that the (inward pointing) unit vector field is given by (cid:0) (cid:1) n(Eη((cid:96)(x)) = 1 n−1 i=1 ∂if (x)2e2ηxi + e2ηf (x) 1/2 ∂1f (x)eηx1, ..., ∂nf (x)eηxn, eηf (x) − (cid:0) (cid:1) Therefore, letting (cid:0)(cid:80) of η at Eη((x∗, f (x∗))) is given by E E η := η(Uf ) = Eη(f (Uf )), the second fundamental form (cid:1) E hE η km(x∗) ∂kmΨ(x∗), n((cid:96)η(x∗)) = (cid:105) (cid:104) = = 1 n−1 i=1 ∂if (x∗)2e2ηx∗ i + e2ηf (x∗) (cid:0)(cid:80) η n−1 i=1 ∂if (x∗)2e2ηx∗ i + e2ηf (x∗) 1/2 (cid:1) η2δkme−ηx∗ kek, (cid:34)(cid:104) ∂if (x∗)eηx∗ i ei (cid:105)Rn−1 +η∂kmf (x∗) η2∂kf (x∗)∂mf (x∗) n i=1 (cid:88) − 1/2 [ηδkm∂kf (x∗) + ∂kmf (x∗) η∂kf (x∗)∂mf (x∗)] . (cid:3) − (cid:0)(cid:80) Thus, since the convexity of Eη(spr((cid:96))) is equivalent to the principal curvatures int(∆n) (with respect to the of Eη(M(cid:96)) being non-negative at q∗ for all q∗ inner pointing normal vector), we see this will be the case if and only if the matrix ∈ (cid:1) Akm = ∂kmf (x∗) is positive semi-definite for all x∗ corresponding to q∗ Note that since we have a graphical parametrization Φf of M(cid:96) around x∗ ∈ η [ − − δkm∂kf (x∗) + ∂kf (x∗)∂mf (x∗)] int(∆n). U , we have and by (3.2), ∂kΦf (x∗) = (ek, ∂kf (x∗)) n(x∗, f (x∗)) = 1 2 + 1 Df (x∗) | | Df (x∗), 1) . ( − (cid:112) ∈ THE GEOMETRY OF MIXABILITY 37 On the other hand, since the normal vector to Φf (U ) at (x∗, f (x∗)) is q∗ have |q∗|, we n((x∗, f (x∗))) = 1 i )2 + (1 n i=1(s∗ for s∗ (cid:112)(cid:80) Rn−1 such that Φ(s∗) = q∗. By properness we know that ∈ 1, ..., s∗ s∗ n, 1 n i=1 s∗ i )2 (cid:32) n−1 − i=1 (cid:88) s∗ i , (cid:33) − (cid:80) 0 = ∂kΦf (x∗), n((x∗, f (x∗))) (cid:105) (cid:104) = 1 i )2 + (1 n i=1(s∗ k + ∂kf (x∗) s∗ n i=1 s∗ i )2 (cid:34) − 1 (cid:32) − n−1 i=1 (cid:88) s∗ i (cid:33)(cid:35) thus (cid:112)(cid:80) and also (cid:80) ∂kf (x∗) = − s∗ k n−1 i=1 s∗ i , 1 − (3.7) 1 + 2 = 1 + Df (x∗) | | 1 (cid:80) 2 = n−1 j )2 j=1 (s∗ n−1 i=1 s∗ i (cid:80) − n−1 j )2 + j=1 (s∗ 1 n−1 i=1 s∗ i 2 1 − n−1 i=1 s∗ (cid:0) (cid:80) i 2 . (cid:1) (cid:80) − Using (3.3) and the previous observations, we can rewrite the terms of Akm (cid:1) (cid:0) (cid:0) (cid:1) (cid:80) (cid:80) as ∂kmf (x∗) = = ∂kmf (x∗) 2 + 1 | 2 + 1 | Df (x∗) | Df (x∗) (cid:112) | 1 (cid:112) n−1 i=1 s∗ 1 i − (cid:113)(cid:80) (cid:1) n−1 j=1 (s∗ j )2 + 1 − n−1 i=1 s∗ i 2 km(x∗) h(cid:96) (cid:0) (cid:80) (cid:1) and (cid:0) (cid:80) [ − δkm∂kf (x∗) + ∂kf (x∗)∂mf (x∗)] δkms∗ k n−1 i=1 s∗ i ks∗ s∗ m n−1 i=1 s∗ i 2 . + 1 = 1 − − (cid:0) Now, consider the log loss λ and its translation to (cid:96)(q∗) which we denote by (cid:80) (cid:1) (cid:80) λ∗ to simplify the notation. That is, we have λ∗ = λ(p) + [(cid:96)(q∗) λ(q∗)] . − 38 CABRERA PACHECO AND WILLIAMSON As discussed in Remark 3.4, we can write Mλ∗ as a graph around x∗ (since λ∗(q∗) = (cid:96)(q∗)). The scalar second fundamental form of Mλ∗ at λ∗(q∗) is then given by (3.8) hλ∗ ij (x∗) = 1 i )2 + (1 n i=1(s∗ n i=1 s∗ i )2 − δkms∗ k + (cid:18) 1 − ks∗ s∗ m n i=1 s∗ i (cid:19) This readily implies that (cid:112)(cid:80) (cid:80) δkm∂kf (x∗) + ∂kf (x∗)∂mf (x∗)] (cid:80) n−1 i=1 s∗ i 2 hλ∗ ij (x∗). n−1 j=1 (s∗ j )2 + 1 − (cid:113)(cid:80) Therefore, (cid:96) is η-mixable at q∗ if and only if we have that (cid:80) − (cid:1) (cid:0) ij](x∗) is semi-positive definite. Since q∗ was arbitrary the result follows. ij ](x∗) [h(cid:96) − η[hλ∗ [ − = 1 (cid:0) 1 n−1 i=1 s∗ i (cid:80) (cid:1) . (cid:3) Remark 3.7. The previous comparison of second fundamental forms is pos- sible because properness forces the induced metrics by (cid:96) and λ to coincide at ij ](x∗) (see Appendix A and Remark A.3). (cid:96)(q∗) = λ∗(q∗), that is, [g(cid:96) The conclusion of Theorem 3.6 does not necessarily hold if one takes a different coordinate system. ij](x∗) = [gλ∗ In order to get a geometric interpretation (i.e., independent of coordinates) we note the following: 0 η[hλ∗ ij](x∗) [h(cid:96) ij ](x∗) − ≤ ij]−1(x∗)[g(cid:96) ij](x∗)[g(cid:96) = [h(cid:96) ij]−1(x∗) ij](x∗)[g(cid:96) [h(cid:96) = The matrices [h(cid:96) ij ](x∗)[gλ∗ ij ]−1(x∗) η[hλ∗ ij](x∗) − ij ](x∗)[gλ∗ η[hλ∗ ij ]−1(x∗)[gλ∗ ij](x∗). [g(cid:96) ij ](x∗)[gλ∗]−1(x∗) are the local ex- pression of the Weingarten map (see [Lee18] for its definition and properties) of (cid:96) and λ respectively. The eigenvalues of these matrices are the principal curvatures of M(cid:96) and Mλ (and they are independent of coordinates), and the determinants are their Gaussian curvatures. From here it also follows that − ij](x∗)[g(cid:96)]−1(x∗) and [hλ∗ ij ](x∗) (cid:0) (cid:1) 1 η (cid:20) [hη(cid:96) η =η [h(cid:96) ij](x∗)[g(cid:96) ij]−1(x∗) [hλ∗ ij ](x∗)[gλ∗ ij ](x∗)[gη(cid:96) ij ]−1(x∗) ij ](x∗)[gλ∗ ij ]−1(x∗) (cid:21) [g(cid:96) ij ]−1(x∗) [g(cid:96) ij](x∗) ij](x∗), − [hλ∗ − (cid:104) that is, (3.9) (cid:105) 0, [W η(cid:96) ij ] [W λ ij] − ≥ where W (cid:96) denotes the Weingarten map of the loss function (cid:96). Then once a ∆n is chosen the relation (3.9) holds. A system of coordinates around p ∈ THE GEOMETRY OF MIXABILITY 39 priori, the relation obtained between the Weingarten maps of (cid:96) and λ does not provide much information, but it does points to look at the loss function η(cid:96). With this in mind Lemma 3.6 does give a direct geometric interpretation ∆n as follows. Let (cid:96) : ∆n we know that around (cid:96)(q), M(cid:96) can be parametrized with Φf (x) = (x, f (x)) for some function f around the point Π((cid:96)(q)). Let x∗ = Φ((cid:96)(q)). Consider now the proper loss (cid:37) = η(cid:96), for some η > 0. We readily see that (cid:37) can be parametrized as Φg(y) = (y, g(y)) with be a proper loss. Given a point q ≥0 in −→ Rn L ∈ g(y) = ηf (η−1y), with g defined around yq = ηx∗. Now we compute the second fundamental form of (cid:37) at yq. Notice that y=ηx∗η−1 = ∂if (x∗), y=ηx∗ = η∂if (η−1x) ∂ig(y) | | y=ηx∗η−1 = η−1∂ijf (x∗), | y=ηx∗ = ∂ijf (η−1x) | ∂ijg(y) and hence, ij (ηx∗) = η−1h(cid:96)(x∗). Then assuming the hypothesis of Lemma 3.6, we obtain ij(ηx∗) = hη(cid:96) h(cid:37) (3.10) hη(cid:96) ij (ηx∗) − ij(x∗) = η−1h(cid:96) hλ ij(x∗) ij(x∗) = η−1 hλ h(cid:96)(x∗) ηhλ ij(x∗) − 0. ≥ − The supporting planes at η(cid:96)(p) and λ(p) of Mη(cid:96) (or more precisely, of its translation to λ(p)) and Mλ, respectively, coincide (since the normal vectors are the same), we denote it by Hp. By looking at Mη(cid:96) and Mλ locally as graphs over Hp, Lemma 3.6 gives the following comparison of graphs, which in turn can be regarded as local embeddability in the sense of convex geometry (see Definition 4.16 below). (cid:1) (cid:0) int(∆n) Theorem 3.8. (cid:96) the local graph of the translation of η(cid:96) to λ(p) over the supporting plane to both M(cid:96)p and Mλ at λ(p), Hp, lies above the graph of λ over Hp. n proper is η-mixable if and only if for all p ∈ L ∈ Remark 3.9. We would like to point out the resemblance of Lemma 3.6 to Theorem 10 in [vERW12]. To recover the latter from our point of view we will first reinterpret Lemma 3.6 and Theorem 3.8 from a convex geometry point of view which will lead to a transparent bridge between Lemma 3.6 and [vERW12, Theorem 10]. 4. Connections to convex geometry In this part we reinterpret our results from the point of view of convex geometry. With this interpretation we can relate Theorem 3.8 to results 40 CABRERA PACHECO AND WILLIAMSON in [vERW12] and [WC22]. We first provide some background and state rel- evant results from convex geometry which are well-known and can be found in [Sch14] and can be adapted to our setting. Let K ⊂ Rn be a convex set, that is for all x, y K and λ We define the recession cone of K as the set ∈ ∈ λx + (1 [0, 1]. λ)y K ∈ − rec(K) = x n : K + x R { ∈ K . } ⊂ The boundary of K is denoted by ∂K, as since we will assume that ∂K is a differentiable manifold we denote the interior (as a manifold) of ∂K by int(∂K). As usual the scaling of K by η > 0 and the Minkowski sum of K and L are defined as (4.1) ηK = ηk ∈ { k + l { n : k R ∈ n : k K , } K, l (4.2) K + L = R Definition 4.1. Let K be a closed convex set in Rn. The support function of K, σ(K, u) : Rn R, is defined as ∈ ∈ ∈ . L } −→ σ(K, u) = sup x∈K(cid:104) . x, u (cid:105) We sometimes denote it as σK(u) := σ(K, u). From the definition we know that K y ∈ ⇐⇒ (cid:104) y, u (cid:105) ≤ σK(u) for all u n. R ∈ From [Sch14, Section 1.7] we have the following. Lemma 4.2 (Properties of σ). Let L, K Rn be closed convex sets. ⊂ σK if and only if L (1) σL (2) σ(K + t, u) = σ(K, u) + (3) σ(K + L, u) = σ(K, u) + σ(L, u). ⊂ t, u (cid:105) (cid:104) K. ≤ for all t Rn. ∈ Definition 4.3. A function f : D Rn given by Rn ⊂ −→ R is convex if its extension to is convex. f (x) = (cid:101) f (x), if x , if x / ∈ ∞ (cid:40) D ∈ D The following lemma is a well-known result (see [Sch14, Theorem 1.7.1] for example). THE GEOMETRY OF MIXABILITY 41 Lemma 4.4. Let f : Rn → f is the support function of the convex, closed set R convex, closed and positively homogeneous, then K f = x n R x, u f (u) for all u n R . { ∈ Definition 4.5. Let L, K ⊂ summand of K if there exists a convex, closed set M M + L. | (cid:104) Rn and closed and convex. We say that L is a Rn such that K = (cid:105) ≤ ⊂ ∈ } ∗ the set of closed, convex sets whose recession cone is Rn n We will be mainly interested in sets K whose recession cone is Rn ≥0, hence ≥0. In we denote by the following we extend some common results in convex geometry which are usually stated for closed, compact convex sets in Rn (see [Sch14]), however, n ∗ [Shv01]. some of them are easily extended to K n ∗ ). Let K, L K n ∗ and η > 0. Then, ∈ K K Lemma 4.6 (Basic properties of sets in the following holds: (1) ηK ∈ K (2) rec(K + L) = Rn (3) K + L is closed, and (4) K + L ≥0, n ∗ , n ∗ . ∈ K Proof. In order to show (1), we need to show that ηK is closed, convex and rec(ηK) = Rn [0, 1], then we have ≥0. Let x, y ηK and λ ∈ λx + (1 − ∈ λ)y = η(λkx + (1 λ)ky) − λ)ky where x = ηkx and y = ηky for some kx, ky λkx + (1 K and hence ηK is convex. Let xn sequence that converges to x. Then, there exists kxn ∈ Since η is a constant, kxn} { uniqueness of the limit, x = ηx∞ ηK. Now, let x ηK. Take any k that ηK + x converges to kx∞ ∈ ∈ K, ∈ ∈ ∈ ⊂ ∈ − K. Since K is convex, then K be a convergent K such that xn = ηkxn. K (since K is closed). By the ≥0, we want to show Rn ∈ ηk + x = η k + x ηK 1 η ∈ (cid:18) rec(ηK), then for any k1 (cid:19) since 1 η x ∈ Rn ≥0. Conversely, if x K, we have ∈ then there exists k2 ∈ ∈ K, such that ηk1 + x = ηk2. Hence ∈ ηk1 + x ηK k1 + x = k2, 1 η Rn ≥0. thus 1 η x ∈ rec(K) = Rn ≥0, thus x ∈ 42 CABRERA PACHECO AND WILLIAMSON To show (2), let x K and l k ∈ ∈ ∈ L, then L. Thus Rn since l + x ≥0 ⊂ ∈ Rn rec(K + L) such that x / ∈ rec(K + L). Let k have λx ∈ Rn ≥0. We want to show that K + L + x K + L. Let ⊂ k + l + x K + L, ∈ rec(K + L). Now, suppose that there is x ∈ ≥0. Since rec(K + L) is a cone, for all λ > 0, we K and l L. Then ∈ k + l + λx ∈ K + L K. ⊂ ∈ Thus (cid:96)+λx since by picking λ sufficiently large, l + λx / ∈ rec(K) = Rn ∈ ≥0 for all λ > 0, but notice that this is a contradiction Rn ≥0. Thus rec(K + L) = Rn ≥0. For (3), see Rockafellar [Roc70] Thm. 8.2 and [Shv01] Thm. 3.1. (4) is simply the combination of (2) and (3) (and the fact that K + L is convex). (cid:3) n ∗ . First, We now specialize the discussion to a particular type of sets K suppose that the boundary ∂K is of class C 2, then at each point x int(∂K) there is an outward pointing normal vector uK(x). Thus, clearly, we can define Sn−1 assigning uK(x) to x a map uK : int(∂K) n ≤0 = n : x = (x1, ..., xn), with xi ∈ 0 for i = 1, ..., n int(∂K). We define ∈ K ∈ −→ R R , ≤ } x { ∈ so that n int(R ≤0) = ∩ x ∈ R n : x = (x1, ..., xn), with xi < 0 for i = 1, ..., n n = R <0. { n Definition 4.7. Define C 2 ∗ with bound- +( ary ∂K of class C 2, and such that the map uK is a C 1-diffeomorphism from n−1 int(∂K) to S − n ∗ ) as the collection of sets K K Rn := Sn−1 ∈ K <0. } We now specialize some properties of the support function to C 2 +( n ∗ ). K Lemma 4.8. If K C 2 +( ∗ ), then dom(σK) = int(Rn n ≤0) ∈ K . 0 } ∪ { = 0 in dom(σK), then it must be an outward normal vector . Now, for n−1 − Proof. Take u to int(∂K), hence it is in S u and thus it must be a normal vector form some x function evaluated at v is finite, and in consequence σK(u) is finite too. int(Rn 0 ≤0) ∪ { } , then v u <0, normalize it to make it unitary by letting v = u/ | | int(∂K), hence the support (cid:3) n−1 − . Then dom(σK) Rn ⊂ ∈ ∈ ∈ S Remark 4.9. Following Schneider [Sch14, Section 2.5] the condition K C 2 +( zero. It also follows that ∈ n ∗ ) is equivalent to assuming the principal curvatures of ∂K to be non- K |S and moreover, σK is of class C 2. σK(u) n−1 − = u−1 (cid:104) , K (u), u (cid:105) Remark 4.10. Let (cid:96) ∈ L Remark 4.9 implies spr((cid:96)) n be a proper loss function. By definition we see that C 2 +( n ∗ ) (since M(cid:96) = ∂(spr((cid:96)))). ∈ K (cid:54) THE GEOMETRY OF MIXABILITY 43 C 2 +( Definition 4.11. Let K, L to each boundary point x of K, there exists a translation vector t that x n). We say that L slides freely inside K if Rn, such L + t K. K ∈ ∈ ∈ ⊂ Theorem 4.12. Let K, L freely inside K. C 2 +( K ∈ n ∗ ). L is a summand of K, then L slides Proof. Suppose that there exists M x ∂K. Then there are l ∈ L and m C 2 +( M such that ∈ K n ∗ ) such that K = L + M . Let ∈ ∈ ∈ x = l + m. Thus, x L + m L + M = K. (cid:3) ∈ ⊂ n ∗ ) Remark 4.13. For a general convex set L, if L is a summand of K we see that the previous proof holds an we conclude that L slides freely inside K; note however that this imposes restrictions on possible sets L. One of this consequences is that the principal curvatures of ∂L must be positive as can be seen from a second fundamental form comparison and Theorem 3.8. C 2 +( K ∈ Lemma 4.14. Let K, L convex. Then the set ∈ C 2 −( K n ∗ ) and suppose that f ( ) = σK( * ) * σL( ) is * − M = x { ∈ n R x, u | (cid:104) (cid:105) ≤ f (u) for all u n R , } ∈ K n ∗ ), and it is such that K = M + L, that is, L and M are summands is in C 2 +( of K. Proof. From Lemma 4.8, the domain of f is Rn R is convex. Thus it is the support function of M (by Lemma 4.4). That is, f ( 0 <0 ∪{ } −→ , i.e., f : Rn 0 <0 ∪{ } σL, and hence K = M + L. Note that M is a summand of K, then using Theorem 4.12 we know that M slides freely inside K, and since ∂K has positive principal curvatures then ∂M does too (cid:3) (Remark 4.13). Since σM is of class C 2, then M has to be in C 2 −( n ∗ ). − ) = σM ( * Therefore we have σM = σK ). * Theorem 4.15. [[Sch14, Theorem 1.5.2]] Let D −→ R be a continuous function. Suppose that for each point x0 D there are an affine function g on Rn and a neighborhood U of x0 such that f (x0) = g(x0) and f Rn convex and let f : D D. Then f is convex. g in U ⊂ ∈ K ≥ ∩ Definition 4.16. We say that L is locally embeddable in K if for all x y L and a neighborhood U of y, such that (L there is a y U ) + x ∈ Theorem 4.17. Let K, L embeddable in K, then L is a summand of K. C 2 −( K ∈ n ∗ ) and L strictly convex. If L is locally ∩ − ∂K, K. ∈ ⊂ n−1 Proof. Let u0 − is locally embeddable in K there are y0 ∂K be a point such that u(x0) = u0. Since L L and a neighborhood U0 of y0 such and x0 ∈ ∈ S ∈ 44 CABRERA PACHECO AND WILLIAMSON ∩ U0) + x0 L : S y0 that (L exists a neighborhood V0 of u0 such that u−1 σ(L + x0 y0, u0) = σ(K, u0) and σ(L + x0 by Lemma 4.2. K. Since u−1 − ⊂ − n−1 − −→ ⊂ y0, u) K (V0) − ≤ ∂L is continuous, there U0. Then it follows that V0 σ(K, u) for all u ∈ Let f ( ) = σ(K, * ) (this is defined on Rn σ(L, * − x ) = homogeneous), and g( (cid:104) * (i) f (u0) = g(u0), since 0 } . Then, clearly, we have ≤0 ∪ { ) * y, − *(cid:105) and is positively f (u0) = σ(K, u0) = σ(K, u0) = g(u0). − − σ(L, u0) σ(L + x0 y0, u0) + x0 (cid:104) − y0, u0 (cid:105) − (ii) f ≥ g on V0, f (u) = σ(K, u) = σ(K, u) g(u). ≥ σ(L, u) σ(L + x0 − − y0, u) + x0 (cid:104) y0, u (cid:105) − − It follows by Theorem 4.15 that f is convex, and by Lemma 4.14 we conclude (cid:3) that L is a summand of K. The following lemma is a direct consequence of the characterization of mix- ability in Theorem 3.8 and Definition 4.16. Lemma 4.18. Let (cid:96) spr(η(cid:96)) is locally embeddable in spr(λ). ∈ L n be a proper loss. For η > 0, if (cid:96) is η-mixable then Lemma 4.19. If (cid:96) is η-mixable then spr(η(cid:96)) slides freely inside spr(λ). Proof. Let (cid:96) be η-mixable, then Lemma 4.18 implies spr(η(cid:96)) it is locally embed- dable in spr(λ). Then Theorem 4.17 implies it is a summand and Theorem 4.12 (cid:3) implies it slides freely inside spr(λ). n Corollary 4.20. Let (cid:96) be a η-mixable proper loss. Then spr(η(cid:96)) ∗ ) and it slides freely inside spr(λ) (λ is the log loss). Additionally, there exists M C 2 −( K ∈ n ∗ ) such that C 2 −( ∈ K spr(λ) = spr(η(cid:96)) + M. Moreover, ∂M can be regarded as (cid:37)(∆n) for a 1-mixable proper loss (cid:37). Proof. Since (cid:96) is an η-mixable proper loss function, η(cid:96) is also a proper loss n function and hence spr(η(cid:96)) ∗ ) (Remark 4.10). Theorem 3.8 implies that spr(η(cid:96)) is locally embeddable in spr(λ). From Theorem 4.17 we know that spr(η(cid:96)) is a summand of spr(λ), which proves the existence of M . As a consequence, M is a convex set with recession cone Rn ≥0 (Lemma 4.14). By applying [WC22, Proposition 21] we can regard ∂M as the image of a proper C 2 −( K ∈ THE GEOMETRY OF MIXABILITY 45 loss function (cid:37), which since spr((cid:37)) is a summand of spr(λ) it is 1-mixable (cid:3) (Lemma 4.14). We now state [Sch14, Theorem 2.5.4] adapted to our setting which will be helpful to relate our work to [vERW12]. ∗ ). Let hM (x) denote the second fundamen- n Theorem 4.21. Let K, L tal form of M at x with respect to u (see (A.2)). The following are equivalent: C 2 −( K ∈ (i) h∂L(x) (ii) σK ≥ − σL is a support function. h∂K(y) for all pairs of points x and y at which u(x) = u(y). Since ∆n is an affine manifold, the geodesics in ∆n are simply straight lines. This allows to define convexity of functions defined on ∆n in the usual way we do for functions on Rn. The following theorem connects and reconciles our results to those in [vERW12]. More precisely, we create a bridge between our results and [vERW12, Theorem 10]. Theorem 4.22. Let (cid:96) and only if ηL(cid:96)( Lλ( ) * risk of the loss function (cid:37) (Definition 1.3) and λ denotes the log loss. n be proper loss. Let η > 0, then (cid:96) is η-mixable if ∈ L ) is convex on int(∆n), where L(cid:37)( ) denotes the Bayes * * − n which is η-mixable. By Lemma 4.19 Proof. Suppose that (cid:96) is a proper loss in hλ(λ(p)). By spr(η(cid:96)) slides freely inside spr(λ) and in particular hη(cid:96)((cid:96)(p)) σspr(η(cid:96)) is a support function with domain Theorem 4.21 it follows that σspr(λ) Rn <0, such that the outward normal vector of (cid:96)(∆n) and λ(∆n) at (cid:96)(p) and λ(p), respectively, is u. Then we have for x = − , in particular it is convex on its interior. Let u 0 <0 ∪ { } ≥ Rn ∆n, L ∈ σspr(λ)(x) − p − ∈ σspr(η(cid:96))(x) = = = = = = which proves the claim. − σspr(η(cid:96))(x/ x | x η(cid:96)(p), x/ | η(cid:96)(p), )) | ) |(cid:105) p p/ | − x | x | p | − ) | (σspr(λ)(x/ x | | x λ(p), x/ ( |(cid:105) − (cid:104) | (cid:104) | p p/ λ(p), ( | (cid:104) | η(cid:96)(p), λ(p), p − λ(p), p (cid:105) Lλ(p) + ηL(cid:96)(p), (cid:105) − (cid:104) + − η(cid:96)(p), p (cid:105) (cid:104) |(cid:105) − (cid:104) − −(cid:104) (cid:104) p (cid:105) ) |(cid:105) (cid:3) Suppose now that for given (cid:96) n proper, there exists a η > 0 such that spr(η(cid:96)) slides freely inside spr(λ). Note that in particular this implies that int(∆n) we spr(η(cid:96)) is locally embeddable in spr(λ), and hence for each p have ∈ L ∈ hη(cid:96)(η(cid:96)(p)) hλ(λ(p)) 0, ≥ − 46 CABRERA PACHECO AND WILLIAMSON which by (3.10) and Lemma 3.6 implies that (cid:96) is η-mixable. Thus combining this with Lemma 4.19 we obtain the following characterization of mixability of proper (sufficiently differentiable) loss functions. Theorem 4.23. Let (cid:96) slides freely inside spr(λ), where λ denotes the log loss. n be proper. (cid:96) is η-mixable if and only if spr(η(cid:96)) ∈ L L In general, the set provides a family of loss functions with appealing , properties. Arguably, one of the most important properties is that given (cid:96) ∈ L if we assume that (cid:96) is proper then we know its principal curvatures are strictly positive. This is a strong and useful geometric feature. For example, in [WC22] the notion of a "inverse loss" called the anti-polar loss was investigated. Given (cid:96) a proper loss (in the sense of [WC22], which are not necessarily smooth), they consider the 0-homogeneous extension of (cid:96) (see Remark 26 in [WC22]), defined on Rn >0 and given by p p 1 (cid:19) (cid:107) 1 = p1 + ... + pn. For the following we simply denote (cid:96)ext by (cid:96). Rn ≥0 where In [WC22, Proposition 29] it is shown that there exists a map (cid:96)(cid:5) : R>0 such that (cid:96)ext(p) := (cid:96) −→ (cid:18) (cid:107) (cid:107) (cid:107) p , (cid:96)(p) = ((cid:96) ◦ (cid:96)(cid:5)(x) = ((cid:96)(cid:5) (cid:96)(cid:5) (cid:96) ◦ ◦ ◦ (cid:96))(p) (cid:96)(cid:5))(x), ∈ >0. The map (cid:96)(cid:5) is called the anti-polar loss of (cid:96). For the Rn for all x, p family of admissible loss function considered in this work, we exploit the differentiability conditions to obtain in a straightforward way an inverse loss defined on (cid:96)(int(∆n)). To see this, suppose that (cid:96) is proper. Since this is equivalent to saying that spr((cid:96)) is in C 2 n ∗ ), meaning that the map uspr((cid:96)) is +( C 1 diffeomorphism. Then we can define the map (cid:96)−1 : (cid:96)(int(∆n)) int(∆n) by ∈ L −→ K L (cid:96)−1(x) := u∂spr((cid:96))(x) uspr((cid:96))(x) , 1 (cid:107) (cid:107) which is the inverse of the map (cid:96) : int(∆n) is nothing else than the unit normal vector (pointing towards Rn (cid:96)(int(∆n)). −→ (cid:96)(int(∆n)). Recall that u∂spr((cid:96))(x) ≥0) at x ∈ It is of interest of finding parametrizations (or links) that simplify the ex- pression of a given proper loss (cid:96). At a theoretical level there are potentially many ways to to this. Notably we have at hand the notion of canonical link in [WVR16] (or see Section 2.7 above for n = 2). As an example of other ways to obtain nice links we have Lemma 3.3 above, which gives a nice expression in coordinates (as the form of a graph) of (cid:96). Unfortunately, to obtain that THE GEOMETRY OF MIXABILITY 47 results one makes uses of the inverse function theorem which does not provide an explicit inverse but rather its existence. We summarize the main messages of this work. 5. Conclusions • • • • • Since mixable loss functions are of great importance in prediction games, it is desirable to understand them from different perspectives. Inspired by the work of Vovk [Vov15], in Section 2 we studied binary loss functions from the point of view of differential geometry, hence restricting to loss functions in (Definition 2.1). To do this, we re- interpret properness as a geometric property, namely, a loss function (cid:96) is proper if and only if L ≥0) to M(cid:96) = (cid:96)(int(∆2)) at (cid:96)(p) ∈ L – the normal vector (belonging to R2 is p |p| , for any p int(∆2), and ∈ – the loss curve (cid:96)(int(∆2)) has positive curvature (with respect to p |p| ). ∈ L Having this framework at hand, we characterized mixability and fun- , as a curvature comparison to the damentality of a proper loss (cid:96) log loss (cid:96)log (cf. [Vov15]). In Section 3, we extended the geometric characterization of proper loss functions to higher dimensions, and obtained the corresponding interpretation of mixability as a geometric comparison (now in terms of the principal curvatures of the "loss surface"). This comparison is done by using the second fundamental forms of the "loss surfaces". The main goal of Section 4 is to re-interpret the geometric results in Section 3 from the point of view of convex geometry. The main result in this part is a new characterization of η-mixability of a proper loss function (cid:96) , as spr(η(cid:96)) sliding freely inside spr((cid:96)log) (in general dimension). This provides an intuitive and geometric way to interpret mixability. Since the results obtained in this work are in terms of curvature, it was necessary to re-interpret well known properties of loss functions in the language of differential geometry. Although this task might seem tedious at first, it is well worth it since it reconciles the re- sults obtain by Vovk [Vov15] for n = 2 and by van Erven, Reid and Williamson [vERW12] for n It is worth to point out the relation of this work with [vERW12]. Specif- ically, the bridge between these to works established by Theorem 4.22 connects our results to Theorem 10 in [vERW12] in the following way. In [vERW12, Theorem 10] the following statements are proven to be equivalent: ∈ L ≥ 2. 48 CABRERA PACHECO AND WILLIAMSON Φ−1 std(int(∆n)), ∈ (i) a proper loss (cid:96) L(t) (ii) ηH H ∈ L is η-mixable, Llog(t) is positive semi-definite for all t where HF (t) denotes the Hessian of F at t, − Llog(p) is convex on int(∆n), and Llog(p) is convex on Φ−1 std(int(∆n)). (iii) ηL(p) (cid:101) L(p) (iv) η (cid:101) − − (cid:101) (cid:101) There, they first proved the equivalence of (i) and (ii), which is the result of a long direct computation done very carefully. The equiva- lence between (iii) and (iv) is straightforward. To connect these two sets of equivalences, standard convex geometry is used to prove the equivalence of (ii) and (iii). Note that the statements (ii) and (iv) make reference to a precise choice of parametrization of ∆n (i.e., the standard parametrization Φstd), therefore, the work presented here is naturally not related to these statements but rather to (i) and (iii), whose equivalence can be considered to be the content of Sections 3 and 4. Determining whether this new approach provides a simplifica- tion of the computations in [vERW12] or not, strongly depends on the differential geometry and convex geometry background of the reader. This work should be considered as complementing the understanding of mixable loss functions and providing a new geometric insight into them. References [BSS05] [dC16] Andreas Buja, Werner Stuetzle, and Yi Shen. Loss functions for binary class probability estimation and classification: Structure and applications. Technical report, University of Pennsylvania, 2005. Manfredo P. do Carmo. Differential geometry of curves & surfaces. Dover Pub- lications, Inc., Mineola, NY, 2016. Revised & updated second edition of [ MR0394451]. [HKW95] David Haussler, Jyrki Kivinen, and Manfred K. Warmuth. Tight worst-case loss bounds for predicting with expert advice. In Computational learning theory (Barcelona, 1995), volume 904 of Lecture Notes in Comput. Sci., pages 69–83. Springer, Berlin, 1995. [Lee18] [HKW98] David Haussler, Jykri Kivinen, and Manfred K. Warmuth. Sequential prediction of individual sequences under general loss functions. IEEE Transactions on Information Theory, 44(5):1906–1925, 1998. John M. Lee. Introduction to Riemannian manifolds, volume 176 of Graduate Texts in Mathematics. Springer, Cham, 2018. Second edition of [ MR1468735]. Zakaria Mhammedi and Robert C Williamson. Constant regret, generalized mixability, and mirror descent. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. [MW18] [RFWM15] Mark D. Reid, Rafael M. Frongillo, Robert C. Williamson, and Nishant Mehta. Generalized mixability via entropic duality. In Peter Gr ̈unwald, Elad Hazan, THE GEOMETRY OF MIXABILITY 49 [Roc70] [RW10] [SAM66] [Sch14] [Shv01] and Satyen Kale, editors, Proceedings of The 28th Conference on Learning The- ory, volume 40 of Proceedings of Machine Learning Research, pages 1501–1522, Paris, France, 03–06 Jul 2015. PMLR. R. Tyrrell Rockafellar. Convex analysis. Princeton Mathematical Series, No. 28. Princeton University Press, Princeton, N.J., 1970. Mark D. Reid and Robert C. Williamson. Composite binary losses. J. Mach. Learn. Res., 11:2387–2422, 2010. Emir H. Shuford, Arthur Albert, and H. Edward Massengill. Admissible prob- ability measurement procedures. Psychometrika, 31(2):125–145, 1966. the Brunn-Minkowski theory, volume 151 of Rolf Schneider. Convex bodies: Encyclopedia of Mathematics and its Applications. Cambridge University Press, Cambridge, expanded edition, 2014. A. P. Shveidel. Recession cones of star-shaped and co-star-shaped sets. In Op- timization and related topics (Ballarat/Melbourne, 1999), volume 47 of Appl. Optim., pages 403–414. Kluwer Acad. Publ., Dordrecht, 2001. [vERW12] Tim van Erven, Mark D. Reid, and Robert C. Williamson. Mixability is Bayes [Vov98] [Vov01] [Vov15] [VZ09] [WC22] risk curvature relative to log loss. J. Mach. Learn. Res., 13:1639–1663, 2012. V Vovk. A game of prediction with expert advice. Journal of Computer and System Sciences, 56(2):153–173, 1998. Volodya Vovk. Competitive on-line statistics. International Statistical Review / Revue Internationale de Statistique, 69(2):213–248, 2001. Vladimir Vovk. The fundamental nature of the log loss function. In Lev Bek- lemishev, Andreas Blass, Nachum Dershowitz, Berndt Finkbeiner, and Wolfram Schulte, editors, Lecture Notes in Computer Science, volume 9300 of Lecture Notes in Computer Science, pages 307–318. Springer, 2015. Vladimir Vovk and Fedor Zhdanov. Prediction with expert advice for the Brier game. J. Mach. Learn. Res., 10:2445–2471, 2009. Robert C. Williamson and Zac Cranko. The geometry and calculus of losses, 2022. arXiv:2209.00238. [WVR16] Robert C. Williamson, Elodie Vernet, and Mark D. Reid. Composite multiclass losses. J. Mach. Learn. Res., 17:Paper No. 223, 52, 2016. Appendix A. Differential Geometry In this part we provide a brief summary of the concepts of differential geom- etry that are used in this work (we assume the reader has some familiarity with the topic although we try to put emphasis on the intuition). We do not intend to give a comprehensive introduction to the topic. Most of the material can be found in almost any differential geometry book, however, we recommend (and when possible use the notation of) [dC16] and [Lee18]. → A.1. Curvature of Curves. A parametrized curve is a differentiable map Rn, (a < b). We are interested in studying the geometry of α : (a, b) parametrized curves. For this it would be useful to restrict our discussions to curves with a well defined tangent line at every point α(t) for t (a, b) (i.e., with non-vanishing α(cid:48)(t)). These curves are called regular. Let φ : (a, b) → (c, d) be a diffeomorphism, the curve β = α(φ(s)) is a reparametrization of ∈ 50 CABRERA PACHECO AND WILLIAMSON α. Note that in this case α((a, b)) = β((c, d)). The image M = α((a, b)) is a 1-dimensional differentiable manifold in Rn (for this it is essential to restrict to regular curves). The study of curves is of particular importance since some aspects are carried to the study of the geometry of general hypersurfaces in Rn. β(cid:48)(s) | = 1 for all s Typically, curvature is defined for curves parametrized by arc-length mean- ing that (c, d) (and a regular curve can always be parametrized this way). For these types of curves, the curvature of β at β(s) is defined as the length of β(cid:48)(cid:48)(s), which measures "how much" a curve "curves". However, this notion does not give information about the direction on which a curve is "curving". We start looking at the case n = 2. We define the signed curvature of a general curve α(t) = (x1(t), x2(t)) by (cf. (1.5)) ∈ | κα(t) := 1(t)x(cid:48)(cid:48) x(cid:48) (x(cid:48) 2(t) − 1(t)2 + x(cid:48) x(cid:48)(cid:48) 1(t)x2(t) 2(t)2)3/2 . κ(t) | coincides with the curvature of α when parametrized It can be checked that by arc-length (at the corresponding point), the signed curvature is well defined up to a sign (the sign will change if we consider a reparametrization that re- a) given by verses the order of (a, b), for example a curve defined on ( β(s) = α( − s)), which motivates the discussion in Section 1.5. − b, | For example, suppose that a planar curver is defined by a function f : (a, b) − R is the following way: −→ α(t) = (t, f (t)), (a, b). A quick computation gives κα(t) = f (cid:48)(cid:48)(t) (1 + f (cid:48)(t)2)3/2 . for t ∈ (A.1) Given a regular curve α : (a, b) = 0, it is straightforward to see that the curve β(t) = ηα(t) is also a regular curve and its signed curvature is given by R3 as above and a real number η −→ κβ(t) = η2x(cid:48) 1(t)x(cid:48)(cid:48) 2(t) − η2x(cid:48)(cid:48) 1(t)x2(t) 2(t)2)3/2 = 1 η κα(t). (η2x(cid:48) 1(t)2 + η2x(cid:48) The notion of signed curvature can be extended to curves in manifolds sit- ting inside Rn (see for example [Lee18, Chapter 8]). For α( Rn −→ parametrized by arc-length, the signed curvature (with respect to n) κ+ α of α n, α(cid:48)(cid:48)(0) at p = α(0) is given by κ+ . It can be shown that this definition (cid:105) agrees with the one we gave for n = 2. α (0) = ε, ε) − (cid:104) (cid:54) THE GEOMETRY OF MIXABILITY 51 − M there is an open set U A.2. Geometry of hypersurfaces in Rn. Let M be a differentiable hyper- 1-dimensional C k manifold). By this surface inside Rn of class C k (i.e., a n Rn−1 and a C k injective we mean that for each p map Φ : U U , forms a basis for the tangent space TqM (q = Φ(x)) to ∂1Φ(x), ..., ∂n−1Φ(x) { } Rn we can consider the induced metric on M by the M at q. Since Φ(U ) ⊂ Euclidean metric in Rn (denoted by ). This is a Riemannian metric on M given on the coordinates given by Φ by the matrix M (called a parametrization of M around p). For each x , (cid:104)* −→ ⊂ *(cid:105) ∈ ∈ gij(x) = , ∂iΦ(x), ∂jΦ(x) (cid:105) (cid:104) ∈ for x U . The metric g allows us to define the length of a curves in M . In general, if a manifold M of dimension n 1 is sitting inside an n- dimensional Riemannian manifold M (and M is endowed with the induced metric from M ) the second fundamental form carries the information on how M is "curved" inside M . Let g be the metric on M and g the induced metric on M by g. Let denote the Levi–Civita connection of g. Let n be a smooth unit normal vector field to M (that is n(p) is perpendicular to TpM for each p M ). The scalar second fundamental form of M with respect to n is the covariant 2-tensor h on M defined as ∇ − ∈ (A.2) h(X, Y ) = n, XY = (cid:104) ∇ (cid:105) −(cid:104)∇ Xn, Y . (cid:105) for X, Y tangent vectors to M . Note that for a hypersurface, at each point we have exactly to unit normal vectors to M at p, thus the scalar second fundamental form is well-defined up to a sign. Fixing a point p M and an for the tangent space at p TpM , the eigenval- orthonormal basis ues of the matrix given by hij = h(Ei, Ej) for i, j = 1, ..., n 1 are called the principal curvatures of M at p and the corresponding eigenspaces are called the principal directions. For details of the above see Chapter 8 in [Lee18]. E1, ..., En−1 { − ∈ } When M = Rn and M is parametrized by Φ : U Rn, −→ of Φ(U ), the scalar second with respect to the local frame fundamental form with respect to a normal unit vector field n is given by ([Lee18, Proposition 8.23]) ∂1Φ, ..., ∂n−1Φ { Rn−1 M ⊂ ⊂ } (A.3) hij = h(∂iΦ, ∂jΦ) = ∂ijΦ, n (cid:104) , (cid:105) for i, j = 1, ..., n Given any p 1. M and v − M of M ∈ ∈ passing through p with velocity v at p. Let M1 and M2 be two hypersurfaces in Rn+1 tangent at a point p M2. Choose a normal vector n and ∩ suppose that M1 lies above M2 (with respect to n). We have the following lemma from [Lee18]. TpM , there a geodesic γV : (a, b) −→ M1 ∈ With the previous lemma we can obtain a comparison result for manifolds with positive principal curvatures. 52 CABRERA PACHECO AND WILLIAMSON M2 and Lemma A.1. Suppose that M1 and M2 are tangent at p fix a normal vector n at p. Suppose that M1 and M2 have positive principal curvatures at p. Then h1(v, v) TpM if and only if M1 h2(v, v) for all v lies above M2 (with respect to n) locally around p. M1 ≥ ∈ ∈ ∩ Proof. First we make the following observation. Suppose that M is a smooth hypersurface in Rn and we have a regular curve α : ( M such that −→ α(0) = p and α(cid:48)(0) = v for some p TpM . Then, letting h denote the second fundamental form of M from (A.2) we have M and v ε, ε) − ∈ ∈ vn, v −(cid:104)∇ d(n (cid:105) α) −(cid:104) ◦ dt (t), α(cid:48)(t) h(v, v) = = = t=0 (cid:105) (cid:12) (cid:12) (cid:12) (cid:12) t=0 (cid:12) (cid:12) (cid:12) (cid:12) Thus, if α is parametrized by arc-length, h(v, v) = = α)(t), α(cid:48)(cid:48)(t) (cid:105) (n ◦ (cid:104) n, α(cid:48)(cid:48)(0) . (cid:105) (cid:104) | = κ+ n, α(cid:48)(cid:48)(0) (cid:105) (cid:104) α (0). Suppose M1 lies above M2 are tangent at p and let v TpM1 = TpM2 with = 1. Then we can intersect M1 and M2 with the plane generated by v v | and n. Then we obtain two curves α1 and α2 on M1 and M2, respectively, such that αi(0) = p and α(cid:48)(0) = v for i = 1, 2. Moreover, we can assume that these curves are parametrized by arc-length so its Euclidean curvature is . Since we can regard these curves as planar curves, there given by (cid:105) are functions f1 and f2 such that the curves α1 and α2 are represented in the plane by the curves i (0), n α(cid:48)(cid:48) (cid:104) v, n ∈ (cid:104) (cid:105) γ1(x) = (x, f1(x)) γ2(x) = (x, f2(x)), i(0) = v, f (cid:48)(cid:48) with fi = (0), f (cid:48) curvatures at p) for i = 1, 2. By construction κ+ κ+ , for i = 1, 2. (0) = γi (cid:105) If M1 lies above M2 at p, then f (cid:48)(cid:48) i (0), n α(cid:48)(cid:48) (cid:104) i (0) > 0 (since M1 and M2 have positive principal γ1(0) = f (cid:48)(cid:48) i (0) and by definition 1 (0) > f (cid:48)(cid:48) h2(v, v) for any v 2 (0) and hence κ+ TpM with κ+ γ2(0), ≥ = 1. Let γ1(0) v | | ∈ which is equivalent to h1(v, v) w ≥ TpM be arbitrary, then = 0 ∈ (A.4) h1(w, w) = as claimed. w | 2h1 | , w w | | w w | (cid:18) |(cid:19) w ≥ | 2h2 | , w w | | w w | (cid:18) |(cid:19) = h2(w, w), Conversely if (A.4) holds, then we see that in particular holds for unitary TpM . This (cid:3) v, which ultimately means that f (cid:48)(cid:48) implies that M1 lies above M2. f (cid:48)(cid:48) 2 (0) for all unitary v 1 (0) ≥ ∈ (cid:54) THE GEOMETRY OF MIXABILITY 53 We present the following instructive example. Example A.2. Consider the differentiable function fκ(x, y) = κ(x2 + y2) with κ > 0, and let Mκ = . We choose the parametrization Φκ(x) = (x, fκ(x)) of Mκ and compute the scalar second fun- damental form of Mκ at p = (0, 0, 0) in these coordinates. We have (x, y, fκ(x, y)) B1(0) } (x, y) ∈ { | ∂xΦ(x, y) = (1, 0, 2κx), ∂yΦ(x, y) = (0, 1, 2κy), ∂xxΦ(x, y) = (0, 0, 2κ), ∂xyΦ(x, y) = (0, 0, 0), ∂yyΦ(x, y) = (0, 0, 2), thus from (A.3) at the point Φκ(0, 0) = (0, 0, 0), the scalar second fundamental form of Mκ with respect to n = (0, 0, 1) is given by [hfκ](p) = and in particular for κ = 1 we have 2κ 0 2κ 0 (cid:19) , (cid:18) Thus, clearly we have [hf1](p) = 2 0 0 2 . (cid:19) (cid:18) (A.5) [hfκ](0) − [hf1](0) = 2κ 2 − 0 2κ 0 (cid:18) 2 (cid:19) − which is positive definite if and only if κ > 1 (when Mκ lies inside M1 and are tangent at p). Remark A.3. We stress a technical observation. The comparison (A.5) in Ex- ample A.2 is valid since regardless of the value of κ, ∂xΦκ(0, 0) and ∂yΦκ(0, 0) are the same, meaning that we can identify the tangent spaces to Mκ and M1 at p for all κ, and the basis for them is given by . In general this is not necessarily the case so one should perform a change of basis before comparing the second fundamental forms. ∂xΦ1(0, 0), ∂yΦκ(0, 0) } { Email address: [email protected] Universt ̈at T ̈ubingen, T ̈ubingen AI Center Email address: [email protected] Universt ̈at T ̈ubingen, T ̈ubingen AI Center
http://arxiv.org/abs/2302.11893v1
2023-02-23T09:57:48
2023-02-23T09:57:48
A framework for benchmarking class-out-of-distribution detection and its application to ImageNet
When deployed for risk-sensitive tasks, deep neural networks must be able to detect instances with labels from outside the distribution for which they were trained. In this paper we present a novel framework to benchmark the ability of image classifiers to detect class-out-of-distribution instances (i.e., instances whose true labels do not appear in the training distribution) at various levels of detection difficulty. We apply this technique to ImageNet, and benchmark 525 pretrained, publicly available, ImageNet-1k classifiers. The code for generating a benchmark for any ImageNet-1k classifier, along with the benchmarks prepared for the above-mentioned 525 models is available at https://github.com/mdabbah/COOD_benchmarking. The usefulness of the proposed framework and its advantage over alternative existing benchmarks is demonstrated by analyzing the results obtained for these models, which reveals numerous novel observations including: (1) knowledge distillation consistently improves class-out-of-distribution (C-OOD) detection performance; (2) a subset of ViTs performs better C-OOD detection than any other model; (3) the language--vision CLIP model achieves good zero-shot detection performance, with its best instance outperforming 96% of all other models evaluated; (4) accuracy and in-distribution ranking are positively correlated to C-OOD detection; and (5) we compare various confidence functions for C-OOD detection. Our companion paper, also published in ICLR 2023 (What Can We Learn From The Selective Prediction And Uncertainty Estimation Performance Of 523 Imagenet Classifiers), examines the uncertainty estimation performance (ranking, calibration, and selective prediction performance) of these classifiers in an in-distribution setting.
[ "Ido Galil", "Mohammed Dabbah", "Ran El-Yaniv" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11893v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11893v1", "@rel": "related", "@type": "application/pdf" } ]
[ "International Conference on Learning Representations (2023)" ]
{ "@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 3 9 8 1 1 . 2 0 3 2 : v i X r a A FRAMEWORK FOR BENCHMARKING CLASS-OUT-OF-DISTRIBUTION DETECTION AND ITS APPLICATION TO IMAGENET Ido Galil* Technion [email protected] Mohammed Dabbah* Amazon [email protected] Ran El-Yaniv Technion, Deci.AI [email protected] ABSTRACT When deployed for risk-sensitive tasks, deep neural networks must be able to detect instances with labels from outside the distribution for which they were trained. In this paper we present a novel framework to benchmark the ability of image classifiers to detect class-out-of-distribution instances (i.e., instances whose true labels do not appear in the training distribution) at various levels of detection difficulty. We apply this technique to ImageNet, and benchmark 525 pretrained, publicly available, ImageNet-1k classifiers. The code for generating a benchmark for any ImageNet-1k classifier, along with the benchmarks prepared for the above-mentioned 525 models is available at https://github.com/mdabbah/COOD benchmarking. The usefulness of the proposed framework and its advantage over alternative existing benchmarks is demonstrated by analyzing the results obtained for these models, which reveals numerous novel observations including: (1) knowledge distillation consistently improves class-out-of-distribution (C-OOD) detection performance; (2) a subset of ViTs performs better C-OOD detection than any other model; (3) the language-vision CLIP model achieves good zero-shot detection performance, with its best instance outperforming 96% of all other models evaluated; (4) accuracy and in-distribution ranking are positively correlated to C-OOD detection; and (5) we compare various confidence functions for C-OOD detection. Our companion paper, also published in ICLR 2023 (Galil et al., 2023), examines the uncertainty estimation performance (ranking, calibration, and selective prediction performance) of these classifiers in an in-distribution setting. 1 Introduction Deep neural networks (DNNs) show great performance in a wide variety of application domains including computer vision, natural language understanding and audio processing. These models are trained on data coming from a certain distribution P (X, Y ), usually with the assumption that test points will be sampled from the same distribution. When the underlying distribution P (X, Y ) of test points is different from the one used to train a model, we may no longer expect the same performance from the model. The difference in distribution may be the result of many processes such as natural deviation in the input space X , noisy sensor readings of inputs, abrupt changes due to random events, newly arrived or refined input classes, etc. Here we distinguish between input distributional changes in PX|Y and changes in the label distribution. We focus on the latter case and consider the class-out-of-distribution (C-OOD) scenario, AKA open-set recognition (Scheirer et al., 2013), where the label support set Y changes to a different set that includes the set YOOD, containing new classes not observed in training. Consider the detection task in which our model is required to distinguish between samples belonging to classes it has seen in training, where x ∼ P (x|y ∈ YID), and samples belonging to novel classes, i.e., x ∼ P (x|y ∈ YOOD). The question we now ask is: how should models be evaluated to most accurately reflect their detection performance? We aim to benchmark the detection performance of DNN classification models that use their confidence rate function κ *The first two authors have equal contribution. (e.g., softmax response; see Section 2) to detect OOD labels, where the basic premise is that instances whose labels are in YOOD are assigned lower κ values. Most works on OOD detection use small-scale datasets that generally do not resemble the training distribution and, therefore, are easy to detect. The use of such sets often causes C-OOD detectors to appear better than they truly are when faced with realistic, yet harder tasks. Motivated by this deficiency, Hendrycks et al. (2021) introduced the ImageNet-O dataset as a solution. ImageNet-O, however, has two limitations. First, it benchmarks models with a single difficulty level exclusively, having only hard C-OOD instances, which might not be relevant for every task's requirements (Section 3 explains how to define different difficulty levels). Second, the original intent in the creation of ImageNet-O was to include only hard C-OOD instances. Its definition of "OOD hardness", however, was carried out with respect to ResNet-50's difficulty in detecting C-OOD classes, specifically when using softmax as its confidence function. This property makes ImageNet-O strongly biased. Indeed, consider the right-most box in Figure 1, which corresponds to the performance of 525 models over ImageNet-O. The orange dot in that box corresponds to ResNet-50, whose OOD detection performance is severely harmed by these ImageNet-O data. Nevertheless, it is evident that numerous models perform quite well, and all other models perform better than ResNet-50. The lack of an objective benchmark for C-OOD is the main motivation for our work. Figure 1: OOD performance across severity (difficulty) levels, using the benchmarks produced by our framework. The detection performance decreases for all models as we increase the difficulty until it reaches near chance detection performance at the highest severity (s10). The top curve belongs to ViT-L/32-384, which surpasses all models at every severity level. We also observe how success or failure with regard to the previous C-OOD benchmark, ImageNet-O, does not reflect the models' true OOD detection performance since it was designed to specifically fool ResNet-50. At the bottom we provide visual examples for OOD classes from ImageNet-21k that may populate each severity level due to their similarity to ID classes from ImageNet-1k, and in this example, to a Monarch butterfly. Our contributions. We propose a novel technique to generate a C-OOD benchmark that covers a variety of difficulty levels. Unlike other existing benchmarks (e.g., ImageNet-O), our technique is not biased towards an arbitrary model such as Resnet50 and/or a specific confidence function such as the softmax response. This useful property is obtained by tailoring the benchmark to the model being evaluated, including its confidence function, and not seeking to determine a single objective criterion for hardness of C-OOD samples (see Section 3). Second, we show and explain how we filter ImageNet-21k to use it for the purpose of generating C-OOD benchmarks for ImageNet-1k (Deng et al., 2009) classifiers (see Section 4). We will provide a simple code to choose the filtering 2 s0s1s2s3s4s7s8s9s10ImageNet-O30405060708090100s5 s6 Models:ViT-L/32-384 ResNet-50 AlexNetSeverity LevelsC-OOD AUROC (detection) parameters most suitable for the specific aim for which the benchmark is meant (e.g., what is classes are considered OOD). Third, we demonstrate the power and usability of our method by applying our C-OOD framework to generate benchmarks for 525 ImageNet-1k classifiers available from popular repositories. We provide a benchmark for each of these classifiers, which will be available for use from our code. We then analyze the results of these benchmarks to make numerous novel observations concerning C-OOD detection such as: (1) training regimes using knowledge distillation (Hinton et al., 2015) consistently yield models with better C-OOD detection performance than the same models trained identically, but without distillation; (2) a subset of ViTs performs better C-OOD detection than any other model; (3) the language–vision model CLIP achieves good zero-shot detection performance for low difficulty (severity) levels; (4) accuracy and in-distribution (ID) ranking are positively correlated with C-OOD detection; (5) we compare the performance of various confidence functions for C-OOD detection; (6) A number of other observations (see Section 5). Lastly, we emphasize that the resulting difficulty levels of our framework allow benchmarking with respect to the difficulty levels most relevant to the task. For example, for a task with a high tolerance for risk (e.g., a task for an entertainment application), the performance of a model on a median difficulty level might be more important than on the hardest difficulty level (severity 10). The opposite might be true for some applications with a low tolerance for risk (e.g., medical applications), for which one requires the best performance to be attained even if the OOD is very hard to detect (severity 10). Furthermore, in Section 5 we show that detection algorithms do not always improve performance on all inputs equally, and could even hurt performance for specific difficulty levels and models (see Figure 7 for a striking example). Choosing the combination of (model, detection algorithm) based only on the detection performance on all data may yield sub-optimal results for our specific desired level of difficulty. 2 Problem Setup Let X be the input space and Y = YID ∪ YOOD be the label space. Let P (X , Y) be an unknown distribution over X × Y. A model f is a prediction function f : X → YID, and its predicted label for an image x is denoted by ˆyf (x). The model f is produced by training on a labeled set Tm = {(xi, yi)}m i=1 ⊆ (X × YID), sampled i.i.d. from P (X , YID), with the objective of minimizing its empirical risk, defined by ˆr(f |Tm) (cid:44) 1 i=1 (cid:96)(f (xi), yi), where (cid:96) : YID × YID → R+ is m a given loss function (e.g., cross-entropy loss for classification). Note that by this definition, the model f will always misclassify any x ∼ P (X , YOOD). We define a confidence score function κ(x, ˆy|f ), where x ∈ X , and ˆy ∈ YID is the model's prediction for x, as follows. The function κ should quantify confidence in the prediction of ˆy for the input x, based on signals from model f . This function should induce a partial order over instances in X . (cid:80)m The most common and well-known κ function for a classification model f (with softmax at its last layer) is its softmax response values – κ(x, ˆy|f ) (cid:44) f (x)ˆy (Cordella et al., 1995; De Stefano et al., 2000) – which is also widely accepted as a baseline in the OOD literature (Hendrycks & Gimpel, 2017; Hendrycks et al., 2021; Berger et al., 2021; Shalev et al., 2018). While this is the primary κ we evaluate for the sake of simplicity, various other κ functions, which are also utilized for OOD detection, exist. To name a few: Out-of-distribution detector for neural networks (ODIN) (Liang et al., 2018), Monte-Carlo dropout (MC dropout) (Gal & Ghahramani, 2016), Mahalanobis distance (Lee et al., 2018), and more. Although many of these methods use the direct output from f , κ could be a different model unrelated to f and unable to affect its predictions. κ functions can be evaluated by the quality of the partial order they induce over instances in X . For every two random samples (x1, y1), (x2, y2) ∼ P (X , Y), and given that x1 belongs to an OOD label and that x2 belongs to an ID label, the detection (or ranking) performance of κ is defined as the probability that κ ranks x2 higher than x1: Pr[κ(x1, ˆy1|f ) < κ(x2, ˆy2|f ) | x1 ∼ P (X , YOOD) ∧ x2 ∼ P (X , YID)] The Area Under the Receiver Operating Characteristic (AUROC or AUC) metric is often used to measure the performance of OOD detection. When ID samples are counted as true positives and OOD samples are counted as false positives, AUROC, in fact, equals the probability in Equation (1) (Fawcett, 2006) and thus is a proper metric to measure OOD detection in classification. See Appendix A for evaluating κ functions in an ID setting. (1) 3 Constructing a model-specific class-out-of-distribution benchmark We first choose a dataset that contains samples from a large set of OOD labels (e.g., labels from ImageNet-21k that are not included in ImageNet-1k). Ideally, this OOD dataset should consist of OOD labels representing labels the model 3 may encounter when deployed. Any large dataset could be used for the purpose of benchmarking performance on C-OOD by splitting it according to labels into an ID component, i.e., the labels on which the model trains, and into an OOD component, i.e., the labels on which the model is exclusively tested. We now introduce a novel framework for generating C-OOD benchmarks with a controllable degree of severity, which could be thought of as the difficulty level of the data. Algorithm 1 summarizes our proposed technique. Let YOOD be a Algorithm 1 Generating C-OOD benchmarks for ̄y ∈ YOOD do 1: function GENERATE BENCHMARK(f, κ, YOOD, group size = |YID|) 2: 3: 4: Split all samples of class ̄y into two sets: c ̄y est and c ̄y test Set the severity score of class ̄y to be: s( ̄y|f, κ) = 1 x∈c ̄y |c ̄y Insert the class and its score ( ̄y, s( ̄y|f, κ)) into classes array est| (cid:80) κ(x|f ). est 5: 6: 7: 8: 9: 10: 11: Sort classes array in ascending order by each OOD class' score s( ̄y|f, κ) for i < |YOOD| − group size do grp array[i] = classes array[i : i + group size] (cid:46) Sliding window of size group size for i < 11 do (cid:46) Select groups in different percentiles to serve as benchmarks sev benchmark[i] = {x | x ∈ c ̄y test s.t. ̄y ∈ grp array[j] and j = [ i 10 * |grp array|]} return sev benchmark large set of OOD classes (e.g., labels from ImageNet-21k that are not included in ImageNet-1k), and let sf,κ( ̄y) be a severity score, defined as the average confidence given by κ to samples from class ̄y ∈ YOOD. This score reflects the level of difficulty faced by the model f and its κ function when detecting instances from class ̄y. When considering ID instances we expect κ to give high values for highly confident predictions. Therefore, the larger s( ̄y|f, κ) is, the harder it is for κ to detect the OOD class ̄y among ID classes. We estimate s( ̄y|f, κ) for each class in the OOD dataset (e.g., ImageNet-21K) using a set of samples from the class (denoted by c ̄y est), while keeping a disjoint set of samples from the same class to be used for testing (denoted by c ̄y test). Using s we sub-sample groups of classes (severity levels) from YOOD, with increasing severity such that severity level i ∈ [0, 10] is the ith percentile of all severity levels. To achieve this, we first estimate the severity score for each class ̄y in our OOD dataset for our model and its confidence function (f, κ), as follows: s( ̄y|f, κ) = 1 |c ̄y est| (cid:88) x∈c ̄y est κ(x|f ). We group the OOD classes into different groups, and choose the size of each group G to be the same as |YID|, the number of labels in the ID dataset (e.g., in ImageNet we choose it to be 1000 classes). The number of possible groups of labels from YOOD could be huge (in ImageNet, for example, the number of possible groups of size 1000 from the 20, 000 OOD classes is about (cid:0)20,000 (cid:1) = 2.5 × 101722), so instead of going over every possible group of classes, we sort the classes by their severity scores and then use a sliding window of size |YID| to define |YOOD| − |YID| + 1 groups of classes with increasing severity (see Figure 2). This method for reducing the number of considered groups of classes was chosen because it groups OOD classes with similar severity scores together. 1000 Figure 2: We define |YOOD| − |YID| + 1 groups of classes with increasing severity by sorting all OOD classes ̄yi ∈ YOOD by their severity scores s( ̄y|f, κ), and then use a sliding window of size |YID| to choose the considered groups. Next, we choose the groups that correspond to the percentiles {10 * i}i=10 i=0 in the array of sorted groups. Finally, we construct the C-OOD benchmark for each severity level i from the set of test samples c ̄y test of all classes in group i. This procedure for choosing groups allows us to interpret the severity levels using percentiles. For example, severity level 5 contains classes that match the median severity among the considered groups. Thus, the performance evaluated on the benchmark for severity 5 corresponds to the performance of the model on samples with a median detection difficulty. 4 തy0തy1തy2തy3തy4തy5തy6...തy−2തy−1Slidingwindowofsize The resulting benchmark is tailored to the evaluated model, since the latter was used to generate it and, therefore, can be used to measure its specific performance. In Appendix B we further argue why our framework can be used to compare C-OOD detection performance of different models. 4 Constructing benchmarks for ImageNet classifiers To use ImageNet-21k as an OOD dataset, we first filter out undesired labels. Since ImageNet-21K contains the ID dataset (ImageNet-1K), the first step is to remove the ID classes from the OOD dataset. Next, we remove all classes that are hypernyms or hyponyms of classes in ImageNet-1K because it might be inaccurate to include them as an OOD class. For example, ImageNet-1K contains the class "brown bear" and ImageNet-21K has the class "bear", which is a hypernym for "brown bear" so it would not be accurate to include "bear" in a C-OOD detection test. We furthermore filter OOD classes that, together with an ID class, either comprise the same object or are a component of the other one. This is due to most images in the dataset containing both components as parts of the whole object (e.g., "pool ball" from ImageNet-1k and "pool table" from ImageNet-21k). We also filter out classes that are practically identical, even though they possess WordNet id numbers that are different (e.g., "hen" is found twice as two distinct classes, with id n01514859 in ImageNet-1k and id n01792640 in ImageNet-21k). Since each class in the ImageNet-1k validation set has 50 samples, we set the number of testing samples for each C-OOD class to be 50 as well |c ̄y test| = 50. In addition, We set the estimation set for each class to be 150 |c ̄y est| = 150. Overall, this means that each OOD class must have at least 200 samples. Accordingly, we remove classes with less than 200 samples. For classes with more than 200 samples we randomly select 200 samples and remove the rest. While the above filtering choices are trivial and suitable for most tasks, two additional filtering options are dependent on the task and its definition of two objects being considered identical. The first option concerns animal classes that might appear to be very similar but have a biological difference such that an expert could distinguish between the two. A good example of this can be observed in Figure 3, depicting the ImageNet-1k class of Monarch butterflies and the ImageNet-21k class of Viceroy butterflies, which are both distinct species of butterflies. The similarity is so remarkable that scientists believe they have evolved to mimic one another to repel common predators (Ritland & Brower, 1991). This mimicry does not only fool predators and the untrained eye: all models studied in this paper classified more than 50% of Viceroy samples as a Monarch butterfly. The fact that such classes are biologically different led us to keep them Figure 3: While both butterflies appear very similar, a Viceroy can be distinguished from a Monarch by a black line crossing its postmedian hindwing. The red arrow on the Viceroy image indicates this black line. in the test set by default and serve as extremely hard OOD classes. Our code, however, allows users to disable such classes easily, since some tasks might permit such similar classes to be classified as the same. The second option concerns inanimate objects created by humans that might appear very similar but are, by definition, distinct from one another and are used differently. An example of two such classes is shown in Figure 4, depicting a cue ball used for billiard games and a ping pong ball. Both are strikingly similar, and we believe a person completely unfamiliar with one of the games might easily confuse the two, if all they had were the images. Our code can be configured easily to either exclude or include such classes. After completing the filtering as described above, the remaining classes were used in the process described in Section 3 as the set of OOD classes YOOD, with ImageNet's validation set being the set of ID classes YID. Our code allows the generation of C-OOD benchmarks for any ImageNet classification model and its κ confidence scoring function. Moreover, we ran the process ourselves for 525 models pretrained on ImageNet, taken from the torchvision (0.10) and "timm" (0.4.12) repositories (Paszke et al., 2019; Wightman, 2019), with softmax as κ. For these models, the benchmarks are ready to be used by the community without further preparations being necessary. 5 MonarchViceroy Figure 4: While both balls appear similar, they are distinguished by their different uses. 5 Performance analysis Having generated C-OOD benchmarks using the above technique for 525 different models , in this section we analyze the results. We first focus on results obtained when setting the confidence function κ to be the softmax response, as it is widely accepted as a baseline in the OOD literature (Hendrycks & Gimpel, 2017; Berger et al., 2021). We then evaluate additional κ functions such as ODIN, entropy and MC dropout. Our analysis leads to several interesting insights. Figure 5: The mean relative improvement when using different training regimes (distillation, pretraining etc.). The shaded green area indicates the area of positive improvement. 1) Knowledge distillation improves C-OOD detection. We measured C-OOD detection improvement (measured in AUROC) when using different training regimes to explore whether a certain method consistently contributes to detection performance. Results are depicted in Figure 5. To make a fair comparison, we only compare pairs of models such that both models have identical architecture and training regimes, with the exception of the method itself being evaluated (e.g., training with or without knowledge distillation). Of all training regimes (knowledge distillation, adversarial training (Goodfellow et al., 2015), pretraining on ImageNet-21k, see below), knowledge distillation had the most significant impact in most severity levels s > 3. In Galil et al. (2023) we also find that among these training regimes, knowledge distillation is the best booster of uncertainty estimation performance in an in-distribution setting. Next, we find that ImageNet21k pretraining also improves performance, and is more beneficial to performance than knowledge distillation in low levels of severity s ≤ 3. Note that this observation could not have been achieved with simplified benchmarks (e.g., ImageNet-O). Our new framework allows for such observations thanks to the division of the benchmarks into different levels of severity. Finally, it is not surprising that adversarial training is irrelevant to C-OOD detection. 2) A subset of ViTs achieves the best C-OOD detection performance, both in absolute terms and per-model size (# parameters, see Figure 9 in Appendix C). Several training regimes (including the original regime from the paper introducing ViT) result in ViTs that outperform all other architectures and training regimes in terms of C-OOD detection, e.g., Dosovitskiy et al. (2021); Steiner et al. (2022); Chen et al. (2022); Ridnik et al. (2021). Further research into other training regimes, however, reveals that not all training regimes result in superb performance (Touvron et al., 2021, 2022; Singh et al., 2022; Paszke et al., 2019), even when a similar amount of data is introduced into the training. We also find 6 Ping pong ballCue balls0s1s2s3s4s5s6s7s8s9s10−101234Severity LevelsTraining regimes:Vanilla - Knowledge Distillation Vanilla - Adversarial TrainingAUROC Improvement %Vanilla - ImageNet21k Pretraining that the same successful subset of ViTs outperforms any other model in terms of uncertainty estimation performance in an in-distribution setting in Galil et al. (2023). These observations warrant additional research with the hope of either training more robust ViTs or transferring the unidentified ingredient of the successful subset of ViTs into other models. 3) The language–vision CLIP model achieves good zero-shot C-OOD detection performance for low severity levels. CLIP (Radford et al., 2021) enables zero-shot classification and produces an impressive performance. We find it is also good at C-OOD detection (especially in severity levels lower than 6), without needing any training or fine-tuning with regard to the dataset. This observation is significant because it means CLIP could be used as a zero-shot C-OOD detection algorithm without the need to train on the ID classes. This also allows the user to change the definition of which classes are considered ID in a flexible manner without the need to retrain the detector. To the best of our knowledge, we are the first to make the observation that CLIP can serve as a capable zero-shot detector on its own, without further training, additional components, or knowledge of the possible OOD classes in advance. For more details, see Appendix D. Figure 6: Architecture accuracy vs. mean C-OOD AUROC performance. In the legend, the pair of numbers next to each architecture name corresponds to the Spearman correlation and the number of networks tested from that architecture family (most samples are too small to draw any specific conclusions). Accuracy appears to have a high correlation with the C-OOD detection performance, with a Spearman correlation of 0.65. 4) Accuracy is the factor most correlated with C-OOD detection. We observe that accuracy is typically a good indicator of the model's performance in C-OOD detection at most severity levels [s0 − s8], with Spearman correlation values in the range of [0.6, 0.73] at those levels (see Figure 12 in Appendix E). The scatter plot in Figure 6 shows the relationship between the architecture accuracy and its C-OOD detection performance. When grouping the networks by architecture, we notice that most architectures also follow this trend. When measuring the correlation between AUROC and accuracy among only the 20% most accurate models, however, the Spearman correlation drops to a range of [0.34, 0.43] (see Figure 13 in Appendix E). 5) In-distribution ranking performance is positively correlated with C-OOD detection. The next best indicative factor correlated with C-OOD detection performance after accuracy is the model's in-distribution ranking performance ("ID AUROC", see Appendix A), with Spearman correlation values in the range of [0.4, 0.5]. When measuring the correlation between AUROC and ID AUROC among only the 20% most accurate models, however, the Spearman correlation increases to a range of [0.54, 0.77]; see Appendix E for more details. 6) Most OOD classes appear in every severity level i ∈ [0, 10] for at least one model, with the exception of some classes that appear to reach severity level 10 for most or even all models (e.g., Viceroy Butterfly, depicted in Figure 3 in Section 4). This observation suggests that "OOD hardness" is usually subjective, and changes greatly across different models. 7 55606570758085907075808590ModelsVarious (0.59, 363) AlexNet (-, 1)ResNet (0.74, 34) EfficientNet (0.55, 52) Twins (-0.94, 6)ViT (0.76, 30)MLP Mixer (0.80, 4) NesT (-1.00, 3) ShuffleNetV2 (1.00, 2) SqueezeNet (1.00, 2) Swin (0.89, 6) EfficientNetV2 (0.82, 15) BiT (0.60, 9)AccuracyC-OOD AUROC (detection)Spearman correlation 0.65 7) The ranking of the best C-OOD detection models tends to remain similar across severity levels. This means that when selecting the best model for deployment, it is usually enough to observe its performance on only a few severity levels; see Appendix F. Note that this conclusion is only true when leaving the κ confidnece function fixed (see below). 8) ODIN offers significant improvements over softmax for most models. In addition to evaluating with softmax as the κ confidence function, we evaluate a few additional methods to serve as κ functions: ODIN, entropy, MC dropout and "max-logit" (not applying softmax). For each model f and κ we re-ran the algorithm described in Section 3 to benchmark (f, κ) (we do this because using the same C-OOD groups produced when using softmax might give an unfair advantage to other κ functions); see Appendix G for more technical details. Figure 7: Relative improvement gain in C-OOD detection performance when using ODIN instead of softmax. Each point represents an evaluated model. The green shaded area indicates the area of positive improvement. Figure 7 shows each model's improvement when using ODIN rather than softmax, from which it is visible that the improvement has a high variance: some models benefit significantly from using ODIN, while it is detrimental to other models. Furthermore, whether or not a model benefits from ODIN changes across different levels of severity. For example, applying ODIN instead of softmax to ViT-L/32-384 barely improves detection when at severity level 0 (AUROC improves by 0.4%), but it significantly improves its detection as the severity level increases (for severity level 10, AUROC improves by 9%). Other models' detection performance, on the other hand, may decrease as severity increases (see Figure 7 for examples). These facts suggest that the pair of (model, κ) needs to be considered with respect to the task and severity level relevant to it. Moreover, it may be that the κ function hyperparameters need to be optimized specifically for the desired severity level. 9) Not applying softmax can improve some models significantly, although most are harmed by it. Figure 16 in Appendix G depicts the effect of not applying softmax, which we dub "max-logit". While most models are harmed by using max-logit instead of softmax, some models are significantly benefited. ViTs, which already outperform all other models, perform significantly better when softmax is not applied, with ViT-L/32-384 improving by 10.6%. It is worth mentioning that of all the (model,κ) pairs evaluated in this paper, ViT-L/32-384 applied with max-logit achieve the best detection performance. Interestingly, regardless of the κ function evaluated, ViT-L/32-384 demonstrated the best detection performance. In Figure 8, we plot its performance across all severity levels using each of the κ functions we consider. Also, as noted in Appendix G, the hyperparameters used for ODIN when applied to ViT were not optimized specifically to it. Performance by using ODIN may improve beyond max-logit with model-specific optimization. Observing that max-logit could be so beneficial for a subset of models while being harmful to most other models was made possible thanks to the scale of our study. 8 s0s1s2s3s4s5s6s7s8s9s10−8−6−4−20246810Severity LevelAUROC Improvement (%)Models:ViT-L/32-384 ResNet-50AlexNet Figure 8: OOD detection performance of ViT-L/32-384, the best model evaluated using each of the κ functions we consider. 10) Using entropy as a confidence function κ improves C-OOD detection performance in most cases. We compare the performance gain from switching to using entropy instead of the softmax score. The results are depicted in Figure 17 in Appendix G. We note that, in most cases, using entropy improves the detection performance. 1 11) MC dropout improves detection, especially for low levels of severity. We evaluate MC dropout Gal & Ghahra- mani (2016) in the context of C-OOD detection. We use 30 dropout-enabled forward passes. The mean softmax score of these passes is calculated and then a predictive entropy score is used as the final uncertainty estimate. The improvements when using MC dropout instead of softmax across all severity levels are depicted in Figure 18 in Appendix G using box plots. We find that MC dropout improves performance, especially so at lower levels of severity. The improvement becomes less significant as severity increases. Similar to ODIN, MC dropout seems to improve some models more significantly at lower severity levels (e.g., MobileNets (Howard et al., 2019)) , while other models are improved more significantly by MC dropout at higher severity levels (e.g., ViTs). We further analyze MC dropout and recall that it comprises two main components: (a) dropout-enabled forward passes and (b) entropy of the mean probability vector from the forward passes. To test which component contributes the most to the perceived gains, we compare the C-OOD detection performance when using MC dropout to the C-OOD detection performance when using just entropy (with no multiple dropout-enabled forward passes). The results of this comparison are plotted in Figure 19 in Appendix G. We find that MC dropout slightly improves upon entropy at most severity levels, especially at lower ones, with few outliers being either significantly improved or harmed. 6 Concluding remarks We introduced a novel approach to benchmarking the performance of classifiers in detecting C-OODs. In contrast to existing techniques, the proposed method allows for unbiased measurements against specific models or confidence functions. A key feature of the proposed benchmarking procedure is that it allows for graded measurements of class out-of-distribution levels of severity. Using this property, we can identify trends in detection robustness that are otherwise impossible to detect. In addition to opening new avenues for future research, the proposed method can be used to draw more precise conclusions about the performance of various models and detection techniques. Using our new benchmarking procedure, we offered numerous interesting observations that merit further investigation into how to improve C-OOD detection. Among the interesting questions raised is why is knowledge distillation beneficial to boosting detection performance, and how can we enhance its robustness to C-OODs? What can we learn from the architectures that were inclined to perform well in C-OOD detection, such as ViT and CLIP? Finally, could detection methods be crafted and optimized for specific severity levels, or can they be modified to be so by changing a hyperparameter? 1Entropy is maximal when the distribution given by the model for P (y|x) is uniform, which implies high uncertainty. To convert entropy into a confidence signal, which should increase as the uncertainty decreases, we use negative entropy. 9 s0s1s2s3s4s5s6s7s8s9s100.70.750.80.850.90.951Severity LevelsC-OOD AUROC (detection)Confidence Function:Softmax - ViT L/32-384Max-logit - ViT L/32-384Entropy - ViT L/32-384Monte-Carlo dropout - ViT L/32-384ODIN - ViT L/32-384 Acknowledgments This research was partially supported by the Israel Science Foundation, grant No. 710/18. References Christoph Berger, Magdalini Paschali, Ben Glocker, and Konstantinos Kamnitsas. Confidence-based out-of-distribution detection: A comparative study and analysis. In Carole H. Sudre, Roxane Licandro, Christian F. Baumgartner, Andrew Melbourne, Adrian V. Dalca, Jana Hutter, Ryutaro Tanno, Esra Abaci Turk, Koen Van Leemput, Jordina Torrents- Barrena, William M. Wells III, and Christopher K. Macgowan (eds.), Uncertainty for Safe Utilization of Machine Learning in Medical Imaging, and Perinatal Imaging, Placental and Preterm Image Analysis - 3rd International Workshop, UNSURE 2021, and 6th International Workshop, PIPPI 2021 Held in Conjunction with MICCAI 2021, Strasbourg, France, October 1, 2021, Proceedings, volume 12959 of Lecture Notes in Computer Science, pp. 122–132. Springer, 2021. doi: 10.1007/978-3-030-87735-4\ 12. URL https://doi.org/10.1007/978-3-030-87735-4 12. Xiangning Chen, Cho-Jui Hsieh, and Boqing Gong. When vision transformers outperform resnets without pre-training or strong data augmentations. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net, 2022. URL https://openreview.net/forum?id=LtKcMgGOeLt. Xiangxiang Chu, Zhi Tian, Yuqing Wang, Bo Zhang, Haibing Ren, Xiaolin Wei, Huaxia Xia, and Chunhua Shen. Twins: Revisiting the design of spatial attention in vision transformers, 2021. L. P. Cordella, C. De Stefano, F. Tortorella, and M. Vento. A method for improving classification reliability of multilayer perceptrons. IEEE Transactions on Neural Networks, 6(5):1140–1147, 1995. doi: 10.1109/72.410358. C. De Stefano, C. Sansone, and M. Vento. To reject or not to reject: that is the question-an answer in case of neural classifiers. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews), 30(1):84–94, 2000. doi: 10.1109/5326.827457. Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pp. 248–255, 2009. doi: database. 10.1109/CVPR.2009.5206848. 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. An In 9th International Conference image is worth 16x16 words: Transformers for image recognition at scale. on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=YicbFdNTTy. Sepideh Esmaeilpour, Bing Liu, Eric Robertson, and Lei Shu. Zero-shot out-of-distribution detection based on the pre-trained model CLIP. In Thirty-Sixth AAAI Conference on Artificial Intelligence, AAAI 2022, Thirty-Fourth Conference on Innovative Applications of Artificial Intelligence, IAAI 2022, The Twelveth Symposium on Educational Advances in Artificial Intelligence, EAAI 2022 Virtual Event, February 22 - March 1, 2022, pp. 6568–6576. AAAI Press, 2022. URL https://ojs.aaai.org/index.php/AAAI/article/view/20610. Tom Fawcett. An introduction to roc analysis. Pattern Recognition Letters, 27(8):861–874, 2006. ISSN 0167- 8655. doi: https://doi.org/10.1016/j.patrec.2005.10.010. URL https://www.sciencedirect.com/science/article/pii/ S016786550500303X. ROC Analysis in Pattern Recognition. Stanislav Fort, Jie Ren, and Balaji Lakshminarayanan. Exploring the limits of out-of-distribution detection. In Marc'Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wortman Vaughan (eds.), Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 7068–7081, 2021. URL https://proceedings.neurips. cc/paper/2021/hash/3941c4358616274ac2436eacf67fae05-Abstract.html. Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. 2016. Ido Galil, Mohammed Dabbah, and Ran El-Yaniv. What can we learn from the selective prediction and uncertainty estimation performance of 523 imagenet classifiers? In International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=p66AzKi6Xim. Shang-Hua Gao, Ming-Ming Cheng, Kai Zhao, Xin-Yu Zhang, Ming-Hsuan Yang, and Philip Torr. Res2net: A new multi-scale backbone architecture. IEEE Transactions on Pattern Analysis and Machine Intelligence, 43(2):652–662, Feb 2021. ISSN 1939-3539. doi: 10.1109/tpami.2019.2938758. URL http://dx.doi.org/10.1109/TPAMI.2019. 2938758. 10 Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6572. Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural 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=Hkg4TI9xl. Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021, pp. 15262– 15271. Computer Vision Foundation / IEEE, 2021. URL https://openaccess.thecvf.com/content/CVPR2021/html/ Hendrycks Natural Adversarial Examples CVPR 2021 paper.html. Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network, 2015. Andrew Howard, Ruoming Pang, Hartwig Adam, Quoc V. Le, Mark Sandler, Bo Chen, Weijun Wang, Liang-Chieh Chen, Mingxing Tan, Grace Chu, Vijay Vasudevan, and Yukun Zhu. Searching for mobilenetv3. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pp. 1314–1324. IEEE, 2019. doi: 10.1109/ICCV.2019.00140. URL https://doi.org/10.1109/ICCV.2019.00140. Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicol`o Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montr ́eal, Canada, pp. 7167– 7177, 2018. URL https://proceedings.neurips.cc/paper/2018/hash/abdeb6f575ac5c6676b747bca8d09cc2-Abstract. html. Shiyu Liang, Yixuan Li, and R. Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id= H1VGkIxRZ. Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alch ́e-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Informa- tion Processing Systems 32, pp. 8024–8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/ 9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf. Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 8748–8763. PMLR, 2021. URL http://proceedings.mlr.press/v139/radford21a.html. Tal Ridnik, Emanuel Ben Baruch, Asaf Noy, and Lihi Zelnik. the In Joaquin Vanschoren and Sai-Kit Yeung (eds.), Proceedings of the Neural Information Pro- masses. cessing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, De- cember 2021, virtual, 2021. URL https://datasets-benchmarks-proceedings.neurips.cc/paper/2021/hash/ 98f13708210194c475687be6106a3b84-Abstract-round1.html. Imagenet-21k pretraining for David B. Ritland and Lincoln P. Brower. The viceroy butterfly is not a batesian mimic. Nature, 350(6318):497–498, Apr 1991. ISSN 1476-4687. doi: 10.1038/350497a0. URL https://doi.org/10.1038/350497a0. Walter J. Scheirer, Anderson de Rezende Rocha, Archana Sapkota, and Terrance E. Boult. Toward open set recognition. IEEE Trans. Pattern Anal. Mach. Intell., 35(7):1757–1772, 2013. doi: 10.1109/TPAMI.2012.256. URL https: //doi.org/10.1109/TPAMI.2012.256. Gabi Shalev, Yossi Adi, and Joseph Keshet. Out-of-distribution detection using multiple semantic label representations. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicol`o Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montr ́eal, Canada, pp. 7386–7396, 2018. URL https://proceedings.neurips.cc/paper/2018/hash/2151b4c76b4dcb048d06a5c32942b6f6-Abstract.html. Mannat Singh, Laura Gustafson, Aaron Adcock, Vinicius de Freitas Reis, Bugra Gedik, Raj Prateek Kosaraju, Dhruv Mahajan, Ross B. Girshick, Piotr Doll ́ar, and Laurens van der Maaten. Revisiting weakly supervised pre-training of visual perception models. CoRR, abs/2201.08371, 2022. URL https://arxiv.org/abs/2201.08371. 11 Andreas Peter Steiner, Alexander Kolesnikov, Xiaohua Zhai, Ross Wightman, Jakob Uszkoreit, and Lucas Beyer. How to train your vit? data, augmentation, and regularization in vision transformers. Transactions on Machine Learning Research, 2022. URL https://openreview.net/forum?id=4nPswr1KcP. Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Herv ́e J ́egou. Train- ing data-efficient image transformers & distillation through attention. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Vir- tual Event, volume 139 of Proceedings of Machine Learning Research, pp. 10347–10357. PMLR, 2021. URL http://proceedings.mlr.press/v139/touvron21a.html. Hugo Touvron, Matthieu Cord, and Herv ́e J ́egou. Deit III: revenge of the vit. CoRR, abs/2204.07118, 2022. doi: 10.48550/arXiv.2204.07118. URL https://doi.org/10.48550/arXiv.2204.07118. Ross Wightman. Pytorch image models. https://github.com/rwightman/pytorch-image-models, 2019. I. Zeki Yalniz, Herv ́e J ́egou, Kan Chen, Manohar Paluri, and Dhruv Mahajan. Billion-scale semi-supervised learning for image classification. CoRR, abs/1905.00546, 2019. URL http://arxiv.org/abs/1905.00546. Hang Zhang, Chongruo Wu, Zhongyue Zhang, Yi Zhu, Haibin Lin, Zhi Zhang, Yue Sun, Tong He, Jonas Mueller, R. Manmatha, Mu Li, and Alexander Smola. Resnest: Split-attention networks, 2020. A Defining in-distribution AUROC We follow Galil et al. (2023) in defining in-dsitribution AUROC ("ID AUROC"). ID AUROC is defined similarly to Equation 1, but discriminating between correct and incorrect predictions instead of discriminating between ID and OOD instances. For every two random samples (x1, y1), (x2, y2) ∼ P (X , Y) and given that (cid:96)(f (x1), y1) > (cid:96)(f (x2), y2), the ranking performance of κ is defined as the probability that κ ranks x2 higher than x1: Pr[κ(x1, ˆy|f ) < κ(x2, ˆy|f )|(cid:96)(f (x1), y1) > (cid:96)(f (x2), y2)] (2) When the 0/1 loss is in play, it is known that AUROC in fact equals the probability in Equation (2) (Fawcett, 2006) and thus is a proper metric to measure ranking in classification (AKA ID AUROC or discrimination). B Comparing Models' Performance Using Our Framework The proposed framework allows for a fair comparison of models in terms of model-specific difficulty, rather than a fixed set of OOD classes chosen according to some (possibly arbitrary) criterion. This is because the framework evaluates each model's performance on tailored benchmarks. This approach provides a more accurate representation of the model's own performance. As the famous quote goes, "You can't judge a fish by its ability to climb a tree". Rephrasing this quote to adapt it to our discussion: if we want to compare a fish with a monkey on what is hardest for each of them, we should judge the fish by its ability to climb a tree and the monkey's ability to swim (although we are aware that some monkeys can swim). Our framework constructs specialized tests for both. That being said, by considering the construction of severity levels (per model), it is possible (neglecting estimation error of the estimation sets c ̄y est) to compare the performance of two models specifically for the classes populating their maximal severity (severity 10): (1) Suppose that model A has better performance (AUROC) on its own group Z of hardest classes (severity 10) than model B's performance on its own severity 10 classes, denoted K. Assume that K does not equal Z (otherwise we are done). Thus, AUROC(A, Z) > AUROC(B, K). (2) By construction of severity groups, for every set of classes R (cid:54)= Z, AUROC(A, R) ≥ AUROC(A, Z) (since Z is the set of hardest classes for model A). This holds true for any set of classes R, including the set K. Therefore, AUROC(A, K) ≥ AUROC(A, Z). By combining (1) and (2) we get that AUROC(A, K) ≥ AUROC(A, Z) > AUROC(B, K) ⇒ AUROC(A, K) > AUROC(B, K), meaning that for the same set of classes K, model A performs better than model B. A "mirror" argument could be crafted to compare the models' performance on the classes populating their minimal severity (severity 0). 12 Figure 9: Number of architecture parameters vs. C-OOD AUROC performance at severity level 5 (median severity). The pair of numbers next to each architecture name in the legend corresponds to its Spearman correlation and the number of models tested from that architecture (family), respectively. Note that specific ViT transformers are also the best when considering a model size limitation. Vertical lines indicate the sizes of ResNet-50 (left vertical line) and ResNet-101 (right vertical line). C Per-size Performance Comparison The scatter plot in Figure 9 shows the relationship between the # of architecture parameters and its C-OOD AUROC performance. Overall, there is a moderate Spearman correlation of 0.45 between #parameters and the C-OOD performance when considering all tested networks. When grouping the networks by architecture families, however, we see that some architectures have high correlation between their model size and their C-OOD AUROC. Architecture families that exhibit this behavior are, for example, ViTs, Swins, EffecientNetV2 and ResNets whose correlations are 0.91, 0.94, 0.89, and 0.79, respectively. Other families exhibit moderate correlations, e.g., EffecientNet(V1) with a 0.47 Spearman correlation. Some architectures, on the other hand, have strong negative correlation, e.g., Twins Chu et al. (2021), NesT Zhang et al. (2020) and Res2Net Gao et al. (2021), whose correlations are -0.94,-1.0, and -0.85, respectively. Additionally, we note that the subset of ViT models mentioned in Section 5 are also the best even when considering a model size limitation. D Zero-shot C-OOD detection with CLIP To evaluate CLIP on ImageNet, we first prepare it following the code provided by its authors (https://github.com/openai/CLIP): The labels of ImageNet-1k are encoded into normalized embedding vectors. At inference time, the incoming image is encoded into another normalized embedding vector. A cosine similarity is then calculated between each label-embedding vector and the image-embedding vector. The highest similarity score is then taken as the confidence score for that prediction. To evaluate CLIP's C-OOD performance, we re-run the algorithm described in Section 3 to benchmark (CLIP, κcosine similarity). The best-performing instance of CLIP (ResNet-50x64) outperforms 96% of all other models (measured by its mean AUROC over all severity levels). In Figure 10 we visualize this CLIP's performance across all severity levels, in comparison to all other models. Interestingly, CLIP's relative advantage over other models decreases as the severity increases, and at severity 10, it is even lower than the median. The same is observed in 13 1314151617181920217075808590ModelsVarious (0.45, 318)AlexNet (-, 1)ResNet (0.79, 33)EfficientNet (0.47, 52)Twins (-0.94, 6)ViT (0.91, 21)MLP Mixer (-0.32, 4)NesT (-1.00, 3)ShuffleNetV2 (1.00, 2)SqueezeNet (-1.00, 2)Swin (0.94, 6)Res2Net (-0.85, 9)EfficientNetV2 (0.89, 15)BiT (0.64, 9)log10 Parameters #C-OOD AUROC (detection)Spearman correlation 0.45 Figure 10: The same graph as in Figure 1, but with an additional lime-colored curve for CLIP ResNet-50x64. Note that as severity levels increase, CLIP's detection advantage is greatly reduced. Figure 11 which depicts a comparison between three identical ResNet-50 models that were trained with three different training regimes, one of them being CLIP. CLIP outperforms its competition up to severity 6 (with a significant margin in lower severity levels), and then underperforms. We hypothesize the degradation in CLIP's performance for higher severity levels happens due to an increase in the number of OOD classes that are descriptively similar to ID classes at higher levels of severity. For example, when examining different types of butterflies from Figure 3, the string text of "monarch butterfly" is very similar to the string text of "viceroy butterfly", simply due to both sharing the word "butterfly". Other butterflies that are less visually similar might be "confused" by CLIP and classified as monarch butterflies, simply because they are also defined as butterflies, making their cosine similarity with the text "monarch butterfly" higher. Common image classifiers, on the other hand, may confuse different butterflies if they appear visually similar and share many distinguishable features, but are not affected by the fact both classes are defined as "butterflies". We also observe that while CLIPs with a confidence function κcosine similarity perform very well at C-OOD detection, their ID ranking is worse than other models. Using softmax and\or adding a linear-probe (as described in Radford et al. (2021)) improves ID ranking significantly, but results in mediocre C-OOD detection performance. We believe that this suggests the multimodal nature of CLIP is a crucial component of its C-OOD detection performance, and that the scaling effect of softmax hinders the partial order induced on OOD and ID instances. In Fort et al. (2021), it was suggested that CLIP be used as a zero-shot OOD detection algorithm. Their suggested method, however, requires knowledge of the possible OOD classes in advance. The authors of Esmaeilpour et al. (2022) suggested to use an additional captioning model, which is fine-tuned on some large dataset (which hopefully contains knowledge of the OOD classes that might emerge during inference), instead. Our suggested approach, in contrast, requires no knowledge, no fine-tuning and no models other than CLIP itself. E Correlations of Various Factors with C-OOD Detection Performance We searched for factors that could be indicative of or correlated with good performance in C-OOD detection. To this end, we measure the correlations of various factors with the C-OOD detection AUROC performance across all levels of severity. The results can be seen in the graphs in Figure 12. We observe that accuracy is typically a good indicator of the model's performance in C-OOD detection at most severity levels (s0 − s8), with Spearman correlation values in [0.6, 0.73] at those levels (see Figure 12). When measuring the correlation between AUROC and accuracy among only the 20% most accurate models, however, the Spearman correlation drops to a range of [0.34, 0.43] (see Figure 13). 14 s0s1s2s3s4s5s6s7s8s9s10ImageNet-O30405060708090100Severity LevelC-OOD AUROC (detection)Models:ViT-L/32-384ResNet-50 AlexNet CLIP ResNet-50x64 Figure 11: A comparison of three identical ResNet-50 models trained with different training regimes: (1) The orange- colored curve represents a ResNet-50 model trained on ImageNet-1k with Torchvision's recipe; (2) the purple-colored curve represents a ResNet-50 model trained with a semi-supervised regime (Yalniz et al., 2019); and (3) the lime-colored curve represents a ResNet-50 trained with CLIP. The next best indicative factors are the ID ranking performance ("ID AUROC"), number of parameters, and the input image size (moderate correlations). Finally, the embedding size is only weakly correlated. Figure 14 shows a scatter plot of in-distribution ranking performance and C-OOD detection performance of all evaluated models. The overall Spearman correlation is 0.43. The legend indicates correlations obtained by specific architecture families. Interestingly, ID AUROC exhibits slightly increasing correlation up to severity s9, and at s10 becomes the most indicative factor for C-OOD detection performance. In contrast, all other investigated factors lose their indicative power at the highest severity levels (s9, s10). Moreover, when measuring the correlation between AUROC and ID AUROC among only the 20% most accurate models, the Spearman correlation increases to a range of [0.54, 0.77], making it the most indicative factor for C-OOD detection among such models (see Figure 13). F Correlation between Rankings of Multiple Severity Levels Since we use multiple benchmarks for C-OOD detection (i.e., the 11 severity levels), to test the performance models in C-OOD detection, and each severity level may rank the models differently (i.e. the best performers for each severity level may vary), we now consider the question of how these rankings change across severity levels. To this end we calculated the correlations between the rankings obtained at different severity levels. The resulting correlation matrix can be seen in Figure 15. Overall, we observe high correlations, which means that different severity levels generally yield similar rankings of the models. This means that when selecting the best model for deployment, it is usually enough to observe its performance on only a few severity levels. We also notice that for each severity level si, the correlation with sj is higher the closer j is to i. This is not surprising and might be anticipated because adjacent severity levels have close severity scores by design. G Comparison of different confidence functions This section contains additional technical details and figures related to our comparison of ODIN, max-logit, entropy and MC dropout. Our main conclusions are presented in Section 5 of the main text. To use MC dropout, we first use 30 dropout-enabled forward passes. The mean softmax score of these passes is calculated and then a predictive entropy score is used as the final uncertainty estimate. 15 s0s1s2s3s4s5s6s7s8s9s100.50.60.70.80.91Severity LevelsC-OOD AUROC (detection)Model:ResNet-50 - TorchvisionResNet-50 - Semi-supervised learningResNet-50 - CLIP Figure 12: Spearman correlations between C-OOD detection AUROC and Accuracy, ID-AUROC, #parameters, input size, and embedding size across all severity levels. Figure 13: Spearman correlations between C-OOD detection AUROC and Accuracy, ID-AUROC, #parameters, input size, and embedding size across all severity levels, among only the 20% most accurate models. When using ODIN, we use a temperature of 2 and set (cid:15) to be 1 * 10−5. We obtained these hyperparameters by using a simple grid search over a validation set, and using seven models of different architectures of the entire sample of models evaluated. Our objective was to find the hyperparameters that improve the mean AUROC across all severity levels the most. We believe that fine-tuning the hyperparameters with the specific model and severity levels in mind may allow for better results. 16 s0s1s2s3s4s5s6s7s8s9s100.10.20.30.40.50.60.7Severity LevelsSpearman CorrelationAccuracyID AUROC log(#Parameters) Input Sizes0s1s2s3s4s5s6s7s8s9s10−0.100.10.20.30.40.50.60.70.8Severity LevelsSpearman CorrelationAccuracyID AUROC log(#Parameters) Input Size Figure 14: The x-axis represents ID ranking performance (measured by AUROC), and the y-axis represents C-OOD detection performance in severity 5 (higher is better). The legend indicates correlations, by specific architecture families, with the number on the right representing sample size, and the one on the left representing the correlation between ID ranking and detection. Figure 15: Spearman correlation between the rankings of the models given by different severity levels. 17 767880828486887075808590ID AUROCC-OOD AUROCVarious (0.40, 388) AlexNet (-, 1)ResNet (0.16, 33) ViT (0.74, 21) MLP Mixer (1.00, 4) ShuffleNetV2 (1.00, 2) SqueezeNet (1.00, 2) Swin (0.83, 6) EfficientNetV2 (-0.46, 15) BiT (0.32, 9)Models (Spearman correlation per family, number of models)(detection)Overall Spearman correlation 0.43s0s1s2s3s4s5s6s7s8s9s10s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 Spearman correlation1.00.9650.9280.8820.8540.8460.8310.8150.7870.690.3760.9651.00.9860.9550.9310.9180.90.8790.8460.7390.4160.9280.9861.00.9850.9680.9550.9380.9150.8830.7790.4610.8820.9550.9851.00.9910.980.9660.9460.9160.8240.5130.8540.9310.9680.9911.00.9930.9830.9690.9440.860.5490.8460.9180.9550.980.9931.00.9930.9830.9630.8880.5760.8310.90.9380.9660.9830.9931.00.9920.9790.9130.6030.8150.8790.9150.9460.9690.9830.9921.00.9890.9390.6340.7870.8460.8830.9160.9440.9630.9790.9891.00.9610.6750.690.7390.7790.8240.860.8880.9130.9390.9611.00.8120.3760.4160.4610.5130.5490.5760.6030.6340.6750.8121.0 Figure 16: Relative improvement gain in C-OOD detection performance when using max-logit instead of softmax (i.e., not applying softmax). In median terms, using max-logit harms performance over softmax for most evaluated models. However, some models (e.g., ViTs) greatly benefit from not applying softmax. The green shaded area indicates the area of positive improvement. Figure 17: Relative improvement gain in C-OOD detection performance when using entropy instead of softmax. In median terms, entropy offers positive improvement over softmax for most levels of severity except s ∈ {7, 8, 9}. The green shaded area indicates the area of positive improvement. 18 s0s1s2s3s4s5s6s7s8s9s10−20−15−10−50510Improvement by using max-logit instead of softmax (i.e. not applying softmax)Severity LevelsImprovement % in C-OOD AUROC (detection)s0s1s2s3s4s5s6s7s8s9s10−10−505Severity LevelsImprovement % in C-OOD AUROC (detection)Improvement by using entropy instead of softmax Figure 18: Relative improvement gain in C-OOD detection performance when using MC dropout instead of softmax. We find that MC dropout improves performance, especially at lower levels of severity. The improvement becomes less significant as severity increases. Figure 19: Relative improvement gain in C-OOD detection performance when using MC dropout instead of entropy. 19 s0s1s2s3s4s5s6s7s8s9s10−6−4−20246Severity LevelsImprovement % in C-OOD AUROC (detection)Improvement by using MC-dropout instead of softmaxs0s1s2s3s4s5s6s7s8s9s10−4−3−2−101234Severity LevelsImprovement % in C-OOD AUROC (detection)Improvement by using MC-dropout instead of entropy
http://arxiv.org/abs/2302.12258v1
2023-02-23T09:51:03
2023-02-23T09:51:03
Data leakage in cross-modal retrieval training: A case study
The recent progress in text-based audio retrieval was largely propelled by the release of suitable datasets. Since the manual creation of such datasets is a laborious task, obtaining data from online resources can be a cheap solution to create large-scale datasets. We study the recently proposed SoundDesc benchmark dataset, which was automatically sourced from the BBC Sound Effects web page. In our analysis, we find that SoundDesc contains several duplicates that cause leakage of training data to the evaluation data. This data leakage ultimately leads to overly optimistic retrieval performance estimates in previous benchmarks. We propose new training, validation, and testing splits for the dataset that we make available online. To avoid weak contamination of the test data, we pool audio files that share similar recording setups. In our experiments, we find that the new splits serve as a more challenging benchmark.
[ "Benno Weck", "Xavier Serra" ]
10.1109/ICASSP49357.2023.10094617
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1109/ICASSP49357.2023.10094617", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.12258v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12258v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.SD", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.SD", "cs.CL", "cs.IR", "cs.LG", "eess.AS" ]
3 2 0 2 b e F 3 2 ] D S . s c [ 1 v 8 5 2 2 1 . 2 0 3 2 : v i X r a DATA LEAKAGE IN CROSS-MODAL RETRIEVAL TRAINING: A CASE STUDY Benno Weck1,2, Xavier Serra2 1 Huawei Technologies, Munich Research Center, Germany [email protected] 2 Universitat Pompeu Fabra, Music Technology Group, Spain [email protected], [email protected] ABSTRACT The recent progress in text-based audio retrieval was largely propelled by the release of suitable datasets. Since the man- ual creation of such datasets is a laborious task, obtaining data from online resources can be a cheap solution to create large- scale datasets. We study the recently proposed SoundDesc benchmark dataset, which was automatically sourced from the BBC Sound Effects web page. In our analysis, we find that SoundDesc contains several duplicates that cause leakage of training data to the evaluation data. This data leakage ul- timately leads to overly optimistic retrieval performance esti- mates in previous benchmarks. We propose new training, val- idation, and testing splits for the dataset that we make avail- able online. To avoid weak contamination of the test data, we pool audio files that share similar recording setups. In our experiments, we find that the new splits serve as a more chal- lenging benchmark. Index Terms- text-based audio retrieval, cross-modal, duplicates, data leakage, deep learning 1. INTRODUCTION Retrieving audio through textual search queries was tradition- ally approached by extracting metadata from all audio files in the collection and selecting items by text-based matching al- gorithms. With the advent of deep-learning-based methods, it became feasible to map search queries directly into the audio content domain in order to retrieve items at a large scale. This form of content-based audio retrieval is commonly referred to as text-based audio retrieval. The research in this relatively young field is mostly driven by the availability of large-scale datasets. These datasets serve as a source for the necessary training data and, ad- ditionally, allow for a comparative evaluation of different approaches. For text–based audio retrieval, the most com- monly used datasets are Clotho [1] and AudioCaps [2]. Both datasets were originally designed for the task of automatic audio captioning but lend themselves well to cross-modal retrieval. Nevertheless, there are certain drawbacks to both: (i) Clotho is limited in size and variability of the audio con- tent and and (ii) the audio content in AudioCaps is not freely accessible The recently presented SoundDesc dataset [3] ad- dresses both shortcomings: it is large in size while keeping a wide variation in content topics and its audio is freely avail- able for research purposes. Moreover, the authors propose it as a benchmark for text-based audio retrieval. The dataset was sourced from the BBC Sound Effects Archive website1. Due to the semi-automatic nature of the dataset creation pro- cess, it is more likely to contain undesired artefacts. We study the data distribution among the publicly available splits of the dataset and identify a couple of defects. Primarily, we de- tect several duplicate recordings. These duplicate recordings cause an unwanted overlap of the training and the evaluation part of the dataset, a so-called data leakage. This leakage ultimately leads to overly optimistic retrieval scores reported on the test set. We are convinced that these defects need to be corrected so that no erroneous conclusions are made and to maximise the potential of the data. This is why, in this work, we set out to propose an updated version of the training, validation, and test splits of the SoundDesc dataset. More specifically, our contributions are as follows: • We identify duplicates and overlapping recordings in the dataset using an off-the-shelf audio fingerprinting system. • We show that these duplicates lead to a data leakage problem and overly optimistic retrieval scores. • We propose new dataset splits that avoid weak con- tamination between development and evaluation data by grouping recordings that potentially share the same recording process. • We make the new splits available online.2 1https://sound-effects.bbcrewind.co.uk/ 2https://doi.org/10.5281/zenodo.7665917 2. RELATED WORK 2.1. Text-based audio retrieval Text-based audio retrieval (sometimes also called language- based audio retrieval) can be described as the problem of ranking a set of audio files according to how closely they match a free-form query text. This is a form of a cross-modal retrieval between two modalities, namely natural language text and audio. For this task, text queries are usually provided as single-sentence descriptions of the audio, also referred to as captions. A common approach in cross-modal retrieval is to employ a separate encoder model for each modality and map the respective outputs to a common representation space. All submission in the Language-based audio retrieval task of the DCASE 2022 challenge [4] used this model architecture. Often these bi-encoder architectures rely on pretrained audio and text models [3, 5, 6]. 2.2. Dataset curation The goal of machine learning is to build a system that can generalise, i.e. perform well on previously unseen input data [7]. To judge this generalisation capability, machine learning practitioners usually keep a part of their data as a held-out set for evaluation. This is commonly referred to as training and test splits of a dataset. We usually assume that training and test data are independent of each other and identically distributed. If information about the evaluation data is ac- cessible to the machine learning model during training, these assumptions are violated and we speak of data leakage [8]. This problem was studied in the context of audio datasets. For example, Sturm [9] uncovers several problems in a bench- mark dataset widely used in music information retrieval re- search. They find some exact duplicates in the dataset and show how certain characteristics of the data can be con- founded with the ground-truth labels if left uncontrolled. For instance, filtering the dataset so that all musical excerpts of an artist are kept in one split can have a significant impact on the performance measure. This phenomenon is sometimes called "artist effect" [10]. As a positive example, Fonseca et al. explain their consid- erations when constructing the splits for the FSD50K dataset [11] – a dataset collected from the online platform Freesound [12]. They differentiate between data leakage and weak con- tamination. In their definition, this contamination can happen if items in a dataset are similar in some regard even if they are not the same. Similar to what Sturm [9] describes about grouping songs of the same artist, they group recordings of the same content uploader. 3. DATA LEAKAGE IN SOUNDDESC stumbled across several duplicate audio items3 in the pro- posed training and test splits. This led us to performing a more thorough investigation about the general structure of this dataset and the proposed splits. 3.1. The SoundDesc dataset The SoundDesc dataset was recently proposed by Koepke et al. [3]. It is a collection of audio recordings and sound effects sourced from the BBC Sound Effects Archive website4 and contains 32979 audio files with associated textual descrip- tions. Additionally, each item in the dataset is labelled with one primary category and potentially additional categories. The authors of the dataset publish the training, validation and testing splits along with benchmark results on these splits. 3.2. Detecting duplicates and overlapping recordings To automatically detect duplicates in the dataset, it requires a system to measure the similarity between recordings. We employed the publicly available audio fingerprinting software Panako [13] since it was already successfully used to detect duplicates in a similar setting [14]. The Panako algorithm was applied with its default configuration to generate a set of po- tentially matching audio recording pairs. After manually re- viewing a small subset, we decided to only keep pairs accord- ing to the following heuristic to filter out spurious matches: Pairs are considered duplicates if (i) the number of seconds containing sub-fingerprint matches exceeds 50% of the total match duration, and (ii) a score of 25 or higher is required for a match to be considered. We are left with 3601 distinct matching pairs. We find that there are not only exact duplicates but also reprocessed recordings and recordings with partial overlaps. These over- laps occur for example at the end and the start of another, or as one or more excerpts of a longer recording. For simplicity, we will refer to all cases as duplicates. 3.3. The effect of duplicates on the benchmark results After finding the duplicates in the dataset we want to assess their influence on the validity of the performance metrics measured in the published evaluation split. To do so we first identify all pairs of duplicates that are split between the training and the evaluation part (validation & testing) of the dataset. We then create a new training set that is a subset of the original by excluding all items that have a duplicate recording in the evaluation data. This way we can keep the test set unchanged and compare our results to the dataset creators' results. In total, we exclude 1388 of the 23085 files in the training set. To investigate the effect of the reduced While employing the newly released SoundDesc dataset for our work on language-based audio retrieval, we accidentally 3For example: https://sound-effects.bbcrewind.co.uk/ search?q=07054072%20OR%2007058026 4https://sound-effects.bbcrewind.co.uk/ training set size, we similarly construct three additional train- ing sets by excluding the same number of files at random. We refer to the new training subsets as deduplicated and random, respectively. To assess the impact on the model training, in our exper- iments, we adopt the Collaborative-Experts (CE) [15] model architecture as it was used by the SoundDesc authors in their benchmark [3] experiment. An implementation of this model is released together with the dataset.5 After model training, we perform retrieval on the entire original test set. Retrieval performance is measured as the recall at different levels by considering only the top k elements for each query (R@k). We report these metrics for the full test set and the subset of duplicates in the test set (648 items). All results are given in Table 1 as the mean and the standard deviation computed over three runs with different random initialisations. training set R@1 R@5 R@10 full test set original deduplicated 31.3 ± 0.3 26.6 ± 0.6 60.9 ± 0.6 55.5 ± 1.1 70.9 ± 0.7 66.1 ± 0.5 random 1 random 2 random 3 29.9 ± 0.5 29.8 ± 0.4 30.2 ± 0.1 59.1 ± 0.3 58.5 ± 0.3 59.2 ± 0.4 69.2 ± 0.3 68.6 ± 0.5 69.5 ± 0.1 duplicates only original deduplicated 52.2 ± 0.9 21.6 ± 0.6 82.8 ± 0.4 49.7 ± 1.8 89.8 ± 0.6 61.4 ± 0.9 random 1 random 2 random 3 49.7 ± 2.5 50.4 ± 0.6 49.8 ± 1.4 80.0 ± 1.2 81.5 ± 1.6 81.0 ± 0.9 87.8 ± 0.6 88.8 ± 0.5 87.9 ± 1.2 Table 1. Comparison of retrieval results for CE models trained with different training data From the table, we can see that models trained without ac- cess to the duplicates in the training set (deduplicated) score significantly lower in all metrics than models trained with the full training set (original). This large drop in performance is most likely only partially due to the fact that the former models have a smaller training set to learn from since mod- els trained on a randomly reduced training set (random 1-3) only suffer a minor hit in performance. This illustrates the influence of duplicates on the retrieval scores. This effect is also apparent when only looking at the metrics measured on test items that have a duplicate in the training set (duplicates only). Not surprisingly, we find that models can achieve sig- nificantly higher retrieval scores in the test subset of only du- plicates than the entire test set when duplicates are left un- treated (original). For example, more than half of the du- 5https://github.com/akoepke/ audio-retrieval-benchmark/ plicates are retrieved as the highest-ranked result (duplicates only/original R@1 = 52.2). After deduplication, the scores re- ported for the subset (deduplicated) are even below the scores of the entire test set. These findings illustrate that there is a data leakage problem in the publicly available splits of the SoundDesc dataset that leads to overly optimistic benchmark results. We argue that, in its current form, it can not be used as a benchmark dataset since it does not allow us to measure if any progress is made in solving the problem of text-based audio retrieval. 4. PROPOSING A NEW BENCHMARK To establish a new benchmark on SoundDesc, the flaws dis- cussed above need to be accounted for when splitting the data. Additionally, we study if forms of weak contamination of the test data can be avoided using the metadata associated with the dataset. 4.1. Treating duplicates As a minimal improvement, the discovered data leakage in SoundDesc needs to be fixed. Simply removing the duplicates from the training set would reduce the dataset size, which is not the preferred solution. Instead, we propose to partition the data so that pairs of duplicates remain in the same split. We form groups of recordings by assigning group labels to each pair of duplicates and by merging groups that share the same recording. Items without any duplicates are left ungrouped. Finally, we split the data and keep 15% for validation and testing, each. We use stratified sampling to maintain the same relative category distribution in all splits. We refer to this split as clean. 4.2. Avoiding weak contamination A bulk of the SoundDesc is sourced from the BBC natural history unit (NHU) archive. It comprises a large number of nature sounds, such as recordings of animals. We surmise that some of these recordings might have a perceptual like- ness even if they are no actual duplicates. Especially record- ings that share the same recording setting could have substan- tial similarities with each other. For example, if multiple vo- calisations of a bird are snippets of a long recording session, In the they might overlap in ambient noise, loudness, etc. context of machine learning these overlaps can be considered unwanted artefacts since those artefacts could favour models that memorise rather than generalise well. To avoid weak con- tamination of the test data in SoundDesc we propose to not split recordings with these kinds of potential overlaps when partitioning the dataset. To automatically identify potential groups of recordings, Date Recordist name Topic (start of description) Description (rest) 1996-11-21 Graham Ross Camel Market Camel Market . . . Rajasthan Musicians Rajasthan Musicians . . . close-up mournful calls from camel. background voices in crowd. close-up calls from camel. Sounds of crowd & individual voices. . . . medium close-up playing of flutes. Also sounds of drumming. Some background chatter from crowd. Sounds of masaks being played. Joined by singers & later drums. . . . 1977-05-31 Lyndon Bird Green Tree Frog (Hyla Cinerea) Green Tree Frog (Hyla Cinerea) . . . Chorus close-up with crickets and distant traffic Chorus close-up with crickets . . . Roy Horton Common Bee Fly (Bombylius Major) Common Bee Fly (Bombylius Major) . . . close-up hum from fly hovering. Birds in background. close-up hum from fly hovering. Birds in background. Also sheep, cockerel and voices in background. . . . Table 2. Examples of metadata associated with grouped recordings in our proposed split. we rely on metadata of the NHU archive:6 the date of the recording, the name of the recordist(s) and the topic of the recording. The topic is given for all NHU recordings at the start of the description text and separated from the rest with a single dash. Recordings that do not have a recording date or a recordist name associated will be left ungrouped. We can assign 12444 recordings to groups. Table 2 shows examples of the resulting groups. We merge the newly defined groups with the groups of the clean split and use the same stratifica- tion process to divide the data. We refer to the resulting splits as group-filtered. 4.3. Benchmark results To set a benchmark for our proposed splits, we compare the previously introduced CE model with our own model. Our system relies on a bi-encoder architecture that has shown promising results for the task of text-based audio retrieval [5]. We follow the same training procedure described in our previous work [5] and only make few minor adjustments to the model architecture: As an audio encoder, we employ a pre-trained PANNs model [16] that we keep fixed during training. The audio embedding sequence extracted by this encoder is reduced by computing the mean and maximum across the time dimension and stacking the resulting vectors. The stacked vectors are then mapped to a dimensionality of 768 using a multi-layer perceptron (MLP). As text encoder, we employ a pre-trained distilroberta-base [17, 18] model. We take the first vector in the extracted text embedding se- quence as the encoder result and similarly process it with an MLP. We use the same evaluation metrics as described above. Table 3 compares the results obtained by the two methods on each of our proposed splits. It is apparent from the figures in the table that there are no significant differences between 6This metadata is also accessible through the BBC Sound Ef- fects Archive website but was not included in the SoundDesc dataset. training set R@1 R@5 R@10 CE Ours CE Ours clean split 27.3 ± 0.6 28.0 ± 0.6 55.9 ± 0.4 55.5 ± 0.7 66.5 ± 0.5 65.6 ± 0.6 group-filtered split 20.4 ± 0.6 20.8 ± 0.3 43.9 ± 0.2 44.3 ± 0.8 53.7 ± 0.5 54.2 ± 0.6 Table 3. Comparison of retrieval results achieved by two dif- ferent methods on our newly proposed SoundDesc splits. the results achieved by the different models in either of the splits. As expected, the results for the clean split are in the range of the results of the experiments with the deduplicated training data discussed in Section 3.3. Interestingly, the re- trieval scores are significantly lower when the group-filtered split is used. This suggests that it is harder to retrieve the cor- rect recording in this split of the data. A possible explanation for these results may be that there was indeed weak contami- nation of the test data present in SoundDesc and models could make use of overlaps in the data to solve the retrieval problem. 5. CONCLUSION In this paper, we demonstrated that a data leakage problem in the publicly available splits of SoundDesc leads to overly optimistic retrieval results. Using an off-the-shelf audio fin- gerprinting software, we identified that the data leakage stems from duplicates in the dataset. We define two new splits for the dataset: a cleaned split to remove the leakage and a group- filtered to avoid other kinds of weak contamination of the test data. From the results achieved by two different retrieval models, we conclude that our splits of the dataset serve as a more challenging benchmark for text-based audio retrieval. human-labeled sound events," IEEE/ACM Transactions on Audio, Speech, and Language Processing, vol. 30, pp. 829–852, 2022, Publisher: IEEE. [12] Frederic Font, Gerard Roma, and Xavier Serra, in Proceedings of the "Freesound Technical Demo," 21st ACM International Conference on Multimedia, New York, NY, USA, 2013, MM '13, pp. 411–412, Association for Computing Machinery, event-place: Barcelona, Spain. [13] Joren Six, "Panako: a scalable audio search system," Journal of Open Source Software, vol. 7, no. 78, pp. 4554, Oct. 2022. [14] Joren Six, Federica Bressan, and Marc Leman, "Ap- plications of Duplicate Detection in Music Archives: From Metadata Comparison to Storage Optimisation," in Digital Libraries and Multimedia Archives, Giuseppe Serra and Carlo Tasso, Eds., Cham, 2018, Communi- cations in Computer and Information Science, pp. 101– 113, Springer International Publishing. [15] Y. Liu, S. Albanie, A. Nagrani, and A. Zisserman, "Use What You Have: Video retrieval using represen- tations from collaborative experts," in arXiv preprint arxiv:1907.13487, 2019. [16] Qiuqiang Kong, Yin Cao, Turab Iqbal, Yuxuan Wang, Wenwu Wang, and Mark D. Plumbley, "PANNs: Large- Scale Pretrained Audio Neural Networks for Audio Pat- tern Recognition," IEEE/ACM Transactions on Audio, Speech, and Language Processing, vol. 28, pp. 2880– 2894, 2020. [17] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Man- dar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov, "RoBERTa: A Ro- bustly Optimized BERT Pretraining Approach," 2019. [18] Victor Sanh, Lysandre Debut, Julien Chaumond, and "DistilBERT, a distilled version of Thomas Wolf, BERT: smaller, faster, cheaper and lighter," 2019. 6. REFERENCES [1] Konstantinos Drossos, Samuel Lipping, and Tuomas Virtanen, "Clotho: an Audio Captioning Dataset," in ICASSP 2020 - 2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Barcelona, Spain, May 2020, pp. 736–740, IEEE. [2] Chris Dongjoo Kim, Byeongchang Kim, Hyunmin Lee, and Gunhee Kim, "AudioCaps: Generating Captions for Audios in The Wild," in NAACL-HLT, 2019. [3] A. Sophia Koepke, Andreea-Maria Oncescu, Joao Hen- riques, Zeynep Akata, and Samuel Albanie, "Audio retrieval with natural language queries: A benchmark IEEE Transactions on Multimedia, pp. 1–1, study," 2022. [4] Huang Xie, Samuel Lipping, and Tuomas Virtanen, "Language-based Audio Retrieval Task in DCASE 2022 Challenge," Accepted at DCASE 2022 Workshop, 2022. [5] Benno Weck, Miguel P ́erez Fern ́andez, Holger Kirch- hoff, and Xavier Serra, "Matching Text and Audio Em- beddings: Exploring Transfer-Learning Strategies for Language-Based Audio Retrieval," in Proceedings of the 7th Workshop on Detection and Classification of Acoustic Scenes and Events 2022, DCASE 2022, Nancy, France, November 3-4, 2022, Mathieu Lagrange, Anna- maria Mesaros, Thomas Pellegrini, Ga ̈el Richard, Ro- main Serizel, and Dan Stowell, Eds. 2022, Tampere Uni- versity. [6] Xinhao Mei, Xubo Liu, Jianyuan Sun, Mark Plumbley, and Wenwu Wang, "On Metric Learning for Audio- Text Cross-Modal Retrieval," in Interspeech 2022. Sept. 2022, pp. 4142–4146, ISCA. [7] Ian Goodfellow, Yoshua Bengio, and Aaron Courville, Deep Learning, MIT Press, 2016. [8] Shachar Kaufman, Saharon Rosset, Claudia Perlich, and Ori Stitelman, "Leakage in data mining: Formulation, detection, and avoidance," ACM Trans. Knowl. Discov. Data, vol. 6, no. 4, pp. 15:1–15:21, 2012. [9] Bob L. Sturm, "The State of the Art Ten Years After a State of the Art: Future Research in Music Information Retrieval," Journal of New Music Research, vol. 43, no. 2, pp. 147–172, 2014. [10] Arthur Flexer and Dominik Schnitzer, "Effects of Al- bum and Artist Filters in Audio Similarity Computed for Very Large Music Databases," Comput. Music. J., vol. 34, no. 3, pp. 20–28, 2010. [11] Eduardo Fonseca, Xavier Favory, Jordi Pons, Frederic Font, and Xavier Serra, "FSD50K: an open dataset of
http://arxiv.org/abs/2302.11883v3
2023-03-30T07:09:35
2023-02-23T09:42:21
PIFON-EPT: MR-Based Electrical Property Tomography Using Physics-Informed Fourier Networks
\textit{Objective:} In this paper, we introduce Physics-Informed Fourier Networks for Electrical Properties Tomography (PIFON-EPT), a novel deep learning-based method that solves an inverse scattering problem based on noisy and/or incomplete magnetic resonance (MR) measurements. \textit{Methods:} We used two separate fully-connected neural networks, namely $B_1^{+}$ Net and EP Net, to solve the Helmholtz equation in order to learn a de-noised version of the input $B_1^{+}$ maps and estimate the object's EP. A random Fourier features mapping was embedded into $B_1^{+}$ Net, to learn the high-frequency details of $B_1^{+}$ more efficiently. The two neural networks were trained jointly by minimizing the combination of a physics-informed loss and a data mismatch loss via gradient descent. \textit{Results:} We performed several numerical experiments, showing that PIFON-EPT could provide physically consistent reconstructions of the EP and transmit field. Even when only $50\%$ of the noisy MR measurements were used as inputs, our method could still reconstruct the EP and transmit field with average error $2.49\%$, $4.09\%$ and $0.32\%$ for the relative permittivity, conductivity and $B_{1}^{+}$, respectively, over the entire volume of the phantom. The generalized version of PIFON-EPT that accounts for gradients of EP yielded accurate results at the interface between regions of different EP values without requiring any boundary conditions. \textit{Conclusion:} This work demonstrated the feasibility of PIFON-EPT, suggesting it could be an accurate and effective method for EP estimation. \textit{Significance:} PIFON-EPT can efficiently de-noise $B_1^{+}$ maps, which has the potential to improve other MR-based EPT techniques. Furthermore, PIFON-EPT is the first technique that can reconstruct EP and $B_{1}^{+}$ simultaneously from incomplete noisy MR measurements.
[ "Xinling Yu", "José E. C. Serrallés", "Ilias I. Giannakopoulos", "Ziyue Liu", "Luca Daniel", "Riccardo Lattanzi", "Zheng Zhang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11883v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11883v3", "@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" ]
1 PIFON-EPT: MR-Based Electrical Property Tomography Using Physics-Informed Fourier Networks Xinling Yu, José E. C. Serrallés, Member, IEEE, Ilias I. Giannakopoulos, Ziyue Liu, Luca Daniel, Fellow, IEEE, Riccardo Lattanzi, Senior Member, IEEE, Zheng Zhang, Member, IEEE 3 2 0 2 r a M 0 3 ] G L . s c [ 3 v 3 8 8 1 1 . 2 0 3 2 : v i X r a Abstract-Objective: In this paper, we introduce Physics- Informed Fourier Networks for Electrical Properties Tomography (PIFON-EPT), a novel deep learning-based method that solves an inverse scattering problem based on noisy and/or incomplete magnetic resonance (MR) measurements. Methods: We used two separate fully-connected neural networks, namely B+ 1 Net and EP Net, to solve the Helmholtz equation in order to learn a de- noised version of the input B+ 1 maps and estimate the object's EP. A random Fourier features mapping was embedded into B+ 1 Net, to learn the high-frequency details of B+ 1 more efficiently. The two neural networks were trained jointly by minimizing the combination of a physics-informed loss and a data mismatch loss via gradient descent. Results: We performed several numerical experiments, showing that PIFON-EPT could provide physically consistent reconstructions of the EP and transmit field. Even when only 50% of the noisy MR measurements were used as inputs, our method could still reconstruct the EP and transmit field with average error 2.49%, 4.09% and 0.32% for the relative permittivity, conductivity and B+ 1 , respectively, over the entire volume of the phantom. The generalized version of PIFON-EPT that accounts for gradients of EP yielded accurate results at the interface between regions of different EP values without requiring any boundary conditions. Conclusion: This work demonstrated the feasibility of PIFON-EPT, suggesting it could be an accurate and effective method for EP estimation. Significance: PIFON- EPT can efficiently de-noise B+ 1 maps, which has the potential to improve other MR-based EPT techniques. Furthermore, PIFON- EPT is the first technique that can reconstruct EP and B+ 1 simultaneously from incomplete noisy MR measurements. Index terms- Electrical Property Mapping, Fourier Features Mapping, Magnetic Resonance Imaging, Physics Informed Neural Networks. This work was supported in part by research grants from the National Science Foundation (NSF 2107321) and the National Institute of Health (NIH 2R01 EB024536) in the United States. (Corresponding author: Xinling Yu) Xinling Yu and Zheng Zhang are with the Department of Electrical and Computer Engineering, University of California, Santa Barbara, CA 93106 USA (email: [email protected]). José E. C. Serrallés and Luca Daniel are with the Research Laboratory of Electronics, Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, Cambridge, MA 02139 USA. Ilias I. Giannakopoulos is with the Bernard and Irene Schwartz Center for Biomedical Imaging, Department of Radiology, New York University Grossman School of Medicine, NY 10016 USA. Riccardo Lattanzi is with the Center for Advanced Imaging Innovation and Research (CAI2R), and with the Bernard and Irene Schwartz Center for Biomedical Imaging, Department of Radiology, New York University Grossman School of Medicine, NY 10016 USA. Ziyue Liu is with the Department of Statistics and Applied Probability, University of California, Santa Barbara, CA 93106 USA. I. INTRODUCTION Electrical properties (EP), namely relative permittivity and electric conductivity, determine the interactions between elec- tromagnetic waves and biological tissue [1], [2]. EP have the potential to be employed as biomarkers for pathologies such as cerebral ischemia [3], [4] and cancer [5]–[8]. EP could also be used to improve the effectiveness of existing therapeutic modalities such as radiofrequency hyperthermia [9]–[11]. 1 ) or receive (B− Several EP tomography (EPT) methods have been proposed that are based on MR measurements, such as the magnetic transmit (B+ 1 ) field maps [12]–[22]. These techniques can be classified based on the form of Maxwell's equations (differential or integral) they use to fit the MR measurements. Differential methods, such as the Helmholtz EPT (H-EPT) [14] or the Convection-Reaction EPT (CR-EPT) [16], require the calculations of spatial derivatives of noisy measured B+ 1 maps, which lead to errors and artifacts in the reconstructions [23]. On the other hand, integral equation- based methods [19], [20] are robust to noise, but require computationally expensive iterative optimizations that rely on an accurate model of the transmit coils [24], [25] and fine- tuned regularization parameters. Recently, data-driven deep learning-based methods have been introduced for EP reconstruction [26]–[29]. These meth- ods treat MR measurements and EP distributions as 2D images or 3D volumes, and train regression convolution neural net- works as surrogate EP reconstruction models from simulated training data. These supervised learning-based techniques per- form well in simulation, but they are not reliable in vivo due to the necessarily limited number of different cases included in the training data. To improve the generalization to in-vivo data, hybrid techniques that embed deep learning into conventional EP mapping methods were proposed [30], [31]. These hybrid methods use neural networks to generate initial guesses of EP for iterative reconstruction schemes [30], or diffusion and convection coefficients for the convection-reaction equation [31]. While these approaches improve generalization, several electromagnetic simulations are still required to generate train- ing data, which can be very expensive and time-consuming. A recent hybrid technique directly reconstructs conductivity from input transceive phases [32]. In such a method, a neural network is trained to represent the input transceive phase map, where the gradients of the phase are computed by automatic differentiation [33] and then used to solve the phase-only convection-reaction EPT. The reconstructed conductivity is compared with ground-truth values at the boundary, as a regularization for the neural network that represents the phase. Since this method retains the physics of EPT, it does not require a comprehensive set of electromagnetic simulations. However, learning a single neural network that can simulta- neously represent the ground-truth phase and provide accurate gradient approximations directly from noisy measured phase maps is challenging, which is shown by the fact that they yielded highly inaccurate EP reconstructions in most cases. Following our preliminary study [34], here we propose the Physics-Informed Fourier Networks (PIFONs) Electrical Prop- erties Tomography (PIFON-EPT) framework, which leverages recent developments on physics-informed deep learning [35], [36] and Fourier features mapping [37] to learn both the EP distribution and the B+ 1 field globally from noisy and/or incomplete ̃B+ 1 measurements. The proposed framework can efficiently de-noise the B+ 1 measurements and provide phys- ically consistent reconstructions of the EP. Differently from other supervised learning-based EPT methods [26]–[29], our proposed PIFON-EPT technique can reconstruct EP directly, without being trained on known B+ 1 and EP distribution pairs. Compared with recent physics-aware hybrid EPT methods [31], [32] in which EP are still solved numerically from convection-reaction equation with boundary condition, our method represents EP as a neural network constrained by the Helmholtz equations and does not require any prior EP information. The rest of the paper is organized as follows: In Section II, we provide a brief overview of standard EPT methods. In Section III, we describe the proposed novel PIFON-EPT framework. In Section IV, we demonstrate the effectiveness of our PIFON-EPT with four representative numerical exper- iments. Further discussion is provided in Section V, whereas Section VI summarizes the main points of this work. II. TECHNICAL BACKGROUND A. Fundamental Helmholtz Equations in MRI The relation between the magnetic field (B) and the EP of a medium can be described by the Helmholtz equation: ∇2B + k2 0εcB + ∇εc × ∇ × B εc = 0, where k0 is the wave number in vacuum and εc = εr − iσ ωε0 , (1) (2) is the relative complex permittivity. Here, εr is the relative permittivity and σ is the electric conductivity, i denotes the imaginary unit, ω denotes the angular frequency, and ε0 denotes the vacuum permittivity. Since the full transmit B1 cannot be measured in an MRI scanner, but only its positively rotating component B+ 1 = (Bx + iBy)/2, we can re-write equation (1) with the help of Gauss' law (∇ * B = 0) as: ∇2B+ 1 + k2 0εcB+ 1 = + (cid:18) ∂B+ 1 ∂x (cid:18) ∂B+ 1 ∂z − i + ∂B+ 1 ∂y ∂Bz ∂x 1 2 − − i (cid:19) 1 2 1 2 ∂Bz ∂z ∂Bz ∂y (gx + igy) (cid:19) gz. (3) 2 Here, g := (gx, gy, gz) := ∇ ln εc. If we assume a smooth distribution of the EP, their gradient g can be ignored, and equation (3) becomes the homogeneous Helmholtz equation: ∇2B+ 1 + k2 0εcB+ 1 = 0. (4) B. Standard Differential EPT Methods One can solve equations (3) and (4) for the EP, starting from measured B+ 1 maps. There are several methods based on such approach (here is a non-exhaustive list [14]–[21]). Next, we provide a brief overview of two popular ones: the Helmholtz EPT [14] and the Convection-Reaction EPT [16]. Open-source software implementations of these methods can be found in EPTlib [38]. 1) Helmholtz EPT: Assuming a homogeneous distribution of the EP and access to measured complex ̃B+ 1 maps, one can directly invert the homogeneous Helmholtz equation (4) to estimate the EP: . εc = − ∇2 ̃B+ 1 ̃B+ k2 1 0 The second-order spatial derivatives of the measured ̃B+ 1 can be computed via finite difference approaches. If the measured fields are noisy, smoothing filters such as the 2nd order Savitzky-Golay filter [39] can be applied to improve the numerical derivatives. (5) 2) Convection-Reaction EPT: High-field MRI scanners (< 7 tesla) utilize birdcage-based body coils [40] for transmission. In these cases, the Bz component of the magnetic field can be assumed negligible near the mid-plane of the magnet bore. As a result, the generalized Helmholtz equation (3) can be simplified as: ∇2 ̃B+ 1 + k2 0εc ̃B+ 1 = + (cid:33) − i ∂ ̃B+ 1 ∂y (gx + igy) (6) (cid:32) ∂ ̃B+ 1 ∂x ∂ ̃B+ 1 ∂z * gz. If we let γ = 1/εc, equation (6) can be rewritten as the convection-reaction equation with a zero diffusion term with respect to γ [16]: (7) ∇2 ̃B+ 1 * γ + k2 0 ̃B+ 1 = − (cid:18) ∂ ̃B+ 1 ∂x − i ∂ ̃B+ 1 ∂y (cid:19) (cid:18) ∂γ ∂x + i ∂γ ∂y (cid:19) ∂ ̃B+ 1 ∂z * . − ∂γ ∂z By imposing appropriate boundary conditions (for example, the value of γ at the boundary of the domain), the convection- reaction equation (7) can be solved with a mesh-based finite difference scheme for γ. As for Helmholts EPT, also in this case the gradients of the measured ̃B+ 1 can be estimated using the Savitzky-Golay filter [39]. Since at MRI frequencies below 3 tesla, the absolute phase of B+ 1 is almost independent from the permittivity [13], it is possible to perform conductivity- only reconstructions using only the absolute phase of ̃B+ 1 [22], which, for birdcage coils, can be estimated with the transceive assumption (see next section) [14]. It is also possible to include an artificial diffusion term to the convection-reaction equation to stabilize and improve the reconstruction results [41]. III. METHODS Our proposed PIFON-EPT is a deep learning-based frame- work for robust EP estimation using noisy and/or incom- plete complex-valued MR measurements. Note that since in MRI we do not have direct access to the absolute phase of B+ 1 , we must rely on symmetry assumptions to estimate the complex-valued field in actual experiments. Specifically, at 1.5 and 3 tesla, when RF birdcage coils are used for transmission and reception in quadrature, the B+ 1 and B− 1 phases are approximately equal [13], [14]. Therefore, since the transceive phase is measurable [42], we can approximate the absolute phase of B+ 1 as half the transceive phase. The goal of PIFON-EPT is to learn the EP distributions globally that best describe the complex-valued B+ at any spatial 1 location (x, y, z), given {(ri, ̃B+ i=1 only for a limited N locations ri = (xi, yi, zi). The workflow of PIFON-EPT is summarized in Fig. 1. 1 (ri))}N A. PIFON-EPT workflow Traditional EPT methods based on finite difference ap- proximation of derivatives of B+ 1 (5), (7) can lead to noise amplifications in the reconstructed EP distributions. To prevent this, we seek to solve an optimization problem constrained by the measured data and physical laws using physics-informed deep learning [35]. We denote the Helmholtz equation that describes the physical laws that must be satisfied by B+ 1 in the general form on a d-dimension domain Ω ∈ Rd: Nr[B+ 1 ; ε(r)](r) = 0, (8) 1 (r) describes the hidden B+ where r ∈ Rd is a spatial coordinate and Nr[*; ε] is a symbolic representation of the Helmholtz equation (4) or (6). ε(r) denotes the complex-valued EP at the location r and B+ 1 field solution governed by equation (8). Given noisy and/or incomplete measurements {ri, ̃B+ 1 (ri)}N i=1, we aim to learn the EP distributions ε as well as the B+ 1 for all r. To do so, we define a Fourier neural network B+ 1 (r; θ1), constructed by Gaussian random Fourier features [37] followed by a fully-connected neural network with a set of weights and biases θ1, to represent the complex B+ 1 field. The Gaussian random Fourier features mapping is defined as: γ(r) = (cid:20) cos(Br) sin(Br) (cid:21) , (9) where each entry in B ∈ Rm×3 is sampled from a Gaussian distribution N(0, σ2). 2m equals the width of the fully- connected neural network following the defined Fourier fea- tures and σ > 0 is a task-specific hyperparameter. We use an additional fully-connected neural network Ec(r; θ2) with independent weights and biases θ2 to estimate the distribution of EP. Hereinafter, we refer to B+ 1 (r; θ1) and Ec(r; θ2) as B+ 1 net and EP net, respectively. The PDE residual of (8) is transformed to: 3 A good set of candidate parameters {θ1, θ2} can be obtained by minimizing the following composite loss function via gradient descent with the Adam optimizer [43]: L(θ1, θ2) = Ldata (θ1) + λLr(θ1, θ2), N (cid:88) Ldata (θ1) = |Re{B+ 1 (ri; θ1)} − Re{ ̃B+ 1 (ri)}|2 1 N + Lr(θ1, θ2) = 1 N 1 N i=1 N (cid:88) i=1 N (cid:88) i=1 |Im{B+ 1 (ri; θ1)} − Im{ ̃B+ 1 (ri)}|2, (11) |R(ri, θ1, θ2)|2. Ldata denotes the data mismatch and Lr denotes the PDE residual. λ denotes the weight coefficient in the loss function, which balances the two loss terms in the composite loss. We remark that λ is a hyperparameter that can either be specified by the user or be tuned automatically [44], [45]. All the 1 (r; θ1) and Ec(r; θ2) with respect to the derivatives of B+ spatial coordinate r as well as the gradient of the loss function with respect to the neural network parameters {θ1, θ2}, are computed using automatic differentiation algorithms [33]. 1 field solution more efficiently [37]. Second, B+ The workflow of our proposed PIFON-EPT (Fig. 1) can be summarized as follow. First, we define two separate fully- 1 Net and EP Net (Ec(r; θ2)) to connected neural networks B+ represent the B+ 1 and the EP, respectively. A random Fourier features mapping (see Fig. 1 green dotted box) is embedded into B+ 1 Net to learn high frequency components of the target B+ 1 Net and EP Net are trained jointly by minimizing a composite loss function that aims to fit the measured ̃B+ 1 data (see Fig. 1 blue dotted box), while satisfying the physics laws characterized by the PDE residual. Finally, the trained physics-informed B+ 1 Net and EP Net can be used to obtain physically consistent predictions of B+ 1 and EP at arbitrary 3D locations (see Fig. 1 bottom red dotted boxes). B. Choice of Helmholtz equation If we assume piece-wise constant EP, then the Helmholtz equation simplifies as in (4). Eq. (6) is a generalized form of the same equation, which accounts for gradients of EP, but is yet not fully general because to reduce the number of unknowns, we assumed that Bz is equal to zero. Depending on which Helmholtz equation is used, we introduced two vari- ants of PIFON-EPT: simplified PIFON-EPT and generalized PIFON EPT. 1) Simplified PIFON-EPT: Assumes piece-wise constant EP and does not require any assumption on Bz. Following Eq. (4), the Helmholtz residual (10) can be represented as: RH = ∇2B+ 1 (r; θ1) + k2 0 Ec(r; θ2)B+ 1 (r; θ1). (12) R(r, θ1, θ2) := Nr[B+ 1 (r; θ1); Ec(r; θ2)](r). (10) 2) Generalized PIFON-EPT: Assumes Bz ≈ 0 and uses the generalized equation (6). The Helmholtz residual (10) 4 Fig. 1. PIFON-EPT workflow. Two separate fully-connected neural networks B+ field and the EP distributions, respectively. The B+ ̃B+ physically consistent predictions of B+ different iterations during training is shown at the bottom (red dotted box). 1 (r; θ1)) and EP Net (Ec(r; θ2)) are defined to represent the B+ 1 1 Net and EP Net are trained jointly by minimizing a composite loss function that aims to fit the measured 1 Net and EP Net can be used to obtain 1 and EP at any arbitrary 3D location. A representative axial cut of the outputs of the neural networks obtained at 1 data (blue dotted box) while also penalizing the PDE residual. Once trained, the resulting physics-informed B+ 1 Net (B+ becomes: RGH = ∇2B+ 1 (r; θ1) + k2 0 Ec(r; θ2)B+ 1 (r; θ1) − (cid:32) ∂B+ 1 (r; θ1) ∂x − i ∂y ∂B+ 1 (r; θ1) (cid:33) (cid:18) ∂Ec(r; θ2) − 1 Ec(r; θ2) (cid:32) ∂B+ 1 (r; θ1) ∂z * ∂x (cid:33) ∂Ec(r; θ2) ∂z . 1 Ec(r; θ2) ∂Ec(r; θ2) ∂y (cid:19) (13) + i Both techniques rely on knowledge of the absolute phase of B+ 1 , which for a quadrature birdcage coil can be esti- mated from the transceive phase assumption. Note that with a sufficient number of transmit-receive coils, it is theoretically possible to solve for both the unknown absolute phase and Bz [46], although the lack of suitable multi-channel coils and the computational complexity of such solution has prevented practical implementations. IV. RESULTS We present a series of numerical examples to demonstrate the effectiveness of our proposed PIFON-EPT framework. Throughout all experiments, unless otherwise specified, we used simulated complex B+ 1 maps as measured data and corrupted them with white Gaussian noise with a standard deviation equal to the ratio of the peak value of |B+ 1 | to a prescribed peak signal-to-noise-ratio (SNR) value. The simu- lations were performed with the volume [47] and the volume- surface integral equation [48], [49] methods. The volume equations were solved using higher-order polynomials [50] as basis functions to ensure accuracy in the B+ 1 distributions. All experiments were performed on a server running Ubuntu 20.04.3 LTS operating system, with an Intel(R) Xeon(R) Silver 4216 CPU at 2.10GHz, 64 cores, 2 threads per core, and an NVIDIA RTX 3090 GPU with 24 GB of memory. A. Validation against the analytical solution To verify our method we used a complex B+ 1 map obtained from the Mie Scattering theory [51] for an infinitely long homogeneous dielectric cylinder of relative permittivity 3 and electric conductivity 0.01 S/m. The operating wavelength was λ = 2.437 m and the cylinder had a radius r equal to the wavelength. A TMz planewave was used as the excitation. 1) Data Acquisition: We computed the B+ 1 field distribu- tion in the domain [−2r, 2r] × [−2r, 2r] using Mie scattering theory [52]. The pixel isotropic resolution was set to 0.05λ. We corrupted the synthetic B+ 1 field with Gaussian noise of peak SNR of 200 and then scaled the noisy field with the peak value of |B+ 1 measurements. The resulting ̃B+ 1 fields were used as the measured data for PIFON-EPT. 1 | to obtain synthetic ̃B+ xzσσσσσσσσy......σσσσ...Re{Ɛ!}Im{Ɛ!}xzσσσσσσσσy......σσσσ...Re{B"#}Im{B"#}sinsincoscos...Fourier featuresFully-connected NNFully-connected NN∂B"#∂x∂B"#∂y∂B"#∂z∇$B"#B"#∂Ɛ!∂x∂Ɛ!∂y∂Ɛ!∂zƐ!Data mismatch: LdataPDE residual: LrTotal loss: Ldata+ λLrB!"NetEP NetUpdate parameters of EP NetB!"reconstruction processzxyMeasured data "B!"Iteration = 0 Iteration = 300 Iteration = 3000 Iteration = 30000Iteration = 0 Iteration = 300 Iteration = 3000 Iteration = 30000Update parameters of B&'NetEP reconstruction process(|B+,|+φ, 2) PIFON Training Settings: B+ 1 Net was constructed by a Fourier features mapping initialized with σ = 2 as a coordinate embedding of the input, followed by a fully-connected neural network with 3 layers, 128 units per layer. EP Net was con- structed using a fully-connected neural network with 3 layers, 128 units per layer. We set all the activation functions as the Sine function. We set λ = 10−4 in equation (11). We trained B+ 1 Net and EP Net jointly using the Adam optimizer for 120k iterations in total, with a decaying schedule of learning rates 10−3, 10−4, 10−5 decreased every 40k iterations, which took ∼ 30 minutes and ∼ 40 minutes for employing simplified PIFON-EPT and generalized PIFON-EPT, respectively. We tested the performance of simplified PIFON-EPT and generalized PIFON-EPT using the same training settings. Fig. the 2 and Fig. 3 compare the EP reconstructions against ground truth EP for simplified PIFON-EPT and generalized PIFON-EPT, respectively. Fig. 4 and Fig. 5 compare ground truth and reconstructed B+ for simplified PIFON-EPT and 1 generalized PIFON-EPT, respectively. The average PNAE over the domain for the relative permittivity, conductivity, and B+ 1 was 3.96%, 9.67% and 0.22%, respectively for simpli- fied PIFON-EPT. The average PNAE over the domain for the relative permittivity, conductivity, and B+ 1 was 1.80%, 1.11% and 0.20%, respectively for generalized PIFON-EPT. The generalized PIFON-EPT achieved smaller errors near the boundary for EP reconstructions. 5 Fig. 3. EP reconstruction with generalized PIFON-EPT for a uniform dielectric cylinder. From left to right, ground truth EP, including relative permittivity (top) and conductivity (bottom), predicted EP using ̃B+ 1 measurements with peak SNR of 200, peak-normalized absolute errors, distribution of the error in 6561 voxels. Fig. 4. Reconstructed B+ 1 with simplified PIFON-EPT inside a uniform dielectric cylinder. From left to right, ground truth noise-free synthetic B+ 1 , including magnitude (top) and transmit phase (bottom), reconstructed B+ 1 from noisy synthetic ̃B+ 1 measurements with peak SNR of 200, peak- normalized absolute errors, distribution of the error in 6561 voxels. Fig. 2. EP reconstruction with simplified PIFON-EPT for a uniform dielectric cylinder. From left to right, ground truth EP, including relative permittivity (top) and conductivity (bottom), predicted EP using ̃B+ 1 measurements with peak SNR of 200, peak-normalized absolute errors, distribution of the error in 6561 voxels. B. Concentric Cylindrical Phantom We considered a two-compartment concentric cylindrical phantom with relative permittivity ε = {70, 78} and conduc- tivity σ = {0.5, 1} S/m (outer, inner). The cylinder loaded a high-pass birdcage coil with eight legs as shown in Fig. 6. The outer and inner radius of the cylinder were 6 cm and 3 cm, respectively, and its length was 14 cm. For this example, we compared the proposed PIFON-EPT with the Helmholtz-EPT (H-EPT) and the Convection-Reaction EPT (CR-EPT) (see II-B). In particular, we used the implementations in EPTlib [38], with the Savitzky-Golay filter with an ellipsoid-shaped kernel of size 2 × 2 × 2 to approximate all the gradients. For CR-EPT, we set the diffusion coefficient to 0.02 and the conductivity boundary condition to 0.55 S/m. Fig. 5. Reconstructed B+ 1 with generalized PIFON-EPT for a uniform dielectric cylinder. From left to right, ground truth noise-free synthetic B+ 1 , including magnitude (top) and transmit phase (bottom), reconstructed B+ 1 from noisy synthetic ̃B+ 1 measurements with peak SNR of 200, peak- normalized absolute errors, distribution of the error in 6561 voxels. 1) Data Acquisition: We used the volume-surface integral equation method [49] to simulate the circularly polarized (CP) mode of the birdcage coil loaded with the cylindrical phantom at 3 T. The resolution was set to 2 mm3. We used B+ 1 and B− from the central region of the cylinder (12 × 12 × 1 2 cm3, MR measurements out of cylindrical phantom were not used) and corrupted them with Gaussian noise of peak 6 1 with generalized PIFON-EPT for Fig. 8. Reconstructed B+ the two- compartment cylindrical phantom. From left to right, noise-free synthetic B+ 1 for the central axial cut, including magnitude (top) and transmit phase 1 field from noisy ̃B+ (bottom), reconstructed B+ 1 measurements, peak- normalized absolute errors, distribution of the error in 31031 voxels. Fig. 9 and Fig. 10 show the conductivity reconstruction results for H-EPT and CR-EPT, respectively, along with the PNAE distribution and the error histogram. The average PNAE over the volume where EP was reconstructed was 51.80% and 11.28% for H-EPT and CR-EPT, respectively. Fig. 9. Conductivity reconstructed with phase-based H-EPT for the two- compartment cylindrical phantom. From left to right, ground truth conductivity for the central axial cut of the phantom, estimated conductivity using ̃φ± measurements with peak SNR of 200, the peak-normalized absolute errors, the distribution of the error in 17423 voxels. Fig. 10. Conductivity reconstructed with phase-based CR-EPT for the two- compartment cylindrical phantom. From left to right, ground truth conductivity for the central axial cut of the phantom, estimated conductivity using ̃φ± measurements with peak SNR of 200, the peak-normalized absolute errors, the distribution of the error in 11645 voxels. C. Four-Compartment Phantom In this example, we explore the performance of PIFON- EPT at 7 tesla. We considered a previously used [19] tissue- mimicking four-compartment phantom shaped as a 20×20×20 cm3 rectangular parallelepiped. The relative permittivity val- ues of the four compartments were 51, 56, 65, and 76. The corresponding electric conductivity values were 0.56, 0.69, 0.84, and 1.02 S/m, respectively. Fig. 6. Geometry of compartments cylindrical phantom the high-pass birdcage coil loaded with a two- SNR of 200. We approximated the complex B+ 1 using the transceive phase assumption (TPA) and constructed the MR measurements | ̃B+ 1 | and ̃φ±. 2) PIFON Training Settings: The Bz field of a birdcage is negligible around the mid-plane of the coil. For this rea- son, we used the generalized PIFON-EPT to perform the reconstruction. For B+ 1 Net, the Fourier feature mapping was initialized with σ = 40 as a coordinate embedding of the input, followed by a fully-connected neural network with 6 layers, 128 units per layer. EP Net was an additional Fourier neural network constructed by a Fourier feature mapping initialized with σ = 2, followed by a fully-connected neural network with 6 layers, 128 units per layer. We set all the activation functions as the Sine function and set λ = 10−8 in equation (11). We trained B+ 1 Net and EP Net jointly using the Adam optimizer for 120k iterations in total, with a decaying schedule of learning rates 10−3, 10−4, 10−5 decreased every 40k iterations. The overall training time took 220 minutes on our GPU. Results are shown in Fig. 7 for the central axial cut of the cylinder. The average PNAE over the entire volume of the cylinder was 4.84%, 3.20% and 0.25% for relative permittivity, conductivity and B+ 1 , respectively. the two- Fig. 7. EP reconstructed with generalized PIFON-EPT for compartment cylindrical phantom. From left to right, ground truth EP for the central axial cut of the phantom, including relative permittivity (top) and conductivity (bottom), estimated EP using synthetic ̃B+ 1 measurements with peak SNR of 200, peak-normalized absolute errors, distribution of the error in 31031 voxels. 1) Data Acquisition: We used a single external excitation to illuminate the phantom, generated from a numerical electro- magnetic basis [53], similar to previous work [19]. We used 6 mm isotropic voxel resolution. We corrupted the synthetic B+ 1 with different levels of Gaussian noise (Peak SNR = 200, 100, 50, 20) and then scaled each field map by the corresponding 1 | to obtain synthetic ̃B+ peak value of |B+ 1 measurements. The case of peak SNR = 50 is shown in Fig. 11. 7 Fig. 12. EP reconstructed with simplified PIFON-EPT for the four- compartment phantom. From left to right, ground truth EP for the central axial cut of the phantom, including relative permittivity (top) and conductivity (bottom), EP reconstructed from synthetic ̃B+ 1 measurements with peak SNR of 50, peak-normalized absolute errors, error distribution in 32768 voxels. Fig. 11. Noisy synthetic ̃B+ 1 measurements. Magnitude (left) and transmit phase (right) are shown for the central axial cut of the Four-compartment phantom. The peak SNR was set to 50. 2) PIFON Training Settings: Since the B1 field in the z direction can not be assumed zero at 7 T, we used the simpli- fied PIFON-EPT. The B+ 1 Net was constructed using a Fourier feature mapping initialized with σ = 40 as a coordinate embedding of the input, followed by a fully-connected neural network with 3 layers, 128 units per layer. For EP Net, we used a second fully-connected neural network with 3 layers, 128 units per layer. We set all the activation functions as the Sine function. We set λ = 10−8 in equation (11). We trained B+ 1 Net and EP Net jointly using the Adam optimizer for 30k iterations in total, with a decaying schedule of learning rates 10−3, 10−4, 10−5 decreased every 10k iterations, which took 21.4 minutes on our GPU. Figs. 12 and 13 show the results for the central slice of the four-compartment phantom. Our method removed the noise from the noisy synthetic measurements (Fig. 11) and the reconstructed B+ 1 was qualitatively similar to the noise-free ground truth. The average PNAE over the volume was 2.47%, 4.01%, 0.24% for the relative permittivity, conductivity and B+ 1 , respectively. The average PNAE for the reconstructed EP and B+ 1 for different levels of noise in the synthetic measurements are summarized in TABLE I. The reconstructions were robust for a wide range of noise levels. TABLE I ROBUSTNESS ANALYSIS OF PIFON-EPT WITH RESPECT TO THE NOISE LEVEL Peak SNR 200 100 50 20 PNAE εr σ B+ 1 2.56% 2.64% 2.47% 2.56% 4.00% 4.10% 4.01% 3.96% 0.15% 0.17% 0.24% 0.49% 1 with simplified PIFON-EPT for Fig. 13. Reconstructed B+ the four- compartment phantom. From left to right, ground truth synthetic B+ 1 for the central axial cut of the phantom, including magnitude (top) and transmit 1 field from noise-corrupted synthetic ̃B+ phase (bottom), reconstructed B+ 1 measurements with peak SNR of 50, the peak-normalized absolute errors, the distribution of the error in 32768 voxels. D. Incomplete Four-Compartment Phantom In this final numerical experiment, we used the same four- compartment phantom as before, but we assumed the synthetic ̃B+ 1 measurements were incomplete, which could happen in reality if the measured signal is too low or corrupted for certain voxels to reconstruct B+ 1 . We tested whether PIFON- EPT could reconstruct the EP and a complete, denoised B+ 1 for the entire volume. 1) Data Acquisition: We randomly set to zero from 20% to 90% of the voxels in the synthetic ̃B+ 1 measurements with peak SNR of 50. As a result, only 10% to 80% of the measurements were used as input for simplified PIFON-EPT. Fig. 14 shows one of the resulting ̃B+ 1 measurements for the central axial cut, where 50% of the ̃B+ 1 values were set to zero. We used the same training settings as for the previous experiment. The total training time when we used 10%, 20%, 50%, and 80% of the measurements was 10, 11, 15, and 18 minutes, respectively. Figs. 15 and 16 show the ground truth EP and noise-free synthetic B+ the 1 reconstructed EP and the denoised completed B+ (second 1 column), the PNAE of the predicted EP and B+ 1 (third column) and their error distribution over the entire volume of the (first column), 8 Fig. 14. Incomplete noisy synthetic ̃B+ 1 measurements with 50% of the voxels set to zero. Magnitude (left) and transmit phase (right) are shown for the central axial cut of the Four-compartment phantom. The peak SNR was set to 50. Fig. 16. Reconstructed B+ 1 with simplified PIFON-EPT for the incomplete four-compartment phantom. From left to right, magnitude (top) and transmit phase (bottom) of the synthetic B+ 1 field for the central axial cut of the phantom, reconstructed B+ 1 with peak SNR of 50, peak-normalized absolute errors, error distribution in 32768 voxels. 1 field using 50% of ̃B+ V. DISCUSSION 1 Net and EP Net) to represent the B+ In this work, we reformulated EPT as a physics-constrained optimization problem with the goal to train two independent neural networks (B+ 1 and EP at any location of interest. To achieve that, we minimized a composite loss that aims to fit ̃B+ 1 measurements while penal- izing the PDE residual (see Fig. 1) via gradient descent with Adam optimizer [43]. Penalizing the PDE residual not only helps EP Net predict the EP distributions that best describe the measured data but also prevents B+ 1 Net from fitting the noise. Compared with standard EPT methods [14], [16] that rely on finite differences to approximate gradients of noisy ̃B+ 1 measurements, which is prone to noise amplifications and artifacts, PIFON-EPT uses automatic differentiation [33] to calculate all the necessary gradients from de-noised B+ 1 maps provided by B+ 1 Net. This way of computing derivatives makes our method robust to noise. Unlike previous supervised deep learning-based EPT methods [26]–[30], our approach does not require a large amount of known data pairs to supervise the training. Compared with previous hybrid deep learning EPT methods [31], [32], which combine deep learning and CR-EPT to solve EP from convection-reaction equations, our method directly trains a neural network (EP Net) to represent the EP based on measured data and the Helmholtz PDE without requiring any boundary conditions and hyperparameter tuning for the diffusion coefficient. A major concern for B+ 1 maps represented by neural net- works is that deep fully-connected networks could fail to learn high-frequency components of the target functions because of the spectral bias [54]–[57]. To overcome the spectral bias and ensure that B+ 1 Net would efficiently learn the high- frequency details of B+ 1 , we applied Fourier features mapping as an input embedding to the B+ 1 . In the concentric cylindrical phantom example, we also applied Fourier features mapping to EP Net because it could help the network avoid predicting homogeneous EP distributions. In simplified PIFON-EPT, we assume a homogeneous dis- tribution of EP. This assumption introduces errors near the interface between regions of different EP values and can deteriorate the quality of the reconstructions. When Bz is Fig. 15. Reconstructed EP with simplified PIFON-EPT for the incomplete four-compartment phantom. From left to right, ground truth EP for the central axial cut of the phantom, including relative permittivity (top) and conductivity (bottom), estimated EP using 50% of ̃B+ 1 with peak SNR of 50, the peak- normalized absolute errors, the distribution of the error in 32768 voxels. phantom (fourth column), respectively. The figures show the case where only 50% of the synthetic ̃B+ 1 measurements were used. We found that our method could accurately reconstruct the EP and B+ 1 for the whole domain, despite using partial measurements as the input. The average PNAE over the entire volume of the phantom was 2.49%, 4.09% and 0.32% for the relative permittivity, conductivity, and B+ 1 , respectively. TABLE II summarizes the average PNAE for the EP and B+ 1 when different percentages of the synthetic measurements are used. The error for the B+ 1 reconstruction increased when a smaller percentage of the data was used. However, PIFON- EPT yielded robust results until as little as 20% of the measurements was used as input. TABLE II PERFORMANCE OF PIFON-EPT WITH RESPECT TO THE PERCENTAGE OF MEASUREMENTS USED AS INPUT FOR THE RECONSTRUCTIONS PNAE % of the Data 80% 50% 20% 10% εr σ B+ 1 2.41% 2.49% 2.77% 7.22% 3.94% 4.09% 4.06% 7.58% 0.26% 0.32% 0.57% 2.69% negligible, the generalized PIFON-EPT can be used which allows the estimation of inhomogeneous EP distributions based on the generalized Helmholtz equation (6) which can greatly decrease the errors near the tissue boundaries (see IV-A). In fact, we showed that PIFON-EPT returned 48.6% and 8.08% more accurate results on average compared to H-EPT and CR-EPT (see IV-B). Furthermore, CR-EPT required tuning of the boundary condition value and the diffusion coefficient parameter until the reconstructed conductivity was close to the ground-truth value, which is not practical in experiments where the ground-truth values are unknown. To the best of our knowledge, PIFON-EPT is the only EPT method that can reconstruct EP and B+ 1 for an entire object, using incomplete and noisy B+ 1 measurements. We demonstrated this for an ultra-high field MRI example, us- ing complex-valued synthetic B+ 1 measurements. The same approach would be impractical in actual experiments because the absolute phase of the B+ is not measurable and the 1 TPA does not hold at 7 tesla. However, note that PIFON- EPT could be adapted to work with multiple transmit coils, which could provide enough degrees of freedom to enable EP reconstruction using the relative phase of B+ 1 between the coil channels [19], [46], which can be measured. This approach will be explored in future work. The current version of PIFON-EPT has a limitation when Bz can not be assumed equal to zero. In this case, boundary ar- tifacts appearing in the reconstructed EP cannot be eliminated. Previous work suggests that this limitation could be overcome by using multiple transmit-receive coils [46]. In this work, we used instead a birdcage coil, for which Bz can be assumed negligible if the main field strength is lower or equal to 3T. However, we found that our network's expressive power was not enough to reconstruct both the EP and the B+ 1 in such a case. To address this, we made our network deeper and used more complex architectures (for example, we included Fourier mapping also in the EP Net) to accurately represent the EP and B+ 1 , which ultimately increased the network's training time. This problem could be solved by designing compressed network architectures [58], [59] to replace the current fully- connected neural networks. VI. CONCLUSION We introduced PIFON-EPT, a new technique to estimate 1 distributions from noisy and/or incomplete ̃B+ EP and B+ 1 measurements. We demonstrated our new approach using a series of numerical examples, showing that PIFON-EPT is accurate and robust even when its input is corrupted with a significant amount of noise. Since PIFON-EPT can efficiently de-noise MR measurements, it has the potential to improve other MR-based EPT methods that use B+ 1 maps as the input. In future work, we will investigate the performance of the proposed algorithms with more realistic numerical phantoms and perform experimental validation. ACKNOWLEDGMENTS The authors are grateful to Alessandro Arduino for his valuable advice about the usage of EPTlib. 9 REFERENCES [1] C. M. Collins and Z. Wang, "Calculation of radiofrequency electro- magnetic fields and their effects in mri of human subjects," Magnetic resonance in medicine, vol. 65, no. 5, pp. 1470–1482, 2011. [2] J. Hand, "Modelling the interaction of electromagnetic fields (10 mhz– 10 ghz) with the human body: methods and applications," Physics in Medicine & Biology, vol. 53, no. 16, p. R243, 2008. [3] D. Holder, "Detection of cerebral ischaemia in the anaesthetised rat by impedance measurement with scalp electrodes: implications for non-invasive imaging of stroke by electrical impedance tomography," Clinical Physics and Physiological Measurement, vol. 13, no. 1, p. 63, 1992. [4] M. A. Fallert et al., "Myocardial electrical impedance mapping of ischemic sheep hearts and healing aneurysms." Circulation, vol. 87, no. 1, pp. 199–207, 1993. [5] K. K. Tha et al., "Noninvasive evaluation of electrical conductivity of the normal brain and brain tumors," in Proc. Int. Soc. Magn. Reson. Med, vol. 22, 2014, p. 1885. [6] K. K. Tha et al., "Noninvasive electrical conductivity measurement by mri: a test of its validity and the electrical conductivity characteristics of glioma," European radiology, vol. 28, no. 1, pp. 348–355, 2018. [7] E. Balidemaj et al., "Feasibility of electric property tomography of pelvic tumors at 3t," Magnetic resonance in medicine, vol. 73, no. 4, pp. 1505– 1513, 2015. [8] J. Shin et al., "Initial study on in vivo conductivity mapping of breast cancer using mri," Journal of Magnetic Resonance Imaging, vol. 42, no. 2, pp. 371–378, 2015. [9] C. Rossmann and D. Haemmerich, "Review of temperature dependence of thermal properties, dielectric properties, and perfusion of biological tissues at hyperthermic and ablation temperatures," Critical ReviewsTM in Biomedical Engineering, vol. 42, no. 6, 2014. [10] E. Balidemaj et al., "Hyperthermia treatment planning for cervical cancer patients based on electrical conductivity tissue properties acquired in vivo with ept at 3 t mri," International Journal of Hyperthermia, vol. 32, no. 5, pp. 558–568, 2016. [11] M. M. de Oliveira, P. Wen, and T. Ahfock, "Bio-heat transfer model of electroconvulsive therapy: Effect of biological properties on induced temperature variation," in 2016 38th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC). IEEE, 2016, pp. 3997–4000. [12] E. Haacke et al., "Extraction of conductivity and permittivity using magnetic resonance imaging," Physics in Medicine & Biology, vol. 36, no. 6, p. 723, 1991. [13] H. Wen, "Noninvasive quantitative mapping of conductivity and dielec- tric distributions using rf wave propagation effects in high-field mri," in Medical Imaging 2003: Physics of Medical Imaging, vol. 5030. SPIE, 2003, pp. 471–477. [14] U. Katscher et al., "Determination of electric conductivity and local sar via b1 mapping," IEEE transactions on medical imaging, vol. 28, no. 9, pp. 1365–1374, 2009. [15] T. Voigt, U. Katscher, and O. Doessel, "Quantitative conductivity and permittivity imaging of the human brain using electric properties tomog- raphy," Magnetic Resonance in Medicine, vol. 66, no. 2, pp. 456–466, 2011. [16] F. S. Hafalir et al., "Convection-reaction equation based magnetic res- onance electrical properties tomography (cr-mrept)," IEEE transactions on medical imaging, vol. 33, no. 3, pp. 777–793, 2014. [17] X. Zhang, S. Zhu, and B. He, "Imaging electric properties of biological tissues by rf field mapping in mri," IEEE transactions on medical imaging, vol. 29, no. 2, pp. 474–481, 2010. [18] D. K. Sodickson et al., "Local maxwell tomography using transmit- receive coil arrays for contact-free mapping of tissue electrical properties and determination of absolute rf phase," in Proceedings of the 20th Annual Meeting of ISMRM. ISMRM Concord California, USA, 2012, p. 388. [19] J. E. Serrallés et al., "Noninvasive estimation of electrical properties from magnetic resonance measurements via global maxwell tomography and match regularization," IEEE Transactions on Biomedical Engineer- ing, vol. 67, no. 1, pp. 3–15, 2019. [20] R. L. Leijsen et al., "3-d contrast source inversion-electrical properties tomography," IEEE transactions on medical imaging, vol. 37, no. 9, pp. 2080–2089, 2018. [21] J. Liu et al., "Gradient-based electrical properties tomography (g ept): A robust method for mapping electrical properties of biological tissues in vivo using magnetic resonance imaging," Magnetic resonance in medicine, vol. 74, no. 3, pp. 634–646, 2015. 10 [47] I. I. Giannakopoulos, M. S. Litsarev, and A. G. Polimeridis, "Memory footprint reduction for the FFT-based volume integral equation method via tensor decompositions," IEEE Transactions on Antennas and Prop- agation, vol. 67, no. 12, pp. 7476–7486, 2019. [48] I. I. Giannakopoulos et al., "A tensor train compression scheme for remote volume-surface integral equation interactions," in 2021 Inter- national Applied Computational Electromagnetics Society Symposium (ACES). IEEE, 2021, pp. 1–4. [49] I. I. Giannakopoulos et al., "A hybrid volume-surface integral equation method for rapid electromagnetic simulations in mri," IEEE Transactions on Biomedical Engineering, 2022. [50] I. P. Georgakis et al., "A fast volume integral equation solver with linear basis functions for the accurate computation of EM fields in MRI," IEEE Transactions on Antennas and Propagation, vol. 69, no. 7, pp. 4020– 4032, 2020. [51] W. J. Wiscombe, "Improved Mie scattering algorithms," Applied optics, vol. 19, no. 9, pp. 1505–1509, 1980. [52] C. F. Bohren and D. R. Huffman, Absorption and scattering of light by small particles. John Wiley & Sons, 2008. [53] I. P. Georgakis et al., "Novel Numerical Basis Sets for Electromagnetic Field Expansion in Arbitrary Inhomogeneous Objects," IEEE Transac- tions on Antennas and Propagation, vol. 70, no. 9, pp. 8227–8241, 2022. [54] B. Ronen et al., "The convergence rate of neural networks for learned functions of different frequencies," Advances in Neural Information Processing Systems, vol. 32, 2019. [55] Y. Cao et al., "Towards understanding the spectral bias of deep learning," arXiv preprint arXiv:1912.01198, 2019. [56] N. Rahaman et al., "On the spectral bias of neural networks," in PMLR, 2019, pp. International Conference on Machine Learning. 5301–5310. [57] S. Wang, H. Wang, and P. Perdikaris, "On the eigenvector bias of fourier feature networks: From regression to solving multi-scale pdes with physics-informed neural networks," Computer Methods in Applied Mechanics and Engineering, vol. 384, p. 113938, 2021. [58] A. Novikov et al., "Tensorizing neural networks," Advances in neural information processing systems, vol. 28, 2015. [59] Z. Liu, X. Yu, and Z. Zhang, "TT-PINN: A tensor-compressed neural PDE solver for edge computing," arXiv preprint arXiv:2207.01751, 2022. [22] N. Gurler and Y. Z. Ider, "Gradient-based electrical conductivity imaging using mr phase," Magnetic resonance in medicine, vol. 77, no. 1, pp. 137–150, 2017. [23] S. Mandija et al., "Error analysis of helmholtz-based mr-electrical properties tomography," Magnetic resonance in medicine, vol. 80, no. 1, pp. 90–100, 2018. [24] I. I. Giannakopoulos et al., "Global Maxwell Tomography using an 8- channel radiofrequency coil: simulation results for a tissue-mimicking phantom at 7T," in 2019 IEEE International Symposium on Antennas and Propagation and USNC-URSI Radio Science Meeting. IEEE, 2019, pp. 823–824. [25] I. I. Giannakopoulos et al., "Magnetic-resonance-based electrical prop- erty mapping using Global Maxwell Tomography with an 8-channel head coil at 7 Tesla: a simulation study," IEEE Transactions on Biomedical Engineering, vol. 68, no. 1, pp. 236–246, 2020. [26] S. Mandija et al., "Opening a new window on mr-based electrical properties tomography with deep learning," Scientific reports, vol. 9, no. 1, pp. 1–9, 2019. [27] N. Hampe et al., "Investigating the challenges and generalizability of deep learning brain conductivity mapping," Physics in Medicine & Biology, vol. 65, no. 13, p. 135001, 2020. [28] S. Gavazzi et al., "Deep learning-based reconstruction of in vivo pelvis conductivity with a 3d patch-based convolutional neural network trained on simulated mr data," Magnetic resonance in medicine, vol. 84, no. 5, pp. 2772–2787, 2020. [29] I. Giannakopoulos et al., "On the usage of deep neural networks as a tensor-to-tensor translation between mr measurements and electrical properties," Proc. ISMRM, 2020. [30] R. Leijsen et al., "Combining deep learning and 3d contrast source inver- sion in mr-based electrical properties tomography," NMR in Biomedicine, vol. 35, no. 4, p. e4211, 2022. [31] A. J. G. Inda et al., "Physics-coupled neural network magnetic resonance electrical property tomography (mrept) for conductivity reconstruction," IEEE Transactions on Image Processing, 2022. [32] A. J. G. Inda et al., "Physics informed neural networks (pinn) for low snr magnetic resonance electrical properties tomography (mrept)," Diagnostics, vol. 12, no. 11, p. 2627, 2022. [33] A. G. Baydin et al., "Automatic differentiation in machine learning: a survey," Journal of Marchine Learning Research, vol. 18, pp. 1–43, 2018. [34] X. Yu et al., "MR-Based Electrical Property Reconstruction Using Physics-Informed Neural Networks," arXiv preprint arXiv:2210.12584, 2022. [35] M. Raissi, P. Perdikaris, and 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, vol. 378, pp. 686–707, 2019. [36] G. E. Karniadakis et al., "Physics-informed machine learning," Nature Reviews Physics, vol. 3, no. 6, pp. 422–440, 2021. [37] M. Tancik et al., "Fourier features let networks learn high frequency functions in low dimensional domains," Advances in Neural Information Processing Systems, vol. 33, pp. 7537–7547, 2020. [38] A. Arduino, "Eptlib: An open-source extensible collection of electric properties tomography techniques," Applied Sciences, vol. 11, no. 7, p. 3237, 2021. [39] A. Savitzky and M. J. Golay, "Smoothing and differentiation of data by simplified least squares procedures." Analytical chemistry, vol. 36, no. 8, pp. 1627–1639, 1964. [40] C. E. Hayes et al., "An efficient, highly homogeneous radiofrequency coil for whole-body nmr imaging at 1.5 t," Journal of Magnetic Resonance (1969), vol. 63, no. 3, pp. 622–628, 1985. [41] C. Li, W. Yu, and S. Y. Huang, "An mr-based viscosity-type regular- ization method for electrical property tomography," Tomography, vol. 3, no. 1, pp. 50–59, 2017. [42] R. W. Brown et al., Magnetic resonance imaging: physical principles and sequence design. John Wiley & Sons, 2014. [43] D. P. Kingma and J. Ba, "Adam: A method for stochastic optimization," arXiv preprint arXiv:1412.6980, 2014. [44] S. Wang, X. Yu, and P. Perdikaris, "When and why pinns fail to train: A neural tangent kernel perspective," Journal of Computational Physics, vol. 449, p. 110768, 2022. [45] S. Wang, Y. Teng, and P. Perdikaris, "Understanding and mitigating gradient flow pathologies in physics-informed neural networks," SIAM Journal on Scientific Computing, vol. 43, no. 5, pp. A3055–A3081, 2021. [46] D. K. Sodickson et al., "Generalized local Maxwell tomography for mapping of electrical property gradients and tensors," in Proceedings of the 21st Annual Meeting of ISMRM. ISMRM, 2013, p. 4175.
http://arxiv.org/abs/2302.11874v1
2023-02-23T09:25:28
2023-02-23T09:25:28
What Can We Learn From The Selective Prediction And Uncertainty Estimation Performance Of 523 Imagenet Classifiers
When deployed for risk-sensitive tasks, deep neural networks must include an uncertainty estimation mechanism. Here we examine the relationship between deep architectures and their respective training regimes, with their corresponding selective prediction and uncertainty estimation performance. We consider some of the most popular estimation performance metrics previously proposed including AUROC, ECE, AURC as well as coverage for selective accuracy constraint. We present a novel and comprehensive study of selective prediction and the uncertainty estimation performance of 523 existing pretrained deep ImageNet classifiers that are available in popular repositories. We identify numerous and previously unknown factors that affect uncertainty estimation and examine the relationships between the different metrics. We find that distillation-based training regimes consistently yield better uncertainty estimations than other training schemes such as vanilla training, pretraining on a larger dataset and adversarial training. Moreover, we find a subset of ViT models that outperform any other models in terms of uncertainty estimation performance. For example, we discovered an unprecedented 99% top-1 selective accuracy on ImageNet at 47% coverage (and 95% top-1 accuracy at 80%) for a ViT model, whereas a competing EfficientNet-V2-XL cannot obtain these accuracy constraints at any level of coverage. Our companion paper, also published in ICLR 2023 (A framework for benchmarking class-out-of-distribution detection and its application to ImageNet), examines the performance of these classifiers in a class-out-of-distribution setting.
[ "Ido Galil", "Mohammed Dabbah", "Ran El-Yaniv" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11874v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11874v1", "@rel": "related", "@type": "application/pdf" } ]
[ "International Conference on Learning Representations (2023)" ]
{ "@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 4 7 8 1 1 . 2 0 3 2 : v i X r a WHAT CAN WE LEARN FROM THE SELECTIVE PREDICTION AND UNCERTAINTY ESTIMATION PERFORMANCE OF 523 IMAGENET CLASSIFIERS? Ido Galil Technion [email protected] Mohammed Dabbah Amazon [email protected] Ran El-Yaniv Technion, Deci.AI [email protected] ABSTRACT When deployed for risk-sensitive tasks, deep neural networks must include an uncertainty estimation mechanism. Here we examine the relationship between deep architectures and their respective training regimes, with their corresponding selective prediction and uncertainty estimation performance. We consider some of the most popular estimation performance metrics previously proposed including AUROC, ECE, AURC as well as coverage for selective accuracy constraint. We present a novel and comprehensive study of selective prediction and the uncertainty estimation performance of 523 existing pretrained deep ImageNet classifiers that are available in popular repositories. We identify numerous and previously unknown factors that affect uncertainty estimation and examine the relationships between the different metrics. We find that distillation-based training regimes consistently yield better uncertainty estimations than other training schemes such as vanilla training, pretraining on a larger dataset and adversarial training. Moreover, we find a subset of ViT models that outperform any other models in terms of uncertainty estimation performance. For example, we discovered an unprecedented 99% top-1 selective accuracy on ImageNet at 47% coverage (and 95% top-1 accuracy at 80%) for a ViT model, whereas a competing EfficientNet-V2-XL cannot obtain these accuracy constraints at any level of coverage. Our companion paper, also published in ICLR 2023 (Galil et al., 2023), examines the performance of these classifiers in a class-out-of-distribution setting. 1 Introduction The excellent performance of deep neural networks (DNNs) has been demonstrated in a range of applications, including computer vision, natural language understanding and audio processing. To deploy these models successfully, it is imperative that they provide an uncertainty quantification of their predictions, either via some kind of selective prediction or a probabilistic confidence score. Notwithstanding, what metric should we use to evaluate the uncertainty estimation performance? There are many and diverse ways so the answer to this question is not obvious, and to demonstrate the difficulty, consider the case of two classification models for the stock market that predict whether a stock's value is about to increase, decrease, or remain neutral (three-class classification). Suppose that model A has a 95% true accuracy, and generates a confidence score of 0.95 on every prediction (even on misclassified instances); model B has a 40% true accuracy, but always gives a confidence score of 0.6 on correct predictions, and 0.4 on incorrect ones. Model B can be utilized easily to generate perfect investment decisions. Using selective prediction (El-Yaniv & Wiener, 2010; Geifman & El-Yaniv, 2017), Model B will simply reject all investments on stocks whenever the confidence score is 0.4. While model A offers many more investment opportunities, each of its predictions carries a 5% risk of failure. Figure 1: A comparison of 523 models by their AUROC (×100, higher is better) and -log(ECE) (higher is better) on ImageNet. Each marker's size is determined by the model's number of parameters. A full version graph is given in Figure 8. Distilled models are better than non-distilled ones. A subset of ViT models is superior to all other models for all aspects of uncertainty estimation ("ViT" in the legend, marked as a red triangle facing upwards); the performance of EfficientNet-V2 and GENet models is worse. Among the various metrics proposed for evaluating the performance of uncertainty estimation are: Area Under the Receiver Operating Characteristic (AUROC or AUC), Area Under the Risk-Coverage curve (AURC) (Geifman et al., 2018), selective risk or coverage for a selective accuracy constraint (SAC), Negative Log-likelihood (NLL), Expected Calibration Error (ECE), which is often used for evaluating a model's calibration (see Section 2) and Brier score (Brier, 1950). All these metrics are well known and are often used for comparing the uncertainty estimation performance of models (Moon et al., 2020; Nado et al., 2021; Maddox et al., 2019; Lakshminarayanan et al., 2017). Somewhat surprisingly, NLL, Brier, AURC, and ECE all fail to reveal the uncertainty superiority of Model B in our investment example (see Appendix A for the calculations). Both AUROC and SAC, on the other hand, reveal the advantage of Model B perfectly (see Appendix A for details). It is not hard to construct counterexamples where these two metrics fails and others (e.g., ECE) succeed. To sum up this brief discussion, we believe that the ultimate suitability of a performance metric should be determined by its context. If there is no specific application in mind, there is a strong incentive to examine a variety of metrics, as we choose to do in this study. This study evaluates the ability of 523 models from the Torchvision and Timm repositories (Paszke et al., 2019; Wightman, 2019) to estimate uncertainty1. Our study identifies several major factors that affect confidence rankings, calibration, and selective prediction, and lead to numerous empirical contributions important to selective predictions and uncertainty estimation. While no new algorithm or method is introduced in our paper, our study generates many interesting conclusions that will help practitioners achieve more powerful uncertainty estimation. Moreover, the research questions that are uncovered by our empirical study shed light on uncertainty estimation, which may stimulate the development of new methods and techniques for improving uncertainty estimation. Among the most interesting conclusions our study elicits are: (1) Knowledge distillation training improves estimation. Training regimes incorporating any kind of knowledge distillation (KD) (Hinton et al., 2015) lead to DNNs with improved uncertainty estimation performance evaluated by any metric, more than by using any other training tricks (such 1Our code is available at https://github.com/IdoGalil/benchmarking-uncertainty-estimation-performance 2 23467788082848688ModelsVariousAlexNetBiTBiT distilledEfficientNetV2GENetMLP MixerMLP Mixer distilledRegNetYResMLPResMLP distilledResNetViTViT*ViT* distilledXCiTXCiT distilled5 ModelsResMLPResMLP distilled ResNetViTViT*ViT* distilledXCiTXCiT distilledVariousAlexNetBiTBiT distilled EfficientNetV2 GENet Mixer Mixer distilledMLPMLPRegNetY-log(ECE)AUROC as pretraining on a larger dataset, adversarial training, etc.). In Galil et al. (2023) we find similar performance boosts for class-out-of-distribution (C-OOD) detection. (2) Certain architectures are more inclined to perform better or worse at uncertainty estima- tion. Some architectures seem more inclined to perform well on all aspects of uncertainty estimation, e.g., a subset of vision transformers (ViTs) (Dosovitskiy et al., 2021) and the zero-shot language– vision CLIP model (Radford et al., 2021), while other architectures tend to perform worse, e.g., EfficientNet-V2 and GENet (Tan & Le, 2021; Lin et al., 2020). These results are visualized in Figure 1. In Galil et al. (2023) we find that ViTs and CLIPs are also powerful C-OOD detectors. (3) Several training regimes result in a subset of ViTs that outperforms all other architectures and training regimes. These regimes include the original one from the paper introducing ViTs (Dosovitskiy et al., 2021; Steiner et al., 2022; Chen et al., 2022; Ridnik et al., 2021). These ViTs achieve the best uncertainty estimation performance on any aspect measured, both in absolute terms and per-model size (# parameters, see Figures 9 and 10 in Appendix B). (4) Temperature scaling improves selective and ranking performance. The simple post-training calibration method of temperature scaling (Guo et al., 2017), which is known to improve ECE, for the most part also improves ranking (AUROC) and selective prediction-meaning not only does it calibrate the probabilistic estimation for each individual instance, but it also improves the partial order of all instances induced by those improved estimations, pushing instances more likely to be correct to have a higher confidence score than instances less likely to be correct (see Section 3). (5) The correlations between AUROC, ECE, accuracy and the number of parameters are de- pendent on the architecture analyzed. Contrary to previous work by (Guo et al., 2017), we observe that while there is a strong correlation between accuracy/number of parameters and ECE or AUROC within each specific family of models of the same architecture, the correlation flips between a strong negative and a strong positive correlation depending on the type of architecture being observed. For example, as DLA (Yu et al., 2018) architectures increase in size and accuracy, their ECE deteriorates while their AUROC improves. The exact opposite, however, can be observed in XCiTs (Ali et al., 2021) as their ECE improves with size while their AUROC deteriorates (see Appendix L). (6) The best model in terms of AUROC or SAC is not always the best in terms of calibration, as illustrated in Figure 1, and the trade-off should be considered when choosing a model based on its application. 2 How to evaluate deep uncertainty estimation performance Let X be the input space and Y be the label space. Let P (X , Y) be an unknown distribution over X × Y. A model f is a prediction function f : X → Y, and its predicted label for an image x is denoted by ˆyf (x). The model's true risk w.r.t. P is R(f |P ) = EP (X ,Y)[(cid:96)(f (x), y)], where (cid:96) : Y × Y → R+ is a given loss function, for example, 0/1 loss for classification. Given a labeled set Sm = {(xi, yi)}m i=1 ⊆ (X × Y), sampled i.i.d. from P (X , Y), the empirical risk of model f is ˆr(f |Sm) (cid:44) 1 i=1 (cid:96)(f (xi), yi). Following Geifman et al. (2018), for a given model f we define m a confidence score function κ(x, ˆy|f ), where x ∈ X , and ˆy ∈ Y is the model's prediction for x, as follows. The function κ should quantify confidence in the prediction of ˆy for the input x, based on signals from model f . This function should induce a partial order over instances in X . (cid:80)m The most common and well-known κ function for a classification model f (with softmax at its last layer) is its softmax response values: κ(x, ˆy|f ) (cid:44) f (x)ˆy (Cordella et al., 1995; De Stefano et al., 2000). We chose to focus on studying uncertainty estimation performance using softmax response as the models' κ function because of its extreme popularity, and its importance as a baseline due to its solid performance compared to other methods (Geifman & El-Yaniv, 2017; Geifman et al., 2018). While this is the main κ we evaluate, we also test the popular uncertainty estimation technique of Monte Carlo dropout (MC dropout) (Gal & Ghahramani, 2016), which is motivated by Bayesian reasoning. Although these methods use the direct output from f , κ could be a different model unrelated to f and unable to affect f 's predictions. Note that to enable a probabilistic interpretation, κ can only be calibrated if its values reside in [0, 1] whereas for ranking and selective prediction any value in R can be used. 3 A selective model f (El-Yaniv & Wiener, 2010; Chow, 1957) uses a selection function g : X → {0, 1} to serve as a binary selector for f , enabling it to abstain from giving predictions for certain inputs. g can be defined by a threshold θ on the values of a κ function such that gθ(x|κ, f ) = 1[κ(x, ˆyf (x)|f ) > θ]. The performance of a selective model is measured using coverage and risk, where coverage, defined as φ(f, g) = EP [g(x)], is the probability mass of the non-rejected instances in X . The selective risk of the selective model (f, g) is defined as R(f, g) (cid:44) EP [(cid:96)(f (x),y)g(x)] . These quantities can be evaluated empirically over a finite labeled set Sm, with the empirical coverage defined as ˆφ(f, g|Sm) = 1 i=1 g(xi), and the empirical selective risk defined as ˆr(f, g|Sm) (cid:44) m i=1 (cid:96)(f (xi),yi)g(xi) . Similarly, SAC is defined as the largest coverage available for a specific accuracy constraint. A way to visually inspect the behavior of a κ function for selective prediction ˆφ(f,g|Sm) (cid:80)m φ(f,g) (cid:80)m 1 m Figure 2: The RC curve made by a ResNet18 trained on CIFAR-10, measured on the test set. The risk is calculated using a 0/1 loss (meaning the model has about 95% accuracy for 1.0 coverage); the κ used was softmax-response. The value of the risk at each point of coverage corresponds to the selective risk of the model when rejecting inputs that are not covered at that coverage slice. e.g., the selective risk for coverage 0.8 is about 0.5%, meaning that an end user setting a matching threshold would enjoy a model accuracy of 99.5% on the 80% of images the model would not reject. can be done using the risk-coverage (RC) curve (El-Yaniv & Wiener, 2010)-a curve showing the selective risk as a function of coverage, measured on some chosen test set; see Figure 2 for an example. In general, though, two RC curves are not necessarily comparable if one does not fully dominate the other (Figure 3 shows an example of lack of dominance). The AURC and E-AURC metrics were defined by (Geifman et al., 2018) for quantifying the selective quality of κ functions via a single number, with AURC being defined as the area under the RC curve. AURC, however, is very sensitive to the model's accuracy, and in an attempt to mitigate this, E-AURC was suggested. The latter also suffers from sensitivity to accuracy, as we demonstrate in Appendix C. The advantage of scalar metrics such as the above is that they summarize the model's overall uncertainty estimation behavior by reducing it to a single scalar. When not carefully chosen, however, these reductions could result in a loss of vital information about the problem (recall the investment example from Section 1, which is also discussed in Appendix A: reducing an RC curve to an AURC does not show that Model B has an optimal 0 risk if the coverage is smaller than 0.4). Thus, the choice of the "correct" single scalar performance metric unfortunately must be task-specific. When comparing the uncertainty estimation performance of deep architectures that exhibit different accuracies, we find that AUROC and SAC can effectively "normalize" accuracy differences that plague the usefulness of other metrics (see Figure 3). This normalization is essential in our study where we compare uncertainty performance of hundreds of models that can greatly differ in their accuracies. For risk-sensitive deployment, let us consider the two models in Figure 3 ; EfficientNet-V2-XL (Tan & Le, 2021) and ViT-B/32-SAM (Chen et al., 2022). While the former model has better overall accuracy and AURC (metrics that could lead us to believe the model is best for our needs), it cannot guarantee a Top-1 ImageNet selective accuracy above 95% for any coverage. ViT-B/32-SAM, on the other hand, can provide accuracies above 95% for all coverages below 50%. 4 Figure 3: A comparison of RC curves made by the best (ViT-L/16-384) and worst (EfficientNet- V2-XL) models we evaluated in terms of AUROC. Comparing ViT-B/32-SAM to EfficientNet-V2 exemplifies the fact that neither accuracy nor AURC reflect selective performance well enough. In applications where risk (or coverage) constraints are dictated (Geifman & El-Yaniv, 2017), the most straightforward and natural metric is SAC (or selective risk), which directly measures the coverage (resp., risk) given at the required level of risk (resp., coverage) constraint. We demonstrate this in Appendix I, evaluating which models give the most coverage for an ambitious SAC of 99%. If instead a specific range of coverages is specified, we could measure the area under the RC curve for those coverages: AURCC(κ, f |Sm) = 1 |C| ˆr(f, gc|Sm), with C being those required coverages. (cid:80) c∈C Often, these requirements are not known or can change as a result of changing circumstances or individual needs. Also, using metrics sensitive to accuracy such as AURC makes designing architectures and methods to improve κ very hard, since an improvement in these metrics could be attributed to either an increase in overall accuracy (if such occurred) or to a real improvement in the model's ranking performance. Lastly, some tasks might not allow the model to abstain from making predictions at all, but instead require interpretable and well-calibrated probabilities of correctness, which could be measured using ECE. 2.1 Measuring ranking and calibration A κ function is not necessarily able to change the model's predictions. Therefore, it can improve the selective risk by ranking correct and incorrect predictions better, inducing a more accurate partial order over instances in X . Thus, for every two random samples (x1, y1), (x2, y2) ∼ P (X , Y) and given that (cid:96)(f (x1), y1) > (cid:96)(f (x2), y2), the ranking performance of κ is defined as the probability that κ ranks x2 higher than x1: Pr[κ(x1, ˆy|f ) < κ(x2, ˆy|f )|(cid:96)(f (x1), y1) > (cid:96)(f (x2), y2)] (1) We discuss this definition in greater detail in Appendix D. The AUROC metric is often used in the field of machine learning. When the 0/1 loss is in play, it is known that AUROC in fact equals the probability in Equation (1) (Fawcett, 2006) and thus is a proper metric to measure ranking in classification (AKA discrimination). AUROC is furthermore equivalent to Goodman and Kruskal's γ-correlation (Goodman & Kruskal, 1954), which for decades has been extensively used to measure ranking (known as "resolution") in the field of metacognition (Nelson, 1984). The precise relationship between γ-correlation and AUROC is γ = 2 * AUROC − 1 (Higham & Higham, 2018). We note also that both the γ-correlation and AUROC are nearly identical or closely related to various other correlations and metrics; γ-correlation (AUROC) becomes identical to Kendall's τ (up to a linear 5 䄀唀刀伀䌀㴀㜀㜀⸀㜀㜀䄀唀刀䌀㴀㘀㠀⸀㐀㔀䄀唀刀伀䌀㴀㠀㜀⸀㔀(ᄀ)䄀唀刀䌀㴀㜀㘀⸀㄀㠀吀漀瀀ⴀ㄀ 䤀洀愀最攀一攀琀 䔀爀爀漀爀 ⠀刀椀猀欀⤀䌀漀瘀攀爀愀最攀刀椀猀欀ⴀ䌀漀瘀攀爀愀最攀 䌀甀爀瘀攀 䌀漀洀瀀愀爀椀猀漀渀䄀挀挀甀爀愀挀礀 㴀 ⸀㜀㐀䔀爀爀漀爀 刀愀琀攀 㴀 ⸀(ᄀ)㘀䄀挀挀甀爀愀挀礀 㴀 ⸀㠀㘀䔀爀爀漀爀 刀愀琀攀㴀 ⸀㄀㐀䄀挀挀甀爀愀挀礀 㴀 ⸀㠀㜀䔀爀爀漀爀 刀愀琀攀㴀 ⸀㄀アパート䄀唀刀伀䌀㴀㠀㠀⸀㐀㤀䄀唀刀䌀㴀(ᄀ)㘀⸀㐀㠀䈀椀最最攀爀 䄀唀刀伀䌀 ⠀砀㄀ ⤀ 椀猀 戀攀琀琀攀爀匀洀愀氀氀攀爀 䄀唀刀䌀 ⠀砀㄀ ⤀ 椀猀 戀攀琀琀攀爀 transformation) in the absence of tied values. Both metrics are also closely related to rank-biserial correlation, the Gini coefficient (not to be confused with the measure from economics) and the Mann–Whitney U test, hinting at their importance and usefulness in a variety of fields and settings. In Appendix E, we briefly compare the ranking performance of deep neural networks and humans in metacognitive research, and in Appendix F we address criticism of using AUROC to measure ranking. The most widely used metric for calibration is ECE (Naeini et al., 2015). For a finite test set of size N , ECE is calculated by grouping all instances into m interval bins (such that m (cid:28) N ), each of size m (the confidence interval of bin Bj is ( j−1 1 m ]). With acc(Bj) being the mean accuracy in bin Bj and conf(Bj) being its mean confidence, ECE is defined as m , j ECE = m (cid:88) j=1 |Bj| N (cid:88) i∈Bj (cid:12) (cid:12) (cid:12) (cid:12) 1[ˆyf (xi) = yi] |Bj| − κ(x, ˆyf (xi)|f ) |Bj| (cid:12) (cid:12) (cid:12) (cid:12) = m (cid:88) j=1 |Bj| N |acc(Bj) − conf(Bj)| Since ECE is widely accepted we use it here to evaluate calibration, and follow (Guo et al., 2017) in setting the number of bins to m = 15. Many alternatives to ECE exist, allowing an adaptive binning scheme, evaluating the calibration on the non-chosen labels as well, and other various methods (Nixon et al., 2019; Vaicenavicius et al., 2019; Zhao et al., 2020). Relevant to our objective is that by using binning, this metric is not affected by the overall accuracy as is the Brier score (mentioned in Section 1), for example. 3 Performance Analysis In this section we study the performance of 523 different models (available in timm 0.4.12 and torchvision 0.10). Note that all figures from our analysis are available as interactive plotly plots in the supplementary material, which provides information about every data point. 1) Among the training regimes evaluated, knowledge distillation improves performance the most. We evaluated several training regimes: (a) Training that involves KD in any form, including Touvron et al. (2021b), knapsack pruning with distillation (in which the teacher is the original unpruned model) (Aflalo et al., 2020) and a pretraining technique that employs distillation (Ridnik et al., 2021); (b) adversarial training (Xie et al., 2020a; Tram`er et al., 2018); (c) pretraining on ImageNet21k ("pure", with no additions) (Tan & Le, 2021; Touvron et al., 2021a, 2022); and (d) various forms of weakly or semi-supervised learning (Mahajan et al., 2018; Yalniz et al., 2019; Xie et al., 2020b). To make a fair comparison, we only compare pairs of models such that both models have identical architectures and training regimes, with the exception of the method itself being evaluated (e.g., training with or without knowledge distillation). More information about each data point of comparison is available in the supplementary material. Note that the samples are of various sizes due to the different number of potential models available for each. Of the methods mentioned above, training methods incorporating distillation improve AUROC and ECE the most. For example, looking at Figure 4a, it is evident that distillation (purple box) almost always improves AUROC, and moreover, its median improvement is the best of all techniques evaluated. The same observation can be made with regards to improving ECE; see Figure 4b. Distillation seems to greatly improve both metrics even when the teacher itself is much worse at both metrics. Figure 5 nicely shows this by comparing the teacher architecture and the students in each case. Additionally, in a pruning scenario that included distillation in which the original model was also the teacher (Aflalo et al., 2020), the pruned models outperformed their teachers. The fact that KD improves the model over its original form is surprising, and suggests that the distillation process itself helps uncertainty estimation. In Galil et al. (2023) we find that KD also improves C-OOD detection performance, measured by AUROC. We discuss these effects in greater detail in Appendix G. 2) Temperature scaling greatly benefits AUROC and selective prediction. Evaluations of the simple post-training calibration method of temperature scaling (TS) (Guo et al., 2017), which is widely known to improve ECE without changing the model's accuracy, also revealed several interesting facts: (a) TS consistently and greatly improves AUROC and selective performance (see 6 (a) (b) Figure 4: A comparison of different methods and their improvement in terms of (a) AUROC and (b) ECE, relative to the same model's performance without employing the method. Markers above the x-axis represent models that benefited from the evaluated method, and vice versa. The numbers in the legend to the right of each method indicate the number of pairs compared. Temperature scaling can sometimes harm ECE, even though its purpose is to improve it. Figure 4a)-meaning not only does TS calibrate the probabilistic estimation for each individual instance, but it also improves the partial order of all instances induced by those improved estimations. While TS is well known and used for calibration, to the best of our knowledge, its benefits for selective prediction were previously unknown. (b) While TS is usually beneficial, it could harm some models (see Figures 4a and 4b). While it is surprising that TS-a calibration method-would harm ECE, this phenomenon is explained by the fact that TS optimizes NLL and not ECE (to avoid trivial solutions), and the two may sometimes misalign. (c) Models that benefit from TS in terms of AUROC tend to have been assigned a temperature smaller than 1 by the calibration process (see Figure 6). This, however, does not hold true for ECE (see Figure 14 in Appendix H). This example also emphasizes the fact that improvements in terms of AUROC do not necessarily translate into improvements in ECE, and vice versa. (d) While all models usually improve with TS, the overall ranking of uncertainty performance between families tends to stay similar, with the worse (in terms of ECE and AUROC) models closing most of the gap between them and the mediocre ones (see Figure 13 in Appendix H). . 3) A subset of ViTs outperforms all other architectures in selective prediction, ranking and calibration, both in absolute terms and per-model size. Several training regimes (including the original regime from the paper introducing ViT) Dosovitskiy et al. (2021); Steiner et al. (2022); Chen et al. (2022); Ridnik et al. (2021) result in ViTs that outperform all other architectures and training regimes in terms of AUROC and ECE (see Figure 1; Figure 13 in Appendix H shows this is true even after using TS) as well as for the SAC of 99% we explored (see Figure 7 and Appendix I). These ViTs also outperform all other models in terms of C-OOD detection performance (Galil et al., 7 −3−2−10123Method4 Adversarial Training (10)Pretraining on ImageNet21k (12) Semi-Supervised Learning (17)Distillation (36) Temperature Scaling (523)MC-Dropout (22)AUROC Improvement over Vanilla−0.0500.050.10.150.2ECE Improvement over VanillaTemperature Scaling can sometimes harm ECEMethodAdversarial Training (10)Pretraining on ImageNet21k (12) Semi-Supervised Learning (17)Distillation (36) Temperature Scaling (523) Figure 5: Comparing teacher models (yellow markers) to their KD students (represented by markers with thick borders and a dot). The performance of each model is measured in AUROC (higher is better) and -log(ECE) (higher is better). Figure 6: Out of 523 models evaluated, models that were assigned a temperature higher than 1 by the calibration process tended to degrade in AUROC performance rather than improve. Markers above the x-axis represent models that benefited from TS, and vice versa. 2023). Moreover, for any size, ViT models outperform their competition in all of these metrics (see Figures 9 and 10 in Appendix B and Figure 15 in Appendix I). Further research into other training regimes, however, reveals that not all training regimes result in superb performance (Touvron et al., 2021b, 2022; Singh et al., 2022; Paszke et al., 2019) (these ViTs are dubbed "ViT∗" in the figures), even when a similar amount of data is introduced into the training and strong augmentations are used. In fact, the models trained by Chen et al. (2022) were not pretrained at all and yet reach superb ranking. Even the largest model introduced by Tran et al. (2022), which is a large modified ViT that was pretrained on JFT-4B (a dataset containing 4 billion images) with the aim of excelling in uncertainty estimation (and other areas), is outperformed by the best ViT we evaluated: Plex L achieves an AUROC of 87.7 (while its smaller versions, Plex M and Plex S, achieve an AUROC of 87.4 and 86.7, respectively), compared to 88.5 achieved by ViT-L/16-384 that has less parameters and was pretrained on ImageNet-21k. In total, 18 ViTs trained on ImageNet-21k outperform2 Plex L, among which are two variations of small ViTs (each with 36 or 22 million parameters). In Appendix J we analyze the different hyperparameters and augmentations used for 2The authors had not released clear results for Plex ECE performance on ImageNet, making a comparison of calibration difficult. The authors mentioned that the average ECE of Plex L in CIFAR-10, CIFAR-100 and 8 2.533.544.555.566.578384858687-log(ECE)AUROCModelsBiTBiT distilledDeiT distilled ECANetECANet distilled EfficientNet EfficientNet distilled PiT distilled RegNetY-16GF ResMLP distilled XCiT distilledTemperature Scaling (Temp. < 1)Temperature Scaling (Temp. > 1)−2−1012345AUROC Improvement over Vanilla6 Temperature Scaling (Temp. < 1) Temperature Scaling (Temp. > 1) Method Figure 7: Comparison of models by their overall accuracy and the coverage they are able to provide given a selective accuracy constraint of Top-1 99% on ImageNet. A higher coverage is better. Only ViT models are able to provide coverage beyond 30% for this constraint. They provide more coverage than any other model compared to their accuracy or size. "Various" refers to all other models (out of the 523) that were not mentioned by name. training the ViT models evaluated in this paper. Unfortunately, no clear conclusions emerge to explain the advantage of the successful training regimes. There is, however, ample evidence to show that advanced augmentations are unlikely to be part of such an explanation. The above facts suggest that the excellent performance exhibited by some ViTs cannot be attributed to the amount of data or to the augmentations used during training. These observations warrant additional research with the hope of either training more robust ViTs or transferring the unidentified ingredient of the successful subset of ViTs into other models. 4) Correlations between AUROC, ECE, accuracy and the model's size could either be positive or negative, and depend on the family of architectures evaluated. This observation contradicts previous smaller scale studies on calibration. While AUROC and ECE are (negatively) correlated (they have a Spearman correlation of -0.44, meaning that generally, as AUROC improves, so does ECE), their agreement on the best performing model depends greatly on the architectural family in question. For example, the Spearman correlation between the two metrics evaluated on 28 undistilled XCiTs is 0.76 (meaning ECE deteriorates as AUROC improves), while for the 33 ResNets (He et al., 2016) evaluated, the correlation is -0.74. Another general observation is that contrary to previous work by (Guo et al., 2017) concerning ECE, the correlations between ECE and the accuracy or the number of model parameters are nearly zero, although each family tends to have a strong correlation, either negative or positive. We include a family-based comparison in Appendix L for correlations between AUROC/ECE and accuracy, number of parameters and input size. These results suggest that while some architectures might utilize extra resources to achieve improved uncertainty estimation capabilities, other architectures do not and are even harmed in this respect. 5) The zero-shot language–vision CLIP model is well-calibrated, with its best instance outper- forming 96% of all other models. CLIP (Radford et al., 2021) enables zero-shot classification and demonstrates impressive performance. We find it is also inclined to be well-calibrated. See Appendix K for details about how we use CLIP. The most calibrated CLIP is based on ViT-B/32 with a linear-probe added to it, and obtains an ECE of 1.3%, which outperforms 96% of models evaluated. Moreover, for their size category, CLIP models tend to outperform their competition in calibration, with the exception of ViTs (see Figure 10 in Appendix B). While this trend is clear for zero-shot CLIPs, we note that some models' calibration performance deteriorates with the addition ImageNet is slightly below 0.01. Our evaluations revealed six ViTs that achieved the same results, with the most calibrated model being ViT-T/16 with an ECE of 0.0054 on ImageNet. 9 01020304050606570758085ModelsVariousAlexNetBiTDLARegNetXRegNetYResNetSWSL ResNeXtViTViT*Coverage for Accuracy 99AccuracyModelsVarious AlexNet BiT DLARegNetXRegNetY ResNet SWSL ResNeXt ViT ViT* of a linear-probe. Further research is required to understand the ingredients of multimodal models' contribution to calibration, and to find ways to utilize them to get better calibrated models. For example, could a multimodal pretraining regime be used to get better calibrated models? 6) MC dropout does not improve selective performance, in accordance with previous works. We evaluate the performance of MC dropout using predictive entropy as its confidence score and 30 dropout-enabled forward passes. We do not measure its effects on ECE since entropy scores do not reside in [0, 1]. Using MC dropout causes a consistent drop in both AUROC and selective performance compared with using the same models with softmax as the κ (see Appendix M and Figure 4a). MC dropout's underperformance was also previously observed in (Geifman & El-Yaniv, 2017). We note, however, that evaluations we have conducted in Galil et al. (2023) show that MC dropout performs well when dealing with C-OOD data. 4 Concluding Remarks We presented a comprehensive study of the effectiveness of numerous DNN architectures (families) in providing reliable uncertainty estimation, including the impact of various techniques on improv- ing such capabilities. Our study led to many new insights and perhaps the most important ones are: (1) architectures trained with distillation almost always improve their uncertainty estimation performance, (2) temperature scaling is very useful not only for calibration but also for ranking and selective prediction, and (3) no DNN (evaluated in this study) demonstrated an uncertainty estimation performance comparable-in any metric tested-to a subset of ViT models (see Section 3). Our work leaves open many interesting avenues for future research and we would like to mention a few. Perhaps the most interesting question is why distillation is so beneficial in boosting uncertainty estimation. Next, is there an architectural secret in vision transformers (ViT) that enables their uncertainty estimation supremacy under certain training regimes? This issue is especially puzzling given the fact that comparable performance is not observed in many other supposedly similar transformer-based models that we tested. If the secret is not in the architecture, what is the mysterious ingredient of the subset of training regimes that produces such superb results, and how can it be used to train other models? Finally, can we create specialized training regimes (e.g., Geifman & El-Yaniv (2019)), specialized augmentations, special pretraining regimes (such as CLIP's multimodal training regime) or even specialized neural architecture search (NAS) strategies that can promote superior uncertainty estimation performance? Acknowledgments This research was partially supported by the Israel Science Foundation, grant No. 710/18. We thank Prof. Rakefet Ackerman for her help with understanding how uncertainty estimation performance is evaluated for humans in the field of metacognition, and for her useful comments for Appendix E. References Rakefet Ackerman, Avi Parush, Fareda Nassar, and Avraham Shtub. Metacognition and system usability: Incorporating metacognitive research paradigm into usability testing. Computers in Human Behavior, 54:101–113, January 2016. doi: 10.1016/j.chb.2015.07.041. URL https: //doi.org/10.1016/j.chb.2015.07.041. Rakefet Ackerman, Avigdor Gal, Tomer Sagi, and Roee Shraga. A cognitive model of human In PRICAI 2019: Trends in Artificial Intelligence, pp. 632–646. Springer bias in matching. International Publishing, 2019. doi: 10.1007/978-3-030-29908-8 50. URL https://doi.org/10. 1007/978-3-030-29908-8 50. Yonathan Aflalo, Asaf Noy, Ming Lin, Itamar Friedman, and Lihi Zelnik-Manor. Knapsack pruning with inner distillation. CoRR, abs/2002.08258, 2020. URL https://arxiv.org/abs/2002.08258. Alaaeldin Ali, Hugo Touvron, Mathilde Caron, Piotr Bojanowski, Matthijs Douze, Armand Joulin, Ivan Laptev, Natalia Neverova, Gabriel Synnaeve, Jakob Verbeek, and Herv ́e J ́egou. Xcit: Cross- covariance image transformers. In Marc'Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, 10 Percy Liang, and Jennifer Wortman Vaughan (eds.), Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 20014–20027, 2021. URL https://proceedings.neurips.cc/paper/ 2021/hash/a655fbe4b8d7439994aa37ddad80de56-Abstract.html. Alexandra Basile, Maggie E. Toplak, and Brendan F. Andrade. Using metacognitive methods to examine emotion recognition in children with ADHD. Journal of Attention Disorders, 25(2): 245–257, November 2018. doi: 10.1177/1087054718808602. URL https://doi.org/10.1177/ 1087054718808602. Glenn W. Brier. Verification of Forecasts Expressed in Terms of Probability. Monthly Weather Review, 78(1):1, January 1950. doi: 10.1175/1520-0493(1950)0780001:VOFEIT2.0.CO;2. Xiangning Chen, Cho-Jui Hsieh, and Boqing Gong. When vision transformers outperform resnets without pre-training or strong data augmentations. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net, 2022. URL https://openreview.net/forum?id=LtKcMgGOeLt. C. K. Chow. An optimum character recognition system using decision functions. IRE Transactions on Electronic Computers, EC-6(4):247–254, 1957. doi: 10.1109/TEC.1957.5222035. L. P. Cordella, C. De Stefano, F. Tortorella, and M. Vento. A method for improving classification reliability of multilayer perceptrons. IEEE Transactions on Neural Networks, 6(5):1140–1147, 1995. doi: 10.1109/72.410358. C. De Stefano, C. Sansone, and M. Vento. To reject or not to reject: that is the question-an answer IEEE Transactions on Systems, Man, and Cybernetics, Part C in case of neural classifiers. (Applications and Reviews), 30(1):84–94, 2000. doi: 10.1109/5326.827457. Yukun Ding, Jinglan Liu, Jinjun Xiong, and Yiyu Shi. Evaluation of neural network uncertainty estimation with application to resource-constrained platforms. CoRR, abs/1903.02050, 2019. URL http://arxiv.org/abs/1903.02050. 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. An image is worth 16x16 words: Transformers for image recognition at scale. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=YicbFdNTTy. Ran El-Yaniv and Yair Wiener. On the foundations of noise-free selective classification. Journal of Machine Learning Research, 11(5), 2010. Tom Fawcett. An introduction to roc analysis. Pattern Recognition Letters, 27(8):861–874, 2006. ISSN 0167-8655. doi: https://doi.org/10.1016/j.patrec.2005.10.010. URL https://www. sciencedirect.com/science/article/pii/S016786550500303X. ROC Analysis in Pattern Recognition. K. Fiedler, Rakefet Ackerman, and Chiara Scarampi. ! metacognition : Monitoring and controlling one ' s own knowledge , reasoning and decisions. 2019. Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimization for efficiently improving generalization. In 9th International Conference on Learning Repre- sentations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=6Tm1mposlrM. Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Training pruned neural networks. CoRR, abs/1803.03635, 2018. URL http://arxiv.org/abs/1803.03635. Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In Maria-Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, volume 48 of JMLR Workshop and Conference Proceedings, pp. 1050–1059. JMLR.org, 2016. URL http://proceedings.mlr.press/v48/gal16.html. Ido Galil, Mohammed Dabbah, and Ran El-Yaniv. A framework for benchmarking class-out-of- distribution detection and its application to imagenet. In International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=Iuubb9W6Jtk. Yonatan Geifman and Ran El-Yaniv. Selective classification for deep neural networks. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vish- wanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: 11 Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 4878–4887, 2017. URL https://proceedings.neurips.cc/paper/2017/hash/ 4a8423d5e91fda00bb7e46540e2b0cf1-Abstract.html. Yonatan Geifman and Ran El-Yaniv. Selectivenet: A deep neural network with an integrated reject option. CoRR, abs/1901.09192, 2019. URL http://arxiv.org/abs/1901.09192. Yonatan Geifman, Guy Uziel, and Ran El-Yaniv. Bias-reduced uncertainty estimation for deep neural classifiers. In International Conference on Learning Representations, 2018. Leo A. Goodman and William H. Kruskal. Measures of association for cross classifications. Journal of the American Statistical Association, 49(268):732–764, December 1954. doi: 10.1080/01621459. 1954.10501231. URL https://doi.org/10.1080/01621459.1954.10501231. Thomas D. Griffin, Jennifer Wiley, and Keith W. Thiede. The effects of comprehension-test expectancies on metacomprehension accuracy. Journal of Experimental Psychology: Learn- ing, Memory, and Cognition, 45(6):1066–1092, June 2019. doi: 10.1037/xlm0000634. URL https://doi.org/10.1037/xlm0000634. Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On calibration of modern neural networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, vol- ume 70 of Proceedings of Machine Learning Research, pp. 1321–1330. PMLR, 2017. URL http://proceedings.mlr.press/v70/guo17a.html. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR recognition. 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 770–778. IEEE Computer Society, 2016. doi: 10.1109/CVPR.2016.90. URL https://doi.org/10.1109/CVPR.2016.90. Philip A. Higham and D. Paul Higham. New improved gamma: Enhancing the accuracy of good- man–kruskal's gamma using ROC curves. Behavior Research Methods, 51(1):108–125, September 2018. doi: 10.3758/s13428-018-1125-5. URL https://doi.org/10.3758/s13428-018-1125-5. Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network, 2015. Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, Quoc V. Le, and Hartwig Adam. Searching for mobilenetv3. CoRR, abs/1905.02244, 2019. URL http://arxiv.org/abs/1905.02244. Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 6402–6413, 2017. URL https: //proceedings.neurips.cc/paper/2017/hash/9ef2ed4b7fd2c810847ffa5fa85bce38-Abstract.html. Ming Lin, Hesen Chen, Xiuyu Sun, Qi Qian, Hao Li, and Rong Jin. Neural architecture design for gpu-efficient networks, 2020. Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Confer- ence on Learning Representations, 2019. URL https://openreview.net/forum?id=Bkg6RiCqY7. Wesley J. Maddox, Pavel Izmailov, Timur Garipov, Dmitry P. Vetrov, and Andrew Gordon Wil- In Hanna M. Wallach, son. A simple baseline for bayesian uncertainty in deep learning. Hugo Larochelle, Alina Beygelzimer, Florence d'Alch ́e-Buc, Emily B. Fox, and Roman Gar- nett (eds.), Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancou- ver, BC, Canada, pp. 13132–13143, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/ 118921efba23fc329e6560b27861f0c2-Abstract.html. Dhruv Mahajan, Ross B. Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan Li, Ashwin Bharambe, and Laurens van der Maaten. Exploring the limits of weakly supervised pretraining. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss (eds.), Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part II, volume 11206 of Lecture Notes in Computer Science, pp. 185–201. Springer, 2018. doi: 10.1007/978-3-030-01216-8\ 12. URL https://doi.org/10.1007/ 978-3-030-01216-8 12. 12 Jooyoung Moon, Jihyo Kim, Younghak Shin, and Sangheum Hwang. Confidence-aware learning for deep neural 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. 7034–7044. PMLR, 2020. URL http://proceedings.mlr.press/v119/moon20a.html. Zachary Nado, Neil Band, Mark Collier, Josip Djolonga, Michael W. Dusenberry, Sebastian Far- quhar, Angelos Filos, Marton Havasi, Rodolphe Jenatton, Ghassen Jerfel, Jeremiah Liu, Zelda Mariet, Jeremy Nixon, Shreyas Padhy, Jie Ren, Tim G. J. Rudner, Yeming Wen, Florian Wen- zel, Kevin Murphy, D. Sculley, Balaji Lakshminarayanan, Jasper Snoek, Yarin Gal, and Dustin Tran. Uncertainty baselines: Benchmarks for uncertainty & robustness in deep learning. CoRR, abs/2106.04015, 2021. URL https://arxiv.org/abs/2106.04015. Mahdi Pakdaman Naeini, Gregory F. Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, AAAI'15, pp. 2901–2907. AAAI Press, 2015. ISBN 0262511290. Niv Nayman, Yonathan Aflalo, Asaf Noy, and Lihi Zelnik. Hardcore-nas: Hard constrained differ- entiable neural architecture search. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 7979–7990. PMLR, 2021. URL http://proceedings.mlr.press/v139/nayman21a.html. Thomas O. Nelson. A comparison of current measures of the accuracy of feeling-of-knowing predictions. Psychological Bulletin, 95(1):109–133, 1984. doi: 10.1037/0033-2909.95.1.109. URL https://doi.org/10.1037/0033-2909.95.1.109. Jeremy Nixon, Michael W. Dusenberry, Linchuan Zhang, Ghassen Jerfel, and Dustin Tran. In IEEE Conference on Computer Vision and Pat- Measuring calibration in deep learning. tern Recognition Workshops, CVPR Workshops 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 38–41. Computer Vision Foundation / IEEE, 2019. URL http://openaccess.thecvf. com/content CVPRW 2019/html/Uncertainty and Robustness in Deep Visual Learning/ Nixon Measuring Calibration in Deep Learning CVPRW 2019 paper.html. Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alch ́e-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Sys- tems 32, pp. 8024–8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/ 9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf. Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 8748–8763. PMLR, 2021. URL http://proceedings.mlr.press/v139/radford21a.html. Tal Ridnik, Emanuel Ben Baruch, Asaf Noy, and Lihi Zelnik. Imagenet-21k pretraining for the masses. In Joaquin Vanschoren and Sai-Kit Yeung (eds.), Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, December 2021, virtual, 2021. URL https://datasets-benchmarks-proceedings.neurips.cc/ paper/2021/hash/98f13708210194c475687be6106a3b84-Abstract-round1.html. Mark Sandler, Andrew G. Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pp. 4510–4520. Computer Vision Foundation / IEEE Computer Society, 2018. doi: 10.1109/CVPR. 2018.00474. URL http://openaccess.thecvf.com/content cvpr 2018/html/Sandler MobileNetV2 Inverted Residuals CVPR 2018 paper.html. Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1409.1556. 13 Mannat Singh, Laura Gustafson, Aaron Adcock, Vinicius de Freitas Reis, Bugra Gedik, Raj Prateek Kosaraju, Dhruv Mahajan, Ross B. Girshick, Piotr Doll ́ar, and Laurens van der Maaten. Revisiting weakly supervised pre-training of visual perception models. CoRR, abs/2201.08371, 2022. URL https://arxiv.org/abs/2201.08371. Andreas Peter Steiner, Alexander Kolesnikov, Xiaohua Zhai, Ross Wightman, Jakob Uszkoreit, and Lucas Beyer. How to train your vit? data, augmentation, and regularization in vision transformers. Transactions on Machine Learning Research, 2022. URL https://openreview.net/ forum?id=4nPswr1KcP. Mingxing Tan and Quoc V. Le. Efficientnetv2: Smaller models and faster training. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 10096–10106. PMLR, 2021. URL http://proceedings.mlr.press/v139/tan21a.html. Hugo Touvron, Piotr Bojanowski, Mathilde Caron, Matthieu Cord, Alaaeldin El-Nouby, Edouard Grave, Armand Joulin, Gabriel Synnaeve, Jakob Verbeek, and Herv ́e J ́egou. Resmlp: Feedforward networks for image classification with data-efficient training. CoRR, abs/2105.03404, 2021a. URL https://arxiv.org/abs/2105.03404. Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Herv ́e J ́egou. Training data-efficient image transformers & distillation through attention. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 10347–10357. PMLR, 2021b. URL http://proceedings.mlr.press/v139/touvron21a. html. Hugo Touvron, Matthieu Cord, and Herv ́e J ́egou. Deit III: revenge of the vit. CoRR, abs/2204.07118, 2022. doi: 10.48550/arXiv.2204.07118. URL https://doi.org/10.48550/arXiv.2204.07118. Florian Tram`er, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick Mc- Daniel. Ensemble adversarial training: Attacks and defenses. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=rkZvSe-RZ. Dustin Tran, Jeremiah Liu, Michael W. Dusenberry, Du Phan, Mark Collier, Jie Ren, Kehang Han, Zi Wang, Zelda Mariet, Huiyi Hu, Neil Band, Tim G. J. Rudner, Karan Singhal, Zachary Nado, Joost van Amersfoort, Andreas Kirsch, Rodolphe Jenatton, Nithum Thain, Honglin Yuan, Kelly Buchanan, Kevin Murphy, D. Sculley, Yarin Gal, Zoubin Ghahramani, Jasper Snoek, and Balaji Lakshminarayanan. Plex: Towards reliability using pretrained large model extensions. CoRR, abs/2207.07411, 2022. doi: 10.48550/arXiv.2207.07411. URL https://doi.org/10.48550/arXiv. 2207.07411. Monika Undorf and Arndt Br ̈oder. Cue integration in metamemory judgements is strategic. Quarterly Journal of Experimental Psychology, 73(4):629–642, October 2019. doi: 10.1177/ 1747021819882308. URL https://doi.org/10.1177/1747021819882308. Juozas Vaicenavicius, David Widmann, Carl R. Andersson, Fredrik Lindsten, Jacob Roll, and Thomas B. Sch ̈on. Evaluating model calibration in classification. In Kamalika Chaudhuri and Masashi Sugiyama (eds.), The 22nd International Conference on Artificial Intelligence and Statis- tics, AISTATS 2019, 16-18 April 2019, Naha, Okinawa, Japan, volume 89 of Proceedings of Machine Learning Research, pp. 3459–3467. PMLR, 2019. URL http://proceedings.mlr.press/v89/ vaicenavicius19a.html. Ross Wightman. Pytorch image models. https://github.com/rwightman/pytorch-image-models, 2019. Cihang Xie, Mingxing Tan, Boqing Gong, Jiang Wang, Alan L. Yuille, and Quoc V. Le. Ad- In 2020 IEEE/CVF Conference on Com- versarial examples improve image recognition. puter Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pp. 816–825. Computer Vision Foundation / IEEE, 2020a. doi: 10.1109/CVPR42600.2020. 00090. URL https://openaccess.thecvf.com/content CVPR 2020/html/Xie Adversarial Examples Improve Image Recognition CVPR 2020 paper.html. Qizhe Xie, Minh-Thang Luong, Eduard H. Hovy, and Quoc V. Le. Self-training with noisy In 2020 IEEE/CVF Conference on Computer Vi- student improves imagenet classification. sion and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pp. 10684– 10695. Computer Vision Foundation / IEEE, 2020b. doi: 10.1109/CVPR42600.2020.01070. URL https://openaccess.thecvf.com/content CVPR 2020/html/Xie Self-Training With Noisy Student Improves ImageNet Classification CVPR 2020 paper.html. 14 I. Zeki Yalniz, Herv ́e J ́egou, Kan Chen, Manohar Paluri, and Dhruv Mahajan. Billion-scale semi- supervised learning for image classification, 2019. Fisher Yu, Dequan Wang, Evan Shelhamer, and Trevor Darrell. Deep layer aggregation. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2403–2412, 2018. doi: 10.1109/CVPR.2018.00255. Shengjia Zhao, Tengyu Ma, and Stefano Ermon. Individual calibration with randomized forecasting. 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. 11387–11397. PMLR, 2020. URL http://proceedings.mlr.press/v119/zhao20e.html. A The investment example Let us consider two classification models for the stock market that predict whether a stock's value is about to increase, decrease or remain neutral (three-class classification). Suppose that Model A has a 95% true accuracy, and generates a confidence score of 0.95 on any prediction (even on misclassified instances); Model B has a 40% true accuracy, but always gives a confidence score of 0.6 on correct predictions, and 0.4 on incorrect ones. We now try and evaluate these two models using the uncertainty metrics mentioned in Section 1 to see which can reveal Model B's superior uncertainty estimation performance. AURC will fail due to its sensitivity to accuracy (the AURC of Model B is 0.12, more than twice as bad as the AURC for Model A, which is 0.05). NLL will rank Model A four times higher (Model A's NLL is 0.23 and Model B's is 0.93). The Brier score would also much prefer Model A (giving it a score of 0.096 while giving Model B a score of 0.54). Evaluating the models' calibration with ECE will also not reveal Model B's advantages, since it is less calibrated than Model A, which has perfect calibration (Model A has an ECE of 0, and Model B has a worse ECE of 0.4). AUROC, on the other hand, would give Model B a perfect score of 1 and a terrible score of 0.5 to Model A. The selective risk for Model B would be better for any coverage of stock predictions below 40%, and for any SAC above 95% the coverage for Model A would be 0, but 0.4 for Model B. Those two metrics are not perfect for any example. Let us instead compare two different models for the task of predicting the weather when we cannot abstain from making predictions. Accordingly, being required to provide an accurate probabilistic uncertainty estimation of the model's predictions, AUROC and selective risk would be meaningless (due to the model's inability to abstain in this task), but ECE or the Brier Score would better evaluate the performance the new task requires. B Ranking and Calibration Visual Comparison A comparison of 523 models by their AUROC (×100, higher is better) and -log(ECE) (higher is better) on ImageNet is visualized in Figure 8. An interactive version of this figure is provided as supplementary material. To compare models fairly by their size, we plot two graphs with the logarithm of the number of parameters as the X-axis, so that models sharing the same x value can be compared solely based on their y value. In Figure 9 we set the X axis to be AUROC (higher is better), and see ViTs outperform any other architecture with a comparable amount of parameters by a large margin. We can also observe that using distillation creates a consistent improvement in AUROC. In Figure 10 we set the X axis to be the negative logarithm of ECE (higher is better) and observe a very similar trend, with ViT outperforming its competition for any model size. C Demonstration of E-AURC's dependence on the model's accuracy Excess-AURC (E-AURC) was suggested by Geifman et al. (2018) as an alternative to AURC (explained in Section 2). To calculate E-AURC, two AURC scores need to be calculated: (1) AU RC(model), the AURC value of the actual model and (2) AU RC(model∗), the AURC value of a hypothetical model with identical predicted labels as the first model, but that outputs confidence values that induce a perfect partial order on the instances in terms of their correctness. The latter means that all incorrectly predicted instances are assigned confidence values lower than the correctly predicted instances. 15 Figure 8: A comparison of 523 models by their AUROC (×100, higher is better) and log(ECE) (lower is better) on ImageNet. Each marker's size is determined by the model's number of parameters. Each dotted marker represents a distilled version of the original. An interactive version of this figure is provided as supplementary material. 16 234567788082848688ModelsVariousAlexNetBiTCaiTCLIP + Linear ProbeCLIP Zero-ShotCoaTConViTDenseNetDLAECANetEfficientNetEfficientNetV2FBNetGENetgMLPHardCoReNASInceptionLeViTMixConvMLP MixerMnasNetMobileNetV2MobileNetV3NASNetNesTNFNetPiTRegNetXRegNetYRepVGGRes2NetResMLPResNetResNet_RSResNeXtSE_ResNetSSL_ResNetSwinSWSL_ResNetTNTTResNetTwinsVGGVisformerViTViT*WSP ResNeXt-log(ECE)AUROC Figure 9: A comparison of 523 models by their AUROC (×100, higher is better) and log(number of model's parameters) on ImageNet. Each dotted marker represents a distilled version of the original. Figure 10: A comparison of 523 models by their -log(ECE) (higher is better) and log(number of model's parameters) on ImageNet. Each dotted marker represents a distilled version of the original. E-AURC is then defined as AU RC(model)−AU RC(model∗). In essence, this metric acknowledges that given a model's accuracy, the area of AU RC(model∗) is always unavoidable no matter how good the partial order is, but anything above that could have been minimized if the κ function was better at ranking, assigning correct instances higher values than incorrect ones and inducing a better partial order over the instances. This metric indeed helps to reduce some of the sensitivity to accuracy suffered by AURC, and for the example presented in Section 1, E-AURC would have given a perfect score of 0 to the model inducing a perfect partial order by its confidence values (Model B). It is easy, however, to craft examples showing that E-AURC prefers models with higher accuracy, even if they have lower or equal capacity to rank. To demonstrate this in a simple way, let us consider two models with a complete lack of capacity to rank correct and incorrect predictions correctly, always outputting the same confidence score. Model A has an accuracy of 20% (thus an error rate of 80%), and Model B has an accuracy of 80% (and an 17 66.5788.59788082848688ModelsVariousAlexNetBiTBiT distilledEfficientNetV2GENetMLP MixerMLP Mixer distilledRegNetYResMLPResMLP distilledResNetViTViT*ViT* distilledXCiTXCiT distilledModelsResMLPResMLP distilled ResNetViTViT* ViT* distilledXCiTXCiT distilledVariousAlexNetBiTBiT distilled EfficientNetV2 GENetMLP MixerMLP Mixer distilledRegNetY7.5log(#Parameters)AUROC66.5788.59234567ModelsVariousAlexNetBiTBiT distilledCLIP + Linear Probe CLIP Zero-Shot EfficientNetV2 GENetMLP MixerMLP Mixer distilled RegNetYResMLPResMLP distilled ResNetViTViT*ViT* distilledXCiTXCiT distilled7.5log(#Parameters)-log(ECE) error rate of 20%). A good ranking metric should evaluate them equally (the same way E-AURC gives the same score for two models that rank perfectly regardless of their accuracy). In Figure 11 we plot their RC curves with dashed lines, which are both straight lines due to their lack of ranking ability. We can calculate both of these models' AURCs, AU RC(modelA) = 0.8, AU RC(modelB) = 0.2. Figure 11: The RC curves for Models A and B are plotted with dashed lines. The RC curves for the hypothetically optimal versions of Models A and B are plotted with solid lines. The next thing to calculate is the best AURC values those models could have achieved given the same accuracy if they had a perfect partial order. We plot these hypothetical models' RC curves in Figure 11 as solid lines. Their selective risk remains 0 for every coverage below their total accuracy, since these hypothetical models assigned the highest confidence to all of their correct instances first. As the coverage increases and they have no more correct instances to select, they begin to give instances that are incorrect, and thus their selective risk deteriorates for higher coverages. Calculating both of these hypothetical models' AURCs gives us the following: AU RC(modelA∗) = 0.482, AU RC(modelB∗) = 0.022. Subtracting our results we get: E-AURC(modelA) = 0.8 − 0.482 = 0.318, E-AURC(modelB) = 0.2 − 0.022 = 0.178 Hence, E-AURC prefers Model B over Model A, even though both do not discriminate at all between incorrect and correct instances. D More on the Definition of Ranking Let us consider a finite set Sm = {(xi, yi)}m i=1 ∼ PX,Y . We assume that there are no two identical values given by κ on Sm. Such an assumption is reasonable when choosing a continuous confidence signal. We further denote c as the number of concordant pairs (i.e., pairs in Sm that satisfy the condition [κ(xi, ˆy|f ) < κ(xj, ˆy|f ) ∩ (cid:96)(f (xi), yi) > (cid:96)(f (xj), yj)]) and d as the number of discordant pairs (i.e., pairs in Sm that satisfy the condition [κ(xi, ˆy|f ) > κ(xj, ˆy|f ) ∩ (cid:96)(f (xi), yi) > (cid:96)(f (xj), yj)]. We assume, for now, that there are no two identical values given by (cid:96) on Sm. Accordingly, we can further develop Equation (1) from Section 2.1 using the definition of conditional probability, Pr[κ(xi, ˆy|f ) < κ(xj, ˆy|f )|(cid:96)(f (xi), yi) > (cid:96)(f (xj), yj)] = Pr[κ(xi, ˆy|f ) < κ(xj, ˆy|f ) ∩ (cid:96)(f (xi), yi) > (cid:96)(f (xj), yj)] Pr[(cid:96)(f (xi), yi) > (cid:96)(f (xj), yj)] , 18 which can be approximated empirically, using the most likelihood estimator, as We note that the last equation is identical to Kendall's τ up to a linear transformation, which equals c (cid:0)m 2 (cid:1) . (2) (cid:1) = c − d (cid:0)m 2 2c − (c + d) (cid:1) (cid:0)m 2 (cid:1) c − d + c − c (cid:0)m 2 c + d (cid:0)m 2 (cid:1) − = 2c (cid:0)m 2 (cid:1) − 1 = 2 * [Equation 2] − 1. (cid:1) = c (cid:0)m 2 = 2 * Otherwise, if the loss assigns two identical values to a pair of points in Sm, but κ does not, then we get: which is identical to Goodman & Kruskal's γ-correlation up to a linear transformation c c + d . (3) c − d c + d = c − d + c − c c + d c + d c + d − 2c c + d = 2c − (c + d) c + d = = 2 * [Equation 3] − 1. D.1 Inequalities of the definition One might wonder why Equation (1) should have strict inequalities rather than non-strict ones to define ranking. As we discuss below, this would damage the definition: (1) If the losses had a non-strict inequality: Pr[κ(x1, ˆy|f ) < κ(x2, ˆy|f )|(cid:96)(f (x1), y1) ≥ (cid:96)(f (x2), y2)] Consequently, in the case of classification, for example, this probability would increase for any pairs consisting of correct instances with different confidences. This would yield no benefit in ranking between incorrect and correct instances and motivates giving different confidence values for instances with the same loss-a fact that would not truly add any value. (2) If the κ values had a non-strict inequality: Pr[κ(x1, ˆy|f ) ≤ κ(x2, ˆy|f )|(cid:96)(f (x1), y1) > (cid:96)(f (x2), y2)]. This probability would increase for any pair (x1, x2) such that κ(x1, ˆy|f ) = κ(x2, ˆy|f ) and (cid:96)(f (x1)) > (cid:96)(f (x2)), although κ should have ranked x1 with a lower value. Furthermore, if a κ function were to assign the same confidence score to all x ∈ X , then when there are no two identical values of losses, the definition's probability would be 1; otherwise, the more different values for losses there are, the larger the probability would grow. In classification with a 0/1 loss, for example, assigning the same confidence score to all instances would result in the probability being Accuracy(f ) * (1 − Accuracy(f )), which is largest when Accuracy(f ) = 0.5. E Ranking capacity comparison between humans and neural networks In the field of metacognition, interestingly, the predictive value of confidence is evaluated by two different aspects: by its ability to discriminate between correct and incorrect predictions (also known as resolution in metacognition or ranking in our context) and by its ability to give well-calibrated 19 confidence estimations, not being over- or under-confident (Fiedler et al., 2019). These two aspects correspond perfectly with much of the research done in the deep learning field, with the nearly matching metric to AUROC of γ-correlation (see Section 2). This allows us to compare how well humans rank predictions in various tasks versus how well models rank their own in others. Human AUROC measurements in various tasks (translated from γ-correlation) tend to range from 0.6 to 0.75 (Undorf & Br ̈oder, 2019; Basile et al., 2018; Ackerman et al., 2016), but could vary, usually towards much lower values (Griffin et al., 2019). In our comprehensive evaluation on ImageNet, AUROC ranged from 0.77 to 0.88 (with the median value being 0.85), and in CIFAR-10 these measurements jump to the range of 0.92 to 0.94. While such comparisons between neural networks and humans are somewhat unfair due to the great sensitivity required for the task, research that directly compares humans and machine learning algorithms performing the same task exist. For example, in Ackerman et al. (2019), algorithms far surpass even the group of highest performing individuals in terms of ranking. F Criticisms of AUROC as a ranking metric (i), ˆyf (xc (i), ˆyf m(xc In this section, addressing the criticism of AUROC as a ranking metric, we show why AUROC does not simply reward models for having lower accuracy, . The paper by Ding et al. (2019) presented a semi-artificial experiment to demonstrate that AUROC might get larger the worse the model's accuracy becomes. They consider a model f and its κ function evaluated on a classification test set X , giving each a prediction ˆyf (x) and a confidence score κ(x, ˆyf (x)|f ), which in this case is the model's softmax response. Let X c = {xc ∈ X |ˆyf (xc) = y(x)} be the set of all instances correctly predicted by the model f , and define xc (i) ∈ X c to be the correct instance that received the i-lowest confidence score from κ. Their example continues and considers an artificial model f m to be an exact clone of f with the following modification: for every i ≤ m, the model f m now predicts a different, incorrect label for xc (i); however, its given confidence score remains identical: κ(xc (i))|f m). f 0 is exactly identical to f , by this definition, not (i))|f ) = κ(xc changing any predictions. The paper shows how an artificially created model f m obtains a higher AUROC score the bigger its m. This happens even though "nothing" changed but a hit to the model's accuracy performance (by making mistakes on more instances). First, to understand why this happens, let us consider f 1: AUROC for κ increases the more pairs of [κ(x1) < κ(x2)|ˆyf (x1) (cid:54)= y(x1), ˆyf (x2) = y(x2)] there are. The model f 1 is now giving an incorrect classification to xc (1), but this instance's position in the partial order induced by κ has (1)) is unchanged); therefore, |X c|−1 correctly ranked pairs were added: remained the same (since κ(xc [κ(xc (i))] for every 1 < i ≤ |X c|. Nevertheless, (i)) = y(xc this does not guarantee an increase to AUROC by itself: if, previously, all pairs of (correct,incorrect) instances were ranked correctly by κ, AUROC would already be 1.0 for f 0 and would not change for f 1. If AUROC for f 1 is higher than it was for f 0, this means there exists at least one instance (1)) < κ(xw). Every such xw that was incorrectly predicted by the original model f 0 such that κ(xc (1)) < κ(xw)|ˆyf (xw) (cid:54)= y(xw), ˆyf (xc originally wrongly ranked pair (by f 0) of [κ(xc (1))] has been eliminated by f 1 wrongly predicting xc (1). This, therefore, causes AUROC to increase at the expense of the model's accuracy. (1)) < κ(xc (1)) (cid:54)= y(xc (1)) = y(xc (1)), ˆyf (xc (i))|ˆyf (xc Such an analysis neglects many factors, which is probably why such an effect is only likely to be observed in artificial models (and not among the actual models we have empirically tested): 1. It is unreasonable to assume that the confidence score given by κ will remain exactly the same for an instance xc (i) given it now has a different prediction. In the case of κ being softmax, it assumes the model's logits have changed in a very precise and nontrivial manner. Additionally, by our broad definition of κ, which allows κ to even be produced from an entirely different model than f , κ receives the prediction and model as a given input (and cannot change or affect either), and it is unlikely to assume changing its inputs will not change its output. 2. Suppose we find the setting reasonable and assume we can actually create a model f m as described. Let us observe a model f p such that p = minm(AUROC of f m=1), meaning 20 that f p ranks its predictions perfectly, unlike the original f 0. Is it really true that f p has no better uncertainty estimation than f 0? Model f p behaves very much like the investment in "Model B" from our example in Section 1, possessing perfect knowledge of when it is wrong and when it is correct, allowing its users risk-free classification. So, given a model f , we can use the above process to produce an improved model f p, and then we can even calibrate its κ to output 0% for all instances below its threshold and 100% for all those above to produce a perfect model, which might have a small coverage but is correct every time, knows it and notifies its user when it truly knows the prediction. The increase in AUROC reflects such an improvement. Not only do we disagree with such an analysis and its conclusions, but we also have vast empirical evidence to show that AUROC does not prefer lower accuracy models unless there is a good reason for it to do so, as we demonstrate in Figure 3 (comparing EfficientNet-V2-XL to ViT-B/32-SAM). In fact, out of the 523 models we tested, the model with the highest AUROC also has the 4th highest accuracy of all models, and the overall Spearman correlation between AUROC and accuracy of all the models we tested is 0.03. Furthermore, Figure 3 also exemplifies why AURC, which was suggested by the just mentioned paper as the alternative to AUROC, is a bad choice as a single number metric, and might lead us to deploy a model that has a worse selective risk for most coverages only due to its higher overall accuracy. G Knowledge distillation effects on uncertainty estimation Figure 12: Comparing vanilla models to those incorporating KD into their training (represented by markers with thick borders and a dot). In a pruning scenario that includes distillation, yellow markers indicate that the original model was also the teacher. The performance of each model is measured in AUROC (higher is better) and -log(ECE) (higher is better). Figure 12 compares vanilla models to those incorporating KD into their training (represented by markers with thick borders and a dot). In a pruning scenario that includes distillation, yellow markers indicate that the original model was also the teacher (Aflalo et al., 2020). While distillation using a different model tends to improve uncertainty estimation in both aspects, distillation by the model itself seems to improve only one-suggesting it is generally more beneficial to use a different model as a teacher. The fact that KD improves the model over its original form, however, is surprising, and implies that the distillation process itself helps uncertainty estimation. Note that although this specific method involves pruning, evaluations of models pruned without incorporating distillation (Frankle & Carbin, 2018) revealed no improvement. It seems, moreover, that the teacher does not have to be good in uncertainty estimation itself; Figure 5 in Section 3 shows this by comparing the teacher architecture and the students in each case. 21 34678384858687885AUROCBiTBiT distilledDeiTDeiT distilled ECANetECANet distilled EfficientNet EfficientNet distilled MLP MixerMLP Mixer distilled MobileNetV3 MobileNetV3 distilled PiTPiT distilled ResMLPResMLP distilled TResNetTResNet distilled XCiTXCiT distilledModels-log(ECE) While the training method by Ridnik et al. (2021) included pretraining on ImageNet-21k and demonstrated impressive improvements, comparison of models that were pretrained on ImageNet21k (Tan & Le, 2021; Touvron et al., 2021a, 2022) with identical models that were not pretrained showed only a slight improvement in ECE, and, in fact, exhibit a degradation of AUROC (see Figures 4a and 4b in Section 3). This suggests that pretraining alone does not improve uncertainty estimation. H More information about Temperature Scaling Figure 13: A comparison of 523 models after being calibrated with TS, evaluated by their AUROC (×100, higher is better) and -log(ECE) (higher is better) on ImageNet. Each marker's size is determined by the model's number of parameters. ViT models are still among the best performing architectures for all aspects of uncertainty estimation. In Figure 13 we see how temperature scaling (TS) affects the overall ranking of models in terms of AUROC and ECE. While the ranking between the different architecture remains similar, the poorly performing models are much improved and minimize the gap between them and the best models. One particularly notable exception is HardCoRe-NAS (Nayman et al., 2021), with its lowest latency versions becoming the top performers in terms of ECE. In addition, models that benefit from TS in terms of AUROC tend to have been assigned a temperature lower than 1 by the calibration process (see Figure 6 in Section 3). The same, however, does not hold true for ECE (see Figure 14). This example also emphasizes the fact that models benefiting from TS in terms of AUROC do not necessarily benefit in terms of ECE, and vice versa. Therefore, determining whether to calibrate the deployed model with TS is, unfortunately, a task-specific decision. We perform TS as was suggested in Guo et al. (2017). For each model we take a random stratified sampling of 5,000 instances from the ImageNet validation set on which to calibrate, and reserve the remainder 45,000 instances for testing. Using the box-constrained L-BFGS (Limited-Memory Broyden-Fletcher-Goldfarb-Shanno) algorithm, we optimize for 5,000 iterations (though fewer iterations usually converge into the same temperature parameter) using a learning rate of 0.01. I Architecture choice for practical deployment based on Selective Performance As discussed in Section 2, when we know the coverage or risk we require for deployment, the most direct metric to check is which model obtains the best risk for the coverage required (selective risk), or which model gets the largest coverage for the accuracy constraint (SAC). While each deployment scenario specifies its own constraints, for demonstration purposes we consider a scenario in which 22 44.555.566.578082848688ModelsResMLPResMLP distilled ResNetViTViT*ViT* distilledXCiTXCiT distilledVariousAlexNetBiTBiT distilled EfficientNetV2 HardCoReNASMLP MixerMLP Mixer distilled RegNetY-log(ECE) with Temperature ScalingAUROC with Temperature Scaling Figure 14: Here the relationship between temperature and the success of TS, unlike the case for AUROC, seems unrelated. misclassifications are by far more costly than abstaining from giving correct predictions. An example of this could be classifying a huge unlabeled dataset (or cleaning bad labels from a labeled dataset). While it is desirable to assign labels to a larger portion of the dataset (or to correct more of the wrong labels), it is crucial that these labels are as accurate as possible (or that correctly labeled instances are not replaced with a bad label). Figure 15: A comparison of 523 models by their log(number of model's parameters) and the coverage they are able to provide for a SAC of 99% (higher is better) on ImageNet. To explore such a scenario, we evaluate all models on ImageNet to see which ones give us the largest coverage for a required accuracy of 99%. In Figure 7, Section 3 (paper's main body) we observe that of all the models studied, only ViT models are able to provide coverage beyond 30% for such an extreme constraint. Moreover, we note that the coverage they provide is significantly larger than that given by models with comparable accuracy or size, and that ViT models that provide similar coverage to their counterparts do so with less overall accuracy. In Figure 15 we see that not only do ViT models provide more coverage than any other model, but that they are also able to do so in any size category. To compare models fairly by their size, we present 23 Temperature Scaling (Temp. < 1)Temperature Scaling (Temp. > 1)00.050.10.150.20.250.30.350.4ECE Improvement over VanillaMethodTemperature Scaling (Temp. < 1) Temperature Scaling (Temp. > 1)0102030405066.577.588.59ModelsVariousAlexNetBiTDLARegNetXRegNetYResNetSWSL ResNeXtViTViT*ModelsVarious AlexNet BiT DLARegNetXRegNetY ResNet SWSL ResNeXt ViT ViT*Coverage for Accuracy 99log(#Parameters) Table 1: A comparison of different training regimes of ViTs. *The paper introducing ViTs (Dosovit- skiy et al., 2021) had also trained ViT models with the JFT-300M dataset; however, their weights are unavailable to the general public. All evaluations of ViTs from that paper were conducted on ViTs pretrained on ImageNet-21k, which are publicly available. **Pretrained DeiT3 models were first pretrained with a learning rate of 3 * 10−3 and then fine-tuned with a learning rate of 3 * 10−4 Regime Reference Pretraining dataset Batch Size Optimizer LR LR decay Weight decay Warmup epochs Label smoothing (cid:15) Dropout Stoch. Depth Repeated Aug Gradient Clip. H. flip Random Resized Crop Rand Augment 3 Augment LayerScale Mixup alpha Cutmix alpha Erasing prob. ColorJitter Test crop ratio Loss Superb performance ViT (original) Steiner et al. Chen et al. DeiT DeiT3 DeiT3 +Pretraining Torchvision Dosovitskiy et al. (2021) Steiner et al. (2022) Chen et al. (2022) Touvron et al. (2021b) Touvron et al. (2022) Paszke et al. (2019) ImageNet-21k* 4096 AdamW 3 * 10−3 cosine 0.1 3.4 0.1 (cid:51) (cid:55) (cid:55) 1.0 (cid:51) (cid:51) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) 0.875 CE (cid:51) ImageNet-21k 4096 AdamW 3 * 10−3 cosine 0.3 3.4 0.1 (cid:51) (cid:51) (cid:55) 1.0 (cid:51) (cid:51) Adapt. (cid:55) (cid:55) Adapt. (cid:55) (cid:55) (cid:55) 0.875 CE (cid:51) - 4096 SAM 3 * 10−3 cosine 0.1 3.4 0.1 (cid:51) (cid:55) (cid:55) 1.0 (cid:51) (cid:51) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) 0.875 CE (cid:51) - 1024 LAMB 1 * 10−3 cosine 0.05 5 0.1 (cid:55) (cid:51) (cid:51) (cid:55) (cid:51) (cid:51) 9/0.5 (cid:55) (cid:55) 0.8 1.0 0.25 (cid:55) 0.875 CE (cid:55) - 2048 LAMB 3 * 10−3 cosine 0.02 5 (cid:55) (cid:55) (cid:51) (cid:51) 1.0 (cid:51) (cid:51) (cid:55) (cid:51) (cid:51) 0.8 1.0 (cid:55) 0.3 1.0 BCE (cid:55) ImageNet-21k 2048 LAMB 3 * 10−3** cosine 0.02 5 0.1 (cid:55) (cid:51) (cid:55) 1.0 (cid:51) (cid:55) (cid:55) (cid:51) (cid:51) (cid:55) 1.0 (cid:55) 0.3 1.0 CE (cid:55) - 512 AdamW 3 * 10−3 cosine 0.3 30 0.11 (cid:55) (cid:55) (cid:51) 1.0 (cid:51) (cid:51) Adapt. (cid:55) (cid:55) 0.2 1.0 (cid:55) (cid:55) 0.875 CE (cid:55) Figure 15, which sets the Y axis to be the logarithm of the number of parameters, so that models sharing the same y value can be compared solely based on their x value-which is the coverage they provide for a SAC of 99%. We see that ViT models provide a larger coverage even when compared with models of a similar size. J Comparison of ViT training regimes and their effects on uncertainty estimation performance In Table 1 we compare the different hyperparameters and augmentations used for training the ViT models evaluated in this paper, with the aim of revealing why some training regimes consistently result in superb ViTs, while others do not. An analysis of the various differences between these regimes, however, eliminates the obvious suspects. 1) Pretraining, on its own, does not seem to offer an explanation: First, we analyze eight pairs of models (provided by Touvron et al. 2022) such that both models have identical architecture and training regimes, with the exception that one was pretrained on ImageNet-21k, and the other was not. Pretraining results in only a slight improvement of 0.16 in AUROC and 0.01 in ECE. Moreover, as mentioned in detail in Section 3, ViT models trained on JFT-4B (Tran et al., 2022) were outperformed by the successful ViT models evaluated in this paper, most of which were pretrained on ImageNet-21k (and even by one ViT SAM model that was not pretrained at all). Second, we note that ViTs trained with the SAM optimizer (Chen et al., 2022), and not pretrained at all, reach superb ranking (AUROC) as well. These facts lead us to conclude that pretraining, at least by itself, is not the main contributor to training successful ViTs. 2) The selection of optimizers and other hyperparameters (such as learning rate, label smoothing etc.) does not seem to have a significant impact. For example, while AdamW (Loshchilov & Hutter, 2019) was used by two of the successful regimes, it was also used by Paszke et al. (2019), and on the other hand was replaced by SAM (Foret et al., 2021) in another successful training regime. 3) Advanced augmentations are unlikely to explain the gaps in uncertainty estimation performance, as regimes producing superior ViT models (Dosovitskiy et al., 2021; Chen et al., 2022) did not use advanced augmentations (in comparison to Touvron et al. (2021b) and Touvron et al. (2022), for example). For these reasons, for the moment, the explanation for the gap remains elusive. The only remaining "suspect" is the batch size used, with all successful regimes using a batch size of 4096, while others 24 Table 2: The relationship between uncertainty estimation performance and the model's attributes and resources (accuracy, number of parameters and input size), measured by Spearman correlation. Positive correlations indicate good utilization of resources for uncertainty estimation. Architecture AUROC & Accuracy -ECE & Accuracy AUROC & #Parameters -ECE & #Parameters AUROC & Input Size -ECE & Input Size # Models Evaluated EfficientNet ResNet ViT XCiT distilled XCiT ViT* SE ResNet EfficientNetV2 NFNet Inception RegNetY RegNetX CaiT distilled DLA MobileNetV3 Res2Net CLIP Zero-Shot CLIP + Linear Probe VGG RepVGG BiT ResNeXt ResNet RS MixConv DenseNet HardCoReNAS Swin ECANet Twins SWSL ResNet GENet SSL ResNet TResNet CoaT LeViT distilled ResMLP MobileNetV2 ViT* Distilled PiT distilled PiT WSP ResNeXt ResMLP distilled MnasNet -0.16 -0.28 0.84 0.60 -0.68 0.23 -0.46 -0.70 0.56 -0.29 -0.03 0.20 0.44 0.64 0.37 -0.70 1.0 0.88 0.81 -0.71 -0.33 -0.96 0.00 -0.11 0.43 -0.60 0.71 -0.20 -0.26 0.94 0.50 0.14 0.10 -0.10 0.60 0.20 -0.30 0.8 1.00 -0.40 1.00 0.80 0.40 -0.29 -0.22 -0.17 0.09 0.89 0.38 -0.02 -0.45 0.78 0.09 -0.98 -0.96 -0.87 -0.90 0.59 0.27 -0.63 0.26 -0.98 0.50 -0.81 0.39 0.79 0.89 -0.14 0.26 0.14 0.60 0.94 -0.89 -1.00 -1.00 -0.30 0.90 -0.90 1.00 0.00 -1.0 -1.00 1.00 0.80 0.20 0.20 -0.22 0.16 0.50 0.35 -0.79 -0.04 -0.53 -0.63 0.63 -0.43 0.27 0.20 0.35 0.77 0.42 -0.68 0.9 0.71 0.71 -0.57 -0.20 -0.22 -0.18 -0.24 0.72 -0.49 0.77 -0.43 -0.14 0.77 0.50 0.26 0.53 -0.10 0.60 0.15 -0.21 0.71 1.00 -0.40 1.00 0.80 0.63 -0.29 0.03 -0.67 0.02 0.94 0.41 0.20 -0.47 0.81 0.30 -0.86 -0.96 -0.87 -0.90 0.60 0.60 -0.8 0.1 -0.90 0.21 -0.85 -0.30 0.82 0.86 0.12 0.37 0.26 0.37 0.89 -0.83 -1.00 -0.94 0.53 0.50 -0.90 0.97 0.10 -0.77 -1.00 1.00 0.80 0.20 0.95 -0.26 -0.40 0.04 0.51 - 0.14 -0.02 -0.59 0.48 -0.08 - - 0.58 - - - 0.55 0.19 - - -0.46 - -0.30 - - - 0.41 0.83 - - 0.87 - -0.58 - - - - 0.22 - - - - - -0.38 -0.44 -0.13 0.12 - -0.12 -0.35 -0.40 0.60 0.23 - - -0.50 - - - -0.58 -0.27 - - -0.25 - 0.82 - - - 0.00 0.37 - - -0.87 - -0.87 - - - - -0.77 - - - - - 50 33 31 28 28 26 18 15 13 13 12 12 10 10 10 9 9 8 8 8 8 7 7 7 6 6 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 4 4 use a smaller batch size of 2048 or lower. One could argue, however, that a two-fold increase in batch size is not sufficient to explain the huge gaps in performance measured. K Evaluations of the zero-shot language–vision CLIP model In this section we describe how we use CLIP model and extract confidence signals from it during inference. To evaluate CLIP on ImageNet, we first prepare it following the code provided by its authors (https://github.com/openai/CLIP): The labels of ImageNet-1k are encoded into normalized embedding vectors. At inference time, the incoming image is encoded into another normalized embedding vector. A cosine similarity is then calculated between each label embedding vector and the image embedding vector, and lastly, softmax is applied. The highest score is then taken as the confidence score for that prediction. We also evaluate the same models when adding a trained "linear-probe" to them (as described in Radford et al. (2021), which is essentially a logistic regression head), that results in a large boost in their accuracy. L Effects of the model's accuracy, number of parameters and input size on uncertainty estimation performance Table 2 shows the relationship between uncertainty estimation performance and model attributes and resources (accuracy, number of parameters and input size), measured by Spearman correlation. We measure uncertainty estimation performance by AUROC (higher is better) and -ECE (higher is better). Positive correlations indicate good utilization of resources for uncertainty estimation (for example, a positive correlation between -ECE and the number of parameters indicates that as the number of parameters increases, the calibration improves). An interesting observation is that distillation can drastically change the correlation between a resource and the uncertainty estimation performance metrics. For example, undistilled XCiTs have a Spearman correlation of -0.79 between their number of parameters and AUROC, indicating that more parameters are correlated with lower ranking performance, while distilled XCiTs have a correlation of 0.35 between the two. 25 Table 3: Comparing using MC dropout to softmax-response (vanilla). Method Accuracy AUROC Architecture MobileNetV3 Large MobileNetV3 Small MobileNetV2 VGG11 VGG11 (no BatchNorm) VGG13 VGG13 (no BatchNorm) VGG16 VGG16 (no BatchNorm) VGG19 VGG19 (no BatchNorm) Vanilla MC dropout Vanilla MC dropout Vanilla MC dropout Vanilla MC dropout Vanilla MC dropout Vanilla MC dropout Vanilla MC dropout Vanilla MC dropout Vanilla MC dropout Vanilla MC dropout Vanilla MC dropout 74.04 74 67.67 67.55 71.88 71.81 70.37 70.21 69.02 68.95 71.59 71.43 69.93 69.71 73.36 73.33 71.59 71.47 74.22 74.17 72.38 72.37 86.88 86.14 86.2 84.54 86.05 84.68 86.31 84.3 86.19 83.94 86.3 84.37 86.24 84.3 86.76 85.02 86.63 84.97 86.52 85.06 86.55 84.99 M Evaluations of Monte Carlo Dropout ranking performance MC Dropout (Gal & Ghahramani, 2016) is computed using several dropout-enabled forward passes to produce uncertainty estimates. In classification, the mean softmax score of these passes, is calculated, and then a predictive entropy score is used as the final uncertainty estimate. In our evaluations, we use 30 dropout-enabled forward passes. We do not measure MC Dropout's effect on ECE since entropy scores do not reside in [0, 1]. We test this technique using MobileNetV3 (Howard et al., 2019), MobileNetv2 (Sandler et al., 2018) and VGG (Simonyan & Zisserman, 2015), all trained on ImageNet and taken from the PyTorch repository (Paszke et al., 2019). The results comparing these models with and without using MC dropout are provided in Table 3. The table shows that using MC dropout causes a consistent drop in both AUROC and selective performance compared with using the same models with softmax as the κ. These results are also visualized in comparison to other methods in Figure 4a in Section 3. MC dropout underperformance in an ID setting was also previously observed in Geifman & El-Yaniv (2017). 26
http://arxiv.org/abs/2302.11870v1
2023-02-23T09:16:54
2023-02-23T09:16:54
Adaptive Sampling for Probabilistic Forecasting under Distribution Shift
The world is not static: This causes real-world time series to change over time through external, and potentially disruptive, events such as macroeconomic cycles or the COVID-19 pandemic. We present an adaptive sampling strategy that selects the part of the time series history that is relevant for forecasting. We achieve this by learning a discrete distribution over relevant time steps by Bayesian optimization. We instantiate this idea with a two-step method that is pre-trained with uniform sampling and then training a lightweight adaptive architecture with adaptive sampling. We show with synthetic and real-world experiments that this method adapts to distribution shift and significantly reduces the forecasting error of the base model for three out of five datasets.
[ "Luca Masserano", "Syama Sundar Rangapuram", "Shubham Kapoor", "Rajbir Singh Nirwan", "Youngsuk Park", "Michael Bohlke-Schneider" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11870v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11870v1", "@rel": "related", "@type": "application/pdf" } ]
[ "Workshop on Distribution Shifts, 36th Conference on Neural\n Information Processing Systems (NeurIPS 2022)" ]
{ "@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 0 7 8 1 1 . 2 0 3 2 : v i X r a Adaptive Sampling for Probabilistic Forecasting under Distribution Shift Luca Masserano∗ Department of Statistics Carnegie Mellon University [email protected] Syama Sundar Rangapuram† AWS AI Labs [email protected] Shubham Kapoor AWS AI Labs [email protected] Rajbir Singh Nirwan∗ D2S Inc. [email protected] Youngsuk Park AWS AI Labs [email protected] Michael Bohlke-Schneider AWS AI Labs [email protected] Abstract The world is not static: This causes real-world time series to change over time through external, and potentially disruptive, events such as macroeconomic cycles or the COVID-19 pandemic. We present an adaptive sampling strategy that selects the part of the time series history that is relevant for forecasting. We achieve this by learning a discrete distribution over relevant time steps by Bayesian optimization. We instantiate this idea with a two-step method that is pre-trained with uniform sampling and then training a lightweight adaptive architecture with adaptive sam- pling. We show with synthetic and real-world experiments that this method adapts to distribution shift and significantly reduces the forecasting error of the base model for three out of five datasets. 1 Introduction Time series forecasting uses historical data to forecast the evolution of a time series to assist decision making in several domains, for example retail [24, 5, 32], electric load planning [30, 13], cloud computing management [25, 26], or labor planning [3]. Most time series forecasting algorithms make the assumption that the data distribution does not change over time. However, this is violated in practice where real-world time series data is affected by drifts such as evolving customer demand or disruptive events (like the COVID-19 pandemic). These distribution shifts will inevitably be part of the time series history and therefore forecasting algorithms need to be able to account for them. Distribution shifts can occur with different (possibly reoccurring) patterns, but likely result in higher test error because the train and test distribution differs. Thus, only a subset of the time series history might come from the same distribution as the test set. Driven by this observation, we propose an adaptive sampling mechanism that explicitly feeds the model with inputs from the history that are only relevant for forecasting in the current (most recent) distribution. Instead of sampling uniformly over the history, our method learns a discrete distribution over past time steps and explicitly allows continuous adaptation, so that the model can react and adapt to distribution shifts. Our contribution is an adaptive sampling mechanism that learns the sampling distribution over time steps via gradient-free Bayesian optimization. We propose a two-step framework where the forecasting model is pre-trained with uniform sampling and then a lightweight architecture is trained with adaptive sampling. We evaluate the properties and performance of this approach with experiments Workshop on Distribution Shifts, 36th Conference on Neural Information Processing Systems (NeurIPS 2022). ∗Work done while at AWS AI Labs †Correspondence to: [email protected] Figure 1: Data distribution shift that our model can address. Each frame shows an indicator function plotted over time with respect to an assumed "standard" distribution (a value of 1 indicates a distribution shift). The red dashed line separates the past (i.e., the training set) from the future (i.e. test set). a) New or reoccurring shift: the distribution over time steps should focus on the shifted regions. b) This case is complementary to the previous one: here the distribution over time steps should exclude the shifted regions. c) The shift occurs in the forecasting window but not in the most recent region before the forecast start date: our model needs to wait until part of the shift is in the training set in order to be able to adapt to it. on synthetic and real-world data. This paper is organized as follows: Section 2 introduces the reader to the background of this paper and the types of data distribution shifts for forecasting that we address. and Section 3 introduces our method and we present experiments in Section 4. Section 5 concludes the paper. Note that the discussion of the related work can be found in Section A.1 in the Appendix. 2 Background Notation We denote the value of time series i at time t by zi,t, where zi,t ∈ R, and corresponding time-varying covariates as xi,t ∈ Rd. The past of each time series (i.e., training set) is denoted as zi,1:T := (zi,1, . . . , zi,T ), and the future (i.e., forecasting window or test set) as zi,T +1:T +τ := (zi,T +1, . . . , zi,T +τ ). The number of time series in the dataset is denoted by N . Our main assumption in this work is that we are able to observe at least some of the forthcoming shift in order to be able to react and adapt to it: Assumption 1 Let c be a constant number of (past) time steps set a priori. We assume that there is no (marginal) distribution shift between the most recent training window of c steps and the forecasting (test) window. More precisely, let zi,t be the given time series at time t and let ̄zi,t be the time series at time t obtained after removing trend, seasonalities and other effects of available features, then p( ̄zi,T −c) = * * * = p( ̄zi,T ) = p( ̄zi,T +1) = * * * = p( ̄zi,T +τ ), ∀i = 1, . . . , N. (1) This assumption implies that the data with t ∈ [T − c, T ] is the closest in time to the forecasting window, therefore it is reasonable to regard it as the most similar to the future. In practice, we take c to be equal to the sum of context and prediction lengths, so that we can use {zi,T −c:T }N i=1 as a validation set to learn and adapt to any distribution shift. In general, we consider the following two scenarios illustrated in Figure 1): (a) A new or reoccurring shift in the past and no shift between the recent training and test window; and (b) a shift that occurred in the past but reverted back to the "standard" regime. Note that we do not address the case where the distribution shift occurs in the test window only, which would be more of a fundamental generalization problem (case (c) in Figure 1). See Section A.2 in the Appendix for a detailed definition of the cases that we consider. 3 Our Method Training of deep learning models in time series settings is usually done by sampling fixed-size windows uniformly at random over the available time series history (i.e., the past). Since distribution shifts happen with different (possibly reoccurring) patterns over time, uniform sampling over the training set would likely feed the algorithm with irrelevant or even misleading data to forecast in the current distribution regime. Therefore we propose to adaptively generate these training windows depending on the regime of the validation set (and by Assumption 1, the test set). The key element of our approach is automatically learning which regions to focus on to accurately forecast the test set. 2 Figure 2: Schematic descrip- the two-step proce- tion of dure. i) Pre-train the full model with uniform sampling; ii.a) use Bayesian optimization to find the optimal φ(cid:63); ii.b) use φ(cid:63) to train the lightweight architecture with adaptive sampling. To achieve this, we introduce a discrete distribution pφ(*) over time steps 1, . . . , T that determines the probability of sampling a training window starting at a time point t. In practice, pφ(*) can be any discrete distribution that is well defined over integers, such as Geometric, Negative Binomial, Poisson, or mixtures of these distributions, parameterized by φ. This distribution is responsible for sampling time windows that are used to train our forecasting model (see Figure A.1 in the Appendix for an illustration). We learn φ by minimizing validation loss of the model that is trained using examples generated according to pφ(*). Ideally, the learned distribution parameters φ(cid:63) will avoid sampling distribution shifts in history that do not correspond to the current regime. This distribution replaces uniform sampling over the history, which cannot distinguish between distribution shifts and normal regions. However, our model should fall back to uniform sampling if this results in lowest validation error. This suggests that no distribution shift is present in the validation window and consequently in the forecast window (by Assumption 1). Adaptive training of a lightweight architecture In practice, we would expect to frequently re- estimate φ(cid:63) to adapt to the current distribution. To address this, we propose a two-step procedure with a lightweight adaptive architecture that is fast to train and can be frequently re-trained. In this sense, this approach is explicitly considering a notion of time-varying parameters. i) The model is pre-trained using uniform sampling over the whole training history. Intuitively, this step aims at learning common features that are useful everywhere in time. ii) After freezing the weights of the pre-trained model, an adaptive lightweight architecture is attached and trained using the adaptive sampling mechanism, where the training windows are generated according to pφ∗ (*). The goal of this step is to learn time-specific features that are relevant to forecast in the current distribution. The lightweight architecture can be a short sequence of fully connected layers, or it can even be a subset of the pre-trained model. Learn φ via Bayesian Optimization We now describe how we estimate the parameters φ of the distribution pφ(*). Let us denote the parameters of the pre-trained model as wpre and those of the lightweight architecture as wada. Moreover, let fw({zi,1:T }) denote the forecasts {ˆzi,T +1:T +τ } of the model whose weights are given by w. Given input time series {zi,t}, i = 1, . . . , N and t = 1, . . . , T , we set aside the last τ observations {zi,T −τ +1:T }, ∀i, for estimating φ. We learn φ by minimizing loss on this validation channel of the model trained according to pφ(*). More precisely, we have φ∗ = argmin (cid:96)(φ), φ where (cid:96)(φ) is the validation loss of the model that is trained using adaptive sampling pφ(*), (cid:96)(φ) = loss (cid:16) fwpre∪w∗ ada(φ) (cid:17) (cid:0){zi,1:T −τ }(cid:1), {zi,T −τ +1:T } . Here w∗ ada(φ) are the weights obtained after fine-tuning the pre-trained model on the input data {zi,1:T −τ } where the training examples are generated according to the distribution pφ(*); note the dependence of w∗ ada on φ. A crucial observation is that one can only evaluate (cid:96)(φ) and cannot obtain its gradients with respect to φ; hence we cannot train (wada, φ) jointly end-to-end. We propose to treat φ as hyper-parameters and use Bayesian optimization [9] to find φ∗. Assumption 1 plays a key role in this step because the most recent region in the training set is used as validation channel to choose φ(cid:63) during Bayesian optimization. The overall approach is depicted in Figure 2 and the implementation details with DeepAR [28] as the base model are given in Algorithm 1. In our experiments we assume wada ⊂ wpre and hence the algorithm is presented for this case. 3 Figure 3: Experiments with synthetic data. a) Synthetic data with injected shift (top) and noise (bottom). b1) (top case in a): Adaptive sampling focuses on the shifted region in the past (red and green bars denote the shifted region) that is relevant for the current regime. b2 (bottom case in a): Adaptive sampling avoids the injected noise shifts. Algorithm 1 Adaptive DeepAR 1: procedure Ada-DeepAR({zi,t}, i ∈ [1 .. N ], t ∈ [1 .. T ]) 2: 3: Ztrain = {zi,t}, ∀i, ∀t wpre ← DeepAR(Ztrain) (cid:46) Standard training with uniform train sampler (cid:46) Random initialization 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: Zada_train = {zi,t}, ∀i, t ∈ [1 .. T − τ ] Zvalidation_labels = {zi,t}, ∀i, t ∈ [T − τ + 1 .. T ] φ = φ0 w = wpre Split w into wada and wfrozen while CONVERGENCE do (cid:46) Solve minφ (cid:96)(φ) wada ← DeepAR(Zada_train, init = w, sampler = pφ(*), fixed = wfrozen) (cid:46) Train with adaptive train sampler by fixing weights wfrozen w = wada ∪ wfrozen ˆZvalidation_preds = forecast(Zada_train, model = w) (cid:96)(φ) = loss( ˆZvalidation_preds, Zvalidation_labels) update φ based on the new evaluation (cid:96)(φ) end while (cid:46) Bayesian Optimization (cid:46) pφ(*) likely has more mass on indices t that help predict Zvalidation_labels accurately (cid:46) Model is ready to predict {zi,t}, ∀i, t ∈ [T + 1 .. T + τ ] return w 16: 17: end procedure 4 Experiments The instantiation of our model in this manuscript is called Ada-DeepAR and uses DeepAR [28] as a base model with a two-layer LSTM (other base models could be used). The adaptive part of our model is the second LSTM layer. Additionally, we perform Bayesian optimization using MOBSTER, which combines asynchronous successive halving and asynchronous Hyperband with gaussian-process based Bayesian optimization [17]. We use the implementation available in Syne Tune [29]. For any time series i with training history T and forecast horizon τ , we use zi,T −τ :T as a validation channel for Bayesian optimization. We consider a geometric and a mixture of two negative binomial distributions as our sampling distributions pφ(*). Training details are given in Section A.4. Experiments on synthetic data: To demonstrate the applicability of our method, we first evaluate it on two synthetic experiments that mimic cases (a) and (b) of Figure 1. We generated an artificial sinusoidal dataset and then injected shifts or noise in different regions. Focus on shifted regions distant in time: In this example we injected a shift in a distant portion of the training dataset and also in the validation and test sets (see the top of panel a) in Figure 3). We show that the sampling distribution over time steps can focus on specific regions that are relevant to the current domain, regardless of when they occurred in the available history (see b1) in Figure 3). Exclude noisy regions: In this example, we injected noise (a negative constant) in two different regions of the training dataset. Our adaptive sampling mechanism avoids these noisy regions from the history (b2) in Figure 3). Interestingly, this sometimes corresponds to sampling only in the most recent window, while in other cases the distribution exploits its bimodality to focus on two distant windows. 4 Ada-DeepAR-uniform (ablation) RevIn DeepAR TFT Dataset Covid-deaths Electricity Traffic Solar Taxi Ada-DeepAR (ours) 0.074∗±0.013 0.048∗†±0.002 0.172±0.002 0.370∗†±0.003 0.286†±0.003 0.088±0.011 0.054†±0.005 0.171±0.004 0.376†±0.003 0.278∗†±0.001 Mean nCRPS Mean Rank 0.190 1.8 0.193 1.8 0.13±0.006 0.063±0.005 0.172±0.003 0.376±0.004 0.288±0.004 0.103±0.053 0.062±0.011 0.176±0.004 0.388±0.007 0.279±0.004 0.053±0.061 0.082±0.000 0.306±0.050 0.562±0.015 0.509±0.001 0.202 3.4 0.206 3.4 0.302 4.2 Table 1: The nCRPS loss (lower is better) for all datasets and models. We average over ten runs and report the mean and standard deviation. We took the results for TFT from TSBench [4], which only uses two runs. Boldface numbers indicate that the differences in error between the best and the second-best method are statistically significant (paired t-test p-value < 0.05). * indicates a statistically significant result when comparing Ada-DeepAR and Ada-DeepAR-uniform. † indicates a statistically significant result when comparing Ada-DeepAR or Ada-DeepAR-uniform to its base model DeepAR. Experiments on real-world datasets: Finally, we show preliminary results on five real-world datasets (see Section A.3 for details). We compare the following models: our two-step training procedure with adaptive sampling (Ada-DeepAR), reversible instance normalization (RevIn) [16], and the attention-based Temporal Fusion Transformer TFT [20]. We also consider an ablation variant of our method, Ada-DeepAR-uniform, which uses the same architecture and two-step procedure as Ada-DeepAR, but performs adaptive training (i.e., fine-tuning of the adaptive weights wada) using uniform sampling instead of pφ(*). This variant is included to highlight the effectiveness of learning the sampling distribution pφ by isolating the gains obtained by our model due to the fine-tuning step. For Ada-DeepAR, Ada-DeepAR-uniform and RevIn we use DeepAR[28] as the base model. Ada-DeepAR-uniform is different from DeepAR because of the fine-tuning step where adaptive weights are again trained one more time; this might help correcting the overfitting of the DeepAR model (and reduce test error) because of the lower capacity of adaptive weights and/or help es- cape local minima (and reduce training loss). We evaluate these probabilistic methods using the continuous-ranked probability score (CRPS) [11, 23]. Table 1 summarizes the results. Averaged over all datasets, Ada-DeepAR improves over the base model DeepAR by 8.4% (relative improvement). For three out of five datasets, the improvements over the base model are statistically significant (paired Student's t-test p-value < 0.05, see Table 1). Ada-DeepAR selected the mixture of two negative binomial distributions for all datasets except Covid-deaths (for which the geometric distribution was selected). RevIn also improves over DeepAR, but with a much smaller margin. TFT performs best on Covid-deaths, but overall worse than the other methods on these datasets. Inter- estingly, Ada-DeepAR-uniform also improves the error by 6.7% over its base model. In particular, Ada-DeepAR-uniform is the best model on the Traffic and Taxi datasets. Our hypothesis is that adaption to distribution shift is not necessary, and perhaps even counterproductive, for these datasets. This is also suggested by the performance of RevIn, which performs similar to Ada-DeepAR on these datasets. Note that a uniform distribution could be seen as one of the possible distributions pφ(*) that our adaptive architecture should consider and if no other distribution reduces the validation error, the uniform distribution should be selected. The performance differences between Ada-DeepAR and Ada-DeepAR-uniform are statistically significant for all datasets except Traffic. 5 Conclusion We introduced an adaptive sampling mechanism over the training history, whose parameters are learned using Bayesian optimization. Our experiments show that our method can improve the forecasting error over its base model (in this work, the improvements over the base model where statistically significant for three out of five datasets). While we find Bayesian optimization to be a powerful technique to find good adaptive sampling parameters, this approach is computationally expensive (because many parallel trials need to be evaluated) and could degrade as the number of parameters increases. Re-framing our approach as an input-selection layer that uses the re- parametrization trick for sampling could allow for cheaper end-to-end learning of the adaptive model parameters and pφ(*). 5 References [1] Alexander Alexandrov, Konstantinos Benidis, Michael Bohlke-Schneider, Valentin Flunkert, Jan Gasthaus, Tim Januschowski, Danielle C Maddix, Syama Sundar Rangapuram, David Salinas, Jasper Schulz, et al. Gluonts: Probabilistic and neural time series modeling in python. J. Mach. Learn. Res., 21(116):1–6, 2020. [2] Sercan O Arik, Nathanael C Yoder, and Tomas Pfister. Self-adaptive forecasting for improved deep learning on non-stationary time-series. arXiv preprint arXiv:2202.02403, 2022. [3] Michael Bohlke-Schneider, Shubham Kapoor, and Tim Januschowski. Resilient neural fore- In Proceedings of the Fourth International Workshop on Data Manage- casting systems. ment for End-to-End Machine Learning, DEEM'20, New York, NY, USA, 2020. Association for Computing Machinery. ISBN 9781450380232. doi: 10.1145/3399579.3399869. URL https://doi.org/10.1145/3399579.3399869. [4] Oliver Borchert, David Salinas, Valentin Flunkert, Tim Januschowski, and Stephan Günnemann. Multi-objective model selection for time series forecasting, 2022. URL https://arxiv.org/ abs/2202.08485. [5] J. D. Croston. Forecasting and stock control for intermittent demands. Journal of the Operational Research Society, 23(3):289–303, Sep 1972. ISSN 1476-9360. doi: 10.1057/jors.1972.50. URL https://doi.org/10.1057/jors.1972.50. [6] Ensheng Dong, Hongru Du, and Lauren Gardner. An interactive web-based dashboard to track COVID-19 in real time. The Lancet Infectious Diseases, 20(5):533–534, May 2020. ISSN 1473-3099. doi: 10.1016/S1473-3099(20)30120-1. URL https://doi.org/10.1016/ S1473-3099(20)30120-1. Publisher: Elsevier. [7] Yuntao Du, Jindong Wang, Wenjie Feng, Sinno Pan, Tao Qin, Renjun Xu, and Chongjun Wang. Adarnn: Adaptive learning and forecasting of time series. In Proceedings of the 30th ACM International Conference on Information & Knowledge Management, pages 402–411, 2021. [8] Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http://archive. ics.uci.edu/ml. [9] Peter I Frazier. A tutorial on bayesian optimization. arXiv preprint arXiv:1807.02811, 2018. [10] Everette S Gardner Jr. Exponential smoothing: The state of the art. Journal of forecasting, 4(1): 1–28, 1985. [11] Tilmann Gneiting and Adrian E Raftery. Strictly proper scoring rules, prediction, and estimation. Journal of the American Statistical Association, 102(477):359–378, 2007. doi: 10.1198/ 016214506000001437. URL https://doi.org/10.1198/016214506000001437. [12] Rakshitha Godahewa, Christoph Bergmeir, Geoffrey I. Webb, Rob J. Hyndman, and Pablo Montero-Manso. Monash time series forecasting archive. In Neural Information Processing Systems Track on Datasets and Benchmarks, 2021. [13] Tao Hong, Jingrui Xie, and Jonathan Black. Global energy forecasting competition 2017: Hierarchical probabilistic load forecasting. International Journal of Forecasting, 35(4):1389 – 1399, 2019. [14] Jiayuan Huang, Arthur Gretton, Karsten Borgwardt, Bernhard Schölkopf, and Alex Smola. Correcting sample selection bias by unlabeled data. In B. Schölkopf, J. Platt, and T. Hoffman, editors, Advances in Neural Information Processing Systems, vol- ume 19. MIT Press, 2006. URL https://proceedings.neurips.cc/paper/2006/file/ a2186aa7c086b46ad4e8bf81e2a3a19b-Paper.pdf. [15] Rolf Isermann. Adaptive Control Systems (A Short Review), pages 127–140. Springer ISBN 978-3-642-86420-9. doi: 10.1007/ Berlin Heidelberg, Berlin, Heidelberg, 1991. 978-3-642-86420-9_12. URL https://doi.org/10.1007/978-3-642-86420-9_12. 6 [16] Taesung Kim, Jinhee Kim, Yunwon Tae, Cheonbok Park, Jang-Ho Choi, and Jaegul Choo. Reversible instance normalization for accurate time-series forecasting against distribution shift. In International Conference on Learning Representations, 2021. [17] Aaron Klein, Louis C. Tiao, Thibaut Lienart, Cedric Archambeau, and Matthias Seeger. Model- based asynchronous hyperparameter and neural architecture search, 2020. URL https:// arxiv.org/abs/2003.10865. [18] Guokun Lai, Wei-Cheng Chang, Yiming Yang, and Hanxiao Liu. Modeling long- and short- term temporal patterns with deep neural networks. CoRR, abs/1703.07015, 2017. URL http://arxiv.org/abs/1703.07015. [19] Fengpei Li, Henry Lam, and Siddharth Prusty. Robust importance weighting for covariate In Silvia Chiappa and Roberto Calandra, editors, Proceedings of the Twenty Third shift. International Conference on Artificial Intelligence and Statistics, volume 108 of Proceedings of Machine Learning Research, pages 352–362. PMLR, 26–28 Aug 2020. URL https: //proceedings.mlr.press/v108/li20b.html. [20] Bryan Lim, Sercan Ö. Arık, Nicolas Loeff, and Tomas Pfister. Temporal fusion transformers for interpretable multi-horizon time series forecasting. International Journal of Forecasting, 37(4): 1748–1764, 2021. ISSN 0169-2070. doi: https://doi.org/10.1016/j.ijforecast.2021.03.012. URL https://www.sciencedirect.com/science/article/pii/S0169207021000637. [21] Linbo Liu, Youngsuk Park, Trong Nghia Hoang, Hilaf Hasson, and Jun Huan. Towards robust multivariate time-series forecasting: Adversarial attacks and defense mechanisms. arXiv preprint arXiv:2207.09572, 2022. [22] Yucheng Lu, Youngsuk Park, Lifan Chen, Yuyang Wang, Christopher De Sa, and Dean Foster. Variance reduced training with stratified sampling for forecasting models. In International Conference on Machine Learning, pages 7145–7155. PMLR, 2021. [23] James E. Matheson and Robert L. Winkler. Scoring rules for continuous probability distributions. Management Science, 22(10):1087–1096, 1976. ISSN 00251909, 15265501. URL http: //www.jstor.org/stable/2629907. [24] Srayanta Mukherjee, Devashish Shankar, Atin Ghosh, Nilam Tathawadekar, Pramod Kompalli, Sunita Sarawagi, and Krishnendu Chaudhury. ARMDN: Associative and recurrent mixture density networks for retail demand forecasting. arXiv preprint arXiv:1803.03800, 2018. [25] Youngsuk Park, Kanak Mahadik, Ryan A Rossi, Gang Wu, and Handong Zhao. Linear quadratic regulator for resource-efficient cloud services. In Proceedings of the ACM Symposium on Cloud Computing, pages 488–489, 2019. [26] Youngsuk Park, Ryan Rossi, Zheng Wen, Gang Wu, and Handong Zhao. Structured policy iteration for linear quadratic regulator. In International Conference on Machine Learning, pages 7521–7531. PMLR, 2020. [27] Dominique Picard. Testing and estimating change-points in time series. Advances in Applied Probability, 17(4):841–867, 1985. doi: 10.2307/1427090. [28] David Salinas, Valentin Flunkert, Jan Gasthaus, and Tim Januschowski. Deepar: Probabilistic forecasting with autoregressive recurrent networks. International Journal of Forecasting, 36(3): 1181–1191, 2020. [29] David Salinas, Matthias Seeger, Aaron Klein, Valerio Perrone, Martin Wistuba, and Cedric Archambeau. Syne tune: A library for large scale hyperparameter tuning and reproducible research. In First Conference on Automated Machine Learning (Main Track), 2022. [30] Harshit Saxena, Omar Aponte, and Katie T. McConky. A hybrid machine learning model for forecasting a billing period's peak electric load days. International Journal of Forecasting, 35 (4):1288 – 1303, 2019. ISSN 0169-2070. doi: https://doi.org/10.1016/j.ijforecast.2019.03.025. URL http://www.sciencedirect.com/science/article/pii/S016920701930144X. 7 [31] Masashi Sugiyama, Shinichi Nakajima, Hisashi Kashima, Paul Buenau, and Motoaki Kawanabe. Direct importance estimation with model selection and its application to covariate shift adapta- tion. In J. Platt, D. Koller, Y. Singer, and S. Roweis, editors, Advances in Neural Information Processing Systems, volume 20. Curran Associates, Inc., 2007. URL https://proceedings. neurips.cc/paper/2007/file/be83ab3ecd0db773eb2dc1b0a17836a1-Paper.pdf. [32] Elham Taghizadeh. Utilizing artificial neural networks to predict demand for weather-sensitive products at retail stores. arXiv preprint arXiv:1711.08325, 2017. [33] NYC Taxi and Limousine Commission. TLC trip record data. https://www1.nyc.gov/ site/tlc/about/tlc-trip-record-data.page, 2015. [34] Olivia Wiles, Sven Gowal, Florian Stimberg, Sylvestre-Alvise Rebuffi, Ira Ktena, Krish- namurthy Dj Dvijotham, and Ali Taylan Cemgil. A fine-grained analysis on distribu- In International Conference on Learning Representations, 2022. URL https: tion shift. //openreview.net/forum?id=Dl4LetuLdyK. [35] TaeHo Yoon, Youngsuk Park, Ernest K Ryu, and Yuyang Wang. Robust probabilistic time series forecasting. In International Conference on Artificial Intelligence and Statistics, pages 1336–1358. PMLR, 2022. 8 A Appendix A.1 Related Work The problem of learning under distribution shift for time series has been extensively studied for many years. For example, change point detection analyzes when the statistical distribution of a time series changes [27]. Another related field is adaptive control, where the system parameters are continuously adjusted to account for discrepancies of expected and observed data [15]. We focus our review on recent methods that address distribution shifts when forecasting with neural networks. Kim et al. [16] employs a trainable instance-wise normalization-and-denormalization layer to address non-stationary mean and variance in time series forecasting. Arik et al. [2] proposes Self-Adaptive Forecasting to adapt the forecasting model using test-time training by "backcasting" and using the backcast errors to signal a potential distribution shift to adjust the weights of the model before inference. AdaRNN [7] splits the time series history into dissimilar segments and learns importance weights to combine the RNN hidden states over these segments. Another notion of distribution shift, adversarial attacks, has been recently considered to build more robust forecasting [35, 21]. Another class of approaches to time series forecasting use specific weighting schemes to weight the time series history to make predictions, for example exponential smoothing, the Non-Parametric Time Series (NPTS) Forecaster [10, 1], or stratified sampling [22]. In contrast to these models, our approach adaptively learns the weighting scheme over the history. Thus, our work can be seen as a specific instantiaten of weighted re-sampling (or importance sampling) for time-series forecasting. Importance sampling weights the log-likelihood in supervised learning tasks by importance weights w(x) = ptest(x)/ptrain(x) where ptest and ptrain are the respective densities from which the train/test samples are drawn [31, 14, 34, 19]. Here, we propose to avoid estimating ptrain and ptest and instead tune the parameters of a parametric re-sampling function using Bayesian optimization. A.2 Scenarios of distribution shift occurrence Assumption 1 allows us to provide a precise breakdown of the specific cases of distribution shift that our model can handle. This is important because it determines the exact applicability of the work described in this paper. As Figure 1 shows, we identify three domains: New or reoccurring shift: When a distribution shift is new or reoccurring in the past and there is no shift between t ∈ [T − c, T ] and t ∈ [T + 1, T + τ ]. In this case the adaptive sampling mechanism is expected to focus only on the shifted regions that are relevant for the current regime. Reverted shift: When a shift occurred in the past but the distribution eventually reverted back to the "standard" regime. This case is complementary to the previous one: here the adaptive sampling mechanism provides a way to exclude the shifted regions. One can see the shifts in this case as regions with noisy or corrupted data: excluding them during training would guarantee robustness against noise. Future shift: When the shift occurs in the forecasting window but not in the most recent region before the forecast start date. Our adaptive sampling mechanism cannot work if we have no information regarding the distribution shift happening in the test set (no free lunch).3 A.3 Datasets We use datasets from the Monash Time Series Forecasting Repository [12] and GluonTS [1] for our experiments. We use the same train/test splits as described in TSBench [4]. See Table A.1 for dataset statistics. The frequencies of our used datasets are 30 minutes (30 MIN), hourly (H), and daily (D). In particular, we use the following datasets: Covid-deaths: Daily COVID-19 deaths of different countries between January 22 and August 21 2020 [6]. 3Note that in our setting we consider the forecasting window to be a mere continuation of the training set, which implies that the context window used at test time was part of training inputs. In this sense, our procedure cannot handle this case if and only if the shift happens solely in the forecasting range. 9 Freq. Horizon Number of Series Avg. Length Number of observations Covid-deaths Electricity Traffic Solar Taxi D H H H 30 MIN 30 24 48 24 24 227 321 862 137 1,214 182 21,044 17,496 7,009 1,488 41,314 6,755,124 15,081,552 960,233 1,806,432 Table A.1: Dataset statistics for the used datasets, taken from Borchert et al. [4]. Electricity: Hourly household consumption data between January 2012 and June 2014 [8]. Traffic: Hourly occupancy rates of freeways in the San Francisco Bay area between 2015 and 2017 [8]. Solar: Hourly power output of 137 photovoltaic power stations in the US [18]. Taxi: Number of taxi rides in different locations in New York sampled at 30 minute windows [33]. A.4 Training Details The parameters of the distribution over history are optimized via Bayesian Optimization [9] using the recent scalable implementation provided in Syne-Tune [29]. We leveraged an AWS EC2 instance with ≈ 42 cores and set the number of random initializations to 44 to allow for sufficient exploration of the parameter space. That is, the optimizer starts with 44 trials, each with a different parameter configuration, and sequentially stops some of them or instantiate new ones given the information from the Gaussian Process posterior. The optimizer stopping criterion was chosen to be the maximum number of trials taken to completion, which was set to 200. We used the CRPS used to decide which trials were stopped or continued was the mean quantile loss over the validation set. The lightweight architecture is supposed to be simple enough to allow frequent re-training through adaptive sampling, so that the forecasting model can quickly adapt to new distributions. Clearly, different architectures will work better with different datasets. In all our experiments with DeepAR [28], we found that using the default two-layer LSTM with 40 hidden units for the pre-trained model, and freezing the first layer only for adaptive training yielded the best results. To clarify, this means that wada ⊂ wpre. Both pre-training and adaptive training were done over 100 epochs with a small dropout probability equal to 0.1. For TFT, we selected the hyperparameter setting from the TSBench [4] that resulted in lowest CRPS loss on the validation set for each dataset. The hyperparameters tuned in TSBench are the context length, the number of hidden states, and the number of heads. For the DeepAR and TFT models, we use the implementation available in GluonTS [1]. A.5 Additional Figures 10 Figure A.1: Adaptive sam- pling uses pφ to sample training windows to come from distributions that are similar to the forecasting window. Both panels show a time series (blue) at the top, with windows (orange) sam- pled during training, and the distribution over time steps at the bottom. a) Uniform sam- pling. b) Adaptive sampling. 11
http://arxiv.org/abs/2302.11864v2
2023-03-07T15:01:39
2023-02-23T09:06:42
Grounding Graph Network Simulators using Physical Sensor Observations
Physical simulations that accurately model reality are crucial for many engineering disciplines such as mechanical engineering and robotic motion planning. In recent years, learned Graph Network Simulators produced accurate mesh-based simulations while requiring only a fraction of the computational cost of traditional simulators. Yet, the resulting predictors are confined to learning from data generated by existing mesh-based simulators and thus cannot include real world sensory information such as point cloud data. As these predictors have to simulate complex physical systems from only an initial state, they exhibit a high error accumulation for long-term predictions. In this work, we integrate sensory information to ground Graph Network Simulators on real world observations. In particular, we predict the mesh state of deformable objects by utilizing point cloud data. The resulting model allows for accurate predictions over longer time horizons, even under uncertainties in the simulation, such as unknown material properties. Since point clouds are usually not available for every time step, especially in online settings, we employ an imputation-based model. The model can make use of such additional information only when provided, and resorts to a standard Graph Network Simulator, otherwise. We experimentally validate our approach on a suite of prediction tasks for mesh-based interactions between soft and rigid bodies. Our method results in utilization of additional point cloud information to accurately predict stable simulations where existing Graph Network Simulators fail.
[ "Jonas Linkerhägner", "Niklas Freymuth", "Paul Maria Scheikl", "Franziska Mathis-Ullrich", "Gerhard Neumann" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11864v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11864v2", "@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.RO" ]
3 2 0 2 r a M 7 ] G L . s c [ 2 v 4 6 8 1 1 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 GROUNDING GRAPH NETWORK SIMULATORS USING PHYSICAL SENSOR OBSERVATIONS Jonas Linkerhägner1∗ Niklas Freymuth1 Paul Maria Scheikl1,2 Franziska Mathis-Ullrich1,2 Gerhard Neumann1 1Institute for Anthropomatics and Robotics, Karlsruhe Institute of Technology, Karlsruhe, Germany 2Department Artificial Intelligence in Biomedical Engineering, Friedrich-Alexander-University Erlangen-Nürnberg, Erlangen, Germany ABSTRACT Physical simulations that accurately model reality are crucial for many engineer- ing disciplines such as mechanical engineering and robotic motion planning. In recent years, learned Graph Network Simulators produced accurate mesh-based simulations while requiring only a fraction of the computational cost of traditional simulators. Yet, the resulting predictors are confined to learning from data gener- ated by existing mesh-based simulators and thus cannot include real world sensory information such as point cloud data. As these predictors have to simulate complex physical systems from only an initial state, they exhibit a high error accumulation for long-term predictions. In this work, we integrate sensory information to ground Graph Network Simulators on real world observations. In particular, we predict the mesh state of deformable objects by utilizing point cloud data. The resulting model allows for accurate predictions over longer time horizons, even under uncertainties in the simulation, such as unknown material properties. Since point clouds are usually not available for every time step, especially in online settings, we employ an imputation-based model. The model can make use of such additional infor- mation only when provided, and resorts to a standard Graph Network Simulator, otherwise. We experimentally validate our approach on a suite of prediction tasks for mesh-based interactions between soft and rigid bodies. Our method results in utilization of additional point cloud information to accurately predict stable simulations where existing Graph Network Simulators fail. 1 INTRODUCTION Mesh-based simulation of complex physical systems lies at the heart of many fields in numerical sci- ence and engineering (Liu et al., 2022; Reddy, 2019; Rao, 2017; Sabat & Kundu, 2021). Applications include structural mechanics (Zienkiewicz & Taylor, 2005; Stanova et al., 2015), electromagnet- ics (Jin, 2015; Xiao et al., 2022; Coggon, 1971), fluid dynamics (Chung, 1978; Zawawi et al., 2018; Long et al., 2021) and biomedical engineering (Van Staden et al., 2006; Soro et al., 2018), most of which traditionally depend on highly specialized task-dependent simulators. Recent advancements in deep learning brought rise to more general learned dynamic models such as Graph Network Simulators (GNSs) (Sanchez-Gonzalez et al., 2018; 2020; Pfaff et al., 2021). GNSs learn to predict the dynamics of a system from data by encoding the system state as a graph and then iteratively computing the dynamics for every node in the graph with a Graph Neural Network (GNN) (Scarselli et al., 2009; Battaglia et al., 2018; Wu et al., 2020b). Recent extensions include long-term fluid flow predictions (Han et al., 2022) and dynamics on different scales (Fortunato et al., 2022). Yet, these approaches assume full knowledge of the initial system state, making them ill-suited for applications ∗correspondence to [email protected] 1 Published as a conference paper at ICLR 2023 Figure 1: A robot's end-effector (grey, red) grasps a 3-dimensional deformable cavity. The robot maintains an internal simulated prediction of the cavity (orange) for two consecutive simulation steps (left, right). This prediction can deviate from the true state of the cavity over time due to an accumulation of error. However, the true cavity state can infrequently be observed from point cloud data (blue), which the model can use to correct its prediction. Here, the point cloud is used to contract the simulated cavity at the bottom and extend it at the top, causing the points to better align with the mesh surface. We repeat the point cloud from the earlier simulation step in both images for clarity. like model-predictive control (Camacho & Alba, 2013; Schwenzer et al., 2021) and model-based Reinforcement Learning (Polydoros & Nalpantidis, 2017; Moerland et al., 2020) where accurate predictions must be made based on partial initial states and observations. In this work, we present Grounding Graph Network Simulators (GGNSs), a new class of GNS that can process sensory information as input to ground predictions in the scene observations. More precisely, we extend the graph of the current system state with point cloud data before predicting the system dynamics from it. Since point clouds do not provide correspondences over time, it is difficult to learn dynamics from point clouds alone. Thus, we use mesh-based data to learn the general system dynamics and utilize point clouds to correct the predictions. As the sensory data is not always available, particularly not for future predictions, our architecture is trained with imputed point clouds, i.e., for each time step the model receives point clouds only with a certain probability. This training scheme allows the model to efficiently integrate the additional information whenever provided. During inference, the model iteratively predicts the next system state, using point clouds whenever available to greatly improve the simulation quality, especially for simulations with incomplete initial state information. Furthermore, our architecture addresses a critical research topic for GNSs by alleviating common challenges such as drift and error accumulation during long-term predictions. As a practical example, consider a robot grasping a deformable object. For optimal planning of the grasp, the robot needs to model the state of the deformable object over time and predict the influence of interactions between object and gripper. This prediction not only depends on the initial shape of the object, but also on the forces the robot applies, the kind of material to grasp and external factors such as the temperature, making it difficult to accurately predict how the material will deform over time. However, once the robot starts deforming the object, it may easily observe the deformations in the form of e.g., point clouds. These observations can then be integrated into the state prediction, i.e., they can ground the simulation whenever new information becomes available. An example is given in Figure 1. Such observation-aided prediction is similar in nature to e.g., Kalman Filters (Kalman, 1960; Jazwinski, 1970; Becker et al., 2019) as the belief of the system state is updated based on partial observations about the system. However, while Kalman Filters explicitly integrate novel information into the belief in a mathematical fashion, we instead simply provide this information to a learned model as additional unstructured sensor input. We evaluate GGNS on a suite of 2d and 3d deformation prediction tasks created in the Simulation Open Framework Architecture (SOFA) (Faure et al., 2012). Comparing our approach to an existing GNS (Pfaff et al., 2021), we find that adding sensory information in the form of point clouds to our model improves the simulation quality for all tasks. We investigate this behavior through extensive ablation studies, showing the importance of different parameter choices and design decisions. Code and data can be found under https://github.com/jlinki/GGNS. Our list of contributions is as follows: (I) We extend the GNS framework to include sensory infor- mation to ground predicted simulations in observations of the system state, allowing for accurate 2 Published as a conference paper at ICLR 2023 predictions of the full simulation. (II) We propose a simple but effective imputation training scheme that naturally integrates sensory information to GNSs whenever available without substantially increasing training cost or model complexity. (III) We construct and experiment on different defor- mation prediction tasks and find that the inclusion of sensory information improves performance in all settings, and that it is particularly crucial when the initial system state is not fully known. 2 RELATED WORK Learned Physics Simulation. In recent years there has been a steady increase in research concerning deep learning for physical simulations. Early work in physical reasoning aims at teaching systems to understand physical relations on N-body systems (Battaglia et al., 2016) and deformable ob- jects (Mrowca et al., 2018). A more direct approach is to instead train a learnable simulator from data provided by some existing ground truth simulator. Here, Convoluational Neural Networks (CNNs) have been extensively studied for fluid flow simulation (Tompson et al., 2017; Chu & Thuerey, 2017; Ummenhofer et al., 2020; Kim et al., 2019; Xie et al., 2018) and aerodynamic flow fields (Guo et al., 2016; Zhang et al., 2018; Bhatnagar et al., 2019). Further approaches use standard neural networks for liquid splash simulations (Um et al., 2018) and latent space physics simulation (Wiewel et al., 2019). Such learned physics simulators are considerably faster than their ground-truth counterparts, and that they are usually fully differentiable. Thus, they have been applied to model-based Reinforcement Learning (Mora et al., 2021) and for Inverse Design problems (Baqué et al., 2018; Durasov et al., 2021; Allen et al., 2022b) . Graph Network Simulators. Graph Network Simulators (GNS) (Sanchez-Gonzalez et al., 2020) are a special case of learned physics simulators that utilize GNNs (Scarselli et al., 2009) to efficiently encode the graph-like structure of many physical problems. They have found wide-spread application in calculating atomic forces (Hu et al., 2021), particle-based simulations (Li et al., 2019; Sanchez- Gonzalez et al., 2020) and mesh-based simulations (Pfaff et al., 2021; Weng et al., 2021; Han et al., 2022; Fortunato et al., 2022; Allen et al., 2022a). Other works in this field directly solve partial differential equations (Alet et al., 2019), and integrates explicit domain knowledge into the learned simulator to improve the predictions (de Avila Belbute-Peres et al., 2020; Li & Farimani, 2021; 2022). Similarly, CNNs have been used to predict particle masses from images to subsequently simulate physical systems with a GNN (Li et al., 2020) via visual grounding. This approach assumes access to a series of images to predict particles and their behavior, whereas GGNS integrates sensor observations into an existing mesh-based simulation. The work most closely related to our research is MeshGraphNet (MGN) (Pfaff et al., 2021), which combines a graph-based encoding of the system state with the next-step prediction of dynamic quantities to produce realistic predictions of mesh-based simulations. Simulation from Observation. Another variant of learned physics simulation is simulation from observation. Learning directly from observations instead of a ground truth simulator requires less expert knowledge for the design of the simulator and is more applicable to real-world scenarios. Different approaches exist for this type of simulation, including Physical reasoning (Li et al., 2020) and particle-based simulation (Martinkus et al., 2021). Point clouds have been used in CNN-based simulation (Watters et al., 2017; Wang et al., 2019), and combined with PointNet (Charles et al., 2017; Qi et al., 2017) to predict object deformations purely from observational data (Park et al., 2021). Further approaches make use of GNNs to predict object relations (Fetaya et al., 2018) and future frames in a point cloud sequence (Gomes et al., 2021). Simulation of Deformable Objects. Simulating deformable objects is crucial for many applications such as robotic manipulation tasks (Sanchez et al., 2018). Yet, recent approaches do not take explicit deformation into account (Matas et al., 2018), or only consider highly simplified geometries such as ropes (Sundaresan et al., 2020) or a square piece of cloth (Wu et al., 2020a; Lin et al., 2020; 2022). One reason for this is the high computational cost of existing simulators, which may be alleviated by fast and accurate learned simulators (Pfaff et al., 2021; Weng et al., 2021). Another recent work trains the parameters of a differentiable simulator to align its simulations with real-world observations of deformable objects based on point cloud information (Sundaresan et al., 2022). In this work, we instead utilize point cloud information to improve upon existing mesh-based GNSs in settings where additional point cloud data is available. 3 Published as a conference paper at ICLR 2023 3 FOUNDATIONS 3.1 MESSAGE PASSING NETWORK Let G = (V, E, XV, XE) be a directed graph with nodes V, edges E ⊆ V × V, node features XV : V → RdV of dimension dV and edge features XE : E → RdE of dimension dE. A Message Passing Network (MPN) (Sanchez-Gonzalez et al., 2020; Pfaff et al., 2021) is a GNN consisting of L Message Passing Blocks that receives the graph G as input and outputs a learned representation for each node V and edge E. Each block l computes updated features for all nodes v ∈ V and edges e ∈ E as e = f l xl+1 E(xl v, xl u, xl e), with e = (u, v) and xl+1 v = f l V(xl v, (cid:77) xl+1 e ), {e=(v,u)∈E} v and x0 where x0 invariant aggregation such as a sum, max, or mean operator. Furthermore, each f l function that is generally parameterized as a simple Multilayer Perceptron (MLP). e are embeddings of the initial node and edge features of G and ⊕ is a permutation- * is a learned 3.2 GRAPH NETWORK SIMULATOR GNSs simulate a system's dynamics by repeatedly applying the following three steps. First, they encode the system state S in a graph G. If the system state is given as e.g., a triangular or tetrahedral mesh M of the underlying entities, this graph is naturally constructed by using the nodes of M as nodes of the graph, and the connection between these nodes as edges. The node and edge features XV, XE can be constructed based on the concrete simulation. In general, encoding purely relative properties such as relative distances and velocities per edge rather than absolute positions per node have been shown to greatly improve training speed and generalization (Sanchez-Gonzalez et al., 2020). Next, the encoded graph G is used as input for a learned MPN, which computes final latent representations xL v for each node v ∈ V. These latent representations are interpreted as (potentially higher-order) derivatives of dynamic quantities, which are used by a simple forward-Euler integrator to derive an updated system state S (cid:48). Note that for some tasks, only a fraction of mesh nodes need to be predicted, as the others are either fixed or belong to a known entity such as a gripper or collider. In this case, only the latent representations of the nodes with otherwise unknown dynamics are used. GNSs are trained on a node-wise next-step Mean Squared Error (MSE) objective, i.e., they minimize the 1-step prediction error of the next system state to that of a given ground truth trajectory. During inference, simulations over potentially hundreds of steps can be generated by iteratively repeating the above-mentioned steps, using the updated dynamics of one step as the input for the next. We note that the model does not predict the movement of fixed entities such as e.g., a collider, which is instead assumed to be known and combined with the model's prediction about the unknown parts of the system. Due to this iterative dependence on previous outputs, the model is prone to error accumulation. A common strategy to tackle this limitation is to apply additional noise to the dynamic variables of the system for each training step (Sanchez-Gonzalez et al., 2020; Pfaff et al., 2021). Intuitively, adding training noise acts as a form of data augmentation that allows the learned model to compensate for small prediction errors over time. This kind of error-compensating next-step prediction leads to plausible and visually realistic predictions. However, the resulting predictions can be arbitrarily inaccurate with respect to the true dynamics of the system, since the model has no reference for its simulation other than some potentially incomplete initial state S0. 4 GROUNDING GRAPH NETWORK SIMULATOR Our approach combines recent advances in graph-based learned physics simulation with additional partial observations of the system state to generate highly accurate simulations from incomplete initial states. To this end, we extend the existing GNS framework to naturally and efficiently integrate auxiliary point cloud data whenever available. This auxiliary information grounds the predictions of the model in an observation of the true system state, guiding it towards predictions that not only look realistic but also closely match the actual dynamics of the system. Figure 2 illustrates an overview of our approach. A more detailed description of the GNN-part of the method is found in Appendix A. 4 Published as a conference paper at ICLR 2023 Figure 2: Schematic of GGNS . Given a system state St (red) and optional point cloud observations (dashed box), a GNN (orange) predicts how the system St+1 will look like at the next step (blue). For object deformation tasks, the state can include boundary conditions (gray) such as colliders or walls. When provided, the point cloud (green) is transformed into a neighborhood graph (yellow) in the same coordinate system as the mesh, connecting each point in the point cloud to the nearest mesh nodes. The model is trained to predict the next system state based on a true state (purple) provided by a ground truth simulator. During inference, the model iteratively predicts updates from a potentially incomplete initial system state (purple), using additional point cloud observations when available. 4.1 POINT CLOUDS AND NEIGHBORHOOD GRAPHS In order to utilize point-based data in addition to meshes we first have to transfer both into a common graph. Following previous work (Sanchez-Gonzalez et al., 2018), we do this by creating a neighborhood graph based on spatial proximity. Given a graph G = (V, E, XV, XE) that encodes a predicted system state and a point cloud observation P = {p1, . . . , pN }, pj ∈ Rd of the true system state, we set V(cid:48) = V ∪ P and E(cid:48) = E ∪ {(pi, pj) ∈ P 2|d(pi, pj) ≤ rP } ∪ {(v, p), (p, v)|v ∈ V, p ∈ P, d(p, v) ≤ rS }. Here, d is some distance measure, usually the euclidean distance, and rP and rS are task-specific neighborhood radii. The corresponding features XV(cid:48), XE(cid:48) of the added nodes and edges in V(cid:48) and E(cid:48) depend on the concrete task. The different node and edge types are one-hot encoded into their respective features to allow the model to differentiate between them. Similar to the original features, information can be encoded in a relative fashion in the form of edge features to aid generalization. More concretely, we encode relative distances in world space along all edges, additionally adding mesh-space distances for edges between two mesh nodes. This connectivity is slightly different from MGN (Pfaff et al., 2021), which make use of additional world edges between mesh-nodes by creating a similar radius-based neighborhood graph for the mesh nodes in world space. 4.2 IMPUTATION-BASED TRAINING AND INFERENCE For most realistic applications, point clouds are typically not available at each time step during inference. For example, we may have access to observed point clouds from the previous k time steps and want to use them to infer the state of the system in the future. We adapt our model to this constraint by employing an imputation-based training scheme. Our model still uses a single GNN, but we now randomly replace the graph G of S with the corresponding extended graph G(cid:48) = (V(cid:48), E(cid:48), XV(cid:48), XE(cid:48)) with equal probability during training. In both cases, the model is only trained to predict the system dynamics for the original nodes V. Intuitively, this allows each system node v ∈ V to utilize the additional information of close-by points of a point cloud when available, while at the same time forcing it to also make sensible predictions when there is no additional information. During inference, we construct G(cid:48) from the (predicted) system state S and a corresponding observed point cloud P of the true object whenever available and use G otherwise. This enables the model to reason about the true system state that is observed via P, adapting its prediction to the otherwise unknown behavior of the system. This grounding of the prediction also alleviates common errors of GNS such as drift and more generally error accumulation. An example can be seen in Figure 1. Here, the system state consists of a predicted mesh and a gripper, and the point cloud consists of points sampled from the true object. The mismatch between point cloud and predicted mesh indicates the prediction error, and 5 Optional Point-cloud InformationNeighborhood GraphState at Step tPredicted Mesh at Step t+1GNNUpdateTrue State atStep t+1Initial SystemStateInference t=0Training MSEPoint-cloud at Step tInference t=t+1 Published as a conference paper at ICLR 2023 Figure 3: Final simulated meshes (t = 50) for GGNS (k = 5) (left), the ground truth simulation (middle) and MGN (right) for 2 test rollouts with different material properties for the Deformable Plate task. Our model closely matches the ground truth simulations for both materials, while MGN predicts the same material every time. the model uses this additional information to correct the current state estimate. Similar figures for the other two tasks can be found in Appendix C. We compare this simple imputation-based method to another training scheme in our experiments, which we call GGNS+LSTM. Here we use an LSTM (Hochreiter & Schmidhuber, 1997) layer on the node output features of the GNN to explicitly include recurrency into the model. This modification allows information such as the material properties to be inferred and propagated over time, which can be utilized to improve the predictions in time steps without point clouds. The resulting model is trained on the same 1-step prediction loss and also uses training noise to generate stable rollouts during inference. However, it is significantly more costly to train, as it makes use of backpropagation in time to compute the gradients for the recurrency. We find experimentally that this recurrent model performs worse than the imputation-based method. An explanation for this is that the potential benefit of propagating information over time is offset by the additional training and model complexity, especially with respect to the next-step prediction objective. For this reason, GGNS relies on this simple but effective imputation-based approach. 5 EXPERIMENTS We evaluate GGNS on complex 2d and 3d mesh-based object deformation prediction tasks modelled in the Simulation Open Framework Architecture (SOFA) (Faure et al., 2012). For each task, the true system state is given by a tetrahedral FEM mesh of a deformable object with rigid boundary conditions combined with a triangular surface mesh of a rigid collider. The point clouds are generated by raycasting using one virtual camera for 2d and up to five cameras for 3d tasks arranged around the scene. More details on the generation of the point clouds are presented in Appendix B. Additional environment-specific details, including node and edge features and dataset properties can also be found in Appendix B. We assume that, while the initial mesh of the object is known, its material properties are not. We model these unknown properties via the Poisson's ratio (Lim, 2015) −1 < ν < 0.5, which is a scalar value describing the ratio of contraction (ν < 0) or expansion (ν > 0) under compression (Mazaev et al., 2020). For all datasets, we randomly assign Poisson's ratios from ν ∈ {−0.9, 0.0, 0.49} equally to all rollouts. We train all models on all tasks using the Adam optimizer (Kingma & Ba, 2015) with a learning rate of 5 × 10−4 and a batch size of 32, using early stopping on a held-out validation set to save the best model iteration for each setting. The models use a LeakyReLU activation function, five message passing blocks with 1-layer MLPs and a latent dimension of 128 for node and edge updates. We use a mean aggregation for the edge features and a training noise of 0.01. All tasks use a normalized task space of [−1, 1]d. An overview of the network hyperparameters can be found in Appendix E. Evaluation Metrics. We evaluate the performance of all trained models on 10 different seeds per experiment. We report the means and standard deviations of the different runs, where, for each run, we average the results over all available steps of a trajectory and over all trajectories in the test set of 6 Published as a conference paper at ICLR 2023 Figure 4: Visualization for a test trajectory at time step t = 70 for GGNS (left), the ground truth simulation (middle) and MGN (right). While MGN accumulates a large prediction error over time, GGNS is able to utilize the additional point cloud information to stay close to the ground truth for the full length of the simulation. Different angles of this visualization can be found in Appendix C. the respective data set. For all experiments, we report the full rollout loss, where the model starts with the initial state S0 and predicts the states up to a final state ST . Here, we provide a point cloud to the model every k ≥ 1 steps and resort to mesh-only prediction otherwise. This corresponds to a setting in which the deformation of an object is tracked with both high-frequency sensors and low-frequency cameras which provide the position of the rigid collider and point-cloud information respectively. We also consider an application where a robot observes an object's deformation up to some point in time and then reasons about future deformations without additional point-cloud information. For this setting, the initial system state S0 is provided to the model, followed by m point clouds for its next m predictions. Then, 10 more steps are predicted without point clouds to predict a state Sm+10 and and compute the corresponding 10-step prediction loss. The reported losses are the average MSE over every step along the trajectory averaged over all possible rollouts. This metric reduces to the average loss for a m + 10-step prediction for methods that cannot make use of point cloud data, as the state Sm+10 needs to be predicted from the initial S0. Baselines. We compare to MGN, a state-of-the-art GNS, which utilizes additional world edges between close-by mesh nodes, but does not incorporate point cloud observations. Comparing these world edges to Section 4.1, MGN assumes an edge partition E = E1 ̇∪E2 and separate edge update functions f l . The edge-aggregation for the node update is then computed by aggregating E1 the latent features of both types of edges separately and concatenating the result. We adopt this explicit representation of edge types for the MGN baseline and experiment with it for GGNS in Appendix D. As it does not provide any significant advantages for our model, GGNS instead resorts to a simple one-hot encoding of the type of input edge for the remaining experiments. and f l E2 Additionally, we evaluate a variant of MGN that has additional access to the underlying Poisson's ratio v as a node feature, called MGN (M). This additional information leads to a deterministic ground truth simulation w.r.t. the initial system state, and upper bounds the performance of MGN. We also compare to GGNS+LSTM, which integrates recurrency into our imputation technique. Here, we investigate whether this recurrency helps the model predicting e.g., material properties over time. As a point cloud based baseline, we use a non-learned method to directly generate a mesh from the point cloud of each time step. We voxel-subsample the point cloud so that we observe approximately the same number of points as nodes in the ground truth mesh and then use Alpha Shapes (Akkiraju et al., 1995) to create a (potentially non-convex) mesh for this time step. This baseline shows how much information can be directly inferred from just the point cloud information. Deformable Plate. We consider a family of 2-dimensional trapezoids that are deformed by a circular collider with constant velocity. Besides the trapezoidal shapes, diversity in the dataset is introduced by varying the size and starting positions of the collider. For this task, we additionally consider the Intersection over Union (IoU) between the predicted and the ground truth mesh as an evaluation metric. We find that this metric is less sensitive to individual mesh nodes and that it instead measures how well the predicted object shape matches that of the real system state. We use a total of 675/135/135 trajectories for our training, validation and test sets. Each trajectory consist of T = 50 timesteps. Tissue Manipulation. An important application for the prediction of deformable objects is medical robotics. We simulate a robot-assisted surgery scenario where a piece of tissue is deformed by a 7 Published as a conference paper at ICLR 2023 r o r r E d e r a u q S n a e M t u o l l o R 10−2 10−3 10−4 10−5 10−6 (k=1) (k=5) (k=2) GGNS 10−2 10−3 10−4 10−5 10−6 10−2 10−3 10−4 10−5 10−6 MGN (k=1) (k=2) (k=5) (k=10) MGN (M) GGNS MGN (k=1) (k=2) (k=5) (k=10) MGN (M) GGNS MGN (k=1) (k=2) GGNS+LSTM (k=5) MGN (M) (a) Deformable Plate (b) Tissue Manipulation (c) Cavity Grasping Figure 5: Rollout Mean Squared Error of GGNS and MGN baselines evaluated on the test set of the three datasets. We report the results for GGNS using point clouds in every k-th time step. MGN(M) indicates the baseline method of MGN that uses the ground truth material as input feature. GGNS outperforms the MGN baseline in all settings and in most cases even if it has access to the complete initial state. For the Deformable Plate task we additionally report the errors for GGNS+LSTM, which perform worse than GGNS for all k but still outperforming the MGN baseline. solid gripper. Varying the direction of the gripper's motion and its gripping position on the tissue results in additional diversity. Here, 600/120/120 trajectories are used, each of which is rolled out for T = 100 timesteps. This task is visualized in Figure 4. Cavity Grasping. Robotic manipulation of deformable objects is an important application of deformable physics simulation. Here, a simulated Panda 1 robot gripper grasps and deforms a cavity. For this purpose, we randomly generate cone-shaped cavities with different radii, which are deformed by a gripper from different positions. An example simulation step by GGNS for this task is illustrated in Figure 1. We use the same amount of samples and data split as in the Tissue Manipulation task. 6 RESULTS Main Results. We test our method on the three deformation prediction tasks described in Section 5 and compare it to MGN with and without material information. We find that GGNS can use the point cloud information to produce high quality rollouts that closely match the true system states. An example is shown in Figure 3, which visualizes the final simulated meshes for our method and the ground truth simulation. Additionally, GGNS outperforms the baselines even when they have access to the complete initial state, which our model has not. Figure 4 shows the qualitative differences between GGNS and MGN on the Tissue Manipulation task. Additional visualizations for all tasks and both methods can be found in Appendix C. The evaluations for full rollouts are given in Figure 5. Table 1 shows results for the m + 10-step evaluation. Appendix D shows the performance of GGNS for different model hyperparameters. Similar to Pfaff et al. (2021), we find that GGNS is robust to most parameter choices, and that a modest amount of training noise is crucial for long-term rollouts. To show the applicability of our method for more realistic point cloud data, we provide additional ablations on noisy and partial observable point clouds in Appendix D. We find that our model is quite robust to the quality of the point clouds and can still reliably use their information to ground the simulation. On the Deformable Plate dataset, we additionally evaluate the mean Intersection over Union (IoU) during the rollouts to emphasize the compliance with the overall shape of the object rather than that of individual mesh nodes. The results are illustrated in Figure 6a. Recurrent Imputation Model. For the 2d data of the Deformable Plate task, we additionally compare our imputation model to the GGNS+LSTM approach, which can use the recurrence of LSTMs to pass information over time. Figure 5a shows that GGNS outperforms this alternative approach for each k. We find that our simple architecture outperforms the recurrent one while requiring significantly less time to train, likely due to the additional complexity of training the recurrent model. The qualitative results in Appendix C confirm these findings. Initial Mesh Generation. Using the IoU metric, we can compare objects across different mesh representations. The results in Figure 6b show that GGNS produces accurate rollouts even if the initial mesh is generated directly from the initial point cloud. For this, we compute a mesh with similar resolution to the training meshes from the convex hull of the initial point cloud, avoiding 1FRANKA EMIKA GmbH, Munich, Germany 8 Published as a conference paper at ICLR 2023 Approach m + 10-step MSE ×10−5 Tissue Plate Cavity GGNS MGN (M) MGN 2.907 ± 0.172 10.663 ± 1.063 282.684 ± 18.112 0.514 ± 0.052 5.027 ± 1.489 5.885 ± 0.723 0.923 ± 0.040 6.294 ± 0.668 11.528 ± 0.747 Table 1: Evaluation on the m + 10-step prediction setting on the test set for all three tasks. GGNS clearly outperforms the baselines on all tasks even if they have access to the full initial simulation state. U o I t u o l l o R p e t s - 0 5 1 0.95 0.9 0.85 0.8 U o I t u o l l o R p e t s - 0 5 1 0.95 0.9 0.85 0.8 t fi e n e B d e z i l a m r o N 1.2 1 0.8 0.6 0.4 0.2 0 Cavity Tissue Plate (k=1) (k=2) GGNS (k=5) MGN (M) MGN (k=1) (k=2) GGNS (k=5) MGN (M) MGN Alpha Shapes 1 2 3 4 5 6 7 8 9 10 k (a) Deformable Plate IoU (b) IoU without initial mesh (c) Different grounding frequencies Figure 6: (a) Rollout IoU for the Deformable Plate dataset for GGNS and the MGN baseline. The main findings here are similiar to the MSE results but enable to compare against the values in (b), where the initial mesh is created from initial the point cloud. The achieved IoUs are lower compared to using the ground truth mesh, but GGNS (k ≤ 2) still outperforms all baselines including the Alpha Shapes in this setting. (c) Normalized benefit of using a point cloud in every k-th timestep, where k = 1 means a point cloud is available in every time step. the dependence on any simulation data. This procedure marks an important step towards using these models on real world data. The results indicate that generating the initial mesh from point cloud information results in a degradation of the performance compared to an evaluation that uses a provided mesh. Yet, it still allows for a high-quality prediction of the deformation. The comparison to Alpha Shapes shows that combining infrequent point cloud information (k = 5) with a simulator leads to better and more consistent results than directly creating the mesh from the point cloud in each time step. Additionally, our model naturally tracks the correspondences of mesh nodes over time, whereas Alpha Shapes cannot observe the evolution of individual particles in the system. As such, GGNS allows for a more thorough understanding of the modeled process. Grounding Frequency. Figure 6c shows the normalized performance of GGNS for grounding frequencies k ∈ {1..10} across tasks. Here, a value of 1.0 corresponds to the performance for k = 1, and 0.0 to the performance MGN. For all tasks there is a clear advantage in utilizing the point cloud information, and the performance increases with the frequency of available point clouds. 7 CONCLUSION We propose Grounding Graph Network Simulator (GGNS), an extension of the popular Graph Network Simulator framework that can utilize auxiliary observations to accurately simulate complex dynamics from incomplete initial system states. Utilizing a neighborhood graph computed from point cloud information and an imputation-based training scheme, our model is able to ground its prediction in an observation of the true system state. We show experimentally that this leads to high-quality simulations in challenging 2d and 3d object deformation tasks, outperforming existing approaches even when these are provided with full information about the system. In future work, we will extend GGNSs to explicitly model uncertainty and maintain a belief over the latent variables of the system, e.g., by employing a Kalman filter in a learned latent space (Becker et al., 2019). Another promising direction is to adapt the current next-step prediction loss to instead predict a trajectory over a small period of time to increase the long-term consistency of the model. Finally, we will employ our model for model-predictive control and model-based Reinforcement Learning in both simulation and on a real robot. 9 Published as a conference paper at ICLR 2023 ACKNOWLEDGMENTS We thank Vincent Kreuziger for the helpful discussions on the visualizations and for the high-quality blender renderings. The authors acknowledge support by the state of Baden-Württemberg through bwHPC. GN was supported by the DFG research unit DFG-FOR 5339 (AI-based Methodology for the Fast Maturation of Immature Manufacturing Processes) and GN and NF were supported by the BMBF project Davis (Datengetriebene Vernetzung für die ingenieurtechnische Simulation). REFERENCES N. Akkiraju, Edelsbrunner H., Facello M., P. Fu, E. P. Mücke, and C. Varela. Alpha shapes: Definition and software. In Proceedings of the 1st International Computational Geometry Software Workshop, pp. 63–66, 1995. URL http://www.geom.uiuc.edu/software/cglist/GeomDir/ shapes95def/. Ferran Alet, Adarsh Keshav Jeewajee, Maria Bauza Villalonga, Alberto Rodriguez, Tomas Lozano- Perez, and Leslie Kaelbling. Graph element networks: adaptive, structured computation and In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th memory. International Conference on Machine Learning, volume 97 of Proceedings of Machine Learn- ing Research, pp. 212–222. PMLR, 09–15 Jun 2019. URL https://proceedings.mlr. press/v97/alet19a.html. Kelsey R Allen, Tatiana Lopez Guevara, Yulia Rubanova, Kimberly Stachenfeld, Alvaro Sanchez- Gonzalez, Peter Battaglia, and Tobias Pfaff. Graph network simulators can learn discontinuous, rigid contact dynamics. Conference on Robot Learning (CoRL)., 2022a. Kelsey R Allen, Tatiana Lopez-Guevara, Kimberly Stachenfeld, Alvaro Sanchez-Gonzalez, Pe- ter Battaglia, Jessica Hamrick, and Tobias Pfaff. Physical design using differentiable learned simulators. arXiv preprint arXiv:2202.00728, 2022b. Pierre Baqué, Edoardo Remelli, François Fleuret, and Pascal Fua. Geodesic convolutional shape optimization. In Jennifer G. Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pp. 481–490. PMLR, 2018. URL http://proceedings.mlr.press/v80/baque18a.html. Peter Battaglia, Razvan Pascanu, Matthew Lai, Danilo Jimenez Rezende, and koray kavukcuoglu. Interaction networks for learning about objects, relations and physics. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016. URL https://proceedings.neurips.cc/ paper/2016/file/3147da8ab4a0437c15ef51a5cc7f2dc4-Paper.pdf. Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinícius Flores Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, Çaglar Gülçehre, H. Francis Song, Andrew J. Ballard, Justin Gilmer, George E. Dahl, Ashish Vaswani, Kelsey R. Allen, Charles Nash, Victoria Langston, Chris Dyer, Nicolas Heess, Daan Wierstra, Pushmeet Kohli, Matthew Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu. Relational inductive biases, deep learning, and graph networks. CoRR, abs/1806.01261, 2018. URL http://arxiv.org/abs/1806.01261. Philipp Becker, Harit Pandya, Gregor Gebhardt, Cheng Zhao, C James Taylor, and Gerhard Neumann. Recurrent kalman networks: Factorized inference in high-dimensional deep feature spaces. In International Conference on Machine Learning, pp. 544–552, 2019. Saakaar Bhatnagar, Yaser Afshar, Shaowu Pan, Karthik Duraisamy, and Shailendra Kaushik. Prediction of aerodynamic flow fields using convolutional neural networks. Computational doi: 10.1007/s00466-019-01740-0. URL https: Mechanics, 64(2):525–545, jun 2019. //doi.org/10.1007%2Fs00466-019-01740-0. Eduardo F Camacho and Carlos Bordons Alba. Model predictive control. Springer science & business media, 2013. 10 Published as a conference paper at ICLR 2023 R. Qi Charles, Hao Su, Mo Kaichun, and Leonidas J. Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 77–85, 2017. doi: 10.1109/CVPR.2017.16. Mengyu Chu and Nils Thuerey. Data-driven synthesis of smoke flows with cnn-based feature descriptors. ACM Trans. Graph., 36(4), jul 2017. ISSN 0730-0301. doi: 10.1145/3072959.3073643. URL https://doi.org/10.1145/3072959.3073643. TJ Chung. Finite element analysis in fluid dynamics. NASA STI/Recon Technical Report A, 78:44102, 1978. JH Coggon. Electromagnetic and electrical modeling by the finite element method. Geophysics, 36 (1):132–155, 1971. Filipe de Avila Belbute-Peres, Thomas D. Economon, and J. Zico Kolter. Combining differentiable In Proceedings of the 37th pde solvers and graph neural networks for fluid flow prediction. International Conference on Machine Learning, ICML'20. JMLR.org, 2020. Nikita Durasov, Artem Lukoyanov, Jonathan Donier, and Pascal Fua. Debosh: Deep bayesian shape optimization. arXiv preprint arXiv:2109.13337, 2021. François Faure, Christian Duriez, Hervé Delingette, Jérémie Allard, Benjamin Gilles, Stéphanie Marchesseau, Hugo Talbot, Hadrien Courtecuisse, Guillaume Bousquet, Igor Peterlik, and Stéphane Cotin. SOFA: A Multi-Model Framework for Interactive Physical Simulation. In Yohan Payan (ed.), Soft Tissue Biomechanical Modeling for Computer Assisted Surgery, volume 11 of Studies in Mechanobiology, Tissue Engineering and Biomaterials, pp. 283–321. Springer, June 2012. doi: 10.1007/8415\_2012\_125. URL https://hal.inria.fr/hal-00681539. T. Fetaya, Elias Wang, K.-C. Welling, Michelle Zemel, Thomas Kipf, Ethan Fetaya, Kuan-Chieh Wang, Max Welling, and Richard S. Zemel. Neural relational inference for interacting systems. arXiv: Machine Learning, 2018. Meire Fortunato, Tobias Pfaff, Peter Wirnsberger, Alexander Pritzel, and Peter Battaglia. Mul- In ICML 2022 2nd AI for Science Workshop, 2022. URL https: tiscale meshgraphnets. //openreview.net/forum?id=G3TRIsmMhhf. Pedro Gomes, Silvia Rossi, and Laura Toni. Spatio-temporal graph-rnn for point cloud prediction. In 2021 IEEE International Conference on Image Processing (ICIP), pp. 3428–3432, 2021. doi: 10.1109/ICIP42928.2021.9506084. Xiaoxiao Guo, Wei Li, and Francesco Iorio. Convolutional neural networks for steady flow ap- proximation. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '16, pp. 481–490, New York, NY, USA, 2016. Associa- tion for Computing Machinery. ISBN 9781450342322. doi: 10.1145/2939672.2939738. URL https://doi.org/10.1145/2939672.2939738. Xu Han, Han Gao, Tobias Pffaf, Jian-Xun Wang, and Li-Ping Liu. Predicting physics in mesh-reduced space with temporal attention. CoRR, abs/2201.09113, 2022. URL https://arxiv.org/ abs/2201.09113. Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9:1735–80, 12 1997. doi: 10.1162/neco.1997.9.8.1735. Weihua Hu, Muhammed Shuaibi, Abhishek Das, Siddharth Goyal, Anuroop Sriram, Jure Leskovec, Devi Parikh, and C Lawrence Zitnick. Forcenet: A graph neural network for large-scale quantum calculations. In ICLR 2021 SimDL Workshop, volume 20, 2021. AH Jazwinski. Stochastic processes and filtering theory. ACADEMIC PRESS, INC.„ 1970. Jian-Ming Jin. The finite element method in electromagnetics. John Wiley & Sons, 2015. Rudolph Emil Kalman. A new approach to linear filtering and prediction problems. Journal of basic Engineering, 82(1):35–45, 1960. 11 Published as a conference paper at ICLR 2023 Byungsoo Kim, Vinicius C. Azevedo, Nils Thuerey, Theodore Kim, Markus Gross, and Barbara Solenthaler. Deep Fluids: A Generative Network for Parameterized Fluid Simulations. Computer Graphics Forum (Proc. Eurographics), 38(2), 2019. Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http: //arxiv.org/abs/1412.6980. Yunzhu Li, Jiajun Wu, Russ Tedrake, Joshua B. Tenenbaum, and Antonio Torralba. Learning particle dynamics for manipulating rigid bodies, deformable objects, and fluids. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum? id=rJgbSn09Ym. Yunzhu Li, Toru Lin, Kexin Yi, Daniel Bear, Daniel Yamins, Jiajun Wu, Joshua Tenenbaum, and Antonio Torralba. Visual grounding of learned physical models. In Hal Daumé III and Aarti Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 5927–5936. PMLR, 13–18 Jul 2020. URL https://proceedings.mlr.press/v119/li20j.html. Zijie Li and Amir Barati Farimani. Accelerating lagrangian fluid simulation with graph neural networks. In ICLR 2021 SimDL Workshop, volume 20, 2021. Zijie Li and Amir Barati Farimani. Graph neural network-accelerated lagrangian fluid simulation. Computers & Graphics, 103:201–211, 2022. Teik-Cheng Lim. Auxetic Materials and Structures. Springer Singapore, 01 2015. ISBN 978- 981-287-274-6. doi: 10.1007/978-981-287-275-3. URL https://doi.org/10.1007/ 978-981-287-275-3. Xingyu Lin, Yufei Wang, Jake Olkin, and David Held. Softgym: Benchmarking deep reinforcement learning for deformable object manipulation. In Conference on Robot Learning, 2020. URL https://arxiv.org/abs/2011.07215. Xingyu Lin, Yufei Wang, Zixuan Huang, and David Held. Learning visible connectivity dynamics for cloth smoothing. In Aleksandra Faust, David Hsu, and Gerhard Neumann (eds.), Proceedings of the 5th Conference on Robot Learning, volume 164 of Proceedings of Machine Learning Research, pp. 256–266. PMLR, 08–11 Nov 2022. URL https://proceedings.mlr.press/v164/ lin22a.html. Wing Kam Liu, Shaofan Li, and Harold S Park. Eighty years of the finite element method: Birth, evolution, and future. Archives of Computational Methods in Engineering, pp. 1–23, 2022. Ting Long, Can Huang, Dean Hu, and Moubin Liu. Coupling edge-based smoothed finite element method with smoothed particle hydrodynamics for fluid structure interaction problems. Ocean Engineering, 225:108772, 2021. Karolis Martinkus, Aurelien Lucchi, and Nathanaël Perraudin. Scalable graph networks for par- ticle simulations. Proceedings of the AAAI Conference on Artificial Intelligence, 35(10):8912– 8920, May 2021. URL https://ojs.aaai.org/index.php/AAAI/article/view/ 17078. Jan Matas, Stephen James, and Andrew J. Davison. Sim-to-real reinforcement learning for deformable object manipulation. In 2nd Annual Conference on Robot Learning, CoRL 2018, Zürich, Switzer- land, 29-31 October 2018, Proceedings, volume 87 of Proceedings of Machine Learning Research, pp. 734–743. PMLR, 2018. URL http://proceedings.mlr.press/v87/matas18a. html. A V Mazaev, O Ajeneza, and M V Shitikova. Auxetics materials: classification, mechanical properties and applications. IOP Conference Series: Materials Science and Engineering, 747 (1):012008, jan 2020. doi: 10.1088/1757-899x/747/1/012008. URL https://doi.org/10. 1088/1757-899x/747/1/012008. 12 Published as a conference paper at ICLR 2023 Thomas M Moerland, Joost Broekens, and Catholijn M Jonker. Model-based reinforcement learning: A survey. arXiv preprint arXiv:2006.16712, 2020. Miguel Angel Zamora Mora, Momchil Peychev, Sehoon Ha, Martin Vechev, and Stelian Coros. In Marina Meila and Tong Zhang Pods: Policy optimization via differentiable simulation. (eds.), Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 7805–7817. PMLR, 18–24 Jul 2021. URL http://proceedings.mlr.press/v139/mora21a.html. Damian Mrowca, Chengxu Zhuang, Elias Wang, Nick Haber, Li F Fei-Fei, Josh Tenen- baum, and Daniel L Yamins. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 31. Curran Asso- ciates, Inc., 2018. URL https://proceedings.neurips.cc/paper/2018/file/ fd9dd764a6f1d73f4340d570804eacc4-Paper.pdf. Flexible neural representation for physics prediction. Jinhyung Park, Dohae Lee, and In-Kwon Lee. Flexible networks for learning physical dynamics of deformable objects. CoRR, abs/2112.03728, 2021. URL https://arxiv.org/abs/2112. 03728. Tobias Pfaff, Meire Fortunato, Alvaro Sanchez-Gonzalez, and Peter W. Battaglia. Learning mesh- based simulation with graph networks. In International Conference on Learning Representations, 2021. URL https://arxiv.org/abs/2010.03409. Athanasios S Polydoros and Lazaros Nalpantidis. Survey of model-based reinforcement learning: Applications on robotics. Journal of Intelligent & Robotic Systems, 86(2):153–173, 2017. Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL https://proceedings.neurips. cc/paper/2017/file/d8bf84be3800d12f74d8b05e9b89836f-Paper.pdf. Singiresu S Rao. The finite element method in engineering. Butterworth-heinemann, 2017. Junuthula Narasimha Reddy. Introduction to the finite element method. McGraw-Hill Education, 2019. Lovely Sabat and Chinmay Kumar Kundu. History of finite element method: a review. Recent Developments in Sustainable Infrastructure, pp. 395–404, 2021. Jose Sanchez, Juan Antonio Corrales Ramon, B. Chedli BOUZGARROU, and Y. Mezouar. Robotic manipulation and sensing of deformable objects in domestic and industrial applica- tions: A survey. The International Journal of Robotics Research, 37:688 – 716, 06 2018. doi: 10.1177/0278364918779698. Alvaro Sanchez-Gonzalez, Nicolas Heess, Jost Tobias Springenberg, Josh Merel, Martin Riedmiller, Raia Hadsell, and Peter Battaglia. Graph networks as learnable physics engines for inference and control. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 4470–4479. PMLR, 10–15 Jul 2018. URL https://proceedings.mlr.press/v80/ sanchez-gonzalez18a.html. Alvaro Sanchez-Gonzalez, Jonathan Godwin, Tobias Pfaff, Rex Ying, Jure Leskovec, and Peter Battaglia. Learning to simulate complex physics with graph networks. In Proceedings of the 37th International Conference on Machine Learning, pp. 8459–8468. PMLR, 2020. Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009. doi: 10.1109/TNN.2008.2005605. Max Schwenzer, Muzaffer Ay, Thomas Bergs, and Dirk Abel. Review on model predictive control: An engineering perspective. The International Journal of Advanced Manufacturing Technology, 117(5):1327–1349, 2021. 13 Published as a conference paper at ICLR 2023 Nicolas Soro, Laurence Brassart, Yunhui Chen, Martin Veidt, Hooyar Attar, and Matthew S Dargusch. Finite element analysis of porous commercially pure titanium for biomedical implant application. Materials Science and Engineering: A, 725:43–50, 2018. Eva Stanova, Gabriel Fedorko, Stanislav Kmet, Vieroslav Molnar, and Michal Fabian. Finite element analysis of spiral strands with different shapes subjected to axial loads. Advances in engineering software, 83:45–58, 2015. Priya Sundaresan, Jennifer Grannen, Brijen Thananjeyan, Ashwin Balakrishna, Michael Laskey, Kevin Stone, Joseph E. Gonzalez, and Ken Goldberg. Learning rope manipulation policies using dense object descriptors trained on synthetic depth data. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pp. 9411–9418, 2020. doi: 10.1109/ICRA40945.2020.9197121. Priya Sundaresan, Rika Antonova, and Jeannette Bohg. Diffcloud: Real-to-sim from point clouds with differentiable simulation and rendering of deformable objects. CoRR, abs/2204.03139, 2022. doi: 10.48550/arXiv.2204.03139. URL https://doi.org/10.48550/arXiv.2204.03139. Jonathan Tompson, Kristofer Schlachter, Pablo Sprechmann, and Ken Perlin. Accelerating eulerian fluid simulation with convolutional networks. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML'17, pp. 3424–3433. JMLR.org, 2017. Kiwon Um, Xiangyu Hu, and Nils Thuerey. Liquid splash modeling with neural networks. Computer Graphics Forum, 37(8):171–182, 2018. doi: https://doi.org/10.1111/cgf.13522. URL https: //onlinelibrary.wiley.com/doi/abs/10.1111/cgf.13522. Benjamin Ummenhofer, Lukas Prantl, Nils Thuerey, and Vladlen Koltun. Lagrangian fluid simulation with continuous convolutions. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=B1lDoJSYDH. RC Van Staden, Hong Guan, and Yew-Chaye Loo. Application of the finite element method in dental implant research. Computer methods in biomechanics and biomedical engineering, 9(4):257–270, 2006. Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E. Sarma, Michael M. Bronstein, and Justin M. Solomon. Dynamic graph cnn for learning on point clouds. ACM Trans. Graph., 38(5), oct 2019. ISSN 0730-0301. doi: 10.1145/3326362. URL https://doi.org/10.1145/3326362. Nicholas Watters, Daniel Zoran, Theophane Weber, Peter Battaglia, Razvan Pascanu, and An- drea Tacchetti. Visual interaction networks: Learning a physics simulator from video. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Gar- nett (eds.), Advances in Neural Information Processing Systems, volume 30. Curran Asso- ciates, Inc., 2017. URL https://proceedings.neurips.cc/paper/2017/file/ 8cbd005a556ccd4211ce43f309bc0eac-Paper.pdf. Zehang Weng, Fabian Paus, Anastasiia Varava, Hang Yin, Tamim Asfour, and Danica Kragic. Graph- based task-specific prediction models for interactions between deformable and rigid objects. In 2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 5741– 5748, 2021. doi: 10.1109/IROS51168.2021.9636660. URL https://arxiv.org/abs/ 2103.02932. Steffen Wiewel, Moritz Becher, and Nils Thuerey. Latent Space Physics: Towards Learning the Temporal Evolution of Fluid Flow. Computer Graphics Forum, 2019. ISSN 1467-8659. doi: 10.1111/cgf.13620. Yilin Wu, Wilson Yan, Thanard Kurutach, Lerrel Pinto, and Pieter Abbeel. Learning to Manipulate Deformable Objects without Demonstrations. In Proceedings of Robotics: Science and Systems, Corvalis, Oregon, USA, July 2020a. doi: 10.15607/RSS.2020.XVI.065. Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A comprehensive survey on graph neural networks. IEEE transactions on neural networks and learning systems, 32(1):4–24, 2020b. 14 Published as a conference paper at ICLR 2023 Longying Xiao, Gianluca Fiandaca, Bo Zhang, Esben Auken, and Anders Vest Christiansen. Fast 2.5 d and 3d inversion of transient electromagnetic surveys using the octree-based finite-element method. Geophysics, 87(4):E267–E277, 2022. You Xie, Erik Franz, Mengyu Chu, and Nils Thuerey. tempoGAN: A Temporally Coherent, Volu- metric GAN for Super-resolution Fluid Flow. ACM Transactions on Graphics (TOG), 37(4):95, 2018. Mohd Hafiz Zawawi, A Saleha, A Salwa, NH Hassan, Nazirul Mubin Zahari, Mohd Zakwan Ramli, and Zakaria Che Muda. A review: Fundamentals of computational fluid dynamics (cfd). In AIP conference proceedings, pp. 020252. AIP Publishing LLC, 2018. Yao Zhang, Woong Je Sung, and Dimitri N. Mavris. Application of convolutional neural network to predict airfoil lift coefficient. In 2018 AIAA/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference, 2018. doi: 10.2514/6.2018-1903. URL https://arc.aiaa.org/ doi/abs/10.2514/6.2018-1903. Qian-Yi Zhou, Jaesik Park, and Vladlen Koltun. Open3d: A modern library for 3d data processing. CoRR, abs/1801.09847, 2018. URL http://arxiv.org/abs/1801.09847. Olek C Zienkiewicz and Robert Leroy Taylor. The finite element method for solid and structural mechanics. Elsevier, 2005. 15 Published as a conference paper at ICLR 2023 Figure 7: A detailed view of the GNN part of GGNS . Given a graph G(cid:48), the node and edge features XV(cid:48) and XE(cid:48) are linearly embedded into a latent space and then updated with L Message Passing Blocks. The resulting predictions are interpreted as dynamic quantities that are used to update the system. A MODEL DETAILS The Message Passing Network employed by GGNS is displayed in 7. As node-wise predictions we use velocities, which are Euler-integrated once to update the positions of the mesh of the deformable object. B ENVIRONMENT DETAILS Here, we describe all key aspects, which are valid for all three environments. All datasets are simulated using SOFA and include different material properties. Therefore, we choose discrete Poisson's ratios from ν ∈ {−0.9, 0.0, 0.49} for one-third of all simulated trajectories each. Other material parameters are kept constant, e.g., for the mass we choose large values for the solid object and smaller values for the deformable to ensure sufficient deformation. The chosen parameters do not represent the full reality, as there are other material parameters that could be varied. However, as we want to showcase the capabilities of our method, we selected these parameters as they displayed the biggest impact on the deformation behavior. B.1 POINT CLOUD GENERATION The required point clouds are not directly available in SOFA, but instead rendered from the scene of the meshes using Raycasting from Open3D (Zhou et al., 2018). We therefore place virtual cameras around and on top of the scene to generate partial point clouds from different directions. For the Deformable Plate dataset one camera is sufficient, while the other two tasks rely on four cameras around and one camera on top of the scene. This results in a good, but not complete coverage of the entire surface with points of the point cloud. Even though there are five cameras around the scene, there are areas that are not covered: For the tissue, the parts that are occluded by the red liver, and for the cavity, parts of the inner surface depending on how the upper and lower radii deviates from one another. Also, as there can be no camera from below, there are naturally no points on the lower surface for both datasets. In Appendix D we additionally provide results for less cameras on the cavity dataset, leading to only partially observable point clouds. If more than one point cloud camera is used, the resulting point clouds are fused and subsampled accordingly to achieve a processable number of points. We voxel subsample in world space, so the points do not belong to any specific part of the mesh, but can rather be seen as some "interpolation" between mesh vertexes. The main challenge is that there are no point correspondences and that the model needs to figure out which point of the point cloud belongs to which vertex in the mesh to do the correction of the mesh nodes for grounding the simulation. Still, voxel subsampling leads to the most structured results compared to other subsampling techniques, which helps the model to account for correspondences between points over time. 16 Message Passing NetworkMessage Passing Stack (Lx)DecoderEncoderLinear Node EmbeddingLinear Edge EmbeddingMessagePassing BlockNode-wise PredictionEuler IntegrationMessagePassing BlockMessagePassing Block Published as a conference paper at ICLR 2023 B.2 INPUT FEATURES In addition to encoding the node or edge type as one-hot features, we add an encoding to static nodes and encode the velocity of the collider in its node features. We encode the positions in space as relative features in the edges instead of absolute encodings in the node features following previous work (Sanchez-Gonzalez et al., 2020). All edges thus receive their relative world coordinates, while mesh edges additionally contain relative coordinates in mesh space. B.3 COLLISION HANDLING SOFA as the ground truth simulator handles collision between objects using triangular surface meshes of all objects involved to detect collisions. The detection is implemented using the LocalMinDistance method and detected collisions are included in the constraints of the system. Using Lagrangian multipliers, the constraints are then processed together with the other forces from the deformation to solve the complete FEM system (Faure et al., 2012). In contrast to that, GGNS uses one-hot encoded edges between the rigid and the soft body that are used by the model to compute the dynamics. There is no explicit handling of collisions, the network learns to avoid them and adapts the mesh accordingly. B.4 DEFORMABLE PLATE For this environment, we simulate a family of 2-dimensional trapezoids deformed by a circular collider with constant velocity. We vary the size of the collider by sampling from a triangular distribution between 15 and 60 % of the edge length of the deformable object. For the collider start position we sample from a uniform distribution between the left and right corner of deformable object. We record 50 time steps per trajectory and 945 trajectories in total, which are split in 675/135/135 trajectories per train, evaluation and test set. A single data sample contains approx. 700 nodes: 57 nodes for the collider, 81 nodes for the mesh oft the deformable object and around 600 points in the subsampled point cloud. The mesh itself consists of 416 edges, the total number of edges is about 3 K depending on the deformation in the according time step. In contrast to the Poisson's ratio, the other adjustable material parameter in SOFA, the Young's modulus is kept constant for all samples at E = 5 000Pa. It describes the compressive stiffness when a force is applied lengthwise. The different material properties together with the different trapezoidal shapes introduce uncertainty in the form of multi-modality into the data. The reason for this is that different deformations result in states that cannot be clearly assigned to a single trapez-material combination. We construct this dataset because it comes with lower computational cost due to the restriction to 2d, but already allows for more general statements due to the non-trivial deformations and the multi-modality. Therefore, it is especially suitable as a proof-of-concept and for ablations. B.5 TISSUE MANIPULATION Here, a piece of tissue is deformed by a rigid gripper which could be part of a robot-assisted surgery scenario. To generate diversity, we generate random motions in a 2d plane and sample a random gripping point from the 19 top mesh points. We record 100 time steps per trajectory and 840 trajectories in total, which we split in 600/120/120 trajectories per train, evaluation and test set. A single data sample consists of approx. 1 200 nodes: 361 for the mesh, one for the gripper and about 850 for the point cloud. The mesh consists of 2 154 edges, which leads to a total number of about 3 800 edges depending on the time step. To ensure physically plausible deformation, each Poisson's ratio is assigned its specific Young's modulus from E ∈ {10 000, 80 000, 30 000}Pa. If instead it were kept the same for each Poisson's ratio, the gripper could penetrate the deformable object or pull it without touching it. The uncertainty in this dataset is mainly in the initial state, which can result in different deformations depending on the material from the same initial state. B.6 CAVITY GRASPING We randomly generate cone-shaped cavities with radii between 87.5% and 50% of the maximum possible gripping width. The cone shape helps to increase uncertainty in the form of multi-modality in the data, because the states resulting from deformation cannot be clearly assigned to a single 17 Published as a conference paper at ICLR 2023 cone-material combination. The deformable cavities are deformed by a gripper located at random positions in space. The positions are sampled form a hexahedron around the geometrical center of the cavity ensuring collision free starting positions. For the grasping, the gripper moves as quickly as it is allowed to the gripping position and then closes its fingers with constant velocity. We record 100 time steps per trajectory and 840 trajectories in total, which are split in 600/120/120 trajectories per train, evaluation and test set. A single data sample consists of approx. 2.4 K nodes: 750 for the mesh, 636 for the gripper and about 1 K for the point cloud. The mesh consists of 4 500 edges, the overall number of edges in the graph is about 8.5 K depending on the exact time step. The motivation for the creation of this environment is that a successful use of our method in this setting is an important step on the way to a real-world application. 18 Published as a conference paper at ICLR 2023 Figure 8: Visualization of a test trajectory in the Tissue Manipulation dataset from three different viewing angles (rows) at time step t = 70 for GGNS (left), the ground truth simulation (middle) and MGN (right). C QUALITATIVE RESULTS In addition to the qualitative illustrations in the main paper, we also provide further views and examples here: Figure 8 shows the same trajectory as Figure 4 but from three additional viewing angles. Figure 9 and Figure 10 show an overlay of the point cloud on the deformable object during the time step where the simulation is grounded by the point cloud. This representation is comparable to Figure 1 for the Cavity Grasping dataset. Furthermore, we provide example visualizations for a test rollout over time for the Deformable Plate task in Figure 11, for the Tissue Manipulation task in Figure 12, and for the Cavity Grasping in Figure 13. Throughout all tasks, GGNS closely matches the ground truth simulation for the complete rollout, achieving close to optimal results when provided with frequent point cloud information (k = 2). Opposed to this, MGN sometimes fails to predict the correct material, leading to poor predictions over time and large mismatches in the final system states. 19 Published as a conference paper at ICLR 2023 Figure 9: Overlay of the point cloud and the predicted mesh for two consecutive time steps t = [10, 11] in the Deformable Plate dataset. We repeat the point cloud from the earlier simulation step in both images for clarity. The illustration shows the correction behavior of GGNS by including the point cloud to ground the mesh based simulation in this time step. This can be observed particularly well in the upper left and right corners of the plate. Figure 10: Overlay of the point cloud and the predicted mesh for two consecutive time steps t = [70, 71] in the Tissue Manipulation dataset. We repeat the point cloud from the earlier simulation step in both images for clarity. The illustration shows the correction behavior of GGNS by including the point cloud to ground the mesh based simulation in the time step. 20 Published as a conference paper at ICLR 2023 Figure 11: Test rollout visualization for the Deformable Plate task. The last column depicts a close-up of the final time step, which is shown in full in the previous column. Here, we additionally show qualitative results for the GGNS+LSTM model. We can see that for k = 2 it matches the ground truth quite well, while for k = 5 a large error occurs due to a prediction of the wrong material. 21 Published as a conference paper at ICLR 2023 Figure 12: Test rollout visualization for the Tissue Manipulation task. The last column depicts a close-up of the final time step, which is shown in full in the previous column. Figure 13: Test rollout visualization for the Cavity Grasping task. The last column depicts a close-up of the final time step, which is shown in full in the previous column. 22 Published as a conference paper at ICLR 2023 Figure 14: Performance for different changes in hyperparameter choices (grey) on the Deformable Plate dataset in comparison to our default model (blue) with k = 1. Error bars indicate one standard deviation. The top row shows the error for the next-step prediction, the bottom row that of full rollouts. We find that a suitable noise scale is crucial for stable rollouts, and that more information in the form of additional edges between the different types of graph nodes generally improves performance. Given enough Message Passing (MP) blocks, further increases in model capacity only lead to modest improvements. D ABLATIONS D.1 HYPERPARAMETER CHOICES Figure 14 compares the performance of GGNS for different hyperparameter choices. We find that the most importance parameters are the number of Message Passing (MP) blocks and the scale of the noise used in training. Both are crucial to achieve a good performance over multi-step rollouts. In terms of training noise, there is a 1-step/multi-step loss trade-off. Other than that, our approach is robust to variations of the different hyperparameters. In terms of graph connectivity, it can be seen that all settings achieve similar performance. Additional information in the form of more local edges helps slightly, while larger connectivity radii do not do much. A detailed listing of the used edge radii is display in Table 2. In particular, the use of significantly more edges in the Equal Radii setting does not provide a significant advantage, which is why we use weaker connectivity Full Graph that saves computation time. The results for the Reduced Graph settings show that edges within the point cloud are not mandatory. For this reason, we omit these edges in the more complex 3d tasks in favor of shorter computation time. D.2 NOISY POINT CLOUDS Besides the ablations on our hyperparameter choices, we present further ablations on more realistic point cloud data. For this purpose, we use point clouds with additional noise and only partial observability to get closer to real world point clouds. Figure 15 shows the results for additional ablations on different scales of noise on the point cloud data of the Deformable Plate dataset. We add noise to the point cloud positions during training, evaluation and testing. This makes it more difficult to infer the correct behavior from the point cloud, but provides a more realistic scenario for, because real world point clouds often exhibit large noise. The results show the robustness of our 23 1071061051-step MSELatent Sizea# MLP Layersb# MP BlockscNoise StddGraph Connectivitye6412825610610510410310250-step Rollout MSEf123g1357h0.00.0010.010.1iFullGraphEqualRadiiReducedGraphj Published as a conference paper at ICLR 2023 r o r r E d e r a u q S n a e M 10−2 10−3 10−4 10−5 10−6 10−2 10−3 10−4 10−5 10−6 10−2 10−3 10−4 10−5 10−6 0.0 0.001 0.005 0.01 MGN (M) Noise Std MGN 0.0 0.001 0.005 0.01 MGN (M) Noise Std MGN 0.0 0.001 0.005 0.01 MGN (M) Noise Std MGN (a) k = 1 (b) k = 2 (c) k = 5 Figure 15: Additional ablations for more realistic point cloud data on two datasets. Here, four different noise levels on the point cloud are evaluated on the Deformable Plate datset. Different grounding frequencies of k = 1 in (a), k = 2 in (b) and k = 5 in (c). GGNS performs better than the baseline even when noise in the scale of the training noise of σ = 0.01 is applied to the point cloud. method: Even when a noise level of σ = 0.01 is applied to the point cloud during testing, it clearly outperforms the baseline. This noise level corresponds to the amount of noise used on the mesh during training. D.3 PARTIAL OBSERVABLE POINT CLOUDS For the ablations on the partial observability, we use the Cavity Grasping dataset. We generate the partial point clouds by using only one, two or five virtual point cloud cameras when using raycasting. The resulting point clouds are visualized for better clarity in Figure 17 for an example test trajectory at time step t = 0. One camera results in a coverage from only one half of the outer surface of the cavity and two cameras cover almost the complete outer hull but not the inner surface. With five cameras, the point cloud covers almost the entire mesh completely, except for the inside and bottom. The resulting point clouds have a very different number of points: About 400 for one camera, about 600 for two cameras, and about 1000 for five cameras compared to 750 mesh nodes for the cavity. The results in Figure 16 show that even with these much less complete point clouds, GGNS still outperforms the baseline. For k ≤ 5 this is the case even if the baseline has access to the full initial state, which GGNS has not. 24 Published as a conference paper at ICLR 2023 10−3 10−4 10−5 10−6 r o r r E d e r a u q S n a e M 10−3 10−4 10−5 10−6 10−3 10−4 10−5 10−6 1 2 # of Cameras 5 MGN (M) MGN 1 2 # of Cameras 5 MGN (M) MGN 1 2 # of Cameras 5 MGN (M) MGN (a) k = 2 (b) k = 5 (c) k = 10 Figure 16: Additional ablations for more realistic point cloud data on the Cavity Grasping dataset. For this purpose, different numbers of cameras are used when generating the point cloud using raycasting. Comparison for three different grounding frequencies:k = 2 in (a), k = 5 in (b) and k = 10 in (c). GGNS outperforms the baseline for all camera settings and grounding frequencies k. Figure 17: Visualization of the point clouds using one, two or five cameras for the raycasting and the corresponding mesh for reference. It is clearly visible how better coverage of the object is achieved as the number of cameras increases. Table 2: Edge radii for the connectivities between point clouds P and meshes M on the 2D Deformable Plate Dataset. Setting P − P M − P World Full Graph Equal Radii Reduced Graph MGN 0.1 0.2 0.0 0.0 0.08 0.2 0.08 0.0 - - - 0.35 25 Published as a conference paper at ICLR 2023 n o i n U r e v o n o i t c e s r e t n I 1 0.95 0.9 0.85 0.8 n o i n U r e v o n o i t c e s r e t n I 1 0.95 0.9 0.85 0.8 GGNS MGN (mat) MGN GGNS MGN (mat) MGN (a) m + 10-step IoU Evaluation (b) m + 10-step IoU Evaluation without initial mesh Figure 18: (a) Comparison of our model to the baseline results on the Plate cataset using the m + 10- step Evaluation routine. (b) Results when using an initial mesh generated from the point cloud. GGNS outperforms the MGN baseline even if it has access to the initial ground truth mesh. 10−5 r o r r E d e r a u q S n a e M p e t s - 1 10−6 0 GGNS GGNS (k=2) GGNS (k=5) MGN(M) MGN 10−5 10−6 r o r r E d e r a u q S n a e M p e t s - 1 10−2 10−3 10−4 r o r r E d e r a u q S n a e M p e t s - 0 0 1 100 200 Epochs (a) Train loss 300 400 10−7 0 100 200 Epochs 300 400 10−5 0 100 200 Epochs 300 400 (b) 1-step Evaluation Loss (c) 100-step Evaluation Loss Figure 19: Exemplary learning curves for the Cavity Grasping task. The light shaded area indicates one standard deviation. Both GGNS and the baselines learn the task pretty similarly in terms of 1-step predictions. Our model is only evaluated for the k = 2 and k = 5 variant during full rollout evaluation. Here, we can clearly see the advantage of using the point cloud information. r o r r E d e r a u q S n a e M t u o l l o R 10−2 10−3 10−4 10−5 10−6 MGN(1H) MGN MGN(1H) MGN MGN(1H) MGN Tissue Cavity Plate Figure 20: Comparison of the MGN baseline with a version using the one-hot encoded edge types instead of an explicit edge type partitioning indicated by MGN (1H). Both are compared for all three tasks and no significant advantage of the explicit edges partitioning could be found. For this reason, GGNS uses the one-hot encoding, because it is both conceptually simpler and requires less computational power. The MGN baseline still uses explicit edge type partitioning throughout this work, following Pfaff et al. (2021). 26 Published as a conference paper at ICLR 2023 Table 3: Configuration of the hyperparameters and key information of the training of our model for all experiments. Parameter Value 32 Adam 5 × 10−4 LeakyReLU Batch Size Optimizer Learning Rate Activation Function Aggregation Function Mean Encoder MP-Blocks MLP Layers Latent Dimension Decoder Residuals Connections Around each MP block Training Noise Std Linear Layer 5 1 128 1-layer MLP 0.01 Table 4: Task specific configuration and hyperparameters for our experiments. We vary the graph connectivity and the number of training epochs for different tasks to control the total training time of our method. Parameter Plate Tissue Cavity Connectivity Setting Number of Epochs Approx. Training Time Full Graph Reduced 1000 21 : 00 h 800 40 : 00 h Reduced 400 38 : 00 h E HYPERPARAMETERS Table 3 gives an overview of hyperparameters shared across tasks. Since GNS are generally robust to the choice of hyperparameters (c.f. D), we use the same hyperparameters for all task and for both, GGNS and MGN for simplicity. The only hyperparameters that vary over tasks are the graph connectivity and the number of training epochs, as shown in Table 4. We adapt these parameters to control for the total training time on a single GPU. 27
http://arxiv.org/abs/2302.11861v2
2023-06-27T00:19:14
2023-02-23T08:59:56
Out-of-Domain Robustness via Targeted Augmentations
Models trained on one set of domains often suffer performance drops on unseen domains, e.g., when wildlife monitoring models are deployed in new camera locations. In this work, we study principles for designing data augmentations for out-of-domain (OOD) generalization. In particular, we focus on real-world scenarios in which some domain-dependent features are robust, i.e., some features that vary across domains are predictive OOD. For example, in the wildlife monitoring application above, image backgrounds vary across camera locations but indicate habitat type, which helps predict the species of photographed animals. Motivated by theoretical analysis on a linear setting, we propose targeted augmentations, which selectively randomize spurious domain-dependent features while preserving robust ones. We prove that targeted augmentations improve OOD performance, allowing models to generalize better with fewer domains. In contrast, existing approaches such as generic augmentations, which fail to randomize domain-dependent features, and domain-invariant augmentations, which randomize all domain-dependent features, both perform poorly OOD. In experiments on three real-world datasets, we show that targeted augmentations set new states-of-the-art for OOD performance by 3.2-15.2%.
[ "Irena Gao", "Shiori Sagawa", "Pang Wei Koh", "Tatsunori Hashimoto", "Percy Liang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11861v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11861v2", "@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" ]
Out-of-Domain Robustness via Targeted Augmentations Irena Gao * 1 Shiori Sagawa * 1 Pang Wei Koh 2 3 Tatsunori Hashimoto 1 Percy Liang 1 3 2 0 2 n u J 7 2 ] G L . s c [ 2 v 1 6 8 1 1 . 2 0 3 2 : v i X r a Abstract Models trained on one set of domains often suf- fer performance drops on unseen domains, e.g., when wildlife monitoring models are deployed In this work, we in new camera locations. study principles for designing data augmenta- tions for out-of-domain (OOD) generalization. In particular, we focus on real-world scenar- ios in which some domain-dependent features are robust, i.e., some features that vary across domains are predictive OOD. For example, in the wildlife monitoring application above, im- age backgrounds vary across camera locations but indicate habitat type, which helps predict the species of photographed animals. Moti- vated by theoretical analysis on a linear setting, we propose targeted augmentations, which se- lectively randomize spurious domain-dependent features while preserving robust ones. We prove that targeted augmentations improve OOD per- formance, allowing models to generalize better with fewer domains. In contrast, existing ap- proaches such as generic augmentations, which fail to randomize domain-dependent features, and domain-invariant augmentations, which ran- domize all domain-dependent features, both per- form poorly OOD. In experiments on three real- world datasets, we show that targeted augmen- tations set new states-of-the-art for OOD perfor- mance by 3.2–15.2%. 1. Introduction Real-world machine learning systems are often deployed on domains unseen during training. However, distribution shifts between domains can substantially degrade model performance. For example, in wildlife conservation, where *Equal contribution of Washington Irena Gao <[email protected]>, <[email protected]>. 3Google Brain. 1Stanford University 2University to: Sagawa Correspondence Shiori Proceedings of the 40 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s). 1 ecologists use machine learning to identify animals pho- tographed by static camera traps, models suffer large per- formance drops on cameras not included during train- ing (Beery et al., 2018). Out-of-domain (OOD) general- ization in such settings remains an open challenge, with recent work showing that current methods do not perform well (Gulrajani & Lopez-Paz, 2020; Koh et al., 2021). One approach to improving robustness is data augmenta- tion, but how to design augmentations for OOD robustness remains an open question. Training with generic augmen- tations developed for in-domain (ID) performance (e.g., random crops and rotations) has sometimes improved OOD performance, but gains are often small and inconsistent across datasets (Gulrajani & Lopez-Paz, 2020; Wiles et al., 2021; Hendrycks et al., 2021). Other work has designed augmentations to encourage domain invariance, but gains can be limited, especially on real-world shifts (Yan et al., 2020; Zhou et al., 2020a; Gulrajani & Lopez-Paz, 2020; Ilse et al., 2021; Yao et al., 2022). Some applied works have shown that heuristic, application-specific augmen- tations can improve OOD performance on specific tasks (Tellez et al., 2018; 2019; Ruifrok et al., 2001). However, it is unclear what makes these augmentations successful or how to generalize the approach to other OOD problems. In this work, we study principles for designing data aug- mentations for OOD robustness. We focus on real-world scenarios in which there are some domain-dependent fea- tures that are robust, i.e., where some features that vary across domains are predictive out-of-domain. For exam- ple, in the wildlife monitoring application above, image backgrounds vary across cameras but also contain features that divulge the static camera's habitat (e.g., savanna, for- est, etc.). This information is predictive across all domains, as wild animals only live in certain habitats; it can also be necessary for prediction when foreground features are in- sufficient (e.g., when animals are blurred or obscured). How might data augmentations improve OOD robustness in such settings? We first theoretically analyze a linear regression setting and show that unaugmented models in- cur high OOD risk when the OOD generalization prob- lem is underspecified, i.e., when there are fewer training domains than the dimensionality of the domain-dependent features. This insight motivates targeted augmentations, Out-of-Domain Robustness via Targeted Augmentations which selectively randomize spurious domain-dependent features while preserving robust ones, reducing the effec- tive dimensionality and bringing the problem to a fully specified regime. We prove that targeted augmentations improve OOD risk in expectation, allowing us to generalize with fewer domains. In contrast, existing approaches such as generic augmentations, which fail to randomize domain- dependent features, and domain-invariant augmentations, which randomize all domain-dependent features, both suf- fer high OOD risk: the former fails to address the under- specification issue, and the latter eliminates robust domain- dependent features that are crucial for prediction. To our knowledge, our analysis is the first to characterize how dif- ferent augmentation strategies affect OOD risk and its scal- ing with the number of domains. It also introduces a natu- ral theoretical setting for OOD generalization, in which the distribution shift arises from sampling finite training do- mains, departing from prior work that considers worst-case shifts (Rosenfeld et al., 2020; Chen et al., 2021b). Empirically, we show targeted augmentations are effec- tive on three real-world datasets spanning biomedical and wildlife monitoring applications: CAMELYON17-WILDS (Bandi et al., 2018; Koh et al., 2021), IWILDCAM2020- WILDS (Beery et al., 2021; Koh et al., 2021), and BIRDCALLS, which we curate from ornithology datasets (Navine et al., 2022; Hopping et al., 2022; Kahl et al., 2022). Targeted augmentations outperform both generic augmentations and domain invariance baselines to achieve state-of-the-art by substantial margins: 33.3% → 36.5% on IWILDCAM2020-WILDS, 75.3% → 90.5% on CAMELYON17-WILDS, and 31.8% → 37.8% on BIRD- CALLS. Overall, our work derives principles for designing data augmentations that can substantially improve out-of- domain performance in the wild. 2. Problem setting Domain generalization. In domain generalization, our goal is to generalize to domains unseen during training. In particular, we seek a model θ ∈ Θ that minimizes the OOD risk under a meta distribution P , where ROOD(θ) ≜ EP [l(θ; (x, y))], and P comprises data from all possible domains Dall: (cid:88) P (x, y) = P (x, y | d)P (d), d∈Dall (1) (2) where we assume Dall is countable to keep notation simple. To obtain training domains Dtrain ⊂ Dall, we sample D domains without replacement from the meta distribution P . This yields the training distribution comprising Dtrain, (cid:88) P (x, y | d)P train(d), (3) P train(x, y) = d∈Dtrain 2 where P train(d) is the probability of drawing domain d from the training domains Dtrain at training time. The chal- lenge is to generalize from the sampled training domains Dtrain to all possible domains Dall that make up the un- derlying meta distribution. In real-world experiments and simulations, we estimate OOD performance by evaluating on held-out domains Dtest, where Dtest ∩ Dtrain = ∅. Feature decomposition. In many real-world shifts, such as those in Section 2.1, domain-dependent features contain predictive information that generalizes across all domains. To capture such settings, we introduce the feature decom- position x = f (xobj, xnoise, xd:robust, xd:spu) (Figure 1 left). Here, features are split along two axes: whether they are robust (i.e., predictive out-of-domain), and whether they are domain dependent (i.e., varying across domains). We formalize these two criteria by (in)dependence with label y and domain d, respectively, in the meta distribution P : xobj, xd:robust ̸⊥⊥ y xnoise, xd:spu ⊥⊥ y xd:robust, xd:spu ̸⊥⊥ d xobj, xnoise ⊥⊥ d. (4) For example, y depends on robust features xobj and xd:robust, but is independent of non-robust features xnoise and xd:spu, which yields P (y | x) = P (y | xobj, xd:robust). We note that these independencies need not hold in the training distribution P train due to finite-domain effects; for instance, when D is small, there may be a dependence be- tween the label y and a spurious feature xd:spu in the train- ing distribution P train, leading models to learn such fea- tures and generalize poorly out-of-domain. 2.1. Real-world datasets We study three real-world datasets (Figure 1 right), which have both robust and spurious domain-dependent features. classification from camera trap images Species (IWILDCAM2020-WILDS). In iWildCam (Beery et al., 2021; Koh et al., 2021), the task is to classify an animal species y from an image x captured by a static camera trap d. There are 243 cameras in Dtrain. Images from the same camera share nearly identical backgrounds. While low-level details of each domain's background are generally spurious (e.g., whether there are two trees or three), backgrounds also contain habitat features, which are predictive across domains. For example, in Figure 1, cameras 23 and 97 are installed in dry Kenyan savannas, while camera 54 observes a leafy Guatemalan forest. The two regions have different label distributions: in practice, wild African elephants are very unlikely to set foot in Guatemala. Further, habitat features are often necessary for prediction; foregrounds are often blurry or occluded Out-of-Domain Robustness via Targeted Augmentations Figure 1. We model inputs as x = f (xobj, xd:robust, xd:spu, xnoise), where each of the four types of features are either (i) dependent on the domain d or not and (ii) dependent on the output label y or not, both in the meta distribution P . We study targeted augmentations, which randomize xd:spu but preserve xd:robust, and we consider three real-world datasets (Beery et al., 2021; Bandi et al., 2018; Koh et al., 2021), each of which have both robust and spurious domain-dependent features. (see Figure 8), so randomizing all domain-dependent features discards useful information. 3. Data augmentation in identification histopathology In Camelyon17 slides Tumor (CAMELYON17-WILDS). (Bandi et al., 2018; Koh et al., 2021), the task is to classify whether a patch of a histopathology slide contains a tumor. Slides are contributed by hospitals d. Variations in imag- ing technique result in domain-specific stain colorings, which spuriously correlate with y in the training set (see Figure 6). Domains also vary in distributions of patient cancer stage. In Camelyon17's 3 training hospitals, most patients in Hospitals 1 and 2 have earlier-stage pN1 breast cancer, whereas nearly half of the patients in Hospital 3 have later-stage pN2 stage cancer. The pN stage relates to the size and number of lymph node metastases, which is correlated with other histological tumor features. These useful tumor features thus depend on both d and y. Bird species recognition from audio recordings (BIRD- CALLS). To monitor bird populations, ornithologists use machine learning to identify birds by their calls in audio recordings. However, generalizing to recordings from new microphones can be challenging (Joly et al., 2021). We introduce a new bird recognition dataset curated from pub- licly released data (see Appendix A.3 for details). The task is to identify the bird species y vocalizing in audio clip x recorded by microphone d. There are 9 microphones in Dtrain, which vary in their model and location. While low- level noise and microphone settings (e.g., gain levels) only spuriously correlate with y, other background noises indi- cate habitat, like particular insect calls in the Amazon Basin that are absent from other regions (Figure 1). As in iWild- Cam, these habitat indicators reliably predict y. We train models on mel-spectrograms of audio clips. Augmentation types. We use the feature decomposition from Section 2 to model three types of data augmentations. Generic augmentations designed for in-domain settings of- ten do not randomize domain-dependent features. For ex- ample, horizontal flips modify object orientation; this fea- ture varies across examples but is typically distributed sim- ilarly across domains. We model generic augmentations as varying xnoise, which is label- and domain-independent: Agen(x) = f (xobj, x′ noise, xd:robust, xd:spu), (5) where x′ noise is drawn from some augmentation distribution. Domain-invariant augmentations Ainv aim to randomize all domain-dependent features xd:robust and xd:spu: Ainv(x) = f (xobj, xnoise, x′ d:robust, x′ d:spu are drawn from some distribution. targeted augmentations Atgt preserve xd:robust where x′ Finally, while aiming to randomize xd:spu: d:robust, x′ d:spu), (6) Atgt(x) = f (xobj, xnoise, xd:robust, x′ d:spu), (7) where x′ d:spu is drawn from some distribution. Applying generic, domain-invariant, and targeted augmentations to the training distribution P train yields new distributions over examples P train , respectively. Intuitively, tgt when augmentations preserve labels, they break any depen- dence between the randomized features and the label y. gen , P train , and P train inv Training. Given N training examples {(x(i), y(i))}N i=1 drawn from P train, we learn a model that minimizes the average loss on the (augmented) training data: ˆθ(unaug) = arg min θ E ˆP train [l(θ; (x, y))] ˆθ(aug) = arg min θ E ˆP train aug [l(θ; (x, y))] , (8) (9) 3 iWildCam2020-WILDS (D=243 cameras) Camelyon17-WILDS (D=3 hospitals) BirdCalls (D=9 microphones) animal foreground cell morphology bird calls low-level background features stain color microphone gain settings, low-level noise habitat features in background cancer stage, tumor size and density habitat noise (other fauna, rain levels) xy-position patch orientation, cell xy-positions x-position Copy-Paste (Same Y) Stain Color Jitter (Tellez et al., 2018) Copy-Paste + Jitter (Region)TARGETED AUGMENTATIONdependent on labelindependent of domaindependent on domainindependent of label Out-of-Domain Robustness via Targeted Augmentations Figure 2. Augmentation examples for the three real-world datasets, including targeted augmentations Copy-Paste (Same Y) for iWild- Cam, Stain Color Jitter for Camelyon17, and Copy-Paste + Jitter (Region) for BirdCalls. Targeted augmentations randomize xd:spu but preserve xd:robust. In Section 5.1, we compare to modified Copy-Paste augmentations in the ablation column. where ˆP train and ˆP train aug are the empirical distributions over the unaugmented and augmented training data, respec- tively. The superscript aug can stand for gen, inv, or tgt. 3.1. Targeted augmentations for real-world datasets to paste bird calls onto other training set recordings from the same geographic region (Southwestern Amazon Basin, Hawaii, or Northeastern United States) (Figure 2). After pasting the bird call, we also jitter hue levels of the spectro- gram to simulate randomizing microphone gain settings. We instantiate targeted augmentations on real-world datasets from Section 2.1. Full details are in Appendix B. 4. Analysis and simulations Species classification from camera trap images (IWILDCAM2020-WILDS). In iWildCam, image back- grounds are domain-dependent features with both spurious and robust components. While low-level background fea- tures are spurious, habitat features are robust. Copy-Paste (Same Y) transforms input (x, y) by pasting the animal foreground onto a random training set background-but only onto backgrounds from training cameras that also observe y (Figure 2). This randomizes low-level back- ground features while roughly preserving habitat. We use segmentation masks from Beery et al. (2021). identification histopathology Tumor slides in (CAMELYON17-WILDS). In Camelyon17, stain color is a spurious domain-dependent feature, while stage-related Stain features are robust domain-dependent features. Color Jitter (Tellez et al., 2018) transforms x by jittering its color in the hematoxylin and eosin staining color space (Figure 2). In contrast, domain-invariant augmentations can distort cell morphology to attain invariance. Bird species recognition from audio recordings (BIRD- CALLS). In BirdCalls, low-level noise and gain levels are spurious domain-dependent features, while habitat-specific noise is a robust domain-dependent feature. Copy-Paste + Jitter (Region) leverages time-frequency bounding boxes 4 We now motivate targeted augmentations and illustrate the shortcomings of generic and domain-invariant augmenta- tions by analyzing a linear setting extended from Section 2. To our knowledge, our analysis is the first to character- ize how different augmentation strategies affect OOD risk and its scaling with the number of domains. It also pro- poses a natural theoretical setting for OOD generalization, in which the distribution shift arises from finite-domain ef- fects, departing from prior work that considers worst-case shifts (Rosenfeld et al., 2020; Chen et al., 2021b). 4.1. Linear regression setting Data distribution. We model each domain d as hav- ing latent attributes μ(d) ≜ [μ(d) spu], which affect the distribution of the corresponding domain-dependent fea- tures xd:robust, xd:spu. In iWildCam, μ(d) robust intuitively cor- responds to a habitat indicator and label prior. In the linear setting, these domain attributes are drawn as robust, μ(d) μ(d) robust ∼ N (0, τ 2I) spu ∼ N (0, τ 2I). μ(d) (10) The dimensionality of μ(d) is pdom, and the dimen- sionality of μ(d) Following the feature decomposition in Figure 1, we consider inputs x = [xobj, xnoise, xd:robust, xd:spu]. The training data is drawn is probust. robust iWildCamCamelyonBirdCallsOriginal ImageGeneric AugmentationsDesigned for in-distribution performance, often only randomize RandAugment MixUp CutMix Cutout RandAugment MixUp CutMix Cutout SpecAugment MixUp Noise Reduction Random PassLISADesigned for domain invarianceTargeted AugmentationRandomize , preserve AblationRandomize and Out-of-Domain Robustness via Targeted Augmentations uniformly from D training domains. Within each domain, inputs x are drawn according to the following distribution: xobj ∼ N (0, I) xnoise ∼ N (0, I) robust, σ2I) spu, σ2I). xd:robust|d ∼ N (μ(d) xd:spu|d ∼ N (μ(d) (11) The domain-dependent features xd:robust and xd:spu are cen- tered around the corresponding domain attributes μ(d) robust and μ(d) spu, while the domain-independent features xobj and xnoise are not. We define the variance ratio γ2 ≜ τ 2/σ2, which is the ratio of variances in μ(d) and feature noise. When γ2 > 1, examples within a domain tend to be more similar to each other than to examples from other domains; we consider the typical setting in which γ2 > 1. The output y ∈ R is a linear function of both xobj and robust domain attribute μ(d) robust: y = β⊤ objxobj + β⊤ robustμ(d) robust + N (0, σ2 ε ). (12) For convenience, we define the parameters for domain- dependent components as βdom ≜ [βrobust, βspu] where βspu = 0. Although y depends on the domain attributes μ(d), models cannot directly observe μ(d), and instead only observe the noised features xd:robust, xd:spu. Because there are finite domains in the training distribution, μ(d) robust and μ(d) robust not only from xd:robust, but also from xd:spu by memorizing the (μ(d) spu) pairings. The fewer domains present dur- ing training, the simpler memorization is for the model, as there are fewer (μ(d) spu) pairings. However, since μ(d) robust and μ(d) spu are independent in the true data generating process, relying on xd:spu does not generalize OOD. spu are coupled: models can infer μ(d) robust, μ(d) robust, μ(d) Augmentations. Recall from Section 3 that generic, domain-invariant, and targeted augmentations replace com- ponents of x with draws from an augmentation distribution. We preserve y when augmenting and fix the augmentation distributions to match the data generating distribution: x′ noise ∼ N (0, I) d:robust ∼ N (0, (σ2 + τ 2)I) x′ d:spu ∼ N (0, (σ2 + τ 2)I). x′ (13) Models. We study linear models, specifically ordinary least squares linear regression in theoretical analysis (Sec- tion 4.2) and ridge regression in simulations (Section 4.3). problem is underspecified (Theorem 1), i.e., when there are fewer training domains than the dimensionality of the domain-dependent features, as is typically the case in real- world domain generalization problems. This motivates targeted augmentations; by eliminating spurious domain- dependent features, targeted augmentations bring the prob- lem to a fully specified regime. We prove that targeted aug- mentations improve OOD risk in expectation (Theorems 2 and 3), whereas generic and domain-invariant augmenta- tions incur high OOD risk (Corollary 1 and Theorem 3). Our analysis assumes infinite data per domain, but finite training domains. This allows us to focus on the effects of OOD generalization while simplifying traditional sample complexity issues, which are better understood. Overview. We study the expected excess OOD risk E (cid:2)ROOD(θ) − ROOD(θ∗)(cid:3), where the expectation is over random draws of training domains, and θ∗ ≜ arg minθ ROOD(θ) is the oracle model that attains opti- mal performance on the meta distribution P . To show that targeted augmentations improve the expected OOD risk, we lower bound the expected excess risk for unaugmented models, upper bound it for models with targeted augmenta- tions, and then demonstrate a gap between the two bounds. Proofs are in Appendix C. Lower bound for excess OOD risk with no or generic augmentations. When the number of domains is smaller than the dimensionality of the domain-dependent features (D < pdom), unaugmented models perform poorly OOD. Theorem 1 (Excess OOD risk without augmentations). If D < pdom, the expected excess OOD risk of the unaug- mented model is bounded below as (cid:104) ROOD(ˆθ(unaug)) − ROOD(θ∗) (cid:105) E ≥ τ 2γ2 ∥βrobust∥2 1 + γ2 (cid:18) 1 − (cid:19) . D pdom (cid:80)D Proof sketch. The learned estimator has weights ˆθ(unaug) dom = (σ2I + M )−1M βdom, where M ≜ 1 d=1 μ(d)μ(d)⊤ is D a random Wishart matrix. As we only observe D < pdom training domains, M is not full rank, with nullity pdom −D. We lower bound the overall excess risk by the excess risk incurred in the null space of M , which can be written as τ 2γ2 i βdom)2; each ui is an eigenvector with a 1+γ2 zero eigenvalue and the summation term is thus the squared norm of a projection of βdom onto the null space of M . In expectation, the squared norm is ||βdom||2(1 − D ) be- pdom cause M has spherically symmetric eigenvectors. Finally, ∥βdom∥ = ∥βrobust∥ because βspu = 0. (cid:80)pdom−D i=1 (u⊤ 4.2. Theory In this section, we first show that unaugmented models fail to generalize OOD when the domain generalization To contextualize the bound, we discuss the relative scale of the excess OOD risk with respect to the OOD risk of the oracle model ROOD(θ∗) = σ2 ε + τ 2∥βrobust∥2/(1 + γ2), where the first term is the irreducible error from noise in 5 Out-of-Domain Robustness via Targeted Augmentations the output y. The excess error of the unaugmented model is higher than the second term by a factor of γ2(1 − D/pdom), where γ2 > 1 is the variance ratio and D is the number of domains. Thus, in typical settings where D is small relative to pdom and the variance ratio γ2 is large, unaugmented models suffer substantial OOD error. Models trained with generic augmentations have the same lower bound (Corollary 1 in Appendix C.4), as applying generic augmentations results in the same model as unaug- mented training in the infinite data setting. Our analysis captures the shortcomings of generic augmentations, which primarily improve sample complexity; as evident in the high OOD risk even in the infinite data setting, improving sample complexity alone fails to achieve OOD robustness. Motivating targeted augmentations. The core problem above is underspecification, in which the number of do- mains is smaller than the dimensionality of the domain- dependent features (D < pdom); there are fewer instances of μ(d) than its dimensionality (although E[xx⊤] is full rank due to feature noise). In such regimes, it is not possible to approximate βdom well, and models incur high OOD risk. We can mitigate this via targeted augmentations, which randomizes the spurious domain-dependent feature. This decreases the effective dimensionality from pdom to probust, the dimensionality of only the robust components, as mod- els would no longer use the spurious feature. Upper bound for excess OOD risk with targeted aug- mentations. With targeted augmentations, the problem (even without feature noise) is no longer underspecified when the number of training domains D is large enough relative to probust < pdom. In this fully specified regime, we can upper bound the expected excess OOD risk as O(log D/D). This resembles the standard rates for ran- dom design linear regression up to a log factor (Hsu et al., 2011; Gy ̈orfi et al., 2002); standard analysis shows that ex- cess ID risk has a O(1/N ) convergence rate where N is the number of samples, and we show that excess OOD risk has an analogous convergence rate as a function of the number of domains instead of examples. Theorem 2 (Excess OOD risk with targeted augmenta- tions). Assume γ2 > 1. For any 0 < r < 1 and large enough D such that D > 2(probust+2) log(4Dprobust)/(1− r)2, the excess OOD risk is bounded above as (cid:104) (cid:105) ROOD(ˆθ(tgt)) − ROOD(θ∗) E ≤ τ 2γ2 ∥βrobust∥2 1 + γ2 (cid:18) 1 D + 2 log(4Dprobust)(probust + 2) D(1 + γ2r)2 (cid:19) . Proof sketch. The learned estimator has weights ˆθ(tgt) 0 and ˆθ(tgt) where Mrobust ≜ 1 D spu = robust = (σ2I + Mrobust)−1Mrobustβrobust, is a random robustμ(d)⊤ d=1 μ(d) (cid:80)D robust σ4(τ 2−λi)2 (σ2+τ 2)(λi+σ2)2 (u⊤ Wishart matrix. (cid:80)probust i=1 The excess risk can be written as i βrobust)2, where λi and ui are eigenvalues and eigenvectors of Mrobust, respectively. Note that this excess risk is low when D is sufficiently large rela- tive to probust such that the eigenvalues are sufficiently close to their expected value τ 2. We upper bound the excess OOD risk by applying concentration of measure arguments from Zhu (2012) to the eigenvalues of Mrobust. Compared to the lower bound for unaugmented models (Theorem 1), this upper bound has qualitatively different behavior. It depends on probust instead of pdom, and it con- verges to 0 at a fast rate of O(log D/D) whereas the lower- bound is a negative linear function of the number of D. Targeted augmentations improve expected OOD risk. We now combine the lower and upper bounds to show that targeted augmentations improve expected OOD risk. Theorem 3 (Targeted augmentations improve OOD risk). If γ2 > 1 and probust is small relative to pdom such that probust < pdom log(2pdom) * 1 4(1 + γ4/(γ2 − 1)2) , then for D such that 4γ4 D > (γ2 − 1)2 (probust + 2) log(2pdom) D < pdom − 4(probust + 2) log(2pdom), the improvement in expected OOD risk is positive: (cid:104) (cid:105) ROOD(ˆθ(unaug)) − ROOD(ˆθ(tgt)) E > 0. As expected, the minimum and maximum number of do- mains for which there is a provable gap is proportional to probust and pdom, respectively. However, there is some looseness in the bound; in simulations (Section 4.3), we see a substantial gap consistent with the above result, including for D outside the proven range. Domain-invariant augmentations incur high OOD er- ror. Finally, we show that domain-invariant augmentations incur high OOD risk in expectation. Theorem 4 (OOD error with domain-invariant augmenta- tions). For all D, expected OOD risk is E[ROOD(ˆθ(inv)) − ROOD(θ∗)] = τ 2γ2∥βrobust∥2 1 + γ2 . Because domain-invariant augmentations randomize all domain-dependent features, models do not use any domain- dependent features, including the robust components that are crucial for prediction. As a result, the expected OOD risk is high (higher than the lower bound for unaugmented models in Theorem 1), and the error does not decay with the number of domains D. 6 Out-of-Domain Robustness via Targeted Augmentations behavior, resulting in an ID and OOD improvement over unaugmented training (also see Figure 11 in Appendix D). However, the OOD error of generic augmentation only de- cays slowly with D and is significantly higher than targeted augmentation for D < 1000. Domain-invariant augmenta- tion results in a constant level of OOD error, which im- proves over the unaugmented and generic models for small values of D, but underperforms once D is larger. Overall, our simulations corroborate the theory and show that targeted augmentations offer significant OOD gains in the linear regression setting. In contrast, generic and domain-invariant augmentations improve over unaug- mented training only in the low-sample regime. 5. Experiments on real-world datasets We return to the real-world datasets (IWILDCAM2020- WILDS, CAMELYON17-WILDS, BIRDCALLS) and aug- mentations introduced in Section 2.1, where we compare targeted augmentations to unaugmented training, generic augmentations, and domain invariance baselines. Generic augmentations. On image datasets iWildCam and Camelyon17, we compare to RandAugment (Cubuk et al., 2020), CutMix (Yun et al., 2019), MixUp (Zhang et al., 2017), and Cutout (DeVries & Taylor, 2017). On audio dataset BirdCalls, we compare to MixUp, SpecAug- ment (Park et al., 2019), random low / high pass filters, and noise reduction via spectral gating (Sainburg, 2022). Since the targeted augmentation for BirdCalls (Copy-Paste + Jit- ter (Region)) includes color jitter as a subroutine, we also include a baseline of augmenting with only color jitter. Domain invariance baselines. We compare to LISA (Yao et al., 2022), a data augmentation strategy that aims to en- courage domain invariance by applying either MixUp or CutMix to inputs of the same class across domains. We also compare to other domain invariance algorithms that do not involve augmentation: (C)DANN (Long et al., 2018; Ganin et al., 2016), DeepCORAL (Sun & Saenko, 2016; Sun et al., 2017), and IRM (Arjovsky et al., 2019). Samples of the augmentations are shown in Figure 2. Addi- tional experimental details can be found in Appendix E.2. Code annd BIRDCALLS are released at this link. 5.1. Results Figure 4 plots the average ID versus OOD performance of each method. On all three datasets, targeted augmentations significantly improve OOD performance. Compared to the best-performing baseline, targeted augmentations im- prove OOD Macro F1 on iWildCam from 33.3% → 36.5%, OOD average accuracy on Camelyon17 from 75.3% → 90.5%, and OOD Macro F1 on BirdCalls from 31.8% → Figure 3. Targeted augmentations (red line) improve OOD er- ror substantially, while generic (orange) or unaugmented (blue) models require many training domains to attain low OOD error. Domain-invariant augmentations (green line) have constant high error. We plot OOD RMSE for varying number of training do- mains, with standard errors over 10 random seeds. We also plot the risk bounds from Section 4.2 for the high-sample regime; be- cause the bounds assume infinite data, we do not plot them for the low-sample case. The plotted Theorem 2 bound is a more general version (Appendix C.5). 4.3. Simulations The analysis in Section 4.2 assumes infinite data per do- main. We now present simulation results with finite data in a high-sample (N = 100 000) and low-sample (N = 5000) regime, where N is the total number of examples across all domains. We fix γ2 = 10, probust = 5 and pspu = 500. Additional details and results are in Appendix D. High-sample regime (N = 100 000). In Figure 3 (left), we plot OOD RMSE against the number of training do- mains D, together with our upper bound for targeted aug- mentations (a more general version of Theorem 2 in Ap- pendix C) and lower bound for unaugmented training (The- orem 1). We observe the trends suggested by our theory. When D is small, the unaugmented model (blue) has high OOD er- ror, and as D increases, OOD error slowly decays. Train- ing with generic augmentation (orange) does not improve over unaugmented training. In contrast, training with tar- geted augmentation (red) significantly reduces OOD error. There is a substantial gap between the red and orange/blue lines, which persists even when D is outside of the window guaranteed by Theorem 3. Finally, domain-invariant aug- mentations result in high OOD error (green) that does not decrease with increasing domains, as in Theorem 3. Low-sample regime (N = 5000). In Figure 3 (right), we plot OOD RMSE against the number of training domains D when the sample size is small. The unaugmented and tar- geted models follow the same trends as in the high-sample regime. However, in the low-sample regime, generic aug- mentation does reduce OOD error compared to the unaug- mented model. When the total number of examples N is small, models are incentivized to memorize individual ex- amples using xnoise. Generic augmentation prevents this 7 020040060080010001.01.21.41.61.8High-sample regime (N=100000)02004006008001000Low-sample regime (N=5000)OOD Test RMSENumber of training domains DUnaugmentedGeneric augmentationDomain invariant augmentationTargeted augmentationThm 1 (unaugmented lower bound)Thm 2 (targeted general upper bound) Out-of-Domain Robustness via Targeted Augmentations Figure 4. We plot the in-domain (ID) performance of methods against their out-of-domain (OOD) performance. Error bars are standard errors over replicates. Targeted augmentations significantly improve OOD performance over the nearest baseline, improving OOD Macro F1 on iWildCam from 33.3% → 36.5%, OOD average accuracy on Camelyon17 from 75.3% → 90.5%, and OOD Macro F1 on BirdCalls from 31.8% → 37.8%. Tables and additional details can be found in Appendix E. 37.8%. On iWildCam and Camelyon17, which are part of the WILDS benchmark, these targeted augmentations set new state-of-the-art performances (Koh et al., 2021). 1 Several generic augmentations were also able to improve OOD performance, although by smaller amounts than tar- geted augmentations; this matches our simulations in the low-sample regime in Section 4.3. RandAugment (Cubuk et al., 2020) performs strongly on iWildCam and Came- lyon17, and both noise reduction and random high / low pass filters perform well on BirdCalls. Some generic aug- mentations degraded performance (MixUp, CutMix, and SpecAugment), which may reflect the fact that these aug- mentations can also distort xobj and xd:robust, e.g., by mix- ing cell morphologies on Camelyon17. Effective robustness. On iWildCam, Miller et al. (2021) showed that the ID and OOD performances of models across a range of sizes are linearly correlated; we plot their linear fit on Figure 4 (left). We found that our targeted aug- mentation Copy-Paste (Same Y) confers what Miller et al. (2021) termed effective robustness, which is represented in the plot by a vertical offset from the line. In contrast, generic augmentations improve OOD performance along the plotted line. While the domain invariance methods also show effective robustness, they mostly underperform the unaugmented model in raw performance numbers. Although neither Camelyon17 nor BirdCalls have associ- ated linear fits, we observe similar trends in Figure 4, with targeted augmentations offering significant OOD gains even at similar ID performances as other methods. 1BirdCalls is a new dataset, so targeted augmentations are state-of-the-art against the baselines reported here. Table 1. Randomizing habitat WILDS and BIRDCALLS degrades performance. Dataset features Method in IWILDCAM2020- ID Test Macro F1 OOD Test Macro F1 iWildCam BirdCalls Unaugmented Copy-Paste (All Backgrounds) Copy-Paste (Same Y) Unaugmented Copy-Paste + Jitter (All Regions) Copy-Paste + Jitter (Same Region) 46.5 (0.4) 47.1 (1.1) 50.2 (0.7) 70.0 (0.5) 76.0 (0.3) 75.6 (0.3) 30.2 (0.3) 34.7 (0.5) 36.5 (0.4) 27.8 (1.2) 33.7 (1.0) 37.8 (1.0) Table 2. Finetuning CLIP ViT-L/14 with targeted augmentations improves OOD performance on CAMELYON17-WILDS (accu- racy) and IWILDCAM2020-WILDS (macro F1). Results aver- aged over 5 seeds with standard errors. Dataset ID Performance OOD Performance Method Camelyon17 Unaugmented Stain Color Jitter 99.5 (0.0) 99.4 (0.0) iWildCam Unaugmented Copy-Paste (Same Y) 55.6 (0.8) 56.6 (0.7) 96.0 (0.2) 97.1 (0.0) 43.5 (0.7) 45.5 (0.3) Ablation on xd:robust. To further demonstrate the utility of preserving xd:robust, we ran ablations on the targeted aug- mentations for iWildCam and BirdCalls, which both pre- serve habitat features. On iWildCam, Copy-Paste (Same Y) selectively pastes animal foregrounds onto backgrounds from domains which also observe y in the training set; as an ablation, we studied Copy-Paste (All Backgrounds), which draws backgrounds from all training domains, including cameras in which y was not observed. Similarly, on Bird- Calls, Copy-Paste + Jitter (Region) only pastes calls onto recordings from the original microphone's region; as an ab- lation, we studied Copy-Paste + Jitter (All Regions), which merges recordings indiscriminately. In Table 1, we see that preserving habitat features is useful-randomizing this fea- ture, as in our ablations, decreases OOD performance by 1.8% on iWildCam and 4.1% on BirdCalls. 8 ,'7HVW0DFUR)22'7HVW0DFUR)8QDXJPHQWHG&XW0L[&XWRXW0L[8S5DQG$XJPHQW&'$1'HHS&25$/,50/,6$&RS\3DVWH 6DPH< L:LOG&DP:,/'6,'9DO$YHUDJH$FFXUDF\22'7HVW$YHUDJH$FFXDUF\8QDXJPHQWHG&XW0L[&XWRXW0L[8S5DQG$XJPHQW'$11'HHS&25$/,50/,6$6WDLQ&RORU-LWWHU&DPHO\RQ:,/'6,'7HVW0DFUR)22'7HVW0DFUR)8QDXJPHQWHG-LWWHU0L[8S1RLVH5HGXFWLRQ5DQGRP3DVV6SHF$XJPHQW&'$1'HHS&25$/,50/,6$&RS\3DVWH-LWWHU 5HJLRQ %LUG&DOOV8QDXJPHQWHG*HQHULF$XJPHQWDWLRQ'RPDLQ,QYDULDQFH7DUJHWHG$XJPHQWDWLRQ0LOOHUHWDO Out-of-Domain Robustness via Targeted Augmentations Targeted augmentations improve OOD performance when finetuning CLIP. We also applied our targeted aug- mentations to CLIP ViT-L/14 (Radford et al., 2021), a large-scale vision-language model (Table 2). Targeted aug- mentations offer 1.1% and 2% OOD average gains over unaugmented finetuning on iWildCam and Camelyon17. 6. Related work Data augmentations for OOD robustness. Prior work has shown that generic augmentations designed for ID per- formance can improve OOD performance, but this effect is inconsistent across datasets (Gulrajani & Lopez-Paz, 2020; Hendrycks et al., 2021; Wiles et al., 2021). Other work has sought to design augmentations specifically for robustness (Puli et al., 2022; Wang et al., 2022). Many augmentations are inspired by domain invariance and aim to randomize all domain-dependent features, including xd:robust. For exam- ple, inter-domain MixUp interpolates inputs from different domains, possibly within the class (Wang et al., 2020; Xu et al., 2020; Yan et al., 2020; Yao et al., 2022). Ilse et al. (2021) propose to select transformations which maximally confuse a domain classifier. Several works train generative models to transform images between domains by learning to modify all domain-dependent features (Hoffman et al., 2018; Zhou et al., 2020b; Robey et al., 2021). In contrast, we preserve xd:robust in targeted augmentations. Analysis on data augmentations and domain general- ization. Existing work usually analyzes augmentations in the standard i.i.d. setting (Dao et al., 2019; He et al., 2019; Chen et al., 2020; Lyle et al., 2020), where augmentations improve sample complexity and reduce variance. We in- stead analyze the effect of data augmentation on OOD per- formance. There is limited theoretical work in this setting: Ilse et al. (2021) use augmentations to simulate interven- tions on domains, and Wang et al. (2022) show that one can recover a causal model given a set of augmentations encoding the relevant invariances. These works are part of a broader thread of analysis which emphasizes robustness to worst-case domain shifts; the aim is thus to recover mod- els that only rely on causal features. In contrast, we seek to generalize to unseen domains on average. Our analysis on generalization to a meta-distribution is related to work on metalearning (Chen et al., 2021a; Jose & Simeone, 2021); however, these analyses focus on adaptation to new tasks instead of out-of-domain generalization. Failures of domain invariance. To improve OOD ro- bustness, the domain invariance literature focuses on learn- ing models which are invariant to domain-dependent fea- tures, such that representations are independent of domain either marginally (Ganin et al., 2016; Albuquerque et al., 2019) or conditioned on y (Long et al., 2018; Zhao et al., 2019). Several works have pointed out failure modes of do- main invariance (Zhao et al., 2019; Johansson et al., 2019; Akuzawa et al., 2020), such as when label distributions vary across domains. Mahajan et al. (2021) focus on cases where the distribution of causal features vary across do- mains; we additionally allow for xd:robust to be non-causal, such as habitat features in iWildCam and BirdCalls. Targeted augmentations in application literature. Many existing domain-specific augmentations can fit the proposed framework of targeted augmentations. For ex- ample, Stain Color Jitter is sourced from the biomedical literature and was designed for OOD robustness (Tellez et al., 2018; 2019; Miller et al., 2021). Copy-Paste (non- selective) has been previously applied to a smaller, single- habitat camera trap dataset (Beery et al., 2020). Our con- tribution lies in interpreting and formalizing why these tar- geted augmentations are effective OOD. Underspecification. D'Amour et al. (2020) point out the underspecification issue in out-of-domain generalization, in which multiple models are optimal on the training data, but generalize very differently out of domain. While our theoretical setting does not precisely fit the above definition of underspecification, we observe a related phenomenon; although there is a unique optimal model due to feature noise, OOD error can be high when the noiseless version of the regression problem is underspecified. 7. Conclusion We studied targeted augmentations, which randomize spu- rious domain-dependent features while preserving robust ones. In theoretical analysis and experiments on real- world datasets, we showed that targeted augmentations can significantly improve OOD performance over generic and domain-invariant augmentations. These results illus- trate the power of leveraging application knowledge to design targeted augmentations: when the out-of-domain generalization problem is underspecified, prior knowledge can provide additional structure and make the out-of- domain generalization problem more tractable. Future work could also explore methods for learning, rather than hand-designing, targeted augmentations; such approaches could leverage high-level prior knowledge on xd:robust, or directly infer xd:robust from the training domains. Acknowledgements We are grateful to Henrik Marklund, Holger Klinck, and Sara Beery for their advice. This work was supported by NSF Frontier and Open Philanthropy awards. Shiori Sagawa was supported by the Apple Scholars in AI/ML PhD Fellowship. 9 Out-of-Domain Robustness via Targeted Augmentations References Akuzawa, K., Iwasawa, Y., and Matsuo, Y. Adversar- ial invariant feature learning with accuracy constraint In Joint European Confer- for domain generalization. ence on Machine Learning and Knowledge Discovery in Databases, pp. 315–331. Springer, 2020. 9 Albuquerque, I., Monteiro, J., Darvishi, M., Falk, T. H., and Mitliagkas, I. Generalizing to unseen domains via distribution matching. arXiv preprint arXiv:1911.00804, 2019. 9 Arjovsky, M., Bottou, L., Gulrajani, I., and Lopez- Invariant risk minimization. arXiv preprint Paz, D. arXiv:1907.02893, 2019. 7 Bandi, P., Geessink, O., Manson, Q., Van Dijk, M., Balken- hol, M., Hermsen, M., Bejnordi, B. E., Lee, B., Paeng, K., Zhong, A., et al. From detection of individual metas- tases to classification of lymph node status at the patient level: the camelyon17 challenge. IEEE transactions on medical imaging, 38(2):550–560, 2018. 2, 3 Beery, S., Van Horn, G., and Perona, P. Recognition in terra incognita. In Proceedings of the European conference on computer vision (ECCV), pp. 456–473, 2018. 1 Beery, S., Morris, D., and Yang, S. Efficient pipeline arXiv preprint for camera trap image review. arXiv:1907.06772, 2019. 18 Beery, S., Liu, Y., Morris, D., Piavis, J., Kapoor, A., Joshi, N., Meister, M., and Perona, P. Synthetic examples im- In Proceedings prove generalization for rare classes. of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 863–873, 2020. 9 Beery, S., Agarwal, A., Cole, E., and Birodkar, V. The arXiv preprint iwildcam 2021 competition dataset. arXiv:2105.03494, 2021. 2, 3, 4, 18 Birodkar, V., Lu, Z., Li, S., Rathod, V., and Huang, J. The surprising impact of mask-head architecture on novel class segmentation. In Proceedings of the IEEE/CVF In- ternational Conference on Computer Vision, pp. 7015– 7025, 2021. 18 Chen, Q., Shui, C., and Marchand, M. Generaliza- tion bounds for meta-learning: An information-theoretic analysis. Advances in Neural Information Processing Systems, 34:25878–25890, 2021a. 9 Chen, S., Dobriban, E., and Lee, J. H. A group-theoretic framework for data augmentation. The Journal of Ma- chine Learning Research, 21(1):9885–9955, 2020. 9 Chen, Y., Rosenfeld, E., Sellke, M., Ma, T., and Risteski, A. Iterative feature matching: Toward provable domain arXiv generalization with logarithmic environments. preprint arXiv:2106.09913, 2021b. 2, 4 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. 7, 8 D'Amour, A., Heller, K., Moldovan, D., Adlam, B., Ali- panahi, B., Beutel, A., Chen, C., Deaton, J., Eisenstein, J., Hoffman, M. D., et al. Underspecification presents challenges for credibility in modern machine learning. Journal of Machine Learning Research, 2020. 9 Dao, T., Gu, A., Ratner, A., Smith, V., De Sa, C., and R ́e, C. A kernel theory of modern data augmentation. In In- ternational Conference on Machine Learning, pp. 1528– 1537. PMLR, 2019. 9 Denton, T., Wisdom, S., and Hershey, J. R. Improving bird In classification with unsupervised sound separation. ICASSP 2022-2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 636–640. IEEE, 2022. 14 DeVries, T. and Taylor, G. W. of convolutional neural networks with cutout. preprint arXiv:1708.04552, 2017. 7 Improved regularization arXiv Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., Marchand, M., and Lem- pitsky, V. Domain-adversarial training of neural net- works. The journal of machine learning research, 17 (1):2096–2030, 2016. 7, 9 Gontijo-Lopes, R., Smullin, S. J., Cubuk, E. D., and Dyer, E. Affinity and diversity: Quantifying mechanisms of data augmentation. arXiv preprint arXiv:2002.08973, 2020. 33 Gulrajani, I. and Lopez-Paz, D. In search of lost domain generalization. arXiv preprint arXiv:2007.01434, 2020. 1, 9 Gy ̈orfi, L., Kohler, M., Krzyzak, A., Walk, H., et al. A distribution-free theory of nonparametric regression, volume 1. Springer, 2002. 6 He, Z., Xie, L., Chen, X., Zhang, Y., Wang, Y., and Tian, Q. Data augmentation revisited: Rethinking the distribution gap between clean and augmented data. arXiv preprint arXiv:1909.09148, 2019. 9 Hendrycks, D., Basart, S., Mu, N., Kadavath, S., Wang, F., Dorundo, E., Desai, R., Zhu, T., Parajuli, S., Guo, M., 10 Out-of-Domain Robustness via Targeted Augmentations et al. The many faces of robustness: A critical analy- sis of out-of-distribution generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 8340–8349, 2021. 1, 9 Hoffman, J., Tzeng, E., Park, T., Zhu, J.-Y., Isola, P., Saenko, K., Efros, A., and Darrell, T. Cycada: Cycle- In Interna- consistent adversarial domain adaptation. tional conference on machine learning, pp. 1989–1998. Pmlr, 2018. 9 Hopping, W. A., Kahl, S., and Klinck, H. A collection of fully-annotated soundscape recordings from the South- western Amazon Basin, September 2022. URL https: //doi.org/10.5281/zenodo.7079124. 2, 13 Hsu, D., Kakade, S. M., and Zhang, T. An analysis arXiv preprint of random design linear regression. arXiv:1106.2363, 2011. 6 Ilse, M., Tomczak, J. M., and Forr ́e, P. Selecting data In Interna- augmentation for simulating interventions. tional Conference on Machine Learning, pp. 4555–4562. PMLR, 2021. 1, 9 Johansson, F. D., Sontag, D., and Ranganath, R. Support and invertibility in domain-invariant representations. In The 22nd International Conference on Artificial Intelli- gence and Statistics, pp. 527–536. PMLR, 2019. 9 Joly, A., Go ̈eau, H., Kahl, S., Picek, L., Lorieul, T., Cole, E., Deneu, B., Servajean, M., Durso, A., Bolon, I., et al. Overview of lifeclef 2021: an evaluation of machine- learning based species identification and species distri- In Experimental IR Meets Multilin- bution prediction. guality, Multimodality, and Interaction: 12th Interna- tional Conference of the CLEF Association, CLEF 2021, Virtual Event, September 21–24, 2021, Proceedings, pp. 371–393. Springer, 2021. 3 Jose, S. T. and Simeone, O. Information-theoretic general- ization bounds for meta-learning and applications. En- tropy, 23(1):126, 2021. 9 Kahl, S., Charif, R., and Klinck, H. A collection of fully- annotated soundscape recordings from the Northeastern United States, August 2022. URL https://doi. org/10.5281/zenodo.7079380. 2, 13 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. 1, 2, 3, 8, 18, 33, 34 Long, M., Cao, Z., Wang, J., and Jordan, M. I. Conditional adversarial domain adaptation. Advances in neural in- formation processing systems, 31, 2018. 7, 9 Lyle, C., van der Wilk, M., Kwiatkowska, M., Gal, Y., and Bloem-Reddy, B. On the benefits of invariance in neural networks. arXiv preprint arXiv:2005.00178, 2020. 9 Mahajan, D., Tople, S., and Sharma, A. Domain gener- alization using causal matching. In International Con- ference on Machine Learning, pp. 7313–7324. PMLR, 2021. 9 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 be- tween out-of-distribution and in-distribution generaliza- tion. In International Conference on Machine Learning, pp. 7721–7735. PMLR, 2021. 8, 9, 34 Navine, A., Kahl, S., Tanimoto-Johnson, A., Klinck, H., and Hart, P. A collection of fully-annotated sound- scape recordings from the Island of Hawai'i, Septem- ber 2022. URL https://doi.org/10.5281/ zenodo.7078499. 2, 13 Park, D. S., Chan, W., Zhang, Y., Chiu, C.-C., Zoph, B., Cubuk, E. D., and Le, Q. V. Specaugment: A simple data augmentation method for automatic speech recognition. arXiv preprint arXiv:1904.08779, 2019. 7 Puli, A., Joshi, N., He, H., and Ranganath, R. Nuisances via negativa: Adjusting for spurious correlations via data augmentation. arXiv preprint arXiv:2210.01302, 2022. 9 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 natu- ral language supervision. In International conference on machine learning, pp. 8748–8763. PMLR, 2021. 9 Robey, A., Pappas, G. J., and Hassani, H. Model-based domain generalization. Advances in Neural Information Processing Systems, 34:20210–20229, 2021. 9 Rosenfeld, E., Ravikumar, P., and Risteski, A. risks of invariant risk minimization. arXiv:2010.05761, 2020. 2, 4 The arXiv preprint Ruifrok, A. C., Johnston, D. A., et al. Quantification of his- tochemical staining by color deconvolution. Analytical and quantitative cytology and histology, 23(4):291–299, 2001. 1, 18 Kumar, A., Shen, R., Bubeck, S., and Gunasekar, S. How arXiv preprint to fine-tune vision models with sgd. arXiv:2211.09359, 2022. 34 Sagawa, S., Koh, P. W., Lee, T., Gao, I., Xie, S. M., Shen, K., Kumar, A., Hu, W., Yasunaga, M., Marklund, H., et al. Extending the wilds benchmark for unsupervised 11 Out-of-Domain Robustness via Targeted Augmentations adaptation. arXiv preprint arXiv:2112.05090, 2021. 33, 34 Sainburg, T. Noise reduction in python using spec- tral gating, 2022. URL https://github.com/ timsainb/noisereduce. 7 Sun, B. and Saenko, K. Deep coral: Correlation alignment for deep domain adaptation. In European conference on computer vision, pp. 443–450. Springer, 2016. 7 Sun, B., Feng, J., and Saenko, K. Correlation alignment for unsupervised domain adaptation. In Domain Adaptation in Computer Vision Applications, pp. 153–171. Springer, 2017. 7 Tellez, D., Balkenhol, M., Otte-H ̈oller, I., van de Loo, R., Vogels, R., Bult, P., Wauters, C., Vreuls, W., Mol, S., Karssemeijer, N., et al. Whole-slide mitosis de- tection in h&e breast histology using phh3 as a refer- ence to train distilled stain-invariant convolutional net- IEEE transactions on medical imaging, 37(9): works. 2126–2136, 2018. 1, 4, 9, 18 Yan, S., Song, H., Li, N., Zou, L., and Ren, L. Improve unsupervised domain adaptation with mixup training. arXiv preprint arXiv:2001.00677, 2020. 1, 9 Yao, H., Wang, Y., Li, S., Zhang, L., Liang, W., Zou, J., and Finn, C. Improving out-of-distribution robustness via se- lective augmentation. arXiv preprint arXiv:2201.00299, 2022. 1, 7, 9 Yun, S., Han, D., Oh, S. J., Chun, S., Choe, J., and Yoo, Y. Cutmix: Regularization strategy to train strong clas- In Proceedings of the sifiers with localizable features. IEEE/CVF international conference on computer vision, pp. 6023–6032, 2019. 7 Zhang, H., Cisse, M., Dauphin, Y. N., and Lopez-Paz, D. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. 7 Zhao, H., Des Combes, R. T., Zhang, K., and Gordon, G. On learning invariant representations for domain adapta- tion. In International Conference on Machine Learning, pp. 7523–7532. PMLR, 2019. 9 Tellez, D., Litjens, G., B ́andi, P., Bulten, W., Bokhorst, J.- M., Ciompi, F., and van der Laak, J. Quantifying the effects of data augmentation and stain color normaliza- tion in convolutional neural networks for computational pathology. Medical image analysis, 58, 2019. 1, 9 Zhou, K., Yang, Y., Hospedales, T., and Xiang, T. Deep domain-adversarial image generation for domain gen- In Proceedings of the AAAI Conference eralisation. on Artificial Intelligence, volume 34, pp. 13025–13032, 2020a. 1 Wang, R., Yi, M., Chen, Z., and Zhu, S. Out-of-distribution generalization with causal invariant transformations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 375–385, 2022. 9 Zhou, K., Yang, Y., Hospedales, T., and Xiang, T. Learning to generate novel domains for domain generalization. In European conference on computer vision, pp. 561–578. Springer, 2020b. 9 Zhu, S. A short note on the tail bound of wishart distribu- tion. arXiv preprint arXiv:1212.5860, 2012. 6, 28 Wang, Y., Li, H., and Kot, A. C. Heterogeneous domain generalization via domain mixup. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3622–3626. IEEE, 2020. 9 Wiles, O., Gowal, S., Stimberg, F., Rebuffi, S.-A., Ktena, I., Dvijotham, K. D., and Cemgil, A. T. A fine-grained In International Confer- analysis on distribution shift. ence on Learning Representations, 2021. 1, 9 Wortsman, M., Ilharco, G., Gadre, S. Y., Roelofs, R., Gontijo-Lopes, R., Morcos, A. S., Namkoong, H., Farhadi, A., Carmon, Y., Kornblith, S., et al. Model soups: averaging weights of multiple fine-tuned mod- els improves accuracy without increasing inference time. In International Conference on Machine Learning, pp. 23965–23998. PMLR, 2022. 34 Xu, M., Zhang, J., Ni, B., Li, T., Wang, C., Tian, Q., and Zhang, W. Adversarial domain adaptation with domain mixup. In Proceedings of the AAAI Conference on Arti- ficial Intelligence, volume 34, pp. 6502–6509, 2020. 9 12 Out-of-Domain Robustness via Targeted Augmentations A. Additional notes on datasets In this appendix, we provide additional analysis justify- ing the decomposition of robust and spurious domain- dependent features in the real-world datasets. We also pro- vide details on the construction of BIRDCALLS. A.1. IWILDCAM2020-WILDS Analysis on domain-dependent features. Figure 8 de- picts a sample of images from the iWildCam training set. This figure illustrates that animal foregrounds-which are often blurry, occluded, or camouflaged – are alone insuf- ficient for prediction. Extracting habitat features from the background gives useful signal on what species (out of 182 classes) are likely for an image. We emphasize that xd:robust is reliable under realistic distribution shifts for this appli- cation: since camera traps monitor wild animals in their natural habitats, adversarial shifts as dramatic as swapping animals between Kenya and Guatemala (Figure 8) are un- likely. Further, we show in Section 5.1 that being too con- servative to this adversarial shift can reduce OOD perfor- mance on relevant, widespread shifts (across cameras). A.2. CAMELYON17-WILDS Analysis on domain-dependent features. Figure 9 de- picts a sample of images from the Camelyon17 training set. This figure illustrates that cell morphologies are af- fected by distributions of patients and their breast cancer stage; Figure 5 concretizes how the distribution of cancer stages varies across domains. We note that unlike IWILDCAM2020-WILDS and BIRD- CALLS, domains in CAMELYON17-WILDS have the same (class-balanced) label distribution. To understand why models are incentivized to memorize stain color in this task, we plot the class-separated color histograms for the three training domains in Figure 6. We see that, on train, mod- els can learn a threshold function based on the class color means for prediction. Figure 5. Hospitals vary in the distribution of cancer stages they observe in patients, due to the different patient distributions they service. This in turn affects the causal feature for cancer predic- tion (cell morphology). 13 Figure 6. Class-separated color histograms for CAMELYON17- WILDS. A.3. BIRDCALLS Problem setting. To monitor the health of bird popu- lations and their habitats, ornithologists collect petabytes of acoustic recordings from the wild each year. Ma- chine learning can automate analysis of these recordings by learning to recognize species from audio recordings of their vocalizations. However, several features vary across the microphones that collect these recordings, such as micro- phone model, sampling rate, and recording location. These shifts can degrade model performance on unseen micro- phones. Dataset construction and statistics. To study targeted augmentations for this setting, we curate a bird recogni- 2 tion dataset by combining publicly released datasets. The original data is sourced from 32kHz long record- ings from Navine et al. (2022); Hopping et al. (2022); Kahl et al. (2022), which were released alongside expert- annotated time-frequency bounding boxes around observed bird calls. To build our dataset from these long recordings, we extracted all 5-second chunks in which a single (or no) species makes a call, and then we undersampled majority classes to achieve a more balanced class distribution. Our curated dataset, BIRDCALLS, contains 4,897 audio clips from 12 microphones distributed between the Northeast- ern United States, Southwest Amazon Basin, and Hawai'i. Each clip features one of 31 bird species, or no bird (we 2We release BIRDCALLS at this link. +RVSLWDO+RVSLWDO+RVSLWDO'LVWULEXWLRQVRIFDQFHUVWDJHS1S1S1PLS1 L Out-of-Domain Robustness via Targeted Augmentations Table 3. Test-to-test comparison on BIRDCALLS ID Test Avg Acc ID Test Macro F1 OOD Test Avg Acc OOD Test Macro F1 Train on OOD data Train on ID data 16.7 (0.2) 79.8 (0.4) 4.1 (0.1) 70.8 (0.6) 84.4 (0.7) 44.6 (0.8) 51.9 (0.9) 23.9 (1.0) include an extra class for "no bird recorded"). The dataset is split as follows: 1. Train: 2,089 clips from 9 microphones 2. ID Validation: 407 clips from 8 of the 9 microphones in the training set 3. ID Test: 1,677 clips from the 9 microphones in the training set 4. OOD Test: 724 clips from 3 different microphones To train classification models, we convert the 5-second au- dio clips into Mel spectrograms and train an EfficientNet- B0 on these images, following prior work (Denton et al., 2022). We evaluate ID and OOD performance on their cor- responding test sets. The label distribution of this dataset is shown in Figure 7; to account for remaining class im- balance, we report Macro F1 as the evaluation metric. We show additional samples of the data in Figure 10. Verifying performance drops. We ran checks to verify that observed ID to OOD performance drops were due to distribution shift, and not due to having an innately more difficult OOD Test set. For these analyses, we further split the OOD Test set into three temporary splits: OOD Train (365 clips), OOD Validation (69 clips), and OOD Test (290). We then compared the (subsetted) OOD Test performance of models trained on the (ID) Train split + se- lected on the ID Validation split with models trained on the OOD Train split + selected on the OOD Validation split. The results are shown in Table 3. We see that models per- form quite on OOD Test if trained on the same distribution of data (OOD Train). This verifies that the ID to OOD per- formance drops are due to distribution shift. Analysis on domain-dependent features. Figure 10 depicts a sample of images from the BirdCalls training set. This figure shows how habitat features distinctly vary across domains. Since fine-grained bird species are almost disjoint across regions, habitat features help indicate which species are likely. Correspondingly, we show in Section 5.1 that retaining habitat features improve both ID and OOD performance. 14 Figure 7. Label distribution of BIRDCALLS. &ODVVODEHO3 \ /DEHOGLVWULEXWLRQIRU%LUG&DOOV7UDLQ22'7HVW Out-of-Domain Robustness via Targeted Augmentations Figure 8. Across domains (columns), both low-level background details xd:spu and high-level habitat features xd:robust vary. Since xd:robust ̸⊥ d, domain invariance may eliminate habitat information. In contrast, a targeted augmentation, Copy-Paste (Same Y), ran- domizes backgrounds between cameras in similar habitats, preserving the ability of the model to use xd:robust. This is necessary for performance, as foregrounds xobj can be too camouflaged, distant, blurred, dark, or occluded for even a human annotator's eye. (All images in this figure contain an animal.) 15 &DPHUD&DPHUD&DPHUD&DPHUD&DPHUD)RUHVW *XDWHPDOD 6DYDQQD .HQ\D Out-of-Domain Robustness via Targeted Augmentations Figure 9. The top two rows depict non-cancerous patches (y = 0), while the bottom three rows are cancerous patches (y = 1). Across domains (columns), several features, including distributions of the causal feature (cell morphology), vary. Cell morphology is impacted by the patient distribution of each hospital, as some hospitals have patients with more aggressive cancer staging (Figure 5). This leads to different distributions of cell morphologies across domains. While domain invariance would thus eliminate this causal feature, targeted augmentations only randomize features independent of y, such as stain color. 16 +RVSLWDO+RVSLWDO+RVSLWDO3DWLHQW S1PL 3DWLHQW S1 3DWLHQW S1PL 3DWLHQW S1 L 3DWLHQW S1 3DWLHQW S1 Out-of-Domain Robustness via Targeted Augmentations Figure 10. Across domains (columns), recordings vary in their habitat features, such as calls from local insects (left two columns, high frequencies), stronger wind levels (center two columns), or rainfall levels. These habitat features can act as a useful bias for deciding likely labels. Targeted augmentations randomize background noise between microphones located in the same region, preserving this robust feature, while domain invariance eliminates this feature. 17 0LFURSKRQH0LFURSKRQH0LFURSKRQH0LFURSKRQH0LFURSKRQH$PD]RQ+DZDLL1RUWKHDVW Out-of-Domain Robustness via Targeted Augmentations B. Augmentation details In this appendix, we provide implementation details for the targeted augmentations we study on the real-world datasets. B.1. Copy-Paste (Same Y) on IWILDCAM2020-WILDS The full Copy-Paste protocol is given in Algorithm 1. We consider two strategies for selecting the set of valid empty backgrounds B(i). 1. Copy-Paste (All Backgrounds): all empty train split images. B(i) = {(x, y, d) ∈ Dtrain : y = "empty"}, i.e., all augmented examples should have a single dis- tribution of backgrounds. There is a large set of train- ing backgrounds to choose from when executing the procedure – of 129, 809 training images, 48, 021 are empty images. 2. Copy-Paste (Same Y): empty train split images from cameras that have observed y(i). Let Y(d) represent the set of labels domain d observes. Then B(i) = {(x, y, d) ∈ Dtrain : y = "empty" and y(i) ∈ Y(d)}. Algorithm 1 Copy-Paste Input: Labeled example (x(i), y(i), d(i)), binary seg- mentation mask m(i), set of images to sample empty im- ages from to use as backgrounds B(i) if y(i) = "empty" or |B(i)| = 0 then Return x(i) end if Copy out foreground by applying segmentation mask f (i) := m(i) ◦ x(i) Randomly select a background b ∈ B(i) Paste f (i) onto b and return ̃x(i) := Paste(f (i), b) Table 4. Pasting onto backgrounds from cameras that have ob- served the same class during training achieves similar ID and OOD performance to pasting within countries. ID Test Macro F1 OOD Test Macro F1 Copy-Paste (Same Y) Copy-Paste (Same Country) 50.2 (0.7) 49.3 (0.9) 36.5 (0.4) 36.7 (0.7) performance to applying Copy-Paste within geographic re- gions. Beery et al. (2021) released noisy geocoordinates for around half of the locations in IWILDCAM2020-WILDS. Using these coordinates, we inferred the country each cam- era trap was located in (we merged all cameras of unknown locations into one group, "unknown country"). We then ap- plied Copy-Paste, pasting animals only onto backgrounds from the same country. Table 4 shows that Copy-Paste (Same Y) and this oracle have the same performance, sug- gesting that the Same Y policy indeed preserves geographic habitat features. B.2. Stain Color Jitter on CAMELYON17-WILDS The full Stain Color Jitter protocol, originally from Tellez et al. (2018), is given in Algorithm 2. The augmenta- tion uses a pre-specified Optical Density (OD) matrix from Ruifrok et al. (2001) to project images from RGB space to a three-channel hematoxylin, eosin, and DAB space before applying a random linear combination. Algorithm 2 Stain Color Jitter Augmentation Input: Labeled example (x(i), y(i), d(i)), normalized OD matrix M (Ruifrok et al., 2001), tolerance ε = 1−6 S = − log(x(i) + ε)M −1 Sample α ∼ Uni(1 − σ, 1 + σ) Sample β ∼ Uni(−σ, σ) P = exp[−(αS + β)M ] − ε Return P with each cell clipped to [0, 255] Segmentation masks. The iWildCam dataset is curated from real camera trap data collected by the Wildlife Con- servation Society and released by Beery et al. (2021); Koh et al. (2021). Beery et al. (2021) additionally com- pute and release segmentation masks for all labeled ex- amples in iWildCam. These segmentation masks were extracted by running the dataset through MegaDetector (Beery et al., 2019) and then passing regions within de- tected boxes through an off-the-shelf, class-agnostic detec- tion model, DeepMAC (Birodkar et al., 2021). We use these segmentation masks for our Copy-Paste augmenta- tion. Comparison to swapping within countries. To confirm that Copy-Paste (Same Y) acts to preserve geographic habi- tat features, we ran an oracle experiment comparing its B.3. Copy-Paste + Jitter (Region) on BIRDCALLS After transforming audio clips into mel-spectrograms, we use time-frequency bounding boxes included in the dataset to extract pixels of bird calls. We then paste these pixels onto spectrograms from the empty (no bird recorded) class, applying Algorithm 1. Finally, we apply color jitter on the spectrograms. The goal of jitter is to simulate changes in gain settings across microphones, which affect the coloring of spectrograms. We consider two strategies for selecting the set of valid empty backgrounds B(i). 1. Copy-Paste + Jitter (All Regions): all empty train split recordings. B(i) = {(x, y, d) ∈ Dtrain : y = "empty"}, i.e., all augmented examples should have a single distribution of backgrounds. There is a large 18 Out-of-Domain Robustness via Targeted Augmentations set of training backgrounds to choose from when ex- ecuting the procedure – of 129, 809 training images, 48, 021 are empty images. 2. Copy-Paste + Jitter (Region): empty train split recordings from microphones in the same region. Let R(d) represent the region (Hawaii, Southwest Amazon Basin, or Northeastern United States) that domain d is located in; we provide these annotations in BIRDCALLS. Then B(i) = {(x, y, d) ∈ Dtrain : y = "empty" and R(d(i)) = R(d)}. 19 Out-of-Domain Robustness via Targeted Augmentations C. Proofs We present the proofs for results presented in Section 4.2. C.1. Analyzing domain-dependent features only In the proofs, we analyze only the domain-dependent features xdom = [xd:robust, xd:spu], disregarding the object features xobj and noise features xnoise, since the latter two features do not affect our results. To show this, we first consider the full setting with x = [xobj, xnoise, xd:robust, xd:spu] and compute the model estimate ˆθ by applying the normal equations. We compute the relevant quantities as E[xx⊤] =  I 0  0 0 0 I 0 0 A   , E[yx] =   βobj βnoise Bβdom   , (14) where the blocks correspond to object features xobj, noise features xnoise, and domain-dependent features [xd:robust, xd:spu] and the matrices A and B depend on the augmentation strategy. Applying the normal equations yields ˆθ =   βobj βnoise A−1Bβdom.   (15) This means that in our infinite-data, finite-domain setting, models perfectly recover βobj and βnoise for all augmentation strategies. Thus, the model incurs zero error from the object and noise dimensions, so these features can also be disregarded in the error computation. In the rest of the proof, we focus on analyzing the domain-dependent features; without loss of generality, we assume that the dimensionality of the object and noise features are 0. In other words, we consider x = [xd:robust, xd:spu], β = βdom = [βrobust, βspu], and θ = θdom = [θrobust, θspu], all of which are of length pdom. C.2. Models Proposition 1 (Estimator without augmentation). Unaugmented training yields the model ˆθ(unaug) = (Σ + M )−1M β where M = 1 D (cid:80)D d=1 μ(d)μ(d)⊤ and Σ = σ2I. Proof. ˆθ(unaug) = E[xx⊤]−1E[xy] (cid:32) = Σ + μ(d)μ(d)⊤ 1 D D (cid:88) d=1 (cid:32) = Σ + 1 D D (cid:88) d=1 μ(d)μ(d)⊤ = (Σ + M )−1 M β (cid:33)−1 (cid:32) (cid:33)−1 (cid:32) 1 D 1 D D (cid:88) d=1 D (cid:88) d=1 E (cid:2)x(β * μ(d) + ε)(cid:3) (cid:33) (cid:33) μ(d)μ(d)⊤β Proposition 2 (Estimator with generic augmentation). Applying generic augmentation yields the model where M = 1 D (cid:80)D d=1 μ(d)μ(d)⊤ and Σ = σ2I. ˆθ(gen) = (Σ + M )−1M β 20 (16) (17) (18) (19) (20) (21) Out-of-Domain Robustness via Targeted Augmentations Proof. Applying generic augmentations do not change the data distribution over the domain-dependent features. Thus, ˆθ(gen) = ˆθ(unaug). Applying Proposition 1 yields the result. Proposition 3 (Estimator with targeted augmentation). Applying targeted augmentation yields the model ˆθ(tgt) = (cid:18)(Σrobust + Mrobust)−1Mrobustβrobust 0 (cid:19) where Mrobust = 1 D (cid:80)D d=1 μ(d) robustμ(d)⊤ robust and Σrobust = σ2I. Proof. In the augmented training distribution, input x in domain d is distributed as x ∼ N (cid:19) (cid:18)(cid:18)μ(d) robust 0 , Σ(tgt) (cid:19) , where Σ(tgt) = (cid:18)σ2I 0 0 (σ2 + τ 2)I (cid:19) . Applying the normal equations on the augmented training distribution, we compute ˆθ(tgt) as ˆθ(tgt) = E[xx⊤]−1E[xy] (cid:16) Σ(tgt) + M (tgt)(cid:17)−1 = M (tgt)β, where M (tgt) = (cid:18)Mrobust 0 (cid:19) 0 0 . Since we can invert block diagonal matrices block by block, we can compute (cid:0)Σ(tgt) + M (tgt)(cid:1)−1 as (cid:16) Σ(tgt) + M (tgt)(cid:17)−1 = (cid:18)(σ2I + Mrobust)−1 0 (cid:19) . 0 1 σ2+τ 2 I As a result of the block structure, we can simplify ˆθ(tgt) as ˆθ(tgt) = (cid:18)(σ2I + Mrobust)−1Mrobustβrobust 0 (cid:19) (22) (23) (24) (25) (26) (27) Proposition 4 (Estimator with domain-invariant augmentations). Applying domain-invariant augmentation yields the model Proof. In the augmented training distribution, input x in domain d is distributed as x ∼ N (0, Σ + T ) . ˆθ(inv) = 0. (28) (29) Applying the normal equations thus yields ˆθ(inv) = 0. Proposition 5 (Oracle model). Recall that θ∗ ≜ arg minθ ROOD(θ) is the oracle model that attains optimal performance on the meta distribution P . The oracle model is θ∗ = (Σ + T )−1T β, (30) where Σ = σ2I and T = τ 2I. Proof. As the number of domains D → ∞, M converges to T . Applying the normal equations yields the result. 21 Out-of-Domain Robustness via Targeted Augmentations C.3. Computation of ID and OOD errors Proposition 6 (OOD error as a function of θ). The OOD error of a model θ is ROOD(θ) = σ2 ε + θ⊤Σθ + (β − θ)⊤ T (β − θ) , where Σ = σ2I and T = τ 2I. Proof. ROOD(θ) =Ex,y,d (cid:104) (y − θ * x)2(cid:105) =Ed =Ed (cid:104) (cid:104) Ex,y|d Ex,y|d (cid:104) (y − θ * x)2(cid:105)(cid:105) (cid:104)(cid:16) βrobust * μ(d) robust + ε − θ * x (cid:17)(cid:105)(cid:105) (cid:104)(cid:0)β * μ(d)(cid:1)2 + θ⊤ (cid:0)Σ + μ(d)μ(d)⊤(cid:1) θ − 2 (cid:0)β * μ(d)(cid:1) (cid:0)θ * μ(d)(cid:1)(cid:105) =σ2 =σ2 =σ2 ε + Ed ε + θ⊤Σθ + (β − θ)⊤ E (cid:2)μ(d)μ(d)⊤(cid:3) (β − θ) ε + θ⊤Σθ + (β − θ)⊤ T (β − θ) Proposition 7 (ID error as a function of θ). The ID error of a model θ is RID(θ) = σ2 ε + θ⊤Σθ + (β − θ)⊤ M (β − θ) , where M = 1 D (cid:80)D d=1 μ(d)μ(d)⊤ and Σ = σ2I. Proof. RID(θ) =ˆEx,y,d (cid:104) (cid:104) (y − θ * x)2(cid:105) =ˆEd Ex,y|d (cid:104) =ˆEd Ex,y|d (y − θ * x)2(cid:105)(cid:105) (cid:104) (cid:104)(cid:16) βrobust * μ(d) robust + ε − θ * x (cid:17)(cid:105)(cid:105) + θ⊤ (cid:0)Σ + μ(d)μ(d)⊤(cid:1) θ − 2 (cid:0)β * μ(d)(cid:1) (cid:0)θ * μ(d)(cid:1)(cid:105) =σ2 =σ2 =σ2 (cid:104)(cid:0)β * μ(d)(cid:1)2 ε + ˆEd ε + θ⊤Σθ + (β − θ)⊤ ˆE (cid:2)μ(d)μ(d)⊤(cid:3) (β − θ) ε + θ⊤Σθ + (β − θ)⊤ M (β − θ) Proposition 8 (OOD error of the oracle). The OOD error of the oracle model θ∗ is ROOD(θ∗) = σ2 ε + τ 2σ2 σ2 + τ 2 ∥βrobust∥2. Proof. Applying Proposition 5 and Proposition 6 yields the following: ROOD(θ∗) = σ2 ε + θ∗⊤Σθ∗ + (β − θ∗)⊤T (β − θ∗) = σ2 ε + = σ2 ε + τ 2σ2 σ2 + τ 2 ∥β∥2 τ 2σ2 σ2 + τ 2 ∥βrobust∥2. 22 (31) (32) (33) (34) (35) (36) (37) (38) (39) (40) (41) (42) (43) (44) (45) (46) (47) (48) Out-of-Domain Robustness via Targeted Augmentations C.4. Proof for Theorem 1 Theorem 1 (Excess OOD error without augmentations). If D < pdom, the expected excess OOD error of the unaugmented model is bounded below as (cid:104) (cid:105) ROOD(ˆθ(unaug)) − ROOD(θ∗) E ≥ τ 2γ2 ∥βrobust∥2 1 + γ2 (cid:18) 1 − (cid:19) . D pdom Proof. The goal is to lower bound the excess OOD error for the unaugmented estimator ˆθ(unaug), ROOD(ˆθ(unaug)) − ROOD(θ∗) ε + ˆθ(unaug)⊤Σˆθ(unaug) + (β − ˆθ(unaug))⊤T =σ2 (cid:16) β − ˆθ(unaug)(cid:17) − ROOD(θ∗) =β⊤M (Σ + M )−1Σ(Σ + M )−1M β + β⊤Σ(Σ + M )−1T (Σ + M )−1Σβ − τ 2σ2 σ2 + τ 2 ∥β∥2. We first eigendecompose M as Using this eigendecomposition, we can compute excess OOD error as ROOD(ˆθ(unaug)) − ROOD(θ∗) M = U diag(λ)U ⊤. =β⊤M (Σ + M )−1Σ(Σ + M )−1M β + β⊤Σ(Σ + M )−1T (Σ + M )−1Σβ − τ 2σ2 σ2 + τ 2 ∥β∥2 =β⊤U diag(v)U ⊤β, where vi = (cid:40) σ4(τ 2−λi)2 (σ2+τ 2)(λi+σ2)2 , τ 4 (σ2+τ 2) , i ≤ D i > D . (49) (50) (51) (52) (53) (54) (55) (56) (57) (58) (59) In the above expression, eigenvectors ui and eigenvalues λi are random variables, with randomness coming from the draw of domains. We simplify the above expression as ROOD(ˆθ(unaug)) − ROOD(θ∗) =β⊤U diag(v)U ⊤β (cid:32) D (cid:88) = i=1 σ4(τ 2 − λi)2 (σ2 + τ 2)(λi + σ2)2 (u⊤ i β)2 + pdom(cid:88) i=D+1 τ 4 (σ2 + τ 2) (cid:33) (u⊤ i β)2 . The first term is always positive, so we can lower bound it by 0, yielding ROOD(ˆθ(unaug)) − ROOD(θ∗) pdom(cid:88) (u⊤ i β)2. τ 4 (σ2 + τ 2) ≥ Finally, we compute the expected excess OOD error: i=D+1 (cid:104) E ≥E ROOD(ˆθ(unaug)) − ROOD(θ∗) (cid:34) pdom(cid:88) (cid:35) (u⊤ i β)2 (cid:105) i=D+1 τ 4 (σ2 + τ 2) ≥ E (cid:2)(u⊤ i β)2(cid:3) . τ 4 (σ2 + τ 2) pdom(cid:88) i=D+1 23 (60) (61) (62) (63) (64) (65) (66) (67) Out-of-Domain Robustness via Targeted Augmentations We then plug in E (cid:104)(cid:0)θ⊤ui (cid:1)2(cid:105) = ∥θ∥2/pdom from Lemma 1, which uses the spherical symmetry of M 's eigenvectors: − RID (cid:16)ˆθ(unaug)(cid:17)(cid:105) ROOD (cid:16)ˆθ(unaug)(cid:17) E (cid:104) ≥ τ 4 (σ2 + τ 2) τ 4 (σ2 + τ 2) τ 2γ2 ∥β∥2 1 + γ2 pdom(cid:88) E (cid:2)(u⊤ i β)2(cid:3) ∥β∥2 i=D+1 pdom − D pdom pdom − D pdom * τ 2γ2 ∥βrobust∥2 1 + γ2 * pdom − D pdom . = ≥ = where γ = τ /σ. (68) (69) (70) (71) (72) Lemma 1. Let θ ∈ Rm be a fixed vector, and let ui be eigenvectors with the ith largest eigenvalue for a random matrix A = 1 k , where z(d) is drawn from an isotropic Gaussian as z(d) ∼ N (0, s2Im). For all i = 1, . . . , m, d=1 z(d)z(d)⊤ (cid:80)k E (cid:2)(θ⊤ui)2(cid:3) = E[(θ⊤ui)2 | λ1, . . . , λm] = ∥θ∥2 m (73) Proof. Since z(d) is sampled from an isotropic Gaussian, A's unit eigenvectors are uniformly distributed on the unit sphere. Thus, we can simplify the expectation as follows: E (cid:2)(θ⊤ui)2(cid:3) = θ⊤E (cid:2)uiu⊤ i (cid:19) (cid:3) θ = θ⊤ I θ (cid:18) 1 m By the same symmetry argument, we get the same expected value even when conditioned on the eigenvalues, E (cid:2)(θ⊤ui)2 | λ1, . . . , λm (cid:3) = ∥θ∥2 m . = ∥θ∥2 m (74) (75) (76) (77) Corollary 1 (Excess OOD error with generic augmentations). If D < pdom, the expected excess OOD error of the generic model is bounded below as (cid:104) E ROOD(ˆθ(gen)) − ROOD(θ∗) (cid:105) ≥ τ 2γ2 ∥βrobust∥2 1 + γ2 (cid:18) 1 − (cid:19) . D pdom Proof. This follows from Theorem 1 and Proposition 2. C.5. Proof for Theorem 2 We first present Theorem 2 and its proof, including a more general theorem statement before it was simplified for the main text. Theorem 2 (Excess OOD error with targeted augmentations). Assume γ2 > 1. For any 0 < r0 ≤ 1 and large enough D such that D > 2(probust + 2) log(4Dprobust/r0), the excess OOD error is bounded as (cid:104) (cid:105) ROOD(ˆθ(tgt)) − ROOD(θ∗) E ≤ τ 2γ2∥βrobust∥2 1 + γ2      r0 D + 2(probust + 2) log(4Dprobust/r0) (cid:18) D 1 + γ2 (cid:18) 1 − (cid:113) 2(probust+2) log(4Dprobust/r0) D (cid:19)(cid:19)2      . (78) 24 Out-of-Domain Robustness via Targeted Augmentations Furthermore, for any 0 < r < 1 and large enough D such that D > 2(probust + 2) log(4Dprobust)/(1 − r)2, (cid:104) (cid:105) ROOD(ˆθ(tgt)) − ROOD(θ∗) E ≤ τ 2γ2 ∥βrobust∥2 1 + γ2 (cid:18) 1 D + 2 log(4Dprobust)(probust + 2) D(1 + γ2r)2 (cid:19) . Proof. Applying Proposition 9 and Lemma 4 yields (cid:104) (cid:105) ROOD(ˆθ(tgt)) − ROOD(θ∗) E ≤ τ 2γ2 1 + γ2 ∥βrobust∥2 (cid:18) η2 (1 + γ2(1 − η))2 + δ (cid:19) = τ 2γ2 1 + γ2 ∥βrobust∥2  δ +      2(probust + 2) log(4probust/δ) (cid:18) D 1 + γ2 (cid:18) 1 − (cid:113) 2(probust+2) log(4probust/δ) D (cid:19)(cid:19)2      = 1 D τ 2γ2 1 + γ2 ∥βrobust∥2 δD +     (cid:18) 2(probust + 2) log(4probust/δ) (cid:18) (cid:113) 2(probust+2) log(4probust/δ) D 1 − 1 + γ2      . (cid:19)(cid:19)2 (79) (80) (81) (82) (83) We will discuss the assumptions needed to apply Proposition 9 and Lemma 4 in a subsequent paragraph. Before we do that, we will pick δ as δ = r0/D for any constant 0 < r0 ≤ 1, in which case 0 < δ < 1 for D > 1. Then, we can simplify the expression as (cid:104) (cid:105) ROOD(ˆθ(tgt)) − ROOD(θ∗) E  ≤ 1 D τ 2γ2 1 + γ2 ∥βrobust∥2 δD +     (cid:18) 2(probust + 2) log(4probust/δ) (cid:18) (cid:113) 2(probust+2) log(4probust/δ) D 1 − 1 + γ2      (cid:19)(cid:19)2 ≤ τ 2γ2∥βrobust∥2 D(1 + γ2)      r0 + 2(probust + 2) log(4Dprobust/r0) (cid:18) 1 + γ2 (cid:18) 1 − (cid:113) 2(probust+2) log(4Dprobust/r0) D (cid:19)(cid:19)2      . In order to apply Proposition 9 and Lemma 4 above, we need to satisfy the following assumptions: • η < 1 • σ2 < τ 2, where η = (cid:113) 2(probust+2) log(4Dprobust/r0) D in this case. The first assumption is equivalent to This concludes the proof of the general statement. Now, we will simplify the expression for clarity. First, let's set r0 = 1. This yields: D > 2(probust + 2) log(4Dprobust/r0). (cid:104) E ROOD(ˆθ(tgt)) − ROOD(θ∗)  (cid:105) ≤ τ 2γ2∥βrobust∥2 D(1 + γ2) 1 +     (cid:18) 2(probust + 2) log(4Dprobust) (cid:18) (cid:113) 2(probust+2) log(4Dprobust) D 1 + γ2 1 − 25      . (cid:19)(cid:19)2 (84) (85) (86) (87) (88) (89) Out-of-Domain Robustness via Targeted Augmentations Now, we will bound (cid:114) 1 − 2(probust + 2) log(4Dprobust) D > r (90) for any 0 < r < 1. To do so, we further assume large enough D such that D > 2(probust + 2) log(4Dprobust)/(1 − r)2. Then, we can simplify the bound as (cid:104) E (cid:105) ROOD(ˆθ(tgt)) − ROOD(θ∗) (cid:18) ≤ τ 2γ2∥βrobust∥2 D(1 + γ2) 1 + 2(probust + 2) log(4Dprobust) (1 + γ2r)2 (cid:19) . (91) (92) Proposition 9. Let λmin, λmax be the minimum and maximum eigenvalue of Mrobust, respectively. If σ < τ and τ 2(1−η) ≤ λmin ≤ λmax ≤ τ 2(1 + η + η2) with probability greater than 1 − δ and η < 1, then (cid:105) (cid:104) ROOD(ˆθ(tgt)) − ROOD(θ∗) E ≤ τ 2γ2 1 + γ2 ∥βrobust∥2 (cid:18) η2 (1 + γ2(1 − η))2 + δ (cid:19) Proof. The excess OOD error of ˆθ(tgt) is ROOD(ˆθ(tgt)) − ROOD(θ∗) ε + ˆθ(tgt)⊤Σˆθ(tgt) + (β − ˆθ(tgt))T =σ2 (cid:16) β − ˆθ(tgt)(cid:17) − ROOD(θ∗) =σ2 ε + ˆθ(tgt)TrobustΣrobust robust + (βrobust − ˆθ(tgt) ˆθ(tgt) robust)⊤Trobust (cid:16) βrobust − ˆθ(tgt) robust (cid:17) − ROOD(θ∗) =ˆθ(tgt)TrobustΣrobust robust + (βrobust − ˆθ(tgt) ˆθ(tgt) robust)⊤Trobust (cid:16) βrobust − ˆθ(tgt) robust (cid:17) − τ 2σ2 σ2 + τ 2 ∥βrobust∥2 =β⊤ robustMrobust(Σrobust + Mrobust)−1Σrobust(Σrobust + Mrobust)−1Mrobustβrobust + β⊤ robustΣrobust(Σrobust + Mrobust)−1Trobust(Σrobust + Mrobust)−1Σrobustβrobust − τ 2σ2 σ2 + τ 2 ∥βrobust∥2. We first eigendecompose Mrobust as Using this eigendecomposition, we can compute excess OOD error as Mrobust = U diag(λ)U ⊤. ROOD(ˆθ(tgt)) − ROOD(θ∗) robustMrobust(Σrobust + Mrobust)−1Σrobust(Σrobust + Mrobust)−1Mrobustβrobust =β⊤ + β⊤ robustΣrobust(Σrobust + Mrobust)−1Trobust(Σrobust + Mrobust)−1Σrobustβrobust − τ 2σ2 σ2 + τ 2 ∥βrobust∥2 =β⊤ robustU diag(v)U ⊤βrobust where vi = = τ 2σ2 σ2 + τ 2 σ2λ2 i + σ4τ 2 (λi + σ2)2 − σ4(τ 2 − λi)2 (σ2 + τ 2)(λi + σ2)2 . 26 (93) (94) (95) (96) (97) (98) (99) (100) (101) (102) (103) (104) (105) (106) Out-of-Domain Robustness via Targeted Augmentations We can rewrite the excess OOD error as ROOD(ˆθ(tgt)) − ROOD(θ∗) =β⊤ robustU diag(v)U ⊤βrobust probust(cid:88) vi(β⊤ robustui)2 = i=1 probust(cid:88) i=1 = σ4(τ 2 − λi)2 (σ2 + τ 2)(λi + σ2)2 (β⊤ robustui)2. (107) (108) (109) (110) We now bound the excess OOD error by applying the bound on λmin and λmax. Recall that we assume τ 2(1 − η) ≤ λmin ≤ λmax ≤ τ 2(1+η+η2) with probability greater than 1−δ. Applying Lemma 3, if τ 2(1−η) ≤ λmin ≤ λmax ≤ τ 2(1+η+η2) and η < 1, then the following holds: ROOD(ˆθ(tgt)) − ROOD(θ∗) probust(cid:88) σ4(τ 2 − λi)2 (σ2 + τ 2)(λi + σ2)2 (β⊤ i=1 robustui)2 σ4τ 4η2 (σ2 + τ 2)(τ 2(1 − η) + σ2)2 ∥βrobust∥2 τ 2γ2η2 (1 + γ2)(1 + γ2(1 − η))2 ∥βrobust∥2. = ≤ = (111) (112) (113) (114) We now bound the expected value of the excess OOD error. Because the above bound holds with probability greater than 1 − δ (because the eigenvalue bounds hold with probability greater than 1 − δ), we first obtain the expected value by applying the total law of expectation: (cid:12) (cid:12) τ 2(1 − η) ≤ λmin ≤ λmax ≤ τ 2(1 + η + η2) (cid:12) (cid:12) (cid:105) (cid:12) λmin < τ 2(1 − η) or λmax > τ 2(1 + η + η2) (cid:12) (cid:104) E ROOD (cid:16)ˆθ(tgt)(cid:17) (cid:104) ≤(1 − δ)E ROOD (cid:16)ˆθ(tgt)(cid:17) − ROOD (θ∗) (cid:105) − ROOD (θ∗) (cid:104) + δE ROOD (cid:16)ˆθ(tgt)(cid:17) τ 2γ2η2 − ROOD (θ∗) (1 + γ2)(1 + γ2(1 − η))2 ∥βrobust∥2 (cid:34)probust(cid:88) + δE σ4(τ 2 − λi)2 (σ2 + τ 2)(λi + σ2)2 (β⊤ robustui)2 i=1 τ 2γ2η2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) σ4τ 4 ≤ ≤ = (1 + γ2)(1 + γ2(1 − η))2 ∥βrobust∥2 + δ (cid:18) τ 2γ2 1 + γ2 ∥βrobust∥2 (1 + γ2(1 − η))2 + δ η2 . (σ2 + τ 2)σ4 ∥βrobust∥2 (cid:19) λmin < τ 2(1 − η) or λmax > τ 2(1 + η + η2) (cid:105) (cid:35) (115) (116) (117) (118) (119) (120) (121) In the second to last step, we upper bound the second term by the maximum value for λi ∈ [0, ∞), using the fact that λi ≥ 0 as Mrobust is positive semidefinite. From Lemma 2, the upper bound is the higher of the value at λi = 0, which is (σ2+τ 2)σ4 ∥βrobust∥2, and limλi→∞ σ2+τ 2 ∥βrobust∥2. Because γ2 > 1, the former is higher, i.e., a more conservative upper bound. (σ2+τ 2)(λi+σ2)2 ∥βrobust∥2 = σ4 σ4(τ 2−λi)2 σ4τ 4 Lemma 2. Let f (z) = (τ 2−z)2 (σ2+z)2 . The derivative of f is d dz f (z) = − 2(τ 2 − z)(σ2 + τ 2) (σ2 + z)3 , (122) and f is decreasing in (−σ2, τ 2) and increasing in (τ, ∞). 27 Proof. Taking the derivative, we get Out-of-Domain Robustness via Targeted Augmentations d dz f (z) = − 2(τ 2 − z)(σ2 + τ 2) (σ2 + z)3 , Lemma 3. For z, η, σ, τ such that τ 2(1 − η) ≤ z ≤ τ 2(1 + η + η2), σ < τ , and 0 ≤ η < 1 + σ2/τ 2, (τ 2 − z)2 (σ2 + z)2 ≤ τ 4η2 (σ2 + τ 2(1 − η))2 . (123) (124) Proof. Let f (z) = (τ 2−z)2 bound f (z) for τ 2(1 − η) ≤ z ≤ τ 2(1 + η + η2) as (σ2+z)2 . Because f (z) is decreasing for −σ2 < z < τ 2 and increasing for z > τ 2 (Lemma 2), we can f (z) ≤ max (cid:18) τ 4η2 (σ2 + τ 2(1 − η))2 , τ 4(η + η2)2 (σ2 + τ 2(1 + η + η2))2 (cid:19) , if η < 1 + 1/γ2. We now show that τ 4η2 (σ2 + τ 2(1 − η))2 > τ 4(η + η2)2 (σ2 + τ 2(1 + η + η2))2 for η > 0. We can simplify the difference between these two quantities as τ 4η2 (σ2 + τ 2(1 − η))2 − η3(η + 2)(σ2 + τ 2)(−σ2 + 2τ 2η + τ 2) (σ2 − τ 2η + τ 2)2(σ2 + τ 2η2 + τ 2η + τ 2)2 . τ 4(η + η2)2 (σ2 + τ 2(1 + η + η2))2 = (125) (126) (127) (128) The above is positive if −σ2 + 2τ 2η + τ 2 > 0, which will be the case for η > 0 and τ 2 > σ2. Lemma 4. Let λmin, λmax be the minimum and maximum eigenvalues of Mrobust, respectively. With probability greater than 1 − δ, the eigenvalues can be bounded as (cid:32) (cid:114) λmin ≥ τ 2 1 − (cid:32) (cid:114) λmax ≤ τ 2 1 + −2(probust + 2) log(δ/4probust) D (cid:33) −2(probust + 2) log(δ/4probust) D + −2(probust + 2) log(δ/4probust) D (cid:33) Proof. We apply equations 1 and 6 from Zhu (2012) and the union bound. Note that the bounds can be written as τ 2(1 − η) ≤ λmin ≤ λmax ≤ τ 2(1 + η + η2), (129) (130) (131) where η = (cid:113) −2(probust+2) log(δ/4probust) D . C.6. Proof for Theorem 3 Theorem 3 (Targeted augmentations improve OOD risk). If γ2 > 1 and probust is small relative to pdom such that then for D such that probust < pdom log(2pdom) * 1 4(1 + γ4/(γ2 − 1)2) , 4γ4 D > (γ2 − 1)2 (probust + 2) log(2pdom) D < pdom − 4(probust + 2) log(2pdom), 28 Out-of-Domain Robustness via Targeted Augmentations the improvement in expected OOD risk is positive: (cid:104) (cid:105) ROOD(ˆθ(unaug)) − ROOD(ˆθ(tgt)) E > 0. Proof. First, we simplify the upper bound further, by picking r = 1/γ2 and by bounding D < pdom: (cid:104) (cid:105) ROOD(ˆθ(tgt)) − ROOD(θ∗) E ≤ ≤ ≤ τ 2γ2 ∥βrobust∥2 1 + γ2 τ 2γ2 ∥βrobust∥2 1 + γ2 τ 2γ2 ∥βrobust∥2 1 + γ2 (cid:18) 1 D (cid:18) 1 D + + 2 log(4Dprobust)(probust + 2) D(1 + γ2r)2 2 log(4Dprobust)(probust + 2) 4D (cid:19) (cid:19) (cid:18) 2 + log(4pdomprobust)(probust + 2) 2D (cid:19) . Now, we compare with the lower bound. The gap is: (cid:105) (cid:104) ROOD(ˆθ(gen)) E − E (cid:104) (cid:105) ROOD(ˆθ(tgt)) (cid:104) = E ROOD(ˆθ(gen)) − ROOD(θ∗) (cid:105) − E (cid:104) (cid:105) ROOD(ˆθ(tgt)) − ROOD(θ∗) ≥ τ 2γ2 ∥βrobust∥2 1 + γ2 (cid:18) 1 − D pdom − 2 + log(4pdomprobust)(probust + 2) 2D (cid:19) (132) (133) (134) (135) (136) (137) (138) We apply Lemma 5, noting that 1 < log(2pdom)(probust + 2) if pdom ≥ 2, i.e., as long as we have at least one robust domain-dependent feature and one spurious domain-dependent feature. (cid:104) (cid:105) ROOD(ˆθ(gen)) E − E (cid:105) (cid:104) ROOD(ˆθ(tgt)) ≥ τ 2γ2 ∥βrobust∥2 1 + γ2 (cid:18) (cid:16) − D − (cid:17)2 + pdom 2 p2 dom 4 − 2pdom(probust + 2) log(2pdom) (cid:19) We now find the conditions where the gap (Equation 140) is positive: (cid:16) − D − (cid:17)2 + p2 dom 4 − 2pdom(probust + 2) log(2pdom) > 0 ⇐⇒ (cid:16) D − < p2 dom 4 − 2pdom(probust + 2) log(2pdom) pdom 2 (cid:17)2 pdom 2 (cid:114) − 2pdom(probust + 2) log(2pdom) < D < ⇐⇒ pdom 2 − p2 dom 4 pdom 2 + (cid:114) p2 dom 4 ⇐= 4(probust + 2) log(2pdom) < D < pdom − 4(probust + 2) log(2pdom), √ √ √ where the last step applies ensure that the term in the square root is positive: x − y > x − − 2pdom(probust + 2) log(2pdom) (143) (144) y for 0 < y < x. For the above computation to go through, we need to p2 dom 4 − 2pdom(probust + 2) log(2pdom) > 0. With algebra, we can show that this is equivalent to probust < pdom 8 log(2pdom) − 2. In addition, we need to satisfy the assumption for Theorem 2: D > 2(probust + 2) log(4Dprobust)/(1 − 1/γ2)2, 29 (145) (146) (147) (139) (140) (141) (142) Out-of-Domain Robustness via Targeted Augmentations which would be implied by D > 4(probust + 2) log(2pdom)/(1 − 1/γ2)2 (148) for D < pdom. We compare this above minimum value on D with the minimum value of D for which there is a gap, we see that 4(probust + 2) log(2pdom)/(1 − 1/γ2)2 is larger by a factor of (1 − 1/γ2)−2. Thus, we can show a gap when 4(probust + 2) log(2pdom)/(1 − 1/γ2)2 < D < pdom − 4(probust + 2) log(2pdom). (149) Finally, we want to show that the above is a non-empty range, with 4(probust + 2) log(2pdom) (1 − 1/γ2)2 < pdom − 4(probust + 2) log(2pdom) ⇐⇒ probust < pdom 4 log(2pdom)(1 + (1 − 1/γ2)−2) − 2. (150) (151) Comparing with the earlier condition on probust, we see that this is a stronger condition. Because ˆθ(unaug) = ˆθ(gen), the same result applies in comparison to ˆθ(gen) as well. Lemma 5 (Negative polynomial lower bound for gap term.). If 1 < log(2pdom)(probust + 2) and Dpdom > 1, 1 − D pdom − 2 + log(4pdomprobust)(probust + 2) 2D (cid:16) D − > − (cid:17)2 + pdom 2 p2 dom 4 − 2pdom(probust + 2) log(2pdom) (152) Proof. Since 1 < log(2pdom)(probust + 2), + 1 D (cid:16) =⇒ 1 − log(2pdom)(probust + 2) D pdom D2 + pdom D pdom D + (cid:17) 2 log(2pdom)(probust + 2) D < (cid:18) log(2pdom)(probust + 2) D (cid:19) (cid:16) < 1 − (cid:16) (cid:16) 1 − 1 − =⇒ =⇒ (cid:17) (cid:17) pdom D pdom D + + pdom + pdom log(2pdom)(probust + 2) D2 pdom + pdom log(2pdom)(probust + 2) D2 (cid:16) < 1 − pdom D (cid:16) < Dpdom 1 − (cid:17) pdom D + 2pdom D (cid:18) log(2pdom)(probust + 2) D (cid:19) (153) (cid:17) + 2pdom(probust + 2) log(2pdom) D2 (154) (155) (cid:17) pdom D + 2p2 dom(probust + 2) log(2pdom) D (156) Since probust ≤ pdom, we know that 1 2 log(4pdomprobust) ≤ log(2pdom). (cid:16) 1 − =⇒ (cid:17) pdom D + 2pdom + pdom log(4pdomprobust)(probust + 2) 2D2 < Dpdom (cid:16) 1 − (cid:17) pdom D + 2p2 dom(probust + 2) log(2pdom) D =⇒ D pdom (cid:16) 1 − (cid:17) pdom D + 2 + log(4pdomprobust)(probust + 2) 2D < D2 (cid:16) 1 − (cid:17) pdom D + 2pdom(probust + 2) log(2pdom) (157) (158) =⇒ − D pdom (cid:16) 1 − (cid:17) pdom D − 2 + log(4pdomprobust)(probust + 2) 2D > −D2 (cid:16) 1 − (cid:17) pdom D − 2pdom(probust + 2) log(2pdom) =⇒ 1 − D pdom − 2 + log(4pdomprobust)(probust + 2) 2D (cid:16) D − > − (cid:17)2 + pdom 2 p2 dom 4 − 2pdom(probust + 2) log(2pdom) (159) (160) 30 Out-of-Domain Robustness via Targeted Augmentations C.7. Proof for Theorem 3 Theorem 3 (OOD error with domain-invariant augmentations). For all D, expected OOD risk is E[ROOD(ˆθ(inv)) − ROOD(θ∗)] = τ 2γ2∥βrobust∥2 1 + γ2 . Proof. (cid:16) β − ˆθ(inv)(cid:17) − ROOD(θ∗) (161) (162) (163) (164) (165) ROOD(ˆθ(inv)) − ROOD(θ∗) = σ2 ε + ˆθ(inv)⊤Σˆθ(inv) + (β − ˆθ(inv))⊤T ε + β⊤T β − ROOD(θ∗) τ 2 1 + γ2 ∥β∥2 ε + τ 2∥β∥2 − σ2 ε − = σ2 = σ2 = = τ 2γ2∥β∥2 1 + γ2 τ 2γ2∥βrobust∥2 1 + γ2 . 31 Out-of-Domain Robustness via Targeted Augmentations D. Extended simulation results In this section, we provide additional details about the sim- ulations in Section 4.3, as well as plots of the ID RMSE for both high and low-sample regimes. D.1. Additional simulation details For all experiments below, we fix σ2 = 0.1, τ 2 = 1, probust = 5, pspu = 500, and pnoise = 500. Models are evaluated by their RMSE on two test sets: an ID test set of held-out examples from Dtrain, and an OOD test set that generates examples from 1000 new domains Dtest. We train with l2 regularization; penalty strengths are tuned on an ID validation set. When applying an augmentation to a training set, we run the augmentation over all inputs 5 times, such that the final training set contains 5N samples. We plot ID RMSEs for varying ranges of D in Figure 11. Training with targeted augmentation results in similar ID error as generic and unaugmented training, although tar- geted augmentations result in slightly higher ID error when D is small. This is because memorizing xd:spu improves ID performance. Domain-invariant augmentation results in high, constant ID error. Plots are averaged over 10 random seeds with standard errors. Figure 11. In-domain RMSE across values for D. Plots are aver- aged over 10 random seeds with standard errors. 32 020040060080010001.01.21.41.6High-sample regime (N=100000)02004006008001000Low-sample regime (N=5000)ID Test RMSENumber of training domains DUnaugmentedGeneric augmentationDomain invariant augmentationTargeted augmentation Out-of-Domain Robustness via Targeted Augmentations E. Experimental details In this appendix, we provide tabular forms of results visu- alized in Figure 4. We also summarize core experimental details for each dataset, including hyperparameter tuning and model selection protocol. E.1. Extended results Table 5. Results on IWILDCAM2020-WILDS ID Test Macro F1 OOD Test Macro F1 Unaugmented RandAugment MixUp CutMix Cutout LISA CDAN DeepCORAL IRM Copy-Paste (Same Y) 46.5 (0.4) 48.9 (0.2) 45.5 (0.6) 45.2 (0.7) 47.9 (0.7) 45.4 (0.7) 41.2 (0.6) 42.4 (1.2) 39.4 (0.4) 50.2 (0.7) 30.2 (0.3) 33.3 (0.2) 28.9 (0.3) 28.4 (0.5) 32.6 (0.4) 29.6 (0.4) 28.6 (0.2) 30.3 (0.6) 27.8 (0.1) 36.5 (0.4) Table 6. Results on CAMELYON17-WILDS ID Val Avg Acc OOD Test Avg Acc Unaugmented RandAugment MixUp CutMix LISA DANN DeepCORAL IRM Stain Color Jitter 89.3 (2.0) 94.9 (1.0) 86.9 (2.2) 84.7 (2.6) 91.0 (1.6) 86.1 (2.1) 92.3 (1.1) 88.0 (2.3) 96.7 (0.1) 65.2 (2.6) 75.3 (1.7) 69.4 (2.1) 60.9 (2.2) 73.6 (1.4) 64.5 (1.9) 62.3 (3.0) 62.4 (3.1) 90.5 (0.9) Table 7. Results on BIRDCALLS ID Test Macro F1 OOD Test Macro F1 Unaugmented SpecAugment MixUp LISA Noise Reduction Random Pass CDAN DeepCORAL IRM Color Jitter Copy-Paste + Jitter (Region) 70.0 (0.5) 71.4 (0.4) 74.0 (0.4) 69.7 (0.5) 75.4 (0.3) 71.2 (2.0) 64.7 (0.5) 69.2 (0.5) 69.2 (0.4) 73.8 (0.2) 75.6 (0.3) 27.8 (1.2) 22.8 (1.0) 26.3 (1.0) 29.4 (1.1) 31.6 (0.9) 31.8 (1.2) 27.0 (1.2) 27.7 (0.9) 28.3 (0.8) 26.1 (0.9) 37.8 (1.0) E.2. Hyperparameters iWildCam. All experiments used a ResNet-50, pretrained on ImageNet, with no weight decay and batch size 24, fol- lowing Sagawa et al. (2021); Koh et al. (2021). Model se- lection and early stopping was done on the OOD validation 33 split of iWildCam, which measures performance on a held- out set of cameras Dval, which is disjoint from both Dtrain and Dtest. We tuned all methods by fixing a budget of 10 tuning runs per method with one replicate each; the hy- perparameter grids are given in Table 8. Final results are reported over 5 random seeds. For CDAN, we tuned the classifier and discriminator learn- ing rates and fixed the featurizer learning rate to be a tenth of the classifier's, following Sagawa et al. (2021). We applied all data augmentations stochastically with a tuned transform probability, since we found that doing so improved performance as in prior work (Gontijo-Lopes et al., 2020). For all augmentations, we also stochastically apply a random horizontal flip with the learned transform probability. Table 8. Hyperparameter IWILDCAM2020-WILDS. search spaces for methods on Method ERM Copy-Paste LISA Vanilla MixUp Vanilla CutMix RandAugment Cutout CDAN Hyperparameters Learning rate ∼ 10Uni(−5,−2) Learning rate ∼ 10Uni(−5,−2) Transform probability ∼ Uni(0.5, 0.9) Learning rate ∼ 10Uni(−5,−2) Transform probability ∼ Uni(0.5, 0.9) Interpolation method ∈ {MixUp, CutMix} Learning rate ∼ 10Uni(−5,−2) Transform probability ∼ Uni(0.5, 0.9) α ∈ {0.2, 0.4} Learning rate ∼ 10Uni(−5,−2) Transform probability ∼ Uni(0.5, 0.9) α ∈ {0.5, 1.0} Learning rate ∼ 10Uni(−5,−2) Transform probability ∼ Uni(0.5, 0.9) k ∈ {1, 2} Learning rate ∼ 10Uni(−5,−2) Transform probability ∼ Uni(0.5, 0.9) Version ∈ {Original, Bounding box-aware} Classifier learning rate ∼ 10Uni(−5.5,−4) Discriminator learning rate ∼ 10Uni(−5.5,−4) λ ∼ 10Uni(−0.3,1) Camelyon17. All experiments used a randomly initial- ized DenseNet-121, with weight decay 0.01 and batch size 168, following Sagawa et al. (2021); Koh et al. (2021). We also fixed the learning rate to that of Sagawa et al. (2021), which was selected by the authors of that paper after a ran- dom search over the distribution 10Uni(−4,−2). For Came- lyon17, we found that the choice of learning rate affected the relative ID vs. OOD accuracies of methods. To re- move this confounder, we therefore standardized the learn- ing rate across augmentations / algorithms for fair compar- ison. Separately tuning the learning rate for each algorithm did not significantly improve performance. Because Camelyon17 is class-balanced, we ran experi- Out-of-Domain Robustness via Targeted Augmentations Table 10. Hyperparameter search spaces for methods on BIRD- CALLS. Hyperparameters Learning rate ∼ 10Uni(−4,−3) Weight decay ∈ {0, 0.001, 0.1, 1} Learning rate ∼ 10Uni(−4,−3) Weight decay ∈ {0, 0.001, 0.1, 1} Transform probability ∼ Uni(0.5, 0.9) Learning rate ∼ 10Uni(−4,−3) Weight decay ∈ {0, 0.001, 0.1, 1} Transform probability ∼ Uni(0.5, 0.9) Learning rate ∼ 10Uni(−4,−3) Weight decay ∈ {0, 0.001, 0.1, 1} Transform probability ∼ Uni(0.5, 0.9) α ∈ {0.2, 0.4} Learning rate ∼ 10Uni(−4,−3) Weight decay ∈ {0, 0.001, 0.1, 1} Transform probability ∼ Uni(0.5, 0.9) k ∈ {1, 2} F ∈ {10, 20, * * * , 100} T ∈ {10, 20, * * * , 100} Learning rate ∼ 10Uni(−4,−3) Weight decay ∈ {0, 0.001, 0.1, 1} Learning rate ∼ 10Uni(−4,−3) Weight decay ∈ {0, 0.001, 0.1, 1} Classifier learning rate ∼ 10Uni(−5,−2) Weight decay ∈ {0, 0.001, 0.1, 1} Discriminator learning rate ∼ 10Uni(−5,−2) λ ∼ 10Uni(−0.3,1) Random Pass Noise Reduction CDAN seeds. Table 11. Hyperparameter search spaces for CLIP experiments on iWildCam. Method ERM Copy-Paste (Same Y) Hyperparameters Learning rate ∼ 10Uni(−6,−4) Weight decay ∼ 10Uni(−4,−0.2) Optimizer = AdamW Learning rate ∼ 10Uni(−6,−4) Weight decay ∼ 10Uni(−4,−0.2) Transform probability ∼ Uni(0.5, 0.9) Optimizer = AdamW ments on DANN (rather than CDAN). For DANN, we used the learning rate fixed across all methods for the featurizer and set the classifier learning rate to be 10× higher, follow- ing Sagawa et al. (2021). Model selection and early stopping was done on the OOD validation split of Camelyon17, which measures perfor- mance on a held-out hospital Dval, which is disjoint from both Dtrain and Dtest. We tuned remaining hyperparame- ters by fixing a budget of 10 tuning runs per method with one replicate each; the hyperparameter grids are given in Table 9. Because of the large variance in performance be- tween random seeds for some algorithms on Camelyon17 (Koh et al., 2021; Miller et al., 2021), we ran 20 replicates in the final results. Method ERM Copy-Paste LISA Vanilla MixUp Table 9. Hyperparameter CAMELYON17-WILDS. search spaces for methods on SpecAugment Hyperparameters Method Stain Color Jitter Augmentation strength ∈ [0.05, 0.1] LISA Vanilla MixUp Vanilla CutMix RandAugment Cutout Interpolation method ∈ {MixUp, CutMix} α ∈ {0.2, 0.4} α ∈ {0.5, 1.0} k ∈ {1, 2} - Discriminator learning rate ∼ 10Uni(−4,−2) λ ∼ 10Uni(−1,0) DANN BirdCalls. All experiments used an EfficientNet-B0, pre- trained on ImageNet, with batch size 64. Model selec- tion and early stopping was done on an ID validation split, which measures performance on a held-out examples from Dtrain. We tuned all methods by fixing a budget of 10 tun- ing runs per method with five replicates each; the hyper- parameter grids are given in Table 10. Because of its small size, BirdCalls has relatively high variance between results; we thus report final results averaged over 20 random seeds. For CDAN, we tuned the classifier and discriminator learn- ing rates and fixed the featurizer learning rate to be a tenth of the classifier's, matching our policy on iWildCam. For all augmentations, we also stochastically apply a random horizontal flip with the learned transform probability. E.3. CLIP Experiments In our experiments finetuning CLIP on iWildCam and Camelyon17, we used OpenAI's CLIP ViT-L/14 at 224 x 224 pixel resolution. Early stopping and model selection were done on the OOD validation splits. Hyperparameters are given in Table 11 for iWildCam and Table 12 for Came- lyon17; we based Camelyon17 hyperparameters on Kumar et al. (2022) and iWildCam hyperparameters on Wortsman et al. (2022). We tuned all methods by fixing a budget of 10 tuning runs per method. Results are averaged over five 34 Out-of-Domain Robustness via Targeted Augmentations Table 12. Hyperparameter search spaces for CLIP experiments on Camelyon17. Method ERM Stain Color Jitter Hyperparameters Learning rate ∼ 10Uni(−6,−3) Weight decay = 0.01 Optimizer = SGD Learning rate ∼ 10Uni(−6,−3) Weight decay = 0.01 Augmentation strength ∈ [0.05, 0.1] Optimizer = SGD 35
http://arxiv.org/abs/2302.11855v1
2023-02-23T08:53:52
2023-02-23T08:53:52
Accurate Free Energy Estimations of Molecular Systems Via Flow-based Targeted Free Energy Perturbation
The Targeted Free Energy Perturbation (TFEP) method aims to overcome the time-consuming and computer-intensive stratification process of standard methods for estimating the free energy difference between two states. To achieve this, TFEP uses a mapping function between the high-dimensional probability densities of these states. The bijectivity and invertibility of normalizing flow neural networks fulfill the requirements for serving as such a mapping function. Despite its theoretical potential for free energy calculations, TFEP has not yet been adopted in practice due to challenges in entropy correction, limitations in energy-based training, and mode collapse when learning density functions of larger systems with a high number of degrees of freedom. In this study, we expand flow-based TFEP to systems with variable number of atoms in the two states of consideration by exploring the theoretical basis of entropic contributions of dummy atoms, and validate our reasoning with analytical derivations for a model system containing coupled particles. We also extend the TFEP framework to handle systems of hybrid topology, propose auxiliary additions to improve the TFEP architecture, and demonstrate accurate predictions of relative free energy differences for large molecular systems. Our results provide the first practical application of the fast and accurate deep learning-based TFEP method for biomolecules and introduce it as a viable free energy estimation method within the context of drug design.
[ "Soo Jung Lee", "Amr H. Mahmoud", "Markus A. Lill" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11855v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11855v1", "@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" ]
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 5 8 1 1 . 2 0 3 2 : v i X r a ACCURATE FREE ENERGY ESTIMATIONS OF MOLECU- LAR SYSTEMS VIA FLOW-BASED TARGETED FREE EN- ERGY PERTURBATION Soo Jung Lee∗, Amr H. Mahmoud ∗& Markus A. Lill Department of Pharmaceutical Sciences University of Basel Klingelbergstrasse 50 4056 Basel, Switzerland [email protected] ABSTRACT The Targeted Free Energy Perturbation (TFEP) method aims to overcome the time-consuming and computer-intensive stratification process of standard meth- ods for estimating the free energy difference between two states. To achieve this, TFEP uses a mapping function between the high-dimensional probability densi- ties of these states. The bijectivity and invertibility of normalizing flow neural net- works fulfill the requirements for serving as such a mapping function. Despite its theoretical potential for free energy calculations, TFEP has not yet been adopted in practice due to challenges in entropy correction, limitations in energy-based training, and mode collapse when learning density functions of larger systems with a high number of degrees of freedom. In this study, we expand flow-based TFEP to systems with variable number of atoms in the two states of considera- tion by exploring the theoretical basis of entropic contributions of dummy atoms, and validate our reasoning with analytical derivations for a model system contain- ing coupled particles. We also extend the TFEP framework to handle systems of hybrid topology, propose auxiliary additions to improve the TFEP architecture, and demonstrate accurate predictions of relative free energy differences for large molecular systems. Our results provide the first practical application of the fast and accurate deep learning-based TFEP method for biomolecules and introduce it as a viable free energy estimation method within the context of drug design. 1 INTRODUCTION Free energy calculation methods such as Free Energy Perturbation (FEP) (Zwanzig, 1954) are valu- able in the field of Computer-aided Drug Design (CADD) to evaluate binding affinities between candidate compounds and receptors, or other biomolecular interactions (Brown et al., 2010; Po- horille et al., 2010; De Vivo et al., 2016). Although useful in cases when experimental testing is unfeasible, high computational cost remains the current drawback for otherwise reliable and accu- rate in silico methods. For example, FEP calculations for the free energy difference between two thermodynamic states requires a multitude of stratified molecular dynamics (MD) simulations so that the distributions of the explored configuration space by these intermediates sufficiently overlap to achieve convergence (Section A.1). Targeted Free Energy Perturbation (TFEP) has been presented as a potential alternative method for free energy calculation by applying a generalized FEP identity (Equation 1) whereby an invertible, high-dimensional mapping function is used to transform a distribution of one system or state to another (Jarzynski, 2002; Hahn & Then, 2009). The invertible and bijective normalizing flow neural network has been suggested as a solution to overcoming the difficulty of formulating the required complex mapping functions in order to achieve overlap of configuration space distributions, and its ∗Equal contribution. 1 application for TFEP has previously been demonstrated on a growing soft sphere solute in a solvated box (Wirnsberger et al., 2020). Despite early success, several challenges remained that hindered immediate application of the TFEP method to larger systems with many more degrees of freedom (DOFs) which follow more complex density functions, such as biomolecules. In our study, we expand on the flow-based TFEP method by addressing the following points: • The bijectivity of flow-based generative neural networks must be upheld by keeping the DOF consistent throughout, a critical point considering many biomolecular free energy studies are performed to compare systems of different sizes. We convert systems to hy- brid topologies where deleted atoms are replaced by dummy atoms and inserted atoms are generated by geometric proposal engines. • The use of dummy atoms in flow-based TFEP for single free energy difference calculations (∆F ), as opposed to dual free energy differences (∆∆F ), leads to inaccuracies due to their entropic contributions. We first delineate this effect through analytical derivations using the coupled-particle toy system. We then propose two different methods of circumventing free energy estimation variance due to the presence of dummy atoms. The first method is incorporation of an auxiliary flow model to the TFEP flow architecture. The second method uses the thermodynamic cycle for relative free energy difference calculation to cancel out entropic effects resulting from dummy atoms. • The difficulty in training a flow-based neural network rises concomitantly with increases in the DOF. A secondary benefit of adding the auxiliary flow is that it approximates a complex target probability density function which can then be set as prior for the free energy difference estimating bijector. The similarity between the prior and target densities reduces the scale and distance of transformation necessary by flow and impedes mode- seeking behavior that often leads to incorrect learning. • We use our extended TFEP method to demonstrate successful prediction of free energy dif- ferences for two different tasks commonly studied in chemical biology and drug discovery: Computation of hydration free energy and free energy differences of protein stability due to mutagenesis. The results are comparable in accuracy to established computational methods at significantly reduced computational costs due to circumvention of long simulations. 2 RELATED WORKS 2.1 TARGETED FREE ENERGY PERTURBATIONS TFEP is an elegant approach to free energy difference estimation devised by Jarzynski (2002), ex- tending Zwanzig's FEP identity function (Zwanzig, 1954). For two thermodynamic states A and B, the relationship between the true free energy difference ∆F of the two states can be recovered using a generalized estimator Φ instead of potential energy differences ∆U : e−β∆F = EA (cid:2)e−βΦA→A(cid:48) (cid:3) , (1) where β denotes the thermodynamic beta and A(cid:48) the new proposal distribution so that for configu- rations x ∼ A, the mapping is M (x) ∼ A(cid:48). In the forward transfer mapping A to B, expectations are taken with respect to the equilibrium density of A, ρA ∝ e−βUA (similar for B when mapping the reverse from B to A). The neural network perfoming the role of TFEP mapping function M : A → A(cid:48) must be invertible so that M −1 : B → B(cid:48). The generalized energy differences for forward and reverse directions are defined as the difference in potential energies between target and base, from where the log determinant of the Jacobian (J) associated with the respective map direction has been subtracted: ΦF (x) = UB(M (x)) − UA(x) − β−1 log |JM (x)| ΦR(x) = UA(M −1(x) − UB(x) − β−1 log |JM −1 (x)|. (2) Additional details are provided in Section A.2. 2 Figure 1: Schematics for the toy system example. (A) Comparison of a standard normalizing flow (left) and an auxiliary flow stacked on a bijector flow (right). Normalizing flows conventionally learn mapping between a data distribution ˆpX for data space X and a prior distribution pZ (typically Gaussian) for reference space Z. (B) Schematic of the thermodynamic cycle for the coupled particle system. Dotted line particles represent dummy atoms. (C) Scheme representing the process of atom annihilation and its corresponding probability density. The probability density of the annihilated particle is transformed to a Gaussian distribution (intermediate state, with dummy atom). The theo- retical mapping of this density to a Dirac delta function cannot be modeled by flow-based methods but is computed by analytical means. TFEP harnesses a path-independent mapping function to overlap the configuration space distribution between reference and target state. With a correctly formulated mapping function in place, conver- gence of the free energy differences is instantaneous and can significantly accelerate free energy predictions compared to conventional methods dependent on simulations which require a lengthy sequence of energy calculations per stratification step. The bottleneck thus far has been the diffi- culty in formulating such a complex mapping function, for which normalizing flow neural networks have recently been presented as a solution Wirnsberger et al. (2020); Rizzi et al. (2021); Falkner et al. (2022). Normalizing flows rely on identical dimensionality between reference and target spaces for bijector transforms in order to perform exact density estimations, a point that is discussed further in Section 3. 2.2 NORMALIZING FLOWS AND BOLTZMANN GENERATORS The architecture of the mapping function M is crucial for accurate free energy prediction using the TFEP method because convergence must be reached based on a finite number of samples obtained from the two end states A and B. Previous reports exhibit the effectiveness of normalizing flows (Pa- pamakarios et al., 2019; Rezende et al., 2020) in free energy calculations (Ding & Zhang, 2021a;b; No ́e et al., 2019), which are transformations of variables z from a known prior density such as a Normal distribution to those from a more complex distribution, x = f (z). Boltzmann Generators are a type of flow-based generative model that learns such diffeomorphisms for molecular structures with many DOFs (No ́e et al., 2019). Additional details are provided in Section A.3. 3 3 ENTROPIC CONTRIBUTIONS OF DUMMY ATOMS As reported by Wirnsberger et al. (2020), normalizing flows satisfy requirements for mapping func- tion implementation in TFEP in that they are bijective, allow for efficient computation of the inverse and the Jacobian determinant, and are highly flexible. The significance of bijectivity is that although DOFs need to stay conserved for flow-based TFEP, the systems being compared do not always share the same number of atoms for many free energy questions posed in computational chemistry. To preserve the same dimensionality throughout the bijective transformation layers of normalizing flow, dummy atoms can be used as placeholders and the systems can be represented with a hybrid topology. We designed a toy system where states A and B differ by a single particle to test our treatment of dummy atoms within the TFEP method, and validate that the differences in the Jacobian term are equivalent to the analytically derived entropy of a Normal distribution function. If a transfer mapping function M : A → A(cid:48) with target B is optimally formulated such that A(cid:48) = B, the Jacobian term from the TFEP generalized estimator log |JM (x)| represents the entropy difference between A and B. To numerically derive the entropic contribution by dummy atoms, we use a 2-dimensional coupled- harmonic particle system (Figure 1B, C), defined by the energy functions provided in Section A.4. These potential functions confine movement of the particles to a predefined range of coordinate space to emulate a physical harmonic bond term, and represent biological ligands in bound and unbound states. The objective is to analytically solve for the explicit entropy contribution to free energy difference predictions by the dummy particle that replaces the deleted atom. The model we use for TFEP free energy estimation is a combination of two stacked flows as shown in Figure 1A. We construct an auxiliary flow as an RQNSF-based BG (Durkan et al. (2019a), Section A.7) of 4 affine coupling layers with alternating even and odd binary masking using the nflows library (Durkan et al., 2020). Supposing we perform a transfer mapping of B to A, this auxiliary flow is foremost trained as a density estimator for A (120 epochs, 4096 batch size, 5e−4 learning rate) by maximum likelihood. The prior is set as a Normal distribution function and the target as A. The auxiliary flow is stacked on top of a second bijector flow, which is the mapping function between A and B and responsible for the free energy difference estimation between the two systems. The bijector is constructed and trained similarly to the auxiliary flow, the only difference being that the prior is set as the estimated density of the auxiliary flow (the learned A), and the target is B. Training is conducted via maximum likelihood so that samples from B are transformed such that the generated distribution B(cid:48) has maximized overlap in the domain of the distribution of the auxiliary flow-estimated A. Finally, the TFEP loss function is used to evaluate the transformation. The advantage of using a dual flow is that the learned prior and target of the bijector occupy distribu- tions that are more similar than a normalizing flow with a noise prior, heightening the efficiency and accuracy of training (Figure S2). Invertible transformations between similar distributions are more straightforward and easier to find because they preserve the general structure of the distributions and can map similar regions to each other. This method avoids increased complexity in the transforma- tion that can lead to difficulty in optimization, risk of overfitting, intractability in computation, and burdens in memory requirements. In contrast, training a bijector alone with no auxiliary density estimate would be driven by minimiza- tion of Kullback-Leibler (KL) divergence, which leads to mode-seeking behavior. For larger systems that follow highly complex and multimodal density functions, this behavior leads to difficulties in convergence and ultimately inaccurate free energy difference predictions. Table 1: Entropy Effects on Single Free Energy Differences Ground truth Flow ∆F ∆∆F Bound Unbound Bound Unbound -1.853 -1.950 -0.470 -3.300 -1.383 -1.350 4 As shown in Table 1, we obtained single free energy differences (∆F ) for atom deletion between prior (A, coupled two-particle system) and target (B, single-particle system) using the dual flow method with TFEP. In the bound state, the difference in ∆F between ground truth and flow is 1.447, and that for unbound state is 1.480. These values are indeed comparable with the known entropy of a Normal distribution, S = ln 2 = 1.4189. We are therefore able to demonstrate with our coupled particle deletion example that a dummy atom defined by a Gaussian will contribute en- tropically to single free energy difference estimations, and it is crucial to take this into consideration when using the TFEP method for free energy studies of molecular systems with changes in DOFs. 2π + 1 √ 4 CONSTRUCTION OF HYBRID TOPOLOGY Relative free energy difference studies in drug discovery often involve end states that have different numbers of atoms, or DOFs. To preserve the bijective nature of normalizing flow for the TFEP method and simultaneously allow the method to be applicable for systems of different size and topology, we implement a hybrid topology approach. Hybrid topologies fuse two systems and map their corresponding atoms to each other (Figure 2A). In this section, we describe the particle types in hybrid topology, the setup for traditional relative free energy calculations by FEP approach (RFEP), and how it is integrated in our proposed deep learning model. Particles in a hybrid topology are assigned to one of four groups: environment, core, unique old, and unique new. Suppose we are estimating free energy differences between Molecule A and Molecule B. All atoms of common residues in A and B are environment atoms, while common atoms on the the C-alpha atom of the mutated residue in the differing residue are designated core atoms (e.g. Trpcage W6F study, Section 7). When considering a transformation in the direction from A to B, unique atoms for A would be considered unique old and those for B would be considered unique new. RFEP can be divided into three stages: First, a hybrid 2D topology is generated from single topolo- gies of Molecules A and B. Second, the topology and coordinates of Molecule A are used as input to initiate a hybrid 3D system. Third, atoms are generated using a geometric proposal engine (Ad- ditional details, Section A.6). For our study, we follow strategies implemented in the Perses framework (Rufa et al., 2022) that use a variant of maximum common substructure algorithm from OEChem TK (OpenEye Scientific Software, Santa Fe, NM) and the force constant and equilibrium state of dummy atoms. 5 ARCHITECTURE AND METHOD DESIGN Variations of normalizing flow networks have been published, where some are permutation equiv- ariant but lacking rotation-translation equivariance (Wirnsberger et al., 2020) and others exhibit E(n) equivariance at the expense of learning instability (Satorras et al., 2021). We base our implementa- tion (Fig. 2C) on the BG concept (No ́e et al., 2019) with the following minor adjustments: (i) We opt for a rotation-translation invariant solution by leveraging the space of internal coor- dinates as a product of hypertori and compact intervals, similar to previous literature (No ́e et al., 2019; K ̈ohler et al., 2021; Invernizzi et al., 2022), and bookend the bijector flow with layers that transform Cartesian to internal coordinates or vice versa. These are non- trainable layers that transform Euclidean coordinates x ∈ Rn×3 into bonds d ∈ [a1, b1] × . . . × [an−1, bn−1], angles α ∈ [0, π]n−2, and torsions τ ∈ Tn−3. The internal coordinate transformation is performed by rational quadratic spline flows (Durkan et al., 2019a). The model learns a joint distribution p(d, α, τ ) on the topological space XIC := I2n−3 × Tn−3, where the closed unit interval is I = [0, 1]. (ii) We set priors as nontrivial probability distributions that are sampled via MD. MD simu- lations are performed using the hybrid topology for each end state (lambda 0 and 1) in Cartesian coordinates from which we obtain a representative set of configurations for train- ing in the forward (A to B) or reverse direction (B to A). Due to the similarity between the prior and the target, the learning by energy scheme (No ́e et al. (2019), Section A.3) is much smoother and we are able to train at fast speed by using a simple flow architecture with only a few coupling layers. 5 Figure 2: Flow-based TFEP model implementations. (A) Hybrid topology for ethane and methanol with dummy atoms (du) inserted for consistent DOFs in bijective transformation via flow models. Environment atoms are numbered 0, 2-4, core atoms are numbered 1, and unique atoms are num- bered 5-8 and marked with a bold outline. Black bidirectional arrows indicate the mapping of each atom to its corresponding atom in the other system. (B) Z-matrices for ethane, methanol, and the hybrid systems. Atom numbering identical to (A). (C) Schematic summarizing the flow architecture that transforms between base System A and target System B. RQNSF coupling layers are repre- sented as blue blocks, Cartesian coordinates are labeled 'xyz', and internal coordinates are 'ic'. Normalizing flows are capable of tractable transformations, but they are not necessarily expressive enough to capture any and all complex mapping from a naive prior to a high-dimensional, complex target distribution. Training a BG in practice may also be difficult because energy-based training is characterized by mode-seeking behavior and struggles to converge reliably when the target distri- bution is multimodal. Our method overcomes this by designing a mapping between similar density functions, which makes the transform more straightforward and enables the model to train quickly and accurately for molecular systems. 5.1 CANCELLATION OF DUMMY ENTROPY For end states A and B that represent the initial Molecule A (λ=0, where λ represents an alchemical coupling parameter) and final Molecule B (λ=1), we perform simulations using a hybrid topology as described in Section 4, where dummy atoms are either turned on or annihilated during the trans- formation depending on which end state molecule they represent. Dummy atoms are connected to the common core through alchemical bonded force field terms, which can skew energies calculated for the end states if they are placed with disregard to physical context. Additionally, the DOFs of dummy atoms are included in the mapping between A and B and contribute entropically to the free energy difference. The first method of balancing these energetic and entropic contributions by implementing an auxil- iary flow as a density estimator for the free energy predicting bijector has been previously demon- strated using a toy system in Section 3. As a second approach, we take advantage of the dummy atoms decoupling from the core environment with regards to their nonbonded interactions in their annihiliated state. This causes the configurational samples of the dummy atoms and their energetic evaluation to be independent of the core and environment. Moreover, these independent energetic 6 and entropic contributions of the dummy atoms cancel each other out in parallel legs of thermody- namic cycles. Dummy atoms in the solvated and vacuum states cancel each other out for solvation free energy calculations, those in folded and unfolded states do so for mutation free energy calcu- lations, and those in bound and unbound complexes also for relative free energies of binding. As a result, it is unnecessary to correct for the energetic and entropic contributions of annihilated dummy atoms for single free energy differences (∆F ) of each transformation leg separately. Instead, we directly compute the dual free energy difference (∆∆F ) from the full thermodynamic cycle. Figure 3: Thermodynamic cycles for application example systems. (A) Thermodynamic cycle for mutation between ethane and methanol. (B) Thermodynamic cycle for W6F residue mutation in Trp- cage miniprotein. Legs of the thermodynamic cycle where the flow-based TFEP mapping function is used are marked orange. 6 APPLICATION ON SMALL MOLECULE MUTATION The energy difference when a molecule transitions from vacuum to a solvated state at constant tem- perature and pressure is represented by solvation free energy, ∆F solvation (or hydration free energy in cases where the solvent is water). Solvation free energy difference estimations are pertinent to computational chemistry and drug design and traditionally require stratified, alchemical methods (Section A.8). Commonly, a series of nonphysical intermediates parameterized by the alchemical coupling parameter λ are simulated to ultimately transfer a solute from gas phase to solvent or vice versa. hydration − ∆F ethane We test our TFEP method on prediction of hydration free energy difference between ethane and methanol. From the thermodynamic cycle in Figure 3A, we see that ∆∆Fhydration = ∆F methanol solvated − ∆F mutation vacuum . In this section, we investigate two pathways. The first is the solvation pathway adapted from Duarte Ramos Matos et al. (2017), where ethane and methanol are respectively flow transformed from water to vacuum or vice versa. The energy functions that calculate potential energy for each end state include terms and parameters for either vacuum or implicit solvent. hydration = ∆F mutation Table 2: Free energy difference estimation from solvation legs. Ethane Methanol Hydration ∆∆F (kcal/mol) Dehydration ∆∆F (kcal/mol) Experimental Vac → Water Water → Vac Gromacs TI 1.83 -5.10 -6.93 2.46 -3.49 -5.95 1.89 -4.75 -6.64 -1.91 4.71 6.62 For the second mutation pathway experiment, we use the hybrid z-matrix topology scheme con- structed by merging the z-matrices of ethane and methanol as shown in Figure 2B. We compare 7 the flow-based free energy estimations (NF) with reference methods thermodynamic integration (SOMD-TI) and Multiple Bennett Acceptance Ratio (SOMD-MBAR) (Section A.8) following al- chemical free energy calculation molecular dynamics simulations run by the OpenMM-interfacing SOMD engine Loeffler et al. (2015); Hedges et al. (2019). NF results are comparable to other meth- ods as shown in Table 3. The loss profile of the transformation of ethane to methanol in solvated and vacuum states and the solvation free energy is given in Figure S4. Table 3: Comparison with alternative free energy calculation methods. Ethane → Methanol (kcal/mol) NF -5.75 SOMD-TI -6.02 SOMD-MBAR -6.16 7 APPLICATION ON PROTEIN RESIDUE MUTATION Trp-cage or TC5b (Neidigh et al., 2002) is a 20-residue (NLYIQWLKDGGPSSGRPPPS) minipro- tein with a two-state folding mechanism that has been featured extensively in energy and confor- mation change studies (Simmerling et al., 2002; Snow et al., 2002; Chowdhury et al., 2003; Niki- forovich et al., 2003; Pitera & Swope, 2003; Zhou, 2003; Ding & Dokholyan, 2005; Linhananta et al., 2005; Sidky et al., 2019; Juraszek & Bolhuis, 2006). The key stabilizing components are the six residues making up the buried hydrophobic core (TYR3, TRP6, LEU7, GLY11, PRO12, PRO19), four prolines that minimize ∆SU , and a salt bridge interaction. Many single-site mutation studies have been performed on Trp-cage, both empirically and compu- tationally. Among these we use W6F, which reportedly leads to completely unfolding in water with destabilization of ∆∆GF = 12.5 ± 0.6 kJ/mol (Barua et al., 2008). Tripeptides and mutation structure files were created and prepared using Schr ̈odinger Maestro (wild- type PDB ID: 1L2Y). Explicitly solvated structures were prepared using the pdb4amber tool from the AmberTools MD package (Case et al., 2020) and MD simulations were run using OpenMM (Eastman et al., 2017). Frames from a 40 ns simulation were collected at equal intervals and used as starting states for multiple short (1 ns) simulations. All spawned simulations were concatenated as a single 40 ns trajectory of 400,000 frames to be used as training input structures to ensure sta- tistically converged results (Genheden & Ryde, 2010). For all simulations, nonbonded cutoff was 0.9 nm, temperature 300 K, timestep 1fs, and a Langevin dynamics integrator was used with 1 ps−1 friction coefficient. Solvent molecules were removed and potential energy was calculated implicitly prior to network training (Paschek et al. (2007), Section 8). We obtained flow-based TFEP free energy difference estimations for W6F mutation (NF) and com- pared the results with predictions from a non-equilibrium switching method implemented by open source software pmx (Seeliger & De Groot, 2010; Gapsys et al., 2015). We also compared esti- mations from equilibrium replica-exchange via lambda hopping (FEP-REMD) as implemented by Schr ̈odinger (Wang et al., 2015). Table 4: Results for Trp-cage W6F mutation free energy estimation. W6F (kcal/mol) Experimental NF 3.18 2.98 pmx 3.48 FEP-REMD (MBAR) 3.19 As shown in Table 4, results for the flow-based TFEP method are comparable with both experimental and computational free energy difference values. 8 CONCLUSION AND DISCUSSION In this work, we introduce a range of contributions to the concept of flow-based free energy dif- ference estimations and related physical problems. The objective of the proposed approach is to provide an alternative computational method of free energy estimation that performs at accelerated 8 speeds compared to conventional methods by eliminating the need for a multitude of computation- ally expensive, stratified MD simulations. To summarize, we first acknowledge dummy atoms are necessary for preserving bijector dimen- sionality and these dummies should not influence the free energy calculations. We then analytically derive the Jacobian contribution in the TFEP generalized estimator by these dummy particles using a toy system. In the next section, we propose integration of a hybrid topology scheme to the TFEP method as an efficient way of preserving dimensionality for molecular systems in normalizing flows. We also discriminate our method from normalizing flow-based BGs (No ́e et al., 2019; Invernizzi et al., 2022; Mahmoud et al., 2022) by mapping between similar prior and target instead of between a noise prior and complex target, enhancing efficiency and the capacity to train larger systems. We also provide two approaches to ensure that deep-TFEP free energy difference estimations do not suffer from variance due to dummy atoms. The first is an architectural solution, stacking an auxiliary flow density estimator on the bijector as a prior. The second is by taking advantage of double free energy difference settings, under assumption that free energy differences for parallel legs of the thermodynamic cycle will contain the same entropic contributions that cancel out. A caveat to note is that this assumption may not hold true in all cases Boresch & Karplus (1996); Fleck et al. (2021), indicating a need for further study. Regarding training data for our deep generative models, we used Generalized Born (GB)-solvated data samples. Although better agreement can be achieved with experiments using explicit solvent, the choice for implicit solvation was deliberate due to challenges in modelling ensemble distributions that included explicit solvent molecules. Furthermore, inclusion of waters greatly increases the system size (DOFs) and also introduces permutation symmetry. Future studies on this topic may attempt a combination of promising developments in flow-based generative models for large systems with permutational symmetry (No ́e et al., 2019; Wirnsberger et al., 2020; K ̈ohler et al., 2023) with the current TFEP approach. Another possible direction for improving the current approach is to enhance physical accuracy by integrating deep learning potentials that implicitly account for explicit water (Chen et al., 2021; Mahmoud et al., 2020; Ghanbarpour et al., 2020). ACKNOWLEDGMENTS This study was financially supported by funding from the Swiss National Science Foundation (Project number: 310030 197629). REFERENCES Bipasha Barua, Jasper C Lin, Victoria D Williams, Phillip Kummler, Jonathan W Neidigh, and Niels H Andersen. The trp-cage: optimizing the stability of a globular miniprotein. Protein Engineering, Design & Selection, 21(3):171–185, 2008. Stefan Boresch and Martin Karplus. The jacobian factor in free energy simulations. The Journal of chemical physics, 105(12):5145–5154, 1996. Scott Brown, Michael Shirts, and David Mobley. Free-energy calculations in structure-based drug design, pp. 61–86. Cambridge University Press, 05 2010. ISBN 978-0-521-88723-6. David A Case, Kellon Belfon, Ido Ben-Shalom, Scott R Brozell, David S Cerutti, Thomas EI Cheatham, Vin ́ıcius WD Cruzeiro, Tom A Darden, Robert E Duke, George Giambasu, et al. Amber 2020: University of california. San Francisco, 2020. Yaoyi Chen, Andreas Kr ̈amer, Nicholas E Charron, Brooke E Husic, Cecilia Clementi, and Frank No ́e. Machine learning implicit solvation for molecular dynamics. The Journal of Chemical Physics, 155(8):084101, 2021. Shibasish Chowdhury, Mathew C Lee, Guoming Xiong, and Yong Duan. Ab initio folding simula- tion of the trp-cage mini-protein approaches nmr resolution. Journal of molecular biology, 327 (3):711–717, 2003. 9 Marco De Vivo, Matteo Masetti, Giovanni Bottegoni, and Andrea Cavalli. Role of molecular dy- namics and related methods in drug discovery. Journal of medicinal chemistry, 59(9):4035–4061, 2016. Feng Ding and Nikolay V Dokholyan. Simple but predictive protein models. Trends in biotechnol- ogy, 23(9):450–455, 2005. Xinqiang Ding and Bin Zhang. Computing absolute free energy with deep generative models. Bio- physical Journal, 120(3):195a, 2021a. Xinqiang Ding and Bin Zhang. Deepbar: a fast and exact method for binding free energy computa- tion. The journal of physical chemistry letters, 12(10):2509–2515, 2021b. Guilherme Duarte Ramos Matos, Daisy Y Kyu, Hannes H Loeffler, John D Chodera, Michael R Shirts, and David L Mobley. Approaches for calculating solvation free energies and enthalpies demonstrated with an update of the freesolv database. Journal of Chemical & Engineering Data, 62(5):1559–1569, 2017. Conor Durkan, Artur Bekasov, Iain Murray, and George Papamakarios. Neural spline flows, 2019a. URL https://arxiv.org/abs/1906.04032. Conor Durkan, Artur Bekasov, Iain Murray, and George Papamakarios. Neural spline flows. Ad- vances in neural information processing systems, 32, 2019b. Conor Durkan, Artur Bekasov, Iain Murray, and George Papamakarios. nflows: normalizing flows in PyTorch, November 2020. URL https://doi.org/10.5281/zenodo.4296287. Peter Eastman, Jason Swails, John D Chodera, Robert T McGibbon, Yutong Zhao, Kyle A Beauchamp, Lee-Ping Wang, Andrew C Simmonett, Matthew P Harrigan, Chaya D Stern, et al. Openmm 7: Rapid development of high performance algorithms for molecular dynamics. PLoS computational biology, 13(7):e1005659, 2017. Sebastian Falkner, Alessandro Coretti, Salvatore Romano, Phillip Geissler, and Christoph Dellago. Conditioning normalizing flows for rare event sampling. arXiv preprint arXiv:2207.14530, 2022. Markus Fleck, Marcus Wieder, and Stefan Boresch. Dummy atoms in alchemical free energy calcu- lations. Journal of Chemical Theory and Computation, 17(7):4403–4419, 2021. Vytautas Gapsys, Servaas Michielssens, Daniel Seeliger, and Bert L De Groot. pmx: Automated protein structure and topology generation for alchemical perturbations, 2015. Samuel Genheden and Ulf Ryde. How to obtain statistically converged mm/gbsa results. Journal of computational chemistry, 31(4):837–846, 2010. Ahmadreza Ghanbarpour, Amr H Mahmoud, and Markus A Lill. Instantaneous generation of protein hydration properties from static structures. Communications Chemistry, 3(1):188, 2020. Aljoscha M Hahn and H Then. Using bijective maps to improve free-energy estimates. Physical Review E, 79(1):011113, 2009. Lester Hedges, Antonia Mey, Charles Laughton, Francesco Gervasio, Adrian Mulholland, Christo- pher Woods, and Julien Michel. Biosimspace: An interoperable python framework for biomolec- ular simulation. Journal of Open Source Software, 4(43), 2019. Michele Invernizzi, Andreas Kr ̈amer, Cecilia Clementi, and Frank No ́e. Skipping the replica ex- change ladder with normalizing flows. The Journal of Physical Chemistry Letters, 13:11643– 11649, 2022. Christopher Jarzynski. Targeted free energy perturbation. Physical Review E, 65(4):046122, 2002. Jarek Juraszek and Peter G Bolhuis. Sampling the multiple folding mechanisms of trp-cage in explicit solvent. Proceedings of the National Academy of Sciences, 103(43):15859–15864, 2006. Jonas K ̈ohler, Andreas Kr ̈amer, and Frank No ́e. Smooth normalizing flows, 2021. URL https: //arxiv.org/abs/2110.00351. 10 Jonas K ̈ohler, Michele Invernizzi, Pim de Haan, and Frank No ́e. Rigid body flows for sampling molecular crystal structures. arXiv preprint arXiv:2301.11355, 2023. Apichart Linhananta, Jesse Boer, and Ian MacKay. The equilibrium properties and folding kinetics of an all-atom g o ̄ model of the trp-cage. The Journal of chemical physics, 122(11):114901, 2005. Hannes H Loeffler, Julien Michel, and Christopher Woods. Fesetup: automating setup for alchemical free energy simulations, 2015. Amr H Mahmoud, Matthew R Masters, Ying Yang, and Markus A Lill. Elucidating the multiple roles of hydration for accurate protein-ligand binding prediction via deep learning. Communications Chemistry, 3(1):19, 2020. Amr H Mahmoud, Matthew Masters, Soo Jung Lee, and Markus A Lill. Accurate sampling of macromolecular conformations using adaptive deep learning and coarse-grained representation. Journal of Chemical Information and Modeling, 62(7):1602–1617, 2022. Jonathan W Neidigh, R Matthew Fesinmeyer, and Niels H Andersen. Designing a 20-residue pro- tein. Nature structural biology, 9(6):425–430, 2002. Gregory V Nikiforovich, Niels H Andersen, R Matthew Fesinmeyer, and Carl Frieden. Possible locally driven folding pathways of tc5b, a 20-residue protein. Proteins: Structure, Function, and Bioinformatics, 52(2):292–302, 2003. Frank No ́e, Simon Olsson, Jonas K ̈ohler, and Hao Wu. Boltzmann generators: Sampling equilibrium states of many-body systems with deep learning. Science, 365(6457):eaaw1147, 2019. doi: 10.1126/science.aaw1147. URL https://www.science.org/doi/abs/10. 1126/science.aaw1147. George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, and Balaji Lakshminarayanan. Normalizing flows for probabilistic modeling and inference, 2019. URL https://arxiv.org/abs/1912.02762. Dietmar Paschek, Hugh Nymeyer, and Angel E Garc ́ıa. Replica exchange simulation of reversible folding/unfolding of the trp-cage miniprotein in explicit solvent: On the structure and possible role of internal water. Journal of structural biology, 157(3):524–533, 2007. Jed W Pitera and William Swope. Understanding folding and design: Replica-exchange simulations of"trp-cage"miniproteins. Proceedings of the National Academy of Sciences, 100(13):7587–7592, 2003. Andrew Pohorille, Christopher Jarzynski, and Christophe Chipot. Good practices in free-energy calculations. The Journal of Physical Chemistry B, 114(32):10235–10253, 2010. Danilo Jimenez Rezende, George Papamakarios, S ́ebastien Racani`ere, Michael S. Albergo, Gurtej Kanwar, Phiala E. Shanahan, and Kyle Cranmer. Normalizing flows on tori and spheres, 2020. URL https://arxiv.org/abs/2002.02428. Andrea Rizzi, Paolo Carloni, and Michele Parrinello. Targeted free energy perturbation revisited: Accurate free energies from mapped reference potentials. The Journal of Physical Chemistry Letters, 12(39):9449–9454, 2021. Dominic A. Rufa, Ivy Zhang, Hannah E. Bruce Macdonald, Patrick B. Grinaway, Iv ́an Pulido, Mike M. Henry, Jaime Rodr ́ıguez-Guerra, Matt Wittmann, Steven K. Albanese, William G. Glass, Ana Silveira, David Schaller, Levi N. Naden, and John D. Chodera. Perses, March 2022. URL https://doi.org/10.5281/zenodo.6328265. Please cite this software using these metadata. Victor Garcia Satorras, Emiel Hoogeboom, Fabian B. Fuchs, Ingmar Posner, and Max Welling. E(n) equivariant normalizing flows, 2021. URL https://arxiv.org/abs/2105.09016. Schr ̈odinger. Schr ̈odinger release (2018) 2: Maestro, version 11.8., schr ̈odinger, LLC, new york, NY, 2021., 2021. 11 Daniel Seeliger and Bert L De Groot. Protein thermostability calculations using alchemical free energy simulations. Biophysical journal, 98(10):2309–2316, 2010. Hythem Sidky, Wei Chen, and Andrew L Ferguson. High-resolution markov state models for the dynamics of trp-cage miniprotein constructed over slow folding modes identified by state-free reversible vampnets. The Journal of Physical Chemistry B, 123(38):7999–8009, 2019. Carlos Simmerling, Bentley Strockbine, and Adrian E Roitberg. All-atom structure prediction and folding simulations of a stable protein. Journal of the American Chemical Society, 124(38): 11258–11259, 2002. Christopher D Snow, Houbi Nguyen, Vijay S Pande, and Martin Gruebele. Absolute comparison of simulated and experimental protein-folding dynamics. nature, 420(6911):102–106, 2002. Lingle Wang, Yujie Wu, Yuqing Deng, Byungchan Kim, Levi Pierce, Goran Krilov, Dmitry Lupyan, Shaughnessy Robinson, Markus K Dahlgren, Jeremy Greenwood, et al. Accurate and reliable prediction of relative ligand binding potency in prospective drug discovery by way of a modern free-energy calculation protocol and force field. Journal of the American Chemical Society, 137 (7):2695–2703, 2015. Peter Wirnsberger, Andrew J Ballard, George Papamakarios, Stuart Abercrombie, S ́ebastien Racani`ere, Alexander Pritzel, Danilo Jimenez Rezende, and Charles Blundell. Targeted free en- ergy estimation via learned mappings. The Journal of Chemical Physics, 153(14):144112, 2020. Ruhong Zhou. Trp-cage: folding free energy landscape in explicit water. Proceedings of the National Academy of Sciences, 100(23):13280–13285, 2003. Robert W Zwanzig. High-temperature equation of state by a perturbation method. i. nonpolar gases. The Journal of Chemical Physics, 22(8):1420–1426, 1954. A APPENDIX A.1 FREE ENERGY PERTURBATION The pairwise free energy difference for the transfer between neighboring intermediate states are individually calculated and summed to obtain the overall free energy change: ∆F = FB − FA = (FB − FN ) + (FN − FN −1) + ... + (F1 − FA) = −kBT N (cid:88) i=0 (cid:28) (cid:18) ln exp − Ui+1 − Ui kBT (cid:19)(cid:29) i The flow-based TFEP method allows us to bypass the computational expense of simulating numer- ous intermediate states i and accelerate computation time without compromising the accuracy of free energy difference estimation. A.2 DEEP MAPPING IN TARGETED FREE ENERGY PERTURBATION The relationship between the Kullback-Leibler Divergence loss function and the generalized esti- mator has been reformulated by Wirnsberger et al. (2020): DKL [ρA(cid:48)||ρB] = β(EA[ΦF ] − ∆F ). When both ΦF and ΦR are available, the Bennett Acceptance Ratio (BAR) can be used to predict statistically accurate free energy: EA[f (β(ΦF − ∆F ))] = EB[f (β(ΦR − ∆F ))], with f (x) = 1/(1 + ex). While not directly related to the free energy calculations, the TFEP loss function has also been recently used to develop LREX to skip the replica-exchange ladder (Invernizzi et al., 2022). 12 A.3 BOLTZMANN GENERATORS The multimodal complexity of energy function-dependent Boltzmann distributions requires a gen- erative model that is capable of non-parametric density estimations. Flow-based Boltzmann Gen- erators (BGs) have been reported to successfully obtain configuration samples of small molecular structures (up to 892 atoms) from the Boltzmann distribution e−U (x) following a training protocol based on valid reference structures from molecular dynamics (MD) and the energy function U (x) No ́e et al. (2019). BGs learn invertible coordinate transformations of variables x ∼ pX (x), configu- ration states which have high Boltzmann probability, from the latent space variables z ∼ pZ(z). The latent space distribution follows a simple Gaussian for easy backward propagation derivative calcu- lations, same as other NFs (Figure S1, left). Each latent variable z from this fixed and prescribed probability distribution function belongs to a unique conditional distribution that is learnable by parameters θ. The task of the BG network is therefore to learn θ for the transformations: x = M (z; θ), z = M −1(x; θ), (3) BGs are tailored for generating states of molecular systems because not only are the models trained using energetically and structurally valid states obtained through MD simulations (example-based training), they are also trained on the energy function so that the target distribution pX (x) ∝ e−U (x) (energy-based training). Once q has been learned and optimized, structures that do not violate the Boltzmann distribution can be generated from the trained model in one-shot. Figure S1: Schematic for distribution learning in Boltzmann Generators. The flow-based model learns the unique distribution for a protein system using a sequence of bijective, invertible func- tions, here depicted as dot-connected orange arrows. The exact prior and exact target are pZ(z) and pX (x) ∝ exp(−u(x)). The BG-generated distribution is q, so that qX (x) = M (z) and qZ(z) = M −1(x). The prior pZ(z) is typically a Gaussian for BGs (left). In our method, we set an auxiliary density estimator as prior instead of a Gaussian (right). 13 A.4 ENERGY FUNCTION DEFINITIONS FOR THE COUPLED PARTICLE SYSTEM. Bound State System A V1(x1, x2) = 0.5 * k1(x1 − x◦ V2(x1, x2) = 0.5 * k2(x2 − x◦ V3(x1, x2) = 0.5 * κ * 0.5(C tanh(α(x1 − x◦ V = V1 + V2 + V3 1)2 2)2 1)) + 1.0) * ((x2 − x1) − d)2 System B V1(x1) where k1 = 5.0, k2 = 10.0, x◦ = 0.5 * k1(x1 − x◦ 1 = −2.0, x◦ 1)2, 2 = 2.0, , d = 3.0, κ = 10.0, C = 0.5, α = 2.0. Unbound State System A V1(x1) = V2(x2) =       0.5 * k(x1 − xl)2, 0.5 * k(x1 − xr)2, 0, otherwise 0.5 * k(x2 − xl)2, 0.5 * k(x2 − xr)2, 0, otherwise if x1 < xl if x1 > xr if x2 < xl if x2 > xr V3(x1, x2) = 0.5 * κ * 0.5(C tanh(α(x1 − x◦ V = V1 + V2 + V3 1)) + 1.0) * ((x2 − x1) − d)2 System B V1(x1) =    0.5 * k(x1 − xl)2, 0.5 * k(x1 − xr)2, otherwise, 0, if x1 < xl if x1 > xr where k = 10.0, x◦ 1 = −2.0, xl = 3.0, xr = 3.0, d = 3.0, κ = 10.0, C = 0.5, α = 2.0. 14 A.5 TRAINING RESULTS FOR DUAL FLOW METHOD. Figure S2: Sampling histograms for the 2D coupled-particle system. System A is the two-particle system, System B is comprised of the first particle and an uncorrelated dummy atom that is defined by a Gaussian energy distribution with a mean of 0. The left two columns are for the bound state, the right two columns for the unbound state. The first row is the target System A, the second row target System B. The third row is the flow-generated distribution before using an auxiliary flow as prior. The final row shows correct training upon implementing the auxiliary flow. Improvements are especially more pronounced in histograms for the unbound state. A.6 ADDITIONAL INFORMATION ON THE RFEP METHOD Unique new atoms and their corresponding dummies receive coordinate placement by a reversible jump Monte Carlo geometry proposal engine to ensure generation of favorable molecular geometries that avoid steric clash or other errors in energy evaluation (Rufa et al., 2022). For the final stage, investigators have the option of using either equilibrium methods (e.g. replica exchange) or non- equilibrium methods (e.g. non-equilibrium switching) to estimate the free energy difference. A.7 RATIONAL QUADRATIC NEURAL SPLINE FLOWS Rational Quadratic Neural Spline Flows (RQNSFs) are a class of normalizing flow models that transform using rational quadratic spline functions (Equation 4), or continuous functions mapped to a bound region (i.e. [−B, B]) for each DOF. The monotonic increase of rational quadratic functions ensure bijectivity in transform. The continuous first derivatives are piece-wise defined on intervals splitting this region. z = f (x) = z0 + (z1 − z0) (cid:2)sξ2 + d0ξ (1 − ξ)(cid:3) s + [d1 + d0 − 2s] ξ (1 − ξ) , (4) 15 We note in the above equation that x0(1), z0(1), and d0(1) are the locations and derivatives at the left (right) interval boundaries, and ξ = (x − x0)/(x1 − x0), s = (z1 − z0)/(x1 − x0). We implemented RQNSF Durkan et al. (2019b) coupling layers in the mapping transformations of our architecture (Figure S3) for a flow module expressive enough to capture the complex probability densities of systems that have high DOFs. Implementations are based on methods described in Mahmoud et al. (2022). Figure S3: Scheme of a Rational Quadratic Spline function transformation. In our RQNSF imple- mentation, a residual network is used to condition the spline coupling transformation. A.8 FREE ENERGY ESTIMATION METHODS In this section, we describe a few approaches to solvation free energy calculation for the sake of comparison with the TFEP approach. We define end states A and B with the respective Hamilto- nians HA(q, p; λ) and HB(q, p; λ), where q and p represent positions and momenta of the system at given points in phase space and λ the nonphysical coupling parameter. We then obtain the λ- dependent Hamiltonian as: H(q, p; λ) = f (λ)HA(q, p; λ) + g(λ)HB(q, p; λ). By convention, H = HA at λ = 0 and H = HB at λ = 1. The Hamiltonians are mixed using the functions f (λ) and g(λ). In the thermodynamic integration (TI) method, simulations are performed for a discrete set of λ values and subsequently the free energy difference between A and B can be (cid:11) estimated by solving for ∆F = (cid:82) λ=1 λ dλ by numerical quadrature approach. In the expo- nential averaging (EXP) or free energy perturbation (FEP) method (Zwanzig, 1954), λ-dependent β ln (cid:10)e−β[HB(qp;λ)−HA(q,p;λ)](cid:11) Hamiltonians are similarly used to to estimate ∆F = − 1 (cid:10) ∂H ∂λ λ=0 A As a third alternative method, Bennett Acceptance Ratio (BAR) relies on bidirectional transfers to iteratively solve for the following: (cid:42) 1 1 + NA NB eβ∆HBA(q,p)−β∆F (cid:43) (cid:42) = A 1 1 + NB NA eβ∆HAB(q,p)+β∆F (cid:43) . B Here, the respective numbers of statistically independent samples from A and B are denoted as NA and NB and the Hamiltonian differences as ∆HBA(q, p) = HB(q, p) − HA(q, p) = −∆HAB(q, p). 16 A.9 ETHANE TO METHANOL SOLVATION LEARNING CURVE Figure S4: Learning curve and free energy difference between ethane and methanol in water and vacuum. 17
http://arxiv.org/abs/2302.11840v1
2023-02-23T08:03:38
2023-02-23T08:03:38
StudyFormer : Attention-Based and Dynamic Multi View Classifier for X-ray images
Chest X-ray images are commonly used in medical diagnosis, and AI models have been developed to assist with the interpretation of these images. However, many of these models rely on information from a single view of the X-ray, while multiple views may be available. In this work, we propose a novel approach for combining information from multiple views to improve the performance of X-ray image classification. Our approach is based on the use of a convolutional neural network to extract feature maps from each view, followed by an attention mechanism implemented using a Vision Transformer. The resulting model is able to perform multi-label classification on 41 labels and outperforms both single-view models and traditional multi-view classification architectures. We demonstrate the effectiveness of our approach through experiments on a dataset of 363,000 X-ray images.
[ "Lucas Wannenmacher", "Michael Fitzke", "Diane Wilson", "Andre Dourson" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11840v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11840v1", "@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 3 2 ] V C . s c [ 1 v 0 4 8 1 1 . 2 0 3 2 : v i X r a StudyFormer : Attention-Based and Dynamic Multi View Classifier for X-ray images Lucas Wannenmacher Michael Fitzke Diane Wilson Andre Dourson Mars Digital Technologies Antech Imaging Services February 24, 2023 Abstract Chest X-ray images are commonly used in medical diagnosis, and AI models have been devel- oped to assist with the interpretation of these images. However, many of these models rely on information from a single view of the X-ray, while multiple views may be available. In this work, we propose a novel approach for combining information from multiple views to improve the per- formance of X-ray image classification. Our approach is based on the use of a convolutional neural network to extract feature maps from each view, followed by an attention mechanism implemented using a Vision Transformer. The resulting model is able to perform multi-label classification on 41 labels and outperforms both single-view models and traditional multi-view classification archi- tectures. We demonstrate the effectiveness of our approach through experiments on a dataset of 363,000 X-ray images. 1 Introduction Accurate and efficient classification of medical images, such as X-ray images, is crucial for the diagnosis and treatment of diseases. Many AI tools for medical imaging rely on models that process a single view of the X-ray image [2] [8]. However, it is common for multiple views to be taken during a patient's visit to the radiologist. In veterinary medicine there is strong evidence that Multi-View thoracic radiographic studies lead to more sensisitive results for possible structured interstitial pulmonary disease, including metastatic disease ([7]). In this work, we present a model called Studyformer that is capable of taking a variable number of X-ray images as input and performing multi-label classification. The architecture of Studyformer combines a convolutional neural network with an attention mech- anism implemented using a Vision Transformer [3] [12]. This approach allows the model to extract relevant features from each view and effectively combine them to improve classification performance. We demonstrate the effectiveness of Studyformer through experiments on a dataset of 363,000 veteri- nary X-ray images and show that it outperforms both single-view models and traditional multi-view classification architectures. In addition, Studyformer is able to accept a variable number of views in any position, making it highly adaptable to a variety of uses. The proposed approach is novel in the field of multi-view classification, using a concatenation method and feature map augmentation in combination with an attention mechanism inspired by the success of Vision Transformers. Studyformer significantly improves classification performance com- pared to existing models such as MVCNN-based models. 2 Related work In recent years, the problem of multi-view classification has received Multi-View classification. significant attention in the machine learning community. A common approach for addressing this problem is to use Multi-View Convolutional Neural Network (MVCNN) architectures [9], which first process each view independently using a Convolutional Neural Network (CNN), followed by a view pooling step and final classification using either a Multi-Layer Perceptron or another CNN. There have 1 been several studies that have demonstrated the effectiveness of multi-view classification techniques, particularly in the context of X-ray images [1, 5]. Our proposed method, StudyFormer, builds upon these existing approaches by introducing an attention-based and dynamic mechanism for combining the information from different views. Vision Transformers (ViT). Transformers (ViTs), introduced in the influential paper "Attention is All You Need" [11], have rapidly gained popularity in the field of Natural Language Processing and have emerged as a promising architecture for a variety of tasks. Transformers were adapted for use in Computer Vision tasks [3], and have subsequently achieved state-of-the-art performance in image classification [10]. In a Vision Transformer (ViT) model, images are decomposed into a sequence of patches which are transformed into tokens and processed by the transformer. Our proposed method, StudyFormer, leverages the effectiveness of ViTs by incorporating them as a key component of our attention-based and dynamic multi-view classifier for X-ray images. RapidRead We compare our approach with classification models from [4], which were trained on large scale medical image data. 3 Method 3.1 Model Architecture In this study, we propose a method called StudyFormer for multi-label classification of X-ray images. Our approach uses an adapted Vision Transformer (ViT) that takes as input features extracted from multiple views of the X-ray images. The features are extracted using a Convolutional Neural Network (CNN) that is pretrained on single-view images [4]. The same CNN is applied to each view to extract features, which are then concatenated and augmented to form a square matrix. The square matrix is fed into the ViT to produce the final multi-label classification. Figure ?? shows the global architecture of StudyFormer. Figure 1: StudyFormer architecture 3.1.1 Feature Extraction The input X-ray views have dimensions of 3 × 320 × 320. The CNN used for feature extraction is based on the Densenet121 architecture [6] and has pre-trained weights from a model trained for multi-label classification on single views. The output feature maps of the convolutional part have dimensions 10 × 10 × 1024. 3.1.2 Data Augmentation and Square Concatenation Data augmentation is used to generate additional feature maps, if needed, to form a square matrix. The feature maps are concatenated to form a square with width W , where W is the square root of 2 the total number of feature maps. In our study, the model was trained for W = 2, 3, and 4, and can accept up to 16 views (W = 4). 3.1.3 ViT The input to the ViT is a matrix of size (W × 10, W × 10, 1024), which required adaptation of the ViT. We used a patch size of 1, a depth of 6, 16 attention heads, and an MLP dimension of 2048 3.2 Data The data for this work consists of 390850 X-ray images, taken from 98660 veterinary sessions. These images were annotated by radiologists for over 41 diseases in a multi-label fashion, and are feedback from the usage of the RapidRead tool. Additionally, we have a dataset of 800 images with high-quality annotations, where the annotations were performed by 12 radiologists collaborating on each image. A sample of these X-ray images is shown in Figure 2. Figure 2: Sample X-ray images from the same session 3.2.1 Data: Train, Validation and Test Sets To ensure unbiased results, we split the X-ray images into three datasets: train, validation, and test, while taking into account the fact that the CNN was previously trained on this dataset. On average, there were ≈ 3.96 images per study, which ranges from 1 to more than 10 images sometimes. The total 390850 images corresponded to 98660 studies. The datasets were split as follows: • The train set consisted of 363820 images, or 92434 studies, from data prior to April 1, 2022. • The validation set consisted of 13515 images, or 3113 studies, from data after April 1, 2022. • The test set consisted of 13481 images, or 3113 studies, also from data after April 1, 2022. 3.2.2 Study-Level Labels The initial labels were relative to each X-ray, but in this work, we needed labels relative to the studies. Different views of a study often had different labels, as some diseases may be visible in some views and not in others. We made the choice that, for a given label, its value should be the maximum value of that label among all views of the study. Formally, let Li,j,k be the value of the ith label of the kth view of the jth study, and let LSi,j be the study-level label, then: LSi,j = max 1,nbviewsj (cid:75) k∈ (cid:74) Li,j,k 1, nblabels ∀i ∈ (cid:74) ∀j ∈ 1, nbstudies (cid:74) (cid:75) (cid:75) This choice reflects the fact that a patient is considered to have a disease if that disease is detected in at least one view of the study. 3 3.2.3 Preprocessing and Transformations The preprocessing operations are consistent with those used in the CNN preprocessing pipeline. When switching to a different CNN, the corresponding preprocessing must be applied. The images are first converted to tensors and resized to 3×320×320 (channels×height×width), followed by normalization. The normalization is performed using the ImageNet mean and standard deviation, which are [0.485, 0.456, 0.406] for the mean and [0.229, 0.224, 0.225] for the standard deviation, respectively. During training, data augmentation is performed using Horizontal and Vertical Flips, as well as the RandAugment data augmentation method of Pytorch. 3.2.4 Training Learning Steps, Computing Power, and Time The CNN used was pre-trained for our specific use case, and the first training stage was focused solely on the ViT by freezing the CNN weights. This stage required over 50 epochs and was performed in several phases by saving the weights and optimizer. Subsequently, the entire network was trained, including the CNN, for 10 epochs until the validation loss stopped decreasing. Most of the training was conducted using a Tesla V100 GPU and took approximately 100 hours. Figure 3: Training and validation losses during the ViT-specific training. 3.2.5 Loss function Several loss functions, including the BCE (Binary Cross Entropy) and the Focal Loss, were evaluated. The Focal Loss showed promise due to the presence of unbalanced classes, however the results were not better than the BCE. Ultimately, the BCE was chosen as the loss function. 3.3 Lung Disease Specific Model A model was trained specifically for lung-related diseases, with the goal of improving performance on these labels. The model classifies three diseases: Pulmonary Mass, Pulmonary Interstitial Nodole, and Mediastinal Mass Effect. 3.4 Multi-View-CNN based Architecture An alternative architecture, based on the Multi-View-CNN (MVCNN), was also implemented for com- parison. In this architecture, the ViT was replaced by a CNN. The results of StudyFormer surpassed the performance of this architecture, as shown in the results section. 4 4 Results 4.1 Comparison of the metrics between the models The performance of the original CNN, the Multi-View-CNN (MVCNN) based architecture, the Study- Former, and the lung disease specific StudyFormer were compared by evaluating their ROC-AUC scores on different diseases. The ROC-AUC scores of the models are presented in Table 1. For the single view CNN model, the maximum score over all views was taken as the output of the Table 1: ROC-AUC scores for different models ROC-AUC scores for different models CNN for each label. Diseases Mediastinal Mass Effect Pulmonary Mass Pulmonary Interstitial - Nodule Sign(s) of IVDD - Nodule Gastric Foreign Material (de- bris) - Nodule Degenerative Joint Disease - Nodule Sign(s) of Pleural Effusion - Nodule Pneumothorax Pulmonary Vascular Single View CNN (Max over views) 0.941 0.929 0.905 0.913 0.865 0.838 0.935 0.926 0.928 MVCNN- based model StudyFormer lung-specific StudyFormer 0.943 0.928 0.908 0.915 0.864 0.839 0.935 0.927 0.928 0.953 0.941 0.922 0.940 0.898 0.848 0.940 0.959 0.955 0.962 0.945 0.919 / / / / / / 5 4.1.1 Comparison of ROC curves Figure 4: Comparison of ROC curves of the Pulmonary Mass label for different models. The Study- former and specific-Studyformer curves are above the single view CNN curve. 4.2 Attention map visualisation This section presents visualizations of the Vision Transformer (ViT) attention maps. The ViT used is specific to lung diseases, and the attention maps are shown for patients with the positive label 'Pulmonary Mass'. The input to the ViT is a concatenated feature map, and the X-ray images have been mapped and displayed with the same concatenation and transformations applied to the augmented feature maps. The attention maps show that the ViT focuses on the thorax region where the lungs are located, as expected. The results also demonstrate that the ViT remains focused on the thorax area even with different contexts in the X-ray images. This highlights the robustness of ViTs. 6 Figure 5: Attention map of the specific-to-lung-diseases model, of a patient with pulmonary mass. We can see here that the attention is focused on the thorax in which the lungs are located, as expected. Figure 6: Here too, the focus is on the thorax. Moreover, for the view on the bottom left, the view was created from the 1st image, with some data augmentation: there were initially only 3 views in the study 7 Figure 7: The 3rd and 4th images do not show the lungs area : the ViT does not pay attention to these images, as expected. Figure 8: In this study, the context of the images is different. This does not disturb the focus of the ViT, which is still on the thorax area. ViTs are known to be robust. 5 Conclusion Our experimental results demonstrate that the Studyformer architecture outperforms single view based architectures in terms of classification performance. The results also show that Studyformer, with its unique architecture that allows a variable number of views to be input in an arbitrary order, performs better than the adapted network in MVCNN under the tested conditions and hyper-parameters. The visualisation of the Vision Transformer (ViT) attention maps supports the conclusion that the attention is focused on the correct regions in the images and highlights the robustness of the network. This finding is particularly relevant for medical imaging, where the focus on specific regions of the images can be critical for accurate diagnosis. 8 Furthermore, we observe that using a network specific to a certain group of labels, as in our case with the network specific to lung diseases, may lead to improved performance. This conclusion requires further investigation, but it highlights the potential for specialising networks for specific domains to achieve better results. In summary, our work contributes to the advancement of multi-view networks and sheds light on the potential of using domain-specific networks for medical image classification. References [1] H. Bertrand, M. Hashir, and J. P. Cohen. Do lateral views help automated chest x-ray predictions? CoRR, abs/1904.08534, 2019. [2] E. C ̧ allı, E. Sogancioglu, B. van Ginneken, K. G. van Leeuwen, and K. Murphy. Deep learning for chest x-ray analysis: A survey. Medical Image Analysis, 72:102125, aug 2021. [3] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, J. Uszkoreit, and N. Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. CoRR, abs/2010.11929, 2020. [4] M. Fitzke, C. Stack, A. Dourson, R. M. B. Santana, D. Wilson, L. Ziemer, A. Soin, M. P. Lungren, P. Fisher, and M. Parkinson. Rapidread: Global deployment of state-of-the-art radiology AI for a large veterinary teleradiology practice. CoRR, abs/2111.08165, 2021. [5] M. Hashir, H. Bertrand, and J. P. Cohen. Quantifying the value of lateral views in deep learning for chest x-rays. 2020. [6] G. Huang, Z. Liu, and K. Q. Weinberger. Densely connected convolutional networks. CoRR, abs/1608.06993, 2016. [7] C. P. Ober and D. Barber. Comparison of two-vs. three-view thoracic radiographic studies on con- spicuity of structured interstitial patterns in dogs. Veterinary Radiology & Ultrasound, 47(6):542– 545, 2006. [8] P. Rajpurkar, J. Irvin, K. Zhu, B. Yang, H. Mehta, T. Duan, D. Ding, A. Bagul, C. Langlotz, K. Shpanskaya, et al. Chexnet: Radiologist-level pneumonia detection on chest x-rays with deep learning. arXiv preprint arXiv:1711.05225, 2017. [9] H. Su, S. Maji, E. Kalogerakis, and E. G. Learned-Miller. Multi-view convolutional neural net- works for 3d shape recognition. CoRR, abs/1505.00880, 2015. [10] H. Touvron, M. Cord, M. Douze, F. Massa, A. Sablayrolles, and H. J ́egou. Training data-efficient image transformers & distillation through attention. CoRR, abs/2012.12877, 2020. [11] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polo- sukhin. Attention is all you need. CoRR, abs/1706.03762, 2017. [12] T. Xiao, M. Singh, E. Mintun, T. Darrell, P. Doll ́ar, and R. B. Girshick. Early convolutions help transformers see better. CoRR, abs/2106.14881, 2021. 9
http://arxiv.org/abs/2302.11836v3
2023-05-19T06:02:43
2023-02-23T07:52:31
On Statistical Properties of Sharpness-Aware Minimization: Provable Guarantees
Sharpness-Aware Minimization (SAM) is a recent optimization framework aiming to improve the deep neural network generalization, through obtaining flatter (i.e. less sharp) solutions. As SAM has been numerically successful, recent papers have studied the theoretical aspects of the framework and have shown SAM solutions are indeed flat. However, there has been limited theoretical exploration regarding statistical properties of SAM. In this work, we directly study the statistical performance of SAM, and present a new theoretical explanation of why SAM generalizes well. To this end, we study two statistical problems, neural networks with a hidden layer and kernel regression, and prove under certain conditions, SAM has smaller prediction error over Gradient Descent (GD). Our results concern both convex and non-convex settings, and show that SAM is particularly well-suited for non-convex problems. Additionally, we prove that in our setup, SAM solutions are less sharp as well, showing our results are in agreement with the previous work. Our theoretical findings are validated using numerical experiments on numerous scenarios, including deep neural networks.
[ "Kayhan Behdin", "Rahul Mazumder" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11836v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11836v3", "@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" ]
3 2 0 2 y a M 9 1 ] L M . t a t s [ 3 v 6 3 8 1 1 . 2 0 3 2 : v i X r a On Statistical Properties of Sharpness-Aware Minimization: Provable Guarantees Kayhan Behdin,† Rahul Mazumder†,‡ †MIT Operations Research Center, Cambridge, MA ‡MIT Sloan Schools of Management, Cambridge, MA Abstract Sharpness-Aware Minimization (SAM) is a recent optimization framework aiming to improve the deep neural network generalization, through obtaining flatter (i.e. less sharp) solutions. As SAM has been numerically successful, recent papers have studied the theoretical aspects of the framework and have shown SAM solutions are indeed flat. However, there has been limited theoretical exploration regarding statistical properties of SAM. In this work, we directly study the statistical performance of SAM, and present a new theoretical explanation of why SAM generalizes well. To this end, we study two statistical problems, neural networks with a hidden layer and kernel regression, and prove under certain conditions, SAM has smaller prediction error over Gradient Descent (GD). Our results concern both convex and non- convex settings, and show that SAM is particularly well-suited for non-convex problems. Additionally, we prove that in our setup, SAM solutions are less sharp as well, showing our results are in agreement with the previous work. Our theoretical findings are validated using numerical experiments on numerous scenarios, including deep neural networks. 1 Introduction Training Deep Neural Networks (DNN) can be challenging, as it requires minimizing non-convex loss func- tions with numerous local minima (and saddle points). As different local minima have different generalization properties, recent research has been focused on developing optimization methods and techniques that improve the quality of DNN training, leading to better generalization over unseen data. An important property of a DNN solution's landscape is its sharpness, which is defined as how rapidly the loss value changes locally. A flatter solution is a solution where the highest and the lowest loss values in the region do not differ too much. Sharpness measures in practice include the largest eigenvalue [38] or trace [21] of the Hessian of the loss. Sharpness-Aware Minimization (SAM) [15] is an optimization framework that builds on the observation that sharpness of the training loss correlates with the generalization performance of a DNN. Specifically, flatter solutions to DNNs have been found to generalize better [14, 24, 40, 39, 15]. Thus, in SAM, the loss function is modified, in a way that it encourages convergence to flatter regions of the loss. SAM has been shown to be empirically successful in numerous tasks [9, 6, 3] and has been extended to several variations [41, 13]. Thus, there has been a growing interest in understanding the theoretical underpinnings of SAM. In this paper, our goal is to further the theoretical understanding of SAM, by exploring the implicit regularization implications of the algorithm dynamics. Related Work. [15] introduced SAM and presented upper bounds for the generalization performance of SAM. Their bound suggests that SAM should generalize well, however, their result does not completely explain why SAM performs better than a vanilla training using Stochastic Gradient Descent (SGD). Most current papers explain the statistical performance of SAM through analyzing the SAM solution loss landscape and geometry, specially, its sharpness. Particularly, continuous time analysis (i.e. when the step size is infinitesimally small) has been used to show SAM can choose more sparse solutions [2], can regularize eigenvalues of the Hessian of the loss [37] and eventually select flatter solutions [10]. The recent work 1 CIFAR100 Theory, noiseless CIFAR10-noisy Theory, noisy (a) (b) (c) (d) Figure 1: Comparison of GD and SAM classification error on the validation set, over epochs for different cases. (a): CIFAR100 with clean labels on ResNet50. (b): Theoretical error curve for a particular model from our analysis for a noiseless case. (c): CIFAR10 with noisy training labels on ResNet50. (d): Theoretical error curve for a noisy case. Note that our theoretical plots capture the relative profile of real data. of [35] also explores the connections between SAM and variational inference, and how SAM seeks flatter solutions. [1] show that SAM regularizes the eigenvalues of the Hessian, resulting in a flatter solution. Another interesting work is by [4] which explores SAM's trajectory for quadratic loss functions and explains how SAM can lead to flatter minima. Although the fact that SAM solutions are flatter partially explains the good generalization of SAM, we note that sharp minima can generalize as well [12, 23] and sharpness can be generally manipulated by reparameterizing the network [21]. This shows the need for a statistical analysis of SAM, rather than a geometric one. Summary of Results and Approach. In a departure from the literature, we directly study the statistical properties and performance of SAM. To this end, we consider two statistical problems, a neural network with a hidden layer, and (indefinite) kernel regression, as kernel methods have been shown to be closely related to DNNs and understanding kernel methods is valuable in the DNN literature [8, 16, 17, 7, 22]. We present a crisp characterization of the prediction error of SAM and Gradient Descent (GD) for these two problems over the course of the algorithm, and show that under certain conditions, SAM can have a lower prediction error compared to GD. In our analysis, we study both convex and non-convex problems and show that SAM particularly works well in the non-convex cases, where GD might have unbounded error unlike SAM. Moreover, we show that SAM solutions in our setup tend to be flatter compared to GD, which theoretically shows the correlation between statistical performance and sharpness. On a technical level, we characterize the SAM trajectory for the aforementioned problems and show a bias-variance trade-off for the prediction error of the algorithm, where bias generally decreases over iterations and variance increases. We show that SAM has a lower bias compared to GD, while GD's variance can be lower than SAM's. This shows SAM performs better when bias is the dominant term, for example when the noise is not too large or the total number of epochs is finite, as is in practice [32], specially for large models [19, 5]. Moreover, we show that in non-convex settings, GD can have unbounded bias and variance while SAM is able to keep the error bounded, showing a better performance. Our numerical results on several models including deep neural networks agree with our theoretical insights. We use numerical experiments to illustrate some of our results. In Figure 1(a), we compare SAM and GD classification error on the validation set over epochs when training ResNet50 network on CIFAR100 dataset (see Section 5 for more details on numerical experiments). We see that SAM has better accuracy over GD for almost all epochs, specially in earlier phases of training, which can be explained by our theory. As the training labels are not noisy in this case, bias is likely to be dominant and as we show, SAM's bias is less than GD's for all iterations under our model assumptions. In fact, in Figure 1(b) we show the error plot calculated from our theory for a noiseless model1, which follows the same trends as Figure 1(a), showing how our theory can explain the differences of GD/SAM in practice. In another case, we compare the performance of SAM and GD for CIFAR10 with training label noise in Figure 1(c). Both methods perform worse in later 1The details of plots in Figures 1(b,d) are discussed in Appendix A. The plots show error for a kernel regression problem with least-squares loss. 2 050100150200Epochs 020406080100GDSAM050100150200Epochs 00.20.40.60.81SAMGD050100150200Epochs 1020304050607080GDSAM050100150200Epochs 0.50.60.70.80.91SAMGD epochs, which can be due to variance becoming dominant. However, GD performs even worse than SAM in the noisy setup. As we show, in the non-convex settings GD can have larger (and even unbounded) variance over SAM, which explains the performance gap seen here. Particularly, Figure 1(d) plots the error from our theory for a noisy model, which again, shows similar trends to the real data plots, such as non-monotonicity of the error and the increasing gap between SAM and GD in later iterations. We note that our approach is different from the previous work. Instead of studying geometric properties of SAM's solution such as its sharpness, which can partially explain why SAM generalizes better, we directly study the statistical performance of SAM. Hence, we present a direct explanation for SAM's performance in practice, rather than relying on the correlation between flatness and generalization. Moreover, our analysis is different from previous work, which does not require us to assume the step size is infinitesimally small, unlike most current work [10, 2, 37, 35]. This provides insights for non-infitnesimal step sizes used in practice. Our contributions. Our contributions in this paper can be summarized as follows: (i) We study the statistical performance of SAM for one layer neural networks and (indefinite) kernel regression; (ii) We show that for these two problem classes, SAM has lower prediction error over GD under certain conditions, specially for non-convex settings; (iii) We show that in our settings, SAM tends to be flatter, confirming the correlation between generalization and flatness; (iv) We verify our theoretical findings using numerical experiments on synthetic and real data, and models including DNNs. 2 SAM: An Overview Let f : Rp (cid:55)→ R be the objective function that we seek to minimize. In many machine learning applications in particular, we have f (w) = (cid:80)n i=1 fi(w)/n where fi is the loss value corresponding to the i-th observation. A standard approach to minimizing f is the GD approach where the model parameters, or weights, are updated by the iterations wGD k+1 = wGD k − η∇f (wGD k ) (1) where η > 0 is the step size or learning rate. In SAM [15], the goal is to find a flatter solution that does not fluctuate too much in a neighborhood of the solution. Therefore, SAM modifies f as f SAM(w) = max (cid:107)ε(cid:107)2≤ρ f (w + ε) (2) and GD is then applied over f SAM, which captures the worst objective locally. The hope is that by minimizing f SAM, a solution is found that does not perform bad locally, and hence the local loss function is flat. As calculating f SAM in closed form is difficult, [15] suggest to approximate f with a linear function, i.e., argmax (cid:107)ε(cid:107)2≤ρ f (w + ε) ≈ argmax (cid:107)ε(cid:107)2≤ρ f (w) + εT ∇f (w). The linear approximation leads to [15]: f SAM(w) ≈ f (w + ρ∇f (w)/(cid:107)∇f (w)(cid:107)2). Taking the gradient of this approximation and ignoring second order terms, the SAM updates are given as (we refer to [15] for details of derivation) wSAM k+1 = wSAM k − η∇f (wSAM k + ρ∇f (wSAM k )). (3) We note that in (3), we ignored the normalization of the inner gradient. But recent work [2] has shown that the effect of such normalization can be neglected and we follow suit. We also note that our analysis in this work is done directly on (3) (based on the linear approximation to f ) which is implemented in practice, unlike the original loss f SAM which is hard to compute. 3 2.1 Overview of Results Throughout the paper, we assume n data points (yi, xi)n In our statistical model, each observation is yi = y∗ i is the true noiseless observation and (cid:15)i's are the zero-mean independent noise values with IE[(cid:15)(cid:15)T ] = σ2I. We let Φ(w; xi) to be our predicted value for observation i, where w ∈ Rp parameterizes the model. We consider the least squares loss as i=1 are given with xi ∈ Rd. i + (cid:15)i where y∗ f (w) = 1 2 n (cid:88) i=1 (yi − Φ(w; xi))2 . The expected prediction error for a solution w is therefore defined as Error(w) = IE(cid:15) (cid:34) 1 n n (cid:88) i=1 (cid:35) (y∗ i − Φ(w; xi))2 . One hence can decompose error as Error(w) = n (cid:88) i=1 1 n (cid:124) (y∗ i − IE(cid:15) [Φ(w; xi)])2 + (cid:123)(cid:122) Bias2(w) (cid:125) IE(cid:15) (cid:34) n (cid:88) i=1 1 n (cid:124) (Φ(w; xi) − IE(cid:15) [Φ(w; xi)])2 . (cid:35) (cid:123)(cid:122) Var(w) (cid:125) (4) (5) (6) The bias term in (6) captures how far the expected predicted value is from the true model, while the variance term is the variance of the prediction resulting from the noise. We discuss the details of models we study in Section 3.1 for the neural network model, and in Section 3.2 for the kernel regression case. Our goal is to show that under certain condition, SAM has lower statistical error compared to GD. To this end, we will characterize the bias and variance terms in (6). Specifically, we show that in all cases that we consider, SAM has a lower bias compared to GD. Moreover, SAM has higher variance in convex settings, but has significantly lower variance in non-convex settings. This quantifies that SAM is well-suited for non-convex problems. 3 Statistical Models Before stating our results, we discuss two important statistical models that we consider and present a formal problem definition for each. 3.1 Neural Networks with a Hidden Layer Let φ(x) : R (cid:55)→ R be a possibly non-linear activation function. A neural network with one hidden layer and L hidden neurons can be defined as Φ(w; x) = (cid:80)L l=1 φ(xT w(l)) where w(l) ∈ Rd and w = (w(1), * * * , w(L)) ∈ Rp where p = dL. For the rest of the paper, we consider the ReLU as the activation function, φ(x) = max(0, x). Let a(w; x) = (a1(w; x), * * * , aL(w; x)) ∈ Rp where for l ∈ [L], we have al(w; x) ∈ Rd, (cid:40) al(w; x) = 0 if xT w(l) ≤ 0 x if xT w(l) > 0. (7) Under this notation, for the ReLU activation we have Φ(w; x) = a(w, x)T w. We study the sequence wSAM from (3) where f (w) is given in (4). In particular, we let wGD to be the sequence from (1) with ρ = 0. We assume both SAM and GD use the same step size η and they both start from an initial solution such as w0. We also consider the following assumptions. k k (A1) There exists ̄k ≥ 1 such that for 0 ≤ k ≤ ̄k and i ∈ [n], we have a(wSAM k ; xi) = a(wGD k ; xi) = a(w0; xi). 4 (A2) There exists ̄w ∈ Rp such that a( ̄w; xi) = a(w0; xi) for i ∈ [n] and y∗ i = a( ̄w; xi)T ̄w. Assumption (A1) states that the quantities xT w(l) do not change sign over the course of the algorithm to avoid non-differentiability of ReLU. This can be ensured by choosing a sufficiently small step size or studying the method near a local minimum where the solution does not change significantly, a common approach to studying DNNs [39, 38, 29]. Moreover, as a(w; x) ∈ RdL, Assumption (A2) is likely to hold true if L is sufficiently large (i.e. the total number of hidden neurons is large). It is worth noting that if φ(x) = x and L = 1, Φ(w; x) = wT x which simplifies the model described above to the ordinary least-squares problem. By taking a(w; x) = x, we have Φ(w; x) = a(w; x)T w = xT w similar to the ReLU case above. Moreover, Assumption (A1) holds trivially for the linear regression case, and Assumption (A2) simplifies to existence of ̄w ∈ Rd such that y∗ i ̄w for i ∈ [n] which is standard in the linear regression literature. Therefore, the framework developed here for ReLU networks can be readily applied to the linear regression problem. i = xT 3.2 Kernel Regression Kernel methods and feature mappings have been a staple of machine learning algorithms in different applica- tions [20]. Moreover, kernel methods have been studied to better understand optimization and generalization in machine learning [26]. This is specially interesting as a long line of work has explored connections and similarities between DNNs and kernels [8, 16, 17, 7, 22], making the analysis of kernel methods even more important. Let K : Rd × Rd (cid:55)→ R be a kernel and X ∈ Rn×d be the model matrix with rows of x1, * * * , xn. We define the Gram matrix associated with this kernel and data as KX = [K(xi, xj)]. A classical assump- tion in kernel learning is that K is Positive Semidefinite (PSD), that is KX is PSD for any X ∈ Rn×d and n ≥ 1. However, there has been a growing interest in learning with indefinite kernels as they often appear in practice due to noisy observations and/or certain data structures (see [27, 28, 30, 31] and references therein). Therefore, throughout this paper, we do not assume K is PSD. In fact, we assume K = K+ − K− where K+, K− are two PSD kernels, resulting in K being indefinite. We use HK to denote the Reproducing (cid:76) HK− where Kre ̆ın Kernel Space (RKKS) for which K is the reproducing kernel. Note that HK = HK+ HK+, HK− are Reproducing Kernel Hilbert Spaces (RKHS) associated with K+, K− and (cid:76) denotes orthog- onal direct sum [27]. We also assume K is symmetric, that is K(xi, xj) = K(xj, xi) for all xi, xj. Given pairs of observations (yi, xi)n i=1, we seek to learn the function h ∈ HK such that h(xi) ≈ yi for all i. To this end, for h ∈ HK we define the loss L[h] = 1 2 n (cid:88) i=1 (h(xi) − yi)2. We note that L[h] is a function of h ∈ HK. The gradient of this loss then can be calculated as2 ∇L[h] = n (cid:88) i=1 (h(xi) − yi)K(xi, *) ∈ HK where K(x, *) : Rd (cid:55)→ R denotes the evaluation function, K(x, *)(y) = K(x, y). Although the SAM algorithm was introduced in the context of losses in Rp, one can mimic SAM in the RKKS. Specifically, we define KernelSAM, an equivalent of SAM algorithm in the RKKS, by iterations Our first result is a representer theorem for KernelSAM. For w ∈ Rn, we will use the notation k+1 = hSAM hSAM k − η∇L[hSAM k + ρ∇L[hSAM k ]]. (10) 2We provide a short review of kernel gradients in Appendix B. wT K(X, *) := n (cid:88) i=1 wiK(xi, *) ∈ HK. 5 (8) (9) Theorem 1. Suppose hSAM 0 = 0. Then, for k ≥ 1, there exists wSAM k ∈ Rn such that hSAM k = (wSAM k )T K(X, *).3 Theorem 1 shows that at each iteration, the SAM solution can be represented as a linear combination of K(xi, *) which allows us to directly study wSAM k . Therefore, using the notation from Section 2.1, Φ(wSAM k ; x) = n (cid:88) j=1 (wSAM k )jK(xj, x) = hSAM k (x). (11) Similar to the case of ReLU networks, we seek to characterize the error for KernelSAM. To this end, we assume the model is well-specified and there exists ̄w ∈ Rn such that yi = n (cid:88) j=1 (cid:124) ̄wjK(xj, xi) +(cid:15)i (cid:123)(cid:122) y∗ i (cid:125) (12) where (cid:15)i's are the noise values, independent of X, with the property IE[(cid:15)] = 0 and IE[(cid:15)(cid:15)T ] = σ2I. With this notation, we let ̄h = ̄wT K(X, *) to be the noiseless estimator. The expected error for hSAM = (wSAM k )T K(X, *) ∈ HK is defined as k Error(wSAM k ) = IE(cid:15) (cid:34) 1 n n (cid:88) i=1 (cid:0) ̄h(xi) − hSAM k (xi)(cid:1)2 (cid:35) = IE(cid:15) (cid:34) 1 n n (cid:88) i=1 (cid:0)y∗ i − Φ(wSAM k (cid:35) ; xi)(cid:1)2 with Φ(*; *) defined in (11). Our final result in this section shows that under the model discussed here, KernelSAM is equivalent to applying SAM on a (non-convex) quadratic objective. Theorem 2. The solution wSAM k defined in Theorem 1 follows (3) where f (w) = 1 2 (w − ̄w)T KX (w − ̄w) − wT (cid:15). (13) As we study indefinite kernels, KX might be indefinite and therefore f (w) in Theorem 2 can be non- convex. This shows that our analysis of SAM applies to both convex (as in the linear regression case discussed in Section 3.1 and PSD kernels) and non-convex functions, as for indefinite kernels. 4 Main Results 4.1 ReLU Networks In this section, we review our theoretical results for the ReLU networks discussed in Section 3.1. We note that as discussed, this model also readily applies to the least-squares linear regression problem and therefore, we do not study that problem separately. Let A ∈ Rn×p be the matrix with i-th row equal to a(w0; xi). Let us (cid:21) (cid:20)U T (cid:21) consider the following Singular Value Decomposition (SVD) of A, A = V ΣU T = (cid:2)V 1 V 2 1 U T 0 2 where Σ1 ∈ Rr×r collects nonzero singular values of A and r is the rank of A. We let D1 = Σ2 characterizes the error for the neural model discussed in Section 3.1. Theorem 3. Suppose w0 = U 1U T 1 w0 and 0 ≺ I − ηD1 − ηρD2 under the model from Section 3.1 one has for k ≤ ̄k 1 ≺ I and let u = U T 1 ( ̄w − w0). Then, 1. Theorem 3 (cid:20)Σ1 (cid:3) Bias2(wSAM k ) = 1 n r (cid:88) (1 − ηdi − ηρd2 i )2kdiu2 i i=1 (14) Var(wSAM k ) = σ2 n (cid:16)(cid:0)I − (I − ηD1 − ηρD2 1)k(cid:1)2(cid:17) . Tr 3An explicit expression for updates can be found in (E.8). 6 In particular, for ̄k ≥ k ≥ 0 one has Bias2(wSAM k ) ≤ Bias2(wGD k ) and Var(wSAM k ) ≥ Var(wGD k ). We note that Theorem 3 is applicable to GD by setting ρ = 0. Theorem 3 precisely characterizes the expected SAM trajectory, and its corresponding bias and variance terms for the neural network model. Specifically, we see that bias for SAM in each iteration is smaller than GD, while the variance for SAM is larger. We note that as k increases, the bias term decreases while the variance increases. Therefore, if the optimization is run for finitely many steps, the bias term is more likely to be the dominant term and as SAM has a lower bias, SAM is more likely to outperform GD. This intuitive argument is formalized in Proposition 1. Proposition 1. Suppose there exists a numerical constant c0 > 1 such that 1 − ηdr ≤ c0(1 − ηd1 − ηρd2 1), 1 − ηd1 ≥ √ c0(1 − ηdr − ηρd2 r). (15) Let SNR = (cid:107)X( ̄w − w0)(cid:107)2 2/rσ2 and assume SNR ≥ 1. Under the assumptions of Theorem 3, if k ≤ log[2/(SNR + 1)] log[(1 − ηd1 − ηρd2 1)2/(1 − ηdr − ηρd2 r)] ∧ ̄k one has Error(wSAM k ) ≤ Error(wGD k ). Proposition 1 shows that, assuming noise is not too large, SAM has a lower error compared to GD if the optimization is run for finitely many steps. Remark 1. As noted, in practice DNNs are trained for a limited number of epochs [32], and it is be- lieved [19, 5] recent large neural networks, specially language models, tend to be undertrained due to resources limitations. This shows the assumption that k is finite is realistic. Remark 2. An interesting special case of Theorem 3 is the noiseless case where σ = 0. We note that Theorem 3 implies that SAM has a lower error than GD for all iterations k ≥ 1 for this case. Remark 3. In Appendix C, we discuss the selection of η, ρ to ensure condition (15) holds. On a high level, condition (15) suggests taking ρ ≥ η to take advantage of SAM performance. Remark 4. Proposition 1 suggests that the total number of iterations should be smaller in noisy cases. As we demonstrate numerically in Section 5, this is necessary to avoid overfitting to noise. 4.2 Kernel Regression Assume the eigenvalue decomposition KX = U DU T . For simplicity, we assume rank(KX ) = n. We let U 1, D1 and U 2, D2 collect eigenvectors and eigenvalues of KX corresponding to positive and negative eigenvalues, respectively. We also let D = diag(d1, * * * , dn) with d1 ≥ * * * ≥ dn. Theorem 4. Suppose hSAM where 0 = 0 and let u = U T ̄w. Then, Var(wSAM k ) = Var+(wSAM k ) + Var−(wSAM k ) Bias2(wSAM k ) = 1 n n (cid:88) (1 − ηdi − ηρd2 i )2kd2 i u2 i i=1 Var+(wSAM k ) = Var−(wSAM k ) = σ2 n σ2 n (cid:16)(cid:0)I − (I − ηD1 − ηρD2 (cid:16)(cid:0)I − (I − ηD2 − ηρD2 1)k(cid:1)2(cid:17) 2)k(cid:1)2(cid:17) Tr Tr . (16) In Theorem 4, Var+, Var− capture the variance from positive and negative eigenvalues of KX , respec- tively. As we see, the behavior in a non-convex case where some eigenvalues are negative is wildly different ) ≤ from the case where all eigenvalues are non-negative. In particular, if dn < 0, not only Bias2(wSAM k 7 Bias2(wGD k ), but the GD bias actually diverges to infinity, while the SAM bias converges to zero under the assumptions of Theorem 4. In terms of variance, we see that similarly, Var− for SAM stays bounded, while it can diverge to infinity for GD. This shows that in the indefinite setting, GD might have unbounded error in the limit of k → ∞ while SAM can keep the error bounded. We also see Var+ shows a behavior similar to the variance from the ReLU case (Theorem 3), implying that when the number of iterations is limited, SAM has smaller error than GD. This shows that SAM is even more suited to the non-convex case as it performs well for both finite and infinite number of iterations. This explanation is formalized in Proposition 2. Proposition 2. Suppose there exists a numerical constant c0 > 1 such that 1 − ηdr ≤ c0(1 − ηd1 − ηρd2 1), 1 − ηd1 ≥ √ c0(1 − ηdr − ηρd2 r) where r is such that dr > 0, dr+1 < 0. Moreover, assume there exists ε > 0 that for j ≥ r + 1, 1 − ηdj − ηρd2 j ≤ 1 ≤ 1 + ε ≤ 1 − ηdj. Let SNR = (cid:107)KX ̄w(cid:107)2 2/rσ2 and assume SNR ≥ 1. Then, under the assumptions of Theorem 4, if k ≤ log[2/(SNR + 1)] log[(1 − ηd1 − ηρd2 1)2/(1 − ηdr − ηρd2 r)] AND k ≥ log 2 log(1 + ε) (17) (18) one has Error(wSAM k ) ≤ Error(wGD k ). Moreover, if dn < 0, lim k→∞ Error(wGD k ) = ∞, lim k→∞ Error(wSAM k ) < ∞. Similar to Proposition 1, Proposition 2 shows that when the total number of iterations is not too large, SAM performs better. Moreover, as discussed, SAM is able to keep the error bounded in the non-convex case, while GD's error diverges as k → ∞. 4.3 SAM solutions are flat. As discussed, numerous papers have numerically observed the correlation between flatness and generalization, where flatter solutions tend to generalize better. In our work, we directly explained how SAM can perform better statistically compared to GD. However, one might ask if such a correlation between flatness and error exists in our setup. Here, we answer this question in the affirmative. Let us define the sharpness for SAM (and GD similarly) as the expected local fluctuations in the loss, κSAM k = max (cid:107)ε(cid:107)2≤ρ0 IE(cid:15)[f (IE(cid:15)[wSAM k ] + ε) − f (IE(cid:15)[wSAM k ])] (19) for some ρ0 > 0 which might be different from ρ, and f is given in (4) for the ReLU case and in (13) for the kernel regression setup. Note that this can be considered as the expected value of sharpness defined by [15], max(cid:107)ε(cid:107)2≤ρ0 f (w + ε) − f (w) which motivates the SAM algorithm. Proposition 3. (1) Under the assumptions of Theorem 3, for k ≥ 1 (cid:118) (cid:117) (cid:117) (cid:116) (1 − ηdi − ηρd2 (1 − ηdi)2kd2 k − κSAM κGD (cid:118) (cid:117) (cid:117) (cid:116) ≥ ρ2 0 r (cid:88) r (cid:88) + ρ0 i )2kd2 i u2 i u2 i i −  .    k dr − d1 2 i=1 i=1 (2) Under the assumptions of Theorem 4, if dn < 0 lim k→∞ k = ∞ > κSAM κGD k ∀k ≥ 1. Proposition 3 shows that for the ReLU setup, SAM has lower sharpness compared to GD for sufficiently small ρ0, k. Specially, if dr = d1, SAM has lower sharpness for k, ρ0 > 0. Moreover, for the indefinite kernel setup, this proposition shows that GD has unbounded sharpness, unlike SAM. This further confirms the connections between generalization and flatness observed theoretically [11] and numerically [15, 39] in the literature. Moreover, this is in agreement with the previous work showing SAM leads to flatter solutions compared to GD [4, 1, 37, 35, 15]. 8 5 Numerical Experiments We conduct various numerical experiments on linear models, kernel methods and deep neural networks to examine the theory we developed and to gain further insight into SAM. Due to space limitations, we only discuss main insights from our DNN experiments here. We use CIFAR10/100 [25] data and noisy versions of CIFAR10 provided by [36] to train ResNet50 network [18] in our experiments here. Additional results for ResNet18 network as well as experiments on linear/kernel models can be found in Appendix F. Large ρ vs small ρ: First, we consider the case with clean (noiseless) labels, where one can expect the bias to be the dominant term. In this case, our theory would suggest taking a larger ρ lowers the error. Moreover, our theory anticipates SAM performs specially better than (S)GD in earlier epochs where the difference in bias is even larger. We show that these insights hold true in our experiments. Particularly, in Figure 2 [Two Left Panels] we observe that when ρ > 0, SAM performs better than GD in almost all epochs. We see that as we increase ρ, SAM performs quite well over the first 150 epochs. However, the gains from large ρ tend to fade in later epochs as smaller values of ρ get to lower bias values as well. Nevertheless, we see that in terms of accuracy, it is better to choose a larger ρ rather than a small ρ (the accuracy values are given in figure legends. Also see Figure F.6 for more details). In case of CIFAR10, ρ = 0.1 is the best value of ρ in our experiments and taking ρ = 0.5 results in a smaller loss of accuracy, compared to taking ρ = 0 (i.e. GD). In the case of CIFAR100, ρ = 0.5 results in better accuracy compared to ρ = 0.1, which shows that generally, overestimating ρ is less harmful than underestimating ρ. This mostly agrees with theory that taking larger ρ in noiseless settings is better, although we note that in practice, variance might not be exactly zero so large ρ might perform slightly worse than smaller ρ, as is the case for CIFAR10. Early stopping in noisy settings: Next, we consider a noisy setting and show that to avoid overfitting, the training has to be stopped early, showing the assumption that the number of epochs is finite is realistic. We use two versions of noisy CIFAR10, random label 1 and worse labels from [36] which we call random and worse, respectively. The random version has about 17% noise in training labels, while worse has about 40% noise. The validation labels for both datasets are noiseless. As we see in Figure 2 [Two Right Panels], as the noise increases both methods tend to overfit in the later stages of training, and overfitting is stronger when noise is higher. This shows that in noisy settings training has to be stopped earlier as noise increases. Performance under noise: As we see from Figure 2, in noisy settings the gap between SAM and GD is even larger. This can be explained as in non-convex settings, GD can have unbounded variance (cf. Theorem 4) which leads to worse performance of GD specially in later epochs. Decaying ρ helps: We observe that having large ρ helps in initial phases of training, while having a smaller ρ might help in the later phases. Therefore, we propose to start SAM with a large value of ρ to decrease bias and then decay ρ over the course of algorithm to limit the increase of variance (the details are discussed in Appendix F). The result for this case are shown in Table 1. Full is the accuracy at the end of training (epoch 200) and Early corresponds to early stopping (epoch 120 for SGD and 50 for SAM-based methods). As can be seen, starting with larger than optimal ρ and decaying leads to accuracy results similar or slightly better than using the optimal fixed ρ. Interestingly, using large ρ leads to considerably better performance if training has to be stopped early, which is often the case in practice specially for large models [19, 5] due to resource limitations. 6 Conclusion and Future Work We presented a direct explanation of why SAM generalizes well through studying the statistical performance of SAM/GD for two classes of problems. Specifically, we showed that SAM works well for neural networks with a hidden ReLU layer if the noise is not too high. We also showed that in indefinite kernel regression, corresponding to a non-convex optimization problem, SAM can have bounded error while GD has unbounded error. An interesting question is that how stochastic version of SAM would differ from the full-batch setting studied here. In Appendix D, we study a stochastic version of SAM and compare it to SGD for a special case. As we see, SAM tends to benefit from stochasticity even more, specially in high-dimensional settings. 9 CIFAR10 CIFAR100 CIFAR10-Random CIFAR10-Worse Figure 2: Accuracy over epochs for SAM and GD with ResNet50 and different datasets. The number in the parenthesis in the legend shows the average best accuracy. Table 1: Comparison of SGD, SAM with optimal ρ and SAM with ρ decaying over the course of algorithm. Dataset Method Full Early CIFAR10 CIFAR100 SGD SAM SAM-Decay SGD SAM SAM-Decay 95.44 ± 0.06 96.31 ± 0.06 96.42 ± 0.10 79.50 ± 0.33 82.01 ± 0.09 82.02 ± 0.27 82.99 ± 0.75 81.43 ± 2.73 86.79 ± 0.38 58.87 ± 0.62 60.20 ± 0.97 61.92 ± 1.63 A deeper analysis of stochastic SAM is left for a future work. Acknowledgments This research is supported in part by a grant from the Office of Naval Research (N000142112841). Authors would like to thank MIT SuperCloud for providing computational resources for this work. 10 050100150200Epochs 020406080100GD = 0 (95.44%)SAM = 0.1 (96.31%)SAM = 0.5 (96.09%)050100150200Epochs 020406080100GD = 0 (79.50%)SAM = 0.1 (81.26%)SAM = 0.5 (81.51)050100150200Epochs 30405060708090100GD = 0 (87.20%)SAM = 0.1 (90.81%)050100150200Epochs 2030405060708090GD = 0 (80.23%)SAM = 0.1 (83.53%) References [1] Atish Agarwala and Yann N. Dauphin. Sam operates far from home: eigenvalue regularization as a dynamical phenomenon, 2023. [2] Maksym Andriushchenko and Nicolas Flammarion. Towards understanding sharpness-aware minimiza- tion. In International Conference on Machine Learning, pages 639–668. PMLR, 2022. [3] Dara Bahri, Hossein Mobahi, and Yi Tay. Sharpness-aware minimization improves language model generalization. arXiv preprint arXiv:2110.08529, 2021. [4] Peter L Bartlett, Philip M Long, and Olivier Bousquet. The dynamics of sharpness-aware minimization: Bouncing across ravines and drifting towards wide minima. arXiv preprint arXiv:2210.01513, 2022. [5] Mohammad Bavarian, Heewoo Jun, Nikolas Tezak, John Schulman, Christine McLeavey, Jerry Tworek, arXiv preprint language models to fill in the middle. and Mark Chen. Efficient training of arXiv:2207.14255, 2022. [6] Kayhan Behdin, Qingquan Song, Aman Gupta, David Durfee, Ayan Acharya, Sathiya Keerthi, and Rahul Mazumder. Improved deep neural network generalization using m-sharpness-aware minimization. In OPT 2022: Optimization for Machine Learning (NeurIPS 2022 Workshop), 2022. [7] Mikhail Belkin, Siyuan Ma, and Soumik Mandal. To understand deep learning we need to understand kernel learning. In International Conference on Machine Learning, pages 541–549. PMLR, 2018. [8] Lin Chen and Sheng Xu. Deep neural tangent kernel and laplace kernel have the same rkhs. arXiv preprint arXiv:2009.10683, 2020. [9] Xiangning Chen, Cho-Jui Hsieh, and Boqing Gong. When vision transformers outperform resnets without pre-training or strong data augmentations. arXiv preprint arXiv:2106.01548, 2021. [10] Enea Monzio Compagnoni, Antonio Orvieto, Luca Biggio, Hans Kersting, Frank Norbert Proske, and Aurelien Lucchi. An sde for modeling sam: Theory and insights. arXiv preprint arXiv:2301.08203, 2023. [11] Lijun Ding, Dmitriy Drusvyatskiy, and Maryam Fazel. Flat minima generalize for low-rank matrix recovery. arXiv preprint arXiv:2203.03756, 2022. [12] Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 1019–1028. PMLR, 06–11 Aug 2017. [13] Jiawei Du, Daquan Zhou, Jiashi Feng, Vincent YF Tan, and Joey Tianyi Zhou. Sharpness-aware training for free. arXiv preprint arXiv:2205.14083, 2022. [14] Gintare Karolina Dziugaite and Daniel M Roy. Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. arXiv preprint arXiv:1703.11008, 2017. [15] Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimization for efficiently improving generalization. arXiv preprint arXiv:2010.01412, 2020. [16] Amnon Geifman, Abhay Yadav, Yoni Kasten, Meirav Galun, David Jacobs, and Basri Ronen. On the similarity between the laplace and neural tangent kernels. Advances in Neural Information Processing Systems, 33:1451–1461, 2020. 11 [17] Behrooz Ghorbani, Song Mei, Theodor Misiakiewicz, and Andrea Montanari. When do neural networks outperform kernel methods? Advances in Neural Information Processing Systems, 33:14820–14830, 2020. [18] 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. [19] Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Ruther- ford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, et al. Training compute- optimal large language models. arXiv preprint arXiv:2203.15556, 2022. [20] Thomas Hofmann, Bernhard Sch ̈olkopf, and Alexander J Smola. Kernel methods in machine learning. The annals of statistics, 36(3):1171–1220, 2008. [21] H. Ibayashi, T. Hamaguchi, and M. Imaizumi. Minimum sharpness: Scale-invariant parameter- robustness of neural networks. arXiv preprint arXiv:2106.12612, 2021. [22] Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and general- ization in neural networks. Advances in neural information processing systems, 31, 2018. [23] Jean Kaddour, Linqing Liu, Ricardo Silva, and Matt Kusner. When do flat minima optimizers work? In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, editors, Advances in Neural Information Processing Systems, 2022. [24] 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. arXiv preprint arXiv:1609.04836, 2016. [25] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. [26] Tengyuan Liang and Alexander Rakhlin. Just interpolate: Kernel "ridgeless" regression can generalize. The Annals of Statistics, 48(3):1329–1347, 2020. [27] Fanghui Liu, Lei Shi, Xiaolin Huang, Jie Yang, and Johan AK Suykens. Analysis of regularized least- squares in reproducing kernel krein spaces. Machine Learning, 110:1145–1173, 2021. [28] Ronny Luss and Alexandre d'Aspremont. Support vector machine classification with indefinite kernels. Advances in neural information processing systems, 20, 2007. [29] Chao Ma and Lexing Ying. On linear stability of sgd and input-smoothness of neural networks. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, volume 34, pages 16805–16817. Curran Associates, Inc., 2021. [30] Dino Oglic and Thomas Gartner. Learning in reproducing kernel krein spaces. In International confer- ence on machine learning, pages 3859–3867. PMLR, 2018. [31] Dino Oglic and Thomas Gartner. Scalable learning in reproducing kernel krein spaces. In International Conference on Machine Learning, pages 4912–4921. PMLR, 2019. [32] Lutz Prechelt. Early Stopping - But When?, pages 55–69. Springer Berlin Heidelberg, Berlin, Heidelberg, 1998. [33] Albert Reuther, Jeremy Kepner, Chansup Byun, Siddharth Samsi, William Arcand, David Bestor, Bill Bergeron, Vijay Gadepally, Michael Houle, Matthew Hubbell, Michael Jones, Anna Klein, Lauren Milechin, Julia Mullen, Andrew Prout, Antonio Rosa, Charles Yee, and Peter Michaleas. Interactive supercomputing on 40,000 cores for machine learning and data analysis. In 2018 IEEE High Performance extreme Computing Conference (HPEC), pages 1–6. IEEE, 2018. 12 [34] Samuel L Smith, Benoit Dherin, David GT Barrett, and Soham De. On the origin of implicit regular- ization in stochastic gradient descent. arXiv preprint arXiv:2101.12176, 2021. [35] Szilvia Ujv ́ary, Zsigmond Telek, Anna Kerekes, Anna M ́esz ́aros, and Ferenc Husz ́ar. Rethinking sharpness-aware minimization as variational inference. arXiv preprint arXiv:2210.10452, 2022. [36] Jiaheng Wei, Zhaowei Zhu, Hao Cheng, Tongliang Liu, Gang Niu, and Yang Liu. Learning with noisy labels revisited: A study using real-world human annotations. In International Conference on Learning Representations, 2022. [37] Kaiyue Wen, Tengyu Ma, and Zhiyuan Li. How sharpness-aware minimization minimizes sharpness? In The Eleventh International Conference on Learning Representations, 2023. [38] Lei Wu, Chao Ma, and Weinan E. How sgd selects the global minima in over-parameterized learning: A dynamical stability perspective. In Advances in Neural Information Processing Systems, volume 31, 2018. [39] Lei Wu, Mingze Wang, and Weijie J Su. The alignment property of SGD noise and how it helps select flat minima: A stability analysis. In Advances in Neural Information Processing Systems, 2022. [40] Zeke Xie, Issei Sato, and Masashi Sugiyama. A diffusion theory for deep learning dynamics: Stochastic gradient descent exponentially favors flat minima. In International Conference on Learning Represen- tations, 2021. [41] Juntang Zhuang, Boqing Gong, Liangzhe Yuan, Yin Cui, Hartwig Adam, Nicha Dvornek, Sekhar Tatikonda, James Duncan, and Ting Liu. Surrogate gap minimization improves sharpness-aware train- ing. arXiv preprint arXiv:2203.08065, 2022. 13 A Details of example from Section 1 Under the notation used in Section 4, the noiseless example shows a one-dimensional case with d1 = 1, η = 0.015, u = 1 and ρ = 1. The plot shows Error for GD and SAM. In the noisy setting, we set n = 2, σ2 = 0.2. The model follows η = 0.0045, d2 = −0.0007/η and ρ = −1/d2. We also set u1 = u2 = 1. The plot similarly shows the error. B Review of Kernel Gradients Note that as discussed in Section 3.2, HK = HK+ HK+, f− ∈ HK− such that f = f+ − f−. Moreover, the inner product in HK is defined as (cid:76) HK− . Therefore, for f ∈ HK, there exists f+ ∈ (cid:104)f, g(cid:105) = (cid:104)f+, g+(cid:105) − (cid:104)f−, g−(cid:105). (B.1) Note that similar to the RKHS case, for f ∈ HK we have (cid:104)K(x, *), f (cid:105) = (cid:104)K+(x, *), f+(cid:105) − (cid:104)K−(x, *), f−(cid:105) = f+(x) − f−(x) = f (x). Let x ∈ Rp, y ∈ R and L[h] = (h(x) − y)2 for h ∈ HK. The gradient of L[h] is a function such as k ∈ HK where k is a good first-order approximation to L[h]. In particular, for any bounded g ∈ HK, L[h + (cid:15)g] = (h(x) + (cid:15)g(x) − y)2 = (h(x) − y)2 + (cid:15)2g(x)2 + 2(cid:15)g(x) (h(x) − y) = L[h] + 2(cid:15)g(x) (h(x) − y) + O((cid:15)2) = L[h] + (cid:15)(cid:104)2 (h(x) − y) K(x, *), g(cid:105) + O((cid:15)2). lim (cid:15)→0 L[h + (cid:15)g] − L[h] (cid:15) = (cid:104)2 (h(x) − y) K(x, *), g(cid:105). (B.2) (B.3) Therefore, Hence, we take ∇L[h] = 2(h(x) − y)K(x, *). C Discussion on Propositions 1 and 2 In this section, we study what conditions (17) implies on the model. Particularly, we set d1 = 1. As two examples, we take dr ∈ {0.8, 0.95} and dn ∈ {−0.6, −1}. We also like the bounds of Proposition 2 to be valid for at least k ≥ 20. Therefore, we take ε = log 2/ log 20 − 1. Next, we sweep η and ρ and choose the values that satisfy (17) for some c0 > 1. We plot the results in Figure C.1 for different values of dr, dn, where we highlight every pair of (η, ρ) that satisfy the condition in dark blue. As can be seen in this figure, taking η to be small and ρ (cid:29) η results in (17) being satisfied. This makes intuitive sense as taking η small helps to satisfy 1 − ηdi − ηρd2 i < 1 and taking ρ (cid:29) η helps to take advantage of SAM regularization. D Effect of Stochasticity: A Special Case In this section, we study SAM when stochastic mini-batches are used and discuss how stochasticity helps SAM's performance. To this end, we limit our analysis to the linear regression case, and assume for k ≥ 1, yk = ̄wT xk + (cid:15)i, where (cid:15)i's are iid noise values as before, and xk's are independent of each other and noise. In fact, we assume for k ≥ 1, xk ∼ N (0, I) follows a normal distribution. The loss corresponding to the point k is defined as fk(w) = 1 2 (yk − xT k w)2. 14 dr = 0.8 dr = 0.95 6 . 0 − = n d 1 − = n d Figure C.1: Comparison of values of (η, ρ) that satisfy condition (17) for different values of dr, dn. See Appendix C for more details. The stochastic versions of the algorithms hence follow wSAM k+1 = wSAM k − η∇fk(wSAM k + ρ∇fk(wSAM k )). (D.1) To better understand stochastic SAM, following the recent work on SGD [34], we consider the expected trajectory the algorithm takes, that is, IE[wSAM ] where the expectation is taken over xi, (cid:15)i for i ≥ 1. Moreover, as the observations are random, we define error over an unseen data point, which follows the same distribution as the training data, i.e., we consider a random design. Specifically, we define k Error(wSAM k ) = IEx0,(cid:15)0 (cid:104)(cid:0)xT 0 (IE[wSAM k ] − ̄w) − (cid:15)0 (cid:1)2(cid:105) where x0, (cid:15)0 follow the same distribution as xk, (cid:15)k and are independent. Proposition D.1. Suppose 0 < 1 − η − ηρ(p + 2) ≤ 1 − η < 1. Then, under the stochastic setup, Error(wSAM k ) − Error(wGD k ) = (cid:2)(1 − η − ηρ(p + 2))2k − (1 − η)2k(cid:3) (cid:107) ̄w(cid:107)2 2 ≤ 0. (D.2) (D.3) Note that Proposition D.1 shows that SAM outperforms GD in the stochastic setup under this linear regression setup. The term (p + 2)ηρ appearing in (D.3) is an effect of stochasticity, and this term in the full-batch setting is expected to be ηρ (cf. Theorem 3 when D1 = I). In the high-dimensional setting where p (cid:29) 1, this additional term resulting from stochasticity improves the SAM error significantly, showing the suitability of SAM for both stochastic and high-dimensional settings. A deeper analysis of stochastic SAM on more complex model is left for future work. 15 0.511.522.533.544.555.566.577.588.599.5100.10.20.30.40.50.60.511.522.533.544.555.566.577.588.599.5100.10.20.30.40.50.60.511.522.533.544.555.566.577.588.599.5100.10.20.30.40.50.60.511.522.533.544.555.566.577.588.599.5100.10.20.30.40.50.6 E Proof of Main Results E.1 A Preliminary Result Theorem 5. Let wSAM k follow (3) with wSAM k+1 = η k (cid:88) i=0 Then, Proof. As we have f (w) = 1 2 (w − ̄w)T H(w − ̄w) + gT (w − ̄w). (I − ηH − ηρH 2)i(I + ρH)(H ̄w − g) + (I − ηH − ηρH 2)k+1w0. (E.1) f (w) = 1 2 (w − ̄w)T H(w − ̄w) + gT (w − ̄w) wSAM k + ρ∇f (wSAM k ) = wSAM k + ρg + ρH(wSAM k − ̄w) = (I + ρH)wSAM k + ρ(g − H ̄w). Therefore, by writing SAM updates: wSAM + ρ∇f (wSAM k+1 = wSAM k = wSAM k = wSAM k = (I − ηH − ηρH 2)wSAM − η∇f (wSAM k − η(g + H(wSAM − η (cid:8)g + H (cid:0)(I + ρH)wSAM k + ρ∇f (wSAM )) k k k k + η(I + ρH)(H ̄w − g) ) − ̄w)) + ρ(g − H ̄w) − ̄w(cid:1)(cid:9) = η k (cid:88) i=0 (I − ηH − ηρH 2)i(I + ρH)(H ̄w − g) + (I − ηH − ηρH 2)k+1w0 where the last equality is a result of an inductive argument. E.2 Proof of Theorem 1 Proof. By the definition, and L[h] = 1 2 n (cid:88) (yi − h(xi))2 i=1 n (cid:88) ∇L[h] = (h(xi) − yi)K(xi, *). i=1 Hence, the KernelSAM gradient can be written as (E.2) (E.3) (E.4) (E.5) [(h + ρ∇L[h])(xi) − yi] K(xi, *) ∇L[h + ρ∇L[h]] = = n (cid:88) i=1 n (cid:88) i=1    h + ρ n (cid:88) j=1   (h(xj) − yj)K(xj, *)  (xi) − yi  K(xi, *)  h(xi) + ρ (a) = n (cid:88) i=1 n (cid:88) (h(xj) − yj)K(xi, xj) − yi   K(xi, *) j=1 = n (cid:88) i=1 [h(xi) − yi] K(xi, *) + ρ n (cid:88) n (cid:88) i=1 j=1 [(h(xj) − yj)K(xi, xj)] K(xi, *) (E.6) 16 where in (a), we used the fact K(xi, *)(xj) = K(xi, xj). As a result, we have ∇L[h + ρ∇L[h]] = v(h)T K(X, *) where v(h) ∈ Rn, and vi(h) = h(xi) − yi + ρ n (cid:88) j=1 [(h(xj) − yj)K(xi, xj)] . Note that hSAM 0 = 0 = 0T K(X, *). Suppose for the sake of induction that hSAM k = (wSAM k )T K(X, *). Then, k+1 = hSAM hSAM k − η∇L[hSAM k = (cid:0)wSAM − ηv(hSAM k k+1 )T K(X, *) = (wSAM k + ρ∇L[hSAM )(cid:1)T K(X, *) k ]] where This completes the proof. E.3 Proof of Theorem 2 wSAM k+1 = wSAM k − ηv(hSAM k ). The proof of this theorem is based on the following technical lemma. Lemma E.1. Under the assumptions of Theorem 2, one has hSAM k = (wSAM k )T K(X, *) where wSAM k+1 = (I − ηKX − ηρK2 X )wSAM k + η(I + ρKX )(KX ̄w + (cid:15)). Proof. Suppose h = n (cid:88) i=1 wiK(xi, *). Then, the residual corresponding to the i-th observation is given as Ri = h(xi) − yi = h(xi) − ̄h(xi) − (cid:15)i n (cid:88) (wj − ̄wj)K(xi, xj) − (cid:15)i = j=1 R = KX (w − ̄w) − (cid:15). or in the matrix/vector notation, Thus, n (cid:88) i=1 [h(xi) − yi] K(xi, *) = = = n (cid:88) i=1 n (cid:88) RiK(xi, *)   n (cid:88) (wj − ̄wj)K(xi, xj) − (cid:15)i  K(xi, *)  i=1 j=1 n (cid:88) n (cid:88) i=1 j=1 (wj − ̄wj)K(xi, xj)K(xi, *) − n (cid:88) i=1 (cid:15)iK(xi, *) (E.7) (E.8) (E.9) (E.10) = (w − ̄w)T KX K(X, *) − (cid:15)T K(X, *) (E.11) 17 using our vector notation. Next, n (cid:88) j=1 [(h(xj) − yj)K(xi, xj)] = n (cid:88) (cid:34) n (cid:88) (wl − ̄wl)K(xj, xl) − (cid:15)j K(xi, xj) (cid:35) l=1 (wl − ̄wl) n (cid:88) j=1 K(xi, xj)K(xj, xl) − n (cid:88) j=1 K(xi, xj)(cid:15)j (K2 X )i,l(wl − ̄wl) − [KX (cid:15)]i j=1 n (cid:88) l=1 n (cid:88) l=1 = = = (cid:2)K2 X (w − ̄w)(cid:3) i − [KX (cid:15)]i. (E.12) This leads to n (cid:88) n (cid:88) i=1 j=1 [(h(xj) − yj)K(xi, xj)] K(xi, *) = (w − ̄w)T K2 X K(X, *) − (cid:15)T KX K(X, *). (E.13) Therefore, from (E.6), ∇L[h + ρ∇L[h]] = (cid:0)KX (w − ̄w) − (cid:15) + ρK2 X (w − ̄w) − ρKX (cid:15)(cid:1)T K(X, *). (E.14) In particular, if hSAM k = (wSAM k )T K(X, *), then hSAM k+1 = (wSAM k+1 )T K(X, *) where wSAM k+1 = wSAM − η (cid:0)KX (wSAM k k = (I − ηKX − ηρK2 X )wSAM k − ̄w) − (cid:15) + ρK2 X (wSAM k − ̄w) − ρKX (cid:15)(cid:1) + η(I + ρKX )(KX ̄w + (cid:15)). (E.15) Proof of Theorem 2. The proof follows from comparing Lemma E.1 to (E.2). E.4 Proof of Theorem 3 Proof. Note that under the setup, f (wSAM k ) = 1 2 (a) = 1 2 n (cid:88) (yi − Φ(wSAM k ; xi))2 i=1 n (cid:88) i=1 (cid:0)(cid:15)i + a( ̄w; xi)T ̄w − a(wSAM k ; xi)T wSAM k (cid:1)2 (cid:107)(cid:15) + A( ̄w − wSAM k )(cid:107)2 2 (b) = = 1 2 1 ( ̄w − wSAM 2 k )T AT A( ̄w − wSAM k ) − (cid:15)T A(wSAM k − ̄w) + 1 2 (cid:107)(cid:15)(cid:107)2 2 (E.16) 18 = = 1 η 1 η where (a) is by Assumption (A2) and (b) is by Assumption (A1). Comparing (E.16) to Theorem 5, we see that H = AT A and g = −AT (cid:15). Next, note that k (cid:88) (I − ηH − ηρH 2)i(I + ρH)(H ̄w − g) i=0 (a) = U (cid:32) k (cid:88) (I − ηD − ηρD2)i (cid:33) (I + ρD)U T (U 1D1U T 1 ̄w + U 1Σ1V T 1 (cid:15)) (b) =U 1 i=0 (cid:32) k (cid:88) i=0 (I − ηD1 − ηρD2 1)i (cid:33) (I + ρD1)U T 1 (U 1D1U T 1 ̄w + U 1Σ1V T 1 (cid:15)) (c) = U 1diag (d) = U 1diag  (cid:40)   (cid:40)   (cid:40) =U 1diag  1 − (1 − ηdj − ηρd2 j )k+1 ηdj + ηρd2 j 1 − (1 − ηdj − ηρd2 j )k+1 ηdj + ηρd2 j 1 − (1 − ηdj − ηρd2 j )k+1 ηdj + ηρd2 j (cid:41)r j=1 (cid:41)r j=1 (cid:41)r   diag (cid:0){1 + ρdj}r j=1   diag (cid:0){1 + ρdj}r j=1 (cid:1) (D1U T 1 ̄w + Σ1V T 1 (cid:15)) (cid:1) (D1U T 1 ̄w + D1Σ−1 1 V T 1 (cid:15))   diag (cid:0){dj + ρd2 j }r j=1 (cid:1) (U T 1 ̄w + Σ−1 1 V T 1 (cid:15)) U 1diag (cid:16)(cid:8)1 − (1 − ηdj − ηρd2 j )k+1(cid:9)r (U T 1 ̄w + Σ−1 1 V T 1 (cid:15)) j=1 (cid:17) j=1 U 1(I − (I − ηD1 − ηρD2 1)k+1)(U T 1 ̄w + Σ−1 1 V T 1 (cid:15)) (E.17) where (a) is by substituting H = U 1D1U T U T 1 U 1 = I and 1 = U DU T , (b) is by the fact the fact U T 2 U 1 = 0, (c) is using k (cid:88) i=0 (1 − x)i = 1 − (1 − x)k+1 x and (d) is true as D1 is invertible. Moreover, U (I − η1D1 − ηρD2 1)kU T w0 = U (I − η1D1 − ηρD2 = U 1(I − η1D1 − ηρD2 1)kU T U 1U T 1)kU T 1 w0 1 w0 (E.18) where the first equation is by the assumption w0 = U 1U T 1 w0. By (E.1), (E.17) and (E.18), we achieve: wSAM k+1 = U 1(I − (I − ηD1 − ηρD2 1)k+1)(U T 1 ̄w + Σ−1 1 V T 1 (cid:15)) + U 1(I − η1D1 − ηρD2 1)k+1U T 1 w0. By taking the expectation, we have IE(cid:15)[wSAM k This implies ] = U 1(I − (I − ηD1 − ηρD2 1)k)U T 1 ̄w + U 1(I − η1D1 − ηρD2 1)kU T 1 w0. IE(cid:15)[wSAM k ] − U 1U T 1 ̄w = −U 1(I − ηD1 − ηρD2 1)kU T 1 ( ̄w − w0). 19 (E.19) (E.20) (E.21) Next, by the definition of bias in (5), nBias2(wSAM k ) = (IE(cid:15)[wSAM k k (a) = (IE(cid:15)[wSAM (b) = (IE(cid:15)[wSAM (c) = ( ̄w − w0)T U T k ] − ̄w)T H(IE(cid:15)[wSAM ] − ̄w)T U 1D1U T ] − ̄w) k 1 (IE(cid:15)[wSAM ] − U 1U T 1 ̄w)T U 1D1U T ] − U 1U T ] − ̄w) k 1 (IE(cid:15)[wSAM k 1 (I − ηD1 − ηρD2 1)kD1(I − ηD1 − ηρD2 1 ( ̄w − w0) 1 ̄w) 1)kU T = r (cid:88) i=1 (1 − ηdi − ηρd2 i )2kdiu2 i (E.22) where (a) is by the SVD of H, (b) is true as ̄w = U 1U T by (E.21). This completes the bias part of the theorem. Next, note that 1 ̄w + U 2U T 2 ̄w and the fact U T 1 U 2 = 0, and (c) is wSAM k − U 1U T 1 ̄w = −U 1(I − ηD1 − ηρD2 1)kU T 1 ( ̄w − w0) + U 1(I − (I − ηD1 − ηρD2 1)k)Σ−1 1 V T 1 (cid:15). As a result, nError(wSAM k ) =IE(cid:15) =IE(cid:15) =IE(cid:15) (cid:2)(wSAM k (cid:104) (wSAM k (cid:104) (wSAM k − ̄w)T H(wSAM k − ̄w)(cid:3) − ̄w)T U 1D1U T 1 (wSAM k (cid:105) − ̄w) − U 1U T 1 ̄w)T U 1D1U T 1 (wSAM k − U 1U T 1 ̄w) (cid:105) (cid:104) =IE(cid:15) ( ̄w − w0)T U 1(I − ηD1 − ηρD2 1)kD1(I − ηD1 − ηρD2 1)kU T 1 ( ̄w − w0) + (cid:15)T V 1Σ−2 − 2( ̄w − w0)T U 1(I − ηD1 − ηρD2 (cid:0)I − (I − ηD1 − ηρD2 1 D1 1)k(cid:1)2 V T 1 (cid:15) 1)kD1(I − (I − ηD1 − ηρD2 1)k)Σ−1 1 V T 1 (cid:15) (E.23) (E.24) (E.25) (cid:105) . Note that IE(cid:15)[(E.25)] = 0, IE(cid:15)[(E.23)] = nBias2(wSAM one has k ) which implies IE(cid:15)[(E.24)] = nVar(wSAM k ). Finally, IE(cid:15)[(cid:15)T V 1 (cid:0)I − (I − ηD1 − ηρD2 1)k(cid:1)2 V T 1 (cid:15)] = IE(cid:15) (cid:16) = Tr (cid:104) Tr (cid:16) (cid:15)(cid:15)T V 1 (cid:104) (cid:15)(cid:15)T V 1 (cid:0)I − (I − ηD1 − ηρD2 (cid:0)I − (I − ηD1 − ηρD2 (a) = σ2Tr = σ2Tr V 1 (cid:16)(cid:0)I − (I − ηD1 − ηρD2 (cid:0)I − (I − ηD1 − ηρD2 1)k(cid:1)2(cid:17) 1)k(cid:1)2 IE(cid:15) (cid:16) 1)k(cid:1)2 1)k(cid:1)2 (cid:17) V T 1 where (a) uses IE(cid:15)[(cid:15)(cid:15)T ] = σ2I. For the next part of the proof, Bias2(wSAM k ) = 1 n r (cid:88) (1 − ηdj − ηρd2 j )2kdju2 j j=1 r (cid:88) (1 − ηdj)2kdju2 j ≤ 1 n j=1 = Bias2(wGD k ). The proof for variance follows. 20 (cid:17)(cid:105) (cid:105)(cid:17) V T 1 V T 1 (E.26) (E.27) E.5 Proof of Proposition 1 Before proceeding with the proof of the proposition, we first show a few technical lemmas. Lemma E.2. Let where a ≥ c and b < d. Then, q(x) ≥ 0 for x ∈ [0, log(c/a)/ log(b/d)]. q(x) = a exp(x log b) − c exp(x log d) Proof. One has q(x) = a exp(x log b) − c exp(x log d) = 0 ⇒ exp(x log(b/d)) = c a ⇒ x = log(c/a) log(b/d) ≥ 0 (E.28) as c/a ≤ 1 and d/b > 1. Hence, q(x) does not change sign between 0 and log(c/a)/ log(b/d) by the intermediate value theorem. Moreover, q(0) = a − c ≥ 0 implying q(x) ≥ 0 in this interval. Lemma E.3. Under the assumptions of Theorem 3, 1 n (1 − ηd1 − ηρd2 1)2k(cid:107)X( ̄w − w0)(cid:107)2 2 ≤ Bias2(wSAM k ) ≤ 1 n (1 − ηdr − ηρd2 r)2k(cid:107)X( ̄w − w0)(cid:107)2 2 and σ2r n (1 − ηd1 − ηρd2 1)2k − 2σ2r n (1 − ηdr − ηρd2 r)k ≤ Var(wSAM k ) − σ2r n ≤ σ2r n (1 − ηdr − ηρd2 r)2k − 2σ2r n (1 − ηd1 − ηρd2 1)k. Proof. From Theorem 3, 1 n (1 − ηd1 − ηρd2 1)2k(cid:107)X( ̄w − w0)(cid:107)2 2 ≤ Bias2(wSAM k ) ≤ 1 n (1 − ηdr − ηρd2 r)2k(cid:107)X( ̄w − w0)(cid:107)2 2 where we used (cid:107)X( ̄w − w0)(cid:107)2 2 = ( ̄w − w0)T X T X( ̄w − w0) = ( ̄w − w0)T U 1D1U T 1 ( ̄w − w0) = uT D1u = r (cid:88) j=1 dju2 j . Moreover, from Theorem 3 we also have Var(wSAM k ) = = σ2 n σ2r n Tr((I − (I − ηD1 − ηρD2 1)k)2) + σ2 n Tr((I − ηD1 − ηρD2 1)2k) − 2σ2 n Tr((I − ηD1 − ηρD2 1)k). The rest of the proof follows. Proof of Proposition 1. Noting that Error(wSAM have k ) = Bias2(wSAM k ) + Var(wSAM k ), from Lemma E.3 we Error(wSAM k ) − σ2r n ≤ (cid:18) (cid:107)X( ̄w − w0)(cid:107)2 2 + σ2r (cid:19) n (1 − ηdr − ηρd2 r)2k − 2σ2r n (1 − ηd1 − ηρd2 1)k (E.29) 21 and Error(wGD k ) − σ2r n ≥ (cid:18) (cid:107)X( ̄w − w0)(cid:107)2 2 + σ2r (cid:19) n (1 − ηd1)2k − 2σ2r n (1 − ηdr)k (E.30) by setting ρ = 0. From (15), σ2r Error(wGD n (cid:18) (cid:107)X( ̄w − w0)(cid:107)2 2 + σ2r k ) − (cid:19) ≥ =ck 0 ≥ck 0 n (cid:18)(cid:18) (cid:107)X( ̄w − w0)(cid:107)2 2 + σ2r n (cid:18) Error(wSAM k ) − (cid:19) σ2r n 0(1 − ηdr − ηρd2 ck (cid:19) r)2k − (1 − ηdr − ηρd2 r)2k − 2σ2r n 2σ2r n 0(1 − ηd1 − ηρd2 ck 1)k (cid:19) (1 − ηd1 − ηρd2 1)k where the last inequality is by (E.29). As a result, Error(wGD k ) ≥ ck 0Error(wSAM k (E.31) ) + (1 − ck 0) σ2r n or equivalently, Error(wSAM k ) − Error(wGD k ) ≤ (1 − ck 0) (cid:18) Error(wSAM k ) − (cid:19) . σ2r n (E.32) Next, let a = ((cid:107)X( ̄w − w0)(cid:107)2 q(x) as in Lemma E.2. Then, from Lemma E.3 we have 2 + σ2r)/n, b = (1 − ηd1 − ηρd2 1)2, c = 2σ2r/n and d = (1 − ηdr − ηρd2 r). Define =q(k). From Lemma E.2, if σ2r Error(wSAM n (cid:18) (cid:107)X( ̄w − w0)(cid:107)2 2 + σ2r ) − k ≥ n k ≤ log(c/a) log(b/d) = (cid:19) (1 − ηd1 − ηρd2 1)2k − 2σ2r n (1 − ηdr − ηρd2 r)k log(2σ2r/((cid:107)X( ̄w − w0)(cid:107)2 2 + σ2r)) log((1 − ηd1 − ηρd2 1)2/(1 − ηdr − ηρd2 r) ) − σ2r/n ≥ 0. Therefore, from (E.32), then q(k) ≥ 0 or equivalently, Error(wSAM k Error(wSAM k ) − Error(wGD k ) ≤ (1 − ck 0) (cid:124) (cid:123)(cid:122) (cid:125) ≤0 (cid:18) Error(wSAM k (cid:124) (cid:123)(cid:122) ≥0 ) − σ2r n (cid:19) (cid:125) ≤ 0 which completes the proof. E.6 Proof of Theorem 4 Proof. First, suppose h = wT K(X, *) for some w ∈ Rn. Then, n (cid:88) i=1 (cid:0)h(xi) − ̄h(xi)(cid:1)2 = n (cid:88)   n (cid:88)  2 (wj − ̄wj)K(xi, xj)  i=1 j=1 = (cid:107)KX (w − ̄w)(cid:107)2 2 = (w − ̄w)T K2 X (w − ̄w). 22 (E.33) (E.34) (E.35) Moreover, Bias2(h) = = = = 1 n 1 n 1 n 1 n n (cid:88) i=1 n (cid:88) i=1 n (cid:88) i=1 (cid:0)IE[h(xi)] − ̄h(xi)(cid:1)2 (E.36) (cid:0)IE[wT [KX ]i] − ̄wT [KX ]i (cid:1)2 (cid:0)[KX ]T i (IE[w] − ̄w)(cid:1)2 (IE[w] − ̄w)T K2 X (IE[w] − ̄w) (E.37) where [KX ]i denotes the i-th column of KX . From Lemma E.1, one has wSAM k+1 = η = η k (cid:88) (I − ηKX − ηρK2 X )(I + ρKX )(KX ̄w + (cid:15)) i=0 k (cid:88) (I − ηKX − ηρK2 X )i(KX + ρK2 X )( ̄w + K−1 X (cid:15)) i=0 (cid:16) = U I − (cid:0)I − ηD − ηρD2(cid:1)k+1(cid:17) (U T ̄w + D−1U T (cid:15)). (E.38) As a result, and IE[wSAM k+1 ] = U (cid:16) I − (cid:0)I − ηD − ηρD2(cid:1)k+1(cid:17) U T ̄w (E.39) wSAM k+1 − ̄w = −U (cid:0)I − ηD − ηρD2(cid:1)k+1 U T ̄w + U (cid:16) I − (cid:0)I − ηD − ηρD2(cid:1)k+1(cid:17) D−1U T (cid:15). (E.40) From (E.35), n (cid:88) i=1 (cid:0)hSAM k (xi) − ̄h(xi)(cid:1)2 =(wSAM k − ̄w)T K2 X (wSAM k − ̄w) − ̄w)T U D2U T (wSAM =(wSAM k = ̄wT U (cid:0)I − ηD − ηρD2(cid:1)2k k (a) − ̄w) D2U T ̄w I − (cid:0)I − ηD − ηρD2(cid:1)k(cid:17)2 (cid:16) − 2 ̄wT U (cid:0)I − ηD − ηρD2(cid:1)k D (cid:16) + (cid:15)T U U T (cid:15) I − (cid:0)I − ηD − ηρD2(cid:1)k(cid:17) where (a) is by (E.40). On the other hand, from (E.37) and (E.39), we have Bias2(h) = 1 n (IE[w] − ̄w)T K2 X (IE[w] − ̄w) = ̄wT U (cid:0)I − ηD − ηρD2(cid:1)2k D2U T ̄w. U T (cid:15) (E.41) (E.42) (E.43) (E.44) (E.45) As a result, IE[(E.42)] = nBias2(h), and also IE[(E.44)] = 0, IE[(E.41)] = nError(h), showing IE[(E.43)] = nVar(h). The rest of the proof follows from the proof of Theorem 3. 23 σ2 n ≥ = i=r+1 (n − r)σ2 n E.7 Proof of Proposition 2 Proof. Let Error+(wSAM where k ) = Bias2 +(wSAM k ) + Var+(wSAM k ), Error−(wSAM k ) = Bias2 −(wSAM k ) + Var−(wSAM k ) Bias2 +(wSAM k ) = Bias2 −(wSAM k ) = 1 n 1 n r (cid:88) (1 − ηdi − ηρd2 i )2kd2 i u2 i i=1 n (cid:88) i=r+1 (1 − ηdi − ηρd2 i )2kd2 i u2 i . (E.46) Note that by following the same steps of the proof of Proposition 1, we have under the assumptions of the proposition, Moreover, note that Bias2 −(wSAM k ) ≤ Bias2 k ) similar to bias corresponding to the convex part. Finally, Error+(wSAM ) ≤ Error+(wGD k ). k −(wGD Var−(wGD k ) − Var−(wSAM k ) = σ2 n n (cid:88) i=r+1 n (cid:88) (cid:110)(cid:0)(1 − ηdi)k − 1(cid:1)2 − (cid:0)1 − (1 − ηdi − ηρd2 i )k(cid:1)2(cid:111) (cid:110)(cid:0)(1 + ε)k − 1(cid:1)2 (cid:111) − 1 (1 + ε)k (cid:0)(1 + ε)k − 2(cid:1) ≥ 0 (E.47) where the last inequality follows the lower bound on k from the proposition. E.8 Proof of Proposition 3 Proof. Let f (w) be defined as in (4) for the ReLU case and in (13) for the kernel case. Then, IE(cid:15)[f (w)] = 1 2 (w − ̄w)T H(w − ̄w) where H = AT A or H = KX for these two cases. Consider the eigenvalue decomposition H = U DU T = U 1D1U T 2 where D1 (cid:31) 0 (cid:31) D2 for the kernel case and D1 (cid:31) D2 = 0 for the ReLU case. Then, 1 + U 2D2U T IE(cid:15)[f (w + ε)] − IE(cid:15)[f (w)] = = = = 1 2 1 2 1 2 1 2 (w + ε − ̄w)T H(w + ε − ̄w) − 1 2 (w − ̄w)T H(w − ̄w) εT Hε + εT H(w − ̄w) εT (U 1D1U T 1 + U 2D2U T 2 )ε + εT U DU T (w − ̄w) (U T 1 ε)T D1(U T 1 ε) + 1 2 (U T 2 ε)T D2(U T 2 ε) + εT U DU T (w − ̄w). (E.48) 24 Part 1: First, consider the case with D2 = 0. Then, max (cid:107)ε(cid:107)2≤ρ0 ≥ max (cid:107)ε(cid:107)2=ρ0 (a) ≥ max (cid:107)ε(cid:107)2=ρ0 ≥ max (cid:107)ε(cid:107)2=ρ0 ε=U 1v (b) ≥ max (cid:107)v(cid:107)2=ρ0 1 2 1 2 = (c) = IE(cid:15)[f (w + ε)] − IE(cid:15)[f (w)] IE(cid:15)[f (w + ε)] − IE(cid:15)[f (w)] λmin(D1)(cid:107)U T 1 ε(cid:107)2 2 + (U T 1 ε)T D1U T 1 (w − ̄w) λmin(D1)(cid:107)U T 1 ε(cid:107)2 2 + (U T 1 ε)T D1U T 1 (w − ̄w) (cid:21) (cid:21) λmin(D1)(cid:107)v(cid:107)2 2 + vT D1U T 1 (w − ̄w) (cid:21) (cid:20) 1 2 (cid:20) 1 2 (cid:20) 1 2 λmin(D1)ρ2 0 + max (cid:107)v(cid:107)2=ρ0 vT D1U T 1 (w − ̄w) λmin(D1)ρ2 0 + ρ0(cid:107)D1U T 1 (w − ̄w)(cid:107)2 where λmin denotes the smallest eigenvalue of the matrix, (a) is by (E.48), (b) is true as if ε = U 1v, 0 = (cid:107)ε(cid:107)2 ρ2 2 = vT U T 1 U 1v = (cid:107)v(cid:107)2 2 and (c) follows vT D1U T 1 (w − ̄w) ≤ (cid:107)v(cid:107)2(cid:107)D1U T 1 (w − ̄w)(cid:107)2. Similarly, max (cid:107)ε(cid:107)2≤ρ0 IE(cid:15)[f (w + ε)] − IE(cid:15)[f (w)] ≤ max (cid:107)ε(cid:107)2≤ρ0 (cid:20) 1 2 λmax(D1)(cid:107)U T 1 ε(cid:107)2 2 + (U T 1 ε)T D1U T 1 (w − ̄w) (cid:21) (a) ≤ ≤ 1 2 1 2 λmax(D1)ρ2 0 + max (cid:107)ε(cid:107)2≤ρ0 (U T 1 ε)T D1U T 1 (w − ̄w) λmax(D1)ρ2 0 + ρ0(cid:107)D1U T 1 (w − ̄w)(cid:107)2. where λmax denotes the largest eigenvalue and (a) is true as (cid:107)U T 1 ε(cid:107)2 ≤ (cid:107)ε(cid:107)2. Note that from (E.20) U T 1 (IE(cid:15)[wSAM k ] − ̄w) = −(I − ηD1 − ηρD2 1)kU T 1 ( ̄w − w0) which implies (cid:107)D1U T 1 (IE(cid:15)[wSAM k ] − ̄w)(cid:107)2 = = = (cid:113) (cid:107)D1U T 1 (IE(cid:15)[wSAM k ] − ̄w)(cid:107)2 2 (cid:113) ( ̄w − w0)T U 1D2 1(I − ηD1 − ηρD2 1)2kU T 1 ( ̄w − w0) (cid:118) (cid:117) (cid:117) (cid:116) r (cid:88) i=1 (1 − ηdi − ηρd2 i )2kd2 i u2 i . The proof follows from (E.49), (E.50) and (E.52). 25 (E.49) (E.50) (E.51) (E.52) Part 2: From (E.48), max (cid:107)ε(cid:107)2≤ρ0 ≥ max (cid:107)ε(cid:107)2=ρ0 IE(cid:15)[f (w + ε)] − IE(cid:15)[f (w)] IE(cid:15)[f (w + ε)] − IE(cid:15)[f (w)] ≥ max (cid:107)ε(cid:107)2=ρ0 1 2 1 2 ≥ = as (cid:107)U T ε(cid:107)2 = (cid:107)ε(cid:107)2. Next, λmin(D)(cid:107)U T ε(cid:107)2 2 + (U T ε)T DU T (w − ̄w) (cid:21) (cid:20) 1 2 λmin(D)ρ2 0 + max (cid:107)U T ε(cid:107)2=ρ0 (U T ε)T DU T (w − ̄w) λmin(D)ρ2 0 + ρ0(cid:107)DU T (w − ̄w)(cid:107)2 max (cid:107)ε(cid:107)2≤ρ0 IE(cid:15)[f (w + ε)] − IE(cid:15)[f (w)] λmax(D)(cid:107)ε(cid:107)2 2 + εT U DU T (w − ̄w) (cid:21) (cid:20) 1 2 ≤ λmax(D)ρ2 0 + ρ0(cid:107)DU T (w − ̄w)(cid:107)2. ≤ max (cid:107)ε(cid:107)2≤ρ0 1 2 From (E.39), implying U T (IE(cid:15)[wSAM k ] − ̄w) = (I − ηD − ηρD2)kU T ̄w (cid:107)DU T (IE(cid:15)[wSAM k ] − ̄w)(cid:107)2 = = = (cid:113) (cid:113) (cid:107)DU T (IE(cid:15)[wSAM k ] − ̄w)(cid:107)2 2 ̄wT U D2(I − ηD − ηρD2)2kU T ̄w (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) i=1 (1 − ηdi − ηρd2 i )2kd2 i u2 i . (E.53) (E.54) (E.55) (E.56) The proof follows from (E.53), (E.54) and (E.56) as 1 − ηdi − ηρd2 i ≥ r + 1. i ≤ 1 for i ∈ [n] and 1 < 1 − ηdi for any E.9 Proof of Proposition D.1 Lemma E.4. Let x ∼ N (0, I). Then, IE[xxT xxT ] = (p + 2)I. Proof. Let ˆH = xxT , ˆΘ = ˆH 2 and Θ = IE[ ˆΘ]. Note that Θi,j = IE[ ˆΘi,j] 2 = IE[( ˆH (cid:34) p )i,j] (cid:88) (cid:35) ˆHi,l ˆHl,j = IE = p (cid:88) l=1 Next, we consider the following cases in (E.57): l=1 IE[xixjx2 l ]. 26 (E.57) 1. i (cid:54)= j: In this case, 2. i = j: Then, p (cid:88) l=1 IE[xixjx2 l ] = IE[xix3 l ] (cid:124) (cid:123)(cid:122) (cid:125) =0 + IE[xjx3 l ] (cid:124) (cid:123)(cid:122) (cid:125) =0 (cid:88) + l(cid:54)=i,j IE[xixjx2 l ] (cid:123)(cid:122) (cid:125) (cid:124) =0 = 0. p (cid:88) l=1 IE[xixjx2 l ] = IE[x4 i ] (cid:124) (cid:123)(cid:122) (cid:125) =3 (cid:88) + l(cid:54)=i IE[x2 i x2 l ] (cid:124) (cid:123)(cid:122) (cid:125) =1 = p + 2. Therefore, Θ = (p + 2)I. Proof of Proposition D.1. Note that fk = 1 2 (xT k ( ̄w − w) + (cid:15)k)2 = 1 2 (w − ̄w)T xkxT k (w − ̄w) − (cid:15)kwT xk + * * * . (E.58) We start by writing SAM updates for the stochastic case. The intermediate solution of SAM is given as wSAM k + ρ∇fk(wSAM k ) = wSAM k + ρ (cid:0)gk + H k(wSAM − ̄w)(cid:1) + ρ(gk − H k ̄w). k = (I + ρH k)wSAM k (E.59) where from (E.58), we have H k = xkxT k and gk = −(cid:15)kxk. Therefore, the SAM update direction is given as k νk = ∇fk(wSAM + ρ∇fk(wSAM = gk + H k((I + ρH k)wSAM = (H k + ρH 2 k)wSAM k k k )) + ρ(gk − H k ̄w) − ̄w) + (I + ρH k)(gk − H k ̄w). (E.60) Hence, wSAM k+1 = wSAM k − ηνk In the next step, we take expectation: = (I − ηH k − ηρH 2 k)wSAM k − η(I + ρH k)(gk − H k ̄w). (E.61) IE[wSAM (cid:2)IEx1,(cid:15)1,*** ,xk−1,(cid:15)k−1 (cid:2)IEx1,(cid:15)1,*** ,xk−1,(cid:15)k−1 (cid:2)(I − ηH k − ηρH 2 (cid:2)(I − ηH k − ηρH 2 k+1 ] = IExk,(cid:15)k = IExk,(cid:15)k = IExk,(cid:15)k (a) = IExk,(cid:15)k (b) = (I − ηIE[H k] − ηρIE[H 2 = (I − ηH − ηρΘ)IE[wSAM k (cid:3)(cid:3) k+1 (cid:12) (cid:2) wSAM (cid:12) xk, (cid:15)k (cid:2) (I − ηH k − ηρH 2 k)IEx1,(cid:15)1,*** ,xk−1,(cid:15)k−1 k)IE (cid:2)wSAM k k])IE[wSAM k (cid:3) − η(I + ρH k)(gk − H k ̄w)(cid:3) ] + η(IE[H k] + ρIE[H 2 k]) ̄w k)wSAM k (cid:2) wSAM k − η(I + ρH k)(gk − H k ̄w)(cid:12) (cid:12) (cid:12) xk, (cid:15)k (cid:3)(cid:3) (cid:3) − η(I + ρH k)(gk − H k ̄w)(cid:3) (cid:12) xk, (cid:15)k ] + η(H + ρΘ) ̄w. (E.62) with Θ = IE[H 2 true as IE[gk] = IE[H kgk] = 0 due to the independence of (cid:15)k and xk. Thus, from (E.62) k], where in (a) we used the fact that wSAM is independent of xk, (cid:15)k, xk+1, (cid:15)k+1,***, and (b) is k IE[wSAM k+1 ] = η = η k (cid:88) i=0 k (cid:88) i=1 (I − ηH − ηρΘ)i(H + ρΘ) ̄w (1 − η − ηρ(p + 2))i(1 + ρ(p + 2)) ̄w = (cid:0)1 − (1 − η − ηρ(p + 2))k+1(cid:1) ̄w (E.63) 27 ErrorGD/ErrorSAM kGD − kSAM ErrorSAM Figure F.1: Results for the full-batch linear regression. Left: Ratio of the best error achieved by GD and SAM. Middle: The difference between the number of iterations leading to the best error Right: Best SAM error where the second equality is by Lemma E.4. Finally, we calculate error from (D.2) as IEx0,(cid:15)0 (cid:104)(cid:0)xT 0 (IE[wSAM k ] − ̄w) − (cid:15)0 (cid:1)2(cid:105) = (IE[wSAM k ] − ̄w)T IE[x0xT 0 ](IE[wSAM ] − ̄w) + IE[(cid:15)2 0] = (IE[wSAM ] − ̄w)T (IE[wSAM = (1 − η − ηρ(p + 2))2k(cid:107) ̄w(cid:107)2 2 k k k ] − ̄w) + σ2 (E.64) which completes the proof. F Additional Numerical Experiments F.1 Linear Regression Experiments First, we examine the theory we developed on the linear regression problem. To this end, we set p = 100, n = 60 corresponding to an over-parameterized regime, with observations as yi = xT i ̄w + (cid:15)i. We assume (xi, (cid:15)i) are independent, and (cid:15)i ∼ N (0, σ2) and xi ∼ (0, Σ) where Σ is an exponential covariance matrix, Σi,j = 0.5|i−j|. Each coordinate of ̄w is independently chosen from Unif[0, 1] and then ̄w is normalized to have norm one. We run GD and SAM with η = 1/2σmax(X)2 and ρ = η/6 for 500 iterations on the least squares loss. We draw 600 noiseless validation samples, denoted as ytest, X test from the same model. We record the validation error defined as Error(w) = (cid:107)ytest − X testwGD 2/600 for GD (and SAM, similarly). We run the whole process described for 100 independent repetitions and report the average and standard deviation of results. We let ErrorGD, ErrorSAM to denote the best validation error achieved for GD and SAM over all iterations, respectively. We also let kGD, kSAM denote the number of iterations with the best error. In Figure F.1, we compare the best error from GD and SAM, and when they are achieved compared to the noise standard deviation. From Figure F.1 [Left Panel], we see that if noise is small, GD and SAM perform similarly, although Figure F.1 [Middle Panel] shows that SAM achieves the best error marginally earlier than GD. When noise is higher but not too high, SAM has a smaller error compared to GD, and this error is achieved earlier. If we continue to increase noise, SAM performs worse and early stopping does not seem to help SAM much. This result is consistent with the theory we developed. Particularly, our theory in Section 4, shows that in the noiseless case or small noise regime, SAM has a lower error compared to GD in earlier iterations. In our experiment, this is confirmed that in small noise regimes, SAM both achieves its best error earlier, and has a smaller error compared to GD. However, as we increase noise, variance increases and as SAM has higher variance, it performs worse. We have also shown the error of SAM in Figure F.1 [Right Panel], showing that increasing noise leads to larger error, as expected. k (cid:107)2 To further examine our theory, we run the model described above for two values of σ = 0.05, 1 and plot the ratio of GD error to SAM error for all iteration in Figure F.2. We see that when noise is smaller, SAM 28 10-310-210-11001010.9650.970.9750.980.9850.990.99511.00510-310-210-110010100.050.10.150.20.250.30.350.410-310-210-1100101100 σ = 0.05 σ = 1 M A S r o r r E / D G r o r r E # of iterations # of iterations Figure F.2: Comparison of ratio of error for GD and SAM over iterations, Error(wGD batch linear regression k )/Error(wSAM k ) for the full- ErrorGD/ErrorSAM ErrorSAM Figure F.3: Results for the stochastic linear regression. Left: Ratio of the best error achieved by SGD and stochastic SAM. Right: Best SAM error performs better than GD in all iterations. On the other hand, when the noise is high, SAM performs better in early iterations, as SAM's bias is lower, while as variance becomes dominant, GD starts to performs better than SAM in later iterations. Again, this is in agreement with our theory. F.1.1 Effect of stochasticity Next, we explore the effect of stochasticity in the algorithm. We use the same model from the previous section. However, we set n = 200 and draw 2000 validation samples. We run the algorithm for an epoch, with batch size of 1. The results for this case are shown in Figure F.3. We see from the left panel that in this case, even for large noise variance values, stochastic SAM performs better than SGD. As we discussed in Appendix D, stochastic SAM can have stronger regularization over SGD due to the way SAM is implemented in practice. F.2 Kernel Regression Experiments Next, we investigate the effect on SAM for the kernel regression case. To this end, we set p = 200, n = 100 and draw X as described in Section F.1. Next, we expand the set of features by adding terms of the form x2 i , x3 i and xixj for 400 pairs of randomly chosen (i, j), overall increasing the dimension of the model to 1000. Then, the observation are drawn as y = ̃xT ̄w + (cid:15) where ̃x is the vector of expanded features and ̄w has iid uniform coordinates and then is normalized to have norm 1. The rest of the setup is similar to Section F.1. We use an indefinite kernel, defined as the difference of a Gaussian kernel with the variance of 100 and an 29 10010110210311.0051.011.0151.021.0251.031.0351001011021030.99511.0051.011.0151.021.0251.0310-310-210-11001010.99911.0011.0021.0031.0041.0051.00610-310-210-11001011.41.51.61.71.8 ErrorGD/ErrorSAM kGD − kSAM ErrorSAM Figure F.4: Results for the kernel regression. Left: Ratio of the best error achieved by GD and SAM. Middle: The difference between the number of iterations leading to the best error Right: Best SAM error σ = 0.3 σ = 3 M A S r o r r E / D G r o r r E # of iterations # of iterations Figure F.5: Comparison of ratio of error for GD and SAM over iterations, Error(wGD regression k )/Error(wSAM k ) for the kernel exponential kernel, K(x, y) = exp − (cid:18) (cid:19) (cid:107)x − y(cid:107)2 2 200 − 0.8 exp(−(cid:107)x − y(cid:107)2) and run the training for 1500 iterations. The whole process is repeated 100 times and then averaged. We use 200 validation points and record the error, defined as Error(h) = 1 200 200 (cid:88) (ytest,i − h(xtest,i))2. i=1 Similar to the case of linear regression, we report the best error over the course of the algorithm and the iteration leading to the best error. The results for this case are shown in Figure F.4. Overall, we see that GD and SAM perform closely in terms of error. Similar to the case of linear regression, unless noise is too large, SAM performs better than GD, although the improvements are marginal. However, we see that the best error for SAM is achieved earlier than GD, which overall agrees with the insight from our bias-variance analysis, as SAM's bias is smaller than GD and in noiseless cases, bias is dominant. We also show the SAM performance in Figure F.4 [Right Panel], showing increasing noise variance leads to worse performance. Finally, we compare the error trajectory of SAM/GD for two values of noise in Figure F.5. We see that in almost all iterations, SAM performs better than GD, which agrees with Proposition 2. Specially, we see that in later iterations, GD performs significantly worse which agrees with our analysis that GD has unbounded error in the non-convex case. 30 10-210-11001010.970.9750.980.9850.990.99511.00510-210-1100101-2-1012345610-210-1100101789101110010110210311.522.510010110210311.522.5 CIFAR10 (ResNet50) CIFAR100 (ResNet50) CIFAR10 (ResNet18) CIFAR100 (ResNet18) Figure F.6: Effect of varying ρ on accuracy on ResNet50 and ResNet18. CIFAR10 CIFAR100 CIFAR10-random CIFAR10-worse Figure F.7: Accuracy over epochs for SAM and SGD (ResNet18). The number in the parenthesis in the legend gives the average best accuracy. F.3 Deep Learning Experiments F.3.1 Experimental setup Our deep learning experiments are done on MIT Supercloud cluster [33] using a single NVIDIA V100 GPU. In all experiments, we use batch size of 256, with the peak starting learning rate of 0.35 scheduled to decay linearly. We train networks for 200 epochs, unless stated otherwise. We use momentum coefficient of 0.9 and weight decay coefficient of 0.0005 in all experiments. We run all experiments for three repetitions and report the average and standard deviation. F.3.2 Comparison of SGD and SAM First, we repeat our experiments from Section 5 on ResNet18. In Figure F.6 we explore the effect of ρ on the accuracy. We see that large or small values of ρ lead to worse performance, as expected. However, we see that as we discussed in Section 5, the loss of accuracy from large values of ρ is less than loss of accuracy when taking ρ = 0, i.e. GD. Specially, in CIFAR100, the loss of accuracy is negligible by going from ρ = 0.3 to ρ = 0.5. A similar situation can be observed from Figure F.6 for the ResNet50 network. As we discussed, this aligns with our theory for the noiseless case. Next, we take a look at error trajectory for noiseless and noisy setups for ResNet18 in Figure F.7. As we see, the profiles of error are similar to the ones from Section 5. Particularly, we see error decreases over epochs for the noiseless case, while start to increase in the noisy setup. Therefore, our insight regarding early stopping in the noisy case holds true here as well. We also see the increasing performance gap between SAM and SGD for the noisy setup, which as we discussed, can be explained by the increase of variance of GD in the non-convex setup. F.3.3 Effect of decaying ρ Based on our observations so far, we see that choosing large values of ρ improves the performance in early epochs, while resulting in worse accuracy in later iterations. Therefore, our hypothesis is that starting the training with a large ρ and then decaying ρ might result in better performance. To test this, we start the 31 00.10.20.30.40.5 95.295.495.695.89696.296.496.600.10.20.30.40.5 7979.58080.58181.58282.500.10.20.30.40.5 95.295.495.695.89696.296.400.10.20.30.40.5 79.279.479.679.88080.280.4050100150200Epochs 020406080100GD = 0 (95.45%)SAM = 0.1 (96.20%)SAM = 0.5 (95.96%)050100150200Epochs 01020304050607080GD = 0 (79.37%)SAM = 0.1 (80.01%)SAM = 0.5 (79.78%)050100150200Epochs 30405060708090GD = 0 (87.00%)SAM = 0.1 (90.36%)050100150200Epochs 30405060708090GD = 0 (79.71%)SAM = 0.1 (82.68%) Table F.1: Effect of starting training with a large ρ and decaying over the course of epochs. Architecture Dataset Method Full Training Early Stopping ResNet18 ResNet50 CIFAR10 CIFAR100 CIFAR10 CIFAR100 SGD SAM-Optimal SAM-Decay SGD SAM-Optimal SAM-Decay SGD SAM-Optimal SAM-Decay SGD SAM-Optimal SAM-Decay 95.45 ± 0.13 96.20 ± 0.02 96.14 ± 0.07 79.37 ± 0.12 80.01 ± 0.03 80.15 ± 0.34 95.44 ± 0.06 96.31 ± 0.06 96.42 ± 0.10 79.50 ± 0.33 82.01 ± 0.09 82.02 ± 0.27 85.98 ± 1.26 85.07 ± 0.09 88.60 ± 1.68 62.58 ± 1.23 59.38 ± 1.14 63.37 ± 0.60 82.99 ± 0.75 81.43 ± 2.73 86.79 ± 0.38 58.87 ± 0.62 60.20 ± 0.97 61.92 ± 1.63 training with a value of ρ in our search grid of {0.1, 0.3, 0.5} that is one step larger than the optimal ρ. For example, if the optimal ρ is 0.1, we start training by ρ = 0.3. Then, we decay ρ. We consider two decay patterns: The value of ρ is multiplied with a coefficient α ∈ {0.7, 0.8, 0.9} at either epoch 175, or epochs 150 and 200. We choose the best scenario among the 6 possible choices outlined above and report the results in Table F.1 under the SAM-Decay row. SAM-Optimal shows the results for the best value of ρ. We run the training for full 200 epochs, but record the validation accuracy over the course of epochs. The early stopping column in Table F.1 corresponds to the best accuracy over the first 120 epochs for SGD, and first 50 epochs for SAM-based methods (i.e. 100 forward-backward passes). We can see that for the full training, decaying ρ results in better or similar accuracy compared to the optimal ρ. This is while using the larger value of ρ for full training leads to worse performance. Moreover, we see that the optimal value of ρ generally performs worse than the decay case when training is stopped early, and using a large ρ shows a considerable improvement in early epochs. As discussed, this is in agreement with the insights from our theory, and our observations above. F.3.4 Effect of sample splitting Finally, we explore the effect of stochasticity in SAM. To this end, we consider a version of SAM where two different sets of samples are used to calculate inner and outer gradients in SAM. That is, for a batch, we break it into two part and use part for the ascend step and the other for the descend. This ensures the independence between the data used for these two gradient steps, which can reduce the effect of stochasticity in SAM. We keep the experimental setup the same as before, but we use two batch size values of 256 (i.e. 128 samples per gradient) and 512 (i.e. 256 samples per gradient), as well as training for 200 and 400 epochs. We also shuffle batches randomly after each epoch. The results on ResNet50 for this case are shown in Table F.2. We see that the results in this case are worse than optimal SAM in Table F.1. This shows that sample splitting does not seem to be helpful in practice. 32 Table F.2: Effect of sample splitting on SAM (ResNet50) Dataset Epochs Batch Size 256 Batch Size 512 CIFAR10 CIFAR100 200 400 200 400 94.39 ± 0.11 94.73 ± 0.11 78.63 ± 0.48 78.95 ± 0.30 95.03 ± 0.09 95.50 ± 0.04 78.72 ± 0.42 79.55 ± 0.33 33
http://arxiv.org/abs/2302.11835v2
2023-05-10T20:08:14
2023-02-23T07:51:00
Reinforcement Learning for Combining Search Methods in the Calibration of Economic ABMs
Calibrating agent-based models (ABMs) in economics and finance typically involves a derivative-free search in a very large parameter space. In this work, we benchmark a number of search methods in the calibration of a well-known macroeconomic ABM on real data, and further assess the performance of "mixed strategies" made by combining different methods. We find that methods based on random-forest surrogates are particularly efficient, and that combining search methods generally increases performance since the biases of any single method are mitigated. Moving from these observations, we propose a reinforcement learning (RL) scheme to automatically select and combine search methods on-the-fly during a calibration run. The RL agent keeps exploiting a specific method only as long as this keeps performing well, but explores new strategies when the specific method reaches a performance plateau. The resulting RL search scheme outperforms any other method or method combination tested, and does not rely on any prior information or trial and error procedure.
[ "Aldo Glielmo", "Marco Favorito", "Debmallya Chanda", "Domenico Delli Gatti" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11835v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11835v2", "@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.MA", "econ.GN", "q-fin.EC" ]
Reinforcement Learning for Combining Search Methods in the Calibration of Economic ABMs Aldo Glielmo a;*, Marco Favoritoa;*, Debmallya Chandab,c and Domenico Delli Gattib aBanca d'Italia, Italy bUniversità Cattolica del Sacro Cuore, Italy cUniversität Bielefeld, Germany 3 2 0 2 y a M 0 1 ] G L . s c [ 2 v 5 3 8 1 1 . 2 0 3 2 : v i X r a Abstract. Calibrating agent-based models (ABMs) in economics and finance typically involves a derivative-free search in a very large parameter space. In this work, we benchmark a number of search methods in the calibration of a well-known macroeconomic ABM on real data, and further assess the performance of "mixed strate- gies" made by combining different methods. We find that methods based on random-forest surrogates are particularly efficient, and that combining search methods generally increases performance since the biases of any single method are mitigated. Moving from these obser- vations, we propose a reinforcement learning (RL) scheme to auto- matically select and combine search methods on-the-fly during a cal- ibration run. The RL agent keeps exploiting a specific method only as long as this keeps performing well, but explores new strategies when the specific method reaches a performance plateau. The resulting RL search scheme outperforms any other method or method combina- tion tested, and does not rely on any prior information or trial and error procedure. 1 Introduction and literature review The last decades have witnessed a consistent growth of the reach and scope of agent-based models (ABMs) in economics and finance, cer- tainly also as a consequence of continuing improvements in the com- puter hardware and software that form the foundation over which ABMs are designed and used [6]. ABMs have also become mature enough that they have seen adoption and usage within central banks and other financial institutions for specific tasks [63, 52]. A particu- larly noteworthy application domain is the modelling of the housing market, pioneered by Bank of England [8] and later studied by many other central banks [21, 16, 15, 51], and the macroeconomic model proposed in [55] and recently adopted by Bank of Canada [39]. Other successful applications can be found in the modelling of financial stability [12, 23], or of the banking sector [17]. In spite of these success stories, ABMs are still predominantly an object of academic interest, and occupy a minor role in policy making. One fundamental reason behind ABMs' limited adoption is the overwhelming flexibility of such a modelling tool which, if handled incorrectly, can lead to widely different models of the same phenomenon and consequently to a narrow predictive power. ∗ These two authors contributed equally. The views and opinions expressed in this paper are those of the authors and do not necessarily reflect the official policy or position of Banca d'Italia. [email protected] [email protected] Rigorous calibration of ABMs via large amounts of real data is a promising path to address the problem of ABM flexibility by ap- propriately restricting it in data-driven and systematic manner [6]. In fact, ABM calibration has a long history [30], but interest in ABM calibration has grown particularly in recent times of ever- increasing data abundance. Historically, the problem has been ap- proached mostly via the 'method of simulated moments' [34, 31, 36], which involves minimising a measure of distance between summary statistics of real and simulated time series, while more recently, other approaches based on maximum likelihood or Bayesian statistics have been proposed and successfully tested [37, 54, 29]. A common challenge of all calibration frameworks is the need of efficiently searching for optimal parameter combinations in high- dimensional spaces, a problem made particularly arduous by the high computational cost of state-of-the-art ABM simulations. This is why the use of several heuristic search methods has been proposed in the ABM literature. Specifically, in [46], building on the work of [22], the authors propose the use of machine surrogates, specifically in the form of XG-boost regressors, to suggest promising parameter com- binations by interpolating the results of previously computed ABM simulations. In [2], the authors expand on this idea and test the ability of several machine learning surrogate algorithms such as Gaussian processes, random forests and support vector machines, to reproduce ABM simulation data. In [53] the author instead proposes the use of particle swarm samplers [42, 61], as well as the search heuristic of [43]. In this work, we take a different view of the problem and test the performance of existing search strategies, on a common calibra- tion task, and propose simple methods to combine them in mixed strategies to drastically boost calibration performance. We test our methods one of the most well-known and studied macroeconomic ABMs [25, 3, 24], often referred to as the CATS ("Complex Adap- tive Trivial System") model. Our contributions are as follows: • We verify that the macroeconomic ABM considered can be effi- ciently calibrated to reproduce a variety of real time series. • We find that methods based on random forest machine learning surrogates are particularly effective searchers in the highly non- convex and discretely-changing loss function induced by ABMs. • We find that combining together different search methods almost always provides better overall performance, and propose this as a convenient heuristic to apply in the ABM calibration practice. • We introduce a simple reinforcement-learning technique to au- tomatically aggregate any number of search methods in a single mixed strategy, and demonstrate the superior performance of this Pi,t Pt AC c a b d Yi,t Y d i,t (b) (a) Figure 1: The CATS model. (a) An illustration of the agent classes of the model and their interactions. Agent classes are represented in green ovals, interaction types are specified in rectangles, and markets are specified in yellow rectangles. The directions of the arrows indicate the flow of the specific good e.g., consumption-goods are acquired by households from C-firms, while labour is acquired by firms from households. (b) An illustration of the firms' decisions on the price-quantity space. Prices Pi,t and quantities Yi,t of goods are updated following the 4 solid black arrows (representing Equations (10) and (9) of Appendix A), and not the dashed black arrows. The dashed blue line is the minimum price they can charge, corresponding to the average cost (AC) for production. approach with respect to naive aggregation strategies. In Section 2 we overview the CATS model (an extended descrip- tion is provided in Appendix A), in Section 3 we describe the cal- ibration technique considered and the search methods that we em- ploy individually and in combination, in Section 4 we describe our benchmarking experiments and the results obtained, in Section 5 we describe the reinforcement learning scheme we proposed to automat- ically combine existing methods, and demonstrate its performance, in Section 6 we verify that the calibrated model reproduces the target real data and that our findings hold well against changes in the model and in the loss function, in Section 7 we conclude. 2 Model illustration The CATS model consists of four classes of interacting agents: households, final-goods producing firms (C-firms), capital produc- ing firms (K-firms) and banks. Figure 1a illustrates these classes of agents and the markets through which they interact, while Figure 1b illustrates a distinctive feature of the model, i.e., the decision making operated by firms on price and quantity of goods to produce. In the interest of space, and since this work focuses only on the calibration of the model, we do not describe the details of the model here but report them in Appendix A. We also refer the interested reader to [3] for an in-depth exposition. 3 Calibration description The calibration method we consider is composed of three main steps. First, a search method (from now on also called a sampler) suggests a set of parameters to explore, then a number of simulations are per- formed for each selected parameter, and finally a loss function is evaluated to measure the goodness of fit of the simulations with re- spect to the real time series. Iterating these three steps allows finding parameters corresponding to progressively lower loss values, and the parameter corresponding to the lowest loss value can be considered optimal. We follow the method of moments paradigm [31, 20] and use the following loss function (often called distance in the ABM literature) for all calibrations. This takes the form L = 1 D D (cid:88) d=1 gT d Wdgd, (1) where gd is the vector of difference between the real and the sim- ulated moments of the one-dimensional time series d, and D is the total number of dimensions in the multi-dimensional time series con- sidered. Different choices for the weighting matrices Wd have been proposed in the literature [31, 32]. In this work we take the Wd ma- trices to be diagonal matrices with elements (Wd)ii inversely pro- portional to the square of the real i-th moment of the one-dimensional time series d. This choice guarantees that the same weight is given to all moments considered, independently of the different scales or units of measure that the different moments might have. In essence, the loss function written in this way provides an estimate of the rela- tive squared error between real and simulated moments. Since we use a common loss function for all calibrations, the only difference between the calibration runs considered here is the choice of search method. We consider the following five search methods, all of which are implemented in Black-it [9], an open source library for ABM calibration: 1 Halton sampler (H). This sampler suggests points according to the Halton series [38, 44]. The Halton series is a low-discrepancy se- ries providing a quasi-random sampling that guarantees an evenly distributed coverage of the parameter space. As the method is very similar to a purely random search, we use it as a baseline for the more advanced search strategies analysed. Random forest sampler (RF). This sampler is a type of machine learning surrogate sampler. It interpolates the previously computed loss values using a random forest classifier [7], and it then proposes parameters in the vicinity of the lowest values of the interpolated loss surface. We use a random forest classifier with 500 independent estimators ("trees") and use 10 classes chosen as the 10 quantiles of the distribution of evaluated losses. XG-boost sampler (XB). This sampler is a machine learning sur- rogate sampler that interpolates loss values using an XG-Boost re- 1 https://github.com/bancaditalia/black-it Labor market HouseholdsConsumptionmarket Credit marketDepositsBanksCapital-goods market K-firmsC-firms Param. Description ξ χ ρ ̄η μ φ δk γ θ ν tw Memory parameter in consumption Wealth parameter in consumption Quantity adjustment Price adjustment Bank's gross mark-up Bank's leverage Inventories depreciation rate Fraction of investing C-firms Rate of debt reimbursement Memory parameter in investment Tax rate Range 0.5-1 0-0.5 0-1 0-1 1-1.5 0-0.01 0-0.5 0-0.5 0-0.1 0-1 0-0.4 Table 1: Parameter descriptions and their corresponding ranges. gression [18], as proposed in [46]. We use a learning rate of 0.1, a maximum tree depth of 5, and 10 estimators. Gaussian process sampler (GP). This sampler is a machine learn- ing surrogate sampler that interpolates loss values using a Gaussian process regression [22, 57]. We use a Matérn covariance function with ν = 5/2 and with the lengthscale optimised at every iteration via maximum marginal likelihood. Best batch sampler (BB). This sampler is a very essential type of genetic algorithm [61] that takes the parameters corresponding to the current lowest loss values and perturbs them slightly in a purely ran- dom fashion to suggest new parameter values to explore. The random perturbation is specifically obtained by first selecting a random sub- set of dimensions, and then changing the parameter value along those dimensions uniformly but within a short range (plus/minus 0.006 in our case). 4 Benchmarking experiments time series, Experiments preparation. Similarly to [26], we calibrate the model using the following 5 historical representing the US economy from 1948 to 2019, downloaded from the FRED database [50]: total output, personal consumption, gross private in- vestment (all in real terms), the implicit price deflator and the civilian unemployment. To make simulated and observed data comparable, we remove the trend component from the total output, consumption and investment using an HP filter [58]; and we use simulated and observed price deflator to compute de-meaned inflation rates. In Ap- pendix B we provide an example of the resulting time series, and ver- ify that 300 simulation epochs are sufficient to equilibrate the model. In Table 1 we list the 11 parameters considered for calibration and the specified ranges of variation. Experiments performed. Using the four samplers described in the previous section, we build 11 search methods as the 5 samplers taken individually, as well as the 6 combinations of any two non-baseline samplers. For each search method, we perform 3 independent cal- ibration runs. Each calibration run consists of 3600 model evalu- ations, and for each parameter 5 independent simulations are per- formed to reduce the statistical variance of the loss estimate. Each simulated series consists of 800 time-steps generated by running the model for 1100 time steps and discarding the first 300. This makes up a total of almost 600000 simulations and more than 50 days of CPU time, which we were able to compress in less than two days by leveraging parallel computing both within and between calibrations. Results and discussion. Figure 2 reports the cumulative minimum loss achieved by the different sampling strategies as a function of the number of model evaluations performed. The lines and the shaded areas indicate averages and standard errors over the 3 realisations of the experiment. Single samplers are reported in the left graph, while couples of samplers are reported in the middle graph as well as – zoomed– in the right graph. The table at the bottom of the graphs reports the minimum loss achieved by the different methods. Single methods. When samplers are taken in isolation, the random forest sampler (RF) clearly outperforms all other methods, the XG- boost sampler (XB) is the second best performing and the Gaussian process sampler (GP) is substantially worse than the other two ma- chine learning surrogate samplers. The low performance of the GP sampler can be ascribed to the smoothness and regularity assump- tions inherent in Gaussian process regression models, assumptions that are not present in random-forest or XG-boost models, and not suited to describe the roughed and complex loss landscape of ABM calibrations. The best batch sampler (BB) performs very poorly in isolation, and underperforms even in comparison with the baseline H sampler. This is not entirely surprising, since the BB sampler can only propose small perturbations around current loss minima and can thus easily remain stuck in one of the many local minima of the highly non-convex landscape typical of ABMs loss functions. Couples of methods. All methods, not just the poorly performing BB sampler, possess intrinsic sampling biases that in the long run can hinder their performances and make them converge to sub-optimal solutions. We find that combining different methods in mixed strate- gies can strongly mitigate such biases and improve overall perfor- mance. The effect can be observed in the second and third panel of Figure 2, by noticing that couples of methods, with the only excep- tion of the 'XB, GP' combination, always perform on par or better than the best single samplers (RF and XB). Interestingly, the best overall performances are achieved by coupling one machine learning surrogate sampler with the genetic BB sampler. In light of the above discussion, we note that machine learning surrogate samplers and the BB sampler work in very different ways, and hence their combina- tion can strongly diminish the respective sampling biases, while since machine learning surrogates all work in similar ways, their combina- tion does not yield to comparable improvements. The RF, BB and the XB, BB combinations are particularly effective and achieve the lowest loss values. To summarise, our results show that the RF and XB samplers are particularly well suited to efficiently search in the parameter space of ABMs. The success of the RF and XB samplers can be ascribed to the ability to correctly approximate high dimensional and possibly dis- continuous functions with no regularities. However, the performance of the RF and XB samplers can be significantly improved if they are used in combination with the BB sampler. The results presented so far can already offer useful guidance for researchers interested in calibrating medium and large scales ABMs, as they provide an easy recipe to boost calibration efficiency by sim- ple alternation of existing search methods. In the next section, we move a step forward and consider the combination of multiple meth- ods in more general terms, without limiting ourselves to the simplest scenario of a "round-robin" selection. 5 Reinforcement learning experiments The results of the benchmarks presented in Section 4 show that the combination of different types of sampling methods can be beneficial for the calibration process even when we naively alternate the avail- able sampling methods during the course of a calibration. This sug- gests that the investigation of different –and more flexible– schedul- ing policies of search methods could bring to even more efficient calibrations. Method Mean Std. Err. H 12.83 0.73 RF 9.803 0.094 XB 10.24 0.29 GP 11.96 0.51 BB 16.87 0.59 RF,XB RF,GP RF,BB XB,GP XB,BB GP,BB 9.88 0.16 9.861 0.075 9.07 0.24 10.89 0.27 9.27 0.31 9.83 0.26 Figure 2: Top graphs: Loss as a function of the number of model evaluations for the single methods (left), and for couples of methods (middle and right). Bottom table: Means and standard errors of the lowest losses achieved by the different strategies. Note that these results are directly comparable with those shown in Figure 3 and discussed in the next section, as both x and y axes have identical ranges. In particular, it is desirable that the chosen scheduling policy shows some form of adaptivity, i.e. that is able to choose the sam- pling method with more chances to sample a good parameter vector, taking into account the progress of the calibration process. To achieve this goal, we frame the ABM calibration problem as a reinforcement learning (RL) problem where the decision-maker (the agent) has to find a good policy such that it chooses the most promising search method, where "promising" is related to the chances of sampling a parameter that improves the value of the loss. The decision-maker receives feedback for its choice in the form of a reward signal com- puted from the sampled loss function values. This is what makes the scheduling policy adaptive: search methods that more often provide loss improvements are more rewarding from the decision-maker per- spective, and they have more chances of being chosen in the next cal- ibration step; on the other hand, whenever a search method does not show to be rewarding anymore, then the decision-maker can detect this and switch the preference to another search method. Borrow- ing terminology from control theory [27], fixed scheduling policies, such as the naive samplers' combinations explored in the previous section, are open-loop, i.e. they do not change regardless of how a search method is performing; instead, RL-based scheduling policies are closed-loop, because they receive and process the feedback com- ing from the calibration process, possibly reacting to such feedback by changing the preferred sampling method. Specifically, we frame the calibration process as a multi-armed bandit (MAB) problem [41, 65, 4, 10, 35, 48]. This is a clas- learning problem that exemplifies the explo- sic reinforcement ration–exploitation trade-off dilemma [62]. The challenge for the agent is to simultaneously attempt to acquire new knowledge by "ex- ploring" different actions and optimise their decisions based on ex- isting knowledge by "exploiting" actions that have been estimated to be rewarding. We define the different sampling methods as the ac- tions available for the agent, and loss improvements as the reward signals. More formally, we define the reward at time t as the frac- tional improvement achieved over the previous best loss Rt = max{0, Lbest,t−1 − Lt Lbest,t−1 } (2) where Lt is the loss obtained for the simulations sampled at time t, and Lbest,t−1 is the best loss sampled up to time t − 1. Note that Rt is a random variable, because Lt depends on the simulated time series outputted by the ABM, and the chosen parameter vector. As in most of the MAB problems, the goal for the agent is to maximize the cumulative sum of rewards SN = N (cid:88) t=1 Rt, (3) where N is the number of calibration steps. Differently from the usual MAB setting, the reward probability distributions associated to each available sampler are obviously non- stationary, and in fact they change drastically during the course of the calibration. As an example, consider that at end of a calibration all methods –even the best ones– stop providing any improvement in the loss, and hence the reward distributions become progressively more peaked around zero. Non-stationarity is the most general assumption one can make over the behaviour of reward probability distributions in MABs [5] and, in our case, the non-stationarity assumption is re- quired from of the lack of knowledge on both the ABM and the sam- plers' behaviours. The MAB is a very simple framework for RL problems, that are more generally modelled as Markov Decision Processes (MDPs) [62]. However, their simplicity is precisely what makes MAB better suited for our context than other approaches. Indeed, as MAB algorithms focus on finding the best action at each step rather than learning the entire environment, they are much more sample efficient. In the ABM calibration context, simulations are typically very expensive, and consequently the sample efficiency of the learn- ing method is of paramount importance. 01000200030008101214161820lossvaluesinglemethodsHRFXBGPBB0100020003000numberofmodelevaluationscouplesofmethodsRF,XBRF,GPRF,BBXB,GPXB,BBGP,BB0100020003000couplesofmethods(zoom) Sampler \ Context RF XB GP BB H sing. samp. 0.25 0.23 0.21 0.11 0.20 glob. 0.27 0.23 0.17 0.23 0.20 high Lbest,t 1.3 0.61 0.26 0.28 0.24 low Lbest,t 0.052 0.033 0.068 0.18 N.A. Table 2: The estimated Q functions for the different search methods and under different contexts. (sing. samp.) uses only single sample calibrations, (glob.) uses all calibrations, (high Lbest,t) uses all cali- bration but only actions taken when the loss is above the median loss, and (low Lbest,t) uses all calibration but only actions taken when the loss is below the median loss. Results are reported on a scale of 10−3. In the following, we test our MAB framework in two experiments. First, in the offline-learning experiments, we let the agent learn from the previously executed calibrations of Section 4. Then, in the online- learning experiments, we let the agent interact with the environment and optimise its policy on-the-fly during each calibration. Offline experiments. In this section, we train a MAB agent over past calibration histories. More precisely, we take the single methods and couples of methods calibrations of Section 4, and process them as if they were observed by a MAB algorithm. This approach gives us an estimate of the expected gain of each sampler, and therefore information about the effectiveness of the sampler methods on the specific calibration task. In the context of MAB solutions, action-value methods are meth- ods for estimating the values of actions and for using the estimates to make action selection decisions [62]. Let Q(a) be the value of ac- tion a or, in our context, the value of using a specific search method during a calibration. One natural way to estimate such values is by averaging the rewards actually received Q(a) = N (cid:80) t=1 Rt * 1At=a N (cid:80) t=1 1At=a , (4) where At is the action chosen at step t. This approach is often called the sample-average method [62]. The first two columns of Table 2 provide the results of this analy- sis when only the single sampler calibrations are considered ("sing. samp." column) and when all calibrations are considered ("glob." col- umn). Not surprisingly, the RF sampler reaches the highest Q value using both datasets, and the results of the "sing. samp." column repli- cate the hierarchy of samplers of the first panel of Figure 2. Interest- ingly, the value of the BB sampler dramatically increases when the combined dataset is used, confirming the analysis carried forward in the last section on the effectiveness of using the BB sampler in com- bination with a machine learning surrogate sampler. The third and fourth columns of Table 2 offer additional insight. In these columns, we restrict the value function estimation of Eq. (4) to actions performed in one of two different 'states', characterised by the best loss Lbest,t being either above the median ("high Lbest,t" column) or below the median ("low Lbest,t" column). Models of this kind, where the actions of a MAB agent depend on one or more states (in this case high/low loss value) are known as contextual MABs [47, 49]. The results clearly indicate that when the loss is high (typically at the beginning of the calibration) the optimal action is the RF sam- pler, but when the loss is low (typically at the end of the calibration) the optimal action becomes, by far, the BB sampler. The BB sam- pler proposes small perturbations around low-loss parameter com- binations, and hence it can be expected to be particularly effective when the calibration has already reached a good minimum, which can be further explored with this method. The analysis performed so far would suggest the design of a mixed search scheme that exploits a machine learning surrogate sampler (say RF or XB) when the loss is sufficiently high, before switching to the BB sampler towards the end of the calibration. However, this specific strategy would not be generally applicable as, on a new cal- ibration task, one would not know in advance the loss values that can be achieved, and hence could not set any loss threshold on the choice of sampler. In the following section, we show how a MAB agent trained on-the-fly can solve this problem by learning this be- haviour, without any prior information, during the course of a single calibration run. Online experiments. In online learning schemes, the agent inter- acts with the environment through a specific policy π while simul- taneously optimising the policy. We propose the use of one of the most well-known algorithms for online learning of MAB agents in non-stationary environments: the (cid:15)-greedy policy with fixed learning rate [62]. In this framework, at each step t, with large probability 1 − (cid:15) the agent performs a 'greedy' action i.e., it selects the action a with the highest value Q(a), and with small probability (cid:15) it selects a purely random action. We can hence write down the (cid:15)-greedy MAB policy as follows πt = (cid:40) argmaxa Qt(a) with probability 1 − (cid:15) random action with probability (cid:15) . (5) After the selected action a is performed, the agent receives a reward Rt, and updates the value Qt(a) as Qt+1(a) = αRt + (1 − α)Qt(a), (6) where α is referred to as the learning rate. Note that the above update rule can be seen as an exponentially weighted moving average of the rewards obtained through action a. The exponential weighting guar- antees that the current value of the Q function is not substantially affected by rewards received many steps earlier and, in turn, this al- lows the algorithm to adapt to changes of the environment on-the-fly during a calibration. Figure 3 shows the results obtained when using the described scheme with a set of possible actions given by the tree samplers RF, XB and BB. The left and middle panels of the figure can be directly compared with the graphs in Figure 2, as they have identical ranges on both x and y axes. We see that the RL scheme proposed strongly outperforms any other method, or method combination, tested in the previous section. This happens for all values considered for the pa- rameters (cid:15) and α, with the best results –by a very narrow margin– obtained with (cid:15) = α = 0.1. For comparison, the figure also reports –in a black dotted curve– the loss achieved by combining the three samplers RF, XB and BB in a simple ('naive') alternation. Such a simple method alternation, with no use of RL, can be imagined to provide a lower-bound on the performance of the RL scheme, and it is seen to give rise to a significantly slower convergence. The right panel of Figure 3 helps us build intuition around the excellent performance of the RL scheme proposed. It depicts with different colours the different actions (samplers) selected during the 3 RL calibration runs performed with the best parameters (cid:15) = α = 0.1. At the beginning of the calibration (say, the first two columns), the agent explores the different strategies by alternating between the 3 samplers and sometimes exploits a specific sampler with long (cid:15)\ α 0.05 0.1 0.025 8.148 ± 0.089 8.00 ± 0.13 0.05 7.94 ± 0.28 7.77 ± 0.23 0.1 7.93 ± 0.12 7.77 ± 0.17 Figure 3: Top graphs: (left and middle) Loss as a function of the number of model evaluations for the RL scheme with different choices of parameters and for a naive alternation of the samplers, (right) the specific samplers ('actions') selected by the RL scheme with parameters (cid:15) = 0.1 and α = 0.1 during the 900 epochs of a calibration for each of the 3 independent runs, to be read from left to right, from top to bottom, note that each epoch provides 4 model evaluations. Bottom table: Means and standard errors of the lowest losses achieved by the RL scheme. These results can be compared directly with those of Figure 2 as they have identical ranges on both x and the y axes. streaks of identical sampler choices. Towards the end of the cali- bration (say, the last two columns), when the loss is low, the agent instead more decisively exploits the BB sampler, in agreement with the offline experiments described earlier and summarised in Table 2. In conclusion, we find that modelling the calibration process as an online learning MAB problem, with actions being given by different available search methods, allows to detect the most promising search methods during the course of a single calibration. This gives rise to a very efficient sampling scheme, and represents a practical tool to intelligently combine different search methods in the calibration of economic ABMs. The (cid:15)-greedy –fixed learning rate– scheme we use here is a par- ticularly simple and intuitive algorithm for MAB learning, but other options have been suggested in the literature. In Appendix C we ex- plore some of them for a simplified calibration setting, and find no substantial improvements in the calibration efficiency. Furthermore, it is important to note here that the simplicity of the RL scheme pro- posed –merely involving the running average and argmax operations of Eqs. 6 and 5– also entails great computational efficiency which, in turn, implies the absence of any overhead in using the RL scheme over naive method combinations. 6 Validation Calibrated model. We here verify that the calibrated model is able to approximately reproduce the behaviour of the five variables tracked in the real dataset. This can be immediately seen by analysing Figure 4, in which the distribution and the moments of the simulated series with the lowest loss are compared with those computed for the real historical series. In agreement with [26], output, consumption and investment are very well captured by the CATS model, while stronger deviations can be observed in inflation and unemployment rates. Also in agreement with [26] we find that, in general, the CATS model can only partially account for the persistence of the real time series. This is clear from the fact that the simulated series have systematically lower values of virtually all autocorrelations considered (indices 5-9 and 14-18 in the second-row graphs). Different models and loss functions. This study aims to address the challenge of calibrating a standard macroeconomic ABM us- ing a method of moments loss function. While the focus is on the CATS model, we believe our findings to be relevant for other ABMs and loss functions. In Appendix D we present further numerical re- sults supporting this claim. Specifically, we performed calibration experiments in two different settings: the paradigmatic 'Brock and Hommes' asset pricing model [13] with a method of moments loss, and a SIR model on a small-world network topology [60] with a Eu- clidean loss. In agreement with the rest of this work, we find that the RF sampler is the best-performing sampler when methods are used in isolation, that coupling different samplers generally provides better performances, and that our RL-scheme can be successfully used to intelligently combine search methods. However, the alternative cal- ibration tasks presented in the appendix are much simpler than the calibration of the CATS model considered in the rest of this work. For this reason, we do not see a significant performance improve- ment in using RL combinations over simple combinations but, im- portantly, we consistently find the performance of the RL-scheme to be as good as the best samplers or sampler-combinations tested, without requiring any trial and error. 7 Conclusions In this work, we systematically compare the performance of 5 search strategies, taken in isolation and in combination, on a method-of- moments calibration of a standard macroeconomic ABM. Our re- 01000200030008101214161820lossvalueRLscheme(cid:15)=0.05α=0.025(cid:15)=0.05α=0.05(cid:15)=0.05α=0.1(cid:15)=0.1α=0.025(cid:15)=0.1α=0.05(cid:15)=0.1α=0.1RF,XB,BB(naive)0100020003000numberofmodelevaluationsRLscheme(zoom) Figure 4: A comparison between distributions and moments of the real series (blue) and the simulated series of lowest loss (orange). The first row reports density estimates obtained via a kernel density estimator. The second row reports the value of the moments. In the second row, the indices from 1 to 18 on the x-axis represent the following statistics. 1-4): mean, variance, skewness and kurtosis, 5-9): autocorrelations of in- creasing time lags. 10-14): mean, variance, skewness and kurtosis of the differentiated time series, 14-18): autocorrelations of the differentiated time series. sults show that calibration based on machine learning surrogate sam- plers, of the kind proposed in [46] but using a random forest algo- rithm for interpolation, provides superior performance with respect to the other search methods. Our results further show that coupling different search methods together gives rise to search strategies that typically improve over their constituents. The empirical efficacy of random forest search methods and of combining different search methods can be of practical help to researchers interested in cali- brating and using medium and large-scale economic ABMs. How- ever, when combining different search methods a natural issue arises about which methods should be combined, and in which way. We provide a solution to this issue by framing the choice of search methods as a multi-armed bandit problem, and leveraging a well- known reinforcement learning scheme to select the best method on- the-fly during the course of a single calibration. The RL scheme pro- posed outperforms any other method or method combination tested, and thus provides a practical tool for researchers interested in effi- ciently calibrating ABMs. In the future, it would be interesting to deepen the analyses of the present study in two possible lines of research, based on either ex- tensions of the banchmarking experiments of Section 4 or on further investigations into the RL scheme of Section 5. The benchmarking framework could be extended in several dimen- sions. The first is the testing of other standard search methods, such as particle swarm samplers or machine learning samplers based on neural networks. The second is the inclusion in the analysis of other measures of goodness of fit, in addition to the method of moments, such as likelihood measures, Bayesian measures [37, 29], or infor- mation theoretic measures [45]. The third is the addition of other widely known macroeconomic ABMs [24] to the analysis, such as the so-called "K+S" model [28], or the recent large-scale model of [55]. This would allow quantitative benchmarking not only of the cal- ibration strategies, but also of the different models when calibrated on the same data. The final direction would involve appropriately increasing the data on which the ABMs are calibrated and tested, po- tentially with more variables and with more national economies. In essence, while the present work is an important step towards a sys- tematic assessment calibration methods for medium and large-scale economic ABMs, all of the above mentioned directions would surely represent equally important steps towards an increasingly more data- driven ABM development. Given the excellent results achieved, the RL scheme proposed also deserves further specific investigation. For example, one could verify whether the RL search method developed here maintains its high performance also in the more general setting of black-box func- tion optimisation, perhaps in other specific application domains that might have peculiarities similar to the ABM calibration problem. One might also try to extend the simple (yet effective) MAB frame- work introduced here, by providing more 'contextual' information to the agent and hence attempting to represent the ABM calibration problem either as an online contextual-MAB problem, or directly as a partially-observable MDP [40]. Potentially, the problem could even be made suited for a pure MDP formulation by feeding the entire his- tory of the past sampled point to the agent that needs to decide on the next search method, or directly decide the specific points to sample as proposed in [19]. Acknowledgements D.C. acknowledges funding from the European Union's Hori- zon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 956107, "Economic Policy in Complex Environments" (EPOC). We would like to thank Marco Pangallo (CENTAI institute), Herbert Dawid (Bielefeld University), Bence Mér ̋o (Bank of Hungary) and the anonymous reviewers of the ICLR workshop 'AI4ABM' and of the AAAI bridge program 'AI for Financial Institutions', for early feedback on the manuscript. The views and opinions expressed in this paper are those of the authors and do not necessarily reflect the official policy or position of Banca d'Italia. −0.10.00.1densityoutputgap−0.050.000.05inflationrate−0.30.00.3investmentsgap−0.10.00.1consumptiongap0.00.10.2realsimulatedunemploymentrate161218−1012momentsvalue161218161218161218161218 References [1] Robin Allesiardo and Raphaël Féraud, 'Exp3 with drift detection for the switching bandit problem', in 2015 IEEE International Conference on Data Science and Advanced Analytics (DSAA), pp. 1–7. IEEE, (2015). [2] Claudio Angione, Eric Silverman, and Elisabeth Yaneske, 'Using ma- chine learning as a surrogate model for agent-based simulations', Plos one, 17(2), e0263150, (2022). [3] Tiziana Assenza, Domenico Delli Gatti, and Jakob Grazzini, 'Emer- gent dynamics of a macroeconomic agent based model with capital and credit', Journal of Economic Dynamics and Control, 50, 5–28, (2015). Crises and Complexity. [4] Peter Auer, Nicolo Cesa-Bianchi, and Paul Fischer, 'Finite-time analy- sis of the multiarmed bandit problem', Machine learning, 47(2), 235– 256, (2002). [5] Peter Auer, Nicolò Cesa-Bianchi, Yoav Freund, and Robert E. Schapire, 'The nonstochastic multiarmed bandit problem', SIAM J. Comput., 32(1), 48–77, (2002). [6] Robert L Axtell and J Doyne Farmer, 'Agent-based modeling in eco- nomics and finance: Past, present, and future', Journal of Economic Literature, (2022). [7] Lukáš Bajer, Zbynˇek Pitra, and Martin Holeˇna, 'Benchmarking gaus- sian processes and random forests surrogate models on the bbob noise- less testbed', in Proceedings of the Companion Publication of the 2015 Annual Conference on Genetic and Evolutionary Computation, pp. 1143–1150, (2015). [8] Rafa Baptista, J Doyne Farmer, Marc Hinterschweiger, Katie Low, Daniel Tang, and Arzu Uluc, 'Macroprudential policy in an agent-based model of the uk housing market', (2016). [9] Marco Benedetti, Gennaro Catapano, Francesco De Sclavis, Marco Fa- vorito, Aldo Glielmo, Davide Magnanimi, and Antonio Muci, 'Black-it: A ready-to-use and easy-to-extend calibration kit for agent-based mod- els', Journal of Open Source Software, 7(79), 4622, (2022). [10] Donald A Berry and Bert Fristedt, 'Bandit problems: sequential alloca- tion of experiments (monographs on statistics and applied probability)', London: Chapman and Hall, 5(71-87), 7–7, (1985). [11] Lilian Besson. SMPyBandits: an Open-Source Research Framework for Single and Multi-Players Multi-Arms Bandits (MAB) Algorithms in Python. Online at: github.com/SMPyBandits/SMPyBandits, 2018. Code at https://github.com/SMPyBandits/SMPyBandits/, documenta- tion at https://smpybandits.github.io/. [12] Richard Bookstaber, Mark Paddrik, and Brian Tivnan, 'An agent-based model for financial vulnerability', Technical report, Office of Financial Research Working Paper Series, (2014). [13] William A Brock and Cars H Hommes, 'Heterogeneous beliefs and routes to chaos in a simple asset pricing model', Journal of Economic dynamics and Control, 22(8-9), 1235–1274, (1998). [14] Sébastien Bubeck, Nicolo Cesa-Bianchi, et al., 'Regret analysis of stochastic and nonstochastic multi-armed bandit problems', Founda- tions and Trends® in Machine Learning, 5(1), 1–122, (2012). [15] Adrian Carro, 'Could spain be less different? exploring the effects of macroprudential policy on the house price cycle', (2022). [16] Gennaro Catapano, Francesco Franceschi, Michele Loberto, and Valentina Michelangeli, 'Macroprudential policy analysis via an agent based model of the real estate sector', Bank of Italy Temi di Discussione (Working Paper) No, 1338, (2021). [17] Mr Jorge A Chan-Lau, ABBA: An agent-based model of the banking system, International Monetary Fund, 2017. [18] Tianqi Chen and Carlos Guestrin, 'Xgboost: A scalable tree boosting system', in Proceedings of the 22nd acm sigkdd international confer- ence on knowledge discovery and data mining, pp. 785–794, (2016). [19] Yutian Chen, Matthew W Hoffman, Sergio Gómez Colmenarejo, Misha Denil, Timothy P Lillicrap, Matt Botvinick, and Nando Freitas, 'Learn- ing to learn without gradient descent by gradient descent', in Interna- tional Conference on Machine Learning, pp. 748–756. PMLR, (2017). [20] Zhenxi Chen and Thomas Lux, 'Estimation of sentiment effects in fi- nancial markets: A simulated method of moments approach', Compu- tational Economics, 52(3), 711–744, (2018). [21] Graeme Cokayne, 'The effects of macroprudential policies on house price cycles in an agent-based model of the danish housing market', Technical report, Danmarks Nationalbank Working Papers, (2019). [22] Stefano Conti and Anthony O'Hagan, 'Bayesian emulation of com- plex multi-output and dynamic computer models', Journal of statistical planning and inference, 140(3), 640–651, (2010). [23] G Covi, M Montagna, and G Torri, 'On the origins of systemic risk', Technical report, European Central Bank Working Papers, (2020). [24] Herbert Dawid and Domenico Delli Gatti, 'Agent-based macroeco- nomics', Handbook of computational economics, 4, 63–156, (2018). [25] Domenico Delli Gatti, Saul Desiderio, Edoardo Gaffeo, Pasquale Cir- illo, and Mauro Gallegati, Macroeconomics from the Bottom-up, vol- ume 1, Springer Science & Business Media, 2011. [26] Domenico Delli Gatti and Jakob Grazzini, 'Rising to the challenge: Bayesian estimation and forecasting techniques for macroeconomic agent based models', Journal of Economic Behavior & Organization, 178, 875–902, (2020). [27] Richard C.. Dorf and Robert H Bishop, Modern control systems, Pear- son Prentice Hall, 2008. [28] Giovanni Dosi, Giorgio Fagiolo, and Andrea Roventini, 'Schumpeter meeting keynes: A policy-friendly model of endogenous growth and business cycles', Journal of Economic Dynamics and Control, 34(9), 1748–1767, (2010). Joel Dyer, Patrick Cannon, J Doyne Farmer, and Sebastian Schmon, 'Black-box bayesian inference for economic agent-based models', arXiv preprint arXiv:2202.00625, (2022). [29] [30] Giorgio Fagiolo, Alessio Moneta, and Paul Windrum, 'A critical guide to empirical validation of agent-based models in economics: Method- ologies, procedures, and open problems', Computational Economics, 30(3), 195–226, (2007). [31] Reiner Franke, 'Applying the method of simulated moments to estimate a small agent-based asset pricing model', Journal of Empirical Finance, 16(5), 804–815, (2009). [32] Reiner Franke and Frank Westerhoff, 'Structural stochastic volatility in asset pricing dynamics: Estimation and model contest', Journal of Economic Dynamics and Control, 36(8), 1193–1211, (2012). [33] Aurélien Garivier and Olivier Cappé, 'The kl-ucb algorithm for bounded stochastic bandits and beyond', in Proceedings of the 24th annual conference on learning theory, pp. 359–376. JMLR Workshop and Conference Proceedings, (2011). [36] [35] [34] Manfred Gilli and Peter Winker, 'A global optimization heuristic for es- timating agent based models', Computational Statistics & Data Analy- sis, 42(3), 299–312, (2003). John Gittins, Kevin Glazebrook, and Richard Weber, Multi-armed ban- dit allocation indices, John Wiley & Sons, 2011. Jakob Grazzini and Matteo Richiardi, 'Estimation of ergodic agent- based models by simulated minimum distance', Journal of Economic Dynamics and Control, 51, 148–165, (2015). Jakob Grazzini, Matteo G Richiardi, and Mike Tsionas, 'Bayesian es- timation of agent-based models', Journal of Economic Dynamics and Control, 77, 26–47, (2017). John H Halton, 'Algorithm 247: Radical-inverse quasi-random point sequence', Communications of the ACM, 7(12), 701–702, (1964). [39] Cars Hommes, Mario He, Sebastian Poledna, Melissa Siqueira, and Yang Zhang, 'Canvas: A canadian behavioral agent-based model', Technical report, Bank of Canada, (2022). [37] [38] [40] Leslie Pack Kaelbling, Michael L Littman, and Anthony R Cassandra, 'Planning and acting in partially observable stochastic domains', Arti- ficial intelligence, 101(1-2), 99–134, (1998). [41] Michael N Katehakis and Arthur F Veinott Jr, 'The multi-armed bandit problem: decomposition and computation', Mathematics of Operations Research, 12(2), 262–268, (1987). [42] Ali Kaveh, 'Particle swarm optimization', in Advances in Metaheuristic Algorithms for Optimal Design of Structures, 11–43, Springer, (2017). [43] Paul Knysh and Yannis Korkolis, 'Blackbox: A procedure for par- allel optimization of expensive black-box functions', arXiv preprint arXiv:1605.00998, (2016). [44] Ladislav Kocis and William J Whiten, 'Computational investigations of low-discrepancy sequences', ACM Transactions on Mathematical Soft- ware (TOMS), 23(2), 266–294, (1997). [45] Francesco Lamperti, 'An information theoretic criterion for empirical validation of simulation models', Econometrics and Statistics, 5, 83– 106, (2018). [46] Francesco Lamperti, Andrea Roventini, and Amir Sani, 'Agent-based model calibration using machine learning surrogates', Journal of Eco- nomic Dynamics and Control, 90, 366–389, (2018). John Langford and Tong Zhang, 'The epoch-greedy algorithm for con- textual multi-armed bandits', Advances in neural information process- ing systems, 20(1), 96–1, (2007). [47] [48] Tor Lattimore and Csaba Szepesvári, Bandit algorithms, Cambridge University Press, 2020. [49] Lihong Li, Wei Chu, John Langford, and Robert E. Schapire, 'A Contextual-Bandit Approach to Personalized News Article Recommen- dation', in Proceedings of the 19th international conference on World wide web - WWW '10, p. 661, (2010). arXiv:1003.0146 [cs]. [50] Michael W McCracken and Serena Ng, 'Fred-md: A monthly database for macroeconomic research', Journal of Business & Economic Statis- tics, 34(4), 574–589, (2016). [51] Bence Méro, András Borsos, Zsuzsanna Hosszú, Zsolt Oláh, and Niko- lett Vágó, 'A high resolution agent-based model of the hungarian hous- ing market', MNB Working Papers, 7, (2022). [52] Romain Plassard et al., 'Making a breach: The incorporation of agent- based models into the bank of england's toolkit', Technical report, Groupe de REcherche en Droit, Economie, Gestion (GREDEG CNRS), Université . . . , (2020). [53] Donovan Platt, 'A comparison of economic agent-based model cali- bration methods', Journal of Economic Dynamics and Control, 113, 103859, (2020). [54] Donovan Platt, 'Bayesian estimation of economic simulation models using neural networks', Computational Economics, 1–52, (2021). [55] Sebastian Poledna, Michael Gregor Miess, Cars Hommes, and Katrin Rabitsch, 'Economic forecasting with an agent-based model', Euro- pean Economic Review, 151, 104306, (2023). [56] Vishnu Raj and Sheetal Kalyani, 'Taming non-stationary bandits: A bayesian approach', arXiv preprint arXiv:1707.09727, (2017). [57] Carl Edward Rasmussen, Gaussian processes in machine learning, Springer, 2004. [58] Morten O Ravn and Harald Uhlig, 'On adjusting the hodrick-prescott filter for the frequency of observations', Review of economics and statistics, 84(2), 371–376, (2002). [59] Yevgeny Seldin and Aleksandrs Slivkins, 'One practical algorithm for both stochastic and adversarial bandits', in International Conference on Machine Learning, pp. 1287–1295. PMLR, (2014). [60] Marcos Simoes, MM Telo da Gama, and André Nunes, 'Stochastic fluc- tuations in epidemics on networks', Journal of the Royal Society Inter- face, 5(22), 555–566, (2008). [61] Forrest J Stonedahl, Genetic algorithms for the exploration of param- eter spaces in agent-based models, Ph.D. dissertation, Northwestern University, 2011. [62] Richard S Sutton and Andrew G Barto, Reinforcement learning: An introduction, MIT press, 2018. [63] Arthur Turrell, 'Agent-based models: understanding the economy from the bottom up', Bank of England Quarterly Bulletin, Q4, (2016). [64] Duncan J Watts and Steven H Strogatz, 'Collective dynamics of 'small- world'networks', Nature, 393(6684), 440–442, (1998). [65] Richard Weber, 'On the gittins index for multiarmed bandits', The An- nals of Applied Probability, 1024–1033, (1992). A Extended model description The model used for our experiments was originally proposed in [3], and consists of four classes of interacting agents: households, final- goods producing firms (C-firms), capital producing firms (K-firms) and banks. Figure 1a of the main text illustrates these classes of agents and the main mechanisms of interactions among them. Household The household sector consists of workers and capitalists. Each worker supplies one unit of labour inelastically. An unemployed worker randomly selects Ze firms and takes the job at the firm with a vacant position on a first come first serve basis. Each worker receives wage w until laid off. Firms are owned by capitalists and they receive dividends and hold equity at those firms but do not work. When a firm becomes bankrupt, it is replaced by a new entrant firm and a capitalist provides equity. All of the households consume final goods and therefore participate in search and matching in the consumption market. They determine their consumption budget according to Cc,t = Y c,t + χDc,t, (7) where Y c,t is the permanent income of the consumer c at time t, Dc,t is the financial wealth deposited at a bank and χ ∈ (0, 1) is the frac- tion of the bank deposit used for consumption. Unlike the standard macroeconomic models, permanent income is the weighted average of current and past incomes with exponentially decaying weights and follows Y c,t = ξY c,t−1 + (1 − ξ)Yc,t (8) where Yc,t is the actual income of period t and ξ ∈ (0, 1) is the mem- ory parameter of the consumer. Each consumer visits a set of randomly selected firms and sorts their prices from lowest to highest (this gives rise to implicit negative rel- ative price elasticity of demand). If the consumption budget is not exhausted on the first firm, the consumer goes to the second firm in the order. If consumption budget is not exhausted after all buying opportunities, the consumer involuntarily saves the rest. Price and quantity setting One of the distinctive features of the CATS model is its expecta- tion formation of the future demand and price setting of the firms, summarised in Figure 1b of the main text, and detailed in this sec- tion. C-firms and K-firms decide the quantity and price in a similar fashion. The only difference between these two is that C-goods are non-storable, unlike K-goods. Firms start off with the pair (Pi,t, Yi,t) and notice the actual sale Qi,t = min(Yi,t, Y d i,t) as demanded quan- tity can differ from produced quantity. Therefore, firms base their decision on two signals: their relative price and actual sale. Now any decision can be mapped to one of the quadrants of the (Pi,t, Yi,t) space depending on the signal. Hence firm i ∈ {C-firms, K-firms} update their next period desired output as (cid:40) i,t+1 Y ∗ i,t+1 = Yi,t + ρ(−∆i,t) − 1i∈K Y k Yi,t − ρ∆i,t1i∈K Y k if ∆i,t ≤ 0 Pi,t ≥ Pt ('c') if ∆i,t > 0 Pi,t < Pt ('d') (9) where ∆i,t = Yi,t − Y d i,t , ρ ∈ (0, 1) and Y k i,t + ∆i,t) i.e., the inventory dynamics of capital firms. Here δk ∈ (0, 1) is the depreciation parameter of the inventories. i,t+1 = (1 − δk)(Y k i,t+1 in the four possible signal scenarios, depicted in the four quadrants of Figure 1b of the main text, firms can only change either prices or adjust their quantities. Equation (9) describes quadrants 'c' and 'd' of the figure, for the price setting in the other two scenarios (quadrants 'a' and 'b' of the figure) firms follow the updating rule (cid:40) Pi,t+1 = Pi,t(1 + ηi,t+1) Pi,t(1 − ηi,t+1) if ∆i,t ≤ 0 Pi,t < Pt ('a') if ∆i,t > 0 Pi,t ≥ Pt ('b') (10) where ηi,t+1 ∼ U(0, ̄η). So when there is excess demand, firms in- crease their price if it is lower than average, since consumers will be willing to pay a higher price and vice-versa. Firms also have average costs (AC) and can not set the price below the level of AC. C-firms produce taking the output of the K-firms as input and therefore par- ticipate in the K-goods market using search and match exactly like in consumption goods market. Production, investment and employment Means of production in the C-firms are capital Ki,t and labour Ni,t. The production function follows Leontief technology i.e., ˆYi,t = min (αNi,t, κKi,t) where α and κ are labor and capital produc- tivity respectively. If the labour is abundant and capital is not fully utilized then the output becomes Yi,t = ωi,t ˆYi,t = ωi,tκKi,t where ωi,t ∈ (0, 1) is the capacity utilization rate. Therefore the required labor for the production is Ni,t = (κ/α)ωi,tKi,t. Capital is accu- mulated by the firms and follows Ki,t+1 = (1 − δωi,t)Ki,t + Ii,t (11) where only utilized capital depreciates and Ii,t is the investment. Investment opportunities of the firms are infrequent (one in every 1/γ periods where γ is the fraction of firms adjusting capital) and capital is fixed in the short run. This gives rise to sticky and durable capital, as firms take investment decisions in an uncertain environ- ment before the consumption market opens and this anchors deci- sions on average lifetime capital stock. The average lifetime capital stock evolves as K i,t−1 = νK i,t−2 + (1 − ν)ωi,t−1Ki,t−1 (12) where ν ∈ (0, 1). Firms decide on investment in two parts. Firstly, they make up for the worn-out capital keeping in the mind the future opportunities of cap- ital adjustment i.e I r γ K i,t−1. Secondly, they target the desired long-term rate of capital utilization ω. Therefore, the total investment of the firm becomes i,t = δ Ii,t = (cid:19) (cid:18) 1 ω + δ γ K i,t−1 − Ki,t (13) and the capital stock evolves as: Ki,t+1 = (cid:19) (cid:18) 1 ω + δ γ K i,t−1 − δωi,tKi,t (14) If the required capital for the desired level of production is lower than the available capital stock, the firm uses a fraction of the stock. If the required capital is higher than the available capital stock, the firm fully utilizes the stock but the level of production is not reached. Following these rules, we get the required number of workers as In short, when demand is higher than the current period's produc- tion, increase the next period's production and vice-versa. Notice that N ∗ i,t+1 = min (cid:16) κ α K ∗ i,t+1, Ki,t+1 (cid:17) , κ α (15) i,t+1 is the required capital for desired production level and where K ∗ Ki,t+1 is the available capital stock. After deciding on the required number of workers to match the de- sired level of production, firms post vacancies as follows The bank then estimates a logistic regression of the individual bankruptcy probability φf for each firm as φf = f (λf ). Consider- ing that the firms are paying θ fraction of their loan back each period, the bank sets the interest rates of loan for each bank as νi,t+1 = max (cid:0)N ∗ i,t+1 − Ni,t, 0(cid:1) . (16) K-firms produce only using labour input from the workers and use linear technology Yj,t = αNj,t. Hence labour requirement of the firm is Nj,t/α. To make up for the required workers, firms post va- cancies and compete with C-firms in the labour market for hiring. Credits and banks Each firm takes loans from the bank to fund its production when internal funding is in short supply. For C-firms there are typically two costs, the wage of the workers and the funding for investment whereas K-firms only acquire the cost of wage. Hence the required loans by the firms are Fi,t = max (wNi,t − 1i∈C−f irmsPk,t−1Ii,tDi,t−1, 0) (17) There is only one bank in the economy. It accepts all deposits from agents and does not provide deposit interests. Bank evaluates the fi- nancial soundness of the firms using the entire past data of the firm's balance sheet. For each firm f , it computes the following leverage ratio λf,t = Lf,t−1 + Ff,t Ef,t−1 + Lf,t−1 + Ff,t . (18) rf,t = μ (cid:26) 1 + r θ Φ(θ, Tf,t) (cid:27) − θ , (19) where Tf,t = 1/φf,t i.e., number of periods after which firm de- faults. Optimization of the lending is done by considering a maxi- mum admissible loss for the bank as a fraction of the bank's equity. If ∆Lf,t is the new extended loan to the firm then it follows that φf (∆Lf,t + Lf,t−1) ≤ ζEb t , and the maximum admissible loan for a firm f becomes F f,t = ζEb t − φf Lf,t−1 φf . (20) (21) In summary, if the loan requirement of the firm is less than the maximum admissible loan for that firm, the firm gets the full fund- ing. On the other hand, if the loan requirement is higher than the maximum admissible loan, the bank lends only up to the limit and the firm has to cut down its hiring, production etc. Figure 5: A typical simulation trace from the CATS model. The dashed vertical lines mark 300 simulation periods. B A visual evaluation of length of transient effects Figure 5 we report the results of an ABM run for a typical model evaluation with arbitrary initial conditions. We use 300 epochs as the initial burn-in period to equilibrate the model. This differs from choice made in the original paper [3], where 1000 epochs are used to this aim, but we believe our choice to be fully justified considering that 300 epochs appeared more than sufficient for a complete equili- bration of the model. As a practical illustration of this claim, Figure 5 well illustrates that transient effects are substantial only within the first 100 epochs, and are typically absent already after 200 epochs. 03008000gdp gap03008000inflation0300800periods0investment gap03008000consumption gap03008000unemployment (a) (b) (c) (d) Figure 6: Tests of the RL calibration framework with different MAB learning algorithms. (a)-(c) Loss values as a function of the number of model evaluations for different sampling strategies. Lines and shaded areas represent means and standard errors over 5 repetitions of each calibration run. (a) Baseline calibrations using the 4 different samplers individually. (b) RL calibrations using 6 different MAB learning algorithms. (c) RL calibrations using the fixed-α, (cid:15)-greedy learning algorithm proposed in the main text. (d) The specific 'actions' selected by the fixed-α, (cid:15)-greedy RL scheme with α = (cid:15) = 0.1 in the 5 calibration repetitions. C A comparison of multiple MAB learning algorithms In this appendix, we test the performance of a number of variations of the RL framework introduced in the main text obtained by coupling it with different learning algorithms for multi-armed bandits (MABs). For reasons of computational cost, the comparison is performed in a simplified setting, and not on the calibration of the economic ABM analysed in the rest of this work. The experimental setting consists of a method of moments calibration of a 5-state Markov process defined by a diagonal transition matrix, with 5 free parameters to calibrate. The target time series is generated by simulating the model for 5000 steps with diagonal transition parameters (0.1, 0.2, 0.3, 0.4, 0.5). We define the action space of the MAB as the set of the 4 samplers (RF,XB,GP,BB). Figure 6a shows the baseline calibrations obtained using the 4 samplers individually, and we see that also for this model the RF sampler outperforms all other search methods. Figure 6b shows sev- eral RL calibrations obtained by couopling the RL framework de- scribed in the main text with the following MAB learning algo- rithms, all available through the SMPyBandits package [11]: 'kl- UCB' [33], 'Exp3' [14], 'Exp3.R' [1] and 'Exp3++' [59], 'Thomp- son' and 'Discounted Thompson' sampling [56]. All of the learn- ing schemes achieve satisfactory results by outperforming all sub- optimal samplers, and performing on par with the RF sampler, but without any prior information about the best sampler at the agent's disposal. Figure 6c shows the RL calibration obtained using the (cid:15)- greedy scheme proposed and tested also in the main text, for different choices of (cid:15) and α. The (cid:15)-greedy scheme is also seen to outperform all single samplers of Figure 6a except the optimal one, and its per- formance is found to be very similar to those of the other algorithms tested in Figure 6c. Figure 6d depicts the actions selected during the 5 runs pertaining to the (cid:15)-greedy calibration with (cid:15) = α = 0.1. Some patterns are clearly visible, such as the preferential choice of the BB sampler and the RF sampler, particularly in the first half of the calibration where the loss decreases rapidly before reaching a plateau. 050100150200number of model evaluations0.00.10.20.30.4loss valueRFXBGPBB050100150200number of model evaluations0.00.10.20.30.4loss valueklUCBExp3RExp3PlusPlusExp3ThompsonDiscountedThompson050100150200number of model evaluations0.00.10.20.30.4loss value=0.05 =0.05=0.05 =0.1=0.05 =0.2=0.1 =0.05=0.1 =0.1=0.1 =0.2=0.2 =0.05=0.2 =0.1=0.2 =0.2 Figure 7: Loss as a function of the number of model evaluations for single methods, simple method combinations, and RL method combinations, for the BH4 model [13] with a method of moments loss (1st row) and for the SIR model with a Euclidean loss (2nd row). D A check of robustness to changes in the model ple squared difference between the two series. and in the loss function Here, we check the robustness of our results by performing further numerical experiments on two different models, and in one case using a different loss function. As a first model, we chose the as- set pricing model of [13], a paradigmatic model within the ABM community often used to test novel calibration or estimation algo- rithms [53, 29]. The calibration was performed on synthetic data generated with the following set of parameters: r = 0.1, β = 1.0, σ = 1.0, [g1, g2, g3, g4] = [0.0, 0.9, 0.9, 1.01], and [b1, b2, b3, b4] = [0.0, 0.2, −0.2, 0.0]. The loss function was the same used for the calibration of the CATS model i.e., a method-of-moments loss. As a second model, we chose a SIR model on a Watts-Strogatz net- work [60, 64], fitted on weakly Italian Covid-19 epidemiological data. For the second model, we used a different loss function: a sim- The first and second rows of plots in Figure 7 report the results of these new numerical experiments, for the 'Brock and Hommes' model with 4 agent types (BH4) and for the SIR model, respectively. We observe that similar considerations can be drawn for such mod- els to the ones already expressed for the CATS model. Specifically, we see that when methods are used in isolation, the best-performing ones are the RFand the XBwhile GPand BBstrongly underperform for the reasons discussed in the main text. We also notice a similar general improvement when coupling search methods, with the best- performing method combinations being RFand BBcombined with the BBsampler. Both models are, however, much simpler to calibrate than the CATS model and. For such simple calibration tasks, we do not see large improvements in using RL combinations over simple combinations but, importantly, the RL performance is as good as the best combinations without requiring trial and error. 02000024681012lossvalue(BH4)singlemethodsHRFXBGPBB02000combinationsofmethodsRF,XBRF,GPRF,BBXB,GPXB,BBGP,BBRF,XB,BB02000RLcombinations(cid:15)=0.05α=0.025(cid:15)=0.05α=0.05(cid:15)=0.05α=0.1(cid:15)=0.1α=0.025(cid:15)=0.1α=0.05(cid:15)=0.1α=0.1010000255075100125150lossvalue(SIR)singlemethodsHRFXBGPBB01000combinationsofmethodsRF,XBRF,GPRF,BBXB,GPXB,BBGP,BBRF,XB,BB01000RLcombinations(cid:15)=0.05α=0.025(cid:15)=0.05α=0.05(cid:15)=0.05α=0.1(cid:15)=0.1α=0.025(cid:15)=0.1α=0.05(cid:15)=0.1α=0.1numberofsimulations E Data and code availability In the interest of reproducibility, the code, the data and the scripts used to generate the key results and the main graphs of this work are available to download as supplementary material of the paper. Fur- thermore, an easy-to-use implementation of the reinforcement learn- ing scheduler proposed in this work has been released in open source within the Black-it package [9], a Jupyter notebook to experiment with it is available at https://github.com/bancaditalia/black-it/blob/ main/examples/RL_to_combine_search_methods.ipynb.
http://arxiv.org/abs/2302.11834v2
2023-06-08T09:48:45
2023-02-23T07:46:24
Generalization of Auto-Regressive Hidden Markov Models to Non-Linear Dynamics and Unit Quaternion Observation Space
Latent variable models are widely used to perform unsupervised segmentation of time series in different context such as robotics, speech recognition, and economics. One of the most widely used latent variable model is the Auto-Regressive Hidden Markov Model (ARHMM), which combines a latent mode governed by a Markov chain dynamics with a linear Auto-Regressive dynamics of the observed state. In this work, we propose two generalizations of the ARHMM. First, we propose a more general AR dynamics in Cartesian space, described as a linear combination of non-linear basis functions. Second, we propose a linear dynamics in unit quaternion space, in order to properly describe orientations. These extensions allow to describe more complex dynamics of the observed state. Although this extension is proposed for the ARHMM, it can be easily extended to other latent variable models with AR dynamics in the observed space, such as Auto-Regressive Hidden semi-Markov Models.
[ "Michele Ginesi", "Paolo Fiorini" ]
10.1109/LRA.2023.3301218
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1109/LRA.2023.3301218", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.11834v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11834v2", "@rel": "related", "@type": "application/pdf" } ]
[ "IEEE Robotics and Automation Letters ( Volume: 8, Issue: 9,\n September 2023)" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.RO", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.RO", "cs.LG" ]
Generalization of Auto-Regressive Hidden Markov Models to Non-Linear Dynamics and Unit Quaternion Observation Space Michele Ginesi1 and Paolo Fiorini2 3 2 0 2 n u J 8 ] O R . s c [ 2 v 4 3 8 1 1 . 2 0 3 2 : v i X r a Abstract- Latent variable models are widely used to perform unsupervised segmentation of time series in different context such as robotics, speech recognition, and economics. One of the most widely used latent variable model is the Auto-Regressive Hidden Markov Model (ARHMM), which combines a latent mode governed by a Markov chain dynamics with a linear Auto-Regressive dynamics of the observed state. In this work, we propose two generalizations of the ARHMM. First, we propose a more general AR dynamics in Cartesian space, described as a linear combination of non-linear basis functions. Second, we propose a linear dynamics in unit quaternion space, in order to properly describe orientations. These extensions allow to describe more complex dynamics of the observed state. Although this extension is proposed for the ARHMM, it can be easily extended to other latent variable models with AR dynamics in the observed space, such as Auto-Regressive Hidden semi-Markov Models. I. INTRODUCTION Hidden Markov Models (HMMs) [1], [2], [3] are a type of graphical model widely used in speech recognition [4], [5], hand-writing recognition [6], natural language modeling [7], and to segment kinematics in the context of Minimally Invasive Surgery [8], [9], [10]. The model consists of a Markov chain governing the evolution of an hidden (or latent) mode. At each time t, the hidden mode zt emits an observation yt with a certain probability distribution p(yt|zt). A well-known generalization of HMMs is the Auto- Regressive HMM (ARHMM) [11], [4], [12], [13], [14], [15], [16], in which the observation yt at time t is given by the hidden mode zt and the previous observed state yt−1 via a linear Auto-Regressive dynamic. This means that the current latent mode zt does not emit an observation, but instead it describes the (linear) vector field governing the evolution of the observed state. This type of model, and its generalizations, have been successfully used to temporally segment robot kinematics. in [15] a state-based transition ARHMM For instance, (STARHMM) was developed. This model adds a conditional dependence between the current observed state and the next hidden mode. Similarly, in [17] this model was improved to learn skills by creating a primitive library. *This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme, ARS (Autonomous Robotic Surgery) project, grant agreement No. 742671. 1 Department of Computer Science, University of Verona, Strada le Grazie 15, Verona, Italy [email protected] 2 Department of Computer Science, University of Verona, Strada le Grazie 15, Verona, Italy [email protected] In the literature, most of the improvements to ARHMM have been implemented in the definition of the latent or observation space (e.g. by adding hidden variables [18], [17]), by adding conditional probabilities relation between modes (e.g. by making the next hidden mode dependent on the current observed state [15], [17]), or by increasing the number of previous states taken into account in the definition of the AR dynamics. That is, most of the generalizations of the ARHMM have focused on the topology of the graphical model. On the other hand, at the best of the authors' knowl- edge, no generalization of the definition of dynamics of the observed state exists in the literature. For this reason, in this work, we propose to generalize the ARHMM to allow Non-Linear AR dynamics in Cartesian space and linear dynamics in Unit Quaternion space. The main advantage of our proposed improvement lies in the fact that it can be straightforwardly adapted to work in combination with the modification of the topology of the latent variable model mentioned above. The paper is structured as follows. In Section II we present the theory behind ARHMM, recalling the Expectation Max- imization (EM) algorithm used to infer the set of model parameters from data. In Section III we present our proposed modification to the ARHMM model and the modification to the EM algorithm to infer the model's parameter. In Sec- tion IV we propose the experiments validating our proposed approach. In Section V we present the conclusion of the work and possible future extensions. II. AUTO REGRESSIVE HIDDEN MARKOV MODELS In this section, we provide a formal definition of the Auto- Regressive Hidden Markov Model. H (cid:9)(cid:9) . In details, an ARHMM is a model defined as follows: . = (cid:8)S, Y, Θ = (cid:8)π, T, {As, bs, Σs}s∈S S = {1, 2, . . . , S} is the set of hidden modes, and the mode at time t ∈ 1, 2, . . . , T is denoted by zt. Y = Rd is the observation space, and the observed state at time t is denoted by yt ∈ Y. Θ is the set of model parameters. Vector π = [πi]i∈S defines the initial mode probability such that πi = Pr(z1 = i), for i ∈ S. Matrix T = [ti j]j∈S i∈S is the transition probabilities matrix between hidden modes such that ti j = Pr(zt+1 = j|zt = i). The emissions are modeled by the following Auto-Regressive (AR) dynamics with Gaussian white noise: yt|zt = s, yt−1 ∼ N (yt|Asyt−1 + bs, Σs) . (1) z1 y1 y1 y0 y0 zt−1 yt−1 yt−1 zt yt yt zt+1 yt+1 yt+1 zT yT yT Fig. 1: Graphical representation of ARHMM. The graphical representation of the model is given in Figure 1. In this representation, a grey dot represents an observed variable, while a white dot denotes a hidden vari- able. An arrow between two nodes a and b means that the probability of b depends on the value of a. For a refresh on graphical model representation, we suggest [19]. Two main algorithms characterize the ARHMM (and the latent-variable models in general): the Expectation Maxi- mization (EM) algorithm and the Viterbi algorithm. The former is used to infer the set of parameters Θ by maximizing the likelihood of the observed data p(Y|Θ). The latter, instead, allows extracting the sequence of latent mode ˆz that maximize the joint probability distribution p(Y, z|Θ) for a given observed sequence Y. In short, the EM algorithm allows to learn the model parameters from the data, while the Viterbi algorithm allows to segment an observed sequence once the model parameters are known. A. EM Algorithm in brief The EM algorithm consists of an iterative procedure that, at each iteration, maximizes, w.r.t. Θ, the auxiliary function Q(Θ, Θold) . = Qinit(Θ, Θold) + Qtrans(Θ, Θold) + Qout(Θ, Θold) (2) where Θold is the current guess of the set of parameters, and the three terms of the sum are defined as log p(z1|Θ)p(z1|Y, Θold), Qinit(Θ, Θold) (cid:88) . = (3a) Qtrans(Θ, Θold) z1∈S T −1 (cid:88) . = (cid:88) t=1 zt,zt+1∈S log p(zt+1|zt, Θ)p(zt, zt+1|Y, Θold), (3b) Qout(Θ, Θold) . = T −1 (cid:88) t=0 zt+1∈S (cid:88) log p(yt+1|zt+1, yt, Θ)p(zt+1|Y, Θold). that (3c) During the Expectation Step, the quantities that depend on θold, is p(zt, zt+1|Y, Θold) and p(zt+1|Y, Θold), are computed using the forward-backward algorithm [19]. During the Maximization Step, the set of parameters Θ that maximizes Qinit, Qtrans and Qout is computed. These two steps are repeated until convergence. Convergence is reached when the changes in the log-likelihood log p(Y, z) is below a given tolerance. III. GENERALIZATION OF ARHMMS TO DIFFERENT DYNAMICS In this section, we present our proposed generalizations of the AR dynamic. In particular, in Section III-A we discuss our proposed non-linear dynamics in Cartesian space; while in Section III-B we present our proposed linear dynamics in Unit Quaternion space. A. Cartesian Non-Linear ARHMM When generalizing the AR dynamics in Cartesian space, we aim at modifying the linear AR dynamics shown in : Rd → Rd for (1) with a more general dynamic fs each hidden mode s ∈ S. To do so, we will use a basis functions-based formulation so that the non-linear function fs is written as a linear combination of non-linear basis functions (cid:8)φn : Rd → R(cid:9) n=0,1,...,N : fs(yt)|i = f (s) i (yt) = N (cid:88) j=0 ω(s) i j φj(yt), (4) where ω(s) is the set of weights that describes the vector i j . = [ω(s) i j ]j=0,1,...,N field. By defining the weight matrix Ωs i=1,2,...,d . and the non-linear map φ(y) = [φj(y)]j=0,1,...,N , we have that formulation (4) can be written in matrix-vector notation as fs(yt) = Ωsφ(yt). (5) Thus, (1) now reads yt|zt = s, yt−1 ∼ N (yt|Ωsφ (yt−1) , Σs) . (6) We remark that, since only the formulation of the AR dynamics changes from the classical ARHMM to the non- linear case, the graphical model representation is the same as in Figure 1. During the Expectation step, the quantities that depend on the current guess of the set Θold of parameters have to be computed. Since the conditional independence properties of the model depend exclusively on its graphical representation [19], we have that the E-step for the Non-Linear ARHMM (NL-ARHMM) is identical to the linear case. The only difference is that the emission probability p(yt|zt, yt−1) is given by formula (6) instead of (1). Similarly, in the Maximization step, maximization of (3a) and (3b) is achieved in the same way as the linear ARHMM case, since there is no dependence on the emission probability. Thus, the only difference in the EM algorithm between a linear ARHMM and the NL-ARHMM lies in the maximization of quantity Qout. Proposition 3.1: Denote by γ(t) the quantity p(zt|Y, Θ) . = Pr(zt = s|Y, Θold). Then, maximization of so that γs(t) Qout(Θ, Θold) in (3c) is achieved by setting Ωs = (cid:32)T −1 (cid:88) t=0 γs(t + 1)yt+1φ(yt)⊺ (cid:33)(cid:32)T −1 (cid:88) t=0 γs(t + 1)φ(yt)φ(yt)⊺ (cid:33)−1 (7a) and (cid:80)T −1 Σs = t=0 γs(t + 1)e(s) t=0 γs(t + 1) where the vector e(s) t ∈ Rd is defined as e(s) t = yt+1 − Ωsφ(yt). (cid:80)T t e(s) t ⊺ ; (7b) Proof: We aim at maximizing (by dropping Θ for notation simplicity) the quantity (cid:101)Q(Θ, Θold) = T −1 (cid:88) S (cid:88) t=0 s=1 γs(t + 1) log p(yt+1|zt+1 = s, yt). To maximize this quantity, we can maximize over each hidden mode s ∈ S independently: Ω⋆ s, Σ⋆ s = arg max Ωs,Σs T −1 (cid:88) t=0 γs(t + 1) log p(yt+1|zt+1 = s, yt). Since the emission probability is given by (6), the function to maximize reads (cid:98)Qout = − 1 2 T −1 (cid:88) t=0 γs(t + 1) log |Σs| T −1 (cid:88) γs(t + 1) (yt+1 − Ωsφ(yt)) ⊺ Σ−1 s (yt+1 − Ωsφ(yt)) . − 1 2 t=0 (8) We start by discussing the maximization over the weight matrix Ωs. The gradient of (cid:98)Qout w.r.t. Ωs is ∇Ωs (cid:98)Q = Σ−1 s (cid:32) T −1 (cid:88) t=0 γs(t + 1)yt+1φ(y)⊺ − Ωs T −1 (cid:88) t=0 γs(t + 1)φ(yt)φ(yt)⊺ (cid:33) . By setting it to zero, we get formula (7a). We now discuss the maximization over the weight matrix Σs. The gradient of (cid:98)Qout w.r.t. Σs is ∇Σ−1 s (cid:98)Q = 1 2 Σs t=0 T −1 (cid:88) γs(t + 1) − T −1 (cid:88) γs(t + 1) 1 2 t=0 ⊺ (yt+1 − Ωsφ(yt)) (yt+1 − Ωsφ(yt)) , which, by setting it to zero, gives formula (7b). We remark that the matrix Ωs in (7b) is the "old" guess, and not that given by the update formula (7a). Thus, when implementing the EM-algorithm, the update of the covari- ance matrices Σs should be performed before the update of the weight matrices Ωs. 1) Example of Basis Functions: In this section, we present some examples of basis functions. The first set shows how to interpret the classical, linear ARHMM as a particular case of NL-ARHMM. Indeed, by . ⊺ defining φ(lin)(y) = [1, y1, y2, . . . , yd] , we have that the resulting weight matrix is a block matrix with the offset b and the linear map A in (1) as Ω = [b, A] . The second well known set of basis functions is the family of Gaussian Radial Basis Functions (GRBFs). Given a set {μi}i=1,2,...,N of centers and a set {Σi}i=1,2,...,N of covariance matrices, we define the basis functions as φ(grbf) 0 φ(grbf) i (y) (y) . = 1, . = exp (cid:0)−(y − μi)Σ−1 i (y − μi)(cid:1) , i = 1, . . . , N. Usually, the covariance matrices are set to be a multiple of the identity matrix Σi = ςiIdd. The main drawback of this family of basis functions lies in the fact that, even for small values of the dimension d of the observed space, a high number of basis functions is needed to 'cover' the space. Indeed, this family of basis functions is usually adopted when learning functions in bounded domains (e.g. in Dynamic Movement Primitives, where the time domain is fixed [20]). For this reason, we suggest to use this set of basis functions when dealing with bounded observation spaces, such as d−dimensional cubes [0, 1]d. Finally, a third family of basis functions is the set of polynomial functions up to a degree k: φ(Pk)(y) . = col (cid:32)(cid:40) d (cid:89) i=1 yci i : ci ∈ N, (cid:41)(cid:33) ci ≤ k . (9) d (cid:88) i=1 For instance, assume that d = 2 (y ∈ Y = R2) and k = 3. Then the basis functions are φ(P3)(y) = (cid:2)1, y1, y2, y2 1, y1y2, y2 1y2, y1y2 2, y3 1, y2 2, y3 2 (cid:3)⊺ . As we will show in Section IV-B, this type of basis functions is particularly useful in low-dimension spaces, where linear dynamics are not able to describe complex evolutions of the observed state. On the other hand, they are less useful in higher dimensional spaces for two main reasons: firstly, lin- ear dynamics are able to describe more complex evolutions; secondly, non-linearity in higher dimensional spaces require a huge amount of parameters (i.e. the number of columns of Ω increases) risking over-fitting and numerical inefficiency. B. Unit-Quaternion Linear ARHMM Orientations can be modeled in different ways. There are two preferred spaces to describe orientations: the space SO(3) of orthogonal 3 × 3 matrices, and the space S3 of unit quaternions. Both representations are singularity-free. However, unit quaternions are preferred since they require instead of the nine only four variable to be described, parameters of 3 × 3 matrices. The main difficulty when dealing with dynamics in S3 lies in the fact that the resulting quaternion must still be of unitary norm. To solve this problem, we take advantage of two properties of quaternions. The first is the fact that the exponential of a quaternion with null real part always results in a quaternion of unit norm: ∥Exp(0 + ai + bj + ck)∥ = ∀a, b, c, ∈ R. The second is the fact that the norm of the 1, product between two quaternion p and q is the product of the norms: ∥p ∗ q∥ = ∥p∥ ∥q∥ . Thus, we propose to describe a dynamics in S3 by 3 parameters a, b, c ∈ R such that qt+1 = Exp(ai + bj + ck) ∗ qt. From here, we will denote as 'vec' the function that maps a quaternion to its vector formulation: vec : S3 → R4, q = qr + qii + qj j + qkk (cid:55)→ q = [qr, qi, qj , qk]⊺. With this notation, we have that in this model the probability of the next observation reads qt|zt = s, qt−1 ∼ N (cid:0)vec(qt)|vec (Exp(asi + bsj + csk) ∗ qt−1) , Σs (cid:1) (10) As in the case of Cartesian Non-Linear ARHMM, we need only to explain how to maximize the emission probability. Therefore, in the Maximization step we have to maximize the quantity Qout in (3c) where the next-state probability is given by (10). Differently from what we showed in Proposition 3.1, there is not a closed form solution to the maximization . = Pr(zt = s|Y, Θold) problem. Indeed, by defining γs(t) we have that the function to maximize reads, similarly to (8): (cid:98)Qout = − 1 2 T −1 (cid:88) t=0 γs(t + 1) log |Σs| T −1 (cid:88) γs(t + 1)vec(qt+1 − μ(s) t+1)⊺Σ−1vec(qt+1 − μ(s) t+1) − 1 2 t=0 (11) t+1 is the expected orientation at time t + 1 for where μ(s) hidden mode s: μ(s) t+1 . = Exp(asi + bsj + csk) ∗ qt. Similarly to Proposition 3.1, maximization of achieved by setting (11) is Σs = (cid:80)T −1 t=0 γs(t + 1)e(s) t+1 * e(s) t+1 ⊺ (cid:80)T −1 t=0 γs(t + 1) where e(s) t+1 is the difference between the actual orientation and the predicted one at time t + 1 assuming that the hidden mode s is active: e(s) t+1 . = vec(qt+1 − μ(s) t+1). On the other hand, maximization over the dynamics pa- rameters can be formulated as (a⋆ s ) = arg max s , c⋆ s , b⋆ (as,bs,cs) (cid:32) − T −1 (cid:88) t=0 γs(t + 1) ∥vec (qt+1 − Exp (asi + bsj + csk) ∗ qt)∥2 Σ−1 (cid:33) where ∥*∥A is the semi-norm induced by a Symmetric x⊺Ax. Semi-Positive Definite (SPD) matrix A: ∥x∥A Unlikely the Cartesian formulation, this problem cannot be solved in closed form. Therefore, to solve the Maximization step, we rewrite the maximization problem as an equivalent minimization problem . = √ (a⋆ s , b⋆ s , c⋆ s ) = arg min (as,bs,cs) (cid:32)T −1 (cid:88) t=0 γs(t + 1) ∥vec (qt+1 − Exp (asi + bsj + csk) ∗ qt)∥2 Σ−1 Fig. 2: Results for the validation test presented in Section IV- A. The top figure shows the components of the trajectory, the second plot shows the "true" segmentation (the first mode is represented in purple, while the second mode is represented in yellow), the third plot shows the segmentation obtained with the learned ARHMM, and the fourth plot shows the segmentation obtained with the learned NL-ARHMM. Remark 3.2: We do not discuss the generalization of the Viterbi algorithm [21] since its most general formulation works with any latent-mode model with Markov dynamic, independently of the dynamics of the observed state. IV. EXPERIMENTS In this section, we will compare the results obtained with the NL-ARHMM against the linear ARHMM, showing that our proposed approach results in higher segmentation scores. A. Validation Test At first, we show that the EM algorithm for the NL- ARHMM allows learning the parameters of the model. To do so, we define a NL-ARHMM with fixed parameters and use it to generate data samples. In our test, we set both the number of hidden modes and the dimension of the continuous state to 2: S = 2, d = 2. The initial mode distribution is set to π = [0.5, 0.5]⊺ and the transition probability matrix is (cid:20)0.95 0.05 0.05 0.95 T = (cid:21) . The non-linear dynamics is written as follows. We start by defining the vector field (cid:33) (cid:21)(cid:19) (cid:18)(cid:20)y1 y2 f = (cid:20)y1 y2 3 + y2 3 + y1 2y1 − y1 − y2 2y2 + y1 − y2 (cid:21) . and solve it via any minimization algorithm (e.g. gradient descent). The implementation (in Python 3.10) of our proposed generalizations is available at https://github.com/ mginesi/nl_arhmm. Remark 3.1: The use of our proposed generalizations can be combined with other extensions to the ARHMM model. For instance, in the EM algorithm of Auto-Regressive Hidden semi Markov Models, the maximization formula for the emission probabilities can be easily extended in a similar fashion to what we proposed here. Then the dynamics of the two hidden modes are obtained using the Euler method with time step δt = 0.05 for the dynamics f and its opposite −f , with Gaussian noise with standard deviation ς = 5e − 03: yt+1|zt+1 = 1, yt ∼ N (yt+1|yt + δtf (yt), ςId2), yt+1|zt+1 = 2, yt ∼ N (yt+1|yt − δtf (yt), ςId2). We use this NL-ARHMM to generate fifty samples with T = 100 steps each. Next, we initialize both a NL-ARHMM (with polynomial basis functions of degree k = 2) and a linear ARHMM, and apply the EM algorithm to learn the (a) d = 1, (b) d = 2 (c) d = 3 Fig. 3: Comparison between linear and polynomial ARHMM. In all three figures the first plot shows the components yi of the observed dynamics, the second plot shows the true segmentation, the third, fourth, and fifth plots shows the segmentations obtained by, respectively, the linear, quadratic, and cubic formulations of the ARHMM (i.e. k = 1, 2, 3 in (9)). model parameters. Finally, we use the Viterbi algorithm to segment a new trajectory generated from the "true" NL- ARHMM. Before applying the EM algorithm we standardize the dataset. That is, we translate it and multiply by a constant to have null mean and unit variance. Figure 2 shows one result for these tests. As can be observed, the NL-ARHMM is able to properly segment the trajectory, being able to capture more complex dynamics. On the other hand, the linear ARHMM results in a poorer segmentation. B. Comparison of Different Degrees Polynomial Functions In this Section, we propose some tests to show that Non- Linear basis functions are more effective when the obser- vation space Y is low dimensional. On the other hand, for high-dimensional observation space the difference between the two is less noticeable. To show this aspect we simulate three different ARHMM with non linear dynamics. Each of them has two hidden modes but differs in the dimension d of the observation space; d = 1, 2, 3. To present a fair comparison, all the six dynamics (two for each value of d) are non-polynomial: in this way none of the model we will compare (linear, quadratic, and cubic) is able to perfectly describe the dy- namics. Simularly to the previous test, for each value of d we generate a total of fifty trajectories of 100 steps. Figure 3 shows the results of these tests. As it can be observed, with d = 1 (Figure 3a) the linear model is not able to properly describe the non-lienar dynam- ics, failing in the segmentation of the obtained trajectory. On the other hand, for d = 2 and 3 (Figures 3b and 3c respectively), the differences between the three dynamical model (linear, quadratic, and cubic) significantly reduce. These tests show that for lower-dimensional observation spaces, the improvements in using the Non-Linear formu- lation for the ARHMM dynamics are more significative. We argue that the motivation lies in the fact that for high- dimensional data, linear vector fields can describe a wider range of dynamics, since the number of parameters in the dynamics grows quadratically with the space dimension (to be precise, the number of parameters for each dynamics is d2 + d: d2 elements for the matrix As and d for the vector bs in (1)). Oh the other hand, for smaller observation spaces, linear dynamics are too limited and the usage of polynomial functions in the definition of the dynamics provides a broader set of possible behaviors. For this reason, in Section IV-C we will propose a model in which the Cartesian position of the robot end-effector is modeled by a linear dynamics, while the gripper angle (a 1-dimensional variable) will be modeled using a polynomial dynamics. C. Experiments on Real Setups To prove the effectiveness of our generalizations, we propose a model combining both Non-Linear Cartesian and Linear Unit-Quaternion dynamics. In particular, we propose a pose+gripper model in which, for each hand of the robot, we model the position with a linear Cartesian model, the end-effector orientation with a linear Unit-Quaternion model, and the gripper angle with a quadratic model. The decision to use a linear model for the position and a quadratic model for the gripper angle are motivated by the tests presented in Section IV-B: for 3-dimensional spaces, linear, quadratic, and cubic models are almost indistinguishable (Figure 3c) and we thus choose the simplest one. On the other hand, for 1-dimensional trajectories, linear models fail to describe the complexity of the behavior, while a quadratic and a cubic one give similar results (Figure 3c). Additionally, we assume that position xh gripper angle θh others when the hidden mode is given: t , and t of each arm h are independent of each t , orientation qh  p  t+1,q1 x1 t+1,θ1 ..., t+1,θH t+1,qH xH (cid:12) t+1, (cid:12) (cid:12) (cid:12) (cid:12) t+1 t ,q1 t ,θ1 x1 t , ..., t ,θH t ,qH xH t ,zt+1   = H (cid:89) h=1 p(xh t+1|zt+1, xh t ) p(qh t+1|zt+1, qh t ) p(θh t+1|zt+1, θh t ). (12) latent variable 1-st e.e. ... H-th e.e. zt−1 zt zt+1 x1 t−1 q1 t−1 θ1 t−1 ... xH t−1 qH t−1 θH t−1 x1 t xH t q1 t ... qH t θ1 t θH t x1 t+1 q1 t+1 θ1 t+1 ... xH t+1 qH t+1 θH t+1 Fig. 4: Graphical representation of a Pose+Gripper ARHMM. A graphical model representation of the model is given in Figure 4. To demonstrate the improvement in the segmentation qual- ity given by the different dynamics, we compare our model against a Linear ARHMM with the same topology, so that the only difference lies in the definition of the Auto Regressive dynamics itself. This means that position, orientation, and gripper angle for each end effector is independent of each other, and the conditional probability of the next observed state follows the same law as in (12). The only difference is that the Linear ARHMM uses linear dynamics for the evolution of each observed state. Since the conditional inde- pendence (and, thus, the topology) are identical, the graphical representation of the model does not change. To test our method, we use the JIGSAW dataset [22]. It consists of three different surgical tasks ('SUTuring', 'Knot Tying', and 'Needle Passing') executed by eight surgeons of different skill levels. Data consists of positions, velocities, orientations (in the form of rotation matrices), angular ve- locities, and gripper angle. Each variable is given for both left and right arms, and for both the patient-side and surgeon-side controllers. Moreover, JIGSAW provides a segmentation of all the tasks in gestures. We use only positions, orientations (converting from rotation matrices to unit quaternions) and gripper angle for the patient-side end-effectors. Thus, in our case, H = 2. To evaluate the quality of the algorithm, we proceed as follows. For a given batch of data, we use the Expectation Maximization algorithm to infer the set of parameters Θ for both models. Then, we apply the Viterbi algorithm to segment one of the executions that were not in the training set, and we compute different scores for segmentation. This test is repeated a given number of times randomizing each time both the training and testing sets. The scores we decide to adopt are the following: Seg-score and Silhouette Index (SI). Seg-score (also known as Jaccard index) [23], [24] is a supervised score, that is, it compares the obtained segmentation to the ground-truth; it is the size of similarity between segmentation result and ground-truth. SI [25], instead, is an unsupervised score and it evaluates the (a) Knot Tying - 6 modes, Seg- score. (b) Knot Tying - 6 modes, SI. (c) Suturing - 5 modes, Seg-score. (d) Suturing - 5 modes, SI. Fig. 5: Histograms showing the number of occurrences for different scores. Color blue marks the 'state of the art' linear ARHMM, while orange marks our proposed generalization. goodness of the segmentation by treating it as a clustering problem; it evaluates the clusters by comparing the average distance within a cluster with the average distance to the points in the nearest clusters. We decided to use these scores since they are already used for the evaluation of segmentation algorithms in the context of robotic surgery [26], [27]. The main challenge in using this dataset is that it is not consistent: the same task may contains different gestures in each trial (that is, a particular gesture is present in one trial but not in the others). This makes the segmentation a particularly hard problem: if the model has many hidden modes, but some are rare, over-fitting and over-segmentation (i.e. a segment is wrongly split in multiple smaller parts) will likely happen. On the other hand, if we use fewer hidden modes, some different gestures will be described by the same hidden mode, resulting in a lower Seg-score. In Figure 5 we show the results of this test. In particular, for each of 100 trials with a given task and a given number of hidden modes, we show the histograms counting the number of occurrences of the scores in a given interval. As it can be seen, the NL model is able to achieve, on average, a higher score in both the supervised and unsupervised metric, and it is also able to achieve higher scores (see, for instance, Figure 5d). V. CONCLUSION AND FUTURE WORKS In this work, we proposed a generalization to the Auto- Regressive Hidden Markov Model via modifications of the Auto-Regressive dynamics. In particular, we proposed a Non- Linear dynamics in Cartesian space and a linear dynamics in Unit-Quaternion space. Experiments on real datasets show that adopting these new dynamics result in an improvement in segmentation scores. 0.300.350.400.450.500.55024681012linearnon-linear0.460.480.500.520.5402468101214linearnon-linear0.10.20.30.402468101214linearnon-linear0.470.480.490.500.510.520.5302468101214linearnon-linear This has been proved by comparing two topologically iden- tical models in which the only difference is the formulation of the vector fields governing the evolution of the observed state. As future work, we aim to further generalize the observed state dynamics to dynamical systems used in trajectory learning for robotics such as Dynamic Movement Primitives [28], [29] and Probabilistic Movement Primitives [30]. This would allow to simultaneously segment a robot trajectory and extract the robot movements used to generate the trajectory. Moreover, we aim at generalizing ARHMMs to deal with dy- namics in generic Riemannian Manifolds and non-Euclidean spaces, possibly extending our proposed idea for Unit- Quaternions to the space SO(3) of Rotation Matrices and the space of Symmetric Positive Definite (SPD) matrices, both heavily used in robotics. REFERENCES [1] S. Calinon, F. D'halluin, E. L. Sauser, D. G. Caldwell, and A. G. Billard, "Learning and reproduction of gestures by imitation," IEEE Robotics Automation Magazine, vol. 17, no. 2, pp. 44–54, June 2010. [2] I. Visser, "Seven things to remember about hidden markov models: A tutorial on markovian models for time series," Journal of Mathematical Psychology, vol. 55, no. 6, pp. 403–415, 2011. [3] A. Vakanski, I. Mantegh, A. Irish, and F. Janabi-Sharifi, "Trajec- tory learning for robot programming by demonstration using hidden markov model and dynamic time warping," IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), vol. 42, no. 4, pp. 1039–1052, 2012. [4] B.-H. Juang and L. Rabiner, "Mixture autoregressive hidden markov models for speech signals," IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 33, no. 6, pp. 1404–1413, 1985. [5] F. Jelinek, Statistical methods for speech recognition. MIT press, 1997. [6] R. Nag, K. Wong, and F. Fallside, "Script recognition using hidden markov models," in ICASSP'86. IEEE International Conference on Acoustics, Speech, and Signal Processing, vol. 11. IEEE, 1986, pp. 2071–2074. [7] C. Manning and H. Schutze, Foundations of statistical natural lan- guage processing. MIT press, 1999. [8] C. E. Reiley, H. C. Lin, B. Varadarajan, B. Vagvolgyi, S. Khudanpur, D. D. Yuh, and G. D. Hager, "Automatic recognition of surgical motions using statistical modeling for capturing variability," in MMVR, vol. 132. Citeseer, 2008, pp. 396–401. [9] B. Varadarajan, C. Reiley, H. Lin, S. Khudanpur, and G. Hager, "Data-derived models for segmentation with application to surgical assessment and training," in International Conference on Medical Image Computing and Computer-Assisted Intervention. Springer, 2009, pp. 426–434. [10] L. Tao, E. Elhamifar, S. Khudanpur, G. D. Hager, and R. Vidal, "Sparse hidden markov models for surgical gesture classification and skill evaluation," in International conference on information processing in computer-assisted interventions. Springer, 2012, pp. 167–177. [15] O. Kroemer, H. Van Hoof, G. Neumann, and J. Peters, "Learning to predict phases of manipulation tasks as hidden states," in Robotics and Automation (ICRA), 2014 IEEE International Conference on. IEEE, 2014, pp. 4009–4014. [11] Y. Ephraim, D. Malah, and B.-H. Juang, "On the application of hidden markov models for enhancing noisy speech," IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 37, no. 12, pp. 1846– 1856, 1989. [12] L. R. Rabiner, A Tutorial on Hidden Markov Models and Selected San Francisco, CA, USA: Applications in Speech Recognition. Morgan Kaufmann Publishers Inc., 1990. [13] K. P. Murphy, "Switching kalman filters," 1998. [14] Y. Ephraim and W. J. Roberts, "Revisiting autoregressive hidden markov modeling of speech signals," IEEE Signal processing letters, vol. 12, no. 2, pp. 166–169, 2005. [16] X. Guan, R. Raich, and W.-K. Wong, "Efficient multi-instance learning for activity recognition from time series data using an auto-regressive hidden markov model," in International Conference on Machine Learning, 2016, pp. 2330–2339. [17] O. Kroemer, C. Daniel, G. Neumann, H. Van Hoof, and J. Peters, "Towards learning hierarchical skills for multi-phase manipulation tasks," in 2015 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2015, pp. 1503–1510. [18] S. Chiappa and J. R. Peters, "Movement extraction by detecting dynamics switches and repetitions," in Advances in neural information processing systems, 2010, pp. 388–396. [19] C. M. Bishop, Pattern Recognition and Machine Learning (Informa- Secaucus, NJ, USA: Springer-Verlag tion Science and Statistics). New York, Inc., 2006. [20] A. J. Ijspeert, J. Nakanishi, and S. Schaal, "Learning attractor land- scapes for learning motor primitives," in Advances in neural informa- tion processing systems, 2003, pp. 1547–1554. [21] G. D. Forney, "The viterbi algorithm," Proceedings of the IEEE, vol. 61, no. 3, pp. 268–278, 1973. [22] Y. Gao, S. S. Vedula, C. E. Reiley, N. Ahmidi, B. Varadarajan, H. C. Lin, L. Tao, L. Zappella, B. B ́ejar, D. D. Yuh et al., "Jhu-isi gesture and skill assessment working set (JIGSAWS): A surgical activity dataset for human motion modeling," in MICCAI Workshop: M2CAI, vol. 3, 2014, p. 3. [23] G. Ivchenko and S. Honov, "On the Jaccard similarity test," Journal of Mathematical Sciences, vol. 88, pp. 789–794, 1998. [24] M. Maˇska, V. Ulman, D. Svoboda, P. Matula, P. Matula, C. Ederra, A. Urbiola, T. Espa ̃na, S. Venkatesan, D. M. Balak et al., "A bench- mark for comparison of cell tracking algorithms," Bioinformatics, vol. 30, no. 11, pp. 1609–1617, 2014. [25] P. J. Rousseeuw, "Silhouettes: a graphical aid to the interpretation and validation of cluster analysis," Journal of computational and applied mathematics, vol. 20, pp. 53–65, 1987. [26] M. Fard, S. Ameri, R. Chinnam, and R. Ellis, "Soft boundary approach for unsupervised gesture segmentation in robotic-assisted surgery," IEEE Robotics and Automation Letters, vol. 2, no. 1, pp. 171–178, 2016. [27] A. Murali, A. Garg, S. Krishnan, F. Pokorny, P. Abbeel, T. Darrell, and K. Goldberg, "TSC-DL:Unsupervised trajectory segmentation of multi-modal surgical demonstrations with deep learning," 2016 IEEE International Conference on Robotics and Automation (ICRA), 2016. imitation with nonlinear dynamical systems in humanoid robots," in Robotics and Automation, 2002. Proceedings. ICRA'02. IEEE International Conference on, vol. 2. [28] A. J. Ijspeert, J. Nakanishi, and S. Schaal, "Movement IEEE, 2002, pp. 1398–1403. [29] M. Ginesi, N. Sansonetto, and P. Fiorini, "Overcoming some draw- backs of dynamic movement primitives," Robotics and Autonomous Systems, vol. 144, p. 103844, 2021. [30] A. Paraschos, C. Daniel, J. R. Peters, and G. Neumann, "Probabilistic movement primitives," in Advances in neural information processing systems, 2013, pp. 2616–2624.
http://arxiv.org/abs/2302.11829v2
2023-02-26T16:23:09
2023-02-23T07:39:37
Learning to Manipulate a Commitment Optimizer
It is shown in recent studies that in a Stackelberg game the follower can manipulate the leader by deviating from their true best-response behavior. Such manipulations are computationally tractable and can be highly beneficial for the follower. Meanwhile, they may result in significant payoff losses for the leader, sometimes completely defeating their first-mover advantage. A warning to commitment optimizers, the risk these findings indicate appears to be alleviated to some extent by a strict information advantage the manipulations rely on. That is, the follower knows the full information about both players' payoffs whereas the leader only knows their own payoffs. In this paper, we study the manipulation problem with this information advantage relaxed. We consider the scenario where the follower is not given any information about the leader's payoffs to begin with but has to learn to manipulate by interacting with the leader. The follower can gather necessary information by querying the leader's optimal commitments against contrived best-response behaviors. Our results indicate that the information advantage is not entirely indispensable to the follower's manipulations: the follower can learn the optimal way to manipulate in polynomial time with polynomially many queries of the leader's optimal commitment.
[ "Yurong Chen", "Xiaotie Deng", "Jiarui Gan", "Yuhao Li" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11829v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11829v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.GT", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.GT", "cs.AI", "cs.DS", "cs.LG", "econ.TH" ]
3 2 0 2 b e F 6 2 ] T G . s c [ 2 v 9 2 8 1 1 . 2 0 3 2 : v i X r a Learning to Manipulate a Commitment Optimizer Yurong Chen Peking University [email protected] Xiaotie Deng Peking University [email protected] Jiarui Gan∗ University of Oxford [email protected] Yuhao Li Columbia University [email protected] Abstract It is shown in recent studies that in a Stackelberg game the follower can manipulate the leader by deviating from their true best-response behavior. Such manipulations are computationally tractable and can be highly beneficial for the follower. Meanwhile, they may result in signifi- cant payoff losses for the leader, sometimes completely defeating their first-mover advantage. A warning to commitment optimizers, the risk these findings indicate appears to be alleviated to some extent by a strict information advantage the manipulations rely on. That is, the follower knows the full information about both players' payoffs whereas the leader only knows their own payoffs. In this paper, we study the manipulation problem with this information advantage re- laxed. We consider the scenario where the follower is not given any information about the leader's payoffs to begin with but has to learn to manipulate by interacting with the leader. The follower can gather necessary information by querying the leader's optimal commitments against contrived best-response behaviors. Our results indicate that the information advantage is not entirely indis- pensable to the follower's manipulations: the follower can learn the optimal way to manipulate in polynomial time with polynomially many queries of the leader's optimal commitment. 1 Introduction Strategy commitment is a useful tactic in many game-theoretic scenarios. In anticipation that the other player, i.e., the follower, will respond optimally, a commitment optimizer, i.e., the leader, picks a strat- egy that maximizes their own payoff. The interaction between the leader and the follower is often modeled and known as a Stackelberg game [von Stackelberg, 1934; Von Stengel and Zamir, 2010]. The equilibrium of the game, called the Stackelberg equilibrium, captures the leader's optimal commitment. It is well-known that the leader's first-mover position comes with a payoff benefit: an optimal com- mitment always yields a higher payoff (often strictly higher) for the leader than what they obtain in any Nash equilibrium of the same game [Von Stengel and Zamir, 2010]. Yet, this first-mover advantage is not without a caveat. The computation of an optimal commitment relies crucially on the follower's payoff information. This strong reliance offers the follower a means to manipulate the leader's commitment. A series of recent studies considered this issue and investigated how a follower can induce an equilibrium different from the original one by misreporting their payoffs [Gan et al., 2019b;a; Nguyen and Xu, 2019; Birmpas et al., 2021; Chen et al., 2022b]. It is shown that finding an optimal manipulation is computationally tractable and there is a large space of outcomes that are realizable through manipulations. In the worst case, a manipulation may completely defeat the ∗Corresponding author. 1 first-mover advantage of the leader and cause a significant payoff loss.1 Moreover, even if the leader is well aware of the possibility of such manipulations, they face an NP-hard problem to compute an optimal mechanism to counteract [Gan et al., 2019b]. A warning to commitment optimizers, the risk these findings indicate may appear to be alleviated to some extent by a strict information advantage required by the manipulations. That is, the follower knows the full information about both players' payoffs, whereas the leader only knows their own. This may not be the case in practice. In this paper, we consider a setting with this information asymme- try relaxed, where neither the leader nor the follower knows any payoff information of the opponent to begin with. The follower has to learn to manipulate by interacting with the leader and can gather necessary information by querying the leader's optimal commitments against contrived payoff func- tions. We are interested in understanding whether the follower can efficiently learn to solve the optimal manipulation problem. More specifically, we assume that the follower has query access to the leader's optimal commit- ment: there is an equilibrium oracle which answers whether a certain Stackelberg equilibrium can be induced by a given (fake) payoff function of the follower. The query access resembles an information exchange process during the course of interaction: the follower (mis)reports a payoff function to the leader, and the leader reacts by committing optimally with respect to the report; the optimal com- mitment is then observed by the follower. Payoff reporting may take the form of direct information exchange. For example, in online platforms, users (follower) set up their profiles and the platform (leader) offers personalized recommendations or pricing based on the information provided.2 Addi- tionally, it can also be realized via another layer of active learning from the leader's side, e.g., in green security games, the defender (leader) learns the optimal patrolling strategy by interacting with poach- ers (followers) [Fang and Nguyen, 2016]. Our main result, presented as follows, is an affirmative answer to the question asked above. Main Theorem (informal). With access to an equilibrium oracle, a follower can learn an optimal payoff function to misreport in polynomial time and via polynomially many queries. The payoff function induces a Stackelberg equilibrium that maximizes the follower's (real) payoff among all inducible equilbria (i.e., equilibria that can be induced by some fake payoff matrix of the follower). The result indicates that the information advantage is not entirely indispensable to the follower's manipulation, so it may not be safe to take it as a protection against manipulations. Indeed, the issue is fairly widespread. The flourish of e-commerce and other online platforms, including various financial activities on crypto-currencies [Chen et al., 2022a], offers many testbeds and realistic application areas for the problem we study. In these domains, the leader interacts individually with a large number of different followers and aims to commit optimally against each of them. A follower who intends to manipulate can easily forge pseudonym identities in a short period of time at low cost and without being detected by the leader (e.g., by creating multiple accounts for a web-based service such as crypto- currency). Adding to the fact, the manipulations we consider are imitative-a term coined by Gan et al. [2019b] meaning that the follower keeps behaving in accordance with the reported payoff function. Such manipulations are almost impossible for the leader to detect in many cases. Due caution is needed when one seeks to exploit the power of commitment in these domains. Our approach to deriving the main result consists of two main components: (1) learning the gra- dient information of the leader's payoff function, and (2) constructing strategically equivalent games with this information to compute the follower's best manipulation strategy. The latter requires com- puting a payoff matrix of the follower to induce her maximin value in the original game. Even in the 1Birmpas et al. [2021] showed that any outcome can be induced as a Stackleberg equilibrium as long as it offers the leader at least the maximin value of the game-a lower bound of the leader's Nash payoff, in contrast to the upper bound promised by an optimal commitment when the follower behaves truthfully. 2https://medium.com/swlh/why-is-your-friend-getting-a-cheaper-uber-fare-than-you-ai-and-the-new-frontier-in- dynamic-pricing-2b7d908deed0 2 full information setting, this problem requires a non-trivial approach in order to derive an efficient solution Birmpas et al. [2021]. In our partial information setting, additional difficulties come from the fact that we cannot fully recover all gradient information of the leader's payoff function. We note that the equilibrium oracle does not directly reveal the leader's payoff information. Therefore, to acquire useful information from the oracle, it requires carefully designed queries that expose strategy profiles of interest as Stackelberg equilibria. This task becomes more challenging, as the numbers of players' actions increase. 1.1 Related Work Our work directly relates to the recent line of work on follower deception in Stackelberg games as we mentioned above. This line of work is motivated by an active learning approach to finding an optimal strategy to commit to [Letchford et al., 2009; Balcan et al., 2015; Blum et al., 2014; Roth et al., 2016; Peng et al., 2019], which asks whether the leader's optimal commitment can be learned with query access to the follower's best response. Gan et al. [2019b] first pointed out that this approach leads to an untruthful mechanism that can be manipulated by the following imitating responses as if they have a different payoff function. They also showed that designing an optimal mechanism to counteract the follower's manipulation is in general NP-hard even to find an approximate solution. The hardness contrasts the tractability of the computation of an optimal commitment in the full information setting, as shown in an early work of Conitzer and Sandholm [2006]. Gan et al. [2019a] considered a security game scenario and showed that, under mild assumptions, in a Stackelberg security game the follower's optimal manipulation is always to misreport payoffs that make the game zero-sum; the leader gains only their maximin payoff as a result. This result does not hold true in general bi-matrix Stackelberg games, but the later result of Birmpas et al. [2021] indeed also revealed a general connection between payoff manipulations in Stackelberg games and the leader's maximin payoff. As we will discuss in detail later, this connection is also one of the cornerstones of our main result. Nguyen and Xu [2019] studied a similar security game scenario and also considered the follower's manipulation strategy when their payoff reporting is restricted in a ball of the true payoff. More recently, Chen et al. [2022b] further extended the line of work to extensive-form games. In another line of work Kolumbus and Nisan [2022b;a] studied the Nash equilibrium of the meta-game when multiple players attempt to manipulate simultaneously. Besides the above line of work, in a more recent study, Haghtalab et al. [2022] approached manip- ulations in Stackelberg games via a repeated game model and interpreted the follower's manipulations as a strategic behavior resulting from their far-sightedness. A framework is proposed in this study to derive efficient learning algorithm for a more patient leader (who does not discount future rewards) to induce truthful best responses from the less patient non-myopic follower (who discounts future rewards). Our setting is analogous to the opposite, where a more patient follower plays with a less patient leader. The patient follower explores the leader's payoff structure until having learned the op- timal manipulation and behaves accordingly afterwards to exploit the leader. We also note that similar interactions against non-myopic bidders have also been extensively explored in the online auction lit- erature Amin et al. [2013; 2014]; Mohri and Medina [2014]; Liu et al. [2018]; Abernethy et al. [2019]; Golrezaei et al. [2021]. 2 Preliminaries Stackelberg games are a standard framework for studying strategy commitment in game theory. In a Stackelberg game, a leader commits to a strategy and a follower best responds to this commitment. We consider general bi-matrix games in this paper. A bi-matrix game G = (uL, uF ) is given by two matrices uL, uF ∈ Rm×n, which specify the leader's and the follower's payoffs, respectively. The 3 leader has m actions (i.e., pure strategies) at their disposal, each corresponding to a row of the payoff matrices; and the follower has n actions, each corresponding to a column. The entries uL(i, j) and uF (i, j) are the payoffs of the leader and the follower when a pair (i, j) ∈ [m] × [n] of actions is played.3 In the mixed strategy setting, the leader can further randomize their actions and the resulting (cid:111) distribution over the actions is called a mixed strategy, e.g., x ∈ ∆m := x ∈ Rm . Slightly abusing notation, we denote by uL(x, j) = (cid:80) i∈[m] xi*uL(i, j) the expected payoff of the leader for a strategy profile (x, j), and similarly denote by uF (x, j) = (cid:80) i∈[m] xi *uF (i, j) the expected payoff of the follower. We will refer to a payoff matrix and the corresponding payoff function interchangeably throughout this paper. i∈[m] xi = 1 ≥0 : (cid:80) (cid:110) A (pure) best response of the follower is then given by j ∈ BR(x), where BR(x) := argmax uF (x, j) j∈[n] is called the follower's best response set, or a BR-correspondence as a function BR : ∆m → 2[n]. In most cases, it is without loss of generality to consider only pure strategy responses, because there always exists an optimal strategy that is pure. Hence, unless otherwise specified, all best responses are pure strategies throughout. It will also be useful to define the inverse function of BR: for any j ∈ [n], BR−1(j) := {x ∈ ∆m : j ∈ BR(x)} is the set of leader strategies that incentivize the follower to best-respond j. The optimal commitments of the leader are captured by the following optimization, with the as- sumption that the follower breaks ties by picking a j ∈ BR(x) in favor of the leader when there are multiple best responses in BR(x): argmax x(cid:48)∈∆m, j(cid:48)∈BR(x(cid:48)) The strategy profile (x, j) is called a strong Stackelberg equilibrium (SSE). Alternatively, using the in- verse function of BR gives the following equivalent definition of an SSE: (x, j) ∈ uL(x(cid:48), j(cid:48)). (1) (x, j) ∈ argmax x(cid:48)∈BR−1(j(cid:48)), j(cid:48)∈[n] uL(x(cid:48), j(cid:48)). (2) SSE is the most widely used solution concept in the literature on Stackelberg games. The optimistic tie-breaking assumption adopted by it is justified by noting that this tie-breaking behavior can often be induced by an infinitesimal perturbation in the leader's strategy [von Stengel and Zamir, 2004]. Definition 1 (SSE and SSE response). A strategy profile (x, j) ∈ ∆m × [n] is said to be an SSE of a game G = (uL, uF ) if and only if Eq. (1) (or equivalently, Eq. (2)) holds. An action j of the follower is called an SSE response of G if and only if (x, j) is an SSE of G for some x ∈ ∆m. 2.1 Equilibrium Manipulation via Payoff Misreporting According to the above definition, the optimal commitment of the leader, or the SSE, is a function of the follower's payoff matrix. When this payoff information is private to the follower, the follower has a chance to manipulate the leader's commitment by reporting a fake payoff matrix. At a high-level, to find out the optimal way to manipulate amounts to solving the following optimization problem: max ̃uF ,x,j s.t. uF (x, j) (x, j) is an SSE of (cid:101)G = (uL, ̃uF ). (3) (3a) 3For any positive integer x we write [x] := {1, . . . , x}. 4 Birmpas et al. [2021] showed that this problem is tractable in the full information setting (i.e., when uL is known to the follower) and presented an elegant characterization of strategy profiles that sat- isfy Eq. (3a). This characterization, summarized in Theorem 2.1 below, forms a foundation of our tech- nical results. We follow the terminology by Birmpas et al. [2021] and define the inducibility as follows. Note that Eq. (3a) also means that the manipulation is imitative: the follower is required to respond according to the reported payoff ̃uF , and this "best response" decides their equilibrium utility. Definition 2 (Inducibility). A payoff matrix ̃uF ∈ Rm×n induces a strategy profile (x, j) (with respect to uL) if and only if (x, j) is an SSE of (uL, ̃uF ). Moreover, (x, j) is said to be inducible (with respect to uL) if and only if it is induced by some ̃uF . Theorem 2.1 (Birmpas et al. 2021). A strategy profile (x, j) is inducible if and only if uL(x, j) ≥ M[n] := max y∈∆m min k∈[n] uL(y, k). Moreover, a payoff matrix ̃uF that induces (x, j) can be computed in polynomial time. The above result establishes an interesting connection between the follower's optimal manipulation and the leader's maximin value M[n]. Intuitively, to induce (x, j), the follower can respond in a way that is completely adversarial against the leader (whereby the leader only gets M[n]) unless the leader plays x. Hereafter, we extend the notation M[n] to every subset S ⊆ [n] of the follower's actions, and define MS := max x∈∆m min j∈S uL(x, j) and MS := argmax x∈∆m min j∈S uL(x, j), (4) which are the leader's maximin payoff and the set of maximin strategies when the follower's responses are restricted in S. These two notations will be frequently used throughout the paper. 2.2 Main Problem: Learning to Manipulate with SSE Oracle We consider the learning version of the follower's optimal manipulation problem, where the leader's payoff matrix is unknown to the follower (i.e., unknown to us). Instead, the follower only has query access to an SSE oracle, denoted ASSE, which is able to answer whether a given solution ( ̃uF , x, j) to the above optimization problem satisfies Eq. (3a) or not-in other words, whether (x, j) is induced by ̃uF .4 Conceptually, when the follower can interact repeatedly with the leader, they can try reporting different payoff matrices ̃uF and observe the leader's optimal commitment against these matrices. The SSE oracle abstract this process. Note that in our model the leader is unaware of the fact that the follower keeps changing their payoffs throughout the process. Rather, the leader thinks that they are interacting with different followers and, as we discussed earlier, this applies to scenarios where the follower can easily forge a large number of fake identities to elicit the leader's payoff information. To put it differently, the leader commits to playing the optimal commitment against every reported payoff matrix. Definition 3 (SSE oracle). Given a matrix ̃uF and a strategy profile (x, j) ∈ ∆m × [n], the SSE oracle, denoted ASSE, outputs whether ̃uF induces (x, j) or not. We consider the time and query complexity with respect to the bit-size of the leader's payoff matrix and assume that its entries are rational numbers. Throughout, when we say that something can be 4The reason that we also specify (x, j) as part of the input to ASSE is to sidestep the tricky case where there are multiple SSEs. Our results do not apply to the setting where we do not have the power to specify a particular SSE. We leave this setting as an interesting open problem. See our discussion in Section 6. 5 computed efficiently, we mean that it can be computed with polynomially many queries to ASSE and in polynomial time. Our algorithms will make frequent use of binary search to find the exact value of an unknown rational number. We note that this can be done exactly in time polynomial in the bit-size of the target number, using a standard approach that searches on the Stern-brocot tree [Graham et al., 1989]. 3 Warm-up and Approach Overview In this section, we provide an overview of our approach to solving the problem defined above. We start with a warm-up, with two examples showing how the SSE oracle can be utilized to obtain some basic information that will be useful throughout the paper. 3.1 Warm-up with ASSE The oracle ASSE does not directly reveal any payoff values, but it exposes payoff information about SSEs. For example, if through the oracle we can confirm that two strategy profiles (x, j) and (x(cid:48), j(cid:48)) are both SSEs, then we know that uL(x, j) = uL(x(cid:48), j(cid:48)). Hence, a main approach to obtaining in- formation via ASSE is by designing payoff matrices that induce strategy profiles of interest as SSEs. In particular, in order for a profile (x, j) to be an SSE, a necessary condition according to (2) is that uL(x(cid:48), j) with respect to some follower action j and the BR-correspondence x ∈ argmax −1 (j) of a fake payoff matrix. Using this necessary condition and ASSE, we can easily, and effi- (cid:103)BR ciently, identify the following handy information; we henceforth assume that they are known in the remainder of the paper. x(cid:48)∈ (cid:102)BR (j) −1 Observation 3.1. With query access to ASSE, for every j ∈ [n], the set Ij := argmaxi∈[m] uL(i, j) of the leader's (pure) best responses against j can be computed efficiently. Hence, M{j}, which is the convex hull of Ij, can also be computed efficiently. Specifically, to decide whether i ∈ Ij for a pure strategy i ∈ [m], we can construct a matrix ̃uF such that ̃uF (i, j) = 0 and ̃uF (i, j(cid:48)) = −1 for all j(cid:48) (cid:54)= j. This way j is the strictly dominant strategy of the follower, so we have (cid:103)BR (j(cid:48)) = ∅ for all j(cid:48) (cid:54)= j. We then query ASSE to check whether ̃uF induces (i, j) as an SSE. A "yes" answer implies that (j) = ∆m and (cid:103)BR −1 −1 uL(i, j) = max −1 x∈ (cid:102)BR uL(x, j) = max x∈∆m uL(x, j) ≥ max i(cid:48)∈[m] uL(i(cid:48), j). (j) So i ∈ Ij. A "no" answer implies the existence of x ∈ (cid:103)BR It follows that uL(i, j) < uL(x, j) ≤ maxi(cid:48)∈[m] uL(i(cid:48), j). Hence, i /∈ Ij. −1 (j) = ∆m such that uL(i, j) < uL(x, j). Observation 3.2. For every i ∈ [m] and j, k ∈ [n], the relation (i.e., >, =, or <) between M{j} and uL(i, k) can be decided efficiently with query access to ASSE. To decide the above relation, we slightly modify ̃uF defined for deriving Observation 3.1; we let ̃uF (i, k) = 0 and keep all other entries the same. This gives the following BR-correspondence of ̃uF : −1 (cid:103)BR (k) = {i}, (cid:103)BR −1 (j) = ∆m, −1 and (cid:103)BR (j(cid:48)) = ∅ for all j(cid:48) ∈ [n] \ {j, k}. Consequently, the best strategies to induce responses j and k yield payoffs M{j} and uL(i, k), respec- tively, for the leader. We can then query ASSE to check if (i(cid:48), j) and (i, k) are SSEs for some i(cid:48) ∈ Ij to decide the relation between these two payoffs. 6 1. For each j ∈ [n], decide if M{j} = M[n]. If M{j} (cid:54)= M[n], learn a vector aj that satisfies Eq. (6). [cf. Section 4] 2. Identify a subset J ⊆ [n] along with a leader strategy x∗ ∈ ∆m, such that uL(x∗, j) = MJ = M[n], for all j ∈ J. (7) [cf. Sections 5, 5.1 and 5.2] 3. Solve LP (5) for every j ∈ [n] with information obtained in the above two steps, hence also solving Problem (3). [cf. Theorem 3.4] Figure 1: Main approach overview. 3.2 Approach Overview Now we present an overview of our approach. Given the characterization by Theorem 2.1, the problem we want to solve, formulated as Problem 3, boils down to solving the following linear program (LP) for every j ∈ [n] and selecting the one with the maximum optimal value. max x∈∆m uF (x, j) s.t. uL(x, j) ≥ M[n] (i.e., (x, j) is inducible) (5) (5a) With only access to ASSE, we cannot hope to learn the exact payoff function uL to solve the above LP. Hence, the idea is to learn a strategically equivalent representation of uL, that is, a vector aj = (aj1, . . . , ajm) ∈ Qm such that uL(x, j) ≡ γj * aj * x + βj for some γj ∈ R>0 and βj ∈ R, (6) where aj * x denotes the inner product of aj and x. Intuitively, aj indicates the direction of the gradient of uL(*, j). As we demonstrate in Lemma 3.3, knowing aj alone (without γj and βj) allows us to reduce the LP to an inducibility problem: decide whether a given strategy profile (x, j) is inducible or not. To solve the inducibility problem means comparing uL(x, j) with the maximin payoff M[n] and this requires constructing a ̃uF that induces either (x, j) or a strategy profile that gives the maximin payoff. In more detail, these procedures are summarized in Figure 1, which also include a special treatment of a degenerate case (i.e., when M{j} = M[n]) that prevents us from even learning aj. The detailed implementations of Steps 1 and 2 are presented in the next sections: learning aj in Section 4, and learning J and x∗ in Section 5. The reason that LP (5) can be solved efficiently in Step 3 is given by Theorem 3.4. Lemma 3.3. Suppose that there is an efficient algorithm that decides correctly whether any given strategy profile (y, k) ∈ ∆m × [n] is inducible or not. Then given aj satisfying (6), LP (5) can be solved in polynomial time with query access to ASSE. The same can be achieved without aj if M{j} = M[n]. Proof. In the case where M{j} = M[n], we have uL(x, j) ≥ M[n] if and only if x ∈ M{j}. By Observation 3.1, LP (5) is then equivalent to solving maxx∈∆m uF (x, j), subject to xi = 0 for all i /∈ Ij, which is an LP with all parameters known. Hence, LP (5) can be solved efficiently. In the case where M{j} (cid:54)= M[n], we are given aj. We can rewrite the constraint Eq. (5a) as aj * x ≥ is still unknown since βj and γj are unknown. However, , where d∗ using binary search d∗ j now that there is an algorithm to solve the inducibility problem, we can learn d∗ j j = (M[n] − βj)/γj. Note that d∗ j 7 as follows. For any given d, pick arbitrary x ∈ ∆m such that aj * x = d. If (x, j) is inducible then we know that uL(x, j) ≥ M[n] by Theorem 2.1 and hence, d ≥ d∗ . ; otherwise, we know that d < d∗ j j Knowing d∗ j , we can then solve LP (5) efficiently. Theorem 3.4. Suppose that the following elements are given: a vector aj satisfying (6) for every j ∈ [n] such that M{j} (cid:54)= M[n]; moreover, J ⊆ [n] and x∗ ∈ ∆m satisfying (7). Then for every j ∈ [n], LP (5) can be solved in polynomial time with query access to ASSE. Proof sketch. By Lemma 3.3, LP (5) reduces to deciding the inducibility of any given strategy profile (y, k). We show that this inducibility problem can be efficiently solved. Specifically, we argue that the following algorithm produces an inducibility witness ̃uF for (y, k) in polynomial time. That is, (y, k) is inducible (with respect to uL) if and only if it is an SSE in (uL, ̃uF ). Hence, by querying ASSE to check whether (y, k) is an SSE of (uL, ̃uF ), we can decide the inducibility of (y, k). The stated result then follows. Construct an inducibility witness ̃uF of (y, k): 1. For every j such that M{j} = M[n], since aj is not given, let aj be a vector in Rm such that: aji = 1 if i ∈ M{j}, and aji = 0 otherwise. 2. Construct a payoff matrix ̃uL ∈ Rm×n corresponding to the following payoff function: ̃uL(x, j) =    aj * x − aj * x∗, ak * x − ak * y, 1, if j ∈ J \ {k}; if j = k; otherwise. (8) 3. Decide if (y, k) is inducible with respect to ̃uL: – If it is inducible, output a payoff matrix ̃uF ∈ Rm×n such that (y, k) is an SSE in ( ̃uL, ̃uF ); – Otherwise, output an arbitrary ̃uF ∈ Rm×n. Namely, the above algorithm constructs a "surrogate" matrix ̃uL using the given information aj, J, and x∗. Then a witness ̃uF is produced using ̃uL. The polynomial run-time of the algorithm is readily seen. In particular, Step 3 can be done in polynomial time according to Theorem 2.1. (Note that all parameters of ̃uL is known, so this is a full-information setting.) It can also be proven that (y, k) is inducible if and only if it is an SSE in (uL, ̃uF ), where ̃uF is the matrix produced by the above algorithm. The details can be found in Appendix A. 4 Learning aj - Directions towards which Leader's Utility Increases For notational simplicity, we present an algorithm for learning an instead of aj. The cases with other aj's are analogous and can be handled by appropriate relabeling. To learn an, the high-level idea is to construct a BR-correspondence (cid:103)BR, such that the boundary of −1 (n) is aligned with a hyperplane with norm vector an. Since we are searching "in the dark" and (cid:103)BR only have access to ASSE, we scan through possible positions of the boundary in the hope of a position where all the points on the boundary are SSE strategies. Take Figure 2 as an example, we want to adjust the two red points defining the boundary to a position where both points are SSE strategies (which form SSEs along with response n of the follower). The boundary then aligns with the contour of uL(*, n) and its norm vector aligns with an. 8 C a n * x = d −1 (n) (cid:102)BR Figure 2: A BR-correspondence (cid:103)BR constructed for learning an. The triangle represents the strategy space ∆m of the leader. The region labeled C is (cid:83) (j), which contains strategies inducing responses j (cid:54)= n of the follower. The black dot at the top represents M{n} in this example. The two red dots on the boundary of (cid:103)BR (n) are two critical points defining the boundary hyperplane. j∈[n−1] (cid:103)BR −1 −1 The above idea is formalized in Lemma 4.2 below, which also considers degenerate cases where an is parallel to a facet of ∆m (e.g., when an is parallel to an edge of the simplex in Figure 2). Special treatment is needed for such degenerate cases, as it shall be clear in the sequel. For ease of descrip- tion, we reorder the leader's actions according to Observation 4.1 throughout this section. (The payoff information needed for the reordering is known because of Observation 3.1.) Specifically, in the case where m1 = 1, we can simply let an = 0 without further learning it, so we can assume that m1 > 1. Observation 4.1. Without loss of generality, we can assume that uL(m1, n) = uL(m1 + 1, n) = * * * = uL(m, n) = M{n}, 1 < m1 ≤ m, and uL(k, n) < M{n} for all k = 1, . . . , m1 − 1. Lemma 4.2. Suppose that the following properties hold for strategies x1, . . . , xm1−1 ∈ ∆m: (a) uL(x1, n) = * * * = uL(xm1−1, n); (b) xi i > 0 for all i ∈ [m1 − 1]; and i = (cid:80)m (c) 1 − xi (cid:18) k=m1 xi k for all i ∈ [m1 − 1]. (cid:19) − 1 x1 1 Let b = , * * * , − 1 , − 1 x2 2 uL(x, n) = γ * b * x + β for all x ∈ ∆m. Proof. Recall that by Observation 4.1, uL(m1, n) = * * * = uL(m, n). Hence, , 0, * * * , 0 xm1−1 m1−1 . Then there exists γ ∈ R>0 and β ∈ R such that uL(x, n) ≡ m (cid:88) i=1 uL(i, n) * xi ≡ m1−1 (cid:88) i=1 (cid:0)uL(i, n) − uL(m, n)(cid:1) * xi + uL(m, n). Given Property (c), for each i ∈ [m1 − 1], we have uL(xi, n) = (cid:0)uL(i, n) − uL(m, n)(cid:1) * xi so Property (a) implies that: i + uL(m, n), (cid:0)uL(1, n) − uL(m, n)(cid:1) * x1 Let γ = − (cid:0)uL(1, n) − uL(m, n)(cid:1) * x1 1 Property (b), we get that uL(x, n) ≡ γ * b * x + β. 1 = * * * = (cid:0)uL(m1 − 1, n) − uL(m, n)(cid:1) * xm1−1 m1−1. and β = uL(m, n). Hence, γ > 0, and since xi i > 0 by Following Lemma 4.2, we aim to find m1 − 1 critical points x1, . . . , xm1−1 with the listed prop- erties. In Figure 2, These are the red points defining the boundary hyperplane shared by area C. To ensure Property (a), the critical points need to form SSEs with action n. Ideally, we can design the BR-correspondence in a way such that the follower responds to strategies in C (as in Figure 2) with a bad action to the leader, so that the best strategy of the leader in C does not outperform the critical points. Sometimes this requires using more than one follower response to "cover" C. We introduce the following useful concept called maximin-cover, or cover for short. 9 1. Compute a cover μ of {n}. [cf. Section 4.2] – If no cover of {n} exists, claim that M{n} = M[n]; Pick J = {n} and an arbitrary x∗ ∈ M{n}, and go to Step 3 in Figure 1. 2. Use μ to compute strategies x1, . . . , xm1−1 satisfying the properties in Lemma 4.2; Output an = . [cf. Section 4.1] (cid:18) (cid:19) , * * * , − 1 , 0, * * * , 0 − 1 x1 1 , − 1 x2 2 xm1−1 m1−1 Figure 3: Summary of the approach to learning an. (Relabeling n to j gives the procedures to learning each aj.) Definition 4 (Cover). A payoff matrix μ ∈ Rm×n of the follower is said to be a maximin-cover (or cover) of S ⊆ [n] if and only if max x∈MS max j∈ (cid:102)BR(x) uL(x, j) < MS, (9) where (cid:103)BR denotes the BR-correspondence of μ. It is said to be a proper cover of S if it holds in addition that S ∩ (cid:103)BR(x) = ∅ for all x ∈ ∆m. −1 −1 We arrange the BR-correspondence in region C according to a cover of {n}, in an attempt to make the leader's maximum attainable payoff in (cid:103)BR (n) surpass that in C. To see how this could work, consider moving the hyperplane an * x = d in Figure 2 towards the top. As it approaches the vertex at (n) and C will approach ∆m and M{n}, respectively. The maximum attainable payoffs the top, (cid:103)BR −1 in (cid:103)BR (n) and C then approaches maxx∈∆m uL(x, n) = M{n} and maxx∈M{n},j∈ (cid:102)BR(x) uL(x, j), respectively, which correspond to the right and left sides of Definition 4 (with S = {n}). Hence, given Definition 4, Property (a) can be achieved when the hyperplane is placed sufficiently close to the top. The additional requirement that a cover is proper is useful as we do not want any strategies in C to induce n, which will eventually alter the boundary of (cid:103)BR (n). It turns out that this requirement is actually not strictly more demanding: according to Lemma 4.3, any cover can be efficiently converted into a proper cover. Therefore, in the remainder of the paper, we simply refer to a proper cover as a cover. Moreover, a simple characterization of a cover is given in Lemma 4.4: the existence of a cover requires a gap between MS and the maximin value M[n]. −1 Lemma 4.3. Given a cover of set S ⊆ [n], a proper cover of S can be constructed in polynomial time. Lemma 4.4. For any S ⊆ [n], a cover of S exists if and only if MS > M[n]. Next, we first demonstrate in Section 4.1 that given a cover of {n} a set of strategies x1, . . . , xm1−1 satisfying the properties in Lemma 4.2 can be computed efficiently, and hence we learn aj. In the special case where {n} does not admit a cover, Lemma 4.4 implies that M{n} = M[n]. This means that J = {n} and an arbitrary x∗ ∈ M{n} already form a tuple satisfying (7), so by Theorem 3.4, we are done without learning an. We demonstrate how to compute (or decide the existence of) a cover in Section 4.2. In summary, the approach to learning an is given in Figure 3. 10 Figure 4: An illustration of fg(n) where m = 4, n = 3, and m1 = 3 (which means uL(n, 3) = uL(n, 4) = M{n} according to Observation 4.1). The polytope represents ∆m. The three hyperplanes separating the regions are boundaries of f −1 g (j). Γ1 defined in Eq. (10) is the surface at the front, where x1 + x3 + x4 = 1 for all x. 4.1 Computing x1, . . . , xm1−1 We now describe how to compute x1, . . . , xm1−1, given a cover μ of {n}. For each i ∈ [m1 − 1], define the following set Γi := x ∈ ∆m : 1 − xi = , (10)    m (cid:88) k=m1 xk    which is a facet of ∆m that contains leader strategies satisfying Property (c) stated in Lemma 4.2. We aim to construct a function ̃uF that induces a strategy xi ∈ Γi to form an SSE with n, for each i ∈ [m1 − 1]. This requires that the leader's maximum attainable payoff with respect to ̃uF is achiev- able at every Γi. If M{n} is covered by only one action of the follower, say action i, this is relatively easy to achieve because the boundary separating (cid:103)BR (i) will be a hyperplane as in Figure 2. However, if more than one action is used to cover M{n}, the shape of the separation surface may become irregular, possibly with vertices sticking out in its interior. We need a more sophisti- cated construction to ensure that these interior points do not yield higher payoffs than the best leader strategies in Γi. (n) and (cid:103)BR Our construction proceeds as follows, where we let x1, . . . , xm1−1 be parameterized by a vector g = (g1, . . . , gm1−1) ∈ Rm1−1. The construction ensures that one optimal strategy of the leader always appears in some Γi, and with fine tuning of g this can further be guaranteed for all Γi. −1 −1 1. Given g = (g1, . . . , gm1−1), let ̃uF g (x, j) := (cid:40)(cid:80)m xi * μ(i, j) i=m1 (cid:80)m1−1 i=1 xi * gi + W * (cid:80)m i=m1 if j ∈ [n − 1]; if j = n. xi where W := mini,j μ(i, j) − 1. 2. For every i ∈ [m1 − 1], pick an arbitrary leader strategy xi such that xi ∈ argmin x∈Γi∩f −1 g (n) xi, 11 (11) (12) 2$+134Γ!%# where fg : ∆m → 2[n] denotes the BR-correspondence of ̃uF g . For simplicity, we omit the dependencies of xi on g in the notation. We shall show soon that the arbitrary choice of xi in (12) suffices for our purpose. Figure 4 provides an illustration of the notions defined above. We show how to find an appropriate g, so that x1, . . . , xm1−1 selected above satisfy the properties in Lemma 4.2. Indeed, the following lemma indicates that Properties (b) and (c) hold as long as we choose g with gi > 0 for all i. Lemma 4.5. xi i > 0 for any choice of g. Moreover, if gi > 0 then Γi ∩ f −1 g (n) (cid:54)= ∅. Proof. For any x ∈ Γi, if xi = 0 then x /∈ f −1 is a cover of {n}. Moreover, if gi > 0, then consider a special x ∈ Γi such that xi = 1 and xk = 0 for all k ∈ [n] \ {i}. It can be verified that x ∈ f −1 g (n) because ̃uF g g (n). Lemma 4.6 shows that the leader's utility on (x, n) for x ∈ Γi only depends on the value of xi. Lemma 4.6. For all x ∈ Γi, it holds that uL(x, n) = c * xi + d for some constants c < 0 and d. Proof. Since x ∈ Γi, we have xk = 0 for all k = [m1 −1]\{i}, and hence uL(x, n) = (cid:80)m uL(k, n)* xk + uL(i, n) * xi. Replacing uL(k, n) with M{n} for all k = m1, . . . , m (by Observation 4.1) and rearranging the terms give the desired result. k=m1 To further ensure Property (a), we define the following set for every g with gi > 0 for all i: Ig := (cid:8)i ∈ [m1 − 1] : (xi, n) is an SSE in game (cid:0)uL, ̃uF (cid:1)(cid:9) . g Clearly, given x1, . . . , xm1−1, Ig can be computed using oracle ASSE. Moreover, Lemma 4.6 implies that argminx∈Γi∩f −1 g (n) uL(x, n), so Ig is well-defined-it is independent of the specific choice of xi in (12). We then aim to find g such that Ig = [m1 − 1], so that Property (a) holds. Theorem 4.7 implies that this can be achieved in polynomial time by inductively applying this result, thus leading to an efficient algorithm for computing x1, . . . , xm1−1. g (n) xi = argmaxx∈Γi∩f −1 . If Ig (cid:54)= [m1 − 1], then there exists g(cid:48) ∈ Qm1−1 Theorem 4.7. Suppose that g ∈ Qm1−1 >0 Ig (cid:40) Ig(cid:48). Moreover, g(cid:48) can be computed in time polynomial in the bit-size of g. Proof sketch. To find g(cid:48), our approach is to increase gi if (xi, n) is not yet an SSE. Intuitively, increas- ing each gi will cause uL(xi, n) to increase, so the hope is that when uL(xi, n) is sufficiently large, (xi, n) becomes an SSE. Attention needs to be paid to the possibility that increasing gi might also cause maxx∈f −1(n)\(∪i∈[m1−1]Γi) uL(x, n) to increase even faster for strategies not in any Γi, so (xi, n) never outperform some (x, n) not in (cid:83) is designed, this possibility can i∈[m1−1] Γi. Thanks to the way ̃uF be eliminated by Lemma 4.8. It indicates that x1, . . . , xm1−1 are representatives of the leader's best choice in f −1 , such that >0 g g (n). The proof is then broken down into the following two cases. • Case 1. If Ig = ∅, we show that by increasing all gi to a sufficiently large number N , some (xi, n) will become an SSE. Moreover, N can be bounded from above by a polynomial in the input size, so we can find a vector g(cid:48) such that g(cid:48) i ≥ N for all i in polynomial time. See Lemma B.1. • Case 2. If Ig (cid:54)= ∅, we show that by increasing gi for an arbitrary i /∈ Ig to an appropriate number (while fixing gk for all k (cid:54)= i), the strategy profile (xi, n) will become a new SSE in addition can be computed in polynomial time. See Lemma B.2. g(cid:48) i to the existing ones. Moreover, g(cid:48) i Lemma 4.8. For any g ∈ Rm1−1 >0 , it holds that maxx∈f −1 g (n) uL(x, n) = maxi∈[m1−1] uL(xi, n). 12 4.2 Computing a Cover of {n} Now we describe how to compute a cover of {n} to complete this section. We first deal with an easy case, where n /∈ S∗ := argminj∈[n] M{j}.5 In this case, any arbitrary (cid:96) ∈ S∗ gives uL(x, (cid:96)) ≤ M{(cid:96)} < M{n} for all x ∈ ∆m. Hence, any payoff matrix in which (cid:96) is a strictly dominant strategy forms a cover of {n}. Using our result in Section 4.1 and Lemma 4.2, we can then compute an. By relabeling n to j, this approach can also be used to find a cover of {j} and obtain aj for any j /∈ S∗. Hence, in what follows we can assume that aj is given for all j ∈ [n] \ S∗. Next, consider the case where n ∈ S∗. To deal with this case, we present a more general result, Theorem 4.9, which finds a cover for any S ⊆ [n]. This method will also be useful for our argument in the next sections, where we need to find a cover for size-2 subsets of [n]. To apply this method requires a base function that make the leader gain at most MS, best responding only actions in S. See the following definition for details. According to this definition, we can simply use a payoff function in which n is a strictly dominant strategy of the follower as the base function for {n}. Definition 5 (Base function). A payoff function ̃uF with BR-correspondence (cid:103)BR is a base function for set S ⊆ [n] if (1) (cid:103)BR(x) ⊆ S for all x ∈ ∆m, and (2) the leader's SSE payoff in game (uL, ̃uF ) is MS. Theorem 4.9. Suppose that S ⊆ [n] and let Q = {j ∈ [n] : M{j} = MS}. Moreover, we are given the following elements: aj for all j ∈ [n] \ (S ∪ Q), a base function ̃uF for S, and MS (as a polytope defined by a set of linear constraints). Then, in polynomial time, we can either compute a cover of S or decide correctly that S does not admit a cover. Proof Sketch. We construct the following payoff function, For every x ∈ ∆m, μ(x, j) := (cid:40) 0, bj * x − cj, otherwise. if j ∈ S; where for each j ∈ [n] \ S, (bj, cj) is a hyperplane such that for any x ∈ ∆m: uL(x, j) ≥ MS ⇐⇒ bj * x ≤ cj. (13) (14) Lemma 4.10 shows that we can efficiently check if μ is a cover of S, and if it is not, then S does not admit any other cover, either. Intuitively, μ aims to bring down the leader's maximum attainable payoff in MS to below MS, so it needs to avoid responses that lead to uL(x, j) ≥ MS when the leader plays x. Eq. (14) ensures this and roughly speaking it creates a "quasi-zero-sum" game on actions j /∈ S. (Ideally, we could just use μ = −uL to fulfill this task if we had the full information of uL.) It then remains to find a way to efficiently compute a set of hyperplanes (bj, cj) satisfying Eq. (14) to finish the construction of μ, which is further demonstrated in the proof of Lemma 4.11 (deferred to Appendix B.6). Lemma 4.10. It can be decided in polynomial time whether the payoff matrix μ defined in Eq. (13) is a cover of S or not. Moreover, if it is not a cover of S, then S does not admit any other cover, either. Lemma 4.11. A hyperplane (bj, cj) satisfying Eq. (14) can be computed in polynomial time for every j ∈ [n] \ S. 5Recall that we can efficiently decide whether n ∈ S∗ or not using ASSE: to compare M{j} and M{j(cid:48)}, pick x ∈ M{j(cid:48)} according to Observation 3.1 and compare it with M{j} according to Observation 3.2. 13 5 Learning J and x∗ We show how to learn J and x∗ in this section. Recall that as outlined in Figure 1, we want to find J ⊆ [n] and x∗ ∈ ∆m, such that uL(x∗, j) = MJ = M[n] for all j ∈ J. First, we highlight several observations that we will use throughout this section. Observation 5.1. The following assumptions are without loss of generality: (a) aj is given for all j ∈ [n], and M{j} > M[n]. (b) 1 ∈ argminj∈[n] M{j}. (c) a1,j (cid:54)= a1,k for some j, k ∈ [m]. Specifically, Observation 5.1(a) results directly from the learning outcome of Section 4. Observa- tion 5.1(b) holds by relabeling action 1 and an arbitrary action in argminj∈[n] M{j}. In the case where Observation 5.1(c) does not hold, we have a1,1 = a1,2 = * * * = a1,m; hence, uL(x, 1) is a constant and uL(x, 1) = M{1} for all x ∈ ∆m. By Observation 5.1(a), it then follows that uL(x, 1) > M[n] for all x ∈ ∆m. According to the desired property of J defined in (7), this means that we can essentially ex- clude all actions that do not satisfy Observation 5.1(c) from our consideration completely-we consider the residue game defined on the remaining action set of the follower after excluding these actions. In addition to the assumptions, when aj is known, we can also assume access to the following oracle AER (Definition 6), which determines if an action j is an SSE response. Specifically, to determine whether j is an SSE response of game (uL, ̃uF ), it suffices to check whether (x, j) is an SSE (by using aj * x(cid:48), so x can ASSE) for an arbitrary x in the set argmax be computed efficiently when aj is known. uL(x(cid:48), j) = argmax x(cid:48)∈ (cid:102)BR x(cid:48)∈ (cid:102)BR (j) (j) −1 −1 Definition 6 (Equilibrium response oracle). Given a game (cid:101)G = (uL, ̃uF ) and an action j ∈ [n] of the follower, the equilibrium response (ER) oracle, denoted AER, outputs whether j is an SSE response of (cid:101)G. To learn J and x∗, we will use the following strategically equivalent payoff matrix ̃uL of the leader, as a surrogate for the original matrix uL: ̃uL(x, j) = (cid:40) γj γ1 W, * aj * x + βj −β1 γ1 , if j ∈ (cid:98)J; otherwise, (15) where W = 1+maxi∈[m],(cid:96)∈ (cid:98)J ̃uL(i, (cid:96)) (a number that is sufficiently large); γj and βj are the parameters that give uL(x, j) ≡ γj * aj * x + βj; and (cid:26) (cid:98)J := j ∈ [n] : min x∈∆m uL(x, j) < M{1} (cid:27) . (16) According to Lemma 5.2, we can compute J and x∗ based on ̃uL instead of the original unknown matrix uL, where we use the notation (cid:102)MS := max x∈∆m min j∈S ̃uL(x, j) for all S ⊆ [n], defined analogously to MS (Eq. (4)). The problem is then equivalent to computing the maximin strategy of ̃uL, which is tractable if all the parameters defining ̃uL are known. Lemma 5.2. For any J ⊆ [n] and x∗ ∈ ∆m, Eq. (7) holds if and only if ̃uL(x∗, j) = (cid:102)MJ = (cid:102)M[n] for all j ∈ J. 14 1. For each j ∈ (cid:98)J, find two reference pairs x1, y1 and x2, y2, such that uL(x1, 1) = uL(y1, j) and uL(x2, 1) = uL(y2, j). [cf. Sections 5.1 and 5.2] 2. Solve Eq. (17) to obtain the quantities γj/γ1 and (βj − β1)/γ1 for each j ∈ (cid:98)J. 3. Construct ̃uL defined in Eq. (15). 4. Compute the maximin value (cid:102)M[n] and maximin strategy x∗ of ̃uL; Output J = {j ∈ (cid:98)J : ̃uL(x∗, j) = (cid:102)M[n]} and x∗. [cf. Lemma 5.2] Figure 5: Summary of the approach to learning J and x∗. It remains to compute the parameters needed for constructing ̃uL, that is, (cid:98)J, γj, and βj. Indeed, (cid:98)J can be efficiently computed by comparing uL(i, j) with M{1} = maxi∈[n] uL(i, 1) for all i, j; these relations are known according to Observation 3.2. Also note that (cid:98)J (cid:54)= ∅, since otherwise we would have M[n] = M{1}, which contradicts Observation 5.1(a). As for γj and βj, we will not learn them directly, but only learn the quantities γj/γ1 and (βj − β1)/γ1. To this end, we will find two different pairs of strategies x1, y1 and x2, y2, such that uL(x1, 1) = uL(y1, j) and uL(x2, 1) = uL(y2, j). This gives the following system of linear equations: (cid:40) γ1 * a1 * x1 + β1 = γj * aj * y1 + βj γ1 * a1 * x2 + β1 = γj * aj * y2 + βj (17) Rearranging the terms, it is easy to see that when x1, x2, y1, and y2 are given (in addition to a1 and aj, which we already know), the above is a system of equations about γj/γ1 and (βj − β1)/γ1; hence, solving the system gives the two desired quantities. We hereafter call each of the two pairs x1, y1 and x2, y2 a reference pair. We in particular look for two reference pairs that make the above equation system non-degenerate, so that it has a unique solution. As a final remark, the reason why we use (cid:98)J instead of [n] is that γj/γ1 and (βj − β1)/γ1 cannot be learned for actions j /∈ (cid:98)J. Indeed, the leader's payoffs for actions not in (cid:98)J is too high, so these actions will not contribute to making the set J such that MJ = M[n]. An overview of the approach to learning J and x∗ is provided in Figure 5. 5.1 Finding the First Reference Pair For ease of description, in what follows, we assume 2 ∈ (cid:98)J and present how to find the reference pairs for computing γ2/γ1 and (β2 − β1)/γ1. The results generalize to any j ∈ (cid:98)J by relabeling 2 to j. Observation 5.3. Without loss of generality, we can assume that 2 ∈ (cid:98)J. Next we show how to find a first reference pair. Recall that we want to find a pair x, y with uL(x, 1) = uL(y, 2). We in particular aim to find a pair such that uL(x, 1) = uL(y, 2) = M{1,2}. ((cid:63)) We use the following payoff function ̃uF d parameterized by a number d ∈ R. 15 a 2 * x = d 1 2 Figure 6: The BR-correspondence of ̃uF d The regions labeled 1 and 2 are f −1 d (1) and f −1 d (1), respectively. . The triangle represents the strategy space ∆m of the leader. For every x ∈ ∆m, let ̃uF d (x, j) =    −1, 0, d − a2 * x, if j ∈ [n] \ {1, 2}; if j = 1; if j = 2. (18) Let fd be the BR-correspondence defined by ̃uF d . It can be verified that f −1 d (1) = {x ∈ ∆m : a2 * x ≥ d} f −1 d (2) = {x ∈ ∆m : a2 * x ≤ d}, and as illustrated in Figure 6. Let Gd := (uL, ̃uF d ) be the game induced by ̃uF d . We then search for a d that makes both actions 1 and 2 SSE responses. Intuitively, when d is suf- ficiently small, the follower responding according to fd leads to action 1 being the sole best response against the entire strategy space ∆m of the leader and hence being the only SSE response of Gd. Con- versely, when d is sufficiently large, action 2 becomes the only SSE response of Gd. Therefore, the goal is to identify a point between these two extremes, where both actions 1 and 2 are SSE responses. This point is exactly d∗ := (M{1,2} − β2)/γ2 (Lemma 5.4). Note that, we cannot compute d∗ directly using the above equation since we do not know any of the values M{1,2}, β2, and γ2. Instead, we will use binary search to find it out: according to Lemma 5.4 presented below, Gd has different SSE responses when d < d∗ and d > d∗, so using the SSE oracle, we can identify whether a candidate value is smaller or larger than d∗. (19) Lemma 5.4. Action 1 is an SSE response of Gd if and only if d ≤ d∗, and action 2 is an SSE response of Gd if and only if d ≥ d∗. Once d∗ is identified, we can compute the first reference pair immediately. Intuitively, both actions 1 and 2 are SSE responses of Gd∗ = (uL, ̃uF d∗ (1) uL(x(cid:48), 1) d∗ (2) uL(y(cid:48), 2) gives uL(x, 1) = uL(y, 2), as desired. The computation of x and y ∈ argmaxy(cid:48)∈f −1 d∗ (1) a1 * x(cid:48), where the constraint (and similarly y) can be handled by solving, equivalently, maxx(cid:48)∈f −1 x(cid:48) ∈ f −1 d∗ (1) is further equivalent to a2 * x(cid:48) ≥ d∗. Hence, the task reduces to solving an LP, which can be done in polynomial time. The following theorem presents a stronger result saying that the strategies in this reference pair yields the maximin payoff of {1, 2} for the leader. d∗). So picking arbitrary x ∈ argmaxx(cid:48)∈f −1 Theorem 5.5. A reference pair x, y ∈ ∆m such that uL(x, 1) = uL(y, 2) = M{1,2} can be computed in polynomial time. 16 a 1 * x = d 1 1 h 2 a 2 * x = d 2 fd1,d2 Figure 7: represents the strategy space ∆m of the leader. The regions labeled 1 and 2 are f −1 d1,d2 f −1 d1,d2 : the BR-correspondence used for finding the second reference pair. The triangle (1) = P1 and (1) = P2, respectively. 5.2 Finding the Second Reference Pair Next, we search for a second reference pair. We aim to find a pair x, y such that uL(x, 1) = uL(y, 2) < M{1,2}. ((cid:63)(cid:63)) Given ((cid:63)), the requirement that the payoffs are strictly smaller than M{1,2} ensures that (17) has a unique solution. Similar to our approach to finding the first reference pair, we aim to construct a BR-correspondence to induce two SSEs (x, 1) and (y, 2). d∗ (1) and f −1 As illustrated in Figure 7, the high-level idea is to pull back the boundaries of the best-response regions f −1 d∗ (2) (where we add a new boundary a1 * x = d1 to the region corresponding to action 1). By pulling back the boundaries by appropriate distances, we can keep the leader's maximum attainable payoffs in these two regions equal, while at the same time they become strictly smaller than M{1,2}; hence, we obtain a pair satisfying ((cid:63)(cid:63)). Hence, the key is to maintain both actions 1 and 2 as SSE responses. The contraction of the best- response regions of these two actions means that a blank region will appear, which needs to be allocated to some response of the follower for the BR-correspondence to be well-defined. In particular, we need a follower action that gives the leader a sufficiently low payoff, so that actions 1 and 2 remain to be SSE responses. Sometimes we cannot find a single action of the follower to fulfill this task so in general we need a cover of {1, 2} which may involve multiple actions. Our main result is stated in Theorem 5.6. To better illustrate the approach, we will first present an algorithm that uses BR-correspondence queries, queries that use games in the form (cid:101)G = (uL, (cid:103)BR), where (cid:103)BR : ∆m → 2[n] is a BR-correspondence. We assume temporarily that ASSE can handle such queries. Ideally, the BR-correspondences used should also be realized by valid payoff matrices, but this is not always the case with the algorithm presented next. Hence, we also design a stronger algorithm that always uses payoff matrices to query the SSE oracle. The process is much more involved but can be better understood based on intuition conveyed from the former, and we leave the details to Appendix E.4. Theorem 5.6. A reference pair x, y ∈ ∆m such that uL(x, 1) = uL(y, 2) < M{1,2} can be computed in polynomial time. 17 5.2.1 Querying by Using BR-correspondences Define the following partition P = (P0, P1, P2) of ∆m, which is parameterized by two numbers d1 and d2: P0(d1, d2) := {x ∈ ∆m : a2 * x ≥ d2 and a1 * x ≥ d1} P1(d1, d2) := {x ∈ ∆m : a2 * x ≥ d2 and a1 * x ≤ d1} P2(d1, d2) := {x ∈ ∆m : a2 * x ≤ d2} (20) (21) (22) For ease of description, we will sometimes omit the dependencies on d1 and d2 and just write P0, P1, and P2 when the parameters are clear from the context. Based on the partition, we define the following BR-correspondence fd1,d2 , which generalizes the BR-correspondence fd defined in the previous section (see (18)). Let fd1,d2 : ∆m → 2[n] be a BR-correspondence such that for every x ∈ ∆m: fd1,d2(x) ⊇    {1} {2} h(x) if and only if x ∈ P1 if and only if x ∈ P2 if and only if x ∈ P0 (23) where h : ∆m → 2[n]\{1,2} is the BR-correspondence of an arbitrary (proper) cover of {1, 2}. Hence, according to this construction, we have f −1 d1,d2 f −1 d1,d2 (j) = Pj (k) ⊆ P0 for all j ∈ {1, 2}, for all k ∈ [n] \ {1, 2}. and Moreover, compared with fd, we have P2(d1, d2) = f −1 d2 Figure 7 illustrates the structure of fd1,d2 . (2), and P1(d1, d2) ∪ P0(d1, d2) = f −1 d2 (1). Our goal is to find two numbers d1 and d2 such that both actions 1 and 2 are SSE responses of Gd1,d2 := (uL, fd1,d2). Before we present our algorithm for computing d1 and d2, we define several other useful notions and make a few observations about fd1,d2 . We define Moreover, let V L d1,d2(j) := max x∈f −1 d1,d2 (j) uL(x, j). d∗ j := (M{1,2} − βj)/γj, (24) (25) for j ∈ {1, 2} (i.e., d∗ with fd∗. Moreover, we have: 2 = d∗ in (19)). It can be verified that when d1 = d∗ 1 and d2 = d∗ 2 , P coincides • P2(d∗ 1, d∗ 2) = f −1 d∗ (2) (cid:54)= ∅, P1(d∗ 1, d∗ 2) = f −1 d∗ (1) (cid:54)= ∅, and P0(d∗ 1, d∗ 2) = M{1,2}; and • for all (cid:12) ∈ {>, <, =} and j ∈ {1, 2}, uL(x, j) (cid:12) M{1,2} if and only if aj * x (cid:12) d∗ j . These two values d∗ and d∗ 2 1 and d2 we aim to find in the domains (−∞, d∗ and d2 < d∗ 2 pair as the first reference pair we obtained. will be useful for our algorithm. Indeed, we search for the two numbers d1 2), respectively. We require that d1 < d∗ 1 , which would yield the same and d2 = d∗ 2 in order to avoid the trivial solution d1 = d∗ 1 1) and (−∞, d∗ 18 requires computing a cover h of {1, 2}. We Existence and Computation of h To obtain fd1,d2 directly invoke Theorem 4.9 presented earlier to accomplish this task. Now that aj is known for all j, to apply this theorem, we only need to supply with a base function for {1, 2}, as well as M{1,2}. Indeed, the function ̃uF 2) defined above fulfills these demands. In the special case where {1, 2} does not admit a cover, Lemma E.1 in the appendix demonstrates that a pair of satisfying J and x∗ can be obtained without a second reference pair. d∗ we obtained in the previous section and the region P0(d∗ 1, d∗ Pinning Down d1 and d2 To find d1 and d2, we first restrict our search in a one-dimensional space: we aim to find a value (cid:15) > 0 such that at least one of actions 1 and 2 are SSE responses of Gd∗ 2−(cid:15). We present the following lemma. 1−(cid:15),d∗ Lemma 5.7. There exists ˆ(cid:15) > 0, such that for all d1 ∈ [d∗ 1 − ˆ(cid:15), d∗ (i) at least one of j ∈ {1, 2} is an SSE response of Gd1,d2; and (ii) V L (j) = γj * dj + βj for j ∈ {1, 2}. d1,d2 1] and d2 ∈ [d∗ 2 − ˆ(cid:15), d∗ 2]: 2 − ˆ(cid:15), such that Gd1,d2 Moreover, assuming ASSE can handle BR-correspondence queries, ˆ(cid:15) is computable in polynomial time. The proof of Lemma 5.7 is deferred to Appendix E.2. Using Lemma 5.7, we obtain d1 = d∗ 1 − ˆ(cid:15) and d2 = d∗ has at least one of actions 1 and 2 as an SSE response. If it happens that both actions 1 and 2 are SSE responses, we are done with a second reference pair. Otherwise, e.g., suppose that action 2 is not an SSE response, it means that we need to expand P2 to increase the leader's maximum attainable payoff for strategies in this region; we do this simply by increasing d2, and we search for a value of d2 that makes both actions 1 and 2 an SSE response. This leads to Theorem 5.8 as a weaker version of Theorem 5.6. The detailed proofs of Theorems 5.6 and 5.8 can be found in the appendix. Theorem 5.8. Assume that ASSE can handle BR-correspondence queries. A reference pair x, y ∈ ∆m such that uL(x, 1) = uL(y, 2) < M{1,2} can be computed in polynomial time. 6 Conclusion Whereas the polynomial-time tractability of the follower's optimal manipulation in Birmpas et al. [2021] assumes full information on the leader's payoffs, we showed that such strict information ad- vantage is not quite necessary: in the learning setting, polynomial number of information exchanges with the leader suffices for the follower to find out the optimal payoff function to report. Our result reveals an interesting difference in the effects of information asymmetry on the two players in a Stackelberg game and points out potential risks of applying strategy commitment under a lack of information: while a leader needs an exponential number of queries to learn a follower's best response correspondence in the worst case [Peng et al., 2019], it only takes the follower a polynomial number of queries to collect enough payoff information of the leader and achieve optimal deception. Thus, special care is needed, when one wants to apply strategy commitment to gain advantage in games but without sufficient information. We note that despite of the SSE oracle defined in our paper, there can be other definitions of oracles, possibly weaker than ours. For example, it may be worth studying oracles that only take a fake payoff function as input and output an SSE according to some underlying tie-breaking rules. This might be more realistic as it is the leader who chooses which equilibrium strategy to play. However, our results do not directly extend to this setting. One insight into this is that, under the weaker oracle, we may lose the ability to check whether the leader utilities under two strategy profiles are equal. Hence, we may not be able to learn the precise quantities necessary for our algorithms. We leave it as an interesting open problem whether there can be an optimal, or a near-optimal algorithm for the follower to learn to deceive when they have access to such weaker oracles. 19 References Jacob D. Abernethy, Rachel Cummings, Bhuvesh Kumar, Sam Taggart, and Jamie Morgenstern. Learn- ing auctions with robust incentive guarantees. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d'Alch ́e-Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neu- ral Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 11587–11597, 2019. 1.1 Kareem Amin, Afshin Rostamizadeh, and Umar Syed. Learning prices for repeated auctions with In Advances in Neural Information Processing Systems (NIPS), pages 1169–1177, strategic buyers. 2013. 1.1 Kareem Amin, Afshin Rostamizadeh, and Umar Syed. Repeated contextual auctions with strategic buyers. In Zoubin Ghahramani, Max Welling, Corinna Cortes, Neil D. Lawrence, and Kilian Q. Weinberger, editors, Advances in Neural Information Processing Systems (NeurIPS), pages 622–630, 2014. 1.1 Maria-Florina Balcan, Avrim Blum, Nika Haghtalab, and Ariel D. Procaccia. Commitment without regrets: Online learning in Stackelberg security games. In Proceedings of the 16th ACM Conference on Economics and Computation (EC), pages 61–78, 2015. 1.1 Georgios Birmpas, Jiarui Gan, Alexandros Hollender, Francisco J Marmolejo-Coss ́ıo, Ninad Rajgopal, and Alexandros A Voudouris. Optimally deceiving a learning leader in stackelberg games. Journal of Artificial Intelligence Research, 72:507–531, 2021. 1, 1, 1, 1.1, 2.1, 2.1, 6 Avrim Blum, Nika Haghtalab, and Ariel D. Procaccia. Learning optimal commitment to overcome In Proceedings of the 28th Conference on Neural Information Processing Systems (NIPS), insecurity. pages 1826–1834, 2014. 1.1 Hongyin Chen, Yukun Cheng, Xiaotie Deng, Wenhan Huang, and Linxuan Rong. Absnft: Securitization and repurchase scheme for non-fungible tokens based on game theoretical analysis. arXiv preprint arXiv:2202.02199, 2022a. 1 Yurong Chen, Xiaotie Deng, and Yuhao Li. Optimal private payoff manipulation against commitment in extensive-form games. In Proceedings of 18th International Conference on Web and Internet Economics (WINE), volume 13778, page 355. Springer, 2022b. 1, 1.1 Vincent Conitzer and Tuomas Sandholm. Computing the optimal strategy to commit to. In Proceedings of the 7th ACM Conference on Electronic Commerce (EC), pages 82–90, 2006. 1.1 Fei Fang and Thanh H Nguyen. Green security games: Apply game theory to addressing green security challenges. ACM SIGecom Exchanges, 15(1):78–83, 2016. 1 Jiarui Gan, Qingyu Guo, Long Tran-Thanh, Bo An, and Michael Wooldridge. Manipulating a learning defender and ways to counteract. In Advances in Neural Information Processing Systems (NeurIPS), pages 8274–8283, 2019a. 1, 1.1 Jiarui Gan, Haifeng Xu, Qingyu Guo, Long Tran-Thanh, Zinovi Rabinovich, and Michael Wooldridge. In Proceedings of the 2019 ACM Conference on Imitative follower deception in Stackelberg games. Economics and Computation (EC), page 639–657, 2019b. 1, 1, 1.1 Negin Golrezaei, Adel Javanmard, and Vahab S. Mirrokni. Dynamic incentive-aware learning: Robust pricing in contextual auctions. Oper. Res., 69(1):297–314, 2021. 1.1 20 Ronald L Graham, Donald E Knuth, Oren Patashnik, and Stanley Liu. Concrete mathematics: a foun- dation for computer science. Computers in Physics, 3(5):106–107, 1989. 2.2 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 (EC), page 917–918, 2022. 1.1 Yoav Kolumbus and Noam Nisan. Auctions between regret-minimizing agents. In Proceedings of the ACM Web Conference 2022, WWW '22, page 100–111, New York, NY, USA, 2022a. Association for Computing Machinery. ISBN 9781450390965. 1.1 Yoav Kolumbus and Noam Nisan. How and why to manipulate your own agent: On the incentives of users of learning agents. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, editors, Advances in Neural Information Processing Systems, 2022b. 1.1 Joshua Letchford, Vincent Conitzer, and Kamesh Munagala. Learning and approximating the optimal strategy to commit to. In International Symposium on Algorithmic Game Theory (SAGT), pages 250– 262, 2009. 1.1 Jinyan Liu, Zhiyi Huang, and Xiangning Wang. Learning optimal reserve price against non-myopic In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicol`o Cesa- bidders. Bianchi, and Roman Garnett, editors, Advances in Neural Information Processing Systems (NeurIPS), pages 2042–2052, 2018. 1.1 Mehryar Mohri and Andres Mu ̃noz Medina. Optimal regret minimization in posted-price auctions with strategic buyers. In Zoubin Ghahramani, Max Welling, Corinna Cortes, Neil D. Lawrence, and Kilian Q. Weinberger, editors, Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pages 1871–1879, 2014. 1.1 Thanh H. Nguyen and Haifeng Xu. In Proceedings of the 28th International Joint Conference on Artificial Intelligence (IJCAI), pages 528–534, 2019. 1, 1.1 Imitative attacker deception in Stackelberg security games. Binghui Peng, Weiran Shen, Pingzhong Tang, and Song Zuo. Learning optimal strategies to commit to. In Proceedings of the 33rd AAAI Conference on Artificial Intelligence (AAAI), pages 2149–2156, 2019. 1.1, 6 Aaron Roth, Jonathan Ullman, and Zhiwei Steven Wu. Watch and learn: Optimizing from revealed In Proceedings of the 48th annual ACM symposium on Theory of Computing preferences feedback. (STOC), pages 949–962, 2016. 1.1 Heinrich von Stackelberg. Marktform und Gleichgewicht. J. Springer, 1934. 1 Bernhard von Stengel and Shmuel Zamir. Leadership with commitment to mixed strategies. CDAM Research Report, LSE-CDAM-2004-01, 2004. 2 Bernhard Von Stengel and Shmuel Zamir. Leadership games with convex strategy sets. Games and Economic Behavior, 69(2):446–457, 2010. 1 21 A Proof of Theorem 3.4 Theorem 3.4. Suppose that the following elements are given: a vector aj satisfying (6) for every j ∈ [n] such that M{j} (cid:54)= M[n]; moreover, J ⊆ [n] and x∗ ∈ ∆m satisfying (7). Then for every j ∈ [n], LP (5) can be solved in polynomial time with query access to ASSE. Proof. Given Lemma 3.3, LP (5) reduces to deciding the inducibility of any given strategy profile (y, k). We demonstrate that this inducibility problem can be solved in polynomial time. Specifically, we will argue that the following algorithm produces an inducibility witness ̃uF for (y, k) in polynomial time: that is, (y, k) is inducible (with respect to uL) if and only if it is an SSE in (uL, ̃uF ). Hence, by querying ASSE to check whether (y, k) is an SSE of (uL, ̃uF ), we can decide the inducibility of (y, k). The stated result then follows. Construct an inducibility witness of (y, k): 1. For every j such that M{j} = M[n], since aj is not given, let aj be a vector in Rm such that: aji = 1 if i ∈ M{j} and aji = 0 otherwise. 2. Construct a payoff matrix ̃uL ∈ Rm×n corresponding to the following payoff function: ̃uL(x, j) =    aj * x − aj * x∗, ak * x − ak * y, 1, if j ∈ J \ {k}; if j = k; otherwise. (8) 3. Decide if (y, k) is inducible with respect to ̃uL: – If it is inducible, compute a payoff matrix ̃uF ∈ Rm×n such that (y, k) is an SSE in ( ̃uL, ̃uF ); – Otherwise, pick an arbitrary ̃uF ∈ Rm×n. 4. Output ̃uF . Namely, the above algorithm constructs a "surrogate" matrix ̃uL using the given information aj, J, and x∗. Then a witness ̃uF is produced using ̃uL. The polynomial run-time of the algorithm is readily seen. In particular, Step 3 can be done in polynomial time according to Theorem 2.1. (Note that all parameters of ̃uL is known, so this is a full-information setting.) We next prove that (y, k) is inducible if and only if it is an SSE in (uL, ̃uF ), where ̃uF is the matrix produced by the above algorithm. Indeed, the "if" direction is trivial, so we prove that if (y, k) is inducible then it must be an SSE in (uL, ̃uF ). Suppose that (y, k) is inducible in the sequel. According to Theorem 2.1, it must be that uL(y, k) ≥ M[n] in this case. In what follows, we first argue that the following statements hold for any x ∈ ∆m (Claim 1). ∀j ∈ J \ {k} : and ̃uL(x, j) > 0 ⇐⇒ aj * x > aj * x∗ ⇐⇒ uL(x, j) > uL(x∗, j); ̃uL(x, k) > 0 ⇐⇒ ak * x > ak * y ⇐⇒ uL(x, k) > uL(y, k). (26) (27) With this result, we can then prove Claim 2 and Claim 3 to complete the proof: Claim 2 implies that Step 3 of the above algorithm outputs a ̃uF that makes (y, k) an SSE of ( ̃uL, ̃uF ), instead of an arbitrary matrix. Given this, Claim 3 further confirms that (y, k) is also an SSE of (uL, ̃uF ). Claim 1. (26) and (27) hold for any x ∈ ∆m. Proof. Note that ̃uL(x, j) > 0 ⇐⇒ aj * x > aj * x∗ and ̃uL(x, k) > 0 ⇐⇒ ak * x > ak * y follow directly by (8), so it remains to prove the second part of each statement. Moreover, if M{j} (cid:54)= M[n] 22 and M{k} (cid:54)= M[n], aj and ak satisfy (6), so it is easy to see that the second part of each statement also holds by expanding uL according to (6). Now consider the case where M{j} = M[n]. We have uL(x∗, j) = M[n] = M{j} ≥ uL(x, j), where uL(x∗, j) = M[n] follows by the definition of x∗ in (7) (and the assumption that j ∈ J), and M{j} ≥ uL(x, j) follows by the definition that M{j} = maxx(cid:48)∈∆m uL(x(cid:48), j). At the same time, uL(x∗, j) = M{j} also implies that x∗ ∈ M{j}. Hence, according to the way aj is defined in Step 1 of the above algorithm, we have x∗ ∈ argmaxx(cid:48)∈∆m aj * x(cid:48) ≥ aj * x. Consequently, both aj * x > aj * x∗ and uL(x, j) > uL(x∗, j) are always false in this case, so (26) holds. Finally, consider the case where M{k} = M[n]. In this case, we can establish M{k} ≥ uL(y, k) ≥ M[n]. Consequently, uL(y, k) ≥ M[n], so we have y ∈ M{k}. Similarly to the above case where M{j} = M[n], we can show that both ak * x > ak * y and uL(x, k) > uL(y, k) must always be false in this case (i.e., by putting y in place of x∗ and k in place of j). Hence, (27) holds. Claim 2. (y, k) is inducible with respect to ̃uL (assuming that (y, k) is inducible with respect to uL). Proof. By construction, ̃uL(y, k) = 0. Hence, by Theorem 2.1, it suffices to show that the maximin value of ̃uL is at most 0, i.e., (cid:102)M[n] := maxx∈∆m minj∈[n] ̃uL(x, j) ≤ 0. Suppose for the sake of contradiction that (cid:102)M[n] > 0. By definition, this means that there exists x ∈ ∆m such that ̃uL(x, j) > 0 for all j ∈ [n]. Applying (26) and (27) gives uL(x, j) > uL(x∗, j) = M[n] for all j ∈ J \ {k} (where uL(x∗, j) = M[n] according to (7)), and uL(x, k) > uL(y, k) ≥ M[n]. It then follows that minj∈J uL(x, j) > M[n], which contradicts the condition in the definition of J, i.e., MJ = M[n]. Claim 3. (y, k) is an SSE of (uL, ̃uF ) (assuming that it is an SSE of ( ̃uL, ̃uF )). Proof. Suppose that (y, k) is an SSE in ( ̃uL, ̃uF ). Let (cid:103)BR be the BR-correspondence of ̃uF . Pick arbitrary x ∈ ∆m and j ∈ (cid:103)BR(x). Since (y, k) is an SSE in ( ̃uL, ̃uF ), by definition, we have ̃uL(x, j) ≤ ̃uL(y, k). Substituting the right hand side with (8), we get that ̃uL(x, j) ≤ ak*y−ak*y = 0. According to (8), this means that j ∈ J ∪ {k}. If j ∈ J \ {k}, then applying (26), we get that uL(x, j) ≤ uL(x∗, j) = M[n] ≤ uL(y, k). (Recall that uL(y, k) ≥ M[n] as (y, k) is inducible). If j = k, then applying (27), we get that Hence, uL(x, j) ≤ uL(y, k) holds in both cases. Since the choice of x and j is arbitrary, we have uL(x, j) = uL(x, k) ≤ uL(y, k). max x∈∆m max j∈ (cid:102)BR(x) uL(x, j) ≤ uL(y, k). It remains to show that k ∈ (cid:103)BR(y). Indeed, according to Claim 2 and Step 3 of the above algorithm, (y, k) must be an SSE in ( ̃uL, ̃uF ), which means that k ∈ (cid:103)BR(y). The proof is complete. 23 B Omitted Proofs in Section 4 B.1 Proof of Lemma 4.3 Lemma 4.3. Given a cover of set S ⊆ [n], a proper cover of S can be constructed in polynomial time. Proof. Suppose that μ is a cover of S. Consider the following matrix μ(cid:48): μ(cid:48)(i, j) = (cid:40) μ(i, j) W if j ∈ [n] \ S if j ∈ S where W := mini,j∈[m]×[n]\S μ(i, j) − 1. We argue that μ(cid:48) is a proper cover of S. Indeed, it is proper since by the above construction no action in S can be a best response to any x ∈ ∆m. It suffices to prove that μ(cid:48) is a cover. Let f and f (cid:48) be the BR-correspondences of μ and μ(cid:48), respectively. Note that for all x ∈ MS, it must be that S ∩ f (x) = ∅. Indeed, if k ∈ S ∩ f (y) and y ∈ MS, we would then have max x∈MS max j∈f (x) uL(x, j) ≥ max j∈f (y) uL(y, j) ≥ uL(y, k) ≥ min j∈S uL(y, j) = MS, contradicting the assumption that μ is a cover. By construction, f (cid:48)(x) = f (x) if S ∩ f (x) = ∅. Hence, f (cid:48)(x) = f (x) for all x ∈ MS. It follows that max x∈MS max j∈f (cid:48)(x) uL(x, j) = max x∈MS max j∈f (x) uL(x, j) < MS. Hence, μ(cid:48) is a cover of S. B.2 Proof of Lemma 4.4 Lemma 4.4. For any S ⊆ [n], a cover of S exists if and only if MS > M[n]. Proof. We first prove the necessity. Suppose a cover μ of S exists. According to the definition of a cover, for any x ∈ MS, there exists j ∈ [n] \ S, such that uL(x, j) < MS. Thus, for all x ∈ MS, we have Meanwhile, for all x /∈ MS, uL(x, k) ≤ uL(x, j) < MS. min k∈[n] min k∈[n] uL(x, k) ≤ min k∈S uL(x, k) < MS. Thus, M[n] = maxx∈∆m minj∈[n] uL(x, j) < MS. Next, consider the sufficiency. Suppose that MS > M[n]. We show that a function μ such that μ(i, j) = −uL(i, j) is a cover of S. Let f be the BR-correspondence of μ. By construction, argmaxk∈[n] μ(x, k) = argmink∈[n] uL(x, k) for any x ∈ ∆m, so j ∈ f (x) implies that uL(x, j) = mink∈[n] uL(x, k). It fol- lows that uL(x, j) = min k∈[n] for all x ∈ ∆m. Thus, maxx∈MS minj∈f (x) uL(x, j) < MS, which completes the proof. uL(x, k) ≤ M[n] < MS 24 B.3 Formal Proof of Theorem 4.7 We first present the proof of Lemma 4.8, then the proof is completed by Lemma B.1 and Lemma B.2, which solves the cases of Ig = ∅ and Ig (cid:54)= ∅ respectively. Lemma 4.8. For any g ∈ Rm1−1 >0 , it holds that maxx∈f −1 g (n) uL(x, n) = maxi∈[m1−1] uL(xi, n). g (n) lies in some Γi, i ∈ [m1 − 1]; in other words, v ∈ Proof. We prove that every vertex v of f −1 g (n) xi. Hence, v ∈ Γi ∩ f −1 g (n). Recall that xi ∈ argminx∈Γi∩f −1 g (n) implies that xi i ≥ vi, and Γi ∩ f −1 in turn, uL(x, n) ≤ uL(xi, n) according to Lemma 4.6. Since maxx∈f −1 g (n) uL(x, n) is always attained at some vertex of f −1 g (n), the stated result then follows. Pick an arbitrary vertex v of f −1 uniquely defined by them. By definition, f −1 corresponding to a hyperplane: g (n). Since v ∈ Rm, it lies in m hyperplanes of f −1 g (n) and is g (n) is defined by the following linear constraints, each x1 + * * * + xm = 1 xi ≥ 0 g (x, n) ≥ ̃uF ̃uF g (x, j) for all i ∈ [m] for all j ∈ [n − 1] (28a) (28b) (28c) Hence, without loss of generality, we can assume that the m hyperplanes defining v corresponds to the following coefficient matrix A:                        1 1 g1 ... g1          (cid:96)1 (cid:96)2 k * * * 1 * * * 1 . . . 1 1 1 . . . 1 * * * * * * ̃μ(m, 1) ... ̃μ(m, k) * * * * * * gm1−1 ... gm1−1 ̃μ(m1, 1) ... ̃μ(m1, k)                        (cid:111) (28a)       (28b) (28c) where we let ̃μ(i, j) = W − μ(i, j) for all i, j. Namely, A * v = b, where b is the vector of the constant terms in (28). In what follows, we let Ai:j denote the submatrix formed by the i-th to the j-th rows of A; and let Ai:j denote the submatrix formed by the i-th to the j-th columns. Since v is uniquely defined by A, we have rank (A) = m. We next argue that (cid:96)1 ≥ m1 − 2 to complete the proof. This indicates that for at least m1 − 2 actions i ∈ [m1 − 1], we have that vi = 0. In other words, vi > 0 for at most one i ∈ [m1 − 1], so by definition this means that v ∈ Γi for some i ∈ [m1 − 1]. Suppose for the sake of contradiction that (cid:96)1 ≤ m1 − 3. Hence, (cid:96)2 + k = m − (cid:96)1 − 1 ≥ m − m1 + 2. Let U =    ̃μ(m1 + (cid:96)2, 1) ... ̃μ(m1 + (cid:96)2, k) * * * * * *    ̃μ(m, 1) ... ̃μ(m, k) be a submatrix of A, and let v(cid:48) = (vm1+(cid:96)2−1, . . . , vm). Hence, U is a k-by-k(cid:48) matrix, with k(cid:48) ≤ k − 1. 25 We have U * v(cid:48) = 1 * λ, where λ = (cid:80)m1−1 gi * vi. Note that v(cid:48) is a size-k(cid:48) vector, so it must be that rank (cid:0)U | 1(cid:62)(cid:1) ≤ k(cid:48) ≤ k − 1 (otherwise, the system of linear equations U * x = 1 * λ would have no solution). Note that via linear transformation, the submatrix Am−k+1,m can be transformed into (cid:0)O 1(cid:62) U (cid:1), where O denotes a k-by-(m1 + (cid:96)2 − 2) matrix with all entries being 0. Hence, we get that i=1 Consequently, rank (Am−k+1,m) = rank (cid:16) O 1(cid:62) U ≤ k − 1. (cid:17) rank (A) ≤ rank (A1:m−k) + rank (Am−k+1:m) ≤ (m − k) + (k − 1) < m, which contradicts the fact that rank (A) = m. Lemma B.1. There exists N > 0, such that Ig (cid:54)= ∅ if gi ≥ N for all i ∈ [m1 − 1]. Moreover, N can be computed in polynomial time. Proof. Given Lemma 4.8, it suffices to find a value N and prove that action n is an SSE response of game (uL, ̃uF g ) if gi ≥ N for all i ∈ [m1 − 1]. Let D = maxi,j,i(cid:48),j(cid:48) |uL(i, j) − uL(i(cid:48), j(cid:48))|. For every x ∈ ∆m, we have uL(x, n) = (cid:32) xi * uL(i, n) + 1 − m1−1 (cid:88) i=1 m1−1 (cid:88) i=1 (cid:33) xi * M{n} ≥ M{n} − (cid:32)m1−1 (cid:88) (cid:33) xi * D, i=1 where we used the fact that uL(i, n) ≥ M{n} − D for all i. Moreover, let i,j where h is the BR-correspondence of μ. For every j ∈ [n − 1], U = max uL(i, j) and T = max x∈M{n},j∈h(x) uL(x, j), uL(x, j) = m1−1 (cid:88) xi * uL(i, j) + m (cid:88) i=m1 xi * uL(i, j) i=1 (cid:32)m1−1 (cid:88) ≤ i=1 (cid:33) (cid:32) xi * U + 1 − m1−1 (cid:88) i=1 (cid:33) xi * T = (cid:32)m1−1 (cid:88) i=1 (cid:33) xi * (U − T ) + T. Recall that since μ is a cover of {n}, by definition T < M{n}. So if it holds that fg(x) = {n} for every x such that c := M{n} − T D + U − T < m1−1 (cid:88) i=1 xi, we know that n must be an SSE response of (uL, ̃uF leads to g ); indeed, for all y such that (cid:80)m1−1 i=1 yi ≤ c, this uL(y, j) ≤ T + c * (U − T ) = M{n} − c * D ≤ max x∈f −1 g (n) uL(x, n) for all j ∈ [n − 1]. It suffices to let gi ≥ N := 1 − c c * (cid:18) max i,j (cid:19) μ(i, j) − W for every i ∈ [m1 − 1] to ensure this, so any N ≥ N satisfies the condition in the statement of this lemma. To compute N , we can start from an arbitrary value N > 0 and g = (N, . . . , N ). We query oracle g ). Set N ← 2 * N and g ← (N, . . . , N ), and repeat the ASSE to check if n is an SSE response of (uL, ̃uF step if it is not. This way, we can find a value N ≥ N in time log(N ). 26 Lemma B.2. Suppose that Ig (cid:54)= ∅ and i ∈ [m1 − 1] \ Ig. There exists g∗ > 0, such that Ig(cid:48) = Ig ∪ {i}, where g(cid:48) = (g1, . . . , gi−1, g∗, gi+1, . . . , gm1−1). Moreover, g(cid:48) can be computed in polynomial time. Proof sketch. Let u∗ − (1 − y∗ i ) * W g∗ = y∗ i , (29) where u∗ and y∗ are the optimal solution to the following LP, where V := maxj∈[n] maxx∈f −1 is the leader's SSE payoff in (uL, ̃uF g (j) uL(x, j) g ). min u,y∈∆m u subject to y ∈ Γi ̃uF g (y, j) ≤ u uL(y, n) = V for all j ∈ [n − 1] (30) (30a) (30b) (30c) We demonstrate the following results to complete the proof; the omitted details can be found in the appendix. • g∗ is well-defined (Lemma B.3), i.e., LP (30) is feasible and bounded, and y∗ i > 0. • g∗ > gi, so that by setting gi to g∗ we indeed increases its value (Lemma B.5). This is important because it means that gi > 0 still holds after the value change, so that we can apply Theorem 4.7 inductively. • Finally, let (g(cid:48), g−i) = (g1, . . . , gi−1, g(cid:48), gi+1, . . . , gm1−1). Then g(cid:48) = g∗ is the only point where Ig(cid:48) = Ig ∪ {i} (Lemma B.6). This means that we can use binary search to pin down g∗. In particular, since g∗ is derived immediately from the solution to LP (30), its bit-size is bounded by a polynomial in the size of the LP. We can find g∗ in polynomial time. Note that we cannot compute g∗ directly using the expression (29) because LP (30) involves unknown parameters. B.4 Proof of Lemma B.2: Omitted Results Lemma B.3. LP (30) is feasible and bounded, and y∗ Proof. Notice that (30) is equivalent to computing the minimal value of maxj∈[n−1] ̃uF g (y, j) with y satisfying (30a) and (30c). It is feasible and bounded if there exists y ∈ Γi such that uL(y, n) = V . Note that for all y ∈ Γi, we have i > 0. uL(y, n) = yi * uL(i, n) + (1 − yi) * M{n}. Let z be an arbitrary point such that (cid:80)m k=m1 zk = 1 (hence z ∈ Γi). • When y = z, we have uL(y, n) = M{n}. • When y = xi, we have uL(y, n) = uL(xi, n) < V as (xi, n) is not an SSE by assumption. By definition (i.e., (12)), xi ∈ Γi. By assumption Ig (cid:54)= ∅, so (xk, n) is an SSE response for some k ∈ [m1 − 1]. Hence, by definition, V = uL(xk, n) < max x∈Γi uL(x, n) ≤ M{n}, where uL(xk, n) < maxx∈Γk uL(x, n) follows by the fact that uL(x, n) decreases with xk in the space k > 0 (Lemma 4.5). Therefore, by continuity, there must exist y ∈ Γi such that Γk (Lemma 4.6), and xk uL(y, n) = V . Moreover, for all such y, yi > 0 as otherwise uL(y, n) = M{n} > V . 27 Lemma B.4. uL(xi, n) increases strictly with gi. Proof. Pick two arbitrary values g(cid:48), g(cid:48)(cid:48) ∈ R such that g(cid:48) < g(cid:48)(cid:48). Let g(cid:48) = (g1, . . . , gi−1, g(cid:48), gi+1, gm1−1) g(cid:48)(cid:48) = (g1, . . . , gi−1, g(cid:48)(cid:48), gi+1, gm1−1). and Let x(cid:48)k and x(cid:48)(cid:48)k denote the critical points defined with respect to g(cid:48) and g(cid:48)(cid:48), respectively (i.e., (12)). Suppose for the sake of contradiction that uL(x(cid:48)i, n) ≥ uL(x(cid:48)(cid:48)i, n). By Lemma 4.6, uL(x(cid:48)i, n) ≥ uL(x(cid:48)(cid:48)i, n) implies that x(cid:48) i i ≤ x(cid:48)(cid:48) i i. Moreover, g(cid:48)(x(cid:48)i, n) = g(cid:48) * x(cid:48) ̃uF i i + < g(cid:48)(cid:48) * x(cid:48) i i + m (cid:88) k=m1 m (cid:88) k=m1 x(cid:48) k i * W x(cid:48) k i * W = ̃uF g(cid:48)(cid:48)(x(cid:48)i, n), (31) where we used the fact that x(cid:48) i i > 0 (Lemma 4.5). Since n ∈ fg(cid:48)(x(cid:48)i), by definition ̃uF g(cid:48)(x(cid:48)i, n) ≥ ̃uF g(cid:48)(x(cid:48)i, j) for all j ∈ [n − 1]. Hence, using (31), we have g(cid:48)(cid:48)(x(cid:48)i, n) > ̃uF ̃uF g(cid:48)(x(cid:48)i, n) ≥ ̃uF g(cid:48)(x(cid:48)i, j) = ̃uF g(cid:48)(cid:48)(x(cid:48)i, j), where the last equality holds since ̃uF g (*, j) does not depend on g by construction. This means that g(cid:48)(cid:48)(x, j) for x in a neighborhood N of x(cid:48)i. Since x(cid:48) i > 0, x(cid:48)i must lie in the relative g(cid:48)(cid:48)(x, n) > ̃uF ̃uF i i. We then establish the following interior of Γi. So N ∩ Γi must contain a point x such that xi < x(cid:48) i contradictory transitions: min y∈Γi∩f −1 g(cid:48) (n) yi ≤ xi < x(cid:48) i i = min y∈Γi∩f −1 g(cid:48) (n) yi. This completes the proof. Hereafter, we let g∗ = (g1, . . . , gi−1, g∗, gi+1, gm1−1), and let x∗k be the critical points defined with respect to g∗ (i.e., (12)). Lemma B.5. uL(x∗i, n) = V , and thus g∗ > gi. Proof. According to Lemma B.4, since uL(xi, n) increases strictly with gi, if uL(x∗i, n) = V > uL(xi, n), then g∗ > gi. Since y∗ ∈ Γi (by (30a)), we have g∗(y∗, n) = y∗ ̃uF i * g∗ + (1 − y∗ i ) * W = u∗. Note that ̃uF have g(cid:48)(*, j) is not dependent on g(cid:48) for all j ∈ [n − 1]. Hence, since y∗ and u∗ satisfy (30b), we g∗(y∗, j) ≤ u∗, for all j ∈ [n − 1]. ̃uF g∗(y∗, j) for all j ∈ [n], which means that y∗ ∈ f −1 As a result, ̃uF we have uL(x∗i, n) ≥ uL(y∗, n) = V , where uL(y∗, n) = V follows by (30c). g∗(y∗, n) ≥ ̃uF g∗ (n). Using Lemma 4.6, To see that uL(x∗i, n) ≤ V , suppose for the sake of contradiction that uL(x∗i, n) > V . Since uL(y∗, n) = V , using Lemma 4.6 again, we have that x∗ i i < y∗ i . Consider a point z = λ * x∗i + (1 − λ) * ei, 28 where λ ∈ [0, 1], and ei = (ei ei are in Γi, we have z ∈ Γi. Moreover, since ei zi = y∗ i , and in turn 1, . . . , ei m) such that ei i = 1 and ei i = 1 ≥ y∗ i k = 0 for all k (cid:54)= i. Since both x∗i and , there exists λ ∈ [0, 1) with which we have (32) (33) g∗(z, n) = ̃uF ̃uF g∗(y∗, n) = u∗, and Meanwhile, note that for all j ∈ [n − 1], we have uL(z, n) = uL(y∗, n) = V. g∗(ei, n) = g∗ > 0 = ̃uF ̃uF g∗(ei, j), In addition, since x∗i ∈ f −1 g∗ (n), by definition we have g∗(x∗i, n) ≥ ̃uF ̃uF g∗(x∗i, j). Consequently, since λ < 1, we must have g∗(z, n) > ̃uF ̃uF g∗(z, j). Plugging into (32) gives ̃uF g∗(z, j), u∗). The fact that z ∈ Γi and uL(z, n) = V (i.e., (33)) we showed above implies that u and z form a feasible solution to LP (30). The objective value of this solution, i.e., u, is strictly smaller than u∗, which is a contradiction. This completes the proof of Lemma B.5. g∗(z, j) < u∗ for all j ∈ [n − 1]. Pick u ∈ [maxj∈[n−1] ̃uF Lemma B.6. Ig(cid:48) = Ig if g(cid:48) ∈ [gi, g∗), Ig(cid:48) = {i} if g(cid:48) > g∗, and Ig(cid:48) = Ig ∪ {i} if g(cid:48) = g∗. Proof. We first argue that the following results hold for any g(cid:48) ≥ gi. (i) maxx∈f −1 g(cid:48) (j) uL(x, j) ≤ maxx∈f −1 (ii) uL(x(cid:48)k, n) = uL(xk, n), for all k ∈ [m1 − 1] \ {i}. g (j) uL(x, j), for all j ∈ [n − 1]; and In words, (i) says that the leader's payoffs for inducing a best response j ∈ [n − 1] does not increase with gi; (ii) says that the leader's payoffs for (xk, n), k (cid:54)= i, does not change with gi. To see (i), note that by construction, ̃uF g (x, j) does not depend on gi for all j ∈ [n − 1]. Moreover, g (x, n) for all x ∈ ∆m. Therefore, any leader strategy x that does g (j), so (i) follows g(cid:48), either. We have f −1 g(cid:48) (j) ⊆ f −1 does not induce j under ̃uF now that g(cid:48) ≥ gi, ̃uF g(cid:48)(x, n) ≥ ̃uF not induce j under ̃uF g immediately. To see (ii), note that ̃uF g does not depend on gi in the space Γk, k (cid:54)= i. Hence, Γk ∩ f −1 g(cid:48) (n) = Γk ∩ f −1 g (n). By Lemma 4.6, the statement then follows. We proceed with the proof. By assumption, Ig (cid:54)= ∅ and we can assume that 1 ∈ Ig. Hence, uL(x1, n) = V . The statements above then imply that max j∈[n−1] max x∈f −1 g(cid:48) (j) uL(x, j) ≤ max j∈[n−1] max x∈f −1 g (j) uL(x, j) ≤ V = uL(x1, n) = uL(x(cid:48)1, n) ≤ max x∈f −1 g(cid:48) (n) uL(x, n), where maxj∈[n−1] maxx∈f −1 maxx∈f −1 g(cid:48) (n) uL(x, n) since x(cid:48)−1 ∈ f −1 max x∈f −1 max j∈[n] g(cid:48) (j) g (j) uL(x, j) ≤ V follows by the definition of the SSE, and uL(x(cid:48)1, n) ≤ g(cid:48) (n) by definition. This further means that uL(x, j) = max x∈f −1 g(cid:48) (n) uL(x, n), 29 and applying Lemma 4.8, we get that max k∈[m1−1] uL(x(cid:48)k, n) = max j∈[n] uL(x, j). max x∈f −1 g(cid:48) (j) Consequently, • when g(cid:48) ∈ [gi, g∗), we have maxk∈[m1−1] uL(x(cid:48)k, n) = V > uL(x(cid:48)i, n); • when g(cid:48) = g∗, we have maxk∈[m1−1] uL(x(cid:48)k, n) = V = uL(x(cid:48)i, n); and • when g(cid:48) > g∗, we have maxk∈[m1−1] uL(x(cid:48)k, n) = uL(x(cid:48)i, n) > V . Lemma B.6 then follows. B.5 Proof of Lemma 4.10 Lemma 4.10. It can be decided in polynomial time whether the payoff matrix μ defined in Eq. (13) is a cover of S or not. Moreover, if it is not a cover of S, then S does not admit any other cover, either. Proof. To decide whether μ is a cover of S, we check the satisfiability of the following linear constraints (by assumption of Theorem 4.9, MS is given as a set of linear constraints): x ∈ MS μ(x, j) ≤ 0 for all j ∈ [n] which can be done in polynomial time. Specifically: • If the constraints are satisfiable, then there exists y ∈ MS such that μ(y, j) ≤ 0 = μ(y, k) for all j ∈ [n], k ∈ S; hence, k ∈ h(y), where h denotes the BR-correspondence of μ. We have max x∈MS ,j∈h(x) uL(x, j) ≥ uL(y, k) ≥ min j∈S uL(x, j) = MS. By definition, this means that μ is not a cover of S. • Conversely, suppose that the constraints are not satisfiable. Pick arbitrary x ∈ MS and j ∈ h(x). Hence, μ(x, j) > 0, and according to the definition of μ, it must be that j /∈ S. We have μ(x, j) = bj * x − cj > 0, which implies that uL(x, j) < MS by (14). Since the choice of x and k is arbitrary, we then have max x∈MS ,j∈h(x) uL(x, j) < MS, so μ is a cover of S. Next, consider the second part of the statement. Suppose that S admits a cover. We show that μ must be a cover of it. According to the necessary condition demonstrate in Lemma 4.4, we have MS > M[n]. Hence, for any x ∈ MS, minj∈[n] uL(x, j) ≤ M[n] < MS, which means that there exists j ∈ [n] \ S such that uL(x, j) < MS. By (14), we then have bj * x > cj, which means Namely, the linear constraints we presented above are not satisfiable. Therefore, μ is a cover of S. μ(x, j) = bj * x − cj > 0. 30 B.6 Proof of Lemma 4.11 Lemma 4.11. A hyperplane (bj, cj) satisfying Eq. (14) can be computed in polynomial time for every j ∈ [n] \ S. Proof. Without loss of generality, we show how to learn bn and cn, and we assume that n /∈ S. We first define the following parameters: ˇd := min x∈MS aj * x, ˆd := max x∈MS aj * x, and d∗ := (MS − βn)/γn. Then specify bn and cn as follows: • If n /∈ Q, we let bn = an and cn =    ˇd − 1, d∗, ˆd, an is given if n /∈ S ∪ Q.) (cid:40) • If n ∈ Q, we let bn,i = if uL(i, n) = M{n} 1, 0, otherwise . (By assumption of Theorem 4.9, if d∗ < ˇd; if d∗ ∈ [ ˇd, ˆd]; if d∗ > ˆd. , and cn = ˇd. Note that ˇd and ˆd can be computed directly given that MS is known (by assumption of The- orem 4.9). Nevertheless, d∗ cannot be computed directly since βn, γn, and MS are unknown. To complete the proof, we show how to learn d∗ next. Define the following payoff function parameterized by a number d. For every x ∈ ∆m, ̃uF d (x, j) := (cid:40) ̃uF (x, j), ̃uF (x, k) + (d − bn * x), if j ∈ [n − 1]; if j = n; (34) where we use arbitrary k ∈ argmax(cid:96)∈[n−1] ̃uF (z, (cid:96)), defined with arbitrarily selected z ∈ Z(d) := {x ∈ MS : bn * x = d} . z is well-defined if d ∈ [ ˇd, ˆd]. d ) if and only if d ≥ d∗, so that we can use We argue that n is an SSE response of the game (uL, ̃uF binary search to find out d∗ (or find out if d∗ < ˇd or d∗ ≥ ˆd, in which case we only need ˇd and ˆd to compute bn and cn as defined above). Denote the BR-correspondences of ̃uF d and ̃uF as fd and f , respectively. Note the following facts: (a) fd(z) = f (z) ∪ {n}. (b) f −1 d (j) ⊆ f −1(j) for all j ∈ [n − 1]. d (n) bn * x = d if d ∈ [ ˇd, ˆd]. (d) uL(x, j) = MS for all x ∈ MS and j ∈ f (x). (c) maxx∈f −1 Indeed, (a) can be verified by comparing ̃uF d (z, j), j ∈ [n − 1], with ̃uF (z, n). (b) is due to the fact that f −1(n) = ∅ according to the property of ̃uF as a base function. 31 To see (c), note that n ∈ fd(z) implies that max x∈f −1 d (n) bn * x ≥ bn * z = d. Moreover, for all x ∈ f −1 d (n), ̃uF d (x, n) ≥ max j∈[n−1] ̃uF d (x, j) = max j∈[n−1] ̃uF (x, j) ≥ ̃uF (x, k), which implies bn * x ≤ d according to (34). Hence, maxx∈f −1 bn * x = d. d Finally, if (d) did not hold, then uL(x, j) (cid:54)= MS for some x ∈ MS and j ∈ f (x). Since ̃uF is a base function, by definition, j ∈ f (x) ⊆ S. Moreover, x ∈ MS means that mink∈S uL(x, k) = MS, so we must have uL(x, j) > MS, which contradicts the definition of a base function. For each j ∈ [n], define V L d (j) := max x∈f −1 which is the leader's maximum attainable payoff for inducing a follower response j. According to (b), for all j ∈ [n − 1], we have uL(x, j), d (j) V L d (j) ≤ max j(cid:48)∈[n] max x∈f −1(j(cid:48)) uL(x, j(cid:48)) = MS, where the second transition follows by the property of ̃uF as a base function. Moreover, pick arbitrary j ∈ f (z); by (a), (d), and the fact that z ∈ MS, we get that max j(cid:48)∈[n−1] d (j(cid:48)) ≥ uL(x, j) = MS. V L Therefore, maxj(cid:48)∈[n−1] V L d (j(cid:48)) = MS. By (c), we also have := V L d (n) = γn * d + βn if d ∈ [ ˇd, ˆd]. It follows that Φ(d) := V L d (n) − max j∈[n−1] V L d (j) = γn * d + βn − MS is continuous and strictly increasing with respect to d. We can then use binary search and oracle ASSE to pin down d∗ (or decide if d∗ < ˇd or d∗ > ˆd): n is an SSE response of (uL, ̃uF d ) if and only if d ≥ d∗; meanwhile, there exists an SSE response j ∈ [n − 1] if and only if d ≤ d∗. C Omitted Proofs in Section 5 C.1 Proof of Lemma 5.2 Lemma 5.2. For any J ⊆ [n] and x∗ ∈ ∆m, Eq. (7) holds if and only if ̃uL(x∗, j) = (cid:102)MJ = (cid:102)M[n] for all j ∈ J. Proof. Note that for all j ∈ [n], we have uL(x∗, j) = M[n] =⇒ j ∈ (cid:98)J, ̃uL(x∗, j) = (cid:102)M[n] =⇒ j ∈ (cid:98)J. and (35) (36) Specifically, (35) follows by the definition of (cid:98)J: if j /∈ (cid:98)J, then by definition we have M{1} ≤ minx∈∆m uL(x, j); hence, M[n] < M{1} ≤ min x∈∆m uL(x, j) ≤ uL(x∗, j) 32 (where M[n] < M{1} is due to Observation 5.1(a)). Moreover, if j /∈ (cid:98)J, according to (15), we have ̃uL(x∗, j) = W > max x∈∆m min k∈[n] ̃uL(x, k) = (cid:102)M[n]. Hence, (36) holds. For all j ∈ (cid:98)J, we have ̃uL(x, j) = γj γ1 * aj * x + βj − β1 γ1 = uL(x, j)/γ1 − β1/γ1, which means that the following two statements are equivalent: uL(x∗, j) = max x∈∆m ̃uL(x∗, j) = max x∈∆m min k∈J min k∈J uL(x, k) = max x∈∆m ̃uL(x, k) = max x∈∆m min k∈[n] min k∈[n] uL(x, k), ̃uL(x, k). and (37) (38) That is, for all j ∈ (cid:98)J, (37) ⇐⇒ (38). Using this equivalence and (35) and (36), we establish the following transitions to complete the proof: ∀j ∈ J : uL(x∗, j) = MJ = M[n] ⇐⇒ J ⊆ (cid:98)J, and ∀j ∈ J : uL(x∗, j) = max x∈∆m ⇐⇒ J ⊆ (cid:98)J, and ∀j ∈ J : ̃uL(x∗, j) = max x∈∆m ⇐⇒ ∀j ∈ J : ̃uL(x∗, j) = (cid:102)MJ = (cid:102)M[n]. min k∈J min k∈J uL(x, k) = max x∈∆m ̃uL(x, k) = max x∈∆m min k∈[n] min k∈[n] uL(x, k) ̃uL(x, k) D Omitted Proofs in Section 5.1 D.1 An Useful Observation Used in All proofs In all the proofs in Section 5.1, we make the following key assumption to ease our presentation. Lemma D.1. Without loss of generality, we can assume that there exists i ∈ I2 such that uL(i, 2) > uL(i, 1). (Recall that Ij := argmaxi(cid:48)∈[m] uL(i(cid:48), j) for all j ∈ [n].) Proof. To see the rationale of this assumption, consider the case where it does not hold, i.e., uL(i, 1) ≥ uL(i, 2) for all i ∈ I2. By Observation 5.1(b), M{2} ≥ M{1}; hence, we have M{1} ≥ uL(i, 1) ≥ uL(i, 2) = M{2} ≥ M{1}, where uL(i, 2) = M{2} since i ∈ I2. This means M{1} = M{2} and uL(i, 1) = uL(i, 2) for all i ∈ I2. So I2 ⊆ I1. Hence, if there exists i ∈ I1 such that uL(i, 1) > uL(i, 2), we can exchange the roles of actions 1 and 2 so that all the assumptions made will hold (in particular, M{1} = M{2} means that Observa- tion 5.1(b) still holds as 2 ∈ argminj∈[m] M{j}). We can then proceed with the subsequent algorithm and eventually learn γ1/γ2 and (β1 − β2)/γ2-from which the original target quantities γ2/γ1 and (β2 − β1)/γ1 can be derived readily. If otherwise uL(i, 1) ≤ uL(i, 2) for all i ∈ I1, then we have M{1} = uL(i, 1) ≤ uL(i, 2) ≤ M{2}, so it must be that uL(i, 1) = uL(i, 2) for all i ∈ I1. Given that I2 ⊆ I1 as we argued, we have I2 = I1 in this case. We further consider the following possibilities: 33 • Ij = I1 for all j ∈ (cid:98)J. Pick arbitrary i ∈ I1, we then have uL(i, j) = M{j} ≥ M{1} for all j ∈ (cid:98)J; moreover, according to the definition of (cid:98)J, uL(i, j) ≥ M{1} for all j /∈ (cid:98)J. We get that minj∈[n] uL(i, j) ≥ M{1} . It follows that M[n] = maxx∈∆m minj∈[n] uL(x, j) ≥ minj∈[n] uL(i, j) ≥ M{1}, which contradicts Observation 5.1(a). • Ij (cid:54)= I1 for some j ∈ (cid:98)J (and hence, Ij (cid:54)= I2). This means that we are able to learn γj/γi and (βj − βi)/γi for both i ∈ {1, 2} with our subsequent algorithm (i.e., by putting j in place of action 2 and i in place of action 1). We can then derive γ2/γ1 and (β2 − β1)/γ1 as follows: γ2/γ1 = γj/γ1 γj/γ2 , and β2 − β1 γ1 = βj − β1 γ1 − βj − β2 γ2 * γ2 γ1 . D.2 Proof of Lemma 5.4 Lemma 5.4. Action 1 is an SSE response of Gd if and only if d ≤ d∗, and action 2 is an SSE response of Gd if and only if d ≥ d∗. To prove Lemma 5.4, we define V L d (j) := max x∈f −1 d (j) uL(x, j) (39) for each j ∈ [n], which is the maximum payoff the leader can obtain by inducing the follower to respond d (j) = −∞ if f −1 d (j) = ∅ for all j ∈ [n] \ {1, 2}, with j. We also let V L d (2) if and only if d ≤ d∗ and so only actions 1 and 2 can be SSE responses. We prove that V L d (2) if and only if d ≥ d∗. Indeed, in the case where d = d∗ the following lemma shows d (1) ≤ V L V L that V L d (j) = ∅. By construction f −1 d (1) ≥ V L d∗(1) = V L Lemma D.2. V L d∗(2) = M{1,2}. d∗(1) = V L d∗(2) = M{1,2}. We defer the proof of Lemma D.2 to Appendix D.3 and proceed with the proof of Lemma 5.4. Proof of Lemma 5.4. Clearly, V L d∗(2) according to Lemma D.2. Hence, it suffices to prove that V L V L d (1) < V L V L d (2) for all d > d∗. If d < d∗, then by construction we have a2*x ≤ d < d∗ for all x ∈ f −1 d (1) is non-increasing with respect to d. Moreover, we have V L d (1) > V L d∗(1) = d (2) for all d < d∗, and d (2). Hence, maxx∈f −1 d (2) a2* x < d∗, and d (2) < γ2 * d∗ + β2 = M{1,2} = V L V L d∗(1) ≤ V L d (1), where V L d∗(1) ≤ V L d (1) as V L If d > d∗, consider the following two cases. d (1) is non-increasing with respect to d. • f −1 • f −1 d (1). d (1) = ∅. Then it follows immediately that V F d (1) (cid:54)= ∅. Pick arbitrary x ∈ f −1 d∗(2) = M{1,2}, there exists y ∈ ∆m such that uL(y, 2) = M{1,2}, which means that a2*y = (M{1,2}−β2)/γ2 = d∗ < d. Hence, there exists a convex combination z of x and y such that a2 * z = d. We have z ∈ f −1 d (1). By definition, we have a2*x ≥ d. Since V L d∗ (2) = M{1,2} > −∞ = V F d (2) ≥ V F d (2), which implies that d (2) ≥ uL(z, 2) = γ2 * d + β2 V L > γ2 * d∗ + β2 = M{1,2} ≥ V L d (1). This completes the proof. 34 D.3 Proof of Lemma D.2 We prove the lemma in two parts: (1) V L d∗(2) = M{1,2} (Lemma D.4). En route, we also prove a result (stated in Lemma D.4) that will be useful in the next section. d∗(1) = M{1,2} (Lemma D.3), and (2) V L Lemma D.3. V L d∗(1) = M{1,2}. Proof. Suppose for the sake of contradiction that V L d∗(1) (cid:54)= M{1,2} and consider the following cases. Case 1. V L d∗(1) < M{1,2}. Since V L d∗(1) < M{1,2}, then for all x ∈ f −1 d∗ (1) we have uL(x, 1) ≤ max x(cid:48)∈f −1 d∗ (1) uL(x(cid:48), 1) = V L d∗(1) < M{1,2}. For all x ∈ ∆m \ f −1 d∗ (1), by construction we have a2 * x < d∗; hence, uL(x, 2) = γ2 * a2 * x + β2 < γ2 * d∗ + β2 = M{1,2}. (40) Therefore, for all x ∈ ∆m, we have minj∈{1,2} uL(x, j) < M{1,2}. This leads to a contradiction: M{1,2} = maxx∈∆m minj∈{1,2} uL(x, j) < M{1,2}. Case 2. V L d∗(1) > M{1,2}. We further consider the following two cases. (i) There exists y2 ∈ f −1 d∗ (1) such that uL(y2, 2) > M{1,2}. Pick arbitrary y1 ∈ argmaxx∈f −1 d∗ (1) uL(x, 1). By assumption, V L uL(y1, 1) = V L d∗(1) > M{1,2}. d∗(1) > M{1,2}, so The fact that y1 ∈ f −1 d∗ (1) also implies that a2 * y1 ≥ d∗ by construction. Hence, uL(y1, 2) = γ2 * a2 * y1 + β2 ≥ γ2 * d∗ + β2 = M{1,2}. (41) (42) (43) Let z = λ*y1+(1−λ)*y2, where λ ∈ (0, 1). By continuity, (42) implies that when λ is sufficiently close to 1, we have uL(z, 1) > M{1,2}. Moreover, (41), (43) and the fact that λ < 1 imply that uL(z, 2) > M{1,2}. Thus, minj∈{1,2} uL(z, j) > M{1,2}, which contradicts the definition of M{1,2}, i.e., M{1,2} = maxx∈∆m minj∈{1,2} uL(x, j) ≥ minj∈{1,2} uL(z, j). (ii) uL(x, 2) ≤ M{1,2} for all x ∈ f −1 d∗ (1). Note that for all x ∈ ∆m\f −1 d∗ (1), it holds that uL(x, 2) < M{1,2} (see (40)). Hence, now we have uL(x, 2) ≤ M{1,2}, for all x ∈ ∆m, which implies that M{2} = max x∈∆m uL(x, 2) ≤ M{1,2}. According to the assumption of Case 2, we have V L d∗(1) > M{1,2}. It follows that M{2} ≤ M{1,2} < V L d∗(1) ≤ max x∈∆m uL(x, 1) = M{1}. This contradicts Observation 5.1(b). Therefore, both cases lead to contradictions. We have V L d∗(1) = M{1,2}. 35 Lemma D.4. V L d∗(2) = M{1,2}. Moreover, there exists x− ∈ ∆m such that a2 * x− < d∗. Proof. According to Lemma D.3, f −1 a2 * x+ ≥ d∗. d∗ (1) (cid:54)= ∅, which means that there exists x+ ∈ ∆m such that We next show that there exists x− ∈ ∆m such that a2 * x− < d∗. Suppose for the sake of con- d∗ (1) = ∆m, so we get tradiction that a2 * x ≥ d∗ for all x ∈ ∆m. By definition we then have f −1 that V L d∗(1) = max x∈f −1 d∗ (1) uL(x, 1) = max x∈∆m uL(x, 1) = M{1}. By Lemma D.3, V L d∗(1) = M{1,2}, so we have Now that a2 * x ≥ d∗ for all x ∈ ∆m by assumption, we have M{1} = M{1,2}. min x∈∆m uL(x, 2) = min x∈∆m γ2 * a2 * x + β2 ≥ γ2 * d∗ + β2 = M{1,2}. Hence, minx∈∆m uL(x, 2) ≥ M{1}, which contradicts Observation 5.3 and the definition of (cid:98)J. Therefore, we obtain two points x+, x− ∈ ∆m such that a2 * x+ ≥ d∗ and a2 * x− < d∗. There d∗ (2) must be a convex combination y of x− and x+ such that y ∈ ∆m and a2 * y = d∗. Hence, y ∈ f −1 and where d∗ ≥ maxx∈f −1 means that maxx∈f −1 a2 * x ≥ a2 * y = d∗, d∗ ≥ max x∈f −1 d∗ (2) d∗ (2) a2 * x holds as f −1 d∗ (2) = {x ∈ ∆m : a2 * x ≤ d∗} by construction. This d∗ (2) a2 * x = d∗. Consequently, V L d∗(2) = γ2 * d∗ + β2 = M{1,2}. D.4 Proof of Theorem 5.5 Theorem 5.5. A reference pair x, y ∈ ∆m such that uL(x, 1) = uL(y, 2) = M{1,2} can be computed in polynomial time. Proof. Lemma 5.4 implies immediately that we can use binary search and oracle AER to compute d∗ in polynomial time. Moreover, both actions 1 and 2 are SSE responses of Gd∗ = (uL, ̃uF d∗). Pick d∗ (2) uL(y(cid:48), 2). Then (x, 1) and (y, 2) d∗ (1) uL(x(cid:48), 1) and y ∈ argmaxy(cid:48)∈f −1 arbitrary x ∈ argmaxx(cid:48)∈f −1 d∗(2), are both SSEs; hence, uL(x, 1) = uL(y, 2). Moreover, since uL(x, 1) = V L according to Lemma D.2, we have uL(x, 1) = uL(y, 2) = M{1,2}. d∗(1) and uL(y, 2) = V L Indeed, since uL(x, j) = γj * x + βj, to compute x and y amounts to solving maxx(cid:48)∈f −1 d∗ (1) a1 * x(cid:48) d∗ (2) a2 * y(cid:48), respectively. Moreover, by definition, the constraints x(cid:48) ∈ f −1 and maxy(cid:48)∈f −1 d∗ (1) and y(cid:48) ∈ f −1 d∗ (2) are further equivalent to a2 * x(cid:48) ≥ d∗ and a2 * x(cid:48) ≤ d∗, respectively. Hence, the task reduces to solving two LPs, which can be done in polynomial time. This completes the proof. E Omitted Proofs in Section 5.2 E.1 Results When {1, 2} does not Admit a Cover Lemma E.1. If {1, 2} does not admit a cover, then J ⊆ [n] and x∗ ∈ ∆m that satisfy (7) can be computed in polynomial time. 36 Proof. By Lemma 4.4, now that {1, 2} does not admit a cover, it must be that M{1,2} = M[n]. Let J = {1, 2}. Next, pick arbitrary y ∈ argmax uL(x, 1) and x∈∆m z ∈ argmax x∈f −1 d∗ (1) uL(x, 1), where fd∗ is the BR-correspondence of (18). By definition, we have uL(z, 1) = M{1}, and according to Lemma D.2, uL(y, 1) = M{1,2}. Now that M{1,2} = M[n], by Observation 5.1(a), M{1} > M{1,2}. This further implies that z /∈ f −1 , which implies that there exists x∗ in the line segment between y and z such that a2 * x∗ = d∗ 2 d∗ (1). Hence, we have a2 * y ≤ d∗ = d∗ and a2 * z ≤ d∗ = d∗ 2 , or equivalently 2 uL(x∗, 2) = M{1,2}. Since uL(x, 1) ≥ M{1,2} for x ∈ {y, z}, by linearity of uL(*, 1), we also get that uL(x∗, 1) ≥ M{1,2}. At the same time, since x∗ ∈ f −1 d∗ (1), it must be that uL(x∗, 1) ≤ uL(y, 1) = M{1,2}, according to the definition of y. As a result, uL(x∗, 1) = M{1,2}. Hence, J and x∗ satisfy (7). To compute x∗ amounts to finding an x ∈ ∆m such that uL(x, 1) = . Hence, x∗ uL(x, 2) = M{1,2}, which translates to the linear constraints a1 * x = d∗ 1 can be computed in polynomial time. and a2 * x = d∗ 2 E.2 Proof of Lemma 5.7 First, the following lemma shows that Condition (ii) is equivalent to that P1(d1, d2) (cid:54)= ∅ and P2(d1, d2) (cid:54)= ∅. 1, and d2 ≤ d∗ Lemma E.2. Suppose that d1 ≤ d∗ j ∈ {1, 2}. Proof. We prove the equivalent statement: maxx∈Pj (d1,d2) aj * x = dj if Pj(d1, d2) (cid:54)= ∅. Consider the case where j = 1. Indeed, by definition we have a1 * x ≤ d1 for all x ∈ P1(d1, d2), so it suffices to show that maxx∈P1(d1,d2) a1 * x ≥ d1. (j) = γj * dj + βj if Pj(d1, d2) (cid:54)= ∅ for 2. Then V L d1,d2 Choose arbitrary x ∈ P1(d1, d2). By definition, we have By Lemma D.3, there exists y ∈ ∆m such that a1 * x ≤ d1, and a2 * x ≥ d2. a1 * y = d∗ 1 ≥ d1, and a2 * y ≥ d∗ 2 ≥ d2. Hence, there exists a convex combination z of x and y, such that a1 * z = d1 and a2 * z ≥ d2, which means z ∈ P1(d1, d2) and hence, maxx∈P1(d1,d2) a1 * x ≥ a1 * z = d1. The case where j = 2 can be proven analogously. Next, we identify a boundary value (cid:15)(cid:48) that makes Pj(d1, d2) (cid:54)= ∅ for all dj ∈ [d∗ value is characterized as the optimal solution to the following LP according to Lemma E.3: 1 − (cid:15)(cid:48), d∗ j ]. This max (cid:15),x1,x2 (cid:15) subject to x1 ∈ ∆m ∩ P1(d∗ x2 ∈ ∆m ∩ P1(d∗ 1 − (cid:15), d∗ 2) 1, d∗ 2 − (cid:15)) (44) (44a) (44b) The LP characterization is important as it helps us bound the bit-size of ˆ(cid:15). 37 Lemma E.3. Let (cid:15)(cid:48) be the optimal value of LP (44). Then (cid:15)(cid:48) > 0. Moreover, P1(d1, d2) (cid:54)= ∅ and P2(d1, d2) (cid:54)= ∅ for all d1 ∈ [d∗ 1] and d2 ∈ [d∗ Proof. Indeed, if (cid:15)(cid:48) > 0, then according to the constraints of LP (44), we have P1(d∗ and P2(d∗ d1 ∈ [d∗ 2) (cid:54)= ∅ 2 − (cid:15)(cid:48)) (cid:54)= ∅. The second part of the statement of this lemma then follows readily: for all 2 − (cid:15)(cid:48), d∗ 2]. 1 − (cid:15)(cid:48), d∗ 1 − (cid:15)(cid:48), d∗ 1, d∗ 1 − (cid:15)(cid:48), d∗ 1] and d2 ∈ [d∗ 2], we have 2 − (cid:15)(cid:48), d∗ P1(d1, d2) ⊇ P1(d∗ 1 − (cid:15)(cid:48), d∗ 2) (cid:54)= ∅, and Hence, it suffices to prove that (cid:15)(cid:48) > 0. P2(d1, d2) ⊇ P2(d∗ 1, d∗ 2 − (cid:15)(cid:48)) (cid:54)= ∅. We have (cid:15)(cid:48) According to Lemma D.4, there exists x− ∈ ∆m such that a2 * x− < d∗ = d∗ . Let (cid:15)(cid:48) 2 2) (cid:54)= ∅. 2 > 0. Moreover, x− ∈ P2(d∗ 2 − (cid:15)(cid:48) 1, d∗ 2) (cid:54)= ∅. Once this holds, we We next argue that there also exists (cid:15)(cid:48) 2), which means P2(d∗ 1 − (cid:15)(cid:48) 2 − (cid:15)(cid:48) 1 > 0 such that P1(d∗ 2 − a2 * x−. 1, d∗ 1, d∗ 2 = d∗ have ε = min{(cid:15)(cid:48) 1, (cid:15)(cid:48) 2} > 0. Moreover, P1(d∗ 1 − ε, d∗ 2) ⊇ P1(d∗ 1 − (cid:15)(cid:48) 1, d∗ 2) (cid:54)= ∅, and P2(d∗ 1, d∗ 2 − ε) ⊇ P2(d∗ 1, d∗ 2 − (cid:15)(cid:48) 2) (cid:54)= ∅. Hence, ε > 0, along with two arbitrarily chosen points x1 and x2 from the above sets, constitutes a feasible solution to (44), which implies the claimed result. We next demonstrate the existence of (cid:15)(cid:48) 1 . Note that it suffices to show that: ∃ x∗ ∈ P1(d∗ 1, d∗ 2) : a1 * x∗ < d∗ 1. (45) Indeed, letting (cid:15)(cid:48) Consider the following two cases. 1 = d∗ 1 − a1 * x∗, we then have x∗ ∈ P1(d∗ 1 − (cid:15)(cid:48) 1, d∗ 2), which means P1(d∗ 1 − (cid:15)(cid:48) 1, d∗ 2) (cid:54)= ∅. Case 1. a2 * x ≤ d∗ 2 for all x ∈ ∆m. In this case, we can prove that P1(d∗ 1, d∗ 2) = argmax x∈∆m uL(x, 2) by noting the following facts: • For all x ∈ P1(d∗ 1, d∗ 2), by definition we have a2 * x ≥ d∗ 2 . Now that a2 * x ≤ d∗ 2 , it must be that a2 * x = d∗ 2 , which further means uL(x, 2) = γ2 * d∗ 2 + β2 = M{1,2} = V L 1,d∗ d∗ 2 (2) for all x ∈ P1(d∗ 1, d∗ 2), where M{1,2} = V L 1,d∗ d∗ 2 (2) follows by Lemma D.4. 1, d∗ • For all x /∈ P1(d∗ Hence, by Lemma D.1, there exists x ∈ argmaxx(cid:48)∈∆m uL(x(cid:48), 2) = P1(d∗ 2), we have a2 * x < d∗, so uL(x, 2) < M{1,2} = V L 1,d∗ d∗ 2 2) such that uL(x, 1) < uL(x, 2). Now that a2 * x ≤ d∗ for all x ∈ ∆m according to the assumption of Case 1, we have uL(x, 2) ≤ M{1,2}, and in turn uL(x, 1) < M{1,2}. Therefore, letting x∗ be the aforementioned x gives a1 * x∗ < (M{1,2} − β1)/γ1 = d∗ 1 1, d∗ (2). . 38 . Let ˆd2 = maxx∈∆m a2 * x; we have ˆd2 > d∗ . Case 2. There exists x ∈ ∆m such that a2 * x > d∗ 2 2 Hence, let ˆd(cid:48) . By continuity, there exists y ∈ ∆m such that 2 > d∗ 2 a2 * y = ˆd(cid:48) . 2 2)/2, we have ˆd2 > ˆd(cid:48) 2 = ( ˆd2 + d∗ Now consider a vector ̃y ∈ Rm such that ̃yi = (cid:40) yi + δ/m(cid:48) yi − δ/(m − m(cid:48)) if yi = 0; if yi > 0, where δ > 0 and m(cid:48) = |i ∈ [m] : yi = 0|. Clearly, (cid:80) i∈[m] yi = 1, and when δ is sufficiently close to 0, we can ensure that: ̃yi ∈ (0, 1) for all i ∈ [m], so ̃y is in the interior of ∆m; moreover, ˆd2 > a2 * ̃y > d∗ 2 by continuity, so ̃y ∈ P1(d∗ i∈[m] ̃yi = (cid:80) 2). 1, d∗ If it happens that a1 * ̃y < d∗ 1 what follows, we assume that a1 * ̃y ≥ d∗ 1 x ∈ f −1 1, d∗ a1 * ̃y = d∗ 1 d∗ (1) = P1(d∗ . , then we are done with ̃y being a point satisfying (45). Hence, in for all . According to Lemma D.3, we have a1 * x ≤ d∗ 1 defined in (18)), so it must be that 2) (where f is the BR-correspondence of ̃uF d We proceed by defining a set of vectors z1, . . . , zm ∈ Rm such that zi j = (cid:40) ̃yj − δ(cid:48) ̃yj + (m − 1) * δ(cid:48) if j ∈ [m] \ {i}; if j = i, where δ(cid:48) > 0. When δ(cid:48) is sufficiently close to 0, we can ensure that ˆd2 > a2 * zi > d∗ 2 we have (cid:80) j = (cid:80) ensures that zi ∈ ∆m. Hence, zi ∈ P1(d∗ . Moreover, j∈[m] ̃yj = 1, and since ̃y is in the interior of ∆m, a sufficiently small δ(cid:48) also 2). Observe that j∈[m] zi 1, d∗ a1 * zi = a1 * ̃y + (m − 1) * δ(cid:48) * a1,i + (cid:88) δ(cid:48) * a1,j j∈[m]\{i}  = d∗ 1 + δ(cid:48) * (m − 1) * a1,i −  = d∗ 1 + δ(cid:48) * m * a1,i − (cid:88) j∈[m] a1,j  .   a1,j + a1,i (cid:88) j∈[m]  We claim that at least a1 * zi < d∗ 1 according to the same argument above via Lemma D.3, we get that a1 * zi = d∗ 1 follows that a1,1 = a1,2 = * * * = a1,m = (cid:80) for all i ∈ [m], for at least one i ∈ [m]. Indeed, if a1 * zi ≥ d∗ 1 for all i ∈ [m]. It j∈[m] a1,j/m, which contradicts Observation 5.1(c). Using the above results, we now prove Lemma 5.7. Proof of Lemma 5.7. We first solve LP (44) and let the optimal value be (cid:15)(cid:48). If some j ∈ {1, 2} is an SSE response of Gd∗ 2−(cid:15)(cid:48), then we are done with ˆ(cid:15) = (cid:15)(cid:48) satisfying both conditions in Lemma 5.7. Specifically: 1−(cid:15)(cid:48),d∗ • Condition (ii) holds according to Lemma E.2 and Lemma E.3. • Further applying Lemma E.2, we get that for any dj ∈ [d∗ j ], j − (cid:15)(cid:48), d∗ V L d1,d2(j) = γj * dj + βj ≥ γj * (d∗ j − ˆ(cid:15)) + βj = V L 1−ˆ(cid:15),d∗ d∗ 2−ˆ(cid:15)(j) (46) 39 for both j ∈ {1, 2}, whereas d1,d2(k) ≤ V L V L 1−ˆ(cid:15),d∗ d∗ 2−ˆ(cid:15)(k) (47) for all k ∈ [n] \ {1, 2} as f −1 2−ˆ(cid:15)(k). In words, the leader's payoff for playing a strategy that induced actions 1 or 2 will not decrease, while that for strategies inducing actions k /∈ {1, 2} will not increase. Hence, at least one of j ∈ {1, 2} remains to be an SSE response, and Condition (i) also holds. (k) ⊆ f −1 1−ˆ(cid:15),d∗ d∗ d1,d2 Hence, in what follows, we assume that neither action 1 nor 2 is an SSE response of Gd∗ For each k ∈ [n] \ {1, 2}, we define the following LP, where μ is the payoff function of h. 1−(cid:15)(cid:48),d∗ 2−(cid:15)(cid:48). min (cid:15),x∈∆m (cid:15) subject to (cid:15) ≤ (cid:15)(cid:48) j − (cid:15) aj * x ≥ d∗ μ(x, k) ≥ μ(x, k(cid:48)) uL(x, k) ≥ γj * (d∗ j − (cid:15)) + βj for all j ∈ {1, 2} for all k(cid:48) ∈ [n] \ {1, 2} for all j ∈ {1, 2} (48) (48a) (48b) (48c) (48d) Hence, we obtain a class of LPs. Let ε be the minimum optimal value of LPs in this class that indeed has a feasible solution. We show that any ˆ(cid:15) < ε satisfies the conditions in the statement of Lemma 5.7 via the following claims. Claim 4. If neither action 1 nor 2 is an SSE response of Gd∗ least one k ∈ [n] \ {1, 2}. 1−(cid:15)(cid:48),d∗ 2−(cid:15)(cid:48), then LP (48) must be feasible for at Proof. Indeed, pick an arbitrary SSE (x, k) of Gd∗ 2−(cid:15)(cid:48). Since neither action 1 nor 2 is an SSE response, it must be that k ∈ [n] \ {1, 2}. Consider the LP (48). (cid:15)(cid:48) and x form a feasible solution to this LP as all the constraints are satisfied: Constraints (48b) and (48c) holds because k is a best response against x; and Constraint (48d) says that (x, k) gives the leader a higher payoff than the best payoff attainable by committing to any strategy in P1 or P2 (when P1 and P2 are non-empty, the right hand side of this constraint is the best attainable payoff in the corresponding region as argued in Lemma E.2). 1−(cid:15)(cid:48),d∗ Claim 5. ε > 0. Proof. Suppose for the sake of contradiction that ε ≤ 0. If ε < 0, then by Constraint (48b) there exists x ∈ ∆m such that aj * x > d∗ j for j ∈ {1, 2} (i.e., uL(x, j) > M{1,2}), which would imply that maxx(cid:48)∈∆m minj∈{1,2} uL(x(cid:48), j) > M{1,2}-a contradic- tion. If ε = 0, then P0(d∗ 2 − ε) = M{1,2}, in which case all x satisfying Constraints (48b) and (48c) would violate (48d): Constraints (48b) and (48c) require that x ∈ P0 = M{1,2} and k ∈ (cid:103)BR(x), respectively, so 1 − ε, d∗ uL(x, k) ≤ max x(cid:48)∈M{1,2} max k(cid:48)∈ (cid:102)BR(x(cid:48)) uL(x(cid:48), k(cid:48)) < M{1,2} = γj * (d∗ j − ε) + βj, where the second transition follows by the definition of a cover (see (9)). Claim 6. Any ˆ(cid:15) < ε satisfies the conditions in the statement of Lemma 5.7. 40 Proof. According to Claim 5, ε > 0. Hence, ˆ(cid:15) > 0. By Eq. (48a), we have ˆ(cid:15) < ε ≤ (cid:15)(cid:48), so Condition (ii) holds according to Lemma E.2 and Lemma E.3. By definition, ε is the minimum of the optimal solutions of the LPs. Hence, if we fix (cid:15) to ˆ(cid:15) = ε/2, no x ∈ ∆m satisfies the constraints in the above LP for any k ∈ [n]\{1, 2}. This means that either k is not a best response against x (Constraints (48b) and (48c)), or k is a best response but the payoff of (x, k) is lower than the highest payoff attainable by committing to a strategy in P1 or P2 (Constraint (48d)). In summary, k cannot an SSE response in Gd∗ 2−ˆ(cid:15), so only action 1 or 2 can be SSE responses. The same argument showing (46) and (47) also shows that only action 1 or 2 can be SSE responses of Gd1,d2 for all d1 ∈ [d∗ 2], so Condition (i) follows. 1] and d2 ∈ [d∗ 1 − ˆ(cid:15), d∗ 1 − ˆ(cid:15), d∗ 1−ˆ(cid:15),d∗ We conclude the proof by showing that a desired ˆ(cid:15) can be computed in polynomial time. Note that we cannot hope to solve the LPs defined in (48) to obtain ˆ(cid:15) since we do not know uL. Nevertheless, since Condition (i) holds for ˆ(cid:15) < ε as we argued above, we can use binary search to find ˆ(cid:15) from the interval [0, (cid:15)(cid:48)]: we maintain a candidate value (cid:15), query the oracle ASSE to check if action 1 or 2 is an SSE response of Gd∗ 2−(cid:15), and halve (cid:15) if they are not. The algorithm will terminate when (cid:15) < ε, which takes polynomial time as the bit-size of ε is bounded from above by a polynomial in the size of the representation of the LPs defined in (48). 1−(cid:15),d∗ E.3 Proof of Theorem 5.8 Theorem 5.8. Assume that ASSE can handle BR-correspondence queries. A reference pair x, y ∈ ∆m such that uL(x, 1) = uL(y, 2) < M{1,2} can be computed in polynomial time. Proof. Using Lemma 5.7, we first find ˆ(cid:15) satisfying the conditions stated in the lemma. Let d1 = d∗ (2) < M{1,2}. and d2 = d∗ , we have V L 2 − ˆ(cid:15). Since d1 < d∗ 1 If both actions 1 and 2 are SSE responses of Gd1,d2 d1,d2 , then we are done: picking arbitrary x ∈ maxx(cid:48)∈P1(d1,d2) a1 * x(cid:48) and y ∈ maxy(cid:48)∈P2(d1,d2) a2 * y(cid:48) gives two SSEs (x, 1) and (y, 2); we have uL(x, 1) = uL(y, 2) = V L (1) < M{1,2} and V L and d2 < d∗ 2 1 − ˆ(cid:15) d1,d2 (2) < M{1,2}. d1,d2 If action 1 is not an SSE response of Gd1,d2 , we have V L d1,d2 (1) < V L d1,d2 (2). Let 1 = (V L d(cid:48) d1,d2(2) − β1)/γ1. According to Condition (ii) of Lemma 5.7, we have V L (1) ≥ V L means that action 1 is an SSE response of Gd,d2 . Meanwhile V L and binary search to pin down d(cid:48) d(cid:48) 1 1,d2 responses when d = d(cid:48) 1 can obtain a desired reference pair. (1) = V L d(cid:48) 1,d2 . Similarly to the first case, where both actions are SSE responses of Gd1,d2 (2) if and only if d ≥ d(cid:48) . This 1 , and we can use oracle AER (2), so both actions 1 and 2 are SSE , we d,d2 d,d2 if and only if d ≥ d(cid:48) 1 Similarly, if action 2 is not an SSE response of Gd1,d2 , then we search for a number 2 = (V L d(cid:48) d1,d2(1) − β2)/γ2. Both actions 1 and 2 are SSE responses of Gd1,d(cid:48) ingly. 2 , and a desired reference pair can be obtained accord- E.4 Querying by Using Payoff Matrices The above algorithm uses BR-correspondences in the queries. We next show how to transform the algorithm to one that uses payoff-based queries, thereby solving our problem completely. Using a similar approach, we first define the following payoff matrix parameterized by two numbers d1 < d∗ 1 and d2 < d∗ . We will show that the BR-correspondence of this payoff matrix functions equivalently 2 to fd1,d2 defined in (23). 41 For every x ∈ ∆m, let ̃uF d1,d2(x, j) := (cid:40) bj * (x − zj) + cj, μ(x, j), if j ∈ {1, 2}; if j ∈ [n] \ {1, 2}. (49) where μ is an arbitrary proper cover of {1, 2}; and bj, cj ∈ R and zj ∈ ∆m are functions of d1 and d2, defined as follows.6 • First, for each j ∈ {1, 2}, define Z1(d1, d2) := (cid:8)x ∈ ∆m : a1 * x = ̄d1 and a2 * x ≥ ̄d2 (cid:9) , and Z2(d2, d2) := (cid:8)x ∈ ∆m : a2 * x = ̄d2 (cid:9) , where for j ∈ {1, 2}: ̄dj := (dj + d∗ j )/2. • Let K1 = [n] \ {1, 2} and K2 = [n] \ {2}. We define c1 = max x∈Z1,k∈K1 ̃uF d1,d2(x, k), (50) (51) (52) and let z1 and k1 be an arbitrary solution corresponding to the above maximum value, i.e., z1 ∈ argmax x∈Z1 and k1 ∈ argmax k∈K1 ̃uF d1,d2(x, k), max k∈K1 ̃uF d1,d2(z1, k). (53) (54) Note that according to (49), ̃uF in fact only rely on μ. Furthermore, let d1,d2 (z1, k) = μ(z1, k) for all k ∈ K1, so the above definitions b1 := gk1 − 6 * W1 d∗ 1 − d1 * a1, (55) where we use Wj := 1 + max i∈[m],k∈Kj ̃uF d1,d2(i, k) − min i∈[m],k∈Kj ̃uF d1,d2(i, k) for j ∈ {1, 2}, i.e., it is a value strictly larger than the maximum gap between the payoff parameters; in addition, for all k ∈ [n], we use gk := (cid:0) ̃uF d1,d2(1, k), . . . , ̃uF d1,d2(m, k)(cid:1) . • c2, z2, and k2 are defined analogously by changing the labels in the above definitions from (x, 1) = 1 to 2. Note that since K2 = K1 ∪ {1}, these parameters also depend on ̃uF b1 * (x − z1) + c1, with c1 and z1 defined above. d1,d2 With the above definitions, we show several properties of ̃uF extend the notation in Section 5.2.1: hereafter, we let ̃fd1,d2 (cid:101)Gd1,d2 := (uL, ̃uF ), and let (cid:101)V L (j) = maxx∈ ̃f −1 d1,d2 d1,d2 (j) uL(x, j). d1,d2 in the subsequent lemmas. We , let be the BR-correspondence of ̃uF d1,d2 d1,d2 6We omit the dependencies of these parameters on d1 and d2 in the notation to simplify the presentation. 42 a 1 * x = d 1 a 1 * x = ̄d 1 z1 1 μ z2 2 a 2 * x = ̄d 2 a 2 * x = d 2 Figure 8: Illustration of ̃fd1,d2 labeled 1 and 2 are ̃f −1 d1,d2 The dotted lines depicts the boundaries of f −1 and f −1 (1) and ̃f −1 d1,d2 (j) = Pj( ̄d1, ̄d2). d1,d2 . The triangle represents the strategy space ∆m of the leader. The regions ̃f −1 (k). d1,d2 (j) = Pj(d1, d2) (1), respectively. The region labeled μ is (cid:83) (j). Recall that f −1 (j) and f −1 k∈[n]\{1,2} ̄d1, ̄d2 d1,d2 ̄d1, ̄d2 We make several observations about ̃fd1,d2 characterizes the structure of ̃fd1,d2 an illustration of this characterization. in comparison to fd1,d2 in the following lemmas. The first lemma Lemma E.4 defined in Section 5.2.1. Figure 8 provides Lemma E.4. Suppose that dj ≤ d∗ j and d(cid:48) hold for all j ∈ {1, 2} and k ∈ [n] \ {1, 2}: j ∈ [ ̄dj, d∗ j ] for each j ∈ {1, 2}. Then the following statements (i) aj * x ≤ d(cid:48) (ii) (cid:83) j∈{1,2} f −1 d1,d2 j for all x ∈ ̃f −1 d1,d2 (j) ⊆ (cid:83) j∈{1,2} (j); ̃f −1 d1,d2 (j); and (iii) f −1 1,d(cid:48) d(cid:48) 2 (k) ⊆ ̃f −1 d1,d2 (k) ⊆ f −1 d1,d2 (k). Proof. We prove each of the statements. Claim (i). Suppose that aj * x > d(cid:48) j . We argue that x /∈ ̃f −1 d1,d2 (j) to prove the claim. Indeed, we have aj * (x − zj) > 0 and hence, ̃uF d1,d2(x, j) = bj * (x − zj) + cj = gkj * (x − zj) − 6 * Wj d∗ j − dj * aj * (x − zj) + cj < gkj * (x − zj) + cj d1,d2(x, kj) − ̃uF = ̃uF = ̃uF d1,d2(x, kj), d1,d2(zj, kj) + cj (56) where we used the fact that ̃uF x /∈ ̃f −1 d1,d2 d1,d2 (j), and Claim (i) holds. (zj, kj) = cj according to the definitions of zj, kj and cj. Hence, Claim (ii). Pick arbitrary j ∈ {1, 2} and x ∈ Pj(d1, d2). We argue that ̃uF which implies Claim (ii) immediately. d1,d2 (x, j) > ̃uF d1,d2 (x, k), 43 Indeed, since x ∈ Pj(d1, d2), by definition, we have aj * x ≤ dj. Hence, ̃uF d1,d2(x, j) = bj * (x − zj) + cj = gkj * (x − zj) − * aj * (x − zj) + cj 4 * Wj d∗ j − dj 6 * Wj * (dj − ̄dj) + cj d∗ j − dj > −2 * Wj − = Wj + cj ≥ ̃uF d1,d2(x, k) for all k ∈ [n] \ {1, 2}, where we used the fact that (57) gkj * (x − zj) ≥ min x(cid:48)∈∆m gkj * x(cid:48) − max x(cid:48)∈∆m gkj * x(cid:48) > Wj. Claim (iii). Consider the BR-correspondence h : ∆m → 2[n]\{1,2} of μ. For any d1 and d2, according to the construction of fd1,d2 and ̃fd1,d2 , we have f −1 d1,d2 ̃f −1 d1,d2 (k) = h−1(k) ∩ P0(d1, d2) (k) = h−1(k) ∩ (cid:101)P0(d1, d2), and where We argue that (cid:26) (cid:101)P0(d1, d2) := x ∈ ∆m : max k∈[n]\{1,2} ̃uF d1,d2(x, k) ≥ max j∈{1,2} (cid:27) ̃uF d1,d2(x, j) . P0(d(cid:48) 1, d(cid:48) 2) ⊆ (cid:101)P0(d1, d2) ⊆ P0(d1, d2) (58) to complete the proof. Indeed, we have P0(d(cid:48) 1, d(cid:48) 2) = cl  ∆m \  and P0(d1, d2) = cl ∆m \  (cid:91) Pj(d(cid:48) 1, d(cid:48) 2)  j∈{1,2} (cid:91) j∈{1,2}  Pj(d1, d2)  , where cl(*) denotes the closure of a set. Since (56) and (57) are strictly satisfied, we also have  (cid:101)P0(d1, d2) = cl ∆m \  (cid:91) ̃f −1 d1,d2 (j)  . j∈{1,2} According to Claims (i) and (ii) we proved above, (cid:91) Pj(d(cid:48) 1, d(cid:48) 2) ⊇ (cid:91) ̃f −1 d1,d2 (j) ⊇ (cid:91) Pj(d1, d2). j∈{1,2} j∈{1,2} j∈{1,2} Hence, (58) holds, and this proves Claim (iii). The next lemma presents a result similar to Lemma E.2. Regarding Figure 8, the result indicates that zj indeed hits the line aj * x = ̄dj whenever Zj (cid:54)= ∅. 44 Lemma E.5. Suppose that j ∈ {1, 2} and Zj (cid:54)= ∅. Then zj ∈ ̃f −1 d1,d2 (j) and (cid:101)V L d1,d2 (j) = γj * ̄dj + βj. Proof. It suffices to prove that zj ∈ ̃f −1 d1,d2 (j). Indeed, this implies that d1,d2(j) ≥ uL(zj, j) = γj * ̄dj + βj (cid:101)V L given that aj *zj = ̄dj by definition; Moreover, according to Lemma E.4, aj *x ≤ ̄dj for all x ∈ ̃f −1 d1,d2 hence, (j); (cid:101)V L d1,d2(j) = max d1,d2 x∈ ̃f −1 (j) uL(x, j) ≤ γj * ̄dj + βj. (j) = γj * ̄dj + βj. As a result, (cid:101)V L d1,d2 Next, we prove that zj ∈ ̃f −1 d1,d2 (j) to complete the proof. By definition (i.e., (49)), d1,d2(zj, j) = bj * (zj − zj) + cj = cj ≥ ̃uF ̃uF d1,d2(zj, k) (59) for all k ∈ Kj. Since K2 = [n] \ {1}, this immediately implies that action 2 is a best response to z2, so z2 ∈ ̃f −1 d1,d2 (2). To argue that z1 ∈ ̃f −1 d1,d2 (z1, 1) ≥ (z1, 2). Indeed, by definition, we have a2 * z1 ≥ ̄d2 (i.e., see (50) and (53)), so similar to (56), we (1), since K1 = [n]\{1, 2}, we need to prove in addition that ̃uF d1,d2 ̃uF d1,d2 have that ̃uF d1,d2 (z1, 2) ≤ ̃uF d1,d2 (z1, k2). Since k2 ∈ K1 ∪ {1}, applying (59) then gives d1,d2(z1, 2) ≤ ̃uF ̃uF d1,d2(z1, k2) ≤ ̃uF d1,d2(z1, 1). Consequently, ̃uF proof. d1,d2 (z1, 1) ≥ ̃uF d1,d2 (z1, k) for all k ∈ [n], so z1 ∈ ̃f −1 d1,d2 (1). This completes the Finally, the following lemma presents a result similar to Lemma 5.7. The result is key to the first step of our approach, where we restrict the search space in a one-dimensional interval. Lemma E.6. Suppose that (cid:15)(cid:48) > 0 is the optimal value of LP (44). It holds for all δ1 ∈ [d∗ δ2 ∈ [d∗ 2 − (cid:15)(cid:48), d∗ 2] that: 1 − (cid:15)(cid:48), d∗ 1] and (i) Zj(δ1, δ2) (cid:54)= ∅ for both j ∈ {1, 2}; and (ii) if at least one of j ∈ {1, 2} is an SSE response of (cid:101)Gδ1,δ2, then the same holds for (cid:101)Gδ(cid:48) , with arbitrary 1,δ(cid:48) 2 1 ∈ [ ̄δ1, d∗ δ(cid:48) 1] and δ(cid:48) 2 ∈ [ ̄δ2, d∗ 2], where ̄δj = (δj + d∗ j )/2. Proof. First, consider Condition (i). If (cid:15) ≤ (cid:15)(cid:48), we have ̄δj ∈ [δj, d∗ Lemma 5.7, we have Pj( ̄δ1, ̄δ2) (cid:54)= ∅. By definition, j ] ⊆ [d∗ j − (cid:15)(cid:48), d∗ j ]. Hence, according to Zj(δ1, δ2) = Pj( ̄δ1, ̄δ2) ∩ {x ∈ ∆m : aj * x = ̄δj}. It then suffices to argue that there exists x ∈ Pj( ̄δ1, ̄δ2) such that aj * x = ̄δj. Indeed, now that Pj( ̄δ1, ̄δ2) (cid:54)= ∅, applying Lemma E.2, we get that there exists x ∈ Pj( ̄δ1, ̄δ2) such that uL(x, j) = γj * ̄δj + βj, which immediately implies that aj * x = ̄δj. Now consider Condition (ii). Now that Condition (i) holds, we have Zj(δ1, δ2) (cid:54)= ∅ and Zj(δ(cid:48) 1, δ(cid:48) 2) (cid:54)= ∅ for both j ∈ {1, 2}. According to Lemma E.5, we then have δ1,δ2(j) = γj * ̄δj + βj (cid:101)V L ≤ γj * ̄δ(cid:48) j + βj = (cid:101)V L 1,δ(cid:48) δ(cid:48) 2 (j), 45 (60) where ̄δ(cid:48) j = (δ(cid:48) j + d∗ j )/2. Moreover, since some j ∈ {1, 2} is an SSE response of (cid:101)Gδ1,δ2 , by definition, this means that δ1,δ2(j) ≥ (cid:101)V L (cid:101)V L δ1,δ2(k) (61) for all k ∈ [n] \ {1, 2}. According to Claim (iii) of Lemma E.4 (and note that δ(cid:48) ̃f −1 (k). As a result, ̃f −1 1,δ(cid:48) δ(cid:48) 1,δ(cid:48) δ(cid:48) 2 2 (k) ⊆ f −1 1,δ(cid:48) δ(cid:48) 2 (k) ⊆ ̃f −1 δ1,δ2 (k) ⊆ ̃f −1 δ1,δ2 (k), which implies that j ∈ [ ̄δj, d∗ j ]), we have Combining (60)–(62), we get that (cid:101)V L 1,δ(cid:48) δ(cid:48) 2 (k) ≤ (cid:101)V L δ1,δ2(k). (62) (cid:101)V L 1,δ(cid:48) δ(cid:48) 2 for all k ∈ [n] \ {1, 2}. Therefore, only actions 1 and 2 can be SSE responses of (cid:101)Gδ1,δ2 (j) ≥ (cid:101)V L 1,δ(cid:48) δ(cid:48) 2 (k) . With the above results in hand, we summarize our approach in the following theorem, which completes our task. The approach is similar to that used to prove Theorem 5.8, where we first search for values for d1 and d2 that make at least one of action 1 and 2 an SSE response. Then we further expand the best response region (see Figure 8) corresponding to the action that is not yet an SSE response while fixing the region of the other action, until both actions are SSE responses. We remark that despite the similarity, one difference between the approaches in Theorem 5.6 and Theorem 5.8 is that once we find a position where one of j ∈ {1, 2}, say action 1, is an SSE response, we cannot simply fix d1 and and increase d2 in the hope of finding another position where both of them are SSE responses. This is because the way ̃uF (2) as our choice of zj is arbitrary from the set Zj.7 Consequently, we can not ensure for any d2 ≤ d(cid:48) 2 that ̃f −1 (k) ⊇ ̃f −1 (k) may grow when (k) for the other actions k ∈ [n]\, which means (cid:101)V L d1,d(cid:48) d1,d2 2 (2), in which case 1 and 2 cannot be SSE (1) and (cid:101)V L we increase d2, potentially exceeding (cid:101)V L responses anymore. To resolve this issue, once we find a position (d1, d2) such that one of j ∈ {1, 2} is an SSE response, our approach is to first "jump" to ( ̄d1, ̄d2). This ensures that ̃f −1 (k) d1,d2 for all k ∈ [n]\{1, 2} according to the structure of ̃fd1,d2 we demonstrated in Lemma E.4 (and Figure 8). is constructed does not ensure that ̃f −1 d1,d2 (k) ⊇ ̃f −1 d1,d(cid:48) 2 (2) ⊆ ̃f −1 d1,d(cid:48) 2 d1,d2 d1,d2 d1,d2 d1,d2 Theorem 5.6. A reference pair x, y ∈ ∆m such that uL(x, 1) = uL(y, 2) < M{1,2} can be computed in polynomial time. Proof. The algorithm is similar to the approach used in Section 5.2.1 and proceeds as follows. • Step 1. Let (cid:15)(cid:48) be the optimal value of LP (44). We first search for an (cid:15) ∈ (0, (cid:15)(cid:48)] such that one of j ∈ {1, 2} is an SSE response of (cid:101)Gd∗ 1−(cid:15),d∗ 2−(cid:15). halve ε if none of j ∈ {1, 2} is an SSE response of (cid:101)Gd∗ applying Lemma E.6 we get that Zj(d∗ Specifically, we use binary search to find such an (cid:15): we start with the candidate value ε = (cid:15)(cid:48) and 2−ε. Note that by Lemma E.3, (cid:15)(cid:48) > 0, so 2−ε is well defined. 1−ε,d∗ Moreover, the binary search procedure will terminate in polynomial time. This is due to the fol- lowing fact. Let ˆ(cid:15) be a number satisfying the conditions stated in Lemma 5.7, which according to the same lemma exists and has a polynomial bit-size. For any ε ≤ ˆ(cid:15), we can show that at least one of 2−ε, so it follows immediately that the binary search j ∈ {1, 2} must be an SSE response of (cid:101)Gd∗ 7It might be possible to ensure this by using more carefully selected zj. However, this introduces other complexities in 2 − ε) (cid:54)= ∅, which means that (cid:101)Gd∗ 1 − ε, d∗ 1−ε,d∗ 1−ε,d∗ the approach, as well as the presentation of it. 46 procedure terminates in polynomial time. Indeed, according to Lemma 5.7, some j ∈ {1, 2} is an SSE response of Gd∗ 2−ε, which means that 1−ε,d∗ max j∈{1,2} V L 1−ε,d∗ d∗ 2−ε(j) ≥ max k∈[n]\{1,2} V L 1−ε,d∗ d∗ 2−ε(k). We can show that the same holds with respect to (cid:101)V L 1−ε,d∗ d∗ 2−ε . Specifically, it suffices to show that for all j ∈ {1, 2}, for all k ∈ [n] \ {1, 2}. (63) (64) (cid:101)V L 1−ε,d∗ d∗ (cid:101)V L 1−ε,d∗ d∗ and 2−ε(j) ≥ V L 2−ε(j) 1−ε,d∗ d∗ 2−ε(k) ≤ V L 2−ε(k) 1−ε,d∗ d∗ 2−ε(k) ⊆ f −1 1 − ε, d∗ (64) follows directly by Lemma E.4, i.e., ̃f −1 1−ε,d∗ d∗ To see that (63) holds, note that since Zj(d∗ (cid:101)V L 1−ε,d∗ d∗ 2−ε(j) = γj * Since ε > 0, it follows that 1−ε,d∗ d∗ 2−ε(k). 2 − ε) (cid:54)= ∅, by Lemma E.5, we have j + (d∗ d∗ 2 j − ε) + βj. (cid:101)V L 1−ε,d∗ d∗ 2−ε(j) > γj * (d∗ j − ε) + βj ≥ V L 1−ε,d∗ d∗ 2−ε(j), where the second inequality follows by the fact that aj * x ≤ d∗ Pj(d∗ 1 − ε, d∗ 2 − ε). j − ε for all x ∈ f −1 1−ε,d∗ d∗ 2−ε(j) = • Step 2. Let (cid:15) be the outcome of Step 1. Let dj = d∗ j − (cid:15) and ̄dj = (d∗ + dj)/2 for j ∈ {1, 2}. We search for δj ∈ [ ̄dj, d∗ j ) such that both actions 1 and 2 are SSE responses of (cid:101)Gδ1,δ2 . Indeed, if both 1 and 2 are SSE responses of (cid:101)G ̄d1, ̄d2 , then we are done. Otherwise, suppose that only action 1 is an SSE response. Then we fix δ1 = ̄d1 and search for a value δ2 such that (δ2 + d∗ 2)/2 = ( (cid:101)V L ̄d1, ̄d2 (1) − β2)/γ2. δ1,δ(cid:48) 2 (1) = (cid:101)V L Given Lemma E.5, and now that Zj(δ1, δ2) (cid:54)= ∅ according to Lemma E.6, only when δ(cid:48) (2), in which case both actions are SSE responses of (cid:101)Gδ1,δ(cid:48) (cid:101)V L δ1,δ(cid:48) 2 AER, we can use binary search to find out δ2: whenever action 2 is not an SSE response of (cid:101)Gδ1,δ(cid:48) know that δ(cid:48) an SSE response of (cid:101)G ̄d1, ̄d2 2 < δ2; and whenever action 1 is not, we know that δ(cid:48) , we fix δ2 = ̄d2 and search for δ1 = ( (cid:101)V L , we 2 > δ2. Similarly, if only action 2 is ̄d1, ̄d2 2 = δ2, we have . Hence, with access to (2) − β1)/γ1. 2 2 • Step 3. Finally, consider ̃uF and let z1 and z2 be the parameters corresponding to this payoff It can be verified that (z1, 1) and (z2, 2) are a reference pair such that uL(z1, 1) = δ1,δ2 matrix. uL(z2, 2) < M{1,2}. Indeed, according to Lemma E.5, j is a best response of zj for both j ∈ {1, 2}; moreover, uL(zj, j) = (cid:101)V L δ1,δ2(j) = γj * ̄δj + βj < γj * d∗ j + βj = M{1,2}, where ̄δj := (d∗ Hence, uL(z1, 1) = uL(z2, 2) < M{1,2}. j +δj)/2 < d∗ j . Now that both actions are SSE responses, we have (cid:101)V L (1) = (cid:101)V L δ1,δ2 (2). δ1,δ2 47
http://arxiv.org/abs/2302.11824v1
2023-02-23T07:17:12
2023-02-23T07:17:12
MossFormer: Pushing the Performance Limit of Monaural Speech Separation using Gated Single-Head Transformer with Convolution-Augmented Joint Self-Attentions
Transformer based models have provided significant performance improvements in monaural speech separation. However, there is still a performance gap compared to a recent proposed upper bound. The major limitation of the current dual-path Transformer models is the inefficient modelling of long-range elemental interactions and local feature patterns. In this work, we achieve the upper bound by proposing a gated single-head transformer architecture with convolution-augmented joint self-attentions, named \textit{MossFormer} (\textit{Mo}naural \textit{s}peech \textit{s}eparation Trans\textit{Former}). To effectively solve the indirect elemental interactions across chunks in the dual-path architecture, MossFormer employs a joint local and global self-attention architecture that simultaneously performs a full-computation self-attention on local chunks and a linearised low-cost self-attention over the full sequence. The joint attention enables MossFormer model full-sequence elemental interaction directly. In addition, we employ a powerful attentive gating mechanism with simplified single-head self-attentions. Besides the attentive long-range modelling, we also augment MossFormer with convolutions for the position-wise local pattern modelling. As a consequence, MossFormer significantly outperforms the previous models and achieves the state-of-the-art results on WSJ0-2/3mix and WHAM!/WHAMR! benchmarks. Our model achieves the SI-SDRi upper bound of 21.2 dB on WSJ0-3mix and only 0.3 dB below the upper bound of 23.1 dB on WSJ0-2mix.
[ "Shengkui Zhao", "Bin Ma" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11824v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11824v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.SD", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.SD", "cs.LG", "eess.AS" ]
MOSSFORMER: PUSHING THE PERFORMANCE LIMIT OF MONAURAL SPEECH SEPARATION USING GATED SINGLE-HEAD TRANSFORMER WITH CONVOLUTION-AUGMENTED JOINT SELF-ATTENTIONS Shengkui Zhao, Bin Ma Alibaba Group {shengkui.zhao, b.ma}@alibaba-inc.com 3 2 0 2 b e F 3 2 ] D S . s c [ 1 v 4 2 8 1 1 . 2 0 3 2 : v i X r a ABSTRACT Transformer based models have provided significant performance improvements in monaural speech separation. However, there is still a performance gap compared to a recent proposed upper bound. The major limitation of the current dual-path Transformer models is the inefficient modelling of long-range elemental interactions and local feature patterns. In this work, we achieve the upper bound by proposing a gated single-head transformer architecture with convolution-augmented joint self-attentions, named MossFormer (Monaural speech separation TransFormer). To effectively solve the indirect elemental interactions across chunks in the dual-path archi- tecture, MossFormer employs a joint local and global self-attention architecture that simultaneously performs a full-computation self- attention on local chunks and a linearised low-cost self-attention over the full sequence. The joint attention enables MossFormer model full-sequence elemental interaction directly. In addition, we employ a powerful attentive gating mechanism with simplified single-head self-attentions. Besides the attentive long-range modelling, we also augment MossFormer with convolutions for the position-wise local pattern modelling. As a consequence, MossFormer significantly outperforms the previous models and achieves the state-of-the-art results on WSJ0-2/3mix and WHAM!/WHAMR! benchmarks. Our model achieves the SI-SDRi upper bound of 21.2 dB on WSJ0-3mix and only 0.3 dB below the upper bound of 23.1 dB on WSJ0-2mix. Index Terms- speech separation, transformer, attention, con- volution, deep learning 1. INTRODUCTION Fig. 1. MossFormer model architecture. MossFormer comprises of a convolutional encoder-decoder structure and a masking net. The masking net is a stack of MossFormer blocks and convolutions. Monaural speech separation that aims to separate individual source speeches from a single overlapped mixture is a fundamental and important task. Recent end-to-end deep learning speech separa- tion models have seen large performance improvements [1–8]. The time-domain Conv-TasNet [1] modelled on an encoded representa- tion eventually surpasses the time-frequency domain counterparts. DPRNN [2] provides an effective dual-path framework for han- dling extreme long encoded input sequences by splitting into smaller chunks and processing the intra- and inter-chunk separately. With capability of learning long-term temporal dependency, DPRNN out- performs Conv-TasNet with a big margin. Building on the dual-path architecture, VSUNOS [3] proposes gated RNN modules to further improve the separation performance. However, RNN based mod- els inherently pass history information recurrently through many intermediate states, leading to suboptimal performance. Recently, the Transformer architecture based on self-attention [9] has been successfully integrated into the dual-path speech separation pipeline. Unlike the recurrent learning of RNN, Transformer provide ability to capture long-range elemental interactions directly. DPTNet [4] uses an amended Transformer architecture with embedded RNN for preserving sequence positional information and shows superior per- formance than DPRNN. SepFormer [8] completely eliminates RNN recurrence by building on standard Transformer with multi-head self-attention (MHSA) and achieves the state-of-the-art (SOTA) performance. Due to the quadratic complexity over the input se- quence in attention computations, the self-attentions in DPTNet and SepFormer are still limited to short context size. The long-range elemental dependencies across chunks are still implicitly modelled through intermediate states. This fact may impose negative impacts on long-range modelling capability. Compared to the recent Cramer Rao bound for non-linear methods [10], there is still a large perfor- mance gap. In addition, convolutions are not well exploited in the existing dual-path Transformer models to learn local feature patterns. In this work, we propose a novel Monaural speech separation TransFormer (MossFormer) model as illustrated in Figure 1. For the dominant MossFormer block, we propose a gated single-head PointwiseConvolutionPointwiseConvolutionPointwiseConvPointwiseConvReshapeReLUGLUMossFormer BlockR x +Sinusoidal PositionalEncodingLayerNormPointwiseConvolution ReLUReLUx1D TransposedConvolution1D ConvolutionInput MixtureSeparatedSourcesReshapeMasking NetEncoderDecoderBx1xTBxNxSBxNxSBxNxSBxSxNBxNxSReshapeBxSxNBxNxSBx(CxN)xS(BxC)xNxS(BxC)xNxS(BxC)xNxS(BxC)xNxSBixNxSi=1,2,...C BixNxSBix1xTBxNxSBxNxS(BxC)xNxS transformer (GSHT) architecture with convolution-augmented joint self-attentions as illustrated in Figure 2. The GSHT architecture employs a powerful attentive gating mechanism such that only a weakened single-head self-attention (SHSA) is required. This facil- itates a joint local and global self-attention for effective long-range direct interaction modelling. To further model position-wise local feature patterns, we propose a convolution module as illustrated in Figure 3 and integrate the convolution module into the atten- tive gating architecture. Our work is mainly motivated by [11, 12]. Our proposed model outperforms SepFormer and the other previ- ous models, and redefines the state-of-the-art on the WSJ0-2/3mix and WHAM!/WHAMR! benchmarks. Moreover, we achieve the SI-SDRi upper bound [10] on WSJ0-3mix. 2. THE MOSSFORMER MODEL Given a speech mixture x = ∑C i=1 si, we aim to estimate C indi- vidual sources si ∈ R1xT , i = 1, 2, ... , C based on a deep learning model. Our overall model architecture is built on the time-domain masking-net framework [1] as illustrated in Figure 1. It comprises of a convolutional encoder-decoder structure and a masking net. The encoder-decoder structure responds for feature extraction and wave- form reconstruction. The masking net maps the encoded output to a group of masks. 2.1. Encoder and Decoder The encoder responds for feature extraction and consists of a one- dimensional (1D) convolutional layer (Conv1D) and a rectified linear unit (ReLU), which constrains the encoded output to be non-negative values. Let the kernel size of the encoder be K1 with stride of K1∕2 and the number of filters be N. The input sequence X ∈ RB×1×T is encoded to the output X′ as follows: X′ = ReLU(Conv1D(X)) (1) where X′ ∈ RB×N×S and S = 2(T − K1)∕K1 + 1. The batch size B is omitted in the follows for ease of presentation. The sequence X′ is multiplied element-wisely by each individual speaker's mask to obtain the separated feature sequence: X′′ i = Mi ⊗ X′. The separated feature sequence is finally decoded into waveform by the decoder: ̂si = Transposed_Conv1D(X′′ i ) (2) The decoder is a 1D transposed convolutional layer and it uses the same kernel size and stride as the encoder. 2.2. Masking Net The masking net performs a non-linear mapping from the encoder output to C groups of masks as shown in Figure 1. To achieve this, the encoded sequence X′ is first normalized and added with positional encodings for global order information. And the sequence is then passed through a pointwise convolution and after reshaping passed to the MossFormer block for sequential processing. In the MossFormer block, the sequence is processed by the con- volution modules and the attentive gating mechanism. The convolu- tion modules process the sequence with linear projections and depth- wise convolutions. The attentive gating mechanism performs a joint local and global self-attention and gating operations. The Moss- Former block learns only the residual and applies the skip connection Fig. 2. MossFormer block. It consists of four convolution mod- ules, scale and offset operations, a joint local and global single- head self-attention, and three element-wise gating operations (φ is an element-wise activation function, ⊕ is element-wise summation, ⊗ is element-wise multiplication). from the input for ease of training. The output of the current Moss- Former block is fed as input to the next MossFormer block. The process of the MossFormer block is repeated R times. The output of the final MossFormer block is processed by a ReLU followed by another pointwise convolution, which expands the se- quence dimension from RN×S to R(C×N)×S . It is then passed through a parallel pointwise convolutions and a GLU. Finally, the sequence is passed through pointwise convolution one more time followed by a ReLU to obtain the mask sequence M ∈ RC×N×S . The mask se- quence M is reformed for each individual speaker Mi ∈ RN×S and is then fed to the decoder separately. 2.3. MossFormer Block The architecture of our proposed MossFormer block is shown in Fig- ure 2, which is developed based on the recent proposed gated atten- tion unit (GAU) [12] for long sequence modelling. A MossFormer block comprises of four convolution modules, scale and offset oper- ations, a joint local and global SHSA, and three gating operations. We aim to boost the modelling capability of the MossFormer block by incorporating convolution modules and a triple-gating structure. The use of gates allows a much simpler SHSA that facilitates a joint local and global attention for effective long-range modelling. 2.3.1. Convolution Module We propose a convolution module to replace the dense layers in GAU for extracting fine-grained local feature patterns in the MossFormer block. Figure 3 illustrates the architecture of the convolution mod- ule. In the convolution module, the sequence is first normalized and projected by a linear layer followed by a SiLU. And then it is feature- wise convoluted by 1D depthwise convolution. Skip-connection and dropout are used to help training and regularizing the network. Input X'' Convolution ModuleConvolution ModuleConvolution ModuleScale & Offset & RoPELocal&GlobalJoint AttentionxxxOutput O U V Q & K U V U' V' BxSxNBxSx2NBxSx2NConvolution ModuleBxSxABxSx2NBxSxN+O' O" Z Q' & K' Fig. 3. Convolution module. It contains a linear layer with an expansion factor followed by a SiLU activation layer, and then followed by a 1-D depthwise convolution layer with a skip connection. 2.3.2. Attentive Gating Mechanism Our attentive gating mechanism combines attention into the triple- gating process to enhance model capability. The mechanism is for- mulated as follows. Let the input sequence of the current Moss- Former block be X′′ ∈ RS×N . It is processed by the convolution module to obtain the values U ∈ RS×2N and V ∈ RS×2N as follows: U = ConvM(X′′), V = ConvM(X′′) (3) where ConvM refers to the convolution module. Here we increase the feature dimensions from N to 2N in the linear layer of ConvM using an expansion factor of 2. By denoting the attention matrix as A ∈ RS×S , the output sequence O ∈ RS×N of the MossFormer block can be expressed as follows: O′ = φ(U ⊗ V′) where V′ = AV O′′ = U′ ⊗ V where U′ = AU O = X′′ + ConvM(O′ ⊗ O′′) (4) (5) (6) where the linear layer of ConvM decreases the feature dimension from 2N to N, and φ is an element-wise activation function. 2.3.3. Joint Local and Global Single-Head Self-Attention For long sequence where S is large, computing the attentions in Eqs. (4) and (5) directly is very expensive. Fortunately, the presence of gating allows us compute V′ and U′ based on the joint local and global attention in an efficient and effective way. We first project the input sequence X′′ through the convolution module into a shared representation: Z = ConvM(X′′) ∈ RS×D, where D ≪ N. We then apply low-cost per-dim scalars and offsets, and RoPE [13] to the shared Z to obtain the queries Q, Q′ ∈ RS×D and the keys K, K′ ∈ RS×D for both the local and global attentions. For the global attention, we employ the following low-cost linearised form to cap- ture long-range global interactions for both sequences V and U: ) ( βK′T V ( βK′T U , U′ V′ (7) ) global = Q′ global = Q′ ) Vh, U′ local,h = ReLU2 (γQhKT V′ where β = 1∕S is a scaling factor. To compute the local quadratic at- tention, we chunk V, U, Q, and K into H non-overlapping chunks of size P , where zero-padding is used when S < H × P . The quadratic attention is therefore independently applied to each chunk as follows: ) Uh (8) where γ = 1∕P is a scaling factor. Here we adopt the squared ReLU instead of the softmax in MHSA for optimizing performance [12]. Note that QhKT h only needs to be computed once as it is shared by V′ local,h and U′ local,h. We concatenate all outputs of V′ local,h and U′ local,h along the time dimension to form back the full sequences: V′ local = local = [U′ [V′ local,1, ... , V′ We add the local attention and the global attention together to local,h = ReLU2 (γQhKT local,H ] and U′ local,1, ... , U′ local,H ]. h h form the final joint attentions of V′ and U′ in Eqs. (4) and (5): V′ = V′ local + V′ global, U′ = U′ local + U′ global Table 1. Hyper-parameters for MossFormer S, M, and L models for optimized performance within parameter and GPU resource limits. Model No. Parameters No. MossFormer Blocks (R) Encoder Output Dimension (N) Encoder Kernel Size (K1) / Stride Depthwise Conv Kernel Size (K2) Chunk Size (P ) Attention Dimension (D) Gating Activation Function (φ) MossFormer MossFormer MossFormer (M) 25.3M 25 384 16/8 17 256 128 Sigmoid (L) 42.1M 24 512 16/8 17 256 128 Sigmoid (S) 10.8M 22 256 8/4 31 256 128 Sigmoid 3. EXPERIMENTS 3.1. Dataset We evaluate the proposed model on both clean and noisy/reverberated settings using the speech separation benchmarks of WSJ0-2/3mix [14] and WHAM!/WHAMR! [15, 16] datasets. We rely on the 8kHz version of the data. The utterances are randomly segmented into 4s long during training and validation. Beside the standard versions of the data, we also consider dynamic mixing (DM) with speed perturbation for data augmentation as described in [8]. 3.2. Training Setup Our evaluations are made for three models with parameters of 11M (S), 25M (M), and 42M (L), respectively. The models are chosen based on our best settings of network depth, model dimensions, con- volution kernel sizes, chunk size, attention dimensions, as well as gating activation function φ within parameter size and training re- source constraints. We use a single NVIDIA V100 GPU with 16 GB of memory for training. Table 1 provides the hyper-parameters. Our models are implemented based on the SpeechBrain tookit1 and optimized using the SI-SDR training loss [17]. We train our mod- els for a maximum of 200 epochs with the Adam optimizer [18] using learning rate of 15e−5 and batch size of 1. During training, the learn- ing rate holds for 85 epochs and then is reduced by a factor of 0.5 with patience of 2. We limit the l2 norm of the training gradients to 5 with gradient clipping. The dropout rate is set to 0.1 for all models. We release audio samples online2 and source code later. 3.3. Results We use SI-SDR improvement (SI-SDRi) as evaluation metric. Ta- ble 2 reports the results on the clean settings of WSJ0-2mix/3mix datasets and the noisy/reverberated WHAM!/WHAMR! datasets. Our models are compared with the best reported results in the lit- erature. We report results of the small MossFormer(S) model on (9) 1speechbrain.github.io/ 2https://github.com/alibabasglab/MossFormer LayerNormInputLinearLayerSiLUAcitivation1DDepthwiseConvDropoutOutputReshapeReshape+ Table 2. Performance comparisons on the WSJ0-2mix/3mix and WHAM!/WHAMR! benchmark datasets. Table 3. Ablation studies on the convolution module, the triple- gating mechanism, and the joint attention. Model TasNet [19] Chimera++ [20] SignPredictionNet [21] Conv-TasNet [1] DeepCASA [5] Learnable fbank [22] Two-Step CTN [23] MGST [24] DPRNN [2] SuDoRMRF [6] VSUNOS [3] DPTNet [4] Wavesplit [7] Wavesplit + DM SepFormer [8] SepFormer + DM MossFormer(S) MossFormer(M) + DM MossFormer(L) + DM Upper bound [10] Para.(M) SI-SDRi WSJ0-2mix/3mix WHAM!/WHAMR! - - 55.2 5.1 12.8 - 8.6 - 2.6 2.6 7.5 2.6 29 29 25.7 25.7 10.8 25.3 42.1 - 10.8 11.5 15.3 15.3 17.7 - 16.1 17.0 18.8 18.9 20.1 20.2 21.0 22.2 20.4 22.3 20.9 22.5 22.8 23.1 - / - / / - / 12.7 - / - / / - - / / 14.7 / - / 16.9 / - / 17.3 / 17.8 / 17.6 / 19.5 / 17.8 / 20.8 / 21.2 / 21.2 - - - 9.9 - - / - / / - 12.7 / 8.3 - - / - 12.9 / - - / - 13.1 / 13.9 / 10.3 / 15.2 / 12.2 / / 16.0 / 13.2 / 16.4 / 14.0 / 17.1 / 15.9 17.3 / 16.3 / - - - - - - - - - - standard data version and results of the MossFormer(M) and Moss- Former(L) models on the augmented data version. For the clean settings, our MossFormer(S) outperforms all the previous models except a very competitive result against Wavesplit on WSJ0-2mix. Note that Wavesplit has 29M parameters, more than 2 times of Moss- Former(S), and uses additional speaker identity labels for training. With DM, our MossFormer(M) outperforms all the previous mod- els. On WSJ0-2mix/3mix, MossFormer(M) achieves 22.5 dB and 20.8 dB SI-SNRi compared to 22.3 dB and 19.5 dB for the 26M Sep- Former, and 22.2 dB and 17.8 dB for Wavesplit. Our MossFormer(L) makes further performance improvements on top of MossFormer(M) with an increase of the model dimension. Compared to the upper bounds of 23.1 dB and 21.2 dB on WSJ0-2mix/3mix reported in [10], MossFormer(L) achieves 22.8 dB and 21.2 dB on WSJ0-2mix/3mix. Therefore, MossFormer(L) achieves not only an upper bound but also new state-of-the-art results on WSJ0-2mix/3mix. For the noisy and reverberated settings, Table 2 shows that Moss- Former(M) and MossFormer(L) outperform the previous models with big margins and MossFormer(L) achieves new state-of-the- art results on WHAM! and WHAMR!, respectively. For instance, MossFormer(L) achieves 0.9 dB and 2.3 dB more compared to Sep- Former. Note that the WHAM!/WHAMR! datasets are built on top of WSJ0-2mix by introducing additional noise and reverberation. Therefore the WHAM!/WHAMR! tasks become harder as the mod- els need to address not only speech separation but also denoising and dereverberation. We observe that the reverberation affects Wavesplit and SepFormer more than MossFormer as their performance drop more from WHAM! to WHAMR!. 3.4. Ablation Studies We base MossFormer(S) model and WSJ0-2mix to make ablation studies. Table 3 shows the effects of the convolution module, the gating mechanism, and the joint-attention. We observe that the con- volution modules has an important impact on the performance. When replacing the convolution modules with the dense layers used in GAU [12] in the values as well as in the queries and keys, it is seen that Model MossFormer(S) Quadratic Local Attention Only Linear Global Attention Only Remove output O′ in Eq.(6) Replace ConvM with Dense for U & V Replace ConvM with Dense for Qs & Ks Replace ConvM with Dense for both U & V and Qs & Ks SI-SDRi 20.9 17.8 19.6 20.4 20.5 20.3 19.9 Table 4. Ablation study on different choice of the gating activation function φ. Model MossFormer(S) ReLU 20.0 Gating Activation Function φ GELU 19.9 Bilinear 20.1 Swish 19.9 Sigmoid 20.9 the performance becomes worse. It also shows that the convolution module affects the queries and keys more than the values. When re- moving the output O′ in Eq.(6), the triple-gating structure becomes a single-gating structure as in GAU [12] and the result drops from 20.9 dB to 20.4 dB. It shows the effectiveness of the triple-gating design. We also test the model using the quadratic local attention only or the linear global attention only. The results show that none of them performs well individually. It demonstrates the impact of the joint-attention scheme. Another observation is that the global atten- tion alone performs better than the local attention alone, implying the importance of global modelling. Table 5. Ablation study on settings of attention dimension and chunk size. Kernel Size K2 31 20.9 21 20.6 65 20.7 Attention Dim. D 128 64 20.9 20.5 256 20.8 Chunk Size P 256 20.9 128 20.5 384 20.9 In Table 4, we validate the choice of the activation function φ according to the study [25] and it shows that the Sigmoid function works the best. Table 5 studies the effects of kernel size K2 in the depthwise convolution in ConvM, the attention dimension D, and the chunk size P . We find that the performance improves with larger kernel sizes till 31 but worsens for 65. In addition, D = 128 performs the best. A larger chunk size tends to perform better, but further increasing P from 256 to 384 has no more improvement. 4. CONCLUSIONS In this work, we introduced MossFormer, a Transformer model for monaural speech separation. Contrary to prior models, we learn the local feature patterns and the global long-range dependencies in a unified attentive gating model. Unlike the dual-path framework that models the long-rang interactions implicitly, we employed a quadratic local attention and a low-cost global attention in a joint form to model the long-rang interactions directly. We also combine convolution modules to model the local feature patterns. Our studies demonstrated the importance of each component and achieved much better results than previous models with new state-of-the-art on the benchmarks of WSJ0-2/3mix and WHAM!/WHAMR!. [16] M. Maciejewski, G. Wichern, E. McQuinn, and J. L. Roux, "Whamr!: Noisy and reverberant single-channel speech sep- aration," arXiv:1910.10279, 2019. [17] J. L. Roux, S. Wisdom, H. Erdogan, and J. R. Hershey, "SDR – half-baked or well done?," in Proc. of ICASSP, 2019. [18] D. P. Kingma and J. Ba, "Adam: A method for stochastic opti- mization," arXiv preprint arXiv:1412.6980, 2014. [19] Y. Luo and N. Mesgarani, "TasNet: time-domain audio separa- tion network for real-time, single-channel speech separation," in Proc. of ICASSP, 2018. [20] Z.-Q. Wang, J. L. Roux, and J. R Hershey, "Alternative objec- tive functions for deep clustering," in Proc. of ICASSP, 2018. [21] Z.-Q. Wang, K. Tan, and D. Wang, "Deep learning based phase reconstruction for speaker separation: A trigonometric perspec- tive," in Proc. of ICASSP, 2019. [22] M. Pariente, S. Cornell, A. Deleforge, and E. Vincent, "Fil- terbank design for end-to-end speech separation," in Proc. of ICASSP, 2020. [23] E. Tzinis, S. Venkataramani, Z. Wang, C. Subakan, and P. Smaragdis, "Two-step sound source separation: Training on learned latent targets," in Proc. of ICASSP, 2020. [24] Y. Zhao, C. Luo, Z.-J. Zha, and W. Zeng, "Multi-scale group transformer for long sequence modeling in speech separation," in Proc. of IJCAI, 2020. [25] N. Shazeer, "GLU variants improve transformer," arXiv:2002.05202, 2020. 5. REFERENCES [1] Y. Luo and N. Mesgarani, "Conv-TasNet: Surpassing ideal time–frequency magnitude masking for speech separation," IEEE/ACM Trans. Audio. Speech, Lang. Process., vol. 27, no. 8, pp. 1256–1266, 2019. [2] Y. Luo, Z. Chen, and T. Yoshioka, "Dual-Path RNN: Efficient long sequence modeling for time-domain single-channel speech separation," in Proc. of ICASSP, 2020. [3] E. Nachmani, Y. Adi, and L. Wolf, "Voice separation with an unknown number of multiple speakers," in Proc. of ICML, 2020. [4] J. Chen, Q. Mao, and D. Liu, "Dual-Path Transformer Network: Direct context-aware modeling for end-to-end monaural speech separation," in Proc. of Interspeech, 2020. [5] Y. Liu and D. Wang, "Divide and conquer: A deep casa approach to talker-independent monaural speaker separation," IEEE/ACM Trans. Audio. Speech, Lang. Process., vol. 27, no. 12, 2019. [6] E. Tzinis, Z. Wang, and P. Smaragdis, "Sudo rm -rf: Efficient networks for universal audio source separation," in Proc. of MLSP, 2020. [7] N. Zeghidour and D. Grangier, "Wavesplit: End-to-end speech separation by speaker clustering," IEEE/ACM Trans. Audio. Speech, Lang. Process., vol. 29, 2021. [8] C. Subakan, M. Ravanelli, S. Cornell, M. Bronzi, and J. Zhong, "Attention is all you need in speech separation," in Proc. of ICASSP, 2021. [9] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. "Attention is all you Gomez, L. Kaiser, and I. Polosukhin, need," in Proc. of NIPS, 2017. [10] S. Lutati, E. Nachmani, and L. Wolf, "SepIt: Approaching arXiv preprint a single channel speech separation bound," arXiv:2205.11801, 2022. [11] A. Gulati, J. Qin, C.-C. Chiu, N. Parmar, Y. Zhang, J. Yu, W. Han, S. Wang, Z. Zhang, Y. Wu, and R. Pang, "Conformer: Convolution-augmented transformer for speech recognition," in Proc. Interspeech, 2020, pp. 5036–5040. [12] W. Hua, Z. Dai, H. Liu, and Q. Le, "Transformer quality in linear time," in Proc. of ICML, 2022. [13] J. Su, Y. Lu, S. Pan, A. Murtadha, B. Wen, and Y. Liu, "Ro- Former: Enhanced transformer with rotary position embed- ding," arXiv:2104.09864, 2021. [14] J. R. Hershey, Z. Chen, J. L. Roux, and S. Watanabe, "Deep clustering: Discriminative embeddings for segmentation and separation," in Proc. of ICASSP, 2016. [15] G. Wichern, J. Antognini, M. Flynn, L. R. Zhu, E. McQuinn, D. Crow, E. Manilow, and J. L. Roux, "Wham!: Extending speech separation to noisy environments," in Proc. of Inter- speech, 2019.
http://arxiv.org/abs/2302.11823v1
2023-02-23T07:12:12
2023-02-23T07:12:12
FedIL: Federated Incremental Learning from Decentralized Unlabeled Data with Convergence Analysis
Most existing federated learning methods assume that clients have fully labeled data to train on, while in reality, it is hard for the clients to get task-specific labels due to users' privacy concerns, high labeling costs, or lack of expertise. This work considers the server with a small labeled dataset and intends to use unlabeled data in multiple clients for semi-supervised learning. We propose a new framework with a generalized model, Federated Incremental Learning (FedIL), to address the problem of how to utilize labeled data in the server and unlabeled data in clients separately in the scenario of Federated Learning (FL). FedIL uses the Iterative Similarity Fusion to enforce the server-client consistency on the predictions of unlabeled data and uses incremental confidence to establish a credible pseudo-label set in each client. We show that FedIL will accelerate model convergence by Cosine Similarity with normalization, proved by Banach Fixed Point Theorem. The code is available at https://anonymous.4open.science/r/fedil.
[ "Nan Yang", "Dong Yuan", "Charles Z Liu", "Yongkun Deng", "Wei Bao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11823v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11823v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
1 FedIL: Federated Incremental Learning from Decentralized Unlabeled Data with Convergence Analysis Nan Yang, Dong Yuan, Charles Z Liu, Yongkun Deng and Wei Bao Faculty of Engineering, The University of Sydney {n.yang, dong.yuan, zhenzhong.liu}@sydney.edu.au, [email protected], [email protected] 3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 3 2 8 1 1 . 2 0 3 2 : v i X r a Abstract-Most existing federated learning methods assume that clients have fully labeled data to train on, while in reality, it is hard for the clients to get task-specific labels due to users' privacy concerns, high labeling costs, or lack of expertise. This work considers the server with a small labeled dataset and intends to use unlabeled data in multiple clients for semi-supervised learning. We propose a new framework with a generalized model, Federated Incremental Learning (FedIL), to address the problem of how to utilize labeled data in the server and unlabeled data in clients separately in the scenario of Federated Learning (FL). FedIL uses the Iterative Similarity Fusion to enforce the server-client consistency on the predictions of unlabeled data and uses incremental confidence to establish a credible pseudo- label set in each client. We show that FedIL will accelerate model convergence by Cosine Similarity with normalization, proved by Banach Fixed Point Theorem. The code is available at https://anonymous.4open.science/r/fedil. Index Terms-Semi-Supervised Learning, Federated Learning, Incremental Learning. I. INTRODUCTION Federated Learning (FL) is a decentralized technique where multiple clients collaborate to train a global model through coordinated communication [1]–[3]. This method has been successfully applied in a range of applications and offers solutions to data privacy, security, and access issues [4]– [6]. However, previous FL research [7] often assumes that clients have fully annotated data with ground-truth labels, which can be an unrealistic assumption as labeling data is a time-consuming, expensive process that often requires the participation of domain experts. A more practical scenario is to share a limited amount of labeled data on the server while assisting clients with unlabeled data in model training [8], as proposed in recent studies. The samples and labels on the server side may be accurate, however, it must be acknowledged that the data on the server is limited and does not provide a complete picture. This results in the reflection of only local features, and not global features. While other clients may have more extensive data coverage, the lack of reliable label information causes the features to be unreliable and uncertain. The two main challenges in model training in an FSSL scenario are depicted in Figure 1. Firstly, overfitting can occur when too much reliance is placed on labeled data from the server, leading to poor model generalization. Secondly, the absence of ground-truth labels in the client data may result in the annotating of incorrect pseudo- labels, causing model mislearning and preventing convergence of model training. Motivated by this practical scenario, a naive solution is to simply perform SSL methods using any off-the-shelf methods (e.g. FixMatch [9], UDA [10]), while using federated learning strategies to aggregate the learned weights. The recent method FedMatch [8] uses existing SSL methods based on pseudo- labeling and enhances the consistency between predictions made across multiple models by deploying a second la- beled dataset for validation on the server, but additionally increases the need for labeled data. Other approaches FedU [11], FedEMA [12], and Orchestra [13], use self-supervised strategies to correct the training results of aggregated client models by labeled data on the server. These methods may result in a learning strategy that heavily relies on the feature information of labeled data, leading to the risk of overfitting. Therefore, a major challenge in FSSL is finding a way to correct the training bias caused by uncertain samples and labels on clients while also learning correct feature information from clients that the server does not have. Additionally, current research in this field is based on empirical model design, with no analysis of model convergence for the FSSL scenario. In this paper, we propose Federated Incremental Learn- ing (FedIL), which is a novel and general framework, for addressing the problem of FSSL, aiming at the demanding challenge of how to utilize separated labeled data in the server and unlabeled data in clients. Inspired by the mainstream semi-supervised learning methods based on pseudo-labeling, we alternate the training of labeled data in the server and unlabeled data in selected clients and employ a siamese network for contrastive learning to ensure acquiring high- quality pseudo-labels during training. To prevent the model from forgetting what it has learned from labeled data in the server when learning unlabeled data in clients, our method uses KL loss during client training to enforce the consistency between the predictions made by clients and the server. In clients, FedIL selects high-confidence pseudo-labels obtained through the mechanism of Incremental Credibility Learning to establish an independent and highly credible pseudo-label set in each client, allowing each client to achieve authentic semi-supervised learning to reduce the training bias during the client training. In the server, we screen the uploaded client weights by Cosine Similarity with normalization to accelerate 2 Fig. 1. Illustrations of Two Challenges in Federated Semi-Supervised Learning (a) Model overfitting is caused by over-reliance on the labeled data on the server, leading to poor recognition of one class that is not similar to those in the training data. (b) Model mislearning is caused by incorrect pseudo-labels generated in clients, leading to incorrect classification in that the data belongs to one class but is labeled as another. the convergence of model training. II. RELATED WORK The design of FedIL is based on the specific needs of the FSSL scenario, especially in protecting the data privacy of clients. The convergence condition of the traditional FL model is the decrease of the Loss, while the Loss in FSSL is computed by pseudo-labels rather than ground-truth labels, which is unreliable, and thus cannot guarantee the model convergence. Therefore, we first propose a Theorem base on the Banach fixed point to use weight difference as a criterion rather than Loss to determine model convergence in FSSL, which reveals that the model enters a progressive convergence stage if the increment difference of weight between the server and the client decreases. The main contributions of this work are summarized as follows: • We first introduce Incremental Credibility Learning to select pseudo labels with higher confidence for join- ing a pseudo-label set to establish a real and reliable semi-supervised training in each client. We also propose Global Incremental Learning to use Cosine Similarity with normalization to select client weights that are close to the server weight, which accelerates model learning. • We further propose a Theorem base on the Banach fixed point, a new definition of convergence for FSSL, that is based on weight difference rather than the loss in super- vised FL. This Theorem reveals that the system enters a progressive convergence stage when the weight increment difference between the server and clients decreases. • We propose FedIL, a novel FSSL framework that can enable combined with any type of semi-supervised model based on pseudo labeling and enables learning server- client consistency between supervised and unsupervised tasks. The experiment results show that FedIL outper- forms most of the state-of-the-art FSSL baselines on both IID and non-IID settings. A. Federated Learning Traditional Federated Learning (FL) is a distributed training technique for acquiring knowledge from decentralized clients without transmitting raw data to the server [1]. A number of methods for averaging local weights at the server have been developed in recent years. FedAvg [1] is the standard algorithm for FL, which averages local weights to update the global weight according to the local training size. FedProx [14] uniformly averages the local weights while clients exe- cute proximal regularisation against the global weights. The aggregation policy introduced by PFNM [15] makes use of Bayesian non-parametric methods. FedMA [16] matches the hidden elements with comparable feature extraction signatures when averaging local weights. In addition to the research of aggregation strategies, Non-IID data is also one of the most significant problems of FL [16], causing weight divergence and performance degradation, as explained in [2]. Numerous solutions to this problem have been proposed, including pro- viding a public dataset [2], knowledge distillation [17], and regularising client training [14]. B. Semi-supervised Learning Semi-supervised learning (SSL) combines supervised learn- ing and unsupervised learning, which aims to improve model performance by leveraging unlabeled data [18]–[20]. The majority of SSL methods fall into two categories: Consistency Regularization and Self-Supervised Learning. Consistency regularization [21] assumes that transformation of the input instances will have no effect on the class semantics and requires that the model output be consistent across input perturbations. UDA [10] and ReMixMatch [22] use data augmentations to enforce the consistency between the repre- sentations of two versions of unlabeled data. Pseudo-Label [23] is a popular and mainstream semi-supervised technique that use hard (1-hot) labels from the model's prediction as labels on unlabeled data, implicitly minimizing the prediction's entropy. FixMatch [9] selects pseudo-labels as consistency 3 Fig. 2. Illustrative Running Example of Client. The client uses the global model θ and the server model θ0 to train the unlabeled data to get the client model θ∗. It comprises an end-to-end training pipeline with three steps: 1) Each client selects pseudo-labels with higher confidence. 2) Move the data with pseudo-labels that are continuous and stable for a certain time to the pseudo-label set in each client. 3) Use KL loss during client training to enforce the prediction consistency between the predictions made by clients and the server. (cid:48) between weak-strong augmented pairs from unlabeled data using a fixed and unified threshold. Self-supervised learning obtains supervisory signals from the data itself. For example, contrastive learning [24], [25] tries to reduce the similarity of positive samples while increasing the similarity of negative samples. The negative pairs are created from either a memory bank, such as MoCo [26], or a huge batch size, such as SimCLR [27], but these methods strongly rely on the computation resources. Methods such as BYOL [28] and SimSiam [29] can avoid negative pairs and only compare positive ones, which can be used when computation resources are limited. After a pre-train model is generated by self-supervised learning, a small number of labeled data will be fed to this model. C. Federated Semi-supervised Learning The majority of existing FL research focuses on super- vised learning problems using ground-truth labels provided by clients while most clients are unlikely to be specialists in many real-world tasks, which is faced as an issue in recent studies [30]. FSSL introduces learning representations from unlabeled decentralized data into FL and tries to overcome the labeling issue in traditional FL. Several solutions have been offered to realize FSSL by incorporating classical semi- supervised learning into the framework of federated learning. There are currently two FSSL scenarios, one is Labels-at- Client, and the other one is Labels-at-Server. For the Labels- at-Client, RSCFed [31] relies on label clients to assist in learning unlabeled data in other clients, while there is still a high risk of data leakage in this scenario. For Labels-at- Server, FedMatch [8] focused on adapting the semi-supervised models to federated learning, which introduced the inter- client consistency that aims to maximize the agreement across models trained at different clients. FedU [11] is based on the self-supervised method BYOL [28], which aims for repre- sentation learning. FedEMA [12] is an upgraded version of FedU, which adaptively updates online networks of clients with EMA of the global model. Orchestra [13] relies on high representational similarity for related samples and low similarity across different samples. Our FedIL consists of novel models that enable clients with just unlabeled data to complete semi-supervised training and the novel Cosine Similarity with normalization based aggregation that accelerates the convergence of the global model in federated learning. III. METHOD In the following sections, we introduce FedIL, our proposed federated incremental learning approach shown in Figure 2 and Figure 3. Section A will describe the scenario setting of Federated Semi-Supervised Learning. In the following sections B, C, and D, we will introduce the walkthrough procedures of the Client system, which has been illustrated as shown in Figure 2. In section E, we will introduce training and weight selection of the Server system shown in Figure 3. The summary of the whole system will be introduced in section F. H(y$iu,argmax(y+iu))UnlabeledExamplexiuModel θ#Prediction y%iuFA(x)Strongly-augmented x%iumax (y*iu)>τPseudo-labelargmax(y+iu)Weakly-augmented x+iuModel θ#Predictiony+iuWeakly-augmented x+iuModelθ0Predictiony0iuKL(y0iu, y+iu)fA(x)fA(x)argmax(y0iu) ==argmax (y*iu)IncrementalCredibilityLearningSamePseudo-label ofxiufor Ttimescontinuously(xiu(t), argmax(y+iu(t)))Pseudo Label Set∆Dl (t)UpdatingH(yil(t),l(i∗u(t))Predictionyil(t)Model θ# and the optimal overall solution is obtained by y∗ = f (X, θ∗) 4 (5) It can be seen that the main task now has been converted into finding the optimal parameter θ∗ corresponding to (2) as θ∗ = arg min θ (cid:107)f (X, θ) − y(cid:107) (6) Once the θ∗ is obtained the mapping f can be determined. Since yu ∈ y is unknown, it is impossible to solve θ by directly calculating the measure between the predicted label and the actual label of the domain, so we propose an iterative method to estimate θ∗ based on ̄yu i and θi with incremental similarity belief. B. Hyper-Pseudo Pattern Space For the dataset Du = [X u, yu] with unknown labels, it is not feasible to use the difference between ̄yu and yu to construct a loss function for learning model updates. The yu are pseudo labels generated by the model strategies, which cannot be equivalent to the ground-truth labels and suffers from certain labeling errors. Therefore, we constructed the Hyper-Pseudo Pattern Space to approximate a pattern of loss model in FSSL, which is equivalent to the loss model for centralized learning built with yu and ̄yu, through a set of nonlinear projections based on a set of augmentations of X u and corresponding estimations to the labels. We expect to detect more features from the data itself to guess the commonality of their labels. Therefore, we introduce pseudo-data derivation from data and weights to generate hyper context. Specifically, we introduce three deriva- tive mappings, including weak augmentation fA(*), strong augmentation FA(*), and the server reference f (*, θ0) to derive three estimations to the labels, as shown in Figure 2, in which weakly and strongly augmentation sub-data of X u can be obtained by ˆX u = fA(X u) (7) and the estimated ˆyu, (cid:101)yu corresponding to ˆX u, (cid:101)X u are ob- tained by mapping f as (cid:101)X u = FA(X u) ˆyu = f ( ˆX u, θ (cid:48) ) (cid:101)yu = f ( (cid:101)X u, θ (cid:48) ) and the server reference label can be obtained by 0 = f ( ˆX u, θ0) yu (8) (9) where θ0 refers to the weight from supervised learning in the server. The client-mapping corresponding to (8)-(9) can be formulated as i = f ( ˆX u ˆyu i = f ( (cid:101)X u i , θ i , θ y0 ) (cid:48) (cid:48) ) (cid:101)yu u i = f ( ˆX u i , θ0) i = 1, 2, . . . , n (10) With the estimated labels, we can select a part of the estimated yu (pseudo labels) as reference labels to enhance the likelihood of classification learning for unlabeled samples. To distinguish the unselected X u, yu, we rewrite the selected pseudo-labels and their corresponding dataset as Dl = [X l, ˆl∗u], which are described in section D. Fig. 3. Illustrative Running Example of Server. We describe training and updating in the server and introduce the communication procedure between the server and local clients. The server uses Cosine Similarity with normalization to select client weights that are close to the server weight, which accelerates model training. The aggregated global model is θ to supervise training the labeled data to get the server model θ0. , and the server uses θ (cid:48) (cid:48) A. Modeling and Federated Mapping Let the whole dataset for the training be D as (cid:21) (cid:21) D = [X, y] = (cid:20)X s X u ys yu (cid:20)Ds Du = (1) where X refers to the input and y refers to the label, X s refers to the input with known labels ys, being the dataset Ds = [X s, ys]; while X u refers to the input without labels, and yu serves as unknown labels corresponding to X u. The main task is to obtain the estimation ̄yu corresponding to the input X u with the mapping f built based on D, which satisfies (cid:26) minf (cid:107)yu − ̄yu(cid:107) ̄yu = f (X u) (2) in which (cid:107) * (cid:107) refers to the difference measurement. Solving the mapping f that satisfies (2) is the process of finding a function that can be fitted to the best mapping relationship by known Ds. However, in the practical process, the unidentified label yu is unknown, so we cannot know exactly what the label corresponding to X u is. Therefore, we introduce a semi-supervised learning strategy for solving this mapping, which can be formulated as ̄yu = f (X u, θ) (3) in which θ refers to the weights for the learning. i with unlabeled data X u In federated learning, the learning system will take place in a distributed system that is composed of a Server and multiple Clients with index i = 1, 2, . . . , n. Each client uses a dataset Du i . The server and all the clients have the same learning model f . Each local client learns a part of the data and submits its learning weights θi to the server, and the server (index i = 0) collects and integrates weights, and then performs supervised learning on labeled dataset Ds. The client-mapping corresponding to (3) can be formulated as i = f (X u ̄yu i , θi) i = 1, 2, . . . , n (4) C. Iterative Similarity Fusion Since there is no known label yu to determine the final optimal solution f in (2), we design an iterative approach to optimize the processing of the most probable optimal solution. On the basis of the above hyper-pseudo space, we use a number of different similarity comparisons and fusions for final confirmation and find an optimal solution that can optimize the fitting weights in different hyper-pseudo contexts. Let θi(t) be the parameter of ith local client at t training rounds. The local optimal parameter θ∗ i (t) is formulated as i (t) = f b(ξa θ∗ i (t) + ξb i (t)) (11) i and ˆyu where f b refers to the back-propagation weight updating for i , and ξb is the f , ξa is the Cross-entropy of the (cid:101)yu Kullback–Leibler divergence to measure how one probability distribution ˆyu is different from a reference probability distri- i bution y0 (cid:26) ξa i (t) = ε(max(ˆyu ξb i (t) = KL(y0 i (t)) − τ )H((cid:101)yu i (t), ˆyu u i (t)) u i , which can be formulated as i (t), arg max(ˆyu i (t))) (12) in which ε(x) refers to step function as (cid:26) 1 x ≥ 0 0 else ε(x) = (13) f b here is equivalent to fusing the features obtained by each context and using it to update the weights of the clients. In the standard semi-supervised learning methods, learning on labeled and unlabeled data is simultaneously done using a shared set of weights. However, this may result in forgetting knowledge of labeled data in disjoint learning scenarios, such as FSSL. FedIL ensures consistency between the class with the highest probability predicted by the local model and the server model when updating the pseudo-label dataset. However, FedIL wants to learn information about all classes instead of treating all negative labels uniformly when training a local model with an unselected unlabeled dataset. In the output of the softmax layer, other classes carry a lot of information besides the class with the highest probability. Therefore, in addition to the regular Cross-entropy loss ξa(t) in semi- supervised models, we propose a consistency KL loss ξb(t) that regularizes the models learned between the server and clients to output the same estimation. D. Incremental Credibility Learning with Dataset Updating it is difficult For unlabeled training data, to guarantee the beginning that pseudo-labels given by the system at are correct. We, therefore, design incremental confidences to observe whether their estimated labels always stabilize at a deterministic result after successive training and validation. Each continuous identification of a classification result will increase the credibility of its label. In the current FSSL scenario, labeled data and unlabeled data are disjoint. To enable complete semi-supervised training in the client, we design a dataset updating strategy by introducing a pseudo- label set to store the selected high-confidence data. 5 In order to integrate the credibility into the optimization for the parameter mapping solution, we further formulate the optimal incremental credibility learning as i (t) = f b(ξa θ∗ i (t) + ξb in which f b(*) refers to the back-propagation mapping to update the weight based on the loss input (*) and i (t) + ξc i (t)) (14) ξc(t) = H(yl i(t), ˆl∗u i(t) refers to the predictions generated by the input X l i i(t), which can be formulated as where yl using the model trained by Dl i (t)) (15) i(t) = f (X l yl i , θi(t)) (16) and ˆl∗u i (t) refers to the optimal pseudo-labels which satisfied two main principles, 1) the label has been consecutively selected as a pseudo-label no less than T times; 2) the u i (t)) == count of the compliance of the rule arg max(y0 arg max(ˆyu i (t))) has been no less than T times. The first time an unlabeled image is involved in training in Dl i(t) can be formulated as ˆl∗u i (t) = α(ˆyu i (t), ˇlu i (t)) arg max(ˆyu i (t − t1 i )) ˇlu i (t) = 1(arg max(y0 i (t)) == arg max(ˆyu u in which 1 refers to the selection function and i (t))) (17) (18) α(ˆyu i (t), ˇlu i (t)) = T (cid:89) ε(max(ˆyu i (t − tk i )) − τ )ε(ˇlu i (t − tk i ))) k=1 (19) When the result is continuous and stable for a long time after a series of confidence increments accumulate to reach a threshold, the data X u i (t)) will be used as candidate credible samples as ∆Dl i(t) and incorporated into the known label dataset Dl i(t + 1) as a reference with unchanged labels for the following training rounds. i (t) and the label arg max(ˆyu The federated pseudo-label set updating can be formulated as Dl i(t + 1) = [X l i (t + 1), ˆl∗u i (t + 1)] (20) where    Dl X l i (t)} i (t) i(t) = {X l i (t + 1) = X l ∆X l i (t + 1) = ˆl∗u ˆl∗u ∆ˆl∗u i (t) = {F −1 i (t), ˆl∗u i (t) ∪ ∆X l A ((cid:101)yu i (t) ∪ ∆ˆl∗u i (t) = f (∆X l i (t) i (t), θi(t)) i (t), θi(t)) | α(ˆyu i (t), ˇlu i (t)) = 1} in which F −1 A refer to the inverse mapping of FA. (21) E. Global Incremental Learning As an iterative update of federated learning, we propose global incremental learning by Cosine Similarity with weight normalization to update the learning weights of each round which is shown in Figure 3, that is, the final learning results of each round will be aggregated into θ(cid:48) through the server (i = 0) system and assigned to each client as the weights of the next round of initial training. The parameter updating of the server (i = 0) can be formulated in an iterative form as θ0(t) = f b(H(ys, arg max(y0(t)))) (22) where y0(t) refers to the prediction based on the X s with the model f and parameter θ(cid:48), i.e., y0(t) = f (X s, θ(cid:48)(t)) (23) in which Ds = [X s, ys] refers to the supervised learning dataset with known labels ys. So the process of solving the model f is equivalent to the process of optimizing θ(cid:48)(t). The aggregated updating can be formulated as θ(cid:48)(t + 1) = θ(cid:48)(t) + ∆θ(t) (24) where the ∆θ(t) can obtained by (25). The incremental ∆θ(t) can be formulated as ∆θ(t) = (cid:80)n i=1 ε(S(t))(θ∗ (cid:80)n i=1 ε(S(t)) i (t) − θ(cid:48)(t)) (25) in which S(t) refers to the cosine similarity between θ∗ θ(cid:48)(t) and θ0(t) − θ(cid:48)(t) that i (t) − S(t) = cos(θ∗ i (t) − θ(cid:48)(t), θ0(t) − θ(cid:48)(t)) (26) F. Summarization of the Framework FedIL well solves the problem of disjoint between la- beled data and unlabeled data and achieves complete semi- supervised training by establishing its own pseudo-label set on each client. Furthermore, Global Incremental Learning helps the server to effectively select the uploaded client weights, which accelerates the convergence of the global model. Based on the federated learning scenario, we separately demonstrate the training process on the server in Algorithm 1 and the training process on local clients in Algorithm 2. (cid:48) (cid:48) (cid:48) (t = 1) randomly. Take θ For Server-side training in Algorithm 1, we aggregate the selected weights from clients in the same direction as the server weight by cosine similarity with normalization. For example, we demonstrate how to derive θ (t = 2). Let t = 1, which means the first training round starts, and initialize global model θ (t = 1) as a reference point and train on the labeled data to get θ0(t = 1), and broadcast (t = 1) and θ0(t = 1) to clients for training. After the first θ training round, select the client models θ∗ i (t = 1) that are close to the server model θ0(t = 1) by using cosine similarity cos(θ∗ (t = 1)). Next, calculate the increment of the difference ∆θ(t = 1) between the selected client models and the global model by (25), and use (24) to get θ (t = 1), θ0(t = 1) − θ i (t = 1) − θ (t = 2). (cid:48) (cid:48) (cid:48) (cid:48) For Client-side training in Algorithm 1, we use KL loss to enforce Server-Client consistency and use Incremental Credibility Learning to build high-confidence Pseudo Label Sets. For example, when selected clients receive the server weight θ0(t) and the global weight θ (t) from the server, unsupervised training based on pseudo labeling will start on clients and we use Cross-entropy loss and KL loss to update Client weight θ∗ i (t). For Pseudo Label Set updating, when pseudo labels arg max(ˆyu i (t)) of one image are continuous (cid:48) 6 and stable for a long period of time, the data X u the label arg max(ˆyu samples in ∆Dl dataset Dl the subsequent training rounds. i (t) and i (t)) will be used as candidate credible i(t) and incorporated into the known label i(t + 1) as a reference with unchanged labels for Algorithm 1 FedIL in the Server 1: for each training round t = 1, 2, 3... do 2: 3: if t = 1 then (cid:48) 4: 5: 6: 7: 8: 9: 10: 11: 12: randomly initialize θ (t = 1) Processing with (22) to update Server weight θ0(t = 1) Randomly select 5 clients from 100 clients broadcast θ Clients (t = 1) and θ0(t = 1) to the next selected (cid:48) else (cid:48) i (t) from clients Received θ∗ {received the weights from clients selected in the last round.} Processing with (24)(25)(26) to update the global weight θ Processing with (22)(23) to update Server weight θ0(t + 1) Randomly select 5 clients from 100 clients broadcast θ Clients (t + 1) and θ0(t + 1) to the next selected (t + 1) (cid:48) end if 13: 14: end for Algorithm 2 FedIL in selected Clients 3: 4: 5: 1: for each selected Client i in parallel do 2: (cid:48) (t) from the Server Received the Server weight θ0(t) and the global weight θ Processing with (12)(13)(14)(15)(16) to update Client weight θ∗ for each Pseudo Label Set updating do i (t) Processing with (17)(18)(19)(20)(21) Pseudo Label Set Dl i(t + 1) to update end for upload θ∗ 6: 7: 8: end for i (t) to the Server IV. CONVERGENCE ANALYSIS OF FEDIL In this section, we provide that the proposed global incre- mental learning possesses the theoretical justification of fixed point convergence, which can be proved as follows. Definition 1: Let (X, d) be a complete metric space. Then a map T : X → X is a contraction mapping on X if ∃q ∈ [0, 1) such that d(T (x), T (y)) ≤ qd(x, y)∀x, y ∈ X. (27) Lemma 1: Banach Fixed Point Theorem. Let (X, d) be a non-empty complete metric space with a contraction mapping T : X → X. Then T admits a unique fixed-point x∗ in X (i.e. T (x∗) = x∗). remark 1: The fixed point x∗ in the non-empty complete metric space (X, d) can be found as T n(x0) = x∗ lim n→∞ xn = lim n→∞ in which x starts with an arbitrary element x0 ∈ X and define a sequence with the contraction mapping as (xn)n∈N by xn = T (xn−1) for n ≥ 1. (28) Theorem 1: Let (Θ, d) be a non-empty norm space of parameter set, in which Θ = {θ}, d(θ) = (cid:107)θ(cid:107). Under the proposed Global Incremental Learning (24) (25), ∃θ∗ ∈ Θ that θ(cid:48)(t) = θ∗ lim t→∞ (29) if and only if the norm of ∆θ(t) is monotonically decreasing with t that d(cid:107)∆θ(t)(cid:107) dt Proof 1: In (Θ, d), define mapping T : Θ → Θ as ≤ 0 (30) T (θ(cid:48)(t)) = θ(cid:48)(t) + ∆θ(t) = θ(cid:48)(t + 1) (31) where ∆θ(t) is obtained by (25). Therefore, d(T (θ(cid:48)(t)), T (θ(cid:48)(t − 1))) = (cid:107)θ(cid:48)(t + 1) − θ(cid:48)(t)(cid:107) = (cid:107)∆θ(t)(cid:107) (32) similarly, d(θ(cid:48)(t), θ(cid:48)(t − 1)) = (cid:107)∆θ(t − 1)(cid:107). d(T (θ(cid:48)(t)), T (θ(cid:48)(t − 1))) d(θ(cid:48)(t), θ(cid:48)(t − 1)) = (cid:107)∆θ(t)(cid:107) (cid:107)∆θ(t − 1)(cid:107) Since d(cid:107)∆θ(t)(cid:107) dt we have (cid:107)∆θ(t)(cid:107) ≤ (cid:107)∆θ(t − 1)(cid:107) therefore, ∃q ∈ (0, 1) ≤ 0 (33) (34) d(T (θ(cid:48)(t)), T (θ(cid:48)(t − 1))) ≤ qd(θ(cid:48)(t), θ(cid:48)(t − 1)) (35) where (cid:107)∆θ(t)(cid:107) (cid:107)∆θ(t − 1)(cid:107) ≤ q < 1 (36) Therefore, with Definition 1, T defined by (31) is a contraction mapping, so the sufficiency of Theorem 1 is proved with lemma 1. When (35) holds, if d(cid:107)∆θ(t)(cid:107) dt > 0 (37) which yields (cid:107)∆θ(t)(cid:107) (cid:107)∆θ(t − 1)(cid:107) = d(T (θ(cid:48)(t)), T (θ(cid:48)(t − 1)) d(θ(cid:48)(t), θ(cid:48)(t − 1)) > 1 (38) in which it is impossible to find q ∈ (0, 1) to satisfy (35), which shows the contradiction and the necessity is proved with proof by contradiction. Therefore, Theorem 1 holds if and only if the norm of ∆θ(t) is monotonically decreasing with t. Theorem 1 reveals the relationship among global learning θ(cid:48)(t), local learning θ∗ i (t), server learning θ0(t) and gives the necessary and sufficient condition for federated learning to en- ter the convergence stage. It is when the incremental difference ∆θ(t) between the distributed local learning weights and the server weights decreases according to the norm (cid:107)∆θ(t)(cid:107), the global incremental learning weights θ(cid:48)(t) gradually converge to the fixed point θ∗ in the parameter space Θ. 7 The condition of Theorem 1 is only ∆θ (weight different) monotonically decreasing for each training round, and the conclusion is ∆θ approaching 0 as time goes on. The novelty of the Theorem is the new definition of convergence for FSSL that is based on weight difference rather than the loss in supervised FL. This is because client data are unlabeled in FSSL, and the loss is computed by pseudo-labels rather than ground-truth labels, which is unreliable and thus cannot guarantee model convergence. We are the first to use weight difference as a criterion rather than loss to determine model convergence in FSSL. V. EXPERIMENT A. Experimental Setup Datasets. We conduct our experiments using three public datasets, including MNIST [32], CIFAR10 and CIFAR100 [33]. The MNIST dataset is a widely used dataset in the field of computer vision and machine learning. It consists of handwritten digit images and is considered a benchmark dataset for image classification tasks. This dataset is split into a 60,000-image training set and a 10,000-image test set. There are 60,000 32x32 color images in CIFAR10 and CIFAR100, where the training set has 50,000 images and the test set has 10,000 images. The CIFAR10 and CIFAR100 datasets, on the other hand, contain natural images belonging to 10 and 100 classes respectively. These datasets contain a large number of color images, making them a popular choice for testing the performance of image classification algorithms. Both CIFAR datasets have been used extensively in the research community to evaluate the performance of various computer vision and machine learning models. Federated System Setting. The whole dataset D will be randomly divided into two separate groups: a labeled set Ds and an unlabeled set Du. The labeled set will be held by the server, while the unlabeled set will be further divided and distributed among K = 100 clients. Each client will receive |Du| K instances for the independent and identically distributed (IID) setting and 20% of the total classes for the non-IID (Not IID) setting. The quantity of unlabeled training data is represented by |Du|. To represent the ratio of labeled data in the entire training dataset, the variable γ is introduced. This means that there will be γ ∗ |D| labeled samples on the server and (1−γ)∗|D| unlabeled data on each client. This distribution is designed to ensure an equal distribution of labeled and unlabeled data among the clients and the server. We set γ = 0.01, 0.1 in the experiments, and only 5 local clients are working in each round. The total training rounds are 2000. Baselines. To fairly evaluate the proposed FedIL framework, we use the same backbone ResNet9 and the following state- of-the-art benchmarks. 1) Fully-Supervised: centralized su- pervised training for the whole labeled datasets. 2) FedMatch [8]: use FedAvg-FixMatch with inter-client consistency and parameter decomposition to train the models. 3) FedU [11]: use the divergence-aware predictor updating technique with self-supervised BYOL [28] to train the models. 4) FedEMA [12]: use an Exponential Moving Average (EMA) of the K TABLE I METHOD-WISE ACCURACY EVALUATION STATS ON IID AND NON-IID SETTINGS OF MNIST, CIFAR10 AND CIFAR100 DATASETS. OUR PROPOSED FEDIL OUTPERFORMS MOST OF THE STATE-OF-THE-ART METHODS. 8 Label rate Fully-Supervised FedMatch FedU FedEMA Orchestra FedIL MNIST CIFAR10 IID non-IID IID non-IID γ=0.01 γ=0.1 γ=0.01 γ=0.1 γ=0.01 γ=0.1 γ=0.01 γ=0.1 97.13% ±0.15 95.42% ±0.23 97.17% ±0.21 96.57% ±0.21 98.30% ±0.21 99.50%±0.02 93.59%±0.03 98.89% ±0.21 98.13% ±0.12 98.90% ±0.13 97.86% ±0.13 99.05% ±0.13 97.22% ±0.23 96.74% ±0.22 96.26% ±0.13 95.97% ±0.28 98.46% ±0.08 98.28% ±0.26 98.78% ±0.08 98.60% ±0.25 97.74% ±0.15 99.08% ±0.25 55.30% ±0.17 54.17% ±0.08 54.85% ±0.09 60.32% ±0.17 61.31% ±0.25 82.20% ±0.29 60.05% ±0.13 63.73% ±0.32 67.17% ±0.23 82.51% ±0.14 54.26% ±0.13 58.73% ±0.15 58.44% ±0.22 57.92% ±0.25 58.98% ±0.16 CIFAR100 IID γ=0.1 non-IID γ=0.1 71.71%±0.05 79.50% ±0.15 72.36% ±0.32 72.49% ±0.18 65.24% ±0.17 79.14% ±0.27 46.43% ±0.33 30.82% ±0.26 30.25% ±0.26 31.15% ±0.17 48.25% ±0.17 46.60% ±0.15 31.51% ±0.15 31.65% ±0.23 31.42% ±0.26 46.39% ±0.25 global model to adaptively update online client networks. 5) Orchestra [13]: use a novel clustering-based FSSL technique. B. Experimental Results Comparison with FSSL methods. We demonstrate our ex- perimental results in Table I, which shows a performance summary using MNIST, CIFAR10 and CIFAR100 by different FSSL methods with the comparison of accuracy and parame- ters in the scenarios of IID and non-IID. The method FedIL we use in our experiments is limited in the sense that it only utilizes the training dataset and the test dataset, and does not incorporate the validation dataset. This is in contrast to FedMatch, which leverages the validation dataset to optimize its weight aggregation by adjusting its parameters in the server. The validation dataset plays a crucial role in this process as it consists of labeled data, and hence allows for a supervised learning approach. By using the validation dataset, FedMatch effectively learns from two labeled datasets, namely Ds1 which is the labeled data in the training dataset, and Ds2 which is the labeled data in the validation dataset. This results in better performance compared to our method, which only utilizes a single labeled dataset. In practice, this solution is not fully applicable, especially when the amount of labeled data is limited. In such cases, dividing the limited labeled data into separate datasets for training and validation becomes problematic as there may not be enough labeled samples to ensure a representative and bal- anced split. Over-fitting is a common issue in these scenarios, where the model becomes overly reliant on the limited labeled data and fails to generalize well to unseen data. To address these limitations, our model employs a different approach to solving for parameters. It uses an incremental credibility-based process that is more in line with the practical application of semi-supervised learning. This method reduces the amount of labeled data required for training, making it more suitable for scenarios where the labeled data is limited. Additionally, our model can also be extended to incorporate validation data if available, making it more flexible and applicable in a wider range of scenarios. Trend of incremental ∆θ(t). The proposed incremental cred- ibility approach ensures that the learning process is gradually Fig. 4. Trend of ∆θ(t) in FedIL. convergent. As illustrated in Figure 4, the trend of ∆θ(t) during the incremental learning of the proposed method can be seen, where ∆θ(t) represents the moving average of ∆θ(t). Despite any perturbations that may occur during the learning process, the overall trend remains one of gradual decline, demonstrating that the proposed federated incremental strat- egy effectively solves the optimal mapping based on model parameter learning and leads to a convergent solution process. The experimental results further confirm the criterion outlined in Theorem 1, indicating that the system's solution process, designed based on the criteria defined in Theorem 1, will eventually converge to a fixed point. VI. ABLATION STUDY A. The Impact of Number of Clients. The impact of the number of clients participating in each training round on the performance of the global model can be seen in Figure 5. Our experiments on the CIFAR10 dataset, conducted over 1000 training rounds, demonstrate a clear correlation between the number of clients selected and the global model performance. As the number of clients increases from 5 to 20, we observe a corresponding improvement in t(t)/HDUQLQJ7UHQGRI(t)(t)(t) 9 TABLE II MODULES ANALYSIS IN FEDIL. Modules FedIL FedIL without pseudo-label set FedIL without Cosine Similarity FedIL without a pseudo-label set and Cosine Similarity Acc 61.31 60.77 28.59 27.21 method still achieved a close-to-30% accuracy within a limited number of training rounds. The incorporation of the candidate label mechanism resulted in a 1% improvement in accuracy, while the use of the similarity adjustment screening strategy resulted in an increase to over 60%. When both the candidate tag mechanism and the similarity incremental screening were utilized simultaneously, the accuracy reached over 61%. This highlights the significant impact of a similar incremental strategy on performance and the contribution of the candidate labeling mechanism toward accelerating the learning process. The core of this method involves the continuous enhancement of label identification by the upper-level server calculation, and the selection of candidate labels for semi-supervised learning tasks through similar incremental learning at each local client calculation in the network, which iterates over time. TABLE III ACCURACY STATS OF FEDIL ON VARIOUS COUNT OF SUCCESSIVE LABELING k. THE DATASET USED HERE IS CIFAR10. Count of Successive Labeling k Accuracy 2 3 4 5 6 7 8 52.95 ±0.13 54.03 ±0.35 54.10 ±0.26 59.51 ±0.17 60.27 ±0.26 61.31 ±0.25 62.03 ±0.37 D. Count of Successive Labeling k and Threshold τ According to the trend shown in Table III, it is evident that there is a trade-off between the reliability of the candidate tag data and calculation time. A larger value of k results in more reliable candidate labels, but it also increases the calculation time. Hence, when selecting parameters, is essential to consider not only the performance metrics but also the distribution characteristics, computational costs, and time constraints. In our study, we have chosen k = 7 and threshold τ equal to 0.95, which is consistent with the parameters used in the Fixmatch [9]. By balancing the competing demands of accuracy and efficiency, we aim to achieve optimal results in our experiments. it VII. CONCLUSION This paper proposes Federated Incremental Learning (FedIL) with an incremental credibility learning strategy to select highly credible pseudo-labels to join the pseudo-label set to establish complete semi-supervised training on unknown samples in each client. We utilize cosine similarity to select client weights and propose a standardized global incremental learning framework to speed up training models while ensuring server-client consistency between learning supervised and un- supervised tasks. Based on Banach's fixed point theorem, we Fig. 5. The Impact of Number of Clients. the global model's performance. However, beyond a certain point, we see that further increases in the number of clients lead to a decrease in the global model's performance. This is likely due to the fact that the data on the clients is unlabeled and incorporating too much of this unknown data in the early stages of training can slow down the convergence of the model. Fig. 6. The Influence of Number of Local Training Epochs. B. The Influence of Number of Local Training Epochs. The influence of the local training epochs in each training round on the performance of the global model is demonstrated in Figure 6. The data on the clients being unlabeled, and con- ducting too many epochs in each client during the early stages of training can have a negative effect on the performance of the model. Our experiments, conducted on the CIFAR10 dataset over 1000 training rounds, show that the optimal number of local training epochs is 5. The results suggest that it is crucial to strike a balance between the number of epochs and the stage of training in order to maintain the optimal performance of the global model. C. The Evaluation of Different Modules For the necessity of each module, we also did an ablation analysis. The results, as presented in Table II, demonstrate that even without the use of the pseudo-label candidate mechanism and the similar incremental screening strategy, the proposed 10 [14] T. Li, A. K. Sahu, M. Zaheer, M. Sanjabi, A. Talwalkar, and V. Smith, "Federated optimization in heterogeneous networks," Proceedings of Machine Learning and Systems, vol. 2, pp. 429–450, 2020. [15] M. Yurochkin, M. Agarwal, S. Ghosh, K. Greenewald, N. Hoang, and Y. Khazaeni, "Bayesian nonparametric federated learning of neural networks," in International Conference on Machine Learning, pp. 7252– 7261, PMLR, 2019. [16] H. Wang, M. Yurochkin, Y. Sun, D. Papailiopoulos, and Y. Khazaeni, "Federated learning with matched averaging," in International Confer- ence on Learning Representations, 2020. [17] W. Zhuang, Y. Wen, X. Zhang, X. Gan, D. Yin, D. Zhou, S. Zhang, and S. Yi, "Performance optimization of federated person re-identification via benchmark analysis," in Proceedings of the 28th ACM International Conference on Multimedia, pp. 955–963, 2020. [18] A. Rasmus, M. Berglund, M. Honkala, H. Valpola, and T. Raiko, "Semi-supervised learning with ladder networks," Advances in neural information processing systems, vol. 28, 2015. [19] Z.-H. Zhou and M. Li, "Tri-training: Exploiting unlabeled data using three classifiers," IEEE Transactions on knowledge and Data Engineer- ing, vol. 17, no. 11, pp. 1529–1541, 2005. [20] O. Chapelle, B. Scholkopf, and A. Zien, "Semi-supervised learning (chapelle, o. et al., eds.; 2006)[book reviews]," IEEE Transactions on Neural Networks, vol. 20, no. 3, pp. 542–542, 2009. [21] M. Sajjadi, M. Javanmardi, and T. Tasdizen, "Regularization with stochastic transformations and perturbations for deep semi-supervised learning," Advances in neural information processing systems, vol. 29, 2016. [22] D. Berthelot, N. Carlini, E. D. Cubuk, A. Kurakin, K. Sohn, H. Zhang, and C. Raffel, "Remixmatch: Semi-supervised learning with distribution matching and augmentation anchoring," in 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020, OpenReview.net, 2020. [23] D.-H. Lee et al., "Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks," in Workshop on challenges in representation learning, ICML, vol. 3, p. 896, 2013. [24] R. Hadsell, S. Chopra, and Y. LeCun, "Dimensionality reduction by learning an invariant mapping," in 2006 IEEE Computer Society Con- ference on Computer Vision and Pattern Recognition (CVPR'06), vol. 2, pp. 1735–1742, IEEE, 2006. [25] A. v. d. Oord, Y. Li, and O. Vinyals, "Representation learning with contrastive predictive coding," arXiv preprint arXiv:1807.03748, 2018. [26] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick, "Momentum contrast for unsupervised visual representation learning," in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9729–9738, 2020. [27] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, "A simple framework for contrastive learning of visual representations," in International conference on machine learning, pp. 1597–1607, PMLR, 2020. [28] J.-B. Grill, F. Strub, F. Altch ́e, C. Tallec, P. Richemond, E. Buchatskaya, C. Doersch, B. Avila Pires, Z. Guo, M. Gheshlaghi Azar, et al., "Bootstrap your own latent-a new approach to self-supervised learning," Advances in neural information processing systems, vol. 33, pp. 21271– 21284, 2020. [29] X. Chen and K. He, "Exploring simple siamese representation learning," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15750–15758, 2021. [30] Y. Jin, X. Wei, Y. Liu, and Q. Yang, "Towards utilizing unlabeled data in federated learning: A survey and prospective," arXiv preprint arXiv:2002.11545, 2020. [31] X. Liang, Y. Lin, H. Fu, L. Zhu, and X. Li, "Rscfed: Random sampling consensus federated semi-supervised learning," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10154–10163, 2022. [32] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, "Gradient-based learning applied to document recognition," Proceedings of the IEEE, vol. 86, no. 11, pp. 2278–2324, 1998. [33] A. Krizhevsky, G. Hinton, et al., "Learning multiple layers of features from tiny images," 2009. further prove the necessary and sufficient conditions for the convergence of global incremental learning, revealing that the system enters a progressive convergence stage when the weight increment difference between server and client decreases. Experimental validation shows that the proposed FedIL outperforms most of the FSSL baselines on common public datasets, thus demonstrating the feasibility of the proposed FedIL mechanism for performance improvement in federated semi-supervised learning by determining the estimation of unlabeled data with incremental learning. Due to the existing hardware limitations of client devices, federated learning can only be implemented with small backbones and datasets, e.g., MNIST, CIFAR10 and CIFAR100. In future work, we will investigate the applicability of large-scale datasets, e.g., ImageNet, in the FSSL scenario. REFERENCES [1] 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. [2] Y. Zhao, M. Li, L. Lai, N. Suda, D. Civin, and V. Chandra, "Federated learning with non-iid data," arXiv preprint arXiv:1806.00582, 2018. [3] Y. Chen, X. Sun, and Y. Jin, "Communication-efficient federated deep learning with layerwise asynchronous model update and temporally weighted aggregation," IEEE transactions on neural networks and learning systems, vol. 31, no. 10, pp. 4229–4238, 2019. [4] A. Hard, K. Rao, R. Mathews, S. Ramaswamy, F. Beaufays, S. Augen- stein, H. Eichner, C. Kiddon, and D. Ramage, "Federated learning for mobile keyboard prediction," arXiv preprint arXiv:1811.03604, 2018. [5] W. Yang, Y. Zhang, K. Ye, L. Li, and C.-Z. Xu, "Ffd: A federated learning based method for credit card fraud detection," in International conference on big data, pp. 18–32, Springer, 2019. [6] T. S. Brisimi, R. Chen, T. Mela, A. Olshevsky, I. C. Paschalidis, and W. Shi, "Federated learning of predictive models from federated electronic health records," International journal of medical informatics, vol. 112, pp. 59–67, 2018. [7] Y. Han and X. Zhang, "Robust federated learning via collaborative machine teaching," in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 34, pp. 4075–4082, 2020. [8] W. Jeong, J. Yoon, E. Yang, and S. J. Hwang, "Federated semi- supervised learning with inter-client consistency & disjoint learning," in International Conference on Learning Representations (ICLR) 2021, International Conference on Learning Representations (ICLR), 2021. [9] K. Sohn, D. Berthelot, N. Carlini, Z. Zhang, H. Zhang, C. Raffel, E. D. Cubuk, A. Kurakin, and C. Li, "Fixmatch: Simplifying semi- supervised learning with consistency and confidence," in Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual (H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin, eds.), 2020. [10] Q. Xie, Z. Dai, E. Hovy, T. Luong, and Q. Le, "Unsupervised data augmentation for consistency training," Advances in Neural Information Processing Systems, vol. 33, pp. 6256–6268, 2020. [11] W. Zhuang, X. Gan, Y. Wen, S. Zhang, and S. Yi, "Collaborative unsupervised visual representation learning from decentralized data," in 2021 IEEE/CVF International Conference on Computer Vision, ICCV 2021, Montreal, QC, Canada, October 10-17, 2021, pp. 4892–4901, IEEE, 2021. [12] W. Zhuang, Y. Wen, and S. Zhang, "Divergence-aware federated self- supervised learning," in International Conference on Learning Repre- sentations, 2021. [13] E. S. Lubana, C. I. Tang, F. Kawsar, R. P. Dick, and A. Mathur, "Orchestra: Unsupervised federated learning via globally consistent clustering," in International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA (K. Chaudhuri, S. Jegelka, L. Song, C. Szepesv ́ari, G. Niu, and S. Sabato, eds.), vol. 162 of Proceedings of Machine Learning Research, pp. 14461– 14484, PMLR, 2022.
http://arxiv.org/abs/2302.11814v2
2023-03-15T14:35:50
2023-02-23T06:53:16
FTM: A Frame-level Timeline Modeling Method for Temporal Graph Representation Learning
Learning representations for graph-structured data is essential for graph analytical tasks. While remarkable progress has been made on static graphs, researches on temporal graphs are still in its beginning stage. The bottleneck of the temporal graph representation learning approach is the neighborhood aggregation strategy, based on which graph attributes share and gather information explicitly. Existing neighborhood aggregation strategies fail to capture either the short-term features or the long-term features of temporal graph attributes, leading to unsatisfactory model performance and even poor robustness and domain generality of the representation learning method. To address this problem, we propose a Frame-level Timeline Modeling (FTM) method that helps to capture both short-term and long-term features and thus learns more informative representations on temporal graphs. In particular, we present a novel link-based framing technique to preserve the short-term features and then incorporate a timeline aggregator module to capture the intrinsic dynamics of graph evolution as long-term features. Our method can be easily assembled with most temporal GNNs. Extensive experiments on common datasets show that our method brings great improvements to the capability, robustness, and domain generality of backbone methods in downstream tasks. Our code can be found at https://github.com/yeeeqichen/FTM.
[ "Bowen Cao", "Qichen Ye", "Weiyuan Xu", "Yuexian Zou" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11814v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11814v2", "@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" ]
FTM: A Frame-level Timeline Modeling Method for Temporal Graph Representation Learning Qichen Ye1*, Bowen Cao1*, Weiyuan Xu1, Yuexian Zou1,2† 1ADSPLAB, School of ECE, Peking University, Shenzhen, China, 2Peng Cheng Laboratory, Shenzhen, China (cid:8)yeeeqichen,zouyx(cid:9)@pku.edu.cn, (cid:8)cbw2021,xuwy(cid:9)@stu.pku.edu.cn 3 2 0 2 r a M 5 1 ] G L . s c [ 2 v 4 1 8 1 1 . 2 0 3 2 : v i X r a Abstract Learning representations for graph-structured data is essen- tial for graph analytical tasks. While remarkable progress has been made on static graphs, researches on temporal graphs are still in its beginning stage. The bottleneck of the temporal graph representation learning approach is the neighborhood aggregation strategy, based on which graph attributes share and gather information explicitly. Existing neighborhood ag- gregation strategies fail to capture either the short-term fea- tures or the long-term features of temporal graph attributes, leading to unsatisfactory model performance and even poor robustness and domain generality of the representation learn- ing method. To address this problem, we propose a Frame- level Timeline Modeling (FTM) method that helps to capture both short-term and long-term features and thus learns more informative representations on temporal graphs. In particular, we present a novel link-based framing technique to preserve the short-term features and then incorporate a timeline ag- gregator module to capture the intrinsic dynamics of graph evolution as long-term features. Our method can be easily as- sembled with most temporal GNNs. Extensive experiments on common datasets show that our method brings great im- provements to the capability, robustness, and domain general- ity of backbone methods in downstream tasks. Our code can be found at https://github.com/yeeeqichen/FTM. Introduction Graph representation learning intends to transform nodes and links on the graph into lower-dimensional vector em- beddings, which can be quite challenging due to the complex graph topological structures and node/link attributes. While approaches on static graphs have made breakthroughs and demonstrated distinguishable applicability in various fields (Graepel et al. 2010; He et al. 2014; Li et al. 2022; Zhu et al. 2022), those on temporal graphs are just getting started. Modeling a temporal graph (which may evolve over time with the addition, deletion, and changing of its attributes) is a core problem in developing real-world industrial sys- tems (e.g., social network, citation network, recommenda- tion systems) where many data are time-dependent, and is *These authors contributed equally. †Corresponding author. Copyright © 2023, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. Figure 1: An example of temporal graph modeling. Given a model that has learnt the dynamics of a large number of users' shopping behaviors in high-dimensional space, what the man in green tends to buy in the future is predictable. much more difficult because of the temporal factors. Figure 1 gives an example of temporal graph modeling. In learning representations on temporal graphs, a key point is the neighborhood aggregation strategy, which al- lows information passing and gathering among graph at- tributes, so that nodes learn their representations from their neighbors. For static graphs, directly linked nodes are neigh- bors to each other because they all appear in the one and only topology. In contrast, temporal graph attributes scatter sparsely across the timeline, leading to temporal-structure inconsistency. For any node in a temporal graph, a node connected to it is not necessarily a neighbor, for this node may appear a long time ago or disappear soon. Each node in a temporal graph may also have several temporal neigh- borhoods, posing a challenge for information aggregation. Therefore, how to design the neighborhood aggregation strategy on temporal graphs remains an open question. Recent works introduce snapshot-based methods (Kumar, Zhang, and Leskovec 2019; Pareja et al. 2020) and temporal random walk-based methods (Nguyen et al. 2018; Xu et al. 2020) for neighborhood aggregation, but are often too sim- ple to capture the evolution of temporal graphs over time. The comparison of the above two methods and our method is shown in Figure 2. In particular, snapshot-based methods equally slice the timeline into a sequence of snapshots, each of which contains nodes and links that occurred within its time span. This kind of method treats a snapshot as a static graph and fails to model the temporal properties within a snapshot, losing short-term features of graph attributes. On day2day2v1Rnv2v3v4v5t2t2 the other hand, temporal random walk-based methods do not impose restrictions on the time range, but select temporal neighbors from the past according to a certain rule (most of- ten randomly) and learn representations based on the neigh- borhood attributes and their time information. However, the problem is that the randomly constructed temporal neighbor- hood cannot ensure a balance between short-term features and long-term features. To develop a representation learning method on temporal graphs that adequately captures both short-term and long- term features, we propose a simple but effective Frame-level Timeline Modeling method (FTM for short), at the heart of which is the innovation of the temporal neighborhood ag- gregation strategy: first, we refer to the concept of frame1 in signal processing, and put forward a novel method called link-based framing technique, where we separate most re- cent links into several frames (i.e., temporal neighborhoods) to emphasize short-term features; then, we extract frame fea- tures with a frame aggregator, which can be easily replaced by most GNN methods; finally, we design a timeline ag- gregator for learning the intrinsic dynamics of successive frames across the timeline to capture long-term features. We conduct experiments on several widely-used bench- marks in both transductive and inductive settings, and the re- sults demonstrate the effectiveness of our proposed method. Moreover, the robustness and domain generality of baselines and our method are also evaluated through quantitative and qualitative experiments, which further suggest the insights of FTM. Our main contributions are summarized as follows: • We propose a simple but effective frame-level time- line modeling method for temporal graph representation learning, namely FTM, which makes contributions to the neighborhood aggregation strategy, and can be easily as- sembled with most GNN methods. • We conduct comprehensive experiments to show that models assembled with FTM achieve better performance on common benchmarks, and we further evaluate its ef- fectiveness through quantitative and qualitative analyses. • We point out the robustness and domain generality issues of several state-of-the-art GNN-based temporal graph representation learning methods, and demonstrate that FTM could greatly alleviate these issues. Related Work Learning representations with GNNs has become a pop- ular research area for graph modeling. Earlier works ex- plore learning representations of topological structures (Kipf and Welling 2016a; Grover and Leskovec 2016), extending GNN to inductive learning (Hamilton, Ying, and Leskovec 2017), and integrating attention mechanisms (Veliˇckovi ́c et al. 2018). In all these works, however, the time informa- tion of graph attributes are discarded. Recent approaches take advantage of the temporal prop- erty. Certain approaches learn to access time-aware knowl- edge by equally slicing the timeline into a sequence of snap- 1A fundamental technique to decompose raw signal into multi- ple ranges according to frame length and hop length. Figure 2: An example illustrating prior techniques and our link-based framing technique (where frame length is 2 and hop length is 1) for neighborhood construction. shots (Trivedi et al. 2019; Singer, Guy, and Radinsky 2019). They aggregate the topological features in a snapshot and combine time-dependent features with sequence-modeling techniques to learn temporal graph embeddings. However, they ignore the sequential nature of nodes and links within the same snapshot, losing short-term features that can guide learning. Meanwhile, the amount of nodes and links within each snapshot is inconsistent, leading to great data biases in learning topological features. More recently, TGAT (Xu et al. 2020) leverages a time en- coding function to learn time-aware representations in con- tinuous time. TGN (Rossi et al. 2020), as a variant of TGAT, integrates a memory module to keep track of the evolution of node-level features. These methods make progress in cap- turing short-term features since the time encoding makes it possible to model the temporal properties of a neighborhood. However, in most cases, they randomly sample neighbors from the past to form a temporal neighborhood for a target node, which means that they cannot ensure a balance be- tween short-term features and long-term features. Our work adopt the idea of time encoding, but make con- tributions to the way that temporal neighborhoods are con- structed and information is aggregated, so that the model learn more informative representations. Proposed Method: FTM Problem Formalization Graph representation learning aims to obtain node or link representations based on their own properties and their in- teractions with neighbors. Let ET − = (cid:8)ei,j,t|1 ≤ i, j ≤ n, 0 ≤ t < T (cid:9) and V T − = (cid:8)vs|s = 1 . . . n(cid:9) denote the set of links and the set of nodes observed before time T , respectively, where n is the amount of nodes, vs is the s- th node (s is only used to distinguish nodes), and ei,j,t is an link between vi and vj emerged at time t ∈ R+. Let s = (cid:8)es,i,t|1 ≤ i ≤ n, 0 ≤ t < T (cid:9) ∪ (cid:8)ej,s,t|1 ≤ ET − j ≤ n, 0 ≤ t < T (cid:9) denotes the subset of ET − containing links that link to node vs and satisfy the time constraint (we mainly consider undirected graphs, where the two parts of ET − are equivalent). Supposing that GT − = (V T −, ET −) s denotes the final state of a temporal graph before time T , learning representations on it is mainly to obtain the node and link representations at time t based on GT −. v1v4tt+1t+2t+3t+4v1v2v3v5v4v6v1v4v6tt+1t+3v1v1v1tt+1t+2t+4t+1t+2Snap-shotRandom WalkOursTemporal GraphFrame 1Frame 2Frame 3v2v6v5v3v4v5v2v3v3v4v6v3v2 Figure 3: The architecture of the model assembling FTM with a backbone network. Assuming that our goal is to compute node v0's representation at timestamp t5, we first construct a timeline consists of 3 frames (cid:8)f t3− (cid:9) as each layer's input. l At each layer - Stage 1, we compute each frame's representation ˆh 0(tj) in parallel through the backbone network (works as the frame aggregator). Stage 2, we aggregate all frames' representations to get the node representation via the timeline aggregator. v0,2, f t5− v0,2 v0,2, f t4− Input Representation Graph attributes can be recorded in various ways. For in- stance, online reviews are in text format, and citations are in triplet format. We encode text with BERT-base (Devlin et al. 2019), and other records with TransE (Bordes et al. 2013), to initialize node and link features. Then, we split links into frames, and feed the features of successive frames into FTM. Link-based Framing Technique. The process of splitting links into temporal frames is controlled by two parameters: - Frame length defines how many links are included in a frame. For example, at timestamp t, to construct a frame of length k for node vs, we take the most recent k links from Et− to form this frame and denote it as f t− s,k. s - Hop length defines how many links to skip when taking the next frame. In practise, we set it to be f rame length (which is empirically the best and is also a convention in signal processing) to stabilize the training process. An example is provided in Figure 2. 2 Frame-level Timeline Modeling The main idea of FTM is to preserve both the short-term and long-term features of graph attributes through a frame ag- gregator and a timeline aggregator. The role of the frame aggregator is to model each neighborhood that generated by the link-based framing technique, so it can be replaced by most GNN methods. For example, the overall framework of the model assembling FTM with TGAT (Xu et al. 2020), i.e., taking TGAT as the frame aggregator, is shown in Fig- ure 3. Since TGAT is composed of a stack of identical lay- ers (with shared parameters), the calculation process of each layer is similar. Assuming that we want node vi's embed- ding at timestamp t, the calculation process in layer l can be described as the following two parts: Temporally Attentive Frame Aggregator. While TGAT randomly samples links from the past to form temporal neighborhoods, we integrate k most recent links to con- struct a frame in order to preserve short-term features. Mean- while, the reason we add links by number rather than by time (as snapshot-based methods) is to guide the model to learn the common evolution of links, instead of time-interval- related knowledge. Given a frame f t− i,k of vi that contains (cid:9), we obtain a temporal neighbor- links (cid:8)ei,j1,t1 , . . . , ei,jk,tk hood feature matrix Z(t) as: Z(t) = [zt(i, t), zt(j1, t1), . . . , zt(jk, tk)] , (cid:105) (cid:104) zt(jk, tk) = h(l−1) jk (tk) || φ(t − tk) || ejk (1) (2) , jk where h(l−1) (tk) is the previous layer's output for vjk , φ(*) is a time encoding function, ejk is the feature vector of ei,jk,tk , and zt(jk, tk) maps the information of vjk into a v0e2e3e3e5e2e1TimelineStage 1:FrameAggregatorStage 2: Timeline Aggregatorfv0,2t3−fv0,2t4−fv0,2t5−Step 1Step 2Parallelly aggregating information for each framelthlayer෡h0l(t5)෡h0l(t4)෡h0l(t3)h0l(t5)Hidden LayerOutput LayerStep 2Step 1 time-aware representation. Then, we attentively aggregate Zt with the multi-head self-attention mechanism: αr j = qr(t) = [Z(t)]0Wr Q, Kr(t) = [Z(t)]1:N Wr K, Vr(t) = [Z(t)]1:N Wr V exp (cid:0)qr (cid:62)Kr (cid:1) Σq exp (cid:0)qr (cid:62)Kr K, Wr j denotes the attention weight, and ̃h where Wr Q, Wr V are query, key and value matrix, re- l,r spectively, αr i (t) is the output of the r-th attention head. Assuming that we have l nh attention heads, the frame representation ˆh i(t) will be: (3) (4) (5) l,r i (t) = j vr αr j , (cid:1) , ̃h (cid:88) q j j l ˆh i(t) = ReLU(yW0 + b0)W1 + b1, (cid:105) (t) i (t)|| . . . || ̃h zt(i, t)|| ̃h l,nh i y = l,1 (cid:104) , (6) (7) l i(t) of frame f t− where W0, W1 are weights and b0, b1 are biases. Attentively Frame-level Timeline Aggregator. In the prior part, we get the representation ˆh i,k . Now, we consider how to aggregate the information of multi- ple frames. Empirically, we set the hop length to half of the frame length to retain redundant information between frames. By doing so, (i) short-term features are further high- lighted; and (ii) framing serves as a scrubbing technique because irregular links (with abnormal time interval/content) will not play a leading role and the commonalities in the evo- lution of links will be emphasized. Let F t− i,k = (cid:8)f tj − i,k |1 ≤ j ≤ n, tn = t(cid:9) denotes a set of frames of node vi, in which the timestamps satisfy: tj−1 = T k 2 (Etj − i ), 2 ≤ j ≤ n (8) where n is the size of this set, T k maps a set of links to its k 2 - th (i.e., half of the frame length) recent element's timestamp. We call this set a n-length timeline of node vi at timestamp t, and we get the final node representation hl 2 i(t) as: hl i(t) = l (cid:104)ˆh i(t1)|| . . . ||ˆh (cid:105)T l i(tn) W2 + b2, (9) where W2 and b are weights and bias. Here we take 1-layer MLP as an example for simplicity, but it could be effortlessly extended to RNN-based or attention-based methods, etc. hl i(t) generated by the last layer is just what we want - node vi's embedding at timestamp t, hi(t). Learning & Inference. Since the temporal information is mostly reflected in the time-sensitive interactions among nodes, we choose to use the future link prediction setup for training. The goal of future link prediction is to predict the probability that an link will exist between a target node vi and another node vj at a specific future time, i.e., given the set of previous links of vi, we compute the probability of a future link ei,j,ti,j between vi and vj. To train the model, we sample a set of negative links ((cid:54)= ei,j,ti,j ) and optimize the per-node objective: (cid:88) Pos (i, j, ti,j)+Q*Evq∼P Neg (i, q, ti,j) (10) L = vi,vj ,ti,j Dataset Reddit (Kumar, Zhang, and Leskovec 2019) Wikipedia (Kumar, Zhang, and Leskovec 2019) Icews14 (Garc ́ıa-Dur ́an, Dumancic, and Niepert 2018) Icews05-15 (Garc ́ıa-Dur ́an, Dumancic, and Niepert 2018) Bitcoin-otc (Kumar et al. 2016) Bitcoin-alpha (Kumar et al. 2016) Mooc (Kumar, Zhang, and Leskovec 2019) Node 11,000 9,000 7,000 Link 672,000 157,000 91,000 10,000 461,000 6,000 4,000 7,000 36,000 24,000 412,000 Table 1: The node and link statics for each dataset. where P is the negative link sampling distribution, Q de- notes the negative sampling size, Pos(*, *, *) and Neg(*, *, *) denote the positive and negative scoring functions: Pos (i, j, ti,j) = − log (cid:0)σ (cid:0)−hi(ti,j)(cid:62)hj(ti,j)(cid:1)(cid:1) Neg (i, q, ti,j) = − log (cid:0)σ (cid:0)hi(ti,j)(cid:62)hq(ti,j)(cid:1)(cid:1) (12) where σ(*) is an activation function, hi(t) is the representa- tion of node vi at timestamp t. For inference, the output of Pos(i, j, ti,j) is used as the logits. (11) Experimental Setups We evaluate our method against strong baselines (adapted to temporal settings when possible). Note that assembling FTM with a baseline method means that we take the base- line method as the frame aggregator of FTM. Tasks and Metrics We perform future link prediction to evaluate the quality of the generated graph representations. We use average preci- sion (AP) as the evaluation metric and consider this task in two settings: (i) Transductive Task. We predict future links among nodes that have been observed during training. (ii) Inductive Task. We perform future link prediction among nodes that have not been observed in the training phase. Datasets We choose seven datasets that contain time-sensitive node interactions: Reddit2 is created from posts between active users and subreddits, where users and subreddits are nodes, and posts are links. Wikipedia3 is created by taking top edited pages in Wikipedia and active users as nodes, and the corresponding edits as links. Icews144, Icews05-155 con- tain political events and the corresponding timestamps. All nodes are real-world entities (e.g. countries) and links are event types. Bitcoin-otc6, Bitcoin-alpha7 are who-trusts- whom networks of people who trade with Bitcoin, where nodes are people and links are the credit evaluation. Mooc8 dataset contains user actions on a popular MOOC platform, where nodes represent users and course activities, and links represent user actions. Dataset scales are listed in Table 1. 2http://snap.stanford.edu/jodie/reddit.csv 3http://snap.stanford.edu/jodie/wikipedia.csv 4https://github.com/nle-ml/mmkb 5https://github.com/nle-ml/mmkb 6https://snap.stanford.edu/data/soc-sign-bitcoinotc.csv.gz 7https://snap.stanford.edu/data/soc-sign-bitcoinalpha.csv.gz 8https://snap.stanford.edu/data/act-mooc.tar.gz Model Reddit Wikipedia GAE (Kipf and Welling 2016b) VAGE (Kipf and Welling 2016b) DeepWalk (Perozzi, Al-Rfou, and Skiena 2014) Node2vec (Grover and Leskovec 2016) CTDNE (Nguyen et al. 2018) DyRep (Trivedi et al. 2019) Jodie (Kumar, Zhang, and Leskovec 2019) GraphSAGE (Hamilton, Ying, and Leskovec 2017) w/ FTM GAT (Veliˇckovi ́c et al. 2018) w/ FTM TGAT (Xu et al. 2020) w/ FTM TGN (Rossi et al. 2020) w/ FTM Average Gain Transductive 93.23 92.92 83.10 84.56 91.41 98.25 97.02 97.20 98.01↑ 97.33 98.21↑ 98.27 98.41↑ 98.78 98.88↑ 0.48 Inductive - - - - - 96.11 94.46 94.68 96.28↑ 95.37 96.75↑ 96.73 96.82↑ 97.77 97.96↑ 0.82 Transductive 91.44 91.34 90.71 91.48 92.17 94.76 92.75 91.09 92.91↑ 94.73 95.03↑ 95.13 97.82↑ 98.28 98.82↑ 1.34 Inductive - - - - - 92.11 93.13 86.08 91.93↑ 91.27 93.54↑ 93.97 97.14↑ 97.69 98.33↑ 2.98 Table 2: AP(%) for future link prediction tasks. ↑ means that FTM brings an improvement to the baseline method. The best results in each column are highlighted in bold font. '-' denotes incapability. Model GraphSAGE (2017) GAT (2018) TGAT (2020) TGN (2020) Average Gain 0 85.46(+1.58) 83.75(+4.31) 87.36(+1.37) 88.19(+1.82) 2.27 1 62.24(+19.52) 79.16(+5.11) 87.67(+1.16) 86.68(+1.99) 6.95 10 34.11(+28.14) 49.56(+17.66) 59.99(+26.83) 80.80(+3.18) 18.95 Attack Intensity(%) 20 51.78(+3.56) 40.47(+19.32) 56.59(+29.85) 81.93(+2.63) 13.84 30 45.89(+5.85) 41.89(+16.11) 47.39(+38.39) 81.81(+4.96) 16.33 40 40.81(+3.04) 36.70(+9.39) 34.61(+51.56) 83.39(+2.09) 16.52 50 48.84(+9.15) 41.38(+15.06) 38.57(+47.29) 83.17(+2.40) 18.48 Table 3: AUC (%) for node classification tasks on Wikipedia. Attack intensity controls the ratio of (the norm of) the added noise to (the maximum norm of) the link features in the dataset. x(+y) indicates that the baseline method achieves x% in AUC, and FTM brings an improvement of y% to it, i.e., the model assembling FTM with this method achieves x+y%. Baselines GAE, VAGE (Kipf and Welling 2016b), DeepWalk (Per- ozzi, Al-Rfou, and Skiena 2014) and Node2vec (Grover and Leskovec 2016) are models for static graphs. CTDNE, DyRep, Jodie, GraphSAGE, GAT, TGAT and TGN are baselines for temporal graphs. We do not ensemble FTM with CTDNE, DyRep and Jodie due to the conflicting schemes9. For other methods, we test the original version and the FTM-assembled version. There may be slight differ- ences between our implementation and others, but it is fair for comparison. Results and Analysis Transductive & Inductive Future Link Prediction. As shown in Table 2, (1) temporal methods surpass static ones, suggesting the importance of temporal properties in mod- eling temporal graphs; (2) models assembled with FTM consistently outperform the originals on all benchmarks, demonstrating the effectiveness of FTM. For instance, on 9These methods have their own custom temporal neighborhood construction strategies. If we apply our action-based framing tech- nique to these methods, we are only assembling FTM with their feature extraction modules. Wikipedia, FTM brings an average gain of 2.98 in AP un- der inductive setting. Meanwhile, TGN+FTM achieves new state-of-the-art performance on both Wikipedia and Reddit. The overall performance on this task indicates that FTM guides the learning of the evolution of temporal graphs and helps to generate more informative representations. Quantitative Analysis Given these overall performance improvements, we inves- tigate how FTM's improvements are reflected in the learnt node representations. Because we have the gold label of node type in Wikipedia, we conduct a downstream task of future link prediction, node classification, in two settings: (i) Fine-tuning. We fine-tune a MLP layer to classify nodes based on the learnt node embeddings. As the result in the second column of Table 3 (attack intensity is 0) shows, FTM brings about 1% ̃4% absolute gain in AUC to back- bone methods, which reveals that models assembled with FTM generate more reasonable node embeddings. It also demonstrates the insights of our method in temporal graph representation learning; (ii) Adversarial Attack. The ability to resist Gaussian noise-perturbated examples is important because noisy data is inevitable under most circumstances (Cheng et al. 2023). We add random Gaussian noise to the original data to generate adversarial examples for five times, (a) Classify users of Wiki (b) Embedding analysis Figure 4: (a) x-axis/y-axis represents the average/standard deviation of the time intervals of a user's actions. The green parts denotes user distribution. The darker the color, the greater the number of users. Red points denote atypical users that have misled TGAT but are correctly classified by TGAT+FTM. (b) The cosine similarity of successive temporal node embeddings generated by TGAT+FTM and TGAT+Snapshot, respectively. The consistency of the embeddings generated by TGAT+FTM proves that FTM helps to learn stable temporal representations. Training Dataset Reddit Wikipedia Model GraphSAGE (2017) GAT (2018) TGAT (2020) TGN (2020) Average Gain GraphSAGE (2017) GAT (2018) TGAT (2020) TGN (2020) Average Gain Icews14 46.89(+35.32) 63.45(+24.32) 76.29(+9.82) 68.63(+12.20) 20.42 71.88(+7.59) 67.19(+12.29) 80.27(+6.94) 66.40(+15.73) 10.64 Icews05-15 61.48(+23.08) 64.44(+20.81) 72.80(+15.47) 70.57(+15.72) 18.77 77.49(+3.46) 69.32(+15.20) 82.03(+10.82) 67.77(+16.36) 11.46 Test Dataset Bitcoin-otc 70.36(+7.59) 70.66(+6.30) 70.19(+10.81) 72.86(+6.48) 7.80 58.88(+12.44) 67.20(+0.34) 71.38(+12.16) 83.76(+0.41) 6.34 Bitcoin-alpha 54.44(+16.09) 61.35(+9.49) 65.46(+8.11) 64.55(+6.04) 9.93 53.81(+18.16) 61.48(+6.71) 71.01(+2.18) 64.69(+7.29) 8.59 Mooc 49.86(+3.38) 47.28(+7.25) 57.01(+16.98) 67.23(+2.48) 7.52 49.11(+4.85) 49.42(+7.19) 53.98(+22.54) 73.20(+1.86) 9.11 Table 4: AP (%) of future link prediction tasks. x(+y) indicates that the baseline method achieves x% in AP, and FTM brings an improvement of y% to it, i.e., the model assembling FTM with this method achieves x+y%. and record the average performance of each model. The re- sults are reported in the last six columns of Table 3 (with attack intensity from 1% to 50%). The average gains that FTM brings to the baseline methods demonstrate that FTM can handle data noise (and maybe data biases) better, which is an important capability that guarantees the applicability of the proposed method. Qualitative Analysis In this section, we examine our model's ability to generate more informative representations on the wikipedia dataset qualitatively. As Figure 4(a) shows, FTM helps to distin- guish atypical users, whereas baselines are often misled; it reflects the potential of FTM in addressing data biases, since the data bias issues in data collected from platforms like Wikipedia are mainly caused by atypical users who of- ten perform irregular/abnormal actions. Moreover, we hy- pothesize that the evolution of user actions has short-term stationary features, because people's personality will not change rapidly. We take the most popular snapshot-based modeling method as the opponent to demonstrate that FTM makes it possible to capture short-term stationary features over time. First, we modify the neighborhood sampling strat- egy of the original TGAT to be snapshot-based, namely TGAT+Snapshot. Specifically, for each node we take its neighbors within an hour to form a temporal neighbor- hood. Then, we compute the cosine similarity of succes- sive temporal node embeddings for TGAT+Snapshot and our TGAT+FTM respectively. As shown in Figure 4(b), the temporal node embeddings generated by TGAT+FTM show higher consistency. It demonstrates that TGAT+FTM learns more stable representations of users and we believe that the main reason lies in capturing short-term stationary features. Intuitively, this ability helps to stabilize the training process and capture the dynamics of user actions. Domain Generality Our reported results thus far demonstrate the effectiveness of FTM in improving the capability and robustness of temporal GNNs. In this section, we explore whether FTM could help 0.02.55.07.510.012.515.0Mean01234567Stdatypical users Neighborhood Scale Percentage of Training Data Model GraphSAGE w/ FTM GAT w/ FTM TGAT w/ FTM Average Gain Inductive L M 94.19 88.96 95.53↑ 92.31↑ 95.56 93.15 95.84↑ 93.40↑ 95.95 92.63 97.26↑ 94.32↑ 0.98 1.76 S 86.31 92.24↑ 91.11 91.85↑ 91.12 94.08↑ 3.21 Generalization Inductive XL 94.68 96.28↑ 95.37 96.75↑ 96.73 96.82↑ 1.02 S 70.87 79.37↑ 69.88 82.38↑ 69.22 91.08↑ 14.29 M 70.83 77.26↑ 74.96 81.75↑ 71.76 89.52↑ 10.33 L 78.74 86.30↑ 83.76 86.20↑ 85.64 95.82↑ 6.73 XL 83.59 86.53↑ 85.84 88.97↑ 87.34 91.06↑ 3.26 1% 65.31 70.40↑ 68.99 73.13↑ 65.65 80.76↑ 8.10 5% 85.39 87.58↑ 90.81 91.02↑ 88.92 92.32↑ 1.67 10% 91.17 91.95↑ 93.13 93.70↑ 92.67 93.45↑ 0.64 50% 95.64 96.65↑ 95.10 96.68↑ 96.25 96.25 0.69 1% 57.99 61.98↑ 59.53 68.45↑ 74.51 81.84↑ 5.00 Generalization 10% 5% 73.04 62.79 82.71↑ 74.92↑ 79.70 76.44 85.91↑ 81.99↑ 81.27 77.16 87.22↑ 87.88↑ 5.69 8.25 50% 80.15 85.34↑ 85.80 90.30↑ 86.38 88.53↑ 2.87 Table 5: Case studies on (1) neighborhood scale, where neighborhood scale expands from S to XL; and (2) the percentage of training data, where models are trained on limited training data of Reddit, e.g., 1% means models are trained/validated on one-percent of the original training/validation data. We do not take TGN into consideration, because the way TGN updates node-wise memory has little to do with the neighborhood scale and the percentage of training data. We report AP(%) of future link prediction on Reddit (inductive; generalize from Wiki). Aggregation Function 1-layer MLP 2-layer MLP LSTM Self-attention AP on Wikipedia Transductive 97.68 97.26 97.64 97.93 Inductive 97.19 96.79 96.99 97.44 Convergence Time 8.5 × 103 s 1.3 × 104 s 2.7 × 104 s 1.1 × 104 s Parameter Size 100% 105% 112% 110% Table 6: Comparison of different aggregate functions in Timeline Aggregator module. improve the domain generality of baseline methods. From the results shown in Table 4, we can observe that (1) these baseline methods suffer from severe domain generality is- sues, e.g., GraphSAGE trained on Reddit only get 46.89 in AP on Icews14; and (2) assembling FTM with these base- line methods greatly improves their domain generality, e.g., when applying models trained on Reddit to Icews14, FTM brings an average gain of 20.42 in AP to them. It illustrates the efficacy of FTM in deriving generalizable knowledge of graph evolution. Furthermore, we test the capability of our method in handling domain gaps from a new perspec- tive - we subsample user-action data from the wikipedia dataset with different time interval distribution and evalu- ate our method on it. The result shows that assembling FTM with baseline methods improves their AP by 1.5 in average, but is not listed here for space-saving issues. Case Studies In normal experiments, we set the number of model layers to be 2 and the length of frames to be 20 to form a node's temporal neighborhood. In this section, we record the per- formance of aforementioned methods under different neigh- borhood scales and data sizes. Note that the test data is the same as aforementioned experiments. In studying the influence of neighborhood scale, we sepa- rately let (the number of model layers, the length of frames) be (1, 10), (1, 20), (2, 10), (2, 20) to form a S-scale, M- scale, L-scale, XL-scale neighborhood respectively. The re- sults are provided in the left part of Table 5. In all cases, models assembled with FTM outperform the originals. It il- lustrates that, even under low-resource settings, assembling FTM with backbone methods can enhance the capability, the robustness, and the domain generality of these models. In studying the influence of data size, we sample x- percent of the training/validation set to form new training/- validation sets. As the results in the right part of Table 5 illustrate, models assembled with FTM outperform the orig- inals in most cases. It indicates that FTM is not totally data- driven, but superior in understanding the evolution of the temporal graph. This ability is of practical importance. Implementation & Training Details chronological Hyper-parameters. We do the train- validation-test split with 70%-15%-15% according to the timestamps of links. In the test set, we randomly sample 10% nodes as 'new nodes' for inductive tasks, and mask down all their links in the training set. Both the number of self-attention layers and the number of heads in each layer of the backbone network are 2. The length of timeline is chosen from [2, 3, 4] (we only report the best result). During training, we use Adam optimizer with learning rate 1e-4. The dimension of time encoding vectors is set to 172, which is same to the dimension of link feature vectors. We have conducted experiments to verify the effect of different aggregate functions in the Timeline Aggregator module. The result is shown in Table 6 (timeline length is 2 and all experiments are conducted on a RTX 2080Ti GPU). Taking both the performance and efficiency into consideration, we decide to deploy a 1-layer MLP as the timeline aggregate function because it achieves comparable performance while having faster convergence rate and smaller parameter size than other aggregate functions. Readers can implement the self-attention mechanism for better performance. Conclusion In this paper, we propose a simple but effective frame-level timeline modeling method for temporal graph representation learning, where the main contributions are made to the way that temporal neighborhoods are constructed and neighbor- ing information is aggregated. Technically, we break down a temporal sequence of graph-structured data into individ- ual frames, and model the evolution of successive frames to mine deeper into the dynamics of nodes and links. Experi- mental results demonstrate the effectiveness of FTM. Mean- while, our experiments empirically reveal that even state- of-the-art GNNs have critical weakness in modeling tempo- ral graphs; but FTM helps to derive generalizable knowl- edge during training and thus greatly improves both the ro- bustness and the domain generality of baseline methods, es- pecially when there are outliers/noise in the data (cf. Fig- ure 4(a), Table 3), or the amount of data and computa- tional resources are insufficient (cf. Table 5). The efficacy of FTM may provide insights that could facilitate the design of more advanced representation learning methods on tem- poral graphs. Acknowledgement This paper was partially supported by Shenzhen Science & Technology Research Program (No: GXWD202012311658- 07007-20200814115301001) and NSFC (No: 62176008) References Bordes, A.; Usunier, N.; Garcia-Duran, A.; Weston, J.; and Yakhnenko, O. 2013. Translating embeddings for modeling multi-relational data. Advances in neural information pro- cessing systems, 26. Cheng, X.; Zhu, Z.; Li, H.; Li, Y.; and Zou, Y. 2023. SSVMR: Saliency-based Self-training for Video-Music Re- trieval. CoRR, abs/2302.09328. Devlin, J.; Chang, M.-W.; Lee, K.; and Toutanova, K. 2019. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Con- ference of the North American Chapter of the Association for Computational Linguistics: Human Language Technolo- gies, Volume 1 (Long and Short Papers), 4171–4186. Min- neapolis, Minnesota: Association for Computational Lin- guistics. Garc ́ıa-Dur ́an, A.; Dumancic, S.; and Niepert, M. 2018. Learning Sequence Encoders for Temporal Knowledge Graph Completion. In EMNLP. Brussels, Belgium: ACL. Graepel, T.; Candela, J. Q.; Borchert, T.; and Herbrich, R. 2010. Web-scale bayesian click-through rate prediction for sponsored search advertising in microsoft's bing search en- gine. In Proceedings of the 27th International Conference on Machine Learning, 13–20. Haifa, Israel: Omnipress. Grover, A.; and Leskovec, J. 2016. node2vec: Scalable fea- ture learning for networks. In Proceedings of the 22nd In- ternational Conference on Knowledge Discovery and Data Mining, 855–864. San Francisco, CA, USA: ACM. Hamilton, W. L.; Ying, R.; and Leskovec, J. 2017. Induc- tive representation learning on large graphs. In Proceedings of the 31st International Conference on Neural Information Processing Systems, 1025–1035. Long Beach, CA, USA. He, X.; Pan, J.; Jin, O.; Xu, T.; Liu, B.; Xu, T.; Shi, Y.; Atallah, A.; Herbrich, R.; Bowers, S.; et al. 2014. Practi- cal lessons from predicting clicks on ads at facebook. In Proceedings of the Eighth International Workshop on Data Mining for Online Advertising. New York City, New York, USA: ACM. Kipf, T. N.; and Welling, M. 2016a. Semi-supervised clas- sification with graph convolutional networks. In 5th Inter- national Conference on Learning Representations. Toulon, France: OpenReview.net. Kipf, T. N.; and Welling, M. 2016b. Variational Graph Auto- Encoders. CoRR, abs/1611.07308. Kumar, S.; Spezzano, F.; Subrahmanian, V.; and Faloutsos, C. 2016. Edge weight prediction in weighted signed net- In 16th International Conference on Data Mining works. (ICDM), 221–230. Barcelona, Spain: IEEE Computer Soci- ety. Kumar, S.; Zhang, X.; and Leskovec, J. 2019. Predicting dynamic embedding trajectory in temporal interaction net- works. In Proceedings of the 25th International Conference on Knowledge Discovery & Data Mining, 1269–1278. An- chorage, AK, USA: ACM. Li, H.; Li, X.; Karimi, B.; Chen, J.; and Sun, M. 2022. Joint Learning of Object Graph and Relation Graph for Visual Question Answering. In IEEE International Conference on Multimedia and Expo, ICME 2022, Taipei, Taiwan, July 18- 22, 2022, 1–6. IEEE. Nguyen, G. H.; Lee, J. B.; Rossi, R. A.; Ahmed, N. K.; Koh, E.; and Kim, S. 2018. Continuous-time dynamic network In Companion Proceedings of the The Web embeddings. Conference, 969–976. Lyon, France: International World Wide Web Conferences Steering Committee. Pareja, A.; Domeniconi, G.; Chen, J.; Ma, T.; Suzumura, T.; Kanezashi, H.; Kaler, T.; Schardl, T.; and Leiserson, C. 2020. Evolvegcn: Evolving graph convolutional networks for dynamic graphs. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, 5363–5370. New York, USA: AAAI. Perozzi, B.; Al-Rfou, R.; and Skiena, S. 2014. Deepwalk: Online learning of social representations. In Proceedings of the 20th International Conference on Knowledge Discovery & Data Mining, 701–710. New York, USA: ACM. Rossi, E.; Chamberlain, B.; Frasca, F.; Eynard, D.; Monti, F.; and Bronstein, M. 2020. Temporal Graph Networks for Deep Learning on Dynamic Graphs. In ICML 2020 Work- shop on Graph Representation Learning. Singer, U.; Guy, I.; and Radinsky, K. 2019. Node embed- ding over temporal graphs. In Proceedings of the Twenty- Eighth International Joint Conference on Artificial Intelli- gence, 4605–4612. Macao, China: ijcai.org. Trivedi, R.; Farajtabar, M.; Biswal, P.; and Zha, H. 2019. Dyrep: Learning representations over dynamic graphs. In International conference on learning representations. New Orleans, LA, USA: OpenReview.net. Veliˇckovi ́c, P.; Cucurull, G.; Casanova, A.; Romero, A.; Lio, P.; and Bengio, Y. 2018. Graph attention networks. In 6th In- ternational Conference on Learning Representations. Van- couver, BC, Canada: OpenReview.net. Xu, D.; Ruan, C.; Korpeoglu, E.; Kumar, S.; and Achan, K. 2020. Inductive representation learning on temporal graphs. In 8th International Conference on Learning Representa- tions. Addis Ababa, Ethiopia: OpenReview.net. Zhu, Z.; Xu, W.; Cheng, X.; Song, T.; and Zou, Y. 2022. A Dynamic Graph Interactive Framework with Label- Semantic Injection for Spoken Language Understanding. CoRR, abs/2211.04023.
http://arxiv.org/abs/2302.11803v1
2023-02-23T06:32:09
2023-02-23T06:32:09
A Comprehensive Survey on Source-free Domain Adaptation
Over the past decade, domain adaptation has become a widely studied branch of transfer learning that aims to improve performance on target domains by leveraging knowledge from the source domain. Conventional domain adaptation methods often assume access to both source and target domain data simultaneously, which may not be feasible in real-world scenarios due to privacy and confidentiality concerns. As a result, the research of Source-Free Domain Adaptation (SFDA) has drawn growing attention in recent years, which only utilizes the source-trained model and unlabeled target data to adapt to the target domain. Despite the rapid explosion of SFDA work, yet there has no timely and comprehensive survey in the field. To fill this gap, we provide a comprehensive survey of recent advances in SFDA and organize them into a unified categorization scheme based on the framework of transfer learning. Instead of presenting each approach independently, we modularize several components of each method to more clearly illustrate their relationships and mechanics in light of the composite properties of each method. Furthermore, we compare the results of more than 30 representative SFDA methods on three popular classification benchmarks, namely Office-31, Office-home, and VisDA, to explore the effectiveness of various technical routes and the combination effects among them. Additionally, we briefly introduce the applications of SFDA and related fields. Drawing from our analysis of the challenges facing SFDA, we offer some insights into future research directions and potential settings.
[ "Zhiqi Yu", "Jingjing Li", "Zhekai Du", "Lei Zhu", "Heng Tao Shen" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11803v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11803v1", "@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", "cs.MM" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 3 0 8 1 1 . 2 0 3 2 : v i X r a A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 1 A Comprehensive Survey on Source-free Domain Adaptation Zhiqi Yu, Jingjing Li, Zhekai Du, Lei Zhu, Heng Tao Shen Abstract-Over the past decade, domain adaptation has become a widely studied branch of transfer learning that aims to improve performance on target domains by leveraging knowledge from the source domain. Conventional domain adaptation methods often assume access to both source and target domain data simultaneously, which may not be feasible in real-world scenarios due to privacy and confidentiality concerns. As a result, the research of Source-Free Domain Adaptation (SFDA) has drawn growing attention in recent years, which only utilizes the source-trained model and unlabeled target data to adapt to the target domain. Despite the rapid explosion of SFDA work, yet there has no timely and comprehensive survey in the field. To fill this gap, we provide a comprehensive survey of recent advances in SFDA and organize them into a unified categorization scheme based on the framework of transfer learning. Instead of presenting each approach independently, we modularize several components of each method to more clearly illustrate their relationships and mechanics in light of the composite properties of each method. Furthermore, we compare the results of more than 30 representative SFDA methods on three popular classification benchmarks, namely Office-31, Office-home, and VisDA, to explore the effectiveness of various technical routes and the combination effects among them. Additionally, we briefly introduce the applications of SFDA and related fields. Drawing from our analysis of the challenges facing SFDA, we offer some insights into future research directions and potential settings. Index Terms-Domain Adaptation, Transfer Learning, Computer Vision, Data-Free Learning. (cid:70) 1 INTRODUCTION Deep neural networks are able to achieve satisfying performance in supervised learning tasks thanks to their generalization ability. However, collecting sufficient training data can be expensive due to factors such as cost and privacy concerns, etc. For instance, manually annotating a single cityscape image for semantic segmentation can take up to 90 minutes. To alleviate this issue, transfer learning [1], [2] has been proposed to enable cross-domain knowledge transfer under label deficient conditions. Domain adaptation (DA) [3], [4], as an important branch of transfer learning, focuses on how to improve model per- formance on unlabeled target domains with the assistance of labeled source domain data. Under the condition of inde- pendent homogeneous distribution, the biggest challenge of domain adaptation is how to reduce the domain shift, which can be mainly classified as conditional shift, covariate shift, label shift and concept shift, and has been widely discussed in the previous DA surveys [5], [6]. In conventional domain adaptation approaches, it is mostly assumed that both the source and target domain data could be accessed during adaptation. However, this is not realistic in many applications. On the one hand, the raw source domain data will be unavailable in some cases due to personal privacy, confidentiality and copyright issues; on the other hand, it is unrealistic to keep the complete source dataset on some resource-limited devices for training. All the above problems have hindered the further spread of this field. To relax the dependence of DA methods on source data, Source-Free Domain Adaption (SFDA) [7], [8] has been proposed in recent years, which has rapidly become the The authors are with the School of Computer Science and Engineering, University of Electronic Science and Technology of China, Chengdu, 611731. (a) UDA (b) SFDA Fig. 1. Comparison of UDA and SFDA settings. focus of domain adaptation and is widely studied in image classification [9], [10], semantic segmentation [11], [12] and object detection [13], [14]. As shown in Fig. 1, the most significant difference be- tween SFDA and Unsupervised Domain Adaptation (UDA) [15], [16] is that the UDA model can be trained using both the source and target domain data, while SFDA can only utilize the source model to initialize the target model and then update it with the unlabeled target data. Existing mainstream UDA methods can be categorized into two main types of methods: those that align the source and target domain distributions by designing specific metrics [3], [17], [18], and those that learn domain-invariant feature representations through adversarial learning [19], [20], [21]. However, these mainstream UDA methods are not suitable for scenarios without source domain data, highlighting the need to investigate SFDA methods as an alternative. Despite the considerable efforts devoted to SFDA, there has been no comprehensive review of all the works and a summary of the current progress related to SFDA. To fill this gap, we aim to provide a timely and comprehensive review of recent advances in SFDA in this survey. In this work, we inherit from existing transfer learning Source dataTarget dataModelSource prediction SupervisedSource label Target predictionSource dataTarget dataSource ModelSource prediction SupervisedTargetModelInitializationSource labelTargetprediction A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 2 Fig. 2. Taxonomy of SFDA methods. surveys [2], [22] and divide SFDA into two directions: data- based one and model-based one. In addition, we find that conventional UDA methods begin to work in the SFDA set- ting through some additional steps with the reconstructed source domain, and thus we discuss this regime as the domain-based reconstruction methods to reflect the exten- sibility of UDA research. We depict the overall topology of SFDA methods in Fig. 2. From the data-centric perspective, the domain-based reconstruction and the image style translation can be seen as some derivatives of UDA. The intuition behind domain- based reconstruction is quite straightforward, i.e., it aims to reconstruct a domain or make further divisions within the target domain to compensate for missing source domain data, so that the UDA approaches can be extended to the SFDA setting. Concretely, it can be subdivided into vir- tual domain generation, intra-domain adversarial alignment and perturbed domain supervision. Image style translation translates the target domain data into the unseen source- style through the Batch Normalization (BN) layers of the source classifier, thereby the target domain data can be better compatible with the source model. Neighborhood clustering is based on the observation that the underly- ing intrinsic structure in the target data is embedded in the neighbor relationship, even though the target domain data distribution can not explicitly align with the source classifier. One assumption is that each category of the tar- get domain will exist neighbors located within the source model's boundary, so those hard samples can be mapped to the source domain distribution by maintaining consistency among neighbors. At last, local structure clustering is based on manifold learning [23], [24], [25], and clustering is per- formed through the selection of neighbor nodes. From the model-centric perspective, the majority of ap- proaches assume that the source-pretrained model has a certain degree of generalization over the target domain due to the similarity of the source and target domains. Therefore, the model can be fine-tuned by exploring the outputs of the model on the target data. This self-training scheme is inherited from the idea of semi-supervised learning [26], [27], [28], and can be futher divided into pseudo-labeling, entropy minimization and contrastive learning. It is noted that we pay additional attention to the pseudo-labeling methods since it is most commonly used in SFDA. Pseudo- labeling is usually achieved by first pseudo-labeling the high-confidence samples in the target domain, and optimize the model thereafter by the obtained pseudo-labels. There- fore, how to obtain high-quality pseudo-label is the main concern of this category of methods. In this paper we try to discuss this technical route comprehensively based on each process in terms of prototype generation, pseudo-label assignment and pseudo-label filtering. Moreover, we observed that most of the SFDA methods are comprised of multiple technical components, and each component might correspond to a category in our taxonomy. Therefore, unlike previous surveys on domain adaptation that treated each work independently, we aim to modular- ize each SFDA method and categorize them to reveal the interrelatedness among different research directions. The goal of this survey is to discuss the problem formulation of SFDA, summarize the current advances in this field, and highlight the distinctive components of SFDA techniques A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 3 TABLE 1 SFDA versus other related settings. Source model Unlabeled target Extra source information No training Data-free KD Federated DA Zero-shot DA Test-time DA Source-relaxed DA Source-free DA No source data (cid:34) (cid:37) (cid:37) (cid:34) (cid:34) (cid:34) - (cid:34) (cid:34) (cid:34) (cid:34) (cid:34) to provide a comprehensive understanding of this area and inspire more ideas and applications. The main contributions of this survey can be summarized as follows. • We propose an overall taxonomy framework for the newly emerged SFDA setting from both data-centric and model-centric perspectives. This survey fills a gap in the existing literature by providing a timely and comprehensive summary of the latest SFDA methods and applications. • We modularize more than 30 representative works and compare the results on the most widely used i.e., Office-31, Office-home classification datasets, and VisDA. The combination of different compo- nents is visually presented and comparatively ana- lyzed, which may be instructive for further research in the SFDA setting. The remainder of this survey is structured as follows. In Section 2, we introduce the notations and preliminary knowledge related to SFDA. Section 3 and Section 4 pro- vide a comprehensive review of data-centric and model- centric SFDA methods, respectively. Section 5 presents a comparison of existing SFDA methods on three mainstream classification datasets. Section 6 discusses the potential ap- plications of SFDA, while Section 7 presents visions for future directions of SFDA. Finally, we conclude the paper in Section 8. 2 OVERVIEW In this section, we introduce some notations and the prelim- inary knowledge related to SFDA, with a brief description of several settings in SFDA methods. - (cid:34) (cid:37) (cid:34) (cid:34) (cid:34) Symbol n D X d F (X ) Y|X Φ L L δ c (cid:101)z Θ F C D G M M B μ σ E P Q K V - (cid:37) (cid:37) (cid:37) (cid:34) (cid:37) (cid:37) (cid:37) (cid:37) (cid:34) (cid:37) (cid:37) TABLE 2 Notations related to SFDA. Description Number of instances Domain Instance set Feature dimensions Feature vector Prediction for instance X Domain space Source label set Loss function Soft-max operation Number of classes Noise vector Model parameters Feature extractor Classifier Domain discriminator Generator Model to be trained Module Memory bank Means Standard deviation Mathematical expectation Marginal distribution Query Key Value 2.1 Notations and Definitions N (μ, σ2) A Gaussian distribution with mean μ and variance σ2 For consistency among the literature, we used as many notations as possible that are the same as those in the surveys related to transfer learning [22] and deep domain adaptation [6], [29]. We summarize them in Table 2. Below are some basic definitions that are closely related with the problem of SFDA. Definition 1. (Domain in SFDA) A domain usually con- tains a data set Φ and a corresponding label set L, where the data set contains the instance set X drown from the marginal distribution P (X ) and correspond- ing dimension d. In SFDA, the source domain Ds = {{X s, P (X s) , ds}, Ls} is usually complete, but note that it is only available during pre-training. The label set of the target domain Dt = {{X t, P (X t) , dt}} is not available and its marginal distribution is also different from the source domain. In typical SFDA, we assume a closed form, i.e., the label spaces of the source and target domains are the same. Definition 2. (Task of SFDA) Given a model M trained on the source domain Ds = {{X s, P (X s) , ds}, Ls}, the process of SFDA consists of two stages. In the first stage (pre-training), the source model is trained by labeled A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 4 3 DATA-BASED METHODS The research of this broad class of data-based approaches can be divided into two routes based two different mo- tivations. On the one hand, consider the unavailability of the source domain data, one of the most intuitive ideas is to mimic the source domain data through the source domain information implied in the model, or to reconstruct an intermediate domain or another domain to compensate for the absence of the source domain data. On the other hand, consider the unannotation of the target domain, an- other class of methods can be seen as trying to explore the potential data structure or clustering information in the unlabeled target domain data, making it possible to perform the domain adaptation task independently with the target domain data alone. In our categorization, we call the above two directions as Domain-based Reconstruction and Image- based Information Extraction, respectively. In the following, we describe each of them separately in detail. 3.1 Domain-based Reconstruction The core purpose of this class of methods is to reconstruct a new domain to supervise the target domain. In general, there are three directions to construct a new domain, one is to generate a virtual source domain, one is to construct a perturbed target domain for robust learning, and the last one is to divide the target domain into source-like and target-like parts and then perform an intra-domain adversarial to achieve alignment. 3.1.1 Virtual Domain Generation In unsupervised domain adaptation, a typical paradigm is to supervise the model on the source domain, and mean- while employing some techniques to align the distributions of the source and target domains directly. The overall train- ing goal of this process can be formulated as: LU DAM = Lcls (C (F (X s)) , Y s) + Ldiv (cid:0)F (X s) , F (cid:0)X t(cid:1)(cid:1) , (1) where Lcls is the supervised loss in the source domain, usually using cross-entropy. Ldiv denotes the criterion used for alignment. However, in SFDA, X s is not available during adaptation. Therefore, the virtual domain generation meth- ods attempt to construct a domain to compensate for the absence of source data. The above equation can be extended as follows: LSF DA = Lgen (C (F (X v)))+Ldiv (cid:0)F (X v) , F (cid:0)X t(cid:1)(cid:1) , (2) where X v denotes the virtual domain and Lgen denotes the generative loss of the virtual domain. Note that the model has been pre-trained on the source domain, so it is possible to simulate the domain distribution by exploring the outputs of the model. It can be found that compared to Eq. 3, SFDA should be concerned with the quality of virtual domain generation in addition to the alignment between domains. Since when the virtual domain is generated, the alignment problem of SDFA becomes similar to that of UDA, e.g., ADDA [21] is used in VDA-DA [35] and MMD [36] is employed as an Fig. 3. An illustration of different settings in SFDA. source data under supervised learning. In the second stage (adaptation), the source domain data is unavail- able, and the goal of SFDA is to adapt the source-trained model to the target domain with unlabeled target data Φt = {{X t, P (X )t, dt}}, i.e., to get high accuracy for outputs M(X t) = P (Y t|X t), where P (Y t|X t) is the prediction result of target data X t. i=1 Ds It is worth noting that the above definitions may also enable some extensions. For the definition of domain, SFDA may include the multi-source domains [30], [31], i.e., Ds = {(cid:80)m i } where m is the number of source domains, or there may be non-closed set cases such as Universal source- free domain adaptation [9]; for the definition of task in SFDA, for example, it is also possible in some extended SFDA settings to use a small portion of labeled target do- main data when performing the task (i.e., Active SFDA [32], [33]). We will discuss different variants of SFDA in the next section. 2.2 Overview of the settings in SFDA Generally, domain adaptation can be divided into homoge- neous domain adaptation and heterogeneous domain adap- tation according to whether the source and target domain feature spaces are identical. In heterogeneous domain adap- tation [34], both the distribution space and feature space of the source and target may be different, i.e., P (X s) (cid:54)= P (X t) and ds (cid:54)= dt, so both distribution adaptation and feature space adaptation may be required. While in homogeneous domain adaptation, the feature spaces of the source and tar- get domains are identical and only distribution adaptation is performed. Among the existing SFDA methods, most of them only involve homogeneous domain adaptation, which is also the focus of our discussion in this survey. According to the label-set correspondence between the source and target domains, the settings can be classified as closed-set, partial, and open-set, and the relationship between them are shown in Fig. 3. Based on the number of source and target domains, there are also single-source, multi-source, and multi-task settings. In this survey, we mainly focus on the most general closed-set single-source SFDA setting, and other settings are also briefly outlined. eABEabDedFfdabABDEFbadABDfClosed-setPartialOpen-setSource label spaceTarget label spaceSource labelA...Fe...fTarget label......SingleMulti-sourceMulti-taskAdaptationAdaptationAdaptation A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 5 (a) Virtual Domain Generation (b) Intra-domain Adversarial Alignment (c) Perturbed Domain Supervision Fig. 4. An overview of Domain Reconstruction methods. alignment metric in STDA [37], we concentrate on how to generate the virtual domain in this section. Technically, the virtual domains can be generated in two ways: based on adversarial generation or based on Gaussian distribution. Drawing on the idea of GAN [38], the adversarial gener- ation can be expressed as: L (C, F, D, G) = Ladv + Lcon, (3) where Lcon is the consistency loss used to constrain the se- mantic consistency across domains and can contain multiple perspectives. Ladv represents the adversarial loss between the generator and the domain discriminator, and is usually based on the following equation: Ladv (G) = Ey,(cid:101)z [log D (1 − G (y, (cid:101)z))] , Ladv (D) = Ext∼Xt [log D (xt)] + Ey,(cid:101)z [log (1 − D (G (y, (cid:101)z)))] , (4) where (cid:101)z stands for the noise vector, G (y, (cid:101)z) represents the generator conditioned on a pre-defined labeled y, which differs from the traditional generator [39], [40]. The focus of this class of methods lies in the design of Lcon. 3C-GAN [41] is a pioneering work in this area, for the generator, it emphasizes the semantic similarity between the generated xv = G (y, (cid:101)z) and the label y. For the classi- fier, a deterministic constraint, a weight constraint, and a clustering-based constraint have been proposed to improve the performance. Further, SDDA [42] proposes a consistency loss based on the domain discriminator, which guides the feature extractor to extract domain-invariant features by a binary classification loss. CPGA [43] is inspired by InfoNCE [44] and generates more representative prototypes for each category by adding a contrastive loss. Another way of virtual domain generation is to simulate the distribution of the source domain based on Gaussian distribution according to the implicit knowledge contained in the pre-trained model. Generall, there are mainly two views. One view is to sample noises from standard Gaussian distribution as the inputs of the generator, then the virtual source data generation process (cid:101)x can be expressed as: (cid:101)x = G ((cid:101)z) , (cid:101)z ∼ N (0, 1) . (5) Based on data-free knowledge distillation [45], Liu et al. [11] propose a batch normalization statistical loss to model the source domain distribution using the mean and variance stored in the BN layer of the source domain model. An alternative view is to regard the source domain distribution as a mixture of multiple Gaussian distributions. For instance, VDM-DA [35] constructs a Gaussian mixture model to represent the distribution of the virtual domain in the feature space as: Dv (fv) = K (cid:88) k=1 πkN (cid:0)fv|μk, σ2I(cid:1) , (6) where fv stands for the virtual features and πk denotes the mixing coefficients with (cid:80)K k=1 πk = 1. To estimate the parameters of the Gaussian mixture model, VDM-DA empirically sets K to the number of categories and considers that the weights of the source classifier implicitly contain prototypical information about each category and derives the mean and standard deviation of the model based on the source classifier. SoFA [46] models the inference process and the generation process, respectively, and derives the mixture of Gaussian distribution from the predicted classes as the reference distribution. However, using generative models for virtual domain is not only costly but also difficult to perform the domain generalization well particularly when the underlying data pattern is complex. Therefore, some approaches attempt to use a non-generative approach, e.g., to construct a virtual source domain by selecting some reliable data directly from the target domain. One most common idea is that by feeding the target domain images into the source model, samples with high prediction entropy are considered closer to the source domain distribution and can be used to represent the source domain distribution to some extent. Another key issue raised by this method, however, is the problem of insufficient data for the virtual source domain. For example, Du et al. [47] found that the number of samples that can be selected to construct the virtual source domain is only one- tenth of the target domain, which is not sufficient to support a data distribution that represents the entire source domain. To tackle this problem, a range of approaches focus on how to scale up virtual source domain data. Mixup [48] can be regarded as an effective technique and PS [47] mixes the samples in the virtual source domain with each other, which can be expressed as: (7) (cid:101)xs,aug = λ(cid:101)xi (cid:101)ys,aug = λ(cid:101)yi s + (1 − λ) (cid:101)xj s, s + (1 − λ) (cid:101)yj s, where λ denotes the mixup coefficient, (cid:101)xi s,(cid:101)xj s are the samples selected by prediction entropy from the virtual source do- main and (cid:101)yi s are their corresponding labels respectively. In this way, an augmented virtual source domain are ob- tained by (cid:101)Ds aug = (cid:101)Ds ∪ (cid:101)Daug with (cid:101)Daug = {(cid:101)xs,aug, (cid:101)ys,aug}. UIDM [49], instead, first performs a mixup in the target domain, and then takes into account not only the prediction entropy in the sample selection of the virtual source domain, s,(cid:101)yj SupervisedVirtual Domain Target DomainǁzlabelGenerative NetworkTarget DomainSourcesimilarConfidenceSourcedissimilarAlignmentTarget DomainPerturbed Target DomainPerturbationSupervised A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 6 but also the data uncertainty brought by the mixup oper- ation and the model uncertainty brought by the dropout operation in a more comprehensive manner. In addition to data augmentation by mixup, another idea is to keep transferring samples from the target domain to the virtual source domain during training. Ye et al. [50] proposes a nonlinear weight entropy minimization loss to continuously reduce the entropy value of high confidence samples while leaving low confidence samples unaffected during the training process, resulting in more reliable sam- ples. Although the number of samples in the virtual source domain is increasing, for some difficult categories their virtual source domain samples may still be severely lack- ing. ProxyMix [51] poses this issue and constructs a class- balanced proxy source domain using the nearest neighbors of each prototype as well as a intra-domain mixup. 3.1.2 Intra-domain Adversarial Exploration In the previous section, we introduced the way to handle the problem of unavailable source data by generating the virtual domain, which views SFDA as a cross-domain problem. Instead, some other methods perform a binary split within the target domain, and then conduct adversarial learning between the two data populations while maintaining the knowledge of the source model. Consequently, it achieves the consistency of the overall data distribution in the target domain, which views SFDA as an intra-domain alignment. It is worth noting that the previously introduced virtual source domain methods share certain inspiration with this class of methods in terms of confidence, but the former emphasizes on how to construct the virtual source domain, while the latter focuses on intra-domain distribution align- ment in an adversarial manner. Therefore, we categorize the former into the virtual domain reconstruction class. Technically, intra-domain adversarial alignment mostly uses diverse classifiers and the feature extractor for ad- versarial purpose, which can be seen as a variant of bi- classifier paradigm adversarial methods [52], [53], [54] in conventional UDA. Here we first review the generic three- step procedures of the bi-classifier paradigm: • Step 1 Source training: min θF ,θC1 ,θC2 2 (cid:88) i=1 Lcls (Ci (F (X s)) , Y s) , where Lcls denotes the cross entropy loss, C1 and C2 re[resent the two classifiers, θF , θC1, θC2 is the model parameters corresponding to the feature extractor and classifiers respectively. • Step 2 Maximum classifier prediction discrepancy: min θC1 ,θC2 Lcls (X s, Y s) − Ldis (cid:0)Y t 1|X t, Y t 2|X t(cid:1) , where the first term is identical to step 1, Ldis refers to the discrepancy loss of the two classifiers' predic- tion. • Step 3 Minimize classifier prediction discrepancy: (cid:0)Y t 1|X t, Y t 2|X t(cid:1) . Ldis min θF We now revisit this three-step procedures in the SFDA setting. For the first step, the source model is usually trained in the same way. For the second and third steps, the Lcls term is intractable because of the missing source data, and source knowledge can not be well maintained. As a result, the prediction discrepancy term Ldis in this case becomes unanchored. To solve the above problem in the SFDA setting, a source-specific classifier can be preserved by freezing the parameters of one classifier, and a target-specific classifier can be trained on the unlabeled target data. In addition, the target domain can be divided into source-similar and source-dissimilar samples by the source-specific classifier's prediction confidence or some other criteria, thus the intra- domain adversarial alignment can be achieved by the pre- diction between the target-specific classifier and the source- specific classifier on the two data populations. Formally, the intra-domain adversarial alignment methods can be generalized to two steps as: Step 1(cid:63) Update the target-specific classifier by maximiz- ing the prediction discrepancy between the target-specific classifier and the source-specific classifier on the source- dissimilar samples while minimizing the same prediction discrepancy on the source-similar samples: min θCt (cid:88) x∈X t h Ldis (cid:0)ps (x) , pt (x)(cid:1) − Ldis (cid:0)ps (x) , pt (x)(cid:1) , (cid:88) x∈X t l h and X t (8) where X t l represent the high-confidence (source- similar) and low-confidence (source-dissimilar) samples in the target domain with X t l = X t, ps (x) and pt (x) de- h ∪ X t note the predictions of source-specific classifier and target- specific classifier, respectively. Step 2(cid:63) Update the feature extractor to pull the target features within the two classifiers' decision boundaries: min θF (cid:88) x∈X t Ldec (cid:0)ps (x) , pt (x)(cid:1) , (9) where Ldec stands for the decision loss to improve the generalization ability of the feature extractor. In general, there are a total of three directions to improve the effect of intra-domain adversarial alignment, which are the selection of Ldis and Ldec, the division between X t h and X t l , and the optimization of network structure. Since we summarize the general framework for in-domain adversar- ial alignment, we now discuss the relevant methods under this framework. A2Net [10], as the first work of intra-domain adversarial alignment, is based on a voting strategy to divide the target domain by concatenating the predictions of the source- specific and target-specific classifiers together and perform- ing a Softmax operation. Concretely, if the voting score of the source-specific classifier is higher than the voting score of the target-specific classifier, it will be seen as like the source- similar features and vice versa. Notably it proposes a Soft- Adversarial mechanism to train the target-specific classifier and feature extractor with the exchange of voting scores, A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 7 which can be expressed as: 3.1.3 Perturbed Domain Supervision − min θCt − min θF nt(cid:88) i=1 nt(cid:88) i=1 (cid:32) αs i log (cid:32) αt i log (cid:32) K (cid:88) k=1 (cid:32) K (cid:88) k=1 (cid:33) pst (i)k + αt i log (cid:33) pst (i)k + αs i log (cid:32) 2K (cid:88) k=K+1 (cid:32) 2K (cid:88) k=K+1 (cid:33)(cid:33) (cid:33)(cid:33) , , pst (i)k pst (i)k i , αt [ps, pt]T (cid:17) (cid:16) (10) where αs i represent the voting scores of the source- specific classifier and target-specific classifier respectively, ∈ R2K is the concentration of ps and pt pst = σ after activation. Although the presentation of Eq. 10 is dif- ferent from that of Eq. 8, it is still essentially an adversarial training between a feature extractor and a target classifier, so our framework is still applicable. BAIT [55] is another typical approach that conforms to the in-domain adversarial alignment paradigm, which uses KL divergence as the discrepancy loss as well as a bite loss that raises the output entropy of the two classifiers, denoted as follows: min θCt (cid:88) x∈X t h DSKL (cid:0)ps (x) , pt (x)(cid:1) − DSKL (cid:0)ps (x) , pt (x)(cid:1) , (cid:88) x∈X t l nt(cid:88) K (cid:88) (cid:2)−ps i,k log pt i,k − pt i,k log ps i,k (cid:3) , min θF i=1 k=1 (11) where DSKL(a, b) = 1 2 (DKL (a|b) + DKL (b|a)). It is worth mentioning that BAIT empirically found in its experiments that for the selected thresholds, it is better to divide the source-similar and source-dissimilar sets into the same size, we consider this to be an informative implications. The KL divergence serves as a relatively good measure of the difference in prediction distributions between two classifiers, but it ignores the determinacy of the classifier outputs, which may lead to ambiguous output problems. Both D-MCD [56] and DAMC [57] are concerned with this problem and have adopted CDD distance [58] to measure both consistency and determinacy of the outputs. In addi- tion to this, they have made some improvements to the net- work structure. In D-MCD, Chu et al. takes advantage of the model's tendency to remember simple samples in the early stages of the training process and designs a strong-weak paradigm to jointly filter the samples to avoid incorrect high-confidence samples. DAMC, on the other hand, uses a network structure with more than two classifiers to provide a tighter upper bound on the domain gap for classification and derives the optimal number of classifiers from being the same as the number of categories. However, all these extra network structures also increase the computational overhead. So far, two major lines of research in UDA have been re- flected in SFDA. In the virtual domain generation class, it is possible to use some metrics or adversarial-learning-based strategy to align the virtual and target domain distributions. In the intra-domain adversarial alignment, a variant of bi- classifier paradigm can be used. Both these methods indicate the potential research connection between SFDA and UDA. This class of methods is essentially based on the assumption that both source and target domain features originate from a domain-invariant feature space [59], i.e., the source and target domains are actually formed by domain-invariant fea- tures plus some domain-biased factors. From the viewpoint of perturbation, it is feasible to use the target domain data to perturb the source data for semantic augmentation [60] in UDA, so as to guide the model to learn domain-invariant features. Then in the absence of source domain data, it is also possible to add some appropriate domain-related perturba- tions on the unlabeled target data during the model training. If the model can resist these domain-related perturbations, it is possible to make the model acquire domain-invariant features. As shown in Fig. 4(c), the perturbed target domain acts as the guidance to the source domain, so we refer to it as the perturbed target domain supervision. Although there are still few approaches on this technique route, due to the distinct technical characteristic, we consider it as a category parallel with other two classes of approaches in Domain- based Reconstruction. As a representative method in this category, SOAP [61] argues that the ultimate goal of the model is to find domain- invariant features, and expresses the adjustment direction of the model as a vector and reflects it in UDA and SFDA as:  −→(cid:15)   −→(cid:15) (cid:16) Dt, DI (cid:17) U DA = −→(cid:15) (cid:0)Dt, Ds(cid:1) + −→(cid:15) (cid:16) Ds, DI (cid:17) , (12) (cid:16) Dt, DI (cid:17) SF DA = −→(cid:15) (cid:0)Dt+, Dt(cid:1) , T + (1 − β) (cid:101)NT . where DI denotes the domain-invariant feature space, and Dt+ is a super target domain constructed by adding a target- specific perturbation (cid:101)NT to the target domain samples as X i T + = βX i SMT [62] is also based on this strategy, which dynam- ically updates the perturbed target domain. Although the motivation of the super target domain is attractive, the construction is still too simple, e.g., taking the mean value of the target images, which may not enough to reflect the property of the target domain. For the same purpose, FAUST [63] interprets this data perturbation from the perspective of uncertainty [64], which first applies a random augmentation to the target images, and then encourages the feature extractor to extract consis- tent features over the target images before and after the per- turbation by both epistemic uncertainty and aleatoric uncer- tainty. Unlike perturbing target data, VMP [65] introduces perturbations to the parameters of the model by variational Bayesian inference to maintain the model's discriminative power while performing model adaptation. AAA [66], on the other hand, introduces adversarial perturbations [67] into domain adaptation by designing adversarial examples to attack the model, and the generation process of the adversarial examples can be represented as follows: (cid:101)xt = xt + nt(cid:88) Lcls i=1 max θG 1 nt (cid:15), G (xt) ||G (xt) || 2 (cid:0)C (F ((cid:101)xt)) , ˆyi t (13) (cid:1) , A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 8 where G denotes the generator, || * || denotes the Euclid norm, (cid:15) > 0 is the perturbation magnitude to control that the perturbation will not destroy the samples' original se- mantic information and ˆyi t is the pseudo label corresponding to (cid:101)xt. The authors argue that if the model defends against these attacks, the generalization ability of the model can be significantly improved in the process. This defense process can be formulated as: max θF ,θC 1 nt nt(cid:88) i=1 Lcls (cid:0)C (F ((cid:101)xt)) , ˆyi t (cid:1) . (14) In general, the key point of this class of methods is the design of perturbations. The first point is that the magnitude of the perturbation should be appropriate, which means enhancing the model's generalization ability without de- stroying the original properties of the data or the model. The second point is that the perturbation should preferably reflect the characteristics of the target domain to accomplish the adaptation task on the target domain. 3.2 Image-based Information Extraction The information contained in one image can be mainly divided into two parts [68]: one is the content information related to the image label, and the other is the style informa- tion that is often domain-specific. Neighborhood Clustering starts from the content information of the target images and builds on the observation that the target data itself has a clear structure and clustering, thus the consistency between neighboring nodes is required to increase the intra-class distance and decrease the inter-class distance in the feature space, so as to reduce the classification difficulty, since the misclassification mostly appears at the decision boundary of the model [69]; Image Style Translation starts from the style information of the image, and converts the target image to the source-style without changing the content information, so that it can be better recognized by the source classifier. 3.2.1 Neighborhood Clustering The key idea behind Neighborhood Clustering is that al- though the feature distribution in the target domain can be deviated from that in the source domain, they can still form clear clusters in the feature space and the features in the same clusters will come from the same category. Therefore, if the consistency between neighbor nodes in the feature space is encouraged, it enables feature points from the same clusters to move jointly towards a common category. G-SFDA [70] is a pioneer job in this category, which proposes to use Local Structure Clustering for consistency constraints. And the methodology can be represented as follows: 1 n LLSC = − i=1 N{1,*** ,K} = {Bj n (cid:88) K (cid:88) log [p (xi) * BS (Nk)] + C (cid:88) KL (pc||qc) , (cid:16) cos (cid:16) F (xi) , Bj F c=1 (cid:17) , ∀Bj p = pc (xi) , and q{c=1,*** ,C} = k=1 F |top − K n 1 (cid:88) n i=1 F ∈ BF 1 C . (cid:17) }, (15) From Eq. 15, LSC first finds the top-K features that are most similar to xi in the feature bank BF by calculating the cosine similarity, and then constrains the prediction consistency of the prediction scores of these K features in the scores bank BS with xi. The second term of LLSC is used to prevent the degenerated solution [71], [72] to encourage prediction balance. CPGA [43] simplifies this step by constraining only the normalized similarity between neighbor nodes as an auxiliary loss, which also helps improve accuracy. Based on this, NRC [73] further refines the neighbor nodes into reciprocal and non-reciprocal neighbors based on whether they are the nearest neighbors to each other,i.e., (j ∈ N i K), and builds an expanded neighbor- hood to aggregate more information in the common struc- ture, thereby weighting the affinity of different neighbors as: K) ∩ (i ∈ N j LN = − 1 nt (cid:88) (cid:88) AikBT S,kpi, LE = − 1 nt (cid:88) (cid:88) i k∈N i K (cid:88) rBT S,mpi, (16) i k∈N i K m∈Ek M where Aik = 1 while i and k are reciprocal nodes, otherwise Aik = r = 0.1. Similarly, Tang et al. [74] construct semantic neighbors on the manifold to portray more complete ge- ometric information, Tian et al. [75] combine with pseudo labeling techniques to obtain structure-preserved pseudo- label by the weighted average predictions of neighboring nodes. However, previous methods have only considered maintaining the consistency of the same clusters (reducing the intra-class distance), but ignored the dissimilarity of dif- ferent clusters (increasing the inter-class distance), AaD [76] achieves this by defining two likelihood function: P (Ci) = P (Bi) = (cid:89) j∈Ci (cid:89) pij = pij = (cid:89) j∈Ci (cid:89) (cid:80)Nt i pk epT i pj k=1 epT epT i pj k=1 epT (cid:80)Nt i pk , , (17) j∈Bi j∈Bi where neighbor set Ci includes K-nearest neighbors of node i, and background set Bi includes the nodes which are not the neighbor of node i. Once these two likelihood functions are obtained, constraints can be placed on both intra-cluster and inter-cluster by the negative log-likelihood as Li (Ci, Bi) = − log P (Ci) P (Bi) . In addition, Neighborhood Clustering also appears widely in a new setting called active SFDA, i.e., selec- tively labeling a small portion of data, which has two main benefits: (1) a small portion of difficult data can be selectively labeled by constructing a neighbor graph, e.g., ELPT [77] selects ungraphable data on the basis of KNN; MHPL [32] considers those data satisfying the properties of neighbor-chaotic, individual-different, and target-like as the most effective choice; (2) the discriminability of the target domain can also be improved by label propagation [78], [79] among neighbor nodes. Overall, the key point of Neighborhood Clustering methods lies in how to mine more structural information from the unlabeled target data,, and since unsupervised clustering is inherently suitable for A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 9 SFDA settings for unavailable source data, there is still a wide scope for this class of methods in the future. 3.2.2 Image Style Translation Image Style Translation [80], [81] aims to render the same content into different styles, which generally contains two loss functions. The first one called content loss is used to ensure consistent semantic information before and after translation. The other one called transfer loss which is based on feature statistics of multiple intermediate layers to perform style translation. However, in previous methods, most of the feature statistics are considered in the form of Gram matrix [68] or instance normalization [82], which requires access to the source domain style data, but this is not feasible in the SFDA setting. So Hou et al. used the mean μn stored and variance σn stored of the image batches for the n- th layer stored in the Batch normalization (BN) layers [83] as a style representative of the source domain and proposed a source-free image style translation as follows: Lcontent = ||F N ((cid:101)xt) − F N (xt) ||2, N (cid:88) ||μn current −μn stored||2 +||σn current −σn stored||2, Lstyle = 1 N n=1 (18) where the feature maps in the source classifier have N layers, (cid:101)xt denotes the source-styled image through the gen- erator. CPSS [84], on the other hand, focuses on improving the robustness of the model by augmenting the samples with diverse styles based on AdaIN [82] during training. A model that is insensitive to changes in image style can be obtained and thus has a strong generalization capability. The training loss can be expressed as: Lintra = σ (cid:16) (cid:101)Fi,j Linter = σ (cid:16) (cid:101)Fk,i,j (cid:17) (cid:18) Fi,j − μ (Fi,j) (cid:19) σ (Fi,j) (cid:17) (cid:18) Fk,i,j − μ (Fk,i,j) + μ (cid:16) (cid:17) , (cid:101)Fi,j (cid:19) + μ (cid:16) (cid:101)Fk,i,j (cid:17) , σ (Fk,i,j) (19) where Lintra and Linter represent the intra-image style swap and inter-image style swap among k images. (cid:101)Fi,j and (cid:101)Fk,i,j denote the shuffled patch that provides the style feature and one image can be divided into nh × nw patches as: F =    F1,1 ... Fnh,1 F1,nw ... * * * . . . * * * Fnh,nw    Similar to CPSS, SI-SFDA [85] simulates learning rep- resentations from corrupted images in medical image seg- mentation by randomly masking some patches with a black background. How to make better use of the BN layer is also a concern for this class of methods, Ishii et al. [86] implicitly implements style translation by aligning the statistics in the BN layer with the target domain distribution. As of now, this class of methods is still relatively rare, and is mostly found in the semantic segmentation. 4 MODEL-BASED METHODS Unlike data-based methods that focus on the data genera- tion or the exploring data properties, model-based methods separate the model into several sub-modules, and then adjust the parameters to some of them for domain adap- tation. In this category, self-training is the most dominant paradigm and even the most popular one in the whole SFDA research. Self-training methods mostly use auxiliary modules to improve model robustness and preserve source domain knowledge in combination with other methods, and we classify them separately in order to reflect our intention of modularizing the methods for an explicit insight in this survey. 4.1 Self-training Since the supervision of the source data is unavailable, self- training, also known as self-supervised learning, makes use of the model's predictions on the unlabeled target domain to refine the model in a self-supervised manner. In SFDA, most self-training methods are carried out based on the ideas of pseudo-labeling, entropy minimization, and contrastive learning. 4.1.1 Pseudo Labeling Without supervision, the most intuitive idea is to label the target samples based on the predictions of the source model, and then perform self-supervised learning based on these pseudo-labels, e.g., SHOT [7]. Specifically, this process can be divided into three steps: the first step Prototype Generation is to generate class prototypes based on the features of some high-confidence samples or all samples, the second step Peseudo-label Assignment is to specify pseudo-labels by the distance or similarity between other samples and class prototypes, and the third step Pseudo- label Filtering finally filters out some noisy labels to keep the purity of the labels. It is worth noting that neither the first step nor the third step in this process necessarily exists. For example, a sample can be directly pseudo-labeled by the most possible class predicted by the source classifier, but we argue that they have a tight relationship with each other. We will expand on each step in more detail below. Prototype Generation. One of the simplest ways is to select class prototypes by self-entropy [87], [88], i.e., to select samples in each class with self-entropy greater than a certain threshold. Ding et al. [51] define the weights of the source classifier as the class prototypes and found that the mean accuracy is higher than employing entropy-criterion. However, the class prototypes selected in this way may not be representative. Similar to this, some methods [77], [89] are inspired by active learning, and consider target samples with higher free energy to be more representative of the target domain distribution which can be used as class proto- types. Another popular approach is to calculate the centroid [7], [90], [91], [92] of each class based on DeepCluster [93], which can be formulated as follows: ck = (cid:80) xt∈Xt (cid:80) δk (F ◦ Gt (xt)) Gt (xt) δk (Ft (xt)) xt∈Xt , (20) where ck denotes the centroid of k-th class, δk denotes the k-th element in the soft-max operation. Some recent A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 10 works [51], [94] argue that using only one prototype does not fully characterize the class, so multiple prototypes are generated in each class. In general, the aim of this step is to attain a class prototype pk that can represent the distribution of each category in the target domain. Pseudo-label Assignment. Once the class prototype is obtained, the pseudo-label of each sample can be obtained by comparing it with different class prototypes, either in terms of similarity or distance in the feature space: (cid:101)t = arg min y k Lpse (G (xt) , pk) , (21) where Lpse represents the metric function of how the pseudo-label is given. Note that when no class prototype is generated, the equation degenerates to (cid:101)t = arg min y k F ◦ G (xt) , (22) where the pseudo-label is assigned directly by the most con- fident category of the model outputs. Moreover, the way of pseudo-labeling is also worth discussing. In the pioneering work SHOT [7], it is time-consuming to touch all the data before assigning the pseudo-label. Based on this, BMD [91] proposes a dynamic pseudo labeling strategy to update the pseudo label in the process of domain adaptation. Shen et al. [95] label only a subset of the target domain to ensure accuracy. In this labeling process, how to maintain the balance between categories is also a major concern. Qu et al. [91] use the idea of multiple instance learning [96], [97] to form a balanced global sampling strategy. You et al. [98] set category-specific thresholds to keep the number between categories as consistent as possible, Li et al. [99] noticed that the model may be biased towards most categories, thus proposing an imbalanced SFDA strategy with secondary label correction. Pseudo-label Filtering. Due to the presence of the do- main shift, the outputs of the model inevitably contain noise, i.e., incorrect pseudo-labels, as illustrated in Fig. 5. Therefore, the false label filtering [56], [87], [100] and the noisy label learning [94], [101], [102] are two important directions to improve the accuracy of pseudo labels. False label filtering is mainly to reject unreliable pseudo-labels by designing some reasonable mechanism. One is to design a specific rule mechanism, such as Kim et al. [87] propose an end-to-end filtering mechanism, which only recognizes a sample as reliable when its Hausdorff distance from its most similar class prototype is smaller than its distance from the second similar class prototype; another is to design an optimized network mechanism to perform filtering, such as Chu et al. [56] utilized the advantage that a weak model is more likely to identify hard samples [103], and propose an additional untrained weak network to filter on incor- rect pseudo-labels. Yang et al. [100] looked at the stability of negative learning and proposed a multi-class negative learning strategy to learn the filtering threshold of pseudo- label selection adaptively. On the other hand, noise label learning is no longer just filtering wrong pseudo-labels, but also learning useful information from the noisy labels for self-refinement. SHOT++ [102] is an extension of SHOT [7], attempting to improve the reliability of low confidence sam- ples by MixMatch [104] between high confidence samples and low confidence samples for information propagation. Fig. 5. An illustration of the process in the Pseudo Labeling methods. Circles with different colors indicate samples of different classes. Cir- cles with solid margins indicate samples with pseudo labels (mismatch between the margin color and the filled color indicates the wrong pseudo label), and triangles indicate class prototypes. The class prototypes are first generated based on the distribution of samples in the feature space, then pseudo-labels are assigned to each sample based on the class prototypes, and finally, the noisy labels are filtered. In particular, some of the methods adjust the position of the class prototypes again in the first step based on the results. NEL [94] introduces ensemble learning [105], [106] into the SFDA setting, first performing data augmentation on the target domain samples with multiple angles based on input and feedback, and then using negative ensemble learning across multiple versions to refine the pseudo label. From the whole process of the pseudo-labeling methods, pseudo- label filtering is used as a key step to improve the accuracy of pseudo-label, but it also brings additional resource over- head, so the efficient pseudo-label filtering technique is still worth discussing. 4.1.2 Entropy Minimization Entropy minimization has profound applications in semi- supervised learning [107], [108] and unsupervised learning [16], [109] methods, and was first introduced to the SFDA setting by [7]. Previous unsupervised domain adaptation mostly improves the adaptive capability of the model in the target domain by aligning the feature distributions in the source and target domains, but this is not feasible without the source domain data. Therefore, another idea is to start directly from the results, assuming that a model with adaptive ability has been obtained, then the model outputs of each sample should be deterministic, i.e., en- tropy minimization, and this ideal result constraint can be inversely employed to guide the optimization of the model. The entropy minimization loss can be expressed as: Lent = −Ext∈Xt K (cid:88) k=1 δk (pt (xt)) log δk (pt (xt)) , (23) where pt denotes the model's prediction with respect to sample xt. Since entropy minimization loss is easy to im- plement and can be easily combined with other methods such as pseudo labeling methods as a loss function, image classification in the passive setting, image segmentation, medical image analysis and blind image quality assessment are rapidly adopted, it has been rapidly adopted for image classification [110], [111], image segmentation [12], [112], Prototype GenerationPseudo-label AssignmentPseudo-label Filtering A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 11 medical image analysis [113] and blind image quality as- sessment [114] in the SFDA setting. However, some works [115], [116] have found that entropy minimization loss may lead to a trivial solution during training, i.e., all predictions are biased towards a certain class, so the batch entropy maximization loss can also be used to ensure the diversity of predictions: Ldiv = K (cid:88) k=1 pk log pk, (24) (cid:2)δ (cid:0)pk t (xt)(cid:1)(cid:3) where pk = Ext∈Xt , is to accumulate the out- puts by class first in one batch, and then perform the soft- max operation.The reason for this is that within a batch, the number of samples in each category should be balanced, so that the uniform distribution has the maximum entropy value. In many SFDA methods, Eq. 23 and Eq. 24 are combined to form the information maximization loss: LIM = Lent + Ldiv. (25) Based on the LIM , Ahmed et al. [31] weight the different source domains in the multi-source domain setting to get the weighted information maximization, and Mao et al. [111] incorporate the neighbor node information to graph adaptation. However, except after information maximiza- tion, innovations based on entropy minimization are rela- tively lacking at present, and more approaches just directly use it as an auxiliary loss to improve accuracy. The key point of entropy minimization is judging from the results how to constrain the outputs of the model on the target domain from different levels such as individual and whole, deterministic and diverse, etc., and what outputs are more reasonable may be a topic worth more in-depth and detailed in the future. 4.1.3 Contrastive Learning Self-supervised contrastive learning [117], [118] is a com- mon route used for unsupervised representation learning, which focuses on learning discriminative representations by increasing the distance between negative pairs while gathering positive pairs. This approach is characterized by the construction of positive and negative sample pairs re- garding the same sample, which can be mainly categorized as the memory-bank based [119], encoder based [117] and mini-batch based [120], [121]. One most typical contrastive loss is the InfoNCE loss [44], [117]: exp (cid:0)uT v+/τ (cid:1) , LInf o = − (cid:88) log v+∈V + exp (uT v+/τ ) + (cid:80) v−∈V − exp (uT v−/τ ) (26) where V +,V − are the sets of positive and negative pairs about the same sample u respectively, and τ is the tem- perature parameter. In unsupervised domain adaptation, the construction of positive and negative sample pairs is usually done with the target domain sample as the key value and then the source domain sample as the query. However, the latter is not available in the source-free setting, so how to construct queries that can be representative of the source domain is the central problem of this class of SFDA methods, which can be mainly divided into 3 ways. The first manner is to use the source classifier's weights as prototype features for each class of source samples [90]: L1 cdc = − M (cid:88) m=1 Iˆyu=m log exp (cid:0)uT wm s /τ (cid:1) (cid:16) uT wj s/τ (cid:80)M j=1 exp (cid:17) , (27) s ], I s, * * * , wM where the classifier weight Ws = [w1 i=m is the pseudo label indicator matrix on target sample u. Similarly, [43] uses the generated prototypes for contrastive learning and introduces weight loss to enhance the relia- bility of the pseudo label. The second way is to increase the similarity of positive pairs in the current batch for contrastive matching [10]: ˆyt L2 cdc = − log exp (sij) Iv(cid:54)=i|γiv| exp (siv) , (cid:80)b v=1 (28) where sij = [σ(pi)]T σ(pv) denotes the similarity of the i-th sample and the v-th sample with the soft-max operation on their model outputs pi, pv, γiv is a threshold function used to determine whether the two samples belong to one class. The last class of approaches preserves a memory bank to store the outputs of the historical models, thus constructing positive and negative sample pairs [122], [123]. HCID [122] uses the current model to encode the samples of the current batch as the query qt = M t (xq), and then uses the historical model to encode the previously stored samples as keys n = M t−m (xkn ): kt−m L3 cdc = − (cid:88) log xq∈Xt + /τ (cid:1) γt−m exp (cid:0)qT kt−m i=0 exp (cid:0)qtkt−m i + /τ (cid:1) γt−m i (cid:80)N , (29) where N is the number of stored keys, γ is the parameter used to measure the reliability of the keys, and one imple- mentation is the classification entropy. In general, part of the processing of this class of source-free methods is similar to the basic idea of data-based SFDA, i.e., using generative or non-generative approaches to compensate for missing source data. 4.2 Self-attention In computer vision tasks, localizing object regions plays an important role in domain adaptation [124], but traditional CNN models prefer to capture local domain-specific infor- mation, such as background information, which may not be helpful for focusing objects we really care about. Therefore, the self-attention mechanism [125], [126] is introduced into the SFDA setting: LAttnself (Q, K, V ) = sof tmax( QK T √ dk )V, (30) where Q, K, V denote query, key and value respectively, dk is the dimensions of K. To alleviate the context loss prob- lem in the source domain, some methods [77], [112], [124] equip the self-attentive module directly with the traditional A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 12 feature extractor. Eq. 30 can also be extended with cross- domain attention [127]: TABLE 3 Statistics of the Datasets in SFDA. LAttncross(Qs, Kt, Vt) = sof tmax( QsK T t√ dk )Vt, (31) where Qs is from the source domain, Kt and Vt are from the target domain, and together they form a sample pair. Based on this, CADX [128] divides the target domain image into supported images and query images under the source- free setting, and improves the original patch-to-patch op- eration to image-to-image in order to capture the overall representations and reduce the computational burden. In addition, some approaches [11], [129] further process the features from both spatial attention and channel atten- tion perspectives to enrich the contextual semantics of the representations. Currently, attention-based SFDA methods are still relatively rare, especially transformer-based SFDA methods. 5 COMPARISON Since the classification task constitutes the main body of existing source-free domain adaptation methods, we com- pare current leading SFDA methods on three most widely used classification datasets in this section. In particular, we modularize these methods according to Section 3 and Section 4 to reflect the effectiveness of the different modules. 5.1 Comparison Datasets The classification datasets used in this paper include Digits [39], VisDA-C [130], Office-31 [131], Office-Home [132], and DomainNet [133], and we have aggregated the statistics in Table. 3. However, due to very little room for improvement for the Digits dataset (98.9% in [7]) and the difficulty of the DomainNet dataset, the other three datasets are more popular in the community. Therefore, we mainly summarize the experimental results on these three datasets to represent the majority. Here are the details of these three datasets. Office-31 is the dominant benchmark dataset in visual transfer learning, which contains 4,652 images of 31 types of target objects commonly found in office environments, such as laptops, filing cabinets, keyboards, etc. These images are mainly derived from Amazon (online e-commerce images), Webcam (low-resolution images taken by webcam), and DSLR (high-resolution images taken by DSLR). There are 2,817 images in the Amazon dataset, with an average of 90 images per category and a single image background; 795 images in the Webcam dataset, with images exhibiting significant noise, color, and white balance artifacts; and 498 images in the DSLR dataset, with 5 objects per category and each object has taken an average of 3 times from different viewpoints. Office-Home is a baseline dataset for domain adaptation that contains 4 domains, each consisting of 65 categories. The four domains are Art (artistic images in the form of drawings, paintings, decorations, etc.), Clipart (a collection of clipart images), Products (images of objects without back- grounds, and Real World (images of objects taken with a regular camera). It contains 15,500 images, with an average Dataset Domain Samples Classes Digits Office SVHN (S) MNIST (M) USPS (U) Amazon (A) Dslr (D) Webcorn (W) Office-Home VisDA-C DomainNet Artistic images (Ar) Clip Art (Cl) Product images (Pr) Real-World images (Rw) Real Synthetic Clipart(clp) Infograph(inf) Painting(pnt) Quickdraw(qdr) Real(rel) Sketch(skt) 1797 10 4652 31 15500 65 207785 12 569010 365 of about 70 images and a maximum of 99 images in each category. VisDA-C is a large-scale dataset for domain adaptation from simulators to realistic environments. It consists of 12 common classes shared by three public datasets: Caltech- 256 (C), ImageNet ILSVRC2012 (I), and PASCALVOC2012 (P). The source domain samples and target domain samples are synthetic images generated by rendering 3D models and real images, respectively. To better represent the modules included in each method, we categorize the SFDA methods into four classes: Domain-based Reconstruction (DR), Image-based Informa- tion Extraction (IIE), Self-Training (ST), and Self-Attention (SA). More finely, we then divide these four types of methods into nine modules, which are Virtual Domain Generation (Mvdg), Intra-domain Adversarial Alignment (Miaa), Perturbed Domain Supervision (Mpds), Neighbor- hood Clustering (Mnc), Image Style Translation (Mist), Pseudo Labeling (Mpl), Entropy Minimization (Mem), Con- trastive Learning (Mcl) and Self-Attention (Msa). 5.2 Comparison Results We summarize the classification accuracy results on the Of- fice, Office-Home and VisDA-C datasets in Table. 4, Table 5, and Table 6. It is important to note that all methods are uniformly set to the single-source homogeneous closed-set source-free domain adaptation and we cite the best results presented in the original paper. In the table, we provide the accuracy of the source-only model [134] (ResNet-50 on Office, Office-Home, and ResNet-101 on VisDA-C) and the target-supervised model at the top, then we split the jobs for the years 2020, 2021, and 2022 with horizontal lines from top to bottom. Our analysis of the comparison results is provided below. The volume of work on SFDA is increasing quickly.There is an explosive growth trend of the num- ber of papers on SFDA research since 2020. On the three A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 13 TABLE 4 Classification Accuracy (%) Comparison for Source-free Domain Adaptation Methods on the Office-31 Dataset (ResNet-50). Method (Source→Target) Source-only [134] Target-supervised [102] SHOT [7] 3C-GAN [41] BAIT [55] SHOT++ [102] Kim et al. [87] A2Net [10] NRC [73] ASL [135] TransDA [124] CPGA [43] AAA [66] VDM-DA [35] HCL+SHOT [122] AaD [76] U-SFAN [136] CoWA-JMDS [137] CDCL [90] D-MCD [56] BMD + SHOT++ [91] ProxyMix [51] UTR [138] SCLM [74] Jing et al. [65] - - (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) Kundu et al. + SHOT++ [139] (cid:33) DR IIE - - (cid:33) SA - - ST - - (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) Modules - - Mpl + Mem Miaa Miaa Mpl + Mem Mpl Miaa + Mcl Mnc Mpl + Mem Mpl + Msa Mnc + Mpl + Mcl Mpds + Mpl + Mcl Mvdg + Mem Mpl + Mcl Mnc Mvdg + Mem Mvdg + Mpl Mpl + Mcl Miaa + Mpl Mpl + Mem Mvdg + Mpl Mpl Mnc + Mpl Mpds Mvdg + Mpl A → W D → W W → D A → D D → A W → A Avg. 76.1 94.3 60.7 86.0 68.9 98.0 99.3 98.0 68.4 98.7 96.7 98.7 62.5 98.7 90.1 93.7 94.6 90.4 91.1 94.0 90.8 94.1 95.0 94.1 94.2 94.1 92.5 92.1 92.8 95.2 92.1 93.5 94.2 96.7 93.5 90.0 93.3 93.2 98.4 98.5 98.1 98.7 98.2 99.2 99.0 98.4 99.3 98.4 98.1 98.0 98.2 99.1 98.0 98.5 98.5 98.8 98.0 98.5 99.1 98.9 98.6 98.9 99.9 99.8 100.0 99.9 99.5 100.0 100.0 99.8 99.6 99.8 99.8 100.0 100.0 100.0 99.0 99.8 100.0 100.0 100.0 99.8 100.0 100.0 100.0 100.0 94.0 92.7 92.0 94.3 92.2 94.5 96.0 93.4 97.2 94.4 95.6 93.2 94.7 96.4 94.2 94.4 94.4 94.1 96.2 95.4 95.0 95.8 96.2 94.6 74.7 75.3 74.6 76.2 71.0 76.7 75.3 76.9 73.7 76.0 75.6 75.8 75.9 75.0 74.6 76.2 76.4 76.4 76.0 75.1 76.3 75.5 75.4 78.3 74.3 77.8 75.2 75.8 71.2 76.1 75.0 75.0 79.3 76.6 76.0 77.1 77.7 76.5 74.4 77.6 74.1 76.4 76.0 75.4 78.4 76.0 76.9 78.9 88.6 89.6 89.4 89.2 87.2 90.1 89.4 89.5 90.7 89.9 89.9 89.7 89.8 89.9 88.8 90.3 89.3 89.9 90.1 85.6 90.3 89.4 90.0 90.7 datasets, the highest accuracies of the SFDA methods are only 3.6% (Kundu et al. + SHOT++ [139] [140] on Ofiice), 2.7% (TransDA [124] on Office-Home) and 0.9% (BMD + SHOT++ [91] on VisDA-C) lower than the accuracy under the target supervision (oracle). To some extent, SFDA shows a tendency to outperform unsupervised domain adaptation methods, both in terms of the number of works and ac- curacy, which not only reflects the great potential of this field, but also indicates the need for a comprehensive SFDA survey. Self-training is still the most popular research line at the moment. Most of the SFDA methods involve the strategy of self-training. In addition, Entropy minimization [7], [63], [91], [102], [136] as an auxiliary loss can be easily combined with most SFDA methods to improve the dis- criminability of the target domain representation. Besides, contrastive learning [10], [43], [66] generally works with the pseudo-labeling module to play the role of domain align- ment. In the absence of source data and target labels, self- supervision by means of pseudo-labeling for the target data is the most common method. However, this inevitably in- troduces the problem of noisy label and error accumulation. In this regard, some approaches translate the SFDA problem into the noisy label learning problem [56], [94] to improve the model performance. There are some approaches [138], [140] that try to bypass the noisy label problem and im- plicitly regularize the self-training direction of the target domain, achieving satisfying results. From the experimental results on two of the three datasets, the methods that achieve the highest accuracy all use the pseudo labeling method SHOT++ [102] as the baseline. For instance, Kundu et al. [139] achieves 90.7% on Office, and BMD [91] achieves 88.7% on VisDA. These observations show that pseudo labeling is a versatile and effective technique, which is also a strong baseline for improvement. Domain-based reconstruction is commonly used in SFDA. The intuition of SFDA methods behind domain- based reconstruction is quite clear: it aims to reconstruct a new source or target domain to replace the missing source domain for supervision. Among this category of methods, intra-domain adversarial alignment methods were the first batch methods, such as BAIT [55] and 3C-GAN [41]. How- ever, their influence is unenviable, probably because the source-similar samples selected in the target domain contain a lot of noise and are not representative enough, which is also why D-MCD [56] targets at the de-noising problem. The attention of virtual domain generation is on the rise, probably because virtual domain generation methods [35], [51], [137], [139] can be closely combined with self-training methods that play the supervised role of the target domain, thus together further improving the effect, e.g., reaching the highest accuracy of 90.7% (Kundu et al. [139]) on the Office- 31 dataset. Neighborhood clustering seems to be effective in image-based information extraction. Compared with image style transformation methods [141], neighbor clustering is obviously more effective. For example, SCLM [74] achieves the highest accuracy on Cl→Ar and Cl→Rw transfer tasks on Office-Home. The reason may be that neighbor clustering can better preserve the underlying structural information A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 14 TABLE 5 Classification Accuracy (%) Comparison for Source-free Domain Adaptation Methods on the Office-Home Dataset (ResNet-50). Method DR IIE Source-only [134] Target-supervised [102] SHOT [7] BAIT [55] SHOT++ [102] A2Net [10] NRC [73] TransDA [124] G-SFDA [70] CPGA [43] AAA [66] PS [47] AaD [76] U-SFAN [136] CoWA-JMDS [137] D-MCD [56] Kundu et al. [140] BMD + SHOT++ [91] ProxyMix [51] UTR [138] FAUST [63] DAMC [57] SCLM [74] Jing et al. [65] - - (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) SA - - ST - - (cid:33) (cid:33) (cid:33) - - (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) Modules Ar → Cl Ar → Pr Ar → Rw Cl → Ar - - Mpl + Mem Miaa Mpl + Mem Miaa + Mcl Mnc Mpl + Msa Mnc + Msa Mnc + Mpl + Mcl Mpds + Mpl + Mcl Mvdg Mnc Mvdg + Mem Mvdg + Mpl Miaa + Mpl Mpl Mpl + Mem Mvdg + Mpl Mpl Mpl + Mem Miaa Mnc + Mpl Mpds Mvdg + Mpl 34.9 77.9 57.1 57.4 57.9 58.4 57.7 67.5 57.9 59.3 56.7 57.8 59.3 57.8 56.9 59.4 61.0 58.1 59.3 59.8 61.4 57.9 58.2 57.9 61.8 50.0 91.4 78.1 77.5 79.7 79.0 80.3 83.3 78.6 78.1 78.3 77.3 79.3 77.8 78.4 78.9 80.4 79.7 81.0 81.2 79.2 78.5 80.3 77.6 81.2 58.0 84.4 81.5 82.4 82.5 82.4 82.0 85.9 81.0 79.8 82.1 81.2 82.1 81.6 81.0 80.2 82.5 82.6 81.6 83.2 79.6 81.1 81.5 82.5 83.0 37.4 74.5 68.0 68.0 68.5 67.5 68.1 74.0 66.7 65.4 66.4 68.4 68.9 67.9 69.1 67.2 69.1 69.3 65.8 67.2 63.3 66.7 69.3 68.6 68.5 Cl → Pr 41.9 91.4 78.2 77.2 79.6 79.3 79.8 83.8 77.2 75.5 78.5 76.9 79.8 77.3 80.0 79.3 79.9 81.0 79.7 79.2 76.9 77.7 79.0 79.4 80.6 Cl → Rw Pr → Ar 46.2 84.4 78.1 75.1 79.3 78.9 78.6 84.4 77.2 76.4 79.4 78.1 79.5 79.2 79.9 78.6 79.5 80.7 78.1 80.1 75.2 77.9 80.7 80.6 79.4 38.5 74.5 67.4 67.1 68.5 68.0 65.3 77.0 65.6 65.7 67.6 67.8 67.2 67.2 67.7 65.3 69.1 70.8 67.0 68.4 65.3 66.5 69.0 68.4 67.8 Pr → Cl 31.2 77.9 54.9 55.5 57.0 56.2 56.4 68.0 56.0 58.0 53.5 57.3 57.4 54.7 57.2 55.6 57.8 57.6 57.5 56.4 59.4 54.3 56.8 55.6 61.5 Pr → Rw Rw → Ar 60.4 84.4 82.2 81.9 83.0 82.9 83.0 87.0 82.2 81.0 81.6 82.1 83.1 81.2 82.4 82.2 82.7 83.6 82.7 83.0 79.0 81.5 82.7 83.1 85.1 53.9 74.5 73.3 73.9 73.7 74.1 71.0 80.5 72.0 72.0 74.5 75.2 72.1 73.3 72.8 73.3 74.5 74.0 73.1 73.7 74.7 73.2 74.7 75.2 73.7 Rw → Cl 41.2 77.9 Rw → Pr Avg. 46.1 82.0 59.9 91.4 58.8 59.5 60.7 60.5 58.6 69.9 57.8 64.4 58.4 59.1 58.5 60.3 60.5 62.8 65.1 60.0 61.7 61.2 64.2 58.9 60.6 59.6 64.1 84.3 84.2 84.9 85.0 85.6 90.0 83.4 83.3 84.1 83.4 85.4 83.9 84.5 83.9 86.4 85.9 85.6 85.9 86.1 84.7 85.0 84.7 86.5 71.8 71.6 73.0 72.8 72.2 79.3 71.3 71.6 71.8 72.1 72.7 71.9 72.5 72.2 74.0 73.6 72.8 73.2 72.0 71.6 73.1 72.8 74.5 (cid:33) Kundu et al. + SHOT++ [139] (cid:33) TABLE 6 Classification Accuracy (%) Comparison for Source-free Domain Adaptation Methods on the VisDA-C Dataset (ResNet-101). Method DR IIE Source-only [134] Target-supervised [102] SHOT [7] 3C-GAN [41] BAIT [55] Hou et al. [141] SHOT++ [102] Kim et al. [87] A2Net [10] NRC [73] G-SFDA [70] ASL [135] TransDA [124] CPGA [43] AAA [66] VDM-DA [35] PS [47] AaD [76] U-SFAN [136] HCL+SHOT [122] CoWA-JMDS [137] NEL [94] CDCL [90] D-MCD [56] Kundu et al. [140] BMD + SHOT++ [91] ProxyMix [51] UTR [138] FAUST [63] DAMC [57] SCLM [74] - - (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) Kundu et al. + SHOT++ [139] (cid:33) - - SA - - ST - - (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) (cid:33) Modules plane bcycl - - Mpl + Mem Miaa Miaa Mist + Mem Mpl + Mem Mpl Miaa + Mcl Mnc Mnc + Msa Mpl + Mem Mpl + Msa Mnc + Mpl + Mcl Mpds + Mpl + Mcl Mvdg + Mem Mvdg Mnc Mvdg + Mem Mpl + Mcl Mvdg + Mpl Mpl Mpl + Mcl Miaa + Mpl Mpl Mpl + Mem Mvdg + Mpl Mpl Mpl + Mem Miaa Mnc + Mpl Mvdg + Mpl 55.1 97.0 94.3 95.7 - - 97.7 86.9 94.0 96.8 96.1 97.3 97.2 95.6 94.4 96.9 95.3 97.4 - 93.3 96.2 94.5 97.3 97.0 - 96.9 95.4 98.0 96.7 95.4 97.1 - 53.3 86.6 88.5 78.0 - - 88.4 81.7 87.8 91.3 88.3 85.3 91.1 89.0 85.9 89.1 86.2 90.5 - 85.4 89.7 60.8 90.5 88.0 - 87.8 81.7 92.9 77.6 86.9 90.7 - bus 61.9 84.3 80.1 69.0 - - 90.2 84.6 85.6 82.4 85.5 86.9 81.0 75.4 74.9 79.1 82.3 80.8 - 80.7 83.9 92.3 83.2 90.0 - 90.1 87.2 88.3 87.6 87.2 85.6 - car 59.1 88.7 57.3 74.2 - - 86.3 63.9 66.8 62.4 74.1 70.7 57.5 64.9 60.2 66.5 61.6 76.2 - 68.5 73.8 87.3 59.9 81.5 - 91.3 79.9 78.0 73.3 79.7 62.0 - horse knife mcycl person plant sktbrd train truck Avg. 80.6 96.3 93.1 94.6 - - 97.9 93.1 93.7 96.2 97.1 96.4 95.3 91.7 96.0 95.7 93.3 97.3 - 91.0 96.4 87.3 96.4 95.6 - 97.8 95.6 97.8 95.5 94.6 97.3 - 17.9 94.4 94.9 93.0 - - 98.6 91.4 95.1 95.9 95.4 72.8 93.3 97.5 93.5 96.8 95.7 96.1 - 88.1 97.4 93.2 98.4 98.0 - 97.8 96.8 97.7 95.4 95.7 94.6 - 79.7 92.0 80.7 88.0 - - 92.9 86.6 85.8 86.1 89.5 93.0 82.7 89.7 87.8 85.4 86.7 89.8 - 86.0 89.3 87.6 91.5 86.2 - 90.6 92.1 91.1 92.9 91.2 81.8 - 31.2 89.4 80.3 87.2 - - 84.1 71.9 81.2 80.6 79.4 80.1 67.2 83.8 80.8 83.3 80.4 82.9 - 78.6 86.8 91.1 85.6 88.7 - 84.4 85.1 84.7 83.6 84.9 84.3 - 81.0 95.5 91.5 92.2 - - 97.1 84.5 91.6 94.8 95.4 95.5 92.0 93.9 90.2 96.0 91.6 95.5 - 86.6 94.6 56.9 96.0 94.6 - 96.9 93.4 95.5 95.3 95.7 93.6 - 26.5 91.8 89.1 88.8 - - 92.2 58.2 88.2 94.1 92.9 78.1 91.8 93.4 92.0 86.6 90.9 93.0 - 88.8 92.1 83.4 95.8 92.7 - 94.3 90.3 91.4 89.5 91.5 92.8 - 73.5 90.7 86.3 85.1 - - 93.6 74.5 86.5 90.4 89.1 87.7 92.5 87.7 86.6 89.5 86.0 92.0 - 80.0 88.7 93.7 92.0 83.7 - 90.9 89.1 91.2 87.7 81.9 88.0 - 8.5 68.7 58.2 54.3 - - 28.8 42.7 56.0 68.2 42.6 50.3 54.7 69.0 68.3 56.3 59.5 64.7 - 74.7 53.8 86.6 63.8 53.1 - 45.9 42.2 41.1 46.9 41.7 55.9 - 52.4 89.6 82.9 83.3 83.0 63.5 87.3 76.7 84.3 85.9 85.4 82.8 83.0 86.0 84.2 85.1 84.1 88.0 82.7 83.5 86.9 84.2 87.5 87.5 88.2 88.7 85.7 87.3 85.2 86.0 85.3 87.8 in clipart images. Besides, AaD [76] achieves the second highest classification accuracy of 88% on VisDA using only one loss function, which can be used as a simple but strong baseline. Self-attention is promising, especially transformer- based SFDA methods. Although the self-attention-based SFDA methods are less used in image classification [70], [124] and mostly seen in semantic segmentation [11], [112], [129], the transformer-based method TransDA [124] achieves the highest accuracy of 79.3% on the Office-Home dataset, which is 4.8% higher than the second highest method [139]. This somewhat suggests that encouraging models to turn their attention to the object region may be quite effective for reducing domain shift. However, TransDA [124] merely injects the transformer into the con- volutional network, and it may be an interesting topic to see how the transformer can be better combined with the SFDA setting. 6 APPLICATION Domain adaptation aims to reduce the cost of labeling target domain data, while source-free domain adaptation goes a step further to preserve the privacy of source domain data. Therefore, source-free domain adaptation and unsupervised A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 15 domain adaptation methods [5], [6], [29] are highly over- lapped in their application areas. Currently, most of SFDA methods are applied in the field of computer vision and natural language processing. Specifically, the classification tasks dominate the research of SFDA, which largely outpaces the growth of SFDA on other computer vision tasks. Below we discuss where the research landscape of SFDA can be potentially extended. 6.1 Computer Vision 7.1 Enrichment of weak research lines Most SFDA methods focus on image classification, which is the fundamental task in computer vision. With the popu- larity of large-scale datasets like VisDA [130] and Domain- Net [142], the demand of the adaptation capability also increases. Image classification can also extend to various application scenarios such as real-world image dehazing [143], cross-scene hyperspectral image classification [144], and blind image quality assessment [114]. Semantic seg- mentation methods [11], [12], [50], [100], [129], [145], [146] have also emerged rapidly and have been widely used, including multi-organ segmentation [113], cross-modal seg- mentation [147], [148], cross-device [100], cross-central do- main segmentation [85], multi-site and lifespan brain skull stripping [77], and road segmentation [98], [149]. Others applications include object detection [13], [14], [62], person re-identification [150], and video analysis [88], [144] can also benefit from SFDA. 6.2 Natural Language Processing The application of source-free domain adaption in natural language processing (NLP) is still relatively limited. Related settings and studies in NLP include continuous learning [151], [152] and generalization capabilities of pre-trained models [153]. Laparra et al. designed the SemEval 2021 Task 10 dataset [154] on two tasks, i.e., negation detection and time expression recognition. Su et al. [33] extended self- training [155], active learning [156] and data augmentation [157] baselines to the source-free setting for systematic com- parison. 6.3 Other Related Problems Domain generalization (DG) [158], [159], which makes the model work on previously unseen target domains, can be seen as a relevant setting for domain adaptation, and some source-free DG methods [160], [161] have also emerged, which can be seen as a variant of the data-based SFDA approach. Source-free zero-shot domain adaptation [162], [163] is proposed to alleviate the requirement for streaming data with small batch size and class distribution in test-time domain adaptation [164]. Ondrej [128] et al. investigated feedforward source-free domain adaption, which is back propagation-free, to further protect user privacy as well as reduce overhead. There are also methods that combine source-free domain adaptation setting with federated learn- ing [149], black box test [165], or robust transfer [166] to meet different practical scenarios. Although we have discussed numerous SFDA methods in this paper, most of them focus on pseudo-labeling. With the categorization in Fig. 2, some kinds of methods are still less explored, such as perturbed domain supervision, neigh- borhood clustering, self-attention especially transformer- based self-attention mechanisms. Contrastive learning [167] and image style translation [168] are still constructed in a relatively homogeneous and simple way, and it is worth introducing some of the latest methods [169], [170] in their respective fields. In addition, entropy minimization, although widely used in SFDA, is mostly used directly as an auxiliary loss in the form of entropy loss or information loss, lacking further innovation. In general, SFDA still has abundant room for enrichment in terms of the methodology. 7.2 Further theoretical support Ben-David et al. [15] derived a general UDA theory that upper-bounds the expected target error based on the distri- bution divergence of source and target domains, the error of the model on the source domain and the ideal joint error. However, the domain divergence is hard to measure in the source-free setting. Most current SFDA methods are motivated by intuition and achieve empirical success on current datasets. Liang et al. [7] suggested information maximization as a means of achieving deterministic and decentralized outputs. While there have been SFDA the- oretical analyses centered on pseudo-labeling [56], multi- source domains [30], [31], and model smoothness [171], these approaches are only suitable for particular methods. Therefore, theoretical support that is universally applicable to SFDA is highly beneficial. 7.3 More Applications Regarding computer vision tasks, most of the current SFDA methods focus on image analysis, while video data con- tains significantly more spatial and temporal semantic in- formation, which presents greater processing challenges. Consequently, there are only a few methods specifically designed for video analysis. Furthermore, unsupervised domain adaptation has found numerous applications in natural language processing [172], [173], [174], time-series data analysis [175], [176], recommendation systems [177], [178], and geosciences [179], [180]. However, these appli- cations have not yet been extended to source-free settings, indicating that SFDA may realize its potential in these areas. 7 FUTURE RESEARCH DIRECTION Despite the rapid growth of research on source-free domain adaptation and the resulting evolution on methodology and performance, the problem settings and targets studied in SFDA are still somewhat limited and homogeneous. 7.4 Comprehensive datasets and evaluation The majority of datasets currently used for SFDA evaluation have balanced categories and clean data, however, some SFDA research has highlighted the significant impact of unbalanced categories [99] and noise [166] on model ac- curacy. Additionally, some existing datasets are limited in A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 16 size and no longer present sufficient challenges to assess the capabilities of modern domain adaptation methods. For example, the W to D task on the Office-31 classification dataset [131] has already reached an accuracy of 100%. Thus, more diverse and challenging datasets are necessary for advancing SFDA research. Furthermore, a more compre- hensive evaluation scheme, including model robustness and overhead, would provide a more complete understanding of model characteristics and improve the applicability of SFDA in various scenarios, such as edge devices. 7.5 Extended settings This survey mainly covers the single-source closed-set set- ting of source-free domain adaptation, which is also the most extensively studied case. Nevertheless, as illustrated in Fig. 3, domain adaptation can be categorized into partial DA, open-set DA, multi-source DA, and multi-task DA, based on the relationship between the source and target domains. Furthermore, depending on various practical sit- uations, the SFDA setting can be combined with test-time DA [164], federated DA [181], and active DA [182]. In the future, SFDA research is expected to become more diverse as researchers explore different settings and scenarios. 8 CONCLUSION Unsupervised Domain adaptation, a crucial subset of trans- fer learning, facilitates the transfer of knowledge acquired from one labeled domain to another unlabeled domain, thereby reducing the need for extensive annotation of neu- ral networks. The source-free setting, which lacks access to source domain data, satisfies privacy and security re- quirements in real-world scenarios and has rapidly gained attention since its emergence. In this paper, we provide a comprehensive overview of existing source-free adaptation methods and present a unified categorization framework. We analyze the experimental outcomes of more than 30 representative SFDA methods on the three most popular datasets, namely Office-31, Office-home, and VisDA, and modularize each method to facilitate comparisons. Lastly, based on our analysis and the current state of SFDA re- search, we suggest potential research directions that could benefit this community. REFERENCES [1] [2] [3] D. N. Perkins and G. Salomon, "Transfer of learning: Contri- bution to the international encyclopedia of education, oxford, england," Pergamon Press. Retrieved December, vol. 31, p. 2009, 1992. S. J. Pan and Q. Yang, "A survey on transfer learning," IEEE Transactions on knowledge and data engineering, vol. 22, no. 10, pp. 1345–1359, 2009. J. Li, E. Chen, Z. Ding, L. Zhu, K. Lu, and H. T. Shen, "Maximum density divergence for domain adaptation," IEEE transactions on pattern analysis and machine intelligence, vol. 43, no. 11, pp. 3918– 3930, 2020. [4] M. Jing, L. Meng, J. Li, L. Zhu, and H. T. Shen, "Adversarial mixup ratio confusion for unsupervised domain adaptation," IEEE Transactions on Multimedia, 2022. G. Wilson and D. J. Cook, "A survey of unsupervised deep domain adaptation," ACM Transactions on Intelligent Systems and Technology (TIST), vol. 11, no. 5, pp. 1–46, 2020. [5] [8] [6] [7] X. Liu, C. Yoo, F. Xing, H. Oh, G. El Fakhri, J.-W. Kang, J. Woo et al., "Deep unsupervised domain adaptation: a review of recent advances and perspectives," APSIPA Transactions on Signal and Information Processing, vol. 11, no. 1, 2022. J. Liang, D. Hu, and J. Feng, "Do we really need to access the source data? source hypothesis transfer for unsupervised do- main adaptation," in International Conference on Machine Learning. PMLR, 2020, pp. 6028–6039. B. Chidlovskii, S. Clinchant, and G. Csurka, "Domain adaptation in the absence of source domain data," in Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016, pp. 451–460. J. N. Kundu, N. Venkat, R. V. Babu et al., "Universal source-free domain adaptation," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020, pp. 4544–4553. [10] H. Xia, H. Zhao, and Z. Ding, "Adaptive adversarial network for source-free domain adaptation," in Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021, pp. 9010–9019. [9] [11] Y. Liu, W. Zhang, and J. Wang, "Source-free domain adaptation for semantic segmentation," in Proceedings of the IEEE/CVF Con- ference on Computer Vision and Pattern Recognition, 2021, pp. 1215– 1224. [12] M. Bateson, H. Kervadec, J. Dolz, H. Lombaert, and I. B. Ayed, "Source-free domain adaptation for image segmentation," Medi- cal Image Analysis, vol. 82, p. 102617, 2022. [13] L. Xiong, M. Ye, D. Zhang, Y. Gan, and Y. Liu, "Source data-free domain adaptation for a faster r-cnn," Pattern Recognition, vol. 124, p. 108436, 2022. [14] C. Saltori, S. Lathuili ́ere, N. Sebe, E. Ricci, and F. Galasso, "Sf-uda 3d: Source-free unsupervised domain adaptation for lidar-based 3d object detection," in 2020 International Conference on 3D Vision (3DV). S. Ben-David, J. Blitzer, K. Crammer, A. Kulesza, F. Pereira, and J. W. Vaughan, "A theory of learning from different domains," Machine learning, vol. 79, no. 1, pp. 151–175, 2010. IEEE, 2020, pp. 771–780. [15] [16] M. Long, H. Zhu, J. Wang, and M. I. Jordan, "Unsupervised domain adaptation with residual transfer networks," Advances in neural information processing systems, vol. 29, 2016. [18] [17] M. Long, Y. Cao, J. Wang, and M. Jordan, "Learning transferable features with deep adaptation networks," in International confer- ence on machine learning. PMLR, 2015, pp. 97–105. S. Cui, S. Wang, J. Zhuo, L. Li, Q. Huang, and Q. Tian, "Towards discriminability and diversity: Batch nuclear-norm maximization under label insufficient situations," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020, pp. 3941–3950. [19] Y. Ganin and V. Lempitsky, "Unsupervised domain adaptation by backpropagation," in International conference on machine learning. PMLR, 2015, pp. 1180–1189. [20] M. Long, Z. Cao, J. Wang, and M. I. Jordan, "Conditional adversarial domain adaptation," Advances in neural information processing systems, vol. 31, 2018. [21] E. Tzeng, J. Hoffman, K. Saenko, and T. Darrell, "Adversarial discriminative domain adaptation," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2017, pp. 7167–7176. [22] F. Zhuang, Z. Qi, K. Duan, D. Xi, Y. Zhu, H. Zhu, H. Xiong, and Q. He, "A comprehensive survey on transfer learning," Proceedings of the IEEE, vol. 109, no. 1, pp. 43–76, 2020. J. Huang, F. Nie, and H. Huang, "A new simplex sparse learning model to measure data similarity for clustering," in Twenty-fourth international joint conference on artificial intelligence, 2015. [23] [24] X. Li, H. Zhang, R. Zhang, Y. Liu, and F. Nie, "Generalized uncorrelated regression with adaptive graph for unsupervised feature selection," IEEE transactions on neural networks and learning systems, vol. 30, no. 5, pp. 1587–1595, 2018. [25] E.-H. S. Han, G. Karypis, and V. Kumar, "Text categorization us- ing weight adjusted k-nearest neighbor classification," in Pacific- asia conference on knowledge discovery and data mining. Springer, 2001, pp. 53–65. [26] K. Saito, D. Kim, S. Sclaroff, T. Darrell, and K. Saenko, "Semi- supervised domain adaptation via minimax entropy," in Proceed- ings of the IEEE/CVF International Conference on Computer Vision, 2019, pp. 8050–8058. [27] A. Kumar, A. Saha, and H. Daume, "Co-regularization based semi-supervised domain adaptation," Advances in neural informa- tion processing systems, vol. 23, 2010. A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 17 [28] L. Li and Z. Zhang, "Semi-supervised domain adaptation by covariance matching," IEEE transactions on pattern analysis and machine intelligence, vol. 41, no. 11, pp. 2724–2739, 2018. [29] M. Wang and W. Deng, "Deep visual domain adaptation: A [30] [31] survey," Neurocomputing, vol. 312, pp. 135–153, 2018. J. Dong, Z. Fang, A. Liu, G. Sun, and T. Liu, "Confident anchor- induced multi-source free domain adaptation," Advances in Neu- ral Information Processing Systems, vol. 34, pp. 2848–2860, 2021. S. M. Ahmed, D. S. Raychaudhuri, S. Paul, S. Oymak, and A. K. Roy-Chowdhury, "Unsupervised multi-source domain adapta- tion without access to source data," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2021, pp. 10 103–10 112. [32] F. Wang, Z. Han, Z. Zhang, and Y. Yin, "Active source free domain adaptation," arXiv preprint arXiv:2205.10711, 2022. [33] X. Su, Y. Zhao, and S. Bethard, "A comparison of strategies for source-free domain adaptation," in Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2022, pp. 8352–8367. [34] O. Day and T. M. Khoshgoftaar, "A survey on heterogeneous transfer learning," Journal of Big Data, vol. 4, no. 1, pp. 1–42, 2017. J. Tian, J. Zhang, W. Li, and D. Xu, "Vdm-da: Virtual domain modeling for source data-free domain adaptation," IEEE Transac- tions on Circuits and Systems for Video Technology, 2021. [35] [36] A. Gretton, K. Borgwardt, M. Rasch, B. Sch ̈olkopf, and A. Smola, "A kernel method for the two-sample-problem," Advances in neural information processing systems, vol. 19, 2006. [38] [37] Q. Tian, C. Ma, F.-Y. Zhang, S. Peng, and H. Xue, "Source-free unsupervised domain adaptation with sample transport learn- ing," Journal of Computer Science and Technology, vol. 36, no. 3, pp. 606–616, 2021. I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde- Farley, S. Ozair, A. Courville, and Y. Bengio, "Generative adver- sarial networks," Communications of the ACM, vol. 63, no. 11, pp. 139–144, 2020. J. Hoffman, E. Tzeng, T. Park, J.-Y. Zhu, P. Isola, K. Saenko, A. Efros, and T. Darrell, "Cycada: Cycle-consistent adversarial domain adaptation," in International conference on machine learn- ing. Pmlr, 2018, pp. 1989–1998. [39] [40] M.-Y. Liu and O. Tuzel, "Coupled generative adversarial net- works," Advances in neural information processing systems, vol. 29, 2016. [41] R. Li, Q. Jiao, W. Cao, H.-S. Wong, and S. Wu, "Model adaptation: Unsupervised domain adaptation without source data," in Pro- ceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020, pp. 9641–9650. [42] V. K. Kurmi, V. K. Subramanian, and V. P. Namboodiri, "Domain impression: A source data free domain adaptation method," in Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 2021, pp. 615–625. [43] Z. Qiu, Y. Zhang, H. Lin, S. Niu, Y. Liu, Q. Du, and M. Tan, "Source-free domain adaptation via avatar prototype generation and adaptation," arXiv preprint arXiv:2106.15326, 2021. [44] A. v. d. Oord, Y. Li, and O. Vinyals, "Representation learning with contrastive predictive coding," arXiv preprint arXiv:1807.03748, 2018. [45] H. Yin, P. Molchanov, J. M. Alvarez, Z. Li, A. Mallya, D. Hoiem, N. K. Jha, and J. Kautz, "Dreaming to distill: Data-free knowl- edge transfer via deepinversion," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020, pp. 8715–8724. [46] H.-W. Yeh, B. Yang, P. C. Yuen, and T. Harada, "Sofa: Source-data- free feature alignment for unsupervised domain adaptation," in Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 2021, pp. 474–483. [47] Y. Du, H. Yang, M. Chen, J. Jiang, H. Luo, and C. Wang, "Gen- eration, augmentation, and alignment: A pseudo-source domain based method for source-free domain adaptation," arXiv preprint arXiv:2109.04015, 2021. [48] H. Zhang, M. Cisse, Y. N. Dauphin, and D. Lopez-Paz, "mixup: Beyond empirical risk minimization," arXiv preprint arXiv:1710.09412, 2017. [49] N. Ma, J. Bu, Z. Zhang, and S. Zhou, "Uncertainty-guided mixup for semi-supervised domain adaptation without source data," arXiv preprint arXiv:2107.06707, 2021. [50] M. Ye, J. Zhang, J. Ouyang, and D. Yuan, "Source data-free unsupervised domain adaptation for semantic segmentation," in Proceedings of the 29th ACM International Conference on Multimedia, 2021, pp. 2233–2242. [51] Y. Ding, L. Sheng, J. Liang, A. Zheng, and R. He, "Proxymix: Proxy-based mixup training with label refinery for source-free domain adaptation," arXiv preprint arXiv:2205.14566, 2022. [52] K. Saito, K. Watanabe, Y. Ushiku, and T. Harada, "Maximum classifier discrepancy for unsupervised domain adaptation," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2018, pp. 3723–3732. [53] C.-Y. Lee, T. Batra, M. H. Baig, and D. Ulbricht, "Sliced wasser- stein discrepancy for unsupervised domain adaptation," in Pro- ceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019, pp. 10 285–10 295. [54] Z. Yu, J. Li, L. Zhu, K. Lu, and H. T. Shen, "Classification certainty maximization for unsupervised domain adaptation," IEEE Transactions on Circuits and Systems for Video Technology, 2023. S. Yang, Y. Wang, J. van de Weijer, L. Herranz, and S. Jui, "Casting a bait for offline and online source-free domain adaptation," arXiv preprint arXiv:2010.12427, 2020. [55] [56] T. Chu, Y. Liu, J. Deng, W. Li, and L. Duan, "Denoised maximum classifier discrepancy for sourcefree unsupervised domain adap- tation," in Thirty-Sixth AAAI Conference on Artificial Intelligence (AAAI-22), vol. 2, 2022. [58] [59] [57] Z. Zong, J. He, L. Zhang, and H. Huan, "Domain gap estimation for source free unsupervised domain adaptation with many classifiers," arXiv preprint arXiv:2207.05785, 2022. S. Li, F. Lv, B. Xie, C. H. Liu, J. Liang, and C. Qin, "Bi-classifier de- terminacy maximization for unsupervised domain adaptation." in AAAI, vol. 2, 2021, p. 5. J. Hoffman, S. Gupta, J. Leong, S. Guadarrama, and T. Darrell, "Cross-modal adaptation for rgb-d detection," in 2016 IEEE in- ternational conference on robotics and automation (ICRA). IEEE, 2016, pp. 5032–5039. S. Li, M. Xie, K. Gong, C. H. Liu, Y. Wang, and W. Li, "Trans- ferable semantic augmentation for domain adaptation," in Pro- ceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2021, pp. 11 516–11 525. [60] [61] L. Xiong, M. Ye, D. Zhang, Y. Gan, X. Li, and Y. Zhu, "Source data-free domain adaptation of object detector through domain- specific perturbation," International Journal of Intelligent Systems, vol. 36, no. 8, pp. 3746–3766, 2021. [62] D. Zhang, M. Ye, L. Xiong, S. Li, and X. Li, "Source-style trans- ferred mean teacher for source-data free object detection," in ACM Multimedia Asia, 2021, pp. 1–8. J. Lee and G. Lee, "Feature alignment by uncertainty and self- training for source-free unsupervised domain adaptation," arXiv preprint arXiv:2208.14888, 2022. [63] [64] A. Kendall and Y. Gal, "What uncertainties do we need in bayesian deep learning for computer vision?" Advances in neural information processing systems, vol. 30, 2017. [65] M. Jing, X. Zhen, J. Li, and C. G. Snoek, "Variational model perturbation for source-free domain adaptation," arXiv preprint arXiv:2210.10378, 2022. J. Li, Z. Du, L. Zhu, Z. Ding, K. Lu, and H. T. Shen, "Divergence- agnostic unsupervised domain adaptation by adversarial at- tacks," IEEE Transactions on Pattern Analysis and Machine Intelli- gence, 2021. [66] [67] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Good- fellow, and R. Fergus, "Intriguing properties of neural networks," arXiv preprint arXiv:1312.6199, 2013. [68] L. A. Gatys, A. S. Ecker, and M. Bethge, "Image style transfer using convolutional neural networks," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 2414–2423. [69] X. Chen, S. Wang, M. Long, and J. Wang, "Transferability vs. discriminability: Batch spectral penalization for adversarial do- main adaptation," in International conference on machine learning. PMLR, 2019, pp. 1081–1090. S. Yang, Y. Wang, J. van de Weijer, L. Herranz, and S. Jui, "Generalized source-free domain adaptation," in Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021, pp. 8978–8987. [70] [71] K. Ghasedi Dizaji, A. Herandi, C. Deng, W. Cai, and H. Huang, "Deep clustering via joint convolutional autoencoder embedding and relative entropy minimization," in Proceedings of the IEEE international conference on computer vision, 2017, pp. 5736–5745. A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 18 [73] [72] Y. Shi and F. Sha, "Information-theoretical learning of discrimina- tive clusters for unsupervised domain adaptation," arXiv preprint arXiv:1206.6438, 2012. S. Yang, J. van de Weijer, L. Herranz, S. Jui et al., "Exploiting the intrinsic neighborhood structure for source-free domain adapta- tion," Advances in Neural Information Processing Systems, vol. 34, pp. 29 393–29 405, 2021. S. Tang, Y. Zou, Z. Song, J. Lyu, L. Chen, M. Ye, S. Zhong, and J. Zhang, "Semantic consistency learning on manifold for source data-free unsupervised domain adaptation," Neural Networks, 2022. [74] [75] L. Tian, L. Zhou, H. Zhang, Z. Wang, and M. Ye, "Robust self- [76] supervised learning for source-free domain adaptation," 2022. S. Yang, Y. Wang, K. Wang, S. Jui et al., "Attracting and dispers- ing: A simple approach for source-free domain adaptation," in Advances in Neural Information Processing Systems, 2022. [77] X. Li, Z. Du, J. Li, L. Zhu, and K. Lu, "Source-free active domain adaptation via energy-based locality preserving transfer," in Pro- ceedings of the 30th ACM International Conference on Multimedia, 2022, pp. 5802–5810. [78] A. Iscen, G. Tolias, Y. Avrithis, and O. Chum, "Label propa- gation for deep semi-supervised learning," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019, pp. 5070–5079. [79] N. Ma, J. Bu, L. Lu, J. Wen, Z. Zhang, S. Zhou, and X. Yan, "Semi- supervised hypothesis transfer for source-free domain adapta- tion," arXiv preprint arXiv:2107.06735, 2021. [80] F. Luan, S. Paris, E. Shechtman, and K. Bala, "Deep photo style transfer," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2017, pp. 4990–4998. J. Johnson, A. Alahi, and L. Fei-Fei, "Perceptual losses for real- time style transfer and super-resolution," in European conference on computer vision. Springer, 2016, pp. 694–711. [81] [82] X. Huang and S. Belongie, "Arbitrary style transfer in real-time with adaptive instance normalization," in Proceedings of the IEEE international conference on computer vision, 2017, pp. 1501–1510. S. Ioffe and C. Szegedy, "Batch normalization: Accelerating deep network training by reducing internal covariate shift," in Interna- tional conference on machine learning. PMLR, 2015, pp. 448–456. [83] [84] Y. Zhao, Z. Zhong, Z. Luo, G. H. Lee, and N. Sebe, "Source-free open compound domain adaptation in semantic segmentation," IEEE Transactions on Circuits and Systems for Video Technology, vol. 32, no. 10, pp. 7019–7032, 2022. [85] Y. Ye, Z. Liu, Y. Zhang, J. Li, and H. Shen, "Alleviating style sensitivity then adapting: Source-free domain adaptation for medical image segmentation," in Proceedings of the 30th ACM International Conference on Multimedia, 2022, pp. 1935–1944. [86] M. Ishii and M. Sugiyama, "Source-free domain adaptation via distributional alignment by matching batch normalization statis- tics," arXiv preprint arXiv:2101.10842, 2021. [87] Y. Kim, D. Cho, K. Han, P. Panda, and S. Hong, "Domain adaptation without source data," IEEE Transactions on Artificial Intelligence, vol. 2, no. 6, pp. 508–518, 2021. [88] Y. Huang, X. Yang, J. Zhang, and C. Xu, "Relative alignment net- work for source-free multimodal video domain adaptation," in Proceedings of the 30th ACM International Conference on Multimedia, 2022, pp. 1652–1660. [89] B. Xie, L. Yuan, S. Li, C. H. Liu, X. Cheng, and G. Wang, "Active learning for domain adaptation: An energy-based approach," in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 36, no. 8, 2022, pp. 8708–8716. [90] R. Wang, Z. Wu, Z. Weng, J. Chen, G.-J. Qi, and Y.-G. Jiang, "Cross-domain contrastive learning for unsupervised domain adaptation," IEEE Transactions on Multimedia, 2022. S. Qu, G. Chen, J. Zhang, Z. Li, W. He, and D. Tao, "Bmd: A gen- eral class-balanced multicentric dynamic prototype strategy for source-free domain adaptation," arXiv preprint arXiv:2204.02811, 2022. [91] [92] P. Chen and A. J. Ma, "Source-free temporal attentive domain adaptation for video action recognition," in Proceedings of the 2022 International Conference on Multimedia Retrieval, 2022, pp. 489–497. [93] M. Caron, P. Bojanowski, A. Joulin, and M. Douze, "Deep cluster- ing for unsupervised learning of visual features," in Proceedings of the European conference on computer vision (ECCV), 2018, pp. 132– 149. [94] W. Ahmed, P. Morerio, and V. Murino, "Cleaning noisy labels by negative ensemble learning for source-free unsupervised domain adaptation," in Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 2022, pp. 1616–1625. [95] M. Shen, Y. Bu, and G. Wornell, "On the benefits of selectivity in pseudo-labeling for unsupervised multi-source-free domain adaptation," arXiv preprint arXiv:2202.00796, 2022. [96] T. G. Dietterich, R. H. Lathrop, and T. Lozano-P ́erez, "Solving the multiple instance problem with axis-parallel rectangles," Artificial intelligence, vol. 89, no. 1-2, pp. 31–71, 1997. [97] W. Li and N. Vasconcelos, "Multiple instance learning for soft bags via top instances," in Proceedings of the ieee conference on computer vision and pattern recognition, 2015, pp. 4277–4285. [98] F. You, J. Li, L. Zhu, Z. Chen, and Z. Huang, "Domain adaptive semantic segmentation without source data," in Proceedings of the 29th ACM International Conference on Multimedia, 2021, pp. 3293– 3302. [99] X. Li, J. Li, L. Zhu, G. Wang, and Z. Huang, "Imbalanced source-free domain adaptation," in Proceedings of the 29th ACM International Conference on Multimedia, 2021, pp. 3330–3339. [100] C.-Y. Yang, Y.-J. Kuo, and C.-T. Hsu, "Source free domain adap- tation for semantic segmentation via distribution transfer and adaptive class-balanced self-training," in 2022 IEEE International Conference on Multimedia and Expo (ICME). IEEE, 2022, pp. 1–6. [101] W. Chen, L. Lin, S. Yang, D. Xie, S. Pu, Y. Zhuang, and W. Ren, "Self-supervised noisy label learning for source-free unsuper- vised domain adaptation," arXiv preprint arXiv:2102.11614, 2021. [102] J. Liang, D. Hu, Y. Wang, R. He, and J. Feng, "Source data-absent unsupervised domain adaptation through hypothesis transfer and labeling transfer," IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021. [103] D. Arpit, S. Jastrzebski, N. Ballas, D. Krueger, E. Bengio, M. S. Kanwal, T. Maharaj, A. Fischer, A. Courville, Y. Bengio et al., "A closer look at memorization in deep networks," in International conference on machine learning. PMLR, 2017, pp. 233–242. [104] D. Berthelot, N. Carlini, I. Goodfellow, N. Papernot, A. Oliver, and C. A. Raffel, "Mixmatch: A holistic approach to semi- supervised learning," Advances in neural information processing systems, vol. 32, 2019. [105] N. C. Garcia, S. A. Bargal, V. Ablavsky, P. Morerio, V. Murino, and S. Sclaroff, "Distillation multiple choice learning for multi- modal action recognition," in Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 2021, pp. 2755–2764. [106] X. Dong, Z. Yu, W. Cao, Y. Shi, and Q. Ma, "A survey on ensemble learning," Frontiers of Computer Science, vol. 14, no. 2, pp. 241–258, 2020. [107] Y. Grandvalet and Y. Bengio, "Semi-supervised learning by en- tropy minimization," Advances in neural information processing systems, vol. 17, 2004. [108] H. Jain, J. Zepeda, P. P ́erez, and R. Gribonval, "Subic: A super- vised, structured binary code for image search," in Proceedings of the IEEE international conference on computer vision, 2017, pp. 833–842. [109] J. T. Springenberg, "Unsupervised and semi-supervised learning with categorical generative adversarial networks," arXiv preprint arXiv:1511.06390, 2015. [110] H. Jeon, S. Lee, and U. Kang, "Unsupervised multi-source do- main adaptation with no observable source data," Plos one, vol. 16, no. 7, p. e0253415, 2021. [111] H. Mao, L. Du, Y. Zheng, Q. Fu, Z. Li, X. Chen, H. Shi, and D. Zhang, "Source free unsupervised graph domain adaptation," arXiv preprint arXiv:2112.00955, 2021. [112] D. Kothandaraman, R. Chandra, and D. Manocha, "Ss-sfda: Self- supervised source-free domain adaptation for road segmentation in hazardous environments," in Proceedings of the IEEE/CVF Inter- national Conference on Computer Vision, 2021, pp. 3049–3059. [113] J. Hong, Y.-D. Zhang, and W. Chen, "Source-free unsupervised domain adaptation for cross-modality abdominal multi-organ segmentation," Knowledge-Based Systems, p. 109155, 2022. [114] J. Liu, X. Li, S. An, and Z. Chen, "Source-free unsupervised domain adaptation for blind image quality assessment," arXiv preprint arXiv:2207.08124, 2022. [115] A. Krause, P. Perona, and R. Gomes, "Discriminative clustering by regularized information maximization," Advances in neural information processing systems, vol. 23, 2010. [116] M. Jabi, M. Pedersoli, A. Mitiche, and I. B. Ayed, "Deep cluster- ing: On the link between discriminative models and k-means," IEEE transactions on pattern analysis and machine intelligence, vol. 43, no. 6, pp. 1887–1896, 2019. A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 19 [117] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick, "Momentum contrast for unsupervised visual representation learning," in Pro- ceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2020, pp. 9729–9738. [118] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, "A simple framework for contrastive learning of visual representations," in International conference on machine learning. PMLR, 2020, pp. 1597–1607. [119] Z. Wu, Y. Xiong, S. X. Yu, and D. Lin, "Unsupervised feature learning via non-parametric instance discrimination," in Proceed- ings of the IEEE conference on computer vision and pattern recognition, 2018, pp. 3733–3742. [120] Y. Tian, D. Krishnan, and P. Isola, "Contrastive multiview coding," in Computer Vision–ECCV 2020: 16th European Confer- ence, Glasgow, UK, August 23–28, 2020, Proceedings, Part XI 16. Springer, 2020, pp. 776–794. [121] M. Ye, X. Zhang, P. C. Yuen, and S.-F. Chang, "Unsupervised em- bedding learning via invariant and spreading instance feature," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019, pp. 6210–6219. [122] J. Huang, D. Guan, A. Xiao, and S. Lu, "Model adaptation: His- torical contrastive learning for unsupervised domain adaptation without source data," Advances in Neural Information Processing Systems, vol. 34, pp. 3635–3649, 2021. [123] X. Zhao, R. Stanislawski, P. Gardoni, M. Sulowicz, A. Glowacz, G. Krolczyk, and Z. Li, "Adaptive contrastive learning with label consistency for source data free unsupervised domain adapta- tion," Sensors, vol. 22, no. 11, p. 4238, 2022. [124] G. Yang, H. Tang, Z. Zhong, M. Ding, L. Shao, N. Sebe, and E. Ricci, "Transformer-based source-free domain adaptation," arXiv preprint arXiv:2105.14138, 2021. [125] 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, vol. 30, 2017. [126] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly et al., "An image is worth 16x16 words: Transformers for image recognition at scale," arXiv preprint arXiv:2010.11929, 2020. [127] T. Xu, W. Chen, P. Wang, F. Wang, H. Li, and R. Jin, "Cd- trans: Cross-domain transformer for unsupervised domain adap- tation," arXiv preprint arXiv:2109.06165, 2021. [128] O. Bohdal, D. Li, S. X. Hu, and T. Hospedales, "Feed-forward source-free latent domain adaptation via cross-attention," arXiv preprint arXiv:2207.07624, 2022. [129] D. Kothandaraman, S. Shekhar, A. Sancheti, M. Ghuhan, T. Shukla, and D. Manocha, "Salad: Source-free active label- agnostic domain adaptation for classification, segmentation and detection," in Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 2023, pp. 382–391. [130] X. Peng, B. Usman, N. Kaushik, J. Hoffman, D. Wang, and K. Saenko, "Visda: The visual domain adaptation challenge," arXiv preprint arXiv:1710.06924, 2017. [131] K. Saenko, B. Kulis, M. Fritz, and T. Darrell, "Adapting visual category models to new domains," in Computer Vision–ECCV 2010: 11th European Conference on Computer Vision, Heraklion, Crete, Greece, September 5-11, 2010, Proceedings, Part IV 11. Springer, 2010, pp. 213–226. [132] H. Venkateswara, J. Eusebio, S. Chakraborty, and S. Pan- chanathan, "Deep hashing network for unsupervised domain adaptation," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2017, pp. 5018–5027. [133] X. Peng, Q. Bai, X. Xia, Z. Huang, K. Saenko, and B. Wang, "Moment matching for multi-source domain adaptation," in Pro- ceedings of the IEEE/CVF international conference on computer vision, 2019, pp. 1406–1415. [134] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 770–778. [135] H. Yan, Y. Guo, and C. Yang, "Augmented self-labeling for source-free unsupervised domain adaptation," in NeurIPS 2021 Workshop on Distribution Shifts: Connecting Methods and Applica- tions, 2021. [136] S. Roy, M. Trapp, A. Pilzer, J. Kannala, N. Sebe, E. Ricci, and A. Solin, "Uncertainty-guided source-free domain adaptation," in Computer Vision–ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23–27, 2022, Proceedings, Part XXV. Springer, 2022, pp. 537–555. [137] J. Lee, D. Jung, J. Yim, and S. Yoon, "Confidence score for source- free unsupervised domain adaptation," in International Conference on Machine Learning. PMLR, 2022, pp. 12 365–12 377. [138] J. Pei, Z. Jiang, A. Men, L. Chen, Y. Liu, and Q. Chen, for transferability "Uncertainty-induced source-free unsupervised domain adaptation," arXiv preprint arXiv:2208.13986, 2022. representation [139] J. N. Kundu, A. R. Kulkarni, S. Bhambri, D. Mehta, S. A. Kulkarni, V. Jampani, and V. B. Radhakrishnan, "Balancing discriminability and transferability for source-free domain adaptation," in Inter- national Conference on Machine Learning. PMLR, 2022, pp. 11 710– 11 728. [140] J. N. Kundu, S. Bhambri, A. Kulkarni, H. Sarkar, V. Jampani, and R. V. Babu, "Concurrent subsidiary supervision for unsupervised source-free domain adaptation," in Computer Vision–ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23–27, 2022, Proceedings, Part XXX. Springer, 2022, pp. 177–194. [141] Y. Hou and L. Zheng, "Source free domain adaptation with image translation," arXiv preprint arXiv:2008.07514, 2020. [142] A. Leventidis, L. Di Rocco, W. Gatterbauer, R. J. Miller, and M. Riedewald, "Domainnet: Homograph detection for data lake disambiguation," arXiv preprint arXiv:2103.09940, 2021. [143] H. Yu, J. Huang, Y. Liu, Q. Zhu, M. Zhou, and F. Zhao, "Source- free domain adaptation for real-world image dehazing," in Pro- ceedings of the 30th ACM International Conference on Multimedia, 2022, pp. 6645–6654. [144] Z. Xu, W. Wei, L. Zhang, and J. Nie, "Source-free domain adaptation for cross-scene hyperspectral image classification," in IGARSS 2022-2022 IEEE International Geoscience and Remote Sensing Symposium. IEEE, 2022, pp. 3576–3579. [145] V. Prabhu, S. Khare, D. Kartik, and J. Hoffman, "Augco: source- augmentation consistency-guided self-training for free domain adaptive semantic segmentation," arXiv preprint arXiv:2107.10140, 2021. [146] M. Bateson, H. Kervadec, J. Dolz, H. Lombaert, and I. Ben Ayed, "Source-relaxed domain adaptation for image segmentation," in International Conference on Medical Image Computing and Computer- Assisted Intervention. Springer, 2020, pp. 490–499. [147] X. Liu, F. Xing, G. El Fakhri, and J. Woo, "Memory consistent unsupervised off-the-shelf model adaptation for source-relaxed medical image segmentation," Medical Image Analysis, vol. 83, p. 102641, 2023. [148] S. Kondo, "Source-free unsupervised domain adaptation with norm and shape constraints for medical image segmentation," arXiv preprint arXiv:2209.01300, 2022. [149] D. Shenaj, E. Fan`ı, M. Toldo, D. Caldarola, A. Tavera, U. Michieli, M. Ciccone, P. Zanuttigh, and B. Caputo, "Learning across do- mains and devices: Style-driven source-free domain adaptation in clustered federated learning," in Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 2023, pp. 444– 454. [150] Y. Ding, Z. Duan, and S. Li, "Source-free unsupervised multi- source domain adaptation via proxy task for person re- identification," The Visual Computer, pp. 1–12, 2022. [151] C. de Masson D'Autume, S. Ruder, L. Kong, and D. Yogatama, "Episodic memory in lifelong language learning," Advances in Neural Information Processing Systems, vol. 32, 2019. [152] R. Sahoo, D. Shanmugam, and J. Guttag, "Unsupervised do- main adaptation in the absence of source data," arXiv preprint arXiv:2007.10233, 2020. [153] D. Hendrycks, X. Liu, E. Wallace, A. Dziedzic, R. Krishnan, and D. Song, "Pretrained transformers improve out-of-distribution robustness," arXiv preprint arXiv:2004.06100, 2020. [154] E. Laparra, X. Su, Y. Zhao, ̈O. Uzuner, T. A. Miller, and S. Bethard, "Semeval-2021 task 10: source-free domain adaptation for se- mantic processing." Association for Computational Linguistics (ACL), 2021. [155] D. Yarowsky, "Unsupervised word sense disambiguation rivaling supervised methods," in 33rd annual meeting of the association for computational linguistics, 1995, pp. 189–196. [156] X. Su, Y. Zhao, and S. Bethard, "The university of arizona at semeval-2021 task 10: Applying self-training, active learning and data augmentation to source-free domain adaptation," in Pro- ceedings of the 15th International Workshop on Semantic Evaluation (SemEval-2021), 2021, pp. 458–466. [157] Z. Miao, Y. Li, X. Wang, and W.-C. Tan, "Snippext: Semi- A COMPREHENSIVE SURVEY ON SOURCE-FREE DOMAIN ADAPTATION 20 supervised opinion mining with augmented data," in Proceedings of The Web Conference 2020, 2020, pp. 617–628. ings of the 31st ACM International Conference on Information & Knowledge Management, 2022, pp. 1808–1817. [179] B. Lucas, C. Pelletier, D. Schmidt, G. I. Webb, and F. Petitjean, "Unsupervised domain adaptation techniques for classification of satellite image time series," in IGARSS 2020-2020 IEEE Interna- tional Geoscience and Remote Sensing Symposium. IEEE, 2020, pp. 1074–1077. [180] M. Q. Nasim, T. Maiti, A. Srivastava, T. Singh, and J. Mei, "Seismic facies analysis: a deep domain adaptation approach," IEEE Transactions on Geoscience and Remote Sensing, vol. 60, pp. 1–16, 2022. [181] X. Peng, Z. Huang, Y. Zhu, and K. Saenko, "Federated adversarial domain adaptation," arXiv preprint arXiv:1911.02054, 2019. [182] J.-C. Su, Y.-H. Tsai, K. Sohn, B. Liu, S. Maji, and M. Chandraker, "Active adversarial domain adaptation," in Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 2020, pp. 739–748. [158] K. Zhou, Z. Liu, Y. Qiao, T. Xiang, and C. C. Loy, "Domain gen- eralization in vision: A survey," arXiv preprint arXiv:2103.02503, 2021. [159] K. Muandet, D. Balduzzi, and B. Sch ̈olkopf, "Domain gener- alization via invariant feature representation," in International conference on machine learning. PMLR, 2013, pp. 10–18. [160] H. Niu, H. Li, F. Zhao, and B. Li, "Domain-unified prompt repre- sentations for source-free domain generalization," arXiv preprint arXiv:2209.14926, 2022. [161] A. Frikha, H. Chen, D. Krompass, T. Runkler, and V. Tresp, "Towards data-free domain generalization," arXiv preprint arXiv:2110.04545, 2021. [162] M. Yazdanpanah and P. Moradi, "Visual domain bridge: A source-free domain adaptation for cross-domain few-shot learn- ing," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022, pp. 2868–2877. [163] W. Zhang, L. Shen, C.-S. Foo, and W. Zhang, "Source-free few- shot domain adaptation." [164] T. Varsavsky, M. Orbes-Arteaga, C. H. Sudre, M. S. Graham, P. Nachev, and M. J. Cardoso, "Test-time unsupervised domain adaptation," in Medical Image Computing and Computer Assisted Intervention–MICCAI 2020: 23rd International Conference, Lima, Peru, October 4–8, 2020, Proceedings, Part I 23. Springer, 2020, pp. 428–436. [165] Q. Peng, Z. Ding, L. Lyu, L. Sun, and C. Chen, "Toward better target representation for source-free and black-box domain adap- tation," arXiv preprint arXiv:2208.10531, 2022. [166] P. Agarwal, D. P. Paudel, J.-N. Zaech, and L. Van Gool, "Un- supervised robust domain adaptation without source data," in Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 2022, pp. 2009–2018. [167] P. Khosla, P. Teterwak, C. Wang, A. Sarna, Y. Tian, P. Isola, A. Maschinot, C. Liu, and D. Krishnan, "Supervised con- trastive learning," Advances in neural information processing sys- tems, vol. 33, pp. 18 661–18 673, 2020. [168] X. Huang, M.-Y. Liu, S. Belongie, and J. Kautz, "Multimodal unsupervised image-to-image translation," in Proceedings of the European conference on computer vision (ECCV), 2018, pp. 172–189. [169] F. Zhan, Y. Yu, R. Wu, J. Zhang, K. Cui, A. Xiao, S. Lu, and C. Miao, "Bi-level feature alignment for versatile image trans- lation and manipulation," in Computer Vision–ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23–27, 2022, Proceed- ings, Part XVI. Springer, 2022, pp. 224–241. [170] C.-H. Yeh, C.-Y. Hong, Y.-C. Hsu, T.-L. Liu, Y. Chen, and Y. Le- Cun, "Decoupled contrastive learning," in Computer Vision–ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23–27, 2022, Proceedings, Part XXVI. Springer, 2022, pp. 668–684. [171] W. Li, M. Cao, and S. Chen, "Jacobian norm for unsupervised source-free domain adaptation," arXiv preprint arXiv:2204.03467, 2022. [172] G. Rotman and R. Reichart, "Deep contextualized self-training for low resource dependency parsing," Transactions of the Association for Computational Linguistics, vol. 7, pp. 695–713, 2019. [173] S. Desai, B. Sinno, A. Rosenfeld, and J. J. Li, "Adaptive ensem- bling: Unsupervised domain adaptation for political document analysis," arXiv preprint arXiv:1910.12698, 2019. [174] G. Rocha and H. L. Cardoso, "A comparative analysis of un- supervised language adaptation methods," in Proceedings of the 2nd Workshop on Deep Learning Approaches for Low-Resource NLP (DeepLo 2019), 2019, pp. 11–21. [175] L. Shen, J. Li, J. Liu, L. Zhu, and H. T. Shen, "Temperature adap- tive transfer network for cross-domain state-of-charge estimation of li-ion batteries," IEEE Transactions on Power Electronics, vol. 38, no. 3, pp. 3857–3869, 2022. [176] K. Wu, J. Li, L. Zuo, K. Lu, and H. T. Shen, "Weighted adversarial domain adaptation for machine remaining useful life prediction," IEEE Transactions on Instrumentation and Measurement, vol. 71, pp. 1–11, 2022. [177] X. Zhang, J. Li, H. Su, L. Zhu, and H. T. Shen, "Multi-level attention-based domain disentanglement for bidirectional cross- domain recommendation," ACM Transactions on Information Sys- tems. [178] H. Su, Y. Zhang, X. Yang, H. Hua, S. Wang, and J. Li, "Cross- domain recommendation via adversarial adaptation," in Proceed-
http://arxiv.org/abs/2302.11799v2
2023-03-15T14:31:56
2023-02-23T06:25:51
FiTs: Fine-grained Two-stage Training for Knowledge-aware Question Answering
Knowledge-aware question answering (KAQA) requires the model to answer questions over a knowledge base, which is essential for both open-domain QA and domain-specific QA, especially when language models alone cannot provide all the knowledge needed. Despite the promising result of recent KAQA systems which tend to integrate linguistic knowledge from pre-trained language models (PLM) and factual knowledge from knowledge graphs (KG) to answer complex questions, a bottleneck exists in effectively fusing the representations from PLMs and KGs because of (i) the semantic and distributional gaps between them, and (ii) the difficulties in joint reasoning over the provided knowledge from both modalities. To address the above two problems, we propose a Fine-grained Two-stage training framework (FiTs) to boost the KAQA system performance: The first stage aims at aligning representations from the PLM and the KG, thus bridging the modality gaps between them, named knowledge adaptive post-training. The second stage, called knowledge-aware fine-tuning, aims to improve the model's joint reasoning ability based on the aligned representations. In detail, we fine-tune the post-trained model via two auxiliary self-supervised tasks in addition to the QA supervision. Extensive experiments demonstrate that our approach achieves state-of-the-art performance on three benchmarks in the commonsense reasoning (i.e., CommonsenseQA, OpenbookQA) and medical question answering (i.e., MedQA-USMILE) domains.
[ "Qichen Ye", "Bowen Cao", "Nuo Chen", "Weiyuan Xu", "Yuexian Zou" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11799v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11799v2", "@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.LG" ]
FiTs: Fine-grained Two-stage Training for Knowledge-aware Question Answering Bowen Cao1*,Qichen Ye1*, Nuo Chen3,4, Weiyuan Xu1, Yuexian Zou1,2† 1ADSPLAB, School of ECE, Peking University, Shenzhen, China, 2Peng Cheng Laboratory, Shenzhen, China 3Hong Kong University of Science and Technology (Guangzhou), 4Hong Kong University of Science and Technology (cid:8)yeeeqichen, zouyx(cid:9)@pku.edu.cn, (cid:8)cbw2021, xuwy(cid:9)@stu.pku.edu.cn, [email protected] 3 2 0 2 r a M 5 1 ] L C . s c [ 2 v 9 9 7 1 1 . 2 0 3 2 : v i X r a Abstract Knowledge-aware question answering (KAQA) requires the model to answer questions over a knowledge base, which is essential for both open-domain QA and domain-specific QA, especially when language models alone cannot provide all the knowledge needed. Despite the promising result of re- cent KAQA systems which tend to integrate linguistic knowl- edge from pre-trained language models (PLM) and factual knowledge from knowledge graphs (KG) to answer complex questions, a bottleneck exists in effectively fusing the repre- sentations from PLMs and KGs because of (i) the semantic and distributional gaps between them, and (ii) the difficul- ties in joint reasoning over the provided knowledge from both modalities. To address the above two problems, we propose a Fine-grained Two-stage training framework (FiTs) to boost the KAQA system performance: The first stage aims at align- ing representations from the PLM and the KG, thus bridg- ing the modality gaps between them, named knowledge adap- tive post-training. The second stage, called knowledge-aware fine-tuning, aims to improve the model's joint reasoning abil- ity based on the aligned representations. In detail, we fine- tune the post-trained model via two auxiliary self-supervised tasks in addition to the QA supervision. Extensive experi- ments demonstrate that our approach achieves state-of-the-art performance on three benchmarks in the commonsense rea- soning (i.e., CommonsenseQA, OpenbookQA) and medical question answering (i.e., MedQA-USMILE) domains. Introduction Recent advances in large pre-trained language models (PLM) have demonstrated distinguishable applicability in various tasks. (Chen et al. 2021; Cheng et al. 2022; Jin et al. 2022; Cao et al. 2022; Li et al. 2023). However, em- pirical studies show that PLMs may struggle when dealing with examples that are distributionally different from the pre-training and fine-tuning corpora (Kassner and Sch ̈utze 2020). This shortcoming limits their performance in the open domain question answering (QA) task that requires a wide range of factual knowledge. More recently, some works (Mihaylov and Frank 2018; Feng et al. 2020) focus on the knowledge-aware question answering (KAQA) task *These authors contributed equally. †Corresponding author. Copyright © 2023, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. Figure 1: (a) An example of the knowledge-aware QA task from CommonsenseQA. (b) The Pearson correlation coef- ficient of representations for the same/different entity from LM and GNN, which represents the semantic consistency between the two modalities (+1: positive correlation; -1: negative correlation; 0: no linear dependency). (c) PCA vi- sualization of the distributions of entity representations from the untuned GreaseLM (integrating RoBERTa-Large and GAT), and the corresponding post-trained GreaseLM. The latter serves as a better starting point for fine-tuning. (cf. Figure 1(a)), which allows access to external knowledge bases, especially knowledge graphs (KG), because KGs cap- ture a broad coverage of factual knowledge explicitly using triplets that encode the relationships between entities. Tak- ing advantage of both PLMs and KGs, these systems achieve remarkable results for tasks requiring open domain knowl- edge and structured reasoning (Lin et al. 2019; Feng et al. 2020; Yasunaga et al. 2021). The overwhelming majority of state-of-the-art KAQA methods can be classified into two categories: semantic parsing-based (SP-based) methods (Luo et al. 2018; Sun et al. 2020) and information retrieval-based (IR-based) methods (Chen et al. 2019; Zhang et al. 2022). This paper mainly focuses on the latter which follows a two-stage pro- cedure: (i) retrieving relevant knowledge from KGs under the information conveyed in the question; and then (ii) fus- ing the retrieved knowledge and the contextualized repre- sentations captured by PLMs to perform joint reasoning. However, IR-based KAQA models inevitably suffer from two problems: (1) Modality Gaps. There exist two intrin- sic differences between two modalities, i.e., the semantic QuestionIf it is not used for hair, a round brushis an example of what?Candidate Answers [A] hair brush [B] ladies bathroom [C] art supplies[D] shower [E] hair salonround brushhairart supplypaintingUsedForUsedForRelatedToAtLocationAtLocation(a)(b)-0.0056-0.00380.09130.0027-0.0500.050.1Pearson's runtuned GreaseLMpost-trained GreaseLM(c)untuned GreaseLMpost-trained GreaseLMSemantic gapDistributional gapKnowledge Basehair brushPearson′srsame entitydifferent entity gap and distributional gap. On one hand, as shown in Fig- ure 1(b), the weak dependency between representations of the same entity (e.g., "round brush" in the QA context and in the knowledge base in Figure 1(a)) from the untuned GreaseLM (Zhang et al. 2022) suggests the semantic gap between the two modalities. On the other hand, we find that both the representations of the LM and the GNN are re- stricted to narrow cones with different shapes and apart from each other (which is consistent with the empirical findings of Liang et al. (2022)), indicating the distributional gap; (2) Difficulties in Joint Reasoning, which cause the problem in training the model to answer questions over the provided two sources of knowledge. We further discuss it in section Knowledge-aware Fine-tuning. To address the above two problems, we propose a Fine- grained Two-stage training framework (FiTs), including post-training and fine-tuning stages (cf. Figure 2). In the first stage, we present a simple but effective post-training method with the knowledge adaptive (KA) objective that aligns the representations from PLMs and KGs. As shown in Figure 1(b), the semantic consistency between represen- tations of the same entity is greatly improved after post- training; Figure 1(c) shows that the distributions of the two modalities are adapted to each other. They demonstrate that both the semantic and the distributional gaps are alleviated, leading to a better starting point for fine-tuning. In the sec- ond stage, our motivation is to train the model to efficiently and effectively reason with both sources of knowledge. To this end, we develop two auxiliary self-supervised learning objectives-(i) knowledge source distinction (KSD): we let the model distinguish whether a retrieved entity is related to the question, related to the answer, or an irrelevant entity to improve model's ability in knowledge understanding; and (ii) knowledge backbone regularization (KBR): we impose a regularization term on the retrieved KG knowledge triplets to enhance the joint reasoning ability of the model-in ad- dition to the supervision signal to perform fine-tuning. Experimental results on three benchmarks (i.e., Common- senseQA, OpenbookQA, and MedQA-USMILE) demon- strate that FiTs boost the model performance for multiple choice question answering, a typical task in KAQA. Specif- ically, our model achieves an absolute improvement in ac- curacy by 2.6%, 1.8%, and 0.6% on the above three bench- marks, respectively, with only 1% additional trainable pa- rameters, suggesting the effectiveness and the domain gen- erality of the proposed method1. Related Work Current KAQA methods can be categorized into two groups: IR-based approaches and SP-based approaches. SP-based methods (Kapanipathi et al. 2020) reason over KGs with logic forms generated by conducting syntactic and semantic analysis on the question. Since the quality of the logic form is highly dependent on the parsing module which converts unstructured text into structured representa- tions, complex questions with compositional semantics in- crease the difficulties in linguistic analysis, leading to a bot- 1The code can be found at https://github.com/yeeeqichen/FiTs Figure 2: The pipelines of previous methods and our two- stage training framework for KAQA tasks. tleneck in performance improvement. Meanwhile, manually annotating logic forms is costly and labor-intensive, which poses another limitation. IR-based KAQA systems typically consist of the mod- ules of KG retrieval and joint reasoning. For KG retrieval, we follow the procedure from Yasunaga et al. (2021) to retrieve relevant KG attributes. To perform joint reasoning over PLMs and the retrieved KG sub-graphs, the most crit- ical challenge is that models have to fuse the semantically and distributionally different knowledge encoded in PLMs and KGs. Some works separately capture language repre- sentations and graph representations with two-tower models (Wang et al. 2019). They suffer from the above issue due to a lack of interactions between the two modalities. Other works take one modality as auxiliary knowledge to ground the other, such as (i) exploiting the textual representation to augment a graph reasoning model (Lv et al. 2020), and (ii) augmenting the language representation of a QA example with the encoded graph knowledge (Lin et al. 2019; Yang et al. 2019). As for these methods, the information flows one way between the two modalities, which still limits the knowledge interaction. More recently, GreaseLM mixes the multi-modal repre- sentations in the intermediate layers of the LM and the GNN to enable two-way interactions between both modalities. However, GreaseLM neglects to adapt the primary represen- tations of PLMs and KGs to each other, thus poorly seed- ing the joint structure. In order to bridge the gaps between PLMs and KGs before joint learning, we propose a knowl- edge adaptive post-training objective, which brings a better starting point to the joint reasoning module. Simultaneously, we retain the structure of GreaseLM as our backbone model. Additionally, due to the imperfectness of the KG retrieval module, models have to reason with inadequate and noisy knowledge retrieved from KGs. Although some works eval- uate KAQA model robustness in severe settings, how to ex- plicitly improve this ability remains an open question (Gu et al. 2021). To this end, in addition to the supervision sig- nal, we design two auxiliary self-supervised fine-tuning ob- jectives to improve model performance in utilizing useful knowledge and distinguishing irrelevant knowledge. Proposed Method In this section, we will explain the problem of KAQA we are investigating and introduce the objectives for our post- training and fine-tuning methods. The pipeline of our two- Pre-trainedModelPost-trainedModelFine-tunedModelMLMKAObjectivesAuxiliary ObjectivesKSDKBRStage IStage IIPost-trainingFine-tuningInitializationPLM&GNNFine-tunedModelObjectiveQA Supervisionoursprevious methodsObjectiveQA Supervision Figure 3: An overview of the post-training process. First, we transform the question-answer pair to model input (i.e., masked context and KG sub-graph), and use the cross-modality encoder to get the fused token(node) representations hM (eM ). Then (i) the token representations corresponding to the [MASK] token are used to calculate the MLM loss, and (ii) the entity represen- tations eL for text entities and eG for KG nodes are used to calculate the knowledge adaptive (KA) loss. stage training framework is illustrated in Figure 2. Problem Formalization We mainly focus on the knowledge-aware multiple choice question answering (KAMCQA) task. Generally speaking, an MCQA-type dataset consists of examples with a context paragraph c, a question q, and a candidate answer set A, all in text format. Treating c and q as a whole, an MCQA ex- ample can be regarded as a Q-A pair. The KAMCQA task is an extension of MCQA, where an external knowledge graph G is accessible to provide auxiliary knowledge relevant to a given MCQA example. In practice, due to computational factors, a KAQA sys- tem first retrieves a sub-graph Gsub from G for each MCQA example which consists of a certain number of entities that are most relevant to that example. We follow the procedure from Yasunaga et al. (2021) to compute the relevance score between each KG entity and the MCQA example. Given an example (c, q, A) and the retrieved Gsub as input, the task is to identify which answer a ∈ A is correct. For simplicity, when computing the probability of a candidate answer being the correct answer, we refer to that answer as a. Cross-modality Encoder The cross-modality encoder extracts and fuses the informa- tion from text and KG. We use GreaseLM as the cross- modality encoder and give a brief introduction here (see more details in our supplementary material). GreaseLM em- ploys a PLM to encode the textual input (c, q, a) and a GNN model to process the Gsub, and further use a two-layer MLP to mix these representations. Specifically, the textual con- text is appended with a special interaction token and passed through N LM-based unimodal encoding layers to get the pre-encoded language representations {hint, h1, ..., hT }. Si- multaneously, an interaction node, whose representation will be used to interact with the representation of the interac- tion token, is also added to the Gsub. In each of the follow- ing M GreaseLM layers, the language representations are fed into transformer LM encoder blocks that continue to en- code textual context, and graph representations are fed into a GNN layer to perform a round of information propagation between nodes in the graph: l { ̃h int, hl { ̃el int, el 1, .., hl 1,..., el T } = LM-Enc (cid:0){hl−1 J } = GNN (cid:0){el−1 int, hl−1 T }(cid:1) 1 ,.., hl−1 J }(cid:1) 1 , ..., el−1 int , el−1 (1) (2) Then the representations of the interaction token and the in- teraction node are concatenated and passed through the MLP to get a modality-wise mixed representation: (cid:2)hl int; el int (cid:3) = MLP (cid:16)(cid:104) ̃h l int; ̃el int (cid:105)(cid:17) (3) Consequently, the cross-modality encoder ensures that in- formation propagates between both modalities. Knowledge Adaptive Post-training In fusing the representations from PLMs and KGs, two main challenges exist: (i) since PLMs and KGs are usually pre- trained on different corpora, the representations from the two modalities may be semantically contradictory, thus lead- ing to confusion in joint reasoning; and (ii) the distribution of them may be discordant, which means that even similar semantics may be embedded in an opposite direction in the latent space. In order to close the gap between both modal- ities, i.e., provide a better initialization for fine-tuning, we Question: If it is not used for hair, a round brush is an example of what? Candidate Answer: art supplies.Cross-modality Encoder[INT]If it is not [MASK] for hair, a round brush is an [MASK] of what? [SEP] art supplies. [SEP] ***************KA LossToken/NodeRepresentationsEntityRepresentationsQuestion-Answer pairPositive PairsNegative Pairs******MLM LosshINTMhTMhhairMhroundMhbrushMhartMhsuppliesMeartsupplyMeroundbrushMehairMeINTMeartsupplyGeroundbrushGehairGeartsuppliesLeroundbrushLehairLModel Input******Add special token & MaskKG retrieval & Add interaction nodepoolingpooling Figure 4: An overview of the knowledge-aware fine-tuning objectives. propose a knowledge adaptive (KA) loss in addition to the MLM (Devlin et al. 2018) loss to perform post-training. int, eL int, eG 1 , ..., eL 1 , ..., eG int, hM int, eM 1 , ..., hM 1 , ..., eM As shown in Figure 3, we get token representations HM = {hM T } and KG node representations EM = {eM K } through the cross-modality en- coder. We then obtain text entity representations EL = {eL J } by pooling over the corresponding to- i ∈ EL represents an ken representations, where each eL entity in the input Q-A pair. Meanwhile, we regard KG node representations as KG entity representations EG = J }, i.e., EG = EM , because each node in {eG the KG represents an entity. Then, we adopt a contrastive learning framework to align the inherent knowledge in EL and EG, where each pair of eL that represents the same entity constitutes a positive pair (e.g., eL art supplies and eG art supply in Figure 3) and eL is treated as a negative ex- i in EG, vice ample for entity representations other than eG j versa. Given a positive or negative pair of entity representa- tions, we concatenate them and pass the joint representation through an MLP to get the probability ˆy ∈ R that indicates whether the two entities are matched: i and eG j ˆy = W1 ReLU (cid:0)W0 (cid:2)eL i ; eG j (cid:3) + b0 (cid:1) (4) where W1 ∈ Rd, W0 ∈ Rd×d and b0 ∈ Rd are trainable parameters, d = dl + dg, dl and dg are the dimension of eL i and eG j , respectively. For each Q-A pair, we choose k positive pairs and k corre- sponding negative pairs. We use labels y = [y1, y2, ..., y2k] to distinguish positive and negative pairs, where yi = 1 if and only if the i-th one is a positive pair, otherwise yi = 0. The calculation of the KA loss is as follows: LKA = − 1 2k 2k (cid:88) i=1 (1 − yi) log (1 − ˆyi) + yi log (ˆyi) (5) Similar to BERT (Devlin et al. 2018), we randomly choose 15% tokens in the MCQA example to perform MLM. The overall post-training loss is the sum of the two losses: Lpost = LKA + LM LM (6) Knowledge-aware Fine-tuning To fully exploit the encoded knowledge in PLMs and KGs, we propose two auxiliary self-supervised learning objectives in addition to the QA supervision signal. QA Supervision We follow the procedure from Zhang et al. (2022) to formulate the fully-supervised objective: for a n-way MCQA example (c, q, A), the probability p (ai|q, c) that ai ∈ A is the correct one is computed as: int, eM p (ai | q, c) ∝ exp (cid:0)MLP (cid:0)hM int, g(cid:1)(cid:1) (7) where g is computed by attentively pooling over the KG node embeddings {eM int as query. Then we compute the cross-entropy loss: J } using hM 1 , ..., eM LSup = − n (cid:88) i=1 yi log (p (ai | q, c)) (8) where yi = 1 if ai is the correct answer, otherwise yi = 0. In the inference time, the answer is predicted by: ap = argmaxa∈A p (a | q, c) Knowledge Source Distinction In the process of KG re- trieval, entities related to the question or answer and edges connecting these entities are retrieved to form a sub-graph. Distinguishing whether a retrieved entity is related to the question or the answer is an essential aspect of knowledge understanding. For example, (9) A weasel has a thin body and short legs to easier burrow after prey in a what? (A) tree (B) mulberry bush (C) chicken coop (D) viking ship (E) rabbit warren To pick out the correct answer (E) rabbit warren, knowledge about the predator-prey relationship and the narrowness of the prey's lair is required. Under real circumstances, prepar- ing for this knowledge will introduce noise like weasels' Knowledge Source DistinctionQuestion:Ifitisnotusedforhair,aroundbrushisanexampleofwhat?Answer:artsupplies.hairhair brushround brushart supplypaintingQA pairKG EntitiesLinked to entities inthe Question?Irrelevant to the given QA?appleKnowledge Backbone Regularizationhair brushhairAtLocationround brushhairAtLocationhair brushround brushRelatedToround brushpaintingUsedForart supplypaintingUsedForKnowledge Tripletsehead+erelationetailRegularization FormRelevant but not directly linked to Q/A entities?QA SupervisionQuestion: If it is not used for hair, a round brush is an example of what?Candidate Answers:[A] hair brush [B] ladies bathroom [C] art supplies[D] shower [E] hair salonMCQA ExampleKnowledge GraphLinked to entities inthe Answer? dens are narrow. So the model has to be clear that rabbits, in the candidate answer (E), have narrow warrens, while weasel appears in the question as the predator. Otherwise, guided by the ambiguous noisy knowledge, the wrong can- didate answer (C) may be chosen. Moreover, due to the imperfectness of the KG retrieval module, suspicious entities are often introduced to Gsub, i.e., containing lots of irrelevant entities. Thus, it is important to let the model distinguish whether a retrieved entity is rel- evant to the Q-A pair. However, distinguishing whether a retrieved entity is relevant to the context is quite challenging due to lack of supervision, so we want to train the model in a heuristic way. To this end, we manually add kirr irrelevant entities to Gsub to guide the model to learn distinguishable representations for significantly irrelevant entities and grad- ually differentiate existing irrelevant entities from the others. To achieve the above two goals, given the representations ) of m + kirr entities in Gsub, EG = (eG we formulate the knowledge source distinction loss as: 2 , . . . , eG 1 , eG m+kirr LKSD = − m+kirr(cid:88) 4 (cid:88) i=1 j=1 yij log (ˆyij) (10) ˆyi = softmax (cid:0)W3 ReLU (cid:0)W2eG i + b1 (cid:1)(cid:1) (11) where W3 ∈ R4×dg , W2 ∈ Rdg×dg and b1 ∈ Rdg are trainable parameters, dg is the dimension of eG i , yi = [yi1, . . . , yi4] is the one-hot vector indicating whether the i- th KG entity is: (1) linked to entities in the question, (2) linked to entities in the candidate answer, (3) an entity in the retrieved multi-hop neighborhood but not directly linked to mentioned entities, or (4) an irrelevant entity. Knowledge Backbone Regularization The knowledge backbone regularization objective is designed to guide the model to better understand the internal relation of KG knowledge triplets < h, r, t >, where h and t are head en- tity and tail entity, respectively, r is the relationship between them. Inspired by TransE (Bordes et al. 2013), where rela- tionships are represented as translations in the embedding space, we assume that, in the latent representation space, the summation of the head entity representation eh and the re- lationship representation er should be close to the tail entity representation et as much as possible, i.e., eh + er → et. To this end, given the entity and relationship representa- tions produced by the cross-modality encoder, we introduce a regularization for the kreg knowledge triplets: LKBR = kreg (cid:88) i=1 (1 − cos (ehi + eri, eti )) (12) The overall fine-tuning loss is as follows: Lf inetune = LSup + LKSD + LKBR (13) Experimental Setups See implementation details in our supplementary material. Datasets We evaluate our proposed post-training and fine-tuning methods on three MCQA datasets: CommonsenseQA (Tal- mor et al. 2019) and OpenbookQA (Mihaylov et al. 2018) for commonsense reasoning, and MedQA-USMILE (Jin et al. 2021) as a medical QA benchmark. The CommonsenseQA dataset includes 12,102 5-way multiple-choice questions. Each question requires extra commonsense knowledge beyond the surface-level textual information given by the context. Due to the fact that the of- ficial test is hidden, our experiments are conducted using the in-house data split of Lin et al. (2019). The OpenbookQA dataset consists of 5,957 4-way multiple-choice questions elementary scientific about knowledge, along with an open book of scientific facts. We perform experiments using the official data splits of Mihaylov and Frank (2018). The MedQA-USMILE dataset includes 12,723 4-way multiple-choice questions that are originally collected from the National Medical Board Examination in the USA. These questions assess a model's ability to apply medical and clin- ical knowledge, concepts, and principles. Baselines For commonsense reasoning tasks, we include Roberta- Large (Liu et al. 2019) and several advanced knowledge graph enhanced question answering systems as baselines for comparison: (1) RGCN (Schlichtkrull et al. 2018), (2) Kag- Net (Lin et al. 2019), (3) MHGRN (Feng et al. 2020), (4) QA-GNN (Yasunaga et al. 2021), and (5) GreaseLM (Zhang et al. 2022). All of these methods, except for Roberta-Large, follow the paradigm of LM+KG. GreaseLM is the top- performing one that fuses representations from the LM and KG with modality interaction layers. For MedQA-USMILE, besides LM+KG methods, we compare with BioBERT- Large (Lee et al. 2020), a pre-trained biomedical language representation model based on BERT-Large (Devlin et al. 2018), and SapBERT (Liu et al. 2021), a state-of-the-art model for medical entity representation learning, which im- proves model's ability to capture entity relationships with the help of entity disambiguation objectives. Results and Analysis Our results in Tables 1 and 2 demonstrate consistent im- provements on the CommonsenseQA (CSQA) and Open- BookQA (OBQA) datasets. On CSQA, our model's test per- formance improves by 7.5% over RoBERTa-Large (fine- tuned LM without KG), 2.8% over LM+KG methods be- fore GreaseLM, and 2.6% over our implementation of the best prior LM+KG system, GreaseLM, on which we evalu- ate our proposed post-training and fine-tuning methods. As for the OBQA dataset, our model's test performance im- proves by 7.6% over AristoRoBERTa (finetuned LM with- out KG), 3.2% over existing LM+KG systems other than GreaseLM, and 1.8% over the GreaseLM that we have im- plemented. The boost over GreaseLM reveals the superior- ity of our proposed knowledge-adaptive post-training and Figure 5: Operations A and B are used for quantitative analysis (section ). The unprocessed MCQA example is shown in Figure 1. Q||A denotes the text obtained by merging the question Q and the candidate answer A. Model RoBERTa-Large (w/o KG)♣ RGCN (Schlichtkrull et al. 2018)♣ KagNet (Lin et al. 2019)♣ MHGRN (Feng et al. 2020)♣ QA-GNN (Yasunaga et al. 2021)♣ GreaseLM (Zhang et al. 2022)♣ GreaseLM (Our implementation) + FiTs (Ours) IHtest-Acc (%) 68.7 68.4 69.0 71.1 73.4 74.2 73.6 76.2 Table 1: Performance comparison on CommonsenseQA in- house split. We report the in-house Test (IHtest) accuracy using the data split of Lin et al. (2019), because the official test is hidden. ♣: results from Zhang et al. (2022); all other results are reproduced by ourselves. knowledge-aware fine-tuning methods in making use of the inherent knowledge from PLMs and KGs. Quantitative Analysis Empirically, both the parametric knowledge and the joint reasoning ability of the model benefit KAQA tasks (Long- pre et al. 2021). Provided the overall performance improve- ments, we investigated whether both knowledge sources make contributions or not by conducting new operations on the dataset. Originally, given an unprocessed MCQA exam- ple (where a question and candidate answers are separate), we separately merge the question and each candidate answer together and obtain KG sub-graphs based on the merged text to generate training/validation/testing data (the Origi- nal Operation in Figure 5). To evaluate the contribution of the model's joint reasoning ability, we apply operation A, where each candidate answer is replaced with the correct answer while their retrieved sub-graphs remain unchanged. This operation restricts the model to infer only based on the question and the KG sub-graph. As for the model's para- metric knowledge, we apply operation B, where each sub- graph is replaced with the one obtained based on the cor- Model AristoRoBERTa (no KG)♣ RGCN (Schlichtkrull et al. 2018)♣ MHGRN (Feng et al. 2020)♣ QA-GNN (Yasunaga et al. 2021)♣ GreaseLM (Zhang et al. 2022)♣ GreaseLM (Our implementation) + FiTs (Ours) Test-Acc (%) 78.4 74.6 80.6 82.8 84.8 84.2 86.0 Table 2: Test accuracy comparison on OpenBookQA. ♣: re- sults from Zhang et al. (2022); all other results are repro- duced by ourselves. Model GreaseLM (Zhang et al. 2022) + post-training + knowledge-aware fine-tuning + FiTs (Ours) test-reason test-param 73.4 73.9 74.2 74.5 69.0 70.9 71.2 71.6 Table 3: The test-reason set evaluates models' joint reason- ing ability, while the test-param set measures models' para- metric knowledge. rect answer while all candidate answers remain unchanged. The KG knowledge provided is equivalent and relevant to the correct answer, so the model is forced to make judg- ments based on an understanding of the relationship between a question and its candidate answers. We conduct experiments using the IHtest set of Com- monsenseQA. The new test set obtained based on operation A is named test-reasoning, test-reason for short, and that based on operation B is named test-parametric, test-param for short. The results in Table 3 demonstrate that both the proposed post-training and fine-tuning methods can signifi- cantly increase the model's parametric knowledge. In com- parison, improvements in the model's joint reasoning ability are marginal, which may be partly due to the imperfectness of the KG retrieval module, i.e., a bottleneck for reasoning. Original OperationA weasel has a thin body and short legs to easier burrow after prey in a tree. ...A weasel has a thin body and short legs to easier burrow after prey in a rabbit warren.Operation AA weasel has a thin body and short legs to easier burrow after prey in a rabbit warren...A weasel has a thin body and short legs to easier burrow after prey in a rabbit warren.Operation BA weasel has a thin body and short legs to easier burrow after prey in a tree. ...A weasel has a thin body and short legs to easier burrow after prey in a rabbit warren.RetrievedKG Sub-graphsMerged TextKG sub-graph for (Q||A)KG sub-graph for (Q||A)KG sub-graph for (Q||A)KG sub-graph for (Q||E)...KG sub-graph for (Q||A)KG sub-graph for (Q||E)...KG sub-graph for (Q||A)KG sub-graph for (Q||E)...KG sub-graph for (Q||E)KG sub-graph for (Q||E)KG sub-graph for (Q||E) Figure 6: Attention analysis of GreaseLM w/ and w/o our methods. Entities with higher attention weights are highlighted. Our model demonstrates the expected pattern by consistently focusing on the "encourage" entity. Model BioBERT-Base (Lee et al. 2020)♣ BioBERT-Large (Lee et al. 2020)♣ QA-GNN (Yasunaga et al. 2021)♣ GreaseLM (Zhang et al. 2022)♣ GreaseLM (Our implementation) + FiTs (Ours) Test-Acc (%) 34.1 36.7 38.0 38.5 38.6 39.2 Model GreaseLM (Only QA supervision) + MLM + KA + MLM + KA IHtest-Acc 73.6 74.1 74.3 74.5 Table 5: Ablation studies of the post-training objectives. Table 4: Test accuracy comparison on MedQA-USMLE. ♣: results from Zhang et al. (2022); all other results are repro- duced by ourselves. Qualitative Analysis Analyzing the attention mechanism is a crucial way to ex- amine a model's behavior. In this section, we analyze graph attention weights in the last layer of GAT (i.e., the atten- tion weight between each entity in Gsub and the context) to find out which entity the model focuses on and investi- gate whether our model demonstrates a sensible reasoning process. As the example in Figure 6 demonstrates, while GreaseLM concentrates on "play" (given the candidate an- swer [C] exercise) and "continue" (given the candidate answer [E] victory), our model shows consistent interest on "encourage", which is the core factor in clarifying the relationship between a candidate answer and "playing tennis". Intuitively, our model performs a more expected behavior of human reasoning, suggesting the success of our fine-grained two-stage training framework. Domain Generality So far, our model's performance demonstrates the effective- ness of our proposed post-training and fine-tuning methods in the commonsense reasoning domain. Here we further in- vestigate whether they are applicable in the medical domain. Following Zhang et al. (2022), we evaluate our model's per- formance on the MedQA-USMLE dataset. The results in Ta- ble 4 illustrate the generality of our methods, achieving an improvement of 0.6% over the backbone model. Figure 7: Ablation studies of the fine-tuning objectives. Post-training: Results in Table 5 suggest that both MLM and KA are helpful for improving the model's test perfor- mance, and they complement each other, bringing an im- provement by 0.9% over raw GreaseLM. Additionally, the comparison between the left and right half of Figure 7 demonstrates that our post-training method clearly benefits the subsequent fine-tuning process. Fine-tuning: The usefulness of the two self-supervised ob- jectives and the interdependence between them are demon- strated in Figure 7. Specifically, with or without post- training, (i) KSD alone can significantly improve model per- formance, but KBR alone degrades that because the model without KSD lacks discrimination on the relevance and im- portance of the external knowledge; (ii) KSD and KBR to- gether bring the best result, suggesting that these two objec- tives complement each other-KSD improves model's dis- crimination on the relevance and importance of the exter- nal knowledge; KBR acts as a commonsense-knowledge- oriented regularization to avoid task-specific overfitting. Ablation Studies We investigated the impact of each part of the post-training and fine-tuning methods through a series of ablation experi- ments using the ConmensenseQA IHtest set. Conclusion This paper introduces FiTs, a fine-grained two-stage train- ing framework for KAQA tasks, including the knowledge adaptive post-training stage (with MLM and KA objectives) 73.674.574.575.673.474.275.376.27374757677w/o Post Trainingw/ Post TrainingIHtest-AccGreaseLMw/ KSDw/ KBRw/ KSD + KBR and the knowledge-aware fine-tuning stage (with KBR and KSD objectives). Post-training alleviates the gaps between the representations from PLMs and KGs, leading to a better starting point for fine-tuning. Fine-tuned with the proposed objectives, the model is better at identifying how relevant and essential each entity in the retrieved KG sub-graph is to the given question. Experimental results on benchmarks in the commonsense reasoning and medical domains show the great improvements our method brings to the backbone model, which are further demonstrated to be reflected in both model's parametric knowledge and joint reasoning abil- ity. Our work reveals a better way to integrate knowledge from PLMs and KGs and gives insights on how to design learning objectives for KAQA tasks. Acknowledgement This paper was partially supported by Shenzhen Science & Technology Research Program (No: GXWD202012311658- 07007-20200814115301001) and NSFC (No: 62176008) References Bordes, A.; Usunier, N.; Garcia-Duran, A.; Weston, J.; and Yakhnenko, O. 2013. Translating embeddings for modeling multi-relational data. Advances in neural information pro- cessing systems, 26. Cao, M.; Yang, T.; Weng, J.; Zhang, C.; Wang, J.; and Zou, Y. 2022. LocVTP: Video-Text Pre-training for Temporal Lo- calization. In Computer Vision–ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23–27, 2022, Proceed- ings, Part XXVI, 38–56. Chen, N.; Liu, F.; You, C.; Zhou, P.; and Zou, Y. 2021. Adap- tive bi-directional attention: Exploring multi-granularity In representations for machine reading comprehension. ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 7833– 7837. IEEE. Chen, Z.-Y.; Chang, C.-H.; Chen, Y.-P.; Nayak, J.; and Ku, L.-W. 2019. UHop: An Unrestricted-Hop Relation Extrac- tion Framework for Knowledge-Based Question Answering. In Proceedings of NAACL-HLT, 345–356. Cheng, X.; Dong, Q.; Yue, F.; Ko, T.; Wang, M.; and Zou, Y. 2022. M3ST: Mix at Three Levels for Speech Translation. CoRR, abs/2212.03657. Devlin, J.; Chang, M.-W.; Lee, K.; and Toutanova, K. 2018. Bert: Pre-training of deep bidirectional transformers for lan- guage understanding. arXiv preprint arXiv:1810.04805. Feng, Y.; Chen, X.; Lin, B. Y.; Wang, P.; Yan, J.; and Ren, X. 2020. Scalable Multi-Hop Relational Reasoning for Knowledge-Aware Question Answering. In Webber, B.; Cohn, T.; He, Y.; and Liu, Y., eds., Proceedings of the 2020 Conference on Empirical Methods in Natural Lan- guage Processing, EMNLP 2020, Online, November 16-20, 2020, 1295–1309. Association for Computational Linguis- tics. Gu, Y.; Kase, S.; Vanni, M.; Sadler, B.; Liang, P.; Yan, X.; and Su, Y. 2021. Beyond IID: three levels of generalization for question answering on knowledge bases. In Proceedings of the Web Conference 2021, 3477–3488. Jin, D.; Pan, E.; Oufattole, N.; Weng, W.-H.; Fang, H.; and Szolovits, P. 2021. What disease does this patient have? a large-scale open domain question answering dataset from medical exams. Applied Sciences, 11(14): 6421. Jin, P.; Huang, J.; Liu, F.; Wu, X.; Ge, S.; Song, G.; Clifton, D. A.; and Chen, J. 2022. Expectation-Maximization Con- trastive Learning for Compact Video-and-Language Repre- sentations. In Thirty-Sixth Conference on Neural Informa- tion Processing Systems. Kapanipathi, P.; Abdelaziz, I.; Ravishankar, S.; Roukos, S.; Gray, A.; Astudillo, R.; Chang, M.; Cornelio, C.; Dana, S.; Fokoue, A.; et al. 2020. Question answering over knowledge bases by leveraging semantic parsing and neuro-symbolic reasoning. arXiv preprint arXiv:2012.01707. Kassner, N.; and Sch ̈utze, H. 2020. Negated and Misprimed Probes for Pretrained Language Models: Birds Can Talk, But Cannot Fly. In Proceedings of the 58th Annual Meet- ing of the Association for Computational Linguistics, 7811– 7818. Lee, J.; Yoon, W.; Kim, S.; Kim, D.; Kim, S.; So, C. H.; and Kang, J. 2020. BioBERT: a pre-trained biomedical language representation model for biomedical text mining. Bioinfor- matics, 36(4): 1234–1240. Li, H.; Cao, M.; Cheng, X.; Zhu, Z.; Li, Y.; and Zou, Y. 2023. Generating Templated Caption for Video Grounding. CoRR, abs/2301.05997. Liang, W.; Zhang, Y.; Kwon, Y.; Yeung, S.; and Zou, J. 2022. Mind the gap: Understanding the modality gap in multi- modal contrastive representation learning. arXiv preprint arXiv:2203.02053. Lin, B. Y.; Chen, X.; Chen, J.; and Ren, X. 2019. KagNet: Knowledge-Aware Graph Networks for Commonsense Rea- soning. In Inui, K.; Jiang, J.; Ng, V.; and Wan, X., eds., Proceedings of the 2019 Conference on Empirical Meth- ods in Natural Language Processing and the 9th Interna- tional Joint Conference on Natural Language Processing, EMNLP-IJCNLP 2019, Hong Kong, China, November 3-7, 2019, 2829–2839. Association for Computational Linguis- tics. Liu, F.; Shareghi, E.; Meng, Z.; Basaldella, M.; and Collier, N. 2021. Self-Alignment Pretraining for Biomedical Entity Representations. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Compu- tational Linguistics: Human Language Technologies, 4228– 4238. Liu, Y.; Ott, M.; Goyal, N.; Du, J.; Joshi, M.; Chen, D.; Levy, O.; Lewis, M.; Zettlemoyer, L.; and Stoyanov, V. 2019. RoBERTa: A Robustly Optimized BERT Pretraining Approach. CoRR, abs/1907.11692. Longpre, S.; Perisetla, K.; Chen, A.; Ramesh, N.; DuBois, C.; and Singh, S. 2021. Entity-Based Knowledge Conflicts in Question Answering. In Proceedings of the 2021 Confer- ence on Empirical Methods in Natural Language Process- ing, 7052–7063. Yasunaga, M.; Ren, H.; Bosselut, A.; Liang, P.; and Leskovec, J. 2021. QA-GNN: Reasoning with Language Models and Knowledge Graphs for Question Answering. In Toutanova, K.; Rumshisky, A.; Zettlemoyer, L.; Hakkani- T ̈ur, D.; Beltagy, I.; Bethard, S.; Cotterell, R.; Chakraborty, T.; and Zhou, Y., eds., Proceedings of the 2021 Confer- ence of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2021, Online, June 6-11, 2021, 535–546. As- sociation for Computational Linguistics. Zhang, X.; Bosselut, A.; Yasunaga, M.; Ren, H.; Liang, P.; Manning, C. D.; and Leskovec, J. 2022. GreaseLM: Graph REASoning Enhanced Language Models for Question An- swering. CoRR, abs/2201.08860. Luo, K.; Lin, F.; Luo, X.; and Zhu, K. 2018. Knowledge base question answering via encoding of complex query graphs. In Proceedings of the 2018 Conference on Empirical Meth- ods in Natural Language Processing, 2185–2194. Lv, S.; Guo, D.; Xu, J.; Tang, D.; Duan, N.; Gong, M.; Shou, L.; Jiang, D.; Cao, G.; and Hu, S. 2020. Graph-based rea- soning over heterogeneous external knowledge for common- sense question answering. In Proceedings of the AAAI Con- ference on Artificial Intelligence, volume 34, 8449–8456. Mihaylov, T.; Clark, P.; Khot, T.; and Sabharwal, A. 2018. Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answering. In Riloff, E.; Chi- ang, D.; Hockenmaier, J.; and Tsujii, J., eds., Proceedings of the 2018 Conference on Empirical Methods in Natu- ral Language Processing, Brussels, Belgium, October 31 - November 4, 2018, 2381–2391. Association for Computa- tional Linguistics. Mihaylov, T.; and Frank, A. 2018. Knowledgeable Reader: Enhancing Cloze-Style Reading Comprehension with Exter- nal Commonsense Knowledge. In Gurevych, I.; and Miyao, Y., eds., Proceedings of the 56th Annual Meeting of the As- sociation for Computational Linguistics, ACL 2018, Mel- bourne, Australia, July 15-20, 2018, Volume 1: Long Papers, 821–832. Association for Computational Linguistics. Schlichtkrull, M. S.; Kipf, T. N.; Bloem, P.; van den Berg, R.; Titov, I.; and Welling, M. 2018. Modeling Relational Data with Graph Convolutional Networks. In Gangemi, A.; Navigli, R.; Vidal, M.; Hitzler, P.; Troncy, R.; Hollink, L.; Tordai, A.; and Alam, M., eds., The Semantic Web - 15th International Conference, ESWC 2018, Heraklion, Crete, Greece, June 3-7, 2018, Proceedings, volume 10843 of Lec- ture Notes in Computer Science, 593–607. Springer. Sun, Y.; Zhang, L.; Cheng, G.; and Qu, Y. 2020. SPARQA: skeleton-based semantic parsing for complex questions over knowledge bases. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, 8952–8959. Talmor, A.; Herzig, J.; Lourie, N.; and Berant, J. 2019. Com- monsenseQA: A Question Answering Challenge Targeting Commonsense Knowledge. In Burstein, J.; Doran, C.; and Solorio, T., eds., Proceedings of the 2019 Conference of the North American Chapter of the Association for Computa- tional Linguistics: Human Language Technologies, NAACL- HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Vol- ume 1 (Long and Short Papers), 4149–4158. Association for Computational Linguistics. Wang, X.; Kapanipathi, P.; Musa, R.; Yu, M.; Talamadupula, K.; Abdelaziz, I.; Chang, M.; Fokoue, A.; Makni, B.; Mattei, N.; et al. 2019. Improving natural language inference using external knowledge in the science questions domain. In Pro- ceedings of the AAAI Conference on Artificial Intelligence, volume 33, 7208–7215. Yang, A.; Wang, Q.; Liu, J.; Liu, K.; Lyu, Y.; Wu, H.; She, Q.; and Li, S. 2019. Enhancing pre-trained language rep- resentations with rich knowledge for machine reading com- prehension. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, 2346–2357.
http://arxiv.org/abs/2302.11795v1
2023-02-23T06:16:15
2023-02-23T06:16:15
Bridging Synthetic and Real Images: a Transferable and Multiple Consistency aided Fundus Image Enhancement Framework
Deep learning based image enhancement models have largely improved the readability of fundus images in order to decrease the uncertainty of clinical observations and the risk of misdiagnosis. However, due to the difficulty of acquiring paired real fundus images at different qualities, most existing methods have to adopt synthetic image pairs as training data. The domain shift between the synthetic and the real images inevitably hinders the generalization of such models on clinical data. In this work, we propose an end-to-end optimized teacher-student framework to simultaneously conduct image enhancement and domain adaptation. The student network uses synthetic pairs for supervised enhancement, and regularizes the enhancement model to reduce domain-shift by enforcing teacher-student prediction consistency on the real fundus images without relying on enhanced ground-truth. Moreover, we also propose a novel multi-stage multi-attention guided enhancement network (MAGE-Net) as the backbones of our teacher and student network. Our MAGE-Net utilizes multi-stage enhancement module and retinal structure preservation module to progressively integrate the multi-scale features and simultaneously preserve the retinal structures for better fundus image quality enhancement. Comprehensive experiments on both real and synthetic datasets demonstrate that our framework outperforms the baseline approaches. Moreover, our method also benefits the downstream clinical tasks.
[ "Erjian Guo", "Huazhu Fu", "Luping Zhou", "Dong Xu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11795v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11795v1", "@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" ]
IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2020 1 Bridging Synthetic and Real Images: a Transferable and Multiple Consistency aided Fundus Image Enhancement Framework Erjian Guo, Huazhu Fu, Senior Member, IEEE, Luping Zhou, Senior Member, IEEE, and Dong Xu, Fellow, IEEE 3 2 0 2 b e F 3 2 ] V I . s s e e [ 1 v 5 9 7 1 1 . 2 0 3 2 : v i X r a Abstract- Deep learning based image enhancement models have largely improved the readability of fundus images in order to decrease the uncertainty of clinical observations and the risk of misdiagnosis. However, due to the difficulty of acquiring paired real fundus images at different qualities, most existing methods have to adopt synthetic image pairs as training data. The domain shift between the synthetic and the real images inevitably hin- ders the generalization of such models on clinical data. In this work, we propose an end-to-end optimized teacher- student framework to simultaneously conduct image en- hancement and domain adaptation. The student network uses synthetic pairs for supervised enhancement, and reg- ularizes the enhancement model to reduce domain-shift by enforcing teacher-student prediction consistency on the real fundus images without relying on enhanced ground- truth. Moreover, we also propose a novel multi-stage multi- attention guided enhancement network (MAGE-Net) as the backbones of our teacher and student network. Our MAGE- Net utilizes multi-stage enhancement module and retinal structure preservation module to progressively integrate the multi-scale features and simultaneously preserve the retinal structures for better fundus image quality enhance- ment. Comprehensive experiments on both real and syn- thetic datasets demonstrate that our framework outper- forms the baseline approaches. Moreover, our method also benefits the downstream clinical tasks. Index Terms- Fundus image, teacher-student model, im- age enhancement I. INTRODUCTION R ETINAL images are widely used by ophthalmologists or automated image analyzing systems as a non-invasive way to detect and monitor various eye and body diseases [1], This work is partially supported by the Huazhu Fu's Agency for Science, Technology and Research (A*STAR) Central Research Fund, and Advanced Manufacturing and Engineering (AME) Programmatic Fund (A20H4b0141). L. Zhou is supported by DP200103223 funded by Australian Research Council (ARC). This work was supported by the funding from The Hong Kong Jockey Club Charities Trust (No.2022- 0174), and the startup funding from The University of Hong Kong. E. Guo and L. Zhou are with the School of Electrical and Information Engineering, University of Sydney, Australia (e-mail: [email protected]; [email protected]). D. Xu is with the Department of Computer Science, The University of Hong Kong, Pokfulam, Hong Kong (e-mail: [email protected]). H. Fu is with the Institute of High Performance Computing (IHPC), Agency for Science, Technology and Research (A*STAR), Singapore 138632 (E-mail: [email protected]). such as glaucoma, diabetic retinopathy, and hypertension. Unfortunately, a study of 5,575 patients found that about 12% of fundus images are not of adequate quality to be readable by ophthalmologists [2]. The quality of fundus images varies due to equipment limitations, ophthalmologists' experience, and patient eye movement, which could negatively affect clinical decision making. Image enhancement methods are therefore proposed as a remedy. Traditional fundus image enhancement methods [3]–[6] were mainly based on hand- crafted priors, and they could not satisfactorily handle the complexity of varied low-quality cases. To solve this issue, the deep learning methods were proposed to learn more general priors from large amounts of paired low-quality and high- quality images [7]–[14]. Therefore, the existing methods resort to either i) synthetic image pairs, such as synthesizing low- quality fundus images by degrading real high-quality ones [7], or ii) unpaired supervision models, such as CycleGAN-like ones [11], [15], for enhancement. However, both approaches have limitations. On one hand, due to the domain shift between the synthetic and the real fundus images, the models trained on synthetic image pairs have limited capability to generalize well to real clinical fundus images. On the other hand, the models trained with unpaired supervision mainly translate image styles and could not well preserve the local details of structures. To bridge this gap, in this work, we propose a new end- to-end optimized method that simultaneously conducts image enhancement and domain adaptation in one-shot based on the well-known mean teacher framework [16]. By imitating self- supervised learning, mean teacher framework was proposed to be used for unsupervised domain adaptation task in [17]. The domain gap is naturally reduced by the consistency regularization in the mean teacher framework, which enforces the predictions of the teacher network and the student network to be consistent around each unlabeled (target domain) image. Mean teacher aims to learn a smoother domain-invariant function from unlabeled (target domain) images than the model purely trained on labeled (source domain) images. In this paper, we adapt the mean teacher framework to our cross-domain enhancement network through both multi-stage enhancement consistency and multi-level segmentation consis- tency. Specifically, our method consists of a student network and a teacher network with identical architecture, while the latter is an exponential moving average of the former. The 2 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2020 student network is trained for two tasks. On one hand, it uses synthetic image pairs for supervised enhancement. On the other hand, it uses the unlabeled real images (without the enhanced ground-truth) to regularize the enhancement model trained on the synthetic input, in order to reduce the domain shift. This is achieved by feeding a real image and its augment simultaneously into the student and the teacher networks, respectively, and enforcing consistent predictions between the two networks. Moreover, we also propose a powerful multi-stage Multi-Attention Guided Enhancement Network called MAGE-Net, which also serves as the back- bones of the student and the teacher network. Our MAGE- Net is comprised of a multi-stage enhancement (MSE) module and a retina structure preservation (RSP) module. The MSE module consists of a UNet-Shaped stage (Stage-1) to encode broad semantic information and an original-scale stage (Stage- 2) to provide spatial details. Multi-type attentions are further employed to guide the enhancement, including our newly proposed fundus attention. Compared with the commonly used skipped connections that directly link encoder-decoder levels, our multi-stage multi-attention architecture provides a more delicate way to effectively integrate multi-scale features. The RSP module is proposed to maintain the vital structures information in fundus images, e.g., the vessels, the optic disc, and the cup, for clinical observation. It sequentially produces essential structure features to guide the enhancement process. Building upon MAGE-Net and the supervised enhancement loss, we further propose multiple consistency losses to bridge the student and teacher networks, including the multi-stage enhancement consistency and the multi-level segmentation consistency of the RSP module. The contributions of this work are summarized as follows: 1) We propose a new teacher-student based framework with specifically designed consistency losses to reduce the do- main shift between the synthetic and the real low-quality fundus images, which is conducted simultaneously with the image enhancement task. 2) We propose a new multi-stage multi-attention guided fundus image enhancement network, which corrects low- quality fundus images while catering for contextual accuracy, spatial accuracy, and anatomical structure ac- curacy. 3) The experimental results show that our fundus enhance- ment method also improves the performance of multiple downstream tasks, such as vessel segmentation, optic disc, and cup detection, and disease recognition. II. RELATED WORK In this section, we briefly discuss the fundus image enhance- ment approaches, domain adaptation methods, and the mean teacher framework, which are related to our work. A. Fundus Image Enhancement Fundus image enhancement methods have two main cate- gories: prior-based methods and learning-based methods. 1) Prior-based methods.: The traditional prior-based meth- ods could not successfully address multiple low-quality cases including noise, blurring, missed focus, illumination, and contrast. Histogram equalization (HE) [18]–[20] is a popu- lar method in this category to improve image contrast of retinal images, but the decreasing of gray levels results in the loss of image details. Therefore, negative observations were found for it in many retina image cases, especially in color retinal images. Alternatively, contrast limited adaptive histogram equalization (CLAHE) is also widely adopted to enhance medical images, e.g., Setiawan et al. [5] applied a specifically designed CLAHE to retinal fundus images. How- ever, the CLAHE method may produce artificial boundaries at the region containing an abrupt change in the gray levels. Moreover, although these methods perform efficiently due to their simplicity, their heavy dependence on global image statistics leads to severe image degradation in practice. These hand-crafted priors from human observations do not always work in diverse real-world low-quality retinal images. They tend to suffer from undesirable color and structure distortions. 2) Learning-based Methods.: Recently, due to the advantage in image representation, deep learning methods have dom- inated the computer vision field. There are different types of methods for promoting image quality, such as image enhancement [21], dehazing [22], denoizing [23], and so on. Unfortunately, due to the differences between medical and natural images, the above image correction methods are not suitable to fundus image enhancement which needs specific design to cater for the special characteristic of retinal images. Retinal image enhancement should use pixel-wise translation to preserve retinal structures, which is critical in retinal image analysis. The deep learning networks applied to retinal image enhancement are composed of two categories: synthetic image- pairs-based methods and unpaired-supervision-based methods. The first ones like [24] require high-low quality retinal image pairs to learn a mapping from one representation to another. The widely used fundus degradation method [7] simulates real images of low quality to build retinal image pairs from real high-quality images. However, the image pair-based methods ignore the domain gap between the synthetic low-quality images and the real thus generalizing unsatisfactorily to clinic use. The unpaired supervision-based methods [7], [15] are usually based on CycleGAN-like frame- works to restore fundus images directly from real unpaired images of high or low quality. However, these methods mainly translate image styles to simulate clean results without well preserving the important details of fundus structures. To this end, vessel segmentation was employed as a useful way to enhance retinal structures. For example, CofeNet [7], a method using synthetic image pairs, was designed to pre- serve the retinal structures in fundus enhancement process through benefiting from vessel segmentation outputs. Recently, Transformer-based methods have achieved great success in high-level vision tasks [25], such as image classification [26], semantic segmentation [27], object detection [28], etc. Due to the advantage of capturing long-range dependencies and good performance in many high-level vision tasks, Transformer has also been introduced into low-level vision tasks, such as low-quality images, AUTHOR et al.: PREPARATION OF PAPERS FOR IEEE TRANSACTIONS ON MEDICAL IMAGING 3 image restoration [29], [30]. The transformer-based method is rarely applied in the fundus image enhancement task. The transformer-based method: RFormer [11] relies on an in-house Real Fundus (RF) dataset including 120 paired high- and low- quality real fundus images to learn to synthesize high-quality images from low-quality ones. Unlike other fundus image enhancement methods using synthetic low-quality images for training, RFormer is directly trained based on paired real fundus images of different qualities, unfortunately, are costly to be collected in practice. Moreover, the RF dataset has not been publicly released. In this paper, to alleviate the issues from both the paired- and the unpaired-supervision-based methods and integrate their advantages, we develop a fundus image enhancement learns feature presentations from synthetic framework that image pairs and leverages real low-quality images to im- prove enhancement performance. This further calls for domain adaptation to alleviate the discrepancy between the synthetic and the real image domains involved in the fundus image enhancement task. B. Domain Adaptation Due to the gap between the source and the target domains, a model trained on the source domain may suffer significant performance drops on the target domain in practice. Domain adaptation is therefore proposed to bridge the domain gap so that the model learned from the source domain is able to perform decently on the target domain. There is a large corpo- ration of literature tackling the problem of domain adaptation. We focus on deep learning based methods as these are most relevant to our work. Unsupervised domain adaptation could be addressed from different perspectives. Discrepancy-based methods guide the feature learning by minimizing the domain gap with Maximum Mean Discrepancy [31], while the works in [32], [33] estimate the domain confusion by learning a do- main discriminator. Differently, self-ensembling [17] extended the mean teacher framework [16] to reduce domain gap and established several cross-domain benchmarks for recognition task. Recently, Mean Teacher has been extensively used as a transfer learning method for various tasks, e.g., image dehaz- ing [34], object detection [35] and semantic segmentation [36]. For example, to reduce the domain gap in image dehazing, Liu et al. [34] developed a disentangle-consistency mean-teacher network (DMT-Net) collaborating with unlabeled real-world hazy images to address the domain shift problem. Similar to [34], our method aims to leverage additional real low- quality fundus images without ground-truth to alleviate the domain discrepancy between the synthetic and the real images. Along this line, we explore the Mean Teacher framework to bridge the domain gap by imposing consistency regularization in fundus image enhancement, which has not been previously explored in this field. Moreover, the enhancement loss and the segmentation loss between synthetic to real fundus image is elegantly integrated into the Mean Teacher paradigm to boost cross-domain enhancement results. C. Mean Teacher Framework Mean Teacher framework [16] is widely used in semi- supervised learning. The main idea of mean teacher is to enforce the predictions of the teacher and the student net- works consistent under small perturbations of the input or the network parameters. Mean teacher consists of two networks with the same architecture: let S(*) and T (*) represent the embedding functions of the student network with weight ws and the teacher network with weight wt, respectively. Let us denote a labeled data as Il, an unlabeled data as Iu and its augment as ̃Iu. The consistency loss penalizes the difference between the student's prediction S(Iu) and the teacher's prediction T ( ̃Iu), which is typically computed as the Mean Squared Error: Lcons(Iu) = (cid:107)S(Iu; ws) − T ( ̃Iu; wt)(cid:107)2 2. (1) The student network is trained by using gradient descent, and the weights wt of the teacher network at the n-th iteration are the exponential moving average of the student weights ws: wn t = α * wn−1 t + (1 − α) * wn−1 s , (2) where α is a smoothing coefficient parameter that controls the updating of the teacher's weights. The total loss of the mean teacher framework is a combination of the supervised losses on labeled data and the consistency losses on unlabeled data, balanced with the trade-off parameter μ: L = M (cid:88) i=1 Lsuper(Ii l) + μ N (cid:88) j=1 Lcons(Ij u), (3) where M and N denote the total number of the labeled and unlabeled images, respectively. III. METHODOLOGY The overview of our proposed teacher-student framework is shown in Fig. 1. It consists of a student network and a teacher network, both built on our proposed MAGE-Net. In order to integrate synthetic and real images, we also design specific consistency losses to reduce the domain shift. The detailed structure of MAGE-Net is shown in Fig. 2a. It is composed of two modules: multi-stage enhancement module (Stage-1 and Stage-2) and retinal structure preservation module (RSP). These two modules are effectively fused through a newly designed fundus attention block (See Fig. 2c). A. Multi-Attention Guided Enhancement Network (MAGE-Net) 1) Multi-Stage Enhancement (MSE) Module: The MSE module (Fig. 2a) consists of two stages to restore clean fundus images. Stage-1 employs encoder-decoder structure with large receptive fields to extract the contextualized features in the fundus images. However, the downsampling operations in Stage-1 loss spatial details and thus yield over-smoothed results. Therefore, Stage-2 is proposed for three reasons: pre- serving local image details by operating on the original image resolution, maintaining the anatomical structure by adding the feature from the RSP module, and fusing features through the 4 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2020 Fig. 1. Overview of Transferred MAGE-Net with Multi-Stage Consistency (T-MAGE-Net). We use MAGE-Net as a teacher network and a student network, respectively. Each paired synthetic image is fed into student model to conduct the supervised learning of image enhancement and segmentation. We calculate supervised multi-stage enhancement losses and supervised segmentation losses in the student network. Each unlabeled real image is firstly transformed into two perturbed samples by adding Gaussian noise and then we inject the two perturbed samples into student and teacher models separately. Two types consistency regularization are devised to facilitate reducing the domain gap in mean teacher paradigm: 1) Multi-Stage Enhancement Consistency Loss to align the clean predictions between teacher and student; 2) Multi-Stage Segmentation consistency Loss for matching the retinal structures between teacher and student. The whole T-MAGE-Net is trained by minimizing the supervised losses on paired synthetic image data plus the two consistency losses on the unlabeled real image in an end-to-end manner. Note that the student network is optimized with Adam and the weights of teacher network are the exponential moving average of student model weights. fundus attention block effectively. Given a low-quality input image, we feed it into each enhancement stage. To enrich the features from Stage-2, we also adopt a multi-patch hierarchy strategy on the input image from Stage-1. We split each input image into two non-overlapping subimages with 50% of the original resolution. Then, we feed them into Stage-2. In Stage-1, we first utilize a convolution layer and a channel attention block (CAB) [37] (Fig. 2b) to extract the features from the input. Specifically, the CAB generates different attention maps for each channel-wise feature, making the network focus on more informative features. Then a UNet- shaped [38] architecture is adopted as our sub-network to restore low-quality fundus images. Each encoder layer em- ploys CABs to extract high-level semantic features, and each decoder layer uses a bilinear upsampling operation followed by a convolution layer instead of using transposed convolution due to the checkerboard artifacts introduced by transposed convolution [39]. Both the encoder and decoder features are resized and fused with the intermediate feature maps of Stage- 2. Moreover, the output of the decoder is sent through the supervised attention (SAM) module (Fig. 2d) [40] to provide the attention maps to Stage-2 with the aid of supervision information from the ground-truth high-quality fundus images. In Stage-2, we employ a residual network. The features of the original image is firstly extracted by a convolution layer and a CAB like in Stage-1, and then sent to a series of our newly proposed blocks: fundus attention block (FAB) (Fig. 2c). To preserve local image details, the FAB keeps the feature maps at the original image resolution and does not employ any downsampling operation. In each FAB, we first extract high-resolution features by using several CABs. Then, we add the resized contextual features from Stage-1 with those from Stage-2 to refine the feature maps of whole images. To boost the performance of the downstream clinical analysis tasks, the feature maps from the RSP module are resized and concatenated with the feature maps from Stage-2. Finally, the fused feature maps are passed through a learnable non-linear transformation filter to maintain stable and efficient model performance. We sequentially employ three FABs for feature extraction and fusion to generate the residual and then add it with the low-quality input image to produce the final enhancement output. 2) Retinal Structure Preservation (RSP) Module: Nature im- age enhancement methods focus on producing visually satisfy- ing results for humans, without necessarily preserving valuable clinical information in the reconstructed images. However, as important clinical diagnosis evidence, the enhanced fundus images should preserve the retinal structures without incor- rectly synthesizing the content. Therefore, we propose the RSP module to further guide image enhancement in the MSE Synthetic ImageAuthentic (Real) ImageSupervised LossExponential Moving AverageStudent Network (MAGE-Net)Consistency LossTeacher Network (MAGE-Net)Stage 2Stage 1RSPStage 1Stage 2RSPEnhancementLossSegmentationLossEnhancementConsistencyLossSegmentationConsistencyLoss AUTHOR et al.: PREPARATION OF PAPERS FOR IEEE TRANSACTIONS ON MEDICAL IMAGING 5 Fig. 2. Illustration of our proposed Multi-Attention Guided Network (MAGE-Net). MAGE-Net consists of two parts: multi-stage enhancement module (MSE) and retinal structure preservation module (RSP). For both teacher and student networks, given an input image, we simultaneously feed it into the RSP module and the two stages of the MSE module. The RSP module sends the features maps of important retinal structures to correct stage-2 of the MSE module at each FAB. The stage-1 of the MSE module extracts the contextualized features by a UNet-shaped network. Then, both the encoder-decoder and SAM features are fused into stage-2 from stage-1. (a) Multi-Attention Guided Network (MAGE-Net). (b) Channel Attention Block. (c) Fundus Attention Block. (d) Supervised Attention Module. module. As illustrated in Fig. 2a, the RSP module is based on the pre-trained AG-Net [41], which is a UNet-shaped segmentation network with its layers respectively supervised by multi-scale segmentation masks. The main retinal structures are encoded as an attention feature map by the decoder at each scale layer. These multi-scale feature maps from different decoder layers are then fused with the MSE module after being scaled up to the original image size. In this way, the important components of fundus images are injected into the image correction network to preserve the clinically useful contents. 3) MAGE-Net Loss: Our MAGE-Net is supervised by an enhancement loss and a segmentation loss. Given a labeled synthetic low-quality image Il, denoting its enhancement output at the s-th stage as Is e and the ground-truth high-quality image as Ih, the enhancement loss at the s-th stage is the sum of the Charbonnier loss [42]: char(Il) = (cid:112)(cid:107)Is Ls e − Ih(cid:107)2 + ε2 and the Edge loss [40]: edge(Il) = (cid:112)(cid:107)∆(Is Ls e) − ∆(Ih)(cid:107)2 + ε2, (4) (5) where ε is set as 0.001 in both loss functions, and ∆(*) is the gradient function. Denoting the segmentation result of Il at the v-th scale in the RSP module as Iv seg and the ground- truth mask as Gv seg, the segmentation loss at the v-th scale is calculated as: Lv seg(Il) = (cid:107)Iv seg − Gv seg(cid:107)2 (6) for each of the four scales in the RSP module. The overall supervised loss of our MAGE-Net is provided below, where the trade-off coefficient λ is set as 0.5: Lmage(Il) = 2 (cid:88) (Ls char(Il) + Ls edge(Il)) + λ 4 (cid:88) Lv seg(Il), s=1 v=1 (7) where s denotes the stage index of MSE module, and v denotes the scale index of the RSP module. B. Transferable MAGE-Net with Multiple Consistency Losses Fig. 1 depicts the overall architecture of our proposed Transferable MAGE-Net (T-MAGE-Net) with multiple con- sistency losses, which corrects the low-quality fundus images for clinical observation and leverages real images for fundus images enhancement. We use the MAGE-Net for both the teacher and student networks. During the training process, we feed the synthetic image pairs into the student network and compute the supervised loss of our MAGE-Net. Meanwhile, for each unlabeled real the corresponding enhanced ground-truth, we create an auxiliary image from it by adding Gaussian noise, separately feeding them into image without MAGE-Net(a)(b)(c)(d) 6 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2020 the student and teacher networks, and enforce the consistent prediction results from the two networks. The consistency loss is computed for the unlabeled real images at each enhancement stage and each scale of the RSP decoder outputs between the teacher and student networks. The whole architecture is then optimized with two consistency regularizations: 1) each stage of the enhancement results consistency to align the clean outputs predictions between teacher and student, 2) each scale of the segmentation consistency for matching and preserving the retinal structure between teacher and student networks. The weights of the teacher model are updated by the exponential moving average weights of the student model [16], which will not significantly increase burden to our MAGE- Net becauses of shared weights between teacher and student models. The employment of a teacher-student framework does not introduce additional parameters to learn as the teacher is simply the exponential moving average of the student [43]. 1) Consistency Loss: Denote an unlabeled real image as Iu and its augment as ̃Iu, and let S(*) and T (*) represent the embedding functions of the student and the teacher networks, respectively. We enforce the two networks to output consistent enhancement results (Se(Iu) and Te( ̃Iu)) of each stages and segmentation results(Sseg(Iu) and Tseg( ̃Iu)) of each segmen- tation scale. The overall consistency loss Lcons(Iu) sums over the multi-stage enhancement consistency loss and the multi- level segmentation consistency losses: Lcons(Iu) = 2 (cid:88) s=1 (cid:107)Ss e (Iu) − T s e ( ̃Iu)(cid:107)1 + 4 (cid:88) v=1 (cid:107)Sv seg(Iu) − T v seg( ̃Iu)(cid:107)1. (8) where s denotes the stage index of MSE module, and v denotes the scale index of the RSP module. 2) Total Loss: The total loss of our method is the sum of the supervised loss from our MAGE-Net and the unsupervised multi-stage multi-level consistency loss: L = M (cid:88) i=1 Lmage(Ii l) + μ N (cid:88) j=1 Lcons(Ij u), (9) where M and N denote the total number of the labeled and unlabeled images, respectively. The weight μ is computed by a time-dependent Gaussian warming up function [16]. The parameters of teacher network are updated by the exponential moving average (EMA) strategy in each training iteration. IV. EXPERIMENTS A. Implementation Details Our method is implemented by PyTorch, and trained on a single NVIDIA RTX V6000 GPU. The Adam optimizer is adopted. The initial learning rate is 2 × 10−5, which is decreased to 1 × 10−7 by the cosine annealing strategy [44]. All of the labeled and unlabeled images are re-scaled to the size of 512 × 512. The mini-batch size is 24, including 16 labeled synthetic images and 8 unlabeled real images. We use a two-stage training strategy. In order to accelerate our training process, we pretrain the RSP module, and then train the whole enhancement framework in an end-to-end fashion. B. Datasets Our training set is formed from the EyeQ [45] dataset, whose images are captured by various cameras from different hospitals. From this perspective, our model is generally trained to enhance images from different centers or equipments [46]. The EyeQ [45] dataset is a subset of the Kaggle [47] dataset for fundus image quality assessment, which has 28,792 retinal images with three quality grades ("Good", "Usable", and "Reject"). Specifically, we select 10,000 high-quality fundus images (labeled as "Good") as the clean images and produce segmentation masks by using pre-trained AG-Net [41]. We randomly choose degradation factors (e.g., light transmission disturbance, image blurring, and retinal artifacts) to synthesize degraded images by using the method [7]. Moreover, we ran- domly select 5,000 low-quality images (labeled as "Uable") as the unlabeled data. In the test stage, to evaluate the quality of image enhancement, we also utilize the degradation model [7] to randomly generate degraded images on the DRIVE [48] test set and REFUGE [49] test set. Moreover, For the Subtest- EyeQ dataset, we chose another 500 images which are labeled as "Good" in EyeQ but not present in Subtrain-EyeQ dataset to evaluate the image enhancement quality. C. Degradation Model Settings The degradation method is based on the ophthalmoscope imaging systems, which is also verified by Cofe-Net [7]. Clinical image collection in a complex environment using an ophthalmoscope often encounters several types of interference, as introduced in the optical feed-forward system. Light trans- mission disturbance is often caused by exposure issues. Due to the interspace between the eye and camera, stray light may en- ter into the ophthalmoscope, mix with the lighting source and result in uneven exposure. This also affects the tuning setting of the programmed exposure, leading to global over-/under- exposure. In addition, image blurring caused by human factors (such as eyeball movement, fluttering, and defocus) results in low-quality images. Besides, the capturing of undesired objects (e.g., dust) during imaging is also a crucial factor that reduces image quality and impedes subsequent diagnosis. Therefore, Cofe-Net [7] proposes a reformulated representation of the interference that occurs during the collection of fundus images. The degradation model could be used to not only support current fundus propagation models, but also synthesize a high- quality pairwise fundus dataset for subsequent research. Cofe- Net [7] summarized the interference in terms of three factors, including light transmission disturbance, image blurring, and retinal artifacts. Thanks to Cofe-Net [7], the degradation method was directly adopted in subsequent works, such as I-SECRET [24]. We put a high-quality fundus image x into the degradation model to get the paired degraded image x(cid:48). Light Transmission Disturbance.: The light transmission disturbance contains two types of degraded factors: global factors and local factors. The global factors include contrast factor, brightness, and saturation, which are caused by unstable stray light, subjective situation, and manual mydriasis. The local factors produce additional non-uniform illumination due to the initiative light leak phenomenon, diverse lens apertures, AUTHOR et al.: PREPARATION OF PAPERS FOR IEEE TRANSACTIONS ON MEDICAL IMAGING 7 TABLE I IMAGE ENHANCEMENT QUALITY COMPARISON OF DIFFERENT METHODS ON DRIVE [48], REFUGE [49], AND SUBTEST-EYEQ TABLE II COMPARISON OF DIFFERENT METHODS IN TERMS OF THE NUMBER OF PARAMETERS. DRIVE [48] . REFUGE [49] Subtest-EyeQ Methods Low-quality Setiawan [5] DCP [50] Cofe-Net [7] StillGAN [15] I-SECRET [24] T-MAGE-Net PSNR 16.28 16.68 17.55 20.31 22.48 24.09 24.72 SSIM PSNR 16.79 0.804 16.65 0.680 14.66 0.792 24.45 0.881 22.90 0.890 25.04 0.906 25.66 0.928 SSIM PSNR 18.49 0.823 18.59 0.668 17.98 0.702 21.88 0.897 22.77 0.871 23.53 0.914 24.14 0.929 SSIM 0.811 0.770 0.786 0.880 0.850 0.889 0.896 and embedded optical compensation mechanism. Therefore, light transmission disturbance is simulated by using: x(cid:48) = clip(α(J * GL(rL, σL) + x) + β; s), (10) where α, β, and s refer to the contrast factor, brightness, and saturation, respectively. To simulate global factors, we randomly set them between −0.5 to 0.5. GL is a Gaussian filter with the radius rL and the variance σL. For local factors, an illumination bias J is defined as: Jij = nl |(i−a)2+(j−b)2<r2 L , (11) where c = (a, b) is the center with the radius of rL. We ran- domly set c ∈ [0.375rL, 0.625rL]. We define rL ∈ [0.75w, w]; σL ∈ [0.66crL, 0.66(w − c)rL] and rL ∈ [0.3w, 0.5w]; σL ∈ [0.55rL, 0.75rL] for light leak phenomenon and uneven exposure problem, respectively, where w denotes the image size. Image Blurring.: The image blurring is caused by unde- sired object distance in funduscopy. It is simulated by using: x(cid:48) = x * GB(rB, σB) + n, (12) where GB is a Gaussian filter with a radius rB and the spatial constant σB, and n denotes the additive random Gaussian noise. Here we set σB = 0.03w, and rB ∈ [0.01w, 0.015w]. Retinal Artifact.: The retinal artifacts are caused by dust and grains attaching on the lens of the imaging plane. It is simulated by using: x(cid:48) = x + K (cid:88) k GR(rk/4, σk) * ok, (13) where K is the undesired object number. To simulate the interference in real clinical scenarios, we randomly increase the number of undesired objects from 10 to 30. For each undesired object k, rk and σk are defined as the radius and the variance of a Gaussian filter GR . We randomly set the radius rk ∈ [0.025w, 0.05w], the variance σk = 5 + 0.8rk, and the illumination bias ok = 1 − e−(0.5+0.04rk)×(0.012rk) for each object k. V. EVALUATION In this section, we evaluate the enhancement performance of different methods in terms of the image quality and three downstream tasks including vessel segmentation task, optic disc/cup detection task and real clinical image analysis task. Methods Cofe-Net [7] StillGAN [15] I-SECRET [24] T-MAGE-Net(ours) Number of Parameters (M) 41.218 78.644 11.756 26.379 TABLE III VESSEL SEGMENTATION PERFORMANCE COMPARISON OF DIFFERENT METHODS ON DRIVE [48] DATASET. Methods Low-quality high-quality Setiawan [5] DCP [50] Cofe-Net [7] StillGAN [15] I-SECRET [24] MAGE-Net(ours) T-MAGE-Net(ours) AUC 0.781 0.953 0.809 0.813 0.875 0.867 0.877 0.910 0.932 Acc 0.938 0.982 0.938 0.948 0.961 0.959 0.963 0.970 0.974 IoU 0.479 0.830 0.504 0.547 0.654 0.639 0.662 0.726 0.764 A. Image Quality Enhancement For quantitative evaluation, we use both PSNR and SSIM as the evaluation metrics in Table I. Our method is the best performer in terms of both PSNR and SSIM [51]. Specifically, among all comparing methods, the baseline method proposed by Setiawan et al. [5] and the DCP [50] method correct each fundus image based on the global image statistics and functions, so their results contain undesired distortion; The relatively poor work results from both methods Setiawan et al. [5] and DCP [50] are expected since they are non-deep learning methods. The method from Setiawan et al. [5] exploits the image contrast normalization and contrast limited adaptive histogram equalization (CLAHE) techniques to restore the color of retinal images. Instead of simply considering the color and texture information like Setiawan et al. [5], the DCP [50] method decomposes the reflection and illumination, which achieves image enhancement and correction by estimat- ing the solution through an alternative minimization scheme. While these algorithms based on the bottom-up frameworks are effective, their optimal solutions rely heavily on global image statistics and mapping functions, namely, these methods ignore discriminative features, which may introduce unde- sired artifacts and distortion. StillGAN [15], a CycleGAN-like method, is trained with unpaired supervision that could not well preserve the local structure details; Cofe-Net [7] model trained on synthetic image pairs ignores the gap between the synthetic and the real low-quality images for the practical diagnosis, so it is not well generalized to the authentic clini- cal fundus images. Although utilizing unlabelled real fundus images, I-SECRET [24] method still loses to ours as it only uses a single CNN-based network to enhance the fundus images without well preserving the retinal and lesion details. Moreover, by cross-referencing Table VI, it is found that our method still wins all the baseline methods even without using the RSP module (i.e., without the additional guidance from the extra segmentation masks), since our method without RSP (i.e., "Ours w/o RSP") achieves PSNR/SSIM of 24.47/0.9273, 8 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2020 better than the best baseline I-SECRET (24.09/0.906) shown in Table I. This may suggest that our mean teacher based domain adaptation more effectively utilizes the unlabelled real low-quality images, compared with the contrastive learning employed by I-SECRET. In addition, visual comparisons of different enhancement results are given in Fig. 3 for synthetic low-quality images and in Fig. 4 and Fig. 5 for real low-quality images without ground-truth. From Fig. 3, we can see that neither StillGAN nor Cofe-Net could eliminate the undesired light spot (indi- cated by the blue arrows) presented in the synthetic low-quality image. This problem is alleviated in the images enhanced by I-SECRET, as it considers both labeled and unlabeled retina images to learn robust features. However, compared with our method, I-SECRET generates blurred vessel boundaries (indicated by the green arrows), confirming the importance of introducing RSP module. Our advantage over I-SECRET could also be observed by the enhancement result from a real low-quality image in Fig. 4. Compared with I-SECRET, our method produces a sharper image with much less undesired light spots. Visual comparison with more methods on real low-quality images is given in Fig. 5. Since there is no ground-truth for the enhancement, we additionally show the vessel segmentation from the enhanced images. As shown, our method could recover finer vessels than other methods. We compared the number of training parameters between the proposed T-MAGE-Net and other baseline approaches, as shown in Table II. It could be found that the numbers of parameters of Cofe-Net [7] and StillGAN [15] are much more than that of our method. Ours is just a bit more than that of I-SECRET [24], but ours achieves better performance. B. Vessel Segmentation The enhancement quality is also validated through the downstream task of vessel segmentation. We evaluate different methods on the degraded DRIVE [48] test set. Quantitative results are shown in Table I. Our method outperforms the competing methods in terms of AUC, Accuracy (Acc.), and IoU. We use CE-Net [52] trained on DRIVE training set as the segmentation method, which achieves AUC/Acc/IoU of 0.953/0.982/0.830 on high-quality DRIVE [48] test set. The vessel segmentation results of real low-quality fundus images from different deep learning methods are shown in Fig. 5. Obviously, the vessel structure is better preserved by using our enhancement method. In contrast, the baseline method by Se- tiawan et al. [5] and DCP [50] produce unsatisfactory results, because their solutions highly rely on global image contrast and illumination. They cannot correct local light spots, holes, and halos, which influences the vessel observation. Other baseline methods, like StillGAN [15] and I-SECRET [24], use different supervised losses to preserve the structure infor- mation of the whole images, but the useful retinal structures for clinic diagnosis are not emphasized during the process, so that the vessel details are missed in Fig. 5. Differently, Cofe-Net [7] designed a retinal structure activation module to emphasize the anatomical retinal structures. Comparing with it, our RSP module together with a multi-resolution method TABLE IV OPTIC DISC/CUP SEGMENTATION PERFORMANCE COMPARISON OF DIFFERENT METHODS ON REFUGE [49] DATASET. Methods Low-quality high-quality Setiawan [5] DCP [50] Cofe-Net [7] StillGAN [15] I-SECRET [24] T-MAGE-Net(ours) mIoU 0.709 0.789 0.727 0.720 0.758 0.725 0.750 0.762 Dice 0.823 0.882 0.841 0.831 0.858 0.834 0.852 0.862 can provide more effective and robust structural features. Moreover, using the restored images from our MAGE-Net without RSP for vessel segmentation, we achieve the results of AUC/Acc/IoU as 0.910/0.970/0.726, better than I-SECRET's 0.877/0.963/0.662 as reported in Table III. The results indicate that our improvements come from both the RSP module to preserve retinal structure and the MSE module to achieve clear images. Therefore, our enhanced images with better quality also lead to the smallest error of vessel segmentation over those produced by other baseline methods. C. Optic Disc/Cup Detection Optic disc and cup detection is important for diagnosing glaucoma. For the downstream task of optic disc/cup detection, we evaluate different methods on the degraded REFUGE [49] test set. We report the Dice and mIoU in Table IV. Specifi- cally, we use Pra-Net [53] trained on the REFUGE training set(obtains mIoU/Dice of 0.789/0.882) for the detection on the enhanced images. The results consistently show that the enhanced images by our method could benefit the optic disc and cup detection for clinical observation. By performing paired t-tests based on the optic disc/cup detection results from our method and the best baseline (I-SECRET [24]), we achieve the p-values of 0.00157 (mIoU) and 0.00063 (Dice), indicating our improvements are statistically significant, as both p-values are lower than 0.05. D. Real Clinical Image Analysis The enhancement model is expected to provide clean images with lesion preservation to assist diagnosis. This is validated by using the ODIR-5K dataset [54] collected from different hospitals and medical centers with different image qualities, which contains eight different labels including "normal", "diabetes", "glaucoma", "cataract", "age-related macular de- generation (AMD)", "hypertension", "myopia", and "other diseases". We adopt the Jordi et al. [55] model to classify ocular diseases. The results are shown in the Table V. Our method boosts the disease recognition performance evidently. Due to the gap between the synthetic and the real low-quality images, Cofe-Net [7] increases the risk of changing lesion areas, such as color distortion in Fig. 3. The enhanced images by I-SECRET [24] and StillGAN [15] are over-smoothed and fail to restore the retinal structure details that are important diagnose clue for eye diseases such as age-related macular degeneration, hypertension, and myopia [56]. In contrast, we AUTHOR et al.: PREPARATION OF PAPERS FOR IEEE TRANSACTIONS ON MEDICAL IMAGING 9 Fig. 3. Visual comparison of enhancement results (Columns 2-5) on a synthetic low-quality fundus image (Column 1). The ground-truth (GT) high-quality image is given in Column 6. The symbol [. / .] denotes [PSNR / SSIM] scores. The bottom row contains the zoom-in views of the images in the top row. Arrows point to the visual differences for attention. TABLE V THE OCULAR DISEASE RECOGNITION RESULTS OF EACH DISEASE ON THE ODIR [54] DATASET. Methods Real fundus image Setiawan et al. [5] DCP [40] Cofe-Net [7] StillGAN [11] I-SECRET [21] MAGE-Net(ours) T-MAGE-Net(ours) Kappa 0.2989 0.1501 0.2899 0.2495 0.2500 0.2527 0.2835 0.3438 normal ACC 0.7875 0.7835 0.7475 0.7275 0.7840 0.7875 0.7600 0.7900 AUC 0.7925 0.7835 0.8100 0.7868 0.7515 0.7977 0.7900 0.8107 Kappa 0.5100 0.2258 0.3671 0.3766 0.3591 0.4110 0.4388 0.5147 diabetes ACC 0.8974 0.8800 0.8675 0.8800 0.8550 0.8800 0.8825 0.9075 AUC 0.7926 0.7177 0.7722 0.7771 0.7932 0.8074 0.8090 0.8076 Kappa 0.4986 0.5862 0.6026 0.5405 0.5580 0.5934 0.6160 0.5660 glaucoma ACC 0.8875 0.9249 0.9247 0.9150 0.9025 0.9225 0.9225 0.9075 AUC 0.8901 0.8761 0.8975 0.8780 0.8870 0.8910 0.8935 0.8989 Kappa 0.8107 0.5985 0.7350 0.7894 0.6794 0.7961 0.8527 0.8390 cataract ACC 0.9625 0.9325 0.9500 0.9575 0.9425 0.9600 0.9700 0.9675 AUC 0.9776 0.9013 0.9427 0.9676 0.9817 0.9747 0.9840 0.9766 Kappa 0.7151 0.3181 0.6270 0.6832 0.7977 0.7346 0.7942 0.7537 AMD ACC 0.9425 0.7000 0.9275 0.9325 0.9550 0.9350 0.9547 0.9475 AUC 0.9596 0.9199 0.9259 0.9590 0.9628 0.9713 0.9790 0.9692 hypertension ACC 0.8898 0.8725 0.8950 0.8800 0.8948 0.8900 0.8800 0.8850 AUC 0.7895 0.5980 0.7877 0.8076 0.8250 0.8197 0.8125 0.7758 Kappa 0.2142 0.0049 0.3225 0.2781 0.3533 0.3529 0.2440 0.2203 Kappa 0.4049 0.3043 0.7615 0.4049 0.4741 0.5169 0.4741 0.5175 myopia ACC 0.9100 0.9000 0.9550 0.9100 0.9175 0.9220 0.9175 0.9225 AUC 0.9117 0.9716 0.9437 0.8626 0.9514 0.8963 0.9266 0.9121 other diseases ACC 0.7825 0.8475 0.8425 0.8475 0.7900 0.8250 0.8300 0.7975 AUC 0.6595 0.4363 0.6562 0.6348 0.6945 0.6658 0.6672 0.6727 Kappa 0.1694 0.0040 0.1572 0.2445 0.2363 0.1566 0.1656 0.2267 Kappa 0.4438 0.2887 0.4662 0.4328 0.4500 0.4707 0.4772 0.4879 average ACC 0.8825 0.8587 0.8887 0.8812 0.8828 0.8903 0.8897 0.8906 AUC 0.8358 0.7541 0.8488 0.8336 0.8528 0.8523 0.8526 0.8545 model under the teacher student framework, as shown in Table V. E. Ablation Study To investigate the contribution of each component in our method, the ablation study is reported in the Table VI. Initially, stage-1 is a UNet-shaped network to correct fundus images, so some fine details are lost due to the sequential downsampling. To solve this problem, stage-2 is introduced to maintain important information. In order to emphasize retinal structures, we utilize the RSP module for clinical purposes. Our MAGE- Net combines the two stages and the RSP module. We observe that either the multi-stage strategy or the RSP module improves the PSNR and SSIM results. The employment of the teacher-student framework reduces the domain shift between the authentic image pairs and the real clinic images, which further improves both PSNR and SSIM results. F. Limitation Fig. 4. Visual comparison between I-SECRET [24] and our method by enhancement from a real low-quality fundus image. The top row shows the real low-quality fundus image and the enhancement results. The bottom row shows the zoom-in views. preserve the retina structure by our RSP module, and enhance the feature learning of our MAGE-Net based on both synthetic low-quality images (via the supervised enhancement process from the student model) and real low-quality images (via the unsupervised consistent enhancement process from both teacher and student models). In this way, the learned features can cater for both domains, which helps reduce domain gap to some extent. Without the teacher student framework, the results of Kappa/ACC/AUC become 0.4772/0.8897/0.8526, worse than 0.4879/0.8906/0.8545 achieved by our complete Although our proposed method outperforms other strong competitors, our method may not well reconstruct the images with too much noise. For example, if the image is extremely over/under-exposured, the proposed method will not work. Also, the vessel and disc/cup can be preserved only with moderate level of noise. A visual example about this limitation is shown in Fig. 6, which includes one extremely blurred real low-quality fundus image and the enhancement results from I-SECRET [24] and our method. Neither I-SECRET [24] nor our method produces clear disc/cup and vessel details. Fundus GT High-qualitySynthetic Low-qualityCofe-NetStillGANI-SECRETOurs[23.29dB/ 0.913][24.45dB/ 0.926][21.82dB/ 0.887][22.42dB/ 0.908][15.53dB/ 0.792]Real Low-qualityI-SECRETOurs 10 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2020 Fig. 5. Visual comparison of enhancement results on real low-quality fundus images. From top to bottom the images are the enhanced images and their zoom-in, and the vessel segmentation results and their zoom-in. The real low-quality images are given in the 1st column. There are no ground-truth high-quality images. TABLE VI THE ABLATION STUDY RESULTS ON THE DRIVE DATASET [48], WHERE"S1" DENOTES THE STAGE-1, "S2" DENOTES THE STAGE-2, "TS" DENOTES THE TEACHER-STUDENT FRAMEWORK, "LE" DENOTES THE SUPERVISED ENHANCEMENT LOSS, "LS" DENOTES THE SUPERVISED SEGMENTATION LOSS, "LCE" DENOTES THE CONSISTENT ENHANCEMENT LOSS, AND "LCS" DENOTES THE CONSISTENT SEGMENTATION LOSS. Loss Combination Le Le Le+Ls Le+Lce S1 (cid:88) (cid:88) (cid:88) (cid:88) Le+Ls+Lce+Lcs(w/o CAB) (cid:88) (cid:88) Le+Ls+Lce+Lcs S2 RSP TS (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) PSNR 22.93 23.35 23.72 24.47 23.33 24.72 SSIM 0.9109 0.9168 0.9228 0.9273 0.9212 0.9281 Fig. 6. Visualization of failure cases. From the left to the right are an extremely blurred real low-quality fundus image, an enhanced image by I-SECRET [24], and an enhanced image by our method. Neither I-SECRET [24] nor our method produces clear disc/cup and vessel details. image enhancement under extreme noise condition is still a challenging problem, and will be investigated in our future work. VI. CONCLUSION In this paper, we propose a new transferred MAGE-Net method by integrating synthetic and real-world low-quality fundus images for multi-stage fundus image enhancement guided by multi-attentions. Furthermore, we design an RSP module to preserve the anatomical retinal structures and inte- grate it with our mean teacher based multi-stage enhancement framework seamlessly. Comprehensive experimental results demonstrate that our proposed method can simultaneously per- form fundus image enhancement and reduce the domain gap between the synthetic and the authentic images. In addition, Real Low-qualityStillGANCofe-NetI-SECRETOursExtremely blurred real image I-SECRET Ours AUTHOR et al.: PREPARATION OF PAPERS FOR IEEE TRANSACTIONS ON MEDICAL IMAGING 11 our method can boost the downstream tasks and assist clinical diagnosis for ophthalmologists and automated image analysis systems. REFERENCES [1] M. D. Abr`amoff, M. K. Garvin, and M. Sonka, "Retinal imaging and image analysis," IEEE reviews in biomedical engineering, vol. 3, pp. 169–208, 2010. [2] S. Philip, L. Cowie, and J. Olson, "The impact of the health technology board for scotland's grading model on referrals to ophthalmology services," British Journal of Ophthalmology, vol. 89, no. 7, pp. 891– 896, 2005. [3] M. Foracchia, E. Grisan, and A. Ruggeri, "Luminosity and contrast normalization in retinal images," Medical image analysis, vol. 9, no. 3, pp. 179–190, 2005. [4] J. Cheng, Z. Li, Z. Gu, H. Fu, D. W. K. Wong, and J. Liu, "Structure- preserving guided retinal image filtering and its application for optic disk analysis," IEEE Transactions on Medical Imaging, vol. 37, no. 11, pp. 2536–2546, 2018. [5] A. W. Setiawan, T. R. Mengko, O. S. Santoso, and A. B. Suksmono, "Color retinal image enhancement using clahe," in International Con- ference on ICT for Smart Society, pp. 1–3, IEEE, 2013. [6] M. Liao, Y.-q. Zhao, X.-h. Wang, and P.-s. Dai, "Retinal vessel enhance- ment based on multi-scale top-hat transformation and histogram fitting stretching," Optics & Laser Technology, vol. 58, pp. 56–62, 2014. [7] Z. Shen, H. Fu, J. Shen, and L. Shao, "Modeling and enhancing low- quality retinal fundus images," IEEE Transactions on Medical Imaging, vol. 40, no. 3, pp. 996–1006, 2020. [8] A. D. P ́erez, O. Perdomo, H. Rios, F. Rodr ́ıguez, and F. A. Gonz ́alez, "A conditional generative adversarial network-based method for eye fundus image quality enhancement," in International Workshop on Ophthalmic Medical Image Analysis, pp. 185–194, Springer, 2020. [9] U. Sevik, C. Kose, T. Berber, and H. Erdol, "Identification of suitable fundus images using automated quality assessment methods," Journal of biomedical optics, vol. 19, no. 4, p. 046006, 2014. [10] T. Li, W. Bo, C. Hu, H. Kang, H. Liu, K. Wang, and H. Fu, "Applications of deep learning in fundus images: A review," Medical Image Analysis, vol. 69, p. 101971, 2021. [11] Z. Deng, Y. Cai, L. Chen, Z. Gong, Q. Bao, X. Yao, D. Fang, W. Yang, S. Zhang, and L. Ma, "Rformer: Transformer-based generative adversarial network for real fundus image restoration on a new clinical benchmark," IEEE Journal of Biomedical and Health Informatics, vol. 26, no. 9, pp. 4645–4655, 2022. [12] H. Li, H. Liu, Y. Hu, H. Fu, Y. Zhao, H. Miao, and J. Liu, "An Annotation-free Restoration Network for Cataractous Fundus Images," IEEE Transactions on Medical Imaging, 2022. [13] H. Liu, H. Li, H. Fu, R. Xiao, Y. Gao, Y. Hu, and J. Liu, "Degradation- Invariant Enhancement of Fundus Images via Pyramid Constraint Net- work," in MICCAI, pp. 507–516, 2022. [14] H. Li, H. Liu, H. Fu, H. Shu, Y. Zhao, X. Luo, Y. Hu, and J. Liu, "Structure-Consistent Restoration Network for Cataract Fundus Image Enhancement," in MICCAI, pp. 487–496, 2022. [15] Y. Ma, J. Liu, Y. Liu, H. Fu, Y. Hu, J. Cheng, H. Qi, Y. Wu, J. Zhang, and Y. Zhao, "Structure and illumination constrained gan for medical image enhancement," IEEE Transactions on Medical Imaging, vol. 40, no. 12, pp. 3955–3967, 2021. [16] A. Tarvainen and H. Valpola, "Mean teachers are better role mod- els: Weight-averaged consistency targets improve semi-supervised deep learning results," Advances in neural information processing systems, vol. 30, 2017. [17] G. French, M. Mackiewicz, and M. Fisher, "Self-ensembling for visual domain adaptation," arXiv preprint arXiv:1706.05208, 2017. [18] A. Mitra, S. Roy, S. Roy, and S. K. Setua, "Enhancement and restoration of non-uniform illuminated fundus image of retina obtained through thin layer of cataract," Computer methods and programs in biomedicine, vol. 156, pp. 169–178, 2018. [19] W.-Y. Hsu and C.-Y. Chou, "Medical image enhancement using mod- ified color histogram equalization," Journal of Medical and Biological Engineering, vol. 35, no. 5, pp. 580–584, 2015. [20] G. D. Joshi and J. Sivaswamy, "Colour retinal image enhancement based on domain knowledge," in 2008 Sixth Indian Conference on Computer Vision, Graphics & Image Processing, pp. 591–598, IEEE, 2008. [21] W. Ren, S. Liu, L. Ma, Q. Xu, X. Xu, X. Cao, J. Du, and M.-H. Yang, "Low-light image enhancement via a deep hybrid network," IEEE Transactions on Image Processing, vol. 28, no. 9, pp. 4364–4375, 2019. [22] B. Cai, X. Xu, K. Jia, C. Qing, and D. Tao, "Dehazenet: An end-to-end system for single image haze removal," IEEE Transactions on Image Processing, vol. 25, no. 11, pp. 5187–5198, 2016. [23] T. Huang, S. Li, X. Jia, H. Lu, and J. Liu, "Neighbor2neighbor: Self- supervised denoising from single noisy images," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14781–14790, 2021. [24] P. Cheng, L. Lin, Y. Huang, J. Lyu, and X. Tang, "I-secret: Importance- guided fundus image enhancement via semi-supervised contrastive con- straining," in International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 87–96, Springer, 2021. [25] F. Shamshad, S. Khan, S. W. Zamir, M. H. Khan, M. Hayat, F. S. Khan, and H. Fu, "Transformers in Medical Imaging: A Survey," arXiv, jan 2022. [26] A. Arnab, M. Dehghani, G. Heigold, C. Sun, M. Luˇci ́c, and C. Schmid, "Vivit: A video vision transformer," in Proceedings of the IEEE/CVF international conference on computer vision, pp. 6836–6846, 2021. [27] H. Cao, Y. Wang, J. Chen, D. Jiang, X. Zhang, Q. Tian, and M. Wang, "Swin-unet: Unet-like pure transformer for medical image segmenta- tion," arXiv preprint arXiv:2105.05537, 2021. [28] N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko, "End-to-end object detection with transformers," in Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part I 16, pp. 213–229, Springer, 2020. [29] J. Liang, J. Cao, G. Sun, K. Zhang, L. Van Gool, and R. Timofte, "Swinir: Image restoration using swin transformer," in Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1833– 1844, 2021. [30] S. W. Zamir, A. Arora, S. Khan, M. Hayat, F. S. Khan, and M.-H. Yang, "Restormer: Efficient transformer for high-resolution image restoration," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5728–5739, 2022. [31] M. Long, H. Zhu, J. Wang, and M. I. Jordan, "Deep transfer learning with joint adaptation networks," in International conference on machine learning, pp. 2208–2217, PMLR, 2017. [32] Y. Ganin and V. Lempitsky, "Unsupervised domain adaptation by backpropagation," in International conference on machine learning, pp. 1180–1189, PMLR, 2015. [33] E. Tzeng, J. Hoffman, K. Saenko, and T. Darrell, "Adversarial discrim- inative domain adaptation," in Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7167–7176, 2017. [34] Y. Liu, L. Zhu, S. Pei, H. Fu, J. Qin, Q. Zhang, L. Wan, and W. Feng, "From synthetic to real: Image dehazing collaborating with unlabeled real data," in Proceedings of the 29th ACM International Conference on Multimedia, pp. 50–58, 2021. [35] A. Raj, V. P. Namboodiri, and T. Tuytelaars, "Subspace alignment based domain adaptation for rcnn detector," arXiv preprint arXiv:1507.05578, 2015. [36] Y. Zhang, Z. Qiu, T. Yao, D. Liu, and T. Mei, "Fully convolutional adaptation networks for semantic segmentation," in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6810–6818, 2018. [37] Y. Zhang, K. Li, K. Li, L. Wang, B. Zhong, and Y. Fu, "Image super- resolution using very deep residual channel attention networks," in Proceedings of the European conference on computer vision (ECCV), pp. 286–301, 2018. [38] O. Ronneberger, P. Fischer, and T. Brox, "U-net: Convolutional networks for biomedical image segmentation," in International Conference on Medical image computing and computer-assisted intervention, pp. 234– 241, Springer, 2015. [39] A. Odena, V. Dumoulin, and C. Olah, "Deconvolution and checkerboard artifacts," Distill, vol. 1, no. 10, p. e3, 2016. [40] S. W. Zamir, A. Arora, S. Khan, M. Hayat, F. S. Khan, M.-H. Yang, and L. Shao, "Multi-stage progressive image restoration," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14821–14831, 2021. [41] S. Zhang, H. Fu, Y. Yan, Y. Zhang, Q. Wu, M. Yang, M. Tan, and Y. Xu, "Attention guided network for retinal image segmentation," in International Conference on Medical Image Computing and Computer- Assisted Intervention, pp. 797–805, Springer, 2019. [42] P. Charbonnier, L. Blanc-Feraud, G. Aubert, and M. Barlaud, "Two deterministic half-quadratic regularization algorithms for computed imaging," in Proceedings of 1st International Conference on Image Processing, vol. 2, pp. 168–172, IEEE, 1994. 12 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2020 [43] G. Yang, Q. Ye, and J. Xia, "Unbox the black-box for the medical explainable ai via multi-modal and multi-centre data fusion: A mini- review, two showcases and beyond," Information Fusion, vol. 77, pp. 29– 52, 2022. [44] I. Loshchilov and F. Hutter, "Sgdr: Stochastic gradient descent with warm restarts," arXiv preprint arXiv:1608.03983, 2016. [45] H. Fu, B. Wang, J. Shen, S. Cui, Y. Xu, J. Liu, and L. Shao, "Evaluation of retinal image quality assessment networks in different color-spaces," in International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 48–56, Springer, 2019. [46] Y. Nan, J. Del Ser, S. Walsh, C. Sch ̈onlieb, M. Roberts, I. Selby, K. Howard, J. Owen, J. Neville, J. Guiot, et al., "Data harmonisation for information fusion in digital healthcare: A state-of-the-art system- atic review, meta-analysis and future research directions," Information Fusion, 2022. [47] "Kaggle diabetic retinopathy detection." [Online], 2015. https:// www.kaggle.com/c/diabetic-retinopathy-detection/ data/. [48] J. Staal, M. D. Abr`amoff, M. Niemeijer, M. A. Viergever, and B. Van Ginneken, "Ridge-based vessel segmentation in color images of the retina," IEEE transactions on medical imaging, vol. 23, no. 4, pp. 501–509, 2004. [49] J. I. Orlando, H. Fu, J. B. Breda, K. van Keer, D. R. Bathula, A. Diaz- Pinto, R. Fang, P.-A. Heng, J. Kim, J. Lee, et al., "Refuge challenge: A unified framework for evaluating automated methods for glaucoma assessment from fundus photographs," Medical image analysis, vol. 59, p. 101570, 2020. [50] K. He, J. Sun, and X. Tang, "Single image haze removal using dark channel prior," IEEE transactions on pattern analysis and machine intelligence, vol. 33, no. 12, pp. 2341–2353, 2010. [51] Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli, "Image quality assessment: from error visibility to structural similarity," IEEE transactions on image processing, vol. 13, no. 4, pp. 600–612, 2004. [52] Z. Gu, J. Cheng, H. Fu, K. Zhou, H. Hao, Y. Zhao, T. Zhang, S. Gao, and J. Liu, "Ce-net: Context encoder network for 2d medical image segmentation," IEEE transactions on medical imaging, vol. 38, no. 10, pp. 2281–2292, 2019. [53] D.-P. Fan, G.-P. Ji, T. Zhou, G. Chen, H. Fu, J. Shen, and L. Shao, "Pranet: Parallel reverse attention network for polyp segmentation," in International Conference on Medical Image Computing and Computer- Assisted Intervention, pp. 263–273, Springer, 2020. [54] "Peking university international competition on ocular disease intelli- gent recognition (odir-2019)." [Online], 2019. https://odir2019. grand-challenge.org/dataset/. [55] C. Jordi, N. Joan Manuel, and V. Carles, "Ocular disease intelligent recognition through deep learning architectures," Universitat Oberta de Catalunya: Barcelona, Spain, pp. 1–114, 2019. [56] T. A. Soomro, A. J. Afifi, L. Zheng, S. Soomro, J. Gao, O. Hellwich, and M. Paul, "Deep learning models for retinal blood vessels segmentation: a review," IEEE Access, vol. 7, pp. 71696–71717, 2019.
http://arxiv.org/abs/2302.11793v2
2023-06-14T13:43:44
2023-02-23T06:13:51
Revisiting the Gumbel-Softmax in MADDPG
MADDPG is an algorithm in multi-agent reinforcement learning (MARL) that extends the popular single-agent method, DDPG, to multi-agent scenarios. Importantly, DDPG is an algorithm designed for continuous action spaces, where the gradient of the state-action value function exists. For this algorithm to work in discrete action spaces, discrete gradient estimation must be performed. For MADDPG, the Gumbel-Softmax (GS) estimator is used -- a reparameterisation which relaxes a discrete distribution into a similar continuous one. This method, however, is statistically biased, and a recent MARL benchmarking paper suggests that this bias makes MADDPG perform poorly in grid-world situations, where the action space is discrete. Fortunately, many alternatives to the GS exist, boasting a wide range of properties. This paper explores several of these alternatives and integrates them into MADDPG for discrete grid-world scenarios. The corresponding impact on various performance metrics is then measured and analysed. It is found that one of the proposed estimators performs significantly better than the original GS in several tasks, achieving up to 55% higher returns, along with faster convergence.
[ "Callum Rhys Tilbury", "Filippos Christianos", "Stefano V. Albrecht" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11793v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11793v2", "@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.MA", "stat.ML" ]
Revisiting the Gumbel-Softmax in MADDPG Callum Rhys Tilbury University of Edinburgh Edinburgh, United Kingdom [email protected] Filippos Christianos University of Edinburgh Edinburgh, United Kingdom [email protected] Stefano V. Albrecht University of Edinburgh Edinburgh, United Kingdom [email protected] 3 2 0 2 n u J 4 1 ] G L . s c [ 2 v 3 9 7 1 1 . 2 0 3 2 : v i X r a ABSTRACT MADDPG is an algorithm in multi-agent reinforcement learning (MARL) that extends the popular single-agent method, DDPG, to multi-agent scenarios. Importantly, DDPG is an algorithm designed for continuous action spaces, where the gradient of the state-action value function exists. For this algorithm to work in discrete ac- tion spaces, discrete gradient estimation must be performed. For MADDPG, the Gumbel-Softmax (GS) estimator is used-a repa- rameterisation which relaxes a discrete distribution into a similar continuous one. This method, however, is statistically biased, and a recent MARL benchmarking paper suggests that this bias makes MADDPG perform poorly in grid-world situations, where the ac- tion space is discrete. Fortunately, many alternatives to the GS exist, boasting a wide range of properties. This paper explores several of these alternatives and integrates them into MADDPG for discrete grid-world scenarios. The corresponding impact on various perfor- mance metrics is then measured and analysed. It is found that one of the proposed estimators performs significantly better than the original GS in several tasks, achieving up to 55% higher returns, along with faster convergence. KEYWORDS Discrete Gradient Estimation, Gumbel-Softmax, Multi-Agent Rein- forcement Learning, MADDPG 1 INTRODUCTION In recent years, interest in the field of reinforcement learning (RL) has grown markedly. Though in existence for over three decades, the discipline's recent integration with deep learning, often called deep RL, has catalysed a renewed hope for its capabilities. Such excitement is certainly warranted: deep RL algorithms have been excelling consistently on a wide range of challenges, many of which seemed unthinkable in the past. Commonly cited feats include conquering popular games, both modern and ancient [5, 37, 44, 47]. An important type of problem in RL is where not only a single agent acts, but multiple agents. These agents act together, either adversarially, co-operatively, or some combination thereof. Broadly, this paradigm is termed multi-agent RL (MARL). Algorithms devel- oped for single-agent contexts can be applied for multiple agents, where each agent simply learns independently, e.g. independent Q- learning [41]. Though suitable for some tasks, this approach strug- gles to learn desired behaviours in certain complex environments, such as those with partial observability [32]. As an alternative, researchers have developed MARL-specific algorithms-either by extending extant single-agent approaches to multi-agent scenarios, or by developing new algorithms altogether. One of the earliest algorithms proposed for deep MARL (that is, MARL with the integration of deep learning) was MADDPG, by Lowe et al. [27]. In this work, the authors extended the single- agent DDPG [24] method, which is itself an extension of the DPG [38] method, to multi-agent scenarios. Crucially, DPG and its descen- dants are designed to work only with continuous action spaces, where each action comes from an uncountable, continuous domain; e.g. the torque applied to motor. The alternative is a discrete action space, which has countable set of possibilities; e.g. choosing to go up or down. The restriction to continuous domains is because the gradient of the state-action value function, taken with respect to the action, must exist. In a discrete action context, this gradient does not exist. Despite this restriction, it seems that the authors of MADDPG desired a unified algorithm, which could be applied to both contin- uous and discrete problems, while still building on the foundations of DPG. To enable MADDPG to work in discrete situations, then, a mathematical trick was applied: the Gumbel-Softmax (GS) repa- rameterisation [18, 28]. Essentially, this trick 'relaxes' the discrete, non-differentiable action space into a somewhat equivalent, con- tinuous space-thus allowing an approximation of the gradient to exist. Relaxing the space in this way, however, introduces statistical bias into the gradient computation. Recently, a benchmarking paper by Papoudakis et al. [32] found that MADDPG achieved decent performance in certain MARL envi- ronments, but performed markedly worse in grid-world situations, where the action space is discrete. The authors suggested that this degradation of performance may be due to the bias from the GS. Interestingly, this field of discrete gradient estimation appears in a host of contexts outside of MARL [21, 35, 48]. As a result, a wealth of alternatives has been proposed for the GS, many of which focus on lowering the bias it introduces [10, 23, 33]. As of yet, though, it seems that not many of these techniques have been integrated into MARL, and certainly not into MADDPG. Accordingly, we ask: Can alternative discrete gradient estimation methods improve the per- formance of MADDPG in grid-world environments, when compared to the original Gumbel-Softmax reparameterisation? In this paper, we study four alternative estimators: two with simple changes to the existing GS (decreasing or annealing the relaxation temperature used), and two novel methods from the literature [10, 33]. We test these estimators with MADDPG in nine grid-world tasks, as a subset of those in the benchmarking paper by Papoudakis et al. [32]. We find that the Gapped Straight Through (GST) [10] estimator yields the most significant improvements, with faster convergence and up to 55% higher returns. Finally, we look at the variance of the gradients from the GST compared to those from the GS for one of the tasks, to help us understand the performance gains observed. We release our code online1. Proc. of the Adaptive and Learning Agents Workshop (ALA 2023), Cruz, Hayes, Wang, Yates (eds.), May 29-30, 2023, London, UK, https:// alaworkshop2023.github.io/ . 2023. 1https://github.com/uoe-agents/revisiting-maddpg 2 BACKGROUND We consider a multi-agent learning problem, which we model as a partially-observable stochastic game (POSG) [16, 36], operating in discrete time-steps, with a set of N agents, N = {1, . . . , N }. Denote the state-space as S, the joint-action space as A = A1 × * * * × AN , and the joint-observation space as O = O1 × * * * × ON . At each time- step, each agent i ∈ N takes an action ai ∈ Ai , and perceives a local observation, oi ∈ Oi , which depends on the current state and the joint-action taken. We define a transition function, P : S ×A ×S ↦→ [0, 1], which describes the probability of transitioning from one state to another, given a joint action. We further define a reward function for each agent, Ri : S × A × S ↦→ R. Let the reward given to agent i at time-step t be denoted as r (t ) . We define the return for γtr (t ) an agent i as its discounted cumulative reward, Gi = (cid:205)T , i where T is the number of time-steps in an episode, and γ ∈ (0, 1] is a discounting factor-controlling how much we care about future rewards relative to current rewards. The game begins in an initial state, which depends on the distribution ρ = S ↦→ [0, 1]. t =0 i Denote each agent's policy (that is, what action it should take in a given state) as πi , with the set of all policies being π = {π1, . . . , πN }. The objective in MARL, then, is to find policies such that the return of each agent i, following πi , is maximised with respect to the other agents' policies, π−i := {π\πi }. That is, we aim to find an optimal set of policies, π, such that E(cid:2)Gi | ˆπi, π−i (cid:3) ∀i : πi ∈ arg max ˆπi (1) Our focus here is on policy gradient methods, where each agent's policy is explicitly encoded as a parametric distribution over actions given the state: πi (a | s; θ ). Assuming the policy is differentiable with respect to its parameters (i.e. exists), an optimal policy can be found through gradient ascent of the expected return. To optimise this expectation, one can apply the Stochastic Policy Gradient Theorem [40]: ∂π (a |s;θ ) ∂θ ∇θ Eπ [r (s, a)] = Eπ [∇θ log π (a | s; θ ) Qπ (s, a)] (2) where Qπ (cid:0)si, ai (cid:1) := Eπ [Gi | si, ai ], the state-action value function. Notice that the gradient, ∇θ , is taken with respect to the policy parameters, which exists if our policy is designed to be sufficiently smooth. This approach is simple and has been popular; e.g. esti- mating Qπ (s, a) with the sampled return yields the REINFORCE algorithm [46]. However, it has been shown to suffer from high variance [30]. Taking a different angle, Silver et al. [38] introduced the Deter- ministic Policy Gradient (DPG) method. Here, instead of trying to learn a stochastic policy, the policy is deterministic: a = μ (s; θ ). The result is the Deterministic Policy Gradient Theorem: ∇θ Eμ (cid:2)r (s, a = μ (s; θ ))(cid:3) = Eμ (cid:2)∇θ μ (s; θ ) ∇a Q μ (s, a)(cid:3) Notice the key difference now: a gradient is also taken with respect to the actions, ∇a. Importantly, this difference means one cannot use DPG in discrete action problems, for this gradient does not exist. (3) DDPG [24] extends the DPG method by integrating it with deep neural networks, and incorporating techniques introduced in the DQN paper [29]: separate 'behaviour' and 'target' networks with Polyak averaging, and the use of a replay buffer. MADDPG [27] then applies DDPG to the multi-agent setting. At the heart of MADDPG is the Centralised Training, Decentralised Execution (CTDE) paradigm. Here, each agent's state-action value function (i.e. critic) is learned in a centralised manner, endowed with the joint observations and joint actions taken: Qi (o, a). These critic networks, parameterised by φi , are updated by minimising the loss, Lc : ∇φi Lc (φi ) = ∇φi (cid:16) ri + γ ̄Qi (cid:16) o′, ̄μ1 (o′ 1), . . . , ̄μN (o′ N ) (cid:17) − Qi (o, a) (cid:17)2 where ̄μi denotes the target policy networks, and ̄Qi the target critic networks. Whereas the critic networks in MADDPG are centralised, notice that the policy networks are decentralised-with each agent con- sidering only their local observation, μi (oi ). These networks are updated using the sampled policy gradient: −∇θi La (θi ) = ∇θi μi (oi ) ∇ai Qi (o, a1, . . . , ai, . . . , aN )(cid:12) (cid:12)ai =μi (oi ) Notice again, as in (3), that a gradient is taken with respect to the action, ∇ai Qi , which does not exist with discrete actions. The authors of both DPG and DDPG paid no attention to this restriction, for their methods were presented explicitly for continuous action problems. In contrast, the MADDPG algorithm was presented for both continuous and discrete cases. To enable the gradient to exist in the latter, the authors used the Gumbel-Softmax (GS) trick [18, 28] to the discrete actions taken, thus enabling an approximation of ∇ai Qi to exist. 3 DISCRETE GRADIENT ESTIMATION In this work, we consider four alternatives to the original GS trick: two of which apply simple changes to the extant method, and two of which are novel methods drawn from the literature. We now provide brief explanations of these techniques, starting with the original GS method. We consider a situation of a parametric discrete distribution, p (a; ζ ), specified by an unconstrained vector of parameters, ζ ∈ RN . In this context, these parameters represent the outputs of a policy network, where actions are sampled as a ∼ p (a; ζ ). We seek an estimation of ∇a p (a; ζ ), but since a is discrete, we must 'relax' the distribution for this gradient to exist. 3.1 Baseline (STGS-1) The GS method was introduced concurrently by Jang et al. [18] and Maddison et al. [28], as a differentiable approximation of the arg max function. As its name suggests, a tempered softmax is used, with a temperature parameter, τ > 0: softmaxτ (x) := softmax( x τ ). In the limit of τ → 0, this operation is equivalent to the arg max, and thus the GS approaches the original distribution. Conversely, as τ → ∞, the GS approaches a uniform distribution, where each category is equally-likely. The temperature thus controls the degree of relaxation. Using ξGS (*) to notate the GS, the relaxed distribution is: ξGS (p (ai ; ζ )) = softmaxτ (ζi + gi ) , gi ∼ G (0, 1) (4) where gi is noise sampled from the Gumbel distribution [31]. By relaxing the distribution in this way, it becomes differentiable, meaning we can incorporate it into a gradient-based optimisation procedure. There is a downside, however: in relaxing, we introduce statistical bias [33]. To understand this bias intuitively, consider again the limit τ → ∞, where the distribution becomes uniform. In such a case, we have removed all parametric information, ζ , about our problem-each category simply has a probability of 1/N . Hence, as we relax, we also steer further away from the original distribution. Herein lies a trade-off: turning the temperature too low means having extreme gradients (or non-existent gradients when τ = 0), but turning the temperature too high means introducing a large bias. Though such a bias is inevitable when relaxing the distribution, there is an easy improvement to the vanilla GS. By naïvely ap- plying the relaxation, we introduce bias in both the forward pass (when we sample from the distribution) and in the backward pass (when we calculate the gradients, e.g. for updating our neural net- work). However, it is only the latter that requires differentiability. Hence, building on the so-called Straight-Through estimator pro- posed by Bengio et al. [4], Jang et al. [18] also introduce the STGS estimator-where, in the backward pass, the GS relaxation is ap- plied, but in the forward pass, the original arg max operation is used. MADDPG uses this variant, and all further discussions focus on it. In both the original MADDPG paper [27] and the benchmarking paper by Papoudakis et al. [32], it seems that the authors simply use a temperature of 1.0 for the STGS relaxation2. Thus, we use this configuration as our baseline, denoted as STGS-1. 3.2 Lower Temperature Gumbel Softmax (STGS-T) Recall that Papoudakis et al. [32] suggest it is the bias that is prob- lematic in the STGS, which is positively correlated to the tem- perature of relaxation-lowering the temperature lowers the bias. Accordingly, our first alternative estimator is the simplest: the STGS estimator with a temperature of τ < 1.0, where τ is a tunable hy- perparameter, denoted as STGS-T. 3.3 Temperature-Annealed Gumbel Softmax (TAGS) The exploitation-exploration dilemma [39]-which describes the trade-off between taking actions that yield known, good rewards (exploiting), and taking actions which may or may not yield better rewards (exploring)-is often discussed in RL. In the continuous- action formulation of MADDPG [27, Appx: Alg. 1], exploration is achieved via the addition of noise to the policy output: ai = μi (oi ) + ηi , where η is drawn from some random process (originally discussed in DDPG [24]). However, in discrete cases, the STGS itself provides some degree of exploration, since relaxing the distribution places some probability mass onto other actions. As a result, the amount of exploration is controlled by the temperature parameter: more relaxation implies more exploration. Notice, then, the coupling between the exploration achieved and the bias introduced. Since exploration is usually desirable in the beginning of a train- ing procedure, we propose setting the temperature to be high early- on, and then annealing it to be lower over time. This strategy allows agents to explore, while still reducing the bias in later stages of 2Nothing is explicitly stated about the temperature used in these papers; we are making such conclusions by looking at their code implementations: Link to snippet from Lowe et al. [27]; Link to snippet from Papoudakis et al. [32]. training. Huijben et al. [17] highlight temperature-annealing as a strategy incorporated by several authors in various experiments with the STGS. Specifically, they mention using an exponentially- decaying annealing scheme, which we adopt here. We define this estimator as the Temperature-Annealed Gumbel Softmax (TAGS). 3.4 Gumbel-Rao Monte Carlo (GRMCK) The next estimator is drawn from the literature, entitled the Gumbel- Rao Monte Carlo (GRMC), by Paulus et al. [33]. Here, the authors seek a way to lower the STGS's variance. Notating the gradient of the original STGS estimator as ∇STGS = ∇aξSTGS, we have: ∇STGS := dsoftmaxτ (ζ + g) da (5) With this notation, the authors propose the Gumbel-Rao estimator: (cid:21) ∇GR := E (cid:20) dsoftmaxτ (ζ + g) da That is, ∇GR = E[∇STGS | a]. This estimator is a Rao-Blackwell [6] version of the original STGS estimator. It can be shown that it thus enjoys the same mean as the STGS, but with lower (or at most, the same) variance: (6) (cid:12) (cid:12) (cid:12) a (7) E (cid:2)||∇GR − ∇ζ ||2(cid:3) ≤ E (cid:2)||∇STGS − ∇ζ ||2(cid:3) where ∇ζ is the true gradient. For rigorous mathematical details about the estimator's impact on variance, the reader is encouraged to see the full paper [33]. Recall that Papoudakis et al. [32] consider the bias of the estimator to be the problem for MADDPG, not the variance. Though guarantees are only made about the latter, the authors of the GRMC argue that with a lower variance, one can safely train the estimator at lower temperatures-i.e. with a lower bias. Empirically, they show this idea to be true. Though theoretically appealing, there is still the challenge of actually computing E[dsoftmaxτ (ζ + g)/da | a]-indeed, a closed- form expression is shown to be difficult. Therefore, the authors provide a Monte Carlo estimate, with K samples, which they term the GRMCK estimator. They first show a distributional equiva- lence: d = (ζ j + gj | a) (cid:40)− log(E j ) + log Z (ζ ) E j Ei exp(ζ j ) + − log Z (ζ ) where a is a one-hot sample with a 1 at index i, E j are i.i.d. samples from the exponential distribution, and Z (ζ ) = (cid:205)j exp(ζ j ). otherwise if j = i (8) (cid:16) (cid:17) They then define the GRMCK estimator as: ∇GRMCK := 1 K K ∑︁ k dsoftmaxτ (ζ + gk ) da , gk ∼ (ζ + g | a) (9) In other words, we first sample a ∼ p (a; ζ ), and then average over K Gumbel noise samples conditioned on a. 3.5 Gapped Straight-Through (GST) The final estimator considered is the most recently introduced: the Gapped Straight Through (GST), by Fan et al. [10]. Here, the authors find that the Gumbel randomness used in the STGS and GRMCK can be replaced with two deterministic perturbations, resulting in an estimator with lower variance. As in the GRMC estimator, we first draw a ∼ p (a; ζ )-a one- hot representation of the selected action-for the straight-through sample. In GRMC, we would then perturb each of the logits, ζ , with Gumbel noise conditioned on a; now, we perturb with two functions, m1 (ζ , a) and m2 (ζ , a). Detailed justifications of these functions are given in the paper itself [10]. Firstly, we desire consistency in the estimator: we want the sam- ple conditioned on a to have the same largest logit as the input distribution; i.e. maxj ζ j . To this end, the first perturbation, m1, pushes the sample to the correct realisation, if necessary: m1 (ζ , a) = (max j ζ j − ⟨ζ , a⟩) * a (10) where ⟨*, *⟩ indicates the inner product. Consider how this works: if a has already selected the largest logit, then ⟨ζ , a⟩ = maxj ζ j , and m1 = 0. If not, then m1 ≠ 0, and the sample is moved in the direction of the largest logit. If non-zero, the first perturbation makes the largest logit the same as the a-selected logit. However, we also want a strict gap between these values-that is, we want the unselected logits to be smaller. Accordingly, we define m2 to create a gap of κ between them: m2 (ζ , a) = −(κ + ζ − max j ζ j )+ ⊙ (1 − a) (11) where (x)+ := max(0, x), ⊙ indicates the Hadamard product. The value of κ can usually be set to 1.0 [10]. Here, the term (1 − a) takes all the unselected logits in the one-hot representation, and moves their parameter values away from the selected logit, with a gap of at least κ. With these perturbation functions defined, the GST estimator is then: ξGST (p (a; ζ )) = softmaxτ (ζ + m1 (ζ , a) + m2 (ζ , a)) (12) 4 EXPERIMENTAL METHODS 4.1 Environments To test the performance of the proposed gradient estimators com- pared to the original STGS estimator, we train on two grid-world environments, across a total of nine tasks (i.e. configurations). For simplicity, we choose to focus solely on co-operative contexts, where agents are working together to maximise their cumulative reward-we feel this approach is sufficient to answer our research question. We use a sensible subset of the choices made by Pa- poudakis et al. [32] in their benchmarking paper: seven tasks in Level-Based Foraging (LBF)3 [1, 8], and two in Multi-Robot Ware- house (RWARE)4 [2, 8]. 4.2 Evaluation Metrics To understand the success (or failure) of the new gradient estimation techniques compared to the original STGS approach, metrics for evaluation are now defined. Returns: Maximum & Average. Recall that we define our MARL goal, in (1), as trying to find an optimal set of policies, such that each agent maximises their expected return with respect to the other agents' policies. Since we focus on co-operative situations 3Code: https://github.com/semitable/lb-foraging 4Code: https://github.com/semitable/robotic-warehouse for this paper, we simply consider the sum of the achieved returns from all agents. Importantly, we are not concerned with the returns achieved here relative to those achieved in, e.g., the MARL bench- marking paper by Papoudakis et al. [32]. Instead, for cogent and consistent analysis, we focus solely on the relative performance of the various estimators against each other. For this evaluation metric, we run the MADDPG algorithm in each task, with each of the proposed gradient estimators. We train the algorithm for a fixed number of time-steps, updating the net- works with a defined period. Throughout training, we evaluate the achieved returns 100 times every 50 000 time-steps. Each train- ing iteration is done over five random seeds and a 95% confidence interval is calculated over the results. Under this heading, we consider two distinct aspects of the achieved returns, following the lead of Papoudakis et al. [32]. Firstly, we consider the maximum return: the evaluation time-step at which the return, averaged over the five seeds, is highest-indicating the peak performance of the algorithm when using a given estimator. Secondly, we consider the average return: the mean of the evalua- tion returns over all time-steps and seeds, for a given estimator in a given task-a proxy for understanding not just the magnitude of the returns, but how quickly the training converges. Compute Time. Though this paper revolves around-and is motivated by-the MADDPG algorithm, notice that the gradient estimators can also be compared in isolation. That is, when compar- ing the computational burden of the various estimation procedures, we need not integrate them into the broader MADDPG problem. Instead, we can take a closer look solely at each estimator's perfor- mance, unhindered by potential bottlenecks elsewhere. Accordingly, we define here a simple, toy problem for the estima- tors. We define a set of input logits, ζ , of various dimensionalities, and measure the time it takes for each estimator to calculate the corresponding relaxations. Because STGS-1, STGS-T, and TAGS all have the same underlying mechanics, we consider these under the single umbrella of the STGS. For the GRMCK, we consider three values of K: 1, 10, and 50. For each dimensionality, the esti- mation procedure is repeated 10 000 times, over five different logit instances. These results are reported over a 95% confidence interval. Gradient Variance. Suppose one of the alternative gradient estimation techniques performs significantly better or worse than the original STGS, based on the returns achieved. The natural follow- up question is: why? As an initial step to answering this question, we choose one of the tasks where there is a notable difference in performance between two estimators: between the baseline STGS-1 method and one which performs much better (or worse). We then retrain the MADDPG algorithm in this task, using each of the two estimators, now logging the variance of the computed gradients across each training mini-batch, over the course of training. We hypothesise that uninformative gradients, i.e. those due to a poor discrete gradient estimator, will yield a mini-batch with low variance, since there are no elements in particular which 'stand out'. In contrast, we believe that informative gradients will have higher variance across the mini-batch, for the opposite reason. We hope for this metric to stimulate future discussion into why we might observe a difference in estimator performance. 4.3 Training Details Hyperparameter tuning is an important, though time-consuming, component of training RL algorithms. For simplicity, then, the opti- mal hyperparameters for the core MADDPG algorithm suggested by Papoudakis et al. [32] are adopted here, mostly without any changes. Our hyperparameter search is thus limited to be over the novel gradient estimation techniques and their associated pa- rameters. Bayesian optimisation [11] is performed for this search, and we use search-range suggestions from the literature, when available [17, 33]. Each parameter is optimised for one task in a particular environment, and then used for all other tasks in that environment. The resulting hyperparameters can be found online5, along with the code used for all experiments. 5 EXPERIMENTAL RESULTS & DISCUSSION 5.1 Returns: Maximum & Average Table 1 shows the maximum and average returns achieved using each gradient estimation technique, across each of the nine tasks. Discussion of these results follows, per environment, with plots shown when relevant. Table 1: Maximum returns (Average returns) shown across all tasks and all algorithms, presented with a 95% confidence in- terval over 5 seeds. Bold indicates the best performing metric for a situation. An asterisk (∗) indicates that a given metric is not significantly different from the best performing metric in that situation, based on a heteroscedastic, two-sided t-test with 5% significance. Under each task name is the number of time-steps used for training. Tasks STGS-1 STGS-T TAGS GRMCK GST F 8x8-2p-2f-c B L [5M] 1.00 ± 0.00 (0.88 ± 0.05) 1.00 ± 0.01 (0.91 ± 0.04) 1.00 ± 0.01 (0.87 ± 0.05) 1.00 ± 0.00 (0.88 ± 0.05) 1.00 ± 0.00 (0.89 ± 0.04) 8x8-2p-2f-2s-c [5M] 0.79 ± 0.07∗ (0.65 ± 0.04) 0.83 ± 0.03 (0.66 ± 0.04) 0.78 ± 0.03∗ (0.62 ± 0.04) 0.81 ± 0.05∗ (0.67 ± 0.04) 0.81 ± 0.02∗ (0.68 ± 0.03) 10x10-3p-3f [6M] 0.75 ± 0.03 (0.58 ± 0.04) 0.75 ± 0.03 (0.59 ± 0.03) 0.74 ± 0.06 (0.51 ± 0.04) 0.71 ± 0.07 (0.57 ± 0.03) 0.79 ± 0.04 (0.66 ± 0.03) 10x10-3p-3f-2s [6M] 0.55 ± 0.05∗ (0.48 ± 0.01) 0.58 ± 0.06 (0.48 ± 0.01) 0.54 ± 0.03 (0.46 ± 0.01) 0.56 ± 0.03∗ (0.49 ± 0.01) 0.56 ± 0.05∗ (0.50 ± 0.01) 15x15-3p-5f [7.5M] 0.24 ± 0.02 (0.12 ± 0.01) 0.28 ± 0.06 (0.15 ± 0.01) 0.20 ± 0.03 (0.08 ± 0.01) 0.26 ± 0.05 (0.16 ± 0.01) 0.31 ± 0.04 (0.20 ± 0.01) 15x15-4p-3f [7.5M] 0.79 ± 0.03 (0.54 ± 0.04) 0.79 ± 0.06 (0.58 ± 0.04) 0.77 ± 0.06 (0.45 ± 0.04) 0.79 ± 0.04 (0.58 ± 0.04) 0.83 ± 0.04 (0.67 ± 0.03) 15x15-4p-5f [7.5M] 0.33 ± 0.06 (0.13 ± 0.02) 0.46 ± 0.12 (0.22 ± 0.02) 0.24 ± 0.05 (0.10 ± 0.01) 0.43 ± 0.06 (0.21 ± 0.02) 0.48 ± 0.06 (0.30 ± 0.02) E R A W R tiny 2ag [7.5M] tiny 4ag [7.5M] 1.37 ± 0.22∗ (0.55 ± 0.07) 1.37 ± 0.49∗ (0.64 ± 0.08) 1.50 ± 0.46 (0.60 ± 0.08) 1.37 ± 0.40∗ (0.65 ± 0.07) 1.40 ± 0.58∗ (0.65 ± 0.07) 2.68 ± 0.49 (0.84 ± 0.12) 3.18 ± 0.60 (1.09 ± 0.15) 2.23 ± 0.50 (0.78 ± 0.11) 3.17 ± 0.85 (1.15 ± 0.15) 4.16 ± 0.97 (1.82 ± 0.21) Level-Based Foraging. We consider now the seven LBF tasks. Firstly, we look at two tasks with two agents over an 8 × 8 grid: one with full-observability (8x8-2p-2f), and one with partial-observability (8x8-2p-2f-2s). Notice in these results, in Table 1, that performance differences across the estimation techniques is statistically insignifi- cant. In 8x8-2p-2f, we see that STGS-T trains marginally faster than 5https://github.com/uoe-agents/revisiting-maddpg the other approaches, and in 8x8-2p-2f-2s, we see that TAGS trains marginally slower than the other approaches-both based on the average returns observed. Nonetheless, each algorithm arrives at a similar maximum return. Due to the insignificance of this result, the training curves are uninteresting, and are not plotted here. We next look at two tasks with three agents over an 10 × 10 grid, with similar situations as before: one with full-observability (10x10-3p-3f), and one with partial-observability (10x10-3p-3f-2s). Plots of the evaluation returns over the duration of training are given in Figure 1. (a) lbf-10x10-3p-3f (b) lbf-10x10-3p-3f-2s Figure 1: Evaluation returns for two LBF tasks (10 × 10) over the training period, where the shaded region indicates the standard error as calculated over 5 seeds. In the first task, seen in Figure 1a, we see an improvement with a novel gradient estimation technique: the GST achieves the highest maximum and average returns for the task, beating the baseline STGS-1 method with statistical significance. It is clear in the figure how training with the GST converges faster than with the other methods. STGS-T and GRMCK perform similarly to the baseline. TAGS, however, performs much worse in average returns-i.e. it converges slower for the task-though it eventually achieves similar maximum returns. In the task with partial observability, seen in Figure 1b, we are less successful-the alternative techniques achieve statistically sim- ilar returns to the baseline, across both maximum and average metrics. The exception is TAGS, which again performs worse than the baseline, though not markedly so. We consider now the remaining three tasks in LBF, with a fully- observable, 15 × 15 grid, with three or four agents: 15x15-3p-5f, 15x15-4p-3f, and 15x15-4p-5f. We note that MADDPG performed particularly poorly in these larger, more-complex LBF situations, according to the benchmarking paper by Papoudakis et al. [32]. The training curves for each of these tasks is given in Figure 2. We notice here significant improvements over the baseline. Yet again, TAGS markedly underperforms, both in maximum and av- erage returns; but the other estimators perform well. STGS-T and GRMCK beat the baseline in average returns for 15x15-3p-5f and ReturnStepGSTSTGS-TSTGS-1TAGSGRMCK01M2M3M4M5M00.20.40.60.8ReturnStepGSTSTGS-TSTGS-1TAGSGRMCK01M2M3M4M5M00.10.20.30.40.50.6 (a) lbf-15x15-3p-5f (a) rware-tiny-2ag (b) lbf-15x15-4p-3f (b) rware-tiny-4ag (c) lbf-15x15-4p-5f Figure 2: Evaluation returns for three LBF tasks (15 × 15) over the training period, where the shaded region indicates the standard error as calculated over 5 seeds. 15x15-4p-3f, and in both average and maximum returns for 15x15- 4p-5f. GST is superior throughout: across all three tasks, it yields significantly higher returns and converges faster than the baseline (and the other techniques). Indeed, these improvements are clearly noticeable in the plots provided. Multi-Robot Warehouse. Next, we consider the RWARE en- vironment for two tasks over a 10 × 11 grid: one with two agents (tiny-2ag) and one with four agents (tiny-4ag). Figure 3 shows the returns for these two environments, over the training period. In tiny-2ag, we see insignificant differences across the estima- tion techniques, with each achieving similar maximum returns. The alternative techniques do converge slightly faster, particularly GRMCK and GST, with marginally higher average returns, but not by much. In tiny-4ag, we see the most significant improvements yet. Bar- ring TAGS, which somewhat underperforms, we notice substantial improvements from the other proposed estimators, for both average and maximum returns. GST triumphs once more, achieving 55% higher maximum returns over the baseline, and over double the average returns. This result is again clear in the plot, in Figure 3b. Discussion. This section presented the results from training MADDPG with each of the proposed gradient estimation tech- niques, across nine tasks from two grid-world environments. In simpler tasks, the alternative techniques do not make a significant difference to the returns achieved. We suspect this outcome is be- cause informative gradients are not as crucial in simple tasks. That Figure 3: Evaluation returns for two RWARE tasks (tiny grid) over the training period, where the shaded region indicates the standard error as calculated over 5 seeds. is, the gradient estimation is not a problematic aspect of the training, and limitations arise elsewhere in the mechanics of MADDPG. Interestingly, in some of the more challenging tasks, particularly in LBF with a grid-size of 15 × 15, and tiny-4ag in RWARE, we see significant improvements. We note that simply lowering the temperature (and hence, the gradient estimator's bias), as in STGS- T, can improve the results somewhat-supporting the hypothesis that the bias introduced by the STGS is a problem for MADDPG. The Rao-Blackwellisation procedure of GRMCK also sees better returns and faster convergence. Much better than these alterna- tives, though, is the GST. With this estimator, we consistently see marked improvements across the two return metrics, and these are statistically significant. Though a lower temperature seems to yield better returns, our re- sults suggest that annealing the temperature, as in TAGS, performs poorly. This result may be due to the coupling of exploration and ex- ploitation, as highlighted earlier, but more investigation is required. Alternatively, it may simply be the hyperparameters chosen-the an- nealing start and end points were taken from the advice of Huijben et al. [17]. It is conceivable that using lower values here may yield better returns, especially considering the improvements seen with STGS-T. Future work could also explore using alternative annealing schemes, or annealing with a different underlying estimator-e.g. one could try a temperature-annealed GST. From these results, considering both the maximum returns and the time to convergence, we note that alternative gradient estima- tion techniques can indeed yield better returns when incorporated into MADDPG, particularly the recently proposed GST, from Fan et al. [10]. 5.2 Compute Time We now consider the computational requirements for each of the algorithms, using the toy problem outlined earlier. Recall that we ReturnStepGSTSTGS-TSTGS-1TAGSGRMCK02M4M6M00.050.10.150.20.250.3ReturnStepGSTSTGS-TSTGS-1TAGSGRMCK02M4M6M00.20.40.60.8ReturnStepGSTSTGS-TSTGS-1TAGSGRMCK02M4M6M00.10.20.30.40.5ReturnStepGSTSTGS-TSTGS-1TAGSGRMCK02M4M6M00.511.502M4M6M01234ReturnStepGSTSTGS-TSTGS-1TAGSGRMCK perform these tests for three classes of estimator: STGS (which ac- counts for STGS-1, STGS-T, and TAGS); GRMC (with three different K values); and GST. Table 2 shows the outcome of these tests. their experiments), but the computational burden will only worsen in such a case, which is undesirable. TAGS, as it was presented here, should not be used. Table 2: Time-per-relaxation, in μs, for the three classes of gradient estimators, when using logits of various dimension- ality as input. Results are given over a 95% confidence interval from 5 different logit instances, where each procedure is re- peated 10 000 times. Underneath each metric, using round brackets, (*), we indicate how much slower the alternative techniques are, when compared to the baseline STGS. ↓ Dimensionality STGS GRMC-1 GRMC-10 GRMC-50 GST 3 5 10 50 100 1000 135.28 ± 0.19 (1.0) 445.91 ± 11.38 (3.3) 446.65 ± 0.86 (3.3) 486.36 ± 1.7 (3.6) 357.56 ± 1.04 (2.64) 135.65 ± 0.51 (1.0) 438.52 ± 0.63 (3.23) 446.66 ± 0.7 (3.29) 501.9 ± 1.16 (3.7) 356.95 ± 0.6 (2.63) 135.83 ± 0.48 (1.0) 438.95 ± 1.01 (3.23) 451.65 ± 0.82 (3.33) 531.97 ± 0.45 (3.92) 356.52 ± 0.55 (2.62) 134.05 ± 0.89 (1.0) 440.46 ± 1.01 (3.29) 484.77 ± 1.29 (3.62) 765.56 ± 2.09 (5.71) 356.77 ± 1.77 (2.66) 139.23 ± 0.25 (1.0) 455.54 ± 2.97 (3.27) 520.06 ± 0.78 (3.74) 1055.18 ± 4.16 (7.58) 359.26 ± 1.26 (2.58) 154.17 ± 0.45 (1.0) 533.12 ± 1.01 (3.46) 1060.74 ± 2.92 (6.88) 6171.59 ± 8.67 (40.03) 386.57 ± 1.36 (2.51) We notice firstly that STGS scales well with dimensionality-the computational overhead when increasing the dimension does not change significantly. Even in the high-dimensional case of 1 000, the technique is only marginally slower. These benefits are common to the baseline STGS-1 approach, as well as the proposed techniques of STGS-T and TAGS. Next, we see that GRMCK is at least three times slower than the baseline approach. Moreover, using a larger K value does, un- derstandably, increase the computational burden of the relaxation. Though this effect is not substantial for low-dimensional inputs, for higher-dimensional problems, K has a marked impact-e.g. with K = 50, computation slows down considerably, becoming 40 times slower than the baseline for an input dimension of 1 000. The computational burden of GST sits somewhat in-between the baseline, STGS, and the GRMCK approach. Importantly, though, this method also scales well with dimensionality, staying at just over 2.5 times slower than the baseline, irrespective of the input size-an attractive property. From these results, and the insights drawn from the previous section, we can draft general guidelines for choosing an alternative estimator: if minimising the computational burden is paramount for a given problem, it may be worth using the STGS-T, for it has the same overhead as the STGS-1, and it does yield improvements in both the achieved returns and convergence time. However, if one can afford a more expensive relaxation procedure, the GST is a good fit-it is somewhat slower, but the benefits are significant. Since GRMCK is more expensive than the GST, yet usually yields lower returns, it does not seem like a sensible option as an estimator in either case. Granted, it could be that better performance comes from increasing K further (e.g. Paulus et al. [33] use K = 1000 in some of 5.3 Gradient Variance We have previously seen marked improvements in some tasks when using the proposed gradient estimators, particularly the GST. We now stimulate further discussion by presenting a cursory look into why. We reconsider the LBF task of 15x15-4p-5f (see Figure 2c), and retrain with two algorithms: the baseline STGS-1, and the best performing alternative, GST. Figure 4 shows the variance of the gradients across mini-batches, for each of the layers in the policy networks, over the course of the training. Figure 4: Plots showing the gradient variance (left: gradients of weight parameters, right: gradients of bias parameters), for each layer in the policy networks, for the 15x15-4p-5f task in LBF. The results are aggregated across the 4 agents in this task-the shaded region indicates the maximum and minimum values across agents, the solid line indicates the mean. Immediately, we notice a trend in these graphs: the variance of the gradients, taken across a mini-batch, increases more rapidly for the GST algorithm than those for the baseline. Though not definitive, such results indicate that more informative gradients are being propagated through the policy networks. Informative gradients, in turn, allow the algorithm to achieve higher returns and converge faster-as evidenced in the results seen previously. 6 RELATED WORK A core insight of this work is that discrete gradient estimation does not exist solely in the domain of RL. In fact, the original GS papers [18, 28] demonstrated the technique on problems such as structured output prediction and density estimation. Indeed, discrete gradients arise in a wide variety of contexts-including discrete variational auto-encoders [19, 35], hard attention [15, 48], layer 0layer 1layer 22M4M6M2e-504e-56e-58e-5VarianceSteps2M4M6M1e-502e-53e-54e-5VarianceSteps2M4M6M1e-502e-53e-54e-55e-5VarianceSteps2M4M6M5e-6010e-615e-6VarianceSteps2M4M6M1e-402e-43e-44e-45e-4VarianceSteps2M4M6M5e-6010e-615e-620e-6VarianceStepsGSTSTGS-1grad(weight)grad(bias) generative adversarial networks for text [22, 49], and convolutional networks [43]. As a result, the biased reparameterisation of the GS is problematic in a wide variety of domains, and accordingly, a signif- icant research effort has focused on improving the method. In this paper, we drew two methods from the literature: the GRMCK [33] and the GST [10]. Various other approaches could, conceivably, be integrated into the MADDPG algorithm to handle discrete-action environments. We outline them briefly here. The STGS, GRMCK, and GST are all instances of the pathwise- derivative approach to gradient estimation, which is underpinned by a more-general form of the Deterministic Policy Gradient Theo- rem, seen in (3). The Invertible Gaussian Reparameterisation [34] also belongs to this class, where Gaussian noise is used instead of Gumbel noise. Andriyash et al. [3], too, move away from using Gumbel noise in their method, and propose a simple piecewise- linear relaxation instead. Other methods steer further away from the STGS. For example, Lee et al. [23] generalise the reparameteri- sation trick through manifold sampling, and are able to create an unbiased and reduced-variance estimator. Lorberbom et al. [25] avoid the need to relax the categorical distribution altogether by applying the technique of direct optimisation. The other approach to gradient estimation is score-function meth- ods, which is underpinned by a more-general form of the Stochastic Policy Gradient Theorem, seen in (2). Alternatives here include: subtracting a baseline [13, 45]; using a Taylor expansion of a mean- field network, as in MuProp [14]; and using copula-based sampling, as in CARMS [9]. However, it is unclear how using a score-function method would change the underlying DPG mechanics when applied in MADDPG. Authors have also combined score function and pathwise deriv- ative methods, leveraging desirable qualities from both approaches. For example: using both REINFORCE and the GS in conjunction, as in REBAR [42]; training a surrogate neural network as a control variate, as in RELAX [12]; and using sampling without replace- ment [20]. 7 CONCLUSION This paper explored the impact of the Gumbel-Softmax (GS) repa- rameterisation [18, 28] on MADDPG [27] when applied to grid- world environments. Firstly, some necessary theoretical founda- tions were presented and the problem was framed in the context of the broader literature. Thereafter, we looked closely at the straight- through GS (STGS) and discrete gradient estimation more generally, highlighting the key concepts therein. After presenting a handful of candidate STGS alternatives-two with simple tweaks to the STGS, and two from the literature [10, 33]-these estimators were implemented into the MADDPG algorithm. A suite of nine MARL tasks across two environments was used for testing, and various metrics were analysed. On some of the tasks-particularly the simpler ones, where MAD- DPG already performed well-no significant changes were observed, in terms of returns achieved and the speed to convergence. On other tasks though, particularly in the more challenging ones, substantial improvements occurred. It was found that even an easy change to the original STGS estimator, simply lowering the temperature pa- rameter, yielded good results. The proposed temperature-annealing scheme in TAGS, however, was shown to be a bad choice for the estimator-though we acknowledge a different set of hyperparam- eters may have helped here. The GRMCK estimator [33] showed promising results, but was hindered by a below-par computational burden. Finally, far superior to the other methods was the GST esti- mator [10]. This method achieved the best results across a range of tasks, with up to 55% higher returns, as well as faster convergence, when compared to the original STGS. Though it did introduce addi- tional computational burden, at around 2.5 times slower than the STGS, the method nonetheless scaled well with dimensionality, and is certainly a viable technique for many use-cases. We are now in a good position to support the suggestions made by Papoudakis et al. [32] in their benchmarking paper. Based on the empirical data observed, we agree that the bias of the STGS method is indeed problematic for MADDPG. As a result, by improving the estimator used-i.e. by lowering its bias-we can improve the returns achieved by MADDPG. To answer our research question from Section 1, then: yes, alternative discrete gradient-estimation techniques can improve the performance of MADDPG in discrete grid-worlds. Notice the benefit of our findings. We can take the extant MAD- DPG algorithm, replace only the gradient estimation technique- that is, swap out, e.g., the STGS for the GST, and leave everything else the same-and the resulting performance may likely improve. Though our algorithm becomes slightly more expensive computa- tionally, we witness faster convergence and higher returns, with minimal development overhead. 8 FUTURE WORK Many avenues of future work extend from this paper-we highlight a handful here. Firstly, it would be useful to evaluate the performance of the proposed algorithms on a wider variety of tasks-in particular, the results in RWARE were promising but distinctly limited, with only two tasks tested. Moreover, only co-operative tasks were tested here, and adversarial configurations should be explored too. Secondly, much more investigation ought to be done into why the GST is boasting better performance. Though an interesting foray, the analysis into the gradient variance was just a first step. Future research should continue to focus on the mechanics of the algorithms, and probe at various points. Thirdly, the core MADDPG algorithm designed for this paper did not incorporate various extensions suggested in the literature, e.g. parameter sharing [7, 8]. Combining the benefits observed here with other strong extensions elsewhere would be an interesting exercise. Furthermore, a wider hyperparameter search, now with the alternative estimators involved too, may be helpful. Finally, we note that only two alternative methods from the literature were presented here-the GRMCK [33] and the GST [10]. Though sufficient for our analysis, it would be useful to explore the other options synthesised from the literature (e.g. [3, 23, 26]). Some of these, though more complex, boast many attractive properties, and may prove to be even more fruitful. REFERENCES [1] Stefano V. Albrecht and Subramanian Ramamoorthy. 2013. A Game-Theoretic Model and Best-Response Learning Method for Ad Hoc Coordination in Multia- gent Systems. In Proceedings of the 2013 International Conference on Autonomous Agents and Multi-Agent Systems (St. Paul, MN, USA) (AAMAS '13). International Foundation for Autonomous Agents and Multiagent Systems, Richland, SC, 1155–1156. [2] Stefano V. Albrecht and Subramanian Ramamoorthy. 2016. Exploiting causality for selective belief filtering in dynamic Bayesian networks. Journal of Artificial Intelligence Research 55 (2016), 1135–1178. [3] Evgeny Andriyash, Arash Vahdat, and Bill Macready. 2019. Improved Gradient- Based Optimization Over Discrete Distributions. arXiv:1810.00116 [cs, stat] (June 2019). arXiv:1810.00116 [cs, stat] [4] Yoshua Bengio, Nicholas Léonard, and Aaron C. Courville. 2013. Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computation. CoRR abs/1308.3432 (2013). arXiv:1308.3432 http://arxiv.org/abs/1308.3432 [5] Christopher Berner, Greg Brockman, Brooke Chan, Vicki Cheung, Przemys- law Debiak, Christy Dennison, David Farhi, Quirin Fischer, Shariq Hashme, Chris Hesse, Rafal Józefowicz, Scott Gray, Catherine Olsson, Jakub Pachocki, Michael Petrov, Henrique Pondé de Oliveira Pinto, Jonathan Raiman, Tim Sali- mans, Jeremy Schlatter, Jonas Schneider, Szymon Sidor, Ilya Sutskever, Jie Tang, Filip Wolski, and Susan Zhang. 2019. Dota 2 with Large Scale Deep Reinforcement Learning. CoRR abs/1912.06680 (2019). http://arxiv.org/abs/1912.06680 [6] David Blackwell. 1947. Conditional expectation and unbiased sequential estima- tion. The Annals of Mathematical Statistics (1947), 105–110. [7] Filippos Christianos, Georgios Papoudakis, Muhammad A Rahman, and Stefano V. Albrecht. 2021. Scaling multi-agent reinforcement learning with selective param- eter sharing. In International Conference on Machine Learning. PMLR, 1989–1998. [8] Filippos Christianos, Lukas Schäfer, and Stefano V. Albrecht. 2020. Shared Experi- ence Actor-Critic for Multi-Agent Reinforcement Learning. In Advances in Neural Information Processing Systems, Vol. 33. Curran Associates, Inc., 10707–10717. [9] Alek Dimitriev and Mingyuan Zhou. 2021. CARMS: Categorical-Antithetic- REINFORCE Multi-Sample Gradient Estimator. In Advances in Neural Information Processing Systems, Vol. 34. Curran Associates, Inc., 13217–13229. [10] Ting-Han Fan, Ta-Chung Chi, Alexander I. Rudnicky, and Peter J Ramadge. 2022. Training Discrete Deep Generative Models via Gapped Straight-Through Estimator. In Proceedings of the 39th International Conference on Machine Learning (Proceedings of Machine Learning Research, Vol. 162), Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvari, Gang Niu, and Sivan Sabato (Eds.). PMLR, 6059–6073. https://proceedings.mlr.press/v162/fan22a.html [11] Roman Garnett. 2022. Bayesian Optimization. Cambridge University Press. in preparation. [12] Will Grathwohl, Dami Choi, Yuhuai Wu, Geoffrey Roeder, and David Duvenaud. 2018. Backpropagation through the Void: Optimizing Control Variates for Black- Box Gradient Estimation. ICLR 2018 (2018). arXiv:1711.00123 [13] Evan Greensmith, Peter Bartlett, and Jonathan Baxter. 2001. Variance Reduction Techniques for Gradient Estimates in Reinforcement Learning. In Advances in Neural Information Processing Systems, T. Dietterich, S. Becker, and Z. Ghahra- mani (Eds.), Vol. 14. MIT Press. https://proceedings.neurips.cc/paper/2001/file/ 584b98aac2dddf59ee2cf19ca4ccb75e-Paper.pdf [14] Shixiang Gu, Sergey Levine, Ilya Sutskever, and Andriy Mnih. 2016. MuProp: Unbiased Backpropagation for Stochastic Neural Networks. In 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, Yoshua Bengio and Yann LeCun (Eds.). http://arxiv.org/abs/1511.05176 [15] Caglar Gulcehre, Sarath Chandar, and Yoshua Bengio. 2017. Memory augmented neural networks with wormhole connections. arXiv preprint arXiv:1701.08718 (2017). [16] Eric A. Hansen, Daniel S. Bernstein, and Shlomo Zilberstein. 2004. Dynamic Programming for Partially Observable Stochastic Games. In Proceedings of the 19th National Conference on Artifical Intelligence (San Jose, California) (AAAI'04). AAAI Press, 709–715. [17] Iris A.M. Huijben, Wouter Kool, Max Benedikt Paulus, and Ruud JG Van Sloun. 2022. A Review of the Gumbel-max Trick and Its Extensions for Discrete Stochas- ticity in Machine Learning. IEEE Transactions on Pattern Analysis and Machine Intelligence (2022), 1–1. https://doi.org/10.1109/TPAMI.2022.3157042 [18] Eric Jang, Shixiang Gu, and Ben Poole. 2017. Categorical Reparameterization with Gumbel-Softmax. ICLR 2017 (2017). [19] Diederik P Kingma, Max Welling, et al. 2019. An introduction to variational autoencoders. Foundations and Trends® in Machine Learning 12, 4 (2019), 307–392. [20] Wouter Kool, Herke van Hoof, and Max Welling. 2020. Estimating Gradients for Discrete Random Variables by Sampling without Replacement. ICLR 2020 (2020). arXiv:2002.06043 [21] Matt J Kusner and José Miguel Hernández-Lobato. 2016. Gans for sequences of discrete elements with the gumbel-softmax distribution. arXiv preprint arXiv:1611.04051 (2016). [22] Matt J. Kusner and José Miguel Hernández-Lobato. 2016. GANS for Sequences of Discrete Elements with the Gumbel-softmax Distribution. https://doi.org/10. 48550/ARXIV.1611.04051 [23] Wonyeol Lee, Hangyeol Yu, and Hongseok Yang. 2018. Reparameterization Gra- dient for Non-differentiable Models. In Advances in Neural Information Processing Systems, Vol. 31. Curran Associates, Inc. [24] Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. 2016. Continuous Control with Deep Reinforcement Learning.. In ICLR 2016. [25] Guy Lorberbom, Andreea Gane, Tommi Jaakkola, and Tamir Hazan. 2019. Di- rect Optimization through Argmax for Discrete Variational Auto-Encoder. In Advances in Neural Information Processing Systems, Vol. 32. Curran Associates, Inc. [26] Guy Lorberbom, Chris J Maddison, Nicolas Heess, Tamir Hazan, and Daniel Tarlow. 2020. Direct Policy Gradients: Direct Optimization of Policies in Discrete Action Spaces. In Advances in Neural Information Processing Systems, Vol. 33. Curran Associates, Inc., 18076–18086. [27] Ryan Lowe, Wu Yi, Aviv Tamar, Jean Harb, Pieter Abbeel, and Igor Mordatch. 2017. Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments. In Advances in Neural Information Processing Systems, Vol. 30. [28] Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. 2017. The Concrete Dis- tribution: A Continuous Relaxation of Discrete Random Variables. ICLR 2017 (2017). arXiv:1611.00712 [29] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. 2013. Playing Atari with Deep Reinforcement Learning. NIPS Deep Learning Wokrshop (Dec. 2013). arXiv:1312.5602 [cs] [30] Shakir Mohamed, Mihaela Rosca, Michael Figurnov, and Andriy Mnih. 2020. Monte Carlo Gradient Estimation in Machine Learning. Journal of Machine Learning Research 21, 132 (2020), 1–62. [31] Kevin P. Murphy. 2023. Probabilistic Machine Learning: Advanced Topics. MIT Press. probml.ai [32] Georgios Papoudakis, Filippos Christianos, Lukas Schäfer, and Stefano V. Albrecht. 2021. Benchmarking Multi-Agent Deep Reinforcement Learning Algorithms in Cooperative Tasks. Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks 1 (Dec. 2021). [33] Max B. Paulus, Chris J. Maddison, and Andreas Krause. 2021. Rao-Blackwellizing the Straight-Through Gumbel-Softmax Gradient Estimator. ICLR 2021 (2021). arXiv:2010.04838 [34] Andres Potapczynski, Gabriel Loaiza-Ganem, and John P Cunningham. 2020. Invertible Gaussian Reparameterization: Revisiting the Gumbel-Softmax. In Ad- vances in Neural Information Processing Systems, Vol. 33. Curran Associates, Inc., 12311–12321. [35] Jason Tyler Rolfe. 2017. Discrete Variational Autoencoders. ICLR 2017 (2017). arXiv:1609.02200 [36] L. S. Shapley. 1953. Stochastic Games. Proceedings of the National Academy of Sciences 39, 10 (Oct. 1953), 1095–1100. https://doi.org/10.1073/pnas.39.10.1095 [37] David Silver, Aja Huang, Chris J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershel- vam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalch- brenner, Ilya Sutskever, Timothy Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. 2016. Mastering the Game of Go with Deep Neural Networks and Tree Search. Nature 529, 7587 (Jan. 2016), 484–489. https://doi.org/10.1038/nature16961 [38] David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. 2014. Deterministic Policy Gradient Algorithms. In Proceedings of the 31st International Conference on Machine Learning. PMLR, 387–395. [39] Richard S. Sutton and Andrew G. Barto. 2018. Reinforcement Learning: An Intro- duction (second edition ed.). The MIT Press, Cambridge, Massachusetts. [40] Richard S Sutton, David McAllester, Satinder Singh, and Yishay Mansour. 1999. Policy Gradient Methods for Reinforcement Learning with Function Approxima- tion. In Advances in Neural Information Processing Systems, Vol. 12. MIT Press. [41] Ming Tan. 1993. Multi-agent reinforcement learning: Independent vs. cooperative agents. In Proceedings of the Tenth International Conference on Machine Learning. 330–337. [42] George Tucker, Andriy Mnih, Chris J Maddison, John Lawson, and Jascha Sohl- Dickstein. 2017. REBAR: Low-variance, Unbiased Gradient Estimates for Discrete Latent Variable Models. In Advances in Neural Information Processing Systems, Vol. 30. Curran Associates, Inc. [43] Andreas Veit and Serge J. Belongie. 2019. Convolutional Networks with Adaptive Inference Graphs. International Journal of Computer Vision 128 (2019), 730–741. [44] Oriol Vinyals, Igor Babuschkin, Wojciech M. Czarnecki, Michaël Mathieu, An- drew Dudzik, Junyoung Chung, David H. Choi, Richard Powell, Timo Ewalds, Petko Georgiev, Junhyuk Oh, Dan Horgan, Manuel Kroiss, Ivo Danihelka, Aja Huang, Laurent Sifre, Trevor Cai, John P. Agapiou, Max Jaderberg, Alexander S. Vezhnevets, Rémi Leblond, Tobias Pohlen, Valentin Dalibard, David Budden, Yury Sulsky, James Molloy, Tom L. Paine, Caglar Gulcehre, Ziyu Wang, Tobias Pfaff, Yuhuai Wu, Roman Ring, Dani Yogatama, Dario Wünsch, Katrina McKinney, Oliver Smith, Tom Schaul, Timothy Lillicrap, Koray Kavukcuoglu, Demis Hass- abis, Chris Apps, and David Silver. 2019. Grandmaster Level in StarCraft II Using Multi-Agent Reinforcement Learning. Nature 575, 7782 (Nov. 2019), 350–354. https://doi.org/10.1038/s41586-019-1724-z [45] Lex Weaver and Nigel Tao. 2001. The Optimal Reward Baseline for Gradient- Based Reinforcement Learning. In Proceedings of the Seventeenth Conference on Uncertainty in Artificial Intelligence (Seattle, Washington) (UAI'01). Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 538–545. [46] Ronald J. Williams. 1992. Simple Statistical Gradient-Following Algorithms for Connectionist Reinforcement Learning. Machine Learning 8, 3 (May 1992), 229–256. https://doi.org/10.1007/BF00992696 [47] Peter R. Wurman, Samuel Barrett, Kenta Kawamoto, James MacGlashan, Kaushik Subramanian, Thomas J. Walsh, Roberto Capobianco, Alisa Devlic, Franziska Eck- ert, Florian Fuchs, Leilani Gilpin, Piyush Khandelwal, Varun Kompella, HaoChih Lin, Patrick MacAlpine, Declan Oller, Takuma Seno, Craig Sherstan, Michael D. Thomure, Houmehr Aghabozorgi, Leon Barrett, Rory Douglas, Dion Whitehead, Peter Dürr, Peter Stone, Michael Spranger, and Hiroaki Kitano. 2022. Outracing Champion Gran Turismo Drivers with Deep Reinforcement Learning. Nature 602, 7896 (Feb. 2022), 223–228. https://doi.org/10.1038/s41586-021-04357-7 [48] Shiyang Yan, Jeremy S Smith, Wenjin Lu, and Bailing Zhang. 2018. Hierarchical multi-scale attention networks for action recognition. Signal Processing: Image Communication 61 (2018), 73–84. [49] Yizhe Zhang, Zhe Gan, Kai Fan, Zhi Chen, Ricardo Henao, Dinghan Shen, and Lawrence Carin. 2017. Adversarial Feature Matching for Text Generation. In Proceedings of the 34th International Conference on Machine Learning (Proceedings of Machine Learning Research, Vol. 70), Doina Precup and Yee Whye Teh (Eds.). PMLR, 4006–4015. https://proceedings.mlr.press/v70/zhang17b.html
http://arxiv.org/abs/2302.12711v1
2023-02-23T05:19:03
2023-02-23T05:19:03
FG-SSA: Features Gradient-based Signals Selection Algorithm of Linear Complexity for Convolutional Neural Networks
Recently, many convolutional neural networks (CNNs) for classification by time domain data of multisignals have been developed. Although some signals are important for correct classification, others are not. When data that do not include important signals for classification are taken as the CNN input layer, the calculation, memory, and data collection costs increase. Therefore, identifying and eliminating nonimportant signals from the input layer are important. In this study, we proposed features gradient-based signals selection algorithm (FG-SSA), which can be used for finding and removing nonimportant signals for classification by utilizing features gradient obtained by the calculation process of grad-CAM. When we define N as the number of signals, the computational complexity of the proposed algorithm is linear time O(N), that is, it has a low calculation cost. We verified the effectiveness of the algorithm using the OPPORTUNITY Activity Recognition dataset, which is an open dataset comprising acceleration signals of human activities. In addition, we checked the average 6.55 signals from a total of 15 acceleration signals (five triaxial sensors) that were removed by FG-SSA while maintaining high generalization scores of classification. Therefore, the proposed algorithm FG-SSA has an effect on finding and removing signals that are not important for CNN-based classification.
[ "Yuto Omae", "Yusuke Sakai", "Hirotaka Takahashi" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12711v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12711v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "eess.SP", "@scheme": "http://arxiv.org/schemas/atom" }
[ "eess.SP", "cs.AI", "cs.LG", "68T07, 68W25", "I.2.6; F.2.2" ]
THIS IS THE PREPRINT VERSION (FEB. 2023). 1 FG-SSA: Features Gradient-based Signals Selection Algorithm of Linear Complexity for Convolutional Neural Networks Yuto Omae, Member, IEEE, Yusuke Sakai, and Hirotaka Takahashi 3 2 0 2 b e F 3 2 ] P S . s s e e [ 1 v 1 1 7 2 1 . 2 0 3 2 : v i X r a Abstract-Recently, many convolutional neural networks (CNNs) for classification by time domain data of multisignals have been developed. Although some signals are important for correct classification, others are not. When data that do not include important signals for classification are taken as the CNN input layer, the calculation, memory, and data collection costs increase. Therefore, identifying and eliminating nonimportant signals from the input layer are important. In this study, we proposed features gradient-based signals selection algorithm (FG- SSA), which can be used for finding and removing nonimportant signals for classification by utilizing features gradient obtained by the calculation process of grad-CAM. When we define ns as the number of signals, the computational complexity of the proposed algorithm is linear time O(ns), that is, it has a low calculation cost. We verified the effectiveness of the algorithm using the OPPORTUNITY Activity Recognition dataset, which is an open dataset comprising acceleration signals of human activities. In addition, we checked the average 6.55 signals from a total of 15 acceleration signals (five triaxial sensors) that were removed by FG-SSA while maintaining high generalization scores of classification. Therefore, the proposed algorithm FG-SSA has an effect on finding and removing signals that are not important for CNN-based classification. Impact Statement-Recently, it has become possible to measure various signals, e.g., electroencephalogram, electrocardiogram, acceleration/gyro, ambient signals, and others. This has led to the development of many artificial intelligences for classification using multiple signals as input data. However, some of the multiple signals are not necessary for class estimation. The such signals increase memory resources, computation time, data measurement cost, and using artificial intelligence cost. Therefore, it is better to remove signals that are not necessary for class intelligence. estimation from the input layer of the artificial Therefore, in this study, we devised an algorithm to remove them. By applying this algorithm to a artificial intelligence that performs class estimation from multiple signals, useless signals are removed and a lightweight model can be constructed. Index Terms-Convolutional neural network, signal impor- tance, signal selection algorithm I. INTRODUCTION Recently, many convolutional neural networks (CNNs) have been developed for classification in the time domain of signals [1]–[4]. Although these studies used all signals, signals that are not important for correct classification may be included in the CNN input layer. These signals worsen classification accuracy, and increase calculation costs, required memory, and data collection costs. Therefore, finding and removing nonimportant signals from the CNN input layer and creating a classification model for the minimum signals possible are crucial. However, many CNNs use all signals [4]–[6] or manually select signals [7], [8]. We can visually find nonimportant signals using grad- CAM embedded in CNNs. Grad-CAM [9] is a method for determining the activated region on input data, and it was proposed by improving the CAM [10]. The method is pri- marily used to input image data [11]–[15]. Cases of applying grad-CAM to CNNs that input time domain data of signals are continuously increasing. For example, classification of the sleep stages [16], prognostication of comatose patients after cardiac arrest [17], classification of schizophrenia and healthy subjects [18], and classification of motor imagery [19] are performed using electroencephalography (EEG) signal(s). Electrocardiogram (ECG) signals are used to detect nocturnal hypoglycemia [20] and predict 1-year mortality [21] have been reported. Acceleration signals have been used to detect hemiplegic gait [22] and human activity recognition [23]. From these studies, we visually find nonimportant signals for correct classification by applying grad-CAM to CNN, inputting the time domain of the signals. However, because one grad-CAM for one input data is generated, observing all of them and finding nonimportant signals is extremely difficult. Therefore, we propose features gradient-based signals selection algorithm (FG-SSA), which can be used to find and remove nonimportant signals from a CNN input layer by utilizing features gradient obtained by the calculation process of grad-CAM. The algorithm provides a signal subset consisting of only important signals. When we define ns as the number of all signals, the computational complexity of the proposed algorithm is linear order O(ns), that is, FG-SSA has a low calculation cost. This work was supported in part by JSPS Grant-in-Aid for Young Scientists (Grant No. 19K20062). Y. Omae is with the Artificial Intelligence Research Center, College of Industrial Technology, Nihon University, Chiba, 275-8575, Japan (e-mail: [email protected]). Y. Sakai and H. Takahashi are with the Research Center for Space Science, Advanced Research Laboratories, Tokyo City University, Tokyo 158-8557, Japan (e-mail: [email protected]). Kim [24] has proposed a group lasso-based algorithm for signal selection. Although this is an effective method, visual insights into the results are difficult because grad-CAM is not used in the calculation process. By contrast, by using the proposed algorithm FG-SSA, we can visually determine the reason the removed signals are not important. 2 THIS IS THE PREPRINT VERSION (FEB. 2023). II. PROPOSED METHOD A. Specific problem for classification We consider a situation in which the task is to estimate a class c belonging to class set C by CNNs from the measurement data of the signal set S of size ns. Some ns signals are important for classification, whereas others are not. Therefore, finding a signal subset Suse that are removed the nonimportant signals from all signal sets S is crucial. In this study, we provide an algorithm for finding such a subset of signals Suse ⊆ S. The applicable targets of the proposed method are all tasks of solving classification problems using CNNs inputting the time domain of multisignals. For an easy understanding of the principle of the proposed method, we set a specific classification problem and explain the proposed algorithm. "OPPORTUNITY Activity Recognition" is the dataset for activity recognition and it is used in "Activity Recognition Challenge" held by IEEE in 2011 [25], [26]. We regard the dataset as reliable because it is used for the performance evaluation of machine learning in some studies [27], [28]. The dataset contains data on multiple inertial measurement units, 3D acceleration sensors, ambient sensors, 3D local- ization information, etc. Four subjects performed a natural execution of daily activities. The activity annotations include locomotions (e.g., sitting, standing, walking) and left- and right-hand actions (e.g., reach, grasp, release, etc.). Details of the dataset are described in [25], [26]. In this study, we used five triaxial acceleration sensors from all the measurement devices (sampling frequency: 32 [Hz]). Attachment points of sensors on the humans body are "back," "right arm," "left arm," "right shoe," and "left shoe." The total number of signals was 15, because we adopted five triaxial sensors (5 × 3 = 15). We adopted data splitting using the sliding window method with window length w = 60 and sliding length 60. One signal length was approximately 2 s, because the sampling frequency was 32 [Hz]. Searching for the optimal window length size is important because it is a hyperparameter that affects the estimation accuracy [29], [30]. However, because the main objective of this study was to provide a signal-selection algorithm, we did not tune the window length size. Next, we labeled the motion class label for each dataset based on human activity. The class labels are combinations of locomotions ("Stand," "Walk," "Sit," and "Lie") and three hands activity ("R": moving right hand, "L": moving left hand, and "N": not moving hands). For example, the class label "Sit R" refers to the sitting and right-hand motions. Table I lists the results of applying the described procedures to all the data. This indicates that the data size of the left- hand motion is small. We consider that nearly all subjects were right-handed (notably, we could not find a description of the subjects' dominant arm in the explanation of the OPPORTUNITY dataset). Moreover, data belonging to Lie R and L are absent. Therefore, these classes were removed from the estimation task; that is, the total number of classes was 10. Subsequently, we randomly split all the data into a training TABLE I SAMPLES SIZE OF EACH CLASS LABEL Labels Stand N Stand L Stand R Walk N Walk L Walk R Sit N Sit L Sit R Lie N Lie L Lie R Total Samples 1070 193 642 1405 63 150 571 130 536 414 0 0 5174 Rates [%] 20.68 3.73 12.41 27.16 1.22 2.90 11.04 2.51 10.36 8.00 0.00 0.00 100.00 dataset (80%) and a test dataset (20%). Moreover, we assigned 20% of the training dataset to the validation dataset. The training, validation, and test datasets were independent because we adopted the sliding window method for the same window and slide length (60 steps). We define the signal set S, which has 15 elements, and the class set C, which has 10 elements, as follows: S = {Back X, Back Y, Back Z, Right arm X, Right arm Y, Right arm Z, Left arm X, Left arm Y, Left arm Z, Right shoe X, Right shoe Y, Right shoe Z, Left shoe X, Left shoe Y, Left shoe Z}, (1) C = {Stand N, Stand L, Stand R, Walk N, Walk L, Walk R, Sit N, Sit L, Sit R, Lie N}. (2) In other words, CNNs solve 10 classification problems from 15 multisignals. Moreover, we provide an algorithm for removing nonimportant signals while maintaining the estimation accu- racy. Although the sets S and C represent acceleration signals and human activities, respectively, the proposed algorithm can be used for other diverse signals, such as EEG, ECG, and others. B. Class estimation The CNN structure for class estimation is shown in Figure 1. The data for the input layer are in the form of a matrix w × ns. w is the window length and ns = |S| is the number of signals. In the case of Subsection II-A, the input layer size is a matrix of 60 × 15. Subsequently, the input data are convoluted using kernel filters of the time-directional convolution size sc. The number of generated feature maps is nf because the number of filters is nf . The reason for adopting only time-directional convolution is to avoid mixing a signal and others in the convolution process. The input data are convoluted by these nc convolution layers, and the CNN generates the feature maps shown in the extracted feature maps in Figure 1. Subsequently, the CNN generates the output vector using some fully connected layers Y. OMAE et al.: FG-SSA: FEATURES GRADIENT-BASED SIGNALS SELECTION ALGORITHM FOR CONVOLUTIONAL NEURAL NETWORKS 3 Fig. 1. CNN structure for 10 human activities recognition from 15 acceleration signals. We applied the proposed algorithm to this structure. and the SoftMax function. We define the output vector y as follows: y = [yc] ∈ R|C|, c ∈ C, (cid:88) c∈C yc = 1. (3) The estimation class c(cid:48) is c(cid:48) = argmax c∈C {yc|c ∈ C}. (4) Herein, we only define the output vector y because it appears in the grad-CAM definition. We explain grad-CAM for time domain signals in the next subsection. C. Time-directional grad-CAM We define the vertical size of the feature map before the fully connected layer as sf , as shown in Figure 1 "Extracted feature maps." Let us denote the kth feature map of signal s as f s,k = [f s,k s ∈ S, k ∈ {1, * * * , nf }. f s,k 2 1 * * * f s,k sf ](cid:62) ∈ Rsf , (5) In the case of CNNs for image-data-based classification, the form of feature maps is a matrix. However, in the case of CNNs consisting of time-directional convolution layers, the form of the feature maps is a vector. We define the effect of the feature map f s,k on the estimation class c(cid:48) as Then, we can apply the grad-CAM of signal s to estimation class c(cid:48) in the vector form of nf(cid:88) c(cid:48) f s,k(cid:17) αs,k , Zs c(cid:48) ∈ Rsf ≥0. Zs c(cid:48) = ReLU (7) (cid:16) 1 nf k=1 The activated region of each signal can be understood by calculating Zs c(cid:48) for all signals ∀s ∈ S. In this paper, we refer to Zs c(cid:48) as "time-directional grad- CAM" because it is calculated by the summing partial dif- ferentiations of time direction. This was defined by a minor change in the basic grad-CAM for image data [9]. In the case of the basic grad-CAM [9], the CNN generates one grad- CAM for one input data. By contrast, in the case of time- directional grad-CAM, CNN generates grad-CAMs as many as the number of signals ns for one input data. Figure 2 shows the examples of Zs c(cid:48) calculated using the CNN described in Section IV. From top to bottom, these results correspond to c(cid:48) = Stand N, Stand L, Stand R, and Walk N. We can determine the signals that are important by viewing the time-directional grad-CAM shown in Figure 2. For example, signals from the left arm and left shoe are not used for estimating the Stand N class. Moreover, left arm signals are not used for the estimation of the Stand R class. Therefore, the time-directional grad-CAM is effective for finding nonimportant signals. D. Signals importance index αs,k c(cid:48) = 1 sf sf(cid:88) j=1 ∂yc(cid:48) ∂f s,k j , (6) Although we can find nonimportant signals by viewing time-directional grad-CAM, the result varies for each input data. Therefore, when the data size is large, viewing all the 4 THIS IS THE PREPRINT VERSION (FEB. 2023). Fig. 2. Examples of time-directional grad-CAMs of 15 acceleration signals for four estimation classes (Stand N, Stand L, Stand R, and Walk N) calculated by the CNN of condition A described in Section IV. The red color represents high activation and the dark blue represents low activation. grad-CAMs is difficult. Herein, we quantify the importance of signal s for classification based on αs,k c(cid:48) defined in Equation 6. Here, we denote the input dataset of size ndat as X = {Xi|i = 1, * * * , ndat}, Xi ∈ Rw×ns. (8) The size of ith input data Xi is w × ns, which is the window length w and number of signals ns. When we define the input dataset of estimation class c(cid:48) ∈ C as Xc(cid:48), we can represent the input dataset X as X = (cid:91) c(cid:48)∈C Xc(cid:48). (9) Using the set Xc(cid:48), we define the importance of the signal s ∈ S to the estimation class c(cid:48) ∈ C as Ls(Xc(cid:48)) = 1 |Xc(cid:48)| (cid:88) gs c(cid:48)(Xi), Xi∈Xc(cid:48) (10) where gs c(cid:48)(Xi) = βs,k c(cid:48) (Xi) = Xi ∈ Xc(cid:48). nf(cid:88) 1 nf (cid:40) k=1 αs,k c(cid:48) (Xi), 0, otherwise if αs,k c(cid:48) (Xi) ≥ 0 , (11) c(cid:48) (Xi) is αs,k In addition, αs,k c(cid:48) of the input data Xi to grad- CAM, and c(cid:48) is the estimated class. Therefore, Ls(Xc(cid:48)) repre- sents the importance of signal s to class c(cid:48) based on the grad- CAM. Notably, to extract the positive effect on classification, we ignore terms with negative partial derivatives, as shown in Equation 11. Moreover, using Ls(Xc(cid:48)), we can obtain the matrix Imat(X) = [Ls(Xc(cid:48))] ∈ R|S|×|C| s ∈ S, c(cid:48) ∈ C. ≥0 (12) We refer to Imat(X) as the "signals importance matrix (SIM)" because the matrix comprises the importance of all signals and classes using the input dataset X. We can understand the effect of each signal to all classes by calculating and viewing SIM Imat(X). Although Imat(X) includes important information, summa- rizing the SIM is necessary to find signals that are not impor- tant to all classes. Therefore, by calculating the summation of the row values of SIM, we denote the importance of signal s as I s(X) = 1 |C| (cid:88) c(cid:48)∈C I s,c(cid:48) mat(X), (13) where I s,c(cid:48) calculating I s(X) for all signals s, we obtain the vector as mat(X) is the value of row s and column c(cid:48). By We refer to Ivec(X) as the "signals importance vector (SIV)" because it is the vector that consists of the signal importance. SIM and SIV are shown in Figure 3. Examples were calcu- lated using the CNN of condition A described in Section IV (see condition A in Section IV). The result of SIM (columns 1 to 10 in Figure 3) includes various important information, for example, the signals Back Z and Right arm X are important for estimating the class Walk R. Moreover, by viewing SIV (the column 11 in Figure 3), we can identify the signals that are important for all classes. βs,k c(cid:48) (Xi), Ivec(X) = [I s(X)] ∈ R|S| ≥0. (14) Y. OMAE et al.: FG-SSA: FEATURES GRADIENT-BASED SIGNALS SELECTION ALGORITHM FOR CONVOLUTIONAL NEURAL NETWORKS 5 Fig. 3. Example of signals importance to all class expressed by SIM Imat(X) and SIV Ivec(X) calculated to CNNs of Condition A described in Section IV. The columns 1 to 10 are SIM and the column 11 is SIV ("All classes"). The values are standardized from zero to one in each column. The greater the cell's value, the greater is the relevance of signal s on estimation class c(cid:48). From SIV, we denote the minimum important signal smin and maximum signal smax as (smin, smax) = (cid:16) argmin s∈S I s(X), argmax (cid:17) I s(X) . (15) s∈S We expect to maintain the estimation accuracy even when removing smin because it is a minimum important signal. By contrast, when we remove smax and re-learn the CNN, we expect the accuracy to decrease, because it is the most important signal. E. Signals Selection Algorithm In this study, we proposed an algorithm to find a desirable signal subset Suse ⊆ S by removing nonimportant signals. The proposed method is presented in Algorithm 1. The main inputs to the algorithm are the training dataset Xtrain, val- idation dataset Xvalid, and the input signal set S. To avoid data leakage, the test dataset was not used in the algorithm. The elements of set S are the signal identification names defined in Equation 1. The first procedure is to create the initial signal set S0, which consists of all signals (line 1). The next step is to develop a CNN using the training dataset X S0 train, which consists of S0 (line 3). Subsequently, we measure the validation accuracy A(X S0 valid) using the validation dataset X S0 valid (line 4). Next, we determine the most important signal smin ∈ S0 based on Equation 15 (line 5). Finally, we obtain the next signal set S1 by removing smin from S0 (line 6). This procedure is repeated until the number of signals reaches one (i.e., t = |S|−1), and record validation accuracies. The algorithm returns the signal subset Suse leading to max- imum validation accuracy (lines 8 and 9). Notably, the case wherein the signal subset leading to the maximum accuracy 6: 7: end for 8: Suse ← Algorithm 1 Features gradient-based signals selection algo- rithm (FG-SSA) Input: Training and validation dataset Xtrain and Xvalid, input signals set S, maximum number of using signals γ Output: Using signals set Suse 1: Initialization of a signals set S0 ← S 2: for t = 0 to |S| − 1 do 3: Learning a CNN by the training dataset X St Calculating validation accuracy A(X St Finding a minimum importance signal smin ← argmin s∈St I s(X St valid) valid) train Removing a signal: St+1 ← St \ smin 4: 5: argmax S(cid:48)∈{S0,*** ,S|S|−1} A(X S(cid:48) valid), s.t., |Suse| ≤ γ 9: return Suse Note: X St valid are all the input data belonging to the training and validation dataset using the signal set St, respectively. train and X St is the initial signal set can occur, that is, Suse = S. In cases wherein the main purpose is to achieve maximum accuracy, adopting the initial signal set as an optimal subset is a better option, if Suse = S occurs. However, some cases exist that require a decrease in the number of signals. Therefore, we prepare constraints wherein the number of adopted signal sizes is γ or less, that is, |Suse| ≤ γ. This is a hyperparameter of the proposed algorithm. When the size of the initial signal set S is ns, the number 6 THIS IS THE PREPRINT VERSION (FEB. 2023). of developing CNN in Algorithm 1 is as follows: T (ns) = ns − 1 ∼ ns. (16) is, That the computational complexity of Algorithm 1 is O(ns). This means that even if the signal size ns increases, the signal subset is returned in realistic time. Generally, the total pattern for choosing m from n signals is nCm. Because m, the number of signals leading to the maximum validation accuracy, is not known, the total number of combinations of input layers Tbs(ns) is similar to ns(cid:88) Tbs(ns) = m=1 ∼ max m nsCm nsCm = nsC(cid:98)ns/2(cid:99). (17) Therefore, finding the optimal signal subset using a brute-force search is difficult. The computation time tends to be large because the CNN includes many other hyperparameters. From this viewpoint, a fast algorithm such as the proposed method is important. III. EXPERIMENT 1: RELATIONSHIP BETWEEN VALIDATION ACCURACY AND THE NUMBER OF DELETED SIGNALS A. Objective and outline Herein, we examine the reliability of smin, max defined in Equation 15. We expect to maintain estimation accuracy even if the signal smin is removed because it is the most nonimportant signal. By contrast, because signal smax is the most important signal, the estimation accuracy may decrease by removing it. To verify the aforementioned hypothesis, we gradually removed signal smin, max using the processes of lines 2 to 7 of Algorithm 1. In addition, we repeatedly developed CNNs and recorded their validation accuracies. We performed verification using a total of 100 seeds because CNN depends on randomness. The adopted layer structure of the CNN is explained in the Appendix section; the number of epochs was 300. B. Result and discussion First, we indicate the validation accuracies when the most nonimportant signal, smin, is gradually removed, as shown in Figure 4 (A). From left to right in Figure 4 (A), the number of deleted signals increases, that is, the number of signals in the CNN input layer decreases. The leftmost result is obtained using all signals, and the rightmost result is obtained by using only one signal as the CNN input layer. The results show that even if six signals were deleted, the validation accuracy did not decrease. Moreover, by removing seven or more signals, the accuracy decreases significantly. In this case, although CNNs estimate class labels from 15 signals in the set S, six signals appear unnecessary. We calculated the average removed timings of the 15 signals to determine the unnecessary signals. The result is shown in Figure 4 (b). This means that the lower the value, the earlier the signal is removed in the procedure of Algorithm 1. The results indicate that the signals of the right and left shoes are removed earlier than those of the other sensors. By contrast, some signals from the back, right arm, and left arm did not disappear early. Therefore, we can regard shoe signals as unimportant for classification. In addition, shoe sensors seem important for walk motion classification. However, even if shoe sensors disappear, we consider that the back sensor attached to centroids of the human body contributes to the classification of walk motions because these motions are periodic. Next, we indicate the validation accuracies when the most important signal, smax, is gradually removed in Figure 5 (a). We can verify that the validation accuracy statistically decreases by removing one of the most important signals. Therefore, we consider that removing the most important signal, smax leads to a worse accuracy. The average timing of the signal removal is shown in Figure 5 (b). From this figure, we confirm that the signals of back X, right arm X, and left arm Y are removed early. Moreover, we confirm that shoe sensor signals are not removed early. These tendencies are in contrast compared with the case of removing the most nonimportant signal smin. Clearly, (1) even if we remove the most nonimportant signal smin, the estimation performance tends to remain, and (2) when we remove the most important signal smax, the performance tends to decrease. Therefore, we regard the signal importance I s(X) defined in Equation 13 as reliable. IV. EXPERIMENT 2: EFFECTIVENESS OF FG-SSA ON GENERALIZATION SCORES A. Objective and outline Herein, we confirm the effect of FG-SSA indicated in Algorithm 1 on the generalization performance of the classi- fication. Therefore, we develop the following three conditions for CNNs. • Condition A: CNN using all signals, i.e., FG-SSA is not used. • Condition B: CNN for applied FG-SSA of γ = ns. • Condition C: CNN for applied FG-SSA of γ = 9. Condition A means that the CNN does not remove signals but uses all signal sets S. Condition B refers to the CNN use the signal subset Suse obtained by the FG-SSA, given ns as the constraint parameter γ. Under this condition, when maximum validation accuracy is achieved using all signal sets S, we allow the algorithm to return S as Suse. In other words, a case wherein no signals are removed can occur. Condition C implies that the number of adopted signals is nine or less for a CNN input layer, that is, |Suse| ≤ 9. In other words, six or more signals were deleted, because the initial number of signals was 15. The value of hyper-parameter γ = 9 was determined by referring to the result shown in Figure 4 (A). We developed CNNs using the signal set, which was deter- mined by FG-SSA. Moreover, the optimal epochs leading to a maximum validation accuracy were adopted. The search range of epochs was from 1 to 300. Subsequently, the generalization Y. OMAE et al.: FG-SSA: FEATURES GRADIENT-BASED SIGNALS SELECTION ALGORITHM FOR CONVOLUTIONAL NEURAL NETWORKS 7 (A) Maximum validation accuracy in 300 epochs when the most nonimportant signal smin is gradually removed and CNNs are re-learned. (B) Fig. 4. Average removed timings of each signal. It means the smaller the timing, the earlier the signal is removed. The results of both (A) and (B) are average values of 100 seeds, and the error bars are standard deviations. The p values in (A) represent the results of two-sided t test, and the dashed line represents the timing of statistically decreasing validation accuracy. Fig. 5. removed timings of each signal. In contrast to that shown in Figure 4, the most important signals are removed. (A) Maximum validation accuracy in 300 epochs when the most important signal smax is gradually removed and CNNs are re-learned. (B) Average performance is measured using the test dataset. The test dataset was used only at it was not used for the parameter search. To remove the randomness effect, we developed CNNs for Conditions A, B, and C with a total of 100 seeds. this time, that is, B. Result and discussion By developing CNNs under conditions A, B, and C on a total of 100 seeds, the average number of signals used was 15.00, 11.94, and 8.35, respectively. In other words, an average of 3.06 and 6.65 signals were removed by FG-SSA in the cases of Condition B and C, respectively. The generalization performance (F score, precision, and recall) measured by the test dataset for each condition is shown in Figure 6. These are histograms of 100 CNNs developed using 100 random seeds. The results indicated that the generalization scores were nearly the same for conditions A, B, and C. Moreover, p values of the two-sided t-test were not statistically significant. Next, we show the confusion matrices obtained by CNNs for each condition in Figure 7. The values were averaged by 100 seed results and standardized, where the summation in each row was 1. Consequently, the confusion matrices were nearly the same. Although the proposed algorithm removed some signals, generalization errors did not increase. Therefore, we consider FG-SSA has the effect of finding and removing signals that are not important for CNN-based classification. From another viewpoint, the number of correct classifica- tions of left hand motions (Stand L, Walk L, and Sit L) was small in all conditions. We adopted weighted cross- entropy-based learning for CNNs because the original data size of the left hand motions is small, as indicated in Table I. However, we consider that an appropriate classification cannot be performed because the data diversity of these motions is low. Although we believe that nearly all subjects are right- the explanation of subjects' dominant arm in the handed, to the best of our OPPORTUNITY dataset is insufficient 8 THIS IS THE PREPRINT VERSION (FEB. 2023). Fig. 6. Histograms of estimation score using the test dataset (total 100 seeds). The macro averages of 10 classes of F score, precision, and recall from left to right, and Conditions A, B, and C from top to bottom. Fig. 7. Confusion matrices of the conditions A, B, and C using the test dataset. Values are averaged by results of 100 seeds. The values are standardized wherein the summation in each row is one. knowledge. V. CONCLUSION, LIMITATIONS, AND FUTURE WORKS In this paper, we describe the following two topics to find and remove nonimportant signals for CNN-based classifica- tion. • (1) The signals importance indices SIM Imat(X) and SIV Ivec(X) are explained in Subsection II-D. • (2) The algorithm of the linear complexity O(ns) for obtaining the signals subset Suse from the initial signals set S by finding and removing nonimportant signals (see Algorithm 1). Although the proposed algorithm performed well in the case of the OPPORTUNITY dataset, it had some limitations. This is explained in the following sections. Future work will confirm these findings. • (A) The results described in this paper is obtained from limited cases. Although we assume that the algorithm can be applied to other than acceleration signals, e.g., EEG, ECG, and others, it is not validated. • (B) In this experiment, the initial signals set size was 15. Y. OMAE et al.: FG-SSA: FEATURES GRADIENT-BASED SIGNALS SELECTION ALGORITHM FOR CONVOLUTIONAL NEURAL NETWORKS 9 The number of signals may be much higher depending on some situations. It to determine the relationship between the number of nonimportant signals and effectiveness of FG-SSA. is important • (C) We assume that the algorithm may extract the sig- nals subset weighted specific target class by providing class weights to the signal importance I s(X) defined in Equation 13. In other words, we denote the importance of signal s weighted classes as I s(X; w) = 1 |C| (cid:88) c(cid:48)∈C wc(cid:48) I s,c(cid:48) mat(X), (18) where wc(cid:48) the class weight vector, defined as follows: denotes the weight of class c(cid:48) and w denotes w = [wc(cid:48) ] ∈ R|C|, s.t., wc(cid:48) = 1. (19) (cid:88) c(cid:48)∈C We note that the algorithm based on I s(X; w) can return the signals subset weighted specific classes. However, this effect is not confirmed in this paper. This will be studied in the future. APPENDIX: LAYERS STRUCTURE OF CNNS The CNNs layer structure is illustrated in Figure 1. First, an input layer exists for inputting w × ns size data (w: window length, ns: the number of signals). Then, nc = 3 convolution layers exist to generate nf feature maps using kernel filters of convolution size sc. The convolutions are only in the direction of time. Next, the generated feature maps are transformed into a vector form by the flattened layer. Vector dimensions are gradually reduced to 200, 100, and 50. Finally, an output vector y of 10 dimensions is generated, and classification is performed. The total number of CNN layers is nine (one input layer, three convolution layers, four dense layers, and one output layer). The activation function of each layer is ReLu. We performed a hyperparameter search for convolution size sc and the number of kernel filters nf and learning rate r. In particular, CNNs were trained using the training and validation datasets described in Subsection II-A and 300 epochs. We adopted a weighted cross-entropy-based loss function based on the inverse values of class sample sizes because the sample sizes of each class are imbalanced, as listed in Table I. The parameter candidates are as follows: sc ∈ {5, 10, 15}, nf ∈ {5, 10}, r ∈ {10−3, 10−4}. (20) The combination of hyperparameters leading to the maximum validation accuracy was (sc, nf , r) = (10, 10, 10−4) (accuracy: 0.726). Therefore, we adopted these parameters because all CNNs appeared in this study. Although CNNs have many other hyperparameters, we refrained from excessive tuning because the main purpose of this study is to provide and confirm the signal-selection algorithm. REFERENCES [1] N. Shahini, Z. Bahrami, S. Sheykhivand, S. Marandi, M. Danishvar, S. Danishvar, and Y. Roosta, "Automatically identified eeg signals of movement intention based on cnn network (end-to-end)," Electronics, vol. 11, 2022. [2] T. Zebin, P. J. Scully, and K. B. Ozanyan, "Human activity recognition with inertial sensors using a deep learning approach," Proceedings of IEEE Sensors, 2017. [3] W. Xu, Y. Pang, Y. Yang, and Y. Liu, "Human activity recognition based on convolutional neural network," Proceedings of the International Conference on Pattern Recognition, pp. 165–170, 2018. [4] Y. Omae, M. Kobayashi, K. Sakai, T. Akiduki, A. Shionoya, and H. Takahashi, "Detection of swimming stroke start timing by deep learn- ing from an inertial sensor," ICIC Express Letters Part B: Applications ICIC International, vol. 11, pp. 245–251, 2020. [5] D. Sagga, A. Echtioui, R. Khemakhem, and M. Ghorbel, "Epileptic seizure detection using eeg signals based on 1d-cnn approach," Pro- ceedings - STA 2020: 2020 20th International Conference on Sciences and Techniques of Automatic Control and Computer Engineering, pp. 51–56, 2020. [6] N. Dua, S. N. Singh, and V. B. Semwal, "Multi-input cnn-gru based human activity recognition using wearable sensors," Computing, vol. 103, pp. 1461–1478, 2021. [7] Y. H. Yeh, D. P. Wong, C. T. Lee, and P. H. Chou, "Deep learning- based real-time activity recognition with multiple inertial sensors," ACM International Conference Proceeding Series, pp. 92–99, 2022. [8] J. P. Wolff, F. Gr ̈utzmacher, A. Wellnitz, and C. Haubelt, "Activity recog- nition using head worn inertial sensors," ACM International Conference Proceeding Series, 2018. [9] R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and D. Batra, "Grad-cam: Visual explanations from deep networks via gradient-based localization," International Journal of Computer Vision, vol. 128, pp. 336–359, 2016. [10] A. L. A. O. Antonio Torralba Bolei Zhou, Aditya Khosla, "Learning deep features for discriminative localization," 2016, pp. 2921–2929. [11] M. Kara, Z. ̈Ozt ̈urk, S. Akpek, A. A. Turupcu, P. Su, and Y. Shen, "Covid-19 diagnosis from chest ct scans: a weakly supervised cnn-lstm approach," AI, vol. 2, pp. 330–341, 7 2021. [12] M. Kavitha, N. Yudistira, and T. Kurita, "Multi instance learning via deep cnn for multi-class recognition of alzheimer's disease," 11 2019. doi: 10.1109/IWCIA47330.2019.8955006 pp. 89–94. [13] J. G. Nam, J. Kim, K. Noh, H. Choi, D. S. Kim, S. J. Yoo, H. L. Yang, E. J. Hwang, J. M. Goo, E. A. Park, H. Y. Sun, M. S. Kim, and C. M. Park, "Automatic prediction of left cardiac chamber enlargement from chest radiographs using convolutional neural network," European Radiology, vol. 31, pp. 8130–8140, 11 2021. [14] T. Matsumoto, S. Kodera, H. Shinohara, H. Ieki, T. Yamaguchi, Y. Hi- gashikuni, A. Kiyosue, K. Ito, J. Ando, E. Takimoto, H. Akazawa, H. Morita, and I. Komuro, "Diagnosing heart failure from chest x-ray images using deep learning," International Heart Journal, vol. 61, pp. 781–786, 7 2020. [15] Y. Hirata, K. Kusunose, T. Tsuji, K. Fujimori, J. Kotoku, and M. Sata, "Deep learning for detection of elevated pulmonary artery wedge pressure using standard chest x-ray," Canadian Journal of Cardiology, vol. 37, pp. 1198–1206, 8 2021. [16] M. Dutt, S. Redhu, M. Goodwin, and C. W. Omlin, "Sleepxai: An explainable deep learning approach for multi-class sleep stage identi- fication," Applied Intelligence, pp. 1–14, 12 2022. [17] S. Jonas, A. O. Rossetti, M. Oddo, S. Jenni, P. Favaro, and F. Zubler, "Eeg-based outcome prediction after cardiac arrest with convolutional neural networks: Performance and visualization of discriminative fea- tures," Human Brain Mapping, vol. 40, pp. 4606–4617, 11 2019. [18] C. Barros, B. Roach, J. M. Ford, A. P. Pinheiro, and C. A. Silva, "From sound perception to automatic detection of schizophrenia: An eeg-based deep learning approach," Frontiers in Psychiatry, vol. 12, 2022. [19] Y. Yan, H. Zhou, L. Huang, X. Cheng, and S. Kuang, "A novel two- stage refine filtering method for eeg-based motor imagery classification," Frontiers in Neuroscience, vol. 15, 2021. [20] M. Porumb, S. Stranges, A. Pescap`e, and L. Pecchia, "Precision medicine and artificial intelligence: A pilot study on deep learning for hypoglycemic events detection based on ecg," Scientific Reports, vol. 10, pp. 1–16, 1 2020. [21] S. Raghunath, A. E. U. Cerna, L. Jing, D. P. vanMaanen, J. Stough, D. N. Hartzel, J. B. Leader, H. L. Kirchner, M. C. Stumpe, A. Hafez, A. Nemani, T. Carbonati, K. W. Johnson, K. Young, C. W. Good, J. M. Pfeifer, A. A. Patel, B. P. Delisle, A. Alsaid, D. Beer, C. M. 10 THIS IS THE PREPRINT VERSION (FEB. 2023). Haggerty, and B. K. Fornwalt, "Prediction of mortality from 12-lead electrocardiogram voltage data using a deep neural network," Nature Medicine, vol. 26, pp. 886–891, 6 2020. [22] H. Shin, "Deep convolutional neural network-based hemiplegic gait detection using an inertial sensor located freely in a pocket," Sensors, vol. 22, 2022. [23] G. Aquino, M. G. Costa, and C. F. C. Filho, "Explaining one- dimensional convolutional models in human activity recognition and biometric identification tasks," Sensors, vol. 22, 2022. [24] E. Kim, "Interpretable and accurate convolutional neural networks for human activity recognition," IEEE Transactions on Industrial Informat- ics, vol. 16, pp. 7190–7198, 2020. [25] R. Chavarriaga, H. Sagha, A. Calatroni, S. T. Digumarti, G. Tr ̈oster, J. D. R. Mill ́an, and D. Roggen, "The opportunity challenge: A bench- mark database for on-body sensor-based activity recognition," Pattern Recognition Letters, vol. 34, pp. 2033–2042, 2013. [26] H. Sagha, S. T. Digumarti, J. D. R. Mill ́an, R. Chavarriaga, A. Calatroni, D. Roggen, and G. Tr ̈oster, "Benchmarking classification techniques using the opportunity human activity dataset," Conference Proceedings - IEEE International Conference on Systems, Man and Cybernetics, pp. 36–40, 2011. [27] A. Murad and J. Y. Pyun, "Deep recurrent neural networks for human activity recognition," Sensors, vol. 17, 2017. [28] J. B. Yang, M. N. Nguyen, P. P. San, X. L. Li, and S. Krishnaswamy, "Deep convolutional neural networks on multichannel time series for human activity recognition," Proceedings of the Twenty-Fourth Interna- tional Joint Conference on Artificial Intelligence, pp. 3995–4001, 2015. [29] O. Banos, J. M. Galvez, M. Damas, H. Pomares, and I. Rojas, "Window size impact in human activity recognition," Sensors, vol. 14, pp. 6474– 6499, 2014. [30] T. Tanaka, I. Nambu, Y. Maruyama, and Y. Wada, "Sliding-window nor- malization to improve the performance of machine-learning models for real-time motion prediction using electromyography," Sensors, vol. 22, 2022.
http://arxiv.org/abs/2302.11777v1
2023-02-23T04:37:49
2023-02-23T04:37:49
Embeddings for Tabular Data: A Survey
Tabular data comprising rows (samples) with the same set of columns (attributes, is one of the most widely used data-type among various industries, including financial services, health care, research, retail, and logistics, to name a few. Tables are becoming the natural way of storing data among various industries and academia. The data stored in these tables serve as an essential source of information for making various decisions. As computational power and internet connectivity increase, the data stored by these companies grow exponentially, and not only do the databases become vast and challenging to maintain and operate, but the quantity of database tasks also increases. Thus a new line of research work has been started, which applies various learning techniques to support various database tasks for such large and complex tables. In this work, we split the quest of learning on tabular data into two phases: The Classical Learning Phase and The Modern Machine Learning Phase. The classical learning phase consists of the models such as SVMs, linear and logistic regression, and tree-based methods. These models are best suited for small-size tables. However, the number of tasks these models can address is limited to classification and regression. In contrast, the Modern Machine Learning Phase contains models that use deep learning for learning latent space representation of table entities. The objective of this survey is to scrutinize the varied approaches used by practitioners to learn representation for the structured data, and to compare their efficacy.
[ "Rajat Singh", "Srikanta Bedathur" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11777v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11777v1", "@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.DB", "cs.IR" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 7 7 7 1 1 . 2 0 3 2 : v i X r a Embeddings for Tabular Data: A Survey Rajat Singh, Srikanta Bedathur [email protected], [email protected] Indian Institute of Technology Delhi Hauz Khas, Delhi-110016, India February 24, 2023 1 Introduction Tabular data1 comprising rows (samples) with the same set of columns (attributes), is one of the most widely used data-type among various industries, including financial services, health care, research, retail, logistics, and climate science, to name a few. Tabular data is unique in several ways and comes with its own properties and challenges, as discussed in Section 2 and 3, respectively, making it difficult to work with. Tabular data contain heterogeneous features, i.e., a table can be a mixture of different types of data: text, numerical, and categorical, to name a few. In addition, tables have intricate inter-dependencies between columns and intra-dependencies within the column. According to the survey [1], SQL2, which is used to efficiently store, query, and access the tables in a database system, is one of the most popular technologies growing among developers. Hence, tables are becoming the natural way of storing data among various industries and academia. The data stored in these tables serve as an essential source of information for making various decisions. As computational power and internet connectivity increase, the data stored by these companies grow exponentially, and not only do the databases become vast and challenging to maintain and operate, but the quantity of database tasks also increases. Thus a new line of research work has been started, which applies various learning techniques to support various database tasks (subsection 4.2) for such large and complex tables. In this work, we split the quest of learning on tabular data into two phases: The Classical Learning Phase (Section 4.1.1) and The Modern Machine Learning Phase (Section 4.1.2). The classical learning phase consists of the models such as SVMs [2], linear and logistic regression [3], and tree-based methods [4, 5, 6, 7, 8, 9]. These models are best suited for small-size tables. However, the number of tasks these models can address is limited to classification and regression [3]. In contrast, the Modern Machine Learning Phase contains models [10, 11, 12, 13, 14, 15, 16] that use deep learning for learning latent space representation of table entities. Deep Neural Networks come with their own set of advantages and disadvantages. Some major pros of using deep learning for tabular data include flexibility, end-to-end training, building more extensive pipelines, and the ability to handle large datasets. In contrast, the significant challenges faced by deep learning models include transparency, interpretability, and heterogeneous features. We split the models into four broad categories according to how a table is visualized. Some models treat the table as an images [14, 17] and graphs [15] whereas others treat the table as simple text [13, 18, 19] or as table only [20, 21]. 1Tabular Data is also known as "Structured Data" in the literature. 2SQL stands for Structured Query Language, helps in accessing, managing, and manipulating the Relational Databases (RDBs) where data is stored in the form of one or more tables. 1 Accordingly, this survey is structured as follows: • We initiate the discussion with definitions and preliminaries of tabular data in section 2. In this section, we talked about what is tabular data and provided definitions of the key terms used in the survey. • Further in section 4, we present a detailed road-map about the methods used by the practitioners to learn representation for tabular data. In subsection 4.2 and 4.3, we present the list of the tasks addressed in the literature and the most common datasets used by the practitioners to train and test their model. 2 Definitions and Preliminaries This section covers the required background for the report and provides pointers to the original works for a more detailed explanation of the methods. As a result of the proliferation of current technology and the internet's accessibility, an enormous3 amount of data is created every second. Based on various types and formats, the data can be loosely divided into the three categories (Figure 1) below: Figure 1: Classification of data. • Structured data: It refers to the data that has strong internal structure . Structured data are highly organized and straightforward to interpret. Structured data4 can be stored in the form of tables consisting of rows and columns where data within the same column share the same semantic meaning. And each row of the table has the same syntax. The ideal example of structured data is relational databases, comprising of tables with rows and columns. • Unstructured data: It refers to the data that has no predefined internal structure and is, therefore, inde- pendent of one another. Unstructured data could be anything that can not be stored in a structured database format. Even unstructured data can have internal structures, but they are not predefined explicitly. Text files (.pdf,.doc, etc.), media (audio, video, and images) are few examples of unstructured data. • Semi-Structured data: Somewhere between structured and unstructured data resides semi-structured data. They have a flexible structure, but they cannot be stored in the form of structured database format, i.e., structured tables with rows and columns. These types of data are human-crafted with markup languages. For instance, the data stored in CSV, JSON, and XML format is treated as semi-structured data. In this report, we mainly focus on Structured data, aka tabular data, and neglect semi-structured and unstruc- tured data as these data come with their challenges and are desirable to be discussed separately. 3In the scale of Quintillion bytes per day 4Structured data is also known as quantitative data. 2 2.1 Tabular Data In Statistics, tabular data refers to the data that can be represented in the form of one or more tables with rows and columns (Figure 2). Where rows represent the samples and columns represent the attributes of those samples. Each row in the table has the same number of columns in the same order. And each column contain data of the same data type. A typical table contain table metadata, column headers5, cell information and cell metadata. A cell is a basic unit of the table formed from the intersection of a row and a column in the table. Figure 2: Tabular data: Representation of data in tabular form with rows and columns. Table metadata consists of a source, name, description, joins with other tables, class, and many more about the table. Table metadata provides explicit semantics about the table. At the same time, cell metadata consists of cell type, source, and so on, which is specific to each cell. A cell stores various types of data (Figure 3), such as text data, categorical data, numerical data, image data, spatial data, hyperlinks, formulas, nested tables, and many more. • Numerical data: The majority of tabular datasets comprises of tables6 with large amounts of numerical information. Numerical data (Figure 4) provide a variety of semantic meanings, such as quantity, mea- surement, and ranking. It can undergo many arithmetic operations, including addition, multiplication, and proportion, to name a few. • Categorical data: Unlike numerical data, categorical variables do not give a sense of numerical ordering. Categorical values are also called quantitative values. These values can't be measured the same as numerical values. For example, a column with gender, marital status, education, etc., generally contains categorical values. • Text data: In the tabular dataset, text data is generally a natural language text with short length and concise meaning. For example, columns with description, address, etc., generally contain textual values. 5Column Headers are also termed as Column Name. 6Medical data, stock market, sensor data, Internet of Things(IoT) data, to name a few. 3 Figure 3: Cell Data • Spatial data: Spatial data refers to information regarding the precise location of an object in an n-dimensional space. Consequently, the cells contain spatial characteristics of the item, like coordinates, dimensions, an- notation, multipoint, and many more. • Other data types, such as nested tables, hyperlinks, formulas, visual formats, images, and time can also be inserted into the table's cell. Different data types confer distinct properties on tables, which should be processed and managed accordingly. Figure 4: Snapshot of S&P 500 stock data table. Major part of this table is Numerical Values. Properties of Tabular Data: Tabular data has unique properties that differentiate it from other data types, such as text. Here are some fundamental characteristics of tabular data: • The atomic entity of the table is the cell, which contains nuclear values. • Each column contains values of the same type. • Tables are rotation invariant; reordering the columns is inconsequential. • Each row within the table is distinct, there is no meaning of repeated rows in the table. 4 Figure 5: Typical Encoder Decoder Architecture 2.2 Embeddings Embeddings7 maps a discrete categorical variable to a vector of continuous numbers. In Natural Language Pro- cessing (NLP) context, embeddings are continuous, low-dimensional vector representations of high dimensional vectors. In general, if an embedding is learned correctly, then it can capture the semantics of the data by placing similar data points closer and dissimilar data points farther apart from each other in the latent space. Plenty of work [22, 10, 23, 24] has already been done to find the effective embeddings for the given data. 2.3 Attention based Encoders Self-attention-based 8 models [25] have done very well at sequence-to-sequence tasks, which are used in natural language [10, 26, 27], recommendation systems [28, 29, 30], and time series [31, 32, 33]. In particular, the architecture of transformer described in [25] involves an Encoder-Decoder (Figure 5) architecture. An encoder is a network that takes a sequence of inputs and maps them to a latent representation with d dimensions. This latent representation keeps the features that matter the most for reconstruction and discards the features that aren't needed. Further, this latent representation is passed to the Decoder to generate the input sequence. In [25] author proposed advanced dot product attention, i.e., multi-head attention. It takes the use of query, keys, and values as input. Specifically, it uses dot-product attention defined as: fAttn(Q, K, V ) = softmax (cid:32) QK(cid:62) √ D (cid:33) V , (1) Where fAttn is the function to calculate attention weights, Q, K, and V represent queries, keys, and values respectively. 7Embeddings are also called Representation. 8Self-attention, sometimes called intra-attention. 5 3 Learning on Structured Data: Challenges C1 Data Quality: It is the most common challenge faced by researchers while dealing with real-world tabular datasets. There are various reasons for low-quality of the tabular data; some of them include the imbalanced distribution of classes [34], missing values in the table [35], erroneous and inconsistent data present in the table [36], outliers [37], and many more. The majority of the models are negatively affected by the poor quality of the data, thus opening a new domain for research to minimize the effect of poor-quality data on ML models. C2 Complex dependencies between tokens: Tabular data often have complex inter and intra dependencies between the tokens. Sometimes there is no relationship between the tokens of the table, and sometimes there are complex dependencies. Therefore, models must learn these dependencies anew for each dataset. This makes it difficult for ML models to generalize on tabular data. C3 Different semantics for the same token: Since there are complex dependencies between tokens of the table thus, a single token appearing in two places can have multiple semantic meanings. For e.g., in the IMDB database, token 1991 under the date of birth column of an actor is different from its presence in release year column in movie table. The same token under different columns has different types. Therefore, it is essential to capture the semantics of tokens in the database. C4 Pre-processing: For tabular data, the performance of the model is heavily dependent on the pre-processing strategy used. Pre-processing consist of four major task: data cleaning, data transformation, data integration, and data reduction. Data cleaning refers to removing of incorrect, inconsistent, incomplete rows/columns from the tables. Data transformation refers to change in raw structure of the data, for example, in [24], numerical values are pre-processed and converted into a vector. Similarly, categorical values are processed and transformed into numerical ids. Data integration refers to joining of two or more tables when needed. Data reduction is the process of removing extra rows from the table and keep that many rows that makes the analysis easier and yet produce the same quality of result. In case of data reduction and data cleaning, pre-processing of data leads to information loss. C5 Domain specific vocabulary: Many of the existing works [20, 13] leverage the knowledge gathered by large language models (LLMs) like BERT [10], GPT[38], T5 [39], and so on. These approaches fine- tuned the LLMs with their tabular data. However, a domain-specific database has its dedicated vocabulary, and language models are not trained on those. For instance, MIMIC is a data warehouse of anonymized hospitalization information of patients admitted to Beth Israel Deaconess medical center. Multiple tables in the database have columns that contain special medical codes that represent different medical emergencies, diagnosis groups, and so on. In such cases, LLM-based solutions may turn out to be not helpful. C6 Heterogeneous Data: Most of the real-world tables are heterogeneous in nature, i.e., a table can be a combination of columns with categorical values, numerical values, text values, and many more. Thus it is important that the model should understand the type of columns present in the table for a better understanding of the table. 6 Figure 6: Explored aspects of Tabular Data. 4 Related Work This section will provide an overview of the evolution of learning on tabular data over time. This transformation occurred in two phases; The Classical Machine Learning phase and The Modern Machine Learning phase. SVMs, Kernel Methods, Regression Techniques like Logistic and Linear Regression, Classification Techniques, and Tree- Based Methods all come under the traditional ML phase. In contrast, the Modern ML phase includes all the deep learning algorithms, such as GNNs, attention-based methods, and many more. The models that come under the classical learning phase can only capture the complex patterns in the table, thus making the model explainable. In contrast, the models used in the modern learning phase project tabular data into latent space in order to capture hidden properties and relations of the table. These models are more difficult to explain than traditional learning models. Researchers have examined the tabular data from a variety of lenses, as illustrated in Figure 6. Tables [20, 21], graphs [15, 40], sentences [13, 11], images [14, 17], and trees [4, 5, 6, 7, 8, 9] have all been used to represent tabular data. Each modality comes to have its own advantages and limitations. Below we tried to address all the state-of-the-art models from each modality with their limitations. 4.1 Models 4.1.1 The Classical Machine Learning phase • Classical Models: Between the 1950s and 1960s, machine learning emerged as a distinct discipline. Most of the algorithms that were designed during that phase were based on probabilistic reasoning and statistics. Classical Models (Figure 7) can be broadly classified into supervised and unsupervised learning. Super- In vised Learning algorithms consist of the algorithms like SVMs [2], Logistic and Linear Regression. contrast, Unsupervised Learning Algorithms consist of algorithms like clustering algorithms (K-means clus- tering [41], DBSCAN [42]) and dimensionality reduction algorithms (Principal Component Analysis [43], Singular Value Decomposition [44], Latent Dirichlet allocation [45], Latent Semantic Analysis (LSA [46], pLSA [47])). Linear Regression is used for regression, i.e., predicting the continuous values, while Logistic Regression is used for classification. When there is more than one predictor variable, then it is known as multiple 7 Figure 7: Classical Models Figure 8: SVM classification (https://www.datacamp.com) 8 linear regression or multivariable linear regression.SVMs (Figure 8)9 are used for classification, regression and the detection of outliers. SVMs choose the decision boundary that maximizes the distance from all the classes' nearest data points. SVMs are broadly classified into Simple SVM and Kernel-based SVMs, where simple SVM is used in the case where data is linearly separable, and Kernel SVMs are used when the dataset consists of non-linear data. Kernel SVMs use kernel functions10 to address the non-linearity in the data. Clustering and dimensionality reduction algorithms come under unsupervised learning algorithms. As the name suggests, clustering tries to group data samples with the same features into one cluster, for example, k-means clustering. In contrast, dimensionality reduction algorithms try to reduce the dimensions required to represent the same data sample with minimum loss in feature. After dimension reduction, performing the downstream task over the learned representation becomes easier. Figure 9: Tree-based Models • Tree-based models: Another set of algorithms that come under the classical machine learning phase is tree- based models (Decision Tree [4], XGBoost [8], CatBoost [9], Lightgbm [48], AdaBoost [6], Random Forest [5]). Tree-based models have been the go-to model for learning on tabular data for decades because they are not only explainable but also handle heterogeneous data. Tree-based models adhere to the methodology of Decision Trees [4], one of the first and most widely used techniques for learning discriminatory models. In general, decision trees make a statement at each step, and based on that statement; it will decide whether the statement is True or False. The top of the decision tree is known as Root Node, the bottommost nodes at each branch are called leaf nodes, and the nodes between the root node and the leaf nodes are called internal nodes. When a decision tree is used to classify data into categories, it is known as a classification tree. When it predicts continuous numerical values, it is known as a regression tree. Thus, the decision tree splits the data into two parts at each decision step. The quality of this split can be 9Source: https://www.datacamp.com/tutorial/svm-classification-scikit-learn-python 10Some popular kernel functions include: Linear Kernel, Polynomial Kernel, Radial Basis Function Kernel 9 calculated using the following statistical methods: Gini impurity, Weighted Gini impurity, information gain, entropy gain, and chi-square. The most prevalent is the Gini impurity, which reduces the impurity of the decision tree. The Gini Impurity for a split is calculated as the weighted average of leaf impurity, and the leaf impurity is calculated as: Gini Impurity of a leaf (G) = 1 − n (cid:88) i=1 p2 i (2) Where pi is the probability of the ith class in a leaf. A single decision tree does not improve performance when the dataset's structure is complex. Therefore, the assembly of two or more trees is performed to improve performance, also known as Ensemble Technique. The ensemble model is based on the idea that several weak learners can be combined to create a strong learner. Ensemble models can be broadly categorized as bagging or boosting. When we need to lower the variance of the decision tree classifier, we use bagging. When we need to improve the accuracy of the decision tree classifier, we use boosting. Bagging models construct different decision tree corresponding to each subset of samples chosen from the training samples with replacement. The final decision is the average of all the predictions from different decision trees, for example, Random Forest [5]. On the other hand, Boosting models try to improve the accuracy from prior learner to new learner by analyzing the error of the prior learners, for example, Ada Boost [6], Gradient Boost [7], XGBoost [8]. Random Forest [5] is an improvement over the decision tree. The one aspect that restricts the decision tree from being the ideal tool for learning is "inaccuracy". Decision trees work well with the training samples but perform extremely badly with the new samples. On the other hand, random forests construct multiple random trees from bootstrapped data by randomly selecting samples from original data, which helps in visualizing multiple aspects of the dataset. The ensemble of multiple random trees is what makes random forests more effective than individual decision trees. Another advantage of a random forest over a simple decision tree is that it maintains accuracy with missing data, and it reduces the over-fitting of the model. Ada Boost [6], also known as Adaptive Boost, is an improvement over the random forest. The major draw- backs of random forest are that 1) it gives equal weight to all decision trees in the final answer, 2) all the decision trees are independent in the random forest, and 3) since the final prediction in the random forest is the mean of predictions from all decision trees, it is not completely accurate. In contrast, Ada Boost uses stumps, a tree with one node and two leaves, also known as weak learners. Each stump has a different weight to the final classification. Each stump is influenced by the mistake of the previous stump. Thus at each step of the Ada Boost, it creates a new learner by learning from the mistakes of the previous learner. Gradient Boost [7] starts from a single leaf instead of constructing a complete decision tree or stumps. In further steps, gradient boost calculates the errors made by the previously built decision tree and builds a new decision tree on top of it based on the previous error. The key difference between the Gradient Boost and Ada Boost is that Ada Boost tries to minimize the exponential loss function that can make the model sensitive to outliers, whereas Gradient Boost can use any differential loss function. Thus Gradient Boost is more flexible and robust to outliers. More formally, as in [49], given a training dataset (Table) T = {xi, yi}N i , where x are features and y is the ˆF (x), of the actual function target value, the goal of gradient boosting is to find an approximation function, F ∗(x), which maps instances x to their output values y, by minimizing the expected value of a given loss 10 function, L(y, F (x)). Gradient boosting builds an additive approximation of F ∗(x) as a weighted sum of functions Fm(x) = Fm−1(x) + ρmhm(x) (3) where ρm is the weight of the mth function, hm(x). hm(x) are also known as weak learners. XGBoost [8] stands for eXtreme Gradient Boost. XGBoost is a more regularized (L1 and L2) form of Gradient Boost. It constructs the decision trees in a similar way as Gradient Boost. XGBoost is capable of parallel learning which increases its performance as compared to Gradient Boost. Researchers have done extensive experimentation over tree-based models [50] and found that tree-based models are best suited for small to medium-sized tables and need a careful selection of hyper-parameters. But, nowadays majority of tabular data is of very large size, such as WDC Web Table Corpus (233M tables), Dresden Web Tables Corpus [Eberius et al., 2015] (174M tables), WebTables [Cafarella et al., 2008] (154M tables), and WikiTables (1.6M tables). Another drawback of using tree-based models is that at each step, they perform decision-making, which destroys the semantic relation of the cell with the corresponding column and the row. Here are some major drawbacks of using the above (the classical machine learning phase) models: – Since these models do not work with any type of data (like text data, categorical data, etc.) thus, a lot of feature tuning is required (such as converting categorical data to numerical data). – These models cannot be used as part of the bigger pipeline. – The tasks that can be performed using these models are very limited (mostly to classification and regression). – Works best with small datasets as training time is very high for large datasets. 4.1.2 The Modern Machine Learning phase The Modern Machine Learning phase is also known as "the era of Deep Learning". In this phase, deep learn- ing algorithms outperform traditional models in numerous domains, including Natural Language Processing (NLP), computer vision, image processing, etc. By projecting the data to an intermediate representation, sometimes referred to as latent space representation ( Figure 5), these models can discover complicated hid- den features in the data. Latent space comprises a compressed representation of the data, the only feature that the decoder may use to attempt to reconstruct the input as accurately as possible. In this manner, the model can capture the hidden features in the data. Some major advantages of using deep learning models include the following: – Since data can be projected into latent space; it is now possible to construct large and complex pipelines, which was previously impossible. – End-to-end training of these pipelines is possible. – In addition to classification and regression, other tasks like Question Answering (QA), missing value imputation, table-to-text conversion, and table retrieval are possible. – Able to manage enormous amounts of data during training and testing. 11 Figure 10: Image-based Models • Image-based models: Image-based models (Figure 10) such as URLNet [14], and Converting tabular data into images for deep learning with convolutional neural networks [17] take the leverage of Convolutional Neural Networks (CNNs) for representing the tables to a latent space representation. This latent repre- sentation will be used for a variety of subsequent tasks, including classification, regression, missing value imputation, etc. Image-based models often follow the pipeline depicted in Figure 11, in which a table is transformed into an image using a certain heuristic, and that image is then passed through a CNN model to determine the latent representation of the table. Figure 11: Image-based Pipelines URLNet [14] performed character level embedding to capture the spatial (sequence) level properties in the URL and word level embedding to capture different properties of the URL such as domain, protocol, and path. Further, these word-level and character-level embeddings are concatenated to form an image-like structure. They then further pass it to the convolution layer and finally to the fully connected layer with softmax to get the probability distribution of each class. In contrast, [17] provides a novel approach, IGTD, for transforming tabular data to image data. In [17], authors applied the IGTD algorithm to transform gene expression profiles of cancer cell lines (CCLs) and molecular descriptors of drugs into their corresponding image representations. In addition, they trained the CNN to predict the anti-cancer treatment response on the transformed image. The authors asserted superior findings to competing models. Some major drawbacks of using image-based models for tabular data: – A significant amount of feature engineering is required to transform the tables into images. 12 – These models cannot be generalized since they are extremely domain-specific (tables with spatial or temporal dependencies between components). – Since CNNs can only capture the local relationships around a pixel; they are unable to capture the lengthy column- or row-wise relationships. • Graph-based models: In addition to images, tables can also be seen as graphs. The initial step in the pipeline for these graph-based models is to turn the table into a graph (bi-partite graph, hyper-graph, multi-graph, etc.) using some heuristics. After constructing the graph, a GNN is trained on these graphs. GNN stands for Graph Neural Networks. ATJ-Net [15] and Cvitkovic [40] use the GNN-based technique to learn tabular data embeddings. Typically, GNN-based models initially associate the graphical ideas of nodes, edges, and vertices with the table's defining attributes of rows, columns, and cell entities. They were followed by training GNN over the constructed graph to perform learning over the graph and project the graph to a latent space representation. Figure 12: Graph-based Models The state-of-the-art model EMBDI([51]) builds a tripartite graph with each entity connected to the row ids and column ids of the table in which it resides. Furthermore, it generates sentences using a random walk over the tripartite graph and learns the embeddings of the entities. Sentences generated by random walks on a tripartite graph may contain entities that are not directly present in the same row or column of the table. EMBDI learns embeddings over the generated sentence corpus by using the standard NLP-based embedding method, word2vec. Thus EMBDI treats the table as a graph, but at the same time, it performs a random walk to construct the sentences, which puts it under the section where we treat tables as sentences. ATJ-Net [15], on the other hand, treats the tables as a hypergraph. As shown in figure 13, hypergraph consist of vertex and hyperedge, where vertex are joinable attributes among the tables and hyperedges are tuples of the tables. In figure 13 joinable attribute between Review and User tables is "user id". Whereas, within Review table the joinable attribute is "bus id" ATJ-Net seeks to develop a better representation of tables under multiple tables settings, even where a table is heterogeneous. This representation can be further used for many downstream tasks, including link prediction, review classification, and recommendation. To achieve this, they pre-processed the tables, and the text and image attributes in the table were converted into embeddings using transformers or ResNet. Categorical values are transferred to continuous integer values. After pre-processing, ATJ-Net turns the table into a hyper-graph with joinable attributes as vertices and tuples as hyper-edges. These hyper-graphs can be considered bipartite graphs where the tuples and the joinable attributes act as vertices to the bipartite graph. In addition, it feeds this hypergraph into a message- 13 passing neural network (MPNN) and determines the latent space representation of hyperedges and vertices. It also employs Random Architecture Search, which automates the manual architecture design process and outperforms manually constructed models. This latent space representation is further used to perform various downstream tasks. Figure 13: An example of Hypergraph [15] [40] aims to predict a single column in the table. It transforms relational tables into a directed multi-graph in which rows are viewed as nodes and foreign key references are handled as directed edges of the multi- graph. These graphs are later fed into GNN, which learns embeddings from the constructed graph. The main drawback of [40] is that if a table has a foreign key to itself, then it will result in selecting the entire database. In general, Graph-based models helped solve challenges that conventional NNs could not adequately address. However, extensive feature engineering is necessary for these models. Secondly, GNNs do not perform well given heterogeneous data. Figure 14: Multi-tabular schema Some major drawbacks of using graph-based models for tabular data: – Tables can have different semantics for same token as shown in figure 14 where "78" comes in two cells with two different meaning, i.e., one represents the age "78 years" where as another represents weight "78 Kg". These tokes with different semantic meanings are hard to map in graphs. – Extensive feature engineering is needed to represent a table into a graph. 14 – Since GNNs do message passing to propagate the information to the next hop node, thus there can be case when two completely independent entities affect each other's embedding. Figure 15: Table as sentence • Tables as collection of sentences: With the advancement of deep learning in Natural Language Processing (NLP) tasks, many researchers have started looking at tables as collection of different types of sentences as follows: – Zhang et al. [11], Somepalli et al. [52] treat the row of the table as a sentence. – Yu et al. [19] treat the column name of the table as a sentence. – Yin et al. [13], Herzig et al. [18] treat the whole table as a sentence. Table2Vec [11] is one of the early works that treat rows of the table as sentences. Table2Vec employs both the table data (cells) and its metadata (caption and column heading) for learning the embeddings of the entities in the tables. For learning embedding, it employs the skip-gram neural network model Word2Vec [22]. Word2Vec [22] projects the input words into a d-dimensional vector space, where similar terms are close together, and dissimilar terms are far apart. More formally, given a tuple in the table as t1, t2, ..., tn, the objective is to maximize the average log probability: 1 n n (cid:88) (cid:88) i=1 −c≤j≤c,j(cid:54)=0 logp(ti+j|ti), (4) where, c is the size of training context, and the probability p(ti+j|ti) is calculated using the following softmax function: p(to|ti) = exp((cid:126)v t=1 exp((cid:126)v (cid:124) to (cid:126)vti) (cid:124) t (cid:126)vti) (cid:80)V , (5) 15 where V is the size of vocabulary, and (cid:126)vti and (cid:126)vto to are the input and output vector representations of term t, respectively. After getting the embedding Table2Vec use that embedding for task such as Row population, Column population, and table retrieval. Bordawekar and Shmueli [23] and Bordawekar and Shmueli [53] focused on answering cognitive queries over relational data that involved locating entities that were similar, dissimilar, or analog. Similar to Ta- ble2Vec [11], their approach involved interpreting rows of tables as natural language (NL) sentences and then training a word2vec model to embed entities in a latent space. [54] aimed to use learned embeddings to identify nontrivial patterns from the database that helps in predicting appropriate policing matters. This way of simply interpreting table rows as NL sentences fail to capture the semantic relations between tables, which are often expressed via foreign key and primary key (FK-PK) pairs. Apart from models that use Word2Vec, GloVe, fastText, and so on for learning representation, another subclass of algorithms uses transformers (attention-based models Deng et al. [20], Yin et al. [13], Yu et al. [19], Somepalli et al. [52], Arik and Pfister [21], Herzig et al. [18] ) for learning representation for the tables. The core idea of these models is quite similar, i.e., the use of Vanilla Transformer with Attention modules, feed-forward network, and positional encoding. Except all these models extend the core model by modifying specific components at different levels, [55]; (1) Input, (2) Internal, (3) Output, and (4) training level. Changes done while providing training data to a model are referred to as input level modifications. The significant changes that different models make is adding or removing various encoding. TAPAS [18] requires independent row encoding to be supplied to the model, whereas TABBIE [56] use column encoding. Other input modifications include the manner input is created; for instance, EmbDi [12] employs random walk to construct sentences that are fed into the transformer model, whereas Table2Vec [11] linearizes the entire table to produce a sentence. Apart from this, the way input is being encoded, such as [24] uses particular numerical encoding for numerical features, while [11] uses simple word2vec [22] encoding, also falls under the input level. The internal level modifications are implemented to increase the model's awareness of the tabular structure. Researchers generally make modifications to the attention module to make the model structure conscious. For instance, TaBERT [13] uses both vertical and horizontal attention and SpanBERT [57] use horizontal attention. Changes done in the output level are related to the task that is being performed using that model. TAPAS [18] use an additional fully connected layer over [CLS] token for predicting the Aggregation operator used in the query, whereas [57] uses a 2-layer feed-forward network with GeLU activations for predicting the span of masked text. Changes done at the training level are linked with pre-training tasks and pre-training objectives. The pre- training task is used for end-to-end learning, where the model tries to reconstruct the correct input using the incorrect one. The most common pre-training task includes Mask Language Model, where the model masks random features from the input, and the task is to predict that feature; for example, TaBERT [13] uses column name and type masking, and SpanBERT [57] uses span masking. As a Pre-training objective majority of the models try to minimize the cross-entropy loss. • Tables as table: TabNet [21] is a transformer-based model for tabular data which does not treat a table as a sentence. TabNet tried to mimic the decision trees using attention. TabNet consists of multiple sub-networks that are processed 16 Task Task Coverage Representative Examples Figure 16: Table as table Assign class labels to problem-domain examples Classification Predicting continuous value for a sample Regression Link Prediction Finds the relation between the given two entities Tables Question Answering Retrieving table/cells from the tables for the Answer of the given NL question Table Retrieval Semantic Parsing Table Metadata Table Content Population Retrieving relevant table for given NL query Table-To-Text Table-To-SQL Cell Type Detection Column Relation Detection Header Detection Populating empty cells in the table [52, 21] [52, 21] [15] [18] [11] [58] [19] [59] [20] [60] [11, 12] Table 1: List of Downstream Tasks for Deep Learning models. in a sequential manner, and each sub-network act as a decision step, similar to decision trees. Each sub- network consists of two blocks: feature transformer block and Attentive transformer block. A few layers of Feature Transform Block are shared across all the sub-networks, and the other remaining layers are only for that particular sub-network. First, the input features are passed to the Feature Transform Block, which decides what features to pass to the next step and what features are responsible for obtaining a result at that step. The attentive transformer aggregates how much each feature has been used before the current decision step. TabNet also has a decoder that takes the encoder representation and reconstructs the feature. The universal model TURL ([20]), is another transformer-based framework for learning deep contextualized representations of table entities. It can be placed in both table as collection of sentences and table as table bucket because, it treat table as the linearize document of sentences and in the same time it uses structure- aware transformer and various types of encoding to capture the sense of table. It learns embeddings for each entity during pre-training and uses a visibility matrix to capture intra-row and intra-column relations of entities in the table. Furthermore, to get the final embedding, it used type embedding, position embedding, mention representation, and entity embedding of the entities and fed them to a structure-aware transformer with Masked Language Model (MLM) and Masked Entity Recovery (MER) as the learning objective. TURL not only uses a huge amount of metadata for pre-training but also requires an external Knowledge Base (KB) for capturing the semantics of entities in the table. It is hard to find external KB for the datasets with domain- specific vocabulary. 4.2 Downstream Tasks In subsection 4.1, we presented some of the works done to learn latent representation space for tabular data. However, learning latent representations alone was not our goal; rather, we wish to learn these representations so that we might perform better on a variety of downstream tasks using tabular data. This section offers a list of downstream tasks (Table 1) that practitioners are using to evaluate the model. 17 Figure 17: MIMIC III dataset schema of 4 tables. (https://mit-lcp.github.io/mimic-schema-spy) • Classification / Regression: Classification is a task that learns how to assign a class label to problem-domain examples. In Machine Learning, a variety of classification tasks may be encountered, and specialized mod- eling architectures are used to tackle each classification task. For example, figure 17 contains the schema of 4 tables from MIMIC III dataset, and we want to predict the mortality risk of a patient given the patient details, admissions details, ICU stay and prescriptions, is a classification task given mortality rate can be only high, low, or moderate. Some classification tasks include Binary Classification [61], Multi-Class Clas- sification [62], and Multi-Label Classification [63]. In contrast, regression is similar to classification, except in classification, we tend to predict the values which are continuous in nature. For example, in figure 17, we want to predict the number of hours a patient is likely to stay in ICU given the patient details, admissions details, ICU stay and prescriptions, is a regression task, where hours can be any real number within some range. • Link Prediction: In recent years, social network analysis has gained considerable interest. The most im- portant research direction in this field is link prediction. Link prediction is the likelihood of a relationship between two entities in a table. In ATJ-Net [15], authors use the Aminer dataset, which is an academic, social network dataset, to train their model ARM-Net to predict the link between author and paper (as a citation) and author and author (as collaboration). In context of tabular data link prediction is equivalent to find a join or entity linking task between two tables. • Table Question Answering: Given an input as Natural Language (NL) query, the table question answering objective is to retrieve the table/cell which contains the answer to the given NL query. For example, given the table in figure 18 and the NL query "Which world champions had only on reigns ?" then the model should give the result as "Dory Funk Jr." and "Gene Kiniski". There are two levels of complexity in Table 18 Question Answering, i.e., simple question answering and complex question answering. Simple question answering handles the simple lookup queries [64]. On the other hand, complex question answering task involves numerical values and aggregation operations [18]. Figure 18: A table (left) with corresponding example questions (right). [18] • Table Retrieval: Table retrieval refers to the task of retrieving relevant ranked list of tables T1, T2, ..., Tn from a collection of tables T , given a query utterance (figure 19). This is one of the least explored aspect of tabular data but have a significant impact. For instance, table retrieval can be used to restrict the search space for Table Question Answering. [65, 66]. Figure 19: : Ad hoc table retrieval: given a keyword query, the system returns a ranked list of tables [67] • Semantic Parsing: Semantic Parsing translates natural language utterances into a meaningful representa- tion. Some of the common semantic parsing tasks in tabular data include Table-To-Text conversion and 19 Table-To-SQL parsing. Table-to-text generates textual description for the given table [58]. On the other hand, given a table and the Natural Language Question as input, Table-to-SQL [19] generate a SQL query that will retrieve the answer of the given NL query over the table. • Table Metadata: Table metadata task generally relates mainly to the following tasks: Cell type, Column type, relation, and header detection. TURL [20] captures the relation between the entities using a visibility matrix. Whereas TaBERT [13] encapsulates the column type by concatenating the cell value with the column type. • Formula Prediction: Given the table and the target column of the table, the Formula prediction objective is to predict the spreadsheet formula such as addition, subtraction, maximum or minimum, for the target column of the table. • Table content population/ Table augmentation: Unlike table metadata where table metadata is noisy and/or missing, Table content population deals with corrupted or missing cell content. Given an input table with missing values, the objective is to predict the missing cell values. [11, 12] 4.3 Dataset In this section of the survey, we will examine numerous facets of tabular data used by practitioners. The datasets used to train and test a model plays a crucial role in comprehending the model's behavior and gaining a complete holistic view of the model. If a model is trained on an unbalanced dataset, it will be skewed toward the majority class and will not produce accurate predictions for minority-class test cases. Similarly, there are ML models [24] that explicitly look into the numerical data and may not fit for categorical or another type of structured data. Tabular datasets may contain a single table to store the entire dataset, or they may contain multiple intercon- nected tables where the data is distributed across multiple tables. Based on the size of Structured Data, datasets can be classified into three categories; small, medium, and large size datasets. Small-size datasets are those datasets that have too few features (∼ 5) and too few (∼ few hundreds) samples. Small-size datasets are very sparse in features and samples; thus, it becomes hard to learn any meaningful pattern from them. On the other hand, medium-size datasets contain a few hundred to a few thousand (∼ 10K) samples. Extensive experimentation shows that tree- based models [50] remain state-of-the-art on the medium-sized structured dataset. Finally, large-size datasets are those datasets that are larger than medium-sized datasets. Generally, Deep Learning based models are best suited for these large-size datasets. Based on the type of entity in the tables, tabular datasets can be classified into two categories: Homogeneous tabular data and heterogeneous tabular data. Homogeneous tabular data contain a single data modality, i.e., if the table contains numerical data (Arcene dataset [68]), then all the rows and columns will be only numerical. Unlike homogeneous tabular data, heterogeneous tabular data is a mixture of different modalities such as Arrthythmia containing categorical, Integer, and real number modalities, MNIST containing categorical and image modalities. Table 2 contains some of the popular tabular datasets and the task that is being performed using these datasets. Such as Wikipedia Tables are one of the most commonly used tabular datasets extracted by crawling over Wikipedia pages. This dataset contains around 1.6M tables with additional information about its surrounding text, such as page caption, title, and description. Similarly, SPIDER is a famous semantic parsing dataset generally used for the text-to-SQL task. It contains tables, a natural language question (10,181), and the SQL query (5,693) associated with that NL question. 20 Dataset Task Coverage Modalities TQA11, SP12, TCP13, TM14 Wikipedia Tables WDC Web Tables Corpus TQA, SP SPIDER WikiTQ MIMIC WikiSQL Forest cover-type SP TQA, SP TCP, Classification SP, TR15 Binary Classification It contain tables and its surrounding text It contain table and its metadata and the surrounding text about the table It contains table + NL Question + sql for the query It contain semi-structured tables and question-answer pair It contain large tables with domain specific vocabulary It contain semi-structured tables and question-SQL pair Table contain numerical and categorical data Table 2: Popular Tabular Datasets References [1] Stack overflow developer survey. 2022. URL https://survey.stackoverflow.co/2022. [2] William S Noble. What is a support vector machine? Nature biotechnology, 2006. [3] Douglas C Montgomery, Elizabeth A Peck, and G Geoffrey Vining. Introduction to linear regression analysis. John Wiley & Sons, 2021. [4] Johannes F ̈urnkranz. Decision Tree. Springer US. [5] Tin Kam Ho. Random decision forests. IEEE, 1995. [6] 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, 1997. [7] Jerome H Friedman. Greedy function approximation: A gradient boosting machine. Annals of statistics, 2001. [8] Tianqi Chen and Carlos Guestrin. XGBoost: A Scalable Tree Boosting System. CoRR, 2016. [9] Anna Veronika Dorogush, Vasily Ershov, and Andrey Gulin. CatBoost: gradient boosting with categorical features support. CoRR, 2018. [10] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In NAACL-HLT, 2019. [11] Li Zhang, Shuo Zhang, and Krisztian Balog. Table2vec. In Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, 2019. [12] Riccardo Cappuzzo, Paolo Papotti, and Saravanan Thirumuruganathan. EmbDI: Generating Embeddings for Relational Data Integration. ACM, 2021. [13] Pengcheng Yin, Graham Neubig, Wen-tau Yih, and Sebastian" Riedel. TaBERT: Pretraining for Joint Un- derstanding of Textual and Tabular Data. In ACL, 2020. [14] Hung Le, Quang Pham, Doyen Sahoo, and Steven C. H. Hoi. URLNet: Learning a URL Representation with Deep Learning for Malicious URL Detection. arXiv, 2018. [15] Jinze Bai, Jialin Wang, Zhao Li, Donghui Ding, Ji Zhang, and Jun Gao. ATJ-Net: Auto-Table-Join Network for Automatic Learning on Relational Databases. WWW '21, 2021. 21 [16] Kushal Majmundar, Sachin Goyal, Praneeth Netrapalli, and Prateek Jain. Met: Masked encoding for tabular data. ArXiv, 2022. [17] Yitan Zhu, Thomas Brettin, Fangfang Xia, Alexander Partin, Maulik Shukla, Hyunseung Yoo, Yvonne A. Evrard, James H. Doroshow, and Rick L. Stevens. Converting tabular data into images for deep learning with convolutional neural networks. Scientific Reports, 2021. [18] Jonathan Herzig, Pawel Krzysztof Nowak, Thomas M ̈uller, Francesco Piccinno, and Julian Eisenschlos. TaPas: Weakly Supervised Table Parsing via Pre-training. Association for Computational Linguistics, 2020. [19] Tao Yu, Chien-Sheng Wu, Xi Victoria Lin, bailin wang, Yi Chern Tan, Xinyi Yang, Dragomir Radev, richard socher, and Caiming Xiong. GraPPa: Grammar-Augmented Pre-Training for Table Semantic Parsing. In International Conference on Learning Representations, 2021. [20] Xiang Deng, Huan Sun, Alyssa Lees, You Wu, and Cong Yu. TURL: Table Understanding through Repre- sentation Learning. In VLDB, 2021. [21] Sercan ̈O Arik and Tomas Pfister. TabNet: Attentive Interpretable Tabular Learning. In AAAI, 2021. [22] T. Mikolov, K. Chen, G. Corrado, and J. Dean. Efficient Estimation of Word Representations in Vector Space. In NeurIPS, 2013. [23] Rajesh Bordawekar and Oded Shmueli. Using Word Embedding to Enable Semantic Queries in Relational Databases. In DEEM, 2017. [24] Yury Gorishniy, Ivan Rubachev, and Artem Babenko. On Embeddings for Numerical Features in Tabular Deep Learning. ArXiv, 2022. [25] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is All you Need. In NeurIPS, 2017. [26] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-Attention with Relative Position Representations. In NAACL-HLT, 2018. [27] Ivan Bilan and Benjamin Roth. Position-aware Self-attention with Relative Positional Encodings for Slot Filling. ArXive, 2018. [28] Wang-Cheng Kang and Julian McAuley. Self-Attentive Sequential Recommendation. In ICDM, 2018. [29] Fei Sun, Jun Liu, Jian Wu, Changhua Pei, Xiao Lin, Wenwu Ou, and Peng Jiang. BERT4Rec: Sequential Recommendation with Bidirectional Encoder Representations from Transformer. In CIKM, 2019. [30] Jiacheng Li, Yujie Wang, and Julian McAuley. Time Interval Aware Self-Attention for Sequential Recom- mendation. In WSDM, 2020. [31] Simiao Zuo, Haoming Jiang, Zichong Li, Tuo Zhao, and Hongyuan Zha. Transformer Hawkes Process. In ICML, 2020. [32] Qiang Zhang, Aldo Lipani, Omer Kirnap, and Emine Yilmaz. Self-attentive Hawkes processes. In ICML, 2020. 22 [33] Karishma Sharma, Yizhou Zhang, Emilio Ferrara, and Yan Liu. Identifying Coordinated Accounts on Social Media through Hidden Influence and Group Behaviours. Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, 2021. [34] Abeer S. Desuky and Sadiq Hussain. An Improved Hybrid Approach for Handling Class Imbalance Problem. Arabian Journal For Science and Engineering, 2021. [35] Adri ́an S ́anchez-Morales, Jos ́e-Luis Sancho-G ́omez, Juan Mart ́ınez-Garc ́ıa, and An ́ıbal R. Figueiras-Vidal. Improving deep learning performance with missing values via deletion and compensation. Neural Computing and Applications, 2019. [36] Guansong Pang, Chunhua Shen, Longbing Cao, and Anton Van Den Hengel. Deep Learning for Anomaly Detection: A Review. ACM Comput. Surv., 2021. [37] Lei Xu and Kalyan Veeramachaneni. Synthesizing Tabular Data using Generative Adversarial Networks. CoRR, 2018. [38] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 2019. [39] 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. JMLR, 2020. [40] Milan Cvitkovic. Supervised learning on relational databases with graph neural networks. arXiv, 2020. [41] Tapas Kanungo, David M. Mount, Nathan S. Netanyahu, Christine D. Piatko, Ruth Silverman, and Angela Y. Wu. An Efficient k-Means Clustering Algorithm: Analysis and Implementation. IEEE Trans. Pattern Anal. Mach. Intell., 2002. [42] Martin Ester, Hans-Peter Kriegel, J ̈org Sander, and Xiaowei Xu. A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise. KDD'96, 1996. [43] Herv ́e Abdi and Lynne J Williams. Principal Component Analysis. Wiley interdisciplinary reviews: compu- tational statistics, 2010. [44] Michael E Wall, Andreas Rechtsteiner, and Luis M Rocha. Singular value decomposition and principal component analysis. In A practical approach to microarray data analysis. 2003. [45] David M Blei, Andrew Y Ng, and Michael I Jordan. Latent Dirichlet Allocation. Journal of machine Learning research, 2003. [46] Thomas K Landauer, Peter W Foltz, and Darrell Laham. An introduction to latent semantic analysis. Dis- course processes, 1998. [47] Thomas Hofmann. Probabilistic Latent Semantic Analysis. In UAI, 1999. [48] Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, Weidong Ma, Qiwei Ye, and Tie-Yan Liu. LightGBM: A Highly Efficient Gradient Boosting Decision Tree. Curran Associates, Inc., 2017. [49] Candice Bent ́ejac, Anna Cs ̈orgo, and Gonzalo Mart ́ınez-Mu ̃noz. A comparative analysis of gradient boosting algorithms. Artificial Intelligence Review, 2020. 23 [50] L ́eo Grinsztajn, Edouard Oyallon, and Ga ̈el Varoquaux. Why do tree-based models still outperform deep learning on tabular data? ArXiv, 2022. [51] Riccardo Cappuzzo, Paolo Papotti, and Saravanan Thirumuruganathan. Creating Embeddings of Heteroge- neous Relational Datasets for Data Integration Tasks. In SIGMOD, 2020. [52] Gowthami Somepalli, Micah Goldblum, Avi Schwarzschild, C. Bayan Bruss, and Tom Goldstein. SAINT: Improved Neural Networks for Tabular Data via Row Attention and Contrastive Pre-Training. ArXiv, 2021. [53] Rajesh R. Bordawekar and Oded Shmueli. Exploiting Latent Information in Relational Databases via Word Embedding and Application to Degrees of Disclosure. In CIDR, 2019. [54] Apoorva Nitsure, Rajesh R. Bordawekar, and Jose Neves. Unlocking New York City Crime Insights using Relational Database Embeddings. arXiv, 2020. [55] Gilbert Badaro and Paolo Papotti. Transformers for Tabular Data Representation: A Tutorial on Models and Applications. Proc. VLDB Endow., 2022. [56] Hiroshi Iida, Dung Ngoc Thai, Varun Manjunatha, and Mohit Iyyer. TABBIE: Pretrained Representations of Tabular Data. In NAACL, 2021. [57] Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S. Weld, Luke Zettlemoyer, and Omer Levy. SpanBERT: Improving Pre-training by Representing and Predicting Spans. Transactions of the Association for Computa- tional Linguistics, 2020. [58] Heng Gong, Yawei Sun, Xiaocheng Feng, Bing Qin, Wei Bi, Xiaojiang Liu, and Ting Liu. TableGPT: Few-shot Table-to-Text Generation with Table Structure Reconstruction and Content Matching. In COLING, 2020. [59] Lun Du, Fei Gao, Xu Chen, Ran Jia, Junshan Wang, Shi Han, and Dongmei Zhang. TabularNet: A Neural Network Architecture for Understanding Semantic Structures of Tabular Data . Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, 2021. [60] Yoshihiko Suhara, Jinfeng Li, Yuliang Li, Dan Zhang, cCaugatay Demiralp, Chen Chen, and Wang Chiew Tan. Annotating Columns with Pre-trained Language Models. Proceedings of the 2022 International Con- ference on Management of Data, 2022. [61] Roshan Kumari and Saurabh Kr. Srivastava. Machine learning: A review on binary classification. Interna- tional Journal of Computer Applications, 2017. [62] Mohamed Aly. Survey on multiclass classification methods. Neural Network, 2005. [63] Grigorios Tsoumakas and Ioannis Katakis. Multi-label classification: An overview. International Journal of Data Warehousing and Mining (IJDWM), 2007. [64] Svitlana Vakulenko and Vadim Savenkov. TableQA: Question Answering on Tabular Data. CoRR, 2017. [65] Fei Wang, Kexuan Sun, Muhao Chen, Jay Pujara, and Pedro A. Szekely. Retrieving Complex Tables with Multi-Granular Graph Representation Learning. CoRR, 2021. [66] Jonathan Herzig, Thomas M ̈uller, Syrine Krichene, and Julian Martin Eisenschlos. Open Domain Question Answering over Tables via Dense Retrieval. CoRR, 2021. 24 [67] Shuo Zhang and Krisztian Balog. Ad Hoc Table Retrieval using Semantic Similarity. Proceedings of the 2018 World Wide Web Conference, 2018. [68] Isabelle Guyon, Steve R. Gunn, Asa Ben-Hur, and Gideon Dror. Result analysis of the nips 2003 feature selection challenge. In NIPS, 2004. 25
http://arxiv.org/abs/2302.11774v1
2023-02-23T04:26:34
2023-02-23T04:26:34
Cross-City Traffic Prediction via Semantic-Fused Hierarchical Graph Transfer Learning
Accurate traffic prediction benefits urban management and improves transportation efficiency. Recently, data-driven methods have been widely applied in traffic prediction and outperformed traditional methods. However, data-driven methods normally require massive data for training, while data scarcity is ubiquitous in low-developmental or newly constructed regions. To tackle this problem, we can extract meta knowledge from data-rich cities to data-scarce cities via transfer learning. Besides, relations among urban regions can be organized into various semantic graphs, e.g. proximity and POI similarity, which is barely considered in previous studies. In this paper, we propose Semantic-Fused Hierarchical Graph Transfer Learning (SF-HGTL) model to achieve knowledge transfer across cities with fused semantics. In detail, we employ hierarchical graph transformation followed by meta-knowledge retrieval to achieve knowledge transfer in various granularity. In addition, we introduce meta semantic nodes to reduce the number of parameters as well as share information across semantics. Afterwards, the parameters of the base model are generated by fused semantic embeddings to predict traffic status in terms of task heterogeneity. We implement experiments on five real-world datasets and verify the effectiveness of our SF-HGTL model by comparing it with other baselines.
[ "Kehua Chen", "Jindong Han", "Siyuan Feng", "Hai Yang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11774v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11774v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
JOURNAL OF LATEX CLASS FILES 1 Cross-City Traffic Prediction via Semantic-Fused Hierarchical Graph Transfer Learning Kehua Chen, Jindong Han, Siyuan Feng*, and Hai Yang 3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 4 7 7 1 1 . 2 0 3 2 : v i X r a Abstract-Accurate traffic prediction benefits urban manage- ment and improves transportation efficiency. Recently, data- driven methods have been widely applied in traffic prediction and outperformed traditional methods. However, data-driven methods normally require massive data for training, while data scarcity is ubiquitous in low-developmental or newly constructed regions. To tackle this problem, we can extract meta knowledge from data-rich cities to data-scarce cities via transfer learning. Besides, relations among urban regions can be organized into various semantic graphs, e.g. proximity and POI similarity, which is barely considered in previous studies. In this paper, we propose Semantic-Fused Hierarchical Graph Transfer Learning (SF-HGTL) model to achieve knowledge transfer across cities with fused semantics. In detail, we employ hierarchical graph transformation followed by meta-knowledge retrieval to achieve knowledge transfer in various granularity. In addition, we intro- duce meta semantic nodes to reduce the number of parameters as well as share information across semantics. Afterwards, the parameters of the base model are generated by fused semantic embeddings to predict traffic status in terms of task heterogeneity. We implement experiments on five real-world datasets and verify the effectiveness of our SF-HGTL model by comparing it with other baselines. Keywords-Few-shot learning, Traffic prediction, Graph neural network. I. INTRODUCTION A S a vital problem in Intelligent Transportation System (ITS), traffic prediction aims to forecast future trans- portation status, e.g. traffic flow [1], traffic speed [2], origin- destination demand [3]. Accurate traffic prediction benefits urban management and improves transportation efficiency. Due to the explosion of data volume, various machine learning methods have been used in traffic prediction and outperformed traditional approaches [4]. Nonetheless, deep learning methods normally require mas- sive data to achieve satisfactory performance, and limited data size leads to over-fitting problems. While data scarcity is ubiquitous in cities with low developmental levels or new districts, it is non-trivial to train a powerful model. In addition, traffic patterns share common features even though they are in different cities. For instance, traffic speed in commercial areas Kehua Chen and Jindong Han are with Division of Emerging Interdisci- plinary Areas (EMIA), Interdisciplinary Programs Office, The Hong Kong University of Science and Technology, Hong Kong, China. Siyuan Feng and Hai Yang are with Civil and Environmental Engineering Department, The Hong Kong University of Science and Technology H. Yang is also with the Intelligent Transportation Thrust, the Hong Kong University of Science and Technology (Guangzhou), Guangzhou, China * S. Feng is the corresponding author, E-mail: [email protected] decreases during peak time, and crowd flow from residential areas to commercial areas tends to surge in the morning. Therefore, if we can extract the traffic patterns from data-rich cities and adapt the learned patterns to data-scarce cities, we can still achieve good performance with limited data sizes. Such knowledge transfer among cities is called cross-city knowledge transfer and has attracted much attention these years. Generally, there are two paradigms in cross-city knowl- edge transfer. The first idea is Divide-Match-Transfer principle [5], [6]: both source and target cities are first divided into several regions, and the target regions absorb knowledge from the most similar source regions after matching. Moreover, the other method utilizes meta learning methods to extract meta- knowledge from source cities and adapt the knowledge based on target cities [7], [8]. In traffic prediction, meta-knowledge can be deemed as various traffic patterns. In terms of recent research, roads or stations in cities can be treated as nodes in graphs, and their distance or POI similarity can be regarded as edges. As such topological structure deter- mines traffic patterns, the knowledge transfer among graphs is more informative than grid-based transfer. However, there are still several challenges in cross-city knowledge transfer. First, most current studies merely achieved knowledge transfer at a solely local level without the consideration of coarse- scale knowledge. Here we define "local" as node level in graphs, i.e. region or grid in previous studies, and define "zone" as a relatively coarse level consisting of more than one node, and encompasses general characteristics (Fig. 1). For instance, several subway stations can all belong to one commercial zone from a physical proximity perspective, and can also belong to one functional category from a Point of Interest (POI) perspective. The local-level transfer losses such zonal information. Second, although various semantics have been employed in traffic predictions since urban data can be normally organized as multiple semantic graphs, most current knowledge-transfer models do not consider different semantic information, and we can merely concatenate various semantic representations for prediction based on current studies. Fig. 2 presents an example of the construction of various semantic graphs, although each semantic graph has identical nodes, the nodes could be connected in different ways to encompass different semantic meanings, e.g. physical proximity and POI similarity in the example. Third, compared to Divide-Match- Transfer principle, meta learning methods directly extract meta-knowledge, and hence are more generalizable. However, previous studies implicitly extract spatial-temporal patterns along with the model parameters, which does not explicitly integrate information among patterns, let alone the knowledge JOURNAL OF LATEX CLASS FILES fusion of multiple semantics. Fig. 1. Local- and zone-level transfer. Fig. 1(a) presents the transfer process among grids or regions. However, grids can be further aggregated into various zones, the transfer among zones is also meaningful but rarely considered in previous studies. Fig. 2. Example for different semantic graphs. To tackle the aforementioned challenges, we propose a novel framework for spatio-temporal transfer learning named Semantic-Fused Hierarchical Graph Transfer Learning (SF- HGTL). SF-HGTL takes graphs as inputs and is able to handle various semantic graphs. Considering the first chal- lenge, we utilize hierarchical graph transformation for each semantic graph to extract multi-level information. To extract meta-knowledge for knowledge transfer and tackle the third challenge, we design several meta-knowledge graphs to extract meta-knowledge from different levels. Graph structure is more informative compared to discrete memory vectors. To solve the second challenge as well as reduce the number of parameters, different semantics share the same meta-knowledge graphs, and their parameters are adjusted by corresponding meta semantic nodes. At last, we employ a modulating function to generate task-specific parameters for the base learner after the fusion of semantics. Note that the base learner can be any deep learning models, e.g. Recurrent Neural Network and Graph Neural Network, and we use the base learner to predict traffic status. The main contributions of this paper are as follows: • We design a novel cross-city knowledge transfer frame- work based on semantic-fused hierarchical graphs, the 2 framework uses hierarchical graph transformation to achieve local, zonal and global feature representation, and we introduce meta-knowledge graphs to benefit information retrieval in the meta-testing phase. • We introduce meta semantic nodes that not only adapt meta-knowledge in terms of various semantics, but also achieve information sharing among semantics since they utilize same meta-knowledge graphs. Semantic discrim- inator is further applied to avoid trivial solutions. • We implement several experiments based on five real- world datasets to verify the effectiveness of the proposed framework. The results demonstrate the superiority of our SF-HGTL model compared to baseline models. The remainder of the paper is organized as follows. We briefly introduce related works in Section 2, and propose def- initions and problems in Section 3. Afterwards, the proposed model is revealed in Section 4. Section 5 thoroughly introduces experiments for evaluation, results and discussions. At last, we summarize the overall paper in Section 6. II. RELATED WORK This paper is relevant to traffic prediction, transfer learning, and cross-city knowledge transfer. In this section, we briefly review related works for the above topics. A. Traffic Prediction As a classical problem, researchers have focused on traffic prediction since several decades ago. Traditional statistical methods include Historical Average (HA) [9], Autoregressive Integrated Moving Average (ARIMA) [10] and its variants. Nonetheless, these traditional methods merely capture linear relations and cannot perfectly depict data patterns. Hence, recent studies tend to use deep learning methods due to their powerful expressiveness. Researchers adopted various techniques to tackle traffic prediction problems, ranging from Recurrent Neural Network (RNN), Convolutional Neural Net- work (CNN) to Graph Neural Network (GNN). Long Short-Term Memory (LSTM) was applied in [11] traffic speed on a single road, and subsequent to predict studies normally use RNN as a model component owing to its powerful capacity of capturing non-linear dynamics. Within a city, traffic status in one region is influenced by proximal regions. To model such relations, [12] formed traffic speed as various matrices, and then transformed matrices into image channels. Then CNN was applied to predict future traffic status. Yet, CNN can only capture Euclidean relations. As an emerging technique, GNN has been widely used in current models for traffic prediction. For example, [13] modeled the traffic flow as a diffusion process on a directed graph and pro- posed DCRNN to forecast traffic speed. T-GCN [14] combined Graph Convolutional Network (GCN) and Gated Recurrent Unit (GRU) to predict traffic status. In addition, [15] came up with ST-MetaNet to capture traffic spatial and temporal correlations. The authors designed the model based on deep meta-learning and chose RNN and GNN as meta-learners. Although deep learning methods achieve accurate traffic prediction, they typically require massive data. Hence, transfer learning provides an effective method to alleviate data scarcity. JOURNAL OF LATEX CLASS FILES B. Transfer Learning Traditional machine learning approaches have achieved great success in various practical scenarios, such as object de- tection, and language processing. However, machine learning normally requires massive labeled data for training, and the collection of labeled data is time-consuming and expensive. Transfer learning achieves knowledge transfer from source domains to improve the learning performance in target do- mains. Hence, transfer learning is suitable to handle few- shot problems, i.e. rich data in source domains and scarce data in target domains. In data-based interpretation [16], the main objective of transfer learning is to minimize the distribu- tion difference between source and target domains, such as instance weighting strategy [17] and feature transformation strategy [18]. In model-based interpretation [16], the aim is to accurately predict results on the target domain by utilizing source knowledge. As an emerging method, meta-learning [19] has been used to achieve transfer learning as an effective method. In meta-learning, a number of tasks are drawn from task distributions, the model aims to learn a generalized meta- learner at the meta-training phase, and achieves fast adaption at the meta-testing phase when new tasks come. As one of the most famous methods, MAML [20] treats the meta-learner as parameter initialization by bi-level optimization, we use MAML as the basic framework in this paper. Besides, [21] raised that the utilization of task discrepancy benefits the model performance, and various modulating methods have been applied in recent studies, such as automated relational meta-graph [22], multimodal modulation network [23], and hierarchical prototype graph [24]. While most previous transfer learning studies focused on image- and text-related tasks, spatial-temporal transfer learning is at the initial stage and still without much understanding. C. Cross-City Knowledge Transfer To the best of our knowledge, [5] first proposed Divide- Match-Transfer principle. The authors partitioned the cities into equal-size grids, then matched target regions with the most correlated source regions. Afterwards, ConvLSTM was used as the backbone model to learn regional representations for prediction. At fine-tuning stage, the model tried to minimize the squared error between regional representations of target regions and matched source regions. MetaST [7] designed a memory module to extract long-term patterns from source cities. The regions in source cities were clustered into several categories as memory. Then, the attention mechanism was utilized to gather useful information from the memory during both the meta-training and meta-testing phases. ST-DANN [6] first mapped source and target data to a common embedding space, and tried to minimize Maximum Mean Discrepancy (MMD) between two embeddings. To further capture spatial dependencies, the model introduced a global attention mechanism. The attention mechanism can also be deemed as a matching process. [8] designed the model in terms of graph data structure. The model extracted meta- knowledge through GRU and Graph Attention Network (GAT). To express the structural information, graph construction loss 3 was introduced. Last, the node-level meta-knowledge was fed into a parameter generation module to produce non-shared feature extractor parameters. To alleviate negative transfer, [25] proposed selective cross-city transfer learning to filter harmful source knowledge. The authors employed edge-level and node- level adaption to training the feature network, and designed a weighting network for loss calculation. As mentioned in the introduction, there are still challenges and limitations in current studies, and this paper aims to solve them via semantic-fused hierarchical graph transfer learning. III. DEFINITION AND PROBLEM FORMULATION In this section, we introduce several definitions used in this paper and formally illustrate the cross-city knowledge transfer problem. Definition 1 (Graph): Given a graph G = (V, E, X, A). V = {v1, v2, ...., vN } is the node set, and N = |V|; E = {eij = (vi, vj)} is the edge set; X ∈ RN ×D is the node feature matrix, and the feature dimension of each node is D; A is the adjacency matrix, each entry aij indicates the weight of edge eij. Definition 2 (Few-Shot Learning): Given a dataset D, where Dtr = {X tr, Y tr} is the training set that only has a few samples, and Dts is the corresponding testing set. The aim of few-shot learning is to train a model on the training set that minimizes the prediction error on the test set. Here, we treat traffic prediction problem in the data-scarce cities as a few-shot learning problem. In this paper, we follow Model-Agnostic Meta-Learning learning (MAML) [20] framework to handle the few-shot problem. As Fig. 3 shows, we use a source dataset DS to train the meta learner, DS is organized as various tasks, denoted as {Ti}I i=1. Each task Ti includes a support set Si and a query set Qi. MAML employs Si and Qi to achieve domain adaption via bi-level optimization. In detail, assuming the initial parameters of the meta learner as θ0, we first utilize Si to update model parameters as θ(cid:48) i is employed to calculate loss based on Qi, and the parameters are updated again to acquire θi+1, i.e. outer updating. We use θi+1 for the following training. At the meta-testing stage, the target dataset DT is also formed as tasks, we employ θi+1 as the initial parameters, fine-tune parameters based on Sk and test the model performance in Qk. i. Then θ(cid:48) Problem Definition 1 (Traffic Prediction): Consider there are N sensors/recorders in a given city, sensor/recorder n measures traffic status on a specific node (e.g. road link, or subway t . Given past T records, station) at the sequential traffic status can be naturally deemed as node features, then traffic prediction aims to find a function g(*) that predicts the next M traffic status: time t, denoted as X n     2 1 X t−T +1 X t−T +1 ... X t−T +1 N     ... X t 1 ... X t 2 ... ... ... X t N g(*) −→     X t+1 1 X t+1 2 ... X t+1 N     (1) 1 ... X t+M ... X t+M ... ... X t+M 2 ... N The above past T traffic status of N nodes and its correspond- ing M traffic status are deemed as one sample. Various samples consist of one task Ti. JOURNAL OF LATEX CLASS FILES 4 GRU to generate node embeddings based on historical traffic status: h(0) vi = GRU({X t−T +1 , ..., X t i }) i Afterwards, we apply Graph Neural Networks (GNN) to extract non-Euclidean information. General GNN follows mes- sage passing mechanism [26], which includes two processes: aggregation and updating. At the l-th layer, GNN updates the node embedding h(l) vi as follows: (2) h(l) vi = UPDATE(h(l−1) vi h(l−1) vj , AGG(l)({(h(l−1) , A)|vj ∈ N (vi)})) vi , (3) where N (vi) indicates the neighborhood of node vi; UPDATE can be neural networks; AGG can be mean or max pooling. However, GNN performs powerfully when focusing on local information since deep GNN leads to over-smoothing problem [27]. Hence, the hierarchical structure is able to provide a larger view and conserve node differences. [28] designed a hierarchical graph representation model to acquire graph em- beddings. Basically, hierarchical graph transformation assigns nodes to clusters at each layer in order to reduce the node numbers. Denote learned cluster assignment matrix at layer l as S(l) ∈ Rnl×nl+1, the node embeddings at layer l as Z(l), the new node/cluster embedding matrix at layer l + 1 as Xl+1, and adjacency matrix at layer l as A(l). The main process is first to generate node embeddings Z(l) through an embedding GNN, and a cluster assignment matrix S(l) through a pooling GNN at layer l. Afterwards, the nodes at layer l are assigned to clusters with new embeddings X(l+1) and a new adjacency matrix A(l+1) at layer l + 1: Z(l) = GNNl,embed(A(l), X(l)) S(l) = softmax(GNNl,pool(A(l), X(l))) X(l+1) = S(l)T A(l+1) = S(l)T Z(l) A(l)S(l) (4) (5) (6) (7) In short, we denote l-th hierarchical graph transformation as HGT(A(l), X(l)). We utilize two-layer transformations, the nodes after the first transformation demonstrates zonal infor- mation, and the second transformation aggregates the overall graphs as semantic information. The utilization of hierarchical graph transformation actually clusters similar nodes together, thus each node at deep levels can be deemed as a coarse cate- gory indicating more general information, e.g. urban functional zones. Besides, we add hierarchical link prediction loss to encode nearby nodes closely, and hierarchical entropy loss to force exclusive assignment: Ll = ||A(l), S(l)S(l)T nl(cid:88) H(Si) Le = 1 nl ||F (8) (9) i=1 where || * ||F is the Frobenius norm; H(*) means the entropy function; and Si is the i-the row of S. Fig. 3. MAML framework. Various tasks are sampled from datasets and the updating process is based on bi-level optimization. Problem Definition 2 (Cross-City Traffic Prediction): Traffic prediction based on a few training samples can be deemed as a few-shot learning problem, and we solve it with meta learning. Here we assume only one source and one target city. Given a source city denoted as CS = {Gc c=1, a target city denoted as CT = {Gc c=1, where J indicates the number of different semantics and each semantic shares the same node features X, i.e. past T traffic status. The source city is data-rich while the target city is data-scarce. We aim to find a function f (*) that leverages knowledge of the source city to predict traffic status in the target city as accurately as possible. T }J S }J IV. METHODOLOGY Fig. 4 presents the proposed model architecture. For each sample in task Ti with multiple semantic graphs, we generate a sample embedding via a semantic-fusion cell. In detail, we first feed the node features into a shared GRU, then treat hidden states as the new node features. Then, hierarchical graph transformation is applied to each semantic graph. At each transformation layer, the nodes retrieve meta-knowledge (MK) from several meta-knowledge graphs. To model the relations among various semantics, we further introduce several meta semantic nodes to adapt the parameters of meta-knowledge graphs in terms of semantics. Afterwards, each semantic graph is transformed as a semantic embedding, and we concatenate semantic embeddings as sample embedding. We treat the average of sample representations as task embedding. The task embedding then interacts with a task meta-knowledge graph. By feeding the task embedding into a task modulating function, we acquire the adapted parameters for the meta learner. A. Hierarchical Graph Transformation Assume there are k = 1, ..., K samples in support set Si, and each sample has c = 1, ..., J semantics. Although various semantics are available in spatio-temporal prediction problems, the node features are normally fixed. Here we employ a shared JOURNAL OF LATEX CLASS FILES 5 Fig. 4. The proposed model structure. For sample k in support set Si, the historical traffic status is first fed into GRU to generate node features. For each semantic, we apply hierarchical graph transformation and multi-level MK graphs to extract node, region and semantic information. To reduce parameter amount, meta semantic nodes are introduced to adjust MK graphs in terms of various semantics. Each sample then generates a sample embedding, we apply mean pooling to obtain a task embedding. At last, we retrieve meta-knowledge for task embedding and generate modulated parameters for meta learner. B. Meta-knowledge Graph Construction Inspired by [22], we design multiple meta-knowledge graphs to extract knowledge at different levels, i.e. node MK graph, zone MK graph and semantic MK graph. Here we take the node MK graph as an example for demonstration. Specifically, we denote the node MK graph as Gmk node(Xmeta, AM ) with N nodes. Both node features mi ∈ Xmeta and adjacency matrix AM (mi, mj) are learned during training: AM (mi, mj) = σ(W|mi − mj|/γ + b)) (10) where mi and mj are node features in the node MK graph; σ is sigmoid function; W and b are learnable parameters; γ is a scaling factor. Afterwards, the node-level graph of each semantic is sup- posed to retrieve meta-knowledge from the node MK graph. Here we construct a super-graph GS node connecting sample nodes with nodes in Gmk node. For the weights among node hvi and meta-node mi, we calculate them via Euclidean distances: AC(hvi, mi) = exp(−||(hvi − mi)/γ||2 2/2) n=1 exp(−||(hvi − mn)/γ||2 (cid:80)N 2/2) (11) As Fig. 5 presents, the node features and adjacency matrix of super-graph GS node are XS = Xnode ⊕ Xmeta, and AS = Anode ⊕ AC ⊕ AT C ⊕ AM respectively, where ⊕ indicates concatenation operation and T means matrix transpose. Then we feed the super-graph into a GNN and integrate node features with meta-knowledge. In our model, meta-knowledge retrieval is implemented for each layer of hierarchical graph transformation, i.e. ˆX(l) = GNN(l)(AS, X(l) S ). Therefore, we finally acquire a semantic embedding with the combination of various meta-knowledge: (13) (12) ˆX(0) = GNN(0)(A(0) ˆX(1) = GNN(1)(A(1) S , X(0) S ) X(1), A(1) = HGT(A(0), ˆX(0)) S , X(1) S ) X(2), A(2) = HGT(A(1), ˆX(1)) Xc = Mean(MLP(X(2))) S , X(2) gc = GNN(2)(A(2) S ) where MLP indicates a fully-connected neural network; Xc means semantic embeddings before MK retrieval; and gc indicates semantic embeddings after MK retrieval; Eq. 12, 14 and 17 represent meta-knowledge retrieval process, and Mean(*) is mean pooling. (14) (15) (16) (17) Subsequently, we acquire graph embeddings gc for each semantic graph and fusion semantic graph embeddings to generate a sample embedding, e.g. concatenation and atten- tion mechanism. Here we simply concatenate semantic graph embeddings to generate sample k's embedding, we name hi- erarchical graph transformation together with semantic fusion process as semantic fusion cell: zk = g1 ⊕ g2 ⊕ ... ⊕ gJ (18) Within a support set Si, we apply mean pooling to sample embeddings to acquire a task embedding: ti = Mean({zk}K k=1) (19) Afterwards, the task embedding further retrieves knowledge from a task MK graph to achieve task adaptation. The retrieval Hierarchical Graph TransformationSemantic LevelZone LevelNode LevelZone LevelNode LevelSemantic LevelSemantic LevelZone LevelNode LevelNode MK GraphZone MK GraphSemantic MK GraphMeta Semantic Nodestnt1tnt1tnt1t0t0t0GRUGRUGRUSharedSharedPhysical GraphSimilarity GraphCorrelation GraphTask MK GraphSample Embedding 1θ0Task ModulationλiθiSupport LossHierarchical LossSemantic Adjustment⊕Semantic DiscriminatorSemantic LossSupport SetSiSample 1Sample KSample Embedding KTask Embedding Semantic-Fusion Cell JOURNAL OF LATEX CLASS FILES 6 Fig. 5. The construction of super-graphs. For a super-graph, we first generate AC based on node features. Afterwards, the node feature Xs is obtained by concatenating Xnode and Xmeta, and the adjacency matrix AS is derived by Anode, Ac, AT c , Am. The shapes of XS and AS are (N + K) × d and (N + K) × (N + K) respectively. process is similar to the aforementioned super-graph construc- tion method. At last, we apply a modulating function to the initialized parameter θ0 to generate task-specific parameters: λi = σ(W * ti + b) θi = λi ◦ θ0 (20) (21) where W and b are learnable parameters; ◦ indicates element- wise multiplication. θi is then used as model parameters for prediction. C. Semantic Adjustment for Meta-knowledge Graph As introduced above, the proposed model conducts meta- knowledge retrieval for each semantic, which increases the number of parameters significantly. To alleviate this problem, we design a semantic adjustment module to achieve parameter adaption in terms of various semantics. In detail, various semantic graphs share the same MK graphs, and we introduce meta semantic nodes sc to adjust MK graphs according to different semantics. The utilization of meta semantic nodes can not only reduce the number of parameters, but also establish connections among semantics. Similar to Eq. 11, we construct a super-graph based on MK graphs and meta semantic nodes, then implement GNN to update node features of MK graphs in terms of meta semantic nodes. Then, MK graphs interact with hierarchical graphs as mentioned above. Hence, the meaning of Hierarchical in our SF-HGTL model is twofold: (i) we use hierarchical graph transformation to aggregate meta-knowledge from node, zone and semantic levels; (ii) we use meta semantic nodes to hierarchically adjust parameters of MK graphs. The features of meta semantic nodes are learned during the training phase to represent different semantics. The current framework merely captures the discrepancy from various se- mantic adjacency matrices, the signal information can vanish after the meta-knowledge retrieval process. Hence, the nodes on MK graphs rather than meta semantic nodes can represent semantic information, which leads to the trivial solution. To solve this problem, we further introduce a semantic discriminator to guide the learning of meta semantic nodes. Specifically, we treat meta semantic nodes as prototypes, i.e. forcing different semantic graph embeddings to approach corresponding meta semantic nodes and keeping away from other semantics: ˆgc = MLP(gc), ∀c = 1, ..., J J (cid:88) c=1 log exp(sc * ˆgc/τ ) j=1 exp(sc * ˆgj/τ ) (cid:80)J Ld = − (22) (23) where J is the number of semantics; τ is the temperature hyperparameter. We use an MLP(*) to increase the expressive- ness. D. Meta-optimization As introduced in [20], we split source-city datasets into massive training tasks TS in meta-training phase. A task Ti ∈ TS consists of a support set Si and a query set Qi, and Si ∩ Qi = ∅. Recall that we use past T steps to predict next M traffic status for one sample, each support set and query set consist of several samples. Afterwards, batches of tasks are sampled from TS to train our model by bi-level optimization. For task Ti, the model first acquires adjusted parameters θi as mentioned above, then leverages Si to inner-update θi: θi ← θi − α∇θLTi(fθ, Si) where α is stepsize; LTi is the task-specific loss function, e.g. Mean Square Error (MSE) and Mean Average Error (MAE) for our traffic prediction. (24) Afterwards, the meta-objective is the combination of task loss based on Qi, hierarchical link prediction loss, hierarchical entropy loss and semantic loss: Φ ← Φ − β∇Φ I (cid:88) (LTi(fθi, Qi) + μ1Ll + μ2Le + μ3Ld) i (25) where Φ is the overall parameters; β is the stepsize; μ1, μ2, μ3 are regularization factors. Algorithm 1 presents the above training process. Xmeta= m11⋯m1d⋮⋱⋮mK1⋯mKdK×dXnode= h11⋯h1d⋮⋱⋮hN1⋯hNdN×dAC= ac11⋯ac1N⋮⋱⋮acK1⋯acKNK×NXS=Xnode⊕Xmeta=h11⋯h1d⋮⋱⋮hN1m11⋮mK1⋯⋱⋯hNdm1d⋮mKd(N+K)×dAm= am11⋯am1K⋮⋱⋮amK1⋯amKKK×KAnode= an11⋯an1N⋮⋱⋮anN1⋯anNNN×NAS=AnodeATCACAm=an11⋯an1N⋮⋱⋮anN1⋯anNNac11⋯acK1⋮⋱⋮ac1N⋯acKNac11⋯ac1N⋮⋱⋮acK1⋯acKNam11⋯am1K⋮⋱⋮amK1⋯amKK(N+K)×(N+K)Meta GraphNode GraphCross Graph JOURNAL OF LATEX CLASS FILES 7 TABLE I. THE DESCRIPTION AND STATISTICS OF FOUR DATASETS Dataset # Nodes # Physical Edges Interval Time Span Mean Std NY-Taxi 460 3,886 60 min Pick:32.913, Drop:32.791 Pick:131.080, Drop:119.994 CHI-Taxi 476 4,018 60 min 1/1/2016 - 12/31/2016 Pick:5.861, Drop:5.950 Pick:39.043, Drop:34.236 DC-Taxi 420 3,538 60 min Pick:2.732, Drop:2.731 Pick:16.317, Drop:14.051 HZMetro 80 248 15 min 1/1/2019 - 1/25/2019 In:213.930, Out:216.277 In:358.880, Out:340.822 SHMetro 288 958 15 min 7/1/2016 - 9/30/2016 In:223.690, Out:229.271 In:358.880, Out:340.821 Algorithm 1 SF-HGTL meta-training algorithm Input: Source city dataset {Gc S }J hyperparameter τ ; and regularization factors μ1, μ2, and μ3. c=1; stepsize α, β; temperature i=1 ∼ TS. i=1 do vi }N i=1 via Equation (2); Sample a batch of tasks {Ti}I for Ti ∈ {Ti}I Output: Initialized model with parameter Φ for target city. 1: Randomly initialize θ0 and Φ. 2: while not done do 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: end while Obtain {h(0) Obtain zk, ∀k = 1, ..., K based on Equation (12)-(18); Compute Ll and Le via Equation (8)-(9); Compute Ld via Equation (22)-(23); Obtain ti via Equation (19) and MK retrieval process; Compute θi via Equation (20)-(21); Update θi with support set Si via Equation (24). end for Update Φ via Equation (25). V. EXPERIMENT To evaluate the effectiveness of our framework, we im- plement diverse experiments with five real-world datasets and compare the model performance with several baselines. The experiments are related to taxi pickup/dropoff and metro passenger flow prediction, and our framework can be easily transferred to other traffic prediction tasks such as traffic speed and flow prediction. Moreover, an ablation study is conducted to indicate the importance of each component of our model. At last, we conduct sensitivity analysis to show the impact of various hyperparameters. A. Experiment Setup and Datasets We choose taxi pickup/dropoff and metro passenger flow prediction tasks in this study. The taxi pickup/dropoff pre- diction involves three datasets: NY-Taxi, CHI-Taxi and DC- Taxi [25], we use proximity, road connectivity and POI graphs in the experiment similar to [25]. The metro passenger flow prediction involves two datasets: HZMetro and SHMetro [29], we utilize physical, similarity and correlation graphs in the experiment as introduced in [29]. The statistics of datasets are listed in Table I. NY-Taxi dataset: The dataset is collected based on New York taxis covered between 74.059° to 73.863° in longitude and 40.645° to 40.848° in latitude. There are 133 million records in total. The data ranges from January 1st 2016 to December 31st 2016, and the recording interval is 1 hour. CHI-Taxi dataset: The dataset is collected based on Chicago taxis covered between 87.740° to 87.576° in longitude and 41.766° to 42.013° in latitude. There are 24.5 million records in total. The data ranges from January 1st 2016 to December 31st 2016, and the recording interval is 1 hour. DC-Taxi dataset: The dataset is collected based on Wash- ington taxis covered between 77.127° to 76.926° in longitude and 38.798° to 38.969° in latitude. There are 10 million records in total. The data ranges from January 1st 2016 to December 31st 2016, and the recording interval is 1 hour. HZMetro dataset: The dataset is generated based on trans- action records of the Hangzhou metro system, the system has 2.35 million ridership each day. The data ranges from January 1st 2019 to January 25th 2019, and the recording interval is 15 min. SHMetro dataset: The dataset is generated based on trans- action records of the Shanghai metro system, the system has 811.8 million ridership each day. The data ranges from July 1st 2016 to September 30th 2016, and the recording interval is 15 min. We conduct four experiments to evaluate the model per- formance, i.e. NY-Taxi to DC-Taxi, CHI-Taxi to DC Taxi, HZMetro to SHMetro, and SHMetro to HZMetro. For taxi prediction, we employ the past 6 time steps to predict the next 5 time steps, including pickup and dropoff volumes. For metro prediction, we use the past 4 time steps to predict the next 4 time steps, including inflow and outflow volumes. Min-Max normalization and Z-score normalization are applied for taxi and metro passenger flow pre-processing respectively. Evaluation metrics: Since the prediction problem is a regression problem, we utilize two widely applied methods for evaluation: Mean Average Error (MAE) and Root Mean Square Error (RMSE). RMSE = (cid:118) (cid:117) (cid:117) (cid:116) 1 n n (cid:88) (yi − ˆyi)2 i=1 MAE = n (cid:88) |yi − ˆyi| 1 n (26) (27) i=1 where ˆyi and yi are predicted and true values of instance i respectively. Implementation details: The experiments are conducted on a Linux server with 2 NVIDIA Tesla V100 GPUs. We use TGCN [14] as the base learner to capture both temporal and spatial relations. The base learner has three TCGN layers with hidden sizes (16, 32, 32), followed by three MLP layers with hidden sizes (256, 128, 128). In addition, we choose k-GNN [30] to proceed graph data. The hidden size of SF-HGTL is 32, the number of centers for MK graphs is 5, the clustering ratio of hierarchical graph transformation is 0.3, and we let μ1 = μ2 = μ3 = 0.1. The learning rates are 1e-3 and 5e-3 for inner JOURNAL OF LATEX CLASS FILES 8 and outer updating respectively, and Adam [31] is employed as the optimizer. The code is available on github.com/ckjzsa/SF- HGTL. B. Baselines We first select several traditional statistical models and state- of-the-art deep learning methods for comparison: • ARIMA [32]: Autoregressive Integrated Moving Aver- age is a classic method for time-series prediction and merely considers linear relations among data. • GRU [33]: Gated Recurrent Unit is a popular deep learning method to capture sequential dependency of data. • TGCN [14]: TGCN employs GCN to capture the spatial features, followed by GRU to learn temporal depen- dency. Above methods merely utilize target data for model learning and do not involve the knowledge transfer process. Next, we pick several transfer learning models for comparison: • Fine-tuned Model: As a natural idea, we first train the base learner through source cities, and then fine-tune the model based on target cities. • MAML [20]: As mentioned before, MAML uses bi-level optimization for parameter initialization, and the base learner is TGCN. • ST-GFSL [8]: ST-GFSL generates non-shared param- eters based on node-level meta-knowledge. Parameter matching is implemented to retrieve similar features from source cities. • CrossTReS [25]: CrossTReS proposed a selective trans- fer learning framework to pick beneficial knowledge from the source domain by introducing a weighting network. Besides, it is suitable to handle multi-graph spatio-temporal prediction problems. Note the last two transfer learning methods develop models that focus on spatial-temporal knowledge transfer on graphs. Moreover, since most methods do not consider multiple graphs, we parallelly use multiple models with different semantic graphs followed by concatenation and a prediction head to predict future traffic status. C. Experimental Results Table II and III show the experimental results of taxi pickup/dropoff and metro passenger flow prediction. The best result is bold, and the second-best result is underlined. Gener- ally, deep learning methods outperform traditional methods and transfer-based methods further improve model performance. Although ST-GFSL model considers spatial-temporal patterns, it does not utilize semantic information and hence performs worse than CrossTReS and SF-HGTL models. For taxi volume prediction, we can find that CrossTReS outperforms SF-HGTL for short-term prediction, but has worse results for long-term prediction. One possible reason is that CrossTReS applies selection mechanism to avoid negative transfer, the re-weighting method works well when the pre- diction period is short but suffers more uncertain for long- term prediction. As a contrast, our SF-HGTL stores meta- knowledge in the MK graphs, and is more powerful to capture long-term traffic patterns. For metro passenger flow prediction, CrossTReS has relatively lower RMSE for the transfer from HZMetro to SHMetro, while our SF-HGTL model has lower MAE. Note that the size of HZMetro dataset is smaller than that of SHMetro, we can conclude that CrossTReS captures peak traffic patterns better than SF-HGTL, and SF-HGTL is better at fitting general traffic patterns when the data size of the source domain is small. However, when the transfer is from SHMetro to HZMetro, i.e. source domain has sufficient data, SF-HGTL outperforms other methods almost in every metric. D. Ablation Study We further conduct several experiments to prove the ef- ficacy of each component: (i) Remove hierarchical graph transformation, denoted as SF-HGTL−HGT ; (ii) Remove meta semantic nodes, denoted as SF-HGTL−M S; (iii) Only keep task MK graph and remove other MK graphs, denoted as SF-HGTL−M K. We implement five paralleled experiments based on metro passenger flow prediction transferring from Hangzhou to Shanghai. Fig. 6 presents the results of five experiments. The removal of hierarchical graph transformation significantly decreases the model performance, which means the information of different granularity is crucial to knowledge transfer. Moreover, the models without meta semantic nodes and MK graphs also perform worse than our SF-HGTL model, as these components store meta-knowledge extracted from various tasks. E. Sensitivity Analysis In this section, we figure out the influence of several vital hyperparameters, i.e. hidden dimension, node number in MK graphs, and clustering ratio. Five experiments are conducted for each hyperparameter based on metro passenger flow pre- diction, and we use MAE of three periods to measure the performance. Fig. 7 presents the results. It can be found that: (i) Hidden size 32 has the lowest MAE, while hidden size 128 has the highest MAE due to overfitting; (ii) The number of centers determines the capability of MK graphs, the analysis shows center number 5 and 15 have the best MAE performance. Note that increasing centers leads to high computational complexity, so we choose center number 5 in the study; (iii) As a crucial hyperparameter, the hierarchical ratio reflects the clustering granularity, a high ratio means few clusters and vice versa. The results demonstrate that the model performance peaks when the hierarchical ratio is 0.3. VI. CONCLUSION We propose a novel framework called SF-HGTL to achieve cross-city traffic prediction. SF-HGTL is based on MAML framework with a modulating function to dynamically adjust parameters of the base learner in terms of task heterogeneity. To generate task embeddings, we employ hierarchical graph JOURNAL OF LATEX CLASS FILES 9 TABLE II. THE EXPERIMENTAL RESULTS FOR TAXI PICKUP/DROPOFF PREDICTION NY-Taxi−→ DC-Taxi CHI-Taxi−→DC-Taxi Baseline ARIMA GRU TGCN Fine-tuned MAML ST-GFSL CrossTReS SF-HGTL RMSE MAE RMSE MAE 1 hour 6.464 5.604 4.960 4.986 4.990 4.858 4.820 4.966 3 hour 12.670 9.461 6.993 7.073 7.071 7.063 6.954 6.618 5 hour 15.590 11.223 7.860 7.851 7.807 7.847 7.733 7.271 1 hour 1.968 1.872 1.841 1.737 1.721 1.613 1.678 1.626 3 hour 3.490 2.869 2.624 2.491 2.544 2.284 2.258 2.041 5 hour 4.277 3.411 2.938 2.713 2.548 2.613 2.518 2.390 1 hour 6.464 5.614 4.862 4.680 4.759 4.720 4.670 4.707 3 hour 12.670 9.461 7.093 6.762 6.849 6.725 6.703 6.667 5 hour 15.590 11.231 7.696 7.682 7.640 7.505 7.370 7.302 1 hour 1.968 1.844 1.841 1.665 1.795 1.677 1.614 1.658 3 hour 3.490 2.858 2.517 2.316 2.353 2.276 2.245 2.068 5 hour 4.277 3.466 2.723 2.675 2.667 2.466 2.364 2.266 TABLE III. THE EXPERIMENTAL RESULTS FOR METRO PASSENGER FLOW PREDICTION Baseline ARIMA GRU TGCN Fine-tuned MAML ST-GFSL CrossTReS SF-HGTL HZMetro−→ SHMetro RMSE MAE SHMetro−→HZMetro RMSE MAE 15min 117.034 69.921 65.438 64.040 63.668 60.512 60.242 60.440 30min 133.054 88.188 65.723 64.276 64.380 60.971 60.793 61.197 60min 125.461 143.522 80.925 77.753 77.734 69.347 68.608 69.210 15min 52.351 32.146 33.467 32.568 32.505 32.200 32.188 30.017 30min 59.130 38.309 33.826 32.642 32.763 32.302 32.309 31.033 60min 61.755 54.856 40.022 38.281 38.418 36.690 36.401 35.400 15min 101.400 62.723 60.093 60.163 58.617 57.580 55.983 54.390 30min 113.407 69.639 63.850 62.481 61.199 60.326 60.807 57.567 60min 109.088 100.848 77.728 73.111 72.674 70.837 71.886 71.243 15min 52.416 33.177 32.535 31.183 31.776 32.879 31.677 29.317 30min 57.517 35.978 34.510 32.641 33.212 33.614 32.264 30.647 60min 57.835 48.669 41.912 38.260 39.080 38.179 38.587 36.823 Fig. 6. Ablation study for three model components. The error bar shows the standard deviation of five experiments. transformation on various semantic graphs, and fuse semantic embeddings via concatenation. In addition, we utilize meta semantic nodes and meta-knowledge graphs to implement knowledge transfer in different levels. We conduct experiments on taxi pickup/dropoff volume and metro passenger flow prediction, and compare the model performance with several state-of-the-art methods. The results show that our SF-HGTL outperforms other baseline models. Besides, the ablation study and sensitivity analysis prove the effectiveness of our model. Nonetheless, the current framework requires complete graphs in both source and target cities, while the graphs may change with the introduction of new nodes, e.g. construction of new stations or roads. Hence, how to transfer knowledge from old nodes to new nodes under dynamic graphs is a non-trivial task. We leave this for future work. ACKNOWLEDGMENT We would like to acknowledge a grant from RGC Theme- based Research Scheme (TRS) T41-603/20R, and a research grant (project N HKUST627/18) from the Hong Kong Re- search Grants Council under the NSFC/RGC Joint Research Scheme. REFERENCES [1] Y. Lv, Y. Duan, W. Kang, Z. Li, and F.-Y. Wang, "Traffic flow prediction with big data: a deep learning approach," IEEE Transactions on Intelligent Transportation Systems, vol. 16, no. 2, pp. 865–873, 2014. [2] M. T. Asif, J. Dauwels, C. Y. Goh, A. Oran, E. Fathi, M. Xu, M. M. Dhanya, N. Mitrovic, and P. Jaillet, "Spatiotemporal patterns in large-scale traffic speed prediction," IEEE Transactions on Intelligent Transportation Systems, vol. 15, no. 2, pp. 794–804, 2013. SF-HGTLSF-HGTLHGTSF-HGTLMSSF-HGTLMK303132333435363738MAE Error15 minSF-HGTLSF-HGTLHGTSF-HGTLMSSF-HGTLMK303132333435363738MAE Error30 minSF-HGTLSF-HGTLHGTSF-HGTLMSSF-HGTLMK343638404244MAE Error60 min JOURNAL OF LATEX CLASS FILES 10 Fig. 7. Sensitivity analysis for three hyperparameters. The error bar shows the standard deviation of five experiments. [3] D. Zhang, F. Xiao, M. Shen, and S. Zhong, "Dneat: A novel dynamic node-edge attention network for origin-destination demand prediction," Transportation Research Part C: Emerging Technologies, vol. 122, p. 102851, 2021. [4] D. A. Tedjopurnomo, Z. Bao, B. Zheng, F. 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, 2020. [5] L. Wang, X. Geng, X. Ma, F. Liu, and Q. Yang, "Cross-city transfer learning for deep spatio-temporal prediction," arXiv preprint arXiv:1802.00386, 2018. [6] S. Wang, H. Miao, J. Li, and J. Cao, "Spatio-temporal knowledge transfer for urban crowd flow prediction via deep attentive adaptation networks," IEEE Transactions on Intelligent Transportation Systems, vol. 23, no. 5, pp. 4695–4705, 2021. [7] H. Yao, Y. Liu, Y. Wei, X. Tang, and Z. Li, "Learning from multiple cities: A meta-learning approach for spatial-temporal prediction," in The World Wide Web Conference, 2019, pp. 2181–2191. [8] B. Lu, X. Gan, W. Zhang, H. Yao, L. Fu, and X. Wang, "Spatio- temporal graph few-shot learning with cross-city knowledge transfer," arXiv preprint arXiv:2205.13947, 2022. of modeling approaches," Journal of transportation engineering, vol. 123, no. 4, pp. 261–266, 1997. [10] M. Van Der Voort, M. Dougherty, and S. Watson, "Combining kohonen maps with arima time series models to forecast traffic flow," Trans- portation Research Part C: Emerging Technologies, vol. 4, no. 5, pp. 307–318, 1996. [11] X. Ma, Z. Tao, Y. Wang, H. Yu, and Y. Wang, "Long short-term memory neural network for traffic speed prediction using remote microwave sensor data," Transportation Research Part C: Emerging Technologies, vol. 54, pp. 187–197, 2015. [12] X. Ma, Z. Dai, Z. He, J. Ma, Y. Wang, and Y. Wang, "Learning traffic as images: a deep convolutional neural network for large-scale transportation network speed prediction," Sensors, vol. 17, no. 4, p. 818, 2017. [13] Y. Li, R. Yu, C. Shahabi, and Y. Liu, "Diffusion convolutional re- current neural network: Data-driven traffic forecasting," arXiv preprint arXiv:1707.01926, 2017. [14] L. Zhao, Y. Song, C. Zhang, Y. Liu, P. Wang, T. Lin, M. Deng, and H. Li, "T-gcn: A temporal graph convolutional network for traffic prediction," IEEE Transactions on Intelligent Transportation Systems, vol. 21, no. 9, pp. 3848–3858, 2019. [9] B. L. Smith and M. J. Demetsky, "Traffic flow forecasting: comparison [15] Z. Pan, Y. Liang, W. Wang, Y. Yu, Y. Zheng, and J. Zhang, "Urban hidden 16hidden 32hidden 64hidden 128303132333435MAE Error15 minhidden 16hidden 32hidden 64hidden 128303132333435MAE Error30 minhidden 16hidden 32hidden 64hidden 12834353637383940MAE Error60 mincenter 3center 5center 10center 1530.0030.2530.5030.7531.0031.2531.5031.7532.00MAE Errorcenter 3center 5center 10center 1530.0030.2530.5030.7531.0031.2531.5031.7532.00MAE Errorcenter 3center 5center 10center 1534.034.535.035.536.036.537.0MAE Errorratio 0.1ratio 0.3ratio 0.5ratio 0.730.0030.2530.5030.7531.0031.2531.5031.7532.00MAE Errorratio 0.1ratio 0.3ratio 0.5ratio 0.730.0030.2530.5030.7531.0031.2531.5031.7532.00MAE Errorratio 0.1ratio 0.3ratio 0.5ratio 0.734.034.535.035.536.036.537.0MAE Error JOURNAL OF LATEX CLASS FILES 11 traffic prediction from spatio-temporal data using deep meta learning," in Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, 2019, pp. 1720–1730. [16] F. Zhuang, Z. Qi, K. Duan, D. Xi, Y. Zhu, H. Zhu, H. Xiong, and Q. He, "A comprehensive survey on transfer learning," Proceedings of the IEEE, vol. 109, no. 1, pp. 43–76, 2020. J. Huang, A. Gretton, K. Borgwardt, B. Sch ̈olkopf, and A. Smola, "Correcting sample selection bias by unlabeled data," Advances in neural information processing systems, vol. 19, 2006. [17] [18] S. J. Pan, I. W. Tsang, J. T. Kwok, and Q. Yang, "Domain adaptation via transfer component analysis," IEEE transactions on neural networks, vol. 22, no. 2, pp. 199–210, 2010. J. Vanschoren, arXiv:1810.03548, 2018. "Meta-learning: A survey," preprint arXiv [19] [20] C. Finn, P. Abbeel, and S. Levine, "Model-agnostic meta-learning for fast adaptation of deep networks," in International conference on machine learning. PMLR, 2017, pp. 1126–1135. [21] A. Achille, M. Lam, R. Tewari, A. Ravichandran, S. Maji, C. C. Fowlkes, S. Soatto, and P. Perona, "Task2vec: Task embedding for meta- learning," in Proceedings of the IEEE/CVF international conference on computer vision, 2019, pp. 6430–6439. [22] H. Yao, X. Wu, Z. Tao, Y. Li, B. Ding, R. Li, and Z. Li, "Automated relational meta-learning," arXiv preprint arXiv:2001.00745, 2020. [23] F. Zhao and D. Wang, "Multimodal graph meta contrastive learning," in Proceedings of the 30th ACM International Conference on Information & Knowledge Management, 2021, pp. 3657–3661. [24] Q. Suo, J. Chou, W. Zhong, and A. Zhang, "Tadanet: Task-adaptive network for graph-enriched meta-learning," in Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2020, pp. 1789–1799. [25] Y. Jin, K. Chen, and Q. Yang, "Selective cross-city transfer learning for traffic prediction via source city region re-weighting," in Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2022, pp. 731–741. [26] W. L. Hamilton, R. Ying, and J. Leskovec, "Representation learning on graphs: Methods and applications," arXiv preprint arXiv:1709.05584, 2017. [27] D. Chen, Y. Lin, W. Li, P. Li, J. Zhou, and X. Sun, "Measuring and relieving the over-smoothing problem for graph neural networks from the topological view," in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 34, no. 04, 2020, pp. 3438–3445. [28] Z. Ying, J. You, C. Morris, X. Ren, W. Hamilton, and J. Leskovec, "Hierarchical graph representation learning with differentiable pooling," Advances in neural information processing systems, vol. 31, 2018. [29] L. Liu, J. Chen, H. Wu, J. Zhen, G. Li, and L. Lin, "Physical- virtual collaboration modeling for intra-and inter-station metro ridership prediction," IEEE Transactions on Intelligent Transportation Systems, 2020. [30] C. Morris, M. Ritzert, M. Fey, W. L. Hamilton, J. E. Lenssen, G. Rattan, and M. Grohe, "Weisfeiler and leman go neural: Higher-order graph neural networks," in Proceedings of the AAAI Conference on Artificial Intelligence (2019), vol. 33, no. 01, 2019, pp. 4602–4609. [31] D. P. Kingma and J. Ba, "Adam: A method for stochastic optimization," arXiv preprint arXiv:1412.6980, 2014. [32] R. J. Hyndman and G. Athanasopoulos, Forecasting: principles and practice. OTexts, 2018. [33] K. Cho, B. Van Merri ̈enboer, D. Bahdanau, and Y. Bengio, "On the properties of neural machine translation: Encoder-decoder approaches," arXiv preprint arXiv:1409.1259, 2014. Kehua Chen received a B.S. degree in civil en- gineering from Chongqing University, a dual M.S. degree in Environmental Science from both Univer- sity of Chinese Academy of Sciences and University of Copenhagen, and is now a Ph.D. student with the Division of Emerging Interdisciplinary Areas, Hong Kong University of Science and Technology. His research interests include spatial-temporal data mining, urban computing, driver behavior analysis and modeling. Jindong Han is currently pursuing his Ph.D. degree at the Hong Kong University of Science and Tech- nology. His research interests include spatiotemporal data mining, graph representation learning, and urban computing. He has published several research papers in prestigious conferences and journals, such as TKDE, AAAI, VLDB, and KDD. Siyuan Feng received a B.S. degree in civil en- gineering from Tongji University, a M.S. degree in Civil Engineering from University of California, Berkeley, and is now a Ph.D. candidate with the Department of Civil and Environmental Engineering, Hong Kong University of Science and Technology. His research interests include economical modelling of multi-modal mobility, deep learning in spatio- temporal traffic forecasting, reinforcement learning in multi-model transportation and urban computing. Hai Yang is currently a Chair Professor at The Hong Kong University of Science and Technology. He is internationally known as an active scholar in the field of transportation, with more than 260 papers published in SCI/SSCI indexed journals and an H- index citation rate of 56. Most of his publications appeared in leading international journals, such as Transportation Research and Transportation Science. Prof. Yang is in the Distinguished Journal Editorial Board of Transportation Research Part B: Method- ological, a top journal in the field of transportation.
http://arxiv.org/abs/2302.11766v1
2023-02-23T04:04:18
2023-02-23T04:04:18
MUTANT: A Multi-sentential Code-mixed Hinglish Dataset
The multi-sentential long sequence textual data unfolds several interesting research directions pertaining to natural language processing and generation. Though we observe several high-quality long-sequence datasets for English and other monolingual languages, there is no significant effort in building such resources for code-mixed languages such as Hinglish (code-mixing of Hindi-English). In this paper, we propose a novel task of identifying multi-sentential code-mixed text (MCT) from multilingual articles. As a use case, we leverage multilingual articles from two different data sources and build a first-of-its-kind multi-sentential code-mixed Hinglish dataset i.e., MUTANT. We propose a token-level language-aware pipeline and extend the existing metrics measuring the degree of code-mixing to a multi-sentential framework and automatically identify MCT in the multilingual articles. The MUTANT dataset comprises 67k articles with 85k identified Hinglish MCTs. To facilitate future research, we make the publicly available.
[ "Rahul Gupta", "Vivek Srivastava", "Mayank Singh" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11766v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11766v1", "@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.LG" ]
MUTANT: A Multi-sentential Code-mixed Hinglish Dataset Rahul Gupta IIT Gandhinagar Gandhinagar, Gujarat, India [email protected] Vivek Srivastava TCS Research Pune, Maharashtra, India [email protected] Mayank Singh IIT Gandhinagar Gandhinagar, Gujarat, India [email protected] Abstract The multi-sentential long sequence textual data unfolds several interesting research direc- tions pertaining to natural language processing and generation. Though we observe several high-quality long-sequence datasets for En- glish and other monolingual languages, there is no significant effort in building such re- sources for code-mixed languages such as Hinglish (code-mixing of Hindi-English). In this paper, we propose a novel task of identi- fying multi-sentential code-mixed text (MCT) from multilingual articles. As a use case, we leverage multilingual articles from two differ- ent data sources and build a first-of-its-kind multi-sentential code-mixed Hinglish dataset i.e., MUTANT. We propose a token-level language-aware pipeline and extend the ex- isting metrics measuring the degree of code- mixing to a multi-sentential framework and automatically identify MCT in the multilin- gual articles. The MUTANT dataset com- prises 67k articles with 85k identified Hinglish MCTs. To facilitate future research, we make the dataset publicly available. Figure 1: Example MCT and the corresponding ar- ticle's title form two multilingual data sources: (A) Dainik Jagran news article and (B) Man-ki-baat speech transcript. We color code the tokens as: English, Hindi, and language independent. 1 Introduction Over the years, we have seen enormous down- stream applications of multi-sentential datasets in the areas such as question-answering (Joshi et al., 2017; Tapaswi et al., 2016), summarization (Sharma et al., 2019; Cachola et al., 2020), machine translation (Bao et al., 2021), etc. The existing state-of-the-art methods prove challenging to scale effectively and efficiently on multi-sentential long sequence text (Ainslie et al., 2020), which unplugs several exciting research avenues. Unfortunately, to a large extent, the majority of the research on multi-sentential data is dominated by a few popular monolingual languages such as English, Chinese, and Spanish. Due to this, code-mixed languages (among other low-resource and under-explored lan- guages) suffer from non-existent works in the afore- mentioned areas of interest. We posit that due to several inherent challenges, the NLP community hold back on building multi- sentential datasets for the low-resource and code- mixed languages. One of the most significant bot- tlenecks in building such resources is the unavail- ability of MCT on traditional and widely popular data sources such as social media platforms where the short-length and noisy code-mixed text is avail- able in abundance. It presents several challenges such as the difficulty in curating a large-scale multi- sentential dataset at ease. Another major challenge is the lack of metrics to measure the degree of code- mixing in the multi-sentential framework. The ex- isting metrics such as code-mixing index (Das and Gambäck, 2014) and multilingual-index (Barnett et al., 2000) already suffers from major limitations (Srivastava and Singh, 2021a) in the short-length text format. In such a scenario, it gets mystifying 3 2 0 2 b e F 3 2 ] L C . s c [ 1 v 6 6 7 1 1 . 2 0 3 2 : v i X r a Dataset (Srivastava and Singh, 2020) (Khanuja et al., 2020) (Mehnaz et al., 2021) (Srivastava and Singh, 2021b) MUTANT Task(s) Machine Translation Natural Language Inference Dialogue Summarization Generation & Evaluation Summarization Data Source(s) Social media posts on Twitter & Facebook Hindi Bollywood movie transcripts Manual translation of dialogues and summaries from (Gliwa et al., 2019) IIT-B En-Hi parallel corpus (Kunchukuttan et al., 2018) Speech transcripts, press releases, and news articles # Instances Avg Tokens Avg Sentences Retrieval 13738 2240 6830 1974 13 87 31 20 1.04 7.15 7.85 1.05 84937 159 10.23 Automatic Automatic - - Manual + Automatic Table 1: Comparison of the MUTANT dataset with the currently available datasets in the Hinglish language. to build a retrieval pipeline to identify MCT and we need to depend heavily on the expertise of human annotators which is a time and cost-demanding exercise. In this work, we address both of these challenges. As a representative use case, we base our work on Hinglish, a popular code-mixed lan- guage in the Indian subcontinent. But the insights from our exploration could be extended to other code-mixed language pairs. To address the first challenge, we identify two non-traditional multilingual data sources1 i.e., po- litical speeches and press releases along with Hindi daily news articles (discussed in detail in Section 3). Figure 1 shows example Hinglish MCTs from two multilingual data sources. To address the sec- ond challenge, we propose a token-level language- aware pipeline and extend a widely popular met- ric (i.e., code-mixing index) measuring the degree of code-mixing in a multi-sentential framework. We demonstrate the effectiveness of the proposed pipeline with a minimal task-specific annotation which significantly reduces the overall human ef- fort (discussed in detail in Section 4). Eventually, we build a novel multi-sentential dataset for the Hinglish language with 85k MCTs identified from 67k articles. In Table 1, we com- pare MUTANT with four other Hinglish datasets (Srivastava and Singh, 2020; Khanuja et al., 2020; Mehnaz et al., 2021; Srivastava and Singh, 2021b) proposed for a variety of tasks such as machine translation, natural language inference, generation, and evaluation. The MUTANT dataset has a signif- icantly higher average number of sentences along with longer MCT (high average number of tokens). Alongside, the dataset notably consists of a higher number of data instances which is a rarity for the code-mixed datasets (Srivastava and Singh, 2021a). 1these data sources have not been actively employed in building datasets for the code-mixed languages 2 Multi-sentential Code-mixed Text Span (MCT) Due to the absence of a formal definition of MCT in the literature, we propose and use the following definition of MCT throughout this work: MCT: Consider a multilingual article A = {s1, s2, ..., sn} consisting of n sentences denoted by si where i ∈[1, n]. A unique non-overlapping MCT Mp in A is a chunk of m > 1 consecutive sentences i.e. Mp = {sk, sk+1, ..., sk+m−1}. Mp should satisfy the following two properties: 1. P 1: At least one sk+j in Mp should be code- mixed. Trivially, at most m-1 sk+j in Mp could be monolingual. Here, j ∈[0, m-1]. 2. P 2: sk in Mp is either the first sentence of the article or preceded by a line break. Likewise, sk+m−1 is either the last sentence of the article or succeeded by a line break. It should be noted that an article A can have multiple non-overlapping unique MCTs i.e. A = {M1, M2, ..., Mq} where q ≥0. 3 Multilingual and Multi-sentential Data Sources Over the years, we observe several interesting and diverse code-mixed data sources such as Twitter, Facebook, movie transcripts, etc. Social media sites have acted as the cornerstone of the code- mixed data collection pipelines due to the ease of availability of large-scale data. Nonetheless, they present several challenges such as noisy data, short text, abusive, and multimodal data. Given the requirements of MUTANT (i.e. multi-sentential and high-quality data), we refrain from using social media sites in this work. Here, we focus on two major data sources: 3.1 Political speeches and press releases Here, we scrape data from five different web sources. Collectively, we denote this data source as Dspeech. Aam Aadmi Party press releases (AAP): We scrape the press releases from the official website of Aam Aadmi Party2. We have scraped 320 Hindi press releases from their website. The website con- tains all the press releases in the last five years starting from June 2017. Indian National Congress speeches (INC): The official website of the INC stores some of the speeches by major INC political leaders. We have extracted 112 of these speeches from their official website3. The timeline for the scraped speeches is between August 2018 to March 2022. Man-ki-baat (MKB): Man-ki-baat is a radio pro- gram hosted by the Indian prime minister Narendra Modi where he periodically addresses the people of the nation. The MKB website4 stores the of- ficial transcripts in Hindi and English languages. We have extracted the transcripts of 67 of these programs between December 2015 to December 2021. Press Information Bureau (PIB): The Press In- formation Bureau houses the official press releases from all Indian government ministries including President's office, the Prime Minister's office, Elec- tion Commission, etc. We have extracted 30283 articles from the PIB website5. The timeline for these articles is from June 2017 to March 2022. PM speech (PMS): Majority of the Indian Prime Minister speeches (different from MKB speeches) are stored digitally on the PM India website6. We have extracted 694 of these speeches that are recorded between November 2016 to October 2021. 3.2 Hindi news articles Here, we scrape data from two major Hindi news daily websites. Collectively, we denote this data source as Dnews. Dainik Bhaskar (DB): Dainik Bhaskar is one of the most popular Hindi newspapers in India. It is ranked 4th in the world by circulation according to 2https://aamaadmiparty.org/media/ press-releases 3https://www.inc.in/media/speeches 4https://www.pmindia.gov.in/hi/mann-ki-baat/ 5https://www.pib.gov.in 6https://www.pmindia.gov.in/hi/news-updates/ World Press Trends 20167. They have digitized the daily newspapers on their website8. Articles on DB website have been divided into many categories such as 'Entertainment' and 'Sports'. We have extracted 115324 articles uploaded on the website between February 2019 to May 2022. In Table 2, we present the category-wise distribution of the articles scraped from the DB website. Category Business Entertainment Featured Lifestyle Miscellaneous National Politics Sports World Total DB 16012 18498 5536 12189 20221 18615 - 9950 14303 115324 DJ 4203 52173 19373 - - 160005 33604 - 42478 311836 Table 2: Number of articles in various news categories in the DB and DJ datasets. Dainik Jagran (DJ): Dainik Jagran is another popular Indian Hindi newspaper. According to World Press Trends 2016, DJ is ranked 5th in the world by circulation. Similar to the DB website, they have also created a repository of articles on their official website9. Here, we extract 311836 of these articles from the website that were uploaded between April 2013 to May 2022. In Table 2, we present the category-wise distribution of the arti- cles scraped from the DJ website. 4 Experimental Setup Problem definition: Given a multilingual article A comprising of q multi-sentential text spans (MST) i.e. A = {M1, M2, ..., Mq}, we predict a binary out- come LCM for each MST Mi i.e. L(A) = {LM1 CM , CM , ..., LMq LM2 CM = 1, if Mi is code-mixed, otherwise 0. In a nutshell, a code-mixed MST Mi is a MCT and it satisfies the properties P 1 and P 2 (ref. §2). CM ,}. LMi Figure 2 shows the architecture of the MCT iden- tification pipeline. Next, we discuss the various components of this pipeline in detail. 4.1 Token-level language annotation (TLA) We exploit the token-level language information to identify MCT given a multilingual article A. 7https://web.archive.org/web/ 20170706110804/http://www.wptdatabase.org/ world-press-trends-2016-facts-and-figures 8https://www.bhaskar.com 9https://www.jagran.com Figure 2: Architecture of MCT identification pipeline. We annotate the words in A using a code-mixed language identification tool. Specifically, we use L3Cube-HingLID (Nayak and Joshi, 2022) for this task. A word wi ∈ A can take either of the three lan- guage tags from the set {English, Hindi, Other}. Given that L3Cube-HingLID works only on the Roman script text, we use a Devanagari to Roman script transliteration tool10 for the tokens written in Devanagari script. In Table 3, we report the per- centage of Hindi and English tokens. With an exception of the AAP dataset, Hindi is the pre- dominant language in all the data sources. Articles 320 112 67 30283 694 115324 311836 31476 427160 AW 1129 2312 4151 525 2591 382 391 590 388 AC 6033 10691 20706 3015 13400 1977 2037 3339 2020 %H 53.97 63.83 77.17 80.96 79.02 80.22 79.28 79.97 80.18 %E 45.09 33.12 22.41 17.59 20.45 18.25 19.60 18.65 18.51 458636 401 589 80.05 18.54 AAP INC MKB PIB PMS DB DJ Dspeech Dnews Dspeech + Dnews Table 3: Distribution of the scraped articles from vari- ous data sources. AW: average number of words. AC: average number of characters. %E: percentage of En- glish tokens. %H: percentage of Hindi tokens. 4.2 Code-Mixing Index (CMI) In the literature, we observe several metrics that has been proposed to measure the degree of code- mixing in text such as code-mixing index (CMI, (Das and Gambäck, 2014)), multilingual-index (M- index, (Barnett et al., 2000)) and integration-index (I-index, (Guzmán et al., 2017)). Each of these metrics has its own merits and limitations (Srivas- tava and Singh, 2021a). In this work, we use the most widely used CMI metric due to the ease of interpretation and the suitability for the task. CMI, by definition, measures the degree of code-mixing in a text as: CM I = (cid:40) 100 ∗ [1 − max(wi) 0 n−u ] n > u n = u (1) Here, wi is the number of words of the language i, max{wi} represents the number of words of the most prominent language, n is the total number of tokens, u represents the number of language- independent tokens (such as named entities, abbre- viations, mentions, and hashtags). The CMI score ranges from 0 to 100. A low CMI score suggests the prevalence of only one language in the text whereas a high CMI score indicates a high degree of code-mixing. 4.3 Small annotated dataset (SAnD) We create a small manually annotated dataset com- prising all seven data sources. The objective of the annotation is to assign a binary label to each MST such that we can identify if the MST is code-mixed or not from the assigned label. More formally, SAnD = {A1: l1, A2: l2, ..., Au: lu}, represents u manually annotated MST11 where li ∈{0,1} ∀ i ∈[1,u]. Here, li=1, if Ai is code-mixed, otherwise 0. 10https://github.com/ritwikmishra/ 11For distinctive representation, we denote MST in SAnD devanagari-to-roman-script-transliteration with A instead of M . Articles MST Total Hing 5 3 3 47 2 30 30 60 60 120 6 69 66 62 36 207 122 239 329 568 2 5 25 27 13 48 28 72 76 148 E/H 4 64 41 35 23 159 94 167 253 420 AAP INC MKB PIB PMS DB DJ Dspeech Dnews Dspeech + Dnews Table 4: SAnD dataset statistics. Hing: Hinglish, E/H: English/Hindi. For this annotation task, we have selected a small number of articles (60 each from Dspeech and Dnews) randomly from the scraped articles. We leave it to the judgment of the annotator to decide if a sentence (and subsequently the MST) is code-mixed or not. The annotator has expert- level proficiency in Hindi, English, and Hinglish languages. In Table 4, we show the distribution of the annotated articles for each data source. In total, we annotate 120 articles and 568 MST where we identify 121 MST (21.3%) as code-mixed. 4.4 Estimating multilinguality Though CMI is widely used in numerous previ- ous works, we couldn't find any discussion on the ideal CMI score thresholding criteria to identify a good code-mixed text. The problem becomes even more challenging when we use the CMI metric in a multi-sentential framework along with constraints P 1 and P 2 (ref §2). Various works (Khanuja et al., 2020) have used empirically identified CMI thresh- olds to measure the degree of code-mixing in the text. But, we couldn't find any experimental justifi- cation for their findings. Dual MEC score: Here, we propose a novel adop- tion of the CMI metric in a constrained multi- sentential framework. For MST Mp with k sen- tences, we compute the scores for dual multilin- guality estimation criteria (MEC) as: 1. Sentence-level CMI (CM I): We compute CM I(si) for the sentence si∈ Mp using the language-information of all the words in si and the formulation given in 1. 2. Multilinguality ratio (M R): We compute CM R for the MST Mp as: M R(Mp) = Ncm k (2) Here, Ncm and k are the number of code-mixed and total sentences in Mp respectively. Figure 3 shows the mean and standard deviation of dual MEC scores on seven different data sources. Figure 3: The mean and standard deviation of the dual MEC score for different data sources. The CMI score is scaled between 0 to 1. Formulation: We identify if the sentence si is code-mixed or monolingual using CM I(si) score as: fcm(si) = (cid:40) 1, CM I(si) > α otherwise 0, (3) Here, α ∈ [0, 100] is the sentence-level CMI score threshold and fcm(.) estimates the code-mixing sta- tus (1 being code-mixed and 0 being monolingual) of the sentence under consideration. Using 3, we compute Ncm as: Ncm = Σk i=1fcm(si) Using 2 and 4, we compute M R(Mp) as: M R(Mp) = Σk i=1fcm(si) k (4) (5) We formulate the following function to identify if MST Mp with k sentences is code-mixed: gcm(Mp) = (cid:40) 1, M R(Mp) > β otherwise 0, (6) Here, β ∈[0, 1] is the multilinguality ratio thresh- old and gcm(.) estimates the code-mixing status (1 being code-mixed and 0 being monolingual) of the MST under consideration. 4.5 Dual MEC threshold computation The dual MEC formulation helps us to identify the MCT in a constrained setting by jointly modeling the sentence-level and MST-level multilinguality information. As discussed in Section 4.4, the ideal thresholds α and β are a conundrum that needs further exploration. Here, we propose to use the SAnD dataset to identify the dual MEC thresh- olds (α and β). Algorithm 1 shows the procedure to compute the thresholds. The algorithm takes SAnD dataset D with u labeled MST. We repre- sent the parameter search space for α and β with αcand and βcand respectively. αcand ranges from αlow to αhigh with a step-size of αstep whereas βcand ranges from βlow to βhigh with a step-size of βstep. Based on our empirical observation, we set (αlow, αhigh, αstep) with (0, 50, 1) and (βlow, βhigh, βstep) with (0, 0.5, 0.025). We perform the grid search on each threshold combination of (αi, βj) to identify the best combi- nation. For each threshold combination, we iden- tify the accuracy of identifying the MCT in D leveraging fcm(.) and gcm(.) formulations. We select the threshold combination with the highest accuracy as the final threshold (α and β). Table 5 shows the best-identified thresholds on various data sources of the SAnD dataset. Figure 4 shows the mean and standard deviation of the accuracy on various dual MEC threshold combinations for different data sources. Algorithm 1 computeα,β(D) Require: D = {A1: l1, A2: l2, ..., Au: lu} where Ai = {s1, s2, ..., sk} for βj in βcand do hits = 0 for Ap ∈ D do Require: αcand = [αlow, αlow+αstep, ..., αhigh] Require: βcand = [βlow, βlow+βstep, ..., βhigh] Require: Accuracy = {} 1: for αi in αcand do 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: end for 14: α = maxvalue(Accuracy).key()[0] 15: β = maxvalue(Accuracy).key()[1] 16: return α, β Fcm = fcm(sq) ∀ sq ∈ Ap Compute gcm(Ap) using Fcm if gcm(Ap) == lp then hits = hits + 1 end for Accuracy[(αi, βj)] = 100 ∗ (hits/u) end for end if α 25 28 22 26 21 18 28 24 29 29 β 0.35 0.30 0.35 0.15 0.45 0.40 0.40 0.35 0.475 0.45 Accuracy(%) 100 89 64 68 89 72 79 72 78 75 AAP INC MKB PIB PMS DB DJ Dspeech Dnews Dspeech + Dnews Table 5: Best identified thresholds (α and β) along with the accuracy of identifying MCT on various data sources in the SAnD dataset. Figure 4: The mean and standard deviation of the accu- racy on various dual MEC threshold combinations. The red dot corresponding to each data source indicates the accuracy against the best-identified thresholds. 4.6 Dual MEC threshold generalization As evident from Table 5, the thresholds α and β vary across the data sources. So, it is important to identify which of these identified thresholds will result in a robust and stable performance across datasets. Here, we experiment with five dual MEC threshold generalisation techniques: 1. Local Average (LA): For the data source Di, we take the mean sentence-level CMI score and mean MR score as the dual MEC thresholds. 2. Global Average (GA): For the data source Di, we take the mean sentence-level CMI score and mean MR score of the corresponding cate- gory data-source (Dspeech or Dnews) as the dual MEC thresholds. 3. Average of LA and GA (ALG): For the data source Di, we take the average of LA and GA identified thresholds as the dual MEC thresh- olds. 4. Single data source generalization (SDG): In this approach, we generalize the dual MEC thresholds identified locally on a single data source Di (using Algorithm 1) to identify MCT globally on other data sources. 5. Multi data source generalization (MDG): In this approach, we use the dual MEC threshold information from multiple sources and use the majority voting to identify the best thresholds. For the data source Di, we use the thresholds identified on three data sources (using Algo- rithm 1), namely Di, Dspeech (if Di ∈ Dspeech, else Dnews), and Dspeech + Dnews. We then make an independent prediction on each of the three thresholds and take majority voting for the final classification of Mp. 5 MUTANT: A Multi-sentential Code-mixed Hinglish Dataset We evaluate the performance of MCT identifi- cation pipeline and the five dual MEC thresh- old generalization techniques using the three sub- sets of the SAnD dataset: Dspeech, Dnews, and Dspeech + Dnews. We report the following metric scores on each of the seven data sources: 1. Accuracy: We compute accuracy as the ratio of the total correct prediction of MCT and non- MCT to the total number of MST. We multiply this ratio by 100 and report the accuracy per- centage. A high accuracy % is preferred. 2. False MCT Rate (FMR): We define FMR as the ratio of incorrectly identified MCT to the total number of actual monolingual MST. We report the FMR% and a low FMR% is preferred. 3. Diversity@10 (D@10): We define D@10 as the percentage of articles in data source Di having more than 10% correctly identified MCT. A high D@10 score is preferred. We report the results in Tables 6, 7, 8. The mean- based threshold generalization techniques (LA, GA, and ALG) consistently show poor performance on all the metrics. Given the nature of the problem, we prefer a low rate of misidentification of mono- Accuracy FMR D@10 L G A 64 66 62 AAP 64 66 63 INC 62 66 MKB 61 64 66 62 PIB 64 66 67 PMS 62 63 66 DB 64 63 62 DJ S M L G A 20 15 72 20 17 73 26 28 69 24 24 67 23 17 71 28 29 67 26 26 75 74 74 72 72 74 78 78 21 21 21 21 21 26 26 S M L G A 51 49 17 51 49 16 48 51 22 55 53 30 53 51 20 57 57 30 49 48 6 46 46 46 46 46 56 56 17 12 18 17 16 5 5 S M 62 60 59 59 70 68 74 73 69 67 78 78 74 73 Table 6: Results on Dspeech dataset. L: LA, G: GA, A: ALG, S: SDG, M: MDG. Accuracy FMR D@10 L G A 71 70 72 AAP 71 70 INC 69 68 70 MKB 66 68 70 68 PIB 69 70 61 PMS 67 69 66 DB 68 69 68 DJ S M L G A 17 17 72 15 14 73 21 25 70 22 23 70 18 14 74 26 28 68 22 22 72 73 73 72 73 73 71 71 15 15 15 15 15 22 22 S M L G A 62 60 14 58 58 9 71 73 21 71 73 29 63 63 14 74 76 29 68 70 4 14 7 15 14 12 3 3 58 58 58 58 58 72 72 S M 72 70 66 65 80 79 80 79 69 71 85 84 73 77 Table 7: Results on Dnews dataset. L: LA, G: GA, A: ALG, S: SDG, M: MDG. Accuracy FMR D@10 L G A 69 70 69 AAP 69 70 INC 70 69 70 MKB 67 69 70 69 PIB 70 70 62 PMS 67 68 67 DB 69 68 68 DJ S M L G A 15 12 73 14 11 73 19 21 70 18 18 67 17 13 72 22 23 67 19 19 74 74 74 72 73 74 75 75 15 15 15 15 15 19 19 S M L G A 57 55 13 56 57 10 65 62 17 64 63 23 59 57 16 62 64 24 62 57 5 60 60 60 60 60 62 62 13 8 14 14 12 4 4 S M 66 65 63 62 65 68 74 75 69 65 75 76 74 71 Table 8: Results on Dspeech+Dnews dataset. L: LA, G: GA, A: ALG, S: SDG, M: MDG. lingual MST as the MCT and at the same time a high number of actual MCT should also be iden- tified. MDG threshold generalization technique satisfies both conditions with low FMR and high accuracy on all the datasets. D@10 depicts if the threshold generalization technique is influenced by the presence of a few outliers in the dataset. SDG and MDG both show competitive results on the D@10 metric outperforming the mean-based threshold generalization techniques by a large mar- gin. The constant poor performance of mean-based threshold generalization against SDG and MDG also shows the efficacy of the proposed threshold computation strategy (Algorithm 1). Finally, to build the MUTANT dataset, we use the MCT identification pipeline with the MDG threshold generalization technique. Table 9 shows the statistics of the MUTANT dataset. To facili- tate future work on this novel task of MCT iden- tification, we will release the MUTANT dataset along with the initially scraped data from all the data sources and the annotated SAnD dataset. The MUTANT dataset can be used for various tasks including but not limited to question-answering, text summarization and machine translation for Hinglish texts. This dataset could be used as a pre-training dataset to train efficient NLU models for various tasks on Hinglish data. 6 Analysis and Discussion In this section, we qualitatively evaluate the MU- TANT dataset by employing two human evalua- tors, different from the one used for the SAnD to avoid any biases in the evaluation. Both evalua- AAP INC MKB PIB PMS DB DJ Dspeech Dnews Dspeech + Dnews A M 30 85 58 8473 597 12851 44913 9243 57764 67007 32 306 243 8786 3909 15433 56228 13276 71661 84937 M/A 1.07 3.6 4.19 1.04 6.55 1.20 1.25 1.44 1.24 1.27 Avg CMI M 35.2 27.5 22.4 23.2 24.7 21.2 22.3 23.8 22.0 22.3 A 33.0 28.1 20.1 23.0 25.8 21.0 22.2 23.2 21.9 22.0 H 21.1 - - 21.0 26.4 20.2 21.6 21.3 21.2 21.2 Avg Words A 1347 751 1034 572 952 107 146 604 137 201 M 1263 208 246 552 145 89 117 420 111 159 H 16 - - 15 13 24 16 15 18 17 Avg Characters M A 6556 6993 935 3368 1156 4843 3028 3139 700 4585 440 528 586 734 2268 3258 555 688 822 1043 H 63 - - 87 79 123 82 87 91 90 Table 9: MUTANT dataset statistics. A: Articles, M: MCT, and H: Headings. The INC and MKB datasets contain generic and very-low informative headlines and we do not include them in the final dataset. A MST CA Hing E/H CKS Acc FMR D@10 AAP INC MKB PIB PMS DB DJ Dspeech Dnews Dspeech + Dnews 5 5 5 5 5 5 5 25 10 35 5 82 119 5 141 49 18 352 67 419 2 10 23 2 13 3 2 50 5 55 3 67 80 3 110 43 15 263 58 1.0 0.76 0.67 1.0 0.52 0.63 0.77 0.65 0.69 100 88 75 80 84 78 88 82 80 321 0.65 82 0 10 25 0 12 20 13 14 18 15 100 80 80 50 100 50 100 71 75 74 Table 10: Qualitative evaluation of the MUTANT dataset. A: Articles, CA: complete agreement be- tween the annotators, Hing: Hinglish MST. E/H: En- glish/Hindi MST, CKS: Cohen's kappa score. tors are proficient in English, Hindi, and Hinglish languages. We randomly sample five articles from each of the seven source datasets and share the orig- inally scraped articles containing both identified MCT and monolingual MST with both evaluators. During the evaluation, we do not disclose which of the MSTs is identified as MCT and share the following guidelines: 1. Any MST containing only Hindi words or only English words is monolingual. 2. Any named entity, date, number, or word com- mon in both English and Hindi languages should be considered a language-independent word. In Table 10, we report our findings from the qual- itative evaluation study. Out of a total of 419 MST, we observe the complete agreement on 321 mono- lingual MST and 55 code-mixed MST resulting in ≈ 90% complete agreement. A complete agree- ment means that both annotators agree that any par- ticular MST is code-mixed or not. On MST with CA, we further compute the three metric scores using MDG. The results strengthen our earlier find- ings from Section 5. In Figure 5, we report two example MCT incorrectly identified by our MCT Figure 5: False positive MCT. We color code the tokens as: Hindi, English, and language independent. identification pipeline. In the first example, both evaluators show complete agreement whereas in the second example there is a disagreement be- tween the evaluators. We attribute this behavior to the poor state of the current code-mixed LID systems (Srivastava and Singh, 2021a) and since the CMI metric and our dual MEC formulation depend heavily on the code-mixed LID tools, the final results get affected. This limitation further provides an opportunity for future works to explore the problem from different perspectives such as a token-level language-independent MCT identifi- cation pipeline. It will also be interesting to see how this pipeline performs with other code-mixed languages, especially in a low-resource setting. 7 Conclusion In this paper, we present a novel task of identifying MCT from multilingual documents. We propose an MCT identification pipeline by extending CMI to the multi-sentential framework and leveraging the pipeline we build a dataset for the Hinglish language. We highlight several challenges in build- ing such resources and our insights will be useful to future works in code-mixed and low-resource languages. 8 Limitations The limitations with the MUTANT dataset include but are not limited to: • Contrary to the previous works, all the data sources comprises the non social media sites. This could potentially limit the diversity in the code-mixed text as observed on social media plat- forms. • In the current form, the dataset is limited to only one code-mixed language. We believe the pro- posed technique to extract MCT could be ex- panded to other code-mixed languages in the fu- ture. • The data sources could potentially have their own biases (topical, style of writing, etc). We expect future works to be cautious while generalizing the results obtained on this dataset. References Joshua Ainslie, Santiago Ontanon, Chris Alberti, Va- clav Cvicek, Zachary Fisher, Philip Pham, Anirudh Ravula, Sumit Sanghai, Qifan Wang, and Li Yang. 2020. Etc: Encoding long and structured inputs In Proceedings of the 2020 Con- in transformers. ference on Empirical Methods in Natural Language Processing (EMNLP), pages 268–284. Guangsheng Bao, Yue Zhang, Zhiyang Teng, Boxing Chen, and Weihua Luo. 2021. G-transformer for In Proceed- document-level machine translation. ings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th Interna- tional Joint Conference on Natural Language Pro- cessing (Volume 1: Long Papers), pages 3442–3455. Ruthanna Barnett, Eva Codó, Eva Eppler, Montse Forcadell, Penelope Gardner-Chloros, Roeland Van Hout, Melissa Moyer, Maria Carme Torras, Maria Teresa Turell, Mark Sebba, et al. 2000. The lides coding manual: A document for preparing and analyzing language interaction data version 1.1– International Journal of Bilingualism, july 1999. 4(2):131–271. Isabel Cachola, Kyle Lo, Arman Cohan, and Daniel S Weld. 2020. Tldr: Extreme summarization of sci- In Findings of the Association entific documents. for Computational Linguistics: EMNLP 2020, pages 4766–4777. Amitava Das and Björn Gambäck. 2014. Identifying languages at the word level in code-mixed indian so- cial media text. In Proceedings of the 11th Interna- tional Conference on Natural Language Processing, pages 378–387. Bogdan Gliwa, Iwona Mochol, Maciej Biesek, and Aleksander Wawer. 2019. Samsum corpus: A human-annotated dialogue dataset for abstractive summarization. In Proceedings of the 2nd Workshop on New Frontiers in Summarization, pages 70–79. Gualberto Guzmán, Joseph Ricard, Jacqueline Serigos, Barbara E Bullock, and Almeida Jacqueline Toribio. 2017. Metrics for modeling code-switching across corpora. Proc. Interspeech 2017, pages 67–71. Mandar Joshi, Eunsol Choi, Daniel S Weld, and Luke Zettlemoyer. 2017. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehen- sion. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Vol- ume 1: Long Papers), pages 1601–1611. Simran Khanuja, Sandipan Dandapat, Sunayana Sitaram, and Monojit Choudhury. 2020. A new dataset for natural language inference from code- mixed conversations. In Proceedings of the The 4th Workshop on Computational Approaches to Code Switching, pages 9–16. Anoop Kunchukuttan, Pratik Mehta, and Pushpak Bhat- tacharyya. 2018. The iit bombay english-hindi par- allel corpus. In Proceedings of the Eleventh Interna- tional Conference on Language Resources and Eval- uation (LREC 2018). Laiba Mehnaz, Debanjan Mahata, Rakesh Gosangi, Uma Sushmitha Gunturi, Riya Jain, Gauri Gupta, Amardeep Kumar, Isabelle G Lee, Anish Acharya, and Rajiv Shah. 2021. Gupshup: Summarizing open-domain code-switched conversations. In Pro- ceedings of the 2021 Conference on Empirical Meth- ods in Natural Language Processing, pages 6177– 6192. Ravindra Nayak and Raviraj Joshi. 2022. L3cube- hingcorpus and hingbert: A code mixed hindi- english dataset and bert language models. arXiv preprint arXiv:2204.08398. Eva Sharma, Chen Li, and Lu Wang. 2019. Bigpatent: A large-scale dataset for abstractive and coherent summarization. In Proceedings of the 57th Annual Meeting of the Association for Computational Lin- guistics, pages 2204–2213. Vivek Srivastava and Mayank Singh. 2020. Phinc: A parallel hinglish social media code-mixed corpus for In Proceedings of the Sixth machine translation. Workshop on Noisy User-generated Text (W-NUT 2020), pages 41–49. Vivek Srivastava and Mayank Singh. 2021a. Chal- lenges and limitations with the metrics measuring the complexity of code-mixed text. In Proceedings of the Fifth Workshop on Computational Approaches to Linguistic Code-Switching, pages 6–14. Vivek Srivastava and Mayank Singh. 2021b. Hinge: A dataset for generation and evaluation of code-mixed hinglish text. In Proceedings of the 2nd Workshop on Evaluation and Comparison of NLP Systems, pages 200–208. Makarand Tapaswi, Yukun Zhu, Rainer Stiefelhagen, Antonio Torralba, Raquel Urtasun, and Sanja Fidler. 2016. Movieqa: Understanding stories in movies through question-answering. In 2016 IEEE Confer- ence on Computer Vision and Pattern Recognition (CVPR), pages 4631–4640. IEEE.
http://arxiv.org/abs/2302.12255v1
2023-02-23T03:26:48
2023-02-23T03:26:48
Modeling Molecular Structures with Intrinsic Diffusion Models
Since its foundations, more than one hundred years ago, the field of structural biology has strived to understand and analyze the properties of molecules and their interactions by studying the structure that they take in 3D space. However, a fundamental challenge with this approach has been the dynamic nature of these particles, which forces us to model not a single but a whole distribution of structures for every molecular system. This thesis proposes Intrinsic Diffusion Modeling, a novel approach to this problem based on combining diffusion generative models with scientific knowledge about the flexibility of biological complexes. The knowledge of these degrees of freedom is translated into the definition of a manifold over which the diffusion process is defined. This manifold significantly reduces the dimensionality and increases the smoothness of the generation space allowing for significantly faster and more accurate generative processes. We demonstrate the effectiveness of this approach on two fundamental tasks at the basis of computational chemistry and biology: molecular conformer generation and molecular docking. In both tasks, we construct the first deep learning method to outperform traditional computational approaches achieving an unprecedented level of accuracy for scalable programs.
[ "Gabriele Corso" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12255v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12255v1", "@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" ]
3 2 0 2 b e F 3 2 ] M B . o i b - q [ 1 v 5 5 2 2 1 . 2 0 3 2 : v i X r a Modeling Molecular Structures with Intrinsic Diffusion Models by Gabriele Corso B.A., University of Cambridge (2021) Submitted to the Department of Electrical Engineering and Computer Science in partial fulfillment of the requirements for the degree of Masters of Science at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY February 2023 © Gabriele Corso, MMXXIII. All rights reserved. The author hereby grants to MIT permission to reproduce and to distribute publicly paper and electronic copies of this thesis document in whole or in part in any medium now known or hereafter created. Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Department of Electrical Engineering and Computer Science January 25, 2023 Certified by . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tommi S. Jaakkola Professor of Electrical Engineering and Computer Science Thesis Supervisor Certified by . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Regina Barzilay Distinguished Professor for AI and Health Thesis Supervisor Accepted by . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Leslie A. Kolodziejski Professor of Electrical Engineering and Computer Science Chair, Department Committee on Graduate Students Modeling Molecular Structures with Intrinsic Diffusion Models by Gabriele Corso Submitted to the Department of Electrical Engineering and Computer Science on January 25, 2023, in partial fulfillment of the requirements for the degree of Masters of Science Abstract Since its foundations, more than one hundred years ago, the field of structural biology has strived to understand and analyze the properties of molecules and their interactions by studying the structure that they take in 3D space. However, a fundamental challenge with this approach has been the dynamic nature of these particles, which forces us to model not a single but a whole distribution of structures for every molecular system. This thesis proposes Intrinsic Diffusion Modeling, a novel approach to this problem based on combining diffusion generative models with scientific knowledge about the flexibility of biological complexes. The knowledge of these degrees of freedom is translated into the definition of a manifold over which the diffusion process is defined. This manifold significantly reduces the dimensionality and increases the smoothness of the generation space allowing for significantly faster and more accurate generative processes. We demonstrate the effectiveness of this approach on two fundamental tasks at the basis of computational chemistry and biology: molecular conformer generation and molecular docking. In both tasks, we construct the first deep learning method to outperform traditional computational approaches achieving an unprecedented level of accuracy for scalable programs. Thesis Supervisor: Tommi S. Jaakkola Title: Professor of Electrical Engineering and Computer Science Thesis Supervisor: Regina Barzilay Title: Distinguished Professor for AI and Health 2 Acknowledgments First, I would like to thank my advisors Tommi Jaakkola and Regina Barzilay without whom this work would have never been possible. They took a chance on me as an undergrad they never met and gave me full freedom from day one to explore my curiosity. I am sure that for the rest of my Ph.D. and life journey, I will continue to be inspired by Regina's strength and enthusiasm and learn from Tommi's incredible technical and creative insight to become the researcher and mentor I aspire to be. I am also very thankful to all my collaborators and labmates for the incredible help and support they have given me. In particular, to Octavian-Eugen Ganea (1987-2022), dear colleague, mentor, and friend without whom this work would have never been possible; and to Bowen Jing and Hannes Stärk with whom I have shared over the past year the research journey that has led to the work presented in this thesis and was made of countless whiteboard discussions, failed experiments, and draft rewrites. I would also like to thank Professor Pietro Liò and all the mentors without whose kindness and support I would never be where I am and Renato Berlinghieri, Theo Olausson, Sara Pidò, and all the friends with whom I share this period of my journey through life. Finally, this thesis is dedicated to my family, in particular, my parents, Luisella and Mariano, and my fiancée Maëlle-Marie. I am deeply grateful for their unwavering love and sacrifices that have always allowed me to follow my passions and dreams. 3 Contents 1 Introduction 1.1 Overview of Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Intrinsic Diffusion Models 2.1 Deep Generative Models . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Diffusion Generative Models . . . . . . . . . . . . . . . . . . . . . . . 2.3 Subspace Diffusion Generative Models . . . . . . . . . . . . . . . . . 2.4 Intrinsic Diffusion Models . . . . . . . . . . . . . . . . . . . . . . . . 2.4.1 Flexibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.2 Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.3 Diffusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.4 Score model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Torsional Diffusion 3.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Flexibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.3 Diffusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.4 Score model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.5 Training and inference procedures . . . . . . . . . . . . . . . . 3.3 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 Experimental setup . . . . . . . . . . . . . . . . . . . . . . . . 4 8 10 12 12 13 14 17 18 18 19 19 21 22 23 24 25 26 27 31 32 32 3.3.2 Ensemble RMSD . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.3 Ensemble properties . . . . . . . . . . . . . . . . . . . . . . . 3.4 Torsional Boltzmann Generators . . . . . . . . . . . . . . . . . . . . . 3.4.1 Likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.2 Energy-based training . . . . . . . . . . . . . . . . . . . . . . 3.4.3 Torsional Boltzmann generator . . . . . . . . . . . . . . . . . 4 DiffDock 4.1 Background and Related Work . . . . . . . . . . . . . . . . . . . . . . 4.2 Docking as Generative Modeling . . . . . . . . . . . . . . . . . . . . . 4.3 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.1 Flexibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.2 Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.3 Diffusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.4 Score model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.5 Confidence model . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.1 Experimental setup. . . . . . . . . . . . . . . . . . . . . . . . 4.4.2 Apo-structure docking . . . . . . . . . . . . . . . . . . . . . . 4.4.3 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Conclusion 5.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Future directions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A Proofs A.1 Chapter 3: Torsional Diffusion . . . . . . . . . . . . . . . . . . . . . . A.1.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.1.2 Torsion update . . . . . . . . . . . . . . . . . . . . . . . . . . A.1.3 Parity equivariance . . . . . . . . . . . . . . . . . . . . . . . . A.1.4 Likelihood conversion . . . . . . . . . . . . . . . . . . . . . . . 33 36 36 37 38 39 42 44 45 48 48 49 51 52 54 54 54 55 56 61 61 62 66 66 66 68 69 70 5 A.2 Chapter 4: DiffDock . . . . . . . . . . . . . . . . . . . . . . . . . . . A.2.1 Zero momentum . . . . . . . . . . . . . . . . . . . . . . . . . A.2.2 Map is bijection . . . . . . . . . . . . . . . . . . . . . . . . . . B Methodological Details B.1 Chapter 3: Torsional Diffusion . . . . . . . . . . . . . . . . . . . . . . B.1.1 Score network architecture . . . . . . . . . . . . . . . . . . . . B.1.2 Conformer matching . . . . . . . . . . . . . . . . . . . . . . . B.2 Chapter 4: DiffDock . . . . . . . . . . . . . . . . . . . . . . . . . . . B.2.1 Training and Inference . . . . . . . . . . . . . . . . . . . . . . B.2.2 Architecture Details . . . . . . . . . . . . . . . . . . . . . . . C Further Discussion C.1 Chapter 3: Torsional Diffusion . . . . . . . . . . . . . . . . . . . . . . C.1.1 RDKit local structures . . . . . . . . . . . . . . . . . . . . . . C.1.2 Limitations of torsional diffusion . . . . . . . . . . . . . . . . D Experimental Details D.1 Chapter 3: Torsional Diffusion . . . . . . . . . . . . . . . . . . . . . . D.1.1 Dataset details . . . . . . . . . . . . . . . . . . . . . . . . . . D.1.2 Training and tuning details . . . . . . . . . . . . . . . . . . . D.1.3 Evaluation details . . . . . . . . . . . . . . . . . . . . . . . . . D.2 Chapter 4: DiffDock . . . . . . . . . . . . . . . . . . . . . . . . . . . D.2.1 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . . D.2.2 Implementation details . . . . . . . . . . . . . . . . . . . . . . 72 72 74 76 76 76 79 80 80 84 90 90 90 92 94 94 94 95 96 97 97 98 D.2.3 Baselines details . . . . . . . . . . . . . . . . . . . . . . . . . . 101 E Further Results 105 E.1 Chapter 3: Torsional Diffusion . . . . . . . . . . . . . . . . . . . . . . 105 E.1.1 Small molecules ensemble RMSD . . . . . . . . . . . . . . . . 105 E.1.2 Ablation experiments . . . . . . . . . . . . . . . . . . . . . . . 105 E.1.3 Ensemble properties . . . . . . . . . . . . . . . . . . . . . . . 107 6 E.2 Chapter 4: DiffDock . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 E.2.1 Physically plausible predictions . . . . . . . . . . . . . . . . . 108 E.2.2 Further Results and Metrics . . . . . . . . . . . . . . . . . . . 109 E.2.3 Ablation studies . . . . . . . . . . . . . . . . . . . . . . . . . . 111 E.2.4 Affinity prediction . . . . . . . . . . . . . . . . . . . . . . . . 114 E.2.5 Visualizations . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 7 Chapter 1 Introduction Many of the functions that small molecules and proteins have depend on the 3D structures their atoms take in space. Over the past century, since the development of X-ray crystallography by Max Von Laue in 1912, the field of structural biology has flourished and has been the base of many scientific discoveries and biological models such as the double helical structure of DNA [102]. Since the initial development of computers, researchers have been trying to use algorithms to directly model the structure formed by different molecular complexes without the need for crystallography or other expensive experimental methods. One of the fundamental tasks in structural biology, referred to as molecular dock- ing, consists of predicting the position, orientation, and conformation of a ligand when bound to a target protein. The development of accurate docking computational methods in this effort would have a huge impact on drug discovery where researchers look for molecules that are able to bind and inhibit certain protein functions. Tradi- tional approaches for docking [96, 31, 49] rely on scoring functions that estimate the correctness of a proposed structure and an optimization algorithm that searches for the global maximum of the scoring function. However, since the search space is vast and the landscape of the scoring functions rugged, these methods tend to be too slow and inaccurate. Recently, the deep learning method AlphaFold2 [45] revolutionized the field of structural biology by being able to accurately (median RMSD below 1Å) predict the 8 folded structure of proteins. AlphaFold2 outperformed by a very large margin existing methods, often based on expensive searches, in the CASP14 competition [71], and, since then, has had a significant impact on a large number of downstream applications. Researchers have tried to apply similar ideas and methods [93, 62] to molecular docking without, however, achieving any substantial improvement in accuracy over established search-based methods. In this thesis, we identify the underlying issue with these existing deep learning methods for molecular docking to be their regression-based training paradigm. This approach fails to capture the flexibility present in molecular structures and to account for model uncertainty. To deal with these two factors, the aleatoric and epistemic uncertainty, that characterize most computational structural biology open challenges, we propose to frame structure prediction as a generative problem. In recent years, the intersection of generative modeling and deep learning has seen tremendous success with large models now able to generate very realistic text [10] and images [92]. Deep generative models could hold the key to a solution to the problem of modeling molecular flexibility, however, the direct application of the methods developed for images and natural language fails due to the issues of very high dimensionality and data scarcity. It is, therefore, crucial to use scientific insights to build the right degrees of freedom into the generative processes and the right symmetries and inductive biases into the models. This thesis presents Intrinsic Diffusion Modeling (IDM), a generative modeling scheme that builds on the diffusion modeling framework. IDM is based on (1) identifying the extrinsic manifold describing the main degrees of freedom of the structure under analysis, (2) defining the diffusion process on a tractable intrinsic space that can be mapped to the extrinsic manifold, and (3) constructing an equivariant extrinsic-to-intrinsic model mapping points from the extrinsic manifold to scores defined in the tangent space of the intrinsic space. We first apply IDM to molecular conformer generation, the task of determining the set of conformations that a molecule can take in 3D space. In this setting, we develop torsional diffusion, a generative model that, intuitively, learns to model the whole 9 distribution of torsion angles of small molecules and can generate conformations by iteratively refining its position over this torsional manifold. On a standard benchmark of drug-like molecules, torsional diffusion generates superior conformer ensembles compared to machine learning and cheminformatics methods in terms of both RMSD and chemical properties, and is orders of magnitude faster than previous diffusion-based models. We then move to the more complex and data-scarce problem of molecular docking, where we identify the main degrees of freedom of a pose as the position of the ligand relative to the protein, its orientation in the pocket, and the torsion angles describing its conformation. We map the resulting pose manifold to the product space of the degrees of freedom (translational, rotational, and torsional) involved in docking and develop an efficient diffusion process on this space. Empirically, DiffDock obtains a 38% top-1 success rate (RMSD<2A) on PDBBind, significantly outperforming the previous state-of-the-art of traditional docking (23%) and deep learning (20%) methods. Moreover, DiffDock has fast inference times and provides confidence estimates with high selective accuracy. 1.1 Overview of Thesis In Chapter 2, we first provide a general introduction to diffusion generative models, this exposition is mainly based on the formalisation provided by Song et al. [92]. Then, we present subspace diffusion generative models where, in the setting of image generation, we show that restricting the diffusion via projections onto subspaces can provide improved runtime and image quality. This section summarises the manuscript: Subspace Diffusion Generative Models. Bowen Jing*, Gabriele Corso*, Renato Berlinghieri, and Tommi Jaakkola. 17th European Confer- ence on Computer Vision (ECCV 2022). [41] At the end of Chapter 2, we outline the main ideas and components behind the IDM framework at an abstract level. 10 In Chapter 3, we present torsional diffusion, the instantiation of our framework for molecular conformer generation. This chapter is based on the manuscript: Torsional Diffusion for Molecular Conformer Generation. Bowen Jing*, Gabriele Corso*, Jeffrey Chang, Regina Barzilay, and Tommi Jaakkola. Advances in Neural Information Processing Systems 36 (NeurIPS 2022). [42] Chapter 4 details how we applied and extended the framework for molecular docking to produce DiffDock. This chapter is based on the manuscript: DiffDock: Diffusion Steps, Twists, and Turns for Molecular Dock- ing. Gabriele Corso*, Hannes Stärk*, Bowen Jing*, Regina Barzilay, and Tommi Jaakkola. 11th International Conference on Learning Representa- tions (ICLR 2023). [17] Finally, in Chapter 5, we conclude by summarising the thesis and discussing the avenues for future research that this work opens. 11 Chapter 2 Intrinsic Diffusion Models 2.1 Deep Generative Models Over the past decade, deep learning methods [28] have achieved impressive results in the supervised learning tasks of classification and regression. In image classification, neural networks have been very successful [53] in learning to predict p(y|x) the probability of image x being of some label y by minimizing some loss such as a multi-class cross-entropy. This approach of predicting probability values for every class is, however, not feasible in continuous spaces, where regression methods aim to learn an estimator ˆy(x) that minimizes some loss function, often the mean squared error Ep(*|x)[(ˆy(x) − y)2]. AlphaFold2 [45] is one successful example of this approach learning the protein structure y given its sequence x. However, most problems on real-world continuous domains are not deterministic, therefore an accurate solution to them requires modeling the whole (conditional) probability distribution p(*|x). This is the goal of the field of generative modeling. Although one would often ideally want to obtain an analytical and tractable form of p(*|x), this is unfeasible for most complex real-world distributions, therefore, the goal of generative models is typically that of learning how to sample y ∼ p(*|x) and, often, evaluate the likelihood of a given point p(y|x). The intersection of the fields of deep learning and generative modeling has been a particularly flourishing one over the past decade. Developments in deep neural 12 networks have provided very powerful function approximators, however, the question of how to use them to learn probability distributions is non-trivial and requires significant ingenuity. To answer this question a wide range of techniques have been proposed including autoregressive models, variational autoencoders [47], continuous normalizing flows [23], generative adversarial networks [29] and diffusion models [88, 92]. 2.2 Diffusion Generative Models Inspired by statistical physics, diffusion generative models1 are a class of generative models based on the idea that, adding noise to the data distribution, one defines a gradual mapping between the data distribution and an approximate prior distribution that can be easily sampled [88]. A neural network is then trained to reverse small steps of this noise addition process allowing to sample from the data distribution starting from a sample of the prior. In this thesis, we will mainly follow the stochastic differential equation (SDE) formalization of diffusion models introduced by Song et al. [92]. In this formalization, the data distribution is considered to be the starting distribution p0(x) of a forward diffusion process described, in Euclidean space, by the Ito SDE: dx = f (x, t)dt + g(t)dw, t ∈ (0, T ) (2.1) where w is the Wiener process and f (x, t) and g(t) are chosen functions referred to as drift and diffusion coefficients. As t grows, the distribution approaches a Gaussian, therefore, for large enough T , we can approximate a sample from the prior pT (x) by sampling from a Gaussian distribution. A theorem from Anderson [2] guarantees that the reverse of a diffusion process is also a well-defined diffusion process given by the following reverse-time SDE: dx = [f (x, t) − g(t)2∇x log pt(x)]dt + g(t)dw (2.2) 1Also known as score-based generative models, denoising diffusion models or just diffusion models. 13 Therefore, if we know ∇x log pt(x) for all t ∈ (0, T ) we can sample from p0(x) by sampling from pT (x) and running the reverse-time SDE. Moreover, Song et al. [92] also showed that the score ∇x log pt(x) can be used to define the probability flow ODE, a deterministic process whose trajectories have the same marginal probability densities as the SDE: dx = [f (x, t) − 1 2 g(t)2∇x log pt(x)]dt (2.3) To obtain estimates of ∇x log pt(x) we train a score model sθ(x, t) via denoising score matching [91]: θ* = arg min Et θ {︁ λ(t)Ex(0)Ex(t)|x(0) ⃦sθ(x(t), t) − ∇x(t) log p0t(x(t) | x(0))⃦ [︀ ⃦ 2 ⃦ 2 ]︀}︁ (2.4) Finally, De Bortoli et al. [21] showed that the framework presented above holds with few modifications on (non-Euclidean) compact Riemannian manifolds, as long as one is able to sample the heat kernel, compute its score and sample from the stationary distribution of these manifolds. Critically, the score is defined in the tangent space of the manifolds. 2.3 Subspace Diffusion Generative Models In the dominant formulation of diffusion generative models, the forward diffusion occurs in the full ambient space of the data distribution, destroying its structure but retaining its high dimensionality. It does not seem parsimonious to represent increasingly noisy latent variables-which approach zero mutual information with the original data-in a space with such high dimensionality. The practical implications of this high latent dimensionality are twofold: High-dimensional extrapolation. The network must learn the score function over the entire support of the high-dimensional latent variable, even in areas very far (relative to the scale of the data) from the data manifold. Due to the curse of dimensionality, much of this support may never be visited during training, and the accuracy of the 14 score model in these regions is called into question by the uncertain extrapolation abilities of neural networks [105]. Learning to match a lower-dimensional score function may lead to refined training coverage and further improved performance. Computational cost. Hundreds or even thousands of evaluations of the high- dimensional score model are required to generate an image, making inference with score-based models much slower than with GANs or VAEs [36, 92]. A number of recent works aim to address this challenge by reducing the number of steps required for inference [90, 83, 44, 74, 22, 51, 101, 84, 55, 5]. However, these methods generally trade-off inference runtime with sample quality. Moreover, the dimensionality of the score function-and thereby the computational cost of a single score evaluation-is an independent and equally important factor to the overall runtime, but this factor has received less attention in existing works. Subspace diffusion models aim to address these challenges. In some real-world domains such as images, target data lie near a linear subspace, such that under isotropic forward diffusion, the components of the data orthogonal to the subspace become Gaussian significantly before the components in the subspace. We propose to use a full-dimensional network to model the score only at lower noise levels, when all components are sufficiently non-Gaussian. At higher noise levels, we use smaller networks to model in the subspace only those components of the score which remain non-Gaussian. As this reduces both the number and domain of queries to the full- dimensional network, subspace diffusion addresses both of our motivating concerns. Moreover, in contrast to many prior works, subspace diffusion remains fully compatible with the underlying continuous diffusion framework [92], and therefore preserves all the capabilities available to continuous score-based models, such as likelihood evaluation, probability flow sampling, and controllable generation. While subspace diffusion can be applied to arbitrary settings, we focus on generative modeling of natural images. Because the global structure of images is dominated by low-frequency visual components-i.e., adjacent pixels values are highly correlated- images lie close to subspaces corresponding to lower-resolution versions of the same image. 15 Figure 2-1: Visual schematic of subspace diffusion with one projection step. Top left: The starting data distribution x0(0) lies near a subspace (light blue line). As 1 (t) approaches a the data evolves, the distribution of the orthogonal component x⊥ Gaussian faster than the subspace component x1(t). At time t1 we project onto the subspace and restrict the remaining diffusion to the subspace. To generate data, we use the full and subspace score models to reverse the full and subspace diffusion steps, and sample x⊥ 1 (t1) from a Gaussian to reverse the projection step. Top right: The diffusion of the subspace component x1(t) is unaffected by the projection step and restriction to the subspace; while the orthogonal component is diffused until t1 and discarded afterward. Bottom: CIFAR-10 images corresponding to points along the trajectory, where the subspaces correspond to lower-resolution images and projection is equivalent to downsampling. Experimentally, we train and evaluate lower-dimensional subspace models in conjunction with state-of-the-art pretrained full-dimensional models from [92]. We improve over those models in sample quality and runtime, achieving an FID of 2.17 and a IS of 9.99 on CIFAR-10 generation with more than 30% inference time reduction. These results are a first hint at the value of restricting the diffusion processes in lower dimensional spaces where the main degrees of freedom lie. This is very promising since, according to the manifold hypothesis, in many real-world domains the high-dimensional data points lie near low-dimensional latent spaces. However, limiting ourselves to Euclidean subspaces, as in subspace diffusion, does not allow, for most problems, to notably reduce the dimensionality of the space over which to operate. This thesis proposes an alternative approach to model significantly more 16 x!"x!t = 0fulldiffusionupsampling/downsamplingsubspacediffusionx!"x!ACBDABCDsubspaceprojectionorthogonalprojectiont = t1t = Tfull diffusionsubspacediffusion complex manifolds in an efficient and effective manner. 2.4 Intrinsic Diffusion Models As discussed in the previous section, we hypothesize that restricting the diffusion process to a submanifold, that, approximately, contains all the datapoints of interest can offer significant improvements in terms of both accuracy and inference time. How to define a diffusion process on such a manifold and construct a score model that is able to generalize to different chemical systems is not straightforward. The generalization component is particularly important because in this thesis we will operate in inductive settings, where the distributions that we want to sample during inference might not be seen during training. For example, for conformer generation, we expect our method to run on any molecule, regardless of whether it was part of our training set. In this section, we present the blueprint of Intrinsic Diffusion Modeling (IDM), the approach that we will show to be very effective in the tasks of molecular conformer generation and molecular docking in the rest of the thesis. IDM is composed of four main components: 1. flexibility: identification of the extrinsic manifold, 2. mapping: definition of the intrinsic manifold and its mapping to the extrinsic, 3. diffusion: specification of a diffusion process on the intrinsic manifold, 4. score model : construction of an extrinsic-to-intrinsic score model. Below we present each component in its abstract form, the reader will likely more clearly understand them by further reading the two examples of their concrete instantiations in torsional diffusion and DiffDock. 17 2.4.1 Flexibility Firstly, one needs to identify a low-dimensional manifold that describes most of the entropy in the distribution under analysis, we will call this manifold the extrinsic space. For the domains that we will analyze in this thesis the definition of this manifold comes from domain knowledge, trying to discover these manifolds from data directly is a very interesting avenue for future work. Importantly, to run inference in inductive settings, one needs to have a way to identify the chosen manifold, e.g. by sampling one of its points, for any query at inference time. Moreover, if the data does not lie exactly on the manifold, but only approximately, one also needs to define a way of projecting datapoints to the manifold. Then, to avoid distributional shift at inference time, we preprocess the training data by sampling the manifold and projecting the datapoint onto it. Training is then run with these projected datapoints. 2.4.2 Mapping De Bortoli et al. [21] defines diffusion models for arbitrary submanifolds in terms of projecting a diffusion in ambient space onto the submanifold. However, the corresponding kernel p(xt|x0) is not available in closed form and has to be sampled numerically with geodesic random walks. This makes the training process very slow or imprecise. Instead, we take a different approach defining a bijection between the extrinsic manifold and simpler intrinsic space over which we run the diffusion. As the name suggests, we will use the definition of some intrinsic coordinates to define the intrinsic space. Critically these different coordinates must be disentangled from each other, forming, therefore, a bijection with the extrinsic manifold and guaranteeing an equivalence between distributions on the intrinsic and extrinsic manifolds. 18 2.4.3 Diffusion One then needs to derive the fundamental components of the diffusion process on the chosen intrinsic space. In particular, to train the diffusion model and run inference, we have to be able to sample the heat kernel of the diffusion, compute its score and sample from the stationary distribution. Luckily, for most well-studied spaces that typically compose an intrinsic coordinate space, the Brownian motion, modeled as a Geodesic Random walk, has a known closed- form solution for computing its kernel and score and simple procedures to transform samples from common distributions to sample from its stationary distribution. This allows us to avoid having to simulate geodesic random walks as described in De Bortoli et al. [21] for a general manifold. 2.4.4 Score model Finally, we need to construct a score model sθ(x, t) that for each point x and diffusion time t predicts the score of the diffused data distribution at that point on the intrinsic manifold. Naively, we may construct a model that works exclusively on the intrinsic manifold by taking as input the intrinsic coordinates of the current point and predicting its score. This, however, would not be able to generalize well across systems because: (1) the definition of intrinsic coordinates often requires arbitrary choices such as the order of the coordinates or their origin but the data distribution is not invariant to such choices (e.g. definition of torsion angle around a bond); (2) laws of physical interactions can be more easily described in terms of extrinsic coordinates rather than intrinsic ones (e.g. electrostatic interactions between atoms far in the molecular graph). These limitations are also one reason why previous attempts to learn distributions of structures via intrinsic coordinates have failed to generalize to multiple chemical systems [76]. For this reason, we propose to, instead, operate in an extrinsic-to-intrinsic frame- work, where the score model takes in a point described in extrinsic coordinated (e.g. 19 a 3D molecular graph) and predicts the score in terms of its intrinsic coordinated (e.g. change in torsion angles). By taking as input the object described in its extrinsic coordinates we avoid the model being influenced by arbitrary choices of origin for intrinsic coordinates and can more easily reason about physical interactions. Moreover, although the model predicts the score (which translates into an update) on the intrinsic manifold this is can be directly applied to the point in the extrinsic manifold (e.g. rotate one of the torsion angles) without ever needing to instantiate the intrinsic space. 20 Chapter 3 Torsional Diffusion Many properties of a molecule are determined by the set of low-energy structures, called conformers, that it adopts in 3D space. Conformer generation is therefore a fundamental problem in computational chemistry [33] and an area of increasing atten- tion in machine learning. Traditional approaches to conformer generation consist of metadynamics-based methods, which are accurate but slow [78]; and cheminformatics- based methods, which are fast but less accurate [35, 81]. Thus, there is growing interest in developing deep generative models to combine high accuracy with fast sampling. Diffusion or score-based generative models [36, 92] have been applied to conformer generation under several different formulations. These have so far considered diffusion processes in Euclidean space, in which Gaussian noise is injected independently into every data coordinate-either pairwise distances in a distance matrix [87, 63] or atomic coordinates in 3D [108]. However, these models require a large number of denoising steps and have so far failed to outperform the best cheminformatics methods. We instead propose torsional diffusion, in which the diffusion process over conform- ers acts only on the torsion angles and leaves the other degrees of freedom fixed. This is possible and effective because the flexibility of a molecule, and thus the difficulty of conformer generation, lies largely in torsional degrees of freedom [3]; in particu- lar, bond lengths and angles can already be determined quickly and accurately by standard cheminformatics methods. Leveraging this insight significantly reduces the 21 dimensionality of the sample space; drug-like molecules1 have, on average, n = 44 atoms, corresponding to a 3n-dimensional Euclidean space, but only m = 7.9 torsion angles of rotatable bonds. Empirically, we obtain state-of-the-art results on the GEOM-DRUGS dataset [3] and are the first method to consistently outperform the established commercial software OMEGA [33]. We do so using two orders of magnitude fewer denoising steps than GeoDiff [108], the best Euclidean diffusion approach. Unlike prior work, our model provides exact likelihoods of generated conformers, enabling training with the ground-truth energy function rather than samples alone. This connects with the literature on Boltzmann generators-generative models which aim to sample the Boltzmann distribution of physical systems without expensive molecular dynamics or MCMC simulations [76, 50]. Thus, as a variation on the torsional diffusion framework, we develop torsional Boltzmann generators that can approximately sample the conditional Boltzmann distribution for unseen molecules. This starkly contrasts with existing Boltzmann generators, which are specific for the chemical system on which they are trained. This chapter is mostly based on the paper: Torsional Diffusion for Molecular Conformer Generation. Bowen Jing*, Gabriele Corso*, Jeffrey Chang, Regina Barzilay, and Tommi Jaakkola. Advances in Neural Information Processing Systems 35 (NeurIPS 2022). 3.1 Background Molecular conformer generation. The conformers of a molecule are the set of its energetically favorable 3D structures, corresponding to local minima of the potential energy surface. The gold standards for conformer generation are metadynamics-based methods such as CREST [78], which explore the potential energy surface while filling in local minima [33]. However, these require an average of 90 core-hours per drug- 1As measured from the standard dataset GEOM-DRUGS [3] 22 like molecule [3] and are not considered suitable for high-throughput applications. Cheminformatics methods instead leverage approximations from chemical heuristics, rules, and databases for significantly faster generation [54, 15, 69, 9, 58]; while these can readily model highly constrained degrees of freedom, they fail to capture the full energy landscape. The most well-regarded of such methods include the commercial software OMEGA [35] and the open-source RDKit ETKDG [56, 81]. A number of machine learning methods for conformer generation has been developed [106, 107, 87, 63], the most recent and advanced of which are GeoMol [25] and GeoDiff [108]. GeoDiff is a Euclidean diffusion model that treats conformers as point clouds x ∈ R3n and learns an SE(3) equivariant score. On the other hand, GeoMol employs a graph neural network that, in a single forward pass, predicts neighboring atomic coordinates and torsion angles from a stochastic seed. Boltzmann generators. An important problem in physics and chemistry is that of generating independent samples from a Boltzmann distribution p(x) ∝ e−E(x)/kT with known but unnormalized density.2 Generative models with exact likelihoods, such as normalizing flows, can be trained to match such densities [76] and thus provide independent samples from an approximation of the target distribution. Such Boltzmann generators have shown high fidelity on small organic molecules [50] and utility on systems as large as proteins [76]. However, a separate model has to be trained for every molecule, as the normalizing flows operate on intrinsic coordinates whose definitions are specific to that molecule. This limits the utility of existing Boltzmann generators for molecular screening applications. 3.2 Method Consider a molecule as a graph G = (V, E) with atoms v ∈ V and bonds e ∈ E, and denote the space of its possible conformers CG. A conformer C ∈ CG is typically defined in terms of its extrinsic (or Cartesian) coordinates-that is, as a point cloud 2This is related to but distinct from conformer generation, as conformers are the local minima of the Boltzmann distribution rather than independent samples. 23 Figure 3-1: Overview of torsional diffusion. Left: Extrinsic and intrinsic views of torsional diffusion (only 2 dimensions/bonds shown). Right: In a step of reverse diffusion (A), the current conformer is provided as a 3D structure (B) to the score model, which predicts intrinsic torsional updates (C). The final layer of the score model is constructed to resemble a torque computation around each bond (D). Y refers to the spherical harmonics and Vb the learned atomic embeddings. ∼= R3n/SE(3). However, we can in 3D space, defined up to global roto-translation: CG also described in terms of its intrinsic (or internal) coordinates: local structures L consisting of bond lengths, bond angles, and cycle conformations; and torsion angles τ consisting of dihedral angles around freely rotatable bonds. We consider a bond freely rotatable if severing the bond creates two connected components of G, each of which has at least two atoms. Thus, torsion angles in cycles (or rings), which cannot be rotated independently, are considered part of the local structure L. Our method, illustrated in Figure 3-1, uses the intrinsic diffusion modeling frame- work to define a diffusion process over the space of structures defined by some local structure. Below we detail each of the four components outlined in Section 2.4. 3.2.1 Flexibility Conformer generation consists of learning probability distributions pG(C). However, the set of possible stable local structures L for a particular molecule is very constrained and can be accurately predicted by fast cheminformatics methods, such as RDKit ETKDG [81]. Thus, we use RDKit to provide approximate samples from pG(L), and develop a diffusion model to learn distributions pG(C | L). We have therefore defined 24 the extrinsic space as the submanifold defined by conditioning C on a given local structure L. Since we will use RDKit to obtain samples from the local structure, to identify a point on the manifold at inference time, we will simply embed the given molecule. From this conformer, any point on our extrinsic manifold will be reachable with some change in torsion angles. In focusing on pG(C | L), we have assumed that we can Conformer matching. sample local structures L ∼ pG(L) with RDKit. While this assumption is very good in terms of RMSD, the RDKit marginal ˆpG(L) is only an approximation of the ground truth pG(L). Thus, if we train on the denoising score-matching loss with ground truth conformers-i.e., conditioned on ground truth local structures-there will be a distributional shift at test time, where only approximate local structures from ˆpG(L) are available. We found that this shift significantly hurts performance. We thus introduce a preprocessing procedure called conformer matching. In brief, for the training split only, we substitute each ground truth conformer C with a synthetic conformer ˆC with local structures ˆL ∼ ˆpG(L) and made as similar as possible to C. That is, we use RDKit to generate ˆL and change torsion angles ˆτ to minimize RMSD(C, ˆC). Naively, we could sample ˆL ∼ ˆpG(L) independently for each conformer, but this eliminates any possible dependence between L and τ that could serve as training signal. Instead, we view the distributional shift as a domain adaptation problem that can be solved by optimally aligning pG(L) and ˆpG(L). See Appendix B.1.2 for details. 3.2.2 Mapping The extrinsic submanifold we have identified by conditioning C on a given local structure L is, however, very complex to deal with in Euclidean space. We, therefore, exploit the fact that a conformer can be univocly defined in terms of its internal coordinates L and τ 3. In particular, almost surely4, there is a bijection between the 3This is true because we are only interested in conformers up to SE(3) transformations. 4Unless we have all the atoms on onne side of a rotatable bond lying all exactly on the line defined by the bond. 25 torsion angles τ and the extrinsic manifold C | L. Since each torsion angle coordinate lies in [0, 2π), the m torsion angles of a conformer define a hypertorus Tm. This is the intrinsic manifold over which we train the diffusion model to sample from pG(τ | L). 3.2.3 Diffusion To learn a generative model over the intrinsic manifold Tm, we apply the continuous score-based framework of Song et al. [92], which holds with minor modifications on compact Riemannian manifolds [21]. For the forward diffusion we use rescaled Brownian motion given by f (x, t) = 0, g(t) = √︁ d dt σ2(t) where σ(t) is the noise scale. as in Song et al. [91], Specifically, we use an exponential diffusion σ(t) = σ1−t with σmin = 0.01π, σmax = π, t ∈ (0, 1). Due to the compactness of the manifold, however, the prior pT (x) is no longer a Gaussian, but a uniform distribution over M . Training the score model with denoising score matching requires a procedure to minσt max sample from the perturbation kernel pt|0(x′ | x) of the forward diffusion and compute its score. We view the torus Tm ∼= [0, 2π)m as the quotient space Rm/2πZm with equivalence relations (τ1, . . . τm) ∼ (τ1 + 2π, . . . , τm) . . . ∼ (τ1, . . . τm + 2π). Hence, the perturbation kernel for rescaled Brownian motion on Tm is the wrapped normal distribution on Rm; that is, for any τ , τ ′ ∈ [0, 2π)m, we have pt|0(τ ′ | τ ) ∝ (︂ exp − ||τ − τ ′ + 2πd||2 2σ2(t) )︂ ∑︁ d∈Zm (3.1) where σ(t) is the noise scale of the perturbation kernel pt|0. We thus sample from the perturbation kernel by sampling from the corresponding unwrapped isotropic normal and taking elementwise mod 2π. The scores of the kernel are pre-computed using a numerical approximation. During training, we sample times t at uniform and minimize the denoising score matching loss JDSM(θ) = Et [︁ λ(t)Eτ0∼p0,τt∼pt|0(*|τ0) [︀||s(τt, t) − ∇τt log pt|0(τt | τ0)||2]︀]︁ (3.2) 26 [︀||∇τ log pt|0(τ | 0)||2]︀ are also precom- where the weight factors λ(t) = 1/Eτ ∼pt|0(*|0) puted. As the tangent space Tτ Tm is just Rm, all the operations in the loss computation are the familiar ones. For inference, we first sample from a uniform prior over the torus. We then discretize and solve the reverse diffusion with a geodesic random walk; however, since the exponential map on the torus (viewed as a quotient space) is just expτ (δ) = τ + δ mod 2π, the geodesic random walk is equivalent to the wrapping of the random walk on Rm. Low-temperature sampling. The score-matching loss used to train the score model minimizes an upper bound on the KL divergence between the model and the data distribution. Although when perfectly learned this leads to the two distributions being exactly equal, in the realistic case of limited data and model capacity the model will tend to learn an overdispersed distribution. Low-temperature sampling of some distribution p(x) with temperature λ−1 < 1 consists of sampling the distribution pλ(x) ∝ p(x)λ. This mitigates the overdispersion problem by concentrating more on high-likelihood modes and effectively trading sample diversity for quality [39]. Exact low-temperature sampling is intractable for most generative models, however, various approximation schemes exist. We use an adaptation of Hybrid Langevin- Reverse Time SDE proposed by Ingraham et al. [39]: (︂ dτ = − λt + )︂ λ ψ 2 sθ,G(C, t) g2(t) dt + √︀1 + ψ g(t) dw with λt = σd + σt σd + σt/λ where λ (the inverse temperature), ψ and σd are parameters that can be tuned. Setting the blue components to 1 recovers the standard reverse time SDE. 3.2.4 Score model Extrinsic-to-intrinsic model While we have defined the diffusion process over intrinsic coordinates, learning a score model s(τ , t) directly over intrinsic coordinates is potentially problematic for several 27 Figure 3-2: A: The torsion τ around a bond depends on a choice of neighbors. B: The change ∆τ caused by a relative rotation is the same for all choices. C: The sign of ∆τ is unambiguous because given the same neighbors, τ does not depend on bond direction. reasons. First, the dimensionality m of the torsional space depends on the molecular graph G. Second, the mapping from torsional space to physically distinct conformers depends on G and local structures L, but it is unclear how to best provide these to a model over Tm. Third, there is no canonical choice of independent intrinsic coordinates (L, τ ); in particular, the torsion angle at a rotatable bond can be defined as any of the dihedral angles at that bond, depending on an arbitrary choice of reference neighbors (Figure 3-2 and Appendix A.1.1). Thus, even with fixed G and L, the mapping from Tm to conformers is ill-defined. This posed a significant challenge to prior works using intrinsic coordinates [25]. To circumvent these difficulties, we instead consider a conformer C ∈ CG in terms of its extrinsic coordinates. Then, we construct the score model sG(C, t) as a function over CG rather than Tm. The outputs remain in the tangent space of Tm, which is just Rm. Such a score model is simply an SE(3)-invariant model over point clouds in 3D space sG : R3n × [0, T ] ↦→ Rm conditioned on G. Thus, we have reduced the 28 problem of learning a score on the torus, conditioned on the molecular graph and local structure, to the much more familiar problem of predicting SE(3)-invariant scalar quantities-one for each bond-from a 3D conformer. It may appear that we still need to choose a definition of each torsion angle τi so that we can sample from pt|0(* | τ ) during training and solve the reverse SDE over τ during inference. However, we leverage the following insight: given fixed local structures, the action on C of changing a single torsion angle τi by some ∆τi can be applied without choosing a definition (Figure 3-2). In other words, we do not need to define a bijection between the extrinsic and intrinsic spaces but only map how actions in the intrisic space transform a point in the extrisic space. Geometrically, this action is a (signed) relative rotation of the atoms on opposite sides of the bond and can be applied directly to the atomic coordinates in 3D. The geometric intuition can be stated as follows (proven in Appendix A.1.2). Proposition 1. Let (bi, ci) be a rotatable bond, let xV(bi) be the positions of atoms on the bi side of the molecule, and let R(θ, xci) ∈ SE(3) be the rotation by Euler vector θ about xci. Then for C, C ′ ∈ CG, if τi is any definition of the torsion angle around bond (bi, ci), τi(C ′) = τi(C) + θ τj(C ′) = τj(C) ∀j ̸= i if ∃x ∈ C, x′ ∈ C ′. x′ V(bi) = xV(bi) x′ V(ci) = R (θ ^rbici, xci) xV(ci) (3.3) where ^rbici = (xci − xbi)/||xci − xbi||. To apply a torsion update ∆τ = (∆τ1, . . . ∆τm) involving all bonds, we apply ∆τi sequentially in any order. Then, since training and inference only make use of torsion updates ∆τ , we work solely in terms of 3D point clouds and updates applied to them. To draw local structures L from RDKit, we draw full 3D conformers C ∈ CG and then randomize all torsion angles to sample uniformly over Tm. To solve the reverse SDE, we repeatedly predict torsion updates directly from, and apply them directly to, the 3D point cloud. Therefore, since our method never requires a choice of reference neighbors for any τi, it is manifestly invariant to such a choice. These procedures are 29 detailed in Section 3.2.5. Parity equivariance The torsional score framework presented thus far requires an SE(3)-invariant model. However, an additional symmetry requirement arises from the fact that the underlying physical energy is invariant, or extremely nearly so, under parity inversion [79]. Thus our learned density should respect p(C) = p(−C) where −C = {−x | x ∈ C}. In terms of the conditional distribution over torsion angles, we require p(τ (C) | L(C)) = p(τ (−C) | L(−C)). Then (proof in Appendix A.1.3), Proposition 2. If p(τ (C) | L(C)) = p(τ (−C) | L(−C)), then for all diffusion times t, ∇τ log pt(τ (C) | L(C)) = −∇τ log pt(τ (−C) | L(−C)) (3.4) Because the score model seeks to learn sG(C, t) = ∇τ log pt(τ (C) | L(C)), we must have sG(C, t) = −sG(−C, t). Thus, the score model must be invariant under SE(3) but equivariant (change sign) under parity inversion of the input point cloud- i.e. it must output a set of pseudoscalars in Rm. Score network architecture Based on the previous discussion, the desiderata for the score model are: Predict a pseudoscalar δτi := ∂ log p/∂τi ∈ R that is SE(3)-invariant and parity equivariant for every rotatable bond in a 3D point cloud representation of a conformer. While there exist several GNN architectures which are SE(3)-equivariant [43, 85], their SE(3)-invariant outputs are also parity invariant and, therefore, cannot satisfy the desired symmetry. Instead, we leverage the ability of equivariant networks based on tensor products [94, 27] to produce pseudoscalar outputs. Our architecture, detailed in Appendix B.1.1, consists of an embedding layer, a series of atomic convolution layers, and a final bond convolution layer. The first two closely follow the architecture of Tensor Field Networks [94], and produce learned 30 feature vectors for each atom. The final bond convolution layer constructs tensor product filters spatially centered on every rotatable bond and aggregates messages from neighboring atom features. We extract the pseudoscalar outputs of this filter to produce a single real-valued pseudoscalar prediction δτi for each rotatable bond. Naively, the bond convolution layer could be constructed the same way as the atomic convolution layers, i.e., with spherical harmonic filters. However, to supply information about the orientation of the bond about which the torsion occurs, we construct a filter from the product of the spherical harmonics with a representation of the bond (Figure 3-1D). Because the convolution conceptually resembles computing the torque, we call this final layer the pseudotorque layer. 3.2.5 Training and inference procedures Algorithms 1 and 2 summarize, respectively, the training and inference procedures (without low-temperature sampling) used for torsional diffusion. In practice, during training, we limit KG to 30 i.e. we only consider the first 30 conformers found by CREST (typically those with the largest Boltzmann weight). Moreover, molecules are batched and an Adam optimizer with a learning rate scheduler is used for optimization. For inference, to fairly compare with other methods from the literature, we follow [25] and set K to be twice the number of conformers returned by CREST. Algorithm 1: Training procedure Input: molecules [G0, ..., GN ] each with true conformers [CG,1, ...CG,KG], learning rate α Output: trained score model sθ conformer matching process for each G to get [ ˆCG,1, ... ˆCG,KG]; for epoch ← 1 to epochmax do for G in [G0, ..., GN ] do sample t ∈ [0, 1] and ˆC ∈ [ ˆCG,1, ... ˆCG,KG]; sample ∆τ from wrapped normal pt|0(* | 0) with σ = σ1−t apply ∆τ to ˆC; predict δτ = sθ,G( ˆC, t); update θ ← θ − α∇θ‖δτ − ∇Δτ pt|0(∆τ | 0)‖2; min σt max ; 31 Algorithm 2: Inference procedure Input: molecular graph G, number conformers K, number steps N Output: predicted conformers [C1, ...CK] generate local structures by obtaining conformers [C1, ...CK] from RDKit; for C in [C1, ...CK] do sample ∆τ ∼ U [0, 2π]m and apply to C to randomize torsion angles; for n ← N to 1 do max √︀2 ln(σmax/σmin); min σt let t = n/N, g(t) = σ1−t predict δτ = sθ,G( ˆC, t); draw z from wrapped normal with σ2 = 1/N ; set ∆τ = (g2(t)/N ) δτ + g(t) z; apply ∆τ to C; 3.3 Experiments We evaluate torsional diffusion by comparing the generated and ground-truth con- formers in terms of ensemble RMSD (Section 3.3.2) and properties (Section 3.3.3). Code to run and replicate the presented results and links to the datasets discussed are available at https://github.com/gcorso/torsional-diffusion. 3.3.1 Experimental setup Dataset. We evaluate on the GEOM dataset [3], which provides gold-standard conformer ensembles generated with metadynamics in CREST [78]. We focus on GEOM-DRUGS-the largest and most pharmaceutically relevant part of the dataset- consisting of 304k drug-like molecules (average 44 atoms). To test the capacity to extrapolate to the largest molecules, we also collect from GEOM-MoleculeNet all species with more than 100 atoms into a dataset we call GEOM-XL and use it to evaluate models trained on DRUGS. Finally, we train and evaluate models on GEOM- QM9, a more established dataset but with significantly smaller molecules (average 11 atoms). Results for GEOM-QM9 are in Appendix E.1. Evaluation. We use the train/val/test splits from [25] and use the same metrics to compare the generated and ground truth conformer ensembles: Average Minimum 32 Table 3.1: Quality of generated conformer ensembles for the GEOM-DRUGS test set in terms of Coverage (%) and Average Minimum RMSD (Å). We compute Coverage with a threshold of δ = 0.75 Å to better distinguish top methods. Note that this is different from most prior works, which used δ = 1.25 Å. Recall Precision Method RDKit ETKDG OMEGA GeoMol GeoDiff Torsional Diffusion TD w/ low temp. Coverage ↑ Mean Med Mean Med Mean Med Mean Med Coverage ↑ AMR ↓ AMR ↓ 38.4 53.4 44.6 42.1 72.7 73.3 28.6 54.6 41.4 37.8 80.0 77.7 1.058 0.841 0.875 0.835 1.002 0.762 0.834 0.809 0.582 0.565 0.570 0.551 40.9 40.5 43.0 24.9 55.2 66.4 30.8 33.3 36.4 14.5 0.995 0.946 0.928 1.136 0.895 0.854 0.841 1.090 56.9 0.729 0.778 73.8 0.671 0.613 RMSD (AMR) and Coverage. These metrics are reported both for Recall (R)- which measures how well the generated ensemble covers the ground-truth ensemble- and Precision (P)-which measures the accuracy of the generated conformers. See Appendix D.1 for exact definitions and further details. Following the literature, we generate 2K conformers for a molecule with K ground truth conformers. Baselines. We compare with the strongest existing methods from Section 3.1. Among cheminformatics methods, we evaluate RDKit ETKDG [81], the most estab- lished open-source package, and OMEGA [35, 34], a commercial software in continuous development. Among machine learning methods, we evaluate GeoMol [25] and GeoDiff [108], which have outperformed all previous models on the evaluation metrics. Note that GeoDiff originally used a small subset of the DRUGS dataset, so we retrained it using the splits from [25]. 3.3.2 Ensemble RMSD Torsional diffusion significantly outperforms all previous methods on GEOM-DRUGS (Table 3.1 and Figure 3-3), reducing by 32% the average minimum recall RMSD and by 28% the precision RMSD relative to the previous state-of-the-art method. Torsional diffusion is also the first ML method to consistently generate better ensembles than 33 Figure 3-3: Mean coverage for recall (left) and precision (right) when varying the threshold value δ on GEOM-DRUGS. OMEGA. As OMEGA is a well-established product used in industry, this represents an essential step towards establishing the utility of conformer generation with machine learning. Torsional diffusion offers specific advantages over both GeoDiff and GeoMol, the most advanced prior machine learning methods. GeoDiff, a Euclidean diffusion model, requires 5000 denoising steps to obtain the results shown, whereas our model- thanks to the reduced degrees of freedom-requires only 20 steps. In fact, our model outperforms GeoDiff with as few as 5 denoising steps. As seen in Table 3.2, this translates to enormous runtime improvements. Compared to torsional diffusion, GeoMol similarly makes use of intrinsic coordinates. However, since GeoMol can only access the molecular graph, it is less suited for reasoning about relationships that emerge only in a spatial embedding, especially between regions of the molecule that are distant on the graph. Our extrinsic-to-intrinsic score framework-which gives direct access to spatial relationships-addresses precisely this issue. The empirical advantages are most evident for the large molecules in GEOM- XL, on which GeoMol fails to improve consistently over RDKit. On the other hand, because GeoMol requires only a single-forward pass, it retains the advantage of faster runtime compared to diffusion-based methods. 34 0.00.51.01.52.0Threshold (angstrom)020406080100Coverage (%)Coverage - RecallRDKitOMEGAGeoMolGeoDiffTor. Diff.0.00.51.01.52.0Threshold (angstrom)020406080100Coverage (%)Coverage - PrecisionRDKitOMEGAGeoMolGeoDiffTor. Diff. Table 3.2: Median AMR and runtime (core-secs per conformer) of machine learning methods, evaluated on CPU for comparison with RDKit. Method Steps AMR-R AMR-P Runtime RDKit GeoMol GeoDiff Torsional Diffusion - - 5000 5 10 20 1.002 0.834 0.809 0.685 0.580 0.565 0.895 0.841 1.090 0.963 0.791 0.729 0.10 0.18 305 1.76 2.82 4.90 Performance vs size. Figure 3-4 shows the performance of different models as a function of the number of rotatable bonds. Molecules with more rotatable bonds are more flexible and are generally larger; it is therefore expected that the RMSD error will increase with the number of bonds. With very few rotatable bonds, the error of torsional diffusion depends mostly on the quality of the local structures it was given, and therefore it has a similar error as RDKit. However, as the number of torsion angles increases, torsional diffusion deteriorates more slowly than other methods. The trend continues with the very large molecules in GEOM-XL (average 136 atoms and 32 rotatable bonds). These not only are larger and more flexible, but-for machine learning models trained on GEOM-DRUGS-are also out of distribution. As shown in Table 3.3, on GEOM-XL GeoMol only performs marginally better than RDKit, while torsional diffusion reduces RDKit AMR by 30% on recall and 12% on precision. These results can very likely be improved by training and tuning the torsional diffusion model on larger molecules. Table 3.3: Performance of various methods on the GEOM-XL dataset. Model AMR-P ↓ AMR-R ↓ Mean Med Mean Med RDKit GeoMol Torsional Diffusion 2.92 2.47 2.05 2.62 2.39 1.86 3.35 3.30 2.94 3.15 3.15 2.78 35 Figure 3-4: Average minimum RMSD (AMR) for recall (left) and precision (right) of the different conformer generation methods for molecules with different number of rotatable bonds in GEOM-DRUGS. The background shows the distribution of the number of rotatable bonds. 3.3.3 Ensemble properties While RMSD gives a geometric way to evaluate ensemble quality, we also consider the chemical similarity between generated and ground truth ensembles. For a random 100-molecule subset of DRUGS, we generate min(2K, 32) conformers per molecule, relax the conformers with GFN2-xTB [4],5 and compare the Boltzmann-weighted properties of the generated and ground truth ensembles. Specifically, the following properties are computed with xTB [4]: energy E, dipole moment μ, HOMO-LUMO gap ∆ε, and the minimum energy Emin. The median errors for torsional diffusion and the baselines are shown in Table 3.5. Our method produces the most chemically accurate ensembles, especially in terms of energy. In particular, we significantly improve over GeoMol and GeoDiff in finding the lowest-energy conformers that are only (on median) 0.13 kcal/mol higher in energy than the global minimum. 3.4 Torsional Boltzmann Generators Diffusion models offer a way of extracting the exact likelihood under the model of the generated datapoints. We exploit this property to train our diffusion model using 5Results without relaxation (which are less chemically meaningful) are in Appendix E.1. 36 147101316Num. rotatable bonds0.00.51.01.52.02.5Avg. Min. RMSD (angstrom)AMR - RecallRDKitOMEGAGeoMolGeoDiffTor. Diff.147101316Num. rotatable bonds0.00.51.01.52.02.5Avg. Min. RMSD (angstrom)AMR - PrecisionRDKitOMEGAGeoMolGeoDiffTor. Diff. Table 3.4: Median absolute error of generated v.s. ground truth ensemble properties. E, ∆ε, Emin in kcal/mol, μ in debye. Method E μ RDKit 0.81 OMEGA 0.68 GeoMol 0.42 0.31 GeoDiff Tor. Diff. 0.22 0.52 0.66 0.34 0.35 0.35 ∆ε Emin 1.16 0.75 0.69 0.68 0.59 0.40 0.39 0.89 0.54 0.13 an energy function rather than samples alone. In Section 3.4.1, we present a way of converting likelihoods on the intrinsic space to likelihoods on the extrinsic one. Then, in Section 3.4.2, we use the likelihoods to derive a novel training scheme based on importance sampling. Finally, in Section 3.4.3, we present experimental evidence that, on unseen molecules, our method is more efficient at sampling the conditional Boltzmann distribution than annealed importance sampling (AIS). 3.4.1 Likelihood By using the probability flow ODE, we can compute the likelihood of any sample τ as follows [92, 21]: log p0(τ0) = log pT (τT ) − 1 2 ∫︁ T 0 g2(t) ∇τ * sG(τt, t) dt (3.5) In [92], the divergence term is approximated via Hutchinson's method [38], which gives an unbiased estimate of log p0(τ ). However, this gives a biased estimate of p0(τ ), which is unsuitable for our applications. Thus, we compute the divergence term directly, which is feasible here (unlike in Euclidean diffusion) due to the reduced dimensionality of the torsional space. The above likelihood is in torsional space pG(τ | L), τ ∈ Tm, but to enable compatibility with the Boltzmann measure e−E(x)/kT , it is desirable to interconvert this with a likelihood in Euclidean space p(x | L), x ∈ R3n. A factor is necessary to convert between the volume element in torsional space and in Euclidean space (full 37 derivation in Appendix A.1.4): Proposition 3. Let x ∈ C(τ , L) be a centered6 conformer in Euclidean space. Then, pG(x | L) = pG(τ | L) √ 8π2 det g where gαβ = n ∑︁ k=1 α * J (k) J (k) β (3.6) where the indices α, β are integers between 1 and m + 3. For 1 ≤ α ≤ m, J (k) α is defined as i = ̃J (k) J (k) i − 1 n n ∑︁ l=1 ̃J (l) i with ̃J (l) i = ⎧ ⎪⎨ 0 ⎪⎩ xbi −xci ||xbi −xci || × (xl − xci) , l ∈ V(bi), l ∈ V(ci), (3.7) and for α ∈ {m + 1, m + 2, m + 3} as J (k) m+1 = xk × ˆx, J (k) m+2 = xk × ˆy, J (k) m+3 = xk × ˆz, (3.8) where (bi, ci) is the freely rotatable bond for torsion angle i, V(bi) is the set of all nodes on the same side of the bond as bi, and ˆx, ˆy, ˆz are the unit vectors in the respective directions. 3.4.2 Energy-based training By computing likelihoods, we can train torsional diffusion models to match the Boltzmann distribution over torsion angles using the energy function. At a high level, we minimize the usual score matching loss, but with simulated samples from the Boltzmann distribution rather than data samples. The procedure therefore consists of two stages: resampling and score matching, which are tightly coupled during training (Algorithm 1). In the resampling stage, we use the model as an importance sampler for the Boltzmann distribution, where Proposition 3 is used to compute the (unnormalized) torsional Boltzmann density ̃pG(τ | L). In the score-matching stage, the importance 6Additional formalism is needed for translations, but it is independent of the conformer and can be ignored. 38 weights are used to approximate the denoising score-matching loss with expectations taken over ̃pG(τ | L). As the model learns the score, it improves as an importance sampler. Algorithm 3: Energy-based training epoch Input: Boltzmann density ̃p, training pairs {(Gi, Li)}i, torsional diffusion model q for each (Gi, Li) do Sample τ1, . . . τK ∼ qGi(τ | Li); for k ← 1 to K do ̃wk = ̃pGi(τk | Li)/qGi(τk | Li); Approximate JDSM for p0 ∝ ̃p using {( ̃wi, τi)}i; Minimize JDSM; This training procedure differs substantially from that of existing Boltzmann generators, which are trained as flows with a loss that directly depends on the model density. In contrast, we train the model as a score-based model, but use it as a flow- both during training and inference-to generate samples. The model density is needed only to reweight the samples to approximate the target density. Since in principle the model used for resampling does not need to be the same as the model being trained,7 we can use very few steps (a shallow flow) during resampling to accelerate training, and then increase the number of steps (a deeper flow) for better approximations during inference-an option unavailable to existing Boltzmann generators. 3.4.3 Torsional Boltzmann generator We evaluate how well a torsional Boltzmann generator trained with MMFF [30] energies can sample the corresponding Boltzmann density over torsion angles. We train and test on GEOM-DRUGS molecules with 3–7 rotatable bonds and use the local structures of the first ground-truth conformers. For the baselines, we implement annealed importance samplers (AIS) [72] with Metropolis-Hastings steps over the torsional space and tune the variance of the transition kernels. 7For example, if the resampler were perfect, the procedure would reduce to normal denoising score matching. 39 Table 3.5: Effective sample size (out of 32) given by importance sampling weights over the torsional Boltzmann density. Temp. (K) Method Steps 1000 Uniform AIS Torsional BG – 5 20 100 5 20 500 1.21 1.36 1.76 3.12 300 1.02 1.18 1.30 2.06 1.71 2.20 3.12 6.72 3.04 3.60 7.28 11.42 6.42 4.68 Table 3.5 shows the quality of the samplers in terms of the effective sample size (ESS) given by the weights of 32 samples for each test molecule, which measures the α-divergence (with α = 2) between the model and Boltzmann distributions [68]. Our method significantly outperforms the AIS baseline, and improves with increased step size despite being trained with only a 5-step resampler. Note that, since these evaluations are done on unseen molecules, they are beyond the capabilities of existing Boltzmann generators. Figure 3-5 shows the distributions of ESSs at 500K for the torsional Boltzmann generator and the AIS baseline. While AIS fails to generate more than one effective sample for most molecules (tall leftmost column), torsional Boltzmann generators are much more efficient, with more than five effective samples for a significant fraction of molecules. 40 Figure 3-5: Histogram of the ESSs of the torsional Boltzmann generator and AIS baseline at 500K. 41 2202402605 stepsAISTorsional BG2.55.07.510.012.515.0ESS0204060Frequency17019020 stepsAISTorsional BG2.55.07.510.012.515.0ESS02040Frequency Chapter 4 DiffDock The biological functions of proteins can be modulated by small molecule ligands (such as drugs) binding to them. Thus, a crucial task in computational drug design is molecular docking-predicting the position, orientation, and conformation of a ligand when bound to a target protein-from which the effect of the ligand (if any) might be inferred. Traditional approaches for docking [96, 31] rely on scoring-functions that estimate the correctness of a proposed structure or pose, and an optimization algorithm that searches for the global maximum of the scoring function. However, since the search space is vast and the landscape of the scoring functions rugged, these methods tend to be too slow and inaccurate, especially for high-throughput workflows. Recent works [93, 62] have developed deep learning models to predict the binding pose in one shot, treating docking as a regression problem. While these methods are much faster than traditional search-based methods, they have yet to demonstrate significant improvements in accuracy. We argue that this may be because the regression- based paradigm corresponds imperfectly with the objectives of molecular docking, which is reflected in the fact that standard accuracy metrics resemble the likelihood of the data under the predictive model rather than a regression loss. We thus frame molecular docking as a generative modeling problem-given a ligand and target protein structure, we learn a distribution over ligand poses. Following the intrinsic diffusion models framework, we therefore develop DiffDock, a diffusion generative model (DGM) over the space of ligand poses for molecular 42 docking. We define a diffusion process over the degrees of freedom involved in docking: the position of the ligand relative to the protein (locating the binding pocket), its orientation in the pocket, and the torsion angles describing its conformation. DiffDock samples poses by running the learned (reverse) diffusion process, which iteratively transforms an uninformed, noisy prior distribution over ligand poses into the learned model distribution (Figure 4-1). Intuitively, this process can be viewed as the progressive refinement of random poses via updates of their translations, rotations, and torsion angles. While DGMs have been applied to other problems in molecular machine learning [108, 42, 37], existing approaches are ill-suited for molecular docking, where the space of ligand poses is an (m + 6)-dimensional submanifold M ⊂ R3n, where n and m are, respectively, the number of atoms and torsion angles. To develop DiffDock, we recognize that the docking degrees of freedom define M as the space of poses accessible via a set of allowed ligand pose transformations. We use this idea to map elements in M to the product space of the groups corresponding to those transformations, where a DGM can be developed and trained efficiently. As applications of docking models often require only a fixed number of predictions and a confidence score over these, we train a confidence model to provide confidence estimates for the poses sampled from the DGM and to pick out the most likely sample. This two-step process can be viewed as an intermediate approach between brute-force search and one-shot prediction: we retain the ability to consider and compare multiple poses without incurring the difficulties of high-dimensional search. Empirically, on the standard blind docking benchmark PDBBind, DiffDock achieves 38% of top-1 predictions with ligand root mean square distance (RMSD) below 2Å, nearly doubling the performance of the previous state-of-the-art deep learning model (20%). DiffDock significantly outperforms even state-of-the-art search-based methods (23%), while still being 3 to 12 times faster on GPU. Moreover, it provides an accurate confidence score of its predictions, obtaining 83% RMSD<2Å on its most confident third of the previously unseen complexes. We further evaluate the methods on structures generated by ESMFold [60]. Our 43 Figure 4-1: Overview of DiffDock. Left: The model takes as input the separate ligand and protein structures. Center : Randomly sampled initial poses are denoised via a reverse diffusion over translational, rotational, and torsional degrees of freedom. Right:. The sampled poses are ranked by the confidence model to produce a final prediction and confidence score. results confirm previous analyses [103] that showed that existing methods are not capable of docking against these approximate apo-structures (RMSD<2Å equal or below 10%). Instead, without further training, DiffDock places 22% of its top-1 predictions within 2Å opening the way for the revolution brought by accurate protein folding methods in the modeling of protein-ligand interactions. This chapter is based on the paper: DiffDock: Diffusion Steps, Twists, and Turns for Molecular Dock- ing. Gabriele Corso*, Hannes Stärk*, Bowen Jing*, Regina Barzilay, and Tommi Jaakkola. 11th International Conference on Learning Representa- tions (ICLR 2023). 4.1 Background and Related Work Molecular docking. The molecular docking task is usually divided between known- pocket and blind docking. Known-pocket docking algorithms receive as input the position on the protein where the molecule will bind (the binding pocket) and only have to find the correct orientation and conformation. Blind docking instead does not assume any prior knowledge about the binding pocket; in this work, we will focus 44 t=Tt=0ligand &proteinreverse diffusion overtranslations, rotations and torsionsranked poses &confidence score12DiffDock on this general setting. Due to the relative rigidity of the protein, docking methods typically assume the knowledge of the bound protein structure [77], this assumption is however not always realistic therefore we evaluate methods both with and without access to exact bound structure. Methods are normally evaluated by the percentage of hits, or approximately correct predictions, commonly considered to be those where the ligand RMSD error is below 2Å [1, 32, 64]. Search-based docking methods. Traditional docking methods [96, 31, 95] consist of a parameterized physics-based scoring function and a search algorithm. The scoring- function takes in 3D structures and returns an estimate of the quality/likelihood of the given pose, while the search stochastically modifies the ligand pose (position, orienta- tion, and torsion angles) with the goal of finding the global optimum of the scoring function. Recently, machine learning has been applied to parameterize the scoring- function [64, 66]. These search-based methods have offered relative improvements when docking to a known pocket but are typically very computationally expensive to run and must still grapple with the very large search space that characterizes blind docking. Machine learning for blind docking. Recently, EquiBind [93] has tried to tackle the blind docking task by directly predicting pocket keypoints on both ligand and protein and aligning them. TANKBind [62] improved over this by independently predicting a docking pose (in the form of an interatomic distance matrix) for each possible pocket and then ranking them. Although these one-shot or few-shot regression- based prediction methods are orders of magnitude faster, their performance has not yet reached that of traditional search-based methods. 4.2 Docking as Generative Modeling Although EquiBind and other ML methods have provided strong runtime improvements by avoiding an expensive optimization process over ligand poses, their performance has not yet reached that of search-based methods. As our analysis below argues, this may 45 be caused by the models' uncertainty and the optimization of an objective function that does not correspond to how molecular docking is used and evaluated in practice. Molecular docking objective. Molecular docking plays a critical role in drug discovery because the prediction of the 3D structure of a bound protein-ligand com- plex enables further computational and human expert analyses on the strength and properties of the binding interaction. Therefore, a docked prediction is only useful if its deviation from the true structure does not significantly affect the output of such analyses. Concretely, a prediction is considered acceptable when the distance between the structures (measured in terms of ligand RMSD) is below some small tolerance on the order of the length scale of atomic interactions (a few Ångström). Consequently, the standard evaluation metric used in the field has been the percentage of predictions with a ligand RMSD (to the crystal ligand pose) below some value ε. However, the objective of maximizing the proportion of predictions with RMSD within some tolerance ε is not differentiable and cannot be used for training with stochastic gradient descent. Instead, maximizing the expected proportion of predictions with RMSD < ε corresponds to maximizing the likelihood of the true structure under the model's output distribution, in the limit as ε goes to 0. This observation motivates training a generative model to minimize an upper bound on the negative log-likelihood of the observed structures under the model's distribution. Thus, we view molecular docking as the problem of learning a distribution over ligand poses conditioned on the protein structure and develop a diffusion generative model over this space (Section 4.3). Confidence model. With a trained diffusion model, it is possible to sample an arbitrary number of ligand poses from the posterior distribution according to the model. However, researchers are often interested in seeing only one or a small number of predicted poses and an associated confidence measure1 for downstream analysis. Thus, we train a confidence model over the poses sampled by the diffusion model and rank them based on its confidence that they are within the error tolerance. The 1For example, the pLDDT confidence score of AlphaFold2 [45] has had a very significant impact in many applications [73, 7]. 46 Figure 4-2: "DiffDock top-1" refers to the sample with the highest confidence. "DiffDock samples" to the other diffusion model samples. Left: Visual diagram of the advantage of generative models over regression models. Given uncertainty in the correct pose (represented by the orange distribution), regression models tend to predict the mean of the distribution, which may lie in a region of low density. Center: when there is a global symmetry in the protein (aleatoric uncertainty), EquiBind places the molecule in the center while DiffDock is able to sample all the true poses. Right: even in the absence of strong aleatoric uncertainty, the epistemic uncertainty causes EquiBind's prediction to have steric clashes and TANKBind's to have many self-intersections. top-ranked ligand pose and the associated confidence are then taken as DiffDock's top-1 prediction and confidence score. Problem with regression-based methods. The difficulty with the development of deep learning models for molecular docking lies in the aleatoric (which is the data inherent uncertainty, e.g., the ligand might bind with multiple poses to the protein) and epistemic uncertainty (which arises from the complexity of the task compared with the limited model capacity and data available) on the pose. Therefore, given the available co-variate information (only protein structure and ligand identity), any method will exhibit uncertainty about the correct binding pose among many viable alternatives. Any regression-style method that is forced to select a single configuration that minimizes the expected square error would learn to predict the (weighted) mean of such alternatives. In contrast, a generative model with the same co- variate information would instead aim to capture the distribution over the alternatives, populating all/most of the significant modes even if similarly unable to distinguish the correct target. This behavior, illustrated in Figure 4-2, causes the regression-based 47 TANKBindCrystalEquiBindDiffDock samplesDiffDock top-1 models to produce significantly more physically implausible poses than our method. In particular, we observe frequent steric clashes (e.g., 26% of EquiBind's predictions) and self-intersections in EquiBind's and TANKBind's predictions (Figures E-1 and E-5). We found no intersections in DiffDock's predictions. Visualizations and quantitative evidence of these phenomena are in Appendix E.2.1. 4.3 Method 4.3.1 Flexibility A ligand pose is an assignment of atomic positions in R3, so in principle, we can regard a pose x as an element in R3n, where n is the number of atoms. However, this encompasses far more degrees of freedom than are relevant in molecular docking. In particular, bond lengths, angles, and small rings in the ligand are essentially rigid, such that the ligand flexibility lies almost entirely in the torsion angles at rotatable bonds. Traditional docking methods, as well as most ML ones, take as input a seed conformation c ∈ R3n of the ligand in isolation and change only the relative position and the torsion degrees of freedom in the final bound conformation.2 The space of ligand poses consistent with c is, therefore, an (m + 6)-dimensional submanifold Mc ⊂ R3n, where m is the number of rotatable bonds, and the six additional degrees of freedom come from rototranslations relative to the fixed protein. This defines the extrinsic manifold over which we will develop the intrinsic diffusion model, therefore, given as input a seed conformation c, we formulate molecular docking as learning a probability distribution pc(x | y) over the manifold Mc, conditioned on a protein structure y. 2RDKit ETKDG is a popular method for predicting the seed conformation. Although the structures may not be predicted perfectly, the errors lie largely in the torsion angles, which are resampled anyways. 48 4.3.2 Mapping In order to make training a diffusion model over the manifold Mc efficient, we follow the IDM framework and define a one-to-one mapping to an intrinsic, "nicer", manifold where the diffusion kernel can be sampled directly. Any ligand pose consistent with a seed conformation can be reached by a com- bination of (1) ligand translations, (2) ligand rotations, and (3) changes to torsion angles. This suggests that given a continuous family of ligand pose transformations corresponding to the m + 6 degrees of freedom, a distribution on Mc can be lifted to a distribution on the product space of the corresponding groups-which is itself a manifold. We associate translations of ligand position with the 3D translation group T(3), rigid rotations of the ligand with the 3D rotation group SO(3), and changes in torsion angles at each rotatable bond with a copy of the 2D rotation group SO(2). More formally, we define operations of each of these groups on a ligand pose c ∈ R3n. The translation Atr : T(3) × R3n → R3n is defined straightforwardly as Atr(r, x)i = xi + r using the isomorphism T(3) ∼= R3 where xi ∈ R3 is the position of the ith atom. Similarly, the rotation Arot : SO(3) × R3n → R3n is defined by Arot(R, x)i = R(xi − ∑︀ xi, corresponding to rotations around the (unweighted) center ̄x) + ̄x where ̄x = 1 n of mass of the ligand. Many valid definitions of a change in torsion angles are possible, as the torsion angle around any bond (ai, bi) can be updated by rotating the ai side, the bi side, or both. However, we can specify changes of torsion angles to be disentangled from rotations or translations. One way of doing so is to identify a central motif in the molecule, such as a ring, and change torsion angles in a way that keeps the motif fixed. However, this special treatment of the central motif introduces an arbitrary asymmetry into the problem and could be difficult for a score model to reason about. Thus, we instead define the operation of elements of SO(2)m such that it causes a minimal perturbation (in an RMSD sense) to the structure:3 3Since we do not define or use the composition of elements of SO(2)m, strictly speaking, it is a product space but not a group and can be alternatively thought of as the torus Tm with an origin 49 Definition. Let Bk,θk(x) ∈ R3n be any valid torsion update by θk around the kth rotatable bond (ak, bk). We define Ator : SO(2)m × R3n → R3nsuch that Ator(θ, x) = RMSDAlign(x, (B1,θ1 ∘ * * * Bm,θm)(x)) where θ = (θ1, . . . θm) and RMSDAlign(x, x′) = arg min x†∈{gx′|g∈SE(3)} RMSD(x, x†) (4.1) This means that we apply all the m torsion updates in any order and then perform a global RMSD alignment with the unmodified pose. The definition is motivated by ensuring that the infinitesimal effect of a torsion is orthogonal to any rototranslation, i.e., it induces no linear or angular momentum. These properties can be stated more formally as follows (proof in Appendix A.2.1): Proposition 4. Let y(t) := Ator(tθ, x) for some θ and where tθ = (tθ1, . . . tθm). Then the linear and angular momentum are zero: d dt ̄y|t=0 = 0 and ∑︀ i(x − ̄x) × d dt yi|t=0 = 0 where ̄x = 1 n ∑︀ i xi. Now consider the product space4 P = T3 × SO(3) × SO(2)m and define A : P × R3n → R3n as A((r, R, θ), x) = Atr(r, Arot(R, Ator(θ, x))) (4.2) These definitions collectively provide the sought-after product space corresponding to the docking degrees of freedom. Indeed, for a seed ligand conformation c, we can formally define the space of ligand poses Mc = {A(g, c) | g ∈ P}. This product space P forms the intrinsic manifold over which we will define the diffusion process and corresponds precisely to the intuitive notion of the space of ligand poses that can be reached by rigid-body motion plus torsion angle flexibility. element. 4Since we never compose elements of P, we do not need to define a group structure. 50 To ensure that the product space P can be used to learn a DGM over ligand poses in Mc we show that (proof in Appendix A.2.2): Proposition 5. For a given seed conformation c, the map A(*, c) : P → Mc is a bijection. which means that the inverse A−1 c : Mc → P given by A(g, c) ↦→ g maps ligand poses x ∈ Mc to points on the product space P. We are now ready to develop a diffusion process on P. 4.3.3 Diffusion Following [21] to implement a diffusion model on P, it suffices to develop a method for sampling from and computing the score of the diffusion kernel on P. Furthermore, since P is a product manifold, the forward diffusion proceeds independently in each manifold [82], and the tangent space is a direct sum: TgP = TrT3 ⊕ TRSO(3) ⊕ TθSO(2)m ∼= R3 ⊕ R3 ⊕ Rm where g = (r, R, θ). Thus, it suffices to sample from the diffusion kernel and regress against its score in each group independently. , σ2 rot In all three groups, we define the forward SDE as dx = √︀dσ2(t)/dt dw where for T(3), SO(3), and SO(2)m respectively and where w is the σ2 = σ2 tr corresponding Brownian motion. Since T(3) ∼= R3, the translational case is trivial and involves sampling and computing the score of a standard Gaussian with variance , or σ2 tor σ2(t). The diffusion kernel on SO(3) is given by the IGSO(3) distribution [75, 57], which can be sampled in the axis-angle parameterization by sampling a unit vector ^ω ∈ so(3) uniformly5 and random angle ω ∈ [0, π] according to p(ω) = 1 − cos ω π f (ω) where f (ω) = ∞ ∑︁ l=0 (2l + 1) exp(−l(l + 1)σ2) sin((l + 1/2)ω) sin(ω/2) (4.3) Further, the score of the diffusion kernel is ∇ ln pt(R′ dω log f (ω))^ω ∈ TR′SO(3), where R′ = R(ω^ω)R is the result of applying Euler vector ω ^ω to R. | R) = ( d 5so(3) is the tangent space of SO(3) at the identity and is the space of Euler (or rotation) vectors, which are equivalent to the axis-angle parameterization. 51 The score computation and sampling can be accomplished efficiently by precomputing the truncated infinite series and interpolating the CDF of p(ω), respectively. Finally, the SO(2)m group is diffeomorphic to the torus Tm, on which the diffusion kernel is a wrapped normal distribution with variance σ2(t). This can be sampled directly, and the score can be precomputed as a truncated infinite series [42]. 4.3.4 Score model Extrinsic-to-intrinsic. Following, the intrinsic diffusion models framework, al- though we have defined the diffusion kernel and score matching objectives on P, we nevertheless develop the training and inference procedures to operate on ligand poses in 3D coordinates directly. Providing the full 3D structure, rather than abstract elements of the product space, to the score model allows it to reason about physical interactions using SE(3) equivariant models, not be dependent on arbitrary definitions of torsion angles [42], and better generalize to unseen complexes. Dependence on seed conformation. The training and inference procedures tech- nically depend on the choice of seed conformation c used to define the mapping between Mc and the product space. However, providing a definite choice of c to the score model introduces an arbitrary inference-time parameter that may affect the final predicted distribution, which is undesirable. In other words, while c defines the manifold of ligand poses, the precise location of c within that manifold should not affect the predicted distribution. Thus, we develop approximate training and inference procedures that remove the dependence on the c; intuitively, these assume that updates to points in the product space P can be applied to ligand poses in Mc directly, without referencing the origin conformer c. While these are only an approximation of the theoretically correct procedures, we find that they work well in practice. In Appendix B.2.1, we present the training and inference procedures in more detail and further discussion on this point. 52 Model architecture. We construct the score model s(x, y, t) to take as input the current ligand pose x and protein structure y in 3D space. The output must be in ∼= R3 corresponds the tangent space TrT3 ⊕ TRSO(3) ⊕ TθSO(2)m. The space TrT3 to translation vectors and TRSO(3) ∼= R3 to rotation (Euler) vectors. Critically both of these vectors are SE(3)-equivariant (with respect to joint rototranslations of x, y) as ligand pose distributions are defined relative to the protein structure, which can have arbitrary location and orientation. Finally, TθSO(2)m corresponds to scores on SE(3)-invariant quantities (torsion angles). Thus, the score model must predict two SE(3)-equivariant vectors for the ligand as a whole and an SE(3)-invariant scalar at each of the m freely rotatable bonds. The score model architecture is a SE(3)-equivariant convolutional network over point clouds [94, 27] whose architectural components are summarized below and detailed in Appendix B.2.2. Structures are represented as heterogeneous geometric graphs formed by ligand atoms and protein residues. Residue nodes receive as initial features language model embeddings trained on protein sequences [60]. Nodes are sparsely connected based on distance cutoffs that depend on the types of nodes being linked and on the diffusion time. Intuitively, nodes are connected with the range of elements that they might be closely interacting with; this range may span widely at the start of the diffusion but is narrow at the end. Convolutional layers simultaneously operate with different sets of weights for different connection types and generate scalar and vector representations for each node. The ligand atom representations after the final interaction layer are then used to produce the different outputs. To produce the two R3 vectors representing the translational and rotational scores, we convolve the node representations with a tensor product filter placed at the center of mass. For the torsional score, we use a pseudotorque convolution to obtain a scalar at each rotatable bond of the ligand analogously to [42], with the distinction that, since the score model operates on coarse-grained representations, the output is not a pseudoscalar (its parity is neither odd nor even). 53 4.3.5 Confidence model Training and inference. In order to collect training data for the confidence model d(x, y), we run the trained diffusion model to obtain a set of candidate poses for every training example and generate labels by testing whether or not each pose has RMSD below 2Å. The confidence model is then trained with cross-entropy loss to correctly predict the binary label for each pose. During inference, the diffusion model is run to generate N poses in parallel, which are passed to the confidence model that ranks them based on its confidence that they have RMSD below 2Å. Architecture. The confidence model has a similar architecture to the score model with two main differences. Firstly, its output is a single SE(3)-invariant scalar produced by mean-pooling the ligand atoms' scalar representations followed by a fully connected layer. Secondly, while the score model only considers a coarse-grained representation of the protein with only its α-carbon atoms, the confidence model has access to the full atomic structure of the protein. This multiscale setup yields improved performance and a significant speed-up w.r.t. doing the whole process at the atomic scale. 4.4 Experiments 4.4.1 Experimental setup. We evaluate our method on the complexes from PDBBind [61], a large collection of protein-ligand structures collected from PDB [8], which was used with time-based splits to benchmark many previous works [93, 99, 62]. We compare DiffDock with state-of-the-art search-based methods SMINA [49], QuickVina-W [32], GLIDE [31], and GNINA [64] as well as the older Autodock Vina [96], and the recent deep learning methods EquiBind and TANKBind presented above. Extensive details about the experimental setup, data, baselines, and implementation are in Appendix D.2.3 and all code is available at https://github.com/gcorso/DiffDock. 54 As we are evaluating blind docking, the methods receive two inputs: the ligand with a predicted seed conformation (e.g., from RDKit) and the crystal structure of the protein. Since search-based methods work best when given a starting binding pocket to restrict the search space, we also test the combination of using an ML-based method, such as P2Rank [52] (also used by TANKBind) or EquiBind to find an initial binding pocket, followed by a search-based method to predict the exact pose in the pocket. To evaluate the generated complexes, we compute the heavy-atom RMSD (permu- tation symmetry corrected) between the predicted and the ground-truth ligand atoms when the protein structures are aligned. All methods except for EquiBind are able to generate multiple structures and rank them. We report the metrics for the highest ranked prediction as the top-1; top-5 refers to selecting the most accurate pose out of the 5 highest ranked predictions, which is a useful metric when multiple predictions are used for downstream tasks. 4.4.2 Apo-structure docking Although large and comprehensive, the PDBBind benchmark only evaluates the capacity that various docking methods have to bind ligands to their corresponding receptor holo-structure. This is a much simpler and less realistic scenario than what is typically encountered in real applications where docking for new ligands is done against apo or holo-structures bound to a different ligand. In particular, since the development of accurate protein folding methods [45], docking programs are often run on top of AI-generated protein structures. With this in mind, we develop a new benchmark, referred to as PDBBind-ESMFold, where we combine the complex prediction of PDBBind with protein structures generated by ESMFold [60]. The main design choice when generating this benchmark relies on how to best align the PDBBind complex with the ESMFold structure to obtain the "ground-truth" docked prediction on the ESMFold structure. An unbiased global alignment of the two protein structures is not desirable because a difference in structure not affecting the pocket where the ligand binds would cause the two pockets to misalign; on the 55 other hand, only aligning residues within a single arbitrary pocket cutoff has many undesirable cases where too many or too few residues are selected or not weighted properly. Instead, we align receptors' residues with the Kabsch algorithm using exponential weighting, for every receptor x its weight is wx = e−λ dx where λ is a smoothing factor and dx is the minimum distance of x to a ligand atom in the original complex, this way residues closer to the ligand will have a higher weight in the alignment. For each complex, we individually select λ ∈ [0, 1] so that it preserves distances as best as possible, in particular, we use the L-BFGS-B [11] from scipy [98] to minimize: λ* = min λ ∑︁ ∑︁ (︂ x∈X y∈Y 1 ‖xc − y‖ − 1 ‖xe(λ) − y‖ )︂2 where ‖xc − y‖ and ‖xe(λ) − y‖ correspond to the distances between protein residue x and ligand atom y respectively in the original crystal structure from PDBBind and in the complex structure obtained aligning the ESMFold structure with smoothing parameter λ. We use inverse distances to give more importance to residues closer to the ligand (in either structure) and avoid steric clashes. We only consider protein backbones because the side-chain predictions are often less reliable and their structure typically changes upon binding. Thus we obtain protein structures on which we run the docking methods and the associated docked ligand positions that we use to evaluate them. 4.4.3 Results Docking accuracy. DiffDock significantly outperforms all previous methods (Table 4.1). In particular, DiffDock obtains an impressive 38.2% top-1 success rate (i.e., percentage of predictions with RMSD <2Å6) when sampling 40 poses and 35.0% when sampling just 10. This performance vastly surpasses that of state-of-the-art commercial software such as GLIDE (21.8%, p=2.7×10−7) and the previous state-of- the-art deep learning method TANKBind (20.4%, p=1.0×10−12). The use of ML-based 6Most commonly used evaluation metric [1, 32, 64] 56 Table 4.1: PDBBind blind docking. All methods receive a small molecule and are tasked to find its binding location, orientation, and conformation. Shown is the percentage of predictions with RMSD < 2Å and the median RMSD with the standard deviation (see Appendix D.2.2). The top half contains methods that directly find the pose; the bottom half those that use a pocket prediction method. The last two lines show our method's performance. In parenthesis we specify the number of poses sampled from the generative model. * indicates that the method runs exclusively on CPU, "-" means not applicable; some cells are empty due to infrastructure constraints. For TANKBind, the runtimes for the top-1 and top-5 predictions are different. Further evaluation details are in Appendix D.2.3. Top-1 RMSD (Å) Top-5 RMSD (Å) Med. Med. %<2 %<2 Method Autodock Vina QVinaW GNINA SMINA GLIDE EquiBind 5.5 20.9±2.1 22.9±2.2 18.7±2.0 21.8±2.1 5.5±1.2 TANKBind 20.4±2.1 P2Rank+SMINA 20.4±2.2 P2Rank+GNINA 28.8±2.4 EquiBind+SMINA 23.2±2.2 EquiBind+GNINA 28.8±2.3 DiffDock (10) DiffDock (40) 35.0±2.5 3.6±0.4 38.2±2.5 3.3±0.3 10.7 7.7±0.8 7.7±1.1 7.1±0.4 9.3±1.3 6.2±0.3 4.0±0.2 6.9±0.6 5.5±0.7 6.5±0.5 4.9±0.7 32.9±2.5 29.3±2.3 4.5±0.4 4.6±0.5 - - 24.5±2.1 33.2±2.5 38.3±2.6 38.6±2.5 39.1±2.5 3.4±0.1 4.4±0.5 3.4±0.4 3.4±0.4 3.1±0.4 40.7±2.6 2.65±0.2 44.7±2.6 2.40±0.2 Average Runtime (s) 205* 49* 127 126* 1405* 0.04 0.7/2.5 126* 127 126* 127 10 40 pocket prediction in combination with search-based docking methods improves over the baseline performances, but even the best of these (EquiBind+GNINA) reaches a success rate of only 28.8% (p=0.0003). Figure 4-3-left shows the proportion of RMSDs below an arbitrary threshold ε with DiffDock exceeding previous methods for almost every possible ε.7 Figure 4-3-right plots how the model's performance changes with the number of generative samples. Unlike regression methods like EquiBind, DiffDock is able to provide multiple diverse predictions of different likely poses, as highlighted in the top-5 performances. 7With the exception of very small ε <1Å where GLIDE performs better. 57 Inference runtime. DiffDock holds its superior accuracy while being (on GPU) 3 to 12 times faster than the best search-based method, GNINA (Table 4.1). This high speed is critical for applications such as high throughput virtual screening for drug candidates or reverse screening for protein targets, where one often searches over a vast number of complexes. As a diffusion model, DiffDock is inevitably slower than the one-shot deep learning method EquiBind, but as shown in Figure 4-3-right and Appendix E.2.3, it can be significantly sped up without significant loss of accuracy. Figure 4-3: Left: cumulative density histogram of the methods' RMSD. Right: DiffDock's performance as a function of the number of samples from the generative model. "Perfect selection" refers to choosing the sample with the lowest RMSD. Selective accuracy of confidence score. As the top-1 results show, DiffDock's confidence model is very accurate in ranking the sampled poses for a given complex and picking the best one. We also investigate the selective accuracy of the confidence model across different complexes by evaluating how DiffDock's accuracy increases if it only makes predictions when the confidence is above a certain threshold, known as selective prediction. In Figure 4-4, we plot the success rate as we decrease the percentage of complexes for which we make predictions, i.e., increase the confidence threshold. When only making predictions for the top one-third of complexes in terms of model confidence, the success rate improves from 38% to 83%. Additionally, there is a high Spearman correlation of 0.68 between DiffDock's confidence and the negative RMSD. Thus, the confidence score is a good indicator of the quality 58 0123450.10.20.30.40.50.60.7DiffDockGLIDEGNINASMINAQVinaWTANKBindEquiBindRMSD (Å)Fraction with lower RMSD0102030400.20.250.30.350.40.450.5Top-1 performanceTop-5 performanceTop-10 performancePerfect selectionNumber of generative samplesFraction with RMSD < 2Å Figure 4-4: Selective accuracy. Percentage of predictions with RMSD below 2Å when only making predictions for the portion of the dataset where DiffDock is most confident. of DiffDock's top-ranked sampled pose and provides a highly valuable confidence measure for downstream applications. Apo-structure docking. Previous work [103] highlighted that traditional search- based docking methods are not well adapted to dock molecules to apo-structures especially when these have been generated computationally. These observations are confirmed in the results in Table 4.2 where search-based methods obtain top-1 accuracies of only 10% or below. This is most likely due to their reliance on trying to find key-lock matches that makes them inflexible to imperfect protein structures, even when built-in options allowing side-chain flexibility are activated the results do not improve. This problem has, so far, largely prevented the computational protein folding revolution, started by AlphaFold2, to have a significant effect on the modeling of protein-ligand binding interactions [103]. Instead, the results presented in Table 4.2 show that DiffDock is able to retain a larger proportion of its accuracy placing the top-ranked ligand below 2Å away on 22% of the complexes. This ability to better generalize to imperfect structures, even without retraining, can be attributed to a combination of (1) the robustness of the diffusion model to small perturbations in the backbone atoms, and (2) the fact that DiffDock does not use the exact position of side chains in the score model and is therefore forced to implicitly model their flexibility. 59 02040608020406080100Baseline performancePerfect selectionConfidence modelPercentage of rejected complexesPercentage w/ RMSD < 2Å Table 4.2: PDBBind-ESMFold blind apo-structure docking. flex indicates that the side chain flexibility feature is turned on in the identified pocket. DiffDock refers to the same model described above, no further training or tuning was done on ESMFold structures. Further evaluation details are in Appendix D.2.3. Method GNINA SMINA EquiBind TANKBind P2Rank+SMINA P2Rank+GNINA EquiBind+SMINA EquiBind+GNINA SMINA+SMINAflex GNINA+GNINAflex EquiBind+SMINAflex EquiBind+GNINAflex DiffDock (10) DiffDock (40) Top-1 RMSD (Å) Top-5 RMSD (Å) %<2 Med. Med. %<2 2.0 3.4 1.7 10.4 4.6 8.6 4.3 10.2 3.4 1.7 4.3 6.6 21.7 20.3 22.3 15.4 7.1 5.4 10.0 11.2 8.3 8.8 12.6 22.1 7.3 9.8 5.0 5.1 4.0 6.9 - 14.7 10.3 12.8 11.7 18.6 8.3 5.1 11.7 14.6 31.9 31.3 14.22 10.0 - 4.3 7.0 7.2 5.8 5.6 11.6 20.0 5.8 6.1 3.3 3.3 60 Chapter 5 Conclusion 5.1 Summary In this thesis, we have presented a novel approach to the fundamental class of problems around learning the 3D structure of molecules and their interactions. This approach, referred to as Intrinsic Diffusion Modeling (IDM), tackles the dynamic and uncertain nature of these structures by learning a diffusion generative model. Moreover, IDM remedies to the high dimensionality and data scarcity characterizing the problems in this class by leveraging scientific knowledge in the form of the specification of the main degrees of freedom of the systems under analysis. In order to leverage this knowledge in an efficient and generalizable way, we define a mapping of the extrinsic manifold of flexibility to a simpler intrinsic manifold, define the diffusion process on the intrinsic manifold and learn an extrinsic-to-intrinsic score model. We hypothesized this approach could provide significant runtime and accuracy improvement because it drastically reduces the dimensionality and increases the smoothness of the space over which we are generating while maintaining the useful inductive biases of the objects over which the model operates. In fact, we showed that instantiations of IDM tailored to the problems of molecular conformer generation and molecular docking significantly outperform existing scalable computational approaches achieving an unpreceded level of accuracy. For molecular conformer generation, we presented, in Chapter 3, torsional diffusion, 61 which uses the IDM framework to restrict the diffusion process to the torsion angles, the most flexible degrees of freedom in molecular conformations. Torsional diffusion is the first machine learning model to significantly outperform standard cheminformatics methods and is orders of magnitude faster than previous Euclidean diffusion models. Using the exact likelihoods provided by our model, we also train the first system- agnostic Boltzmann generator. In Chapter 4, we presented DiffDock, an instantiation of the intrinsic diffusion modeling framework tailored to the task of molecular docking. This represents a paradigm shift from previous deep learning approaches, which use regression-based frameworks, to a generative modeling approach that is better aligned with the objective of molecular docking. The intrinsic diffusion process over the manifold describing the main degrees of freedom produces a fast and accurate generative model. Empirically, DiffDock outperforms the state-of-the-art by very large margins on PDBBind, has fast inference times, and provides confidence estimates with high selective accuracy. Moreover, unlike previous methods, it retains a large part of its accuracy even when run on apo and computationally generated protein structures, opening the way for the revolution brought by accurate protein folding methods in the modeling of protein ligand interactions. 5.2 Future directions There are several avenues for future work that the work presented in this thesis opens up. Firstly, there is the improvement and establishment of the tools presented in chapters 3 and 4. The established benchmark for conformer generation in the machine learning community, GEOM, used to train torsional diffusion, is composed of conformers derived with the metadynamics tool CREST with molecules simulated in a vacuum. This raises two concerns, firstly, the accuracy of CREST is not on par with more expensive computational methods like DFT or crystallography data, and secondly, chemists are typically interested in solvents very different from vacuum. Training torsional diffusion on more accurate conformers and conditioning its generation on 62 different solvents is an avenue for future work with high impact potential. When studying the interaction between a protein and a small molecule, researchers are typically not only interested in the pose with which the molecule binds to the protein, predicted by DiffDock, but also the affinity of such interaction. Physically this corresponds to free energy and its accurate prediction is one of the most impactful open problems in computational biophysics due to its importance in the field of drug discovery. Free energy is a thermodynamic property that depends on both the "strength" (enthalpy) of the interaction and its "tightness" (entropy), therefore, towards the goal of its accurate prediction generative methods, like DiffDock, providing the binding structure conformational ensemble will a key component. Finally, for these tools to be adopted and facilitate research in chemistry and biology, it is important that they are distributed with efficient and easy-to-use libraries and programs. The development of these tools is of critical importance for the impact that these methods will have on scientific research and industry. A second class of avenues for future work consists of the use of the Intrinsic Diffusion Modeling paradigm to tackle new problems or extend the existing methods to further degrees of flexibility. Below I list some of the problems and degrees of flexibility that I believe could be effectively tackled with IDM: 1. Molecular rings and cycles. Since both torsional diffusion and DiffDock model the flexibility of conformers based on the torsion angles of rotatable bonds, they assume that the conformation of cycles is fixed and rely for its prediction on RDKit. While this works fine for small rings typically present in drug-like molecules, it suffers for larger and more flexible rings, especially for macrocycles. These degrees of freedom could be integrated with torsion angles in the IDM framework by, for example, employing the ring puckering coordinates [18] to model the flexibility of ring conformations as points on hyperspheres. 2. Protein flexibility. DiffDock assumes that the structure of the protein is fixed and preserves the structure that was given as input. Although preliminary results have shown that DiffDock is robust to inaccuracies in the structure 63 given as input, the fixed protein assumption prevents us to study how the protein conformation changes upon binding, a factor that can be very important for evaluating the affinity of the interaction. Modeling protein flexibility, both in general and upon binding, is therefore a very important problem where an IDM- based approach could provide significant improvements over existing methods. While some follow-up work [104] applied the torsional diffusion framework to the full protein molecular graph, this approach is problematic because of the large lever-arm effect that changing a torsion in the backbone can have on very distant parts of the protein. Instead, I believe that a promising approach is to use torsional flexibility to model sidechain flexibility (where the lever-arm effect is limited) and use some local flexibility scheme such as the backrub motion [20] to model movements in the backbone. 3. Protein-protein interactions. The IDM framework could be also applied to model protein-protein interactions, a fundamental problem in structural biology. One promising approach to this problem could involve combining the SO(3) and T(3) components of DiffDock to model the rigid protein-protein docking problem and the protein flexibility components discussed above to model the conformation of each of the proteins. Finally, it is also a very exciting avenue of future work the extension of the IDM framework to model more general and complex problems. Some interesting avenues of research in this direction are: 1. automatically discovering from data extrinsic and intrinsic manifolds that well describe degrees of freedom of a generation problem; 2. relaxing the condition that the diffusion is done exclusively on the extrinsic manifold, but, instead, using such manifold as a soft constraint or inductive bias to make the full dimensional diffusion more efficient; 3. improve the framework to train IDM from an energy or reward function presented in Section 3.4.3, making it more efficient and effective; 64 4. successively improve or jointly train the score model and the confidence or energy model presented in DiffDock; 5. support and design forward diffusion processes that more closely align with physical priors leading to more stable conformations even before relaxation. Overall the work presented in this thesis makes me very optimistic that diffusion generative models will have a profound impact in many areas of structural biology and persuaded that a more careful and effective design of the domain and process of the diffusion will be critical to achieving these results. 65 Appendix A Proofs A.1 Chapter 3: Torsional Diffusion Reported in this section are the proofs of the propositions in Chapter 3. These were primarily developed by Bowen Jing and Jeffrey Chang. A.1.1 Definitions Consider a molecular graph G = (V, E) and its space of possible conformers CG. A conformer is an assignment V ↦→ R3 of each atom to a point in 3D-space, defined up to global rototranslation. For notational convenience, we suppose there is an ordering of nodes such that we can regard a mapping as a vector in R3n where n = |V|. Then a conformer C ∈ CG is a set of SE(3)-equivalent vectors in R3n-that ∼= R3n/SE(3). This defines the space of conformers in terms of extrinsic (or is, CG Cartesian) coordinates. An intrinsic (or internal) coordinate is a function over CG-i.e., it is an SE(3)- invariant function over R3n. There are four types of such coordinates typically considered: Bond lengths. For (a, b) ∈ E, the bond length lab ∈ [0, ∞) is defined as |xa − xb|. Bond angles. For a, b, c ∈ V such that a, c ∈ N (b), the bond angle αabc ∈ [0, π] 66 is defined by cos αabc := (xc − xb) * (xa − xb) |xc − xb||xa − xb| (A.1) Chirality. For a ∈ V with 4 neighbors b, c, d, e ∈ N (a), the chirality zabcd ∈ {−1, 1} is defined as zabcde := sign det ⎛ ⎝ 1 1 1 1 xb − xa xc − xa xd − xa xe − xa ⎞ ⎠ (A.2) Similar quantities are defined for atoms with other numbers of neighbors. Chirality is often considered part of the specification of the molecule, rather than the conformer. Torsion angles. For (b, c) ∈ E, with a choice of reference neighbors a ∈ N (b) ∖ {c}, d ∈ N (c) ∖ {b}, the torsion angle τabcd ∈ [0, 2π) is defined as the dihedral angle between planes abc and bcd: cos τabcd = sin τabcd = nabc * nbcd |nabc||nbcd| ubc * (nabc × nbcd) |ubc||nabc||nbcd| (A.3) where uab = xb −xa and nabc is the normal vector uab ×ubc. Note that τabcd = τdcba- i.e., the dihedral angle is the same for four consecutively bonded atoms regardless of the direction in which they are considered. A complete set of intrinsic coordinates of the molecule is a set of such functions (f1, f2, . . .) such that F (C) = (f1(C), f2(C), . . .) is a bijection. In other words, they fully specify a unique element of CG without overparameterizing the space. In general there exist many possible such sets for a given molecular graph. We will not discuss further how to find such sets, as our work focuses on manipulating molecules in a way that holds fixed all l, α, z and only modifies (a subset of) torsion angles τ . As presently stated, the torsion angle about a bond (b, c) ∈ E is ill-defined, as it could be any τabcd with a ∈ N (b) ∖ {c}, d ∈ N (c) ∖ {b}. However, any complete set of intrinsic coordinates needs to only have at most one such τabcd for each bond (b, c) [25]. Thus, we often refer to the torsion angle about a bond (bi, ci) as τi when 67 reference neighbors ai, bi are not explicitly stated. A.1.2 Torsion update Given a freely rotatable bond (bi, ci), by definition removing (bi, ci) creates two connected components V(bi), V(ci). Then, consider torsion angle τj at a different bond (bj, cj) with neighbor choices aj ∈ N (bj), dj ∈ N (cj), aj ̸= cj, dj ̸= bj. Without loss of generality, there are two cases • Case 1: aj, bj, cj, dj ∈ V(bi) • Case 2: dj ∈ V(ci) and aj, bj, cj ∈ V(bi) Note that in Case 2, cj = bi and dj = ci must hold because there is only one edge between V(bi), V(ci). With these preliminaries we now restate the proposition: Proposition 1. Let (bi, ci) be a rotatable bond, let xV(bi) be the positions of atoms on the bi side of the molecule, and let R(θ, xci) ∈ SE(3) be the rotation by Euler vector θ about xci. Then for C, C ′ ∈ CG, if τi is any definition of the torsion angle around bond (bi, ci), τi(C ′) = τi(C) + θ τj(C ′) = τj(C) ∀j ̸= i if ∃x ∈ C, x′ ∈ C ′. x′ V(bi) = xV(bi) x′ V(ci) = R (θ ^rbici, xci) xV(ci) (A.4) where ^rbici = (xci − xbi)/||xci − xbi||. Proof. First we show τi(C′) = τi(C) + θ, for which it suffices to show τi(x′) = τi(x) + θ. Because ai, bi ∈ V(bi), x′ xci, we have x′ = xbi. Since the rotation of xV(ci) is centered at ci = xci as well. Now we consider di and u′ − xci. By the Rodrigues ai = xai and x′ bi cd = x′ di rotation formula, u′ cd = ucd cos θ + nbcd |ubc| sin θ + ubc |ubc| (︂ ubc |ubc| )︂ * ucd (1 − cos θ) (A.5) Then we have bcd = ubc × u′ n′ cd = nbcd cos θ − (︂ nbcd × )︂ ubc |ubc| sin θ (A.6) 68 To obtain |n′ bcd|, note that since nbcd ⊥ ubc, ⃒ ⃒ nbcd × ⃒ ⃒ ubc |ubc| ⃒ ⃒ ⃒ ⃒ = |nbcd| which gives |n′ bcd| = |nbcd|. Thus, cos τ ′ i = nabc * n′ bcd |nabc||nbcd| = nabc * nbcd |nabc||nbcd| cos θ − nabc * (nbcd × ubc) |nabc||nbcd||ubc| sin θ = cos τi cos θ − sin τi sin θ = cos(τi + θ) (A.7) (A.8) Similarly, sin τ ′ i = ubc * (nabc × n′ bcd) |ubc||nabc||nbcd| = ubc * (nabc × nbcd) |ubc||nabc||nbcd| cos θ − ubc * (nabc × (nbcd × ubc)) |ubc|2|nabc||nbcd| sin θ = sin τi cos θ + cos τi sin θ = sin(τi + θ) (A.9) Therefore, τ ′ i = τi + θ Now we show τ ′ j = τj for all j ̸= i. Consider any such j. For Case 1, x′ j = τj. For Case 2, x′ = xdj so clearly τ ′ aj = xaj , x′ bj cj = xcj = xbj , x′ = cj = xcj , x′ dj xbj , x′ immediately. But because dj = ci, we also have x′ dj aj = xaj , x′ bj j = τj. = xdj . Thus, τ ′ A.1.3 Parity equivariance Proposition 2. If p(τ (C) | L(C)) = p(τ (−C) | L(−C)), then for all diffusion times t, ∇τ log pt(τ (C) | L(C)) = −∇τ log pt(τ (−C) | L(−C)) (A.10) Proof. From Equation A.3 we see that for any torsion τi, we have τi(−C) = −τi(C); therefore τi(−C) = −τi(C), which we denote τ−. Also denote τ := τ (C), pt(τ ) := pt(τ | L(C)) and t(τ−) := pt(τ− | L(−C)). We claim pt(τ ) = p′ p′ (equation 3.1) is parity invariant, t(τ−) for all t. Since the perturbation kernel p′ t(τ−) = = ∫︁ Tm ∫︁ Tm 0(τ ′ p′ −)pt|0(τ− | τ ′ −) dτ ′ − p0(τ ′)pt|0(τ | τ ′) dτ ′ − = pt(τ ) (A.11) 69 Next, we have ∇τ log p′ t(τ−) = ∂τ− ∂τ ∇τ − log p′ t(τ−) = −∇τ log pt(τ ) (A.12) which concludes the proof. A.1.4 Likelihood conversion Proposition 3. Let x ∈ C(τ , L) be a centered conformer in Euclidean space. Then, pG(x | L) = pG(τ | L) √ 8π2 det g where gαβ = n ∑︁ k=1 α * J (k) J (k) β (A.13) where the indices α, β are integers between 1 and m + 3. For 1 ≤ α ≤ m, J (k) α is defined as i = ̃J (k) J (k) i − 1 n n ∑︁ l=1 ̃J (l) i with ̃J (l) i = ⎧ ⎪⎨ 0 ⎪⎩ xbi −xci ||xbi −xci || × (xl − xci) , l ∈ V(bi), l ∈ V(ci), (A.14) and for α ∈ {m + 1, m + 2, m + 3} as J (k) m+1 = xk × ˆx, J (k) m+2 = xk × ˆy, J (k) m+3 = xk × ˆz, (A.15) where (bi, ci) is the freely rotatable bond for torsion angle i, V(bi) is the set of all nodes on the same side of the bond as bi, and ˆx, ˆy, ˆz are the unit vectors in the respective directions. Proof. Let M be (m + 3)-dimensional manifold embedded in 3n-dimensional Euclidean space formed by the set of all centered conformers with fixed local structures but arbitrary torsion angles and orientation. A natural set of coordinates for M is qα = {τ1, τ2, . . . , τm, ωx, ωy, ωz}, where τi is the torsion angle at bond i and ωx, ωy, ωz define the global rotation about the 70 center of mass: ⎛ xk = ̃xk − 1 n n ∑︁ l=1 ̃xl where ̃xl = eΛ(ω)x′ k, Λ(ω) = ⎜ ⎜ ⎜ ⎝ 0 ωz −ωy ⎞ ⎟ ⎟ ⎟ ⎠ . −ωz ωy 0 ωx −ωx 0 (A.16) Here x′ k is the position of atom k as determined by the torsion angles, without centering or global rotations, and ωx, ωy, ωz are rotation about the x, y, and z axis respectively. Consider the set of covariant basis vectors Jα = ∂x ∂qα . and corresponding the covariant components of the metric tensor, gαβ = Jα * Jβ = ∂x ∂qα * ∂x ∂qβ . (A.17) (A.18) The conversion factor between torsional likelihood and Euclidean likelihood is given by ∫︁ √︀det g d3ω, (A.19) √ where det g dm+3q is the invariant volume element on M [12], and the integration over ω marginalizes over the uniform distribution over global rotations. The calculation of Eq. A.19 proceeds as follows. Let the position of the k'th atom be xk, and let the three corresponding components of Jα be J (k) α . For 1 ≤ i ≤ m, J (k) i is given by J (k) i = ∂ ∂τi (︃ ̃xk − )︃ ̃xl 1 n n ∑︁ l=1 = ̃J (k) i − 1 n n ∑︁ l=1 ̃J (l) i (A.20) where ̃J (k) torsion angle τi, without considering the change in the center of mass. Clearly ̃J (bi) := ∂ ̃xk/∂τi is the displacement of atom k upon an infinitesmal change in the i = ̃J (ci) i = 0 i because neither bi nor ci itself is displaced; furthermore, all atoms on the b side of torsioning bond are not displaced, so J (k) i = 0 for all k ∈ N (bi). The remaining atoms, in N (ci), are rotated about the axis of the (bi, ci) bond. The displacement per infinitesimal ∂τi is given by 71 the cross product of the unit normal along the rotation axis, ( ̃xci − ̃xbi)/|| ̃xci − ̃xbi||, with the displacement from rotation axis, ̃xk − ̃xbi. This cross product yields J (k) in Eq. A.14, α where the tildes are dropped as relative positions do not depend on center of mass. For α ∈ {m + 1, m + 2, m + 3}, a similar consideration of the cross product with the rotation axis yields Eq. A.15. Finally, since none of the components of the metric tensor depend explicitly on ω, the integration over ω in Eq. A.19 is trivial and yields the volume over SO(3) of 8π2 [14], proving the proposition. A.2 Chapter 4: DiffDock Reported in this section are the proofs of the propositions in Chapter 4. These were primarily developed by Bowen Jing. A.2.1 Zero momentum Proposition 4. Let y(t) := Ator(tθ, x) for some θ and where tθ = (tθ1, . . . tθm). Then the linear and angular momentum are zero: d dt ̄y|t=0 = 0 and ∑︀ i(x − ̄x) × d dt yi|t=0 = 0 where ̄x = 1 n ∑︀ i xi. Proof. Let y(t) = R(t)(B(t, θ, x) − ̄x) + ̄x + p(t) where B(t, θ, *) = B1,tθ1 ∘ * * * Bm,tθm and R(t), p(t) are the rotation (around ̄x) and translation associated with the optimal RMSD alignment between B(t, θ, x) and x. By definition of RMSD, for any t, R(t) and p(t) minimize ||y(t) − x|| = ||R(t)(B(t, θ, x) − ̄x) + ̄x + p(t) − x|| (A.21) For infinitesimal t = dt, the RHS becomes RHS = ||R(dt)(B(dt, θ, x) − ̄x) + ̄x + p(dt) − x|| = ||(R′(0) dt + R(0)) (B′(0, θ, x) dt + B(0, θ, x) − ̄x) + ̄x + p′(0) dt + p(0) − x|| = ||R′(0) (x − ̄x) + B′(0, θ, x) + p′(0) || dt (A.22) 72 where we have used R(0) = I, B(0, θ, x) = x, and p(0) = 0. Thus, we see that RMSD alignment implies that the derivatives of R(t), p(t) minimize the norm of y′(0) = R′(0) (x − ̄x) + B′(0, θ, x) + p′(0) (A.23) This expression represents the instantaneous velocity of the points yi at t = 0. We now show that minimizing the velocity results in zero linear and angular momentum. We abbreviate B′(t, θ, x(0))i := bi and p′ = v. Further, let ri = xi − ̄x, such that the rotational contribution to the velocity can be written in terms of an angular velocity vector ω. With this, at t = 0 we have y′ i = bi + ω × ri + v (A.24) We thus obtain the squared norm as ∑︁ ||y′ i||2 = i = ∑︁ i ∑︁ i (bi + ω × ri + v) * (bi + ω × ri + v) ||bi||2 + 2bi * (ω × ri) + 2bi * v + (ω × ri) * (ω × ri) + 2(ω × ri) * v + ||v||2]︁ [︁ ∑︁ = ||bi||2 + 2ω * ∑︁ (ri × bi) + 2 i i (︃ ∑︁ )︃ bi i * v + n ||v||2 + ωT I(r)ω (A.25) where we have used the fact that ∑︀ i rirT i is the 3 × 3 inertia tensor. To minimize the squared norm (and thus the norm itself), i ri = 0 and where I(r) = (∑︀ i ri * ri) I − ∑︀ we set gradients with respect to v, ω to zero. This gives v = − 1 n ∑︁ bi i and ω = −I(r)−1 )︃ ri × bi (︃ ∑︁ i Now with y′ i = bi + ω × ri + v we evaluate the linear momentum 1 n ∑︁ y′ i = i 1 n (︃ ∑︁ i bi + ω × ∑︁ i )︃ ri + nv = 0 (A.26) (A.27) 73 which is zero by direct substitution of v. Similarly, we evaluate the angular momentum ∑︁ i ri × y′ i = = ∑︁ i ∑︁ i ri × bi + ∑︁ i ri × (ω × ri) + ∑︁ i ri × v ri × bi + I(r)ω = 0 (A.28) which is zero by direct substitution of ω. Thus, the linear and angular momentum are zero at t = 0 for arbitrary x. Note that since we did not use the particular form of B(tθ, x) in the above proof, we have shown that RMSD alignment can be used to disentangle rotations and translations from the infinitesimal action of any arbitrary function. A.2.2 Map is bijection Proposition 5. For a given seed conformation c, the map A(*, c) : P → Mc is a bijection. Proof. Since we defined Mc = {A(g, c) | g ∈ P}, A(*, c) is automatically surjective. We now show that it is injective. Assume for the sake of contradiction that A(*, c) is not injective, so that there exist elements of the product space g1, g2 ∈ P with g1 ̸= g2 but with A(g1, c) = A(g2, c) = c′. That is, Atr(r1, Arot(R1, Ator(θ1, c))) = Atr(r2, Arot(R2, Ator(θ2, c))) (A.29) i c(2) i c(1) i /n = ∑︀ i /n = ∑︀ i ci/n + r1 and ∑︀ which we abbreviate as c(1) = c(2). Since only Atr changes the center of mass ∑︀ we have ∑︀ i ci/n, i ci/n + r2. However, since c(1) = c(2), this implies r1 = r2. Next, consider the torsion angles τ1 = (τ (1) m ) of c(1) corresponding to some choice of dihedral angles at each rotatable bond. Because Atr and Arot are rigid-body motions, only Ator changes the dihedral angles; in particular, by definition we have τ (1) i mod 2π for all i = 1, . . . m. However, because τ (1) for all i and therefore θ1 = θ2 (as elements of SO(2)m). Now denote c⋆ = Ator(θ1, c) = Ator(θ2, c) and apply i mod 2π and τ (2) , this means θ(1) ∼= τi + θ(2) ∼= θ(2) i ∼= τi + θ(1) 1 , . . . τ (1) i = τ (2) i i i i 74 Atr(−r1, *) = Atr(−r2, *) to both sides of Equation A.29. We then have which further leads to Arot(R1, c⋆) = Arot(R2, c⋆) c⋆ − ̄c⋆ = R−1 1 R2(c⋆ − ̄c⋆) (A.30) (A.31) In general, this does not imply that R1 = R2. However, R1 ̸= R2 is possible only if c⋆ is degenerate, in the sense that all points are collinear along the shared axis of rotation of R1, R2. However, in practice, conformers never consist of a collinear set of points, so we can safely assume R1 = R2. We now have (r1, R1, θ1) = (r2, R2, θ2), or g1 = g2, contradicting our initial assumption. We thus conclude that A(*, c) is injective, completing the proof. 75 Appendix B Methodological Details B.1 Chapter 3: Torsional Diffusion B.1.1 Score network architecture Overview To perform the torsion score prediction under these symmetry constraints we design an architecture formed by three components: an embedding layer, a series of K interaction layers and a pseudotorque layer. The pseudotorque layer produces pseudoscalar torsion scores δτ := ∂ log p/∂τ for every rotatable bond. Following the notation from Thomas et al. [94] and Batzner et al. [6], we represent the node acm representations as V (k,l,p) a dictionary with keys the layer k, rotation order l and parity p that contains tensors with shapes [|V|, nl, 2l + 1] corresponding to the indices of the node, channel and representation respectively. We use the e3nn library [27] to implement our architecture. Embedding layer In the embedding layer, we build a radius graph (V, Ermax) around each atom on top of the original molecular graph and generate initial scalar embeddings for nodes V (0,0,1) and edges eab combining chemical properties, sinusoidal embeddings of time φ(t) [97] and, for the edges, a radial basis function representation of their a 76 Figure B-1: Overview of the architecture and visual intuition of the pseudotorque layer. length μ(rab) [86]: Ermax = E ⊔ {(a, b) | rab < rmax} eab = Υ(e)(f eab||μ(rab)||φ(t)) ∀(a, b) ∈ Ermax (B.1) V (0,0,1) a = Υ(v)(fa||φ(t)) ∀a ∈ V where Υ(e) and Υ(v) are learnable two-layers MLPs, rab is the Euclidean distance between atoms a and b, rmax = 5 is the distance cutoff, fa are the chemical features of atom a, fab are the chemical features of bond (a, b) if it was part of E and 0 otherwise. The node and edge chemical features fa and fab are constructed as in Ganea et al. [25]. Briefly, the node features include atom identity, atomic number, aromaticity, degree, hybridization, implicit valence, formal charge, ring membership, and ring size, constituting a 74-dimensional vector for GEOM-DRUGS and 44-dimensional for QM9 (due to fewer atom types). The edge features are a 4 dimensional one-hot encoding of the bond type. Interaction layers The interaction layers are based on e3nn [27] convolutional layers. At each layer, for every pair of nodes in the graph, we construct messages 77 Interaction layers4 ⨉Vatom= (V(",$)∊Rc,V(&,$)∊R3c,V(',$)∊R5c)Δτfor each bondPseudotorque layer∑Y(rpos) ⊗Vneighbor⊗Y2(rbond)for each atom with p∈[−1,1]Vneighborrposrbond using tensor products of the current irreducible representation of each node with the spherical harmonic representations of the normalized edge vector. These messages are themselves irreducible representations, which are weighted channel-wise by a scalar function of the current scalar representations of the two nodes and the edge and aggregated with Clebsch-Gordan coefficients. At every layer k, for every node a, rotation order lo, and output channel c′: V (k,lo,po) ac′mo = ∑︁ ∑︁ C(lo,mo) (li,mi)(lf ,mf ) ∑︁ ∑︁ ψ(k,lo,lf ,li,pi) abc Y (lf ) mf (^rab) V (k−1,li,pi) bcmi 1 |Na| c (B.2) mf ,mi lf ,li,pi with ψ(k,lo,lf ,li,pi) abc b∈Na = Ψ(k,lo,lf ,li,pi) c (eab||V (k−1,0,1) a ||V (k−1,0,1) b ) where the outer sum is over values of lf , li, pi such that |li − lf | ≤ lo ≤ li + lf and (−1)lf pi = po, C indicates the Clebsch-Gordan coefficients [94], Na = {b | (a, b) ∈ Emax} the neighborhood of a and Y the spherical harmonics. The rotational order of the nodes representations lo and li and of the spherical harmonics of the edges (lf ) are restricted to be at most 2. All the learnable weights are contained in Ψ, a dictionary of MLPs that compute per-channel weights based on the edge embeddings and scalar features of the outgoing and incoming node. Pseudotorque layer The final part of our architecture is a pseudotorque layer that predicts a pseudoscalar score δτ for each rotatable bond from the per-node outputs of the interaction layers. For every rotatable bond, we construct a tensor-valued filter, centered on the bond, from the tensor product of the spherical harmonics with a l = 2 representation of the bond axis. Since the parity of the l = 2 spherical harmonic is even, this representation does not require a choice of bond direction. The filter is then used to convolve with the representations of every neighbor on a radius graph, and the products which produce pseudoscalars are passed through odd-function (i.e., with tanh nonlinearity and no bias) dense layers (not shown in equation B.3) to produce a single prediction. For all rotatable bonds g = (g0, g1) ∈ Erot and b ∈ V, let rgb and ˆrgb be the 78 magnitude and direction of the vector connecting the center of bond g and b. Eτ = {(g, b) | g ∈ Er, b ∈ V, rgb < rmax} ∑︁ T (lo,po) gbmo = C (lo,mo) (2,mg)(lr,mr)Y (2) mf (ˆrg) Y (lr) mr (ˆrgb) egb = Υ(τ )(μ(rgb)) mg,mr,lr:po=(−1)lr δτg = ∑︁ ∑︁ l,pf ,pi:pf pi=−1 mo,mi C (0,0) (l,mf )(l,mi) 1 |Ng| ∑︁ ∑︁ b∈Ng c gcb T (l,pf ) γ(l,pi) gbmf V (K,l,pi) bcmi (B.3) with γ(l,pi) gcb = Γ(l,pi) c (egb||V (K,0,1) b ||V (K,0,1) g0 + V (K,0,1) g1 ) where Υ(τ ) and Γ are MLPs with learnable parameters and Ng = {b | (g, b) ∈ Eτ }. B.1.2 Conformer matching The conformer matching procedure, summarised in Algorithm 4, proceeds as follows. For a molecule with K conformers, we first generate K random local structure estimates ˆL from RDKit. To match with the ground truth local structures, we compute the cost of matching each true conformer C with each estimate ˆL (i.e. a K × K cost matrix), where the cost is the best RMSD that can be achieved by modifying the torsions of the RDKit conformer with local structure ˆL to match the ground truth conformer C. Note that in practice, we compute an upper bound to this optimal RMSD using the fast von Mises torsion matching procedure proposed by Stark et al. [93]. We then find an optimal matching of true conformers C to local structure estimates ˆL by solving the linear sum assignment problem over the approximate cost matrix [19]. Finally, for each matched pair, we find the true optimal ˆC by running a differential evolution optimization procedure over the torsion angles [67]. The complete assignment resulting from the linear sum solution guarantees that there is no distributional shift in the local structures seen during training and inference. Table B.1 shows the average RMSD between a ground truth conformer Ci and its matched conformer ˆCi. The average RMSD of 0.324 Å obtained via conformer matching provides an approximate lower bound on the achievable AMR performance for methods that do not change the local structure and take those from RDKit (further discussion in Appendix C.1.1). 79 Algorithm 4: Conformer matching Input: true conformers of G [C1, ...CK] Output: approximate conformers for training [ ˆC1, ... ˆCK] generate local structures [ ˆL1, ... ˆLK] with RDKit; for (i, j) in [1, K] × [1, K] do Ctemp = von_Mises_matching(Ci, ˆLj); cost[i,j] = RMSD(Ci, Ctemp); assignment = linear_sum_assignment(cost); for i ← 1 to K do j = assignment[i]; ˆCi = differential_evolution(Ci, ˆLj, RMSD); Table B.1: Average RMSD(ci, ˆci) achieved by different variants of conformer matching. "Original RDKit" refers to the RMSD between a random RDKit conformer and a ground truth conformer without any optimization. In "Von Mises optimization" and "Differential evolution," the torsions of the RDKit conformer are adjusted using the respective procedures, but the pairing of RDKit and ground truth conformers is still random. In "Conformer matching," the cost-minimizing assignment prior to differential evolution provides a 15% improvement in average RMSD. The results are shown for a random 300-molecule subset of GEOM-DRUGS. Matching method RMSD (Å) Original RDKit Von Mises optimization Differential evolution Conformer matching 1.448 0.728 0.379 0.324 B.2 Chapter 4: DiffDock B.2.1 Training and Inference In this section we present the training and inference procedures of the diffusion generative model. First, however, there are a few subtleties of the generative approach to molecular docking that are worth mentioning. Unlike the standard generative modeling setting where the dataset consists of many samples drawn from the data distribution, each training example (x⋆, y) of protein structure y and ground-truth ligand pose x⋆ is the only sample from the corresponding conditional distribution px⋆(* | y) defined over Mx⋆. Thus, the innermost training loop iterates over distinct 80 conditional distributions px⋆(* | y), along with a single sample from that distribution, rather than over samples from a common data distribution pdata(x). As discussed in Section 4.3, during inference, c is the ligand structure generated with a method such as RDKit. However, during training we require Mc = Mx⋆ in order to define a bijection between c ∈ Mx⋆ and P. If we take c ∈ Mx⋆, there will be a distribution shift between the manifolds Mc considered at training time and those considered at inference time. To circumvent this issue, at training time we predict c with RDKit and replace x⋆ with arg minx†∈Mc RMSD(x⋆, x†) using the conformer matching procedure described in Jing et al. [42]. The above paragraph may be rephrased more intuitively as follows: during inference, the generative model docks a ligand structure generated by RDKit, keeping its non- torsional degrees of freedom (e.g., local structures) fixed. At training time, however, if we train the score model with the local structures of the ground truth pose, this will not correspond to the local structures seen at inference time. Thus, at training time, we replace the ground truth pose by generating a ligand structure with RDKit and aligning it to the ground truth pose while keeping the local structures fixed. With these preliminaries, we now continue to the full procedures (Algorithms 5 and 6). The training and inference procedures of a score-based diffusion generative model on a Riemannian manifold consist of (1) sampling and regressing against the score of the diffusion kernel during training; and (2) sampling a geodesic random walk with the score as a drift term during inference [21]. Because we have developed the diffusion process on P but continue to provide the score model with elements in Mc ⊂ R3n, the full training and inference procedures involve repeatedly interconverting between the two spaces using the bijection given by the seed conformation c. However, as noted in the main text, the dependence of these procedures on the exact choice of c is potentially problematic, as it suggests that at inference time, the model distribution may be different depending on the orientation and torsion angles of c. Simply removing the dependence of the score model on c is not sufficient since the update steps themselves still occur on P and require a choice of c to be mapped to Mc. However, notice that the update steps-in both training and inference-consist 81 Algorithm 5: Training procedure (single epoch) Input: Training pairs {(x⋆, y)}, RDKit predictions {c} foreach c, x⋆, y do c (x0); Let x0 ← arg minx†∈Mc RMSD(x⋆, x†); Compute (r0, R0, θ0) ← A−1 Sample t ∼ Uni([0, 1]); Sample ∆r, ∆R, ∆θ from diffusion kernels ptr Set rt ← r0 + ∆r; Set Rt ← (∆R)R0; Set θt ← θ0 + ∆θ mod 2π; Compute xt ← A((rt, Rt, θt), c); Predict scores α ∈ R3, β ∈ R3, γ ∈ Rm = s(xt, c, y, t) ; Take optimization step on loss L = ||α − ∇ptr t (∆r | 0)||2 + ||β − ∇prot t (* | 0), prot t (* | 0), ptor t (* | 0); t (∆R | 0)||2 + ||γ − ∇ptor t (∆θ | 0)||2 of (1) sampling the diffusion kernels at the origin; (2) applying these updates to the point on P; and (3) transferring the point on P to Mc via A(*, c). Might it instead be possible to apply the updates to 3D ligand poses x ∈ Mc directly? It turns out that the notion of applying these steps to ligand poses "directly" corresponds to the formal notion of group action. The operations Atr, Arot, Ator that we have already defined are formally group actions if they satisfy A(*)(g1g2, x) = A(g1, A(g2, x)). While true for Atr, Arot, this is not generally true for Ator if we take SO(2)m to be the direct product group; however, the approximation is increasingly good as the magnitude of the torsion angle updates decreases. If we then define P to be the direct product group of its constituent groups, A is a group action of P on Mc, as the operations of Atr, Arot, Ator commute and are (under the approximation) individually group actions. The implication of A being a group action can be seen as follows. Let δ = gbg−1 a be the update which brings ga ∈ P to gb ∈ P via left multiplication, and let xa, xb be the corresponding ligand poses A(ga, c), A(gb, c). Then xb = A(gbg−1 a ga, c) = A(δ, xa) (B.4) which means that the updates δ can be applied directly to xa using the operation 82 Algorithm 6: Inference procedure Input: RDKit prediction c, protein structure y (both centered at origin) Output: Sampled ligand pose x0 Sample θN ∼ Uni(SO(2)m), RN ∼ Uni(SO(3)), rN ∼ N (0, σ2 Let xN = A((rN , RN , θN ), c); for n ← N to 1 do tor(T )); tr((n − 1)/N ) and similarly for ; tr = σ2 rot, ∆σ2 tor tr(n/N ) − σ2 Let t = n/N and ∆σ2 ∆σ2 Predict scores α ∈ R3, β ∈ R3, γ ∈ Rm ← s(xn, c, y, t); Sample ztr, zrot, ztor from N (0, ∆σ2 Set rn−1 ← r0 + ∆σ2 Set Rn−1 ← R(∆σ2 torγ + ztor) mod 2π; Set θn−1 ← θn + (∆σ2 Compute xn−1 ← A((rn−1, Rn−1, θn−1), c); trα + ztr; rotβ + zrot)Rn); tr), N (0, ∆σ2 rot), N (0, ∆σ2 tor) respectively; Return x0; A. The training and inference procedures then become Algorithm 7 and 8 below. The initial conformer c is no longer used, except in the initial steps to define the manifold-to find the closest point to x⋆ in training, and to sample xN from the prior over Mc in inference. Conceptually speaking, this procedure corresponds to "forgetting" the location of the origin element on Mc, which is permissible because a change of the origin to c (c′)- some equivalent seed c′ ∈ Mc merely translates-via right multiplication by A−1 the original and diffused data distributions on P, but does not cause any changes on Mc itself. The training and inference routines involve updates-formally left multiplications-to group elements, but as left multiplication on the group corresponds to group actions on Mc, the updates can act on Mc directly, without referencing the origin c. We find that the approximation of A as a group action works quite well in practice and use Algorithms 7 and 8 for all training and experiments discussed in the paper. Of course, disentangling the torsion updates from rotations in a way that makes Ator exactly a group action would justify the procedure further, and we regard this as a possible direction for future work. 83 Algorithm 7: Approximate training procedure (single epoch) Input: Training pairs {(x⋆, y)}, RDKit predictions {c} foreach c, x⋆, y do Let x0 ← arg minx†∈Mc RMSD(x⋆, x†); Sample t ∼ Uni([0, 1]); Sample ∆r, ∆R, ∆θ from diffusion kernels ptr Compute xt ← A((∆r, ∆R, ∆θ), x0); Predict scores α ∈ R3, β ∈ R3, γ ∈ Rm = s(xt, y, t) ; Take optimization step on loss L = ||α − ∇ptr t (∆r | 0)||2 + ||β − ∇prot t (* | 0), prot t (* | 0), ptor t (* | 0); t (∆R | 0)||2 + ||γ − ∇ptor t (∆θ | 0)||2 Algorithm 8: Approximate inference procedure Input: RDKit prediction c, protein structure y (both centered at origin) Output: Sampled ligand pose x0 Sample θN ∼ Uni(SO(2)m), RN ∼ Uni(SO(3)), rN ∼ N (0, σ2 Let xN = A((rN , RN , θN ), c); for n ← N to 1 do tor(T )); tr((n − 1)/N ) and similarly for ; tr = σ2 rot, ∆σ2 tor tr(n/N ) − σ2 Let t = n/N and ∆σ2 ∆σ2 Predict scores α ∈ R3, β ∈ R3, γ ∈ Rm ← s(xn, y, t); Sample ztr, zrot, ztor from N (0, ∆σ2 Set ∆r ← r0 + ∆σ2 Set ∆R ← R(∆σ2 torγ + ztor; Set ∆θ ← ∆σ2 Compute xn−1 ← A((∆r, ∆R, ∆θ), xn); trα + ztr; rotβ + zrot); tr), N (0, ∆σ2 rot), N (0, ∆σ2 tor) respectively; Return x0; B.2.2 Architecture Details We use convolutional networks based on tensor products of irreducible representations (irreps) of SO(3) [94] as architecture for both the score and confidence models. In particular, these are implemented using the e3nn library [27]. Below, ⊗w refers to the spherical tensor product of irreps with path weights w, and ⊕ refers to normal vector addition (with possibly padded inputs). Features have multiple channels for each irrep. Both the architectures can be decomposed into three main parts: embedding layer, interaction layers, and output layer. We outline each of them below. 84 Embedding layer Geometric heterogeneous graph. Structures are represented as heterogeneous geometric graphs with nodes representing ligand (heavy) atoms, receptor residues (located in the position of the α-carbon atom), and receptor (heavy) atoms (only for the confidence model). Because of the high number of nodes involved, it is necessary for the graph to be sparsely connected for runtime and memory constraints. Moreover, sparsity can act as a useful inductive bias for the model, however, it is critical for the model to find the right pose that nodes that might have a strong interaction in the final pose to be connected during the diffusion process. Therefore, to build the radius graph, we connect nodes using cutoffs that are dependent on the types of nodes they are connecting: 1. Ligand atoms-ligand atoms, receptor atoms-receptor atoms, and ligand atoms- receptor atoms interactions all use a cutoff of 5Å, standard practice for atomic interactions. For the ligand atoms-ligand atoms interactions we also preserve the covalent bonds as separate edges with some initial embedding representing the bond type (single, double, triple and aromatic). For receptor atoms-receptor atoms interactions, we limit at 8 the maximum number of neighbors of each atom. Note that the ligand atoms-receptor atoms only appear in the confidence model where the final structure is already set. 2. Receptor residues-receptor residues use a cutoff of 15 Å with 24 as the maximum number of neighbors for each residue. 3. Receptor residues-ligand atoms use a cutoff of 20 + 3 * σtr Å where σtr represents the current standard deviation of the diffusion translational noise present in each dimension (zero for the confidence model). Intuitively this guarantees that with high probability, any of the ligands and receptors that will be interacting in the final pose the diffusion model converges to are connected in the message passing at every step. 4. Finally, receptor residues are connected to the receptor atoms that form the 85 corresponding amino-acid. Node and edge featurization. For the receptor residues, we use the residue type as a feature as well as a language model embedding obtained from ESM2 [60]. The ligand atoms have the following features: atomic number; chirality; degree; formal charge; implicit valence; the number of connected hydrogens; the number of radical electrons; hybridization type; whether or not it is in an aromatic ring; in how many rings it is; and finally, 6 features for whether or not it is in a ring of size 3, 4, 5, 6, 7, or 8. These are concatenated with sinusoidal embeddings of the diffusion time [97] and, in the case of edges, radial basis embeddings of edge length [86]. These scalar features of each node and edge are then transformed with learnable two-layer MLPs (different for each node and edge type) into a set of scalar features that are used as initial representations by the interaction layers. Notation Let (V, E) represent the heterogeneous graph, with V = (Vl, Vr) respec- tively ligand atoms and receptor residues (receptor atoms Va, present in the confidence model, are for simplicity not included here), and similarly E = (Ell, Elr, Erl, Err). Let ha be the node embeddings (initially only scalar channels) of node a, eab the edge embeddings of (a, b), and μ(rab) radial basis embeddings of the edge length. Let represent the variance of the diffusion kernel in each of the three σ2 tr , and σ2 tor , σ2 rot components: translational, rotational and torsional. Interaction layers At each layer, for every pair of nodes in the graph, we construct messages using tensor products of the current node features with the spherical harmonic representations of the edge vector. The weights of this tensor product are computed based on the edge embeddings and the scalar features-denoted h0 a -of the outgoing and incoming nodes. The messages are then aggregated at each node and used to update the current 86 node features. For every node a of type ta: ha ← ha ⊕ t∈{l,r} BN(ta,t) (︃ 1 |N (t) a | ∑︁ b∈N (t) a )︃ Y (ˆrab) ⊗ψab hb (B.5) with ψab = Ψ(ta,t)(eab, h0 a, h0 b) Here, t indicates an arbitrary node type, N (t) a = {b | (a, b) ∈ Etat} the neighbors of a of type t, Y are the spherical harmonics up to l = 2, and BN the (equivariant) batch normalisation. The orders of the output are restricted to a maximum of l = 1. All learnable weights are contained in Ψ, a dictionary of MLPs, which uses different sets of weights for different edge types (as an ordered pair so four types for the score model and nine for the confidence) and different rotational orders. Output layer The ligand atom representations after the final interaction layer are used in the output layer to produce the required outputs. This is where the score and confidence architecture differ significantly. On one hand, the score model's output is in the tangent space TrT3 ⊕TRSO(3)⊕TθSO(2)m. This corresponds to having two SE(3)-equivariant output vectors representing the translational and rotational score predictions and m SE(3)-invariant output scalars representing the torsional score. For each of these, we design final tensor-product convolutions inspired by classical mechanics. On the other hand, the confidence model outputs a single SE(3)-invariant scalar representing the confidence score. Below we detail how each of these outputs is generated. Translational and rotational scores. The translational and rotational score intuitively represent, respectively, the linear acceleration of the center of mass of the ligand and the angular acceleration of the rest of the molecule around the center. Considering the ligand as a rigid object and given a set of forces and masses at each ligand, a tensor product convolution between the atoms and the center of mass would be capable of computing the desired quantities. Therefore, for each of the two outputs, we perform a convolution of each of the ligand atoms with the (unweighted) center of 87 mass c. v ← 1 |Vl| ∑︁ a∈Vl Y (ˆrca) ⊗ψca ha with ψca = Ψ(μ(rca), h0 a) (B.6) We restrict the output of v to a single odd and a single even vectors (for each of the two scores). Since we are using coarse-grained representations of the protein, the score will neither be even nor odd; therefore, we sum the even and odd vector representations of v. Finally, the magnitude (but not direction) of these vectors is adjusted with an MLP taking as input the current magnitude and the sinusoidal embeddings of the diffusion time. Finally, we (revert the normalization) by multiplying the outputs by 1/σtr for the translational score and by the expected magnitude of a score in SO(3) with diffusion parameter σrot (precomputed numerically). Torsional score. To predict the m SE(3)-invariant scalar describing the torsional score, we use a pseudotorque layer similar to that of Jing et al. [42]. This predicts a scalar score δτ for each rotatable bond from the per-node outputs of the atomic convolution layers. For rotatable bond g = (g0, g1) and b ∈ Vl, let rgb and ˆrgb be the magnitude and direction of the vector connecting the center of bond g and b. We construct a convolutional filter Tg for each bond g from the tensor product of the spherical harmonics with a l = 2 representation of the bond axis ˆrg:1 Tg(ˆr) := Y 2(ˆrg) ⊗ Y (ˆr) (B.7) ⊗ is the full (i.e., unweighted) tensor product as described in Geiger et al. [26], and the second term contains the spherical harmonics up to l = 2 (as usual). This filter (which contains orders up to l = 3) is then used to convolve with the representations 1Since the parity of the l = 2 spherical harmonic is even, this representation is indifferent to the choice of bond direction. 88 of every neighbor on a radius graph: Eτ = {(g, b) | g a rotatable bond, b ∈ Vl} egb = Υ(τ )(μ(rgb)) ∀(g, b) ∈ Eτ hg = 1 |Ng| ∑︁ b∈Ng Tg(ˆrgb) ⊗γgb hb (B.8) with γgb = Γ(egb, h0 b, h0 g0 + h0 g1) Here, Ng = {b | (g, b) ∈ Eτ } and Υ(τ ) and Γ are MLPs with learnable parameters. Since unlike Jing et al. [42], we use coarse-grained representations the parity also here is neither even nor odd, the irreps in the output are restricted to arrays both even h′ g and odd h′′ g scalars. Finally, we produce a single scalar prediction for each bond: δτg = Π(h′ g + h′′ g) (B.9) where Π is a two-layer MLP with tanh nonlinearity and no biases. This is also "denormalized" by multiplying by the expected magnitude of a score in SO(2) with diffusion parameter σtor. Confidence output. The single SE(3)-invariant scalar representing the confidence score output is instead obtained by concatenating the even and odd final scalar representation of each ligand atom, averaging these feature vectors among the different atoms, and finally applying a three layers MLP (with batch normalization). 89 Appendix C Further Discussion C.1 Chapter 3: Torsional Diffusion C.1.1 RDKit local structures In this section, we provide empirical justification for the claim that cheminformatics methods like RDKit already provide accurate local structures. It is well known in chemistry that bond lengths and angles take on a very narrow range of values due to strong energetic constraints. However, it is not trivial to empirically evaluate the claim due to the difficulty in defining a distance measure between a pair of local structures. In this section, we will employ two sets of observations: marginal error distributions and matched conformer RMSD. Marginal error distributions We examine the distribution of errors of the bond lengths and angles in a random RDKit conformer relative to the corresponding lengths and angles in a random CREST conformer (Figure C-1). The distributions are narrow and uni-modal distributions around zero, with a RMSE of 0.03 Å for bond lengths and 4.1° for bond angles on GEOM-DRUGS. Comparing DRUGS and QM9, the error distribution does not depend on the size of the molecule. Although it is difficult to determine how these variations will compound or compensate for each other in the global conformer structure, the analysis demonstrates that bond lengths and angles 90 Figure C-1: Histogram of the errors in 15000 predicted bond lengths and angles from randomly sampled molecules in GEOM-DRUGS and GEOM-QM9. have little flexibility (i.e., no strong variability among conformers) and are accurately predicted by RDKit. Matched conformer RMSD We can more rigorously analyze the quality of a local structure ˆL with respect to a given reference conformer C by computing the minimum RMSD that can be obtained by combining ˆL with optimal torsion angles. That is, we consider the RMSD distance of C to the closest point on the manifold of possible conformers with local structure ˆL: RMSDmin(C, ˆL) := minτ RMSD(C, ˆC) where ˆC = ( ˆL, τ ). Conveniently, ˆC is precisely the output of the differential evolution in Appendix B.1.2. Thus, the average RSMD reported in the last row of Table B.1 is the expected RMSDmin of an optimal assignment of RDKit local structures to ground-truth con- formers. This distance-0.324 Å on GEOM-DRUGS-is significantly smaller than the error of the current state-of-the-art conformer generation methods. Further, it is only slightly larger than the average RMSDmin of 0.284 Å resulting from matching a ground truth conformer to the local structure of another randomly chosen ground truth conformer, which provides a measure of the variability among ground truth local structures. These observations support the claim that the accuracy of existing approaches on drug-like molecules can be significantly improved via better conditional sampling of torsion angles. 91 0.20.10.00.10.2Error (Å)0500100015002000FrequencyBond lengthsDRUGSQM9201001020Error (°)050010001500FrequencyBond anglesDRUGSQM9 C.1.2 Limitations of torsional diffusion As demonstrated in Section 4.4, torsional diffusion significantly improves the accuracy and reduces the denoising runtime for conformer generation. However, torsional diffusion also has a number of limitations that we will discuss in this section. Conformer generation The first clear limitation is that the error that torsional diffusion can achieve is lower bounded by the quality of the local structure from the selected cheminformatics method. As discussed in Appendix C.1.1, this corresponds to the mean RMSD obtained after conformer matching, which is 0.324 Å with RDKit local structures on DRUGS. Moreover, due to the the local structure distributional shift, conformer matching (or another method bridging the shift) is required to generate the training set. However, the resulting conformers are not the minima of the (unconditional or even conditional) potential energy function. Thus, the learning task becomes less physically interpretable and potentially more difficult; empirically we observe this clearly in the training and validation score-matching losses. We leave to future work the exploration of relaxations of the rigid local structures assumption in a way that would still leverage the predominance of torsional flexibility in molecular structures, while at the same time allowing some flexibility in the independent components. Rings The largest source of flexibility in molecular conformations that is not directly accounted for by torsional diffusion is the variability in ring conformations. Since the torsion angles at bonds inside cycles cannot be independently varied, our framework treats them as part of the local structure. Therefore, torsional diffusion relies on the local structure sampler pG(L) to accurately model cycle conformations. Although this is true for a large number of relatively small rings (especially aromatic ones) present in many drug-like molecules, it is less true for puckered rings, fused rings, and larger cycles. In particular, torsional diffusion does not address the longstanding difficulty that existing cheminformatics methods have with macrocycles-rings with 12 or more atoms that have found several applications in drug discovery [24]. We hope, however, 92 that the idea of restricting diffusion processes to the main sources of flexibility will motivate future work to define diffusion processes over cycles conformations combined with free torsion angles. Boltzmann generation With Boltzmann generators we are typically interested in sampling the Boltzmann distribution over the entire (Euclidean) conformational space pG(C). However, the procedure detailed in Section 3.4.2 generates (importance- weighted) samples from the Boltzmann distribution conditioned on a given local structure pG(C | L). To importance sample from the full Boltzmann distribution pG(C), one would need a model pG(L) over local structures that also provides exact likelihoods. This is not the case with RDKit or, to the best of our knowledge, other existing models, and therefore an interesting avenue for future work. 93 Appendix D Experimental Details D.1 Chapter 3: Torsional Diffusion D.1.1 Dataset details Splits We follow the data processing and splits from Ganea et al. [25]. The splits are random with train/validation/test of 243473/30433/1000 for GEOM-DRUGS and 106586/13323/1000 for GEOM-QM9. GEOM-XL consists of only a test split (since we do not train on it), which consists of all 102 molecules in the MoleculeNet dataset with at least 100 atoms. For all splits, the molecules whose CREST conformers all have a canonical SMILES different from the SMILES of the molecule (meaning a reacted conformer), or that cannot be handled by RDKit, are filtered out. Dataset statistics As can be seen in Figure D-1, the datasets differ significantly in molecule size as measured by number of atoms or rotatable bonds. Particularly significant is the domain shift between DRUGS and XL, which we leverage in our experiments by testing how well models trained on DRUGS generalize to XL. Boltzmann generator The torsional Boltzmann generator described in Section 3.4.3 is trained and tested on molecules from GEOM-DRUGS with 3–7 rotatable bonds. The training (validation) set consists of 10000 (400) such randomly selected 94 Figure D-1: Statistics about the atoms and rotatable bonds counts in the three different datasets. molecules from the DRUGS training (validation) set. The test set consists of all the 453 molecules present in the DRUGS test set with 3–7 rotatable bonds. D.1.2 Training and tuning details Conformer generation For conformer ensemble generation on GEOM-DRUGS, the torsional diffusion models were trained on NVIDIA RTX A6000 GPUs for 250 epochs with the Adam optimizer (taking from 4 to 11 days on a single GPU). The hyperparameters tuned on the validation set were (in bold the value that was chosen): initial learning rate (0.0003, 0.001, 0.003), learning rate scheduler patience (5, 20), number of layers (2, 4, 6), maximum representation order (1st, 2nd), rmax (5Å, 7Å, 10Å) and batch norm (True, False). Finally, for low-temperature sampling, the three relevant parameters λ, ψ, and σd were chosen with an inference sweep with Bayesian optimizer. All the other default hyperparameters used can be found in the attached code. For GEOM-XL the same trained model was used; for GEOM-QM9 a new model with the same hyperparameters was trained. Torsional Boltzmann generators We start from a torsional diffusion model pre- trained on GEOM-DRUGS, and train for 250 epochs (6-9 days on a single GPU). A separate model is trained for every temperature. The resampling procedure with 5 95 050100150200Number of atoms0%5%10%15%20%25%Relative frequencyAtoms countDRUGSQM9XL020406080Number of rotatable bonds0%5%10%15%20%Relative frequencyRotatable bonds countDRUGSQM9XL steps is run for every molecule every max(5, ESS) epochs, where ESS is computed for the current set of 32 samples. The only hyperparameter tuned (at temperature 300K) is σmin, the noise level at which to stop the reverse diffusion process. We further improve the training procedure of torsional Boltzmann generators by implementing annealed training. The Boltzmann generator for some temperature T is trained at epoch k by using the Boltzmann distribution at temperature T ′ = T + (3000 − T )/k as the target distribution for that epoch. Intuitively, this trains the model at the start with a smoother distribution that is easier to learn, which gradually transforms into the desired distribution. D.1.3 Evaluation details Ensemble RMSD As evaluation metrics for conformer generation, [25] and follow- ing works have used the so-called Average Minimum RMSD (AMR) and Coverage (COV) for Precision (P) and Recall (R) measured when generating twice as many conformers as provided by CREST. For K = 2L let {C * l }l∈[1,L] and {Ck}k∈[1,K] be respectively the sets of ground truth and generated conformers: COV-R := AMR-R := 1 L 1 L ⃒ ⃒ ⃒ ⃒ {l ∈ [1..L] : ∃k ∈ [1..K], RMSD(Ck, C * l ) < δ ∑︁ l∈[1..L] min k∈[1..K] RMSD(Ck, C * l ) ⃒ ⃒ ⃒ ⃒ (D.1) where δ is the coverage threshold. The precision metrics are obtained by swapping ground truth and generated conformers. In the XL dataset, due to the size of the molecules, we compute the RMSDs without testing all possible symmetries of the molecules, therefore the obtained RMSDs are an upper bound, which we find to be very close in practice to the permutation-aware RSMDs. Runtime evaluation We benchmark the methods on CPU (Intel i9-9920X) to enable comparison with RDKit. The number of threads for RDKit, numpy, and torch is set to 8. We select 10 molecules at random from the GEOM-DRUGS test set and 96 generate 8 conformers per molecule using each method. Script loading and model loading times are not included in the reported values. Boltzmann generator To evaluate how well the torsional Boltzmann generator and the AIS baselines sample from the conditional Boltzmann distribution, we report their median effective sample size (ESS) [48] given the importance sampling weights wi of 32 samples for each molecule: ESS = )︀2 (︀ ∑︀32 i=1 wi i=1 w2 i ∑︀32 (D.2) This approximates the number of independent samples that would be needed from the target Boltzmann distribution to obtain an estimate with the same variance as the one obtained with the importance-weighted samples. For the baseline annealed importance samplers, the transition kernel is a single Metropolis-Hastings step with the wrapped normal distributions on Tm as the proposal. We run with a range of kernel variances: 0.25, 0.5, 0.3, 0.5, 0.75, 1, 1.5.2; and report the best result. We use an exponential annealing schedule; i.e., pn ∝ p1−n/N where p0 0 is the uniform distribution and pN is the target Boltzmann density. pn/N N D.2 Chapter 4: DiffDock In general, all our code is available at https://github.com/gcorso/DiffDock. This includes running the baselines, runtime calculations, training and inference scripts for DiffDock, the PDB files of DiffDock's predictions for all 363 complexes of the test set, and visualization videos of the reverse diffusion. D.2.1 Experimental Setup Data. We use the molecular complexes in PDBBind [61] that were extracted from the Protein Data Bank (PDB) [8]. We employ the time-split of PDBBind proposed by Stärk et al. [93] with 17k complexes from 2018 or earlier for training/validation 97 and 363 test structures from 2019 with no ligand overlap with the training com- plexes. This is motivated by the further adoption of the same split [62] and the critical assessment of PDBBind splits by Volkov et al. [99] who favor temporal splits over artificial splits based on molecular scaffolds or protein sequence/structure similarity. For completeness, we also report the results on protein sequence simi- larity splits in Appendix E.2.2. We download the PDBBind data as it is provided by EquiBind from https://zenodo.org/record/6408497. These files were prepro- cessed with Open Babel before adding any potentially missing hydrogens, correcting hydrogens, and correctly flipping histidines with the reduce library available at https://github.com/rlabduke/reduce. Metrics. To evaluate the generated complexes, we compute the heavy-atom RMSD between the predicted and the crystal ligand atoms when the protein structures are aligned. To account for permutation symmetries in the ligand, we use the symmetry- corrected RMSD of sPyRMSD [65]. For these RMSD values, we report the percentage of predictions that have an RMSD that is less than 2Å. We choose 2Å since much prior work considers poses with an RMSD less that 2Å as "good" or successful [1, 32, 64]. This is a chemically relevant metric, unlike the mean RMSD as detailed in Section 4.2 since for further downstream analyses such as determining function changes, a prediction is only useful below a certain RMSD error threshold. Less relevant metrics such as the mean RMSD are provided in Appendix E.2.2. D.2.2 Implementation details Training Details. We use Adam [46] as optimizer for the diffusion and the confi- dence model. The diffusion model with which we run inference uses the exponential moving average of the weights during training, and we update the moving average after every optimization step with a decay factor of 0.999. The batch size is 16. We run inference with 20 denoising steps on 500 validation complexes every 5 epochs and use the set of weights with the highest percentage of RMSDs less than 2Å as the final diffusion model. We trained our final score model on four 48GB RTX A6000 98 GPUs for 850 epochs (around 18 days). The confidence model is trained on a single 48GB GPU. For inference, only a single GPU is required. Scaling up the model size seems to improve performance and future work could explore whether this trend continues further. For the confidence model uses the validation cross-entropy loss is used for early stopping and training only takes 75 epochs. Code to reproduce all results including running the baselines or to perform docking calculations for new complexes is available at https://github.com/gcorso/DiffDock. Hyperparameters. For determining the hyperparameters of DiffDock's score model, we trained smaller models (3.97 million parameters) that fit into 48GB of GPU RAM before scaling it up to the final model (20.24 million parameters) that was trained on four 48GB GPUs. The smaller models were only trained for 250 or 300 epochs, and we used the fraction of predictions with an RMSD below 2Å on the validation set to choose the hyperparameters. Table D.1 shows the main hyperparameters we tested and the final parameters of the large model we use to obtain our results. We only did little tuning for the minimum and maximum noise levels of the three components of the diffusion. For the translation, the maximum standard deviation is 19Å. We also experimented with second-order features for the Tensor Field Network but did not find them to help. The complete set of hyperparameters next to the main ones we describe here can be found in our repository. From the start we have divided the inference schedule into 20 time steps, the effect of using more or fewer steps for inference is discussed in Appendix E.1.2. As we found that the large-scale diffusion models overfit the training data on low-levels of noise we stop the diffusion early after 18 steps. At the last diffusion step no noise is added. The confidence model has 4.77 million parameters and the parameters we tried are in Table D.2. We generate 28 different training poses for the confidence model (for which it predicts whether or not they have an RMSD below 2Å) with a small score model. The score model used to generate the training samples for the confidence model does not need to be the same one that the model will be applied to at inference time. 99 Table D.1: The hyperparameter options we searched through for DiffDock's score model. This was done with small models before scaling up to a large model. The parameters shown here that impact model size (bottom half of the table) are those of the large model. The final parameters for the large DiffDock model are marked in bold. Parameter Search Space using all atoms for the protein graph using language model embeddings using ligand hydrogens using exponential moving average maximum number of neighbors in protein graph maximum neighbor distance in protein graph distance embedding method dropout learning rates batch size non linearities Yes, No Yes, No Yes, No Yes, No 10, 16, 24, 30 5, 10, 15, 18, 20, 30 sinusoidal, gaussian 0, 0.05, 0.1, 0.2 0.01, 0.008, 0.003, 0.001, 0.0008, 0.0001 8, 16, 24 ReLU convolution layers number of scalar features number of vector features 6 48 10 Table D.2: The hyperparameter options we searched through for DiffDock's confi- dence model. The final parameters are marked in bold. Parameter Search Space using all atoms for the protein graph using language model embeddings using ligand hydrogens using exponential moving average maximum number of neighbors in protein graph maximum neighbor distance in protein graph distance embedding method dropout learning rates batch size non linearities Yes, No Yes, No No No 10, 16, 24, 30 5, 10, 15, 18, 20, 30 sinusoidal 0, 0.05, 0.1, 0.2 0.03, 0.003, 0.0003, 0.00008 16 ReLU convolution layers number of scalar features number of vector features 5 24 6 100 Runtime. Similar to all the baselines, the preprocessing times are not included in the reported runtimes. For DiffDock the preprocessing time is negligible compared to the rest of the inference time where multiple reverse diffusion steps are performed. Preprocessing mainly consists of a forward pass of ESM2 to generate the protein language model embeddings, RDKit's conformer generation, and the conversion of the protein into a radius graph. We measured the inference time when running on an RTX A100 40GB GPU when generating 10 samples. The runtimes we report for generating 40 samples and ranking them are extrapolations where we multiply the runtime for 10 samples by 4. In practice, this only gives an upper bound on the runtime with 40 samples, and the actual runtime should be faster. Statistical intervals and significance. In order to provide estimates about the variance of the performance measures reported, in Tables 4.1 and E.7 we report the standard deviation of the performance under 1000 independent resamples with replacement of the test set (bootstrapping). For determining the statistical significance of the superior performance of our method we used the paired two-sample t-test implemented in scipy [98]. For Autodock Vina, we took the results from Lu et al. [62], and therefore we were not able to run estimates of the intervals. D.2.3 Baselines details Our scripts to run the baselines are available at https://github.com/gcorso/ DiffDock. For obtaining the runtimes of the different methods, we always used 16 CPUs except for GLIDE as explained below. The runtimes do not include any preprocessing time for any of the methods. For instance, the time that it takes to run P2Rank is not included for TANKBind, and P2Rank + SMINA/GNINA since this receptor preparation only needs to be run once when docking many ligands to the same protein. In applications where different receptors are processed (such as reverse screening), the experienced runtimes for TANKBind and P2Rank + SMINA/GNINA will thus be higher. We note that for all these baselines we have used the default hyperparameters unless 101 specified differently below. Modifying some of these hyperparameters (for example the scoring method's exhaustiveness) will change the runtime and performance tradeoffs (e.g., if the searching routine is left running for longer then better poses are likely to be found), however, we leave these analyses to future work. SMINA [49] improves Autodock Vina with a new scoring-function and user-friendliness. The default parameters were used with the exception of setting –num_modes 10. To define the search box, we use the automatic box creation option around the receptor with the default buffer of 4Å on all 6 sides. GNINA [64] builds on SMINA by additionally using a learned 3D CNN for scoring. The default parameters were used with the exception of setting –num_modes 10. To define the search box, we use the automatic box creation option around the receptor with the default buffer of 4Å on all 6 sides. QuickVina-W [32] extends the speed-optimized QuickVina 2 [1] for blind docking. We reuse the numbers from Stärk et al. [93] which had used the default parameters except for increasing the exhaustiveness to 64. The files were preprocessed with the prepare_ligand4.py and prepare_receptor4.py scripts of the MGLTools library as it is recommended by the QuickVina-W authors. Autodock Vina [96] is older docking software that does not perform as well as the other more recent search-based baselines, but it is a well-established tool. We reuse the numbers reported in TANKBind [62] GLIDE [31] is a strong heavily used commercial docking tool. These methods all use biophysics based scoring-functions. We reuse the numbers from Stärk et al. [93] since we do not have a license. Running GLIDE involves running their command line tools for preprocessing the structures into the files required to run the docking algorithm. As explained by Stärk et al. [93], the very high runtime of GLIDE with 1405 seconds per complex is partially explained by the fact that GLIDE only uses a 102 single thread when processing a complex. This fact and the parallelization options of GLIDE are explained here https://www.schrodinger.com/kb/1165. With GLIDE, it is possible to start data-parallel processes that compute the docking results for a different complex in parallel. However, each process also requires a separate software license. EquiBind [93], we reuse the numbers reported in their paper and generate the predictions that we visualize with their code at https://github.com/HannesStark/ EquiBind. TANKBind [62], we use the code associated with the paper at https://github. com/luwei0917/TankBind. The runtimes do not include the runtime of P2Rank or any preprocessing steps. In Table 4.1 we report two runtimes (0.72/2.5 sec). The first is the runtime when making only the top-1 prediction and the second is for producing the top-5 predictions. Producing only the top-1 predictions is faster since TANKBind produces distance predictions that need to be converted to coordinates with a gradient descent algorithm and this step only needs to be run once for the top-1 prediction, while it needs to be run 5 times for producing 5 outputs. To obtain our runtimes we run the forward pass of TANKBind on GPU (0.28 seconds) with the default batch size of 5 that is used in their GitHub repository. To compute the time the distances-to-coordinates conversion step takes, we run the file baseline_run_tankbind_parallel.sh in our repository, which parallelizes the computation across 16 processes which we also run on an Intel Xeon Gold 6230 CPU. This way, we obtain 0.44 seconds runtime for the conversion step of the top-1 prediction (averaged over the 363 complexes of the testset). P2Rank [52], is a tool that predicts multiple binding pockets and ranks them. We use it for running TANKBind and P2Rank + SMINA/GNINA. We download the program from https://github.com/rdk/p2rank and run it with its default parameters. 103 EquiBind + SMINA/GNINA [93], the bounding box in which GNINA/SMINA searches for binding poses is constructed around the prediction of EquiBind with the –autobox_ligand option of GNINA/SMINA. EquiBind is thus used to find the binding pocket and SMINA/GNINA to find the exact final binding pose. We use –autobox_add 10 to add an additional 10Å on all 6 sides of the bounding box following [93]. P2Rank + SMINA/GNINA. The bounding box in which GNINA/SMINA searches for binding poses is constructed around the pocket center that P2Rank predicts as the most likely binding pocket. P2Rank is thus used to find the binding pocket and SMINA/GNINA to find the exact final binding pose. The diameter of the search box is the diameter of a ligand conformer generated by RDKit with an additional 10Å on all 6 sides of the bounding box. 104 Appendix E Further Results E.1 Chapter 3: Torsional Diffusion E.1.1 Small molecules ensemble RMSD We also train and evaluate our model on the small molecules from GEOM-QM9 and report the performance in Table E.1. For these smaller molecules, cheminformatics methods already do very well and, given the very little flexibility and few rotatable bonds present, the accuracy of local structure significantly impacts the performance of torsional diffusion. RDKit achieves a mean recall AMR just over 0.23Å, while torsional diffusion based on RDKit local structures results in a mean recall AMR of 0.178Å. This is already very close lower bound of 0.17Å that can be achieved with RDKit local structures (as approximately calculated by conformer matching). Torsional diffusion does significantly better than other ML methods, but is only on par with or slightly worse than OMEGA, which, evidently, has a better local structures for these small molecules. E.1.2 Ablation experiments In Table E.2 we present a set of ablation studies to evaluate the importance of different components of the proposed torsional diffusion method: 105 Table E.1: Performance of various methods on the GEOM-QM9 dataset test-set (δ = 0.5Å). Again GeoDiff was retrained on the splits from [25]. Recall Precision Coverage ↑ AMR ↓ Coverage ↑ AMR ↓ Mean Med Mean Med Mean Med Mean Med 85.1 85.5 91.5 76.5 0.199 0.235 100.0 100.0 0.177 0.126 0.193 0.225 100.0 0.229 0.297 100.0 86.8 82.9 86.7 50.0 100.0 100.0 100.0 33.5 0.232 0.224 0.270 0.524 0.205 0.186 0.241 0.510 0.195 Torsional diffusion 92.8 100.0 0.178 0.147 92.7 100.0 0.221 Method RDKit OMEGA GeoMol GeoDiff 1. Baseline refers to the model described and tested throughout the paper. 2. First order irreps refers to the same model but with node irreducible representa- tions kept only until order l = 1 instead of l = 2; this worsens the average error by about 5%, but results in a 41% runtime speed-up. 3. Only D.E. matching refers to a model trained on conformers obtained by a ran- dom assignment of RDKit local structures to ground truth conformers (without first doing an optimal assignment as in Appendix B.1.2); this performs only marginally worse than full conformer matching. 4. Train on ground truth L refers to a model trained directly on the ground truth conformers without conformer matching but tested (as always) on RDKit local structures; although the training and validation score matching loss of this model is significantly lower, its inference performance reflects the detrimental effect of the local structure distributional shift. 5. No parity equivariance refers to a model whose outputs are parity invariant instead of parity equivariant; the model cannot distinguish a molecule from its mirror image and fails to learn, resulting in performance on par with a random baseline. 6. Random τ refers to a random baseline using RDKit local structures and uniformly random torsion angles. 106 Table E.2: Ablation studies tested on conformer generation on GEOM-DRUGS. Refer to Appendix E.1.2 for an explanation of each entry. Recall Precision Method Baseline First order irreps Only D.E. matching Train on ground truth L No parity equivariance Random τ Coverage ↑ Mean Med Mean Med Mean Med Mean Med Coverage ↑ AMR ↓ AMR ↓ 80.0 77.9 81.1 22.4 12.5 72.7 70.1 72.5 34.8 30.5 30.9 0.582 0.565 55.2 56.9 0.778 0.729 0.605 0.588 0.920 0.928 0.589 0.569 0.909 0.929 51.4 53.8 22.3 17.9 18.2 51.4 56.1 7.8 3.9 0.817 0.794 1.182 1.234 0.783 0.749 1.136 1.217 4.0 1.228 1.217 13.2 0.922 0.923 E.1.3 Ensemble properties In Table E.3, we report the median absolute errors of the Boltzmann-weighted proper- ties of the generated vs CREST ensembles, with and without GFN2-xTB relaxation. For all methods, the errors without relaxation are far too large for the computed properties to be chemically useful-for reference, the thermal energy at room temper- ature is 0.59 kcal/mol. In realistic settings, relaxation of local structures is necessary for any method, after which errors from global flexibility become important. After relaxation, torsional diffusion obtains property approximations on par or better than all competing methods. Table E.3: Median absolute error of generated v.s. ground truth ensemble properties with and without relaxation. E, ∆ε, Emin in kcal/mol, μ in debye. Without relaxation With relaxation Method μ E ∆ε 1.40 39.08 Emin 39.14 RDKit OMEGA 16.47 0.78 3.25 16.45 43.68 GeoMol 19.43 GeoDiff 36.94 Tor. Diff. 43.27 18.82 36.91 7.36 4.96 4.93 1.22 1.34 0.92 5.04 E 0.81 0.68 0.42 0.31 0.22 μ 0.52 0.66 0.34 0.35 0.35 ∆ε Emin 1.16 0.75 0.69 0.68 0.40 0.59 0.39 0.89 0.54 0.13 107 E.2 Chapter 4: DiffDock E.2.1 Physically plausible predictions Table E.4: Steric clashes. Percentage of test complexes for which the predictions of the different methods exhibit steric clashes. Search-based methods never produced steric clashes. Method EquiBind TANKBind DiffDock (10) DiffDock (40) Top-1 Top-5 % steric clashes % steric clashes 26 6.6 2.8 2.2 - 3.6 0 2.2 Due to the averaging phenomenon of regression-based methods such as TANKBind and EquiBind, they make predictions at the mean of the distribution. If aleatoric uncertainty is present, such as in case of symmetric complexes, this leads to predicting the ligand to be at an un-physical state in the middle of the possible binding pockets as visualized in Figure E-6. The Figure also illustrates how DiffDock does not suffer from this issue and is able to accurately sample from the modes. In the scenario when epistemic uncertainty about the correct ligand conformation is present, this often results in "squashed-up" predictions of the regression-based methods as visualized in Figure E-1. If there is uncertainty about the correct conformer, the square error minimizing option is to put all atoms close to the mean. These averaging phenomena in the presence of either aleatoric or epistemic un- certainty cause the regression-based methods to often generate steric clashes and self intersections. To investigate this quantitatively, we determine the fraction of test complexes for which the methods exhibit steric clashes. We define a ligand as exhibiting a steric clash if one of its heavy atoms is within 0.4Å of a heavy receptor atom. This cutoff is used by protein quality assessment tools and in previous literature [80]. Table E.4 shows that DiffDock, as a generative model, produces fewer steric clashes than the regression-based baselines. We generally observe no unphysical pre- 108 Figure E-1: Ligand self-intersections. TANKBind (blue), EquiBind (cyan), Diff- Dock (red), and crystal structure (green). Due to the averaging phenomenon that occurs when epistemic uncertainty is present, the regression-based deep learning models tend to produce ligands with atoms that are close together, leading to self-intersections. DiffDock, as a generative model, does not suffer from this averaging phenomenon, and we never found a self-intersection in any of the investigated results of DiffDock. dictions from DiffDock unlike the self intersections that, e.g., TANKBind produces (Figure E-1) or its incorrect local structures (Figure E-2). This is also visible in the randomly chosen examples of Figure E-5 and can be examined in our repository, where we provide all predictions of DiffDock for the test set. E.2.2 Further Results and Metrics In this section, we present further evaluation metrics on the results presented in Table 4.1. In particular, for both top-1 (Table E.5) and top-5 (Table E.6) we report: 109 Figure E-2: Chemically plausible local structures. TANKBind (blue), EquiBind (cyan), and DiffDock (red) structures for complex 6g2f. EquiBind (without their correction step) produces very unrealistic local structures and TANKBind, e.g., pro- duces non-planar aromatic rings. DiffDock's local structures are the realistic local structures of RDKit. 25th, 50th and 75th percentiles, the proportion below 2Å and below 5Å of both ligand RMSD and centroid distance. Moreover, while Volkov et al. [99] advocated against artificial protein set splits and for time-based splits, for completeness, in Table E.7 and Figure E-3, we report the performances of the different methods when evaluated exclusively on the portion of the test set where the UniProt IDs of the proteins are not contained in the data that is seen by DiffDock in its training and validation. Table E.5: Top-1 PDBBind docking. Ligand RMSD Centroid Distance Methods 25th 50th 75th Percentiles ↓ % below threshold ↑ 5 Å Percentiles ↓ 2 Å 25th 50th 75th Autodock Vina QVina-W GNINA SMINA GLIDE (c.) EquiBind 5.7 2.5 2.4 3.1 2.6 3.8 TANKBind 2.5 P2Rank+SMINA 2.9 P2Rank+GNINA 1.7 EquiBind+SMINA 2.4 EquiBind+GNINA 1.8 DiffDock (10) DiffDock (40) 1.5 1.4 10.7 7.7 7.7 7.1 9.3 6.2 4.0 6.9 5.5 6.5 4.9 3.6 3.3 21.4 23.7 17.9 17.9 28.1 10.3 8.5 16.0 15.9 11.2 13 7.1 7.3 21.2 40.2 40.8 38.0 33.6 39.1 59.0 43.0 47.8 43.6 50.3 5.5 20.9 22.9 18.7 21.8 5.5 20.4 20.4 28.8 23.2 28.8 1.9 0.9 0.8 1.0 0.8 1.3 0.9 0.8 0.6 0.7 0.6 6.2 3.7 3.7 2.6 5.6 2.6 1.8 2.6 2.2 2.1 1.9 61.7 35.0 63.2 38.2 0.5 0.5 1.2 1.2 20.1 22.9 23.1 16.1 26.9 7.4 4.4 14.8 14.6 7.3 9.9 3.3 3.2 110 % below thresh. ↑ 2 Å 5 Å 47.1 54.6 53.6 59.8 48.7 67.5 77.1 60.1 60.9 69.3 66.5 26.5 41.0 40.2 41.6 36.1 40.0 55.1 44.1 48.3 49.2 50.8 80.7 80.5 63.1 64.5 Table E.6: Top-5 PDBBind docking. Ligand RMSD Centroid Distance Percentiles ↓ 25th 50th 75th % below threshold ↑ 5 Å Percentiles ↓ 2 Å 25th 50th 75th Methods GNINA SMINA 1.6 1.7 TANKBind 2.1 P2Rank+SMINA 1.5 P2Rank+GNINA 1.4 EquiBind+SMINA 1.3 EquiBind+GNINA 1.4 DiffDock (10) DiffDock (40) 1.2 1.2 4.5 4.6 3.4 4.4 3.4 3.4 3.1 2.7 2.4 11.8 9.7 6.1 14.1 12.5 8.1 9.1 4.9 5.0 52.8 53.1 67.5 54.8 60.3 60.6 61.7 29.3 29.3 24.5 33.2 38.3 38.6 39.1 40.7 75.1 75.5 44.7 0.6 0.6 0.8 0.6 0.5 0.5 0.5 0.5 0.4 2.0 1.85 1.4 1.8 1.4 1.3 1.1 1.0 0.9 8.2 6.2 2.9 12.3 9.2 5.1 5.3 2.2 1.9 % below thresh. ↑ 2 Å 5 Å 66.8 72.9 86.8 66.2 69.3 74.9 73.7 49.7 50.8 62.0 53.4 57.3 58.9 60.1 72.3 87.0 88.0 76.7 Figure E-3: PDBBind docking on unseen receptors. Left: cumulative density histogram of the methods' RMSD. Right: Percentage of predictions with RMSD below 2Å when only making predictions for the portion of the dataset where DiffDock is most confident. E.2.3 Ablation studies Below we report the performance of our method over different hyperparameter settings. In particular, we highlight the different ways in which it is possible to control the tradeoff between runtime and accuracy in our method. These mainly are: (1) model size, (2) diffusion time, and (3) diffusion samples. 111 0123450.10.20.30.40.50.60.7DiffDockGLIDEGNINASMINAQVinaWTANKBindEquiBindRMSD (Å)Fraction with lower RMSD0204060800.20.40.60.81Baseline performancePerfect selectionConfidence modelPercentage of rejected complexesFraction with RMSD < 2Å Table E.7: PDBBind docking on unseen receptors. Percentage of predictions for which the RMSD to the crystal structure is below 2Å and the median RMSD. "*" indicates the method run exclusively on CPU, "-" means not applicable; some cells are empty due to infrastructure constraints. Top-1 RMSD Med. %<2 Top-5 RMSD Med. %<2 Average Runtime (s) Method Autodock Vina QVinaW GNINA SMINA GLIDE EquiBind TANKBind 1.4 15.3±2.9 14.0±2.9 14.0±2.9 19.6±3.3 0.7±0.7 6.3±2.0 16.6 10.3±2.3 13.6±2.6 8.5±2.6 18.0±3.9 9.1±0.6 5.0±0.2 23.0±3.5 21.7±3.5 7.0±1.1 6.7±0.7 - 11.1±2.6 - 4.4±0.3 DiffDock (10) DiffDock (40) 15.7±3.1 20.8±3.3 6.1±0.7 6.2±0.8 21.8±3.3 4.2±0.4 28.7±3.6 3.9±0.4 205* 49* 127 126* 1405* 0.04 0.7/2.5 10 40 Model size. The final DiffDock score model has 20.24 million parameters from its 6 convolution layers with 48 scalar and 10 vector features. In Table E.8 we show the results for a smaller score model with 5 convolutions, 24 scalar, and 6 vector features resulting in 3.97 million parameters that can be trained on a single 48GB GPU. The confidence model used is the same for both score models. We find that scaling up the model size helped improve performance which we did as far as possible using four 48GB GPUs for training. Scaling the model size further is a promising avenue for future work. Protein embeddings. As described in Appendix B.1.1, the architecture uses as initial features of protein residues the language model embeddings from ESM2 [60] in order for the model to more easily reason about the protein sequence. In Table E.8 we show that while these provide some improvements they are not necessary to obtain state-of-the-art performance. Diffusion steps. Another hyperparameter determining the runtime of the method during inference is the number of steps we take during the reverse diffusion. Since these are applied sequentially DiffDock's runtime scales approximately linearly with 112 Table E.8: Model size and protein embeddings comparison. All methods receive a small molecule and are tasked to find its binding location, orientation, and conformation. Shown is the percentage of predictions for which the RMSD to the crystal structure is below 2Å and the median RMSD. Method DiffDock-small-noESM (10) DiffDock-small-noESM (40) DiffDock-small (10) DiffDock-small (40) DiffDock-noESM (10) DiffDock-noESM (40) DiffDock (10) DiffDock (40) Top-1 RMSD (Å) Top-5 RMSD (Å) %<2 Med. Med. %<2 Average Runtime (s) 26.2 28.4 26.0 31.1 33.9 34.2 35.0 38.2 4.7 3.8 4.3 4.0 3.8 3.5 3.6 3.3 32.0 37.7 33.3 38.0 39.4 42.7 40.7 44.7 3.2 2.6 3.2 2.7 2.8 2.4 2.7 2.4 7 28 7 28 10 40 10 40 the number of diffusion steps. In the rest of the paper, we always use 20 steps, but in Figure E-4 we show how the performance of the model varies with the number of steps. We note that the model reaches nearly the full performance even with just 10 steps, suggesting that the model can be sped up 2x with a small drop in accuracy. Figure E-4: Ablation study on the number of reverse diffusion steps. 113 010203040506000.10.20.30.40.5Top-1 performanceTop-5 performanceTop-10 performanceNumber of reverse diffusion stepsFraction with RMSD < 2Å Diffusion samples. Given a score-based model and a number of steps for the diffusion model, it remains to be determined how many independent samples N to query from the diffusion model and then feed to the confidence model. As expected the more samples the confidence model receives the more likely it is that it will find a pose that it is confident about and, therefore, the higher the performance. The runtime of DiffDock on GPU scales sublinearly until the different samples fit in parallel in the model (depends on the protein size and the GPU memory) and approximately linearly for larger sample sizes (however it can be easily parallelized across different GPUs). In Figure 4-3 we show how the success rate for the top-1, top-5, and top-10 prediction change as a function of N . For example, for the top-1 prediction, the proportion of the prediction with RMSD below 2Å varies between 22% of a random sample of the diffusion model (N = 1) to 38% when the confidence model is allowed to choose between 40 samples. E.2.4 Affinity prediction To validate the quality of the predicted poses, we also do some experiments in predicting the binding affinity labels already present in PDBBind. In this section we report some preliminary results on this task that show that a simple approach can already achieve results competitive with the state-of-the-art. We leave a more thorough and sophisticated analysis on how to best use the DiffDock framework for binding affinity to future work. Affinity prediction framework. We train the binding affinity predictor by gen- erating a fixed number of poses with the diffusion model and then feeding them to an affinity prediction model with architecture almost analogous to the confidence model. This affinity prediction model takes in the poses as a single heterogeneous graph with a single receptor but multiple sets of ligand nodes, which have edges to the same receptor but not among themselves. After the final interaction layer, the scalar representations of nodes in each ligand are aggregated with a mean pooling and passed through a set of dense layers (as it is done for the confidence prediction). Then, 114 the representations of the different ligands are aggregated using multiple permutation invariant aggregators (mean, maximum, minimum, and standard deviation) as in Corso et al. [16], and transformed with another set of dense layers producing a single output, the predicted affinity. Dataset, baselines, and training. To train we use PDBBind with the same splits used to train the diffusion and confidence models. This provides for each of the complexes an affinity measure that consists of inhibiting concentration (IC50), inhibition constant (Ki), or dissociation constant (Kd) and its conversion to the − log Kd/Ki metric. As baselines, we use a series of state-of-the-art sequence-based and structure-based methods: TransformerCPI [13], MONN [59], IGN [40], PIGNet [70], HOLOPTOT [89], STAMPDPI [100] and TANKBind [62]. We take the baselines' performances from Lu et al. [62]. Table E.9: Binding affinity prediction. Prediction of − log Kd/Ki on PDBBind. The baseline numbers are from Lu et al. [62]. No hyperparameter tuning was performed for DiffDock's performance. Methods RMSE ↓ Pearson ↑ Spearman ↑ MAE ↓ TransCPI MONN PIGNet IGN HOLOPROT STAMPDPI TANKBind DiffDock 1.741 1.438 2.640 1.433 1.546 1.658 1.346 1.347 0.576 0.624 0.511 0.698 0.602 0.545 0.726 0.692 0.540 0.589 0.489 0.641 0.571 0.411 0.703 1.404 1.143 2.110 1.169 1.208 1.325 1.070 0.718 1.052 Results. The results presented in Table E.9 highlight how even preliminary results with a straightforward way of using DiffDock's predictions for affinity prediction achieve a performance that is on par with the state-of-the-art. We hope this can motivate future work on better integrating affinity prediction in the method and scaling to larger amounts of data. 115 E.2.5 Visualizations 116 Figure E-5: Randomly picked examples. The predictions of TANKBind (blue), EquiBind (cyan), GNINA (magenta), DiffDock (red), and crystal structure (green). Shown are the predictions once with the protein and without it below. The complexes were chosen with a random number generator from the test set. TANKBind often produces self intersections (examples at the top-right; middle-middle; middle-right; bottom-right). DiffDock and GNINA sometimes almost perfectly predict the bound structure (e.g., top-middle). The complexes in reading order are: 6p8y, 6mo8, 6pya, 6t6a, 6e30, 6hld, 6qzh, 6hhg, 6qln. 117 Figure E-6: Symmetric complexes and multiple modes. EquiBind (cyan), DiffDock highest confidence sample (red), all other DiffDock samples (orange), and the crystal structure (green). We see that, since it is a generative model, DiffDock is able to produce multiple correct modes and to sample around them. Meanwhile, as a regression-based model, EquiBind is only able to predict a structure at the mean of the modes. The complexes are unseen during training. The PDB IDs in reading order: 6agt, 6gdy, 6ckl, 6dz3. 118 Figure E-7: Reverse Diffusion. Reverse diffusion of a randomly picked complex from the test set. Shown are DiffDock highest confidence sample (red), all other DiffDock samples (orange), and the crystal structure (green). Shown are the 20 steps of the reverse diffusion process (in reading order) of DiffDock for the complex 6oxx. Videos of the reverse diffusion are available at https://github.com/gcorso/ DiffDock. 119 Bibliography [1] Amr Alhossary, Stephanus Daniel Handoko, Yuguang Mu, and Chee-Keong Kwoh. Fast, accurate, and reliable molecular docking with QuickVina 2. Bioinformatics, 2015. [2] Brian DO Anderson. Reverse-time diffusion equation models. Stochastic Pro- cesses and their Applications, 1982. [3] Simon Axelrod and Rafael Gómez-Bombarelli. Geom, energy-annotated molecu- lar conformations for property prediction and molecular generation. Scientific Data, 2022. [4] Christoph Bannwarth, Sebastian Ehlert, and Stefan Grimme. Gfn2-xtb-an accurate and broadly parametrized self-consistent tight-binding quantum chem- ical method with multipole electrostatics and density-dependent dispersion contributions. Journal of chemical theory and computation, 2019. [5] Fan Bao, Chongxuan Li, Jun Zhu, and Bo Zhang. Analytic-dpm: an analytic estimate of the optimal reverse variance in diffusion probabilistic models. ArXiv preprint, 2022. [6] Simon Batzner, Albert Musaelian, Lixin Sun, Mario Geiger, Jonathan P Mailoa, Mordechai Kornbluth, Nicola Molinari, Tess E Smidt, and Boris Kozinsky. E (3)-equivariant graph neural networks for data-efficient and accurate interatomic potentials. Nature communications, 2022. [7] Nathaniel Bennett, Brian Coventry, Inna Goreshnik, Buwei Huang, Aza Allen, Dionne Vafeados, Ying Po Peng, Justas Dauparas, Minkyung Baek, Lance Stewart, et al. Improving de novo protein binder design with deep learning. bioRxiv, 2022. [8] H. Berman, K. Henrick, and H. Nakamura. Announcing the worldwide Protein Data Bank. Nat Struct Biol, 2003. [9] Evan E Bolton, Sunghwan Kim, and Stephen H Bryant. Pubchem3d: conformer generation. Journal of cheminformatics, 2011. [10] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda 120 Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 2020. [11] Richard H Byrd, Peihuang Lu, Jorge Nocedal, and Ciyou Zhu. A limited memory algorithm for bound constrained optimization. SIAM Journal on scientific computing, 1995. [12] Sean M Carroll. Spacetime and geometry. Cambridge University Press, 2019. [13] Lifan Chen, Xiaoqin Tan, Dingyan Wang, Feisheng Zhong, Xiaohong Liu, Tianbiao Yang, Xiaomin Luo, Kaixian Chen, Hualiang Jiang, and Mingyue Zheng. Transformer cpi: improving compound–protein interaction prediction by sequence-based deep learning with self-attention mechanism and label reversal experiments. Bioinformatics, 2020. [14] Gregory S Chirikjian. Stochastic models, information theory, and Lie groups, volume 2: Analytic methods and modern applications. Springer Science & Business Media, 2011. [15] Jason C Cole, Oliver Korb, Patrick McCabe, Murray G Read, and Robin Taylor. Knowledge-based conformer generation using the cambridge structural database. Journal of Chemical Information and Modeling, 2018. [16] Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Liò, and Petar Veličković. Principal neighbourhood aggregation for graph nets. Advances in Neural Information Processing Systems, 2020. [17] Gabriele Corso, Hannes Stärk, Bowen Jing, Regina Barzilay, and Tommi Jaakkola. Diffdock: Diffusion steps, twists, and turns for molecular docking. International Conference on Learning Representations, 2023. [18] D t Cremer and JA Pople. General definition of ring puckering coordinates. Journal of the American Chemical Society, 1975. [19] David F Crouse. On implementing 2d rectangular assignment algorithms. IEEE Transactions on Aerospace and Electronic Systems, 2016. [20] Ian W Davis, W Bryan Arendall III, David C Richardson, and Jane S Richardson. The backrub motion: how protein backbone shrugs when a sidechain dances. Structure, 2006. [21] Valentin De Bortoli, Emile Mathieu, Michael Hutchinson, James Thornton, Yee Whye Teh, and Arnaud Doucet. Riemannian score-based generative modeling. Advances in Neural Information Processing Systems, 2022. [22] Prafulla Dhariwal and Alex Nichol. Diffusion models beat gans on image synthesis. In Advances in Neural Information Processing Systems, 2021. 121 [23] Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016. [24] Edward M Driggers, Stephen P Hale, Jinbo Lee, and Nicholas K Terrett. The exploration of macrocycles for drug discovery-an underexploited structural class. Nature Reviews Drug Discovery, 2008. [25] Octavian Ganea, Lagnajit Pattanaik, Connor Coley, Regina Barzilay, Klavs Jensen, William Green, and Tommi Jaakkola. Geomol: Torsional geometric generation of molecular 3d conformer ensembles. Advances in Neural Information Processing Systems, 2021. [26] Mario Geiger and Tess Smidt. e3nn: Euclidean neural networks. arXiv preprint, 2022. [27] Mario Geiger, Tess Smidt, Alby M., Benjamin Kurt Miller, Wouter Boomsma, Bradley Dice, Kostiantyn Lapchevskyi, Maurice Weiler, Michał Tyszkiewicz, Simon Batzner, Martin Uhrin, Jes Frellsen, Nuri Jung, Sophia Sanborn, Josh Rackers, and Michael Bailey. Euclidean neural networks: e3nn, 2020. [28] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. MIT press, 2016. [29] 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, 2020. [30] Thomas A Halgren. Merck molecular force field. i. basis, form, scope, param- eterization, and performance of mmff94. Journal of computational chemistry, 1996. [31] Thomas A Halgren, Robert B Murphy, Richard A Friesner, Hege S Beard, Leah L Frye, W Thomas Pollard, and Jay L Banks. Glide: a new approach for rapid, accurate docking and scoring. 2. enrichment factors in database screening. Journal of medicinal chemistry, 2004. [32] Nafisa M. Hassan, Amr A. Alhossary, Yuguang Mu, and Chee-Keong Kwoh. Protein-ligand blind docking using quickvina-w with inter-process spatio- temporal integration. Scientific Reports, 2017. [33] Paul CD Hawkins. Conformation generation: the state of the art. Journal of Chemical Information and Modeling, 2017. [34] Paul CD Hawkins and Anthony Nicholls. Conformer generation with omega: learning from the data set and the analysis of failures. Journal of chemical information and modeling, 2012. 122 [35] Paul CD Hawkins, A Geoffrey Skillman, Gregory L Warren, Benjamin A Elling- son, and Matthew T Stahl. Conformer generation with omega: algorithm and validation using high quality structures from the protein databank and cambridge structural database. Journal of chemical information and modeling, 2010. [36] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 2020. [37] Emiel Hoogeboom, Victor Garcia Satorras, Clement Vignac, and Max Welling. Equivariant diffusion for molecule generation in 3d. In International Conference on Machine Learning, 2022. [38] Michael F Hutchinson. A stochastic estimator of the trace of the influence matrix for laplacian smoothing splines. Communications in Statistics-Simulation and Computation, 1989. [39] John Ingraham, Max Baranov, Zak Costello, Vincent Frappier, Ahmed Ismail, Shan Tie, Wujie Wang, Vincent Xue, Fritz Obermeyer, Andrew Beam, et al. Illuminating protein space with a programmable generative model. bioRxiv, 2022. [40] Dejun Jiang, Chang-Yu Hsieh, Zhenxing Wu, Yu Kang, Jike Wang, Ercheng Wang, Ben Liao, Chao Shen, Lei Xu, Jian Wu, et al. Interactiongraphnet: A novel and efficient deep graph representation learning framework for accurate protein–ligand interaction predictions. Journal of medicinal chemistry, 2021. [41] Bowen Jing, Gabriele Corso, Renato Berlinghieri, and Tommi Jaakkola. Subspace diffusion generative models. European Conference on Computer Vision, 2022. [42] Bowen Jing, Gabriele Corso, Jeffrey Chang, Regina Barzilay, and Tommi Jaakkola. Torsional diffusion for molecular conformer generation. Advances in Neural Information Processing Systems, 2022. [43] Bowen Jing, Stephan Eismann, Patricia Suriana, Raphael John Lamarre Town- shend, and Ron Dror. Learning from protein structure with geometric vector perceptrons. In International Conference on Learning Representations, 2021. [44] Alexia Jolicoeur-Martineau, Ke Li, Rémi Piché-Taillefer, Tal Kachman, and Ioannis Mitliagkas. Gotta go fast when generating data with score-based models. ArXiv preprint, 2021. [45] John Jumper, Richard Evans, Alexander Pritzel, Tim Green, Michael Figurnov, Olaf Ronneberger, Kathryn Tunyasuvunakool, Russ Bates, Augustin Žídek, Anna Potapenko, et al. Highly accurate protein structure prediction with alphafold. Nature, 2021. [46] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference for Learning Representations, 2015. 123 [47] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. [48] Leslie Kish. Survey sampling. 1965. [49] David Ryan Koes, Matthew P Baumgartner, and Carlos J Camacho. Lessons learned in empirical scoring with smina from the csar 2011 benchmarking exercise. Journal of chemical information and modeling, 2013. [50] Jonas Köhler, Andreas Krämer, and Frank Noé. Smooth normalizing flows. Advances in Neural Information Processing Systems, 2021. [51] Zhifeng Kong and Wei Ping. On fast sampling of diffusion probabilistic models. In ICML Workshop on Invertible Neural Networks, Normalizing Flows, and Explicit Likelihood Models, 2021. [52] Radoslav Krivák and David Hoksza. P2rank: machine learning based tool for rapid and accurate prediction of ligand binding sites from protein structure. Journal of cheminformatics, 2018. [53] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 2017. [54] David Lagorce, Tania Pencheva, Bruno O Villoutreix, and Maria A Miteva. Dg-ammos: A new tool to generate 3d conformation of small molecules using d istance g eometry and a utomated m olecular m echanics o ptimization for in silico s creening. BMC Chemical Biology, 2009. [55] Max WY Lam, Jun Wang, Dan Su, and Dong Yu. Bddm: Bilateral denoising diffusion models for fast and high-quality speech synthesis. In International Conference on Learning Representations, 2021. [56] Greg Landrum et al. Rdkit: A software suite for cheminformatics, computational chemistry, and predictive modeling, 2013. [57] Adam Leach, Sebastian M Schmon, Matteo T Degiacomi, and Chris G Willcocks. Denoising diffusion probabilistic models on so(3) for rotational alignment. In ICLR 2022 Workshop on Geometrical and Topological Representation Learning, 2022. [58] Jiabo Li, Tedman Ehlers, Jon Sutter, Shikha Varma-O'Brien, and Johannes Kirchmair. Caesar: a new conformer generation algorithm based on recursive buildup and local rotational symmetry consideration. Journal of chemical information and modeling, 2007. [59] Shuya Li, Fangping Wan, Hantao Shu, Tao Jiang, Dan Zhao, and Jianyang Zeng. Monn: a multi-objective neural network for predicting compound-protein interactions and affinities. Cell Systems, 2020. 124 [60] Zeming Lin, Halil Akin, Roshan Rao, Brian Hie, Zhongkai Zhu, Wenting Lu, Allan dos Santos Costa, Maryam Fazel-Zarandi, Tom Sercu, Sal Candido, and Alexander Rives. Language models of protein sequences at the scale of evolution enable accurate structure prediction. arXiv, 2022. [61] Zhihai Liu, Minyi Su, Li Han, Jie Liu, Qifan Yang, Yan Li, and Renxiao Wang. Forging the basis for developing protein–ligand interaction scoring functions. Accounts of Chemical Research, 2017. [62] Wei Lu, Qifeng Wu, Jixian Zhang, Jiahua Rao, Chengtao Li, and Shuangjia Zheng. Tankbind: Trigonometry-aware neural networks for drug-protein binding structure prediction. Advances in neural information processing systems, 2022. [63] Shitong Luo, Chence Shi, Minkai Xu, and Jian Tang. Predicting molecular conformation via dynamic graph score matching. Advances in Neural Information Processing Systems, 2021. [64] Andrew T McNutt, Paul Francoeur, Rishal Aggarwal, Tomohide Masuda, Rocco Meli, Matthew Ragoza, Jocelyn Sunseri, and David Ryan Koes. Gnina 1.0: molecular docking with deep learning. Journal of cheminformatics, 2021. [65] Rocco Meli and Philip C. Biggin. spyrmsd: symmetry-corrected rmsd calculations in python. Journal of Cheminformatics, 2020. [66] Oscar Méndez-Lucio, Mazen Ahmad, Ehecatl Antonio del Rio-Chanona, and Jörg Kurt Wegner. A geometric deep learning approach to predict binding conformations of bioactive molecules. Nature Machine Intelligence, 2021. [67] Oscar Méndez-Lucio, Mazen Ahmad, Ehecatl Antonio del Rio-Chanona, and Jörg Kurt Wegner. A geometric deep learning approach to predict binding conformations of bioactive molecules. Nature Machine Intelligence, 2021. [68] Laurence Illing Midgley, Vincent Stimper, Gregor NC Simm, and José Miguel Hernández-Lobato. Bootstrap your flow. arXiv preprint, 2021. [69] Maria A Miteva, Frederic Guyon, and Pierre Tuffery. Frog2: Efficient 3d conformation ensemble generator for small compounds. Nucleic acids research, 2010. [70] Seokhyun Moon, Wonho Zhung, Soojung Yang, Jaechang Lim, and Woo Youn Kim. Pignet: a physics-informed deep learning model toward generalized drug– target interaction predictions. Chemical Science, 2022. [71] J Moult, K Fidelis, A Kryshtafovych, T Schwede, and M Topf. Critical assessment of techniques for protein structure prediction, fourteenth round. CASP 14 Abstract Book. [72] Radford M Neal. Annealed importance sampling. Statistics and computing, 2001. 125 [73] Marco Necci, Damiano Piovesan, and Silvio CE Tosatto. Critical assessment of protein intrinsic disorder prediction. Nature methods, 2021. [74] Alex Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. In International Conference on Machine Learning, 2021. [75] Dmitry I Nikolayev and Tatjana I Savyolov. Normal distribution on the rotation group so (3). Textures and Microstructures, 1970. [76] Frank Noé, Simon Olsson, Jonas Köhler, and Hao Wu. Boltzmann generators: Sampling equilibrium states of many-body systems with deep learning. Science, 2019. [77] Nataraj S Pagadala, Khajamohiddin Syed, and Jack Tuszynski. Software for molecular docking: a review. Biophysical reviews, 2017. [78] Philipp Pracht, Fabian Bohle, and Stefan Grimme. Automated exploration of the low-energy chemical space with fast quantum chemical methods. Physical Chemistry Chemical Physics, 2020. [79] Martin Quack. How important is parity violation for molecular and biomolecular chirality? Angewandte Chemie International Edition, 2002. [80] Srinivas Ramachandran, Pradeep Kota, Feng Ding, and Nikolay V Dokholyan. Automated minimization of steric clashes in protein structures. Proteins, 2011. [81] Sereina Riniker and Gregory A Landrum. Better informed distance geometry: using what we know to improve conformation generation. Journal of chemical information and modeling, 2015. [82] Emanuele Rodolà, Zorah Lähner, Alexander M Bronstein, Michael M Bronstein, and Justin Solomon. Functional maps representation on product manifolds. In Computer Graphics Forum. Wiley Online Library, 2019. [83] Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of In International Conference on Learning Representations, diffusion models. 2022. [84] Robin San-Roman, Eliya Nachmani, and Lior Wolf. Noise estimation for genera- tive diffusion models. ArXiv preprint, 2021. [85] Vıctor Garcia Satorras, Emiel Hoogeboom, and Max Welling. E (n) equivariant graph neural networks. In International Conference on Machine Learning, 2021. [86] Kristof Schütt, Pieter-Jan Kindermans, Huziel Enoc Sauceda Felix, Ste- fan Chmiela, Alexandre Tkatchenko, and Klaus-Robert Müller. Schnet: A continuous-filter convolutional neural network for modeling quantum interac- tions. Advances in neural information processing systems, 2017. 126 [87] Chence Shi, Shitong Luo, Minkai Xu, and Jian Tang. Learning gradient fields for molecular conformation generation. In International Conference on Machine Learning, 2021. [88] Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Gan- guli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, 2015. [89] Vignesh Ram Somnath, Charlotte Bunne, and Andreas Krause. Multi-scale representation learning on proteins. Advances in Neural Information Processing Systems, 34, 2021. [90] Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In International Conference on Learning Representations, 2021. [91] Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. Advances in Neural Information Processing Systems, 2019. [92] Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. International Conference on Learning Representations, 2021. [93] Hannes Stärk, Octavian Ganea, Lagnajit Pattanaik, Regina Barzilay, and Tommi Jaakkola. Equibind: Geometric deep learning for drug binding structure predic- tion. In International Conference on Machine Learning, 2022. [94] Nathaniel Thomas, Tess Smidt, Steven Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley. Tensor field networks: Rotation-and translation- equivariant neural networks for 3d point clouds. arXiv preprint, 2018. [95] René Thomsen and Mikael H Christensen. Moldock: a new technique for high-accuracy molecular docking. Journal of medicinal chemistry, 2006. [96] Oleg Trott and Arthur J Olson. Autodock vina: improving the speed and accuracy of docking with a new scoring function, efficient optimization, and multithreading. Journal of computational chemistry, 2010. [97] 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, 2017. [98] 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, 2020. 127 [99] Mikhail Volkov, Joseph-André Turk, Nicolas Drizard, Nicolas Martin, Brice Hoffmann, Yann Gaston-Mathé, and Didier Rognan. On the frustration to predict binding affinities from protein–ligand structures with deep neural networks. Journal of Medicinal Chemistry, 2022. [100] Penglei Wang, Shuangjia Zheng, Yize Jiang, Chengtao Li, Junhong Liu, Chang Wen, Atanas Patronov, Dahong Qian, Hongming Chen, and Yuedong Yang. Structure-aware multimodal deep learning for drug–protein interaction prediction. Journal of chemical information and modeling, 2022. [101] Daniel Watson, Jonathan Ho, Mohammad Norouzi, and William Chan. Learning to efficiently sample from diffusion probabilistic models. ArXiv preprint, 2021. [102] James D Watson and Francis HC Crick. Molecular structure of nucleic acids: a structure for deoxyribose nucleic acid. Nature, 1953. [103] Felix Wong, Aarti Krishnan, Erica J Zheng, Hannes Stärk, Abigail L Manson, Ashlee M Earl, Tommi Jaakkola, and James J Collins. Benchmarking alphafold- enabled molecular docking predictions for antibiotic discovery. Molecular Systems Biology, 2022. [104] Kevin E Wu, Kevin K Yang, Rianne van den Berg, James Y Zou, Alex X Lu, and Ava P Amini. Protein structure generation via folding diffusion. arXiv preprint, 2022. [105] Keyulu Xu, Mozhi Zhang, Jingling Li, Simon S Du, Ken-ichi Kawarabayashi, and Stefanie Jegelka. How neural networks extrapolate: From feedforward to graph neural networks. In International Conference on Learning Representations, 2021. [106] Minkai Xu, Shitong Luo, Yoshua Bengio, Jian Peng, and Jian Tang. Learning neural generative dynamics for molecular conformation generation. In Interna- tional Conference on Learning Representations, 2021. [107] Minkai Xu, Wujie Wang, Shitong Luo, Chence Shi, Yoshua Bengio, Rafael Gomez-Bombarelli, and Jian Tang. An end-to-end framework for molecular conformation generation via bilevel programming. In International Conference on Machine Learning, 2021. [108] Minkai Xu, Lantao Yu, Yang Song, Chence Shi, Stefano Ermon, and Jian Tang. Geodiff: A geometric diffusion model for molecular conformation generation. In International Conference on Learning Representations, 2021. 128
http://arxiv.org/abs/2302.11756v2
2023-06-13T18:50:18
2023-02-23T03:04:00
Learning Manifold Dimensions with Conditional Variational Autoencoders
Although the variational autoencoder (VAE) and its conditional extension (CVAE) are capable of state-of-the-art results across multiple domains, their precise behavior is still not fully understood, particularly in the context of data (like images) that lie on or near a low-dimensional manifold. For example, while prior work has suggested that the globally optimal VAE solution can learn the correct manifold dimension, a necessary (but not sufficient) condition for producing samples from the true data distribution, this has never been rigorously proven. Moreover, it remains unclear how such considerations would change when various types of conditioning variables are introduced, or when the data support is extended to a union of manifolds (e.g., as is likely the case for MNIST digits and related). In this work, we address these points by first proving that VAE global minima are indeed capable of recovering the correct manifold dimension. We then extend this result to more general CVAEs, demonstrating practical scenarios whereby the conditioning variables allow the model to adaptively learn manifolds of varying dimension across samples. Our analyses, which have practical implications for various CVAE design choices, are also supported by numerical results on both synthetic and real-world datasets.
[ "Yijia Zheng", "Tong He", "Yixuan Qiu", "David Wipf" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11756v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11756v2", "@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 n u J 3 1 ] G L . s c [ 2 v 6 5 7 1 1 . 2 0 3 2 : v i X r a Learning Manifold Dimensions with Conditional Variational Autoencoders Yijia Zheng1 ∗ Tong He2 Yixuan Qiu3 David Wipf2 1 Department of Statistics, Purdue University 2 Amazon Web Services 3 School of Statistics and Management, Shanghai University of Finance and Economics [email protected], {htong, daviwipf}@amazon.com, [email protected] Abstract Although the variational autoencoder (VAE) and its conditional extension (CVAE) are capable of state-of-the-art results across multiple domains, their precise behav- ior is still not fully understood, particularly in the context of data (like images) that lie on or near a low-dimensional manifold. For example, while prior work has suggested that the globally optimal VAE solution can learn the correct mani- fold dimension, a necessary (but not sufficient) condition for producing samples from the true data distribution, this has never been rigorously proven. Moreover, it remains unclear how such considerations would change when various types of conditioning variables are introduced, or when the data support is extended to a union of manifolds (e.g., as is likely the case for MNIST digits and related). In this work, we address these points by first proving that VAE global minima are indeed capable of recovering the correct manifold dimension. We then extend this result to more general CVAEs, demonstrating practical scenarios whereby the conditioning variables allow the model to adaptively learn manifolds of varying dimension across samples. Our analyses, which have practical implications for various CVAE design choices, are also supported by numerical results on both synthetic and real-world datasets. 1 Introduction Variational autoencoders (VAE) [6, 14] and conditional variants (CVAE) [17] are powerful genera- tive models that produce competitive results in various domains such as image synthesis [5, 13, 21], natural language processing [16], time-series forecasting [9, 19], and trajectory prediction [8]. As a representative example, when equipped with an appropriate deep architecture, VAE models have re- cently achieved state-of-the-art performance generating large-scale images [11]. And yet despite this success, there remain VAE/CVAE behaviors in certain regimes of interest where we lack a precise understanding or a supporting theoretical foundation. In particular, when the data lie on or near a low-dimensional manifold, as occurs with real-world images [12], it is meaningful to have a model that learns the manifold dimension correctly. The latter can provide insight into core properties of the data and be viewed as a necessary, albeit not suf- ficient, condition for producing samples from the true distribution. Although it has been suggested in prior work [3, 4] that a VAE model can learn the correct manifold dimension when globally op- timized, this has only been formally established under the assumption that the decoder is linear or affine [2]. And the potential ability to learn the correct manifold dimension becomes even more nuanced when conditioning variables are introduced. In this regard, a set of discrete conditions (e.g., MNIST image digit labels) may correspond with different "slices" through the data space, with each ∗Work completed during internship at the AWS Shanghai AI Labs. An earlier version of this work was published at NeurIPS 2022. inducing a manifold with varying dimension (intuitively, the manifold dimension of images labelled "1" is likely smaller than those of "5"). Alternatively, it is possible to have data expand fully in the ambient space but lie on a low-dimensional manifold when continuous conditional variables are present. Such a situation can be trivially constructed by simply treating some data dimensions, or transformations thereof, as the conditioning variables. In both scenarios, the role of CVAE models remains under-explored. Moreover, unresolved CVAE properties in the face of low-dimensional data structure extend to prac- tical design decisions as well. For example, there has been ongoing investigation into the choice between a fixed VAE decoder variance and a learnable one [3, 4, 10, 15, 18], an issue of heightened significance when conditioning variables are involved. And there exists similar ambiguity regard- ing the commonly-adopted strategy of sharing weights between the prior and encoder/posterior in CVAEs [7, 17]. Although perhaps not obvious at first glance, in both cases these considerations are inextricably linked to the capability of learning data manifold dimensions. Against this backdrop our paper makes the following contributions: (i) In Section 2.1 we provide the first demonstration of general conditions under which VAE global minimizers provably learn the correct data manifold dimension. (ii) We then extend the above result in Section 2.2 to address certain classes of CVAE models with either continuous or discrete conditioning variables, the latter being associated with data lying on a union of manifolds. (iii) Later, Section 3 investigates common CVAE model designs and training practices, includ- ing the impact of strategies for handling the decoder variance as well as the impact of weight sharing between conditional prior and posterior networks. (iv) Section 4 supports our theoretical conclusions and analysis with numerical experiments on both synthetic and real-world datasets. 2 Learning the Dimension of Data Manifolds In this section we begin with analysis that applies to regular VAE models with no conditioning. We then later extend these results to more general CVAE scenarios. 2.1 VAE Analysis is ωgt(dx) and is the ambient data space equipped We begin with observed variables x with some ground-truth probability measure ωgt. Hence the probability mass of an infinitesimal dx ωgt(dx) = 1. VAE models attempt to approximate this measure with a on Rκ as in parameterized distribution pθ(x) instantiated as marginalization over latent variables z ∈ z) pθ(x) = represents a parameterized likelihood function that is typically referred to as the decoder. 0, I) is a standardized Gaussian prior and pθ(x | z)p(z)dz. Here p(z) = N (z pθ(x | ∈ X ⊆ RX X X | Rd, where R To estimate decoder parameters θ, the canonical VAE training loss is formed as a bound on the average negative log-likelihood given by (θ, φ) = L Eqφ(z | x)[log pθ(x | Z {− z)] + KL[qφ(z x) p(z)] ωgt(dx) | || } ≥ − Z log pθ(x)ωgt(dx), X (1) where the latent posterior distribution qφ(z x) (or the VAE encoder) controls the tightness of the bound via trainable parameters φ. Borrowing from [4], we package widely-adopted VAE modeling assumptions into the following definition: | X Definition 1 (κ-simple VAE) A κ-simple VAE is a VAE model with dim[z] = κ latent dimen- sions, the Gaussian encoder qφ(z ), the Gaussian decoder 0, I). Here γ > 0 is a trainable scalar in- pθ(x | cluded within θ, while the mean functions μz(x; φ) and μx(z; θ) are arbitrarily-complex L-Lipschitz continuous functions; the variance function σ2 z (x; φ) can be arbitrarily complex with no further con- straint. | μx(z; θ), γI), and the prior p(z) = N (z z) = N (x | σ2 z (x; φ) } μz(x; φ), diag x) = N (z { | | 2 Our goal in this section will be to closely analyze the behavior of κ-simple VAE models when trained on data restricted to low-dimensional manifolds defined as follows: Definition 2 (Data lying on a manifold) Let r and d denote two positive integers with r < d. Then r is a simple r-Riemannian manifold embedded in Rd when there exists a diffeomorphism φ Rr, where φ is r and Rr. Specifically, for every x r, there exists a u = φ(x) M between invertible and both φ and φ− M 1 are differentiable. ∈ M ∈ As pointed out in [4], when training κ-simple VAEs on such manifold data, the optimal decoder variance will satisfy γ 0 (i.e, unbounded from below). And as we will soon show, one effect of this phenomena can be to selectively push the encoder variances along certain dimensions of z towards zero as well, ultimately allowing these dimensions to pass sufficient information about x through the latent space such that the decoder can produce reconstructions with arbitrarily small error. To formalize these claims, we require one additional definition: → Definition 3 (Active VAE latent dimensions) Let denote globally-optimal parameters of θ∗γ, φ∗γ} a κ-simple VAE model applied to (1) as a function of an arbitrary fixed γ. Then a dimension of latent variable z is defined as an active dimension (associated with sample x) if j the corresponding optimal encoder variance satisfies σz(x; φ∗γ )2 1, . . . , κ 0 as γ ∈ { 0. { } j → → We now arrive at the main result for this section: Theorem 1 (Learning the data manifold dimension using VAEs) Suppose Then for all κ r with r < d. r, any globally-optimal κ-simple VAE model applied to (1) satisfies the following: M = X ≥ (i) (θ∗γ, φ∗γ) = (d L − r) log γ + O(1), (ii) The number of active latent dimensions almost surely equals r, and (iii) The reconstruction error almost surely satisfies Eqφ∗ x x) (z γ | || (cid:2) μx(z; θ∗γ) || − 2 = O(γ). (cid:3) While all proofs are deferred to the appendices, we provide a high-level sketch here. First, we prove by contradiction that there must exist at least r active dimensions with corresponding encoder variances tending to zero at a rate of O(γ). If this is not the case, we show that the reconstruction term will grow at a rate of O( 1 γ ), leading to an overall loss that is unbounded from above. Next, we obtain upper bound and lower bounds on (1), both of which scale as (d r) log γ + O(1) when the number of active dimensions is r. And lastly, we pin down the exact number of active dimensions by showing that the inclusion of any unnecessary active dimensions decreases the coefficient of the log γ scale factor, i.e., the factor (d r) uniquely achieves the minimal loss. − − → Overall, Theorem 1 provides a number of revealing insights into the VAE loss surface under the stated conditions. First, we observe that although the loss can in principle be driven to minus infinity via sub-optimal solutions as γ 0, globally-optimal solutions nonetheless achieve an optimal rate (i.e., largest possible coefficient on the log γ factor) as well as the minimal number of active latent dimensions, which matches the ground-truth manifold dimension r. Moreover, this all occurs while maintaining a reconstruction error that tends to zero as desired. Additionally, while we have thus far treated γ as a manually controlled parameter tending to zero for analysis purposes, when we transition to a trainable setting, similar intuitions are still applicable. More specifically, around global minimizers, the corresponding optimal γ∗ scales as L2 2, where σz(x; θ∗)1:r denotes the r optimal latent posterior standard deviations associated with active dimensions. Hence both the decoder variance γ and the latent posterior variances of active dimensions converge to zero in tandem at the same rate; see the proof for more details. In contrast, along the remaining 0 σz(x; φ∗γ) = Ω(1), which optimzes the KL term without inactive dimensions we show that limγ compromising the reconstruction accuracy. σz(x; θ∗)1:r d || → || In closing this section, we note that previous work [4] has demonstrated that global minima of VAE models can achieve zero reconstruction error for all samples lying on a data manifold. But it was not formally established in a general setting that this perfect reconstruction was possible using a minimal number of active latent dimensions, and hence, it is conceivable for generated samples involving a larger number of active dimensions to stray from this manifold. In contrast, to achieve perfect reconstruction using the minimal number of active latent dimensions, as we have 3 demonstrated here under the stated assumptions, implies that generated samples must also lie on the manifold. Critically, the noisy signals from inactive dimensions are blocked by the decoder and therefore cannot produce deviations from the manifold. 2.2 Extension to Conditional VAEs In this section, we extend our analysis to include conditional models, progressing from VAEs to with asso- CVAEs. For this purpose, we introduce conditioning variables c drawn from some set there exists a ciated probability measure νgt such that gt(dx) = 1. Collectively we also have subset RC with probability measure ωc gt satisfying c X ωc gt(dx)νgt(dc) = 1. Given these definitions, the canonical CVAE loss is defined as νgt(dc) = 1. Moreover, for any c ωc ⊆ X ∈ C RX C c c RC RX (θ, φ) = L Z C Z X − c (cid:8) Eqφ(z x,c)[log pθ(x | | z, c)] + KL[qφ(z x, c) || pθ(z c)] | | (cid:9) ωc gt(dx)νgt(dc) ≥ Z C Z X log pθ(x | c − c)ωc gt(dx)νgt(dc), (2) which forms an upper bound on the conditional version of the expected negative log-likelihood. We may then naturally extend the definition of the κ-simple VAE model to the conditional regime as follows: Definition 4 (κ-simple CVAE) A κ-simple CVAE is an extension of the κ-simple VAE with the the Gaus- revised conditional, parameterized prior pθ(z sian encoder qφ(z ), and the Gaussian decoder | μx(z, c; θ), γI). The encoder/decoder mean functions μz(x, c; φ) and μx(z, c; θ) pθ(x | are arbitrarily-complex L-Lipschitz continuous functions, while the prior mean μz(c; θ) and vari- ance σ2 z (x, c; φ) can all be arbitrarily-complex functions with no further constraint. c) = N (z | σ2 z (x, c; φ) } z (c; θ),2 and encoder variance σ2 z, c) = N (x | μz(x, c; φ), diag σ2 z (c; θ) } x, c) = N (z μz(c; θ), diag ), { { | | Likewise, we may also generalize the definition of active latent dimensions, where we must explicitly account for the modified conditional prior distribution which controls the relative scaling of the data. Definition 5 (Active CVAE latent dimensions) Let of a κ-simple CVAE model applied to (2) as a function of an arbitrary fixed γ. Then a dimension j ∈ ) x, c 1, . . . , κ { } j /σz(c; θ∗γ)2 if the corresponding j-th optimal encoder/prior variance ratio satisfies σz(x, c; φ∗γ )2 j → 0 as γ of latent variable z is defined as an active dimension (associated with sample pair denote globally-optimal parameters θ∗γ, φ∗γ} } 0. { { → Note that a CVAE (or VAE) with a standardized (parameter-free) Gaussian prior, the prior variance equals one. Hence it follows that Definition 3 is a special case of Definition 5 where σ2 z (c; θ) = I. Before proceeding to our main result for this section, there is one additional nuance to our manifold assumptions underlying conditional data. Specifically, if c follows a continuous distribution, then it can reduce the number of active latent dimensions needed for obtaining perfect reconstructions. To quantify this effect, let c. Intuitively then, depending on the information about x contained in c, the number of active latent dimensions within X c r may be less than r. We quantify this reduction via the following definition: M Definition 6 (Effective dimension of a conditioning variable) Given an integer t let with the following properties: (i) There exists a function g : C well as t dimensions of φ(x) denoted as φ(x)t, such that g(c) = φ(x)t for all pairs t, x ∈ , where φ is a diffeomorphism per Definition 2; and (ii) there does not exist such a ∈ { t C → (c, x) : c { r denote the subset of t denote a subset of C function g for t + 1. We refer to t as the effective dimension of any conditioning variable c , 0, . . . , r } Rt as r associated with c r ⊆ M ∈ M c r} M M C t. Loosely speaking, Definition 6 indicates that any c dimensions of x within r c r. Incidentally, if t = r, then this definition implies that x degenerates 2While the parameters of the prior mean and variance functions are labeled as θ, this is merely to follow standard convention and group all parameters from the generative pipeline together under the same heading; it is not meant to imply that the decoder and prior actually share the same parameters. ∈ C M ≤ ∈ C t can effectively be used to reconstruct t 4 to a deterministic function of c. Given these considerations, Theorem 1 can be extended to CVAE models conditioned on continuous variables as follows: Theorem 2 (Learning the data manifold dimension using CVAEs) Suppose c = t. Then any globally-optimal κ-simple CVAE model applied to the 0, and r t and 1, t = X C C c r with r M loss (2), with κ ≥ ≥ ≥ ≥ r, satisfies the following: (i) (θ∗γ, φ∗γ) = (d L − r + t) log γ + O(1), and (ii) The number of active latent dimensions almost surely equals r t, and − (iii) The reconstruction error almost surely satisfies Eqφ∗ γ x,c) (z | || (cid:2) x μx(z, c; θ∗γ) || − 2 = O(γ). (cid:3) This result indicates that conditioning variables can further reduce the CVAE loss (by increasing the coefficient on the log γ term as γ 0 around optimal solutions. Moreover, conditioning can replace active latent dimensions; intuitively this occurs because using c to reconstruct dimensions of x, unlike dimensions of z, incurs no cost via the KL penalty term. Additionally, it is worth mentioning that even if the observed data itself is not strictly on a manifold (meaning r = d), once the conditioning variables c are introduced, manifold structure can be induced on c, i.e., with t > 0 it follows that d X r + t > 0 and the number of active latent dimensions satisfies r t < d. → − − 2.3 Adaptive Active Latent Dimensions Thus far our analysis has been predicated on the existence of a single r-dimensional manifold un- derlying the data x, along with a conditioning variable c that captures t degrees-of-freedom within this manifold. More broadly though, it is reasonable to envision scenarios whereby the data instead lie on a union of manifolds, each with a locally-defined value of r and possibly t for continuous conditioning variables. In such instances, both Theorems 1 and 2 can be naturally refined to reflect this additional flexibility. { αk While we defer a formal treatment to future work, it is nonetheless worthwhile to consider CVAE behavior within two representative scenarios. First, consider the case where c is now a discrete m k=1, such as the label of an MNIST digit random variable taking a value in some set/alphabet [24] (whereby m = 10). It then becomes plausible to assume that r = f (αk) for some function f , meaning that the manifold dimension itself may vary conditioned on the value of c (e.g., the space of digits "1" is arguably simpler than the space of digits "8"). In principle then, a suitably- designed CVAE model trained on such data should be able to adaptively learn the dimensions of these regional manifolds. Later in Section 4.4 we empirically demonstrate that when we include a specialized attention layer within the CVAE decoder, which allows it to selectively shut on and off different latent dimensions, the resulting model can indeed learn the underlying union of low- dimensional manifolds under certain circumstances. From a conceptual standpoint, the outcome is loosely analogous to a separate, class-conditional VAE being trained on data associated with each αk. } As a second scenario, we may also consider the case where t varies for different values of a contin- uous conditioning variable c. Extrapolating from Theorem 2, we would expect that the number of active latent dimensions r t will now vary across regions of the data space. Hence an appropraite CVAE architecture should be able to adaptively compress the active latent dimensions so as to align with the varying information contained in c. Again, Section 4.4 demonstrates that this is indeed possible. − 3 On Common CVAE Model Design Choices In this section, we review CVAE model designs and training practices that, while adopted in various prior CVAE use cases, nonetheless may have underappreciated consequences, especially within the present context of learning the underlying data manifold dimensionality. 5 3.1 On the Equivalence of Conditional and Unconditional Priors Per the canonical CVAE design, it is common to include a parameterized, trainable prior pθ(z c) within CVAE architectures [1, 7, 8, 20, 25]. However, the strict necessity of doing so is at least partially compromised by the following remark: | L c). (θ, φ) = c), encoder qφ(z | ∼ N c) = pθ′(x | x, c) and decoder pθ′(x | x, c) and decoder pθ(x | (0, I), encoder qφ′ (z Remark 1 (Converting conditional to unconditional priors) Consider a κ-simple CVAE model z, c). We can always find another κ-simple with prior pθ(z | CVAE model with prior p(z) z, c), such that (θ′, φ′) and pθ(x | L Remark 1 indicates that, at least in principle, a parameterized, conditional prior is not unequivocally needed. Specifically, as detailed in the appendix, we can always explicitly convert an existing κ- simple CVAE model with conditional prior pθ(z c) into another κ-simple CVAE model with fixed 0, I) without sacrificing any model capacity in the resulting generative process prior p(z) = z, c)p(z)dz; essentially the additional expressivity of the conditional prior is pθ′(x | merely absorbed into a revised decoder. Even so, there may nonetheless remain differences in the optimization trajectories followed during training such that achievable local minima may at times lack this equivalence. (z N | pθ′(x | c) = R | | 3.2 The Impact of γ Initialization on Model Convergence As emphasized previously, VAE/CVAE models with sufficient capacity applied to manifold data 0. However, directly fixing γ near zero can be problematic achieve the minimizing loss when γ for reasons discussed in [3], and more broadly, performance can actually be compromised when γ is set to any fixed positive constant as noted in [4, 10, 15, 18]. → Even so, it remains less well-understood how the initializaton of a learnable γ may impact the optimization trajectory during training. After all, the analysis we have provided is conditioned on finding global solutions, and yet it is conceivable that different γ initializations could influence a model's ability to steer around bad local optima. Note that the value of γ at the beginning of training arbitrates the initial trade-off between the reconstruction and KL terms, as well as the smoothness of the initial loss landscape, both of which are factors capable of influencing model convergence. We empirically study these factors in Section 4.5. 3.3 A Problematic Aspect of Encoder/Prior Model Weight Sharing Presumably to stabilize training and/or avoid overfitting, one widely-adopted practice is to share CVAE weights between the prior and posterior/encoder modules [8, 17, 19]. For generic, fixed- sized input data this may take the form of simply constraining the encoder as qφ(z c) [17]. More commonly though, for sequential data both prior and encoder are instantiated as some form of recurrent network with shared parameters, where the only difference is the length of the input sequence [8, 19], i.e., the full sequence for the encoder or the partial conditioning sequence for the prior. x, c) = pθ(z | | n More concretely with respect to the latter, assume sequential data x = l=1, where l is a time index (for simplicity here we will assume a fixed length n across all samples, although this can be easily generalized). Then associated with each time point xl within a sample x, we have a prior conditioning sequence cl = x<l , l j=1. The resulting encoder and prior both define − distributions over a corresponding latent zl via qφ(zl x<l) respectively. Along with the decoder model pθ(xl ≤ zl, x<l), the revised, sequential CVAE training loss becomes l) and pθ(zl xj xl x { } { } 1 | | n (θ, φ) = L Z X {− Xl=1 | Eqφ(zl| x≤l) [log pθ(xl | zl, x<l] + KL [qφ(zl x ≤ | l) || pθ(z | x<l)] } ωgt(dx), (3) where we observe that there is now an additional summation over the temporal index l. This mir- rors the fact that to reconstruct (or at test time generate) a sample x, the CVAE will sequentially produce each time point xl conditioned on previously reconstructed (or generated) values. We now analyze one of the underappreciated consequences of encoder/prior weight-sharing within the afore- mentioned sequential CVAE context. 6 Theorem 3 (Weight sharing can compromise the performance of sequential CVAEs) Assume sequential data with ground-truth measure ωgt defined such that the probability mass of xl conditioned on x<l lies on a manifold with minimum dimension r > 1 (this excludes strictly deterministic sequences). Moreover, given a κ-simple sequential CVAE model,3 assume that the prior is constrained to share weights with the encoder such that pθ(zl x<l). Then the (θ, φ) = Ω(1) for any θ and φ. corresponding loss from (3) satisfies x<l) = qφ(zl | | L Given the rigidity of this lower bound, Theorem 3 indicates that the sequential CVAE model is unable to drive the the loss towards minus infinity as required to produce active latent dimensions Intuitively, this (per Definition 5) and correctly learn low-dimensional manifolds when present. relates to subtleties of the differing roles the encoder and prior play in sequence models. ≤ 1) at time l is in every way identical to In particular, it follows that the encoder distribution qφ(zl x | l) per the adopted the prior at time l + 1 given that pθ(zl+1| x x<l+1) = qφ(zl+1| x<l+1) = qφ(zl+1| weight sharing assumption. But these distributions are meant to serve two very different purposes: (i) The encoder is meant to push the variances of active dimensions to zero so as to learn the underlying manifold, while the remaining/superfluous dimensions merely output useless noise that is filtered by the decoder. (ii) In stark contrast, the role of the prior is not to instantiate reconstructions, but rather to inject the calibrated randomness needed to match the conditional uncertainty in the ground-truth distribution. Therefore, unless the observed data sequences are deterministic, in which case xl can be predicted exactly from x<l, it is impossible to achieve both (i) and (ii) simultaneously. And indeed, we verify these insights via numerical experiments conducted in Section 4.6. ≤ 4 Experiments In this section we first corroborate our previous analysis in a controllable, synthetic environment; later we extend to real-world datasets to further support our conclusions.4 We also include ex- periments comparing the impact of full versus diagonal encoder covariance models to validate with respect to complementary analysis of VAE local minima from [22]. Note that the VAE/CVAE model architectures used for all of our experiments are described in Section A of the appendix. 4.1 Datasets and Metrics Rr from a Gaussian mixture Synthetic Data We begin by generating low-dimensional data u model with 5 equiprobability components, each with mean μu and transformed variance log σu drawn from a standardized Gaussian distribution. Next, to produce the high-dimensional data mani- r is a randomly initialized fold t is projection matrix. For conditional models, we also compute c = Gcu1:t, where Gc another random projection. Given these assumptions, we can then construct training datasets with varying values of r, d, and t. For all experiments with synthetic data, the training set size is 100,000. We also perform tests using synthetic sequential data described in Section 4.6. r in Rd, we compute x = sigmoid(Gxu), where Gx M Rd Rt = X ∈ ∈ ∈ × × Real-world Data We also investigate model behaviors via MNIST [24] and Fashion MNIST [23].5 These two datasets involve image samples with clear-cut low-dimensional manifold structure, while at the same time, they are not so complex that more intricate architectures and training designs are required that might otherwise obfuscate our intended message (e.g., more complex models may fail at times to learn correct low-dimensional structure simply because of convergence issues). Metrics By convention, we report the loss from (1) for VAEs and (2) for CVAEs; these losses are often referred to as the negative evidence lower bound (-ELBO) (note though that these values are not always directly comparable across different testing scenarios). We also include auxiliary metrics to diagnose model behavior, including the number of active dimensions (AD), the reconstruction error (Recon), the KL-divergence (KL), and the learned decoder variance γ. 3This is defined analogously to the κ-simple CVAE from Definition 4. 4Code is available at https://github.com/zhengyjzoe/manifold-dimensions-cvae 5MNIST is under the CC BY-SA 3.0 license, and Fashion MNIST is MIT-Licensed. 7 Table 1: Aligning learned VAE active dimensions (AD) with the ground-truth manifold dimension r. When κ r (a surplus of latent dimensions) the VAE largely succeeds as γ, the reconstruction error (Recon), and -ELBO converge to relatively small values; however, when κ < r this is not possible. ≥ AD Recon κ d 10 20 20 30 5 20 r 2 4 6 8 10 2 4 6 8 10 2 4 6 8 10 6 8 10 2 4 6 7 8 2 4 6 8 10 2 4 6 8 10 5 5 5 KL 18.31 24.22 24.14 27.91 16.39 17.98 23.11 28.96 33.83 35.81 18.42 24.60 31.89 37.28 35.13 2 2 4 3 3 3 × 2.6 × 9.2 × 1.27 × 5.99 × 10− 10− 10− 10− 10− 3 1.6 1.75 3.09 3.42 4.74 × × × × × 10− 10− 10− 10− 10− 3 2 2 2 2 2.6 2.73 4.74 5.68 1.13 10− 10− 10− 10− 10− × × × × × 2 2 2 1 1.299 3.719 3.564 × × × 1 1 1 10− 10− 10− 22.53 16.618 15.966 γ -ELBO 10− 10− 4 × × 10− 10− 10− 3 3 10− 4 4 × 10− 10− 10− 10− 3 3 10− 4 4 × 10− 10− 10− 10− 3 3 1.625 5.654 3 × 1.4 × 2.5 × 5.052 2 × 6 × 1.2 × 1.1 × 7.221 2 × 9 × 1.6 × 2.5 × 2.1 × 8.8 × 1.113 3 3 10− 10− 10− × 5 5 5 5 2 -58.26 -29.83 -17.39 -10.38 -6.40 -114.52 -60.90 -43.75 -36.82 -28.34 -176.74 -100.28 -76.46 -65.66 -47.00 -36.97 -22.60 -16.96 Table 2: VAE latent compression on real datasets in further support of Theorem 1. Dataset κ AD Recon -ELBO MNIST Fashion MNIST 5 16 32 5 16 32 5 12 13 5 9 9 14.899 9.749 7.469 13.163 9.026 7.820 -842.286 -1065.83 -1224.37 -935.127 -1216.68 -1327.26 4.2 Learning Manifold Dimensions with VAEs We begin by exploring the VAE's ability to learn the correct manifold dimension in support of Theo- rem 1. Specifically, using the synthetic dataset, we vary the ambient dimension d and and compare with the estimated number of the ground-truth manifold dimension r ∈ { active dimensions with κ = . Please see Section B of the appendix for details regarding how active dimensions are computed in practice (while in numerical experiments encoder variances will not converge to exactly zero, we can nonetheless observe these variances closely clustering around either 0 or 1 as expected). 2, 4, 6, 8, 10 10, 20, 30 5, 20 ∈ { ∈ { } } } Results are shown in Table 1, where we observe that when κ r, the VAE can generally align the active dimensions with the value of r as expected once γ has converged to a small value. In contrast, when κ is too small (i.e., κ = 5), it is no longer possible to learn the manifold dimension (not surprisingly, the -ELBO and reconstruction error are also much larger as well). ≥ Complementary results on MNIST and Fashion MNIST are reported in Table 2. While we no longer have access to the ground-truth value of r, we can still observe that as κ increases, the number of active dimensions saturates as expected. 8 Table 3: CVAE latent compression showing AD = r the first t dimensions of u, i.e. Gc = It, d = κ = 20, and r = 10. − t exactly in support of Theorem 2. Here c is t 1 3 5 7 9 -ELBO Recon -31.41 -36.67 -42.78 -52.39 -62.25 4.61 4.66 4.86 4.29 3.84 × × × × × 2 2 2 2 2 10− 10− 10− 10− 10− KL 33.26 27.78 20.81 13.72 6.07 γ AD 3 3 3 3 2.4 2.4 2.6 2.2 2 10− × 10− × 10− × 10− × 3 10− × 9 7 5 3 1 Table 4: CVAE latent compression in real datasets with κ = 32. AD is averaged over all the classes. AD Recon KL γ -ELBO MNIST Fashion MNIST 12 9 6.044 8.773 81.672 54.552 0.0063 0.0102 -1489.42 -1239.09 4.3 Learning Manifold Dimensions with CVAEs Turning to CVAEs, we provide empirical support for Theorem 2 using synthetic datasets with vary- ing t, the effective dimension of the conditioning variable c. For this purpose, we set c to be the first t dimensions of u by equating Gc to a t-dim identity matrix It, and let d = κ = 20, and r = 10. t across all values of t. Table 3 shows the results, whereby the CVAE correctly learns that AD = r Meanwhile, on MNIST and Fashion MNIST we train CVAEs with the class label of each image as the conditioning variable, and the results with κ = 32 are in Table 4. By comparing with Table 2, we observe that the CVAE model for MNIST has a lower AD and -ELBO, suggesting that when conditioned on labels, the model can more easily confine the resulting representations to a lower- dimensional manifold. In contrast, for FashionMNIST the CVAE/VAE results are more similar, indicating that the class labels provide marginal benefit, possibly because their visual complexity and manifold structure is more similar across classes. We also provide an example of the CVAE encoder variances produced on the MNIST dataset in Section B of the appendix. − 4.4 Adaptive CVAE Active Dimensions within a Dataset Continuing with CVAE experimentation, we now turn to verifying aspects of Section 2.3, namely, the ability to adaptively learn active dimensions that vary regionally within a single dataset com- posed of a union of low-dimensional ground-truth manifolds. To this end, we choose c as a discrete indicator of each source manifold, 5 in total with r latent dimensions within each re- spectively. Table 5 shows the results using d = 20 and κ = 40, noting that both the AD and -ELBO values are class-conditional within a single dataset. Also, we report performance both with and without a special attention layer in the decoder that helps to selectively determine which dimensions should be active on a sample-by-sample basis. These results indicate that, when equipped with a suit- ably flexible decoder network, the CVAE has the ability to adaptively learn AD values that correctly align with data lying on a union of manifolds. 1, ..., 5 ∈ { } Table 5: Adaptively learning CVAE active dimension involving data lying on a union of 5 manifolds with r , and d = 20, κ = 40. A discrete c labels each manifold/class, and the AD values and -ELBO are computed on a class-conditional basis. 1, . . . , 5 ∈ { } r 1 2 3 4 5 True AD without AD with attention AD attention -ELBO without attention -ELBO with attention 1 2 3 4 5 4 4 4 4 4 -102.25 -62.42 -60.13 -28.06 -7.58 -114.22 -99.81 -74.28 -50.36 -59.25 1 2 3 4 5 9 Table 6: Adaptively learning active dimensions involving a continuous c and associated t ∈ varying within a single dataset; also r = 12, d = 20, κ = 90. The AD values 2, 4, 6, 8, 10 { and -ELBO are computed on a class-conditional basis. } t 2 4 6 8 10 True AD without AD with attention AD attention -ELBO without attention -ELBO with attention 10 8 6 4 2 10 10 10 10 10 10 8 6 4 2 -9.69 -33.71 -27.10 -50.70 -61.77 -41.49 -20.52 -73.26 -80.64 -55.14 Table 7: Learned active dimensions as initial γ is varied, with d = 20, r = 10, t = 5, κ = 20. Init log γ VAE CVAE p(z) CVAE pθ(z c) | AD -ELBO AD -ELBO AD -ELBO -20 -10 0 10 20 10 9 8 3 1 -28.39 -28.57 -27.56 -13.89 -1.7 5 5 5 5 5 -41.20 -44.53 -44.38 -43.72 -45.22 5 5 5 5 4 -40.72 -45.25 -45.2 -43.66 -37.85 2, 4, 6, 8, 10 To further explore adaptive active dimensions, we also consider the case where c is a continuous varying from sample-to-sample (this is achieved by using the first variable with t R10 2, 4, 6, 8, 10 { we apply zero-padding. Using r = 12, d = 20, and κ = 20, results are shown in Table 6, again with and without the attention layer that exploits c to correctly learn the optimal AD across all values of t. ∈ { dimensions of u as the conditioning variable). To maintain a constant size of c ∈ } } 4.5 The Impact of γ Initialization on Model Training We next investigate how the initialization of γ impacts VAE/CVAE model convergence as related to the discussion in Section 3.2. Results with synthetic data and d = 20, κ = 20, r = 10, and for the CVAE, t = 5 are shown in Table 7 as the initial γ is varied. Here we observe that for the VAE model, the correct number of active dimensions is only learned when γ is initialized sufficiently small. In contrast, for the CVAE we include results both with and without a parameterized prior. However, given an adequately-sized decoder, both models perform similarly as would be expected (note that we used the same decoder for both models, so the parameter-free prior model was technically not strictly equivalent per Remark 1). And with the exception of the log γ = 20 case when the parame- terized CVAE prior model falls into a local minima, they are both able to correctly learn the number of active CVAE dimensions as AD = r t = 5, consistent with Theorem 2. In comparison with the VAE, the CVAE models are likely less sensitive to the initial γ because the number of active latent dimensions that need to be learned is half that of the VAE (5 versus 10). − 4.6 Performance Degradation Using Shared Weights between Encoder and Prior Finally, we provide empirical support for Theorem 3 relating to the potential impact of weight- sharing within sequential models. We generate sequences via an autoregressive-moving-average (ARMA) process, and we define the conditioning variable cl at time l as the concatentation of the previous 5 timepoints within each sequence. Results training a CVAE model to generate analogous sequences are shown in Table 8. We observe that when the encoder and prior share parameters (first row) the -ELBO cannot be significantly reduced, largely because the reconstruction error remains high. In contrast, without shared weights (second row) the model successfully drives the reconstruc- tion error and -ELBO to much smaller values as might be expected based on Theorem 3. Of course in larger, more complex models there could be other mitigating factors, such as overfitting risks, that might allow shared weights to at times perform relatively better. 10 Table 8: Impact of weight sharing between encoder and prior on sequential data. Shared Weights -ELBO True False -2.49 -45.015 Recon 0.374 1.81 × 5 10− KL 18.09 175.99 γ 0.012 7.252 7 10− × Table 9: Comparing equivalent-capacity VAEs with diagonal vs. full encoder covariances. Setup is the same as Table 2 using MNIST data and κ = 32. AD Recon -ELBO Full Diagonal 8 13 4.5 7.6 -1756 -1205 4.7 Full vs. Diagonal Encoder Covariances Our theoretical contributions from Section 2 were predicated on properties of VAE/CVAE global optima assuming sufficient model capacity to represent ground-truth manifolds. However, we have spoken relatively little about explicit strategies for steering optimization trajectories away from bad local solutions that may have less desirable characteristics. In this regard, analysis from [22] sug- gests that all else being equal, a full (as opposed to diagonal) VAE encoder variance may provide a beneficial selective smoothing effect capable of guiding training iterations towards global solutions, mitigating the risk of converging to bad local alternatives. We now verify this theoretical prediction using MNIST data and the same experimental setup used to produce Table 2. The only modification is to accommodate the full covariance model, where we used the encoder to produce the Cholesky decomposition of a general covariance matrix. Per this revised setup, results comparing equivalent-capacity VAEs (that only differ in the final encoder layer used to compute respective covariances, i.e., full vs. diagonal) are displayed in Table 9. From these results we observe that all else being equal, the full covariance encoder model does in fact produce a significantly lower VAE loss. Moreover, the reconstruction error is lower even while using a fewer number of active latent dimensions. This closely aligns with predictions from [22], and complements our general findings here that VAE minima tend to align with optimal sparse representations, at least to the extent that good minima can be found. 5 Conclusion In this paper we provide several insights into the behavior of VAEs and CVAEs applied to data ly- ing on low-dimensional manifolds. This includes a formal demonstration that both VAE and CVAE global minima can learn manifold dimensions underlying the data, including those manifolds that have been modulated by conditioning variables. We also explore common CVAE design choices that can have practical implications when applying to various specialized applications, such as se- quential data or data composed of a union of manifolds. That being said, beyond the attention mechanism we mentioned for learning region-specific active latent dimensions, we have not thor- oughly explored what types of decoder inductive biases might best align with real-world manifold data. This represents a reasonable direction for future work. References [1] Matthias Bauer and Andriy Mnih. Resampled priors for variational autoencoders. In Interna- tional Conference on Artificial Intelligence and Statistics, 2019. [2] Bin Dai, Yu Wang, John Aston, Gang Hua, and David Wipf. Hidden talents of the variational autoencoder. arXiv preprint arXiv:1706.05148, 2018. [3] Bin Dai, Li Wenliang, and David Wipf. On the value of infinite gradients in variational autoen- coder models. Advances in Neural Information Processing Systems, 34, 2021. 11 [4] Bin Dai and David Wipf. Diagnosing and enhancing VAE models. In International Conference on Learning Representations, 2019. [5] Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taïga, Francesco Visin, David Vázquez, and Aaron C. Courville. Pixelvae: A latent variable model for natural images. In 5th International Conference on Learning Representations, 2017. [6] Diederik Kingma and Max Welling. Auto-encoding variational Bayes. In International Con- ference on Learning Representations, 2014. [7] Thomas Kipf, Ethan Fetaya, Kuan-Chieh Wang, Max Welling, and Richard Zemel. Neural relational inference for interacting systems. In International Conference on Machine Learning, pages 2688–2697. PMLR, 2018. [8] Longyuan Li, Jian Yao, Li Wenliang, Tong He, Tianjun Xiao, Junchi Yan, David Wipf, and Zheng Zhang. Grin: Generative relation and intention network for multi-agent trajectory pre- diction. Advances in Neural Information Processing Systems, 34, 2021. [9] Sindy Löwe, David Madras, Richard Zemel, and Max Welling. Amortized causal discovery: Learning to infer causal graphs from time-series data. In Proceedings of the First Conference on Causal Learning and Reasoning. PMLR, 2022. [10] Pierre-Alexandre Mattei and Jes Frellsen. Leveraging the exact likelihood of deep latent vari- able models. Advances in Neural Information Processing Systems, 31, 2018. [11] Jialun Peng, Dong Liu, Songcen Xu, and Houqiang Li. Generating diverse structure for image inpainting with hierarchical vq-vae. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10775–10784, 2021. [12] Phil Pope, Chen Zhu, Ahmed Abdelkader, Micah Goldblum, and Tom Goldstein. The intrinsic In International Conference on Learning dimension of images and its impact on learning. Representations, 2021. [13] Ali Razavi, Aaron Van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. Advances in neural information processing systems, 32, 2019. [14] Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International Conference on Machine Learning, 2014. [15] Danilo Jimenez Rezende and Fabio Viola. Taming VAEs. arXiv preprint arXiv:1810.00597, 2018. [16] Iulian Serban, Alessandro Sordoni, Ryan Lowe, Laurent Charlin, Joelle Pineau, Aaron Courville, and Yoshua Bengio. A hierarchical latent variable encoder-decoder model for gener- ating dialogues. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017. [17] Kihyuk Sohn, Honglak Lee, and Xinchen Yan. Learning structured output representation using deep conditional generative models. Advances in neural information processing systems, 28, 2015. [18] Hiroshi Takahashi, Tomoharu Iwata, Yuki Yamanaka, Masanori Yamada, and Satoshi Yagi. Student-t variational autoencoder for robust density estimation. In International Joint Confer- ence on Artificial Intelligence, 2018. [19] Binh Tang and David S Matteson. Probabilistic transformer for time series analysis. Advances in Neural Information Processing Systems, 34:23592–23608, 2021. [20] Jakub Tomczak and Max Welling. VAE with a VampPrior. In International Conference on Artificial Intelligence and Statistics, 2018. [21] Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. Advances in neural information processing systems, 30, 2017. [22] David Wipf. Marginalization is not marginal: No bad VAE local minima when learning optimal sparse representations. In International Conference on Machine Learning, 2023. [23] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: A novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017. [24] Corinna Cortes Yann LeCun. THE MNIST DATABASE of handwritten digits. http://yann.lecun.com/exdb/mnist/. 12 [25] Jun-Yan Zhu, Richard Zhang, Deepak Pathak, Trevor Darrell, Alexei A Efros, Oliver Wang, and Eli Shechtman. Toward multimodal image-to-image translation. Advances in neural infor- mation processing systems, 30, 2017. 13 Appendix A Details of Model Architectures and Implementation Synthetic Data For the experiments with VAE models, both the encoder and decoder are defined as a Multi Layer Perceptron (MLP) with a single hidden layer. For all the experiments with CVAE models except Section 4.6, the encoder first processes conditioning variable c via an MLP, then concatenates the output and samples x as the input of another MLP. The decoder processes c in the same way and then uses an MLP to decode the latent variable. In Section 4.4, the attention layer we use in the decoder is a trainable vector which is applied as the weight of the latent vector at the top layer. In Section 4.6, both the encoder and decoder are LSTMs with one hidden layer. Real Data Both the encoder and decoder use two ResNet blocks to process MNIST/ Fashion 3 Conv-BN- MNIST images. Each encoder block is a residual network which contains two 3 ReLU modules in its main branch and one 1 1 Conv-BN module in its shortcut. The decoder block contains a single-layer ConvNet residual block followed by a ConvTranspose layer. × × Resources We conduct our experiments on an Amazon Web Services g4dn.12xlarge EC2 instance, which provides 4 T4 GPUs. We estimate that the time to run through all experiments in this paper once would cost 20 GPU-hours. The research activity for this paper cost around 100 GPU-hours in total. B Encoder Variance Illustration To show the active dimensions visually, here we report the encoder variances both on synthetic data and the MNIST dataset. Note that when the value of the encoder variance is less than 0.05, we categorize the corresponding dimension as active for VAE models; for CVAEs we analogously require that the encoder/prior variance ratio is less than 0.05. Note however in Table 1 and 2 below, the number of active dimensions is quite obvious given the clear clustering of variance values. Table 10: VAE encoder variance matrix on synthetic data associated with Table 1 of the main text, where κ = 20, d = 30, r = 6 and we find the number of active dimensions is 6. The estimated active dimensions are in blue. 0.0080 0.0027 1.0000 1.0000 0.0018 0.0031 0.0087 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.0141 1.0000 1.0000 1.0000 1.0000 1.0000 Table 11: CVAE Encoder variance matrix of the CVAE model on MNIST dataset from Table 4 of the main text, where κ = 32 and the number of active dimensions is 12. The estimated active dimensions are labeled in blue. 3.6159e-03 9.8518e-01 9.8065e-01 9.6985e-01 7.8233e-04 9.7785e-01 9.2616e-01 1.0324e-03 9.6320e-01 9.6739e-01 9.7336e-01 6.1294e-03 9.7318e-01 9.7737e-01 9.8335e-01 9.6723e-01 7.6566e-04 9.6077e-01 3.7781e-03 9.7449e-01 9.8596e-01 9.7315e-01 9.6775e-01 9.6046e-01 3.5173e-04 8.1020e-04 7.1394e-04 9.8012e-01 2.4359e-04 9.8431e-01 1.2756e-03 2.1289e-03 C Proof of Theorem 1 Summary of the Proof We define three categories based on the number of active dimensions and the rate of their encoder variance. Note that any possible VAE optimum has to fall into one of the 14 following three categories: the number of dimensions whose encoder variance σ2 either greater than r, equal to r or less than r. The proof's logic flow is: z (x, φ∗γ ) = O(γ) is 1. When the number of active dimensions whose encoder variance σ2 r, the reconstruction error will increase at a rate of O( 1 optimum. This is proven in Section C.1; z (x) = O(γ) is less than γ ), thus the cost cannot reach the 2. When the stated dimension number equals r, the optimal cost is exactly (d The corresponding proof is in Section C.2; r) log γ +O(1). − 3. When the stated dimension number is greater than r, denoted as m > r, the cost is (d m) log γ + O(1) > (d − r) log γ + O(1) as shown in Section C.3. − The O(γ) rate of the reconstruction error also follows naturally from these results. C.1 The number of active dimensions whose encoder variance σ2 z (x) = O(γ) is less than r || x − μx(z0) μx(z0) x0 − 2 > 0 leading to the positive expectation term The main idea is to link the gap between a large σz and large reconstruction error. For a given z0, μx(z0) will equal some x0 such that where x = 2dz. x0, we have μx(z) || To minimize such positive error, we need to lower the density q(z = x0, which is a function of σz. Suppose that the number of active dimensions whose encoder variance σ2 z (x) = O(γ) is less than r. In this section, we will show that under this assumption the model can't reach its global optimum, i.e. 2 = 0. But for other choices from x . Remind that the cost of VAE is z q(z | x) where x R X − 9 x) || || || || | L −∞ (θ, φ) = L {− Z X Eqφ(z x)[log pθ(x | | z)] + KL[qφ(z p(z)] x) || | } ωgt(dx) We have 2 (θ, φ) = L {− Z X 2Eqφ(z x)[log pθ(x | | z)] + 2KL[qφ(z p(z)] x) || | } ωgt(dx) = d log(2πγ) + γ− 1Eqφ(z x x)[ | || − μx(z) || 2] + 2KL(qφ(z x) || | p(z)) ωgt(dx) (cid:9) (4) = d log(2πγ) + γ− qφ(z x)[ | x − μx(z) || 2]dz ωgt(dx) || Z Zz Z X (cid:8) 1 X p(z))ωgt(dx) x) || 2KL(qφ(z | + Z X Following the two facts: 1. Lebesgue measure on the real numbers is σ-finite. 2. z ∈ Rκ and x , where X ∈ X is a r-dimensional manifold embedded in Rd. and referring to Fubini's theorem, we can switch the integration order of ωgt(dx) and dz. Assume Rκ is permutable. For a r-dimensional manifold, we can always use the components of z the first r dimensions of z to get φ(x), i.e. once given r-dimensional information, there always exists a decoder, s.t. μx(z1:r) = μx(z). Denote by μz(x)1:r and σ2 z (x)1:r the mean and covariance matrix of the first r dimension of z. After switching the integration order, we have ∈ Z ⊆ κ 15 6 6 1 γ Zz X Z 1 γ Zz Z 1 γ Zz = = X Z X qφ(z x)[ x || | − μx(z) || 2]dz ωgt(dx) + Z X [d log(2πγ) + 2KL(qφ(z p(z))] ωgt(dx) x) || | qφ(z x)[ x || | 2]ωgt(dx)dz + [d log γ + 2KL(qφ(z p(z)) + O(1)] ωgt(dx) x) || | || μx(z1:r) − 1 σ2 z (x)1:r e− 1 2 (z − | Z X μz (x)1:r)T σ−2 z (x)1:r(z p(z)) + O(1)] ωgt(dx) x) || | r Z (2π)r X ∈Z p [d log γ + 2KL(qφ(z | μz(x)1:r)[ − x || − μx(z) || 2]ωgt(dx)dz+ C.1.1 Analyze the density with respect to σz(x)1:r and z1:r r and view it as a Next, for the integral over constant. Since μx is a deterministic function, μx(z1:r) is also constant. The log-density on z1:r is in the first term in (5), we examine a certain z1:r ∈ Z X (5) μz(x)1:r − r 2 log( 1 2π ) + 1 2 log 1 2 − 1 σ2 z | | (z1:r − Take the derivative of σ2 z , we have μz(x)1:r)T σ− z (z1:r 2 μz(x)1:r) − 2 σ− z 2 − + 1 2 2 z (z1:r σ− − μz(x)1:r)(z1:r μz(x)1:r)T σ− z 2 − − z is smaller than (z1:r When σ2 μz(x)1:r)(z1:r − the density is monotonically increasing when σ2 (z1:r z ≺ − tonically decreasing when σ2 μz(x)1:r)(z1:r z ≻ − continuous, so we have L μx(z1:r) z1:r − | ≥ | − equality comes from the fact that we can choose optimal μz and μx, s.t. μx(μz(x)1:r) = x. Now we can divide x into four cases and we assume all the four disjoint cases exist when analyzing, otherwise the integration over corresponding domain is 0 which would not affect our result. The four cases are as follows: μz(x)1:r)T , the second term's rate is larger. Thus μz(x)1:r)T and mono- μz(x)1:r)(z1:r μz(x)1:r)T . Note that μx is L-Lipschitz . The μx(μz(x)1:r) | (z1:r − μz(x)1:r μx(z1:r) − = ∈ X x | − | | 1. 2. 3. 4. ≺ − − − ≺ (z1:r (z1:r { = + { < + z (x)1:r z (x)1:r μz(x)1:r)(z1:r μz(x)1:r)(z1:r x : σ2 } ∞ x : σ2 } ∞ x : (z1:r x : (z1:r X1(z1:r) = μz(x)1:r || X2(z1:r) = μz(x)1:r || X3(z1:r) = X4(z1:r) = X1(z1:r) μz(x)1:r)(z1:r μz(x)1:r)T { − ∪ X4(z1:r) cover the whole space of x related to z1:r, i.e. − − − z (x)1:r (z1:r ≺ μz(x)1:r)(z1:r ∪X2(z1:r) = z (x)1:r (cid:23) μz(x)1:r)(z1:r μz(x)1:r)(z1:r } X μz(x)1:r)T μz(x)1:r)T μz(x)1:r)T μz(x)1:r)(z1:r z (x)1:r x : σ2 x : σ2 x : σ2 { (z1:r − − (z1:r (cid:22) (cid:22) − − { { − − ≺ { μz(x)1:r)T μz(x)1:r)T } ∩ { } ∩ { x : x : z1:r z1:r || || − − σ2 z (x)1:r < σ2 z (x)1:r = ∞} ∞} μz(x)1:r)T } X1(z1:r) and X3(z1:r) ∪ X2(z1:r) ∪ ∪ − . Thus (z1:r). } ∩ { x : z1:r || − μz(x)1:r = || l as the lower bound of σ2 . The integral over X1(z1:r) ∞ z 's eigenvalues, which cannot approach 0 by our assumption. We have X4(z1:r) = X3(z1:r) (i) X1(z1:r) = } + ∞ Denote σ2 σz < + e− 1 σ2 z | | p 1 1 2 (z1:r e− σr l Z X1(z1:r ) ≤ Z X1(z1:r ) will approach 0 as 1 2 (z1:r μz (x)1:r)T σ−2 z (z1:r − μz (x)1:r)[ − x || − μx(z1:r) || 2]ωgt(dx)r μz (x)1:r)T σ−2 z (z1:r − μz(x)1:r)[L2 − z1:r || − μz(x)1:r) || 2]ωgt(dx)r z1:r || − μz(x)1:r = + || . Thus ∞ 0dz = 0 z1:r R 16 (ii) + X2(z1:r) = } ∞ x : σ2 z (x)1:r { (z1:r − ≺ μz(x)1:r)(z1:r μz(x)1:r)T − } ∩ { x : z1:r || − μz(x)1:r < || 2 {|| and z1:r α 2 > α Denote N = maxx } ∩ X2(z1:r), x : 2 (z1:r) = x { − || where α 9 0. If for any α, ∈ X2(z1:r), x = μx(z1:r). How- , we have for all x ever, if μx(x)r z (μx(z1:r)) ≺ − − μz(μx(z1:r)))T . We can find a pair of μx and μz, e.g. identity mapping, s.t. μz(μx(z1:r)) = z1:r and σ2 . Thus, ∈ X2(z1:r) and once μz(x)1:r } || α 2 (z1:r) = ∈ X2(z1:r), i.e. μx(z1:r) satisfies σ2 z (μx(z1:r)) < 0, which is impossible. Thus μx(z1:r) / X2(z1:r) || μz(μx(z1:r)))(z1:r , there exists an α, s.t. X2(z1:r) = . The integral over X2(z1:r) α 2 (z1:r) μx(z1:r) (z1:r = − = X X X ∅ ∅ ∅ ∅ e− 1 σ2 z | | p 1 2 σ−2r e− σr l 1 Z X2(z1:r) 1 = ≥ Z X2(z1:r) 1 e− σr l α σr l e− ≥ 1 2 σ−2r l N [ 2 σ−2r l N 1 2 (z1:r μz (x)1:r)T σ−2 z (z1:r − μz(x)1:r)[ − x || − μx(z1:r) || 2]ωgt(dx)r l N [ x || − μx(z1:r) || 2]ωgt(dx)r x [ || − μx(z1:r) || 2]ωgt(dx)r + Z X α 2 (z1:r) Z( X α 2 (z1:r))c x [ || − μx(z1:r) || 2]ωgt(dx)r] The last inequality comes from the fact that ̟( the non-negativity of the second term. X α 2 (z1:r)) 1 where ̟ is a counting measure and ≥ { (iii) x : (z1:r X3(z1:r) = σ2 z (x)1:r < μz(x)1:r)(z1:r In this case the density is monotonically decreasing with σz. Since σz upper bound of the eigenvalues of σ2 μz(x)1:r α′ in (ii), define 3 (z1:r) = z . It can also bound 2 > α′ μz(x)1:r)T μx(z1:r) z1:r x : − − (cid:22) x || − } ∩ X3(z1:r). If { || − X || ∞} = + ∞ || X3(z1:r) , denote σ2 u as the 2. Use the same strategy = , we have ∅ 1 2 (z1:r e− 1 σ2 z | | p 1 2 σ−2r+2 e− σr u u r Z X3(z1:r) r = ≥ Z X3(z1:r) 1 e− σr u α′ σr u e− ≥ r 2 σ−2r+2 u 2 σ−2r+2 u μz(x)1:r)T σ−2 z (z1:r − μz(x)1:r)[ − x || − μx(z1:r) || 2]ωgt(dx)r x [ || − μx(z1:r) || 2]ωgt(dx)r [ Z X α′ 3 (z1:r) x [ || − μx(z1:r) || 2]ωgt(dx)r + Z( X α′ 3 (z1:r))c x [ || − μx(z1:r) || 2]ωgt(dx)r] (iv) X4(z1:r) = x : (z1:r μz(x)1:r)(z1:r μz(x)1:r)T σ2 z (x)1:r = − In this case the density is monotonically decreasing with σz, and the dominant factor is ∞} − (cid:22) { Since σz is arbitrarily large, it is obvious that μx(z1:r) 2. Note that ). σ2 z | | p > tr(σ2 z ) z1:r − ≥ || μz(x)1:r 2 || ≥ √ | . | 1 σ2 z (x)1:r 1 x L2 || − || The integral over | * | X4(z1:r) = det( * e− 1 2 (z1:r − μz(x)1:r)T σ−2 z (z1:r μz (x)1:r)[ − x || − μx(z1:r) || 2]ωgt(dx)r Z X4(z1:r) ≤ Z X4(z1:r) 1 σ2 z | z1:r || | p L2 | p . z → ∞ will approach 0 as σ2 μz(x)1:r) − σ2 z (x)1:r || | 2 ωgt(dx)r 17 6 6 6 6 C.1.2 Analyze the existence of the above cases and get a lower bound = We have z1:r X ∪ is 0. To get a lower bound of (5), we need to prove x X1 ∪ X2 ∪ X3 ∪ X4, where X μz(x)1:r z1:r i = < X X2 ∪ X3 6 exists. = ∅ i(z1:r), i = 1, 2, 3, 4. In X1 ∪ X4, the integral , i.e. there must exists z1:r such that − || ∞} , then in the KL term the trace tr(σ2 z (x)1:r) = + ∞ . Thus to minimize loss, σz < which cannot be ∞ ∞} ∩ {|| ∈ { σ2 z (x)1:r < For σz(x)r, if σz(x)r = σ2 offset by z (x)1:r log | < | μz(x)1:r − − For , s.t. , with L-Lipschitz continuity, for any z∗1:r, we can find a x∗ z1:r || || = 0. Denote Uδ(x)r as a neighborhood of x with the radius of δ. For any μz(x∗)1:r z∗1:r − || Uδ(x∗) , we have x ∈ ∈ X ∞ || . ∞ μz(x)1:r || z∗1:r|| − = || μz(x)1:r − μz(x∗)1:r L x || − x∗ || ≤ Lδ || ≤ Uδ(x′) is with positive measure. If for any x ⊂ X2 ∪ X3. To get a positive lower bound, we need to prove there exists x′ and δ, s.t. the Uδ(x1), μz(x)1:r = z1 1:r, = z2 2 δ, and z1 1:r. 1:r 6 Uδ(x1) ∈ So Uδ(x∗) image of μz(x′) for x Uδ(x2), μz(x)1:r = z2 and for any x ∈ Note that can always choose a larger δ to get such pair of Uδ(x2), μz(x3) should equals z1 exists x∗, s.t. μz(Uδ(x∗)) has a positive measure. ∩ 1:r simultaneously which is impossible. Thus, there must x2 || ≤ . Then there exists x3 1:r, which satisfy δ < || x1, x2 } 1:r and z2 ∈ x1 − ∈ { 3 With the existence of x∗, such that Uδ(x∗) ⊂ X2 ∪ X3 and positive measured μz(Uδ(x∗)), we have e− 1 2 (z1:r − μz (x)1:r)T σ−2 z (z1:r μz (x)1:r)[ − x || − μx(z1:r) || 2]ωgt(dx)rdz1:r+ e− 1 2 (z1:r − μz(x)1:r)T σ−2 z (z1:r μz (x)1:r)[ − x || − μx(z1:r) || 2]ωgt(dx)rdz1:r+ 1 γ Zz1:r Z X 1 (2π)r σ2 z | [d log γ + 2KL(qφ(z p | 1 (2π)r X2∪X3 | [d log γ + 2KL(qφ(z p l N , 1 e− min 2 σ−2r α σr l [d log γ + 2KL(qφ(z { σ2 z | x) | || α′ σr u X Z 1 γ Zz1:r Z X Z 1 γ Zz1:r = ≥ = Z X C γ p(z)) + O(1)] ωgt(dx) x) || | p(z)) + O(1)] ωgt(dx) r 2 σ−2r+2 u e− dz1:r+ } p(z)) + O(1)] ωgt(dx) x) || | + d log γ log σ2 z (x) | | − ωgt(dx) + O(1) (cid:3) Z X (cid:2) Here denote C = min α σr l { e− z1:r R 1 2 σ−2r l N , α′ σr u e− C.1.3 Analyze the rate of the lower bound r 2 σ−2r+2 u dz1:r for simplicity. } (6) The first term C γ grows at a rate of O( 1 γ ). Because σ2 z is at a lower rate than γ, we have O(d log γ log σ2 z (x) | | − ) < O( − (d − κ) log 1 γ ) and the right part decreases at a rate of log 1 γ ), which means the γ . When γ increase from reconstruction term cannot be offset by the decrease from the KL term. Moreover, from the fact that O( 1 γ ), when γ is small enough, the loss is monotonically decreasing with γ. γ ) > O(log 1 γ ) > O(log 1 0, O( 1 → Therefore, when γ can never achieve optimum. Thus, there must exist some active dimensions whose variance σ2 satisfies σ2 , which means at this case, the model z (x) 0 to reach the global optimum. We can learn from the expression 0, the lower bound cannot approach → z (x) = O(γ) as γ −∞ → 18 of C that as long as the number of such active dimensions whose encoder variance σ2 z (x) = O(γ) exceeds r, as γ approaches zero, the reconstruction term is at most at the rate of O(1). Next, we will show that when there exist at least r such active dimensions, the VAE model's optimum is achievable. C.2 The number of active dimensions whose encoder variance σ2 z (x) = O(γ) equals r In this section, we get an upper bound and a lower bound and show that both case the cost is (d r) log γ + O(1). − C.2.1 An Upper Bound of ELBO Get an upper bound by Lipschitz We can write z = μz(x) + ε Since decoder mean function μx(z; θ) is L-Lipschitz continuous, we have: ∗ σz(x), where ε N (0, I). ∼ ∼ Ez =Eε ∼ Eε ≤ ∼ =Eε ∼ qφγ (z | N (0,I)[ N (0,I)[ N (0,I)[ || || x)[ x μx(z) 2] − || || μx(μz(x)1:r) L(μz(x)1:r Lσz(x)1:rε − 2] 2] μx(z1:r) − μz(x)1:r − || σz(x)1:rε) 2] (7) || || where the first equality comes from the fact that we can choose optimal encoder-decoder pairs such that μx(μz(x)1:r) = x. Take it into || , L 2 (σz(x)1:r, γ) L = ≤ Z X L2 γ Z X (cid:2) Ez (cid:20) qφ(z ∼ x)[ | 1 γ || x − μx(z) || 2 2] + d log 2πγ log | − σ2 z (x)1:r log | | − σ2 z (x)r+1:κ Eε ∼ N (0,I)[ || σz(x)1:rε || 2] + d log 2πγ log | − σ2 z (x)1:r log | | − σ2 z (x)r+1:κ | | + O(1) (cid:21) ωgt(dx) + O(1) (cid:3) ωgt(dx) (8) We get an upper bound of , denoted as ̃ . L L Analysis of the Upper Bound ̃ L that it is at a rate of O((d r) log γ). We can get implicit optimal values of ̃ L − We have optimal γ∗ Now we only pay attention to the upper bound ̃ L and try to prove : γ∗ and σ∗(x)2 1:r by taking the derivative of ̃ L separately. γ∗ = arg min γ ̃ (θ, φ) = L L2 d Eε ∼ N (0,I)[ || σz(x)1:rε 2] || (9) and ∂2 ̃ (σz(x)1:r, γ) L ∂σz(x)1:r = = 2L2σz(x)1:r γ 2L2σz(x)1:r γ we have the optimal variance of ̃ : L Eε ∼ N (0,I)[εεT ] − 1 2σz(x)− 1:r 2σz(x)− 1:r = 0 1 − σ∗z (x)2 1:r = γ I L2 (10) It shows that 1 √γ σ∗z (x)1:r = O(1) when it reaches the optimal value. 19 Take the optimal values into ̃ L , then we get ̃ L as a function of γ∗ and σ∗z (x)1:r: 2 ̃ L (γ∗, σ∗z (x)1:r) = (cid:20) Z X = Z X L2 γ∗ Eε ∼ N (0,I)[ || σz(x)1:rε || 2] + d log 2πγ∗ log | − σ∗z (x)2 1:r| − log | σz(x)2 r+1:κ| + O(1) (cid:21) ωgt(dx) d + d log(2πγ∗) (cid:20) log | − γ∗ log | σz(x)2 r+1:κ| + O(1) (cid:21) ωgt(dx) =d log(2πγ∗) r log γ∗ log | − − + O(1) r+1:κ| I L2 | − σz(x)2 Define as γ∗ { → κ i=1 as the eigenvalues of σz(x). Denote ̃r as the number of λi 0. We have } (11) κ i=r+1 that will go to 0 λi { } (γ∗) = d log γ∗ 2 ̃ L r log γ∗ 2 − − r+ ̃r Xi=r+1 κ log λi 2 − Xi= ̃r+r+1 log λi + O(1) (12) To minimize (12), we want ̃r to be as small as possible and at the best equals 0 which is achievable. Since the rest κ r dimensions are irrelevant to γ, at least will not approach 0 when γ 0, we can view them as constants. We have the loss equals ̃r = κ − − − r → C.2.2 A Lower Bound of ELBO (d − r) log γ + O(1) (13) From C.1 we have analyzed the loss performance when there are less than r active dimensions whose variance goes to zero at a rate no lower than γ. In this part, we focus on the case that r latent dimensions are such active dimensions whose encoder variance goes to zero at a rate of O(γ). Without loss of generality, we assume the first r latent dimensions satisfy σ2 z (x)1:r = O(γ) as γ 0. We have → 2 (θ, φ) = L = Z X Z X {− 1 γ (cid:26) 2Eqφ(z x)[log pθ(x | | z)] + 2KL[qφ(z p(z)] x) || | } ωgt(dx) Eqφ(z x x)[ | || − μx(z) || 2] + d log(2πγ) + 2KL(qφ(z x) || | p(z)) (cid:27) ωgt(dx) ≥ Z X (cid:8) = Z X (cid:8) d log(2πγ) log σ2 z (x) | | − + O(1) ωgt(dx) d log γ log | − σ2 z (x)1:r log | | − (cid:9) σ2 z (x)r+1:κ | + O(1) ωgt(dx) (cid:9) (14) (d r) log γ − − r) log γ + O(1) ≥ Z =(d X (cid:8) − σ2 z (x)r+1:κ log | | + O(1) ωgt(dx) (cid:9) The inequalities come from the fact that the norm term is non-negative and the active dimensions' rate is no less than γ. For the last equality, we can use the strategy in (12). To minimize the lower bound, there should not be any active dimensions in these r + 1 : κ dimensions. We get an upper bound and a lower bound at the same rate, i.e. log γ with r active latent dimensions. Therefore, the original loss is also with r active dimensions. We have the optimal cost for each x equals (d − r) log γ + O(1) 20 (15) 0, as well as So far, we have get the conclusion in Theorem 1 about the form of ELBO when γ the number and rate of active dimensions. Next, we show that the number of active dimensions can't be greater than r. → C.3 When the number of active dimensions is greater than r Denote now there are m active dimensions and m > r. From (11), in this case ̃r = m loss is − r, and the 1 γ Eqφγ (z x x)[ | || − μx(z) || 2] + d log(2πγ) r r+ ̃r 2 − Xi=1 log λi 2 − Xi=r+1 log λi + O(1) (16) → 0 λi = 0, r+ ̃r i=r+1 log λi is monotonically increases as ̃r increases at the rate of γ ). For the reconstruction term, it is unaffected since we only use the first r latent dimensions γ ), which is larger than the since here limγ Ω(log 1 for reconstruction. Therefore, the loss will increase at the rate of Ω(log 1 loss when m = r. P − 2 In conclusion, only when the number of active dimensions equals r, and these active dimensions' encoder variance σ2 0, the optimal cost is (d r) log γ + O(1). z (x) = O(γ) as γ → − D Proof of Theorem 2 Summary of the proof We focus on analyzing the loss conditioned on a specific c, which is c) = p(z), i.e. a parameter free defined as L prior, and then extend to the case when the prior involves the conditioning variable. The logic flow is as follows: c(θ, φ). We then first construct the proof when pθ(z | 1. The prior is independent of c (a) Following the same proof idea as in Theorem 1, when the number of active dimensions whose encoder variance σ2 k, where k is the number z (x, c; φ) = O(γ) is less than r of effective dimensions of c used in the decoder, the reconstruction error will grow at a rate of O( 1 γ ). This is proven in Section D.1.1; − (b) In Section D.1.2 we show that both the upper bound and the lower bound are (d t) log γ and the exact number of active dimensions is r t. − r + − 2. The prior is a function of c (a) Since involving c in the prior will not affect the reconstruction term, we extend the conclusion in Section D.1.1 to the general case; (b) Show that both the upper bound and the lower bound are (d r + t) log γ and the exact number of active dimensions is r − t. The proof is in Section D.2. − Under CVAE setting, we first make some denotations for proof. Since the encoder, prior, and decoder share the same condition c, the model has flexibility to use part of each c from the three networks. Denote t as the number of effective dimensions of c, and k as the number of effective dimensions of c 1(u1:k), used in the decoder pθ(x | where 0 k effective k ≤ 1(uk+1:t), and this part of information will be included in the dimensions, i.e. μx(μz(c)) = φ− latent variable z. z, c), i.e. there exists a pair of encoder and decoder, s.t. μx(c) = φ− t and is a learnable parameter. The encoder and prior use the rest t − ≤ D.1 When the prior is independent of c, i.e. pθ(z c) = p(z) | In this case, we can write the cost as: 21 2 c(θ, φ) =2 L Z X Eqφ(z x,c)[log pθ(x | | z, c)] + KL[qφ(z x, c) || | p(z)] } ωc gt(dx) c{− 1 γ = = = Eqφ(z x,c)[ x c c | X || − φ− x,c)[ Eqφγ (z Z 1 γ Z | d log(2πγ) + 2KL(qφ(z 1 γ Z Eqφγ (z x,c)[ φ− || || X | c X μx(z, c) 2] + d log(2πγ) + 2KL(qφ(z x, c) || | p(z))ωc gt(dx) || φ− 1(uk+1:r) μx(zk+1:r) || − 2+ μx(c) 2 + || || − p(z))ωc gt(dx) 1(u1:k) x, c) | || 1(uk+1:r) μx(zk+1:r) || − 2 + d log(2πγ) + 2KL(qφ(z x, c) || | p(z))ωc gt(dx) D.1.1 The number of active dimensions whose encoder variance σ2 z (x, c; φ) = O(γ) is less than r k − Following the same proof idea in Theorem 1, assume there is no active dimension in σz(x; φ). For the reconstruction term, it is equivalent to reconstruct a (r k)-dimensional manifold. Thus we can find an lower bound of the cost − 2 c(θ, φ) L C′ γ C′ γ ≥ = + + [d log γ + 2KL(qφ(z x, c) || | p(z)) + O(1)] ωc gt(dx) Z c X d log γ log | − σ2 z (x, c; φ)1:k log | | − σ2 z (x, c; φ)k+1:κ Z c (cid:2) X t+k − | + O(1) (cid:3) ωc gt(dx) (17) where C′ = z1:r−k R min α σr−k l { e− 1 2 σ−2(r−k) l N , α′ σr−k u e− r−k 2 σ−2(r−k)+2 u dz1:r k. − } The first term C ′ γ grows at a rate of O( 1 γ ). Because σ2 z is at a lower rate than γ, we have O(d log γ log σ2 z (x, c; φ) | | − ) < O( − (d − κ) log 1 γ ) and the right part decreases at a rate of log 1 γ ), which means the γ . When γ increase from reconstruction term cannot be offset by the decrease from the KL term. Moreover, from the fact that O( 1 γ ), when γ is small enough, the loss is monotonically decreasing with γ. γ ) > O(log 1 γ ) > O(log 1 0, O( 1 → 0, the lower bound cannot approach Therefore, when γ , which means at this case, the model → can never achieve optimum. Thus, there must exist some active dimensions whose variance satisfies σ2 0 to reach the global optimum, and it is showed in z (x, c; φ)i = O(γ), i = 1, . . . , κ as γ C′ that as long as the number of such active dimensions exceeds r k, as γ approaches zero, the reconstruction term is at most at the rate of O(1). Next, we will show that when there exist at least r k such active dimensions, the CVAE model's optimum is achievable. −∞ → − − D.1.2 Bounds of CVAE cost The upper bound We have z1:t μz(x, c; φ)t k + σz(x; φ)t k+1:r − − − k+1:r k = μz(x, c; φ)1:t kε2, where ε1 ∼ − − k + σz(x, c; φ)1:t k), ε2 ∼ N (0, I t − − kε1 and zt − t). N (0, I r − − The loss is: k+1:r = 22 1 γ 1 γ φ− || 1 Eε1∼ γ d log γ = ≤ Eqφγ (z x,c)[ x || − | μx(z, c) || 2] + d log(2πγ) + 2KL(qφ(z x, c) || | p(z)) Eqφγ (z x,c)[ || | 1(ut+1:r) φ− 1(u1:k) − μx(zt − k+1:r − k) Lσz(x, c; φ)1:t − N (0,I t−k)[ || log | − σ2 z (x, c; φ)1:t − k | − μx(c) 2 + φ− 1(uk+1:t) μx(z1:t 2+ || − || 2] + d log(2πγ) + 2KL(qφ(z 1 Eε2∼ kε1|| γ σ2 z (x, c; φ)t log N (0,I r−t)[ 2] + k+1:r k || − − − | | || + O(1) k) − || x, c) p(z)) | || Lσz(x, c; φ)t − k+1:r 2]+ kε2|| − (18) z (x, c; φ)1:t Denote σ2 − the derivative of σz(c; φ) and σz(x, c; φ)t σz(x, c; φ) are independent, we can make both achieve optimum. We have: u c . Take L k separately. Because the diagonal elements in z (c, φ) for simplicity, and denote the upper bound of loss as k as σ2 k+1:r − − u c (γ, k) = L − (t − k) log γ (r t) log γ + d log γ + O(1) − − To minimize u c (γ, k), the optimal k is t, thus the upper bound is: L u r + t) log γ + O(1) c (γ) =(d L The lower bound We have show that there must be at least r O(γ), otherwise the loss will increase at a rate of O(γ). We can get a lower bound − − k active dimension at a rate of Eqφγ (z 1 γ d log γ ≥ x,c)[ | − log (r x μx(z, c) || − || σ2 z (x, c; φ)1:r k) log γ | − log − r + k) log γ + O(1) − 2] + d log(2πγ) + 2KL(qφ(z log σ2 z (x, c; φ)r | − | σ2 z (x, c; φ)r k+1:κ k+1:κ | − + O(1) − | k | p(z)) x, c) | || + O(1) l c(γ, k), to minimize it, we have k = t, thus the lower bound is L d log γ (d ≥ ≥ Denote the lower bound as − − l c(γ) = (d L − r + t) log γ + O(1) Both t) log γ + O(1) and the number of active dimensions is r l c are at a rate of O(log γ), we come to the conclusion that the ELBO is (d L u c and L c) = p(z). t when pθ(z − | D.2 The general case Define a trainable parametric prior of z, i.e. z z (c; θ)). Since involving c in the ∼ prior doesn't affect the reconstruction term, we have the conclusion in Section D.1.1 that there are at least r k active latent dimensions at a rate of O(γ). Without loss of generality, we assume the first r − k dimension of σ2 k = O(γ). z (x, c; φ), i.e. σ2 z (x, c; φ)1:r N (μz(c; θ), σ2 − − The upper bound The loss is: (19) (20) (21) r + − N (0,I t−k)[ ≤ | x,c)[ Eqφγ (z 1 γ 1 Eε1∼ γ σ2 z (c, φ) log | + (μzφ(1:t + (μzφ(t − κ + tr(σ2 − x || − μx(z, c) || 2] + d log(2πγ) + 2KL(qφ(z x, c) || p(z c)) | | Eε2∼ N (0,I r−k)[ || Lσz(x, c; φ)t − k+1:r − 1 γ 2] + Lσz(c; φ)ε1|| || σ2 z (x, c; φ)t log k))T σ2 k+1:κ))T σ2 | μzθ (1:t − μzθ (t − z (c; θ)1:t − | − k) − − k+1:κ) − z (c, φ)/σ2 log σ2 z (x, c; φ)r k+1:r − − 1 z (c; θ)− 1:t − z (c; θ)− t − k | − | k(μzφ(1:t k) − − 1 k+1:κ(μzφ(t − z (c; θ)t z (x; φ)/σ2 k) + tr(σ2 − μzθ (1:t k+1:κ k)) − k+1:κ) − k+1:κ) − μzθ (t − k+1:κ)) | + log k | (22) 2] + d log(2πγ) kε2|| σ2 z (c; θ)1:t − − σ2 z (c; θ)t + log | | k+1:κ | − 23 Since we can only control k dimensions of the prior when training, take the derivative of μz(c; θ)1:k and σz(c; θ)1:k, we have μz(c; θ)∗1:t σ2 z (c; θ)∗1:t − − k = μz(c; φ) k = (μz(c; φ) μz(c; θ)∗1:t − − k)(μz(c; φ) μz(c; θ)∗1:t − − k)T + σ2 z (c, φ) = σ2 z (c, φ) (23) Let them achieve the optimal values. The loss becomes E 1 γ Lσz(c; φ)ε1|| ε1∼ log N (0,I t−k)[ || σ2 z (x, c; φ)t | − + (μzφ(t k+1:r − μzθ (t k+1:κ) − − − E 2] + 1 ε2∼ γ σ2 z (x, c; φ)r log k | − k+1:κ))T σ2 z (c; θ)− t − | − N (0,I r−k)[ Lσz(x, c; φ)t − k+1:r kε2|| − || 2] + d log(2πγ) − k+1:κ | 1 k+1:κ(μzφ(t + log σ2 z (c; θ)r − μzθ(t | k+1:κ) − − − + tr(σ2 k+1:κ | k+1:κ)) + t z (x; φ)/σ2 κ k − − (24) z (c; θ)k+1:κ) From (24) we observe that if we have a flexible enough prior, there are t won't provide any loss both in reconstruction and kl term. To minimize (24), σ2 k = γ I σ2 z (x; φ)∗t − when it approaches 0 as constants, we have k latent dimensions that z (c, φ)∗ = 0 and L2 . Let them be the optimums, and view the terms that are irrelevant with γ k+1:r − − The lower bound to get the lower bound, we have u′ c = (d L − r + t) log γ + O(1) (25) x,c)[ x μx(z, c) 2] + d log(2πγ) + 2KL(qφ(z x, c) | c)) p(z || | + log σ2 z (x, c; φ)r μzθ(t k+1:κ − k+1:κ))T σ2 | | σ2 z (c; θ)r k+1:κ − 1 k+1:κ(μzφ(t + | k+1:κ) − − z (c; θ)− t − − log | − | k+1:κ) − − + O(1) μzθ (t − k+1:κ)) + O(1) Eqφγ (z 1 γ d log γ tr(σ2 ≥ =d log γ d log γ ≥ =(d − − − | || − || σ2 z (x, c; φ)t log − | − z (x; φ)/σ2 z (c; θ)k+1:κ) + (μzφ(t σ2 log z (x, c; φ)t t) log γ + O(1) (r k+1:r k+1:r − − − k k | | − r + t) log γ + O(1) (26) The last inequality comes from the conclusion that there are at least r k active dimensions at a rate of O(γ) and the loss is monotonously increase with γ. In this case k can be any integer in [0, t], thus we cannot determine how many dimensions are used by the encoder and decoder separately. But no matter what value k is, the cost of CVAE is − In conclusion, after integrating over , we have C (d − r + t) log γ + O(1) (θ∗, φ∗) = L Z C c(θ∗, φ∗)νgt(dc) = (d L − r + t) log γ + O(1) E Proof of Theorem 3 Summary of the proof We first define a space of sequences, and then separate the sequences into two categories according to the performance of the KL term. In Section E.1, we analyze the case when the Kl term equals O(log 1 γ ), and in Section E.2, the rate of KL term is higher than O(log 1 γ ). . In both categories, we prove that the whole cost cannot go to −∞ (θ, φ). Define S as the set of the sequences, and the sequence is Let θ∗, φ∗ = arg minθ,φ S. defined as xl L { ∞l=1 ∈ } ⊂ X 24 x Consider when l equals to a constant l0, we have the prior as qφ∗ (z qφ∗ (z | same as the encoder at l = l0, and the encoder as qφ∗ (z points are l0). Next, consider l = l0 + 1, we have the prior as qφ∗ (z x<l0 ), and encoder as | l0 ), which is exactly the l0+1). The cost function at these two x x ≤ ≤ ≤ | | (l0) c L (θ∗, φ∗) = Eqφ∗ (z − x≤l0 )[log pθ∗(xl0 | | z, x<l0)] + KL[qφ∗ (z x ≤ l0 ) || | qφ∗ (z | x<l0 )] and (l0+1) c L (θ∗, φ∗) = Eqφ∗ (z − x≤l0+1)[log pθ∗(xl0+1| | z, x ≤ l0)] + KL[qφ∗ (z x ≤ l0+1) || | qφ∗ (z l0)] x ≤ | respectively. Next, we separate the sequences with varied values into two cases. E.1 KL term is at a rate of O(log 1 γ ) when γ 0. → Denote log qφ(z struction term | l) x ≤ − log qφ(z | x<l) = fl(γ) = O(log 1 γ ). In this setting, we analyze the recon- Eqφ∗ (z | − qφ∗ (z x≤l0 )[log pθ∗(xl0 | l0 ) log pθ∗(xl0 | x ≤ | z, x<l0 )] z, x<l0)dz qφ∗ (z x ≤ l0)[ xl0 − μ∗x(z) || || | 2]dz + d log(2πγ) = = Z Z 1 γ Z Z Similarly we have = Eqφ∗ (z | x≤l0+1)[log pθ∗(xl0+1| xl0+1 − l0+1)[ x || ≤ | qφ∗ (z − 1 γ Z Z z, x ≤ l0 )] μ∗x(z) || 2]dz + d log(2πγ) With the condition that log qφ(z l) x ≤ | − log qφ(z | x<l) = fl(γ) = O(log 1 γ ), we have KL[qφ(z =Eqφ(z Eqφ(z ≤ | | | || x qφ(z l) x<l)] | ≤ x≤l) [log qφ(z l) x x≤l)[fl(γ)] = fl(γ) ≤ | log qφ(z x<l)] | − (27) (28) (29) That shows KL term is either small than a constant or goes to infinity at a slower rate than rate of log 1 x<l), from which we have 0. We can also get qφ(z x<l) 1 | efl (γ) qφ(z | ≥ γ when γ → qφ(z x<l) | qφ(z l) x ≤ | ≥ qφ(z l)( x ≤ | − 1 efl(γ) − 1) (30) Together we have 25 Eqφ∗ (z z, x<l0 )] Eqφ∗ (z | x≤l0 )[log pθ∗(xl0 | xl0 − l0) || x ≤ | qφ∗ (z μ∗x(z) || − 2dz + | x≤l0+1)[log pθ∗(xl0+1| xl0+1 − l0+1) || x ≤ | z, x ≤ l0 )] μ∗x(z) || 2dz (cid:21) + 2d log(2πγ) qφ∗(z Z Z − 1 γ (cid:20)Z 1 γ Z [ Z Z Z 1 γ Z [ Z qφ∗ (z Z [qφ∗(z | | = = ≥ = ( Z Z 1 efl0 (γ) − 1 γ Z qφ∗ (z Z 1) Z x | ≤ || (cid:2) qφ(z x Z l0+1) || (cid:2) qφ∗(z | | l0+1) x ≤ | xl0 − μ∗x(z) || 2 + || xl0+1 − μ∗x(z) || 2 dz+ l0 ) x ≤ − l0+1)] x ≤ xl0 − μ∗x(z) || || (cid:3) 2dz] + 2d log(2πγ) [qφ∗(z l0 ) x ≤ − qφ∗(z l0+1)] x ≤ || qφ∗ (z l0+1) x ≤ | xl0 − μ∗x(z) || xl0 − 2 + || μ∗x(z) || 2dz] + 2d log(2πγ) xl0+1 − μ∗x(z) || 2 dz+ (cid:3) l0+1) || xl0 − μ∗x(z) || 2]dz + 2d log(2πγ) ≤ | 1 efl0 (γ) || (cid:20) xl0 − μ∗x(z) || 2 + xl0+1 − μ∗x(z) || || 2 (cid:21) dz + 2d log(2πγ) (31) For any l0 = 1, 2, . . . and all z , we have the following cases: ∈ Z ∈ Z1, μ∗x(z) = xl0 and μ∗x(z) = xl0+1. We have || xl0 − 2 μ∗ x(z) γ || at a rate → ∞ 1. For any z of O( 1 γ ). 2. For any z rate of O( 3. For any z equal Ω(1). γe 1 fl0 (γ) ). ∈ Z3, μ∗x(z) ∈ Z2, μ∗x(z) = xl0+1 and μ∗x(z) = xl0 . We have || xl0+1− γefl0 μ∗ x(z) (γ) 2 || at a → ∞ = xl0 and μ∗x(z) = xl0+1. Both cases above cause the norm term With the setting, the lower bound of reconstruction term is 1 γ Z 1 γ Z 1 γ Z 1 γ Z = ≥ Z Z1 Z3 qφ∗ (z l0+1) x ≤ | 1 efl0 (γ) || (cid:20) xl0 − μ∗x(z) || 2 + μ∗x(z) || 2 (cid:21) dz + 2d log(2πγ) qφ∗ (z qφ∗ (z | | x ≤ l0+1) || l0+1) x ≤ (cid:20) xl0+1 − 1 efl0 (γ) || μ∗x(z) || 2dz + qφ∗ (z x ≤ l0+1) || xl0 − μ∗x(z) || | 2dz+ xl0 − μ∗x(z) || 2 + || 2 μ∗x(z) || (cid:21) dz + 2d log(2πγ) xl0+1 − || 1 γefl0 (γ) Z Z2 xl0+1 − qφ∗ (z x ≤ l0+1) || xl0+1 − μ∗x(z) || | 2dz + 2d log(2πγ) (32) Z1∪Z3 Since the probability mass of xl conditioned on x<l lies on a manifold with at least 1 dimen- i0 , in which sion, i.e. we exclude deterministic sequences, there must exist a sequence 2dz C, where C is a constant, otherwise all the sequences qφ∗ (z S, i = 1, 2, . . . share the same values which violates our assumption. μ∗x(z) || xl+1 − ∞l=1 i l+1) xl ≥ x || { } ≤ | RZ ∈ xl P { Then for (32), there must exist a constant C′, such that } qφ∗(z x ≤ l0+1) || xl0+1 − μ∗x(z) || | 2dz C′ ≥ Z Z1∪Z3 Thus, the lower bound of the cost is C′ γ − 2d log 1 2πγ 26 6 6 6 6 When γ goes to zero, O( 1 for any θ and φ. γ ) > O(log 1 γ ). We get the conclusion that c(θ, φ) = L RX Ω(1)ωgt(dx) E.2 KL term goes to infinity at a rate higher than O(log 1 γ ). In this case, we have l0)] 2KL[qφ∗ (z | σ2 z (x = log | σ2 z (x | ≤ 2 + tr(σ− z (x x ≤ l0 ) | ≤ l0+1) − | l0 )σ2 z (x x qφ∗ (z l0+1) || κ + (μz(x ≤ | l0+1)) ≤ ≤ l0+1) μz(x ≤ − l0 ))T σ− 2 z (x ≤ l0 )(μz(x ≤ l0+1) μz(x ≤ − l0 )) (33) ≤ Thus it can only happen when there are some dimensions where σ2 2 is not, which indicate that tr(σ− z (x z (x ≤ at a rate of Ω( 1 l0 ) is active while σ2 γ ). We have l0+1)) l0 )σ2 z (x z (x ≤ ≤ ≤ → ∞ 2Eqφ∗ (z | − x≤l0+1)[log pθ∗(xl0+1| 2 z (x z (x l0 )σ2 ≤ d log(2πγ) + tr(σ− ≥ κ + (μz(x ≤ l0+1) μz(x ≤ − − σ2 z (x l0+1)) + log | σ2 z (x | l0 )(μz(x 2 z (x ≤ l0 ))T σ− ≤ ≤ ≤ | l0 ) | ≤ l0+1) | ≤ l0+1) z, x ≤ l0)] + 2KL[qφ∗ (z x l0+1) || qφ∗ (z l0)] x ≤ | μz(x ≤ l0 )) − l0+1) (34) Because 2 z (x tr(σ− σ2 z (x≤l0 ) d log(2πγ) + log | | σ2 z(x≤l0+1) | at a rate of Ω( 1 l0 )σ2 l0+1)) z (x | → −∞ a γ ), the whole loss will go to infinity. rate at ≤ ≤ → ∞ of O(log γ) while In summary, in both cases, when summing over l, (θ, φ) will go to infinity. L F Justification of Remark 1 Consider a κ-simple CVAE model with encoder qφ(z Further, let μq(x, c), σq(x, c) be the distributional parameters for z the distributional parameters for z regard to (θ, φ) being z, c). c) and decoder pθ(x | | x, c), μp(c), σp(c) be qφ(z c). Name this model as M , and we have its cost with x, c), prior pθ(z pθ(z ∼ ∼ | | | 2 c(M ; θ, φ) = L = X Z 1 γ Z 2Eqφ(z x,c)[log pθ(x | | z, c)] + 2KL[qφ(z x, c) || pθ(z c)] | } | ωc gt(dx) {− (z; μq(x, c), σq(x, c)) x − μx(z) || 2dzωc gt(dx) || 2KL[qφ(z Z X 1 (2πγ)d exp {− || | z x, c) || μq − 2σ2 q || c)]ωc gt(dx) pθ(z | 2 x }|| − μx(z) || 2dzωgt(dx) Z N X Z + log(2πγ) + = 1 γ Z X Z Z p + log(2πγ) + [log σp log σq κ + μq || − μp || − − Z X 2/σp + tr(σq/σp)]ωc gt(dx) (35) Next, we construct another κ-simple CVAE, M ′, with a standard Gaussian prior, only using compu- tation modules in M . Specifically, the new prior, decoder, and encoder are defined as: (0, I) • Prior: p′(z′) = N • Decoder: p′(x z′, c) = pθ(x | | • Encoder: q′(z x, c) = | N z′ σp(c) + μp(c), c) ∗ (μ′q, σ′q), where 27 – μ′q = (μq(x, c) – σ′q = σq(x, c)/σp(c) − μp(c))/σp(c) With M ′ defined, we are going to show that it has the exact same cost value as the above one during (M ; θ, φ), and the generated data distribution during generation, i.e. training, i.e. (M ′; θ, φ) = L z, c)pθ(z pθ(x p′(x | | L (z′; 0, I) z′, c) c). N ≡ | During training, we have z′ σp(c) + μp(c), σq(x, c)/σp(c) (μ′q, σ′q), thus z′ σp(c)) = σp(c) + μp(c) ((μq(x, c) (μq(x, c), σq(x, c)). Thus, we have ∼ N ∗ − μp(c))/σp(c) ∗ ∼ N ∗ N = Eq(z′ 1 γ Z 1 γ Z Z =Eqφ(z = Z z′ σp(c) + μp(c), c)] | x,c)[log pθ(x | (z′; μ′, σ′) N ∗ x || − μx(z′ ∗ σp(c) + μp(c)) || 2dz′ + log(2πγ) (z; μq(x, c), σq(x, c)) N x,c)[log pθ(x | | z, c)] x − μx(z) || 2dz + log(2πγ) || Besides, we also have KL[q′(z′ x, c) (μq(x, c) | (0, I)] μp(c))/σp, σq(x, c)/σp(c) N μq(x, c) ||N − μp(c))/σp − || (0, I)] ||N 2 + tr(σq/σp) κ log(σq/σp)] − − 2/σp + tr(σq/σp)] [ = =KL[ 1 2 1 2 || = [log σp =KL[qφ(z log σq − x, c) − pθ(z κ + μq || − μp || c)] | || | In terms of generation equivalence, for any z′p ∼ N (0, I), we have p′(x | =pθ(x | =pθ(x | =pθ(x | z′, c)p(z′; 0, I) σp(c) + μp(c))p(z′; 0, I) ∗ z′ z)p(z; μp(c), σp(c)) z)pθ(z c) | (36) (37) (38) Therefore we conclude that M ′ and M share the same cost value, i.e. and equivalent data generation distributions. c(M ′; θ, φ) = L c(M ; θ, φ), L 28
http://arxiv.org/abs/2302.11751v1
2023-02-23T02:36:27
2023-02-23T02:36:27
Data-Free Diversity-Based Ensemble Selection For One-Shot Federated Learning in Machine Learning Model Market
The emerging availability of trained machine learning models has put forward the novel concept of Machine Learning Model Market in which one can harness the collective intelligence of multiple well-trained models to improve the performance of the resultant model through one-shot federated learning and ensemble learning in a data-free manner. However, picking the models available in the market for ensemble learning is time-consuming, as using all the models is not always the best approach. It is thus crucial to have an effective ensemble selection strategy that can find a good subset of the base models for the ensemble. Conventional ensemble selection techniques are not applicable, as we do not have access to the local datasets of the parties in the federated learning setting. In this paper, we present a novel Data-Free Diversity-Based method called DeDES to address the ensemble selection problem for models generated by one-shot federated learning in practical applications such as model markets. Experiments showed that our method can achieve both better performance and higher efficiency over 5 datasets and 4 different model structures under the different data-partition strategies.
[ "Naibo Wang", "Wenjie Feng", "Fusheng Liu", "Moming Duan", "See-Kiong Ng" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11751v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11751v1", "@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" ]
Data-Free Diversity-Based Ensemble Selection For One-Shot Federated Learning in Machine Learning Model Market Naibo Wang, Wenjie Feng, Fusheng Liu, Moming Duan, See-Kiong Ng Institute of Data Science, National University of Singapore [email protected]; [email protected]; [email protected]; [email protected]; [email protected] 3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 1 5 7 1 1 . 2 0 3 2 : v i X r a Abstract-The emerging availability of trained machine learn- ing models has put forward the novel concept of Machine Learning Model Market in which one can harness the collective intelligence of multiple well-trained models to improve the performance of the resultant model through one-shot federated learning and ensemble learning in a data-free manner. However, picking the models available in the market for ensemble learning is time-consuming, as using all the models is not always the best approach. It is thus crucial to have an effective ensemble selection strategy that can find a good subset of the base models for the ensemble. Conventional ensemble selection techniques are not applicable, as we do not have access to the local datasets of the parties in the federated learning setting. In this paper, we present a novel Data-Free Diversity-Based method called DeDES to address the ensemble selection problem for models generated by one-shot federated learning in practical applications such as model markets. Experiments showed that our method can achieve both better performance and higher efficiency over 5 datasets and 4 different model structures under the different data-partition strategies. Index Terms-Ensemble Selection, One-Shot Federated Learn- ing, Machine Learning Model Market, Non-IID, Ensemble Learn- ing, Data Privacy. I. INTRODUCTION To address the increasing demands on data privacy protec- tion while satisfying the growing appetites for more data for machine learning tasks, federated learning [1] (FL) has become the mainstay for enabling collaborative machine learning on decentralized devices/parties without seeing any of their data. However, traditional multi-round federated learning training process has its drawbacks: for m clients and n training rounds, the server can acquire O(mn) gradients or models, which can possibly reveal a great deal of sensitive information of the clients' local data and violate the privacy protection setting [2]. One-shot federated learning [3] has been proposed to further protect the privacy of clients, by only requiring the clients to send their final well-trained models to the server once. In this way, not only the privacy of clients can be better protected, the communication costs are also significantly decreased. However, the model generated by one-shot feder- ated learning is often less accurate than the model generated by conventional federated learning. As a result, the one-shot federated learning method is unsuitable for applications such as medical diagnosis, where the model's accuracy is crucial. The emerging availability of pre-trained machine learning models for various machine learning tasks has put forward the novel concept of Machine Learning Model Market [4] (beyond model management systems like modelDB [5] or huggingface [6]) to harness the collective intelligence from multiple well- trained models in a data-free manner. Clients can upload their individual well-trained models to the market server, and the server can select multiple models from its database and perform collective machine learning (e.g., ensemble learning or model fusion) to enhance the performance of the targeted machine learning task (e.g. image or text classification). Compared to model fusion, ensemble learning [7] is com- paratively straightforward and cost-effective to harness the power of collective machine intelligence to boost task perfor- mance in a data-free manner. For example, a classic ensemble learning method is the Voting method by which multiple models will vote together to produce the final classification results. However, selecting all available models from the model market for ensemble learning is not always the most effective strategy. As shown by Zhou et al. [8], many could be better than all when ensembling neural networks. In addition, testing each incoming sample m times, when we have a large number of m models in an ensemble team, can also be time-consuming and inefficient. As such, we focus on the ensemble selection or ensemble pruning [9] problem, which aims to find a good subset of base models for ensemble from the model market. A key consideration for ensemble selection is the model diversity. Numerous papers have demonstrated that the more diverse the models, the higher the ensemble's performance will have [10], [11]. While numerous model diversity calculation methods have been proposed to maximize model diversities, they typically require access to the local datasets of the parties which is not possible in the one-shot federated learning setting of model markets. As such, none of the existing methods can be utilized to calculate model diversity within an ensemble team under the one-shot federated learning setting. In this work, we propose a novel Data-Free Diversity-Based Ensemble Selection framework called DeDES for selecting strong ensemble teams for ensemble learning, whose models are sourced from the machine learning model market and trained by one-shot federated learning. We perform a series of studies to show that our presented method is robust, efficient, and successful for various data partitions (especially non- i.i.d data), datasets, and model structures. To the best of our knowledge, this is the first paper to systematically deal with the problem of ensemble selection for one-shot federated learning, which is a valuable application for machine learning model market. Fig. 1 depicts our scenario. Clients will train their models locally by their own dataset until convergence and then upload their models to the model market. To conduct ensemble learning, the server will select, based on our algorithm, a good ensemble team from all models with the same task on the model market. Note that during the whole process, the server has no access to the local datasets of clients at all, which is what we mean by data-free. The contributions of our paper are as follows: 1. We proposed a formal formulation of the ensemble selection problem to facilitate a clearer comprehension of the topic; 2. We presented a Data-Free Diversity-Based Ensemble Se- lection framework DeDES for One-Shot Federated Learning which can evaluate model diversity and conduct ensemble pruning with no data exposure; 3. We proposed a technique for selecting the representative model inside a cluster to improve the performance of the final ensemble learning; and 4. We conducted a set of comprehensive experiments to illustrate the efficacy and efficiency of the proposed ensemble selection approach. Our codes and supplementary material are available on- line 1. II. RELATED WORK Various federated learning systems [12], [13] have been proposed to assist various parties in cooperatively training a global model without disclosing their data. In particular, one- shot federated learning proposes to train a global model using a single round of server-client communication. FedKT [4], Fusion Learning [14], etc. are all good examples of one-shot federated learning; however, none of them tackle the ensemble selection problem for one-shot federated learning. Lately, with the popularity of utilizing pre-trained models, there is emerging interest in Machine Learning Model Market [15] as a platform for users to exchange their trained models from others, and to harness the collective intelligence for the targeted machine learning task by combine the models. Note that the model market is a concept differs from previous concepts such as model management systems like ModelDB [5] or huggingface [6] which only include the fundamen- tal model manipulation features of upload, download, and search. Or TFX [16] which aims to deploy production ML pipelines. The goal of model market is to enable collaborative machine learning through utilizing the collective intelligence of multiple machine learning models, using model sharing, model unlearning, model pruning, model compression, model valuation, model recommendation, model ensemble, etc. 1https://anonymous.4open.science/r/DeDesForOSFL/ Compared to federated learning, ensemble learning, which seeks to merge multiple weak learners (base models) into strong learner(s), has been a popular topic for decades. Voting [17], Bagging [7], Boosting [18], and Stacking [19] are exam- ples of traditional ensemble learning approaches. Ensemble Selection is an important concern in ensemble learning. There are three major approaches to select a fixed ensemble team for every incoming test sample: Search-based [9], rank-based [20], and cluster-based [21]. Cluster-based ensemble selec- tion approaches are based on model diversity. Classic model diversity calculation methods include Binary Disagreement [22], Cohen's Kappa [23], Q Statistics [24], Generalized Diversity [25] and Kohavi-Wilpert Variance [22]. All of these methods require access to the local dataset and thus violates the fundamental constraint of federated learning. III. PROBLEM DEFINITION Assume that there are m different clients as parties who want to collaborate in machine learning on a given ML task, e.g., classification or regression. Let M := {M1, . . . , Mm} be the well-trained models with each Mi trained on i-th client via the one-shot federated learning strategy over its private dataset Di = {(xk, yk)}ni k=1 with size ni, where each data is i.i.d. sampled from an unknown distribution D. M will then be uploaded to the central server of the machine learning model market. Our ensemble selection problem can be formulated as: Problem 1: Given: the model set M and a relative small K of M such constant K < m, find the optimal subset M∗ that M∗ K = arg min MK ⊆M,|MK |=K E(x,y)∼D (cid:96)(y, fMK (x))), (1) where fMK (*) is the prediction function based on MK and (cid:96) is the loss function. Under the ensemble learning setting, fMK is the aggrega- tion function to combine the prediction of Mi ∈ MK for the final prediction ˆy = fMK (x); it can be weighted average for regression, or weighted voting-based (e.g., majority or plurality voting) for classification. Under the model fusion setting, fMK is the prediction of the fusion model based on all elements in MK. We focus on the classification task in the following sections and we adopt the weighted voting strategy based on the size of local clients' datasets for ensemble learning. Thus, for a C- class classification (i.e., the label set is {1, . . . , C}) task, with I(*) as the indicator function, the prediction ˆy of the input x is given by ˆy := arg max c∈{1,...,C} K (cid:88) j=1 ni k=1 nk (cid:80)K I (Mj(x) = c) , (2) IV. PROPOSED FRAMEWORK: DEDES We present our proposed ensemble selection framework, DeDES , to solve Problem 1 without accessing to any dataset from the local clients. Algorithm 1 summarizes the structure of DeDES. (An illustrative view is given in supplementary.) Fig. 1: Overview of ensemble learning and ensemble selection process on machine learning model market under one-shot federated learning setting. Algorithm 1: DeDES framework Input: model set M, model training-set sizes i=1, model scores S = {si}m N = {ni}m target model-set size K. i=1, and Output: Optimal model subset (Ensemble Team) M∗ K. 1 M∗ K ← ∅ (cid:46) 1. Model filtering: select high-quality candidates by filtering out outliers. 2 O ← OutlierFilter(M, S) (cid:46) O: outlier models set 3 N = {ni | Mi /∈ O, ∀Mi ∈ M}; S = {si | Mi /∈ O, ∀Mi ∈ M}; M = M \ O; (cid:46) 2. Model representation: get model's feature representation. 4 RM = {Ri = Represention(Mi) | ∀Mi ∈ M} (cid:46) 3. Model clustering: get K-size model clusters for diversity selection. 5 CM = Clustering(RM, K) (cid:46) 4. Representative model selection: choose the 'best' model in each cluster. 6 for C ∈ CM do 7 NC = {ni | ∀Mi ∈ C ∩ M} max ← max(NC); nC nC (cid:46) τ : user predefined threshold, e.g., τ = 0.3. if nC med / nC k = arg maxj{nj | Mj ∈ C ∩ M} med ← median(NC) max < τ then 8 9 10 11 else 12 13 M∗ k = arg maxj {sj | Mj ∈ C ∩ M} K ← M∗ K ∪ {Ck} (cid:46) Ck: the k-th element of the cluster C 14 return M∗ K Considering the performance and efficiency of M∗ K, it is necessary to choose a small K and keep the diversity and high- quality among selected elements/models. DeDES achieves such goal via different components, including model filtering, model representation, model clustering, and representative model selection, which are explained in detail as follows. a) Model filtering:: Being from multiple parties in FL, the performance of those various models can vary significantly and are out-of-control to the central server. The inferior model may result from different reasons, including low-quality train- ing data, e.g., being unreliable or contaminated, and with much noise, trained with inappropriate parameters, etc. Therefore, it is necessary to filter out such outlier models to eliminate the effect of the noises and help to select high-quality models efficiently. In Alg. 1, we use the OutlierFilter to obtain the outlier models O based on the model scores S provided from each party, which can be the local validation accuracy or prediction confidence. OutlierFilter can be any score- based unsupervised outlier detection methods [26], we used a variation of the commonly-used box-plot in our experiment (refer to the supplementary). b) Model representation:: Given the model structure and its parameters, generating effective and suitable representation for the models is crucial to measure their properties, like simi- larity and diversity. Intuitively, we can use all or partial (some layers) of the parameters to represent the model. Considering that all models in M are of the same type, we choose to use the parameters of the last layer of the model, which contain individualized and sufficient the model behavior (especially for the classifier) and data manifold/space for local training. Besides, to distill compact information and suppress noise for the representation, especially for big models like Resnet-101, dimension reduction (DR) is also applied for the representations; all unsupervised approaches can be adopted here, including the classical PCA, Kernel-PCA, and so on. information about In the Alg. 1, we obtain the presentation Ri for the model Mi via the function Represention in Line 4, which extracts the parameters of the last layer of Mi to be a flatten vector and conducts dimension reduction for the vector after normalization. The target dimension for DR is set to be |M| by default. c) Model clustering:: To guarantee the diversity in M∗ K as we mentioned before, we can utilize the clustering method to identify the similarity of different models, where models with similar properties are grouped into the same cluster and different clusters are as different as possible. We can use the traditional clustering approach here, such as K-Means, Hierarchical Clustering, and Spectral Clustering, etc. and set the target number of clusters as K. This process is denoted Ensemble Selection Framework (DeDES)Ensemble Selection Framework (DeDES)*Datasets ModelsOne-Shot FLOne-Shot FLOne-Shot FL*Datasets ModelsOne-Shot FLOne-Shot FLOne-Shot FLMachine Learning Model MarketMachine Learning Model MarketLocal Training......One-Shot FL......Same Task ModelsUploadTest SamplesFinal PredictionVoteVoteVoteVotePredictionPredictionPredictionPredictionInputInputInputInputTest SamplesFinal PredictionVoteVoteVoteVotePredictionPredictionPredictionPredictionInputInputInputInputEnsemble TeamsEnsembleLearningEnsemble Selection Framework (DeDES)*Datasets ModelsOne-Shot FLOne-Shot FLOne-Shot FLMachine Learning Model MarketLocal Training......One-Shot FL......Same Task ModelsUploadTest SamplesFinal PredictionVoteVoteVoteVotePredictionPredictionPredictionPredictionInputInputInputInputEnsemble TeamsEnsembleLearning by Clustering in Alg. 1, which leads to CM as the resultant clusters. d) Representative model selection:: To choose exactly K models with high performance, we elaborately select the rep- resentative element in each cluster while keeping the diversity. Among the models in each cluster, we can intuitively select the model with either the highest model score si ∈ S (provided by the individual party) or the largest training dataset (leading to a better-trained model). Therefore, as the Line 6-13 in Alg. 1 shows, we design a heuristic select strategy to make full use of these two ways, which can choose a better one than any of the fixed way as the experiment results proved. That is, if the amount of training data for the models inside the cluster is balanced (measured by the ratio between the median size and the maximum size), the model with the highest model score is chosen, otherwise, the one with the largest training data is chosen. e) Inference:: After obtaining the optimal M∗ K with Algorithm 1, we will conduct ensemble learning with the weighted voting as Eq. (2). Note that in the whole process of DeDES , we successfully select the ensemble team M∗ K based on the model diversity without accessing to any of local private data of these parties. V. EXPERIMENTS A. Experiment Setup To simulate the real scenarios in federated learning as [27] and comprehensively evaluate DeDES, we designed four types of dataset-partition strategies as follows, which lead to differ- ent local data distribution to train diverse models Mis. • Homogeneous (homo): the amount of samples and the data distribution keep the same for all parties; • IID but different quantity (iid-dq): the training data of each party follows the same distribution, but the amount of data is different; • Skewed data distribution (noniid-lds): the training data of each party follows different distributions, especially for the label distribution; • Non-IID with k (< C) classes (noniid-l'k'): the training data of each party only contains k of C classes, which is an extreme Non-IID setting. We used 5 image datasets and 4 types of neural network models (i.e., VGG-5, ResNet-50, DenseNet-121, and Deep Later Aggregation) in our experiments. Table I lists the de- tailed information about the datasets and configurations. We partition all datasets into different groups based on the above strategies and train the model for each client. Fig. 2 shows an example for the data distribution under the different partition strategies for CIFAR10 with 5 parties. The detailed configuration information of DeDES are elab- orated in the supplementary, including the learning rate, model representation strategy, clustering method for different data partitions, etc. B. Baseline Strategies For the model ensemble learning under our problem setting, we follow the designs in [3] and summarize the well-known used selection approaches as follows: • Cross-validation selection (CV): select M∗ K using local validation accuracy; • Data (DS): M∗ selection ∈ K top({n1, * * * , nm}, K)}, the models trained with i.e., the top K size training dataset, which are selected by top; K consists of model random • Random selection (RS): M∗ {Mi | i = selected from M; • All selection (AS): select M as the target model set ignoring K, this method will consider all clients' data but will be very time-consuming. Besides, we construct the following baselines in terms of the model fusion, which derives a single model leading to the highest efficiency for inference, as comparison with the traditional federated learning methods. The final model M ∗ is defined as: • Federated averaging (FedAvg): M ∗ = (cid:80)m (cid:80)m i=1 (cid:80)m • Mean averaging (MeanAvg): M ∗ = 1 i=1 Mi. m Also, we include the following results as the ground-truths ni j=1 nj Mi; for comparison, • Label distribution selection (LDS): utilizing the label distribution instead of model representation as the input of our method 2; • Oracle: using the aggregated dataset D = (cid:83)m i=1 Di to train a model Moracle, whose performance is the 'oracle'. C. Performance Analysis The effectiveness of ensemble learning Figure 7 compared different methods for 4 types of data partition settings, where TOP 1 and TOP 2 mean a single model who got the best and second best test accuracy on the whole test dataset Dtest, i.e., Dtest = (cid:83)m is the test set for party/client i. As shown in Fig. 7, the performance of the ensemble methods (such as AS and DeDES) are always better than single models, which validates the effectiveness of ensemble learning under one-shot federated learning settings. , where Dtest i=1 Dtest i i Comparison of DeDES with other methods For m mod- els, the number of possible ensemble teams is 2m, i.e., the number of possible ensemble teams increases exponentially with m. Since test all the optimal one is unpractical unless m is very small, so in our experiment we will compare DeDES with existing methods to validate its superiority. teams to get Table IV shows the test performance of selective config- urations for different datasets and partition methods. As we can see, the performance of the Oracle method is always the best, since it is the centralized setting and can get all parties' data/information; meanwhile, the performance of the FedAvg or MeanAvg is significantly worst (near random guess), 2Note that learning scenarios. the label distribution is unavailable in the real federated (a) homo (b) iid-dq (c) noniid-lds (d) noniid-l4 Fig. 2: Example distribution of four dataset partition strategies for the CIFAR10 dataset with party number m = 5. Every color bar shows a different class and the height of the bar represents the number of samples of that class. TABLE I: Details of experiment configurations Dataset EMNIST Digits EMNIST Letters EMNIST Balanced CIFAR10 C 10 26 47 10 Size ((cid:80) i ni) 280,000 145,600 131,600 60,000 CIFAR100 100 60,000 k in noniid-lk 3 8 18 4 45 Model m VGG-5 (Spinal FC), ResNet-50 100, 200, 400 ResNet-50, DenseNet-121 50, 100, 200 ResNet-50, Deep Layer Aggregation 5, 10, 20 (a) homo (b) iid-dq (c) noniid-lds (d) noniid-l4 Fig. 3: Ensemble Learning (Weighted Voting) performance (test accuracy, %) comparison on EMNIST Digits dataset for m = 200, K = 80. with only test accuracy around 2% for the EMNIST Balanced datasets, which validates that directly average/fuse well-trained models are not suitable for the one-shot federated learning setting. choose; for the iid-dq partition, the Data Selection (DS) is the best method for most of datasets, this is because under this setting, the single TOP 1/2 models as in Fig. 7 (b) have the largest dataset with samples of every class in the label set {1, . . . , C}, so the models themselves already have strong generalization ability. Therefore, under this partition, the more data we have, the better performance we will get, hence the best way is to select K models with top K largest data sets. When the data partition is Non-IID (noniid-ld and noniid- lk), we can see that DeDES achieves the best performance for most of the datasets, with different m and K (more m and K combinations are in the supplementary), which validates the effectiveness of our method. DeDES can get the second best performance for the CIFAR100 dataset, with the AS method be the best, this is because CIFAR100 has 100 labels, thus the data amount of each individual label for local parties is too tiny to train a generalized model. Under this condition, the AS method will get more information than other methods and therefore have better performance. But for other datasets especially EMNIST where all local models are more generalized, DeDES will get better performance than others. In some case DeDES is even better than the ground-truth label distribution selection (LDS), which validates that our model representation is very effective. As demonstrated in Table IV, with the homo partition, the accuracy difference between all methods is minimal, making it difficult to determine which method is superior. This is because the homo partition is an IID setting, hence the data distribution of all parties is nearly identical. As a result, each party contains the same information as the others, so there is not a significant difference regardless of which parties we Complete Inspection on ensemble teams When m = 10, we can have 210 = 1024 ensemble teams to select. Table V enumerated the accuracy of all 1024 teams and the ranking of selected teams generated by different approaches. We can see that the ensemble team selected by DeDES is ranked higher than other baseline methods, which validates the efficacy of our method. TABLE II: Test accuracy (%) comparison for different dataset on different data partitions and model structures. The best and next best methods are bolded and underlined, respectively. If our DeDES method is better than the LD ground-truth method, the value of LD method will be marked in skyblue. Dataset EMNIST Digits (VGG-5 Spinal FC) EMNIST Letters (VGG-5 Spinal FC) EMNIST Balanced (VGG-5 Spinal FC) CIFAR10 (Resnet-50) CIFAR100 (Resnet-50) Partition homo iid-dq noniid-ld noniid-l3 homo iid-dq noniid-ld noniid-l8 homo iid-dq noniid-ld noniid-l18 homo iid-dq noniid-ld noniid-l4 homo iid-dq noniid-ld noniid-l45 m 400 400 400 400 200 200 200 200 100 100 100 100 200 200 200 200 20 20 20 20 K 150 150 150 150 120 120 120 120 50 50 50 50 100 100 100 100 12 12 12 12 DeDES 98.03 99.27 97.67 98.21 88.64 92.32 87.93 89.10 85.19 87.34 83.43 85.43 32.08 36.97 29.71 34.40 20.84 47.38 16.31 21.29 AS 98.10 98.75 96.99 97.96 88.77 92.19 87.74 87.93 84.94 87.28 82.72 82.99 32.09 38.49 29.23 33.50 22.84 47.37 18.71 23.68 CV 98.10 98.93 95.47 97.87 88.88 91.97 86.52 84.40 85.10 87.31 78.65 81.22 32.07 38.84 26.02 32.24 20.58 47.38 15.97 20.56 DS 98.08 98.88 91.70 63.59 88.82 92.33 83.45 86.98 84.96 87.35 79.44 81.02 30.78 39.03 29.10 30.00 20.65 47.38 16.15 20.26 RS 98.07 98.72 96.67 94.35 88.68 92.13 87.45 85.95 84.96 86.90 81.89 81.93 30.30 36.66 26.67 33.05 20.48 25.10 15.78 19.97 FedAvg MeanAvg 10.28 10.51 10.01 10.11 3.72 3.84 4.03 3.85 2.10 2.04 2.19 2.09 10.18 10.04 9.89 10.02 0.99 1.00 0.96 0.92 10.26 10.48 9.89 10.09 3.71 3.82 4.02 3.84 2.11 2.04 2.16 2.08 9.69 10.03 9.88 9.87 0.99 0.94 0.97 0.91 LD 98.10 99.27 92.86 98.13 88.77 92.33 85.01 87.54 84.83 87.35 77.28 82.87 32.08 38.81 28.94 34.15 20.85 47.38 15.32 19.61 Oracle 99.74 99.71 99.72 99.61 95.12 95.12 94.90 95.06 89.70 89.25 89.48 89.52 88.68 88.10 87.31 89.67 59.81 60.35 60.38 61.74 TABLE III: Complete inspection on ensemble teams for EMNIST Balanced dataset with m = 10, K = 6, noniid-lds partition. Method DeDES AS CV DS LD RS Rank 34/1024 114/1024 241/1024 348/1024 608/1024 669/1024 Accuracy (%) 84.34 83.39 82.29 80.86 77.77 76.54 Fig. 4: The relationship of K and Ensemble Test Accuracy of DeDES for the EMNIST Letters Dataset when m=400. D. Impact on Efficiency Table. IV shows that in some cases, DeDES is the second best method after All Selection (AS). Note that the efficiency of AS is quite poor, and the performance gap between these two approaches is small, validating that our method can reduce ensemble time to a large extent with minimal performance loss. It is easy to know that the inference time for ensemble learning (weighted voting) increases linearly with K, i.e., the total inference time T for one test sample is K×c, where c is constant inference time for one sample by one model. The experimental results depicted in Fig.8 indicate that when K reaches a certain value, the test accuracy will not increase significantly, sometimes even decrease. Therefore, with a suitable K (usually 50% of m), we can substantially reduce our inference time for ensemble learning while achieving good ensemble performance. And we do not need to concern too the running duration of DeDES compared to much about others because the ensemble selection process will only run once and will finish in a few minutes, therefore it is of little consequence. E. Ablation Studies For experiment details of this section, please refer to the supplementary. • Performance Comparison on different model struc- tures and datasets Our method is solid for various model structures and datasets. • Performance Comparison on different model repre- sentation It is better to use the models' later layer's [15] 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 opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021. [16] Denis Baylor, Levent Koc, et al. Tfx: A tensorflow-based production- In Proceedings of the 23rd ACM scale machine learning platform. SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1387–1395, 2017. [17] Zhi-Hua Zhou. Ensemble learning. In Machine learning. Springer, 2021. [18] Robert E Schapire. Explaining adaboost. In Empirical inference, pages 37–52. Springer, 2013. [19] Yuyan Wang et al. Stacking-based ensemble learning of decision trees for interpretable prostate cancer detection. Applied Soft Computing, 77:188–204, 2019. [20] Zhongchen Ma, Qun Dai, and Ningzhong Liu. Several novel evaluation measures for rank-based ensemble pruning with applications to time series prediction. Expert systems with applications, 42(1):280–292, 2015. [21] Mojtaba Amiri Maskouni and Xiaofang Zhou. Auto-ces: an automatic pruning method through clustering ensemble selection. In Australasian Database Conference, pages 275–287. Springer, 2018. [22] Ludmila I Kuncheva and Christopher J Whitaker. Measures of diversity in classifier ensembles and their relationship with the ensemble accuracy. Machine learning, 51(2):181–207, 2003. [23] Mary L McHugh. Interrater reliability: the kappa statistic. Biochemia medica, 22(3):276–282, 2012. [24] Huaxiang Zhang and Linlin Cao. A spectral clustering based ensemble pruning approach. Neurocomputing, 139:289–297, 2014. [25] Derek Partridge and Wojtek Krzanowski. Software diversity: practical statistics for its measurement and exploitation. Information and software technology, 39(10):707–717, 1997. [26] Yue Zhao, Zain Nasrullah, and Zheng Li. Pyod: A python toolbox for scalable outlier detection. JMLR, 20(96):1–7, 2019. [27] Qinbin Li, Yiqun Diao, Quan Chen, and Bingsheng He. Federated learning on non-iid data silos: An experimental study. In ICDE, pages 965–978. IEEE, 2022. parameters for representation than utilizing their front layer's parameters. • Importance of Dimension Reduction Methods. Kernel- PCA is better than other dimension reduction methods such as PCA and non-compression. • Clustering/Diversity validation Our method can really cluster similar models together and the whole team's diversity is higher than other methods. VI. CONCLUSION This paper presents a novel Data-Free Diversity-Based method called DeDES to address the ensemble selection problem for models generated by one-shot federated learning. Experiments demonstrated our method can achieve both bet- ter performance and efficiency for various model structures and datasets, especially for non-iid data partitions. To our knowledge, this is the first paper to systematically address the ensemble selection problem for one-shot federated learning, which is essential for applications such as machine learning model markets. In the future, we will focus on the issue of heterogeneous model structures, propose more robust and useful model representation techniques, and better voting method to future improve ensemble performance and efficiency. REFERENCES [1] Tian Li, Virginia Smith, et al. Federated learning: Challenges, methods, and future directions. IEEE Signal Processing Magazine, 37(3):50–60, 2020. [2] Jonas Geiping, Hartmut Bauermeister, Hannah Droge, and Michael Moeller. Inverting gradients-how easy is it to break privacy in federated learning? NeurIPS, 33:16937–16947, 2020. [3] Neel Guha, Ameet Talwalkar, and Virginia Smith. One-shot federated learning. arXiv preprint arXiv:1902.11175, 2019. [4] Qinbin Li, Bingsheng He, and Dawn Song. Practical one-shot federated learning for cross-silo setting. In Zhi-Hua Zhou, editor, Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI-21, pages 1484–1490. International Joint Conferences on Artifi- cial Intelligence Organization, 8 2021. Main Track. [5] Manasi Vartak, Matei Zaharia, et al. Modeldb: a system for machine the Workshop on learning model management. Human-In-the-Loop Data Analytics, pages 1–3, 2016. In Proceedings of [6] Thomas Wolf, Morgan Funtowicz, et al. Huggingface's transform- arXiv preprint language processing. ers: State-of-the-art natural arXiv:1910.03771, 2019. [7] Omer Sagi and Lior Rokach. Ensemble learning: A survey. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 8(4):e1249, 2018. [8] Zhi-Hua Zhou, Jianxin Wu, and Wei Tang. Ensembling neural networks: many could be better than all. Artificial intelligence, 137(1-2):239–263, 2002. [9] Rich Caruana et al. Ensemble selection from libraries of models. In ICML, 2004. [10] Yanzhao Wu, Ling Liu, et al. Boosting ensemble accuracy by revisiting ensemble diversity metrics. In CVPR, pages 16469–16477, 2021. [11] Yanzhao Wu and Ling Liu. Boosting deep ensemble performance with hierarchical pruning. In ICDM, pages 1433–1438. IEEE, 2021. [12] Keith Bonawitz, Brendan McMahan, et al. Towards federated learning at scale: System design. Proceedings of Machine Learning and Systems, 1:374–388, 2019. [13] Moming Duan, Liang Liang, et al. Self-balancing federated learning with global imbalanced data in mobile systems. IEEE Transactions on Parallel and Distributed Systems, 32(1):59–71, 2020. [14] Anirudh Kasturi et al. Fusion learning: A one shot federated learning. In International Conference on Computational Science, pages 424–436. Springer, 2020. A. Execution process of DeDES APPENDIX Fig. 5 gives a flow chart of DeDES when we use parameters of the model's last layer as the model representation and PCA as the dimension reduction method. The choice of clustering method will depend on the data partition which are shown in section 4.1. B. Model filter algorithm Algorithm 2: OutlierFilter algorithm for the model filtering Input: model set M, truncated threshold pair (plow, phigh), interval scale s, and model scores S = {si}m i=1. Output: Outlier model set O. (cid:46) Sort the score set S, such as local validation accuracy, by ascending order. 1 S ← AscendingSort(S) (cid:46) Get the value of the plow-th, phigh-th element of S. 2 qlow, qhigh ← Splow, Sphigh 3 interval ← qhigh − qlow 4 outlier threshold ← qlow − s ∗ interval 5 O ← ∅ 6 for i = 1 to m do 7 if si < outlier threshold then 8 O ← O ∪ {Mi} 9 return O As in Alg. 1 from the main paper, we use the OutlierFilter to obtain the outlier models O based on the model scores S provided from each party, which can be the local validation accuracy or prediction confidence. OutlierFilter can be any score-based unsupervised outlier detection methods; as we mentioned before, we utilized a variation of the commonly-used box-plot in our experiment, which is shown in the above Alg. 2. As shown in Fig. 6, the 8-th party (i.e., p8) was not well- trained and not converged due to the inappropriate learning rate, which results in an inferior validation accuracy (20.9%). Our method can successfully filter out this party's model by the model filtering method when selecting the ensemble team, and can then improve the final performance of ensemble learning. C. Experiment Setup 1) Component Configurations: In this subsection, we will describe the default configurations of our DeDES framework for the experiments in the main paper. For local model training, we utilize the SGD optimizer to get 200 models for every party through 200 epochs of training with learning rate started at 0.1 and decrease at later epochs. I.e., we will save all the models from the 200 training rounds. After the training finished, for every party, we select the model with the highest local validation accuracy (among these 200 models) as the final well-trained model and then upload it to the server of model market. Meanwhile, we will record the test results on the whole test set for this final model. In our experiments, we select parameters of the final model layer (last layer) as the model representation; we utilize the MINMAX scaler to preprocess the Model Representation Matrix (as shown in Fig. 5), and the Gaussian Normalization scaler to preprocess the Label Distribution ground-truth input data; we do not utilize any dimension reduction strategy for the model representation matrix because the last layer of model parameters are already few in number. Spectral clustering is used on the homo and iid-dq parti- tioned dataset; K-Means clustering is used on the noniid-lds and noniid-lk partitioned dataset. Our proposed model representative selection approach is utilized to determine the representative model within each cluster; as we have stated, we apply weighted voting strategy based on the size of local clients' datasets to perform ensemble learning; we use the test accuracy on the whole test set Dtest as the evaluation metric for all the ensemble selection methods. 2) Environment: All our experiments are running on a single machine with 1TB RAM and 256 cores AMD EPYC 7742 64-Core Processor @ 3.4GHz CPU. The GPU we used is NVIDIA A100 SXM4 with 40GB memory. The environment settings are: Python 3.9.12, PyTorch 1.12.1 with CUDA 11.6 on Ubuntu 20.04.4 LTS. All the experimental results are the average over three trials. D. Additional Experiments In this section, we will show more experimental results as a supplement to the main paper. Due to the relatively large amount of experimental data, for each conclusion/finding, we take one of the experimental cases as presentation (one dataset, one m and one K), while the conclusion remains similar to other datasets/m/K. 1) The importance of ensemble learning: Fig. 7 shows the data distributions for the four data partitions of the EMNIST balanced dataset with local validation accuracy and test accu- racy for the whole test set Dtest when m=10. We can see that the capacity (test accuracy for the whole test set) of a single model is weak, even when their local validation accuracies (validation accuracy for their own dataset) are high, which validates the importance of ensemble learning that can utilize the collaborative power of multiple models. 2) Performance Analysis (Supplementary): Table. IV shows the performance of different methods when we apply them on the 5 datasets with 4 partitions, but different model structures than the main paper. K is selected about half of m. Note that when m = 200, K = 120 on the EMNIST Letters dataset, the test accuracy of DeDES and AS, CV are the same, which means they both selected the same ensemble team. Compared to other baseline methods, DeDES can still achieve good performance (at least the second best, close to the best method of All Selection, which is very time-consuming). Table V enumerated the accuracy of all 1024 teams and the ranking of ensemble teams selected by different methods Fig. 5: Flow chart of the execution process of DeDES framework, where last layer is used to represent the model and PCA is used as the dimension reduction method. Circles of the same style (same color and texture) represent models with actual high similarity. problem. 3) Impact on Efficiency (Supplementary): Fig.8 gives an- other plot of the relationship between K and test accuracy for the EMNIST Balanced dataset. The conclusion remains the same as the main paper that we don't have to select all models to form an ensemble team for most of the cases, which saves the inference time and also keeps good performance. 4) Ablation Studies: • Performance Comparison on different model struc- tures and datasets Our method is solid for various model structures and datasets. As shown in Table 2. in the main paper and Table. IV of this supplementary material, no matter what model structures/datasets we use, our method can achieve better performance than other baselines methods for ensemble learning. • Performance Comparison on different model repre- sentation As shown in Fig. 9, for the VGG-5 (Spinal FC) model, layer1, layer2, layer3 and last layer represent the first, middle, latter and final/last fully-connected layers of the model which are selected as the model representations and the random layer means we randomly select 10% of all layers as our model representation. As we can see, for the iid partitions (homo and iid-dq), almost no per- formance difference can be observed no matter what layer we choose; however, for the noniid partitions (noniid-lds and noniid-l18), there is still a gap in the performance Fig. 6: Data distribution for the iid-dq partition of the EMNIST letters dataset with local validation accuracy, and test accuracy for the whole test set Dtest when m=10. Every dot at the red line shows the best local validation accuracy after training for 200 epochs while the dots at the blue line show the test accuracy (of the model with the best local validation accuracy) on the whole test set Dtest of the k-th party pk. for another data partition (noniid-lds) of the EMNIST balanced dataset. We can see that the ensemble team selected by DeDES is ranked higher than other baseline methods, which validates the efficacy of our method. Note the value of K here is 5 while the size of the best ensemble team among all 1024 teams is 4, therefore, how to select an appropriate K remains an open Parameter PreprocessModel ClusteringFinal Ensemble TeamModel RepresentationSelectionDimension ReductionRepresentative Model SelectionFlattenFlattenFlattenFlattenLast LayerLast LayerLast LayerLast LayerOne-Dimensional VectorOne-Dimensional VectorOne-Dimensional VectorOne-Dimensional VectorModel Parameter MatrixPCA Select Select Select Select Select Select Select Select Select..................FlattenModel Parameter Matrix......Model Filtering...... (a) homo (b) iid-dq (c) noniid-lds (d) noniid-l18 Fig. 7: Different data distribution of the EMNIST balanced dataset with local validation accuracy, and test accuracy for the whole test set when m=10. Every dot at the red line shows the best local validation accuracy after training for 200 epochs while the dots at blue line show the test accuracy (of the model with the best local validation accuracy) on the whole test set Dtest of the k-th party pk. TABLE IV: Test accuracy (%) comparison for different dataset on different data partitions and model structures. The best and next best methods are bolded and underlined, respectively. If our DeDES method is better than the LD ground-truth method, the value of LD method will be marked in skyblue. Dataset EMNIST Digits (Resnet-50) EMNIST Letters (Resnet-50) EMNIST Balanced (Resnet-50) CIFAR10 (Densenet) CIFAR100 (Deep Layer Aggregation) Partition homo iid-dq noniid-ld noniid-l3 homo iid-dq noniid-ld noniid-l8 homo iid-dq noniid-ld noniid-l18 homo iid-dq noniid-ld noniid-l4 homo iid-dq noniid-ld noniid-l45 m 400 400 400 400 200 200 200 200 100 100 100 100 200 200 200 200 20 20 20 20 K 150 150 150 150 120 120 120 120 50 50 50 50 100 100 100 100 12 12 12 12 DeDES 96.33 98.13 96.52 96.64 78.01 88.88 79.78 81.10 80.12 85.68 76.34 77.99 46.84 52.38 44.90 47.04 23.01 39.18 22.29 24.41 AS 96.46 98.01 96.50 96.81 77.91 88.88 80.55 82.79 80.11 85.68 77.56 80.28 46.30 53.01 43.91 48.51 24.80 39.18 25.11 27.42 CV 96.65 98.08 86.58 89.21 78.77 88.88 79.53 80.54 80.33 85.68 71.64 77.71 46.47 53.55 40.89 46.08 22.47 39.18 21.37 24.07 DS 96.23 98.07 95.48 58.59 77.13 88.89 77.27 78.86 79.38 85.71 74.16 77.98 45.37 53.47 40.54 40.92 22.27 39.18 21.88 23.08 RS 96.31 97.94 96.04 94.72 77.08 88.45 78.65 80.28 79.20 84.54 75.00 77.40 45.68 51.76 41.49 45.43 22.63 37.04 21.15 23.59 FedAvg MeanAvg 10.25 10.63 10.24 9.74 3.86 3.82 4.23 3.74 2.15 2.11 2.23 2.13 10.49 10.45 10.38 9.71 0.95 1.01 0.94 0.87 10.22 10.64 10.19 9.61 3.89 3.80 4.28 3.69 2.18 2.14 2.21 2.13 10.08 10.56 10.52 9.47 0.94 0.95 0.94 0.85 LD 96.70 98.13 94.80 96.83 77.41 88.85 78.37 82.33 78.93 85.76 70.75 78.58 46.34 54.03 41.61 47.45 22.12 39.18 21.42 23.19 Oracle 99.71 99.70 99.70 99.67 94.76 95.13 94.86 95.08 89.44 89.12 89.52 89.39 90.57 90.38 91.01 90.79 52.63 55.61 55.94 54.90 TABLE V: Complete inspection on ensemble teams for EM- NIST Digits dataset with m = 10, K = 5, noniid-lds partition. Method DeDES AS DS LD CV RS Rank 214/1024 372/1024 608/1024 675/1024 933/1024 952/1024 Accuracy (%) 98.34 97.09 89.63 87.86 74.73 72.45 of different layers as representations. From the figure we can see that it is better to use the models' later layer's parameters for representation than utilizing their front layer's parameters, but it is just a crude conclusion that doesn't apply to all situations. Therefore, how to select a good model representation to get better performance remains an open problem, especially for the noniid data Fig. 8: The relationship of K and Ensemble Test Accuracy of DeDES for the EMNIST Balanced Dataset when m=400. partition. • Importance of Dimension Reduction Methods. As shown in Fig. 10, we compare three (dimension reduc- Fig. 9: Comparison on the Ensemble Test Accuracy when applying different model representations on DeDES for the EMNIST Letters Dataset, VGG-5 (Spinal FC) structure when m=200, K = 120. Fig. 11: The Binary Disagreement value of ensemble teams se- lected by different methods for the CIFAR10 Dataset, Resnet- 50 structure when m=50, K = 30. Fig. 10: Comparison on the Ensemble Test Accuracy when applying different dimension reduction methods with the last layer as model representation on DeDES for the CIFAR10 Dataset, Resnet-50 structure when m=50, K = 30. Fig. 12: The Cohen's Kappa value of ensemble teams selected by different methods for the CIFAR10 Dataset, Resnet-50 structure when m=50, K = 30. tion) methods: PCA, Kernel PCA, and no compression which means we don't compress the model representation (here is the parameters of model's last layer). For PCA and Kernel-PCA, we reduced the model representation to m − sizeof (O) dimensions. We can see that for most of the partitions, the Kernel-PCA is better than other methods such as PCA and no compression. This is because the Kernel-PCA can convert non-linear separable data to a new low-dimensional subspace suitable for alignment for linear classification, thus is suitable for the non-linear separable deep learning models. But we can also see that for the noniid-lds partition, we don't have to do the dimension reduction to get better ensemble learning results. Therefore, similar as the ablation study of model model representations, how to design a more effective dimension reduction method is still an open problem. • Clustering/Diversity validation To validate our cluster- ing results, we compare the Binary Disagreement (BD) [22] and the Cohen's Kappa (CK) [23] value of the ensemble teams selected by different methods to measure their diversities. The binary disagreement is defined as the ratio of the number of samples on which two models Mi and Mj get different prediction value to the total number of samples they predicted, higher binary disagreement means higher diversity; the cohen's kappa measures the agreement between two models in view of their reliability, lower cohen's kappa value indicates higher diversity (lower agreement). We take the average value of BD/CK for all pair (Mi, Mj) in M∗ K to get the final binary agreement/cohen's kappa value for the whole team M∗ K. As shown in Fig. 11 and Fig. 12, compared to other base- line methods, the ensemble team's diversity of DeDES is higher (higher BD or lower CK), which also means the agreement of the whole team's models are low. Since we only select one model from every cluster, so this finding also indicates that our method can really cluster similar models together, which validates that DeDES can really generate an ensemble team with high diversity. Note that the All Selection (AS) method can also have high diversity compared to DeDES and meanwhile have high ensemble test accuracy, which validates the conclu- sion that the more diverse the models, the higher the ensemble's performance will have.
http://arxiv.org/abs/2302.11750v1
2023-02-23T02:36:09
2023-02-23T02:36:09
Hera: A Heterogeneity-Aware Multi-Tenant Inference Server for Personalized Recommendations
While providing low latency is a fundamental requirement in deploying recommendation services, achieving high resource utility is also crucial in cost-effectively maintaining the datacenter. Co-locating multiple workers of a model is an effective way to maximize query-level parallelism and server throughput, but the interference caused by concurrent workers at shared resources can prevent server queries from meeting its SLA. Hera utilizes the heterogeneous memory requirement of multi-tenant recommendation models to intelligently determine a productive set of co-located models and its resource allocation, providing fast response time while achieving high throughput. We show that Hera achieves an average 37.3% improvement in effective machine utilization, enabling 26% reduction in required servers, significantly improving upon the baseline recommedation inference server.
[ "Yujeong Choi", "John Kim", "Minsoo Rhu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11750v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11750v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.DC", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.DC", "cs.IR", "cs.LG" ]
Hera: A Heterogeneity-Aware Multi-Tenant Inference Server for Personalized Recommendations Yujeong Choi John Kim School of Electrical Engineering KAIST {yjchoi0606, jjk12, mrhu}@kaist.ac.kr Minsoo Rhu 3 2 0 2 b e F 3 2 ] C D . s c [ 1 v 0 5 7 1 1 . 2 0 3 2 : v i X r a Abstract-While providing low latency is a fundamental requirement in deploying recommendation services, achieving high resource utility is also crucial in cost-effectively maintaining the datacenter. Co-locating multiple workers of a model is an effective way to maximize query-level parallelism and server throughput, but the interference caused by concurrent workers at shared resources can prevent server queries from meeting its SLA. Hera utilizes the heterogeneous memory requirement of multi-tenant recommendation models to intelligently determine a productive set of co-located models and its resource allocation, providing fast response time while achieving high throughput. We show that Hera achieves an average 37.3% improvement in effective machine utilization, enabling 26% reduction in required servers, significantly improving upon the baseline recommeda- tion inference server. I. INTRODUCTION Deep neural network (DNN) based personalized recom- mendation models play a vital role in today's consumer facing internet services (e.g., e-commerce, news feed, Ads). Facebook, for instance, reports that recommendation models account for more than 75% of all the machine learning (ML) inference cycles in their datacenters [1]. A major challenge facing this emerging ML workload is the need to effectively balance low latency and high throughput. More concretely, unlike training scenarios where throughput is the primary figure-of-merit, ensuring low latency responsiveness is a fundamental requirement for inference services, especially for these user-facing recommendation models. Nonetheless, achieving high server utility and system throughput is still vital for hyperscalers as cost-effectively maintaining the con- solidated datacenters directly translates into low total cost of ownership (TCO). Given this landscape, "co-locating" multiple workers from a single or multiple recommendation models is an effective solution to improve system throughput. As the inference server is constantly being fed with numerous service queries, the scheduler can utilize such query-level parallelism to have multiple inference queries be concurrently processed using these multiple workers. Recommendations are typically deployed using CPUs because of their high availability at datacenters as well as their latency-optimized design. A key challenge in co-locating recommendation models over a multi-core CPU is determining which models to co-locate Preprint. together, how many workers per each model to deploy, and how to gracefully handle the interference between co-located workers at shared resources, i.e., caches and the memory system. Latency-critical ML tasks operate with strict service latency, so even a level agreement (SLA) goals on tail small amount of disturbance at shared resources can cause deteriorating effects on "latency-bounded" throughput (i.e., the number of queries processed per second that meets SLA targets, aka QPS). To this end, an important motivation and contribution of this work is a detailed characterization on the effect of co-locating multiple recommendation model workers on tail latency as well as latency-bounded throughput. We make several observations unique to multi-tenant recommendation inference. Conventional convolutional and recurrent neural networks (CNNs and RNNs) are primarily based on highly regular DNN algorithms. These "dense" DNN models enjoy high QPS improvements by utilizing query-level parallelism to scale up the number of multi-tenant workers [2], a property this paper henceforth refers to as worker scalability. However, DNN-based recommendations employ "sparse" embedding layers in addition to dense DNNs, exhibiting a highly irreg- ular memory access pattern over a large embedding table. Depending on which application domain the recommendation model is being deployed (e.g., ranking, filtering, . . .), the con- figuration of different models can vary significantly in terms of its 1) embedding table size, 2) the number of embedding table lookups per each table, and 3) the depth/width of the dense DNN layers. All these factors determine the memory capacity and bandwidth demands of a model, affecting its worker scalability (Section V). For example, recommenda- tions with a modest model size generally exhibit a compute- limited, cache-sensitive behavior with high worker scalability. On the other hand, models with high memory (capacity and/or bandwidth) requirements are substantially limited with their worker scalability, rendering co-location a suboptimal, or worse, an impossible design point. As a result, blindly choosing the recommendation models to co-locate, without accounting for each model's worker scalability, leads to ag- gravated tail latency and QPS, leaving significant performance left on the table. In this paper, we present Hera, a "Heterogeneous Memory Requirement Aware Co-location Algorithm" for multi-tenant recommendation inference. The innovation of Hera lies in its ability to accurately estimate co-location affinity among Fig. 1: Model architecture of DNN-based recommendations a given pair of recommendation models. Models with high (or low) co-location affinity are defined as those that can (or fail to) sustain high QPS while sharing the compute/memory resources with each other. Our key observation is that memory capacity and/or bandwidth limited recommendations with low worker scalability generally exhibit high co-location affinity with models with high worker scalability. This is because memory-limited models fail to fully utilize on-chip cores and its local caches, allowing compute-limited/cache- sensitive models to leverage such opportunity to spawn more workers while causing less disturbance to tail latency. Based on such key observation, we design Hera with two key components: 1) a "cluster-level" model selection unit (Section VI-B) and 2) a "node-level" shared resource management unit (Section VI-C). At the cluster level, Hera utilizes an analytical model that systematically evaluates co- location affinity among any given pair of recommendation models. Hera's model selection unit then utilizes this infor- mation to determine what models are most appropriate to be co-located together across all the nodes within the cluster. Once the models to co-locate are determined, Hera's node- level resource management unit examines how many workers as well as how much shared cache capacity each model should be allocated within each node that effectively utilize query-level parallelism for high sustained QPS. Overall, Hera achieves an average 37.3% improvement in effective machine utilization, which enables a 26% reduction in the number of required inference servers, significantly improving state-of- the-art. II. BACKGROUND A. Neural Recommendation Models Recommendation models aim to find out contents/items to recommend to a user based on prior interactions as well as user's preference. A well-known challenge with content recommendations is that users interact only with a subset of available contents and items. Take YouTube as an example where any given user only watches a tiny subset of available video clips. Consequently, state-of-the-art DNN-based recom- mendation models combine both dense and sparse features for high accuracy. Here, dense features represent continuous inputs (e.g., user's age) whereas sparse features represent categorical inputs (e.g., a collection of movies a user has previously watched). Figure 1 shows a high-level overview of DNN-based recommendation models which we detail below. Model architecture overview. The dense features in rec- ommendations are processed with a stack of dense (bottom) Fig. 2: A CPU-based multi-tenant recommendation inference server. DNN layers (e.g., convolutions, recurrent, and MLPs). Cate- gorical features on the other hand are encoded as multi-hot vectors where a "1" represent a positive interaction among the available contents/items. As the number of positive interaction among all possible items are extremely small (i.e., a small number of "1"s within the multi-hot vector), the multi-hot vectors are transformed into real-valued, dense vectors (called embeddings) by an embedding layer. Specifically, an array of embedding vectors are stored contiguously as a table, and a sparse index ID (designating the location of "1"s within the multi-hot vector) is used to read out a unique row from this table. Because the multi-hot vector is extremely sparse, reading out the embedding vectors (corresponding to each sparse indices) from the table is equivalent to a sparse vector gather operation. The embedding vectors gathered from a given embedding table are reduced down into a single vector using element-wise additions. In general, embedding vector gather operations exhibit a highly memory-limited behavior as they are highly sparse and irregular memory accesses. Another distinguishing aspect of embedding layers is their high memory capacity demands: the embedding tables can contain several millions of entries, amounting to tens to hundreds of GBs of memory usage. As there are multiple embedding tables, multiple reduced embeddings are generated by the embedding layer, the re- sult of which goes through a feature interaction stage. One popular mechanism for feature interactions is a dot-product operation [3] between all input vectors (i.e., implemented is as a batched GEMM). The feature interaction output concatenated with the output of the bottom DNN layer, which is subsequently processed by the top DNN layers to calculate an event probability (e.g., the click-through-rates in advertisement banners) for recommending contents/items. State-of-the-art DNN-based recommendation models. While Figure 1 broadly captures the high-level architec- ture of DNN-based recommendations, state-of-the-art model architectures deployed in industry settings exhibit notable differences in terms of their key design parameters (colored in red in Figure 1). Table I summarizes our studied, industry- scale DNN-based recommendation models published from Google, Facebook, and Alibaba [1], [4], [5], [6], [7]. We further detail our evaluation methodology later in Section IV. B. Inference Serving Architectures Why CPUs for recommendation inference? As the com- plexity of ML algorithms increases, GPUs or dedicated ASICs are gaining momentum in servicing recommendations [8], [9], [10]. Nonetheless, CPUs are still popular deployment 2 Dense featuresSparsefeaturesSparsefeaturesEventprobabilityLookupsper tableLookupsper tableBatch (N)Batch (N)Batch (N)MLP sizeSparse featurepoolingDense FCEmbedding table...FeatureinteractionPredictor FCOperator typeOperator typeNumber of tablesMLP sizeEmbedding table...User requestsConventional recommendation inference server(e.g., DeepRecSys)CoreCoreCoreCoreCoreLLC, memory subsystem, storage, networkWorker 1Worker 2Worker 3Worker 4Worker 5Model A TABLE I: Key architectural configurations of state-of-the-art neural recommendation models. Model Domain DLRM (A) DLRM (B) DLRM (C) DLRM (D) NCF DIEN DIN Wide&Deep Social media Social media Social media Social media Movies E-commerse E-commerse Play store Dense-FC 128-64-64 256 -128-64 2560-1024-256-32 256-256-256 - - - - FC Predict-FC 256-64-1 128-64-1 512-256-1 256-64-1 256-256-128 200-80-2 200-80-2 1024-512-256 Size (MB) 0.2 0.5 12 0.2 0.6 0.2 0.2 8 Tables 8 40 10 8 4 43 4 27 Lookup 80 120 20 80 1 1 3 1 Embeddings Dimension 64 64 32 256 64 32 32 32 Size (GB) 2 25 2.5 8 0.1 3.9 2.7 3.5 Pooling Sum Sum Sum Sum Concat Attention+RNN Attention+FC Concat SLA (ms) 100 400 100 100 5 35 100 25 options for several hyperscalars [1], [9], [11], [12], [13], [14] because the abundance of CPUs in today's datacenters make them appealing from a TCO perspective, particularly during the off-peak portions of the diurnal cycle where they remain idle. In fact, key industrial organizations are constantly developing system-level solutions that that better optimize CPU-based recommendation inference [9], [11], [15]. Given their importance in ML inference, this paper focuses on CPU- based inference servers tailored for recommendations. Multi-tenant inference server architecture. While pro- viding fast response to end-users is vital for inference, achieving high server utility is also crucial for cost-effectively maintaining the consolidated datacenters. Co-locating mul- tiple workers of an ML model on a single machine is an effective solution to improve server utility and throughput at the cost of aggravated latency. In our baseline CPU-based, multi-tenant inference server, a single worker (implemented using Caffe2 worker) is allocated with a dedicated CPU core and its local caches, multiples of which share the last level cache (LLC) and the memory subsystem (Figure 2). Because the inference server is consistently being requested with mul- tiple service queries, having multiple workers helps leverage query-level parallelism to simultaneously execute multiple inference services, improving throughput. As inference is a highly latency-sensitive operation, existing ML frameworks are designed with an in-memory processing model assuming the entire working set of a given worker process is all captured inside DRAM (i.e., paging data in and out of disk swap space is a non-option). Therefore, having multiple workers be co-located within a single machine requires the CPU memory capacity to be large enough to fully accommodate the aggregate memory usage of all the concurrent workers [13], [16], [17]. III. RELATED WORK Improving server cost-efficiency via multi-tenancy has been studied extensively in prior literature [18], [19], [20], [21], [22], [23]. As co-located multi-tenant tasks contend for shared resources, prior work has focused on how to minimize interference and performance unpredictability. A common approach is to co-locate a user-facing, latency- critical task with best-effort workloads (e.g., batch jobs), prioritizing the latency-critical task with higher QoS to meet SLA. While effective in guaranteeing QoS for latency-critical tasks, such solution suffers from low server utility in terms of the number of latency-critical tasks scheduled per servers. Consequently, recent work [24], [25], [26] explored QoS- TABLE II: CPU server node configuration. Component CPU model Frequency Physical cores per socket Sockets SIMD Shared L3 cache size DRAM capacity DRAM speed DRAM bandwidth Operating system Network bandwidth Specification Intel(R) Xeon(R) Gold 6242 CPU 2.80 GHz 16 2 AVX-512 22 MB (11-ways) 192 GB per socket 2666 MT/s 128 GB/s CentOS Linux 7 10 Gbps aware resource management techniques that can accommo- date multiple latency-critical tasks within a single machine. Unlike these prior work focusing on generic, latency-critical cloud services (e.g., Memcached, Sphinx, MongoDB, . . .), our work focuses on ML-based recommendation inference servers, presenting our unique, application-aware Hera archi- tecture. More importantly, Hera develops a novel analytical model that quantifies co-location affinity among a given pair of recommendation models for intelligently selecting models to co-locate. More relevant to Hera is recent work by Gupta et al. [1], [13], which conducts a workload characterization on the effect of co-locating multiple workers from a single, ho- mogeneous recommendation model (Figure 2). As we detail in Section V-B, co-locating workers from a single model severely limits the worker scalability for memory capacity or bandwidth limited recommendations. To the best of our knowledge, Hera is the first to quantitatively evaluate the effect of co-locating workers from both homogeneous as well as heterogeneous recommendation models, developing a cluster-wide heterogeneous model selection algorithm as well as a node-level QoS-aware resource partitioning algorithm for recommendation inference servers. While not directly related to recommendation inference, Choi et al. [27] and Ghodrati et al. [28] studied an NPU-based multi-tenant in- ference for CNNs/RNNs/Attentions using temporal [27] and spatial [28] multi-tasking, respectively. There is also several recent work proposing near-data processing for accelerating recommendations [29], [30], [31], [32], [33]. In general, the key contributions of Hera is orthogonal to these prior work. IV. METHODOLOGY Hardware platform. We utilize a multi-node cluster con- taining one master node and five compute nodes, allowing a total of ten inference servers to be deployed (Table II). The intra-node resource partitioning and isolation are done using Linux's cpuset cgroups for allocating specific core IDs to a 3 Fig. 3: A single worker's inference time without co-location broken into key operators of Caffe2, assuming a batch size of 220 (mean value of our studied query size distribution,Section IV). Embedding layers are implemented using SparseLengthsSum (SLS) in Caffe2. FC and BatchGEMM refers to fully-connected and batched GEMM. (a) Fig. 4: Effect of single worker inference on on-chip cache miss rate (left) and off-chip DRAM bandwidth utility (right). given model worker, and Intel's Cache Allocation Technology (CAT) for LLC partitioning. Software architecture. Hera's runtime manager is imple- mented using Facebook's open-sourced DeepRecInfra [13], a software framework for designing ML inference servers for at-scale neural recommendation models. Query arrival rates. Prior work [13] reports that the query arrival rates of recommendation services in a pro- duction datacenter follows a Poisson distribution. Similarly, MLPerf's cloud inference suite [34] also employs a Poisson distribution in its inference query traffic generator. As such, our evaluation utilizes DeepRecInfra's inference query traffic generator which issues requests to the inference server based on a Poisson distribution, the query arrival rate of which is configured as appropriate per our evaluation goals (detailed in Section VII). Query working set size. The size of queries for rec- ommendation inference decides the number of items to be ranked for a given user, which determines request batch size. Prior work [13] observes that the working set sizes for recommendation queries follow a unique distribution with a heavy tail effect. We utilize DeepRecInfra to properly reflect such distribution, having the batch size of an inference range from 1-1024 [13]. Benchmarks. We utilize the open-sourced recommenda- tion models provided with DeepRecInfra [13] to construct eight industry-representative model architectures. The SLA target of each model is properly chosen in accordance to prior work [4], [5], [6], [13] (Table I). As discussed in Section II-A, recent literature frequently points to large em- bedding tables [33], [35], [36], [37] with wide embedding vectors (32 to 1024 dimensions) [29], [38], [39] as it helps improve algorithmic performance. Two of our model archi- tectures accomodate such latest algorithmic developments: 1) DLRM(B) that models similar scale of memory capacity requirement to MLPerf's DLRM (sized with tens of GBs of embedding tables), and 2) DLRM(D) modeling embeddings with wide vectors. 4 (b) Fig. 5: Effect of scaling up multi-tenant workers on (a) LLC miss rate and (b) memory bandwidth utilization. DLRM(B) does not have bars under 12/16 workers as it results in an out-of-memory error. V. WORKLOAD CHARACTERIZATION A. Analysis on "Single" Model Worker We start by characterizing a single worker's inference behavior without co-location, breaking down latency per major compute operators. As shown in Figure 3, the apparent operator diversity leads to different performance bottlenecks. For example, models such as DLRM(A,B,D) are signif- icantly bottlenecked on the memory intensive embedding layers, experiencing high cache miss rate and high memory bandwidth usage (Figure 4). Because embedding vector gather operations are conducted over a large embedding table, its memory access stream are extremely sparse and irregular with low data locality. Consequently, models with a large number of embedding tables and embedding lookups (DLRM(A,B)) or wide embedding vectors (DLRM(D)) show much higher memory intensity as the majority of execution time is spent gathering embedding vectors. Such property is in stark con- trast to DLRM(C), NCF, DIEN, DIN, and WnD, which spend significant amount of time on the computationally intensive FC and/or recurrent layers. Thanks to the (relatively) higher compute intensity and smaller working set, these compute- intensive models exhibit better caching efficiency and lower memory bandwidth consumption. B. Serving with "Multi"-Tenant Workers Building on top of the characterization on single worker inference, we now study the efficacy of co-locating multiple workers from a single recommendation model. We assume a single multi-core CPU machine is utilized for servicing inference queries for the recommendation model but the num- ber of concurrently executing workers are scaled "up" (i.e., one worker per each core, Figure 2) to characterize its effect on shared memory resources (Figure 5) as well as latency- bounded throughput, i.e., QPS (Figure 6). QPS is measured by quantifying the maximum input load the concurrent workers can process without violating SLA. Specifically, we start from a low input query arrival rate (i.e., queries arrived per second) and gradually inject higher request rates until the observed (95th percentile) tail latency starts violating the SLA target. 020406080100DLRM(A)DLRM(B)DLRM(C)DLRM(D)NCFDIENDINWnDLatencybreakdown (%)SLSFCBatchGEMMCastConcatReluRecurrentLayer012345020406080100DLRM(A)DLRM(B)DLRM(C)DLRM(D)NCFDIENDINWnDDRAM bandwidth(GB/s)Cache miss rate(%)Cache miss rateDRAM bandwidth020406080100DLRM(A)DLRM(B)DLRM(C)DLRM(D)NCFDIENDINWnDLLC miss rate(%)481216020406080100DLRM(A)DLRM(B)DLRM(C)DLRM(D)NCFDIENDINWnDDRAM bandwidth (GB/s) 481216 Fig. 6: Latency-bounded throughput (QPS) as a function of the number of parallel workers. We show normalized QPS to 16 workers to demonstrate each model's worker scalability. The max load of a recommendation model therefore is defined to quantify the maximum input query arrival rate its workers are able to sustain without SLA violation. As the number of workers are increased, we generally observe a gradual increase in LLC miss rate with a cor- responding increase in memory bandwidth usage. This is expected as more workers proportionally demand larger com- pute and memory usage. However, there are noticeable differ- ences in the way different models react under a multi-tenant inference scenario. First and foremost, memory "capacity" hungry models such as DLRM(B) is severely limited with its ability to spawn a large number of concurrent workers as the aggregate memory usage of a single worker alone amounts to 25 GB (Table I). Consequently, the inference server suffers from an out-of-memory error beyond 8 work- ers (recall that ML inference servers employ a software stack implemented using an in-memory processing model, Section II-B), leaving an average 50% of CPU cores and on-chip caches left idle. Such behavior is likely to be a significant concern to hyperscalers because recent literature frequently points to neural recommendation models having several tens to hundreds of GBs of memory usage [1], [36], [37], [40]. As such, co-locating a large number of workers for these memory capacity limited models are challenging under current ML serving architectures (Figure 6). Second, embedding limited models with high memory "bandwidth" usage (DLRM(A,D)) exhibit an almost linear increase in memory bandwidth utility with a large number of workers. This is because the LLC fails to capture the already meager data locality of embedding layers, frequently missing at the LLC and consuming high memory bandwidth. The perfor- mance of DLRM(D) in particular is completely bottlenecked on memory bandwidth, whose aggregated bandwidth usage saturates beyond 12 workers (Figure 5). As a result, the QPS improvements in DLRM(D) levels off around 12 workers, only achieving a further 4% throughput enhancements going from 12 to 16 workers. Therefore, scaling up the number of multi-tenant workers beyond 12 for DLRM(D) is highly sub-optimal from a throughput cost-efficiency perspective. Lastly, the remaining five recommendation models with high compute intensity and a modest model size (Table I) leave plenty of memory bandwidth available even when the number of parallel workers are maximized. As shown in Figure 6, such headroom in memory bandwidth allows these compute- intensive recommendation models to enjoy a scalable increase in QPS with a large number of parallel workers. Fig. 7: Changes in latency-bounded throughput (QPS) when limiting the number of LLC ways allocated to workers. Results are normalized to the right-most configuration where we allow the workers to fully utilize the entire (11 ways) LLC. Each experiment assumes maximally possible workers are spawned for execution (8 for DLRM (B) and 16 for other models). Note that Intel's CAT prevents the allocation of zero LLC ways to any given process (i.e., bypassing the LLC is impossible), thus having at least a single LLC way allocated per each model is required. We observed similar trends when measuring sensitivity of QPS on LLC over different number of workers, so we omit them for brevity. Overall, we conclude that recommendation models with high memory capacity and/or bandwidth demands are severely limited with its worker scalability, i.e., the ability to leverage query-level parallelism in ML inference servers to scalably increase QPS via multi-tenant workers. In contrast, models that are relatively more compute intensive with high cache sensitivity exhibit much better worker scalability. Such high worker scalability however is only guaranteed when each worker is provided with a "large enough" LLC capacity to sufficiently capture locality, as we further discuss below. C. Sensitivity to LLC Capacity To analyze the sensitivity of each model's worker scal- ability to LLC size, we utilize Intel's Cache Allocation Technology (CAT) [41] to limit the number of LLC ways allocated to the multi-tenant workers. Figure 7 plots the sustained QPS of each model architecture (y-axis) as we gradually limit the number of ways allocated to the executing workers (from right to left on the x-axis). Several important observations can be made from this experiment. First, the memory-limited DLRM(A,B,D) shows high robustness to available LLC capacity. For instance, DLRM(D) is able to achieve 90% of maximum QPS despite having only a single LLC way allocated. These memory-limited models spend significant fraction of their execution time on highly irregular embedding gather operations with low locality (Figure 3). Therefore, leveraging memory parallelism rather than locality (i.e., memory bandwidth rather than LLC capacity) is more crucial for these memory-limited models in achieving high sustained QPS. Second, models with high compute-intensity (NCF, DIEN, DIN, WnD) exhibit high sensitivity to the LLC capacity, underscoring the importance of sufficiently provisioning shared cache space to the multi-tenant workers. Interestingly, many of these cache-sensitive workloads are able to sustain reasonably high QPS despite having allocated with a small LLC space. For instance, DIEN is capable of achieving more than 80% of maximum QPS while only being allocated with 2 out of the 11 LLC ways (and similarly 2 ways and 5 ways for WnD and DIN, respectively). 5 020406080100481216Normalized QPS(%)Number of workersDLRM(A)DLRM(B)DLRM(C)DLRM(D)NCFDIENDINWnD0204060801001234567891011Normalized QPS(%)Cache waysDLRM(A)DLRM(B)DLRM(C)DLRM(D)NCFDIENDINWnD Fig. 8: High-level overview of Hera architecture. VI. HERA ARCHITECTURE AND DESIGN A. Design Principles Overview. Figure 8 provides an overview of Hera's two key components, 1) the cluster-level model selection unit (Section VI-B) and 2) the node-level shared resource manage- ment unit (Section VI-C). At the cluster level, Hera employs our analytical model that utilizes the heterogeneous memory needs of recommendations for selecting the optimal pair of models to co-locate across all the server nodes. Once the models to co-locate are determined, Hera node-level resource management unit sets up the proper compute/memory re- source allocation strategy for the multi-tenant workers, which is dynamically tuned for maximum efficiency by closely monitoring each model's tail latency, QPS, and query arrival rates. Key approach. Section V-B revealed that models with high memory capacity or bandwidth usage suffer from low worker scalability, leaving significant amount of CPU cores and shared LLC underutilized. To address such inefficiency, Hera aims to deploy workers from a pair of low and high worker scalability models, as their complementary compute and memory usage characteristic (i.e., memory-intensive vs. compute-intensive execution for low vs. high worker scal- ability models respectively) helps maximize server utility while minimizing interference at shared resources. Figure 9 provides examples that highlight the importance of Hera's worker scalability aware, multi-tenant model selection algo- rithm, where the cache-sensitive NCF is co-located with (a) another cache-sensitive DIEN and (b) memory capacity lim- ited DLRM(B). As depicted, co-locating two cache-sensitive and high worker scalability models with similar resource requirements (NCF and DIEN) results in severe interference at the LLC, causing an average 20% throughput loss compared to each model's isolated execution. In contrast, consider the example in Figure 9(b) where workers with complementary compute/memory access patterns are co-located. Because of DLRM(B)'s memory capacity constraints, the model is not able to fully utilize the 16 cores on-chip, rendering the remaining CPU cores and LLC left underutilized. Co- locating NCF with DLRM(B) therefore helps better utilize server resources thereby significantly improving aggregate throughput. Of course, the interference between DLRM(B) and NCF cannot be eliminated completely, so both models experience some throughput loss compared to their respective isolated executions. Nonetheless, the net benefit of enhanced Fig. 9: Effect of co-locating (a) (high, high) worker scalability models and (b) (high, low) worker scalability models. server utility via intelligently co-locating low and high worker scalability models outweighs the deterioration in each model's throughput, leading to a significant system-wide QPS im- provement. As such, we seek to address the key research challenge regarding how to reliably estimate a given model's worker scalability anad utilize that information to decide the optimal set of models to co-locate across the cluster. Once the models to co-locate are determined, another research question remains regarding how to efficiently allocate shared resources among multi-tenant workers that minimize interference and maximize QPS. We first elaborate on Hera's cluster-level model selection algorithm in Section VI-B followed by a discussion of our node-lvel resource management policy in Section VI-C. B. Cluster-level Multi-tenant Model Selection Unit Profiling-based worker scalability estimation. Through our characterization in Section V-B, we observe that a given recommendation model's performance scalability (as a function of the number of concurrent workers) can be estimated reliably through profiling. Hera utilizes the slope of the performance scalability curve in Figure 6 to make a binary decision on whether the subject model has high worker scalability or not. For example, memory capacity limited DLRM(B) and memory bandwidth limited DLRM(D) are categorized as those with low worker scalability because employing a large number of workers is either impossible (DLRM(B)) or simply unproductive beyond a certain thresh- old from a QPS perspective (DLRM(D)). The remaining recommendation models on the other hand are categorized as having high worker scalability as they can fully utilize the CPU cores and on-chip caches with sustained high QPS. The profiled result in Figure 6 only needs to be collected once for a target server architecture and the derivation of whether a model has high worker scalability or not is entirely done offline, having negligible impact on Hera's performance or memory usage, i.e., a static boolean variable per each model designates its worker scalability. Determining key sources of resource contention. By utilizing the recommendation model's (high/low) worker scal- ability information, Hera tries to co-locate a pair of (high, low) worker scalability models. This helps us significantly reduce the model selection search space as it tries to avoid the unfruitful co-location of (high, high) worker scalability models. Nonetheless, different recommendation models natu- rally exhibit different compute and shared resource usage, 6 1. Profile registered models for worker scalability derivationServer node 1Model AModel BHera RMUModel BModel DHera RMUServer node 2Model CHera RMUServer node N...CPUWorker 1Worker 2Worker 3Hera resource management unit (RMU)Worker 1Worker 2Model BCoreCoreLLCResource partition policyTail latency, QPS,query arrival rateDRAMDiskNetworkShared without partitionCore(a) Hera cluster-level model selection unit(b) Hera node-level resource management unit (RMU)Model ACoreCore2. Evaluate co-location affinity3. Select optimal model pairsfor co-location4. Allocate multi-tenant inference servers per target QPSHera model selection unit100%100%54%51%43%41%Effective aggregate load84 %QPS loss due to interferenceIsolatedexecution (max load with 16 cores and entire LLC)Isolatedexecution (max load with 8 cores and entire LLC)Co-locatedexecution (max load with optimal LLC partition) DIENNCF100%100%100%51%90%46%Effective aggregate load136 %Isolatedexecution (max load with 16 cores and entire LLC)Isolatedexecution (max load with 8 cores and entire LLC)Co-locatedexecution (max load with optimal LLC partition) DLRM (B)NCF(a)(b) Algorithm 1 Co-location Affinity for i = 1 to CacheWaymax do 1: (cid:46) Step A: Derive co-location affinity at LLC 2: CoAffLLC = 0 3: 4: 5: 6: CacheWayA = i CacheWayB = CacheWaymax − CacheWayA CoAfftemp = QPS[ModelA][CacheWayA] QPS[ModelA][CacheWaymax] + ( end if if CoAfftemp > CoAffLLC then CoAffLLC = CoAfftemp 7: 8: 9: 10: end for 11: 12: (cid:46) Step B: Derive co-location affinity at memory bandwidth 13: CoAffDRAM = min( 14: 15: (cid:46) Step C: Estimation of system-level co-location affinity 16: CoAffsystem = min(CoAffLLC, CoAffDRAM) MemBWsystem MemBWA + MemBWB , 1) QPS[ModelB][CacheWayB] QPS[ModelB][CacheWaymax] )/2 so understanding a model's unique resource requirement helps better estimate the magnitude of shared resource con- tention, thereby narrowing down the model selection search space even further. Prior work [20], [24], [25] considers the shared LLC, memory, storage, and network bandwidth as one of the most important sources of resource contention under multi-tenancy. However, our key finding is that the multi-tenant workers for recommendation inference rarely compete for storage and network bandwidth. As previously discussed in Section II-B, state-of-the-art ML frameworks for inference servers employ an in-memory processing model. Consequently, once the ML inference server is bootstrapped for deployment (e.g., initializing inference server-client pro- cesses, provisioning each worker's memory allocation needs inside DRAM, . . .), the multi-tenant workers have little to no interaction with the storage system at inference time. This is not surprising given the latency-critical nature of inference and its need for high performance predictability. When it comes to the network stack, the ML inference server receives client's service queries through the NIC over an HTTP/REST protocol [16], [17]. However, we observe less than an average 1.9 Gbps of network bandwidth usage in all our evaluation, far less than the available system-wide network bandwidth (which is typically in the orders of several tens to hun- dreds of Gbps in at-scale datacenters). Consequently, Hera only considers the interference at shared LLC and memory bandwidth for evaluating both the candidate models for co- location and the efficient resource allocation mechanism for those models. Compared to previous, generic QoS-aware resource partitioning mechanisms [20], [24] that consider the interference at all of cache/memory/storage/network, Hera's application-awareness helps our proposal more agiley adapt to the dynamics of inference query arrival patterns, signifi- cantly improving upon state-of-the-art (Section VII-A2). Identifying co-location affinity for model selection. We develop an analytical model that estimates co-location affinity among a given pair of models. Hera's model selection unit utilizes co-location affinity to determine the best set of models to co-locate, choosing those with high co-location affinity, i.e., ones that can sustain high QPS while sharing the 7 (a) (b) Fig. 10: In (a), we show the estimated co-location affinity among all possible pairs of co-located models (the higher the better). To demonstrate how well our co-location affinity models the effect of shared resource interference, we show in (b) the measured aggregate QPS of co-located models normalized to the summation of the QPS achieved when each model is executed in isolation. LLC/memory. Co-location affinity is derived by estimating how much QPS loss is expected to the co-located ModelA and ModelB due to the interference at the shared LLC and memory bandwidth – the two most important sources of resource contention under multi-tenant ML inference (Al- gorithm 1). Similar to our definition of worker scalability, we employ a profiling-based approach to model the effect of shared resource contention on QPS. First, the profiled LLC sensitivity study in Figure 7 is utilized to derive the expected QPS when ModelA and ModelB gets an equal partition of the CPU cores for worker allocation. Each model is then given a partitioned slice of the shared LLC ways (CacheWayA and CacheWayB in line 4-5). The profiled QPS for each model is then normalized to the QPS achieved when each model is given the entire LLC for execution, the result of which is averaged over the two co-located models to quantify the effect of LLC interference (line 6). By examining all possible combination of LLC partitioning, we are able to derive the most optimal LLC partitioning point that gives the highest aggregate QPS (line 7-8). As Hera's resource management unit is capable of utilizing such information for optimal LLC partitioning (detailed in Section VI-C), we utilize this LLC partitioning point as the reference to quantify co-location affinity at LLC. As such, the closer the CoAffLLC value is to 1, the more likely the co-located models are less interfering with each other, thus having high co-location affinity at LLC. Estimating co-location affinity for memory bandwidth shar- ing (CoAffDRAM ) by following the same measure as done in deriving CoAffLLC is challenging. This is because there is currently no practical way to manually partition and isolate each model's memory bandwidth usage (unlike the LLC where Intel's Cache Allocation Technology [41] provides means to fine-tune LLC partitioning). We therefore employ the analytical model in line 13 which utilizes our profiled result in Figure 5(b) to measure co-location affinity with respect to memory bandwidth sharing. Here MemBWA and MemBWB are the amount of memory bandwidth consumed when each model is given half of the CPU cores and the entire LLC for isolated execution without co-location. By normalizing the sum of MemBWA and MemBWB to the available socket-level memory bandwidth (MemBWsystem), we get an estimate on how much effective bandwidth each model will be able to utilize vs. an idealistic scenario without Algorithm 2 Hera Cluster Scheduling Algorithm Algorithm 3 Hera Resource Management Algorithm for mi in Low do while ServicedQPS[mi] < TargetQPS[mi] do mj = find model with highest colocation affinity(mi, High) AllocateNewServer(mi, mj): // qpsmi , qpsmj : maximum QPS when mi & mj are co − located ServicedQPS[mj] + = qpsmi ServicedQPS[mi] + = qpsmj 1: TargetQPS[m1, m2, ..., mn] = [QPSm1, QPSm2, ..., QPSmn] 2: ServicedQPS[m1, m2, ..., mn] = [0, 0, ..., 0] 3: Low = [models with low worker scalability] 4: High = [models with high worker scalability] 5: 6: (cid:46) Step A: Allocate servers to be co-located with low worker scalability models 7: 8: 9: 10: 11: 12: 13: 14: 15: end for 16: 17: (cid:46) Step B: Allocate servers for high worker scalability models 18: 19: 20: 21: 22: 23: 24: end for AllocateNewServer(m) // qpsm : maximum QPS when m is executed in isolation ServicedQPS[m] + = qpsm while ServicedQPS[m] < TargetQPS[m] do for m in High do end while end while bandwidth interference due to co-location (line 13). The evaluated CoAffDRAM can therefore provide guidance on how intrusive the memory bandwidth sharing will have on co- located models, quantifying co-location affinity at memory. For a conservative evaluation of co-location affinity that considers interference at both LLC and memory, we choose the lower value among the CoAffLLC CoAffDRAM (line 16). Figure 10(a) plots the derived co-location affinity for all possible model pairs we study. To visualize how well our co-location affinity captures the interference and its effect on QPS, we also show in Figure 10(b) the measured aggregate QPS of co-located models normalized to the theoretically maximum QPS achievable when each model is executed in isolation. As shown, Figure 10 clearly demonstrates the strong correlation between our estimated co-location affinity and the measured QPS (i.e., Pearson correlation coefficient: 0.95) It that is worth pointing out the parameters to derive Algorithm 1 are all statically determined. Therefore, the derivation of co-location affinity for all possible model pairs are done offline and are stored as a lookup table inside a two- dimensional array (indexed using ModelA and ModelB's iden- tifier, Figure 10(a)). This table is then utilized by the central master node with global cluster visibility to determine model pairs to co-locate in inference servers to achieve a cluster- wide target QPS. Algorithm 2 is a pseudo-code of Hera's cluster scheduling algorithm where we start by examining the low worker scalability models for deployment, checking the co-location affinity table to find the best candidate for co-location (line 6). Specifically, the scheduler prioritizes models with high worker scalability as prime candidates for co-location with low worker scalability models. When low worker scalability models are all deployed, the remaining models are allocated with a dedicated server in isolation but with maximum workers spawned to maximize QPS (line 17). (cid:46) Step A: Monitor phase Monitor tail latancy, QPS, and query traffic rate for Tmonitor (cid:46) Step B: Adjust phase for each model M do end for if number of workers have changed then end if while True do end if end while adjust workers(M) adjust LLC partition() slack = tail latencyM/SLAM if slack > 1.0 or slack < 0.8 then 1: procedure RESOURCE MANAGEMENT ROUTINE() 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: end procedure 17: 18: procedure ADJUST WORKERS(m) 19: 20: 21: 22: 23: 24: 25: 26: end procedure 27: 28: procedure ADJUST LLC PARTITION() 29: 30: 31: 32: 33: urgency = tail latencym/SLAm if urgency < 1.0 then QPShighest = 0 for i = 1 to CacheWaymax do urgency = 1 CacheWayA = i CacheWayB = CacheWaymax − CacheWayA QPScurr = end if adjusted traffic = urgency × trafficquery number of workers = find number of workers(m, adjusted traffic) Allocate Model m with number of workers QPS[ModelA][Number of workers allocated for ModelA][CacheWayA]+ QPS[ModelB][Number of workers allocated for ModelB][CacheWayB] 34: 35: 36: 37: 38: 39: 40: end procedure end if if QP Scurr > QP Scurr then QPShighest = QPScurr best partition = (CacheWayA, CacheWayB) end for Allocate ModelA and ModelB with best partition C. Node-level Resource Management Unit Once the model pair to co-locate are chosen for an infer- ence server, Hera goes through the server initialization proce- dure for bootstrapping, followed by an iterative monitor-and- adjust process to periodically fine-tune the resource allocation policy per inference query traffic (Figure 8). Initialization. Server bootstrapping is done by evenly partitioning the CPU cores and shared LLC among the co- located workers (i.e., one core per each worker, all workers for a single model allocated with half the LLC), properly allocating the required data structures in-memory. If one of the co-located model does not have enough worker scalability to fully utilize allocated cores (e.g., memory capacity limited DLRM(B)), the other model utilizes those idle cores to spawn more workers. Monitor. After server initialization, Hera resource man- agement unit (RMU) periodically monitors tail latency, QPS, and the service query traffic rate for a period of Tmonitor to evaluate the effectiveness of current resource allocations (line 4 in Algorithm 3). The RMU checks whether the current core/LLC allocation is appropriate or not by calculating the SLA slack, i.e., ratio between measured latency vs. the model's SLA target (line 7). If the tail latency is larger than the SLA, the RMU deems that the current resource allocation 8 is under-provisioned and the likelihood of violating SLA is too high. Contrarily, if the tail latency is smaller than the SLA, the possibility of SLA violation is relatively low. However, too large of an SLA slack by some predefined threshold (80% of SLA in our default setting) also implies that the current resource allocation is unnecessarily over- provisioned. Therefore, when either one of these conditions are met for a given model (line 8), RMU calls functions adjust_workers() and adjust_LLC_partition() to properly upsize/downsize the allocated cores and LLC to make sure they are given sufficient amount of resources to meet SLA (line 9,13). Adjusting model workers. At-scale datacenters receive a dynamically fluctuating query arrival patterns following a Poisson distribution (Section IV). SLA violations occur because the rate at which inference queries arrive to the server is overwhelmingly too high for the currently available workers. Therefore, the ability to dynamically provision a proportional amount of workers and LLC per query ar- rival rate is crucial for appropriately handling query-level parallelism. Now recall that our characterization on worker scalability (the left-axis in Figure 6) provides a proxy on how much sustained QPS can be achieved with a given number of workers. The RMU therefore utilizes the performance scalability curve in Figure 6 (the same data structure used in Section VI-B for deriving models' worker scalability) to find out the minimum number of workers that can achieve input query arrival rate, sustainable QPS for the current trafficquery (find_number_of_workers() in line 24), the result of which is used to adjust the number of workers for the next monitoring phase. Given the reactive nature of Algorithm 3 (i.e., allocating additional workers occur after SLA violation is observed), we additionally define urgency of a model's queries as defined in line 19-21 to make sure Hera can adequately handle high spikes in query arrival rates. We define urgency as the ratio between the latency and the SLA target, so the higher measured tail the urgency the more likely that the inference server has delinquent service queries yet to be serviced inside the server request queue, leading to an unusually high tail latency. By artificially scaling up the observed query traffic rate with its urgency, the RMU helps better provision large enough workers for urgent models, enabling agile responsiveness. Of course, such over-provisioning might lead to unnecessarily large SLA slack after adjustment, but such case is gracefully handled by the RMU by properly downsizing the workers during the next monitor-and-adjust phase. Adjusting LLC partitions. When the number of work- the RMU ers for each co-located model has changed, also adjusts the partitioned LLC ways as appropriate using adjust_LLC_partition(). Similar to how the optimal LLC way partitioning design point in Algorithm 1 was derived, we employ a profiling-based strategy. Specifically, a one-time, offline profiling of QPS for all the models for all possible combination of (number of workers, number of LLC ways) is conducted, which is used to populate Fig. 11: Violin plots of EMU with constant load. The three markers represent min, median, and max EMU. the (three-dimensional) lookup table utilized in line 33 of Algorithm 3. Whenever adjust_LLC_partition() is called, the RMU utilizes this lookup table to re-evaluate the optimal number of LLC ways to allocate under the renewed (upsized/downsized) number of workers allocated for each model that results in the highest aggregate QPS. The overhead of generating this lookup table is amortized over all future deployments over a target server architecture and the memory allocation required to store this data structure is less than 2 KBs, having negligible impact on performance and memory usage. VII. EVALUATION Our evaluation takes a bottom-up approach, first focusing on intra-node evaluation (Section VII-A, Section VII-B), fol- lowed by our cluster-wide analysis (Section VII-C). Following prior work [24], we first evaluate scenarios where the multi- tenant workers run at constant loads (Section VII-A) and later explore fluctuating load (Section VII-B). A. Constant Load 1) Effectiveness of Hera Model Selection Unit: We es- tablish two baseline model selection algorithms and two Hera based design points as follows. The baseline designs are: 1) state-of-the-art DeepRecSys [13], which co-locates multiple workers from a single, homogeneous model (Sec- tion III/Section V-B), and 2) randomly choosing any given pair of heterogeneous models to co-locate without any re- striction (Random). The two Hera design points are 3) Hera(Random) and 4) Hera, where both utilize the worker scalability of the candidate model to avoid the undesirable co-location of (high, high) worker scalability models. How- ever, Hera(Random) randomly chooses any one of the possible model pairs (excluding (high, high) model pairs), whereas Hera can utilize our estimated co-location affinity (Figure 10) to choose model pairs that provide the highest machine utilization. To rule out the effect of resource manage- ment policy in our evaluation, all four design points including Hera employ our proposed resource management algorithm in Section VI-C. We measure Effective Machine Utilization (EMU), a metric used in related prior work [20], [24], [25] that is defined as the max aggregate load of all co-located applications, where each application's load is expressed as a percentage of its max load when executed in isolation with all server resources (Figure 9, Section V-B discusses how max load is measured for each model). Note that EMU can be above 100% by better bin-packing shared resources among co-located models. 9 (a) PARTIES (b) Hera Fig. 12: Each plot shows the result of co-locating the memory bandwidth limited DLRM(D) (Modelx) with each of our studied recommendation mod- els (Modely) using (a) PARTIES and (b) Hera. Each line shows the maximum percentage of Modely's max load (y-axis) that can be achieved without SLA violation when Modelx (i.e., DLRM(D)) is running at the fraction of its own max load indicated on the x-axis. Therefore, the aggregation of max load for Modelx and Modely at a particular design point equals its EMU. For instance, the EMU of DLRM(D) and NCF when DLRM(D) is at 50% max load is (50+50)=100% under PARTIES, while Hera achieves (50+80)=130%. Figure 11 shows the distribution of EMU for each model selection algorithm's all chosen pair of co-located models. Because DeepRecSys does not co-locate workers from multiple models, QPS is always identical to the max load of isolated execution, thus having EMU of 100%. As for Random, we show the EMU distribution for all possible combination of model pairs among the eight models we study, achieving 82 to 147% EMU. Although Random can improve EMU when opportunistically co-locating low worker scalability models with other models, it fails to rule out the co-location of (high, high) scalability co-location pairs with low co-location affinity, resulting in worst-case 18% EMU loss. The two Hera design points on the other hand utilizes worker scalability to successfully rule out model pairs with low co-location affinity, guaranteeing the EMU never falls below 100% and achieve substantial EMU improvement than DeepRecSys and Random. However, a key difference be- tween Hera(Random) and Hera are the following. When the cluster-level scheduler selects model pairs to co-locate, Hera(Random) makes random selection from any model combinations except (high, high) worker scalability model pairs. In contrast, Hera utilizes the estimated co-location affinity to judiciously choose model pairs with the highest EMU, leading to significant EMU improvements vs. the other three data points. Overall, Hera achieves 37.3%, 34.7%, and 5.4% average EMU improvement than DeepRecSys, Random, and Hera(Random), respectively. 2) Effectiveness of Hera Resource Manager: PAR- TIES [24] is a QoS-aware intra-node resource manager targeting generic, latency-critical cloud services. To clearly demonstrate the novelty of Hera's application-aware resource manager, we implement PARTIES on top of Hera's model se- lection algorithm and compare its EMU against Hera. Across all evaluated scenarios, Hera achieves an average 12% (max- imum 55%) EMU improvement than PARTIES. Due to space constraints, we show in Figure 12 a subset of our evaluation (a) Co-location with NCF (b) Co-location with DIN Fig. 13: Number of workers and LLC ways allocated when the low worker scalability DLRM(D) with 50% max load is co-located with high worker scalability (a) NCF and (b) DIN. Hera successfully allocates sufficient number of workers and LLC ways, reaching 80%/100% of max load for NCF/DIN. PARTIES fails to provision high enough LLC to cache-sensitive NCF/DIN, only achieving 50%/90% of max load for these two models. where we visualize the max load of low worker scalability DLRM(D) (x-axis) and the other co-located model (y-axis). Hera generally achieves higher sustained max load over PARTIES for the majority of deign points when gradually injecting each model with loads from 40% to 100% of their respective max load. The reason behind Hera's superior per- formance is twofold. First, Hera is based on our profile-based characterization to determine a good initial starting point within the search space to find the optimal core/LLC resource allocation scheme. Second, while PARTIES needs to carefully fine-tune all shared resources in a system (i.e., in addition to core/LLC, the disk and network bandwidth is also carefully monitored and adjusted by PARTIES), our application-aware Hera leverages the unique properties of ML inference servers (e.g., in-memory processing, Section VI-B) to narrow down the resource management targets, thus enabling rapid deter- mination of an optimal resource management strategy that best suits recommendation model's heterogeneous memory needs. In Figure 13, we show a snapshot of PARTIES vs. Hera's resource allocation when the low worker scalability DLRM(D) is co-located with high worker scalability NCF and DIN. Given its cache sensitive property (Figure 7), NCF and DIN require sufficient LLC capacity to sustain high max load. While PARTIES is able to eventually allocate enough workers for NCF, the amount of LLC provisioned for this cache- sensitive workload is much lower than under Hera, failing to achieve high max load. B. Fluctuating Load This section evaluates the robustness of Hera's resource manager vs. PARTIES in handling dynamically changing query arrival rates. At-scale datacenter applications frequently experience fluctuations in their load (e.g., sudden burst of high traffic load, diurnal patterns where load is high at daytime while gradually decreasing during night time). To simulate such scenario, we employ measures proposed by Chen et al. [24] where we co-locate models with heterogeneous re- source requirements, e.g., DLRM(D) and NCF, and vary the query arrival rate as illustrated in Figure 14: the load to both DLRM(D) and NCF are gradually increased until T1, which is when NCF experiences a sudden decrease in its load. At T2, the query arrival rate to NCF is suddenly spiked from 10 405060708090100405060708090100Max load ofthe colocated model(%)Max load of DLRM(D) (%)DLRM (A)DLRM (B)DLRM (C)DLRM (D)DIENDINWnDNCF405060708090100405060708090100Max load of DLRM(D) (%)DLRM (A)DLRM (B)DLRM (C)DLRM (D)DIENDINWnDNCF020406080100HeraPARTIESHeraPARTIESAmount of resource allocated (%)DLRM (D)NCFNum.workersNum.LLCways020406080100HeraPARTIESHeraPARTIESAmount of resource allocated (%)DLRM (D)DINNum.workersNum.LLCways Fig. 15: The number of servers required (y-axis) to service a target QPS level (x-axis) when the target QPS per each model is evenly distributed in an identical manner. Fig. 14: Changes in tail latency and resource allocations with Hera and PARTIES with fluctuating load for DLRM(D) and NCF. Tail latency is normalized to each model's respective SLA targets, i.e., normalized latency larger than 1.0 signifies a QoS violation. Note that the maximum number of cores and LLC ways is 16 and 11 under our studied evaluation (Table II). 20%→60% of its max load while DLRM(D) sees a sudden drop from 70%→10%. Figure 14 clearly shows that Hera does a much better job in maintaining tail latency at below SLA, unlike PARTIES which frequently exhibits sudden spikes of SLA violations throughout its execution. Our analysis revealed that PARTIES, while it is capable of eventually figuring out a decent resource allocation strategy, the decision is based on a constant upsize/downsize feedback loop that monitors various shared resources within the system. Because Hera utilizes the profile-based characterization lookup table (Algorithm 3), it is able to rapidly determine the optimal resource allocation even at sudden changes of loads at T1 and T2, enabling robust execution even under fluctuating query arrival rates. C. Cluster-wide Server Utilization In this section, we analyze Hera's effectiveness in reducing the number of servers required to fulfill a cluster-wide target QPS goal. Because the set of models deployed by hyper- scalers as well as each model's expected service demand (i.e., query arrival rate) are proprietary information not publicly available, we take the following measure for our evaluation. Even distribution of target QPS among models. We first assume that the eight models in Table I have an identical level of target QPS (Figure 15). We then utilize the four model selection algorithms to measure the total number of servers required to satisfy this target QPS. When the aggregate target QPS across all the models exceeds the max load serviceable by our multi-node cluster, we run separate rounds of experiments in an iterative manner to quantify how many additional servers are needed to service the remaining QPS. The baseline DeepRecSys allocates a single server to service a single model, so low worker scalability models like DLRM(B,D) require a larger number of servers to reach the Fig. 16: The number of servers required (y-axis) when low and high worker scalability models have different ratios of target QPS levels (x-axis). target QPS. As for Random, the cluster scheduler randomly selects a given pair of models for multi-tenant deployment until the target QPS is achieved. Because Random is capa- ble of better utilizing compute nodes servicing low worker scalability models like DLRM(B,D), it is able to reduce the number of servers by an average 15% compared to DeepRecSys. However, Random is not able to properly iso- late the interference at shared resources, so the unproductive co-location of (high, high) worker scalability models suffers from low efficiency. Both Hera(Random) and Hera are worker scalability aware and can potentially avoid deploying model pairs with low co-location affinity (e.g., NCF vs. DIEN/DIN/WnD). Nonetheless, Hera does a much better job reducing the number of servers vs. Hera(Random) as it effectively utilizes our estimated co-location affinity to minimize unfruitful model co-location pairs. For instance, Hera noticeably reduces the number of servers utilized for deploying DIEN all thanks to its ability to better bin-pack the shared resources among co-located models, achieving an average 26% and 11% reduction in total required servers than DeepRecSys and Random, respectively. Skewed distribution of target QPS among models. Figure 16 shows the number of servers needed when the per- model target QPS exhibits a skewed distribution. Unless the queries are all requested to low worker scalability models or all to high scalability models (which is unlikely the common case in real-world settings), Hera is able to noticeably reduce the number of servers required to reach a target QPS. D. Sensitivity Effect of Hera co-location and LLC partitioning. Hera consists of two key components: 1) affinity-aware co-location algorithm, and 2) application-aware LLC partitioning via Intel CAT. To clearly quantify where Hera's main benefits come from, we quantify the impact of isolating our two main 11 0.00.20.40.60.81.0DeepRecSysRandomHera(Random)HeraDeepRecSysRandomHera(Random)HeraDeepRecSysRandomHera(Random)HeraDeepRecSysRandomHera(Random)Hera2K4K8K16KNumber of servers required(normalized)Target QPSDLRM(A)DLRM(B)DLRM(C)DLRM(D)NCFDIENDINWnD00.20.40.60.811.2(16:1)(4:1)(2:1)(1:1)(1:2)(1:4)(1:16)Number of servers required(normalized)(Num of requests for low scalability model : Num of requests for high scalability model)DeepRecSysRandomHera(Random)Hera tenant recommendations, uncovering its heterogeneous mem- ory capacity and bandwidth demands. We then utilize such property to develop a profiling-based, feedback driven Hera runtime system that dynamically adapts resource allocation among multi-tenant workers for balancing latency throughput. Compared to state-of-the-art, Hera significantly improves effective machine utility while guaranteeing SLA. REFERENCES [1] U. Gupta, C.-J. Wu, X. Wang, M. Naumov, B. Reagen, D. Brooks, B. Cottel, K. Hazelwood, M. Hempstead, B. Jia, H.-H. S. Lee, A. Malevich, D. Mudigere, M. Smelyanskiy, L. Xiong, and X. Zhang, "The Architectural Implications of Facebook's DNN-based Personal- ized Recommendation," in Proceedings of the International Symposium on High-Performance Computer Architecture (HPCA), 2020. [2] T. Singhal, "Maximizing GPU Utilization For Datacenter Inference with NVIDIA TensorRT Inference Server." NVIDIA Webinar, 2019. [3] M. Naumov, D. Mudigere, H.-J. M. Shi, J. Huang, N. Sundaraman, J. Park, X. Wang, U. Gupta, C.-J. Wu, A. G. Azzolini, D. Dzhul- gakov, A. Mallevich, I. Cherniavskii, Y. Lu, R. Krishnamoorthi, A. Yu, V. Kondratenko, S. Pereira, X. Chen, W. Chen, V. Rao, B. Jia, L. Xiong, and M. Smelyanskiy, "Deep Learning Recommenda- tion Model for Personalization and Recommendation Systems," arXiv preprint arXiv:1906.00091, 2019. [4] H.-T. Cheng, L. Koc, J. Harmsen, T. Shaked, T. Chandra, H. Aradhye, G. Anderson, G. Corrado, W. Chai, M. Ispir, R. Anil, Z. Haque, L. Hong, V. Jain, X. Liu, and H. Shah, "Wide & Deep Learning for Recommender Systems," in Proceedings of the 1st workshop on deep learning for recommender systems, 2016. [5] G. Zhou, X. Zhu, C. Song, Y. Fan, H. Zhu, X. Ma, Y. Yan, J. Jin, H. Li, and K. Gai, "Deep Interest Network for Click-Through Rate Prediction," in Proceedings of the ACM SIGKDD International Con- ference on Knowledge Discovery & Data Mining, 2018. [6] G. Zhou, N. Mou, Y. Fan, Q. Pi, W. Bian, C. Zhou, X. Zhu, and K. Gai, "Deep Interest Evolution Network for Click-Through Rate Prediction," in Proceedings of the AAAI Conference on Artificial Intelligence, 2019. [7] X. He, L. Liao, H. Zhang, L. Nie, X. Hu, and T.-S. Chua, "Neural Collaborative Filtering," in Proceedings of the international conference on world wide web, 2017. [8] J. Park, M. Naumov, P. Basu, S. Deng, A. Kalaiah, D. Khudia, J. Law, P. Malani, A. Malevich, S. Nadathur, J. Pino, M. Schatz, A. Sidorov, V. Sivakumar, A. Tulloch, X. Wang, Y. Wu, H. Yuen, U. Diril, D. Dzhulgakov, K. Hazelwood, B. Jia, Y. Jia, L. Qiao, V. Rao, N. Rotem, S. Yoo, and M. Smelyanskiy, "Deep Learning Inference in Facebook Data Centers: Characterization, Performance Optimizations and Hardware Implications," arXiv preprint arXiv:1811.09886, 2018. [9] Z. Deng, J. Park, P. T. P. Tang, H. Liu, J. Yang, H. Yuen, J. Huang, D. Khudia, X. Wei, E. Wen, D. Choudhary, R. Krishnamoorthi, C.-J. Wu, S. Nadathur, C. Kim, M. Naumov, S. Naghshineh, and M. Smelyanskiy, "Low-Precision Hardware Architectures Meet Rec- ommendation Model Inference at Scale," 2021. [10] D. Kalamkar, E. Georganas, S. Srinivasan, J. Chen, M. Shiryaev, and A. Heinecke, "Optimizing Deep Learning Recommender Sys- tems' Training On CPU Cluster Architectures," arXiv preprint arXiv:2005.04680, 2020. [11] K. Hazelwood, S. Bird, D. Brooks, S. Chintala, U. Diril, D. Dzhulgakov, M. Fawzy, B. Jia, Y. Jia, A. Kalro, J. Law, K. Lee, J. Lu, P. Noordhuis, M. Smelyanskiy, L. Xiong, and X. Wang, "Applied Machine Learning at Facebook: A Datacenter Infrastructure Perspective," in Proceedings of the International Symposium on High-Performance Computer Archi- tecture (HPCA), 2018. [12] R. Hwang, T. Kim, Y. Kwon, and M. Rhu, "Centaur: A Chiplet-Based, Hybrid Sparse-Dense Accelerator for Personalized Recommendations," in Proceedings of the International Symposium on Computer Architec- ture (ISCA), 2020. [13] U. Gupta, S. Hsia, V. Saraph, X. Wang, B. Reagen, G.-Y. Wei, H.- H. S. Lee, D. Brooks, and C.-J. Wu, "DeepRecSys: A System for Optimizing End-to-end At-scale Neural Recommendation Inference," in Proceedings of the International Symposium on Computer Architecture (ISCA), 2020. (a) (b) Fig. 17: Hera sensitivity to (a) enabling/disabling LLC partitioning (with and w/o CAT), and (b) different system configurations (the numbers inside the bracket refers to (number of cores, number of LLC ways, and memory bandwidth (GB/sec))). Note that the scale of the y-axis is 80−140%. proposals in Figure 17(a) as an ablation study. Even without LLC partitioning, Hera's co-location algorithm alone provides 22% EMU improvements vs. Baseline DeepRecSys, with further 8% improvement with LLC partitioning. Different system configuration. We show a subset of our sensitivity study to different system configurations in Figure 17(b), illustrating the EMU improvement when the underlying system configuration is changed with different number of CPU cores, LLC ways, and memory bandwidth (GB/sec). As depicted, the benefits of Hera remains in- tact across diverse system platform configurations, achieving 30%/35%/18% EMU improvement for the shown configura- tions. E. Design Overhead Profiling/deployment cost. Hera is implemented as a profiling-based, feedback-driven scheduler, and the main de- sign overhead comes from profiling the following two lookup tables: (a) QPS as a function of number of parallel workers (Figure 6) and (b) QPS as a function of LLC ways allocated (Figure 7). The profiling time taken to generate these two tables (Tworker and TLLC, respectively) are: Tworker = O(number of CPU cores) TLLC = O(number of LLC ways × number of CPUcores) Using our baseline system (Table II), Tworker and TLLC takes less than 1 minute and 15 minutes per each model. As each data point can be collected completely independently, profiling and generating Figure 6 and Figure 7 across hun- dreds of models can easily be done within tens of minutes assuming thousands of compute nodes are available (which is readily accessible in cloud datacenters). Utilizing these two lookup tables as a 2D software array, generating the co- location affinity matrix in Figure 10(a) (Algorithm 1) even for hundreds of models takes less than one second using a single CPU core. Deploying Hera across thousands of servers. Each inference server is deployed individually per-node and the execution of Hera's cluster-wide scheduling algorithm (Algo- rithm 2) incurs less than 100 ms of latency, enabling scalable deployment in at-scale datacenters. VIII. CONCLUSION Hera is an application-aware co-location algorithm and resource management software for multi-tenant recommenda- tion inference. We first conduct a characterization on multi- 12 80100120140RandomHeraRandomHeraw/o CATwith CATEMU (%)80100120140(16,11,124)(16,11,94)(20,20,77)System configurationEMU (%) in Proceedings of the International Symposium on High-Performance Computer Architecture (HPCA), 2021. [32] B. Kim, J. Park, E. Lee, M. Rhu, and J. H. Ahn, "TRiM: Tensor Reduction in Memory," IEEE Computer Architecture Letters, 2020. [33] M. Wilkening, U. Gupta, S. Hsia, C. Trippel, C.-J. Wu, D. Brooks, and G.-Y. Wei, "RecSSD: Near Data Processing for Solid State Drive Based Recommendation Inference," in Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2021. [34] MLPerf, "MLPerf: A Broad ML Benchmark Suite for Measuring Performance of ML Software Frameworks, ML Hardware Acceler- ators, and ML Cloud Platforms." https://github.com/mlperf/inference/ tree/master/cloud. [35] W. Zhao, J. Zhang, D. Xie, Y. Qian, R. Jia, and P. Li, "AIBox: CTR Prediction Model Training on A Single Node," in Proceedings of the ACM International Conference on Information and Knowledge Management, 2019. [37] M. Lui, Y. Yetim, [36] X. Yi, Y.-F. Chen, S. Ramesh, V. Rajashekhar, L. Hong, N. Fiedel, N. Seshadri, L. Heldt, X. Wu, and H. Chi, "Factorized Deep Retrieval and Distributed TensorFlow Serving," in Conference on Machine Learn- ing and Systems, 2018. ̈O. ̈Ozkan, Z. Zhao, S.-Y. Tsai, C.-J. Wu, and M. Hempstead, "Understanding Capacity-Driven Scale-Out Neural Recommendation Inference," arXiv preprint arXiv:2011.02084, 2020. [38] J. Hestness, N. Ardalani, and G. Diamos, "Beyond Human-Level Ac- curacy: Computational Challenges in Deep Learning," in Proceedings of the Symposium on Principles and Practice of Parallel Programming (PPOPP), 2019. [39] SambaNova, "Surpassing State-of-the-Art Accuracy in Recommen- dation Models." https://sambanova.ai/blog/surpassing-state-of-the-art- accuracy-in-recommendation-models/, 2020. [40] W. Zhao, D. Xie, R. Jia, Y. Qian, R. Ding, M. Sun, and P. Li, "Distributed Hierarchical GPU Parameter Server for Massive Scale Deep Learning Ads Systems," in Proceedings of Machine Learning and Systems, 2020. [41] Intel, "Intel CMT CAT." https://github.com/intel/intel-cmt-cat. [14] U. Gupta, S. Hsia, J. Zhang, M. Wilkening, J. Pombra, H.-H. S. Lee, G.-Y. Wei, C.-J. Wu, and D. Brooks, "RecPipe: Co-Designing Models and Hardware to Jointly Optimize Recommendation Quality and Performance," in Proceedings of the International Symposium on Microarchitecture (MICRO), 2021. [15] H. Liu, Q. Gao, J. Li, X. Liao, H. Xiong, G. Chen, W. Wang, G. Yang, Z. Zha, D. Dong, D. Dou, and H. Xiong, "JIZHI: A Fast and Cost-Effective Model-As-A-Service System for Web-Scale Online Inference at Baidu," in Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2021. [16] C. Olston, N. Fiedel, K. Gorovoy, J. Harmsen, L. Lao, F. Li, V. Ra- jashekhar, S. Ramesh, and J. Soyke, "TensorFlow-Serving: Flexible, High-Performance ML Serving," arXiv preprint arXiv:1712.06139, 2017. [17] NVIDIA, "NVIDIA Triton Inference Server." https://developer.nvidia. com/nvidia-triton-inference-server. [18] J. Mars, L. Tang, R. Hundt, K. Skadron, and M. L. Soffa, "Bubble- Up: Increasing Utilization in Modern Warehouse Scale Computers via Sensible Co-Locations," in Proceedings of the International Symposium on Microarchitecture (MICRO), 2011. [19] C. Delimitrou and C. Kozyrakis, "Paragon: QoS-Aware Scheduling for Heterogeneous Datacenters," in Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2013. [20] D. Lo, L. Cheng, R. Govindaraju, P. Ranganathan, and C. Kozyrakis, "Heracles: Improving Resource Efficiency at Scale," in Proceedings of the International Symposium on Computer Architecture (ISCA), 2015. [21] H. Kasture and D. Sanchez, "Ubik: Efficient Cache Sharing with Strict QoS for Latency-Critical Workloads," in Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2014. [22] Y. Jiang, K. Tian, and X. Shen, "Combining Locality Analysis with Online Proactive Job Co-Scheduling in Chip Multiprocessors," in In- ternational Conference on High-Performance Embedded Architectures and Compilers, 2010. [23] Y. Jiang, K. Tian, X. Shen, J. Zhang, J. Chen, and R. Tripathi, "The Complexity of Optimal Job Co-Scheduling on Chip Multiprocessors and Heuristics-Based Solutions," IEEE Transactions on Parallel and Distributed Systems, 2010. [24] S. Chen, C. Delimitrou, and J. F. Mart ́ınez, "PARTIES: Qos-Aware Re- source Partitioning for Multiple Interactive Services," in Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2019. [25] T. Patel and D. Tiwari, "CLITE: Efficient and Qos-Aware Co-location of Multiple Latency-Critical Jobs for Warehouse Scale Computers," in Proceedings of the International Symposium on High-Performance Computer Architecture (HPCA), 2020. [26] R. Nishtala, V. Petrucci, P. Carpenter, and M. Sjalander, "Twig: Multi-Agent Task Management for Colocated Latency-Critical Cloud Services," in Proceedings of the International Symposium on High- Performance Computer Architecture (HPCA), 2020. [27] Y. Choi and M. Rhu, "PREMA: A Predictive Multi-task Scheduling Algorithm For Preemptible Neural Processing Units," in Proceedings of the International Symposium on High-Performance Computer Archi- tecture (HPCA), 2020. [28] S. Ghodrati, B. H. Ahn, J. K. Kim, S. Kinzer, B. R. Yatham, N. Alla, H. Sharma, M. Alian, E. Ebrahimi, N. S. Kim, C. Young, and H. Es- maeilzadeh, "Planaria: Dynamic Architecture Fission for Spatial Multi- Tenant Acceleration of Deep Neural Networks," in Proceedings of the International Symposium on Microarchitecture (MICRO), 2020. [29] Y. Kwon, Y. Lee, and M. Rhu, "TensorDIMM: A Practical Near- Memory Processing Architecture for Embeddings and Tensor Opera- tions in Deep Learning," in Proceedings of the International Symposium on Microarchitecture (MICRO), 2019. [30] L. Ke, U. Gupta, B. Y. Cho, D. Brooks, V. Chandra, U. Diril, A. Firoozshahian, K. Hazelwood, B. Jia, H.-H. S. Lee, M. Li, B. Maher, D. Mudigere, M. Naumov, M. Schatz, M. Smelyanskiy, X. Wang, B. Reagen, C.-J. Wu, M. Hempstead, and X. Zhang, "RecNMP: Accelerating Personalized Recommendation with Near-Memory Pro- cessing," in Proceedings of the International Symposium on Computer Architecture (ISCA), 2020. [31] Y. Kwon, Y. Lee, and M. Rhu, "Tensor Casting: Co-Designing Algorithm-Architecture for Personalized Recommendation Training," 13
http://arxiv.org/abs/2302.11737v2
2023-10-09T01:32:17
2023-02-23T01:57:09
Causally Disentangled Generative Variational AutoEncoder
We present a new supervised learning technique for the Variational AutoEncoder (VAE) that allows it to learn a causally disentangled representation and generate causally disentangled outcomes simultaneously. We call this approach Causally Disentangled Generation (CDG). CDG is a generative model that accurately decodes an output based on a causally disentangled representation. Our research demonstrates that adding supervised regularization to the encoder alone is insufficient for achieving a generative model with CDG, even for a simple task. Therefore, we explore the necessary and sufficient conditions for achieving CDG within a specific model. Additionally, we introduce a universal metric for evaluating the causal disentanglement of a generative model. Empirical results from both image and tabular datasets support our findings.
[ "Seunghwan An", "Kyungwoo Song", "Jong-June Jeon" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11737v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11737v2", "@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" ]
Causally Disentangled Generative Variational AutoEncoder SeungHwan ANa, Kyungwoo Songb and Jong-June Jeona;* aDepartment of Statistics, University of Seoul, S. Korea bDepartment of Applied Statistics, Department of Statistics and Data Science, Yonsei University, S. Korea 3 2 0 2 t c O 9 ] L M . t a t s [ 2 v 7 3 7 1 1 . 2 0 3 2 : v i X r a Abstract. We present a new supervised learning technique for the Variational AutoEncoder (VAE) that allows it to learn a causally dis- entangled representation and generate causally disentangled outcomes simultaneously. We call this approach Causally Disentangled Genera- tion (CDG). CDG is a generative model that accurately decodes an output based on a causally disentangled representation. Our research demonstrates that adding supervised regularization to the encoder alone is insufficient for achieving a generative model with CDG, even for a simple task. Therefore, we explore the necessary and sufficient conditions for achieving CDG within a specific model. Additionally, we introduce a universal metric for evaluating the causal disentangle- ment of a generative model. Empirical results from both image and tabular datasets support our findings. 1 Introduction Learning disentangled representation is a widely studied and challeng- ing topic of VAE [14], and GAN [8] due to its potential to enable inter- pretable data generation and enhance downstream task performances [32]. Roughly speaking, studies on disentangled representation investi- gate the structure of a latent space where each dimension corresponds to a ground-truth factor that generates a dataset [3]. In early studies of disentangled representation, the ground-truth factors consisting of the latent space are assumed to be mutually independent exogenous vari- ables [11]. In light of the growing interest in interpretable generative models, recent research has expanded the modeling of disentangled representation by incorporating a Structural Causal Model (SCM) and a jointly dependent model for the ground-truth factors [4, 33, 31, 25]. The importance of supervised learning for disentangled represen- tation is raised by [19], who proved that unsupervised disentangle- ment learning is impossible. Especially when the model includes en- dogenous factors of interest, the validity of the maximum likelihood method is guaranteed only when the ground-truth factors are correctly specified [33]. So, the SCM and supervised encoder regularization method [21] are crucial for constructing latent space that causally aligns with the ground-truth factors [39, 28]. Furthermore, the align- ment of the latent structure is also adapted by topological generation, which produces causally-aware generative models [37, 35, 36]. However, we found that the supervised regularization of the encoder [39, 28] is insufficient for achieving the causally-aware generative model. Even when the encoder builds a causally disentangled la- tent space, the causality between a latent variable and the generated output may not hold due to the entangled structure of the decoder. ∗ Corresponding Author. Email: [email protected]. Our research demonstrates that causally-aware generative models are necessarily able to recover the output according to the causally disen- tangled factors identified by the encoder. We refer to this property as Causally Disentangled Generation (CDG) and focus on the required conditions of the decoder and the causal effect of CDG. Based on the conditions, we propose a new VAE model satisfying CDG, the CDG-VAE. The development of CDG-VAE makes three contributions to the field of causally-aware generative models. First, we establish sufficient and necessary conditions of the decoder structure for CDG. Second, CDG-VAE can be applied to chain graphs (i.e., Partial DAGs) unlikely [37, 35, 36] that require a completely identified directed acyclic graph (DAG) for a topological generation. Third, we propose a generalized metric measuring the degree of causally disentangled generativeness under an arbitrary DAG structure of the ground-truth factors. Our metric is derived from the necessary conditions for CDG and do- calculus of causal effects [22]. We aim to demonstrate the effectiveness of our proposed model by evaluating two distinct types of datasets, namely image and tabular data. Specifically, we show that our model can produce causally plau- sible counterfactual samples with both qualitative and quantitative assessments of the image dataset. Additionally, we provide evidence of the advantages attained from the causally disentangled representa- tion of our model in terms of two downstream tasks: sample efficiency and distributional robustness [28]. Moving on to the tabular dataset, we show that our model can generate high-quality synthetic data while preserving the observed causal structure represented by a chain graph. Notation. Let v = (v1, v2, * * * , vp) ∈ Rp be a p-dimensional vector and a = (a1, * * * , am) be a tuple where aj ∈ {1, * * * , p}. va := (va1 , va2 , * * * , vam ) denotes a subvector of v sliced by a. Let σ(1), σ(2), * * * , σ(K) form a partition of {1, 2, * * * , p} and assume that each σ(j) is the ordered tuple whose elements are increasing. For a set I = {i1, i2, * * * , ik} ⊆ {1, * * * , K}, σ(I) := σ(i1) ⊕ * * * ⊕ σ(ik), where ⊕ is concatenation of tuples and i1 < i2 < * * * < ik. In particular, for I = {1, * * * , K} we denote σ(I) simply by σ and we call σ the permutation inducing K-block partion on Rp. 2 Assumptions and Model Structure 2.1 Data Generating Process Let x = (x1, * * * , xp) ∈ X ⊂ Rp, g = (g1, * * * , gd) ∈ Rd, u = (u1, * * * , ud) ∈ [0, 1]d with d < p be the observation, the ground-truth factor generating x, and the annotation vector of x. The generation and causal structure in x entirely depends on g. It is g x = D(g, u) u u g x = D(g) g x = D(g) u (a) GM1 (b) GM2 (c) GM3 Figure 1: Various generative model (GM) structures. assumed that g is unobservable, and the causality of g is identified only through u. Figure 1 shows three popular generative models (GM1, GM2, GM3) for causal disentanglement learning. In GM1 [13, 42, 10], gi, i = 1, * * * , d are mutually independent since the annotation vec- tor u is directly used to generate the observation x. In GM2 [39], u determines the conditional distribution of the ground-truth factor. The proposed model follows GM3 employed by [31, 28, 25]. GM3 differs from GM2 in that u is not explicitly used to construct the latent space. Rather, u is a recognized property of x, the annotation. [21] proposes the supervised regularization ensuring that the learned latent representation is disentangled. tuples Assumption 1 σ(j), π(j), j = 1, * * * , K are given such that there are (block) causal relationships, gπ(j) → xσ(j), j = 1, * * * , K. representation). Partition (Blocked [17] shows that Assumption 1 is required to infer the relationship among objects in the image. We denote the permutations inducing the K-block partition for x and g by σ and π and let σ and π be K-block consecutive partitions without loss of generality. 2.2 Embedding Causality We introduce the Markovian SCM of g [22, 24], denoted by M(g, e, F, Pe), where g and e ∈ Rd are the endogenous and ex- ogenous variables, F is a set of structural equations, and Pe is a probability measure of e. Assumption 2. 1. [Identifiable SCM] M(g, e, F, Pe) is identifiable with the directed acyclic graph (DAG) G derived from F. 2. [Unconfoundedness] The observation x is generated based on M(g, e, F, Pe) and xσ(j) depends on only gπ(j), for j = 1, * * * , K. It is ideal to employ M(g, e, F, Pe) as latent variables of CDG- VAE. However, we reduce M(g, e, F, Pe) to a simple non-linear structure equation model because Pe is unknown and F leads to heavy computational expense in training our generative model. Let B ∈ {0, 1}d×d be a binary adjacency matrix whose element indicates the existence of directed edges of G (i.e., the causal relationships between K block subvectors of gπ). For a subvector with an index s, the set of its non-descendants is denoted as N D(s), and the set of its descendants is denoted as Des(s). The reduced non-linear structural equation model [40, 39, 28] is f −1(z) = B⊤f −1(z) + ε, (1) where z ∈ Rd is an induced latent variable by an element-wise invert- ible function f and the d-dimensional standard normal distribution random variable ε. The distribution of latent variables in CDG-VAE is defined based on the entailed distribution of 1 and the distribution of ε, p(ε). The modeling of p(z) through B is distinguished from conventional VAE models whose prior distributions are given without considering causality. Here, B is treated as a known matrix. 2.3 Derivation of CDG-VAE The decoder of CDG-VAE is given by p(xσ|z; θ, β) = N (xσ|D(z; θ)σ, β * I), where D : Rd (cid:55)→ Rp is a function pa- rameterized with θ, I is the p × p identity matrix, and β > 0 is the non-trainable observation noise. The rearranged vector of D(z; θ) with σ is denoted as D(z; θ)σ, where D(z; θ)σ = (D(z; θ)σ(1), * * * , D(z; θ)σ(K)). The proposal distribution q(ε|x; φ) of CDG-VAE is given by N (cid:0)ε|μ(x; φ), diag(σ2(x; φ))(cid:1), where μ : Rp (cid:55)→ Rd, σ2 : Rp (cid:55)→ Rd + are neural networks parameterized with φ, and diag(a), a ∈ Rd denotes a diagonal matrix with diagonal elements a. Based on the proposal distribution, the negative ELBO (Evidence of Lower BOund) is written as L(x; θ, φ, f ) := Eq ∥ xσ − D(F (ε; f, B); θ)σ ∥2 (cid:21) (cid:20) 1 2 + β * KL(q(ε|x; φ)∥p(ε)) (2) where q is the proposal distribution, F (ε; f, B) := f ((I − B⊤)−1ε), f is parameterized with the flow-based model [27, 2], KL(q∥p) de- notes Kullback-Leibler divergence from p to q, and constant terms are omitted (see Appendix A.1 for detailed derivation). See Appendix A.1 for detailed covariance structures of z. The rearranged vector of z with π is denoted as zπ. Figure 2: Model structure of CDG-VAE. 2.4 Reguarization for Disentangled Representation In the supervision setting [21] of GM3, we adopt Assumption 3, which was adopted in semi-supervised causal disentanglement learning [28]. It implies the generative model with the type of GM3, the conditional independence u ⊥⊥ g|x, because g is F(x)-measurable. Assumption 3 (Informative supervision). gi = E[ui|x], ∀i. Since the ground-truth factors are causally related, the represen- tation of our encoder is entangled as the ground-truth factors [33]. With F (μ(x; φ); f, B), we aim to train the encoder parameters (φ, f ) to approximate the SCM of E[u|x] by (1). The following definition formalizes this concept. Definition 4 (Disentangled Representation [28]). For i = 1, * * * , d, suppose that there exists a 1-to-1 function hi such that F (μ(x; φ); f, B)i = h−1 i (E[ui|x]), where (φ, f ) are parameters of an encoder of a generative model, and the subscript i denotes the ith element. Then the generative model is said to have a disentangled representation with respect to E[u|x]. Note that Definition 4 implies that the disentangled representation only depends on the encoder of VAE. We adopt the supervised loss to obtain the disentangled representation, which aligns the representation and annotation vector [21]. Our final objective is minimizing Ex[L(x; θ, φ, f )] + λ * Ex,u[l(F (μ(x; φ); f, B), u)] (3) with respect to (θ, φ, f ), where λ > 0 is the tuning parameter and Ex, Ex,u indicate expectations for the marginal and joint distribution of the dataset, respectively. Note that (3) is easily extended to the semi- supervised learning model because the negative ELBO L and the supervised loss l are decoupled. In this paper, l is the cross-entropy loss with the sigmoid function hi for u ∈ [0, 1]d [28]. 3 Properties of CDG-VAE 3.1 Causally Disentangled Generation The disentanglement in the latent space has been studied with the link of explainability of VAE [11, 5, 7, 20]. The generative power of the latent space is theoretically investigated by the dimension of an activated latent space [1], which indicates a regular condition of the encoder. However, the disentangled latent space obtained by the encoder does not directly guarantee the generation of causally plausible data. We discover that the disentangled generation in the decoder is necessary. A simple example shows that D(z; θ)σ(N D(K)) determined by zπ(N D(K)) can be affected by do-intervention on zi, i ∈ π(K) due to entangled decoder structure (see examples in Section 5.2 and Ap- pendix A.7). However, in the disentangled latent space, a total causal effect does not exist from zi, i ∈ π(K) to zj, j ∈ π(N D(K)) be- cause there is no directed path [23]. This result implies that causal generation requires two types of disentanglement in encoding and decoding processes, respectively. We propose a new definition of the causally disentangled generation. Definition 5 (Causally Disentangled Generation (CDG)). Suppose a generative model has a disentangled representation (Definition 4). Let D(*; θ) : Rd (cid:55)→ Rp be a decoder mean vector of the model where the input is denoted as z ∈ Rd. Then the model is causally disentan- gled generative if, for s = 1, * * * , K, D(z; θ)σ(s) is independent to zπ(l), l ̸= s, given zπ(s). Definition 5 implies that CDG mimics the causal relationship of gπ(j) → xσ(j) as zπ(j) → D(z; θ)σ(j) for j = 1, * * * , K. And the following Proposition 6 demonstrates the sufficient condition of the decoder function class satisfying CDG. : Rd Proposition 6 (Sufficient Condition for CDG). Suppose a gen- erative model has a disentangled representation (Definition 4). (cid:55)→ Rp be a decoder mean vector of the Let D(*; θ) model. If the decoder structure of the model satisfies D(z; θ)σ := (cid:17) (cid:16) , where θ = (θ1, * * * , θK ), and D(zπ(1); θ1), * * * , D(zπ(1); θK ) D(*; θj) : R|π(j)| (cid:55)→ R|σ(j)| is a function parameterized with θj for j = 1, * * * , K, then the model satisfies Definition 5. Proof. If a generative model satisfies Proposition 6, the jth decoder partition D(zπ(j); θj) (which corresponds to D(z; θ)σ(j)) takes only a block-partitioned zπ(j) as input, for j = 1, * * * , K. Therefore, for j = 1, * * * , K, since zπ(j) is the direct cause of D(zπ(j); θj), D(zπ(j); θj) is independent to zπ(i), i ̸= j, given zπ(j). (cid:50) Assumption 7 (Faithfulness). The entailed distribution of (1) is faithful with respect to the graph induced by B. Proposition 8 (Existence of Total Causal Effect (TCE)). Suppose a generative model has a disentangled representation (Definition 4) and satisfies CDG (Definition 5). Let D(*; θ) : Rd (cid:55)→ Rp be a decoder mean vector of the model where the input is denoted as z ∈ Rd. For s = 1, * * * , K, under Assumption 7, 1. there is no total causal effect from zi to D(z; θ)j, for all i ∈ π(s) and j ∈ σ(N D(s)). 2. if there is a directed path from zi to zj for some i ∈ π(s) and j ∈ π(l) where l ∈ {s} ∪ Des(s), then there is a total causal effect from zi to D(z; θ)k, for all k ∈ σ(l). Proposition 8 states that the existence of TCE can be investigated by intervening on the latent variable if the causal structure identified by known B is embedded precisely in the latent space and a model satis- fies CDG. Since TCE determines the positiveness of the causal effect, Proposition 8 motivates us to check the validity of CDG by measuring the causal effect (see Section 3.2). Due to the computational issue, we estimate the causal effect on the annotation vector instead of block partitions, based on the causal relationship from D(z; θ)σ to uπ. First, we define the average causal effect of the latent variable on the annotation vector (the counterfactual quantity corresponding to the ground-truth factors [25]) and then propose necessary conditions for CDG based on the average causal effect. We denote z(1), z(2) as the vector of maximum and minimum values of latent variables given the observed dataset, respectively, and denote π(s)−i as the partition tuple π(s) without an index i. Definition 9 (Average Causal Effect (ACE)). Suppose that zi, i ∈ π(s), s = 1, * * * , K is intervened with z(1) . Then, for c = 1, * * * , d, the average causal effect of zi on the annotation vector uc given zπ(N D(s))⊕π(s)−i is defined as and z(2) i i ACE(uc, zi, zπ(N D(s))⊕π(s)−i = zπ(N D(s))⊕π(s)−i ) (cid:12) E[uc|zπ(N D(s))⊕π(s)−i , do(zi := z(1) (cid:12) (cid:12) )] i := − E[uc|zπ(N D(s))⊕π(s)−i , do(zi := z(2) i (cid:12) (cid:12) )] (cid:12). Proposition 10 (Necessary Conditions for CDG). For i ∈ π(s), s = 1, * * * , K, assume that arbitrary x and zπ(N D(s))⊕π(s)−i are given. z(j) (i,zπ(ND(s)),x) denotes z defined in (1) under intervention do(zi := z(j) ) given x and zπ(N D(s))⊕π(s)−i , for j = 1, 2. Suppose a gen- i erative model has a disentangled representation (Definition 4). For c = 1, * * * , d, under Assumption 7, if the model satisfies CDG (Defi- nition 5) and 1. c ∈ π(N D(s)), then ACE(uc, zi, zπ(N D(s))⊕π(s)−i ) = 0. 2. there is a directed path from zi to zc where c ∈ π(l) and l ∈ {s} ∪ Des(s), then 0 < ACE(uc, zi, zπ(N D(s))⊕π(s)−i ) E[uc|z(1) (i,zπ(ND(s)),x)] − E[uc|z(2) where p(x) is the probability density function of x. ≤ Ep(x) (cid:12) (cid:12) (cid:12) (i,zπ(ND(s)),x)] (cid:12) (cid:12) (cid:12), 3.2 Causal Disentanglement Metric Based on Proposition 10, we propose a metric that can evaluate how much a model is causally disentangled generative. Definition 11 (Causal Disentanglement Metric (CDM)). For c = 1, * * * , d and i ∈ π(s), s = 1, * * * , K, the causal disentanglement metric (CDM) is defined as CDM (c, i) := E[ACE(uc, zi, zπ(N D(s))⊕π(s)−i )], where E indicates the expectation with respect to zπ(N D(s))⊕π(s)−i . First, CDM for the first case of Proposition 10 measures interven- tional robustness [31]. If a generative model satisfies CDG, ACE should be zero by Proposition 10 (i.e., no total causal effect), and CDM is also exactly zero. Thus, CDM (c, i) > 0 implies that the model is not interventional robust. Next, CDM for the second case of Proposition 10 measures counter- factual generativeness [25]. Suppose a generative model satisfies CDG. Then, ACE should be non-zero (i.e., total causal effect exists) and is the lower bound of the coverage for the counterfactual quantity uc by Proposition 10. Therefore, CDM (c, i) = 0 or CDM (c, i) ≈ 0 implies that the model lacks counterfactual generativeness. [31, 25, 28] have considered disentangled causal mechanisms and proposed metrics for causal disentanglement. Unlike our study, the ex- isting studies do not deal with a causal effect between latent variables nor derive the metric based on the SCM of the ground-truth factors. In particular, our metric is theoretically justified by the necessary conditions for the CDG and the do-calculus of causal effects. There- fore, CDM can be regarded as a generalized causal disentanglement metric under the arbitrary DAG structure of ground-truth factors. See Appendix A.4 for identification of CDM's upper and lower bounds. Also, the faithfulness condition (Assumption 7) excludes the case where the directed path exists in B, but the total causal effect does not under. It implies that, under the faithfulness condition, our proposed metric CDM is valid to measure the causally disentangled genera- tiveness of the model. However, without the faithfulness condition, we can only measure the interventional robustness of Proposition 10. Therefore, the faithfulness condition is required to measure the causal disentanglement of the model by the average causal effect. 4 Related Work Active Latent Dimensions. [6, 29] propose the statistics to detect active latent dimensions, which encode useful information about the data and are significant in data generation. [1] shows that the pos- terior variance σ2(x; φ) determines whether the latent dimension affects generated data. However, the definition of disentangled repre- sentation (Definition 4) only depends on the deterministic component μ(x; φ). Therefore, a latent dimension can be simultaneously non- active and disentangled. It is a critical issue because the causally plau- sible counterfactual samples can not be generated when non-active latent variables are intervened (see Appendix A.8 for an example). [26] mitigates the non-activation issue by maximizing the additional mutual information regularization term. However, we discover that all latent dimensions are always active under Proposition 6. Supervised Causal Disentanglement Learning. [39, 28] propose causal disentanglement learning methods based on supervision setting [21] and embed the SCM in the latent space to make the represen- tation causally entangled. To obtain the disentangled representation, [39] aligns the latent variable and the annotation vector using KL- divergence and the customized prior, and [28] regularizes the encoder. However, since [39, 28] only constrain the encoder, their methods can not guarantee that generating causally plausible data is achievable. Causally-Aware Synthetic Data Generation. Since tabular datasets are already well-structured, covariates (columns) are usu- ally assumed to be causally related [36]. To exploit causations in the synthetic data generation, [37, 36, 35] generate data in the order of causal topology, and consequently, they require the completely iden- tified DAG, not the Partial DAG. However, from the observational data, the true causal graph of covariates can be identified only up to a Markov Equivalence Class (MEC), including undirected edges. Even though [35] proves that their generator converges to the right distribu- tion for any graph belonging to MECs, incorrect edge directions have the potential risk of misunderstandings of causations. 5 Experiments This section demonstrates that our model is causally disentangled in both the encoding and decoding processes. Our numerical experiments show that CDG-VAE can achieve two goals: 1) the causally plausible counterfactual generation under interventions on latent variables and 2) synthetic data generation preserving the observed causal struc- ture. Furthermore, the performances of our model, sample efficiency, distributional robustness, and synthetic data quality, are presented with three downstream tasks. The code and appendix are available at https://github.com/an-seunghwan/CDG-VAE. 5.1 Overview Dataset. For evaluation, we consider two types of datasets, image and tabular. For an image dataset, a simulated pendulum dataset [28, 39] is used. And loan, adult, and covertype datasets are used for real tabular datasets (see Appendix A.6 for detailed data descriptions). Compared Models. We train the vanilla VAE and InfoMax VAE [26] based on the objective function (3) (see Appendix A.1 for detailed ob- jective functions). We also compare existing disentangled generative models (CausalVAE [39], DEAR [28]) and synthesizers (TVAE [38], CTAB-GAN [41]). Note that all models are trained under the ground-truth causal graph, not a super-graph, because we numerically find that DEAR and CausalVAE are not able to discover ground-truth causal relationships. VAE, InfoMax VAE, and CDG-VAE share the same network archi- tecture for the encoder; however, only CDG-VAE has the decoder structure of Proposition 6. Notably, all models have the same size of the latent dimension. 5.2 Image Dataset In the pendulum dataset, there exist four ground-truth factors: g1(light angle), g2(pendulum angle), g3(shadow length), and g4(shadow po- sition). These factors have the causal relationship given as the DAG structure of Figure 3(a). Partition tuples of gπ are π(1) = (1), π(2) = (2), and π(3) = (3, 4). Causal structures are visualized in Figure 3(b). As in [28], we introduce random measurement noises in the genera- tion of annotation vectors to make the pendulum dataset more realistic. Shadows of 20% corrupted data are randomly generated to mimic some environmental disturbance. The training and test dataset sizes are 7,500 and 2,500, respectively. We also evaluated our model under a semi-supervised setting where only 10% of the annotation vectors are available. Since the annotations are bounded from 0 to 1, CDM's upper and lower bounds are also bounded from 0 to 1. 5.2.1 Causally Disentangled Generation We investigate the performance of counterfactual generation through do-intervention on the latent variable, and Figure 4 shows correspond- ing generated images. For CausalVAE and DEAR, if we intervene on g2 g4 g1 g3 (a) gπ(1) gπ(3) gπ(2) xσ(1) xσ(3) (b) xσ(2) (c) (d) Figure 3: Pendulum dataset. (a) DAG of the ground-truth factors g = (g1, * * * , g4). (b) The causal relationships between gπ and xσ. Dashed edges indicate induced edges by causations of gπ. (c) An observation example. (d) From left to right, xσ(1) (the light), xσ(2) (the pendulum), and xσ(3) (the shadow). shadow length and position, block partitions of their parents (i.e., light angle and pendulum angle) are affected (see the third and fourth row of Figure 4(a) and 4(b)). However, CDG-VAE can generate images in which block partitions of light angle and pendulum angle are not affected when their children (i.e., shadow length and position) are intervened (see the third and fourth row of Figure 4(c)). Therefore, CDG-VAE under Proposition 6 enables CDG. 5.2.2 Causal Disentanglement Metric We compared models using our proposed causal disentanglement metric CDM. For ease of explanation, we use CDM (light, length) instead of CDM (c = 1, i = 3). The second and third columns of Table 1 indicate the interventional robustness. For example, as light angle is a parent of shadow length, CDM (light, length) mea- sures interventional robustness. CDG-VAE achieves exactly zero in both CDM (light, length) and CDM (angle, pos), which implies that only CDG-VAE can satisfy CDG. It is worth mentioning that CDG-VAE achieves exactly zero CDM values for all other cases (see Appendix A.8). And the fourth and fifth columns of Table 1 show the counter- factual generativeness. For example, since shadow length is a child of pendulum angle, CDM (length, angle) measures the counter- factual generativeness. CDG-VAE achieves the highest score in CDM (pos, pos) and outperforms CausalVAE and DEAR models in CDM (length, angle). Therefore, Table 1 indicates that CDG- VAE has competitive counterfactual generativeness performance (see Appendix A.8 for other cases). 5.2.3 Downstream Task This section investigates the advantages of causally disentangled rep- resentations for two downstream tasks: sample efficiency and distri- butional robustness [28]. The binary classification task is mainly used for evaluation, and we generate the target label as a function of the ground-truth factors. It means that the representations learned from the generative model are causal representations of the target label (see Appendix A.7 for a detailed explanation). Sample Efficiency. To measure the sample efficiency, we use the statistical efficiency score defined as the test accuracy based on 100 samples divided by the test accuracy based on all samples, following (a) CausalVAE (b) DEAR (c) CDG-VAE(NL) Figure 4: Examples of generated counterfactual images. For each image, intervened dimensions are light angle, pendulum angle, shadow length, and shadow position from top to bottom. 'NL' denotes that a nonlinear f is used. [19, 28]. We use fitted encoders to extract representations and train an MLP classifier on top of the representations to predict the target label. Notably, all models are evaluated with the same MLP. We also report the test accuracies to prevent misleading when a classifier achieves poor test accuracy in both cases. Table 2 shows that CDG- VAE performs the best in the sample efficiency downstream task. Distributional Robustness. To evaluate the distributional robust- ness of causal representations, we manipulate the training dataset to impose spurious correlations between the target label and some spurious features of the image. We choose background_color ∈ {white(0), blue(1)} as a spurious feature [28]. 80% of the training samples have the same value of the target label and background_color (strong correlation), but the test samples do not have such correlations (all label values are distributed equally). Table 3 shows the performances of the compared models in the distributional robustness (downstream task) of the causally disentan- gled representation. The worst case ('TrainWorst' and 'TestWorst') is when the target label and the spurious feature background_color are grouped to have the opposite label. For that group, the spuri- ous feature has a different correlation between the training and test datasets. And Table 3 shows that CDG-VAE shows the best test accu- racy in the worst cases. Therefore, CDG-VAE can produce a causally disentangled representation robust to distributional shifts. Note that 'TrainAvg' or 'TrainWorst' are not reasonable criteria to judge the Table 1: Numbers in parentheses are lower and upper bounds of CDM. 'L' and 'NL' denote the model with linear and nonlinear f , and '*' denotes the semi-supervised learned model. Mean and standard deviation values are obtained from 10 repeated experiments. 'pos' denotes shadow position. ↑ denotes higher is better and ↓ denotes lower is better. Interventional Robustness ↓ Counterfactual Generativeness ↑ Model CDM (light, length) CDM (angle, pos) CDM (length, angle) CDM (pos, pos) VAE(L) VAE(NL) InfoMax(L) InfoMax(NL) CausalVAE DEAR CDG-VAE(L) CDG-VAE(NL) (0.44, 0.44)±(0.35,0.35) (0.38, 0.40)±(0.28,0.27) (0.42, 0.43)±(0.39,0.38) (0.37, 0.39)±(0.32,0.30) (0.28, 0.28)±(0.11,0.10) (0.21, 0.23)±(0.16,0.15) (0.00, 0.00)±(0.00,0.00) (0.00, 0.00)±(0.00,0.00) (0.28, 0.28)±(0.30,0.31) (0.27, 0.33)±(0.25,0.24) (0.38, 0.38)±(0.34,0.34) (0.26, 0.33)±(0.28,0.25) (0.17, 0.17)±(0.09,0.08) (0.26, 0.29)±(0.25,0.24) (0.00, 0.00)±(0.00,0.00) (0.00, 0.00)±(0.00,0.00) (0.31, 0.32)±(0.16,0.15) (0.33, 0.34)±(0.12,0.12) (0.40, 0.40)±(0.26,0.25) (0.44, 0.44)±(0.21,0.21) (0.10, 0.10)±(0.04,0.04) (0.23, 0.25)±(0.23,0.23) (0.24, 0.25)±(0.10,0.09) (0.35, 0.36)±(0.16,0.15) (0.27, 0.28)±(0.25,0.24) (0.31, 0.34)±(0.21,0.20) (0.29, 0.31)±(0.22,0.20) (0.31, 0.34)±(0.19,0.16) (0.29, 0.29)±(0.09,0.09) (0.16, 0.20)±(0.18,0.16) (0.69, 0.69)±(0.25,0.25) (0.78, 0.78)±(0.24,0.24) CDG-VAE(L)* CDG-VAE(NL)* (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.00,0.00) (0.21, 0.22)±(0.09,0.07) (0.29, 0.30)±(0.12,0.11) (0.66, 0.66)±(0.22,0.22) (0.79, 0.79)±(0.21,0.21) Table 2: Sample efficiency and test accuracies with 100 and all training samples. 'L' and 'NL' denote the model with linear and nonlinear f , and '*' denotes the semi-supervised learned model. Mean and standard deviation values are obtained from 10 repeated experiments. Higher is better. Model 100(%) All(%) SE(100/All) g1 g2 VAE(L) VAE(NL) InfoMax(L) InfoMax(NL) CausalVAE DEAR CDG-VAE(L) CDG-VAE(NL) CDG-VAE(L)* CDG-VAE(NL)* 88.41±2.07 87.74±1.23 88.69±1.36 87.74±1.05 50.39±2.08 82.92±3.45 89.48±0.76 87.94±1.29 89.33±0.63 88.39±0.69 90.18±1.01 90.16±0.60 90.34±0.52 90.15±0.54 86.94±1.44 88.92±1.34 90.68±0.24 90.19±0.52 90.52±0.34 90.06±0.47 98.03±1.67 97.32±1.25 98.18±1.45 97.32±0.98 57.98±2.74 93.27±3.97 98.67±0.81 97.51±1.22 98.69±0.48 98.14±0.90 best model because Table 3 shows the distributional robustness where the distribution of the test dataset is changed (i.e., distributional shift). On the other hand, if the latent space is not causally disentangled, the features of observation partitions are entangled in the encoder, and the model exploits the entangled features in the learning of the latent space. It results that the latent variable is affected by the changes in the observation partitions, which are not causally related. See the toy example of such a case in Appendix A.7. And we guess that the latent space of CausalVAE is not fully disentangled, and the downstream classifier utilizes the correlation information between the spurious feature and the target label. Consequently, the downstream classifier with CausalVAE is overfitted and shows a higher score in 'TrainAvg' metric in Table 3. 5.3 Tabular Datasets 5.3.1 Causal Disentanglement Learning In the supervised causal disentanglement learning method with tabular datasets, we assume that the causal dependencies between K block subvectors of xσ are induced by the causal structure of gπ. Therefore, xσ is a chain graph-structured data, such as a multi-layered proteomic data [9] and xσ(1), * * * , xσ(K) are chain components [16]. Figure 5(b) shows the chain graph of loan dataset obtained by PC algorithm [30]. The chain components of xσ are xσ(1) = (Mortgage, Income), xσ(2) = (Experiences, Age), and xσ(3) = g3 (a) (b) Figure 5: loan dataset. (a) DAG structure of ground-truth factors g. (b) The chain graph of covariates. (CCAvg). We assume that each chain component xσ(j) is generated by the single ground-truth factor gj, as in GM3 of Figure 1 (gj → xσ(j)). Thus, Figure 5(a) is the DAG structure of the ground-truth factors g. Due to undirected edges between covariates (e.g., the edge between Mortgage and Income), the SCM of covariates is not defined well, and the covariate-wise topological generation of [37, 35, 36] is not appli- cable. However, without a completely identified DAG, CDG-VAE can achieve the CDG. That is, our model can include (Mortgage, Income) and (Experience, Age) as the chain components in disentanglement learning. First, since Figure 5(a) consists of only directed causal relation- ships, the SCM of the latent variables can be formulated based on the DAG of Figure 5(a). Next, we define the bijection output of each chain component xσ(j) as E[uj|xσ(j)] and assume that gj = E[uj|xσ(j)] = E[uj|x], for j = 1, 2, 3. The DAG obtained by the PC algorithm with bijection outputs is equivalent to Figure 5(a), implying that bijection outputs have the same causal structure as the ground-truth factors. In practice, we use the interleaving function for bijection after the min-max scaling (note that the independence is not affected by scaling). See Appendix A.6 for other tabular datasets' chain graph structures and chain components. 5.3.2 Synthetic Data Generation We evaluated the performance of our model in synthetic data genera- tion. To measure whether the observed causal structure is preserved, we use the Structural Hamming Distance (SHD) [34] between causal graphs of the observed and a synthetic dataset. Causal graphs are Table 3: Distributional robustness: Train and test dataset accuracy for average ('Avg') and worst ('Worst') cases. 'L' and 'NL' denote the model with linear and nonlinear f , and '*' denotes the semi-supervised learned model. Mean and standard deviation values are obtained from 10 repeated experiments. Higher is better. Model TrainAvg(%) TrainWorst(%) TestAvg(%) TestWorst(%) VAE(L) VAE(NL) InfoMax(L) InfoMax(NL) CausalVAE DEAR CDG-VAE(L) CDG-VAE(NL) CDG-VAE(L)* CDG-VAE(NL)* 61.70±2.46 62.14±1.98 61.50±2.08 62.33±2.35 73.93±0.99 62.33±2.27 64.28±5.22 60.97±0.91 70.43±4.69 67.19±3.61 57.70±2.56 57.63±2.93 57.55±3.56 58.07±2.48 35.52±5.57 55.62±4.61 50.45±10.07 59.34±1.30 40.47±11.16 44.28±9.88 58.88±0.85 59.41±0.93 59.04±1.21 59.60±0.77 57.92±1.28 58.60±1.02 58.02±0.91 59.22±0.60 55.36±1.37 55.66±1.96 55.73±2.75 55.91±3.34 56.00±3.29 56.45±2.36 33.91±4.92 53.16±4.25 48.59±10.05 57.21±1.50 36.31±9.87 41.01±9.48 Table 4: SHD and data quality scores for synthetic datasets. All models use linear f . Mean and standard deviation values are obtained from 10 repeated experiments. 'Baseline' indicates results from the observed dataset. ↑ denotes higher is better and ↓ denotes lower is better. Dataset Model Baseline VAE InfoMax TVAE CTAB-GAN CDG-VAE CDG-TVAE loan(p = 5) adult(p = 5) covertype(p = 8) SHD ↓ R2 ↑ SHD ↓ F1 ↑ SHD ↓ F1 ↑ - 0.392 6.1±2.3 −7.936±15.127 −5.149±7.920 7.1±1.1 −0.631±0.380 5.0±1.8 −0.912±0.504 4.9±0.9 0.9±0.3 0.4±0.5 −0.982±1.663 0.013±0.010 - 7.0±2.3 7.5±1.2 5.1±1.5 5.5±3.2 0.3±0.9 0.2±0.4 0.818 0.739±0.032 0.712±0.061 0.724±0.009 0.795±0.007 0.696±0.003 0.645±0.001 - 17.7±3.1 17.8±4.1 16.2±2.9 17.3±3.6 1.6±0.5 2.8±0.6 0.712 0.067±0.022 0.102±0.021 0.358±0.024 0.077±0.029 0.127±0.015 0.178±0.005 obtained by the PC algorithm [30]. The smaller SHD value indicates a model can generate synthetic data with precise causal relationship information. On the other hand, to evaluate the synthetic data quality, we use the synthetic data as training data for three widely used machine learning algorithms: linear (logistic) regression, Random Forest, and Gradient Boosting (see Appendix A.6 for details). We average the following metrics: R2 for the regression and F1 for the classification problem. Note that the synthetic data and the observed data have the same size. Here, CDG-TVAE is the new synthesizer where the mode-specific normalization technique of TVAE is combined with CDG-VAE. The SHD values of Table 4 show that models under Proposition 6 (CDG-VAE and CDG-TVAE) outperform in terms of preserving the original causal structure well compared to the other models in synthetic data generation. Moreover, we observe that the difference in the SHD value between the proposed model and the compared models becomes significantly larger as the number of covariates (p) increases. Although CDG-TVAE compromises the F1 score and SHD value (covertype dataset) since we restrict the latent space and the de- coder structure of the model according to the causal relationships, CDG-TVAE has a competitive performance in data quality scores in Table 4 (loan, adult datasets). Therefore, CDG-TVAE can gener- ate synthetic data, which can be used as a good proxy of the original data while preserving the observed causal structure. 6 Conclusion and Limitations We demonstrate that causally disentangled latent space is insufficient to generate an image according to the causal mechanism defined by a general SCM. Figure 4 shows that the entangled decoder can not generate the counterfactual image even when the causal struc- ture is simple and the block-partition indices are known. This result concludes that the disentanglement of features is crucial both in the encoder and the decoder, and a causal relationship is contaminated without the disentanglement. The decoder structure of Proposition 6 is very restricted since it requires the indices of all partition blocks (i.e., obtaining complete causal information for supervision). We do not believe the proposed decoder structure is directly applicable to large-scale datasets such as the CelebA dataset [18]. Besides, in synthetic data generation, we numerically find that the supervised disentanglement learning with interleaving bijection (Section 5.3) can preserve the observed causal structure only when the cardinality of a chain component is small (empirically, less than 4). We guess that it is because the interleaving function has limited expressiveness. We expect that we can effectively deal with the partitioned blocks as a multi-layered image with the same size and control the prop- erty of disentangled features by utilizing mutual information between generated samples and annotation vectors. In addition, to enrich the ex- pressiveness of the latent space with a causal structure, it is necessary to find computationally tractable bijections maps for multivariates and multi-layered data and apply supervised disentanglement learning. We leave solving the two problems as our future work. Lastly, our model is identifiable in the sense of [15] (the generalized identifiability). But it is not sure that our model is also A-identifiable or P -indentifiable [12] because our standard Gaussian assumption for priors violates the sufficient condition of the identifiability. We will thoroughly discuss the identifiability of our proposed model and address this as a crucial research topic for future investigations. Acknowledgements This work was supported by the National Research Foundation of Korea(NRF) grant funded by the Korea government(MSIT) (No. NRF-2022R1A4A3033874, No. NRF-2022R1F1A1074758, and NO.2022M3J6A1084845). The authors acknowledge the Urban Big data and AI Institute of the University of Seoul supercomputing re- sources (http://ubai.uos.ac.kr) made available for conducting the re- search reported in this paper. References [2] [1] SeungHwan An and Jong-June Jeon, 'Customized latent space: Practical usage of variational autoencoder', SSRN Electronic Journal, (2023). Jens Behrmann, Will Grathwohl, Ricky TQ Chen, David Duvenaud, and Jörn-Henrik Jacobsen, 'Invertible residual networks', in International Conference on Machine Learning, pp. 573–582. PMLR, (2019). [3] Yoshua Bengio, Aaron Courville, and Pascal Vincent, 'Representation learning: A review and new perspectives', IEEE transactions on pattern analysis and machine intelligence, 35(8), 1798–1828, (2013). [4] Yoshua Bengio, Tristan Deleu, Nasim Rahaman, Rosemary Ke, Sébastien Lachapelle, Olexa Bilaniuk, Anirudh Goyal, and Christo- pher Pal, 'A meta-transfer objective for learning to disentangle causal mechanisms', arXiv preprint arXiv:1901.10912, (2019). [5] Diane Bouchacourt, Ryota Tomioka, and Sebastian Nowozin, 'Multi- level variational autoencoder: Learning disentangled representations from grouped observations', in Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, (2018). [6] Yuri Burda, Roger Baker Grosse, and Ruslan Salakhutdinov, 'Importance weighted autoencoders', CoRR, abs/1509.00519, (2015). [7] Emilien Dupont, 'Learning disentangled joint continuous and discrete representations', Advances in Neural Information Processing Systems, 31, (2018). Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio, 'Gen- erative adversarial networks', Communications of the ACM, 63(11), 139–144, (2020). [8] [9] Min Jin Ha, Francesco Claudio Stingo, and Veerabhadran Baladan- dayuthapani, 'Bayesian structure learning in multilayered genomic net- works', Journal of the American Statistical Association, 116(534), 605– 618, (2021). [11] [10] Sina Hajimiri, Aryo Lotfi, and Mahdieh Soleymani Baghshah, 'Semi- supervised disentanglement of class-related and class-independent fac- tors in vae', ArXiv, abs/2102.00892, (2021). Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner, 'beta-vae: Learning basic visual concepts with a constrained variational framework', (2016). Ilyes Khemakhem, Diederik P. Kingma, and Aapo Hyvärinen, 'Varia- tional autoencoders and nonlinear ica: A unifying framework', in Inter- national Conference on Artificial Intelligence and Statistics, (2019). [12] [13] Diederik P. Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling, 'Semi-supervised learning with deep generative models', in NIPS, (2014). [14] Diederik P Kingma and Max Welling, 'Auto-encoding variational bayes', arXiv preprint arXiv:1312.6114, (2013). [15] Bohdan Kivva, Goutham Rajendran, Pradeep Ravikumar, and Bryon Aragam, 'Identifiability of deep generative models without auxiliary information', in Neural Information Processing Systems, (2022). [16] Daphne Koller and Nir Friedman, Probabilistic graphical models: prin- ciples and techniques, MIT press, 2009. [17] Sébastien Lachapelle, Pau Rodriguez, Yash Sharma, Katie E Everett, Rémi Le Priol, Alexandre Lacoste, and Simon Lacoste-Julien, 'Disen- tanglement via mechanism sparsity regularization: A new principle for nonlinear ica', in Conference on Causal Learning and Reasoning, pp. 428–484. PMLR, (2022). [18] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang, 'Deep learning face attributes in the wild', in Proceedings of International Conference on Computer Vision (ICCV), (December 2015). [19] Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Raetsch, Syl- vain Gelly, Bernhard Schölkopf, and Olivier Bachem, 'Challenging common assumptions in the unsupervised learning of disentangled repre- sentations', in international conference on machine learning, pp. 4114– 4124. PMLR, (2019). [20] Francesco Locatello, Michael Tschannen, Stefan Bauer, Gunnar Rätsch, Bernhard Schölkopf, and Olivier Bachem, 'Disentangling factors of variation using few labels', arXiv preprint arXiv:1905.01258, (2019). [21] Francesco Locatello, Michael Tschannen, Stefan Bauer, Gunnar Rätsch, Bernhard Schölkopf, and Olivier Bachem, 'Disentangling factors of [22] [23] [24] variations using few labels', in International Conference on Learning Representations, (2020). Judea Pearl, Causality, Cambridge university press, 2009. J. Peters, Dominik Janzing, and Bernhard Schölkopf, 'Elements of causal inference: Foundations and learning algorithms', (2017). Jonas Peters, Dominik Janzing, and Bernhard Schölkopf, Elements of causal inference: foundations and learning algorithms, The MIT Press, 2017. [25] Abbavaram Gowtham Reddy, Vineeth N Balasubramanian, et al., 'On causally disentangled representations', in Proceedings of the AAAI Con- ference on Artificial Intelligence, volume 36, pp. 8089–8097, (2022). [26] Ali Lotfi Rezaabad and Sriram Vishwanath, 'Learning representations by maximizing mutual information in variational autoencoders', in 2020 IEEE International Symposium on Information Theory (ISIT), pp. 2729– 2734. IEEE, (2020). [27] Danilo Rezende and Shakir Mohamed, 'Variational inference with nor- malizing flows', in International conference on machine learning, pp. 1530–1538. PMLR, (2015). [28] Xinwei Shen, Furui Liu, Hanze Dong, Qing Lian, Zhitang Chen, and Tong Zhang, 'Weakly supervised disentangled generative causal repre- sentation learning', Journal of Machine Learning Research, 23, 1–55, (2022). [29] Robert Sicks, Ralf Korn, and Stefanie Schwaar, 'A generalised linear model framework for variational autoencoders based on exponential dispersion families', J. Mach. Learn. Res., 22, 233:1–233:41, (2020). [30] Peter Spirtes, Clark N Glymour, Richard Scheines, and David Hecker- man, Causation, prediction, and search, MIT press, 2000. [31] Raphael Suter, Djordje Miladinovic, Bernhard Schölkopf, and Stefan Bauer, 'Robustly disentangled causal mechanisms: Validating deep rep- resentations for interventional robustness', in International Conference on Machine Learning, pp. 6056–6065. PMLR, (2019). [32] Attila Szabó, Qiyang Hu, Tiziano Portenier, Matthias Zwicker, and Paolo Favaro, 'Challenges in disentangling independent factors of variation', arXiv preprint arXiv:1711.02245, (2017). [33] Frederik Träuble, Elliot Creager, Niki Kilbertus, Francesco Locatello, Andrea Dittadi, Anirudh Goyal, Bernhard Schölkopf, and Stefan Bauer, 'On disentangled representations learned from correlated data', in Inter- national Conference on Machine Learning, pp. 10401–10412. PMLR, (2021). Ioannis Tsamardinos, Laura E Brown, and Constantin F Aliferis, 'The max-min hill-climbing bayesian network structure learning algorithm', Machine learning, 65(1), 31–78, (2006). [34] [35] Boris van Breugel, Trent Kyono, Jeroen Berrevoets, and Mihaela van der Schaar, 'Decaf: Generating fair synthetic data using causally-aware gen- erative networks', Advances in Neural Information Processing Systems, 34, 22221–22233, (2021). [36] Bingyang Wen, Luis Oliveros Colon, KP Subbalakshmi, and Rajarath- nam Chandramouli, 'Causal-tgan: Generating tabular data using causal generative adversarial networks', arXiv preprint arXiv:2104.10680, (2021). [37] Depeng Xu, Yongkai Wu, Shuhan Yuan, Lu Zhang, and Xintao Wu, 'Achieving causal fairness through generative adversarial networks', in Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, (2019). [38] Lei Xu, Maria Skoularidou, Alfredo Cuesta-Infante, and Kalyan Veera- machaneni, 'Modeling tabular data using conditional gan', Advances in Neural Information Processing Systems, 32, (2019). [39] Mengyue Yang, Furui Liu, Zhitang Chen, Xinwei Shen, Jianye Hao, and Jun Wang, 'Causalvae: Disentangled representation learning via neural structural causal models', in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9593–9602, (2021). [40] Yue Yu, Jie Chen, Tian Gao, and Mo Yu, 'Dag-gnn: Dag structure learning with graph neural networks', in International Conference on Machine Learning, pp. 7154–7163. PMLR, (2019). [41] Zilong Zhao, Aditya Kunar, Hiek van der Scheer, Robert Birke, and Lydia Yiyu Chen, 'Ctab-gan: Effective table data synthesizing', ArXiv, abs/2102.08369, (2021). [42] Zhilin Zheng and Li Sun, 'Disentangling latent space for vae by label rel- evant/irrelevant dimensions', 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 12184–12193, (2018).
http://arxiv.org/abs/2302.11730v1
2023-02-23T01:35:44
2023-02-23T01:35:44
Detachedly Learn a Classifier for Class-Incremental Learning
In continual learning, model needs to continually learn a feature extractor and classifier on a sequence of tasks. This paper focuses on how to learn a classifier based on a pretrained feature extractor under continual learning setting. We present an probabilistic analysis that the failure of vanilla experience replay (ER) comes from unnecessary re-learning of previous tasks and incompetence to distinguish current task from the previous ones, which is the cause of knowledge degradation and prediction bias. To overcome these weaknesses, we propose a novel replay strategy task-aware experience replay. It rebalances the replay loss and detaches classifier weight for the old tasks from the update process, by which the previous knowledge is kept intact and the overfitting on episodic memory is alleviated. Experimental results show our method outperforms current state-of-the-art methods.
[ "Ziheng Li", "Shibo Jie", "Zhi-Hong Deng" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11730v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11730v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Detachedly Learn a Classifier for Class-Incremental Learning Ziheng Li, Shibo Jie, Zhi-Hong Deng School of Intelligence Science and Technology, Peking University {liziheng, parsley, zhdeng}@pku.edu.cn 3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 0 3 7 1 1 . 2 0 3 2 : v i X r a Abstract In continual learning, training a discriminative model need to continually learn a feature extractor and a classifier on a se- quence of tasks. This paper empirically proves a pretrained feature extractor can significantly promote continual learn- ing by means of a optimized experience replay (ER) strategy. We present an probabilistic analysis that the failure of vanilla ER comes from unnecessary re-learning of previous tasks and incompetence to distinguish current task from the previous ones, which is the cause of knowledge degradation and pre- diction bias. To overcome these weaknesses, we propose a novel replay strategy called task-aware experience replay. It rebalances the replay loss and detaches classifier weight for the old tasks from the update process, by which the previ- ous knowledge is kept intact and the overfitting on episodic memory is alleviated. Experimental results show our method outperforms current state-of-the-art methods. 1 Introduction Training of contemporary artificial neural networks heav- ily relies on the exposition to independent and identi- cally distributed data sampling. When continually learn- ing a sequence of tasks, neural network only works well on the most recent task and the performance on previ- ous tasks drops drastically. This phenomenon is referred to as catastrophic forgetting (McCloskey and Cohen 1989; McClelland, McNaughton, and O'Reilly 1995). It restricts the application of neural networks in read-world scenarios. Continual learning (CL, a.k.a. incremental learning) aims to train a single model on non-stationary data distribution avoiding catastrophic forgetting with limited memory over- head (McCloskey and Cohen 1989; Kirkpatrick et al. 2017). On the other hand, pretrained models have achieved great success in NLP and CV (Devlin et al. 2019; Radford et al. 2019; Dosovitskiy et al. 2021). Most state-of-the-art ap- proaches for NLP downstream tasks rely on pretraining on large-scale dataset. For CV, this pretraining & fine- tuning paradigm is also applied in continual learning to replace random initialization (Jung et al. 2020; Cha et al. 2021). Some works keep the pretrained model unchanged to extract stable feature, on which they build a simple classifier (van de Ven, Li, and Tolias 2021), e.g. one-layer linear classifier. We think it is necessary to push the research of continual learning towards pretrained-model- based paradigm to achieve satisfactory performance in real- world applications. However, existing works still do not fully exploit the power of pretrained model. This paper aims to explore a effective way to continually learn a classifier upon a frozen feature extractor. Compared with finetun- ing, this linear probing paradigm also enjoys the pretrained knowledge but is much more efficient. Although pretrained feature extractor provides rich and stable feature, training the classifier still faces two chal- lenges. First, the ability to classify among classes of past tasks degrades which we call knowledge degradation; Sec- ond, the classifier is unable to learn to distinguish between current task and past ones which causes the notorious pre- diction bias. Prediction bias happens because discriminative classifier needs both positive and negative samples to de- rive the decision boundary. Without previous data, the clas- sifier cannot distinguish samples from different tasks. To this end, many class-incremental learning approaches maintain an episodic memory that stores a few samples from previous tasks to perform experience replay (ER) in following train- ing (Rolnick et al. 2019; Castro et al. 2018; Hou et al. 2019; Aljundi et al. 2019; Buzzega et al. 2020). In this paper, to explore a proper way that ER works with pretrained model, we first present an analysis from a prob- abilistic view that vanilla experience replay (ER) fails be- cause of unnecessary re-learning of previous tasks and in- competence to distinguish the current task from the previous ones due to overfitting and class imbalance, which causes knowledge degradation and prediction bias respectively. To overcome the weaknesses of vanilla ER, we propose task- aware experience repaly (TaER). TaER differs from ER in three aspects. Firstly, TaER focuses on training classifier built on a frozen pretrained model. Secondly, TaER adds a dynamic weight factor to the replay loss term to mimic a class-balanced training. Thirdly, TaER only updates the classifier weight for the current task so that the old classi- fier is detached from the gradient flow (still involve in soft- max), which completely eliminates the forgetting and signif- icantly alleviates overfitting. In summary, our contribution are three-fold: 1. We empirically prove a pretrained feature extractor can significantly promote continual learning. 2. We propose a novel ER strategy which better exploits the pretrained feature extractor and overcomes the weak- nesses of vanilla ER, backed up by a probabilistic analy- sis. 3. Experimental results show our method outperform cur- rent state-of-the-art baselines. 2 Related Work Continual Learning Mainstream continual learning strategies can be divided into three categories (Parisi et al. 2019). Regularization strategies preserve the past knowledge by directly limiting the update of the parameters so that the neural network can have stable outputs (Kirkpatrick et al. 2017; Zenke, Poole, and Ganguli 2017; Aljundi et al. 2018; Jung et al. 2020). The algorithms assign a penalty term for each parameter according to its importance and deviation. Architecture strategies prevent knowledge interference by assigning a task-specific module for each task and freezing shared parameters. The module can be hid- den units (Masse, Grant, and Freedman 2018), parameter mask (Serr`a et al. 2018) or sub-networks (Yoon et al. 2018; Yan, Xie, and He 2021). In inference phase, model will switch to corresponding parameters according to task iden- tity, or alternatively leverage the whole expanded model. Replay (a.k.a rehearsal) strategies maintain a episodic memory to store a few past samples. During training. Ex- perience replay (ER) (Robins 1995; Rolnick et al. 2019) takes input sampled from both of current training data and memory as if input were sampled from joint data distribution. Meta-Experience Replay (MER) (Riemer et al. 2019) combines ER with meta-learning to promote trans- fer and suppress interference. Gradient based sample selec- tion (GSS) (Aljundi et al. 2019) improves memory selection strategy by maximizing the diversity of gradients. Dark ex- perience replay++ (DER++) (Buzzega et al. 2020) not only stores the ground truth in the memory but also records net- work's logits for replay. classifier (Wu et al. Incremental Classifier Learning Incremental 2018; learning Javed and Shafait 2018) suffers both knowledge degra- iCaRL (Rebuffi et al. 2017) dation and prediction bias. tackles the two challenges by combining distillation loss (Shmelkov, Schmid, and Alahari 2017) with experience replay. This hybrid strategy is typically used in follow-up works. However, ER can only alleviate prediction bias to some extent. Due to the memory limit, there is a severe imbalance between new classes and old classes, which encourages the classifier to output a high score for new classes. To this end, EEIL (Castro et al. 2018) proposes a cross-distilled loss function to retain the knowledge together with a balanced finetuning. This finetuning is replaced by a rebalanced loss in our method, which is much more efficient since it does not introduce extra training. BiC (Wu et al. 2019) adds a linear model behind the classifier to correct the bias towards new classes. UCIR (Hou et al. 2019) uses cosine normalization in the last layer to avoid the imbalanced magnitude of weight vector of the classifier. They also further exploit the memory samples by a margin rank loss. SS-IL (Ahn et al. 2021) analyzes ER from a view of gradient and proposes separated softmax to reduce inter-task interference which is contrary to our method. Among previous works, UCIR is most close to our method. UCIR also fixes the previous weights. The difference is we abolish distillation loss and only leverage a joint cross entropy loss and we equip it with a dynamic balance factor. 3 Preliminaries Problem Formulation Under continual learning setting, a classification problem consists of a sequence of T tasks. At each time t ∈ {1, 2, * * * , T }, a new task arrives and model can only sam- ple from current distribution Dt while Di, 1 ≤ i < t are invisible. Due to the difficulty of class-incremental learning, this restriction is usually relieved that it is tolerable to store a small episodic memory M . The final goal is to learn a map- ping f : X 7→ Y that minimizes L = E (x,y)∼D l(f (x), y), (1) where D is the joint distribution of all tasks. In this paper, we assume the label set Yt of each task is informed on task Yj = ∅, ∀i 6= j. That is to say the training arriving and Yi is task-aware. T A Probabilistic View of Continual Learning First, we present a analysis of what the model learns at each time t from the probabilistic view. There are two typical ap- proaches to model the data distribution with neural network. The discriminative approach models the conditional distri- bution p(y|x) while the generative approach models the joint distribution p(x, y). Most classification model belongs to the former one, since it usually enjoys better accuracy. But mod- eling p(y|x) requires samples (original images or features or information in other forms) from all classes at the same time. By contrast, it is still feasible to train generative mod- els even if each task contains only one class, but their classi- fication performance usually fall behind discriminative mod- els. In this paper, we focus on discriminative models. We assume f (x) , g(h(x)) = softmax(W Th(x)), where h is the frozen pretrained feature extractor, W is the weight of a one-layer softmax classifier. As tasks continually arrive, the label set is expanding and so is W . Note that the classifier computes probability over all seen classes. Thus we can rewrite the conditional dis- tribution p(y|x) at time t as p(y|x; Y1:t). Total probability theorem gives a more detailed factorization: p(y|x; Y1:t) = p(y|x; Y1:t−1)p(y ∈ Y1:t−1|x; Y1:t)+ p(y|x; Yt)p(y ∈ Yt|x; Y1:t). (2) Following equation 2, we intuitively explain the classifica- tion process as 2 phases. First, the model makes a inter- task classification to decide whether x belongs to current task. Next, a intra-task classification is conducted within reduced label set. Due to p(y ∈ Y1:t−1|x; Y1:t) + p(y ∈ Yt|x; Y1:t) = 1, the equation actually has three terms: 1. p(y|x; Yt). This term represents the performance on the current task. Model needs to establish this distribution at time t. Since model has full access to Dt, p(y|x; Yt) can be accurately modeled. 2. p(y|x; Y1:t−1). This term represents the performance on the previous task. Model has learned this distri- bution before time t. When model parameters update, p(y|x; Y1:t−1) may suffer knowledge degradation. 3. p(y ∈ Y1:t−1|x; Y1:t). This term represents model's abil- ity to distinguish samples of previous tasks from cur- rent ones. This distribution is also established at time t. The unavailability of previous data makes the learning of p(y ∈ Y1:t−1|x; Y1:t) challenging. Weaknesses of Vanilla ER Experience replay is designed to remind the model how to perform on previous tasks. The effect of ER is actually two-fold: preserving p(y|x; Y1:t−1) and establishing p(y ∈ Y1:t−1|x; Y1:t). We next bridge the probabilistic analysis with the loss function. Vanilla ER optimizes whole weight matrix of the classifier as follows: Lc t + Lr t , where arg min W t = Ex,y∼Dt[l(π(W Th(x)), y)], Lc t = Ex,y∼M [l(π(W Th(x)), y)], Lr π represents the softmax function and M is the episodic memory. We denote wi as the i-th column of matrix W , W1:t−1 as the columns corresponding to previous tasks and Wt as the columns for current task. Assuming l is cross en- tropy loss function, we can rewrite Lc (3) t as Ex,y∼Dt l(π(W T " t h(x)), y) − ln i h(x) i∈Yt ewT i∈Y1:t ewT P i h(x) # , (4) where the two terms respectively represent p(y|x; Yt) and p(y ∈ Yt|x; Y1:t). Lc t also has a similar form: P l(π(W T Ex,y∼M 1:t−1h(x)), y) − ln ewT i∈Y1:t−1 i∈Y1:t ewT i h(x) # (5) where the two terms respectively represent p(y|x; Y1:t−1) and p(y ∈ Y1:t−1|x; Y1:t). i h(x) P P " In practice, although with the episodic memory, ER still suffers heavy forgetting and causes prediction bias towards classes of the current task. We attribute its poor perfor- mance to inaccurate estimates of p(y|x; Y1:t−1) and p(y ∈ Y1:t−1|x; Y1:t). Note that M is very small, e.g. |M | = 200 in our experiments, which means each class only preserves about one or two samples. Thus the classifier easily gets overfitting. Besides, in joint learning all classes are balanced sampled, but vanilla ER samples from the union set Dt ∪ M , or samples two batches of equal size from Dt and M re- spectively at each step, which causes more exposition to the classes of the current task. This imbalance significantly hurts p(y ∈ Y1:t−1|x; Y1:t). 4 Task-Aware Experience Replay We now propose a simple but effective strategy called task- aware experience replay (TaER) that works well both for knowledge preservation and inter-task separation. It forces the model to exclusively learn the current task avoiding unnecessary parameter update while maintaining accurate boundary between old and new classes. As shown in Figure 1, we keep W1:t−1 untouched since task t. Suppose W1:t−1 has been well learned on D1:t−1, there is no need to re-learn it on memory set one more time. This strategy is rarely used in the method without the aid of pretrained model, since the representation is con- tinually learned and classifier has to adapt the changing representation. Previous works (Ahn et al. 2021; Hou et al. 2019; Buzzega et al. 2020) usually leverage knowledge dis- tillation to constrain the update of the classifier. But it is reasonable here because we assume the feature extrac- tor has been able to extract rich feature, so the classifier no longer needs a finetuning. Frozen W1:t−1 and h brings constant π(W T 1:t−1h(x)), which means the forgetting of p(y|x; Y1:t−1) is completely eliminated. The only goal at time t is to learn the classification within task t and dis- tinguish task t from task 1 ∼ t − 1. Besides, we find that the fixed weight also reduces overfitting on estimating p(y ∈ Y1:t−1|x; Y1:t). We think this is because finetuing W1:t−1 on M will cause task boundary to collapse towards the memory sample. To overcome class imbalance, (Castro et al. 2018) pro- poses to add balanced finetuning stage after training each task, where the model optimizes Lb = E (x,y)∼M∪τ (Dt)[l(f (x), y)] (6) on reduced training set τ (Dt) together with the memory set. We find this procedure can be replaced by a rebalanced loss. Here we conduct replay by taking two equal-size batches from the training set and memory set respectively at each update step. Hence the model is actually optimizing (x,y)∼M [l(f (x), y)] + E E (x,y)∼Dt [l(f (x), y)]. (7) If we further adopt a class-balanced memory management strategy, the first term in Equation 7 can be regards as an approximation of t−1 i=1 (cid:26) X |Yi| |Y1:t−1| E (x,y)∼Di[l(f (x), y)] . (cid:27) (8) Above derivation first leverages the total probability theorem and substitute p((x, y) ∈ Di; M ) by |Y1:t−1| . Suppose D is a class-balanced distribution. We factorize the equation 1 by the same way: |Yi| t i=1 (cid:26) X |Yi| |Y1:t| E (x,y)∼Di[l(f (x), y)] . (cid:27) (9) Comparing Equation 8 and 9, we get the ratio of loss term |Y1:t−1| . It is approximately equivalent for new and old tasks |Yt| ~ (cid:1876) (cid:1839) ~ (cid:1876) (cid:1830)(cid:3047) Feature Extractor : (cid:1849)(cid:2869) (cid:3047)(cid:2879)(cid:2869) (cid:1849)(cid:3047) Cross entropy (cid:3400) (cid:2019) 1- (cid:3397) (cid:2019) (cid:3400) Cross entropy Figure 1: Overview of our model. The classifier continually expands as new task arrives. The blue parts are frozen. Only the classifier weight for the current task is allowed to update. Each step the model inputs two equal-size batches from current task and the memory respectively. The losses of two branches are integrated with a balance factor. 5 Experiments 2010) CUB200 (Welinder et al. Setup Benchmark. Evaluations are performed on three com- monly used datasets: CIFAR100 (Krizhevsky, Hinton et al. 2009), and CORe50 (Lomonaco and Maltoni 2017). We do not conduct experiments on ImageNet because the feature extractor used in our experiments is pretrained on ImageNet (Deng et al. 2009). There are two commonly used protocols: (i) split all classes equally into T tasks (Rebuffi et al. 2017); (ii) train the model on half of the classes as the first task followed by N equally split tasks and evaluate on all T = N + 1 tasks. Under the first protocol, we conduct experiments to prove our method outperforms generic continual learning methods in linear probing a pretrained model. Besides, we use the second protocol to compare with current state-of-the-art class-incremental methods that do not use the pretrained model. T is set to 10 in the former protocol. For the latter one, we set N = 5 and 10 and evaluate only on CIFAR100. Baselines. For the first protocol, we mainly com- pare our method against replay-based method: vanilla iCaRL (Rebuffi et al. 2017), ER (Rolnick et al. 2019), GSS (Aljundi et al. 2019) and DER++ (Buzzega et al. 2020). We also compare with a regularization method oEWC (Schwarz et al. 2018) and two classifier learning methods UCIR (Hou et al. 2019) and SS-IL (Ahn et al. 2021). We do not compare with architecture-based methods here because they conflict with the linear probing setting. To better understand the performance of these continual learn- ing methods, we present the results of naive sequential fine- tuning and jointly learning all tasks as reference. They re- spectively represent the lower bound and upper bound of this learning scenario. For the second protocol, we compare with architecture-based methods DER (Yan, Xie, and He 2021), AANets (Liu, Schiele, and Sun 2021) and FAS (Miao et al. 2022). The former two methods are also replay-based. Implementation Details. For the methods used in proto- col (i), we choose ViT-S/16 (Dosovitskiy et al. 2021) and ResNet18 as the frozen pretrained extractor (pretrained on ImageNet) and produce the results using their public codes. We train the classifier with a SGD optimizer with batch size exp(wT Pi∈Y1:t−1 Pi∈Y exp(wT Figure 2: Estimates of p(y ∈ Y1:t−1|x; Y1:t) for each t (hor- izontal axis). Suffixes test and memory represent the cal- i h(x)) performed on Dt and M culation of respectively. ER-Bal mean ER with balanced loss but not fixed weight. Note that classes from the current task is not included in the calculation. So the results should be close to 1 ideally. We can find all three methods correctly predicts on memory set but performance of ER and ER-Bal significantly drop on test set while TaER still works well. i h(x)) to sampling one batch from each task and take the sum. Here we give the final objective for TaER: arg min Wt (1 − λ)Lc t + λLr t , where λ = |Y1:t−1| |Y1:t| . (10) We empirically show when the classifier is trained with TaER, the prediction bias is significantly alleviated. To esti- i h(x) mate p(y ∈ Y1:t−1|x; Y1:t), we calculate Pi∈Y1:t−1 Pi∈Y e ewT wT i h(x) as the indicator. The experiment is conducted on 10-split CI- FAR100 following the setup in section 5. As shown in Fig- ure 2, both ER and TaER perfectly model the distribution on memory set but only TaER generalizes remarkably. It is worth noting that balanced loss alone is still insufficient to accurately estimate p(y ∈ Y1:t−1|x; Y1:t) unless the overfit- ting is overcome. Method Finetune oEWC ER iCaRL GSS DER++ UCIR SS-IL TaER (Ours) Joint ViT-S/16 ResNet18 CIFAR100 CUB200 CORe50 CIFAR100 CUB200 CORe50 25.00 20.41 52.70 64.06 45.61 56.47 52.74 65.36 71.37 81.50 46.57 44.30 80.00 74.87 61.13 81.97 85.26 79.24 84.47 87.00 22.40 19.77 71.62 74.57 66.55 75.46 61.75 65.28 78.90 89.43 11.50 7.85 25.29 31.49 18.92 22.35 29.20 36.31 55.50 66.47 10.78 6.31 31.73 28.94 23.08 30.25 24.54 33.36 55.42 65.86 12.58 9.69 44.85 58.36 41.97 51.45 32.27 53.01 68.85 76.44 Table 1: Average accuracy after training all tasks on three benchmarks, the higher the better. The results are averaged over 3 runs. N 5 10 DER AANET RN32 RN18 FAS RN32 RN18 ViT-16/S TaER TaER 73.21 72.81 67.59 65.66 65.44 62.48 68.86 68.27 80.68 80.15 Table 2: Average incremental accuracy on CIFAR100 where the first class contains half of classes. "RN" is the abbrevia- tion of ResNet. 32. Since there is no need to learn the representation, one epoch is sufficient for CIFAR100 and CORe50. As CUB200 contains relatively few samples, it needs more training, so we set epoch as 10 for it. For our method, ER and fine- tune, learning rate is set to 0.1 without momentum. For all experiments, no data augmentation is applied. The size of the episodic memory is fixed as 200. We use greedy balanc- ing sampling strategy (Prabhu, Torr, and Dokania 2020) to manage the memory except GSS and UCIR since the man- agement strategy is part of their methods. For the baselines used in protocol (ii), we directly use the results reported in their papers. Following their settings, the size of the episodic memory is set to 2000. As the first task contains 50 classes, we initialize the classifier weight with the mean of the fea- ture of the corresponding class computed on training set to accelerate learning. Metrics. Following the previous work (Chaudhry et al. T 2018), we report average accuracy AT = 1 k=1 aT,k, T where aT,k represents the accuracy evaluated on task k af- ter training T tasks. Under protocol (ii), due to the imbal- anced number of classes in each task, the commonly used metric is average incremental accuracy (Hou et al. 2019) T AIAT = 1 k=1 αk where αk is the accuracy evaluated T on all seen classes at training phase k. P P Evaluation for Linear Probing Setting As shown in Table 1, TaER outperforms all other baselines using the ResNet18 backbone. For the ViT-S/16 backbone, TaER achieves better average accuracy than all other base- lines on CIFAR100 and CORe50 and is second best on CUB200. Although UCIR get a slightly higher accuracy on CUB200, its performance on the other two benchmarks are much lower than ours. It is notable that the best result among baselines on three datasets comes from three different meth- ods. No baseline consistently outperforms the others. Over- all, TaER achieve the best performance and has better gen- eralization. As for other methods, non-replay methods SGD and oEWC performs worst because they cannot distinguish across different tasks. This is especially notable for ResNet18 features where the model can only work on the last task. By comparison, replay methods achieve unbridge- able improvement even each class is assigned about two memory samples. We observe ER is competitive among these baselines which consistently outperforms GSS. It seems that the gradient-based sample selection strategy does not work in this setting. DER++, UCIR and SS-IL respec- tively beat the other baselines on three datasets. The generic replay method DER++ is the only baseline consistently out- performs ER. The characteristics of the dataset seem to have significant influence on UCIR and SS-IL. Comparison with Other SOTA Baselines As shown in Table 2, ViT-based TaER outperforms all other baselines again. FAS performs the worst because it does not store samples or features. DER outperforms the other two baselines drastically because it uses ResNet18 rather than reduced ResNet32. When switched to ResNet18 backbone, TaER only outperforms AANET and FAS and falls behind DER, because DER can adapt features on downstream tasks which benefits more from large episodic memory. Although the ViT-S/16 used in TaER is larger than ResNet18 and re- duced ResNet32, its trainable parameters are much fewer. Actually their training costs are very close. So, these results are comparable. Moreover, the architecture-based meth- ods has two drawbacks. First, architecture-based method is usually designed for a specific network architecture (e.g ResNet) which makes it hard to apply on other models (e.g. Figure 3: The visualization of the confusion matrix after 10 tasks trained on CIFAR100. The pixel in p-th row and q-th column represents the ratio that model classifies sample with ground truth p into label q. Higher luminance means larger ratio. ViT). Second, architecture-based method causes model size to increase as task continually arrives. The amount of incre- ment depends on the size of the base model. The larger the model, the larger the size increment. These two drawbacks impede these SOTA baselines to cooperate with pretrained models. But our TaER is compatible with pretrained mod- els of any architecture and any size. The memory increment only depends on the number of classes and dimension of fea- tures, which are very small relatively to the model size for almost all applications. We argue the applicability of pre- trained model is the advantage of our method and should be take into account when making comparison. More Analysis and Discussion Considering that all methods perform much better using ViT-S/16, we only discuss the performance using ViT-S/16 as the feature extractor in the following. Prediction Bias. To verify that TaER alleviates prediction bias, we compare the confusion matrix of our method with other baselines. As shown in Figure 3, we can find ER, UCIR and DER++ have strong tendency to classify the old classes into the most recent classes. This is because of aforemen- tioned class-imbalanced sampling and overfitting on mem- ory set. By comparison, TaER shows much less prediction bias and its prediction mainly concentrates on the diagonal. SS-IL shows even less bias towards the last task, but we can find the diagonal at right bottom corner is much darker. It has a reversed bias towards the previous tasks when predict- ing on the most recent task, which we also do not expect. TaER pursues overall inter-task separation and thus have a better performance. Knowledge Preservation In section 3 we have decoupled catastrophic forgetting into two parts. Besides the predic- tion bias that we have discussed, knowledge degradation is important as well. To measure the knowledge preservation, Figure 4: Preserved accuracy evaluated after training 10 tasks on CIFAR100. Objective CIFAR100 CUB200 CORe50 arg min W arg min Wt arg min W arg min Wt Lc Lc ̄λLc ̄λLc t +Lr t t +Lr t t +λLr t t +λLr t 52.70 57.47 59.73 71.37 80.00 79.87 80.50 84.47 71.62 70.49 76.33 78.90 Table 3: Ablation study for TaER. ̄λ = 1 − λ. We report average accuracy on three datasets. we define preserved accuracy P T t which means the accuracy computed on Dt over the label set Y1:t after training all T tasks. This definition is different from aT,k where the clas- sification is conducted over the full label set Y1:T . By this way, we eliminated the performance drop caused by increas- ing classes. The results are shown in Figure 4. The curve has a tendency to decrease at the early stage but turn to in- crease at last. The high preserved accuracy on the starting tasks is easy to understand since there are only a few classes to predicted. As for the most recent tasks, they have been just trained and have not experienced much forgetting. We can find TaER does better in knowledge preservation. This is credited to the weight fixing strategy. It keeps all the knowl- edge learned at each training phase. Ablation Study. We provide an ablation study on the three benchmarks. As shown in Table 3, both the weight fixing strategy and loss rebalance factor boost the average accu- racy for CIFAR100. Fixing weight alone (the second row) seems not to bring improvement on CUB200 and CORe50. We think this is because knowledge degradation and over- fitting on memory set is not so serious as CIFAR100. The results of ER (the first row) support this view, especially on CUB200 where the performance of ER has been very close to the upper bound. On CORe50, loss rebalancing factor (the third row) contributes the most improvement. We spec- Figure 5: Average accuracy evaluated with different memory size. Figure 6: Average accuracy evaluated with different pre- trained feature extractor. N 5 10 20 50 ER SS-IL TaER 59.40 52.70 51.63 48.16 69.96 65.36 53.43 47.37 72.66 71.37 71.09 66.62 Table 4: Average incremental accuracy on CIFAR100 of dif- ferent task numbers. ulate this is because prediction bias is primary challenge on CORe50. From an overall view, loss rebalancing factor tends to play a more important role than the weight fixing strategy. When combing the two components, TaER consistently beat other variations. The Effect of Memory Size. We provide the results about the effect of memory size in Figure 5. It is apparent that larger memory benefits all methods, especially ER. As we have analyzed before, small memory will cause heavy over- fitting. The size of the memory is critical to the performance of ER. Our method also benefits a lot from the larger mem- ory for the same reason because weight fixing strategy can only alleviate overfitting but not get rid of it. The estimate of p(y ∈ Y1:t−1|x; Y1:t) still relies on the previous samples. As for SS-IL, the incremental is not so significant. It is note- worthy that SS-IL only uses the memory to re-learn the past tasks rather than jointly classify with the current task. We think this is because the memory values more for inter-task separation than knowledge preservation. The Effect of Task Numbers To understand how our method performs on longer or shorter learning sequence, we additionally provide results on 5- split, 20-split and 50-split CIFAR100. Longer sequence makes knowledge preservation and inter-task separation even harder. But our model still maintains a remarkable av- erage accuracy as shown in Table 4. The performance for 5, 10 and 20 tasks are quite close. The only apparent drop happens in 50-split setting, where the model can only see two classes at each task. By comparison, both ER and SS-IL experience a drastic performance dropping as task number increases. The Effect of Feature Extractor It is worth noting that TaER is designed to train a classi- fier built on pretrained model. The capacity of the pretrained model is critical to TaER's performance. To further under- stand the effect of feature extractor, we conduct experiments with ViT-Tiny, ViT-Small and ViT-Base (the amount of pa- rameters are 5.5M, 21.7M and 85.8M respectively) on CI- FAR100. As shown in Figure 6, larger model benefits all methods. Our method achieves the highest accuracy on the largest model by a margin more than 14% over the oth- ers, which proves that TaER is good at exploiting large pre- trained model. The improvement of accuracy is strongly cor- related with the increment of model complexity. It is con- ceivable that more powerful pretrained model will bring even larger improvement. 6 Conclusions In this paper, we step towards large pretrained model based continual learning and focus on linear probing setting. We analyze the weaknesses of vanilla ER, a most widely used strategy, from a probabilistic view and accordingly decou- ple the catastrophic forgetting into knowledge degradation and prediction bias two parts. To overcome ER's weaknesses we propose a novel ER strategy called task-aware experi- ence replay and empirically verify that TaER works as we expect. Extensive experiments prove TaER outperforms cur- rent SOTA baselines on several benchmarks. In addition, we reveal the potential of pretrained model to solve continual learning problems. With the aid of large pretrained model, our TaER has shown dominant superiority to the classic SOTA methods even just by linear probing. References Ahn, H.; Kwak, J.; Lim, S.; Bang, H.; Kim, H.; and Moon, T. 2021. SS-IL: Separated Softmax for Incremental Learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 844–853. Aljundi, R.; Babiloni, F.; Elhoseiny, M.; Rohrbach, M.; and Tuytelaars, T. 2018. Memory Aware Synapses: Learning In Computer Vision - ECCV 2018 What (not) to Forget. - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part III, 144–161. Aljundi, R.; Lin, M.; Goujaud, B.; and Bengio, Y. 2019. Gra- dient based sample selection for online continual learning. In NeurIPS, 11816–11825. Buzzega, P.; Boschini, M.; Porrello, A.; Abati, D.; and Calderara, S. 2020. Dark Experience for General Contin- ual Learning: a Strong, Simple Baseline. In NeurIPS. Castro, F. M.; Mar ́ın-Jim ́enez, M. J.; Guil, N.; Schmid, C.; and Alahari, K. 2018. End-to-End Incremental Learning. In Ferrari, V.; Hebert, M.; Sminchisescu, C.; and Weiss, Y., eds., Computer Vision - ECCV 2018 - 15th European Con- ference, Munich, Germany, September 8-14, 2018, Proceed- ings, Part XII, volume 11216 of Lecture Notes in Computer Science, 241–257. Springer. Cha, S.; Hsu, H.; Hwang, T.; Calmon, F. P.; and Moon, T. 2021. CPR: Classifier-Projection Regularization for Contin- ual Learning. In ICLR. OpenReview.net. Chaudhry, A.; Dokania, P. K.; Ajanthan, T.; and Torr, P. H. 2018. Riemannian walk for incremental learning: Under- standing forgetting and intransigence. In Proceedings of the European Conference on Computer Vision (ECCV), 532– 547. Deng, J.; Dong, W.; Socher, R.; Li, L.; Li, K.; and Fei-Fei, L. 2009. ImageNet: A large-scale hierarchical image database. In CVPR, 248–255. IEEE Computer Society. Devlin, J.; Chang, M.; Lee, K.; and Toutanova, K. 2019. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In NAACL-HLT (1), 4171–4186. Association for Computational Linguistics. Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; Uszkoreit, J.; and Houlsby, N. 2021. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. In ICLR. OpenReview.net. Hou, S.; Pan, X.; Loy, C. C.; Wang, Z.; and Lin, D. 2019. Learning a Unified Classifier Incrementally via Rebalanc- ing. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16- 20, 2019, 831–839. Computer Vision Foundation / IEEE. Javed, K.; and Shafait, F. 2018. Revisiting Distillation In ACCV (6), vol- and Incremental Classifier Learning. ume 11366 of Lecture Notes in Computer Science, 3–17. Springer. Jung, S.; Ahn, H.; Cha, S.; and Moon, T. 2020. Contin- ual Learning with Node-Importance based Adaptive Group Sparse Regularization. In NeurIPS. Kirkpatrick, J.; Pascanu, R.; Rabinowitz, N.; Veness, J.; Des- jardins, G.; Rusu, A. A.; Milan, K.; Quan, J.; Ramalho, T.; Grabska-Barwinska, A.; et al. 2017. Overcoming catas- trophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13): 3521–3526. Krizhevsky, A.; Hinton, G.; et al. 2009. Learning multiple layers of features from tiny images. Liu, Y.; Schiele, B.; and Sun, Q. 2021. Adaptive Aggrega- In CVPR, tion Networks for Class-Incremental Learning. 2544–2553. Computer Vision Foundation / IEEE. Lomonaco, V.; and Maltoni, D. 2017. CORe50: a New Dataset and Benchmark for Continuous Object Recognition. In CoRL, volume 78 of Proceedings of Machine Learning Research, 17–26. PMLR. Masse, N. Y.; Grant, G. D.; and Freedman, D. J. 2018. Alle- viating catastrophic forgetting using context-dependent gat- ing and synaptic stabilization. Proceedings of the National Academy of Sciences, 115(44): E10467–E10475. McClelland, J. L.; McNaughton, B. L.; and O'Reilly, R. C. 1995. Why there are complementary learning systems in the hippocampus and neocortex: insights from the successes and failures of connectionist models of learning and mem- ory. Psychological review. McCloskey, M.; and Cohen, N. J. 1989. Catastrophic inter- ference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation. Else- vier. Miao, Z.; Wang, Z.; Chen, W.; and Qiu, Q. 2022. Contin- ual Learning with Filter Atom Swapping. In International Conference on Learning Representations. Parisi, G. I.; Kemker, R.; Part, J. L.; Kanan, C.; and Wermter, S. 2019. Continual lifelong learning with neural networks: A review. Neural Networks, 113: 54–71. Prabhu, A.; Torr, P. H. S.; and Dokania, P. K. 2020. GDumb: A Simple Approach that Questions Our Progress in Contin- ual Learning. In ECCV (2), volume 12347 of Lecture Notes in Computer Science, 524–540. Springer. Radford, A.; Wu, J.; Child, R.; Luan, D.; Amodei, D.; Sutskever, I.; et al. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8): 9. Rebuffi, S.; Kolesnikov, A.; Sperl, G.; and Lampert, C. H. 2017. iCaRL: Incremental Classifier and Representation Learning. In CVPR, 5533–5542. IEEE Computer Society. Riemer, M.; Cases, I.; Ajemian, R.; Liu, M.; Rish, I.; Tu, Y.; and Tesauro, G. 2019. Learning to Learn without Forgetting by Maximizing Transfer and Minimizing Interference. In ICLR (Poster). OpenReview.net. Robins, A. V. 1995. Catastrophic Forgetting, Rehearsal and Pseudorehearsal. Connect. Sci., 7(2): 123–146. Rolnick, D.; Ahuja, A.; Schwarz, J.; Lillicrap, T. P.; and Wayne, G. 2019. Experience Replay for Continual Learn- ing. In NeurIPS, 348–358. Schwarz, J.; Grabska- Barwinska, A.; Teh, Y. W.; Pascanu, R.; and Hadsell, R. J.; Czarnecki, W.; Luketina, 2018. Progress & Compress: A scalable framework for con- In Dy, J. G.; and Krause, A., eds., Pro- tinual learning. ceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsm ̈assan, Stockholm, Swe- den, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, 4535–4544. PMLR. Serr`a, J.; Suris, D.; Miron, M.; and Karatzoglou, A. 2018. Overcoming Catastrophic Forgetting with Hard Attention to the Task. In ICML, volume 80 of Proceedings of Machine Learning Research, 4555–4564. PMLR. Shmelkov, K.; Schmid, C.; and Alahari, K. 2017. Incremen- tal Learning of Object Detectors without Catastrophic For- getting. In ICCV, 3420–3429. IEEE Computer Society. van de Ven, G. M.; Li, Z.; and Tolias, A. S. 2021. Class- Incremental Learning With Generative Classifiers. In IEEE Conference on Computer Vision and Pattern Recognition Workshops, CVPR Workshops 2021, virtual, June 19-25, 2021, 3611–3620. Computer Vision Foundation / IEEE. Welinder, P.; Branson, S.; Mita, T.; Wah, C.; Schroff, F.; Be- longie, S.; and Perona, P. 2010. Caltech-UCSD birds 200. Wu, Y.; Chen, Y.; Wang, L.; Ye, Y.; Liu, Z.; Guo, Y.; and Fu, Y. 2019. Large Scale Incremental Learning. In CVPR, 374–382. Computer Vision Foundation / IEEE. Wu, Y.; Chen, Y.; Wang, L.; Ye, Y.; Liu, Z.; Guo, Y.; Zhang, Z.; and Fu, Y. 2018. Incremental Classifier Learning with Generative Adversarial Networks. CoRR, abs/1802.00853. Yan, S.; Xie, J.; and He, X. 2021. DER: Dynamically Ex- pandable Representation for Class Incremental Learning. In CVPR, 3014–3023. Computer Vision Foundation / IEEE. Yoon, J.; Yang, E.; Lee, J.; and Hwang, S. J. 2018. Life- long Learning with Dynamically Expandable Networks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. Zenke, F.; Poole, B.; and Ganguli, S. 2017. Continual Learn- In Proceedings of the ing Through Synaptic Intelligence. 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, 3987– 3995.
http://arxiv.org/abs/2302.11725v1
2023-02-23T01:17:21
2023-02-23T01:17:21
Asymptotically Unbiased Off-Policy Policy Evaluation when Reusing Old Data in Nonstationary Environments
In this work, we consider the off-policy policy evaluation problem for contextual bandits and finite horizon reinforcement learning in the nonstationary setting. Reusing old data is critical for policy evaluation, but existing estimators that reuse old data introduce large bias such that we can not obtain a valid confidence interval. Inspired from a related field called survey sampling, we introduce a variant of the doubly robust (DR) estimator, called the regression-assisted DR estimator, that can incorporate the past data without introducing a large bias. The estimator unifies several existing off-policy policy evaluation methods and improves on them with the use of auxiliary information and a regression approach. We prove that the new estimator is asymptotically unbiased, and provide a consistent variance estimator to a construct a large sample confidence interval. Finally, we empirically show that the new estimator improves estimation for the current and future policy values, and provides a tight and valid interval estimation in several nonstationary recommendation environments.
[ "Vincent Liu", "Yash Chandak", "Philip Thomas", "Martha White" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11725v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11725v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Asymptotically Unbiased Off-Policy Policy Evaluation when Reusing Old Data in Nonstationary Environments Yash Chandak Philip Thomas Stanford University University of Massachusetts Amherst University of Alberta Martha White 3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 5 2 7 1 1 . 2 0 3 2 : v i X r a Vincent Liu University of Alberta Abstract In this work, we consider the off-policy policy evaluation problem for contextual bandits and fi- nite horizon reinforcement learning in the non- stationary setting. Reusing old data is critical for policy evaluation, but existing estimators that reuse old data introduce large bias such that we In- can not obtain a valid confidence interval. spired from a related field called survey sam- pling, we introduce a variant of the doubly robust (DR) estimator, called the regression-assisted DR estimator, that can incorporate the past data with- out introducing a large bias. The estimator uni- fies several existing off-policy policy evaluation methods and improves on them with the use of auxiliary information and a regression approach. We prove that the new estimator is asymptoti- cally unbiased, and provide a consistent variance estimator to a construct a large sample confi- dence interval. Finally, we empirically show that the new estimator improves estimation for the current and future policy values, and provides a tight and valid interval estimation in several non- stationary recommendation environments. 1 INTRODUCTION Off-policy policy evaluation (OPE) is the problem of esti- mating the expected return of a target policy from a dataset collected by a different behavior policy. OPE has been used successfully for many real world systems, such as recom- mendation systems (Li et al., 2011) and digital marketing (Thomas et al., 2017), to select a good policy to be de- ployed in the real world. A variety of estimators have been proposed, particularly based on importance sampling (IS) (Hammersley and Handscomb, 1964) and modifications 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). reduce variance, such as self-normalization (Swaminathan and Joachims, 2015b), direct methods that use reward mod- els and variance reduction techniques like the doubly ro- bust (DR) estimator (Dud ́ık et al., 2011; Jiang and Li, 2016; Thomas and Brunskill, 2016). Often high-confidence esti- mation is key, with the goal to estimate confidence intervals around these value estimates that maintain coverage with- out being too loose (Thomas et al., 2015a,b; Swaminathan and Joachims, 2015a; Kuzborskij et al., 2021). Much less work has been done, however, for the nonsta- tionary setting where the reward and transition dynamics change over time. Extending these approaches to the non- stationary setting is key as most real world systems change with time, or appear to due to partial observability. In this setting, we face a critical bias-variance tradeoff: us- ing past data introduces bias, but not using past data in- troduces variance. Jagerman et al. (2019) introduced the sliding-window IS and exponential-decay IS estimator, that gradually reduces the impact of older data to control the bias-variance tradeoff. There is some other work predicting future OPE values for a target policy in a nonstationary en- vironment, by using time-series forecasting (Thomas et al., 2017; Chandak et al., 2020); the goal there, however, is to forecast future policy values using past value estimates, rather than to estimate the current value. Much of the other work tackling nonstationary problems has been for policy optimization. There is a relatively large body of work on nonstationary bandits in the on-policy set- ting (e.g., see Yu and Mannor (2009)). More pertinent to this work is a recent approach in the off-policy setting (Hong et al., 2021). Their focus, however, is on the use of change point detection and hidden Markov models for policy optimization in the online phase. As a result, these ideas do not directly apply to nonstationary OPE. In this work, we propose a new approach for nonstation- ary OPE by exploiting ideas from a related field called sur- vey sampling (Cochran, 1977), where handling nonstation- ary data has been a bigger focus. We propose a variant of the DR estimator, called the regression-assisted DR es- timator, for nonstationary environments. We exploit two ideas: (1) using auxiliary variables from the past data to build a proxy value and incorporate the proxy value in the Asymptotically Unbiased Off-Policy Policy Evaluation when Reusing Old Data in Nonstationary Environments estimator without introducing bias, and (2) a regression ap- proach on top of the proxy value to reduce variance further. Using the regression approach introduces some bias, how- ever, we prove that the estimator is asymptotically unbiased and provide a consistent variance estimator to construct a large sample confidence interval (CI). Moreover, we show that this regression-assisted estimator unifies several ex- isting OPE methods, including the weighted IS estimator. We empirically show that in several recommendation prob- lems, formalized as contextual bandits, that the new esti- mator improves the estimation and provides a tighter and valid CI empirically compared to the sliding-window esti- mators. We then extend the idea to finite horizon reinforce- ment learning, and highlight similar improvements. 2 PROBLEM SETUP In this section, we describe our main problem setting: off- policy policy evaluation (OPE) in the nonstationary setting. To convey the core insights of our paper precisely, we first focus on contextual bandits. Notation. We start by describing the standard station- ary setting for OPE in the contextual bandit setting. Let S be a set of contexts, A be a set of actions, and r : S × A → R be the reward function. The goal is to evaluate the value of a target policy π, that is, estimate J(π) = ES∼P,A∼π(*|S)[r(S, A)], using an offline (off- policy) dataset. The dataset is created through the inter- action of a behavior policy with the environment: (1) the environment draws a context si from P ∈ ∆(S) and (2) the behavior policy draws an action ai from πb(*|si) and observes ri = r(si, ai). This process repeats n times, giv- ing dataset D = {(si, xi, ai, ri)}n i=1. We assume that we also observe the context feature xs ∈ Rd for each context s in the dataset. Nonstationary OPE. Dealing with arbitrary nonstation- arity may not be possible. Fortunately, many real world environments have structures than can be exploited. We consider a piecewise stationary setting with known change points, where the reward function changes across intervals but remains stationary within each interval. For example, an environment can be stationary within each day or each week or for a number of interactions. We assume the set of contexts and the set of actions do not change over time. Let rk denote the reward function for the k-th interval and Dk = {(si, ai, rk(si, ai))}nk i=1 denote the data of size nk collected over the k-th interval. The goal is to estimate amount of new data Dk to estimate the current value Jk(π). We consider a stationary context distribution to present the paper succinctly, however, our methods described in the pa- per are applicable to the settings where the context distri- bution is also changing. It is often necessary in high-stakes applications to provide confidence intervals. Let D = (Dt)k t=1 denote the set of all data collected across different intervals. Given D and a desired level of failure probability α ∈ (0, 1), it would be ideal to estimate a high confidence lower bound CI− and a high confidence upper bound CI+ such that Pr (cid:0)CI−(D, α) ≤ Jk(π) ≤ CI+(D, α)(cid:1) = 1 − α where the probability is under the randomness of Dk and conditional on all old data D1, . . . , Dk−1. 3 BACKGROUND In this section, we review existing estimators for stationary OPE and describe how OPE can be written using the survey sampling formulation. We use this survey sampling for- mulation to introduce the proposed estimators in the next section. 3.1 Estimators for Stationary OPE A foundational strategy to estimate J(π) in stationary OPE is to use importance sampling. The IS estimator is given by ˆJIS(π) = 1 n n (cid:88) i=1 π(ai|si) πb(ai|si) r(si, ai). This IS estimator can have high variance since the impor- tance ratio can be very large. The weighted IS (WIS) es- timator (Sutton and Barto, 1998), also known as the self- normalized estimator (Swaminathan and Joachims, 2015b), normalizes the importance weights and is more commonly used. The WIS estimator is given by ˆJWIS(π) = n (cid:88) i=1 π(ai|si)/πb(ai|si) j=1 π(aj|sj)/πb(aj|sj) (cid:80)n r(si, ai). Besides these IS-based estimators, another common esti- mator is the direct method (DM). We learn a reward pre- diction model ˆr and use ˆJDM(π) = 1 n n (cid:88) (cid:88) i=1 a∈A π(a|si)ˆr(si, a). The doubly robust (DR) estimator (Dud ́ık et al., 2011) com- bines the DR and the IS estimator, Jk(π) = (cid:88) P (s)π(a|s)rk(s, a) s∈S,a∈A ˆJDR(π) = 1 n n (cid:88) i=1 given previous datasets D1, . . . , Dk−1 and a newly sam- pled Dk. The problem mirrors the real world where we have plenty of past data D1, . . . , Dk−1 but only a small (cid:34) π(ai|si) πb(ai|si) (r(si, ai) − ˆr(si, ai)) + (cid:35) π(a|si)ˆr(si, a) . (cid:88) a∈A Vincent Liu, Yash Chandak, Philip Thomas, Martha White There are other OPE estimators such as estimators with clipping (Bottou et al., 2013) or shrinkage (Su et al., 2020). Dud ́ık et al. (2012) studied the setting where the policies are non-stationary (history-dependent) but the environment is stationary, which is different from our setting. Chandak et al. (2021) focus on estimating the reward distribution and do not discuss how to efficiently leverage past data under non-stationarity. 3.2 OPE as Survey Sampling Survey sampling can be dated back to Hansen and Hur- witz (1943); Horvitz and Thompson (1952), where they consider the problem of selecting a sample of units from a finite population to estimate unknown population param- eters. Formally, let U = {1, . . . , N } be the population of interest, yi be the study variable and xi be the auxiliary variable for the unit i ∈ U. A subset of the population, called a sample, is selected according to a sampling design. We observe the study variable for units in the sample, and the goal is to estimate the population total of the study vari- ables ty = (cid:80) i∈U yi. To formalize OPE under survey sampling, let the popula- tion be U = S × A and the study variable be ys,a = P (s)π(a|s)r(s, a). The population total of y is the value of the policy: ty = (cid:80) (s,a)∈U ys,a = J(π). The weight- ing P (s)π(a|s) goes into the study variable since the goal is to estimate the total of study variable without weighting. Even though we have P (s) in the study variable, the term often cancels out in the estimator. This formulation has some subtle differences from the stan- dard OPE formulation. First, it assumes that S × A is fi- nite, since U is finite in survey sampling. Second, the study variable is fixed, that is, the reward function is determin- istic. These limitations can be overcome by assuming that the finite population is generated as a random sample from an infinite superpopulation; this superpopulation model is discussed in the appendix. For the main body, we assume a finite population with fixed study variables. Of particular interest for nonstationarity is the model- assisted approach for survey sampling (S ̈arndal et al., 1992). The key idea is to use the auxiliary variable xs,a to form a proxy value ˆys,a such that ˆys,a is close to the study variable ys,a. A simple example is that the auxiliary variable xs,a might be the value of ys,a at a past time and we can use proxy value ˆys,a = xs,a. A general form for a model-assisted estimator, assuming the population total of the proxy value is known, is the difference estimator (Cas- sel et al., 1976): (cid:80) where ps,a is the probability of selecting the pair (s, a). This es- timator is unbiased and can be much lower variance, if the proxy value is close to the study variable. This strategy is like adding a control variate, but specific to survey sam- pling since the source of stochasticity is different than the (s,a)∈U ˆys,a+(cid:80) ys,a−ˆys,a nps,a (s,a)∈D typical Monte Carlo setting. 4 OPE ESTIMATORS UNDER NONSTATIONARITY In the section, we propose an estimator for nonstationary environments. There are two popular strategies that con- sider the bias-variance tradeoff when reusing the past data in non-stationary environments: sliding window IS and ex- ponential decay IS (Jagerman et al., 2019). The sliding window IS estimator directly uses the IS estimator for the data in the most recent B intervals. Though not proposed in the original work, it is natural to extend this idea to other es- timators. For example, for the direct method, we can build a reward model from the data in the most recent B intervals and evaluate the policy with the reward prediction. The window size B controls the bias-variance tradeoff. If B = 0 then we only use the most recent data Dk: the esti- mator does not introduce bias by using past data but suffers high variance due to having a small sample size. If we use a large B, the estimator might introduce large bias but might have lower variance due to a larger sample size. Sliding window estimators require carefully choosing B to balance the bias from using past data and the variance from not us- ing past data. The balance usually depend on how fast the environment is changing, which is usually unknown. More- over, even with a small value of B, the bias of the sliding window estimator can be so large that the confidence inter- val is invalid, as we will show in the experiment section. Therefore, the main question that we aim to address is: How can we reuse the past data for nonstationary OPE without introducing large bias? One natural way to leverage the past data would be to use the DR estimator with a reward prediction learned from the past data, as described in the following section. However, naively using the past data to construct a reward prediction may not be the best approach in the nonstationary setting. This raises a followup question: How can we obtain a good reward prediction to both reduce the error of estimation and also obtain tight CIs? To address this challenge we draw inspiration from the survey sampling literature, and propose the regression-assisted DR estimator, that helps re- duce variance further and provides tighter CIs. 4.1 The Difference and DR estimator We can leverage the idea of the difference estimator in sur- vey sampling, for our nonstationary OPE setting. We can use the past data Dk−B, . . . , Dk−1 to build a reward pre- diction ˆrk as a function of the context feature and the ac- tion: ˆrk(s, a) = m(xs, a; θ) for some function m param- eterized by θ. The reward prediction can be used as the proxy value in the estimator. The resulting difference esti- Asymptotically Unbiased Off-Policy Policy Evaluation when Reusing Old Data in Nonstationary Environments mator, for interval k, is 4.2 The Regression-Assisted DR Estimator ˆtDiff,k = (cid:88) P (s)π(a|s)ˆrk(s, a) (s,a)∈U 1 n (cid:88) (s,a)∈Dk + π(a|s) πb(a|s) (r(s, a) − ˆrk(s, a)). (1) The elegance of this approach is that we can leverage past data by incorporating it into the proxy value in the differ- ence estimator, without introducing any bias. While the estimator is unbiased, the variance depends on the quality of the reward prediction ˆrk (Thomas and Brun- skill, 2016). The environment is nonstationary, so past data has to be used carefully to get a good estimate, and in some cases, the estimate may be poor. In the next section, we dis- cuss how to obtain a better prediction by fitting a regression on top of the reward prediction. A careful reader would have noticed one other nuance with the above difference estimator: it requires the population total of the proxy value ˆys,a = P (s)π(a|s)ˆrk(s, a), which is the first term in Eq (1). In some cases, this information may be known and it should be leveraged to get a better estimator for OPE. In other cases, we will need to estimate it. In the standard contextual bandit setting, given a sample Dk, we often assume that we know the auxiliary variable xs,a for all units in the set {(s, a) : s ∈ Dk, a ∈ A}. If we estimate the population total from Dk with the information about the auxiliary variables, the estimator becomes ˆtDR,k = + 1 n 1 n (cid:88) (cid:88) π(a|s)ˆrk(s, a) a∈A s∈Dk (cid:88) (s,a)∈Dk π(a|s) πb(a|s) (rk(s, a) − ˆrk(s, a)). (2) This estimator reduces to the DR estimator. Therefore, the DR estimator is the difference estimator when the popula- tion total of the proxy value is estimated by sample Dk. (cid:80) (cid:80) s∈D(cid:48) Of particular that do not result there are other options to estimate the pop- However, in the standard DR ulation total, estimator. relevance here is that we can use past data D(cid:48) to estimate this population total: 1 a∈A π(a|s)ˆrk(s, a). This term does not rely |D(cid:48)| on rewards in the past data-which might not be correct due to nonstationarity-and only requires access to the auxiliary variables xs in these datasets. If we assume only the rewards are nonstationary, rather than the context distri- bution, making these old datasets a perfectly viable option to estimate this population total. In survey sampling, this is usually motivated by assuming that there might be another survey that contains the auxiliary variables (Yang and Kim, 2020). We consider a model on top of the reward prediction from the past data to mitigate variance further. Let φk(s, a)(cid:62) = (1, ˆrk(s, a)) be the augmented feature vector with the re- ward prediction and define zs,a = P (s)π(a|s)φk(s, a). Note that zs,a is a function of the auxiliary variable xs. We consider a (heteroscedastic) linear regression model such that the study variables ys,a := P (s)π(a|s)rk(s, a) are re- alized values of the random variables Ys,a with Eξ[Ys,a] = z(cid:62) s,a = P (s)π(a|s)σ2 where the s,aβ and Vξ(Ys,a) = σ2 expectation and variance are with respect to the model ξ, and β, σ are the model coefficients. These are the assump- tions underlying the regression estimator, rather than as- sumptions about the real world. Further, even though we consider a linear regression on the feature vector φ for the regression-assisted DR estimator, the reward prediction it- self can be non-linear (e.g., a neural network). (cid:80) The weighted least squares estimate of β is βk = arg minβ . Suppose the rel- evant matrix is invertible, βk can be estimated using sample data Dk: s,aβ − ys,a (cid:0)z(cid:62) (s,a)∈U 1 σ2 (cid:1)2 s,a   ˆβk = (cid:88) (s,a)∈Dk   (cid:88) (s,a)∈Dk π(a|s) πb(a|s) π(a|s) πb(a|s)  −1 φk(s, a)φk(s, a)(cid:62)   φk(s, a)rk(s, a)  . (3) If we know the population total of z(cid:62) s,a regression-assisted DR (Reg) estimator is ˆβk, then the ˆtReg,k = (cid:88) P (s)π(a|s)φk(s, a)(cid:62) ˆβk + 1 n (s,a)∈U (cid:88) (s,a)∈Dk (cid:16) π(a|s) πb(a|s) rk(s, a) − φk(s, a)(cid:62) ˆβk (cid:17) . (4) More generally, we can use the same data or the past data to estimate the population total, as described above. This ˆβk consists only of the weight on the past reward model and the bias unit. This may not seem like a par- ticularly useful addition, but because it is estimated using Dk, it allows us to correct the past reward prediction. Further, the regression-assisted DR estimator actually pro- vides a natural way to combine existing estimators in the OPE literature, depending on the choice of the feature vec- tor φ and the coefficients β. To see this, we first show how WIS can be seen as an instance of this estimator.1 1Mahmood et al. (2014) have a similar observation that the solution ˆβ is the WIS estimator if φ(s, a) = 1 for all (s, a). They also extend the estimate with linear features φ and use φ(s, a) ˆβ directly, which is more related to the model-based approach. In our work, the model prediction is used as the proxy value so the resulting estimators are different. Vincent Liu, Yash Chandak, Philip Thomas, Martha White We provide the theoretical result in the stationary setting where φ is fixed, so we can drop the subscript k for simplic- ity. For the nonstationary setting, the inference for ˆtReg,k is conducted conditional on the past data D1, . . . , Dk−1, so φ is again fixed and all results extends to the nonstationary setting. The proofs can be found in Appendix B. Theorem 1 (WIS as a special case of the regression-as- sisted estimator). Suppose we use a linear regression model with univariate feature φ(s, a) = 1. Then the regression-assisted DR estimator with estimated coefficient ˆβ from Eq (3) has the same form as the WIS estimator: ˆtReg = (cid:88) (s,a)∈D π(a|s)/πb(a|s) (s(cid:48),a(cid:48))∈S π(a(cid:48)|s(cid:48))/πb(a(cid:48)|s(cid:48)) (cid:80) r(s, a). (5) The result provides a novel perspective for the WIS esti- mator: it can be viewed as fitting a regression to predict the reward with a constant feature. As a result, the only dif- ference between the regression-assisted DR estimator and the WIS estimator is the choice of feature vector for reward prediction. If there are other features that might be useful for predicting the reward, we can include it with the regres- sion approach and potentially improve the WIS estimator. In Table 1, we show that we can recover other estima- tors based on different choices for the coefficients β = (β1, β2)(cid:62) with the feature vector φ(s, a)(cid:62) = (1, ˆr(s, a)). If β1 = 0, β2 = 0, we recover the IS estimator. If β1 = 0, β2 = 1, we recover the difference estimator or the DR estimator. If β2 = 0 and β1 is learned from data, we recover the WIS estimator. pose different models as an alternative to the linear regres- sion model. These regression models can be potentially more useful for feature selection or to find a model that fits the population well. 5 THEORETICAL ANALYSIS In the regression approach, if the coefficients are estimated from the same data Dk, the estimator becomes biased. For example, the DR estimator is unbiased since the coeffi- cients are fixed, and the WIS estimator is biased since one of the coefficients is estimated. In this section, we show that even if we run the regression on the same data we use to build the estimator, the regression-assisted DR estimator still enjoys asymptotic properties. To prove these theoretical properties, there are a number of results from the survey sampling literature that we build on. For completeness, we provide a brief overview of survey sampling in Appendix A, and the proof of these properties under survey sampling notation in Appendix B. Theorem 2 (Properties of the estimator). Let AV(*) denote the asymptotic variance in term of the first order, that is V(*) = AV(*) + o(n−1), we have (1) ˆtReg is asymptotically unbiased with a bias of order O(n−1), and (2) AV(ˆtReg) =  1 n (cid:88)  (s,a)∈U P (s) π(a|s)2 πb(a|s) (r(s, a) − φ(s, a)(cid:62)β)2 − t2 e   Table 1: A Unifying View of Existing Estimators. where te = (cid:80) U P (s)π(a|s)(r(s, a) − φ(s, a)(cid:62)β). IS DR WIS Reg ˆβ1 0 ˆβ2 0 ˆβ1 0 0 1 β1 β2 There are other approaches to estimate the coefficients from data. The more robust DR estimator (Farajtabar et al., 2018) minimizes the estimated variance ˆV(ˆtReg) with re- spect to the coefficient to achieve the lowest asymptotic variance among all coefficient β under some mild condi- tions. Kallus and Uehara (2019) further consider an ex- panded model class on top of the reward prediction and minimize the estimated variance among both the expanded model class and the reward prediction model class. How- ever, it often unclear how large the sample size needs to be such that the estimator with the lowest asymptotic vari- ance indeed has a lower variance against other estimators in practice. On the other hand, there is a considerable lit- erature in survey sampling on improving estimation for the total and variance estimator when the sample size is small or the feature vector is high dimensional. For example, Breidt and Opsomer (2000); McConville et al. (2017) pro- Variance estimation for the regression-assisted DR esti- mator. The exact form of the variance of the regression- assisted DR estimator is often difficult to obtain, so we use the approximate variance from Theorem 2. Replacing the unknown β by the sample-based estimate ˆβ, we have a vari- ance estimator ˆV(ˆtReg) =  (cid:88)  (s,a)∈D 1 n(n − 1) (cid:18) π(a|s) πb(a|s) (r(s, a) − φ(s, a)(cid:62) ˆβ) (cid:19)2  − nˆt2 e  D π(a|s) where ˆte = (cid:80) nπb(a|s) (r(s, a) − φ(s, a)(cid:62) ˆβ). S ̈arndal et al. (1989) propose the weighted residual technique which can potentially result in better interval estimation. See Ap- pendix C for a derivation. Finally, we show the variance estimator is consistent and the regression-assisted estimator is asymptotically normal. Theorem 3. The variance estimator ˆV(ˆtReg) is consistent, and D→ N (0, 1). ˆtReg−ty√ ˆV(ˆtReg) Asymptotically Unbiased Off-Policy Policy Evaluation when Reusing Old Data in Nonstationary Environments Based on Theorem 3, we can construct a large sample CI. Corollary 1. Let ˆσ = α) percentile of the standard normal distribution, then ˆV(ˆtReg) and zα denote the 100(1− (cid:113) Pr (cid:0)ˆtReg − zα/2 ˆσ ≤ J(π) ≤ ˆtReg + zα/2 ˆσ(cid:1) → 1 − α. 6 EXPERIMENTS In this section, we demonstrate the effectiveness of the regression-assisted DR estimators in a semi-synthetic and a real world recommendation environment. We compare the proposed estimator to existing estimators, including IS, WIS, DM and Diff (which is DR without estimating the population total). We also include the IS, WIS, DM with the sliding window (SW) approach of window size B. When B = 0, SW-IS and SW-WIS is the standard IS and WIS. For Diff, Reg, we use the past data Dk−B, . . . , Dk−1 to learn a reward prediction. For the semi-synthetic dataset, we follow the experimental design from Dud ́ık et al. (2011). We use the supervised- to-bandit conversion to construct a partially labeled dataset from the YouTube dataset in the LibSVM repository. We construct a nonstationary environment by generating a se- quence of reward functions based on the environment de- sign in Chandak et al. (2020). For each true positive context-action pair in the original classification dataset, the reward follows a sine wave with some noise over time. We use PCA to reduce the dimension of the context features to 32. The target policy is obtained by training a classifier on a small subset of the original classification dataset. We adapt the Movielens25m dataset (Harper and Konstan, 2015) for the real world experiment. To construct a non- stationary environment, we divide the rating data chrono- logically. Each interval contains the rating data for 60 days and we use the rating data for K = 24 intervals ending November 21, 2019. We consider only active users who gave at least one rating for at least half of the K intervals, resulting in a total number of around 2000 users. During each interval, we compute the rating matrix r(u, g) for each user and genre by averaging the user u's rating for all rated movies in the genre g. As a result, we have a sequence of rating functions which represent users' average rating for each genre over time. The user features are built by matrix factorization on the average rating data with hidden size 32, and the target policy is obtained by training a classifier on a small subset of the average rating data. For the OPE objective, we consider an uniform weighting P (s) = 1/|S| for all users s. We also let nk = α|S| for all k and α ∈ {0.1, 1.0}. For each interval k = 0, . . . , K, we sample data Dk using a random policy. For estimators that require a reward prediction, we build the reward prediction by linear regression on historical data for each action sep- arately, which is the same approach used in Dud ́ık et al. (2011). More experiment details can be found in Appendix E, and Algorithm 1 describes the experimental procedure. In nonstationary OPE, the aim is to estimate Jk(π) with data from D1 to Dk. All of the estimators discussed in this paper, however, can be extended to predict the future values using the ideas from Thomas et al. (2017); Chan- dak et al. (2020). Suppose we have the OPE estimators for each interval up to interval k, that is, ˆJ1(π), . . . , ˆJk(π), we can fit these data to a forecasting model to predict the fu- ture value Jk+1(π), . . . , Jk+δ(π). We therefore test both settings: estimating Jk(π) and predicting Jk+1(π). For the experiments predicting Jk+1(π), we adapt the method pro- posed in Chandak et al. (2020) and predict the future values by fitting a regression. That is, ˆJk+δ(π) = ψ(k + δ)(cid:62) ˆwk where ˆwk is the OLS estimator for the regression problem n=0 and target ˆJt(π) with feature map ψ(t) = (cos(2πtn))d−1 for t = 1, . . . , k, where we set d = 5 in the experiment. 1 K (cid:113) (cid:80)K Sensitivity to window size and sample size. We vary the window size B and sample size n, and report the sensitivity plot in Figure 1. The error is averaged over K intervals, that k=1( ˆJk(π) − Jk(π))2. We can see is, RMSE = that the sliding window (SW) estimators, including SW-IS, SW-WIS and SW-DM, are sensitive to the window size, while Diff and Reg are robust to the window size. Reg outperforms IS and WIS and simply using B = 1 reduces the error by a large margin. Reg also has a lower error compared to Diff, especially with small window size and sample size. This suggests that Reg is more robust to a bad reward prediction from the past data, which implies it is more robust to the speed of the nonstationarity. We report the error for predicting the future value Jk+1(π) in Figure 1. Reg has the lowest error for predicting the fu- ture values except in MovieLens with small sample size. We also find that even SW-DM and SW-IS have low error for estimating the current value Jk for some hyperparame- ters, they still have high error for predicting the future value Jk+1. We hypothesize that approximately unbiased esti- mators generally have better future prediction even though they might have high variance. It is possible that the fore- casting model cancels out the noise in approximately unbi- ased estimators and results in better future value prediction. (cid:113) Empirical validation of the interval estimation. We use ˆJk(π) ± 1.96 ˆV( ˆJk(π)) as the approximate 95% CI. We report the empirical coverage of the CI using the estimated variance in Figure 2. The empirical coverage is defined as the number of rounds such that the CI contains the true value divided by the total number of rounds K. The results shown here are with n = 1.0|S|. IS (B = 0), WIS (B = 0), Diff and Reg all have the desired coverage and Reg has the smallest width. All sliding window estimators have large bias when B > 0, so the coverage is poor and it is unclear how to compare to estimators with the desired coverage. Note that even with a small value of B, for example, B = 1 Vincent Liu, Yash Chandak, Philip Thomas, Martha White Figure 1: Sensitivity curves. Top row: estimating Jk(π). Bottom row: predicting Jk+1(π). "True J" is the baseline if we use the true values to predict the future values. The number are averaged over 30 runs with one standard error. Across runs, the target policy and the sequence of reward functions are fixed, but the sampled data is random. Figure 2: The empirical coverage and the width of CIs. Higher coverage and lower width is better. in MovieLens, sliding window estimators fail to provide a valid CI. The result suggests that Reg provides an accurate and tight CI. Empirical investigation of the feature vectors. Besides using one past reward prediction as the only feature, we also investigate the utility when we (1) include the context features; and (2) include separate past reward predictions, that is, φk(s, a) = (1, ˆrk−B(s, a), . . . , ˆrk−1(s, a)) where we learn a reward model ˆrt for interval t from data Dt sep- arately. Since these additional features could be correlated, we use ridge regression when estimating the coefficients. The regularization parameter is chosen by cross-validation. We aim to answer two questions: (1) whether including the context feature or the past reward predictions helps, and (2) how we should include the past reward information. To an- swer the questions, we test five different feature vectors: (a) Reg: we use one past reward prediction as described in Section 4.2, with and without the context features, (b) Reg-AR: we use separate past reward predictions with and without context features, and (c) Reg-Feature: we use con- text features only. We show the comparison in Figure 3. We find that including the context features helps in general, however, using only the context features is not sufficient. The past reward information helps deal with nonstationar- ity. Moreover, using separate predictions only improves the accuracy in MovieLens with n = 0.1|S|. In these ex- periments, there was no one dominant way to include past reward information, and more experimentation is needed to understand when one might be preferred. We provide an ablation study to investigate the impact when the population total of the proxy value is estimated in Appendix F. We found that using the past data to estimate the population total results in very similar performance as we know the population total. 7 EXTENSION TO REINFORCEMENT LEARNING for contextual bandits can be ex- The estimators tended to finite horizon reinforcement learning (RL). Let M = (S, A, P, r, H, ν) be a finite horizon fi- is nite MDP. Our goal to estimate the value of a policy J(π) = (cid:80) τ ∈(S×A)H Pπ M (τ )R(τ ) where 01248160.010.020.03RMSE for JkYoutube: 0.1|S|01248160.0020.004Youtube: 1.0|S|01248160.10.20.3MovieLens: 0.1|S|01248160.050.100.15MovieLens: 1.0|S|0124816B0.000.010.020.03RMSE for Jk+10124816B0.0020.0040124816B0.10.20.30.40124816B0.100.150.20SW-DMSW-ISSW-WISTrue JDiffReg0124816B0.000.250.500.751.00coverageYoutube: Coverage0124816B0.00250.00500.00750.0100widthYoutube: Width0124816B0.000.250.500.751.00coverageMovieLens: Coverage0124816B0.10.20.30.4widthMovieLens: WidthDMSW-ISSW-WISDiffReg Asymptotically Unbiased Off-Policy Policy Evaluation when Reusing Old Data in Nonstationary Environments Figure 3: Comparison of different feature vectors for estimating Jk(π). Figure 4: Results for the RL environment. First column: estimating Jk(π). Second column: predicting Jk+1(π). Third and fourth column: coverage and width of CI. the probability of Pπ M (τ ) = ν(s0)π(a0|s0)P (s1|s0, a0) . . . π(aH−1|sH−1) seeing the trajectory τ = is (s0, a0, . . . , sH−1, aH−1) by running π in M , and R(τ ) = (cid:80)H−1 h=0 r(sh, ah). To formalize OPE for RL under survey sampling, let U = (S × A)H be the population containing all trajectories and yτ = Pπ M (τ )R(τ ) be the study variable. Note that there are many ways to view OPE for RL in the survey sampling framework, which corresponds to different existing estima- tors for RL such as the trajectory-wise IS, per-decision IS (PDIS) estimator and marginalized IS estimator. We pro- vide more discussion in Appendix D. The regression-assisted estimator with fitted Q evalua- tion. We use fitted Q evaluation (FQE), which has been shown to be effective for several stationary OPE bench- marks empirically (Voloshin et al., 2021), to build a proxy value ˆR(τ ) for each trajectories τ ∈ U. In nonstationary environments, FQE outputs ˆQk−1(s, a) from the past data Dk−B, . . . , Dk−1, and we use ˆR(τ ) = ˆVk−1(s0) = (cid:80) a∈A π(a|s0) ˆQk−1(s0, a) as the proxy value where s0 is the initial state of the trajectory τ . Similar to the estimator for contextual bandits, we first estimate the coefficient with the feature vector φ(s0)(cid:62) = (1, ˆVk−1(s0)) and use the regression-assisted DR estimator ˆtReg-F QE,k = (cid:88) s0∈S ν(s0)φ(s0)(cid:62) ˆβk+ 1 n (cid:88) τ ∈Dk π(a0|s0) . . . π(aH−1|sH−1) πb(a0|s0) . . . πb(aH−1|sH−1) When ν is unknown, we can estimate the population to- tal of the proxy value by 1/|D(cid:48)| (cid:80) s0∈D(cid:48) φ(s0)(cid:62) ˆβ from the past data D(cid:48) or the same data Dk. The regression-assisted DR estimator can be viewed as a biased-corrected FQE es- timator for nonstationary environments. Experimental results. We consider an RL environment with a binary tree structure, that is, a finite horizon MDP with H = 10, |A| = 2, |S| = |A|H − 1, and an initial state s0. For each state, taking action 1 leads to the left child and taking action 2 leads to the right child. The reward for each state-action pair follows a sine wave with differ- ent frequency and amplitude. The environment mimics the session-aware recommendation problem where we take a sequence of actions for one customer during a short ses- sion. We use a random policy to collect 10 trajectories for every interval. The target policy is a trained policy using Q-learning on the underlying environment. From Figure 4, Reg has the lowest error for estimating the current value and predicting the future value in general. We show the coverage of the one-sided CI since we mainly care about the lower bound on the policy value for safe policy improvement. The results show that Reg again provides a valid and tight interval estimation, and is promising for safe policy improvement in nonstationary RL environments. 8 CONCLUSION (R(τ ) − φ(s0)(cid:62) ˆβk). We proposed the regression-assisted DR estimator for OPE in the nonstationary setting, inspired by estimators from the survey sampling literature. The estimator incorporates 01248160.00450.00500.0055RMSEYoutube: 0.1|S|01248160.00140.00160.0018RMSEYoutube: 1.0|S|01248160.150.160.17MovieLens: 0.1|S|01248160.0450.050MovieLens: 1.0|S|RegReg-ARReg-Featurewithout context featurewith context feature0124816B0.250.500.75RMSE for Jk0124816B0.250.500.75RMSE for Jk+10124816B0.000.250.500.751.00coverage0124816B0.51.0widthSW-DMSW-ISSW-WISTrue JDiffReg Vincent Liu, Yash Chandak, Philip Thomas, Martha White past data into a proxy value without introducing large bias, and uses a regression approach to build a reward predic- tion well suited for nonstationary environments. As far as we know, these two ideas have not been applied to nonsta- tionary OPE. We theoretically show that we can construct a large sample confidence interval and empirically demon- strate that the proposed estimator provides tight and valid high-confidence estimation in several recommendation en- vironments in contextual bandits and finite horizon RL. References L ́eon Bottou, Jonas Peters, Joaquin Qui ̃nonero-Candela, Denis X Charles, D Max Chickering, Elon Portugaly, Dipankar Ray, Patrice Simard, and Ed Snelson. Counter- factual reasoning and learning systems: The example of computational advertising. Journal of Machine Learning Research, 2013. F Jay Breidt and Jean D Opsomer. Local polynomial re- gression estimators in survey sampling. Annals of statis- tics, 2000. Claes M Cassel, Carl E S ̈arndal, and Jan H Wretman. Some results on generalized difference estimation and generalized regression estimation for finite populations. Biometrika, 1976. Ray Chambers and Robert Clark. An introduction to model- based survey sampling with applications. Oxford Uni- versity Press, 2012. Yash Chandak, Georgios Theocharous, Shiv Shankar, Martha White, Sridhar Mahadevan, and Philip Thomas. Optimizing for the future in non-stationary mdps. In In- ternational Conference on Machine Learning, 2020. Yash Chandak, Scott Niekum, Bruno da Silva, Erik Learned-Miller, Emma Brunskill, and Philip S Thomas. Universal off-policy evaluation. In Neural Information Processing Systems, 2021. William G. Cochran. Sampling Techniques, 3rd Edition. John Wiley, 1977. Miroslav Dud ́ık, John Langford, and Lihong Li. Doubly robust policy evaluation and learning. In International Conference on Machine Learning, 2011. Miroslav Dud ́ık, Dumitru Erhan, John Langford, and Li- hong Li. Sample-efficient nonstationary policy evalua- tion for contextual bandits. In Uncertainty in Artificial Intelligence, 2012. Mehrdad Farajtabar, Yinlam Chow, and Mohammad Ghavamzadeh. More robust doubly robust off-policy In International Conference on Machine evaluation. Learning, 2018. Mart ́ın H F ́elix-Medina. Asymptotics in adaptive clus- ter sampling. Environmental and Ecological Statistics, 2003. John M Hammersley and David C Handscomb. Monte Carlo Methods. Springer Dordrecht, 1964. Morris H Hansen and William N Hurwitz. On the theory of sampling from finite populations. The Annals of Mathe- matical Statistics, 1943. F Maxwell Harper and Joseph A Konstan. The movielens datasets: History and context. ACM Transactions on In- teractive Intelligent Systems, 2015. Joey Hong, Branislav Kveton, Manzil Zaheer, Yinlam Chow, and Amr Ahmed. Non-stationary off-policy op- timization. In International Conference on Artificial In- telligence and Statistics, 2021. Daniel G Horvitz and Donovan J Thompson. A generaliza- tion of sampling without replacement from a finite uni- verse. Journal of the American Statistical Association, 1952. Rolf Jagerman, Ilya Markov, and Maarten de Rijke. When people change their mind: Off-policy evaluation in non- In Interna- stationary recommendation environments. tional Conference on Web Search and Data Mining, 2019. Nan Jiang and Lihong Li. Doubly robust off-policy value evaluation for reinforcement learning. In International Conference on Machine Learning, 2016. Nathan Kallus and Masatoshi Uehara. Intrinsically effi- cient, stable, and bounded off-policy evaluation for re- inforcement learning. In Neural Information Processing Systems, 2019. Ilja Kuzborskij, Claire Vernade, Andras Gyorgy, and Csaba Szepesv ́ari. Confident off-policy evaluation and selec- tion through self-normalized importance weighting. In International Conference on Artificial Intelligence and Statistics, 2021. Lihong Li, Wei Chu, John Langford, and Xuanhui Wang. Unbiased offline evaluation of contextual-bandit-based In Interna- news article recommendation algorithms. tional Conference on Web Search and Data Mining, 2011. Qiang Liu, Lihong Li, Ziyang Tang, and Dengyong Zhou. Infinite-horizon off- In Neural Information Processing Breaking the curse of horizon: policy estimation. Systems, 2018. A Rupam Mahmood, Hado P Van Hasselt, and Richard S Sutton. Weighted importance sampling for off-policy learning with linear function approximation. In Neural Information Processing Systems, 2014. Kelly McConville. Improved estimation for complex sur- veys using modern regression techniques. PhD thesis, Colorado State University, 2011. Kelly S McConville, F Jay Breidt, Thomas Lee, and Gretchen G Moisen. Model-assisted survey regression Asymptotically Unbiased Off-Policy Policy Evaluation when Reusing Old Data in Nonstationary Environments Frank Yates and P Michael Grundy. Selection without re- placement from within strata with probability propor- tional to size. Journal of the Royal Statistical Society: Series B (Methodological), 1953. Jia Yuan Yu and Shie Mannor. Piecewise-stationary bandit problems with side observations. In International Con- ference on Machine Learning, 2009. estimation with the lasso. Journal of Survey Statistics and Methodology, 2017. Doina Precup, Richard S Sutton, and Satinder Singh. Eligi- bility traces for off-policy policy evaluation. Computer Science Department Faculty Publication Series, 2000. Carl-Erik S ̈arndal, Bengt Swensson, and Jan H Wretman. The weighted residual technique for estimating the vari- ance of the general regression estimator of the finite pop- ulation total. Biometrika, 1989. Carl-Erik S ̈arndal, Bengt Swensson, and Jan Wretman. Model assisted survey sampling. Springer New York, 1992. Amode R Sen. On the estimate of the variance in sampling with varying probabilities. Journal of the Indian Society of Agricultural Statistics, 1953. Yi Su, Maria Dimakopoulou, Akshay Krishnamurthy, and Miroslav Dud ́ık. Doubly robust off-policy evaluation with shrinkage. In International Conference on Machine Learning, 2020. Richard S Sutton and Andrew G Barto. Introduction to reinforcement learning. MIT press Cambridge, 1998. Adith Swaminathan and Thorsten Joachims. Counter- factual risk minimization: Learning from logged ban- In International Conference on Machine dit feedback. Learning, 2015a. Adith Swaminathan and Thorsten Joachims. The self- In normalized estimator for counterfactual learning. Neural Information Processing Systems, 2015b. Philip Thomas and Emma Brunskill. Data-efficient off- policy policy evaluation for reinforcement learning. In International Conference on Machine Learning, 2016. Philip Thomas, Georgios Theocharous, and Mohammad Ghavamzadeh. High confidence policy improvement. In International Conference on Machine Learning, 2015a. Philip Thomas, Georgios Theocharous, and Mohammad Ghavamzadeh. High-confidence off-policy evaluation. In AAAI Conference on Artificial Intelligence, 2015b. Philip S Thomas, Georgios Theocharous, Mohammad Ghavamzadeh, Ishan Durugkar, and Emma Brunskill. Predictive off-policy policy evaluation for nonstationary decision problems, with applications to digital market- ing. In IAAI Conference, 2017. Cameron Voloshin, Hoang Minh Le, Nan Jiang, and Yisong Yue. Empirical study of off-policy policy evaluation for reinforcement learning. In Neural Information Process- ing Systems Datasets and Benchmarks Track (Round 1), 2021. Shu Yang and Jae Kwang Kim. Statistical data integra- tion in survey sampling: A review. Japanese Journal of Statistics and Data Science, 2020. Vincent Liu, Yash Chandak, Philip Thomas, Martha White A OVERVIEW OF SURVEY SAMPLING In this section, we introduce the survey sampling terminology and how to use it for OPE. Survey sampling can be dated back to Hansen and Hurwitz (1943); Horvitz and Thompson (1952), where they consider the problem of selecting a sample of units from a finite population to estimate unknown population parameters. For example, if the goal is to estimate the customer satisfaction rate for a product, survey sampling is concerned with selecting a subset of customers to conduct surveys. Since then, the field has investigated a variety of practical scenarios, including dealing with missing data, handling non-stationarity and understanding to how to leverage auxiliary information. Formally, let U = {1, . . . , N } be the population of interest, yi be the study variable and xi be the auxiliary variable for the unit i ∈ U. Continuing the above example, the population could be all customers, the study variable could be the satisfaction level, and the auxiliary variable could be the information about the customer. A subset of the population, called a sample, is selected according to a sampling design. We observe the study variable for units in the sample, and the goal is to estimate the population total of the study variables ty = (cid:80) A sampling design I = (I1, . . . , IN ) is a random vector describing how the sample is drawn from the population: Ii > 0 means that the unit i is selected in the sample and Ii = 0 means the unit is not selected. For example, a multinomial design is a with-replacement and fixed-size design where we draw n units independently and identically according to probability pi with (cid:80) i=1, that is, P (I1 = ii, . . . , IN = iN ) = n! i ii = n and 0 otherwise. In survey sampling, the study variable ΠN is fixed and the randomness comes from the sampling design I. i∈U pi = 1. In this case, the design vector I follows the multinomial distribution with parameters n and (pi)N i=1ii! pii i . . . piN N if (cid:80) i∈U yi. Given a sample D of fixed size n, the Hansen-Hurwitz (HH) estimator (Hansen and Hurwitz, 1943) for multinomial design is ˆtHH = (cid:80) . The estimator ˆtHH is an unbiased estimator for ty if pi > 0 for all i ∈ U. yi E[Ii] = (cid:80) i∈D yi npi i∈D This formalize OPE under survey sampling, let the population be U = S × A and the study variable be ys,a = P (s)π(a|s)r(s, a). The population total of y is the value of the policy: ty = (cid:80) (s,a)∈U ys,a = J(π). The weighting P (s)π(a|s) goes into the study variable since the goal is to estimate the total of study variable without weighting. Even though we have P (s) in the study variable, the term often cancels out as we will see for the HH estimator. For OPE, the sampling design is the multinomial design with sampling probability ps,a = P (s)π(a|s). Given a sample D = {(si, ai, r(si, ai))}n i=1, the HH estimator is ˆtHH = (cid:88) (s,a)∈D ys,a nps,a = (cid:88) (s,a)∈D P (s)π(a|s)r(s, a) nP (s)πb(a|s) = 1 n (cid:88) (s,a)∈D π(a|s) πb(a|s) r(s, a). It has the same form as the IS estimator. In the case where the sampling design p is not known and needs to be estimated by a propensity model, it is called the inverse propensity score (IPS) estimator. The HH estimator is called the design-based estimator in the survey sampling literature. This is because the primary source of randomness is from the sampling design. Another approach is called the model-based approach which assumes the study variables are generated by a superpopulation model. The goal is to model the relationship between the study variable and the auxiliary variable. The resulting estimator is similar to the direct method. The model-based approach. The model-based approach is a popular approach in the survey sampling literature. Chambers and Clark (2012) provide an introduction for the model-based approach. Different from design-based and model-assisted approaches, the study variables are assumed to be generated by a superpopulation model and typically depends on the auxiliary variable. More previously, we assume the values yi, . . . , yn are realization of random variables Y1, . . . , Yn. The joint distribution of Y1, . . . , Yn is denoted by ξ, which is called the superpopulation distribution. For example, we assume Eξ[Yi|xi] = x(cid:62) i for some unknown model parameter β and σi. The selected sample D is treated as a constant and the sample values of yi are random. Estimation and inference are deduced conditional on the selected sample and the model. i β and Vξ(Yi|xi) = σ2 For OPE, we have ys,a = P (s)π(a|s)r(s, a) and auxiliary vector xs,a = P (s)π(a|s)φ(s, a). We assume a linear model: Eξ[Ys,a|xs,a] = x(cid:62) s,a = (P (s)π(a|s)σ)2, and Ys,a's are independent. Using the WLS estimator to estimate β s,aβ, Vξ(Ys,a|xs,a) = σ2   ˆβ = (cid:88) (s,a)∈D  †    xs,ax(cid:62) s,a σ2 s,a (cid:88) (s,a)∈D xs,ays,a σ2 s,a    =  (cid:88) φ(s, a)φ(s, a)(cid:62) (s,a)∈D  †    (cid:88) (s,a)∈D  φ(s, a)r(s, a)  , Asymptotically Unbiased Off-Policy Policy Evaluation when Reusing Old Data in Nonstationary Environments we have the model-based estimator ˆtMB = (cid:88) ys,a + (cid:88) x(cid:62) s,a ˆβ. (s,a)∈D (s,a)(cid:54)∈D That is, the population total is estimated by the total of study variables in the sample and the total of the study variables of units not in the sample. The model-based estimator is similar to the direct method (DM) in OPE. The key difference is that DM does not use the sample value of ys,a but uses the prediction for all units, that is, ˆtDM = (cid:88) x(cid:62) s,a ˆβ. (s,a)∈U The model-based survey sampling framework provide a way to do inference for the DM estimator, which is conditional on the selected sample and the model ξ. Let tx = (cid:80) (s,a)∈U xs,a, then Vξ(ˆtDM) = Vξ   (cid:88) x(cid:62) s,a (s,a)∈U  ˆβ  = t(cid:62) x Vξ( ˆβ)tx = σ2t(cid:62) x   (cid:88) (s,a)∈D  † φ(s, a)φ(s, a)(cid:62)  tx. Plugging in the estimator ˆσ2 = 1 n−p (cid:80) (s,a)∈D(r(s, a) − φ(s, a)(cid:62) ˆβ)2 for σ, we have an estimated variance ˆV(ˆtDM) = ˆσ2t(cid:62) x   (cid:88) (s,a)∈D  † φ(s, a)φ(s, a)(cid:62)  tx. B TECHNICAL DETAILS For the theoretical analysis, we make the following assumptions: 1. ∀(s, a) ∈ U, Lp ≤ ps,a for some real number Lp > 0. 2. ∀(s, a) ∈ U, Ly ≤ ys.a ≤ Uy for some real number Ly, Uy. 3. ∀(s, a) ∈ U, Lx ≤ φ(s, a) ≤ Ux for some real vector Lx, Ux. The inequality holds element-wise. 4. The estimated matrix of (cid:80) (s,a)∈U φ(s, a)φ(s, a)(cid:62) are invertible. the covariates (cid:80) (s,a)∈D π(a|s) πb(a|s) φ(s, a)φ(s, a)(cid:62) and the finite population matrix In short, we need to make sure the data collection policy chooses each action with a non-zero probability, and the reward and feature vector are bounded. B.1 Proof of Theorem 1 Definition 1 (The ratio estimator). Let zs,a ∈ R be the auxiliary variable, tz be the populating total of the auxiliary variable, which is assumed to be known, and ˆtHH and ˆtz be the HH estimator for ty and tz respectively. The ratio estimator is given by ˆtRatio = tz ˆtHH ˆtz . Now we show that the ratio estimator is a special case of the regression estimator. Lemma 1. Suppose we have univariate auxiliary information zs,a. Under the linear model Eξ[Ys,a] = βzs,a and s,a = zs,aσ2 for some β ∈ R and σ ∈ R+, the regression estimator is equivalent to the ratio estimator. Vξ(Ys,a) = σ2 Vincent Liu, Yash Chandak, Philip Thomas, Martha White Proof. First note that the regression estimator has an alternative expression as ˆtReg = (cid:88) zs,a ˆβ + (cid:88) ˆβ ys,a − zs,a nps,a (s,a)∈D  (s,a)∈U (cid:88) (s,a)∈D (cid:88) (s,a)∈D = = ys,a nps,a ys,a nps,a (cid:88) +  zs,a − (cid:88) (s,a)∈U (s,a)∈D  +  (cid:88) zs,a − (cid:88) (s,a)∈U (s,a)∈D   ˆβ     zs,a nps,a zs,a nps,a (cid:88) (s,a)∈D zs,azs,a nps,aσ2 s,a  −1    (cid:88) (s,a)∈D zs,ays,a nps,aσ2 s,a   (cid:88) = (s,a)∈D ys,a nps,a   1 +  (cid:88) zs,a − (cid:88) (s,a)∈U (s,a)∈D zs,a nps,a     (cid:88) (s,a)∈D zs,azs,a nps,aσ2 s,a  −1  zs,a σ2 s,a (cid:124) (cid:88) = (s,a)∈D gs,ays,a nps,a (cid:123)(cid:122) gs.a where gs,a can be viewed as the weight for each unit in the sample.   (cid:125) Under the model σ2 s,a = zs,aσ2, for each (s(cid:48), a(cid:48)) ∈ D, we have    (cid:88) (s,a)∈D zs,azs,a nps,aσ2zs,a  −1  (cid:19) (cid:18) zs(cid:48),a(cid:48) σ2zs(cid:48),a(cid:48) gs(cid:48),a(cid:48) = 1 +  (cid:88) zs,a − (cid:88) (s,a)∈U (s,a)∈D   = 1 + (cid:88) zs,a − (cid:88)   = 1 + (s,a)∈U (s,a)∈D   (cid:88) zs,a   (cid:88) zs,a nps,a zs,a nps,a       (cid:88) (s,a)∈D  −1  − 1 zs,a nps,a  −1  zs,a nps,a (s,a)∈U (s,a)∈D  = tz/  (cid:88) (s,a)∈D   zs,a nps,a The second equality follows by cancelling out the right most term with the σ2 in the inverse bracket. Note that the weight is the same for each unit in the sample. Plugging into the previous equation, we have ˆtReg = tz (cid:80) (cid:80) (s,a)∈D ys,a/nps,a (s,a)∈D zs,a/nps,a = ˆtRatio. Proof of Theorem 1. We first show that the WIS estimator belongs to a class of estimators called the ratio estima- tor in survey sampling in Definition 1. Suppose the auxiliary variable zs,a = P (s)π(a|s), and we know tz = (cid:80) (s,a)∈U P (s)π(a|s) = 1. Then, the ratio estimator is    ˆtRatio = tz ˆtHH ˆtz (cid:88) =  (s,a)∈D ys,a nps,a (cid:88)   (s,a)∈D  −1  = zs,a nps,a (cid:88) (s,a)∈D π(a|s)/πb(a|s) (s(cid:48),a(cid:48))∈D π(a(cid:48)|s(cid:48))/πb(a(cid:48)|s(cid:48)) (cid:80) r(s, a) which is the WIS estimator in the OPE literature. Then, we prove a more general statement that a ratio estimator with univariate auxiliary information zs,a is a special case s,a = zs,aσ2 for some β ∈ R and of the regression estimator under the linear model Eξ[Ys,a] = βzs,a and Vξ(Ys,a) = σ2 σ ∈ R+ in Lemma 1. Asymptotically Unbiased Off-Policy Policy Evaluation when Reusing Old Data in Nonstationary Environments B.2 Proof of Theorem 2 Lemma 2 (Variance of the HH estimator for multinomial design). Let z be a mapping from S × A to [a, b] for two constants a < b, and ˆtHH be the HH estimator for the variable ys,a = P (s)π(a|s)z(s, a). With multinomial design n and ps,a = P (s)πb(a|s), the variance is given by V(ˆtHH) =   1 n (cid:88) (s,a)∈U y2 s,a ps,a  − t2 y  = 1 n   (cid:88) (s,a)∈U P (s)π(a|s) π(a|s) πb(a|s)  z(s, a)2 − t2 y  . Proof. Recall the HH estimator is ˆtHH = (cid:88) D ys,a nps,a (cid:88) = U Is,ays,a nps,a . where Is,a is the (s, a)-th element of the design vector I. The variance is V(ˆtHH) = V (cid:33) (cid:32) (cid:88) U Is,a ys,a nps,a (cid:88) = V(Is,a) (s,a)∈U (cid:18) ys,a nps,a (cid:19)2 + (cid:88) Cov(Is,a, Is(cid:48),a(cid:48)) (s,a)(cid:54)=(s(cid:48),a(cid:48)) (cid:18) ys,a nps,a (cid:19) (cid:18) ys(cid:48),a(cid:48) nps(cid:48),a(cid:48) (cid:19) . We know V(Is,a) = nps,a(1 − ps.a) and Cov(Is,a, Is(cid:48),a(cid:48)) = −nps.aps(cid:48),a(cid:48) from the properties of the multinomial distri- (cid:16)(cid:80) bution, hence, after some calculation, we have V(ˆtHH) = 1 n the value of ys,a and ps,a. . The proof is completed by plugging in y2 s,a ps,a − t2 y (s,a)∈U (cid:17) Proof of Theorem 2. Note that we assume the first term in Eq (3) is invertible. We can write the estimator as ˆtReg = ˆty + (tz − ˆtz) ˆA−1 ˆC where ˆty is the HH estimator for ty = (cid:80) U zs,a and ˆtz be the HH estimator for tz. ˆA and ˆC denote the first and second matrix is Eq (3) respectively. Moreover, let tzj be the j-th element of the vector tz, and ˆtzj be the j-th element of the vector ˆtzj. Let A = (cid:80) U P (s)π(a|s)φ(s, a)φ(s, a)(cid:62), C = (cid:80) U P (s)π(a|s)φ(s, a)r(s, a) and B = A−1C. Using the Taylor lineariza- tion technique (see Section 6.6 of S ̈arndal et al. (1992)), and we can approximate ˆtReg at ˆty = ty, ˆt1 = t1, ˆtz = tz, ˆA = A and ˆC = C: U P (s)π(a|s)r(s, a) and tz = (cid:80) ˆtReg = ty + 1(ˆty − ty) − Bj(ˆtz,j − tz,j) + (cid:88) j (cid:88) i,j (tz − tz)(cid:62)[−A−1EijA−1]C( ˆAij − Aij)+ (tz − ˆtz)(cid:62)ej( ˆCj − Cj) + . . . (cid:88) j = ˆty + (tz − ˆtz)(cid:62)B + ... where Eij is a matrix where the ij- and ji-th elements are one and all other elements are zero, and ej is a vector where the j-th element is one and zero otherwise. Since the random variable is bounded, the moments exist. Taking the expectation, we get E[ˆtReg] = E[ˆty + (tz − ˆtz)(cid:62)B] + O(n−1) = ty + O(n−1). The first equality follows from the remainder terms of the Taylor expansion are the expectations of (ˆty − ty)p and (ˆtz,j − tz,j)p for p ≥ 2, which is of order O(1/n). The second equality follows from ˆtz is an unbiased estimator for tz. Therefore, ˆtReg is asymptotically unbiased. (6) Furthermore, V(ˆtReg) = E[(ˆtReg − E[ˆtReg])2] = E[(ˆtReg − ty + ty − E[ˆtReg])2] = E[(ˆtReg − ty)2 + (ty − E[ˆtReg])2 + 2(ˆtReg − ty)(ty − E[ˆtReg])] = E[(ˆtReg − ty)2] + o(n−1) = E[(ˆty − ˆtzB (cid:125) (cid:124) −ty + txB)2] + o(n−1) (cid:123)(cid:122) (a) Vincent Liu, Yash Chandak, Philip Thomas, Martha White (cid:16)(cid:80) The last equality comes from Eq (6). φ(s, a)(cid:62)B) so the expectation (the first 1 n Lemma 2. Since the variance converges to zero and the estimator is asymptotically unbiased, we also know ˆtReg πb(a|s) (r(s, a) − φ(s, a)(cid:62)B)2 − t2 Note that term in the last (s,a)∈U P (s)π(a|s) π(a|s) with te = (cid:80) is the variance of is the HH estimator ˆte = (cid:80) π(a|s) nπb(a|s) (r(s, a) − (a) which is given by U P (s)π(a|s)(r(s, a) − φ(s, a)(cid:62)B) by p → ty. line) (a) (cid:17) D e B.3 Proof of Theorem 3 Proof of consistency. Define ˆVn(β) = 1 n(n − 1)   (cid:88) (s,a)∈D (cid:18) π(a|s) πb(a|s) (r(s, a) − φ(s, a)(cid:62)β) (cid:19)2  − nˆte(β)2  , and Vn(β) =   (cid:88) (s,a)∈U 1 n P (s)π(a|s) π(a|s) πb(a|s) (r(s, a) − φ(s, a)(cid:62)β)2 − te(β)2   where ˆte(β) = (cid:80) to show that D π(a|s) nπb(a|s) (r(s, a) − φ(s, a)(cid:62)β) and te(β) = (cid:80) U P (s)π(a|s)(r(s, a) − φ(s, a)(cid:62)β). Then it is sufficient n| ˆVn( ˆβn) − Vn(βW LS)| p → 0. For (cid:15) > 0, by the triangle inequality, Pr(n| ˆVn( ˆβn) − Vn(βW LS)| > (cid:15)) ≤ Pr(n| ˆVn( ˆβn) − ˆVn(βW LS)| > (cid:15)/2) + Pr(n| ˆVn(βW LS) − Vn(βW LS)| > (cid:15)/2). p → βW LS and the continuous mapping theorem, we get ˆVn( ˆβn) p → ˆVn(βW LS), For the first term, using the fact that ˆβn which implies limn→∞ Pr(n| ˆVn( ˆβn) − ˆVn(βW LS)| > (cid:15)/2) = 0. Define es,a(β) = r(s, a) − φ(s, a)(cid:62)β, twe2(β) = (cid:80) (cid:80) (cid:16) π(a|s) (cid:17)2 D nπb(a|s) es,a(β) (the first term of ˆV(β)). Then, for the second term, we have U P (s)π(a|s) π(a|s) πb(a|s) es,a(β)2 (the first term of Vn(β)) and ˆtwe2(β) = (cid:12) (cid:12) (cid:12) Pr(n ˆVn(βW LS) − Vn(β) (cid:12) (cid:12) = Pr( (cid:12) (cid:12) (cid:12) (cid:12) ≤ Pr( (cid:12) (cid:12) n n − 1 n n − 1 ˆtwe2(βW LS) − (cid:12) (cid:12) (cid:12) > (cid:15)/2) n n − 1 ˆtwe2(βW LS) − twe2(βW LS) ˆte(βW LS)2 − twe2 (βW LS) + te(βW LS)2 (cid:12) (cid:12) (cid:12) (cid:12) > (cid:15)/4) + Pr( n n − 1 (cid:12) (cid:12) (cid:12) (cid:12) ˆte(βW LS)2 − te(βW LS)2 (cid:12) (cid:12) (cid:12) (cid:12) < (cid:15)/4). (cid:12) (cid:12) (cid:12) (cid:12) > (cid:15)/2) Note that ˆtwe2(βW LS) and ˆt(βW LS)2 are the HH estimators for twe2(βW LS) and te(βW LS) respectively, so they are consistent. As a result, we have which completes the proof. lim n→∞ Pr(n (cid:12) (cid:12) (cid:12) ˆVn( ˆβW LS) − Vn(βW LS) (cid:12) (cid:12) (cid:12) > (cid:15)/2) = 0, Proof of asymptotic normality. It is known that the HH estimator for with-replacement sampling is asymptotically normal (for example, see Theorem 2 of F ́elix-Medina (2003) or McConville (2011)), that is, (cid:20)√ √ (cid:21)(cid:19) (cid:18) D→ N 0, (cid:21) n(ˆty − ty) n(ˆtz − tz) (cid:20) Σy Σyz Σzy Σz where Σy, Σyz, Σzy and Σz are the limiting covariance matrices. Then we follow the proof idea from Theorem 3.2 of McConville (2011). Using the Slutsky's Theorem and the fact that ˆβn (cid:20) √ √ n(ˆty − ty) n(ˆtz − tz) ˆβn (cid:21) D→ N (0, p → βW LS, we have (cid:21) ΣyzβW LS W LSΣzβW LS ). Σy (cid:20) W LSΣzy β(cid:62) β(cid:62) Asymptotically Unbiased Off-Policy Policy Evaluation when Reusing Old Data in Nonstationary Environments √ √ √ n(ˆty − ty) − n(ˆtReg − ty) = Note that where σ2 = Σy − ΣyzβW LS − β(cid:62) V(ˆty − ˆtzβW LS) = 1 asymptotic variance of ˆtReg is AV(ˆtReg) = V(ˆty − ˆtzβW LS). Therefore, AV(ˆtReg) = σ2/n, and (ˆtReg − ty)/ N (0, 1). n(ˆtReg − ty) D→ N (0, σ2) W LSΣzβW LS. Note that we can write the variance of ˆty − ˆtzβW LS as W LSΣzβW LS), and in the proof for Theorem 2, we show that the AV(ˆtReg) D→ n(ˆtz − tz) ˆβn. By the Delta method, we have n (Σy − ΣyzβW LS − β(cid:62) W LSΣzy + β(cid:62) W LSΣzy + β(cid:62) (cid:113) √ By the consistency of the variance estimator and Slutsky's theorem, we have ˆtReg − ty (cid:113) ˆV(ˆtReg) = ˆtReg − ty (cid:113) AV(ˆtReg) (cid:113) AV(ˆtReg) (cid:113) ˆV(ˆtReg) D→ N (0, 1). C VARIANCE ESTIMATION In this section, we provide the variance estimation for all estimators used in our experiments. Variance estimation for the IS estimators. For the IS estimator from the Monte Carlo literature, we first note that the estimator can be written as 1 πb(Ai|Si) and Ri = r(Si, Ai). Then, the variance is given by n V( ˆJIS(π)) = 1 n V (W R) due to the i.i.d. property, and V (W R) can be estimated by the sample variance. Therefore, we have an unbiased variance estimator i WiRi where Wi = π(Ai|Si) (cid:80) ˆV( ˆJIS(π)) = (cid:34) 1 n 1 n − 1 n (cid:88) i=1 (cid:16) WiRi − ˆJIS(π) (cid:17)2(cid:35) . For the HH estimator from the survey sampling literature, we can use the Sen-Yates-Grundy variance estimator (Sen, 1953; Yates and Grundy, 1953) for the multinomial design, which is given by ˆV(ˆtHH) = 1 n(n − 1)   (cid:88) (s,a)∈D (cid:18) π(a|s) πb(a|x) (cid:19)2 r(s, a)  − nˆt2 HH  . The variance estimator ˆV(ˆtHH) is an unbiased estimator for the true variance V(ˆtHH). Interestingly, it also has the same form as the variance estimator for the IS estimator. Variance estimation for the WIS estimator. Using the Taylor linearization technique, the ratio estimator is approxi- mately by ˆtRatio = tx ˆRtx ≈ R + (ˆty − Rˆtx). Define us,a = ys,a − Rxs,a, tu = (cid:80) , then we have an approximate variance AV(ˆtRatio) = V(ˆtu). Based on the approximation, the estimated variance is given by 2 i∈U us,a and ˆtu = 1 us,a ps,a (cid:80)  D n  ˆV(ˆtWIS) = 1 n(n − 1)   (cid:88) (s,a)∈D (cid:18) π(a|s) πb(a|x)  (cid:19)2 (r(s, a) − ˆtWIS) − n  1 n (cid:88) (s,a)∈D π(a|s) πb(a|s) (r(s, a) − ˆtWIS)    . Variance estimation for the difference and DR estimator. Since the first term of the difference estimator is fixed, the π(a|s) variance of the difference estimator equals to the variance of the HH estimator ˆt∆ = 1 πb(a|s) ∆(s, a) where n ∆(s, a) = r(s, a) − ˆr(s, a). Then the variance estimator is (s,a)∈D (cid:80) ˆV(ˆtDiff) = 1 n(n − 1)   (cid:88) (s,a)∈D (cid:18) π(a|s) πb(a|x) (cid:19)2 ∆(s, a)  − nˆt2 ∆  . For the DR estimator where the first term is also estimated from D, first note that the DR estimator can be written as ˆtDR = 1 n (cid:88) (s,a)∈D (π(a|x)(r(s, a) − ˆr(s, a)) + πb(a|s)ˆrπ(s)) πb(a|s) Vincent Liu, Yash Chandak, Philip Thomas, Martha White which is the HH estimator for t = (cid:80) estimator U P (s)(π(a|s)(r(s, a) − ˆr(s, a)) + πb(a|s)ˆrπ(s)). Therefore, we have the variance ˆV(ˆtDR) = 1 n(n − 1)   (cid:88) (s,a)∈D (cid:18) (π(a|x)(r(s, a) − ˆr(s, a)) + πb(a|s)ˆrπ(s)) πb(a|s) (cid:19)2  − nˆt2 DR  . Variance estimation for the regression-assisted estimator. We briefly describe the weighted residual technique from S ̈arndal et al. (1989). Using the definition of gs,a = 1 + (tx − ˆtx)((cid:80) )−1φ(s, a), the regression estimator can be written as π(a|s)φ(s,a)φ(s,a)(cid:62) nπb(a|s) i∈D ˆtReg = (cid:88) (s,a)∈U P (s)π(a|s)φ(s, a)(cid:62)βW LS + (cid:88) (s,a)∈D π(a|s) nπb(a|s) gs,a(r(s, a) − φ(s, a)(cid:62)βW LS). It follows that V(ˆtReg) = V   (cid:88) (s,a)∈D π(a|s) nπb(a|s) gs,a(r(s, a) − φ(s, a)(cid:62)βW LS)   which is the variance of the HH estimator ˆte = (cid:80) U P (s)π(a|s)gs,a(r(s, a)− φ(s, a)(cid:62)β). Ignoring the fact that the weight gs,a is sample dependent and replacing βW LS with ˆβ, we have the g-weighted variance estimator πb(a|s) gsa(r(s, a)−φ(s, a)(cid:62)β) for te = (cid:80) π(a|s) D ˆV(ˆtReg) = 1 n(n − 1)   (cid:88) (s,a)∈D (cid:18) π(a|s) πb(a|x) gsa(r(s, a) − φs,a (cid:19)2 ˆβ)  − nˆt2 e  . D EXTENSION TO RL In the main paper, we discuss OPE for RL by treating each trajectory as one unit in a population containing all possible trajectories. That is, let U = (S × A)H be the population containing all trajectories and yτ = Pπ M (τ )R(τ ) be the study variable. We use multinomial design with pτ = Pπb M (τ ) to obtain a sample of trajectories D. The resulting HH estimator has the same form as the trajectory-wise IS estimator (Sutton and Barto, 1998). , that is, ˆtIS = 1 n (cid:88) τ ∈D Pπ M (τ ) Pπb M (τ ) R(τ ) = 1 n (cid:88) τ ∈D π(a0|s0) . . . π(aH−1|sH−1) πb(a0|s0) . . . πb(aH−1|sH−1) R(τ ). However, there are many other ways to view OPE for RL in the survey sampling framework. One way is to consider estimating the expected reward at each horizon separately. In this case, for h = 0, . . . , H − 1, let Uh = (S × A)h+1 and our goal is to estimate Jh(π) = ν(s0)π(a0|s0)P (s1|s0, a0) . . . π(ah|sh)r(sh, ah) (cid:88) τ ∈Uh which is the expected reward at horizon h under policy π. It is easy to see that J(π) = (cid:80)H−1 h=0 Jh(π). Therefore, this can be viewed as stratified sampling where stratum h contain all trajectories of horizon h. Using the IS estimator to estimate Jh(π) for each horizon, we get the per-decision IS estimator (Precup et al., 2000). That is, ˆtPDIS = H−1 (cid:88) h=0 ˆJh(π) = H−1 (cid:88) h=0 1 n (cid:88) τ ∈D π(a0|s0) . . . π(ah|sh) πb(a0|s0) . . . πb(ah|sh) r(sh, ah). (7) The sampling at each horizon might depend on the sampling at the previous horizon. In that case, we can't easily get the variance or an variance estimator since V ( ˆJ(π)) (cid:54)= (cid:80)H−1 h=0 V ( ˆJh(π)). However, we can still compute the variance and an variance estimator via a recursive form (Jiang and Li, 2016). Another way is to consider sampling transitions instead of episode. Let U = S × A and for (s, a) ∈ U, ys,a = dπ(s, a)r(s, a) where dπ(s, a) = ((cid:80)H−1 M (Sh = s, ah = a))/H. We use multinomial design with ps,a = μ(s, a) h=0 where μ is a data distribution that we can use to sample data. However, for this formulation, dπ(s, a) is usually unknown, and there are existing work on estimating the density ratio (Liu et al., 2018). Pπ Asymptotically Unbiased Off-Policy Policy Evaluation when Reusing Old Data in Nonstationary Environments E EXPERIMENT DETAILS The goal of the experiment design is to model the recommendation system where reward associated with each user- item pair changes over time. For the Youtube dataset, we generate a sequence of reward functions based on the non- stationary recommendation environment used in Chandak et al. (2020). For each positive context-action pair in the original classification dataset, the reward follows a sine wave with noises. More precisely, rk(s, a) = 0.5 + amplitudes,a ∗ sin(k ∗ frequencys,a) + 0.01ε where ε ∼ Unif([0, 1]). For each interval, we also randomly sample some context-action pairs and set their rewards to positive random values to increase the noise. To obtain a target policy for the Youtube and MovieLens dataset, we fist train a classifier on a small subset of the original multi-label classification dataset. Then we apply the softmax function on the outputs of the trained classifiers to obtain a probability distribution over actions for each context. The conditional distribution is used as the target policy. Similarly for the RL environment, the reward follows rk(s, a) = μs,a + 0.25 ∗ sin(k ∗ frequencys,a) + 0.01 ∗ ε where ε ∼ Unif([0, 1]). To obtain a target policy, we fist train a Q-learning agent on the underlying environment for 1000 episodes and then apply the softmax function on the Q-value as the target policy. The summary statistics of the dataset are: Youtube MovieLens |S| 31703 1923 |A| 47 19 We provide a pseudocode for our experiment procedure in Algorithm 1. Algorithm 1 Non-stationary OPE experiment with regression-assisted DR estimator Input: a non-stationary environment M , a target policy π, a behavior policy πb, window size B, a prediction subroutine P red(X, Y, xtest) using linear regression with basis function ψ for k = 0, . . . , K do Collect a dataset Dk = {(si, ai, rk(si, ai), πb(ai|si))}n if k > 0 then i=1 from M # Estimate the current value Build a reward prediction ˆrk from the past data Dk−B, . . . , Dk−1 Compute ˆβk from Dk using Eq (3) with φ(s, a) = (1, ˆrk(s, a)) Compute ˆtReg,k from Dk using Eq (4) # Predict the future value ˆtP red,k+1 = P red(X = [ψ(1), . . . , ψ(k)], Y = [ˆtReg,1, . . . , ˆtReg,k], xtest = ψ(k + 1)) Compute the true value J1(π), . . . , Jk(π) Output: RMSEReg = RMSEP red = (cid:113) 1 K (cid:113) 1 K (cid:80)K k=1(ˆtReg,k − Jk(π))2 # Error for estimating the current value (cid:80)K k=2(ˆtP red,k − Jk(π))2 # Error for predict the future value F ADDITIONAL EXPERIMENTS We provide more experiment results in this section. Estimating the population total of the proxy values. For the experiments in the main paper, we use the population total of the proxy values for the DM, Diff and Reg estimator. In this experiment, we test the regression-assisted estimator when the population total of the proxy values are being estimated, that results in the estimator using Eq (2), which we call RegDR, and the estimator with an independent survey D(cid:48), described in the last paragraph of Section 4.1, which we call RegDR2. In Figure 5, we found that RegDR2 has a similar RMSE compared to Reg, and both are slightly better than RegDR. This suggests that using an independent survey has potential to improve the standard DR estimator in the non-stationary setting. Vincent Liu, Yash Chandak, Philip Thomas, Martha White Figure 5: Comparison when the population total of the proxy value is estimated. Top: estimating Jk(π). Bottom: predicting Jk+1(π). Figure 6: Comparison to PDIS in the simulated RL environment. Left: estimating Jk(π). Right: predicting Jk+1(π). Note that PDIS and IS are horizontal lines since they do not depend on B. Moreover, even the population total needs to be estimated, the regression-assisted estimator can still perform well using RegDR2. Comparison to PDIS. For the RL experiment, we compare Reg to PDIS in Eq (7), which is expected to improve over the standard trajectory-wise IS estimator. The result in Figure 6 shows that Reg still outperforms PDIS. 01248160.00450.00500.0055RMSE for JkYoutube: 0.1|S|01248160.001350.00140Youtube: 1.0|S|01248160.160.17MovieLens: 0.1|S|01248160.04250.04500.04750.0500MovieLens: 1.0|S|0124816B0.00400.00450.00500.0055RMSE for Jk+10124816B0.001600.001650.001700.001750124816B0.230.240.250.260124816B0.1100.1150.120RegRegDR2RegDR0124816B0.20.40.6RMSE for Jk0124816B0.20.30.4ISPDISReg
http://arxiv.org/abs/2302.11716v4
2023-05-18T02:05:22
2023-02-23T00:45:14
VRA: Variational Rectified Activation for Out-of-distribution Detection
Out-of-distribution (OOD) detection is critical to building reliable machine learning systems in the open world. Researchers have proposed various strategies to reduce model overconfidence on OOD data. Among them, ReAct is a typical and effective technique to deal with model overconfidence, which truncates high activations to increase the gap between in-distribution and OOD. Despite its promising results, is this technique the best choice for widening the gap? To answer this question, we leverage the variational method to find the optimal operation and verify the necessity of suppressing abnormally low and high activations and amplifying intermediate activations in OOD detection, rather than focusing only on high activations like ReAct. This motivates us to propose a novel technique called ``Variational Rectified Activation (VRA)'', which simulates these suppression and amplification operations using piecewise functions. Experimental results on multiple benchmark datasets demonstrate that our method outperforms existing post-hoc strategies. Meanwhile, VRA is compatible with different scoring functions and network architectures. \textcolor[rgb]{0.93,0.0,0.47}{Our code can be found in Supplementary Material}.
[ "Mingyu Xu", "Zheng Lian", "Bin Liu", "Jianhua Tao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11716v4", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11716v4", "@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 y a M 8 1 ] G L . s c [ 4 v 6 1 7 1 1 . 2 0 3 2 : v i X r a VRA: Variational Rectified Activation for Out-of-distribution Detection Mingyu Xu1,2∗, Zheng Lian2∗, Bin Liu2, Jianhua Tao3 1School of Artificial Intelligence, University of Chinese Academy of Sciences 2Institute of Automation, Chinese Academy of Sciences 3Department of Automation, Tsinghua University {xumingyu2021, lianzheng2016}@ia.ac.cn Abstract Out-of-distribution (OOD) detection is critical to building reliable machine learning systems in the open world. Researchers have proposed various strategies to reduce model overconfidence on OOD data. Among them, ReAct is a typical and effective technique to deal with model overconfidence, which truncates high activations to increase the gap between in-distribution and OOD. Despite its promising results, is this technique the best choice? To answer this question, we leverage the variational method to find the optimal operation and verify the necessity of suppressing abnor- mally low and high activations and amplifying intermediate activations in OOD detection, rather than focusing only on high activations like ReAct. This motivates us to propose a novel technique called "Variational Rectified Activation (VRA)", which simulates these suppression and amplification operations using piecewise functions. Experimental results on multiple benchmark datasets demonstrate that our method outperforms existing post-hoc strategies. Meanwhile, VRA is compati- ble with different scoring functions and network architectures. Our code can be found in Supplementary Material. 1 Introduction Systems deployed in the real world often encounter out-of-distribution (OOD) data, i.e., samples from an irrelevant distribution whose label set has no interaction with the training data. Most of the existing systems tend to generate overconfident estimations for OOD data, seriously affecting their reliability [1]. Therefore, researchers propose the OOD detection task, which aims to determine whether a sample comes from in-distribution (ID) or OOD. This task allows the model to reject recognition when faced with unfamiliar samples. Considering its importance, OOD detection has attracted increasing attention from researchers and has been applied to many fields with high-safety requirements such as autonomous driving [2] and medical diagnosis [3]. In OOD detection, existing methods can be roughly divided into two categories: methods requiring training and post-hoc strategies. The first category identifies OOD data by training-time regularization [4, 5] or external OOD samples [6, 7]. But they require more computational resources and are inconvenient in practical applications. To this end, researchers propose post-hoc strategies that directly use pretrained models for OOD detection. Due to their ease of implementation, these methods have attracted increasing attention in recent years. Among them, React [8] is a typical post-hoc strategy that truncates abnormally high activations to increase the gap between ID and OOD, thereby improving detection performance. But is this operation the best choice for widening the gap? To answer this question, we use the variational method to solve for the optimal operation. Based on this operation, we reveal the necessity of suppressing abnormally low and high activations and amplifying ∗Equal Contribution Preprint. Under review. intermediate activations in OOD detection. Then, we propose a simple yet effective strategy called "Variational Rectified Activation (VRA)", which mimics suppression and amplification operations using piecewise functions. To verify its effectiveness, we conduct experiments on multiple benchmark datasets, including CIFAR-10, CIFAR-100, and the more challenging ImageNet. Experimental results demonstrate that our method outperforms existing post-hoc strategies, setting new state-of-the-art records. The main contributions of this paper can be summarized as follows: • (Theory) From the perspective of the variational method, we find the best operation for max- imizing the gap between ID and OOD. This operation verifies the necessity of suppressing abnormally low and high activations and amplifying intermediate activations. • (Method) We propose a simple yet effective post-hoc strategy called VRA. Our method is compatible with various scoring functions and network architectures. • (Performance) Experimental results on benchmark datasets demonstrate the effectiveness of our method. VRA is superior to existing post-hoc strategies in OOD detection. 2 Methodology 2.1 Problem Definition Let X be the input space and Y be the label space with c distinct categories. Consider a supervised classification task on a dataset containing N labeled samples {x, y}, where y ∈ Y is the ground-truth label for the sample x ∈ X . Ideally, all test samples come from the same distribution as the training data. But in practice, the test sample may come from an unknown distribution, such as an irrelevant distribution whose label set has no intersection with Y. In this paper, we use pin to represent the marginal distribution of X and pout to represent the distribution of OOD data. In this paper, we aim to determine whether a sample comes from ID or OOD. 2.2 Motivation Among all methods, ReAct is a typical and effective post-hoc strategy [8]. Suppose h(x) = {zi}m i=1 is the feature vector of the penultimate layer and m denotes the feature dimension. For convenience, we use z as shorthand for zi. ReAct truncates activations above a threshold c for each z: g(z) = min(z, c), (1) where c = ∞ is equivalent to the model without truncation. ReAct has demonstrated that this truncation operation can increase the gap between ID and OOD [8]: Ein[g(z)] − Eout[g(z)] ≥ Ein[z] − Eout[z]. (2) Despite its promising results, is this strategy the best option for widening the gap between ID and OOD? In this paper, we attempt to answer this question with the help of the variational method. 2.3 VRA Framework To find the best operation, we should optimize the following objectives: • Maximize the gap between ID and OOD. • Minimize the modification brought by the operation to maximally preserve the input. The final objective function is calculated as follows: L(g) = Ein[(g(z) − z)2] − 2λ (Ein[g(z)] − Eout[g(z)]) , (3) min g where λ controls the trade-off between two losses. To solve for Eq. 3, we first make a mild assumption to ensure the function space G is sufficiently complex. Assumption 1 We assume Ein[|z|], Eout[|z|], Ein[z2], and Eout[z2] exist. Let G be a Hilbert space: G = {g(z)|Ein[|g(z)|], Eout[|g(z)|], Ein[g(z)2], Eout[g(z)2] < ∞}. (4) 2 (5) (7) (8) (9) This space is sufficiently complex containing most functions, such as identity functions, constant functions, and all bounded continuous functions. Then, we define the inner product of G as follows: (cid:90) < ga(z), gb(z) >= ga(z)gb(z)pin(z)dz. Combining this assumption, the equivalent equation of Eq. 3 is: (cid:90) min g∈G L(g) = (g(z) − z)2 pin(z) − 2λg(z)(pin(z) − pout(z))dz. (6) Then, we leverage the variational method to solve for the functional extreme value. We mark g∗(*) as the optimal solution. ∀f (*) ∈ G and ∀(cid:15) ∈ R, we then have: L(g∗) ≤ L(g∗ + (cid:15)f ). It can be converted to: (cid:90) (g∗(z) − z)2 pin(z) − 2λg∗(z)(pin(z) − pout(z))dz (cid:90) ≤ (g∗(z) + (cid:15)f (z) − z)2 pin(z) − 2λ(g∗(z) + (cid:15)f (z))(pin(z) − pout(z))dz. Then, we have: (cid:90) (cid:15)2 f 2(z)pin(z)dz + 2(cid:15) (cid:90) (cid:18) f (z) g∗(z) − z − λ (cid:18) 1 − pout(z) pin(z) (cid:19)(cid:19) pin(z)dz ≥ 0. (10) Combining Assumption 1 and the arbitrariness of (cid:15), we can get: (cid:19)(cid:19) (cid:18) (cid:18) (cid:90) f (z) g∗(z) − z − λ 1 − pin(z)dz = 0. pout(z) pin(z) Considering Assumption 1 and the arbitrariness of f (z), we have: g∗(z) − z − λ (cid:18) 1 − (cid:19) pout(z) pin(z) = 0. Therefore, the optimal activation function is: g∗(z) = z + λ (cid:18) 1 − (cid:19) . pout(z) pin(z) (11) (12) (13) To verify its effectiveness, we compare the optimal function g∗(*) with the unrectified function g(z) = z. Since g∗(*) is the optimal solution, it should get a smaller value in Eq. 3: Ein[(g∗(z) − z)2] − 2λ (Ein[g∗(z)] − Eout[g∗(z)]) ≤ Ein[(z − z)2] − 2λ (Ein[z] − Eout[z]) . (14) The equivalent equation of Eq. 14 is: (Ein[g∗(z)] − Eout[g∗(z)]) − (Ein[z] − Eout[z]) ≥ 1 2λ Ein[(g∗(z) − z)2]. (15) It shows that g∗(*) enlarges the gap between ID and OOD by at least 1 2λ Ein[(g∗(z) − z)2] ≥ 0. 2.4 Practical Implementations Through theoretical analysis, we have found the optimal operation g∗(*) that can maximize the gap between ID and OOD. But in practice, this operation depends on the specific expressions of pin and pout. Estimating these expressions is a challenging task given that OOD data comes from unknown distributions [9]. This drives us to look for more practical implementations. For this purpose, we treat ImageNet as ID data and select multiple OOD datasets. We first use histograms to approximate the probability density functions of pin and pout. Then, we compute g∗(*) and compare it with ReAct, whose threshold is set to the 90th percentile of activations estimated on ID data, consistent with the original paper [8]. Experimental results are shown in Figure 1. 3 (a) empirical PDF on iNaturalist (b) empirical PDF on SUN (c) empirical PDF on Places (d) activation functions on iNaturalist (e) activation functions on SUN (f) activation functions on Places Figure 1: Empirical PDFs for pin(*) and pout(*), and visualization of different activation functions. We treat ImageNet as ID data and select multiple OOD datasets for visualization. Compared with the model without truncation, we observe that ReAct suppresses high activations (see Figure 1(d)∼1(f)). Unlike ReAct, the optimal operation g∗(*) further demonstrates the necessity of suppressing abnormally low activations in OOD detection. To mimic such operations, we design a piecewise function called VRA: VRA(z) =    0, z < α z, α ≤ z ≤ β β, z > β , where α and β are two thresholds for determining low and high activations. Obviously, α = 0 and β = ∞ represent models without activation truncation; α = 0 and β > 0 represent models equivalent to ReAct. Therefore, our method is a more general operation. Since different features have distinct distributions, we propose an adaptively adjusted strategy to determine α and β. Specifically, we predefine ηα and ηβ satisfying ηα < ηβ. Then, we treat the ηα-quantile (or ηβ-quantile) of activations estimated on ID data as α (or β). Meanwhile, we observe that g∗(*) amplifies intermediate activations in Figure 1(d)∼1(f). Therefore, we propose another variant of VRA called VRA+, which further introduces a hyper-parameter γ to control the degree of amplification:    0, z < α z + γ, α ≤ z ≤ β β, z > β . VRA+(z) = 3 Experiments 3.1 Experimental Setup Corpus Description In line with previous works, we consider different OOD datasets for distinct ID datasets [8, 10]. For CIFAR benchmarks [11] as ID data, we use the official train/test splits for ID data and select six datasets as OOD data: Textures [12], SVHN [13], Places365 [14], LSUN-Crop [15], LSUN-Resize [15], and iSUN [16]; for ImageNet [17] as ID data, it is more challenging than CIFAR benchmarks due to larger label space and higher resolution images. To ensure non-overlapped categories between ID and OOD, we select a subset from four datasets as OOD data, in line with previous works [8, 10]: iNaturalist [18], SUN [19], Places [14], and Textures [12]. 4 Baselines To verify the effectiveness of our method, we implement the following state-of-the-art post-hoc strategies as baselines: 1) MSP [20] is the most basic method that directly leverages the maximum softmax probability to identify OOD data; 2) ODIN [21] uses temperature scaling and input perturbation to increase the gap between ID and OOD; 3) Mahalanobis [22] calculates the distance from the nearest class center as the indicator; 4) Energy [23] replaces the maximum softmax probability with the theoretically guaranteed energy score; 5) ReAct [8] applies activation truncation to remove abnormally high activations; 6) KNN [24] exploits non-parametric nearest-neighbor distance for OOD detection; 7) DICE [10] leverages sparsification to select the most salient weights; 8) SHE [25] uses the energy function defined in the modern Hopfield network [26]. Implementation Details Our method contains three user-specific parameters: the thresholds ηα and ηβ, and the degree of amplification γ. We select ηα from {0.5, 0.6, 0.65, 0.7}, ηβ from {0.8, 0.85, 0.9, 0.95, 0.99}, and γ from {0.2, 0.3, 0.4, 0.5, 0.6, 0.7}. Consistent with previous works [8], we use Gaussian noise images as the validation set for hyperparameter tuning. By default, we use DenseNet-101 [27] for CIFAR and ResNet-50 [28] for ImageNet. All experiments are implemented with PyTorch [29] and carried out with NVIDIA Tesla V100 GPU. To compare the performance of different methods, we exploit two widely used OOD detection metrics: FPR95 and AUROC. Among them, FPR95 measures the false positive rate of OOD data when the true positive rate of ID data is 95%; AUROC measures the area under the receiver operating characteristic curve. 3.2 Experimental Results and Discussion Main Results To verify the effectiveness of our method, we compare VRA-based methods with competitive post-hoc strategies. Experimental results are shown in Table 1 and Table 2. We observe that our method generally achieves Top3 performance on different datasets and performs the best overall. Different from these baselines, we attempt to maximize the gap between ID and OOD by suppressing abnormally low and high activations and amplifying intermediate activations. These results demonstrate the effectiveness of such suppression and amplification operations in OOD detection. Meanwhile, we observe that VRA+ generally outperforms VRA, suggesting that the operation closer to the theoretical optimum solution generally can achieve better performance. We also compare with methods that require training. MOS [4] addresses OOD detection by training- time regularization. Experimental results in Table 2 show that our method outperforms MOS with the same backbone. Meanwhile, VOS [5] is a recently advanced strategy that synthesizes virtual outliers to regularize decision boundaries during training. According to their original paper, it achieves 95.33% in AUROC and 22.47% in FPR95 on CIFAR-10. Our method outperforms VOS under the same ID data, OOD data, and network architecture (see Table 1). Therefore, VRA-based methods do not require an expensive training process but can achieve better performance in OOD detection. Compatibility with Scoring Functions In Table 3, we investigate the compatibility of VRA-based methods with different scoring functions: MSP, Energy, and ODIN. Experimental results demonstrate that our method brings performance improvements for all scoring functions and generally achieves better performance than competitive post-hoc strategies. These results verify the compatibility and effectiveness of our method in OOD detection. Performance Upper Bound Analysis We propose VRA and VRA+ to approximate the optimal op- eration for OOD detection. But is it necessary to design other functions to get a better approximation? To answer this question, we need to reveal whether g∗(*) can reach the upper-bound performance. The core of estimating g∗(*) is to estimate the probability density functions of pin and pout. To this end, we consider two ideal cases: VRA-True and VRA-Fake-True. In the first case, we assume that all ID and OOD data are known in advance; in the second case, we randomly select 1% of ID and OOD data from the entire dataset. Both cases leverage histograms to estimate pin and pout and use Eq. 13 to calculate g∗(*). Considering that histograms provide a piecewise form of g∗(*), we directly use the piecewise function to represent g∗(*). In Table 4, we observe that both ideal cases can achieve near-perfect results. Therefore, g∗(*) that increases the gap between ID and OOD can generate more discriminative features for OOD detection. In the future, we will explore other functions that can better describe the optimal operation for better performance. 5 Table 1: Main results on CIFAR benchmarks. In this table, we compare detection performance with competitive post-hoc strategies. All methods are pretrained on ID data. We report the results for each dataset, as well as the average results across all datasets. "FR." and "AU." are abbreviations of FPR95 and AUROC. Top3 results are marked in red, and darker colors indicate better performance. Method MSP [20] ODIN [21] Mahalanobis [22] Energy [23] ReAct [8] KNN [24] DICE [10] SHE [25] VRA VRA+ MSP [20] ODIN [21] Mahalanobis [22] Energy [23] ReAct [8] KNN [24] DICE [10] SHE [25] VRA VRA+ SVHN LSUN-C LSUN-R iSUN Textures Places365 FR. ↓ AU. ↑ FR. ↓ AU. ↑ FR. ↓ AU. ↑ FR. ↓ AU. ↑ FR. ↓ AU. ↑ FR. ↓ AU. ↑ ID Dataset: CIFAR-10; Backbone: DenseNet-101 [27] Average FR. ↓ AU. ↑ 47.27 25.29 06.42 40.61 41.64 13.51 25.99 28.12 18.75 13.54 81.70 41.35 22.44 87.46 83.81 23.96 54.65 41.89 70.91 62.64 93.48 94.57 98.31 93.99 93.87 96.68 95.90 94.72 96.68 97.45 75.40 92.65 95.67 81.85 81.41 93.99 88.84 90.61 87.46 88.70 33.57 04.70 56.55 03.81 05.96 30.95 00.26 00.76 01.32 02.03 95.54 98.86 86.96 99.15 98.84 93.82 99.92 99.84 99.63 99.56 42.10 03.09 09.14 09.28 11.46 11.37 03.91 09.73 05.80 06.37 94.51 99.02 97.09 98.12 97.87 97.72 99.20 98.15 98.69 98.72 42.31 03.98 09.78 10.07 12.72 10.79 04.36 10.99 05.70 06.15 94.52 98.90 97.25 98.07 97.72 97.91 99.14 97.95 98.69 98.71 64.15 57.50 21.51 56.12 43.58 24.50 41.90 51.98 34.89 27.07 ID Dataset: CIFAR-100; Backbone: DenseNet-101 [27] 60.49 10.54 68.90 14.72 25.55 70.98 00.93 01.06 10.73 19.82 85.60 97.93 86.30 97.43 94.92 73.37 99.74 99.68 98.04 96.33 85.24 65.22 23.07 70.65 60.08 76.34 49.40 78.18 38.52 28.44 69.18 84.22 94.20 80.14 87.88 76.69 91.04 73.97 93.49 95.47 85.99 67.05 31.38 74.54 65.27 70.88 48.72 72.73 38.53 28.72 70.17 83.84 89.28 78.95 86.55 78.58 90.08 76.14 93.42 95.18 84.79 82.34 62.39 84.15 77.78 37.75 65.04 61.49 47.64 40.62 88.15 82.38 92.15 86.43 92.47 95.19 88.18 83.07 93.42 95.03 71.48 71.48 79.39 71.03 78.95 87.48 76.42 76.57 90.17 91.57 63.02 52.85 85.14 39.40 43.31 63.88 48.59 59.35 39.98 39.97 82.55 82.32 92.66 79.20 82.65 95.20 79.58 85.33 76.39 79.78 88.57 88.55 63.15 91.64 91.03 85.00 89.13 84.16 91.69 91.96 74.31 76.84 61.39 77.72 74.04 59.70 77.26 70.53 78.66 76.42 48.74 24.57 31.42 26.55 26.45 25.83 20.84 26.82 17.74 15.85 80.13 58.14 50.14 68.45 65.86 62.52 49.72 56.78 47.12 43.34 92.46 93.71 89.15 94.57 95.30 94.39 95.25 92.98 96.47 96.91 74.36 84.49 84.37 81.19 83.96 78.30 87.23 81.25 90.21 90.61 Table 2: Main results on ImageNet. All methods are pretrained on ImageNet. Method iNaturalist FR. ↓ AU. ↑ MSP [20] ODIN [21] Mahalanobis [22] Energy [23] ReAct [8] KNN [24] DICE [10] SHE [25] VRA VRA+ MSP [20] ODIN [21] Mahalanobis [22] Energy [23] ReAct [8] MOS [4] VRA VRA+ 54.99 47.66 97.00 55.72 20.38 59.08 25.63 34.22 15.70 15.48 63.69 62.69 96.34 64.91 49.97 09.28 27.26 20.81 87.74 89.66 52.65 89.95 96.22 86.20 94.49 90.18 97.12 97.08 87.59 89.36 46.33 88.48 89.80 98.15 95.68 97.70 Places FR. ↓ AU. ↑ 79.76 81.78 41.79 82.86 91.58 74.87 87.48 90.15 91.27 91.79 80.86 84.59 42.41 85.89 94.20 80.10 90.83 84.69 94.25 94.91 73.99 67.89 98.40 64.92 33.85 77.09 46.49 45.35 37.85 34.62 SUN FR. ↓ AU. ↑ Backbone: ResNet-50 [28] 70.83 60.15 98.50 59.26 24.20 69.53 35.15 54.19 26.94 23.50 Backbone: ResNetv2-101 [28] 79.98 71.67 88.43 65.33 65.30 40.63 34.53 32.89 81.44 76.27 89.75 73.02 73.12 49.54 47.31 45.83 78.34 83.92 65.20 85.32 87.40 92.01 93.27 92.68 76.76 80.67 64.46 81.37 85.34 89.06 90.19 90.01 Textures FR. ↓ AU. ↑ Average FR. ↓ AU. ↑ 68.00 50.23 55.80 53.72 47.30 11.56 31.72 45.09 21.47 19.66 82.73 81.31 52.23 80.87 80.82 60.43 30.69 23.88 79.61 85.62 85.01 85.99 89.80 97.18 90.30 87.93 95.62 96.08 75.45 76.30 72.10 75.79 70.53 81.23 94.22 95.43 66.95 56.48 87.43 58.40 31.43 54.32 34.75 44.71 25.49 23.31 76.96 72.99 81.69 71.03 67.30 39.97 34.95 30.85 81.99 85.41 55.47 86.17 92.95 84.59 90.78 88.24 94.57 94.97 79.54 82.56 62.02 82.74 83.27 90.11 93.34 93.71 Parameter Sensitivity Analysis VRA uses two hyper-parameters (ηα and ηβ) to adaptively adjust thresholds for low and high activations. In this section, we conduct parameter sensitivity analysis and reveal their impact on OOD detection. In Figure 2, we observe that our method does not perform well when ηα and ηβ are inappropriate. A large ηα suppresses too many low activations, while a large ηβ suppresses too few high activations. Therefore, it is necessary to choose proper ηα and ηβ for VRA. Role of Adaptively Adjusted Strategy In this paper, we adopt an adaptive strategy to automatically determine α and β. To verify its effectiveness, we compare this adaptive strategy with another strategy that uses fixed α and β for different features. To determine these hyper-parameters, we use Gaussian noise images as the validation set, in line with previous works [8]. Experimental results in Table 5 6 Table 3: Compatibility with different scoring functions. For each ID dataset, we report the average results of its OOD datasets. We use DenseNet-101 [27] for CIFAR and ResNet-50 [28] for ImageNet. Method MSP [20] MSP + ReAct MSP + DICE MSP + VRA Energy [23] Energy + ReAct Energy + DICE Energy + VRA ODIN [21] ODIN + ReAct ODIN + DICE ODIN + VRA CIFAR-10 CIFAR-100 ImageNet Average FPR95 ↓ AUROC ↑ FPR95 ↓ AUROC ↑ FPR95 ↓ AUROC ↑ FPR95 ↓ AUROC ↑ 48.73 48.00 43.72 42.31 26.55 26.45 20.83 17.74 24.57 21.00 26.05 17.38 92.46 92.77 92.92 93.50 94.57 94.67 95.24 96.47 93.71 95.98 94.62 96.52 80.13 77.69 76.86 79.69 68.45 62.27 49.72 53.24 58.14 54.17 61.39 47.12 74.36 76.22 76.39 75.94 81.19 84.47 87.23 88.74 84.49 88.62 83.83 90.21 66.95 55.63 67.41 47.09 58.41 31.43 34.75 25.49 56.48 42.21 62.89 32.75 81.99 87.85 82.24 89.62 86.17 92.95 90.77 94.57 85.41 91.28 84.48 93.39 65.27 60.44 62.66 56.36 51.14 40.05 35.10 32.16 46.40 39.13 50.11 32.42 82.94 85.61 83.85 86.35 87.31 90.70 91.08 93.26 87.87 91.96 87.64 93.37 Table 4: Performance upper bound analysis. For each ID dataset, we report the average results over multiple OOD datasets. We use DenseNet-101 [27] for CIFAR and ResNet-50 [28] for ImageNet. ID Energy [23] VRA VRA-Fake-True VRA-True FPR95 ↓ AUROC ↑ FPR95 ↓ AUROC ↑ FPR95 ↓ AUROC ↑ FPR95 ↓ AUROC ↑ CIFAR-10 CIFAR-100 ImageNet 26.55 68.45 58.41 94.57 81.19 86.17 17.74 47.12 25.49 96.47 90.21 94.57 13.27 23.62 13.09 97.75 94.20 96.89 00.96 01.58 03.50 99.81 99.69 99.31 demonstrate that our adaptive strategy outperforms this fixed strategy. The reason lies in that different features have distinct statistical distributions. Using fixed thresholds for different features will limit the performance of OOD detection. Compatibility with Backbones In this section, we further verify the compatibility of our method with different backbones. For a fair comparison, all methods are pretrained on ImageNet, and we report the average results on four OOD datasets of ImageNet. Compared with competitive post-hoc strategies, experimental results in Table 6 demonstrate that our method can achieve the best performance under different network architectures. These results validate the effectiveness and compatibility of our method. Meanwhile, we observe some interesting phenomena in Table 6. ReAct [8] points out that mismatched BatchNorm [30] statistics between ID and OOD lead to model overconfidence on OOD data. In Table 6, VGG-16 and VGG-16-BN refer to models without and with BatchNorm, respectively. We observe that no matter with or without BatchNorm, ReAct cannot achieve better performance than Energy, consistent with previous findings [31]. Therefore, BatchNorm may not be the only reason for model overconfidence, and the network architecture also matters. Furthermore, Energy [23] generally outperforms MSP [20] with the exception of EfficientNetV2, which also reveals its limitation in compatibility. In the future, we will conduct an in-depth analysis to reveal the reasons behind these phenomena. 4 Further Analysis Combining features with logit outputs can achieve better performance in OOD detection [36]. Therefore, we design another variant of VRA called VRA++, whose scoring function is defined as: λv m (cid:88) i=1 g(zi) + log c (cid:88) i=1 eli, (16) where zi, i ∈ [1, m] represents the i-th feature and li, i ∈ [1, c] represents the i-th logit output. This scoring function consists of two items: (1) Since we have maximized the gap between ID and OOD Ein[g(zi)] − Eout[g(zi)], we directly use the sum of all rectified features (cid:80)m i=1 g(zi) as the indicator; (2) We also calculate the energy score on logit outputs for OOD detection. These items are combined using a balancing factor λv. Unlike VRA using piecewise functions, we further test the performance of the quadratic function g(z) = −z2 + αvz. By choosing a proper αv, this quadratic function can 7 (a) AUROC on CIFAR-10 (b) AUROC on CIFAR-100 (c) AUROC on ImageNet (d) FPR95 on CIFAR-10 (e) FPR95 on CIFAR-100 (f) FPR95 on ImageNet Figure 2: Parameter sensitivity analysis. For each ID dataset, we report the average results over multiple OOD datasets. We use DenseNet-101 [27] for CIFAR and ResNet-50 [28] for ImageNet. Table 5: Role of adaptively adjusted strategy. We use DenseNet-101 [27] for CIFAR. ID Strategy CIFAR-10 CIFAR-100 assign α, β assign ηα, ηβ assign α, β assign ηα, ηβ Hyper-parameters OOD Performance α 0.50 – 0.50 – β 1.50 – 1.50 – ηα – 0.60 – 0.60 ηβ – 0.95 – 0.95 FPR95 ↓ 19.44 17.74 56.35 47.12 AUROC ↑ 96.34 96.47 86.09 90.21 also simulate suppression and amplification operations. Finally, our scoring function is defined as: m (cid:88) (z2 i − αvzi) + log −λv i=1 c (cid:88) i=1 eli. (17) Among all methods, ViM [36] is a powerful strategy that combines features and logit outputs. For a fair comparison with ViM, we use the same ID data (ImageNet), OOD data (OpenImage-O [36], Texture [12], iNaturalist [18], and ImageNet-O [37]), and network architecture (BiT [38]). Experimental results in Table 7 demonstrate that VRA++ achieves better performance than ViM, verifying the scalability and high potential of our method. Meanwhile, VRA++ generally achieves the best performance among all variants (see Table 8). These results further demonstrate the necessity of combining features and logit outputs in OOD detection. 5 Related Work Post-hoc Method Post-hoc strategies are an important branch of OOD detection. Due to their ease of implementation, they have attracted increasing attention from researchers. Among them, MSP [20] was the most basic post-hoc strategy, which directly leveraged the maximum value of the posterior distribution as the indicator. Since then, researchers have proposed various post-hoc approaches. For example, ODIN [21] used temperature scaling and input perturbations to improve the separability of ID and OOD data. Energy [23] replaced the softmax confidence score in MSP [20] with the theoretically guaranteed energy score. Mahalanobis [22] used the minimum distance from the 8 Table 6: Compatibility with different backbones. All methods are pretrained on ImageNet. Energy ReAct+Energy VRA+Energy MSP FPR95 ↓ AUROC ↑ FPR95 ↓ AUROC ↑ FPR95 ↓ AUROC ↑ FPR95 ↓ AUROC ↑ Backbone ResNet-18 [28] ResNet-34 [28] ResNet-50 [28] ResNet-101 [28] ResNet-152 [28] VGG-16 [32] VGG-16-BN [32] EfficientNetV2 [33] RegNet [34] MobileNetV3 [35] 69.70 68.84 66.95 64.70 61.35 67.94 65.92 57.57 65.37 67.99 80.61 81.19 81.99 82.47 83.74 81.60 82.00 83.96 82.85 82.14 58.59 57.20 58.40 54.84 50.39 54.33 50.49 75.29 59.46 60.49 80.40 86.84 86.17 87.29 88.61 88.17 89.03 71.10 85.51 87.80 36.36 32.23 31.43 31.68 26.57 67.81 59.02 48.28 34.65 60.72 92.17 93.08 92.95 93.03 94.22 83.68 86.34 88.01 92.53 87.82 34.87 30.63 25.49 25.80 22.21 32.99 35.12 43.81 26.18 56.65 92.58 93.46 94.57 94.36 95.20 92.59 92.05 89.76 94.55 89.30 Table 7: Performance of VRA++. All methods are based on BiT [38] and pretrained on ImageNet. Method MSP [20] ODIN [21] Mahalanobis [22] Energy [23] ReAct [8] ViM [36] VRA++ OpenImage-O FR. ↓ AU. ↑ 84.16 73.72 85.64 72.83 83.10 64.32 84.77 73.42 88.94 54.97 91.54 43.96 93.55 34.94 Texture FR. ↓ AU. ↑ 79.80 76.65 81.60 74.07 97.33 14.05 81.09 73.91 90.64 50.25 98.92 04.69 98.76 05.02 iNaturalist FR. ↓ AU. ↑ 87.92 64.09 86.73 70.75 85.70 64.95 84.47 74.98 91.45 48.60 89.30 55.71 96.37 22.25 ImageNet-O FR. ↓ AU. ↑ 57.12 96.85 63.00 96.85 80.37 70.05 63.59 96.40 67.07 91.70 83.87 61.50 84.21 60.45 Average FR. ↓ AU. ↑ 77.25 77.83 79.24 78.63 86.63 53.34 78.48 79.68 84.52 61.38 90.91 41.47 93.22 30.67 class centers to identify OOD data. KNN [24] was a nonparametric method that explored K-nearest neighbors. More recently, researchers have found that the reason behind model overconfidence in OOD data lies in abnormally high activations of a small number of neurons. To address this, Dice [10] used weight sparsification, while ReAct [8] exploited activation truncation. Different from these works, we further demonstrate that abnormally low activations also affect OOD detection performance. This motivates us to propose VRA to rectify the activation function. Activation Function Activation functions are an important part of neural networks [39, 40]. Previ- ously, researchers found that neural networks with the ReLU activation function produced abnormally high activations for inputs far from the training data, harming the reliability of deployed systems [41]. To address this problem, ReAct used a truncation operation to rectify activation functions. In this paper, we propose a more powerful rectified activation function for OOD detection. Experimental results on multiple benchmark datasets demonstrate the effectiveness of our method. Variational Method The variational method is often used to solve for the functional extreme value. Its most famous application in neural networks is the variational autoencoder [42], which solves for the functional extreme value by trading off reconstruction loss and Kullback–Leibler divergence. It has also been applied to other complex scenarios [43] and multimodal tasks [44]. In this paper, we use the variational method to find the operation that can maximize the gap between ID and OOD. 6 Conclusion This paper proposes a post-hoc OOD detection strategy called VRA. From the perspective of the variational method, we find the theoretically optimal operation for maximizing the gap between ID and OOD. This operation reveals the necessity of suppressing abnormally low and high activations and amplifying intermediate activations in OOD detection. Therefore, we propose VRA to mimic these suppression and amplification operations. Experimental results show that our method outper- forms existing post-hoc strategies and is compatible with different scoring functions and network architectures. In the ideal case of knowing a small fraction of OOD samples, we can achieve near- perfect performance, demonstrating the strong potential of our method. Meanwhile, we verify the effectiveness of our adaptively adjusted strategy and reveal the impact of different hyper-parameters. 9 Table 8: Comparison of VRA variants. "Net1" and "Net2" refer to ResNet-50 and ResNetv2-101. Method VRA VRA+ VRA++ CIFAR-10 CIFAR-100 ImageNet (Net1) ImageNet (Net2) FPR95 ↓ AUROC ↑ FPR95 ↓ AUROC ↑ FPR95 ↓ AUROC ↑ FPR95 ↓ AUROC ↑ 17.74 15.89 15.52 96.47 96.90 96.87 47.12 43.31 35.20 90.21 90.61 91.80 25.49 23.32 18.63 94.57 94.96 95.75 34.95 30.85 25.92 93.34 93.78 94.60 In this paper, we treat maxg Ein[g(z)] − Eout[g(z)] as the core objective function derived from ReAct and ming Ein[(g(z) − z)2] as the regularization term. However, there may be better regularization terms that can not only guarantee the existence of the optimal solution but also ensure that the expression of the optimal solution is easy to implement and has good interpretability. Therefore, we will explore other regularization terms for OOD detection. Meanwhile, this paper uses simple piecewise functions to approximate the complex optimal operation. In the future, we will explore other functional forms that can better describe the optimal operation. We will also conduct an in-depth analysis to reveal the impact of BatchNorm and different backbones on OOD detection. 10 References [1] Jingkang Yang, Pengyun Wang, Dejian Zou, Zitang Zhou, Kunyuan Ding, Wenxuan Peng, Haoqi Wang, Guangyao Chen, Bo Li, Yiyou Sun, Xuefeng Du, Kaiyang Zhou, Wayne Zhang, Dan Hendrycks, Yixuan Li, and Ziwei Liu. Openood: Benchmarking generalized out-of-distribution detection. In Proceedings of the Thirty-sixth Conference on Neural Information Processing Systems Datasets and Benchmarks Track, pages 1–14, 2022. [2] Alexander Amini, Ava Soleimany, Sertac Karaman, and Daniela Rus. Spatial uncertainty sampling for end-to-end control. arXiv preprint arXiv:1805.04829, 2018. [3] Tanya Nair, Doina Precup, Douglas L Arnold, and Tal Arbel. Exploring uncertainty measures in deep networks for multiple sclerosis lesion detection and segmentation. In Proceedings of the Medical Image Computing and Computer Assisted Intervention, MICCAI, pages 655–663, 2018. [4] Rui Huang and Yixuan Li. Mos: Towards scaling out-of-distribution detection for large semantic space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8710–8719, 2021. [5] Xuefeng Du, Zhaoning Wang, Mu Cai, and Yixuan Li. Vos: Learning what you don't know In Proceedings of the International Conference on Learning by virtual outlier synthesis. Representations, pages 1–21, 2022. [6] Qing Yu and Kiyoharu Aizawa. Unsupervised out-of-distribution detection by maximum classifier discrepancy. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9518–9526, 2019. [7] Jingkang Yang, Haoqi Wang, Litong Feng, Xiaopeng Yan, Huabin Zheng, Wayne Zhang, and Ziwei Liu. Semantically coherent out-of-distribution detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 8301–8309, 2021. [8] Yiyou Sun, Chuan Guo, and Yixuan Li. React: Out-of-distribution detection with rectified activations. In Proceedings of the Advances in Neural Information Processing Systems, pages 144–157, 2021. [9] Christopher M Bishop. Pattern recognition and machine learning. Springer, 2006. [10] Yiyou Sun and Yixuan Li. Dice: Leveraging sparsification for out-of-distribution detection. In Proceedings of the European Conference on Computer Vision, pages 691–708, 2022. [11] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. [12] Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3606–3613, 2014. [13] 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, pages 1–9, 2011. [14] Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(6):1452–1464, 2017. [15] Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. [16] Pingmei Xu, Krista A Ehinger, Yinda Zhang, Adam Finkelstein, Sanjeev R Kulkarni, and Jianxiong Xiao. Turkergaze: Crowdsourcing saliency with webcam based eye tracking. arXiv preprint arXiv:1504.06755, 2015. 11 [17] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 248–255, 2009. [18] Grant Van Horn, Oisin Mac Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard, Hartwig Adam, Pietro Perona, and Serge Belongie. The inaturalist species classification and detection dataset. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8769–8778, 2018. [19] Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3485–3492, 2010. [20] Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. In Proceedings of the International Conference on Learning Representations, pages 1–12, 2017. [21] Shiyu Liang, Yixuan Li, and R Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. In Proceedings of the 6th International Conference on Learning Representations, pages 1–27, 2018. [22] Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Proceedings of the Advances in Neural Information Processing Systems, pages 7167–7177, 2018. [23] Weitang Liu, Xiaoyun Wang, John Owens, and Yixuan Li. Energy-based out-of-distribution detection. In Proceedings of the Advances in Neural Information Processing Systems, pages 21464–21475, 2020. [24] Yiyou Sun, Yifei Ming, Xiaojin Zhu, and Yixuan Li. Out-of-distribution detection with deep nearest neighbors. In Proceedings of the International Conference on Machine Learning, pages 20827–20840, 2022. [25] Jinsong Zhang, Qiang Fu, Xu Chen, Lun Du, Zelin Li, Gang Wang, Shi Han, and Dongmei Zhang. Out-of-distribution detection based on in-distribution data patterns memorization with modern hopfield energy. In Proceedings of the Eleventh International Conference on Learning Representations, pages 1–19, 2023. [26] Hubert Ramsauer, Bernhard Schäfl, Johannes Lehner, Philipp Seidl, Michael Widrich, Lukas Gruber, Markus Holzleitner, Thomas Adler, David Kreil, Michael K Kopp, Günter Klambauer, Johannes Brandstetter, and Sepp Hochreiter. Hopfield networks is all you need. In Proceedings of the International Conference on Learning Representations, pages 1–95, 2021. [27] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4700–4708, 2017. [28] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for im- age recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016. [29] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: an imperative style, high-performance deep learning library. In Proceedings of the 33rd International Conference on Neural Information Processing Systems, pages 8026–8037, 2019. [30] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the International Conference on Machine Learning, pages 448–456, 2015. [31] Yeonguk Yu, Sungho Shin, Seongju Lee, Changhyun Jun, and Kyoobin Lee. Block selection method for using feature norm in out-of-distribution detection. arXiv preprint arXiv:2212.02295, 2022. 12 [32] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [33] Mingxing Tan and Quoc Le. Efficientnetv2: Smaller models and faster training. In Proceedings of the International Conference on Machine Learning, pages 10096–10106, 2021. [34] Ilija Radosavovic, Raj Prateek Kosaraju, Ross Girshick, Kaiming He, and Piotr Dollár. Design- ing network design spaces. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10428–10436, 2020. [35] 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. [36] Haoqi Wang, Zhizhong Li, Litong Feng, and Wayne Zhang. Vim: Out-of-distribution with virtual-logit matching. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4921–4930, 2022. [37] Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15262–15271, 2021. [38] Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, and Neil Houlsby. Big transfer (bit): General visual representation learning. In Proceedings of the European Conference on Computer Vision, pages 491–507, 2020. [39] Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the International Conference on Machine Learning, pages 807–814, 2010. [40] Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016. [41] Matthias Hein, Maksym Andriushchenko, and Julian Bitterwolf. Why relu networks yield high-confidence predictions far away from the training data and how to mitigate the problem. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 41–50, 2019. [42] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In Proceedings of the International Conference on Learning Representations, pages 1–14, 2014. [43] Bing Yu et al. The deep ritz method: a deep learning-based numerical algorithm for solving variational problems. Communications in Mathematics and Statistics, 6(1):1–12, 2018. [44] Gaurav Pandey and Ambedkar Dukkipati. Variational methods for conditional multimodal deep learning. In Proceedings of the International Joint Conference on Neural Networks (IJCNN), pages 308–315, 2017. 13
http://arxiv.org/abs/2302.11715v2
2023-06-28T22:19:13
2023-02-23T00:43:03
Variable Importance Matching for Causal Inference
Our goal is to produce methods for observational causal inference that are auditable, easy to troubleshoot, accurate for treatment effect estimation, and scalable to high-dimensional data. We describe a general framework called Model-to-Match that achieves these goals by (i) learning a distance metric via outcome modeling, (ii) creating matched groups using the distance metric, and (iii) using the matched groups to estimate treatment effects. Model-to-Match uses variable importance measurements to construct a distance metric, making it a flexible framework that can be adapted to various applications. Concentrating on the scalability of the problem in the number of potential confounders, we operationalize the Model-to-Match framework with LASSO. We derive performance guarantees for settings where LASSO outcome modeling consistently identifies all confounders (importantly without requiring the linear model to be correctly specified). We also provide experimental results demonstrating the method's auditability, accuracy, and scalability as well as extensions to more general nonparametric outcome modeling.
[ "Quinn Lanners", "Harsh Parikh", "Alexander Volfovsky", "Cynthia Rudin", "David Page" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11715v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11715v2", "@rel": "related", "@type": "application/pdf" } ]
[ "Proceedings of the Thirty-Ninth Conference on Uncertainty in\n Artificial Intelligence, PMLR 216:1174-1184, 2023" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ME", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ME", "cs.LG", "econ.EM" ]
Variable Importance Matching for Causal Inference 3 2 0 2 n u J 8 2 ] E M . t a t s [ 2 v 5 1 7 1 1 . 2 0 3 2 : v i X r a Quinn Lanners1 Harsh Parikh2 Alexander Volfovsky3 Cynthia Rudin2 David Page1 1Dept. of Biostatistics, Duke University, Durham, NC, USA. 2Dept. of Computer Science, Duke University, Durham, NC, USA. 3Dept. of Statistical Science, Duke University, Durham, NC, USA. Abstract Our goal is to produce methods for observational causal inference that are auditable, easy to trou- bleshoot, accurate for treatment effect estimation, and scalable to high-dimensional data. We describe a general framework called Model-to-Match that achieves these goals by (i) learning a distance met- ric via outcome modeling, (ii) creating matched groups using the distance metric, and (iii) using the matched groups to estimate treatment effects. Model-to-Match uses variable importance mea- surements to construct a distance metric, making it a flexible framework that can be adapted to vari- ous applications. Concentrating on the scalability of the problem in the number of potential con- founders, we operationalize the Model-to-Match framework with LASSO. We derive performance guarantees for settings where LASSO outcome modeling consistently identifies all confounders (importantly without requiring the linear model to be correctly specified). We also provide experimen- tal results demonstrating the method's auditability, accuracy, and scalability as well as extensions to more general nonparametric outcome modeling. 1 INTRODUCTION Matching methods are a popular approach to causal infer- ence on observational data due to their conceptual simplicity. These methods aim to emulate randomized controlled trials by pairing similar treated and control units, thus allowing for treatment effect estimation [Stuart, 2010]. One significant benefit of using matching methods is their auditability along with their accuracy. An auditable method allows domain experts to validate the estimation procedure, argue about the violation of key assumptions, and determine whether the analysis is trustworthy. Since causal analyses often de- pend on untestable assumptions, it is critical to determine whether all important confounders are accounted for, if data are processed correctly, and whether the treatment and con- trol units in the matched groups are cohesive enough to be comparable [Parikh et al., 2022b]. Parikh et al. [2022a] and Yu et al. [2021] showed that the audit of matched groups using external unstructured data is crucial in healthcare and social science scenarios. In high-stakes scenarios, audibility enables domain experts to make data-driven and trustworthy decisions and policies. We would ideally be able to match units that are exactly identical to one another except for treatment assignments [Rosenbaum and Rubin, 1983]. However, exact matches are almost impossible in high-dimensional settings with con- tinuous covariates [Parikh et al., 2022c]. In such scenarios, we aim to create almost-exact matches on important covari- ates. The question then becomes how to construct a distance metric between units that determines who should be in a unit's matched group. We want to learn a distance metric that provides accurate causal estimates, ensures auditability so we can evaluate and troubleshoot, and is scalable to large observational datasets that might be used for high-stakes policy decisions. We introduce the Model-to-Match framework which uses variable importance from prognostic score models to learn a distance metric. The framework has three steps. First, we use machine learning to estimate outcomes and use the mea- sured variable importance to construct a distance metric. Second, we use the learned distance metric to match treat- ment and control units into matched groups. Third, we use the matched groups to estimate conditional average treat- ment effects (CATEs). Our research focuses on the first step in this framework, as learning a good distance metric is an essential but difficult step to ensure that matching yields accurate treatment estimates. A special case of our framework is called LCM – LASSO Coefficient Matching. LCM has the characteristics we desire. It is able to accurately estimate treatment effects, creates Accepted for the 39th Conference on Uncertainty in Artificial Intelligence (UAI 2023). almost-exact matched groups, and scales better than other comparable methods by orders of magnitude. LCM uses LASSO (Least Absolute Shrinkage and Selection Operator) coefficients to identify important variables and then uses K-nearest neighbors to construct matched groups. LCM benefits from both the efficiency of parametric models and the power of nonlinear modeling by leveraging a parametric method to learn which features to match on and then a nonparametric approach for treatment effect estimation. It is simple to implement yet works extremely well. We perform extensive empirical studies to compare LCM's performance with existing methods. Our results demonstrate that LCM can accurately and efficiently recover true treatment effects even in high-dimensional and non-linear setups without compromising auditability (Section 6). We further propose adaptations of our framework such as (a) metalearner LCM, (b) feature importance matching using decision trees, and (c) LCM-augmented-prognostic scores that work well in complex scenarios (Section 7). 2 BACKGROUND AND ASSUMPTIONS We study the setting where every individual i in the popula- tion S is assigned to one of the two treatments Ti ∈ {0, 1}. Under the stable unit treatment value assumption (SUTVA), we define the potential outcomes of individual i as Yi(0) and Yi(1). We consider an i.i.d sample of n individuals, Sn, where for each individual i we observe a p-dimensional pre-treatment covariate vector Xi, an assigned treatment Ti, and an observed outcome Yi = Yi(1)Ti + Yi(0)(1 − Ti). The individualized treatment effect is defined as τi := Yi(1) − Yi(0). Since we observe only one of the poten- tial outcomes for each unit, τi is not observed for any of the units. We need to impute the missing potential outcomes to estimate the treatment effects of interest [Rubin, 2011]. In our setup, we are interested in identifying (a) conditional average treatment effects (CATEs) τ (x) := E [τi | Xi = x] for all x ∈ Dom(X), and (b) the average treatment effect (ATE) τ := E [τi]. In observational data (where the treatments are not ran- domized), the treatment choice and potential outcomes can depend on common variables, which are referred to as con- founders. In our setup, we assume that the set of confounders is a subset of the set of pre-treatment covariates, and poten- tial outcomes and treatment assignment are conditionally independent given X: (Yi(1), Yi(0)) ⊥ Ti | Xi. This is referred to as conditional ignorability [Rubin, 1974]. Lastly, we assume that the probability of a unit receiving treatment t is bounded away from 1 and 0: 0 < P (Ti = t | Xi = x) < 1. This is referred to as the positivity assumption. Combin- ing the positivity and conditional ignorability assumptions, adjusting for pre-treatment covariates (X) is sufficient to identify CATEs and ATE. Matching Methods. Matching methods use a distance- metric, dM, on X to group similar units with different treat- ment assignments in order to estimate the causal effects of treatment T on outcome Y . The most popular matching tech- niques are propensity score matching (PSM) [Rosenbaum and Rubin, 1983] and prognostic score matching (PGM) [Hansen, 2008b]. These techniques project the data to a lower dimensional propensity or prognostic score, which are then used for matching. These projections can be sen- sitive to modeling choices that affect the accuracy of the treatment effect estimates [Kreif et al., 2016]. Further, the units within a matched group can be far from each other in covariate space – i.e., the matched groups are generally not auditable [Parikh et al., 2022c]. To date, the only ob- servational causal inference techniques that attempt to opti- mize accuracy while maintaining auditability are those stem- ming from the almost-matching-exactly (AME) framework, namely the optimal matching (optMatch) [Yu et al., 2021, Kallus, 2017], genetic matching (GenMatch) [Diamond and Sekhon, 2013], FLAME/DAME [Wang et al., 2017, Dieng et al., 2019], MALTS [Parikh et al., 2022c, 2019, 2022a] and AHB [Morucci et al., 2020] algorithms. FLAME/DAME can scale to extremely large datasets but handles only cate- gorical variables. GenMatch, MALTS, and AHB can also handle both continuous and categorical variables but do not scale as well, thereby limiting their usefulness (see Figure 3 in Section 6). What we develop is a method that yields accu- rate treatment effect estimates and is auditable like MALTS but can scale to much larger datasets and run at a fraction of the time. Formally, for a unit i, the K-nearest neighbors of units with treatment t′ and the corresponding matched group MGdM(Xi) are defined as KNNdM(Xi, t′) := (cid:20) dM(Xi, Xj) < dM(Xi, Xk) (cid:21) < K    ,    (cid:88) k : 1 j∈S (t′ ) n MGdM(Xi) := (cid:91) t′∈{0,1} KNNdM (Xi, t′) , n where S (t′) := {j : Tj = t′} represents the set of units is t′. Match groups can whose treatment assignment then be used to estimate potential outcomes, (cid:98)Yi(t′) = ψ (KNNdM(Xi, t′)), where ψ is a function of the outcomes of the K-nearest neighbors (e.g. arithmetic mean). As we will see, a high quality distance metric is key to creating accurate estimates. A good distance metric can lead to in- terpretable matched groups and accurate treatment effect estimates; a poor distance metric leads to neither. Non-matching Methods. There are a number of non- matching frameworks that can estimate conditional average treatment effects. Regression methods, particularly doubly robust regression methods, are often used to estimate CATEs [Farrell, 2015]. However, their performance is highly sensi- tive to model misspecification, requiring either the propen- sity or outcome model to be correctly specified. Machine learning methods are also popular for estimating CATEs. The most commonly used machine learning methods in- clude Bayesian additive regression trees (BART) [Hahn et al., 2019], double machine learning [Chernozhukov et al., 2017], and generalized random forests [Athey et al., 2019]. While these methods can accurately estimate CATEs, they are often significantly less interpretable than matching meth- ods and are not auditable. Additionally, previous almost- matching-exactly literature has shown that AME methods achieve similar CATE estimation accuracy to machine learn- ing approaches while maintaining auditability Parikh et al. [2022c], Morucci et al. [2020], Wang et al. [2017]. For these reasons, in this paper we focus on comparing LCM to other matching methods and AME methods in particu- lar. We include an experiment comparing LCM to machine learning methods on a high-dimensional quadratic dataset in the Supplementary Material. 3 MODEL-TO-MATCH FRAMEWORK We propose a framework, called Model-to-Match, that fo- cuses on combining prognostic score modeling with distance metric learning for almost-exact matching. Our framework is divided into three steps: (i) learning the weight matrix M of a distance metric dM using a machine learning model, (ii) creating matched groups using the learned dM, and (iii) estimating treatment effects using the matched groups. In our framework, we restrict ourselves to binary and con- tinuous pre-treatment covariates. As such, all categorical covariates are dummified in the data preprocessing steps. We let p indicate the dimensionality of the final covariate space after preprocessing. This facilitates the use of more feature-importance methods (such as LASSO) and allows the feature space to be more finely weighted. We choose our distance metric, dM, such that for any X1 and X2, dM(X1, X2) = ∥MX1 − MX2∥m. M is a p × p matrix and the m in ∥ * ∥m is flexible and can be any positive integer. To learn a distance metric in our Model-to-Match framework we first train two machine learning models f (0) and f (1), such that for any i ∈ Sn, (cid:98)Yi(t′) = f (t′)(Xi). For each j ∈ {1, 2, . . . , p} we then calculate θj, the importance of covariate X*,j to f (0) and f (1). Variable Importance Example 1: If the f 's are linear estima- tors, such as LASSO or Ridge where f (t) β(t) = Xβ(t), then |β(t′ ) | j ∥β(t′ )∥1 θj can be (cid:80) . t′∈{0,1} Variable Importance Example 2: If the f 's are decision trees then θj can be measured via Gini importance, feature permutation importance, or a similar feature importance metric. Variable Importance Example 3: For f 's from backward elimination with ordinary least squares, θj can be equal to the drop in R2 when the j-th feature X*,j is removed. Variable Importance Example 4: For any generic model class, θj can be measured via subtractive model reliance, which measures the change in the loss of a model when a covariate is perturbed [Fisher et al., 2019]. We then set all the diagonal entries, Mj,j, in the distance metric M to be equal to |θj| and all the non-diagonal entries in M to zero. By constructing M in this way we can inter- pret each weight, Mj,j, as the relative feature importance of covariate X*,j. We are interested in having an M that is sparse so that we only match on the important covariates. Further, we want the estimation of f 's to be scalable in both the number of samples and the number of covariates. Keeping these requirements in mind, we use l1-regularized regression, i.e., LASSO, as the modeling method of choice for the majority of this paper. However, our framework is general and can be applied to any supervised model class. For example, we discuss using shallow regression trees to model the f 's in Section 7. In practice, LASSO performs well for this step of the framework. 4 LINEAR COEFFICIENT MATCHING In this section, we operationalize the Model-to-Match frame- work using LASSO [Tibshirani, 1996] as the machine learn- ing algorithm for learning the distance metric and refer to this as LASSO Coefficient Matching (LCM). As in the example in Section 3, we use scaled absolute values of LASSO's coefficients as the diagonal entries for an M∗. Since LASSO's coefficients are sparse, the entries of M∗ will be sparse. This creates a distance metric dM∗ that pri- oritizes tighter matches on a small number of important co- variates, leading to faster runtimes and facilitating matched groups that are close in important covariates. We perform honest causal estimation for a given observed dataset Sn. Broadly, honest causal estimation means that we do not use the same data to learn about the control vari- ables as we do for inference [Ratkovic, 2019]. We achieve honesty by dividing the data into two disjoint subsets: Sn,tr and Sn,est. In Step (i), we use Sn,tr to estimate β's and, by consequence, learn dM∗ . Algorithm 1 describes our training step to learn M∗ using LASSO. In Step (ii), we then per- form matching with replacement using dM∗ to get matched groups, MGdM∗ (Xi), for each unit i ∈ Sn,est. In Step (iii), we use MGdM∗ (Xi) to estimate the CATE for X = Xi as (cid:98)τ (Xi) = (cid:98)Yi(1) − (cid:98)Yi(0) where (cid:98)Yi(t′) = (cid:80) (cid:80) k∈MGdM∗ (Xi) k∈MGdM∗ (Xi) 1[Tk = t′]Yk 1[Tk = t′] Data: Dataset Sn,tr Result: Distance metric M∗ begin W ← [0, ..., 0] ∈ Rp (Loop over treatment possibilities.) for t′ in {0, 1} do (Find units that have treatment t′.) S (t′) n,tr ← {i ∈ Sn,tr : Ti = t′} (Run LASSO to get coefficients.) ˆβ(t′) ← minβ∈Rp λ∥β∥1 + (cid:80) i∈S (t′) n,tr (Yi − Xiβ)2 (Average the element wise absolute values of the coefficients across treatment and control.) for l in {1, ..., p} do Wl ← Wl + | ˆβ(t′ ) | l ∥ ˆβ(t′ )∥1 end end (Coefficients used as stretches in distance metric.) M∗ ← 0p×p for l in {1, ..., p} do l,l ← 1 M∗ 2 Wl end end Algorithm 1: Algorithm to estimate M∗ using LASSO Since we perform honest causal inference where we do not use the same data to learn dM∗ as we do for estimat- ing CATEs, our method performs η-fold cross-fitting by swapping the training set each time. This is similar to the strategy used in Chernozhukov et al. [2018] and enables the estimation of CATEs for all i ∈ Sn. Because LASSO does not need many observations to fit the data well, we use only one of the η splits as the training set and the data in the remaining (1 − η) splits as the estimation set. Using a smaller amount of data in the learning step allows us to cre- ate match groups with a larger portion of the data. Because the nearest neighbor-based estimation in Step (iii) is local and non-parametric, more data will improve the quality of matched groups and the accuracy of the CATEs. For matching we employ the Manhattan distance to align with the additive linear form and ∥ * ∥1 regularization of LASSO. In particular, for all i, j ∈ Sn,est, dM∗ (Xi, Xj) = p (cid:80) l,l|Xi,l − Xj,l|. Our method has three hyperparame- l=1 ters: η, λ, and K. We learn λ using cross-validation in our training in Step (i). The number of nearest neighbors, K, M∗ and the number of splits for cross-fitting, η, can be chosen through cross-validation or set manually. . 5 THEORETICAL RESULTS Here, we prove optimality properties of using LASSO to learn our distance metric. We then show under what con- ditions LCM guarantees consistency in CATE estimation. Proofs are included in the Supplementary Materials. Theorem 5.1 motivates LCM. It shows that if the potential outcomes are linear in the predictors then using the absolute values of the coefficients in these models as the stretches in a distance metric guarantees that as the distance between two units decreases, their expected outcomes become closer. Theorem 5.1. [Closeness in X implies closeness in Y ]. Consider a p-dimensional covariate space where for t′ ∈ {0, 1}, f (t′)(Xi) = E[Yi|X = Xi, T = t′] = Xiβ(t′). Construct M ∈ Rp×p where for all l, r ∈ {1, ..., p} Ml,l = |β(t′) | and for l ̸= r Ml,r = 0. Then, ∀i, j, we have that dM(Xi, Xj) ≥ (cid:12) (cid:12) (cid:12)f (t′)(Xi) − f (t′)(Xj) (cid:12) (cid:12) (cid:12). l From here, we define a diagonal Mahalanobis distance ma- trix as any (cid:102)M ∈ Rp×p that is diagonal (for all l, r ∈ {1, ..., p}, l ̸= r, (cid:102)Ml,r = 0) and has non-negative entries ( (cid:102)Ml,l ≥ 0). We show in Theorem 5.2 that the M from Theorem 5.1 is the optimal stretch matrix, compared to any other equally scaled diagonal Mahlanobis distance matrix, in regards to the maximum absolute difference in expected outcomes. Theorem 5.2. [Optimality of M] Using the setup of The- orem 5.1, let supp(X) = Rp. Consider an arbitrary di- agonal Mahalanobis distance matrix (cid:102)M ∈ Rp×p where p |β(t′) (cid:80) | > 0. l l=1 For some ε ≥ 0 and X1 ∈ Rp, define S X2 ∈ Rp, d | and (cid:102)Ml,l > 0 when |β(t′) (cid:102)M,ε(X1) := {X2 : (cid:102)M(X1, X2) = ε}. Then, | (cid:102)Ml,l| = p (cid:80) l=1 l sup X2∈SM,ε(X1) |f (t′)(X1) − f (t′)(X2)| ≤ sup (cid:102)M,ε(X1) X3∈S |f (t′)(X1) − f (t′)(X3)|. These results show how a linear outcome model induces a meaningful distance metric for causal inference. The follow- ing theorem states that when we do not know the true value of the coefficients (and more generally when the model is non-linear but LASSO still recovers its support), we can employ the LCM procedure of Section 4 to generate a dis- tance metric that yields consistent estimates of CATEs. This theorem uses the notion of variable importance, as discussed in Section 3. Theorem 5.3. [Consistency of LCM] For t′ ∈ {0, 1}, let f (t′)(Xi) = E[Yi|X = Xi, T = t′]. Let f (t′) be Lipschitz continuous and, f (t′)(cid:17) (cid:110) j : importance of X*,j in f (t′) is > 0 supp := (cid:111) (cid:16) . Denote dM∗ as the distance metric learned by LCM in Sec- tion 4 and let Γ (M∗) = {j : M∗ j,j > 0}. LCM is consis- tent for CATE estimation if supp (cid:0)f (0)(cid:1) (cid:83) supp (cid:0)f (1)(cid:1) ⊆ Γ (M∗). This result follows from LASSO and its adaptations' ability to estimate sparse coefficient vectors in high dimensions, even when n < p [Meinshausen and Yu, 2009, Zhou, 2010, Wasserman and Roeder, 2009, Meinshausen and Bühlmann, 2006]. LASSO also exhibits consistency for feature selec- tion in some nonlinear settings [Zhang et al., 2016]. 6 EXPERIMENTAL RESULTS Our experiments focus on factors crucial in high-stakes causal inference. (i) Accuracy and Auditability: We com- pare LCM's matched groups to PGM's and highlight the importance of auditability. (ii) Nonlinear Outcomes: We study if LCM is sensitive to model misspecification and compare our results to linear PGM (which uses the same underlying prognostic model as LCM). (iii) Scalability: We compare LCM to existing AME algorithms in both runtime and estimation performance as both the number of observa- tions and the number of features increase. 6.1 ACCURACY AND AUDITABILITY Matching enables us to investigate whether a CATE is es- timated in a trustworthy manner by auditing the quality of the matched groups. We now highlight how LCM produces accurate estimates while matching tightly on important co- variates. We work with the ACIC 2018 Atlantic Causal In- ference Conference semi-synthetic dataset [Carvalho et al., 2019], which is based on data from the National Study of Learning Mindsets randomized trial [Yeager, 2015-2016]. The dataset contains 10,000 students across 76 schools. There are four categorical student-level covariates and one categorical and five continuous school-level covariates. Car- valho et al. [2019] constructed this semi-synthetic dataset by drawing covariates from the real experiment and then syn- thetically generating treatment assignments and outcomes. Details can be found in Carvalho et al. [2019]. We ran our method alongside linear PGM, computed using LASSO, and nonparametric PGM, computed using gradient boosted trees. All three methods recover ATE estimates that are close to the true value of 0.24 – LCM: 0.249, Linear PGM: 0.251, and Nonparametric PGM: 0.260, which are Figure 1: Closeness in important covariates for matched groups produced by LCM, linear PGM, and nonparamet- ric (NP) PGM. (a) shows the mean absolute difference be- tween a query unit and its matched group's covariate values. Smaller values imply better and tighter matches. (b) shows, for a random sample, the four nearest neighbors of opposite treatment under LCM, linear PGM, and NP PGM. In (b), the text in red indicates values that are far from the query unit's value. S3 indicates the self-reported prior achievements of students and is important for selection into treatment, and X1 indicates school-level average mindset score of the stu- dents and is an effect modifier. also in line with the estimates of other interpretable and uninterpretable methods described in Carvalho et al. [2019]. While all three methods accurately estimate the ATE, only LCM matches almost exactly on important covariates. We compare how tightly LCM, linear PGM, and nonparametric PGM fit on a covariate that is identified as important for se- lection into treatment (S3) and one that is an effect modifier (X1). Figure 1 shows that LCM matches tighter on impor- tant covariates than PGM. In this way, LCM more closely emulates exact-matching and results in more intuitive and auditable match groups. The fact that LCM accurately esti- mates the treatment effect and matches so tightly on these important covariates increases the trust we have in our con- clusions. We expand on these findings and show that LCM matches tighter across all the effect modifiers in the Supple- mentary Material. 6.2 NONLINEAR OUTCOMES We have shown that linear prognostic score matches are not tight on important covariates, leading to unintuitive matched groups. However, LASSO estimated prognostic scores are more interpretable than scores estimated with gra- dient boosted trees. This interpretability comes at a cost: the performance of linear PGM heavily depends on the linearity of the underlying data generation process. LCM is more and CATE estimation accuracy. We omit FLAME/DAME [Wang et al., 2017, Dieng et al., 2019] from this comparison since it can only handle discrete covariates. We generate synthetic datasets of various sizes from the quadratic data generation process described in Parikh et al. [2022c] and the Supplementary Materials. We first measure the runtime scalability of LCM, MALTS, GenMatch, and AHB with respect to the number of samples, n, and number of covariates, p. To measure scaling runtime in n, we keep the number of covariates constant at 64 and increase the number of samples from 256 to 8192. To measure scaling in p, we set the number of samples to be 2048 and vary the number of covariates from 8 to 1024. The Supplemen- tary Materials contain further information on how runtimes were measured. Figure 3 shows the runtimes for each of the AME algorithms on these various dataset sizes, high- lighting the multiple-order-of-magnitude runtime disparity between LCM and other AME methods. MALTS ran out of memory (16GB RAM) for the largest dataset in each plot. We stopped increasing the dataset sizes for AHB when its runtime surpassed the longest measured runtime of all other methods. As discussed in Section 4, LASSO is capable of recover- ing sparse βs and important features in high dimensional settings. Naturally, LCM also excels at producing accu- rate CATE estimates as the number of irrelevant covariates grows. Figure 4 shows how LCM is robust to added noise as the number of unimportant covariates grows – unlike MALTS and GenMatch, which struggle to learn an accurate distance metric as the dimensionality of the covariate space increases. Here, we keep the number of important covariates equal to 8. 7 MODEL-TO-MATCH ADAPTATIONS In this section, we propose three adaptations of the Model- to-Match framework that extend LCM. The first approach uses a metalearner variant of LCM and shows improve- ment in CATE estimation in certain settings. The second adaptation proposes the use of a tree-based outcome mod- eling approach in place of LASSO. The third adaptation combines prognostic score matching with LCM to yield accurate CATEs and tight match groups. Figure 2: CATE estimation accuracy of LCM and Linear PGM on nonlinear synthetically generated datasets Sine and Exponential. The y-axis is the absolute CATE estimation error relative to the true ATE. robust to nonlinear data because its LASSO component is used only to determine the relative weight of features in the distance metric (not to model the outcome with a linear combination of the covariates). We compare CATE estimation accuracy of LCM and linear PGM on two synthetically generated datasets where the outcome is a non-linear function of the covariates. We call these datasets Sine and Exponential to align with their underlying potential outcome functions. We generate 5000 samples and 100 covariates for each dataset. For Sine, the outcome function is Yi = sin(Xi,1) − Ti sin(Xi,2). Whereas, for Exponential, the outcome function is Yi = 2eXi,1 − 3 (cid:88) j=2 eXi,j + TieXi,4 . We outline the specific details of the data generation pro- cesses in the Supplementary Material. Figure 2 shows that LCM is more robust to nonlinear outcome functions than linear PGM. Again, the superior performance of LCM is unsurprising because it performs nonlinear estimation in Step (iii), using the linear LASSO method in Step (i) only to pinpoint im- portant covariates upon which nonlinear estimation can be successfully performed. 7.1 METALEARNER LCM 6.3 SCALABILITY Existing almost-matching-exactly methods learn covariate weights and/or create match groups through computation- ally expensive and data hungry optimization algorithms. In this section we compare LCM to MALTS [Parikh et al., 2022c], GenMatch [Diamond and Sekhon, 2013], and AHB [Morucci et al., 2020] in regards to scalability in runtime Metalearners leverage powerful regression tools for estimat- ing heterogenous treatment effects [Künzel et al., 2019]. LASSO Coefficient Matching can be adapted to run similar to the T-learner outlined in Künzel et al. [2019] by learning separate distance metrics for control and treated units. The metalearner adaptation of LCM is advantageous when cer- tain covariates have vastly different effects on the outcome Figure 5: Absolute CATE estimation error relative to the true ATE for various methods on the Sine data generation process. The transparent boxes separate the methods into dif- ferent categories. Green: Almost exact matching methods. Yellow: Other matching methods. Red: TLearner methods. Figure 3: Scalability in n and p for LCM, MALTS, Gen- Match, and AHB. depending on if a sample received treatment or not. For Metalearner LCM, we learn a separate distance met- ric, dM(t′ )∗ , for each t′ ∈ {0, 1}. Specifically, for l, r ∈ {1, . . . , p} we set M(t′)∗ l,l = | ˆβ(t′) , where ˆβ(t′) = minβ∈Rp λ∥β∥1 +(cid:80) l,r = 0 when l ̸= r. In Step (ii), for each unit i ∈ Sn,est, we find K- nearest neighbors with replacement using the corresponding distance metric in each treatment arm. (Yi − Xiβ)2, and M(t′)∗ 1 ∥ ˆβ(t′ )∥1 i∈S (t′ ) n,tr | l To illustrate the advantage of the Metalearner LCM, we consider the same Sine data generation process used in Sec- tion 6.2. In Sine, covariate Xi,1 is important to the outcome under both treatment regimes (Yi(0) and Yi(1)) while co- variate Xi,2 is only relevant to the outcome under treatment (Yi(1)). We generate 500 samples and 10 covariates. We compare LCM to the previously used matching methods along with linear and nonparametric T-Learners. Figure 5 shows estimated CATE errors for each method. Metalearner LCM improves upon LCM, which already outperforms other matching methods, and is comparable to T-Learners. Figure 6 shows how Metalearner LCM stretches the control and treatment response surfaces differently, whereas regular LCM learns a global metric that is a linear combination of the two treatment spaces. The Metalearner variant is more suitable for problems in which accurate CATE estimation is more important than emulating a randomized experiment. Figure 4: Absolute CATE estimation error relative to the true ATE for LCM, MALTS, and GenMatch as the number of covariates increases. Figure 6: Relative covariate weights averaged over the η- folds for LCM M∗, Metalearner LCM M(0)∗, and Met- alearner LCM M(0)∗. This shows that the Metalearner LCM's distance metrics are different between treatment and control groups. 7.2 FEATURE IMPORTANCE MATCHING LASSO can often find the important features, even if the true data generation process is nonlinear [Zhang et al., 2016]. However, in cases where it cannot, we can use any nonlin- ear method (decision tree, random forest, BART, AdaBoost, etc.) from which we can extract a measure of feature im- portance. These feature importance values can be used in place of LASSO coefficients in Algorithm 1 as weights for matching. We demonstrate this using shallow decisions trees as the model and Gini importance as the feature importance mea- sure [Menze et al., 2009]. We use a shallow decision tree to promote sparsity and to account for nonlinearities in the outcome space. We generate a dataset with 1000 samples and 10 covariates where only the first covariate is important: Yi(0) = X 2 i,1 + 10 + εi,y. A linear approach will not find this important covariate because it is symmetric around 0. The full data generation process is outlined in the Supplementary Material. Figure 7 shows that in this setting, the tree-based method creates more accurate CATE estimates than the LASSO method (LCM). i,1 + εi,y and Yi(1) = X 2 7.3 LCM-AUGMENTED-PGM As shown in Section 6.1, LCM produces tighter matched groups on important covariates than linear and non- parametric PGM. However, PGM sometimes can estimate CATEs more accurately while not producing tight matched groups. This might occur either when the parametric prog- nostic model is correctly specified or when there is a strong non-linear effect that a non-parametric prognostic score can model accurately. In such situations, we propose augment- ing PGM with LCM to guarantee tight matches and accurate Figure 7: Absolute CATE estimation error relative to the true ATE for LCM vs. the Model-to-Match framework with classification and regression decision tree (CART) as the model and Gini feature importance as the feature importance measure. Figure 8: Absolute CATE estimation error for linear LAP (blue), non-parametric LAP (orange) and LCM (green). CATE estimates. Our LCM-augmented-PGM (LAP) is a two stage procedure. In the first stage, we match using prog- nostic scores and create large matched groups. In the second stage, we match using the distance metric learned via LCM inside each PGM matched group. The first stage leverages the flexibility of outcome modeling and the second stage ensures tight matching on important covariates. We compare LCM and LAP using the quadratic data gen- eration process used in Section 6.3 and described in the Supplementary Material. We generate 5000 units and 20 covariates, of which the first 5 are important and the other 15 are irrelevant. Here, we first do 25 nearest neighbors matching with PGM and then perform 5 nearest neighbors matching using the LCM learned distance metric. Figure 8 shows that for this problem setup, both linear LAP and non- parametric LAP are more accurate than LCM. Further, Fig- ure 9 shows that the matches created using non-parametric LAP are almost equally as tight as LCM's matches on the 5 important covariates and do not prioritize matching on irrelevant covariates. 8 DISCUSSION AND CONCLUSION Model-to-Match is a fast, scalable, and auditable framework for observational causal inference. Unlike other almost- and implement our framework on large, real-world datasets such as electronic health records, genome studies, living standards measurement studies, etc. Acknowledgements We acknowledge funding from the National Science Foun- dation and Amazon under grant NSF IIS-2147061, and the National Institute on Drug Abuse under grant DA054994. Quinn Lanners thanks the National Science Foundation Arti- ficial Intelligence for Designing and Understanding Materi- als - National Research Traineeship (aiM-NRT) at Duke Uni- versity funded under grant DGE-2022040. Cynthia Rudin, Alexander Volfovsky and Harsh Parikh are supported by NSF grant DMS-2046880. Harsh Parikh is also partially support by Amazon Graduate Fellowship and NSF award IIS-1703431. Alexander Volfovsky is also supported by a National Science Foundation Faculty Early Career Develop- ment Award (CAREER: Design and analysis of experiments for complex social processes). References Susan Athey, Julie Tibshirani, and Stefan Wager. General- ized random forests. The Annals of Statistics, 47(2):1148 – 1178, 2019. Keith Battocchi, Eleanor Dillon, Maggie Hei, Greg Lewis, Paul Oka, Miruna Oprescu, and Vasilis Syrgkanis. EconML: A Python Package for ML- Based Heterogeneous Treatment Effects Estimation. https://github.com/py-why/EconML, 2019. Version 0.14.0. Carlos Carvalho, Avi Feller, Jared Murray, Spencer Woody, and David Yeager. Assessing treatment effect variation in observational studies: Results from a data challenge, 2019. URL https://arxiv.org/abs/1907.07592. Victor Chernozhukov, Denis Chetverikov, Mert Demirer, Esther Duflo, Christian Hansen, Whitney Newey, and James Robins. Double/debiased machine learning for treatment and causal parameters, 2017. Victor Chernozhukov, Denis Chetverikov, Mert Demirer, Esther Duflo, Christian Hansen, Whitney Newey, and James Robins. Double/debiased machine learning for treatment and structural parameters, 2018. Alexis Diamond and Jasjeet S. Sekhon. Genetic match- ing for estimating causal effects: A general multivariate matching method for achieving balance in observational studies. The Review of Economics and Statistics, 95(3): 932–945, 2013. Awa Dieng, Yameng Liu, Sudeepa Roy, Cynthia Rudin, Interpretable almost-exact and Alexander Volfovsky. Figure 9: Average standard deviation for each covariate in- side the matched groups for non-parametric LAP (NP LAP) and LCM. The smaller the standard deviation, the tighter the match on that covariate. The dataset has 20 covariates, but we only show 10 for ease of presentation. Note that X1-X5 are important and X6-X10 are unimportant. matching-exactly approaches, Model-to-Match can scale to large datasets and high-dimensional settings and is flexi- ble in regards to how the outcome space is modeled to learn a distance metric. We implemented Model-to-Match using LASSO as our machine learning algorithm of choice and refer to this as LCM. We show many desirable properties of LCM – including robustness to model misspecification and the ability to handle high-dimensional settings – and provide details on its consistency for CATE estimation. We provide additional experimental results in the Supplementary Mate- rial including further comparisons to non-matching CATE estimation methods and a simulation showing the advan- tage of LCM over equally weighted matching after feature selection. Limitations and Future Directions. Model-to-Match is for i.i.d. data and should be extended to situations with either network interference or time-series effects. Further- more, Model-to-Match is sensitive to the variable impor- tance metric choice – leading to confounding bias if the correct support is not recovered. While we introduce our framework for categorical treatments, we are working on extending its application to continuous treatment regimes. Other variations of Model-to-Match are easily possible. While we show sparse decision trees as a potential substi- tute to LASSO, any machine learning algorithm can be used. Furthermore, one can use other configurations in the match- ing and estimation steps of the framework, such as using a ∥ * ∥2 norm instead of ∥ * ∥1, employing a caliper match- ing method instead of K nearest neighbors, or choosing a different post-matching estimator instead of arithmetic aver- age for potential outcomes. This level of flexibility makes Model-to-Match a framework that can be adapted to a vari- ety of practical problems. In future work, we plan to both study the theory behind different Model-to-Match variations matching for causal inference. Proceedings of Machine Learning Research (Proceedings of AISTATS), 89:2445, 2019. Vincent Dorie, Hugh Chipman, Robert McCulloch, Ar- mon Dadgar, R Core Team, Guido U Draheim, Maarten Bosmans, Christophe Tournayre, Michael Petch, Rafael de Lucena Valle, et al. Package 'dbarts'. 2019. Max H. Farrell. Robust inference on average treatment effects with possibly more covariates than observations. Journal of Econometrics, 189(1):1–23, 2015. URL https://EconPapers.repec.org/RePEc: eee:econom:v:189:y:2015:i:1:p:1-23. Aaron Fisher, Cynthia Rudin, and Francesca Dominici. All models are wrong, but many are useful: Learning a vari- able's importance by studying an entire class of prediction models simultaneously. J. Mach. Learn. Res., 20(177): 1–81, 2019. P. Richard Hahn, Jared S. Murray, and Carlos Carvalho. Bayesian regression tree models for causal inference: regularization, confounding, and heterogeneous effects, 2019. Ben B. Hansen. The prognostic analogue of the propen- sity score. Biometrika, 95(2):481–488, 2008a. ISSN 00063444, 14643510. URL http://www.jstor. org/stable/20441477. Exactly Almost Matching ahb-r-package. com/almost-matching-exactly/ AHB-R-package, 2022. Lab. AME- https://github. Nicolai Meinshausen and Peter Bühlmann. High- dimensional graphs and variable selection with the lasso. The Annals of Statistics, 34(3), June 2006. doi: 10.1214/ 009053606000000281. URL https://doi.org/10. 1214/009053606000000281. Nicolai Meinshausen and Bin Yu. Lasso-type recov- ery of sparse representations for high-dimensional data. The Annals of Statistics, 37(1), February 2009. doi: 10.1214/07-aos582. URL https://doi.org/10. 1214/07-aos582. Bjoern H Menze, B Michael Kelm, Ralf Masuch, Uwe Him- melreich, Peter Bachert, Wolfgang Petrich, and Fred A Hamprecht. A comparison of random forest and its gini importance with standard chemometric methods for the feature selection and classification of spectral data. BMC bioinformatics, 10:1–16, 2009. Marco Morucci, Vittorio Orlandi, Sudeepa Roy, Cynthia Rudin, and Alexander Volfovsky. Adaptive hyper-box matching for interpretable individualized treatment effect estimation. In Conference on Uncertainty in Artificial Intelligence, pages 1089–1098. PMLR, 2020. Ben B Hansen. The prognostic analogue of the propensity score. Biometrika, 95(2):481–488, 2008b. Harsh Parikh. AME-pymalts. https://github.com/ almost-matching-exactly/MALTS, 2020. Daniel E Ho, Kosuke Imai, Gary King, and Elizabeth A Stuart. Matching as nonparametric preprocessing for re- ducing model dependence in parametric causal inference. Political analysis, 15(3):199–236, 2007. Nathan Kallus. A Framework for Optimal Matching for Causal Inference. In Aarti Singh and Jerry Zhu, edi- tors, Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, volume 54 of Pro- ceedings of Machine Learning Research, pages 372–381, Fort Lauderdale, FL, USA, 20–22 Apr 2017. Noémi Kreif, Susan Gruber, Rosalba Radice, Richard Grieve, and Jasjeet S Sekhon. Evaluating treatment effectiveness under model misspecification: A compar- ison of targeted maximum likelihood estimation with bias-corrected matching. Statistical Methods in Med- ical Research, 25(5):2315–2336, 2016. doi: 10.1177/ 0962280214521341. Harsh Parikh, Cynthia Rudin, and Alexander Volfovsky. An application of matching after learning to stretch (malts). Observational Studies, 5(2):118–130, 2019. Harsh Parikh, Kentaro Hoffman, Haoqi Sun, Sahar F. Zafar, Wendong Ge, Jin Jing, Lin Liu, Jimeng Sun, Aaron F. Struck, Alexander Volfovksy, Cynthia Rudin, and M. Brandon Westover. Effects of epileptiform ac- tivity on discharge outcome in critically ill patients: A retrospective cross-sectional study. 2022a. Harsh Parikh, Carlos Varjao, Louise Xu, and Eric Tchet- gen Tchetgen. Validating causal inference methods. In International Conference on Machine Learning, pages 17346–17358. PMLR, 2022b. Harsh Parikh, Alexander Volfovsky, and Cynthia Rudin. Malts: Matching after learning to stretch. Journal of Machine Learning Research, 23(240), 2022c. Sören R. Künzel, Jasjeet S. Sekhon, Peter J. Bickel, and Bin Yu. Metalearners for estimating heterogeneous treatment effects using machine learning. Proceedings of the Na- tional Academy of Sciences, 116(10):4156–4165, Febru- ary 2019. doi: 10.1073/pnas.1804597116. URL https: //doi.org/10.1073/pnas.1804597116. 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. Marc T. Ratkovic. Rehabilitating the regression : Honest and valid causal inference through machine learning. 2019. Paul R Rosenbaum and Donald B Rubin. The central role of the propensity score in observational studies for causal effects. Biometrika, 70(1):41–55, 1983. Donald B Rubin. Estimating causal effects of treatments in randomized and nonrandomized studies. Journal of educational Psychology, 66(5):688, 1974. Donald B Rubin. Causal inference using potential outcomes. Journal of the American Statistical Association, 2011. Elizabeth A Stuart. Matching methods for causal inference: A review and a look forward. Statistical Science, 25(1):1, 2010. Robert Tibshirani. Journal of Regression shrinkage and selec- the Royal Statis- tion via the lasso. tical Society: Series B (Methodological), 58(1):267– 288, January 1996. doi: 10.1111/j.2517-6161.1996. tb02080.x. URL https://doi.org/10.1111/j. 2517-6161.1996.tb02080.x. Tianyu Wang, Sudeepa Roy, Cynthia Rudin, and Alexander Volfovsky. FLAME: A fast large-scale almost match- ing exactly approach to causal inference. arXiv preprint arXiv:1707.06315, 2017. Larry Wasserman and Kathryn Roeder. High-dimensional variable selection. The Annals of Statistics, 37(5A), Oc- tober 2009. doi: 10.1214/08-aos646. URL https: //doi.org/10.1214/08-aos646. David S. Yeager. The national study of learning mindsets [united states]. 2015-2016. URL https://doi.org/ 10.3886/ICPSR37353.v4. Ruoqi Yu, Dylan S. Small, David Harding, José Avel- danes, and Paul R. Rosenbaum. Optimal match- ing for observational studies that integrate quantitative Statistics and Public Pol- and qualitative research. icy, 8(1):42–52, 2021. doi: 10.1080/2330443X.2021. URL https://doi.org/10.1080/ 1919260. 2330443X.2021.1919260. Yue Zhang, Soumya Ray, and Weihong Guo. On the consis- tency of feature selection with lasso for non-linear targets. In Proceedings of the 33rd International Conference on Machine Learning (ICML), volume 48, page 183–191, 2016. Shuheng Zhou. Thresholded lasso for high dimensional variable selection and statistical estimation, 2010. URL https://arxiv.org/abs/1002.1583. Variable Importance Matching for Causal Inference (Supplementary material) Quinn Lanners1 Harsh Parikh2 Alexander Volfovsky3 Cynthia Rudin2 David Page1 1Dept. of Biostatistics, Duke University, Durham, NC, USA. 2Dept. of Computer Science, Duke University, Durham, NC, USA. 3Dept. of Statistical Science, Duke University, Durham, NC, USA. 9 PROOFS FOR THEOREMS IN SECTION 5 Theorem 5.1 (Closeness in X implies closeness in Y ). Consider a p-dimensional covariate space where for t′ ∈ {0, 1}, f (t′)(Xi) = E[Yi|X = Xi, T = t′] = Xiβ(t′). Construct M ∈ Rp×p where for all l, r ∈ {1, ..., p} Ml,l = |β(t′) | and for l ̸= r Ml,r = 0. Then, ∀i, j, we have that dM(Xi, Xj) ≥ (cid:12) (cid:12)f (t′)(Xi) − f (t′)(Xj) (cid:12) (cid:12) (cid:12) (cid:12). l Proof for Theorem 5.1. dM(Xi, Xj) = p (cid:88) l=1 Ml,l|Xi,l − Xj,l| = p (cid:88) l=1 |β(t′) l ||Xi,l − Xj,l| ≥ = l p (cid:88) β(t′) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (Xi,l − Xj,l) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)f (t′)(Xi) − f (t′)(Xj) (cid:12) (cid:12) (cid:12) . l=1 QED Theorem 5.2 (Optimality of M). Using the setup of Theorem 5.1, let supp(X) = Rp. Consider an arbitrary diagonal Mahalanobis distance matrix (cid:102)M ∈ Rp×p where ∥ (cid:102)M∥1 = ∥β(t′)∥1 and (cid:102)Ml,l > 0 when |β(t′) | > 0. For some ε ≥ 0 and X1 ∈ Rp, define S (cid:102)M,ε(X1) := {X2 : X2 ∈ Rp, d (cid:102)M(X1, X2) = ε}. Then, l sup X2∈SM,ε(X1) |f (t′)(X1) − f (t′)(X2)| ≤ sup (cid:102)M,ε(X1) X3∈S |f (t′)(X1) − f (t′)(X3)|. In what follows, we recall that a diagonal Mahalanobis distance matrix, (cid:102)M, is: • diagonal: for all l, r ∈ {1, ..., p}, l ̸= r, (cid:102)Ml,r = 0. • non-negative entries: for all l ∈ {1, ..., p}, (cid:102)Ml,l ≥ 0. To prove this result, we first prove the following two lemmas. Lemma 1 (Maximum Absolute Difference in Expected Outcomes under M). Consider a p-dimensional covariate space (cid:12) (cid:12) (cid:12)β(t′) where supp(X) = Rp and for t′ ∈ {0, 1}, f (t′)(Xi) = E[Yi|X = Xi, T = t′] = Xiβ(t′). Define L := {l : (cid:12) (cid:12) (cid:12) > 0}. Construct any diagonal Mahalanobis distance matrix, (cid:102)M, where ∥ (cid:102)M∥1 = ∥β(t′)∥1 and (cid:102)Ml,l > 0 when |β(t′) | > 0. Then, for some ε ≥ 0 and X1 ∈ Rp, let S (cid:102)M,ε(X1) be as defined in Theorem 5.2. We can conclude that l l sup (cid:102)M,ε(X1) X3∈S |f (t′)(X1) − f (t′)(X3)| = ε max l∈L (cid:40) (cid:41) . | |β(t′) l (cid:102)Ml,l Accepted for the 39th Conference on Uncertainty in Artificial Intelligence (UAI 2023). Proof of Lemma 1. sup (cid:102)M,ε(X1) X3∈S |f (t′)(X1) − f (t′)(X3)| = sup (cid:102)M,ε(X1) X3∈S (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:88) l∈L β(t′) l (cid:12) (cid:12) (cid:12) (X1,l − X3,l) (cid:12) (cid:12) . Note that since supp(X) = Rp, with probability strictly greater than zero there exists an X1 and X3 such that (cid:102)M(X1, X3) = ε and for all l ∈ L, X1,l > X3,l when β(t′) d (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) l > 0 and X1,l < X3,l when β(t′) (cid:12) (cid:12) (cid:12) (X1,l − X3,l) (cid:12) (cid:12) l < 0. Then, (cid:41) (X1,l − X3,l) (cid:12) (cid:12)β(t′) (cid:12) sup (cid:102)M,ε(X1) sup (cid:102)M,ε(X1) β(t′) X3∈S X3∈S (cid:88) (cid:88) (cid:40) = (cid:12) (cid:12) (cid:12) l l l∈L l∈L (cid:40) (cid:88) l∈L | |β(t′) l (cid:102)Ml,l (cid:41) (cid:102)Ml,l |X1,l − X3,l| . = sup (cid:102)M,ε(X1) X3∈S (cid:27) (cid:102)Ml,l |X1,l − X3,l| : X3 ∈ S (cid:102)M,ε(X1) is maximized at ε maxl∈L (cid:26) (cid:27) | |β(t′ ) l (cid:102)Ml,l . It is known that if the Note that (cid:26) | |β(t′ ) l (cid:102)Ml,l (cid:80) l∈L maximum value of a set is in the set, the supremum of that set equals the maximum value of that set. Therefore, we conclude that, sup (cid:102)M,ε(X1) X3∈S (cid:40) | |β(t′) l (cid:102)Ml,l (cid:88) l∈L (cid:41) (cid:102)Ml,l |X1,l − X3,l| = ε max l∈L (cid:40) (cid:41) . | |β(t′) l (cid:102)Ml,l QED Lemma 2 Under the same setup as Lemma 1, maxl∈L (cid:26) (cid:27) | |β(t′) l (cid:102)Ml,l ≥ 1. Proof of Lemma 2. First note that (cid:80) l∈L (cid:102)Ml,l ≤ (cid:102)Ml,l = p (cid:80) l=1 p (cid:80) l=1 |β(t′) l | = (cid:80) l∈L |β(t′) l |. There are two possible cases. In case |β(t′) one, ∀l ∈ L, (cid:102)Ml,l = Ml,l = |β(t′) l (cid:102)Ml,l then there must exist an l′ ∈ L for which (cid:102)Ml′,l′ < |β(t′) |. Then maxl∈L l | l′ | =⇒ maxl∈L | |β(t′ ) l (cid:102)Ml,l > 1. QED = 1. In case two, there exists l ∈ L for which (cid:102)Ml,l ̸= |β(t′) l |. But Proof of Theorem 5.2. First note that M is a diagonal Mahalanobis distance matrix, ∥M∥1 = ∥β(t′)∥1, and Ml,l > 0 when |β(t′) | > 0. The proof of the theorem then follows directly from Lemma 1 and Lemma 2. l sup X2∈SM,ε(X1) |f (t′)(X1) − f (t′)(X2)| = ε max l∈L (cid:40) (cid:40) (cid:41) (cid:41) |β(t′) | l Ml,l |β(t′) l |β(t′) l | | (cid:41) (cid:40) | |β(t′) l (cid:102)Ml,l = ε max l∈L = ε ≤ ε max l∈L Where ε ≤ ε maxl∈L (cid:26) (cid:27) | |β(t′) l (cid:102)Ml,l because of Lemma 2. QED = sup (cid:102)M,ε(X1) X3∈S |f (t′)(X1) − f (t′)(X3)|. Theorem 5.3 (Consistency of LCM). For t′ ∈ {0, 1}, let f (t′)(Xi) = E[Yi|X = Xi, T = t′]. Let f (t′) be Lipschitz continuous and, supp (cid:16) f (t′)(cid:17) := (cid:111) (cid:110) j : importance of X*,j in f (t′) is > 0 . Denote dM∗ as the distance metric learned by LCM in Section 4 and let Γ (M∗) = {j : M∗ CATE estimation if supp (cid:0)f (0)(cid:1) (cid:83) supp (cid:0)f (1)(cid:1) ⊆ Γ (M∗). j,j > 0}. LCM is consistent for Proof of Theorem 5.3. First, let us introduce the concept of a smooth distance metric (defined in Parikh et al. [2022c]). Definition 9.1 (Smooth Distance Metric). d : X × X → R+ is a smooth distance metric if there exists a monotonically increasing bounded function δd(*) with zero intercepts, such that ∀i, j ∈ S if Ti = Tj = t′ and d(Xi, Xj) ≤ a then |E [Yi(t′)|Xi] − E [Yj(t′)|Xj]| ≤ δd(a). Theorem 1 in [Parikh et al., 2022c] shows that matching with a smooth distance metric guarantees consistency of CATE estimates. Recovering the correct support for the potential outcome functions implies that restricting to only variables in the recovered support, the potential outcomes are independent of the covariates: (Y (1), Y (0)) ⊥ X | {X*,j}j∈supp(f (0))∪supp(f (1)). Also, note that if {Xi,j}j∈supp(f (0))∪supp(f (1)) is close to {Xk,j}j∈supp(f (0))∪supp(f (1)) then f (0)(Xi) is close to f (0)(Xk) and f (1)(Xi) is close to f (1)(Xk) by the definition of support and the Lipschitz continuity assumption. Thus, if supp(f (0)) ∪ supp(f (1)) ⊆ Γ(M∗) then d∗ M is a smooth distance metric. This guarantees the consistency of our estimates. QED Consistency of LASSO. Much work has been done on the consistency of LASSO for feature selection [Zhang et al., 2016]. The ability for LASSO to recover the correct support even in the case of non-linear targets makes it more robust to model misspecification. LASSO is consistent for support recovery if f (Xi, t) = E[Yi|X = Xi, T = t′] satisfies one of the following conditions: (i) f (Xi, t′) = Xiβ(t′) (ii) f (Xi, t′) = g Xiβ(t′)(cid:17) where β(t′) and the following conditions are met: (cid:16) k ̸= 0 for k ∈ {1, .., r}, for some r ≤ p, and, if r < p, β(t) k = 0 for k ∈ {r, ..., p}, (a) Cov(X, X) is invertible. (b) The eigenvalues of Σr,r = Cov(X1:r, X1:r) are such that 0 < c1 ≤ Λ (Σr,r) ≤ c2 < ∞. Where Λ (Σr,r) are the eigenvalues of Σr,r. (c) E[Y (t′)]4 < ∞ (d) g is differentiable almost everywhere and for t ∼ N (0, 1), E(|g(t)|) < ∞ and E(|g′(t)|) < ∞. (e) For all i, E (cid:20) X T i Xi (cid:12) (cid:12) (cid:12)g (cid:16) Xiβ(t′)(cid:17)(cid:12) (cid:12) (cid:12) 2(cid:21) < ∞. 10 METHOD IMPLEMENTATION FOR EXPERIMENTS In this section we outline how we implemented each method used in our experiments. To calculate CATE estimates for all samples, we employed the same η-fold cross-fitting strategy for each method. In particular, we train models to estimate the (cid:98)Yi(t′) = f (t′)(Xi) for t′ ∈ {0, 1} using Sn,tr and perform estimation on Sn,est. The only method that we did not use cross-fitting for was GenMatch, which does not use the outcome to learn it's distance metric and thus does not require a training set. All references to scikit-learn refer the Python machine learning package from Pedregosa et al. [2011]. • LASSO Coefficient Matching: We implemented the method described in this paper in Python. We use scikit-learn's LassoCV to learn dM∗ and NearestNeighbors with metric='manhattan' to perform nearest neighbor matching. • Linear and Nonparametric Prognostic Score Matching: We follow the notion of a prognostic score outlined in Hansen [2008a]. In particular, we employ a double prognostic score matching method were we model both the control and treatment space separately as (cid:98)Yi(t′) = f (t′)(Xi) for t′ ∈ {0, 1}. For linear PGM we use scikit-learn's LassoCV as our prognostic score models and for nonparametric PGM we use GradientBoostingRegressor for our prognos- tic score models. We then match with replacement on [f (0)(Xi), f (1)(Xi] using scikit-learn's NearestNeighbors with metric='euclidean' to perform nearest neighbor matching. We estimated CATEs with the same mean estimator as LCM. • MALTS Matching: We use the method developed in Parikh et al. [2022c] that was implemented in Python [Parikh, 2020]. We use the package's mean CATE estimator with smooth_cate=False. • MatchIt: We use MatchIt's implementation of GenMatch [Ho et al., 2007]. We kept the default setting of ratio=1, which set K = 1 for matching. But we matched with replacement to be in line with LCM and the other matching methods we compared with. • Linear and Nonparametric TLearner: We use the EconML TLearner implementation from Battocchi et al. [2019]. For Linear TLearner we use scikit-learn's LassoCV for our models and for Nonparametric TLearner we use scikit-learn's GradientBoostingRegressor for our models. • AHB: We use the method developed in Morucci et al. [2020] that was implemented in R [Lab, 2022]. We use the package's AHB_fast_match implementation with the default settings. • Bart T-Learner: We use the dbarts R package from Dorie et al. [2019]. We train a BART model on Sn,tr to model (cid:98)Yi(t′) = f (t′)(Xi) for t′ ∈ {0, 1}. We then estimate CATEs for each j ∈ Sn,est as f (1)(Xj) − f (0)(Xj). • Linear DoubleML: We use the econml.dml.DML class in the econml Python package from Battocchi et al. [2019]. We fit a model on Sn,tr setting model_y=WeightedLassoCV, model_t=LogisticRegressionCV, and model_final=LassoCV. We then estimate CATEs for each j ∈ Sn,est using the .effect() method. • Causal Forest DoubleML: We use the econml.dml.CausalForestDML class in the econml Python package from Battocchi et al. [2019]. We fit a model on Sn,tr setting model_y=WeightedLassoCV and model_t=LogisticRegressionCV. We then estimate CATEs for each j ∈ Sn,est using the .effect() method. • Causal Forest: We use the implementation of causal forest from the grf R package from Battocchi et al. [2019]. We fit a model on Sn,tr with the default package settings. We then used the fit model to estimate CATEs for each j ∈ Sn,est. 11 EXPERIMENTAL DETAILS FOR SECTION 6 AND SECTION 7 In this section, we describe the data generating processes used and provide further details regarding the setup of each experiment conducted in this paper. The source code necessary to reproduce all of the experiments in this paper is located in the GitHub repository: https://github.com/almost-matching-exactly/variable_imp_matching. 11.1 DATA GENERATION PROCESSES Here we outline the data generation processes (DGPs) not fully outlined in the main text. Sine and Exponential DGPs. Used in Sections 6.2 and 7.1. We generate the covariates and treatment assignments for the Sine and Exponential DGPs in a similar manner. For both, we generate data as follows: Xi,1, . . . , Xi,p iid∼ N (0, σ2), εi,t iid∼ Uniform(−α, β) iid∼ N (0, 1) (cid:35) (cid:17) Xi,1 + Xi,2 + εi,t > 0.5 εi,y (cid:34) Ti = 1 expit (cid:16) Yi = TiYi(1) + (1 − Ti)Yi(0) + εi,y, where expit is the logistic sigmoid: expit(x) = 1 1+e−x . For Sine we set α = β = π, σ2 = 0.1 and calculate the potential outcomes as For Exponential we set α = β = 3, σ2 = 1 and calculate the potential outcomes as Yi(0) = sin(Xi,1), Yi(1) = sin(Xi,1) − sin(Xi,2). Yi(0) = 2eXi,1 − 3 (cid:88) j=2 eXi,j , Yi(1) = 2eXi,1 − 3 (cid:88) j=2 eXi,j + eXi,4 . Quadratic DGP. Used in Sections 6.3 and 7.3. This quadratic data generation process is also described in Parikh et al. [2022c]. This DGP includes both linear and quadratic terms. For each sample, let Xi be a p-dimensional vector where the first k ≤ p covariates are relevant and κ ≤ k is the number of covariates relevant to determining the treatment choice. The DGP is outlined below. Xi,p iid∼ N (1, 1.5), εi,yεi,t iid∼ N (0, 1), s1, . . . , s|k| iid∼ Uniform{−1, 1} αj|sj iid∼ N (10sj, 9), β1, . . . , β|k| iid∼ N (1, 0.25) Yi(0) = (cid:88) j≤k αjXi,j Yi(1) = (cid:88) j≤k αjXi,j + (cid:88) j≤k βjXi,j + (cid:88) (cid:88) j≤k j′≤k Xi,jXi,j′ (cid:34) (cid:16) (cid:88) expit Ti = 1 j≤κ Xi,j − κ + εi,t (cid:35) (cid:17) > 0.5 Yi = TiYi(1) + (1 − Ti)Yi(0) + εi,y Where expit(x) = 1 1+e−x . Basic Quadratic DGP. Used in Section 7.2. This DGP is a quadratic DGP centered at zero. We generate each sample as shown. Xi,1, . . . , Xi,10 iid∼ N (0, 2.5), εi,y Yi(0) = X 2 i,1, Yi(1) = X 2 i,1 + 10 iid∼ N (0, 1), Ti ∼ Bernoulli(0.5) Yi = TiYi(1) + (1 − Ti)Yi(0) + εi,y 11.2 EXPERIMENTAL DETAILS In Table 1 we provide details on the experiments shown in this paper. We include additional notes for selected experiments below: • Section 6.1: Accuracy and Auditability: We included the school id as a categorical covariate in our dataset. After preprocessing the categorical covariates, we had 6 continuous covariates and 98 binary covariates that we used as input to each model. We used only two splits due to the small occurrence rate of many of the categorical values. We repeated the cross-fitting process 50 times to smooth out treatment effect estimates for each method. All of the results in this section are for the combined 50 iterations. • Section 6.3: Scalability: The matchit package only performs k:1 matching, so we kept K=1 for GenMatch (which is the default value). Reported runtimes were measured on a Slurm cluster with VMware, where each VM was an Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz. For measuring runtime, we ran each method 20 times on each dataset size. We report the average runtime for each method on each dataset. The variability across the 20 runs was negligible so we ommitted bars showing the standard deviation from the final plot. Each individual runtime measurement was ran on a separate Slurm job that was allocated a single core with 16GB RAM. • Section 7.3: LCM-Augmented-PGM: For ease of implementation, we did not perform cross-fitting for this experiment. Rather, we just used half of the samples (2500) for training and the other half of the samples (2500) for estimation. 12 ADDITIONAL EXPERIMENTAL RESULTS In this section, we include additional experimental results using LCM. We first discuss further findings from experiments in Section 6 and Section 7. We then show results of additional experiments comparing LCM to non-matching methods and matching methods with equal weights after feature selection. Section 6.1: Accuracy and Auditability. Figure 10 in this document is an expanded plot of Figure 1(a) in the main text. The supplementary material's Figure 10 includes S3, X1, and all other effect modifiers X2, C1=1, C1=13, and C1=14. As mentioned in the caption of Figure 1(a) in the main text, S3 indicates the self-reported prior achievements of students and X1 indicates school-level average mindset score of the students. X2 is a school-level continuous covariate that measures the school's achievement level and C1 is a categorical covariate for race/ethnicity. We measure closeness in continuous covariates using the same mean absolute difference metric used in Figure 1(a) in the main text. Whereas, we measure Table 1: Details of Experiments in Sections 6 and 7. The Additional Information column indicates if further details for that experiment are included in Section 11.2. Section 6.1: Accuracy and Auditability 6.2: Nonlinear Outcome Dataset ACIC 2018 Learning Mindset Dataset Sine Exponential 10,000 5000 5000 10 100 100 # Samples # Covariates K 6.3: Scalability Linear + Quadratic Varies Varies 7.1: Metalearner LCM 7.2: Feature Importance Matching 7.3: LCM- Augmented-PGM Sine Simple Quadratic 500 500 Linear + Quadratic 5000 10 10 20 10 10 10 10 (1 for GenMatch - see notes) 10 10 Additional Notes Y Y η 2 10 10 2 5 5 25 using PGM followed by 5 using LCM N/A Y Figure 10: Closeness in important covariates for matched groups produced by LCM, linear PGM, and nonparametric (NP) PGM. Smaller values imply better and tighter matches. closeness in categorical covariates as the percent of samples in a match group that do not have the same label as the query unit (% Mismatch). LCM matches much more tightly on all of the continuous covariates. For categorical covariates, while LCM matches tighter than PGM methods, it struggles compared to continuous covariates. We theorize this is due to the low occurrence rate of these features. In particular, C1=1 in 9.5%, C1=13 in 1.8% and C1=14 in 6.2% of samples. Therefore, it is difficult to find matches that have the same C1 value and are also similar in all of the other important covariates. LCM sometimes prioritizes matching almost-exactly on other covariates at the expense of these rare categorical covariates. Carvalho et al. [2019] also states that although XC (Urbanicity) is not an effect modifier it is strongly related to X1 (student's fixed mindsets - summarized at the school level) and X2 (school achievement level) which are true effect modifiers. Because of this, seven of the eight methods that are summarized in Carvalho et al. [2019] identified XC as an effect modifier. Carvalho et al. [2019] further shows that, in this dataset, marginally the true cates for XC=3 are much lower than other values of XC. We show in Figure 11 that LCM also identifies this trend in XC. For Section 6.1, we did not compare to other almost-matching-exactly methods (i.e. MALTS, AHB, GenMatch) due to the large size of the dataset. The ACIC 2018 Learning Mindset Dataset has 50,000 samples and >100 covariates after encoding the categorical features. Results from Section 6.3 highlight how intractable it would be to run other AME methods on a dataset of this size. Section 6.2: Nonlinear Outcomes. Figure 12 shows CATE estimation accuracy for the same experiment in Section 6.2 Figure 11: Marginal CATE estimates produced by LCM, Linear PGM, and Nonparametric PGM for the categorical school- level covariate of urbanicty (XC). with the number of covariates increased to 500 for both the Sine and Exponential datasets. Given that we used 10 splits for this experiment, the training set in each fold had 500 samples. Note that LCM's accuracy does not suffer in this extremely high-dimensional setting where the number of samples equals the number of covariates. These results further highlight the ability of LCM to scale to very high-dimensional data even in the case of nonlinear outcome functions. Section 7.1: Metalearner LCM. For the Metalearner LCM, here we show the effect of learning unique distance metrics for calculating control vs treated KNNs. We measure the distance between query unit's covariate values and the values of the ten nearest neighbors' of each treatment type. In particular, we calculate the mean absolute difference between a query unit's value and the values of its ten nearest neighbors. As explained in Section 7.1, X1 is a relevant covariate to the outcome under both treatment regimes, whereas X2 is only relevant to the outcome under treatment. X3 is unimportant in both setting and shown as a reference point. Figure 13 shows that while LCM's nearest neighbors are equally close on X0 and X1 in both treatment spaces, Metalearner LCM considers X2 as unimportant when calculating KNNs who are in the control group. This highlights how Metalearner LCM is able to adapt to outcome spaces that are different under different treatment regimes. LCM vs Machine Learning Methods. Previous almost-matching-exactly literature has established that AME methods perform as well as (and often better than) machine learning methods like BART, causal forest, and double machine learning for estimating CATEs [Parikh et al., 2022c, Morucci et al., 2020, Wang et al., 2017]. For this reason, this paper focuses on comparing LCM to matching methods and particularly other AME methods. However, here we include an experiment comparing the CATE estimation accuracy of LCM to various machine learning methods on a high-dimensional non-linear dataset. We use the Quadratic DGP with 25 relevant covariates, 2 of which are relevant to the treatment choice, and 125 irrelevant covariates. We generate 2500 samples and set η = 5. We run LCM with two configurations. LCM Mean is run with K = 10 and uses a mean estimator inside the match groups. LCM Linear is run with K = 40 and uses linear regression as the estimator inside the match groups. We compare to state-of-the-art machine learning methods double machine learning (DML), causal forest, and BART TLearner. Figure 14 shows that LCM Mean performs on par with the machine learning methods on this dataset, further highlighting the accuracy our method. LCM Linear improves upon LCM Mean, showing that we can achieve better accuracy with more sophisticated estimators if we are willing to increase the size of the match groups. LCM vs Feature Selection. Here we show CATE estimation accuracy of LCM compared to matching equally on the covariates after feature selection. To compare with LCM, we estimate CATEs using feature selection by simply following the same steps as LCM but replacing the M∗ with an M ∈ Rp×p such that Ml,l = 1 when M∗ l,l > 0 and Ml,l = 0 when M∗ l,l = 0. We refer to this method as LASSO FS. We also compare to an Oracle feature selector in which we assume that we know which covariates are important and match equally only on the important covariates. Figure 12: Comparing LCM's and Linear PGM's performances for high-dimensional nonlinear synthetically generated datasets Sine and Exponential. Figure 13: Measure of how tightly the KNN groups are for LCM versus Metalearner LCM under different treatment regimes. Figure 14: Estimated CATE absolute error relative to the true ATE for LCM Mean, LCM Linear, and state-of-the-art machine learning methods. DML stands for double machine learning. Figure 15: Estimated CATE absolute error relative to the true ATE for LCM and matching equally on covariates after LASSO and Oracle feature selection. We run our analysis on three of the data generation processes used earlier in this paper. Namely, we run on the Sine, Exponential, and Quadratic DGPs described in Section 11.1. We generate 5000 samples and 100 covariates for each DGP and have two important covariates for Sine, four important covariates for Exponential, and five important covariates for Quadratic. All tests set η = 5 and K = 10. Figure 15 shows that LCM outperforms LASSO feature selection and performs on par with an Oracle feature selector. This highlights how using the relative weights of feature importance values in a distance metric, and thus matching tighter on covariates that more heavily contribute to the outcome, ultimately leads to more accurate CATE estimates.
http://arxiv.org/abs/2302.11709v1
2023-02-23T00:07:03
2023-02-23T00:07:03
Bayes meets Bernstein at the Meta Level: an Analysis of Fast Rates in Meta-Learning with PAC-Bayes
Bernstein's condition is a key assumption that guarantees fast rates in machine learning. For example, the Gibbs algorithm with prior $\pi$ has an excess risk in $O(d_{\pi}/n)$, as opposed to the standard $O(\sqrt{d_{\pi}/n})$, where $n$ denotes the number of observations and $d_{\pi}$ is a complexity parameter which depends on the prior $\pi$. In this paper, we examine the Gibbs algorithm in the context of meta-learning, i.e., when learning the prior $\pi$ from $T$ tasks (with $n$ observations each) generated by a meta distribution. Our main result is that Bernstein's condition always holds at the meta level, regardless of its validity at the observation level. This implies that the additional cost to learn the Gibbs prior $\pi$, which will reduce the term $d_\pi$ across tasks, is in $O(1/T)$, instead of the expected $O(1/\sqrt{T})$. We further illustrate how this result improves on standard rates in three different settings: discrete priors, Gaussian priors and mixture of Gaussians priors.
[ "Charles Riou", "Pierre Alquier", "Badr-Eddine Chérief-Abdellatif" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11709v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11709v1", "@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" ]
3 2 0 2 b e F 3 2 ] L M . t a t s [ 1 v 9 0 7 1 1 . 2 0 3 2 : v i X r a Bayes meets Bernstein at the Meta Level: an Analysis of Fast Rates in Meta-Learning with PAC-Bayes Charles Riou The University of Tokyo & RIKEN Center for AIP Tokyo, Japan Pierre Alquier ESSEC Business School Asia-Pacific campus, Singapore [email protected] [email protected] Badr-Eddine Ch ́erief-Abdellatif CNRS, LPSM, Sorbonne Universit ́e & Universit ́e Paris Cit ́e [email protected] p Abstract Bernstein's condition is a key assumption that guarantees fast rates in machine learning. For ex- ample, the Gibbs algorithm with prior π has an excess risk in O(dπ/n), as opposed to the standard dπ/n), where n denotes the number of observations and dπ is a complexity parameter which O( depends on the prior π. In this paper, we examine the Gibbs algorithm in the context of meta- learning, i.e., when learning the prior π from T tasks (with n observations each) generated by a meta distribution. Our main result is that Bernstein's condition always holds at the meta level, regardless of its validity at the observation level. This implies that the additional cost to learn the Gibbs prior π, which will reduce the term dπ across tasks, is in O(1/T ), instead of the expected O(1/√T ). We further illustrate how this result improves on the standard rates in three different settings: discrete priors, Gaussian priors and mixture of Gaussians priors. Keywords: Bernstein's condition, meta-learning, fast rates, PAC-Bayes bounds, information bounds, the Gibbs algorithm, variational approximations. 1 Introduction One of the greatest promises of artificial intelligence is the ability to design autonomous systems that can learn from different situations throughout their lives and adapt quickly to new environments, as humans, animals and other living things naturally do. Based on the intuition that a new prob- lem often has significant similarities to previously encountered tasks, the use of past experience is particularly important in areas such as computer vision (Quattoni et al., 2008; Kulis et al., 2011; Li et al., 2018; Achille et al., 2019), natural language processing (Huang et al., 2018; Gu et al., 2018; Dou et al., 2019; Qian and Yu, 2019) and reinforcement learning (Finn et al., 2017; Mishra et al., 2018; Wang et al., 2016; Yu et al., 2020) where the learner has access to only a few training exam- ples for the task of interest, but for which a vast amount of datasets from a variety of related tasks is available. In the area of digit recognition for example, it is possible to leverage the experience gained from millions of similar open source image classification datasets, as the key features needed to classify cats from dogs or pants from shirts can be used to classify handwritten digits. This idea is at the heart of meta-learning (Thrun and Pratt, 1998; Baxter, 2000; Vanschoren, 2019), a field that has recently attracted a lot of attention due to its huge success in real-world applications, and which aims to improve performance on a particular task by transferring the knowledge contained in different but related tasks. ©xxxx C. Riou and P. Alquier and B.-E. Ch ́erief-Abdellatif. License: CC-BY 4.0, see https://creativecommons.org/licenses/by/4.0/. C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF Meta-learning has been widely studied in recent literature. It must be noted that meta-learning was used to refer to a wide range of situations. Providing a precise definition of meta-learning is a challenge. In particular, the terms transfer learning and multi-task learning, although distinct, are often used interchangeably instead of meta-learning. Transfer learning is a very general concept that involves two tasks that share similarities - a source and a target - and consists in transferring the knowledge acquired on the source dataset to better process the target data (Pan and Yang, 2010; Zhuang et al., 2020). In practice, this can be formulated in many different ways, but the most pop- ular approach is to pre-train a model on the source data, e.g., images of cats and dogs, and then to fine-tune it on the target training data set, e.g., images of handwritten digits. In particular, a challenging problem in transfer learning is to find a measure that quantifies the similarity between the source and target tasks. Multi-task learning adopts a different framework, where multiple learn- ing tasks are considered and the goal is to learn a model that can handle all tasks simultaneously (Caruana, 1997; Zhang and Yang, 2021). The model usually has a common representation, e.g., the first layers of a deep neural network, and a task-specific component, e.g., the last layer of the network. Meta-learning also considers a collection of datasets from a variety of tasks, but unlike multi-task learning, we are not interested in learning the fixed number of tasks, but rather in being prepared for future tasks that are not yet given. Also, unlike transfer learning, meta-learning exploits the commonality of previous tasks rather than the similarity between some specific source and target tasks. We use these metadata to design a meta-procedure that adaptively learns a predictor for any new learning task that is a priori unknown, and the goal is to quickly learn to adapt a learning pro- cedure from past experience. Meta-learning is therefore sometimes referred to as learning-to-learn, or lifelong learning in the online context. The implementation of this learning-to-learn mechanism can take different forms, which we briefly describe in the following paragraph. As the name suggests, meta-learning involves two levels of abstraction to improve learning over time: a meta-level and a within-task level. At the within-task level, the new task of interest is pre- sented and the corresponding pattern is learned from the training data set of the task at hand. This learning process is greatly accelerated by a meta-learner, which has distilled the knowledge accumu- lated in previous tasks into the within-task model. The meta-learning procedure can accelerate the within-task algorithm in various ways, and three main categories stand out in the literature: metric- based methods, which are based on non-parametric predictive models governed by a metric that is learned using the meta-training dataset (Koch et al., 2015; Vinyals et al., 2016; Snell et al., 2017; Sung et al., 2018); model-based methods, which quickly update the parameters in a few learning steps, which can be achieved by the model's internal architecture or another meta-learning model (Santoro et al., 2016; Munkhdalai and Yu, 2017; Mishra et al., 2018); and optimisation-based meth- ods, which mainly involve learning the hyper-parameters of a within-task algorithm using the meta- training set for fast adaptation (Hochreiter et al., 2001; Ravi and Larochelle, 2017; Finn et al., 2017; Nichol et al., 2018; Qiao et al., 2018; Gidaris and Komodakis, 2018). Due to their performance and ease of implementation, the optimisation-based family is the dominant class in the recent lit- erature, exploiting the idea that well-chosen hyperparameters can greatly speed up the learning process and allow model parameters to be quickly adapted to new tasks with little data. For ex- ample, it is possible to learn the task of interest using a gradient descent whose initialisation and learning rate would have been learned from the metadata. Among the best known meta-strategies is the model agnostic meta-learning procedure (MAML) (Finn et al., 2017) and its variants im- plicit MAML (Rajeswaran et al., 2019), Bayesian MAML (Grant et al., 2018; Yoon et al., 2018; 2 FAST RATES IN META-LEARNING WITH PAC-BAYES Nguyen et al., 2020) and Reptile (Nichol et al., 2018). We refer the interested reader to the recent review by Chen et al. (2023) for more details. 2 Approach and Contributions In this paper, we focus on the Gibbs algorithms within tasks, or their variational approximations. the Gibbs algorithms, also known as Gibbs posteriors (Alquier et al., 2016) or exponentially weighted aggregation (Dalalyan and Tsybakov, 2008), can also be interpreted in the framework of Bayesian statistics as a kind of generalized posterior (Bissiri et al., 2016). PAC-Bayes bounds were developed to control the risk and the excess risk of such procedures (Shawe-Taylor and Williamson, 1997; McAllester, 1998; Catoni, 2004; Zhang, 2006; Catoni, 2007; Yang et al., 2019), see Guedj (2019); Alquier (2021) for recent surveys. More recently, the related mutual information bounds (Russo and Zou, 2019; Haghifam et al., 2021) were also used to study the excess risk of the Gibbs algorithms (Xu and Raginsky, 2017). Gibbs posteriors are often intractable, and it is then easier to compute a variational ap- proximation of such a posterior. It appears that PAC-Bayes bounds can also be used on such ap- proximations (Alquier et al., 2016). Many recent publications built foundations of meta-learning through PAC-Bayes and information bounds (Pentina and Lampert, 2014; Amit and Meir, 2018; Ding et al., 2021; Liu et al., 2021; Rothfuss et al., 2021; Farid and Majumdar, 2021; Rothfuss et al., 2022; Guan and Lu, 2022a; Rezazadeh, 2022). These works and the related literature are discussed in detail in Section 6. Most of these papers proved empirical PAC-Bayes bounds for meta-learning. These bounds can be minimized, and we obtain both a practical meta-learning procedure, together with a numerical certificate on its generalization. However, these works did not focus on the rate of convergence of the excess risk. Bernstein's condition a is a low-noise assumption reflecting the inherent difficulty of the learn- ing task (Mammen and Tsybakov, 1999; Tsybakov, 2004; Bartlett and Mendelson, 2006). While it was initially designed to study the ERM (Bartlett and Mendelson, 2006), it characterizes the learn- ing rate of algorithms beyond the ERM. PAC-Bayes bounds and mutual information bounds show that the excess risk of the Gibbs algorithm is in O(dπ,t/n) when Bernstein's condition is satis- fied (Catoni, 2007; Gr ̈unwald and Mehta, 2020), as opposed to the slow rate O((dπ,t/n)1/2) in the general case. The quantity dπ,t measures the complexity of task t. Importantly, it also depends on the prior distribution π used in the algorithm. Similar results hold when we replace the Gibbs algorithm by a variational approximation (Alquier et al., 2016). In the meta-learning setting, we are given T tasks simultaneously. Using the Gibbs algorithm with a fixed π in all tasks leads to an average excess risk in O(Et[(dπ,t/n)α]), where α = 1 when , and α = 1/2 otherwise. Here, Et denotes Bernstein's condition holds for each task t 1, . . . , T } the expectation with respect to a future (out-of-sample) task t. This approach is referred to as "learning in isolation", because each task is solved regardless of the others. Of course, in meta- learning we want to take advantage of the multiple tasks. For example, Pentina and Lampert (2014) used the Gibbs algorithm at the meta-level, in order to learn a better prior. The expected benefit is to reduce the complexity term dπ,t. ∈ { Overview of the paper: • In Section 3, we recall existing results on the excess risk of the Gibbs algorithm when learning tasks in isolation, and we introduce Bernstein's condition, a fundamental assumption under which the fast rate O(Et[dπ,t/n]) is achieved by the Gibbs algorithm. 3 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF • In Section 4, we prove that regardless of its validity at the within-task level, Bernstein's condition is always satisfied at the meta level. As a consequence of this result, we show that a meta-level the Gibbs algorithm achieves the excess risk O(inf π∈M Et[(dπ,t/n)α] + 1/T ) with α = 1 if Bernstein's condition is satisfied, and α = 1/2 otherwise. We further raise the open question of the generalization of this result to its variational approximations. • In Section 5, we apply the previous results to various settings: learning a discrete prior, learning a Gaussian prior and learning a mixture of Gaussians prior. We show that the gain brought from the meta learning is blatant, as in some favorable situations, one can even have inf π∈M Et[dπ,t/n] = 0. • In Section 6, we provide a deeper comparison with the rich literature on meta-learning. 3 Problem Definition and Notations Z be a space of observations, Θ be a decision space and l : R+ be a bounded Let loss function defined on the previously defined sets. Let (Θ) denote the set of all probability distributions on Θ equipped with a suitable σ-field. The learner has to solve T tasks. Given a , the learner receives the observations Zt,i, i = 1 . . . n, assumed to be drawn task t } independently from a distribution Pt on the decision space . The objective of the learner is to find a parameter θ in the parameter space Θ which minimizes the so-called prediction risk associated to Pt on , defined as 1, . . . , T Z × ∈ { → Θ Z P Z RPt(θ) = EZ∼Pt[l(Z, θ)]. We denote by R∗ Pt the minimum of RPt(θ) and by θ∗ t its corresponding minimizer: R∗ Pt = inf θ∈Θ RPt(θ) = RPt(θ∗ t ). In Bayesian approaches, we rather seek for ρt ∈ P (Θ) such that Eθ∼ρt[RPt(θ)] is small. Defining, for any θ Θ, the empirical risk as ∈ ˆRt(θ) = 1 n n Xi=1 l(Zt,i, θ), a standard choice for ρt is the so-called Gibbs posterior given by ρt(π, α) = argminρ∈P(Θ) Eθ∼ρ (cid:26) ˆRt(θ) i h + KL(ρ π) k αn , (cid:27) (1) where π is the prior distribution on the parameter θ and α is some parameter which will be made explicit later. The corresponding risk estimate is defined by Rt(ρ, π, α) = Eθ∼ρ ˆ + KL(ρ π) k αn . ˆRt(θ) i h 4 FAST RATES IN META-LEARNING WITH PAC-BAYES More generally, we can also consider variational approximations, defined by ρt(π, α, F ) = argminρ∈F Eθ∼ρ (cid:26) ˆRt(θ) h i + KL(ρ π) k αn , (cid:27) (2) where the generalization properties (Alquier et al., 2016). With these notations, ρt(π, α) = ρt(π, α, lead to feasible minimization problems, and don't affect (Θ)). (Θ). Adequate choices for F ⊆ P F P 3.1 Assumptions on the loss and Bernstein's condition Recall that we assumed the loss function to be bounded: there exists a constant C > 0 such that (z, θ) ∀ ∈ Z × Θ, l(z, θ) C. ≤ (3) PAC-Bayes bounds for unbounded losses are well-known, see the discussion at the end of Alquier (2021). However, a lot of those bounds become a little more complicated. Thus, the choice to work with bounded variables is made here for the sake of clarity, and is not due to a fundamental limitation of our method. We define the variance term for task t by Vt(θ, θ∗ t ) := EPt l(Z, θ) | 2 l(Z, θ∗ t ) | − h i Θ. The following condition is crucial in the study of the risk of Gibbs posterior. for any θ ∈ Assumption 1 (Bernstein's condition) There exists a constant c > 0 such that, for any θ Θ, ∈ ≤ This assumption characterizes the excess risk of Gibbs posterior, see Theorem 1 below. paper, we will provide a bound on the excess risk both under this condition and without it. − (cid:0) (cid:1) Vt(θ, θ∗ t ) c RPt(θ) R∗ Pt . In this In some of the applications developed in Section 5, we will also make the following assumption: there exists L > 0 such that, for any Pt ∼ P − Intuitively, Taylor's expansion of RPt gives RPt(θ) and any θ Θ, ∈ θ k R∗ Pt ≤ L 2. θ∗ t k (4) − RPt(θ) = RPt(θ∗ t ) + dRPt(θ∗ t ).(θ 0 θ∗ t ) θ +O( k − − θ∗ t k 2) = RPt(θ∗ θ t ) + O( k 2). θ∗ t k − and thus we can expect (4) to be satisfied when the risk is smooth enough. However, note that this assumption is not necessary for the main results of this paper to hold, and will only be used in very specific applications. {z | } 3.2 Learning in Isolation 1, . . . , T In the process of learning in isolation, we consider each of the tasks separately. We then fix some St the set of observations from task t: Zt,1, . . . , Zt,n. We recall t the following result, which can be found, e.g., in Alquier (2021), and whose proof is recalled in Appendix B for the sake of completeness. and denote by ∈ { } 5 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF Theorem 1 Assume that the loss l satisfies (3). Then, the following bound holds, for any α > 0: ESt E θ∼ρt(π,α,F ) [RPt(θ)] − R∗ Pt ≤ 1 αcIB 2(1−Cα) (cid:18) 1 − ESt (cid:20) inf ρ∈F ˆ Rt(ρ, π, α) − ˆRt(θ∗ t ) (cid:21) + IB) αC 2(1 8 − , (cid:19) where IB is equal to 1 if Bernstein's condition (in Assumption 1) is satisfied, and 0 otherwise. In particular, under Bernstein's condition, the choice α = 1 c+C yields the bound ESt E θ∼ρt(π,α,F )[RPt(θ)] R∗ Pt ≤ − 2ESt inf ρ∈F ˆ Rt(ρ, π, α) − ˆRt(θ∗ t ) (cid:21) . (cid:20) When specifying a model and a prior, a derivation of the right-hand side in Theorem 1 leads to explicit rates of convergence. For example, a classical assumption in the Bayesian literature is that there are constants κ, d 2017). As this condition is usually applied on one task, with a specific prior, the notation d does not reflect the dependence with repect to π or to t. However, in our context, this dependence will be crucial, so we will write dπ,t instead of d. Under such an assumption, the right-hand side in Theo- rem 1 can be made more explicit. For simplicity, we state this result for Gibbs posteriors ρt(π, α) only. 0 such that π( θ : Rt(θ) { sd/κ (Ghosal and Van der Vaart, Rt(θ∗ t ) } ≤ s) ≥ − ≥ Corollary 2 Assume that, almost surely on Pt, π( θ : Rt(θ) { s) sdπ,t/κπ,t. Then, ESt (cid:20) inf ρ∈P(Θ) ˆ Rt(ρ, π, α) − ˆRt(θ∗ t ) (cid:21) ≤ Rt(θ∗ t ) − dπ,t log nα dπ αn } ≤ ≥ + log κπ,t . In particular, under Bernstein's condition, the choice α = 1/(c + C) gives ESt E θ∼ρt(π,α)[RPt(θ)] R∗ Pt + 2 ≤ dπ,t log nα dπ,t + log κπ,t αn . On the other hand, without Bernstein's condition, ESt E θ∼ρt(π,α)[RPt(θ)] R∗ Pt + ≤ dπ,t log nα dπ,t + log κπ,t αn + αC 2 8 , and in particular, for α = 2 2dπ,t/(√nC), we obtain p ESt E θ∼ρt(π,α)[RPt(θ)] R∗ Pt + ≤ C 2 r dπ,t 2n 1 2 (cid:18) log 8e2n dπC 2 + 1 dπ,t log κπ,t . (cid:19) 4 Main Results From this section onward, we focus on meta-learning. As opposed to the learning in isolation, the meta-learning considers all the tasks t and takes advantage of possible similarities between the T tasks to improve learning in each task. More precisely, while assuming that for , Zt,1, . . . , Zt,n are drawn independently from distribution Pt, we also assume any t } . A future that the distributions P1, . . . , PT are drawn independently from a certain distribution 1, . . . , T 1, . . . , T ∈ { ∈ { } P 6 FAST RATES IN META-LEARNING WITH PAC-BAYES (out-of-sample) task PT +1 will also be drawn from and ZT +1,1, . . . , ZT +1,n will be drawn inde- pendently from PT +1. This task will be solved by the Gibbs algorithm ρT +1(π, α). Our objective is to learn the prior π using the tasks t 1, . . . , T P , in order to make the meta-risk } ∈ { (π) = EPT +1∼P EST +1∼PT +1 E Eθ∼ρT +1[RPT +1(θ)]. as small as possible. We will compare it to the so-called oracle meta-risk ∗ = EPT +1∼P [R∗ PT +1], E which can only be reached by an oracle who would know the best classifier in each task in advance. 4.1 Bernstein's condition at the meta level In this subsection, we prove a version of Bernstein's condition at the meta level. Let Rt(ν, α) = ESt∼Pt inf ρ∈P(Θ) (cid:20) ˆ Rt(ρ, ν, α) (cid:21) for any prior ν, and let π∗ α be the distribution minimizing the expectation of the above quantity: π∗ α = argminν EPt∼P [ Rt(ν, α)] . Surprisingly enough, in contrast to the learning in isolation, Bernstein's condition is always satisfied at the meta level, on the condition that we use Gibbs posteriors ρt(π, α) within tasks. Theorem 3 Assume that the loss l satisfies the boundedness assumption (3). Then, for any π , ∈ P EPt ESt ˆ Rt(ρt(π, α), π, α) (cid:20)(cid:16) − where c = 8eC. ˆ Rt(ρt(π∗ cEPt ≤ α, α), π∗ α, α) 2 (cid:21) (cid:17) ˆ Rt(ρt(π, α), π, α) − ESt h ˆ Rt(ρt(π∗ α, α), π∗ , α, α) i Proof It classically holds (e.g. Alquier (2021)) that ˆ Rt(ρt(π, α), π, α) = − 1 nα log Eθ∼π e−nα ˆRt(θ) = log Eθ∼π e−nα ˆRt(θ) 1 τ − (cid:18) h for any fixed τ > 0. By the boundedness assumption, it holds that, for any π h i , ∈ P τ nα (cid:19) i (5) exp( − Cτ ) ≤ Eθ∼π e−nα ˆRt(θ) h i τ nα 1. ≤ We next use the following lemma, whose proof can be found in Appendix D. Lemma 4 Let f : x 1 τ log x. Then, for any x, y [exp( − ∈ Cτ ), 1], 7→ − (f (x) − f (y))2 8 exp(2Cτ ) τ ≤ f (x) + f (y) 2 f − x + y 2 . (cid:19)(cid:19) (cid:18) (cid:18) 7 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF An application of Lemma 4 to x = Eθ∼π e−nα ˆRt(θ) τ nα and y = Eθ∼π∗ α e−nα ˆRt(θ) τ nα gives 2 h i ˆ Rt(ρt(π, α), π, α) (cid:16) f (y))2 = (f (x) − 8 exp(2Cτ ) τ 8 exp(2Cτ ) τ " ≤ = h ˆ Rt(ρt(π∗ α, α), π∗ i α, α) − (cid:17) f f (x) + f (y) 2 x + y 2 (cid:18) (cid:19)(cid:19) Rt(ρt(π, α), π, α) + ˆ ˆ Rt(ρt(π∗ 2 − (cid:18) α, α), π∗ α, α) + 1 τ log x + y 2 (cid:18) (cid:19)# (these derivations are directly inspired from the proof technique introduced by Bartlett et al. (2006)). Taking expectations with respect to St ∼ Pt on both sides ˆ Rt(ρt(π∗ ˆ Rt(ρt(π, α), π, α) α, α), π∗ α, α) ESt − 2 (cid:20)(cid:16) ≤ Integrating with respect to Pt ∼ P EPt ESt ˆ Rt(ρt(π, α), π, α) − (cid:20)(cid:16) 8 exp(2Cτ ) τ ≤ 8 exp(2Cτ ) τ (cid:18) (cid:21) (cid:17) Rt(π, α) + 2 Rt(π∗ α, α) + Rt − (cid:18) π + π∗ α 2 , α . (cid:19)(cid:19) yields 2 α, α) ˆ Rt(ρt(π∗ α, α), π∗ EPtRt(π, α) + EPtRt(π∗ 2 (cid:17) (cid:21) α, α) EPtRt − π + π∗ α 2 (cid:18) . (6) , α (cid:19)! By definition of π∗ α, it holds that, for any π′ Rt(π∗ In particular, this holds for π′ = (π + π∗ EPt[ ∈ P α, α)] , EPt[ Rt(π′, α)]. ≤ α)/2 and plugging this into the right hand side of (6) gives EPt ESt ˆ Rt(ρt(π, α), π, α) (cid:20)(cid:16) − ˆ Rt(ρt(π∗ α, α), π∗ α, α) (cid:21) (cid:17) 4 exp(2Cτ ) τ ≤ EPtRt(π, α) − EPtRt(π∗ α, α) ! . The (optimal) choice τ = 1 2C gives the desired bound EPt ESt ˆ Rt(ρt(π, α), π, α) (cid:20)(cid:16) − ˆ Rt(ρt(π∗ α, α), π∗ α, α) 2 2 (cid:17) (cid:21) 4 exp(2Cτ ) EPt τ ≤ ESt ˆ Rt(π, α) " EPt ˆ Rt(π∗ α, α) # . − 8 FAST RATES IN META-LEARNING WITH PAC-BAYES 4.2 PAC-Bayes Bound for Meta-learning We will now seek for a prior π which allows to obtain a small meta-risk Eπ∼Π[ E (π)]. In order to do so, we will fix a set of possible priors )1. Given a probability distribution Λ G ⊆ P distribution on priors similarly as in (1), but at the meta-level: M ∈ G ( M and a set of distributions on these priors: called "prior on priors", we define Gibbs G ˆΠ = argminΠ∈G 1 T ( T t=1 X Eπ∼Π h ˆ Rt (ρt(π, α), π, α) + Λ) KL(Π k βT , ) i (7) where β > 0 is some parameter. As a consequence of Theorem 3 comes the next result, whose proof is given in Appendix E. Theorem 5 Assume that the loss l satisfies (3). Defining β = 1 C+c , it holds, for any (Θ), F ⊆ P EP1,...,PT ES1,...,ST E π∼ ˆΠ [ E (π)] ∗ − E ≤ 1 2 αcIB 2(1−Cα) EPT +1 inf Π∈G " − Eπ∼Π inf ρ∈F (cid:20) Eθ∼ρ[RT +1(θ) (cid:26) RT +1(θ∗ t )] + − π) KL(ρ k αn + Λ) KL(Π k βT + αC 2(1 8 − IB) . # (cid:27)(cid:21) While the bound given in Theorem 5 depends on some subset (Θ) chosen for computational reasons, the bound is on the excess risk of ˆΠ, which itself is based on the exact Gibbs posterior ρt(π, α), and not on its variational approximation ˆΠ( ), based on ρt(π, α, ) and defined as F ⊆ P F F ˆΠ( F ) = argminΠ∈G 1 T ( T t=1 X Eπ∼Π h ˆ Rt (ρt(π, α, F ), π, α) + i KL(Π Λ) k βT . ) In some settings, ˆΠ( open question to determine under what condition on F ) is tractable and its Gibbs-based counterpart ˆΠ is not, and it is a fundamental we can replace ˆΠ by ˆΠ( ) in Theorem 5. Open Question 1 Under what conditions on Theorem 5? F can we replace ˆΠ by ˆΠ( F ) in the left-hand side of 4.3 A Toy Application of Theorem 5: Concurrent Priors This subsection gives a toy application of Theorem 5 just to fix ideas. Here, we study the case where M statisticians propose a different prior, all of which are assumed to satisfy a prior mass condition as in Corollary 2. We denote by the set of priors. We choose Λ as = the uniform distribution on ). Here again, for the sake of simplicity, we assume G that Bernstein's condition (see Assumption 1) is satisfied at the task level. π1, . . . , πM } { M ( M and M = P 1. Note that measurability issues can arise when the set F is non parametric. However, in all our examples, the set F is parametric. 9 F F C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF A direct application of Theorem 5 and Corollary 2 gives EP1,...,PT ES1,...,ST E π∼ ˆΠ [ E (π)] ∗ − E ≤ 4 min π∈M EPT +1 dπ,T +1 log nα dπ,T +1 αn + log κπ,T +1 In other words, we obtain the rate of convergence provided by the best prior among at the price of an additional log(M )/T term. . + 4 log M βT , π1, . . . , πM } { 5 Applications of Theorem 5 In this section, by an application of Theorem 5, we derive explicit bounds on the excess risk of the Gibbs algorithm in the case of discrete priors (the parameter set Θ is finite; Subsection 5.1), Gaussian priors (Subsection 5.2) and mixtures of Gaussian priors (Subsection 5.3). 5.1 Learning Discrete Priors In this subsection, we assume that define A∗ as the smallest possible subset of Θ such that = M < Θ | ∞ | . Following Meunier and Alquier (2021), we P , θ∗ := argminθ RP (θ) A∗, (8) ∼ P A∗ | = Θ and m∗ ∈ ∀ . In general, A∗ = Θ and m∗ = M . However, in some favorable and we denote m∗ := | situations, A∗ M , in which case, the meta-learning may improve upon the learning ≪ in isolation. In the setting considered, Bernstein's condition is trivially satisfied and the excess risk of the Gibbs algorithm is 4 log(M ) αn We define our set of priors as the set of probability distributions πA which are uniform on . Θ and parameterized by A: M A ⊆ = A πA| { ⊆ Θ , } M ∈ { 1, . . . , M with probability 2M −m is the set of all distributions on and G draw m A ⊆ defined on . Our "prior on priors" Λ is then defined as follows: we 1), then given m, draw a subset Θ of cardinality m uniformly at random, and take πA. In other words, Λ is a distribution 1 (M m) 2M −1 ≈ such that Pπ∼Λ(π = πA) = 2M −m 2M −1 × Proposition 6 The excess risk of the meta predictor ˆΠ defined in (7) is bounded as follows: 2−m (for M M ≫ F } . EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ≤ E ∗ + 4 log m∗ αn + 4m∗ log 2eM m∗ βT . Remark 7 Let us now compare the meta-learning rate above to the 4 log M learning in isolation. In the unfavorable case m∗ than the learning in isolation one, by a term O(M/T ) which vanishes rapidly when T rate achieved by the M , the meta-learning bound is sensibly larger ∼ + αn . In the favorable case m∗ M however, the meta-learning considerably improves upon the → ∞ learning in isolation for large values of T . In the extreme case where m∗ = 1, we have ≪ EP1,...,PT 4 log(2eM ) βT Thus, the benefits of the meta-learning are mainly expected in the T n regime. They are huge when the tasks are very similar, and close to zero when the tasks are totally unrelated. This is in line with the results of Meunier and Alquier (2021) in the online setting. ES1,...,ST π∼ ˆΠ[ E ∗ + (π)] ≤ E ≫ E . 10 6 FAST RATES IN META-LEARNING WITH PAC-BAYES Proof We first consider learning in isolation. The classical choice is to take π as uniform in each task. An application of Theorem 1 gives ESt E θ∼ρt(π,α)[RPt(θ)] ∗ − E ≤ 2 inf ρ∈P(Θ) (cid:2) (cid:3) Eθ∼ρ [RPt(θ)] (cid:26) R∗ Pt + − KL(ρ π) k αn (cid:27) ≤ = Eθ∼ρ [RPt(θ)] 2 inf ρ=δθ (cid:26) 2 log M αn . R∗ Pt + − π) KL(ρ k αn (cid:27) In the meta-learning case, an application of Theorem 5 gives EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf 1≤m≤M inf |A|=m EPT +1∼P inf θ∈A RPT +1(θ) R∗ Pt+1 − (cid:20) log(m) αn n + + m log 2 + log βT M m o . (cid:0) (cid:1) (cid:21) Under the assumption (8), it holds that EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ≤ E ∗ + 4 log(m∗) αn + 4m∗ log(2) + 4 log βT M m∗ . (cid:0) (cid:1) We conclude by using the classic bound log m log M e m . M m (cid:0) (cid:1) ≤ 5.2 Learning Gaussian priors In this subsection, we consider the set of all Gaussian distributions = M ( pμ,σ2 = d N Oi=1 (μi, σ2 i ), μ = (μ1, . . . , μd) Rd, σ2 = (σ2 1, . . . , σ2 d) ∈ (R∗ +)d . ) ∈ (9) So, priors on priors are actually defined as priors on μ and σ2 given by: = G ( qτ,ξ2,a,b = (τk,i, ξ2 k) N K ⊗ Ok=1 Ok∈[K] i∈[d] Γ(ak, bk) , ) (10) and we choose the prior on priors as Λ = q0, ̄ ̄ξ2, ̄ ̄a, ̄ ̄b. From now on and until the end of this section, we assume that both (4) and Assumption 1 (Bernstein's condition) hold, and we are looking for a prior on priors Π from which to sample π, such that ρT +1(π, α) concentrates as much as possible to the best parameter. Denoting μ∗ := EPT +1∼P [μPT +1] and Σ( μPT +1 − P k , the following holds. ) := EPT +1∼P 2 k μ∗ (cid:2) 11 (cid:3) C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF Proposition 8 Under Assumptions 1 and 4, the excess risk of ˆΠ defined in (7) for in (9) and (10) is bounded as follows: and G M defined EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] −E ∗ ≤ ( G(C, μ∗, ̄ ̄ξ, L, ̄ ̄a, ̄ ̄b) d+log(T ) F (C, μ∗, ̄ ̄ξ, L, ̄ ̄a, ̄ ̄b) T d log n+Σ(P) n where F and G are functions of the problem parameters. (cid:16) ) if Σ( ≤ P otherwise, n T ; + d T (cid:17) Interestingly enough, in the favorable case Σ( log T T to the very fast rate of convergence O P ) n T , a proper choice of the prior of priors lead , which considerably improves upon the fast rate ≤ 1 n + 1 O F and G, are given in Appendix F. when n ≪ T (cid:0) (cid:1) T . The detailed proof of this proposition, as well as explicit expressions of (cid:16) (cid:17) 5.3 Learning Mixtures of Gaussian priors In this subsection, we generalize the result of the previous section to priors that are mixtures of Gaussians. We still assume that Assumption 4 and Assumption 1 (Bernstein's condition) hold. We first assume the number of components in the mixture is known. Under these hypotheses, the set of possible priors π is = M pw,μ,σ2 = ( K d wk Xk=1 Oi=1 (μk,i, σ2 k,i) : N k ∀ [K], wk ≥ ∈ 0, 1⊤w = 1 ) . (11) We add a Dirichlet prior on the weights w of the components in the mixture, and the set of priors on priors becomes = G ( qδ,τ,ξ2,b = Dir(δ) (τk,i, ξ2 k) N ⊗ Ok∈[K] i∈[d] K ⊗ Ok=1 Γ(2, bk) : δ = (δ1, . . . , δK ) RK , ) ∈ (12) while the initial prior on priors is chosen as Λ = qIK ,0, ̄ ̄ξ2, ̄ ̄b. We define ΣK( P ) := inf τ1,...,τK EPT +1∼P min k∈[K] k μPT +1 − (cid:20) 2 τkk . (cid:21) Proposition 9 Under Assumptions 1 and 4, the excess risk of ˆΠ defined in (7) for in (11) and (12) is bounded as follows: and G M defined EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ CVfinite(K, n) + K × CVGaussian (d, ΣK( + CVmeta(T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ), ), n, T ) P where CVfinite(K, n) = 4 log(2K) αn ; CVmeta(T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ) = O CVGaussian (d, ΣK ( P ), n, T ) = ( 8Ld T + 4 αn log (1 + 4αLn) + 4ΣK (P) αn αT 2d 12 dK log T T ; (cid:18) if ΣK( ) P otherwise. ≤ (cid:19) n T 2 ; and is a O When T dK log T T FAST RATES IN META-LEARNING WITH PAC-BAYES Let us analyze each of the terms of the above bound. The first term CVfinite(K, n) is the bound we had in the finite case of Subsection 5.1. Visualizing our K mixtures as the K points in the finite case, this term is the time required by our estimator to select the right mixture. While this term we might hope for, it is makes the convergence rate of O essentially unavoidable as it appears in the much simpler model of a finite set of K parameters described in Subsection 5.1. notably worse than the O n + 1 1 T (cid:0) (cid:0) (cid:1) (cid:1) T 1 The next term CVGaussian (d, ΣK ( case of Subsection 5.2, with the exception that Σ( convergence time to the best Gaussian for every task t. P Eventually, the last term CVmeta(T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ) is the convergence term at the meta level . This is the cost of the meta learning compared to the learning in isolation. ) is replaced by ΣK( ), n, T ) is (similar to) the bound obtained in the Gaussian ), and scales with the P P n, this term is very small and justifies the use of the meta learning. (cid:16) ≫ (cid:17) 1 T (cid:0) n + 1 Remark 10 One may think, looking at the bounds in the two previous cases considered, that the convergence rate in the case of mixtures of Gaussians is slower than the one for Gaus- O . In reality, the rate of convergence is (naturally) faster for the sians which can be as fast as O model of mixtures of Gaussians, because in the case of mixtures of Gaussians, the convergence term n CVGaussian (d, ΣK( T , while in the Gaus- n T is required. Under this assumption, sian case, the much stronger assumption Σ( (cid:0) P the similar rate O is naturally achieved. under the assumption that ΣK( (cid:0) ), n, T ) is O ) = Σ1( (cid:1) 1 T ≤ ≤ 1 T P P P (cid:1) (cid:1) ) ) 1 T We now consider the case when the number of mixtures K is unknown. The set of priors hence becomes the set of all (finite) mixtures of Gaussians: (cid:0) (cid:1) = M pw,μ,σ2 = ( +∞ d wk Xk=1 Oi=1 (μk,i, σ2 k,i) : N K ∃ ≥ 1 : k ∀ ≥ K + 1, wk = 0 ) . (13) In the definition of the set of priors on priors T (otherwise, there is a high chance of overfitting). We then set a Dirichlet prior on the number of components K, and given K, set the same model as before. Formally, , we assume that K ≤ G = qx,δ,τ,ξ2,b = qx × ( G qδ,τ,ξ2,b|K , ) (14) and we set the prior on priors Λ = q 1 T IT ,IK ,0, ̄ ̄ξ2, ̄ ̄b. The application of Theorem 5 yields the bound Proposition 11 Under the same conditions and using the same notations as Proposition 9, the excess risk of ˆΠ defined in (7) for defined in (13) and (14) is bounded as follows: and M G EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ inf K∈[T ] ( CVfinite(K, n) + K CVGaussian (d, ΣK ( P × ), n, T ) + CVunknown meta (T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ) , ) where the convergence term at the meta level becomes CVunknown meta (T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ) = CVmeta(T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ) + 2 log T βT . 13 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF Our estimator takes 2 log T to find the optimal number of mixtures at the meta level. This is the price βT to pay to have the infimum on K in the bound. In the limit T n and when no prior information on K is available, this clearly improves upon the bound of Proposition 9, and hence justifies setting a prior on K at the meta level rather than choosing an isolated K, pleading again in the favor of meta-learning. The proof of all the results of this subsection is given in Appendix G. ≫ 6 Discussion In recent years, the statistical guarantees of meta-learning have received increasing attention. In the following paragraphs, we present a short review of the literature on the statistical theory of meta-learning, followed by a brief discussion of three papers that are closely related to our analysis. Theoretical bounds in meta-learning. The first theoretical analysis of meta-learning goes back to Baxter (2000), who introduced the notion of task environment and derived a uniform generalization bound based on the capacity and covering number of the model. Following this i.i.d. task environ- ment setting, many other generalization bounds have since been provided for different strategies and proof techniques, including VC theory (Baxter, 2000; Ben-David and Schuller, 2003; Maurer, 2009; Maurer et al., 2016; Guan and Lu, 2022b), algorithmic stability (Maurer and Jaakkola, 2005; Chen et al., 2020; Al-Shedivat et al., 2021; Guan et al., 2022) and information theory (Jose and Simeone, 2021; Chen et al., 2021; Jose et al., 2021; Rezazadeh et al., 2021; Hellstr ̈om and Durisi, 2022). A related approach for deriving such bounds is based on PAC-Bayes theory. First proposed in the meta-learning framework in the pioneering paper of Pentina and Lampert (2014), this idea of learn- ing a hyper-posterior that generates a prior for the new task has been taken up several times in the recent years (Amit and Meir, 2018; Ding et al., 2021; Liu et al., 2021; Rothfuss et al., 2021; Farid and Majumdar, 2021; Rothfuss et al., 2022; Guan and Lu, 2022a; Rezazadeh, 2022). In par- ticular, Amit and Meir (2018) derived a new PAC-Bayes bound, which they applied to the opti- mization of deep neural networks, albeit with computational limitations. This latter concern was partially addressed by Rothfuss et al. (2021), who also specified the hyper-posterior and extended the results to unbounded losses, and further investigated their study in Rothfuss et al. (2022). Some papers combined ideas from different literatures, such as Farid and Majumdar (2021), who ex- plored the link between PAC-Bayes and uniform stability in meta-learning, and provided a pre- cise analysis of stability and generalization. Excess risk bounds have also been provided in the i.i.d. task environment framework, see Maurer et al. (2016); Denevi et al. (2018a,b, 2019a,b, 2020); Balcan et al. (2019); Bai et al. (2021); Chen and Chen (2022). The task environment assumption has recently been challenged, for example by Du et al. (2020) and Tripuraneni et al. (2021), who proposed to use assumptions on the distributional similarity between the features and the diversity of tasks to control the excess risk, an idea further explored by Fallah et al. (2021) who exploited a notion of diversity between the new task and training tasks using the total variation distance. Finally, a detailed analysis of regret bounds in lifelong learning has been carried out in recent years (Alquier et al., 2017; Denevi et al., 2018b, 2019b; Balcan et al., 2019; Khodak et al., 2019; Finn et al., 2019; Meunier and Alquier, 2021). Comparison to Denevi et al. (2019a). Denevi et al. (2019a) is probably the study that is the most related to our paper. The authors provide statistical guarantees for Ridge regression with a meta- learned bias, and focus on the usefulness of their strategy relative to single-task learning, proving that their method outperforms the standard l2-regularized empirical risk minimizer. In particular, 14 FAST RATES IN META-LEARNING WITH PAC-BAYES they can achieve an excess risk rate of order O Σ( ) is a variance term similar to the one we defined in our Gaussian example. in the favorable case Σ( 1/√T (cid:16) (cid:17) ) ≤ n T , where P P Comparison to Guan et al. (2022). To the best of our knowledge, Guan et al. (2022) is the only work in the meta-learning literature that addresses fast rates with respect to the number of tasks T under the task environment assumption. However, we actually show in our paper that there is no need to extend Bernstein's condition when using exact Bayesian inference and that the final posterior naturally satisfies the extended Bernstein assumption, thus giving fast rates with respect to T , while Guan et al. (2022) require an additional Polyak-Łojasiewicz condition to achieve fast rates. Furthermore, their analysis is very different in nature, relying on stability arguments to derive generalization bounds, while we use PAC-Bayes theory to control the excess risk. Comparison to Guan and Lu (2022a) and Rezazadeh (2022). Finally, Guan and Lu (2022a) and Rezazadeh (2022) provide fast rate generalization bounds based on Catoni's PAC-Bayes inequality. Nevertheless, their notion of fast rates differs substantially from ours: our rates quantify the rate of convergence of the excess risk, in line with the classic statistical learning literature. In contrast, the fast rates of Guan and Lu (2022a) are only available for a variant of the generalization gap that compares the theoretical risk to a factor of the empirical risk. In order to obtain a sharp factor equal to 1 in front of the empirical risk, one needs to fine-tune a parameter in Guan and Lu (2022a)'s inequality, which would then return a slow rate. 7 Conclusion and open problems We provided an analysis of the excess risk in meta-learning the prior via PAC-Bayes bounds. Sur- prisingly, at the meta-level, conditions for fast rates are always satisfied if one uses exact Gibbs posteriors at the task level. An important problem is to extend this result to variational approxima- tions of Gibbs posteriors. References Alessandro Achille, Michael Lam, Rahul Tewari, Avinash Ravichandran, Subhransu Maji, Char- less C Fowlkes, Stefano Soatto, and Pietro Perona. Task2vec: Task embedding for meta-learning. In Proceedings of the IEEE/CVF international conference on computer vision, pages 6430–6439, 2019. Maruan Al-Shedivat, Liam Li, Eric Xing, and Ameet Talwalkar. On data efficiency of meta-learning. In International Conference on Artificial Intelligence and Statistics, pages 1369–1377. PMLR, 2021. P. Alquier, J. Ridgway, and N. Chopin. On the properties of variational approximations Journal of Machine Learning Research, 17(239):1–41, 2016. URL of Gibbs posteriors. http://jmlr.org/papers/v17/15-290.html. Pierre Alquier. User-friendly introduction to PAC-Bayes bounds. arXiv preprint arXiv:2110.11216, 2021. Pierre Alquier, The Tien Mai, and Massimiliano Pontil. Regret Bounds for Lifelong Learning. In Aarti Singh and Jerry Zhu, editors, Proceedings of the 20th International Conference on Artificial 15 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF Intelligence and Statistics, volume 54 of Proceedings of Machine Learning Research, pages 261– 269, Fort Lauderdale, FL, USA, 20–22 Apr 2017. PMLR. R. Amit and R. Meir. Meta-learning by adjusting priors based on extended PAC-Bayes theory. In International Conference on Machine Learning, pages 205–214. PMLR, 2018. Yu Bai, Minshuo Chen, Pan Zhou, Tuo Zhao, Jason Lee, Sham Kakade, Huan Wang, and Caiming Xiong. How important is the train-validation split in meta-learning? In International Conference on Machine Learning, pages 543–553. PMLR, 2021. Maria-Florina Balcan, Mikhail Khodak, and Ameet Talwalkar. Provable guarantees for gradient- based meta-learning. In International Conference on Machine Learning, pages 424–433. PMLR, 2019. P. L. Bartlett, M. I. Jordan, and J. D. McAuliffe. Convexity, classification, and risk bounds. Journal of the American Statistical Association, 101(473):138–156, 2006. Peter L Bartlett and Shahar Mendelson. Empirical minimization. Probability theory and related fields, 135(3):311–334, 2006. Jonathan Baxter. A model of inductive bias learning. Journal of artificial intelligence research, 12: 149–198, 2000. Shai Ben-David and Reba Schuller. Exploiting task relatedness for multiple task learning. In Learning Theory and Kernel Machines: 16th Annual Conference on Learning Theory and 7th Kernel Workshop, COLT/Kernel 2003, Washington, DC, USA, August 24-27, 2003. Proceedings, pages 567–580. Springer, 2003. P. G. Bissiri, C. C. Holmes, and S. G. Walker. A general framework for updating belief distributions. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 78(5):1103–1130, 2016. S. Boucheron, G. Lugosi, and P. Massart. Concentration Inequalities. Oxford University Press, 2013. R. Caruana. Multitask learning. Machine Learning, 28(1):41–75, 1997. O. Catoni. Statistical Learning Theory and Stochastic Optimization. Saint-Flour Summer School on Probability Theory 2001 (Jean Picard ed.), Lecture Notes in Mathematics. Springer, 2004. O. Catoni. PAC-Bayesian supervised classification: the thermodynamics of statistical learning. Institute of Mathematical Statistics Lecture Notes – Monograph Series, 56. Institute of Mathe- matical Statistics, Beachwood, OH, 2007. Jiaxin Chen, Xiao-Ming Wu, Yanke Li, Qimai Li, Li-Ming Zhan, and Fu-lai Chung. A closer look at the training strategy for modern meta-learning. Advances in Neural Information Processing Systems, 33:396–406, 2020. Lisha Chen and Tianyi Chen. Is bayesian model-agnostic meta learning better than model-agnostic meta learning, provably? In International Conference on Artificial Intelligence and Statistics, pages 1733–1774. PMLR, 2022. 16 FAST RATES IN META-LEARNING WITH PAC-BAYES Lisha Chen, Sharu Theresa Jose, Ivana Nikoloska, Sangwoo Park, Tianyi Chen, and Osvaldo Sime- one. Learning with limited samples: Meta-learning and applications to communication systems. Foundations and Trends® in Signal Processing, 17(2):79–208, 2023. Qi Chen, Changjian Shui, and Mario Marchand. Generalization bounds for meta-learning: An information-theoretic analysis. Advances in Neural Information Processing Systems, 34:25878– 25890, 2021. T. Cover and J. Thomas. Elements of Information Theory. Wileys Series in Communication. A. Dalalyan and A. B. Tsybakov. Aggregation by exponential weighting, sharp PAC-Bayesian bounds and sparsity. Machine Learning, 72(1-2):39–61, 2008. G. Denevi, C. Ciliberto, D. Stamos, and M. Pontil. Learning to learn around a common mean. Advances in neural information processing systems, 31, 2018a. G. Denevi, C. Ciliberto, D. Stamos, and M. Pontil. Incremental learning-to-learn with statistical guarantees. arXiv preprint arXiv:1803.08089, 2018b. G. Denevi, C. Ciliberto, R. Grazzi, and M. Pontil. Learning-to-learn stochastic gradient descent with biased regularization. In International Conference on Machine Learning, pages 1566–1575. PMLR, 2019a. Giulia Denevi, Dimitris Stamos, Carlo Ciliberto, and Massimiliano Pontil. Online-within-online meta-learning. Advances in Neural Information Processing Systems, 32, 2019b. Giulia Denevi, Massimiliano Pontil, and Carlo Ciliberto. The advantage of conditional meta- learning for biased regularization and fine tuning. Advances in Neural Information Processing Systems, 33:964–974, 2020. N. Ding, X. Chen, T. Levinboim, S. Goodman, and R. Soricut. Bridging the gap between practice and pac-bayes theory in few-shot meta-learning. Advances in neural information processing systems, 34:29506–29516, 2021. M. D. Donsker and S. S. Varadhan. Asymptotic evaluation of certain markov process expectations for large time. iii. Communications on Pure and Applied Mathematics, 28:389–461, 1976. Zi-Yi Dou, Keyi Yu, and Antonios Anastasopoulos. Investigating meta-learning algorithms for low-resource natural language understanding tasks. arXiv preprint arXiv:1908.10423, 2019. Simon S Du, Wei Hu, Sham M Kakade, Jason D Lee, and Qi Lei. Few-shot learning via learning the representation, provably. arXiv preprint arXiv:2002.09434, 2020. Alireza Fallah, Aryan Mokhtari, and Asuman Ozdaglar. Generalization of model-agnostic meta- learning algorithms: Recurring and unseen tasks. Advances in Neural Information Processing Systems, 34:5469–5480, 2021. A. Farid and A. Majumdar. Generalization bounds for meta-learning via pac-bayes and uniform stability. Advances in neural information processing systems, 34:2173–2186, 2021. 17 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International conference on machine learning, pages 1126–1135. PMLR, 2017. Chelsea Finn, Aravind Rajeswaran, Sham Kakade, and Sergey Levine. Online meta-learning. In International Conference on Machine Learning, pages 1920–1930. PMLR, 2019. S. Ghosal and A. Van der Vaart. Fundamentals of nonparametric Bayesian inference, volume 44. Cambridge University Press, 2017. Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4367– 4375, 2018. Erin Grant, Chelsea Finn, Sergey Levine, Trevor Darrell, and Thomas Griffiths. Recasting gradient- based meta-learning as hierarchical bayes. arXiv preprint arXiv:1801.08930, 2018. Peter D Gr ̈unwald and Nishant A Mehta. Fast rates for general unbounded loss functions: from erm to generalized bayes. The Journal of Machine Learning Research, 21(1):2040–2119, 2020. Jiatao Gu, Yong Wang, Yun Chen, Kyunghyun Cho, and Victor OK Li. Meta-learning for low- resource neural machine translation. arXiv preprint arXiv:1808.08437, 2018. J. Guan and Z. Lu. Fast-rate pac-bayesian generalization bounds for meta-learning. In International conference on machine learning, pages 7930–7948. PMLR, 2022a. J. Guan, Y. Liu, and Z. Lu. Fine-grained analysis of stability and generalization for modern meta learning algorithms. Advances in neural information processing systems, 2022. Jiechao Guan and Zhiwu Lu. Task relatedness-based generalization bounds for meta learning. In International Conference on Learning Representations, 2022b. B. Guedj. A primer on PAC-Bayesian learning. In Proceedings of the second congress of the French Mathematical Society, 2019. Mahdi Haghifam, Gintare Karolina Dziugaite, Shay Moran, and Dan Roy. Towards a unified information-theoretic framework for generalization. Advances in Neural Information Process- ing Systems, 34:26370–26381, 2021. Fredrik Hellstr ̈om and Giuseppe Durisi. Evaluated cmi bounds for meta learning: Tightness and expressiveness. arXiv preprint arXiv:2210.06511, 2022. Sepp Hochreiter, A Steven Younger, and Peter R Conwell. Learning to learn using gradient descent. In Artificial Neural Networks-ICANN 2001: International Conference Vienna, Austria, August 21–25, 2001 Proceedings 11, pages 87–94. Springer, 2001. Po-Sen Huang, Chenglong Wang, Rishabh Singh, Wen-tau Yih, and Xiaodong He. Natural language to structured query generation via meta-learning. arXiv preprint arXiv:1803.02400, 2018. Sharu Theresa Jose and Osvaldo Simeone. Information-theoretic generalization bounds for meta- learning and applications. Entropy, 23(1):126, 2021. 18 FAST RATES IN META-LEARNING WITH PAC-BAYES Sharu Theresa Jose, Osvaldo Simeone, and Giuseppe Durisi. Transfer meta-learning: Information- IEEE Transactions on Information theoretic bounds and information meta-risk minimization. Theory, 68(1):474–501, 2021. Mikhail Khodak, Maria-Florina F Balcan, and Ameet S Talwalkar. Adaptive gradient-based meta- learning methods. Advances in Neural Information Processing Systems, 32, 2019. Gregory Koch, Richard Zemel, Ruslan Salakhutdinov, et al. Siamese neural networks for one-shot image recognition. In ICML deep learning workshop, volume 2. Lille, 2015. Brian Kulis, Kate Saenko, and Trevor Darrell. What you saw is not what you get: Domain adaptation using asymmetric kernel transforms. In CVPR 2011, pages 1785–1792. IEEE, 2011. Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy Hospedales. Learning to generalize: Meta- In Proceedings of the AAAI conference on artificial intel- learning for domain generalization. ligence, volume 32, 2018. Tianyu Liu, Jie Lu, Zheng Yan, and Guangquan Zhang. Pac-bayes bounds for meta-learning with data-dependent prior. arXiv preprint arXiv:2102.03748, 2021. E. Mammen and A. B. Tsybakov. Smooth discrimination analysis. the Annals of Statistics, 27(6): 1808–1829, 1999. A. Maurer. Transfer bounds for linear feature learning. Machine Learning, 75(3):327–350, 2009. A. Maurer and T. Jaakkola. Algorithmic stability and meta-learning. The Journal of Machine Learning Research, 6(6), 2005. A. Maurer, M. Pontil, and B. Romera-Paredes. The benefit of multitask representation learning. The Journal of Machine Learning Research, 17(81):1–32, 2016. D. A. McAllester. Some PAC-Bayesian theorems. In Proceedings of the Eleventh Annual Confer- ence on Computational Learning Theory, pages 230–234, New York, 1998. ACM. D. Meunier and P. Alquier. Meta-strategy for learning tuning parameters with guarantees. Entropy, 23(10), 2021. Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. A simple neural attentive meta- learner. ICLR, 2018. Tsendsuren Munkhdalai and Hong Yu. Meta networks. In International conference on machine learning, pages 2554–2563. PMLR, 2017. Cuong Nguyen, Thanh-Toan Do, and Gustavo Carneiro. Uncertainty in model-agnostic meta- In Proceedings of the IEEE/CVF Winter Conference on learning using variational inference. Applications of Computer Vision, pages 3090–3100, 2020. Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018. 19 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on knowledge and data engineering, 22(10):1345–1359, 2010. A. Pentina and C. Lampert. A PAC-Bayesian bound for lifelong learning. In International Confer- ence on Machine Learning, pages 991–999. PMLR, 2014. Kun Qian and Zhou Yu. Domain adaptive dialog generation via meta learning. arXiv preprint arXiv:1906.03520, 2019. Siyuan Qiao, Chenxi Liu, Wei Shen, and Alan L Yuille. Few-shot image recognition by predicting In Proceedings of the IEEE conference on computer vision and parameters from activations. pattern recognition, pages 7229–7238, 2018. Ariadna Quattoni, Michael Collins, and Trevor Darrell. Transfer learning for image classification with sparse prototype representations. In 2008 IEEE Conference on Computer Vision and Pattern Recognition, pages 1–8. IEEE, 2008. Aravind Rajeswaran, Chelsea Finn, Sham M Kakade, and Sergey Levine. Meta-learning with im- plicit gradients. Advances in neural information processing systems, 32, 2019. Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In International conference on learning representations, 2017. A. Rezazadeh. A unified view on pac-bayes bounds for meta-learning. In International conference on machine learning, pages 18576–18595. PMLR, 2022. Arezou Rezazadeh, Sharu Theresa Jose, Giuseppe Durisi, and Osvaldo Simeone. Conditional mu- tual information-based generalization bound for meta learning. In 2021 IEEE International Sym- posium on Information Theory (ISIT), pages 1176–1181. IEEE, 2021. J. Rothfuss, V. Fortuin, M. Josifoski, and A. Krause. Pacoh: Bayes-optimal meta-learning with pac- guarantees. In International conference on machine learning, pages 9116–9126. PMLR, 2021. J. Rothfuss, M. Josifoski, V. Fortuin, and A. Krause. Pac-bayesian meta-learning: From theory to practice. arXiv preprint arXiv:2211.07206, 2022. D. Russo and J. Zou. How much does your data exploration overfit? controlling bias via information usage. IEEE Transactions on Information Theory, 66(1):302–323, 2019. Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Meta- In International conference on machine learning with memory-augmented neural networks. learning, pages 1842–1850. PMLR, 2016. J. Shawe-Taylor and R. Williamson. A PAC analysis of a Bayes estimator. In Proceedings of the Tenth Annual Conference on Computational Learning Theory, pages 2–9, New York, 1997. ACM. Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. Ad- vances in neural information processing systems, 30, 2017. 20 FAST RATES IN META-LEARNING WITH PAC-BAYES Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip HS Torr, and Timothy M Hospedales. Learning to compare: Relation network for few-shot learning. In Proceedings of the IEEE con- ference on computer vision and pattern recognition, pages 1199–1208, 2018. Sebastian Thrun and Lorien Pratt. Learning to learn: Introduction and overview. Kluwer Academic Publishers, pages 3–17, 1998. Nilesh Tripuraneni, Chi Jin, and Michael Jordan. Provable meta-learning of linear representations. In International Conference on Machine Learning, pages 10434–10443. PMLR, 2021. A. B. Tsybakov. Optimal aggregation of classifiers in statistical learning. the Annals of Statistics, 32(1):135–166, 2004. Joaquin Vanschoren. Meta-learning. Automated machine learning: methods, systems, challenges, pages 35–61, 2019. Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. Advances in neural information processing systems, 29, 2016. Jane X Wang, Zeb Kurth-Nelson, Dhruva Tirumala, Hubert Soyer, Joel Z Leibo, Remi Munos, Charles Blundell, Dharshan Kumaran, and Matt Botvinick. Learning to reinforcement learn. arXiv preprint arXiv:1611.05763, 2016. A. Xu and M. Raginsky. Information-theoretic analysis of generalization capability of learning al- gorithms. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS'17, page 2521–2530, Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 9781510860964. Jun Yang, Shengyang Sun, and Daniel M Roy. Fast-rate pac-bayes generalization bounds via shifted rademacher processes. Advances in Neural Information Processing Systems, 32, 2019. Jaesik Yoon, Taesup Kim, Ousmane Dia, Sungwoong Kim, Yoshua Bengio, and Sungjin Ahn. Bayesian model-agnostic meta-learning. Advances in neural information processing systems, 31, 2018. Tianhe Yu, Deirdre Quillen, Zhanpeng He, Ryan Julian, Karol Hausman, Chelsea Finn, and Sergey Levine. Meta-world: A benchmark and evaluation for multi-task and meta reinforcement learn- ing. In Conference on robot learning, pages 1094–1100. PMLR, 2020. Tong Zhang. Information-theoretic upper and lower bounds for statistical estimation. IEEE Trans- actions on Information Theory, 52(4):1307–1321, 2006. Yu Zhang and Qiang Yang. A survey on multi-task learning. IEEE Transactions on Knowledge and Data Engineering, 34(12):5586–5609, 2021. Fuzhen Zhuang, Zhiyuan Qi, Keyu Duan, Dongbo Xi, Yongchun Zhu, Hengshu Zhu, Hui Xiong, and Qing He. A comprehensive survey on transfer learning. Proceedings of the IEEE, 109(1): 43–76, 2020. 21 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF Appendix A. Some Useful Formulas The following (known) results are used throughout the text. They are recalled here without proof. A.1 Concentration Inequalities For Hoeffding and Bernstein see Boucheron et al. (2013). For Donsker and Varadhan, see for ex- ample Catoni (2007). Lemma 12 (Hoeffding's inequality) Let U1, . . . , Un be i.i.d random variables taking values in an interval [a, b]. Then, for any s > 0, Lemma 13 (Bernstein's inequality) Let U1, . . . , Un be i.i.d random variables such that for any k 2, ≥ V C k−2. (15) E es P n i=1[Ui−E(Ui)] ns2(b−a)2 8 e . ≤ h i k! 2 E k Ui| | h i ≤ Then, for any s (0, 1/C], ∈ Note that in particular, if Ui| ≤ | E es P n i=1[Ui−E(Ui)] ns2V 2(1−sC) . e ≤ h i C almost surely, 15 always holds with V = E(U 2 i ). A.2 Donsker and Varadhan's Lemma Lemma 14 (Donsker and Varadhan's variational inequality Donsker and Varadhan (1976)) Let μ be a probability measure on Θ. For any measurable, bounded function h : Θ R, we have: → log Eθ∼μ eh(θ) = sup Eθ∼ρ[h(θ)] ρ∈P(Θ) μ) KL(ρ k − . n Moreover, the supremum with respect to ρ in the right-hand side is reached for the Gibbs measure μh defined by its density with respect to μ o h i dμh dμ (θ) = eh(θ) Eθ∼μ eh(θ) . A.3 KL Divergence of some known Distributions (cid:2) (cid:3) Denoting by H(x) the entropy of (x1, . . . , xT ), recall that the KL divergence between a multinomial is distribution of parameters (x1, . . . , xT ) and a multinomial distribution of parameters 1 T , . . . , 1 T KL (cid:18) Mult Mult(x) k 1 T (cid:18) (cid:19)(cid:19) = log T H(x). − (cid:0) (cid:1) (16) Recall that the KL divergence between 2 normal distributions is KL N (cid:0) (μ, σ2) kN ( ̄μ, ̄σ2) = 1 2 (cid:1) (μ (cid:18) 22 ̄μ)2 − ̄σ2 + σ2 ̄σ2 − 1 + log ̄σ2 σ2 . (cid:19) (17) FAST RATES IN META-LEARNING WITH PAC-BAYES Recall that the KL divergence between 2 Gamma distributions is KL Γ Γ(a, b) k ̄ ̄a, ̄ ̄b (cid:16) (cid:16) (cid:17)(cid:17) = (a − ̄ ̄a) ψ(a) + log Γ ( ̄ ̄a) Γ(a) + ̄ ̄a log + a ̄ ̄b b . − b b ̄ ̄b (18) Recall that the KL divergence between a Dirichlet distribution of parameter δ and a Dirichlet distri- bution of parameter 1K = (1, . . . , 1) is Dir(1K )) = log KL (Dir(δ) k Γ(K) Appendix B. Proof of Theorem 1 Γ(1⊤δ) K k=1 Γ(δk) × Q K + Xk=1 (δk − 1) ψ(δk) (cid:16) − ψ(1⊤δ) . (19) (cid:17) We mostly follow the proof technique developed in Catoni (2007). For any s > 0, fix θ Ui = E[l(Zt,i, θ)] distinguish two cases, whether or not Bernstein assumption is satisfied. If Bernstein assumption is satisfied, we apply Lemma 13 to Ui. Note that in this case, V is actually the variance term Vt(θ, θ∗ Θ and let . We are going to } t )] + l(Zt,i, θ∗ t ). So, for any s > 0, E[l(Zt,i, θ∗ t ) for any i l(Zt,i, θ) 1, . . . , n ∈ { − − ∈ ESt sn e RPt (θ)− ˆRt(θ)−R∗ Pt (cid:16) + ˆRt(θ∗ t ) (cid:17) (cid:20) We let s = λ/n, which gives ESt λ e (cid:16) RPt (θ)− ˆRt(θ)−R∗ Pt + ˆRt(θ∗ t ) (cid:17) (cid:20) Making use of Bernstein hypothesis gives ns2 V (θ,θ∗ t ) 2(1−sC) . e λ2V (θ,θ∗ t ) 2(n−Cλ) . e ≤ (cid:21) ≤ (cid:21) RPt (θ)− ˆRt(θ)−R∗ Pt + ˆRt(θ∗ t ) (cid:17) ESt (cid:16) λ e (cid:20) e ≤ (cid:21) λ2c(RPt (θ)−R∗ Pt) 2(n−Cλ) . If Bernstein hypothesis is not satisfied, we apply Lemma 12 to Ui, which gives, for any s > 0, Letting s = λ/n gives ESt sn e RPt (θ)− ˆRt(θ)−R∗ Pt (cid:16) + ˆRt(θ∗ t ) (cid:17) (cid:20) ESt λ e (cid:16) RPt (θ)− ˆRt(θ)−R∗ Pt + ˆRt(θ∗ t ) (cid:17) (cid:20) ns2 C2 8 e . λ2C2 8n . e ≤ (cid:21) ≤ (cid:21) Defining the general bound λ2c W = R∗ Pt RPt(θ) 2(n (cid:0) − − Cλ) λ2C 2 8n IB), (1 − IB + (cid:1) (20) where IB is equal to 1 if Bernstein assumption is satisfied, and 0 otherwise, it holds in either case that RPt (θ)− ˆRt(θ)−R∗ Pt + ˆRt(θ∗ t ) (cid:17) ESt (cid:16) λ e (cid:20) eW . ≤ (cid:21) 23 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF Rearranging the terms gives ESt λ e (cid:16) RPt (θ)−R∗ Pt (cid:20) − W λ − ˆRt(θ)+ ˆRt(θ∗ t ) (cid:17) 1. ≤ (cid:21) Next, integrating this bound with respect to π and using Fubini's theorem to exchange both integrals gives ESt Eθ∼π λ e (cid:16) RPt (θ)−R∗ Pt (cid:20) − W λ − ˆRt(θ)+ ˆRt(θ∗ t ) (cid:17) 1. ≤ (cid:21) We then apply Lemma 14 to the argument of the expectation with respect to the sample, and we have ESt supρ∈P(Θ) e λEθ∼ρ n RPt (θ)−R∗ Pt h − W λ − ˆRt(θ)+ ˆRt(θ∗ t ) i −KL(ρkπ) o Jensen's inequality implies (cid:20) 1. ≤ (cid:21) λESt e supρ∈P(Θ) h Eθ∼ρ n RPt (θ)−R∗ Pt h − W λ − ˆRt(θ)+ ˆRt(θ∗ t ) i − KL(ρkπ) λ 1, oi ≤ in other words, ESt Eθ∼ρ sup " ρ∈P(Θ) (cid:26) (cid:20) RPt(θ) R∗ Pt − − W λ − ˆRt(θ) + ˆRt(θ∗ t ) (cid:21) − KL(ρ π) k λ 0. (cid:27)# ≤ At this stage, we can replace W by its value given in (20) to obtain the bound: ESt " Eθ∼ρ sup ρ∈P(Θ) (cid:26) 1 (cid:20) (cid:18) λcIB − 2(n − Cλ) RPt(θ) R∗ Pt − (cid:19) (cid:0) λC 2(1 − 8n − IB) (cid:1) ˆRt(θ) + ˆRt(θ∗ t ) (cid:21) − − KL(ρ π) k λ 0. (cid:27)# ≤ Next, we rearrange the terms and replace the supremum on ρ by ρt(π, α): ESt E θ∼ρt(π,α) [RPt(θ)] R∗ Pt ≤ − 1 ESt E θ∼ρt(π,α) (cid:20) × (cid:18) ˆRt(θ∗ t ) + − π) KL(ρt(π, α) k λ + λC 2(1 − 8n IB) . (cid:19) (cid:21) We then replace λ by αn and by definition of Gibbs posterior ρt(π, α), the above bound is the same as ESt E θ∼ρt(π,α) [RPt(θ)] R∗ Pt ≤ − ESt inf ρ∈F (cid:20) (cid:26) × (cid:18) ˆRt(θ∗ t ) + π) KL(ρ k αn + αC 2(1 8 − IB) . (cid:19) (cid:27)(cid:21) ˆRt(θ) i h − 24 1 λcIB 2(n−Cλ) − ˆRt(θ) i h 1 αcIB 2(1−Cα) 1 − Eθ∼ρ FAST RATES IN META-LEARNING WITH PAC-BAYES In particular, under Bernstein assumption, i.e., if IB = 1, the choice α = 1 C+c gives ESt E θ∼ρt(π,α)[RPt(θ)] (cid:2) R∗ Pt ≤ − 2ESt inf ρ∈F (cid:20) Eθ∼ρ (cid:26) ˆRt(θ) i h (cid:3) ˆRt(θ∗ t ) + − π) KL(ρ k αn . (cid:27)(cid:21) Without Bernstein assumption, i.e., if IB = 0, rewriting the bound and taking the minimum over α yields ESt E θ∼ρt(π,α)[RPt(θ)] R∗ Pt ≤ − ESt inf α (cid:2) and this concludes the proof. (cid:3) inf ρ∈F (cid:20) Eθ∼ρ (cid:26) ˆRt(θ) i h − ˆRt(θ∗ t ) + KL(ρ π) k αn + αC 2 8 , (cid:27)(cid:21) (cid:4) Appendix C. Proof of Corollary 2 First, ESt (cid:20) inf ρ∈P(Θ) ˆ Rt(ρ, π, α) − ˆRt(θ∗ t ) (cid:21) = ESt inf ρ∈P(Θ) (cid:20) inf ρ∈P(Θ) ≤ ESt (cid:20) Eθ∼ρ[ ˆRt(θ)] + (cid:18) Eθ∼ρ[ ˆRt(θ)] + KL(ρ π) k αn π) KL(ρ k αn ˆRt(θ∗ t ) (cid:21) − (cid:19) ˆRt(θ∗ t ) (cid:21) − KL(ρ π) k αn . (cid:21) = inf ρ∈P(Θ) ]Eθ∼ρ[Rt(θ)] Rt(θ∗ t ) + − (cid:20) θ : Rt(θ) { Rt(θ∗ t ) − s . Then, } ≤ Now, define ρs as the resctriction of π to the set ESt (cid:20) inf ρ∈P(Θ) ˆ Rt(ρ, π, α) − ˆRt(θ∗ t ) (cid:21) inf s>0 ≤ (cid:20) Eθ∼ρ[Rt(θ)] Rt(θ∗ t ) + − π) KL(ρsk αn (cid:21) inf s>0 " ≤ s + log 1 π({θ:Rt(θ)−Rt(θ∗ αn t )≤s}) # inf s>0 " ≤ s + dπ,t log 1 s + log κπ,t αn # by assumption. An optimization with respect to s leads to s = dπ,t/(αn) and we obtain the first statement: ˆ Rt(ρ, π, α) Plugging this into Theorem 1 leads immediately to the other statements. ˆRt(θ∗ t ) (cid:21) inf ρ∈P(Θ) ESt ≤ − (cid:20) dπ,t log nα dπ αn + log κπ,t . Appendix D. Proof of Lemma 4 First, we note that f : x consequence, This implies that f is exp(Cτ )/τ -Lipschitz, that is, for any (x, y) 1 τ log(x) is differentiable on [exp( = 1/(τ x) is maximized at x = exp( Cτ ), 1] and f ′(x) = 1 τ x . As a Cτ ) and its maximum is exp(Cτ )/τ . Cτ ), 1]2, f ′(x) | | [exp( 7→ − − − − ∈ − f (x) | − f (y) | ≤ exp(Cτ ) τ x | y . | − 25 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF Taking the square of both sides of the inequality yields (x, y) [exp( Cτ ), 1]2, (f (x) ∀ − Then, f ′′(x) = 1/(τ x2) and thus, f is 1/τ -strongly convex, that is, for any (x, y) f ′′(x) | | ≥ ∈ f (y))2 − exp(2Cτ ) τ 2 (x − ≤ y)2. (21) 1/τ (minimum reached for x = 1). This implies that [exp( − ∈ Cτ ), 1] we have, for any θ [0, 1], ∈ f (θx + (1 θ)y) − ≤ θf (x) + (1 θ)f (y) − θ(1 − 2τ θ) (x y)2. − − We apply this inequality to θ = 1/2 and rearrange terms, and we obtain (x, y) ∀ ∈ [exp( − Cτ ), 1]2, 1 8τ y)2 (x − ≤ f (x) + f (y) 2 f − x + y 2 . (cid:19) (cid:18) Finally, combining (21) with (22) yields (x, y) ∀ ∈ [exp( − Cτ ), 1]2, [f (x) f (y)]2 − 8 exp(2Cτ ) τ ≤ f (x) + f (y) 2 f − x + y 2 , (cid:19)(cid:21) (cid:18) (cid:20) concluding the proof of the lemma. Appendix E. Proof of Theorem 5 (22) (cid:4) The proof of Theorem 5 is structured as follows: we first bound the excess risk by the expectation of the infimum of the empirical risk ˆ t ) in Lemma 15. Using classic techniques, R we turn this bound into the prediction risk. (ρ, π, α) ˆR(θ∗ − E.1 Lemma Lemma 15 Assume that the loss l satisfies the boundedness assumption (3). Then, the following bound holds with the choice β = 1 C+c : EP1,...,PT ES1,...,ST E π∼ ˆΠ [ E (π)] ∗ − E ≤ 1 2 αcIB 2(1−Cα) − EP1,...,PT ES1,...,ST " 1 T inf Π∈G ( Proof For any t T Eπ∼Π t=1 (cid:16) X [T ], let ∈ ˆ Rt(ρt(π, α), π, α) i h − ˆRt(θ∗ t ) + (cid:17) Λ) KL(Π k βT ) + αC 2(1 8 − IB) , # Ut := ˆ Rt(ρt(π∗ α, α), π∗ α, α) ˆ Rt(ρt(π, α), π, α). − Please note that E[Ut] = EPt [ Rt(π∗ α)] where E[Ut] is a shortcut notation for EPt∼P ESt∼Pt[Ut]. Besides, please note that, by the assump- tion on the boundedness of l, it a.s. holds that C. Applying Lemma 13 to Ut gives, for any Ut| ≤ | β > 0, Rt(π)] , EPt [ − EP1,...,PT ES1,...,ST eβ h T t=1(Ut−ESt [Ut]) P 26 e ≤ i β2T ̃V (π) 2(1−βC) , FAST RATES IN META-LEARNING WITH PAC-BAYES where ̃V (π) = EPT +1 EST +1 factor can be bounded as ̃V (π) is satisfied at the meta level, so that the bound becomes ˆ RT +1(ρT +1(π, α), π, α) cE[ ˆ RT +1(ρT +1(π∗ UT +1] by Theorem 3, which states that Bernstein hypothesis α, α), π∗ (cid:20)(cid:16) ≤ . This α, α) − − (cid:17) (cid:21) 2 EP1,...,PT ES1,...,ST eβ P " T t=1(Ut−E[Ut])+ cβ2T E[UT +1] 2(1−βC) 1. # ≤ Integrating with respect to the prior π Λ and using Fubini's theorem yields ∼ EP1,...,PT ES1,...,ST Eπ∼Λ eβ " P T t=1(Ut−E[Ut])+ cβ2T E[UT +1] 2(1−βC) 1. # ≤ Next, by an application of Lemma 14, the left-hand side becomes EP1,...,PT ES1,...,ST " supΠ∈P(P(θ))(cid:26) e Eπ∼Π(cid:20) β T t=1(Ut−E[Ut])+ P cβ2T E[UT +1] 2(1−βC) (cid:21) −KL(ΠkΛ) (cid:27) 1. # ≤ We then make use of Jensen's inequality and arrange terms, so that the bound becomes EP1,...,PT ES1,...,ST sup Π∈P(P(θ)) ( Eπ∼Π " 1 T " T t=1 X E[Ut]) + (Ut − cβE[UT +1] 2(1 βC) # − − KL(Π Λ) k βT 0. )# ≤ We replace the supremum on Π by an evaluation of the term in ˆΠ and arrange terms, so that the bound becomes EP1,...,PT ES1,...,ST E π∼ ˆΠ "− 1 T T t=1 X E[Ut] + cβE[UT +1] 2(1 βC) # − EP1,...,PT ES1,...,ST ≤ 1 T "− T Xt=1 E π∼ ˆΠ[Ut] + KL( ˆΠ Λ) k βT , # which is identical to cβ − 2(1 Cβ) (cid:19) − 1 (cid:18) EP1,...,PT ES1,...,ST E EPT +1 EST +1 [UT +1] π∼ ˆΠ EP1,...,PT ES1,...,ST 1 T "− Then, we replace E[UT +1] by its value, yielding the bound cβ − 2(1 Cβ) (cid:19) − 1 (cid:18) EP1,...,PT ES1,...,ST E EPT +1 EST +1 π∼ ˆΠ " ≤ T t=1 X E π∼ ˆΠ[Ut] + KL( ˆΠ Λ) k βT . # ˆ RT +1(ρT +1(π, α), π, α) − ˆ RT +1(ρT +1(π∗ α, α), π∗ α, α) # ≤ EP1,...,PT ES1,...,ST " 27 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF 1 T − T E π∼ ˆΠ t=1 X α, α), π∗ ˆ Rt(ρt(π, α), π, α) − h α, α) does not depend on π Since the term ˆ Rt(ρt(π∗ the inequality, which gives + ˆ Rt(ρt(π∗ α, α), π∗ α, α) i ˆΠ, we can simplify it on both sides of . # KL( ˆΠ Λ) k βT ∼ cβ − 2(1 Cβ) − 1 (cid:18) EP1,...,PT ES1,...,ST E EPT +1 EST +1 π∼ ˆΠ ˆ RT +1(ρT +1(π, α), π, α) i h (cid:19) + cβ 2(1 Cβ) − ES1,...,ST EP1,...,PT ≤ EPT +1 EST +1 ˆ RT +1(ρT +1(π∗ α, α), π∗ α, α) i h E 1 T "− T Xt=1 π∼ ˆΠ ˆ Rt(ρt(π, α), π, α) i h + KL( ˆΠ Λ) k βT # . (23) Theorem 1 provides the following lower bound for any π′: EST +1 ˆ RT +1(ρT +1(π′, α), π′, α) h i 1 ≥ (cid:18) αcIB − 2(1 Cα) − EST +1 E θ∼ρT +1(π′,α) RPT +1(θ) (cid:19) αcIB + 2(1 − Cα) R∗ PT +1 − (cid:2) αC 2(1 8 IB) (cid:3) . − (24) This further implies that EST +1 ˆ RT +1(ρT +1(π′, α), π′, α) h i 1 ≥ (cid:18) αcIB − 2(1 Cα) − R∗ PT +1 (cid:19) αcIB 2(1 − Cα) + R∗ PT +1 − IB) αC 2(1 8 − (25) for any π′. In particular, applying (24) to π′ = π and (25) to π = π∗ left-hand side of (23) gives α, and injecting the results in the αcIB cβ − 2(1 Cα) 2(1 (cid:19) − − Cβ) 1 (cid:18) EPT +1 R∗ PT +1 + 1 (cid:18) cβ − 2(1 Cβ) − (cid:19) + EP1,...,PT αcIB 2(1 h ES1,...,ST i E π∼ ˆΠ EPT +1 EST +1 E θ∼ρT +1(π′,α) RPT +1(θ) Cα) − ES1,...,ST EPT +1 R∗ PT +1 h 1 T T t=1 X "− EP1,...,PT ≤ IB) αC 2(1 8 − − i E π∼ ˆΠ ˆ Rt(ρt(π, α), π, α) h i + KL( ˆΠ Λ) k βT . # ! (cid:2) (cid:3) We remove bound becomes E ∗ = EPT +1 from both sides of the inequality and arrange terms, so that the R∗ PT +1 h i 28 FAST RATES IN META-LEARNING WITH PAC-BAYES αcIB − 2(1 Cα) − (cid:19) (cid:18) 1 cβ − 2(1 Cβ) − 1 (cid:18) EP1,...,PT ES1,...,ST E π∼ ˆΠ [ E (π)] ∗ −E !− IB) αC 2(1 8 − EP1,...,PT ES1,...,ST ≤ "− E π∼ ˆΠ ˆ Rt(ρt(π, α), π, α) i h ∗ + − E KL( ˆΠ Λ) k βT . # (cid:19) T 1 T t=1 X By definition, ˆΠ is the minimizer of the integrand of the right-hand side, and therefore, αcIB − 2(1 Cα) − (cid:19) (cid:18) 1 (cid:18) 1 − 2(1 EP1,...,PT ES1,...,ST inf Π∈G ( " 1 T cβ Cβ) (cid:19) − T EP1,...,PT ES1,...,ST E π∼ ˆΠ [ E (π)] ∗ − E ! ≤ Eπ∼Π t=1 (cid:16) X ˆ Rt(ρt(π, α), π, α) h i − ˆRt(θ∗ t ) + KL(Π Λ) k βT (cid:17) + αC 2(1 8 − )# IB) , and the choice β = 1 c+C yields EP1,...,PT ES1,...,ST E π∼ ˆΠ [ E (π)] ∗ − E ≤ 1 2 αcIB 2(1−Cα) − EP1,...,PT ES1,...,ST " 1 T inf Π∈G ( T Eπ∼Π ˆ Rt(ρt(π, α), π, α) i − ˆRt(θ∗ t ) + (cid:17) Λ) KL(Π k βT IB) αC 2(1 8 − , # + ) Xt=1 (cid:16) which concludes the proof of the lemma. h E.2 Proof of Theorem 5 From Lemma 15, EP1,...,PT ES1,...,ST E ≤ 1 − ∗ (π)] π∼ ˆΠ [ E − E EP1,...,PT 2 αcIB 2(1−Cα) ES1,...,ST + KL(Π Λ) k βT + ) αC 2(1 8 − 2 αcIB 2(1−Cα) inf Π∈G ≤ 1 − EP1,...,PT ES1,...,ST + KL(Π Λ) k βT + αC 2(1 8 − IB) ) # 1 T ( " T Eπ∼Π Xt=1 (cid:16) 1 T inf Π∈G( IB) ˆ Rt(ρt(π, α), π, α) i h − ˆRt(θ∗ t ) (cid:17) T t=1 (cid:16) X Eπ∼Π ˆ Rt(ρt(π, α), π, α) i h − ˆRt(θ∗ t ) (cid:17) 2 αcIB 2(1−Cα) = 1 − EPT +1 EST +1 inf Π∈G Eπ∼Π (cid:16) ( ˆ RT +1(ρT +1(π, α), π, α) i h − ˆRT +1(θ∗ T +1) (cid:17) 29 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF + KL(Π Λ) k βT + αC 2(1 8 − IB) ) 2 αcIB 2(1−Cα) inf Π∈G ≤ 1 − EPT +1 EST +1 ( Eπ∼Π inf ρ∈P(Θ)" Eθ∼ρ[ ˆRT +1(θ)] + KL(ρ π) k αn ˆRT +1(θ∗ T +1) # − + Λ) KL(Π k βT + αC 2(1 8 − IB) ) 2 αcIB 2(1−Cα) EPT +1 inf Π∈G ≤ 1 − Eπ∼Π inf ρ∈P(Θ) ( EST +1 " Eθ∼ρ[ ˆRT +1(θ)] + KL(ρ π) k αn ˆRT +1(θ∗ T +1) # − + KL(Π Λ) k βT + αC 2(1 8 − IB) ) 2 αcIB 2(1−Cα) EPT +1 inf Π∈G ≤ 1 − ( Eπ∼Π inf Eθ∼ρ[RT +1(θ) RT +1(θ∗ t )] + − π) KL(ρ k αn # + Λ) KL(Π k βT + αC 2(1 8 − ρ∈P(Θ)" IB) . ) This ends the proof. (cid:4) Appendix F. Application of Theorem 5 to the Gaussian Case Assume that l is L-Lipschitz. As a result, the risks RPt are also L-Lipschitz. We choose the prior (and hence, the variances are the same for all coordinates). A straightforward p ̄μ,( ̄σ2,..., ̄σ2) ∈ F application of (17) gives KL(pμ,σ2, p ̄μ,( ̄σ2,..., ̄σ2)) = 1 2 d Xi=1 (cid:20) ̄μi)2 (μi − ̄σ2 + σ2 i ̄σ2 − 1 + log ̄σ2 σ2 i (cid:19)(cid:21) . (cid:18) In this case, ρt(π, α) = pμ(t),σ2(t), where (μ(t), σ2(t)) = argminμ,σ2 E ( θ∼N (μ,σ2) + 1 2αn ˆRt(θ) i h d Xi=1 (cid:20) ̄μi)2 (μi − ̄σ2 + σ2 i ̄σ2 − 1 + log ̄σ2 σ2 i (cid:19)(cid:21)) . (cid:18) We now define G as the family of distributions qτ,v,a,b on ( ̄μ, ̄σ2), where qτ,v,a,b( ̄μ, ̄σ2) = d N " Oi=1 ( ̄μi; τi, ξ2) # ⊗ Γ( ̄σ2; a, b). Fix a prior on priors Λ = q0, ̄ ̄ξ2, ̄ ̄a, ̄ ̄b. We choose ˆΠ = qˆt, ˆξ2,ˆa,ˆb, where (ˆτ , ˆξ2, ˆa, ˆb) = argminτ,ξ2,a,b E ( ( ̄μ, ̄σ2)∼qτ,ξ2,a,b" 1 T T Xt=1 E min μ(t),σ2(t)( θ∼N (μ(t),σ2(t)) ˆRt(θ) i h 30 FAST RATES IN META-LEARNING WITH PAC-BAYES + 1 2αn d Xi=1 (cid:20) (μi(t) − ̄σ2 ̄μi)2 + σ2 i (t) ̄σ2 − 1 + log ̄σ2 σ2 i (t) + 1 2βT d Xi=1 " τ 2 i ̄ ̄ξ2 + ξ2 ̄ ̄ξ2 − 1 + log (cid:19)(cid:21))# (cid:18) ̄ ̄ξ2 ξ2 ̄ ̄a)ψ(a) + log Γ( ̄ ̄a) Γ(a) + ̄ ̄a log b ̄ ̄b 2βT !# (a − + + a ̄ ̄b−b b , ) ) = Γ′( where Γ( ) is the digamma function. We apply ) is the gamma function and ψ( )/Γ( * * * * Theorem 5: EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf τ,ξ2,a,b( E ( ̄μ, ̄σ2)∼qτ,ξ2,a,b EPT +1 min μ(T +1),σ2(T +1)( E " θ∼N (μ(T +1),σ2(T +1))[RPT +1(θ)] RPT +1(θ∗ t ) − d + 1 2αn d Xi=1 (cid:20) τ 2 i ̄ ̄ξ2 Xi=1 " + 1 2βT (μi(T + 1) ̄σ2 − ̄μi)2 + σ2 i (T + 1) ̄σ2 + ξ2 ̄ ̄ξ2 − 1 + log ̄ ̄ξ2 ξ2 !# (a − + 1 + log ̄σ2 σ2 − i (T + 1) ̄ ̄a)ψ(a) + log Γ( ̄ ̄a) Γ(a) + ̄ ̄a log b ̄ ̄b 2βT (cid:18) (cid:19)(cid:21))# + a ̄ ̄b−b b . ) We next apply Assumption 4, and the bound becomes EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf τ,ξ2,a,b( E ( ̄μ, ̄σ2)∼qτ,ξ2,a,b EPT +1 min μ,σ2 ( " L σ k 2 k + 1 2αn d Xi=1 (cid:20) ̄μi)2 (μi − ̄σ2 + σ2 i ̄σ2 − 1 + log + 1 2βT d Xi=1 " τ 2 i ̄ ̄ξ2 + ξ2 ̄ ̄ξ2 − 1 + log (cid:18) (cid:19)(cid:21))# ̄σ2 σ2 i (T + 1) ̄ ̄ξ2 ξ2 ̄ ̄a)ψ(a) + log Γ( ̄ ̄a) Γ(a) + ̄ ̄a log b ̄ ̄b 2βT !# (a − + + a ̄ ̄b−b b . ) p, and define μ∗ = EP ∼P(μP ). Idea: define for any P , μP that minimizes RP , that is: RP (μP ) = R∗ If μP = μ∗ -a.s., all the task have the same solution. On the other hand, if μP has a lot of variations, then the tasks have very unrelated solutions. In the infimum above, take μ = μPT +1 and τ = μ∗. Then, P EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ≤ E ∗ + inf E ̄σ2∼Γ−1(a,b) min σ2 ( " L σ k 2 k ξ2,a,b( 31 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF EPT +1∼P + μPT +1 − k 2 ̄σ2αn μ∗ 2 k (cid:0) (cid:1) + ξ2d + 1 2αn + βC 2 8T + k μ∗ 2 k 2β ̄ ̄ξ2 + d 2β " ξ2 ̄ ̄ξ2 − (a − + σ2 i ̄σ2 − 1 + log ̄σ2 σ2 i (cid:19)(cid:21))# (cid:18) d Xi=1 (cid:20) 1 + log ̄ ̄ξ2 ξ2 !# ̄ ̄a)ψ(a) + log Γ( ̄ ̄a) Γ(a) + ̄ ̄a log b ̄ ̄b 2βT + a ̄ ̄b−b b . ) , this quantity will be very important in the rate. Therefore, Let Σ( ) = EPT +1∼P P EP1,...,PT ES1,...,ST E μPT +1 − k (cid:2) (π)] π∼ ˆΠ[ E μ∗ 2 k ∗ − E (cid:3) ≤ 4 inf ξ2,a,b,β( E ̄σ2∼Γ−1(a,b) L min σ2 ( " σ k 2 + k Σ( ) + ξ2d P 2 ̄σ2αn + k μ∗ 2 k 2β ̄ ̄ξ2T + d 2β " ξ2 ̄ ̄ξ2 − 1 + log ̄ ̄ξ2 ξ2 !# (a − + d + 1 + log 1 2αn σ2 i ̄σ2 − (cid:18) Xi=1 (cid:20) ̄ ̄a)ψ(a) + log Γ( ̄ ̄a) Γ(a) + ̄ ̄a log b ̄ ̄b 2βT ̄σ2 σ2 i (cid:19)(cid:21))# ̄ ̄b−b b + a . ) An exact optimization in σ2 gives σ2 i = ̄σ2 (2αL ̄σ2n+1) and after simplifications, EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E ∗ + 4 inf (π)] E ξ2,a,b( ≤ E ̄σ2∼Γ−1(a,b) + k 2 μ∗ k 2β ̄ ̄ξ2T + d 2β " ξ2 ̄ ̄ξ2 − 1 + log Σ( ) + ξ2d P 2 ̄σ2αn + " ̄ ̄ξ2 ξ2 !# (a − + d log 2αL ̄σ2n + 1 (cid:0) 2αn # ̄ ̄a)ψ(a) + log Γ( ̄ ̄a) Γ(a) + ̄ ̄a log b ̄ ̄b 2βT (cid:1) + a ̄ ̄b−b b . ) We now consider separately two cases: Σ( will choose later. First case: Σ( improvement on the bound from the meta-learning. Simply take ξ = ̄ ̄ξ to get dǫ for some ǫ (very small) that we ) > dǫ. This is the case where we do not expect a significant ) > dǫ or Σ( ≤ P P P ) EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] − E ∗ E 4 inf a,b ( ≤ ̄σ2∼Γ−1(a,b) Σ( ) + d ̄ ̄ξ2 P ̄σ2αn " + 2 μ∗ 2 k k β ̄ ̄ξ2T (a − + d log 2αL ̄σ2n + 1 + 2αn (cid:0) ̄ ̄a)ψ(a) + 2 log Γ( ̄ ̄a) # (cid:1) Γ(a) + ̄ ̄a log b ̄ ̄b βT + a ̄ ̄b−b b . ) In this case, an accurate optimization with respect to a and b will not improve the bound signifi- cantly, and for this reason, we simply take a = ̄ ̄a and b = ̄ ̄b. Also note that for U Γ(a, b) we have E(U x) = Γ(a + x)/[bxΓ(a)] and thus E(1/ ̄σ2) = b/(a log(2αLE( ̄σ2)n + 1) = log(2αLna/b + 1). Thus, 1) and E(log(2αL ̄σ2n + 1)) ∼ − ≤ EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ≤ E ∗ + 4 ̄ ̄b d ̄ ̄ξ2 + Σ( P ( ̄ ̄a h 1)αn − ) 2d log + i 2 ̄ ̄aαLn ̄ ̄b αn (cid:16) + 1 + (cid:17) 2 μ∗ 2 k k β ̄ ̄ξ2T . 32 FAST RATES IN META-LEARNING WITH PAC-BAYES Second case: Σ( meta-learning, and in order to take advantage of it, we choose ξ very small: ξ2 = ǫ. We obtain dǫ. In this case, we expect a significant improvement in the bound from the ≤ P ) EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ≤ E ∗ + 4 inf E a,b ( ̄σ2∼Γ−1(a,b) + k 2 μ∗ k 2β ̄ ̄ξ2T + d 2βT " ǫ ̄ ̄ξ2 − 1 + log 2αL ̄σ2n + 1 (cid:0) + ( 2αn d log dǫ ̄σ2αn ̄ ̄ξ2 ǫ !# ̄ ̄a)ψ(a) + log Γ( ̄ ̄a) Γ(a) + ̄ ̄a log b ̄ ̄b 2βT ) (cid:1) + a ̄ ̄b−b b . ) (a − + In order to take advantage of the meta-learning, we are going to make sure that ̄σ2 is very small by tuning a and b adequately. But then we have E(log(2αL ̄σ2n + 1)) 2αLE( ̄σ2)n = 2αLna/b, and we obtain ≤ EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ≤ E ∗ + 4 inf − bdǫ + + k dLa b μ∗ 2 k 2β ̄ ̄ξ2T 1)αn ̄ ̄a)ψ(a) + log Γ( ̄ ̄a) Γ(a) + ̄ ̄a log b ̄ ̄b 2βT − (a (a a,b,β∈G( ̄ ̄ξ2 ǫ !# + + d 2βT " ǫ ̄ ̄ξ2 − 1 + log Choose a = ̄ ̄a (make sure that ̄ ̄a > 1) and an optimization with respect to b gives b = Reinjecting in the bound gives + a ̄ ̄b−b b . ) αLa(a−1)n ǫ . q EP1,...,PT ES1,...,ST E + 2d βT " ǫ ̄ ̄ξ2 − 1 + log (π)] π∼ ˆΠ[ E ̄ ̄ξ2 ǫ !# ∗ + 4d s ≤ E + 2 βT ̄ ̄a log ̄ ̄aL α( ̄ ̄a 1) ǫ n + − 1 ̄ ̄b r r nαL ̄ ̄a( ̄ ̄a ǫ 2 μ∗ 2 k k β ̄ ̄ξ2T 1) − ! + ̄ ̄a ̄ ̄b r ǫ nαL ̄ ̄a( ̄ ̄a . 1) ! − The last step is to chose ǫ. Interestingly enough, for ǫ = 1/n we recover the rate of learning in isolation: d/n. Now, an optimization w.r.t ǫ gives ǫ = √n/T and thus EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ≤ E ∗ + 4d T s ̄ ̄aL α( ̄ ̄a 1) − + 2 μ∗ 2 k k β ̄ ̄ξ2T + 2d βT n ̄ ̄ξ2T 2 − (cid:18) 1 + log ̄ ̄ξ2T 2 (cid:16) (cid:17)(cid:19) + 2 βT ̄ ̄a log T ̄ ̄b (cid:18) αL ̄ ̄a( ̄ ̄a − 1) + (cid:19) p ̄ ̄a ̄ ̄b T p αL ̄ ̄a( ̄ ̄a 1) . ! − In the T > n regime, this is a significant improvement compared to the learning in isolation in which case, we can simplify the bound as EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ≤ E ∗ + G(C, μ∗, ̄ ̄ξ, L, ̄ ̄a, ̄ ̄b) d + log(T ) T , where 33 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF G(C, μ∗, ̄ ̄ξ, L, ̄ ̄a, ̄ ̄b) = 4 s α( ̄ ̄a ̄ ̄aL + 2 β μ∗ 2 k k ̄ ̄ξ2 + n ̄ ̄ξ2T 2 As a conclusion, 1) − + 1 + log ̄ ̄ξ2 + ̄ ̄a + ̄ ̄a 2 log αL ̄ ̄a( ̄ ̄a ̄ ̄b2 1) − + ̄ ̄a ̄ ̄b T αL ̄ ̄a( ̄ ̄a 1) . ! − p EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ≤ E ∗ + min ̄ ̄b h d ̄ ̄ξ2 + Σ( P ( ̄ ̄a 1)αn − ) d log + i 2 ̄ ̄aαLn ̄ ̄b 2αn (cid:16) + 1 + (cid:17) 2 μ∗ 2 k k β ̄ ̄ξ2T , G(C, μ∗, ̄ ̄ξ, L, ̄ ̄a, ̄ ̄b) d + log(T ) T . ! Appendix G. Application of Theorem 5 to the Case of Mixtures of Gaussians We first assume that priors that are mixtures of K Gaussians, where K is known: = M ( K d pw,μ,σ2 = wk Xk=1 Oi=1 (μk,i, σ2 k,i) : N (i, k) ∀ [d] [K], μk,i ∈ × ∈ R, σ2 k,i ∈ R∗ +, wk ≥ 0, 1⊤w = 1 . ) We set the prior π = distribution N P K k=1 ̄wkN (μ, σ2), (17) implies, for any w, μ, σ2, ( ̄μk, ̄σ2 kId). Then, denoting by g(x; μ, σ2) the pdf of the normal KL(pw,μ,σ2 π) = k ≤ = Rd Z log K Rd Z K Xk=1 wk log K k=1 wkg(x; μk, σ2 k) K k=1 ̄wkg(x; ̄μk, ̄σ2 kId) P wkg(x; μk, σ2 k) ̄wkg(x; ̄μk, ̄σ2 kId) P log wkg(x; μk, σ2 k)dx K Xk=1 wkg(x; μk, σ2 k)dx wkKL( N (μk, σ2 k) kN ( ̄μk, ̄σ2 kId)) wk ̄wk K + Xk=1 K Xk=1 = KL(w ̄w) + k 1 2 Xi=1 where the inequality on the second line follows from the log sum inequality from Cover and Thomas, and the bound from Theorem 5 becomes, at t = T + 1, Xk=1 d wk ̄μk,i)2 (μk,i − ̄σ2 k + σ2 k,i ̄σ2 k − 1 + log ̄σ2 k σ2 k,i ! , EST +1 E θ∼ρT +1(π,α)[RPT +1(θ)] − + R∗ PT +1 ≤ 1 2αn K Xk=1 Eθ∼pw,μ,σ2 [RPT +1(θ)] R∗ PT +1 + − KL(w ̄w) k αn ̄μk,i)2 (μk,i − ̄σ2 k + σ2 k,i ̄σ2 k − 1 + log ̄σ2 k σ2 k,i ! ) . 2 inf w,μ,σ2 ( d wk Xi=1 34 FAST RATES IN META-LEARNING WITH PAC-BAYES Assumption (4) implies that E θ∼N (μ,σ2)[RPT +1(θ)] R∗ PT +1 ≤ − LE θ∼N (μ,σ2) θ k − 2 μPT +1k . It follows that the previous bound with the choice μ1 = * * * K EST +1 E θ∼ρT +1(π,α)[RPT +1(θ)] R∗ PT +1 ≤ − 2 inf L w,σ2 ( = μK = μPT +1 becomes (cid:3) (cid:2) wkk σkk 2 + ̄w) KL(w k αn + 1 2αn K d wk Xk=1 Xi=1 Xk=1 (μPT +1,i − ̄σ2 k ̄μk,i)2 + σ2 k,i ̄σ2 k − 1 + log ̄σ2 k σ2 k,i ! ) . While the choice μ1 = = μK = μPT +1 may seem less meaningful than in the Gaussian case (with one single component), it is completely natural as the best possible choice for the parameter θ k) of the mixture brings an error term which is μPT +1. In the computation, each component can be decomposed between a bias term and a variance term, (μk, σ2 * * * N E θ∼N (μk,σ2 k) θ k − 2 μPT +1k = (cid:2) (cid:3) 2 μk − k bias term (first order) μPT +1k + σ2 k , variance term (second order) | for which the choice μk = μPT +1 minimizes the first order error term. Next, we set the family distributions on {z } : of G |{z} F = G qδ,τ,ξ2,b = Dir(δ) ( (τk,i, ξ2 k) N ⊗ Ok∈[K] i∈[d] K ⊗ Ok=1 Γ(2, bk) : δ = (δ1, . . . , δK ) RK, ∀ ∈ (k, i), ξ2 k > 0, τk,i ∈ R, bk > 0, δk > 0 ) , where Dir(δ) is the Dirichlet distribution of parameter δ. We set the prior on priors Λ = q1K ,0, ̄ ̄ξ2, ̄ ̄b, where 1K = (1, . . . , 1) and ̄ ̄ξ2 = . Then, using (17), (18) and (19), KL(qδ,τ,ξ2,bk Λ) = log Γ(K) + (cid:17) K ̄ ̄ξ2 1, . . . , ̄ ̄ξ2 (cid:16) Γ(1⊤δ) K k=1 Γ(δk) τ 2 k,i ̄ ̄ξ2 k Q Xk,i × 1 2 + + ξ2 k ̄ ̄ξ2 k K Xk=1 (δk − 1 + log − 1) ψ(δk) (cid:16) ̄ ̄ξ2 k ξ2 k ! + 2 − K ψ(1⊤δ) (cid:17) bk ̄ ̄bk log Xk=1 + ̄ ̄bk − bk bk ! , where ψ is the digamma function. We can next use the bound from Theorem 5 and we have EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ E 4 inf δ,τ,ξ2,b ( ( ̄w, ̄μ, ̄σ2)∼qδ,τ,ξ2 ,b EPT +1 L inf w,σ2 ( " 35 wkk σkk 2 + ̄w) KL(w k αn K Xk=1 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF + 1 2αn K d wk Xk=1 + 1 2βT log Γ(K) + 1 4βT Xi=1 Γ(1⊤δ) K k=1 Γ(δk) τ 2 ξ2 k,i k ̄ ̄ξ2 ̄ ̄ξ2 k k + × Q Xk,i ̄μk,i)2 (μPT +1,i − ̄σ2 k σ2 k,i ̄σ2 k − + K 1 + log ̄σ2 k σ2 k,i ! )# + 1 2βT 1 + log − (δk − Xk=1 ̄ ̄ξ2 k ξ2 k ! + 1) ψ(δk) 1 βT (cid:16) K Xk=1 − ψ(1⊤δ) (cid:17) log bk ̄ ̄bk + ̄ ̄bk − bk bk ! ) . Next, minimizing over σ2 gives k,i gives the optimal value ̄σ2 k 2αnL ̄σ2 k+1 , and replacing in the above bound EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ E 4 inf δ,τ,ξ2,b ( ( ̄w, ̄μ, ̄σ2)∼qδ,τ,ξ2,b EPT +1 KL(w ̄w) k αn + d 2αn inf w ( + 1 2βT log Γ(K) + 1 4βT K wk log 2αnL ̄σ2 k + 1 + (cid:0) Xk=1 Γ(1⊤δ) K k=1 Γ(δk) τ 2 ξ2 k,i k ̄ ̄ξ2 ̄ ̄ξ2 k k + × Q Xk,i (cid:1) K + 1 2βT 1 + log − " μPT +1 − ̄σ2 k 2 ̄μkk ) # 1 2αn K Xk=1 wk k 1) ψ(δk) (δk − Xk=1 ̄ ̄ξ2 k ξ2 k ! + 1 βT (cid:16) K − ψ(1⊤δ) (cid:17) log + bk ̄ ̄bk ̄ ̄bk − bk bk ! ) . Xk=1 [K]. We are going to restrict the infimum infw to the set of w such that wk ∈ { In other words, we are selecting only the best component of the mixture in the optimization bound. The reader can check that this is actually the exact solution to the minimization problem in the above bound. As a result of this minimization, the bound becomes for any k 0, 1 } ∈ EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ E 4 inf δ,τ,ξ2,b ( ( ̄w, ̄μ, ̄σ2)∼qδ,τ,ξ2,b min k∈[K] (cid:26) + 1 2βT 1 αn log 1 ̄wk + d 2αn log 2αnL ̄σ2 k + 1 + 1 2αn log Γ(K) + 1 4βT (cid:0) × Γ(1⊤δ) K k=1 Γ(δk) τ 2 ξ2 k,i k ̄ ̄ξ2 ̄ ̄ξ2 k k + Q Xk,i + 1 2βT 1 + log − K (cid:1) (δk − Xk=1 ̄ ̄ξ2 k ξ2 k ! + 1) ψ(δk) 1 βT (cid:16) K Xk=1 EPT +1 " μPT +1 − k ̄σ2 k 2 ̄μkk (cid:27) # − ψ(1⊤δ) (cid:17) log bk ̄ ̄bk + ̄ ̄bk − bk bk ! ) . [K], identical to Please note that the term inside the expectation is, up to the minimum on k αn log 1 the one we had in the case of one single Gaussian mixture, except for the term 1 , which ̄wk may be seen as a penalty for the choice of the component k [K] in the mixture. We then bound the expectation term in the above bound by first using Fubini's theorem, and then inverting the minimum and the second expectation: ∈ ∈ 36 FAST RATES IN META-LEARNING WITH PAC-BAYES EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf δ,τ,ξ2,b ( EPT +1 min k∈[K] ( " E ( ̄w, ̄μ, ̄σ2)∼qδ,τ,ξ2,b 1 αn (cid:20) log 1 ̄wk + d 2αn log 2αnL ̄σ2 k + 1 + 1 2αn μPT +1 − k ̄σ2 k 2 ̄μkk (cid:21) )# + 1 2βT log Γ(K) + 1 4βT Xk,i Γ(1⊤δ) K k=1 Γ(δk) × τ 2 k,i ̄ ̄ξ2 k Q + ξ2 k ̄ ̄ξ2 k − 1 + log (cid:0) + 1 2βT K (cid:1) (δk − Xk=1 ̄ ̄ξ2 k ξ2 k ! + 1 βT 1) ψ(δk) (cid:16) K Xk=1 log bk ̄ ̄bk − ψ(1⊤δ) (cid:17) bk . bk ! ) ̄ ̄bk − + (26) We can then bound the expectation term, which we decompose as E ( ̄w, ̄μ, ̄σ2)∼qδ,τ,ξ2 ,b 1 αn log 1 ̄wk + (cid:20) 1 αn = E ̄w∼Dir(δ) (cid:20) log d 2αn 1 ̄wk (cid:21) log 2αnL ̄σ2 k + 1 + (cid:0) + d 2αn E (cid:1) ̄σ2 k∼Γ(2,bk) 1 2αn μPT +1 − k ̄σ2 k 2 ̄μkk (cid:21) log 2αnL ̄σ2 k + 1 + 1 2αn E (cid:2) (cid:0) ( ̄w, ̄μ, ̄σ2)∼qδ,τ,ξ2 ,b (cid:1)(cid:3) μPT +1 − k ̄σ2 k 2 ̄μkk . (cid:21) (cid:20) Jensen's inequality helps to bound both the first term E 1 αn ̄w∼Dir(δ) log (cid:20) 1 ̄wk (cid:21) 1 αn 1 αn ≤ = log E ̄w∼Dir(δ) log 1⊤δ 1 − 1 δk − 1 ̄wk (cid:21) (cid:20) and the second term d 2αn E ̄σ2 k∼Γ(2,bk) log 2αnL ̄σ2 k + 1 (cid:2) (cid:0) (cid:1)(cid:3) d 2αn d 2αn log log ≤ = ̄σ2 k∼Γ(2,bk) 2αnLE (cid:16) 4Lαn bk (cid:18) + 1 (cid:19) ̄σ2 k + 1 (cid:2) (cid:3) (cid:17) in the decomposition. The third term can be bounded as follows 1 2αn E ( ̄w, ̄μ, ̄σ2)∼qδ,τ,ξ2,b = E ̄μk∼N (τk,ξ2 kId) 2 ̄μkk (cid:21) 2 ̄μkk μPT +1 − k ̄σ2 k (cid:20) μPT +1 − k (cid:2) 2 + E ̄μk∼N (τk,ξ2 (cid:3) kId) bk 2αn bk αn bk αn ≤ τkk τkk The bound on the expectation then becomes μPT +1 − k μPT +1 − k = (cid:16) (cid:0) 2 + dξ2 k . (cid:1) τk − k 2 ̄μkk (cid:2) (cid:3)(cid:17) 37 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF E + log log k + 1 1 αn d 2αn 2αnL ̄σ2 ( ̄w, ̄μ, ̄σ2)∼qδ,τ,ξ2 ,a,b 1 ̄wk 1⊤δ 1 − 1 δk − (cid:19) are In our final bound, we wish to have as few terms as possible in O not so problematic, because they correspond to the fast convergence rate at the meta-level. For this reason, we are going to take out of the infimum: while the terms in O μPT +1 − k ̄σ2 k μPT +1 − k 4Lαn bk (cid:21) τkk 2 + dξ2 k (cid:20) 1 αn 1 2αn d 2αn (cid:1) + 1 bk αn ̄μkk (cid:0) log log ≤ + + + (cid:18) 1 T 1 n (cid:0) (cid:1) (cid:1) (cid:0) (cid:0) (cid:1) . 2 • the term d 2αn log 4Lαn bk + 1 , which is unavoidable and corresponds to the main term of the bound in the worst case, with a O (cid:16) (cid:17) 1 n speed of convergence; • the term bkdξ2 (cid:1) αn , which will be handled through an optimization in ξ2 (cid:0) k k and will be a O As a consequence, we bound the minimum on [K] by 1 T term. (cid:0) (cid:1) E min k∈[K] (cid:26) K ( ̄w, ̄μ, ̄σ2)∼qδ,τ,ξ2,b (cid:20) log + 1 + 4αLn bk 1 αn K log + 1 ̄wk bkdξ2 k αn d 2αn (cid:18) Xk=1 Xk=1 and plugging this result in (26) gives (cid:19) d 2αn log 2αnL ̄σ2 k + 1 + 1 2αn (cid:0) min k∈[K] 1 αn + (cid:1) μPT +1 − bkk (cid:26) 2 + log τkk 2 ̄μkk μPT +1 − k ̄σ2 k 1⊤δ 1 − 1 δk − (cid:27) ≤ (cid:21)(cid:27) , (27) EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf δ,τ,ξ2,b ( K log d 2αn 4αLn bk K + 1 + bkdξ2 k αn min k∈[K] bkk (cid:26) (cid:20) Γ(1⊤δ) K k=1 Γ(δk) K ξ2 k ̄ ̄ξ2 k × Q d 4βT Xk=1 μPT +1 − 1 2βT + K 1 + log − (cid:18) Xk=1 2 + log τkk (δk − 1) Xk=1 ̄ ̄ξ2 k ξ2 k ! + 1 βT 1⊤δ 1 − 1 δk − ψ(δk) (cid:16) K Xk=1 (cid:19) Xk=1 (cid:27)(cid:21) − ψ(1⊤δ) (cid:17) log bk ̄ ̄bk + ̄ ̄bk − bk bk ! ) . + 1 αn EPT +1 + 1 2βT log Γ(K) + 1 4βT K Xk=1 2 τkk k ̄ ̄ξ2 k + An exact optimization in ξ2 k gives and replacing in the bound yields ξ2 k = 1 + ̄ ̄ξ2 k 4bk ̄ ̄ξ2 kβT αn EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf δ,τ,b ( d 2αn + 1 αn EPT +1 min k∈[K] (cid:20) (cid:26) bkk μPT +1 − 38 K Xk=1 τkk log 4αLn bk (cid:18) + 1 (cid:19) 2 + log 1⊤δ 1 − 1 δk − (cid:27)(cid:21) FAST RATES IN META-LEARNING WITH PAC-BAYES + 1 2βT log Γ(K) K + 1 4βT 2 τkk k ̄ ̄ξ2 k + Xk=1 From here, we set δk = 2 for any k Xk=1 Γ(1⊤δ) K k=1 Γ(δk) K × d 4βT Q log 1 + K + 1 2βT (δk − 1) ψ(δk) 4bk Xk=1 ̄ ̄ξ2 kβT αn ! + 1 βT (cid:16) K Xk=1 − ψ(1⊤δ) (cid:17) log bk ̄ ̄bk + ̄ ̄bk − bk bk ! ) [K], which implies ∈ 1 2βT K Xk=1 (δk − 1) ψ(δk) (cid:16) − ψ(1⊤δ) (cid:17) 0 ≤ because ψ is increasing. Please also note that log Γ(K) Γ(1⊤δ) K k=1 Γ(δk) × = log Γ(2K) Γ(K) ≤ K log(2K). We can then deduce the bound Q EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf τ,b ( d 2αn K log Xk=1 (cid:18) 4αLn bk + 1 αn EPT +1 (cid:20) min k∈[K] μPT +1 − τkk 2 bkk (cid:8) d 4βT K Xk=1 + log 1 + + 1 + log(2K) αn (cid:19) 1 4βT + K log(2K) 2βT (cid:21) (cid:9) ̄ ̄ξ2 kβT 4bk αn ! + 1 βT + K log Xk=1 K Xk=1 bk ̄ ̄bk 2 τkk k ̄ ̄ξ2 k ̄ ̄bk − + bk bk ! ) . . Let it is clear that ΣK( P ) := inf τ1,...,τK EPT +1∼P min k∈[K] k μPT +1 − (cid:20) 2 τkk , (cid:21) EPT +1 min k∈[K] (cid:20) bkk (cid:8) μPT +1 − τkk 2 ΣK( P ≤ (cid:21) Xk=1 ), the previous bound becomes (cid:9) K ) bk. By choosing τ1, . . . , τK minimizing ΣK( P EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf b ( log(2K) αn + d 2αn 4αLn bk + 1 (cid:19) + ) ΣK( P αn bk + K log(2K) 2βT + 1 4βT K Xk=1 K log Xk=1 K (cid:18) 2 τkk k ̄ ̄ξ2 k Xk=1 K K + d 4βT log 1 + 4bk ̄ ̄ξ2 kβT αn ! + 1 βT log bk ̄ ̄bk + ̄ ̄bk − bk . bk ! ) (28) Xk=1 Please note that τ1, . . . , τK are characteristic of the distribution . Intuitively, if the distribution has K modes, or K Gaussian mixtures, τ1, . . . , τK correspond to the centers of these modes or P Xk=1 P 39 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF mixtures up to a permutation. Consequently, they do not scale with n or T , but can be regarded as problem parameters of constant order. Let ǫ > 0 which we will specify later, we are going to consider two separate cases: - either ΣK( ) dǫ, implying that the distribution is concentrated around τ1, . . . , τK and the variance of the local distribution around each of those points is smaller than ǫ; P ≤ - or ΣK( P ) > dǫ. G.1 First Case: ΣK( P dǫ ) ≤ In this case, we expect the distribution to well concentrated around τ1, . . . , τK (which are the centers of the mixtures). As a result, the optimal parameter in the new task T + 1 is going to be closed to one of τ1, . . . , τK and we can infer it from the previous tasks. This is precisely the case where we expect a significant improvement from the meta-learning over the learning in isolation. A closer look at the bound above shows that, besides the term log(2K) αn (for which we will provide an interpretation later in this section), all the terms are O log T T , which is the fast rate of convergence at the meta level, except possibly for the terms ΣK (P) αn K k=1 bk. Nevertheless, the assumption on ΣK( (cid:17) K k=1 log ) shows that the second of those terms ). For this reason, we are going to choose bk small enough so that the 4αLn bk (cid:16) d 2αn + 1 and P P (cid:16) (cid:17) is very small (of order O first term becomes small, and we set P ǫ n (cid:0) (cid:1) Replacing in the bound gives k ∀ ∈ [K], bk = T. EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 ( log(2K) αn + d 2αn T KΣK( + P ) + K log(2K) 2βT + 1 4βT αn + d 4βT log 1 + 4 ̄ ̄ξ2 kβT 2 αn ! + K Xk=1 log T ̄ ̄bk + ̄ ̄bk − T T ! ) . 4αLn T + 1 (cid:19) log 2 (cid:18) τkk k ̄ ̄ξ2 k K K Xk=1 K Xk=1 1 βT Xk=1 We can easily bound the second term in the bound using the inequality log(1 + x) becomes x, which ≤ d 2αn K Xk=1 4αLn T log (cid:18) + 1 (cid:19) 2LdK T , ≤ and replacing ΣK( P ) by its upper bound dǫ gives EP1,...,PT ES1,...,ST E + 2K log(2K) βT + 1 βT (π)] ∗ − E 2 + d βT π∼ ˆΠ[ E K τkk k ̄ ̄ξ2 k Xk=1 ≤ K 4 log(2K) αn + + 4T Kǫ αn 8LdK T kβT 2 αn ! 4 ̄ ̄ξ2 log 1 + Xk=1 40 + 4 βT K Xk=1 log T ̄ ̄bk + ̄ ̄bk − T T ! . FAST RATES IN META-LEARNING WITH PAC-BAYES From here, the choice of the rate ǫ = n T 2 yields the final bound: EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E where we denoted ∗ (π)] CVfinite(K, n) + CVGaussian(K, d, T ) + CVmeta(T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ), − E ≤ CVfinite(K, n) = 4 log(2K) αn , CVGaussian(K, d, T ) = 8LdK T + 4K αT and CVmeta(T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ) = 2K log(2K) βT + 1 βT K Xk=1 2 τkk k ̄ ̄ξ2 k + d βT + 4 βT Remark 16 Please note that and CVfinite(K, n) = O log K n (cid:18) (cid:19) CVGaussian(K, d, T ) + CVmeta(T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ) = O log 1 + K Xk=1 K log T ̄ ̄bk + Xk=1 4 ̄ ̄ξ2 kβT 2 αn ! ̄ ̄bk − T T ! . dK log T T . (cid:19) (cid:18) This bound comes as no surprise, because the process of learning the parameter θ in the mixture of Gaussians framework consists of two different steps: - first identifying the K centers of the mixtures which, similarly to the finite case, is captured in the log K term; n - then, identifying the right parameters of the Gaussian components centered on the points , identified in the previous step. Similarly to the Gaussian case, this is captured in O in the most favorable case. log T T (cid:16) (cid:17) Remark 17 It may seem paradoxical that the model of mixtures of Gaussians achieves, in the best rate achieved by a single possible case, a rate of convergence O Gaussian in the regime n << T under optimal conditions. In reality, the latter rate of convergence is also achievable in the model of mixtures of Gaussians, but similarly as in the case of a single Gaussian component, it requires the strong assumption that slower than the O log K n log T T (cid:16) (cid:16) (cid:17) (cid:17) which is much more restrictive. On the other hand, many distributions only satisfy Σ1( P dǫ, ) ≤ ΣK( P dǫ ) ≤ for some K 2, in which case the rate of convergence O achieved here is much faster than ≥ , which is the best possible rate achieved in the single Gaussian model in general. (cid:17) (cid:16) log K n O d log n n (cid:16) (cid:17) 41 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF G.2 Second Case: ΣK( P ) > dǫ ) is not smaller than dǫ and therefore, the choice of a large parameter bk would K k=1 bk too large to achieve the desired rate of convergence. As a result, we In this case, ΣK( make the term ΣK (P) set P αn P Replacing in the bound (28) gives k ∀ ∈ [K], bk = 1. EP1,...,PT ES1,...,ST E + 2K log(2K) βT + 1 βT G.3 In Summary (π)] π∼ ˆΠ[ E K τkk k ̄ ̄ξ2 k 2 Xk=1 ∗ − E ≤ 4 log(2K) αn + + d βT K Xk=1 log 1 + 2dK αn kβT 2 αn ! 4 ̄ ̄ξ2 log (1 + 4αLn) + ) 4KΣK( αn P + 4 βT K Xk=1 (cid:18) log 1 ̄ ̄bk + ̄ ̄bk − . 1 (cid:19) In any case, the bound can be written as EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ CVfinite(K, n) + K × CVGaussian (d, ΣK( ), n, T ) + CVmeta(T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ), P where CVfinite(K, n) = 4 log(2K) αn is the convergence term in the finite case (to find the centers of the mixtures), and CVGaussian (d, K, ΣK ( P ), n, T ) = ( 8Ld T + 4 αn log (1 + 4αLn) + 4ΣK (P) αn αT 2d if ΣK( ) P otherwise; ≤ n T 2 ; is equal to the convergence term in the Gaussian case (with one component) and is a O exist K points such that distribution is concentrated at a rate ǫ = n if there T 2 around those K points, and 1 T (cid:0) (cid:1) O d log n n otherwise. The remaining term is P (cid:17) (cid:16) CVmeta(T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ) = 2K log(2K) βT + 1 βT K Xk=1 2 τkk k ̄ ̄ξ2 k + d βT K log 1 + 4 ̄ ̄ξ2 kβT 2 αn ! Xk=1 K 4 βT + log T ̄ ̄bk + ̄ ̄bk − 1 (cid:19) dK log T T . Xk=1 (cid:18) and it is the convergence term term at the meta level. Please note that it is a O G.4 What if the number of components in the mixture is unknown? (cid:16) (cid:17) In practice, we do not know in advance how to chose the number of components K in the prior. In this case, we are going to include inside all the mixtures of Gaussians, i.e., M = M pw,μ,σ2 = ( +∞ d wk Xk=1 Oi=1 (μk,i, σ2 k,i) : N K ∃ ≥ 1 : k ∀ ≥ K + 1, wk = 0 ) . 42 FAST RATES IN META-LEARNING WITH PAC-BAYES Note that the sum inside the definition of ̄K K. We still denote by π = k=1 ̄wkN k ̄K + 1, ̄wk = 0. It still holds that, for any w, μ, σ2, P F ( ̄μk, ̄σ2 ≥ is finite, since wk = 0 for any k beyond a certain rank kId) the prior in each task. By definition, for any KL(pw,μ,σ2 π) k ≤ KL(w ̄w) + k where we denoted 1 2 ∞ d wk Xk=1 Xi=1 ∞ ̄μk,i)2 (μk,i − ̄σ2 k + σ2 k,i ̄σ2 k − 1 + log ̄σ2 k σ2 k,i ! , KL(w ̄w) = k wk log wk ̄wk . Xk=1 To put things clearly, the KL remains identical to the case where K is known except for the fact that the sums on k are no longer stopping at a pre-determined K. This difference aside, the bound remains identical to the one in the case where K is known, and the bound from Theorem 1 becomes, at t = T + 1, 2 inf w,μ,σ2 ( d EST +1 E θ∼ρT +1(π,α)[RPT +1(θ)] R∗ PT +1 ≤ − Eθ∼pw,μ,σ2 [RPT +1(θ)] R∗ PT +1 + − KL(w ̄w) k αn + 1 2αn ∞ wk ̄μk,i)2 (μk,i − ̄σ2 k + σ2 k,i ̄σ2 k − 1 + log ̄σ2 k σ2 k,i ! ) . Xi=1 Next, we are going to define a prior on K within the prior of priors as follows. We assume that the number of mixtures K is smaller than T , because even if it were not, it would be impossible to identify them with enough confidence. We define the set of priors on priors Xk=1 = qx,δ,τ,ξ2,b = qx × ( G qδ,τ,ξ2,b|K , ) where qx = Mult(x1, . . . , xT ) is the prior distribution on K and qδ,τ,ξ2,b|K = Dir(δ1, . . . , δK ) (τk,i, ξ2 k) N ⊗ Ok∈[K] i∈[d] K ⊗ Ok=1 Γ(2, bk). and we set the prior of prior as Λ = q 1 between the priors of priors, which becomes T 1T ,1K ,0, ̄ ̄ξ2, ̄ ̄b. We also need to re-compute the KL divergence KL(qλ,δ,τ,ξ2,bk Λ) = log T − H(x) + E K∼Mult(x) + log Γ(K) Γ(1⊤δ) K k=1 Γ(δk) × + 1 2 Xk,i τ 2 k,i ̄ ̄ξ2 k + ξ2 k ̄ ̄ξ2 k − K " Xk=1 1 + log (δk − ̄ ̄ξ2 k ξ2 k ! 1) ψ(δk) (cid:16) K + 2 Xk=1 − ψ(1⊤δ) (cid:17) log bk ̄ ̄bk + ̄ ̄bk − bk bk ! # , Q , we optimize first in (x1, . . . , xT ) and then on using (16). Please note that in any optimization on δ, τ, ξ2, b conditionally on K. This means that the latter parameters are allowed to depend on K. G 43 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF While the infimum on shortcut notation inf x,δ,τ,ξ2,b. We can next use the bound from Theorem 5 and we have of any quantity should be written inf x inf δ,τ,ξ2,b∈σ(K), we will adopt the G EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ ∞ 4 inf x,δ,τ,ξ2,b ( E ( ̄w, ̄μ, ̄σ2)∼qx,δ,τ,ξ2,b EPT +1 L inf w,σ2 ( " + 1 2αn ∞ d wk Xk=1 Xi=1 H(x)) + ̄μk,i)2 (μk,i − ̄σ2 k + 1 2βT E K∼Mult(x) " + 1 2βT (log T − +log Γ(K) Γ(1⊤δ) K k=1 Γ(δk) × + 1 2 Xk,i τ 2 k,i ̄ ̄ξ2 k + ξ2 k ̄ ̄ξ2 k − 1 + log wkk σkk 2 + KL(w ̄w) k αn 1 + log ̄σ2 k σ2 k,i ! )# Xk=1 σ2 k,i ̄σ2 k − K (δk − Xk=1 ̄ ̄ξ2 k ξ2 k ! +2 1) ψ(δk) − (cid:16) K Xk=1 log bk ̄ ̄bk ψ(1⊤δ) (cid:17) bk ̄ ̄bk − + . bk ! #) Q The optimization on σ2 becomes k,i may be performed exactly by setting σ2 k,i = ̄σ2 k 2αLn ̄σ2 k+1 , and the bound EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 E inf x,δ,τ,ξ2,b ( ( ̄w, ̄μ, ̄σ2)∼qx,δ,τ,ξ2,b EPT +1 KL(w ̄w) k αn + d 2αn inf w ( ∞ Xk=1 + 1 2βT (log T − H(x)) + wk log 2αLn ̄σ2 k + 1 + (cid:0) E 1 2βT K∼Mult(x) " (cid:1) K +log Γ(K) Γ(1⊤δ) K k=1 Γ(δk) × + 1 2 Xk,i τ 2 k,i ̄ ̄ξ2 k + ξ2 k ̄ ̄ξ2 k − 1 + log Q We restrict the optimization in w to the set the bound becomes (wk)k≥1 : { k0 ≤ ∃ " μPT +1 − ̄σ2 k 2 ̄μkk ) # 1 2αn ∞ Xk=1 wk k (δk − Xk=1 ̄ ̄ξ2 k ξ2 k ! +2 1) ψ(δk) (cid:16) K log Xk=1 ̄K : wk0 = 1, ψ(1⊤δ) (cid:17) bk ̄ ̄bk − + . bk ! #) − bk ̄ ̄bk k ∀ , and = k0, wk = 0 } EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 E inf x,δ,τ,ξ2,b ( ( ̄w, ̄μ, ̄σ2)∼qx,δ,τ,ξ2,b EPT +1 1 αn log 1 ̄wk + d 2αn log 2αLn ̄σ2 k + 1 + 1 2αn μPT +1 − k ̄σ2 k min k∈[K] (cid:26) + 1 2βT (log T − H(x)) + (cid:0) E 1 2βT K∼Mult(x) " (cid:1) K " ̄μkk 2 (cid:27) # ψ(1⊤δ) (cid:17) bk ̄ ̄bk − + . bk ! #) (δk − Xk=1 ̄ ̄ξ2 k ξ2 k ! +2 1) ψ(δk) − (cid:16) K Xk=1 log bk ̄ ̄bk +log Γ(K) Γ(1⊤δ) K k=1 Γ(δk) × + 1 2 Xk,i τ 2 k,i ̄ ̄ξ2 k + ξ2 k ̄ ̄ξ2 k − Q 1 + log 44 6 FAST RATES IN META-LEARNING WITH PAC-BAYES Next, we classically decompose the expectation E ( ̄w, ̄μ, ̄σ2)∼qx,δ,τ,ξ2,b [X] as E ( ̄w, ̄μ, ̄σ2)∼qx,δ,τ,ξ2,b [X] = E K∼Mult(x) E ( ̄w, ̄μ, ̄σ2)∼qδ,τ,ξ2 ,b|K [X] . Applying Fubini's theorem and inverting the infimum and the expectation yields the bound h i EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 E inf x,δ,τ,ξ2,b ( K∼Mult(x) EPT +1 " E ( ̄w, ̄μ, ̄σ2)∼qδ,τ,ξ2 ,b|K 1 αn (cid:20) log 1 ̄wk + d 2αn log 2αLn ̄σ2 k + 1 + 1 2αn min k∈[K] ( μPT +1 − k ̄σ2 k 2 ̄μkk (cid:21) )# + 1 2βT (log T − H(x)) + 1 2βT E +log Γ(K) Γ(1⊤δ) K k=1 Γ(δk) × + 1 2 Xk,i τ 2 k,i ̄ ̄ξ2 k + ξ2 k ̄ ̄ξ2 k − The bound (27) from the previous part still holds: Q (cid:0) K∼Mult(x) " 1 + log K (cid:1) (δk − Xk=1 ̄ ̄ξ2 k ξ2 k ! +2 1) ψ(δk) − (cid:16) K Xk=1 log bk ̄ ̄bk ψ(1⊤δ) (cid:17) bk ̄ ̄bk − + . bk ! #) min k∈[K] E (cid:26) ( ̄w, ̄μ, ̄σ2)∼qδ,τ,ξ2,b|K d 2αn K log Xk=1 (cid:18) 4αLn bk + 1 + (cid:19) Xk=1 1 αn (cid:20) log K + 1 ̄wk bkdξ2 k αn d 2αn log 2αLn ̄σ2 k + 1 + 1 2αn (cid:0) min k∈[K] 1 αn + (cid:1) μPT +1 − bkk (cid:26) τkk 2 ̄μkk μPT +1 − k ̄σ2 k 1⊤δ 1 − 1 δk − 2 + log ≤ (cid:21)(cid:27) , (cid:27) and we can inject it in the computation so that the bound becomes EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf x,δ,τ,ξ2,b ( d 2αn E K∼Mult(x) + E d αn K∼Mult(x) K " Xk=1 bkξ2 k + E 1 αn # K∼Mult(x) EPT +1 min k∈[K] (cid:20) K bkk (cid:26) + 1 2βT (log T − H(x)) + 1 2βT E K∼Mult(x) " +log Γ(K) Γ(1⊤δ) K k=1 Γ(δk) × + 1 2 Xk,i τ 2 k,i ̄ ̄ξ2 k + ξ2 k ̄ ̄ξ2 k − 1 + log (δk − Xk=1 ̄ ̄ξ2 k ξ2 k ! +2 1) ψ(δk) − (cid:16) K Xk=1 log bk ̄ ̄bk ψ(1⊤δ) (cid:17) bk ̄ ̄bk − + . bk ! #) K 4αLn bk log (cid:18) 2 + log τkk " Xk=1 μPT +1 − + 1 (cid:19)# 1⊤δ 1 − 1 δk − (cid:27)(cid:21) Q An exact optimization in ξ2 k yields ξ2 k = ̄ ̄ξ2 k ̄ ̄ξ2 4bk k αn βT 1+ and we can replace in the bound EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf x,δ,τ,b ( d 2αn E K∼Mult(x) K " Xk=1 log 4αLn bk (cid:18) + 1 (cid:19)# 45 C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF . . + E 1 αn K∼Mult(x) EPT +1 bkk μPT +1 − 2 + log τkk min k∈[K] K (cid:20) (cid:26) + 1 2βT (cid:27)(cid:21) (log T H(x)) − + 1 2βT E K∼Mult(x) (δk − 1) ψ(δk) (cid:16) − log 1 + 4bk " Xk=1 2 + + 1 2 K Xk=1 τkk k ̄ ̄ξ2 k d 2 K Xk=1 ψ(1⊤δ) (cid:17) ̄ ̄ξ2 kβT αn ! Γ(K) K + 2 log Xk=1 Γ(1⊤δ) K k=1 Γ(δk) ̄ ̄bk − × Q bk + ̄ ̄bk bk bk ! #) 1⊤δ 1 − 1 δk − + log We choose δk = 2 for any k 1 and noting that both ≥ K (δk − Xk=1 1) ψ(δk) (cid:16) − ψ(1⊤δ) (cid:17) 0 ≤ and log Γ(K) we deduce the following bound: Γ(1⊤δ) K k=1 Γ(δk) × Q = log Γ(2K) Γ(K) ≤ K log(2K), EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf x,τ,b ( d 2αn E K∼Mult(x) " 4αLn bk (cid:18) + 1 (cid:19)# + E 1 αn K∼Mult(x) EPT +1 min k∈[K] (cid:20) + E 1 αn K∼Mult(x) [log(2K)] + 1 2βT (log T − bkk (cid:8) μPT +1 − 1 2βT E H(x)) + K∼Mult(x) " K log(2K) K log Xk=1 τkk 2 (cid:21) (cid:9) K + 1 2 2 τkk k ̄ ̄ξ2 k + d 2 K log 1 + 4bk ̄ ̄ξ2 kβT αn ! K + 2 log Xk=1 bk ̄ ̄bk + ̄ ̄bk − bk bk ! #) Xk=1 Xk=1 Recall the (unchanged) definition of ΣK( ): P ΣK( P ) = inf τ1,...,τK EPT +1∼P min k∈[K] k μPT +1 − (cid:20) 2 τkk . (cid:21) Recalling that τ (as well as b) is allowed to depend on K, we define (τ1, . . . , τK ) as the argument ). It follows that the bound becomes (up to a permutation) of ΣK( P EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ + E 1 αn K∼Mult(x) K " Xk=1 + 1 2βT E K∼Mult(x) " K log(2K) + d 2αn E 4 inf x,b ( K∼Mult(x) K " Xk=1 log 4αLn bk (cid:18) + 1 (cid:19)# bkΣK( P ) + log(2K) # + 1 2βT (log T H(x)) − 2 τkk k ̄ ̄ξ2 k + d 2 K Xk=1 log 1 + 4bk ̄ ̄ξ2 kβT αn ! 1 2 K Xk=1 46 FAST RATES IN META-LEARNING WITH PAC-BAYES K + 2 log Xk=1 bk ̄ ̄bk + ̄ ̄bk − bk bk ! #) . From here, we are going to distinguish two different cases, as we did before: - first case: there exists K reasonably small such that ΣK( P dǫ; ) ≤ - second case: for any reasonable K, ΣK( P ) > dǫ. G.4.1 FIRST CASE Again, this is the case where we expect some improvement from the meta-learning. Setting the bound becomes k ∀ ∈ [K], bk = T, EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf x ( d 2αn E K∼Mult(x) 4αLn T (cid:18) + 1 (cid:19)# K log " Xk=1 1 2βT + E 1 αn K∼Mult(x) [KT ΣK( P ) + log(2K)]+ 1 2βT (log T − H(x))+ E K∼Mult(x) " K log(2K) K + 1 2 2 τkk k ̄ ̄ξ2 k + d 2 K Xk=1 log 1 + 4 ̄ ̄ξ2 kβT 2 αn ! K + 2 log Xk=1 T ̄ ̄bk + ̄ ̄bk − T T ! #) , Xk=1 and after the simplification d 2αn K log Xk=1 (cid:18) 4αLn T + 1 (cid:19) 2LdK T , ≤ we deduce EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 2Ld T E 4 inf x ( K∼Mult(x) [K] + E 1 αn K∼Mult(x) [log(2K)] + E T αn K∼Mult(x) [KΣK( P )] + (log T 1 2βT K log 1 + − 4 ̄ ̄ξ2 1 2βT E K H(x)) + K∼Mult(x) K log(2K) " kβT 2 αn ! + 2 Xk=1 log T ̄ ̄bk + ̄ ̄bk − T T ! #) , + 1 2 K Xk=1 2 τkk k ̄ ̄ξ2 k + d 2 Xk=1 Then, choosing to restrict the infimum on all the multinomial distributions Mult(x1, . . . , xT ) to all the Dirac masses, i.e., all the (x1, . . . , xT ) such that there exists K such that xK = 1. It follows that H(x) = 0 and we deduce that 1, . . . , T ∈ { } EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ inf K∈[T ] ( 4 log(2K) αn + 8LdK T + 47 4T KΣK( P ) + 2 log T βT αn C. RIOU AND P. ALQUIER AND B.-E. CH ́ERIEF-ABDELLATIF + 2 βT " K log(2K)+ 1 2 K Xk=1 2 τkk k ̄ ̄ξ2 k + d 2 K Xk=1 log 1 + 4 ̄ ̄ξ2 kβT 2 αn ! K +2 log T ̄ ̄bk + ̄ ̄bk − T T ! #) , In particular, if there exists a K relatively small such that ΣK( becomes P dǫ = dn T 2 , then the bound Xk=1 ) ≤ EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] − E ∗ + 2 βT " K log(2K)+ 1 2 K Xk=1 2 τkk k ̄ ̄ξ2 k + d 2 G.4.2 SECOND CASE Recall the bound: 4 log(2K) αn 4 ̄ ̄ξ2 inf K∈[T ] ( ≤ K 1 + log Xk=1 + 8LdK T + 4dK αT + 2 log T βT kβT 2 αn ! K +2 log Xk=1 T ̄ ̄bk + ̄ ̄bk − T T ! #) EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf x,b ( d 2αn E K∼Mult(x) K " Xk=1 log 4αLn bk (cid:18) + 1 (cid:19)# bkΣK( P ) + log(2K) + (log T H(x)) − + E 1 αn K∼Mult(x) K " Xk=1 + 1 2βT E K∼Mult(x) " K log(2K) + 1 2 K Xk=1 2 τkk k ̄ ̄ξ2 k 1 2βT K # + d 2 4bk ̄ ̄ξ2 kβT αn ! ̄ ̄bk − bk + log 1 + Xk=1 K + 2 log Xk=1 bk ̄ ̄bk bk ! #) . . In this case, we do not expect much improvement from meta-learning, and we will simply choose The bound then becomes k ∀ 1, . . . , T ∈ { , bk = 1. } EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ 4 inf x ( d log (1 + 4αLn) 2αn E K∼Mult(x) [K] + E 1 αn K∼Mult(x) [KΣK( P ) + log(2K)] + 1 2βT (log T H(x)) + + 1 2 K Xk=1 2 τkk k ̄ ̄ξ2 k + d 2 K Xk=1 log 1 + − 4 ̄ ̄ξ2 kβT αn ! 1 2βT E K K∼Mult(x) " K log(2K) + 2 log Xk=1 (cid:18) 1 ̄ ̄bk + ̄ ̄bk − . 1 (cid:19) #) Similarly as before, we restrict the minimization to the set of Dirac distributions and we deduce EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] − E ∗ 48 FAST RATES IN META-LEARNING WITH PAC-BAYES inf K∈[K] ( ≤ 4 log(2K) αn + 2dK log (1 + 4αLn) αn + ) 4KΣK( αn P + 2 log T βT + 2 βT " K log(2K) + Xk=1 G.4.3 OVERALL BOUND K 1 2 2 τkk k ̄ ̄ξ2 k + d 2 K Xk=1 log 1 + 4 ̄ ̄ξ2 kβT αn ! K + 2 log Xk=1 (cid:18) 1 ̄ ̄bk + ̄ ̄bk − . 1 (cid:19)# ) In summary, the bound can be written as EP1,...,PT ES1,...,ST E π∼ ˆΠ[ E (π)] ∗ − E ≤ inf K∈[T ] ( CVfinite(K, n) + K CVGaussian (d, ΣK ( P × ), n, T ) + CVunknown meta (T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ) ) , where CVfinite(K, n) and CVGaussian (d, K, ΣK ( P where the number of mixtures K is known, and the convergence term at the meta level becomes ), n, T ) are exactly the same terms as in the case CVunknown meta (T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ) = CVmeta(T, n, d, K, ̄ ̄b, ̄ ̄ξ2, τ ) + 2 log T βT . Even when the number of mixtures K is unknown, the same bound as in the case of K known can be achieved up to a 2 log T term, which is the order of the time required to find the optimal number βT of components in the mixture at the meta level. 49
http://arxiv.org/abs/2302.11707v1
2023-02-23T00:00:32
2023-02-23T00:00:32
A Deep Neural Network Based Approach to Building Budget-Constrained Models for Big Data Analysis
Deep learning approaches require collection of data on many different input features or variables for accurate model training and prediction. Since data collection on input features could be costly, it is crucial to reduce the cost by selecting a subset of features and developing a budget-constrained model (BCM). In this paper, we introduce an approach to eliminating less important features for big data analysis using Deep Neural Networks (DNNs). Once a DNN model has been developed, we identify the weak links and weak neurons, and remove some input features to bring the model cost within a given budget. The experimental results show our approach is feasible and supports user selection of a suitable BCM within a given budget.
[ "Rui Ming", "Haiping Xu", "Shannon E. Gibbs", "Donghui Yan", "Ming Shao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11707v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11707v1", "@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" ]
Int'l Conf. Data Science | ICDATA'21 | 1 A Deep Neural Network Based Approach to Building Budget-Constrained Models for Big Data Analysis* Rui Ming1, Haiping Xu2, Shannon E. Gibbs3, Donghui Yan4, and Ming Shao5 1,2,3,5Department of Computer and Information Science 4Department of Mathematics University of Massachusetts Dartmouth, Dartmouth, MA 02747, USA Email: {rming, hxu, sgibbbs, dyan, mshao}@umassd.edu Abstract-Deep learning approaches require collection of data on many different input features or variables for accurate model training and prediction. Since data collection on input features could be costly, it is crucial to reduce the cost by selecting a subset of features and developing a budget-constrained model (BCM). In this paper, we introduce an approach to eliminating less important features for big data analysis using Deep Neural Networks (DNNs). Once a DNN model has been developed, we identify the weak links and weak neurons, and remove some input features to bring the model cost within a given budget. The experimental results show our approach is feasible and supports user selection of a suitable BCM within a given budget. Keywords- Deep learning, big data analysis, budget-constrained model, input feature, deep neural network I. INTRODUCTION With the emergence of big data, large scale data-driven machine learning becomes increasingly important. Deep learning, also called deep structured learning, is a subfield of machine learning based on artificial neural networks (ANNs). A deep neural network (DNN) is an ANN with multiple hidden layers between the input and output layers. There are many different types of DNNs, e.g., feedforward deep neural network (FF-DNN), recurrent neural network (RNN) and convolutional neural network (CNN), all of which follow similar procedures for training and testing [1]. Deep learning approach has been very successful in recent years for processing big data from sources such as social media, Internet search engines, e- commerce platforms, and healthcare systems. Successful deep learning mechanisms require collecting a large amount of data or purchasing data from a third-party vendor on many different input features or variables in order to develop feasible and accurate models for classification and prediction. However, data collection on input features could be very expensive and time consuming. Such cost may also include preprocessing, maintenance and storage of the data associated with the input features. For example, a recommendation system of a major e- commerce application using deep learning would require storing millions of user access information per month. Dozens of features such as, the amount of time a user views a certain item, and other items that are also viewed, would be recorded * This material is based on work supported by 2020 University Industry Collaborative Seed Fund, University of Massachusetts. for each user access. The preprocessing of such data and the costs associated with the storage, transmission and maintenance can be remarkably high. Similarly, in a deep learning application that determines when a cruise ship needs to be maintained, a huge amount of data on the status measurements and usage statistics of the different system components of the cruise ship would also be required. As one more example, in a healthcare application using deep learning, various medical test data such as blood pressure, cholesterol levels and heart rates, need to be collected to develop an accurate medical diagnose model for training and determination of certain diseases. The cost associated with input features include the cost to collect the training and testing data as well as collection of a new data point for the classification or prediction purpose. In this study, we assume there are existing training and testing datasets for building a deep learning model. Therefore, we can focus on the total cost of collecting a new data point on all required features of the model. We call the cost for collecting a new data point the model cost. Note that a high model cost would also imply a high cost of acquiring the needed datasets for model training and testing. Practically, there are always limits to the budgets in deep learning applications. Due to the budget constraints, we must limit the number of features used in a model, while keeping the model accuracy high enough. In our approach, we reduce the model cost by selecting a subset of the most important features and deriving a reasonable model within a certain budget. In other words, with a given budget, we need to eliminate the least important features to ensure the model cost is lower than the budget. Since removing features typically reduces the accuracy of the model, it is required that our approach must deliver a budget-constrained model (BCM) with a reasonable accuracy. In previous work, we proposed several ways to select a set of features under a certain cost profile [2]. In this paper, we focus on deep learning methods and introduce a DNN-based approach to identifying the least important features from a DNN, subject to a given budget. Instead of deriving a single BCM, we produce a list of BCMs with expected predictive accuracies, sorted by predefined budget levels. This could be used to choose a BCM with the best predictive accuracy under a given budget, or allow a user to better trade off between budget and model accuracy. 2 Int'l Conf. Data Science | ICDATA'21 | II. RELATED WORK Previous work related There have been many research efforts on big data analytics using deep learning approaches. Deep architectures such as DNNs can often capture hierarchical and complex patterns of the inputs for more effective analysis of big data than traditional statistical learning methods. For example, the "Google Brain" project has used large DNNs with about one million simulated neurons and one billion simulated connections to leverage big data for image enhancement, language translation, and robotics research [3]. Esteva et al. presented deep learning techniques using DNNs for medical imaging, electronic health record data processing, and robotic-assisted surgery in the healthcare domain [4]. They also demonstrated the application of deep learning in bioinformatics, e.g., building a deep-learning system in genomics to convert raw data into input data tensors, processed by DNNs for specific biomedical applications. Xu and Gade designed a systematic approach to designing a layered knowledge graph that can be converted into a structured DNN [5]. The structured DNN model has been used for smart real estate assessments, which outperforms conventional multi- variate linear regression methods as well as prediction mechanisms used by the leading real estate companies such as Zillow and Redfin. Most of the deep learning approaches assume the availability of required datasets for predictive analysis without considering the cost associated with data collection. In contrast, our approach aims to derive budget- constrained models by eliminating the least important features. is summarized as follows. Elkan showed the proportion of negative examples in a training set would affect the optimal cost-sensitive classification decisions for problems with differing misclassification costs [6]. He recommended first developing a classifier and then using the probability estimates calculated from the classifier to compute optimal decisions. Sheng and Ling proposed a method to select a proper threshold that produces the lowest misclassification cost [7]. The experimental results showed that thresholding, as a general method to develop a cost-sensitive algorithm, has the least sensitivity on the misclassification cost ratio. O'Brien et al. analyzed the relationship between systematic errors in the class probability estimates and cost matrices for multiclass classification [8]. They explored the effect on the class partitioning of the cost matrix and demonstrated the effective- ness of learning a new partition matrix. Zhou et al. proposed a method to select features by their probabilities that are inversely proportional to the costs [9]. They constructed a decision tree with feature costs and used a random forest-based feature selection algorithm to produce low-cost feature subsets. Ji and Carin presented a formal definition of the cost-sensitive classification problem and provided a solution using a partially observable Markov decision process (POMDP) [10]. Different from traditional approaches, features were selected in a sequential manner until no additional feature acquisition could be justified based on classification results. More recently, Maliah and Shani formulated the cost sensitive classification problem as a POMDP, taking both test and misclassification costs into consideration [11]. They used a tree-based MDP to cost-sensitive learning approach to modeling a belief space and provided a scalable method for reasoning about future actions. Frumosu et al. proposed a method to reduce the production cost by predicting the number of faulty products while ensuring production quality delivery [12]. They reduced the problem to an imbalanced binary classification problem and solved the problem using Voronoi diagrams and the genetic algorithm. The above cost-sensitive learning approaches provided useful methods to reduce test and misclassification costs; however, they are not aimed to provide users model options to meet the budget constraints. In addition, most of the existing cost-sensitive learning approaches are not deep learning approaches, which intrinsically have limitations in dealing with large datasets and complex problems such as medical diagnosis. In previous work [2], Yan et al. approached the problem of budget constrained learning, in terms of variable costs. They explored the solution space to produce a model schedule as a list of models, sorted by model costs and expected predictive accuracy. Based on this work, we further proposed a deep learning based approach to building budget-constrained models using deep neural networks. In this sense, our approach complements existing cost-sensitive learning approaches that are suitable for applications not involving large amount of data and provides a scalable solution to complex problems, such as cybersecurity, fraud detection and medical diagnosis. III. MODEL COST AND BUDGET-CONSTRAINED MODELS Deep learning has been widely used in various fields such as medical diagnosis, autonomous driving, and mathematics education. DNNs are a type of deep learning methods widely adopted in big data analytics and large-scale data driven applications. Since DNN-based approaches have shown ground-breaking results in speech recognition and image recognition tasks in recent years, the number of applications using DNNs has exploded. In this paper, we demonstrate our deep learning approach using FF-DNN – a simple type of DNNs, to build BCMs for big data analysis. A. Model Cost of a Deep Neural Network The FF-DNN model is usually treated as a "black box"; however, it is undeniable that every neuron in a hidden layer of a FF-DNN has certain significance or hidden semantics, and different neurons have different effects on the outputs of the model [5]. To a certain extent, the absolute weight value of a link in a neural network represents the impact of the source neuron to the target neuron. Such impact may pass through the layers of the neural network and influence the results of the output neurons. When an input neuron has the least impact on the results of the output neurons, its corresponding feature may become a candidate to be removed from the model with minimal impact on the model accuracy. To adopt a well-trained deep learning model for prediction or classification, we need to collect data on a set of input features. For example, the set of input features to determine if a patient has a certain heart disease may include measures such as "blood pressure", "heart rate", "fasting blood sugar", "age", and "gender". The collection, purchase, and storage of data on Int'l Conf. Data Science | ICDATA'21 | 3 different features may incur different feature cost. Let F be the set of all measurable features in a certain domain, where | F | = m. Let f = {f1, f2, ..., fK} be a set of input features of a model Ф(f), which uses a total of K measurable features; thus, f ⊆ F and K ≤ m. Let function be a mapping from feature f  F to the cost of measuring feature f. To simplify matters, we assume a feature cost is a nonnegative integer from the set of nonnegative integers Z*. We define the model cost of Ф(f) as the summation of all feature costs as in Eq. (1). C. A Framework for Building a Budget-Constrained Model With sufficient training and testing datasets, our approach aims to develop a BCM with its model cost within a given budget level. The framework for generating a BCM under a given budget is illustrated in Fig. 1. C(Ф(f)) = ∑ c(fi) K i=1 where fi f and | f | = K (1) Given a budget level b, we need to find a set of features f ⊆ F, such that the model cost of Ф(f) is no more than b, and Ф(f) has the best predictive accuracy. That is, to solve the optimal problem defined in Eq. (2). arg max f⊆F accuracy(Ф(f)) subject to C(Ф(f)) ≤ b (2) In our DNN-based approach, we start with all measurable features and a list of predefined budget levels. We gradually remove the least important input features until the model costs are within the budgets. For each budget level, once the least important features are removed, the remaining features form a new set of inputs for development of a new classifier. It is expected that the new model will be less accurate as the number of input features decreases; however, the costs of collecting data for training and prediction can be significantly reduced. B. Budget-Constrained Models In the context of FF-DNN, a budget-constrained model or BCM Ф(f) is defined as a 4-tuple (S, f, w, p), where S is the structure of the FF-DNN, f is a set of input features that correspond to the set of input neurons in Ф(f), w is the weights of the links in Ф(f), and p the expected accuracy of the model. Note in this paper, S is defined as a fully connected DNN (FCDNN), while using partially connected DNNs (PCDNNs) is envisioned as a future, and more ambitious research direction. Given a list of budget levels B = (b1, b2, ..., bn) and a set of measurable features F = {f1, f2, ..., fm}, our task is to build a list BCMs Фi, where 1 ≤ i ≤ n, and for each Фi, with an identified subset of features from F such that the model satisfies Eq. (2) for budget bi. Table I shows an example of a list of BCMs with their expected model accuracy and lists of features, sorted by budget levels. With a given budget and a required accuracy, we can find the most suitable model from the table. For example, if the given budget is 1750, and the required model accuracy is 0.94, we shall choose the BCM with the set of features {1,4,5,8,10}, whose model cost is 1500 that is less than 1750. TABLE I. AN EXAMPLE OF A LIST OF BCMS UNDER BUDGETS Model Budget Accuracy Features Ф1 Ф2 Ф3 Ф4 Ф5 Ф6 3000 2500 2000 1500 1000 500 0.9615 0.9519 0.9433 0.9406 0.9357 0.9325 {1,2,4,5,8,10,11,12} {1,2,4,5,8,10,11} {1,4,5,8,10,11} {1,4,5,8,10} {1,5,8,10} {1,5,10} Fig. 1. A Framework of generating a BCM under a given budget For any raw data, whether captured by measurement or purchased from a third-party vendor, there is typically a lot of unnecessary information. We first need to preprocess the data and retrieve the needed fields in a desired format. Since data points with missing information or wrong information could negatively affect the training and testing results, such data points must be fixed or considered as outliers to be removed from the dataset. The dataset is then split into a training dataset and a testing dataset. Note that to simplify Fig. 1, we do not show the process of partitioning the dataset into k equal sized subsamples for the k-fold cross-validation purpose. We extract all the features from the dataset to build the first model. After the model is fully trained, we check if the model cost is higher than the given budget. If the answer is yes, we find the least important feature, remove it using an algorithm described in Section IV, and create a new model using the remaining features. This procedure is repeated until the model cost becomes less than or equal to the given budget. In this case, the testing dataset is used to calculate the expected model accuracy. Finally, the 4-tuple (S, f, w, p), i.e., the structure S of the FF- DNN, the set of input features f, the weights of the links w in the model, and the expected accuracy p of the model, is recorded as the resulting BCM for the given budget. IV. GENERATION OF BUDGET-CONSTRAINED MODELS A. Identifying the Least Important Input Feature In our DNN-based approach, we define a set of thresholds for the links of the neural network, designed to identify and eliminate the weak links. When a neuron's output links are all identified as weak links, the neuron is considered to have minimal impact on the output, and thus, it is considered a weak neuron. Our approach starts with the last hidden layer that most directly affects the output neurons, and then works backward to *:ZFc 4 Int'l Conf. Data Science | ICDATA'21 | determine the weak links and weak neurons. The procedure repeats until we find weak input neurons, whose corresponding features become a candidate to be removed from the model. We now use a few examples to show how to identify weak links and weak neurons. Since multiple source neurons link to a target neuron, the weights of each link represent their impact on the target neuron. The higher absolute value of a weight, the higher the impact a source neuron has on the target neuron. We can identify the weak links by setting a threshold for each target neuron of a link. For example, in Fig. 2 (a), the link threshold for target neuron tn is set to 0.3. Consequently, the link from source neuron n1 to n is marked as a weak link (denoted by a dashed line) as the weight of the link is 0.1 that is less than tn. reasonably mark links l1, l2, l3 and l4 as weak links. Being said, a link is marked as a weak link in either of the following two cases: 1) its weight is less than the threshold, and 2) its target neuron is a weak neuron. Fig. 4 presents an example of a FF-DNN model with four layers including two hidden layers. There are three input neurons n11, n12 and n13, which correspond to three input features. All neurons except the input neurons have been assigned thresholds. Note that the thresholds for the neurons can be different, and each threshold of a neuron n is initialized based on the weights of all links that connect to neuron n. As described later in this section, the thresholds need to be adjusted if no weak input neuron can be identified. (a) (b) Fig. 2. Examples of (a) weak link and (b) weak neuron On the other hand, a source neuron links to multiple target neurons. If the links coming from a source neuron have all been identified as weak links, that source is marked as a weak neuron. For example, in Fig. 2 (b), all links coming from source neuron n are weak links because their link weights are less than their corresponding thresholds; thus, neuron n is marked as a weak neuron denoted by a dashed circle. If a neuron is identified as a weak neuron, its impact on the outputs of the neural network is considered minimal. Therefore, all links connecting that weak neuron are considered as weak links because if we remove the weak neuron from the DNN, all its incoming links will also be removed. Fig. 3 shows such an example with neuron n5 being a weak neuron. Fig. 4. An example of a FF-DNN model The steps to identify weak links and weak neurons of the neural network in Fig. 4 are illustrated in Fig. 5. From the figure, we can see the process starts with the last hidden layer and works backward to the input layer. For example, in Layer 3, since the neuron n31 contains only one output link, which is a weak link, it is marked as a weak neuron. Similarly, in Layer 2, since neuron n21 contains links that are either weak or connect to a weak neuron, neuron n21 is then marked as a weak neuron as well. Finally, in Layer 1, two input neurons n11 and n12 are identified as weak neurons; thus, their corresponding input features are candidate features to be removed from the model. It is worth noting that, in our approach, when more than one weak input neurons are identified, the least important feature is considered to be the one having the highest feature cost; therefore, minimizing the model cost. Fig. 3. An example of weak links connecting to a weak neuron As shown in Fig. 3, since neuron n5 is a weak neuron, neuron n1 to n4 would have little impacts on the outputs of the neural network through their links to n5; therefore, we can Fig. 5. The steps to identify weak links and weak neurons Int'l Conf. Data Science | ICDATA'21 | 5 The procedure of finding the least important feature is shown in Algorithm 1. As described in the algorithm, given a FF-DNN Ф(f) with L layers, all neurons and links in Ф(f) are initially considered strong. A very low initial threshold δn is set for each neuron n, except for the input layer, based on the weights of the input links to neuron n. Starting from the last hidden layer lL-1, all the weak neurons and weak links are marked in a backward manner. To ensure that the input layer contains at least one weak neuron, the value of each threshold can be increased gradually. Finally, a weak neuron in the input layer is selected and its corresponding input feature is identified as the least important feature f*. Algorithm 1: Finding the Least Important Feature Input: A FF-DNN Ф(f) with L layers including input layer l1 and output layer lL, where f is a set of features and L ≥ 4. Output: The least important feature f*. 1. Let all neurons/links in Ф(f) be strong neurons/links 2. Let f* be the least important feature, initialized to null 3. for i = 2 to L 4. for each neuron n in layer li 5. Initialize the threshold tn of neuron n with small value δn 6. while f* is null 7. for i = L-1 to 1 // identify weak links/neurons backward 8. for each target neuron β in li+1 9. for each source neuron α in li 10. Let wγ be the weight of the link γ from α to β 11. if wγ < tβ or β is a weak neuron 12. Mark link γ as a weak link 13 for each source neuron α in li 14. if all links from source neuron α are weak links 15. Mark source neuron α as a weak neuron 16. if there is no weak neuron in input layer l1 17. Let threshold tn of each target neuron n in Ф(f) be 2*δn 18. else // there are one or more weak input neurons 19. Select a weak neuron α* in l1 with highest feature cost 20. Set f* to the input feature corresponding to α* 21. return f* B. Generating a FF-DNN based BCM Once we are able to identify the least important input feature in our FF-DNN based deep learning approach, we can generate a FF-DNN model that satisfies a budget requirement. Let a given budget be b. We develop a FF-DNN model that satisfies the requirements described in Eq. (2). This may require going through a number of steps to remove more than one input feature to meet the budget requirement. Each time when the least important feature is removed, we build a new FF-DNN model and train it using the same datasets. It is expected that the new model is less accurate than its previous model version as the number of input features decreases. With the trained new model, we identify the least important feature again until the budget requirement is met. Algorithm 2 shows the procedure to generate a BCM given budget level b, dataset D with a set of features F, and model cost function C(Ф(f)). To make the model cost C(Ф(f)) ≤ b, starting from f = F, the method gradually removes the least important feature using Algorithm 1. Finally, the model Ф(f) is created and trained on the f that satisfies C(Ф(f)) ≤ b, and the corresponding 4-tuple (S, f, w, p) representing BCM Ф(f) is returned as the result. Algorithm 2: Generating a BCM Under a Given Budget Input: Dataset D with a set of m measurable features F = {f1, f2, ..., fm}, model cost function C(Ф(f)), and a given budget b. Output: 4-tuple (S, f, w, p) representing BCM Ф(f) with C(Ф(f)) ≤ b. 1. Let f be the set of measurable features F 2. Randomly partition D into k equal sized subsamples. 3. while C(Ф(f)) > b // model cost is greater than the given budget 4. Create a FF-DNN Ф(f) with a set of features f 5. Train and test Ф(f) with dataset D using k-fold cross-validation 6. Invoke Algorithm 1, and let f* be the least important feature 7. Remove feature f* from f 8. Create a FF-DNN Ф(f) with a set of features f 9. Train and test Ф(f) with D, and save weights w and accuracy p 10. Let S be the structure of FF-DNN Ф(f). 11. return 4-tuple (S, f, w, p) C. Generating a List of BCMs Developing a deep learning model under a specific budget may possibly result in failing to achieve the required predictive accuracy or wasting money on unnecessary features. For example, a low given budget for a deep learning model adopted in a cardiac diagnosis application may only use a limited number of features, which could make the prediction accuracy less than 60%. Such an application is obviously not marketable. On the other hand, suppose a vehicle routing simulation application has already achieved close to 100% prediction accuracy with a reasonable model cost. If we continue to improve the model with more features under a higher budget, it cannot improve the predictive accuracy significantly and will inevitably waste money. To avoid the above undesirable situations, users shall be allowed to trade off between various budget levels and the required predictive accuracy for a suitable cost-effective deep learning model. Algorithm 3 shows the procedure to generate a list of BCMs LBCM, given a maximum budget bmax and a distance d between two consecutive budget levels. Each generated BCM satisfies the minimal accuracy requirement as well as its corresponding budget requirement. Algorithm 3: Generating a List of BCMs Input: The maximum budget bmax, the distance d between two consecutive budget levels, and the minimum required predictive accuracy pmin Output: A list of BCMs LBCM that meet the budget and predictive accuracy requirements 1. Let LBCM be a list of BCMs, initialized to an empty list. 2. Let b be a budget level, initialized to bmax 3. while b > 0 // a budget level should be always greater than 0 4. Invoke Algorithm 2, and let (S, f, w, p) be a 4-tuple representing BCM Ф(f) with C(Ф(f)) ≤ b 5. if p ≥ pmin // the expected model accuracy is no less than pmin 6. Add the 4-tuple (S, f, w, p) into LBCM 7. else return LBCM 8. b = b - d 9. return LBCM 6 Int'l Conf. Data Science | ICDATA'21 | V. CASE STUDY The major goal of our approach is to develop a list of DNN models that meet budget requirements, while keeping the predictive accuracy of each model as high as possible. To validate the feasibility and performance of our approach, we conduct experiments on two datasets from the UC Irvine Machine Learning Repository [13]. The two datasets are the Early-stage diabetes risk prediction dataset (DS1) and the Heart disease dataset (DS2). To facilitate the application of our approach and ensure fully trained models as well as improved model accuracy, we adopt the TensorFlow [14] to develop FF- DNNs for the experiments and apply k-fold cross-validation to train and test the models. Each dataset is randomly divided into 10 datasets for 10-fold cross-validation. For categorical data, we use one-hot encoding to divide the corresponding feature into multiple in order to improve model performance. For example, the feature Itching in DS1 is a categorical feature with a value of either "Yes" or "No", representing the presence or absence of itching symptoms, respectively. Using the one-hot encoding, the feature Itching can be split into two features, namely Itching_Yes and Itching_No. If Itching has value "Yes", it is replaced by two features Itching_Yes = 1 and Itching_No = 0; otherwise, we set Itching_Yes = 0 and Itching_No = 1. A. The Early Stage Diabetes Risk Prediction Dataset The Early-stage diabetes risk prediction dataset includes 520 instances, collected using direct questionnaires from the patients of Sylhet Diabetes Hospital in Sylhet, Bangladesh [13]. There are 13 categorical attributes used as features, namely Age, Sex, Polydipsia, Weakness, Polyphagia, Genital thrush (Gthrush), Visual blurring (Vblur), Itching, Irritability, Delayed healing (Dheal), Partial paresis (Par), Muscle stiffness (Mstiff) and Alopecia. Each input feature is assigned a feature ID as shown in Table II. TABLE II. FEATURES IN EARLY-STAGE DIABETES RISK PREDICTION DATASET DS1 Input Feature [Feature ID] Alopecia [2] Dheal [1] Gthrush [6] Polydipsia [7] Vblur [3] Itching [5] Irritability [8] Polyphagia [9] Par [10] Obesity [4] Mstiff [11] Weakness [12] Age [13] The label of each data point is an output categorical feature of Diabetes, which has the value of either "Yes" or "No", indicating whether a patient has diabetes or not. The FF-DNN models that we build for this dataset have 5 hidden layers with 120 hidden neurons in each hidden layer. We set the feature costs randomly by sampling from [100, 300] uniformly, except for the costs of Sex and Age, which are set to 0. In the following experiments, the maximum budget level bmax is set to 1900, which is greater than the total cost of all features in the diabetes dataset; thus, the initial BCM model shall consist of all the features with the potential maximum predictive accuracy. We set a distance d = 200 between two consecutive budget levels, gradually decrease the corresponding BCMs. This process stops when the predictive accuracy becomes less than the minimum required predictive accuracy pmin = 0.65, as predefined for the experiments. level, and derive the budget Table III shows a list of BCMs generated by applying Algorithm 3, where the features are represented by the feature ID as defined in Table II. For example, the BCM Ф8, with the given budget of 500 and expected predictive accuracy of 0.8173, has a set of input features {3,6,7,13}, representing the features of Visual blurring, Genital thrush, Polydipsia, and Age. TABLE III. LIST OF BCMS FOR THE EARLY-STAGE DIABETES DATASET Model Budget Accuracy DS1 Input Features Ф1 Ф2 Ф3 Ф4 Ф5 Ф6 Ф7 Ф8 Ф9 1900 1700 1500 1300 1100 900 700 500 300 0.9615 0.9423 0.9423 0.9327 0.9327 0.9135 0.8462 0.8173 0.7115 {1,2,3,4,5,6,7,8,9,10,11,12,13} {1,3,4,5,6,7,8,9,10,11,13} {1,3,4,5,6,7,8,9,10,13} {1,3,5,6,7,8,9,10,13} {1,3,6,7,9,10,13} {3,6,7,9,10,13} {3,6,7,9,13} {3,6,7,13} {3,13} The list of BCMs in Table III allows a user to select an appropriate deep learning model based on the budget and accuracy requirements. For example, when the given budget is 1600 and the required accuracy is 0.94, the user shall select the BCM Ф3with the set of features {1,3,4,5,6,7,8,9,10,13}. In this case, the expected predictive accuracy is 0.9423, which is greater than the required accuracy 0.94. However, if the required accuracy becomes 0.95, the user will have to increase the budget to 1900 and select the first model Ф1 with expected predictive accuracy 0.9615, being greater than 0.95. To demonstrate the expected performance of our approach, we compare it with two different approaches: the cost-based approach and the random selection approach. With the given features and the cost function, the cost-based approach works in accordance with the principle that it always removes the most expensive feature to make the model cost decrease quickly; while the random selection approach randomly removes a feature each time to reduce the model cost. For each of the three approaches, we generate 10 BCMs for each budget level, and select the model with the highest prediction accuracy. The highest predictive accuracy vs. model cost at each budget level is presented in Fig. 6. Fig. 6. Predictive accuracy over predefined budget levels (DS1) Int'l Conf. Data Science | ICDATA'21 | 7 From Fig. 6, we can see that our approach outperforms the other two approaches at each budget level, while the cost-based approach works better than the random-selection approach in most of the cases. Since the cost-based approach removes the most expensive feature at each step, it can remove the minimum number of features to make the model cost below a given budget. Compared with the random-selection approach, the cost-based approach would generally perform better than the random selection approach as more features could be kept for a given budget, potentially leading to a higher accuracy. However, the cost-based approach may also mistakenly remove the most expensive feature that is also an important one. This is the reason why the cost-based approach cannot perform as well as our approach. Note that our approach always removes the least important feature first, which has the lowest impact on the model prediction accuracy. In the figure, all three curves intersect at budget level 1900, the reason being, all three approaches share the same FF-DNN that uses all input features, and thus, they have the same accuracy. In addition, we notice that the accuracies of all three methods drop sharply when the budget level becomes less than 900; whereas the budget levels above 900 maintain high accuracies of all three methods. This indicates that the BCM Ф6 from Table III with the budget level of 900 may be considered as the most cost-effective model. To further demonstrate that our approach leads to a higher degree of model accuracy than the other two approaches. We conduct experiments using the three approaches by removing only one feature at a time. Fig. 7 shows the comparison results among the three approaches showing how accuracy changes with the number of features removed. As demonstrated in the figure, for any number of features removed, our approach consistently achieves the highest model accuracy than the other two approaches. Fig. 7. Accuracy changes with the number of features removed (DS1) B. The Heart Disease Dataset The Heart disease dataset contains 76 attributes, but only 14 features is used in this experiment for demonstration purpose [13]. The 14 features include 7 categorical attributes, namely Sex, Chest pain type (Cp), Slope of the peak exercise ST segment results (Restecg), Number of major vessels colored by fluoroscopy electrocardiographic (Slope), Resting (Ca), Exercise induced angina (Thal), Thallium Stress Test (Exang), along with 6 integer attributes, namely Age, Resting blood pressure (Trestbps), Serum cholestoral in mg/dl (Chol), Fasting blood sugar (Fbs), Maximum heart rate achieved (Thalach), and ST depression induced by exercise relative to rest (Oldpeak). Each input feature is assigned a feature ID as shown in Table IV. TABLE IV. FEATURES IN HEART DISEASE DATASET DS2 Input Feature [Feature ID] Ca [1] Exang [2] Oldpeak [6] Trestbps [7] Chol [11] Sex [12] Cp [3] Thal [4] Slope [8] Fbs [9] Age [13] Thalach [5] Restecg [10] The label of each data point is an output categorical feature of Diagnosis of heart disease, which has the value of either "Yes" or "No", indicating whether a patient has a heart disease or not. The FF-DNN model we built for this dataset contains 3 hidden layers with 200 hidden neurons in each hidden layer. Similar to the experiments on the Early-stage diabetes risk prediction dataset, we set the maximum budget level bmax to 1600, the distance d = 200 between two consecutive budget levels, and the minimum required predictive accuracy pmin to 0.65. Table V shows the list of BCMs generated using our approach with random feature costs sampling from [100, 300]. TABLE V. LIST OF BCMS FOR THE HEART DISEASE DATASET Model Budget Accuracy DS2 Input Features Ф1 Ф2 Ф3 Ф4 Ф5 Ф6 Ф7 Ф8 1600 1400 1200 1000 800 600 400 200 0.9333 {1,2,3,4,5,6,7,8,9,10,11,12,13} 0.9111 {1,2,3,4,6,8,9,10,11,12,13} 0.9111 {1,2,3,6,8,9,10,11,12,13} 0.8889 {1,2,3,6,9,10,12,13} 0.8444 {1,2,6,9,10,12,13} 0.8222 {2,6,10,12,13} 0.8000 {6,10,12,13} 0.7778 {6,12,13} Now, we compare the performance of our approach with that of the cost-based approach and the random selection approach by generating lists of BCMs for various budget levels. The results of predictive accuracy over predefined budget levels for the three approaches are shown in Fig. 8. Fig. 8. Predictive accuracy over predefined budget levels (DS2) 8 Int'l Conf. Data Science | ICDATA'21 | From Fig. 8, we can see that our approach has the highest model accuracy at all budget levels, while the cost-based approach has higher accuracy than the random selection approach at most of the budget levels. These results are consistent with those from the previous experiments on DS1. However, we notice that when the two features Exang and Restecg are removed from BCM Ф6 and Ф7, respectively, the predictive accuracy is not significantly changed. This is different from the situation shown in Fig. 6, where accuracy drops sharply when the budget level becomes low. Since our approach always removes the least important feature first, the features Exang and Restecg are supposed to be important ones; thus, removing them shall result in significant decrease of the predictive accuracy. The reason why this does not happen could be explained by the correlations the input features may have with each other. In this particular case, the importance of the features Exang and Restecg may have relied on features that have been removed, e.g., features Ca and Fbs in BCM Ф5. Similar to the experiments on DS1, we develop models using the three approaches by removing only one feature at a time. Fig. 9 shows the comparison results among the three approaches. As shown in the figure, for any number of features removed, our approach again consistently achieves the highest model accuracy than the other two approaches. Fig. 9. Accuracy changes with the number of features removed (DS2) VI. CONCLUSIONS AND FUTURE WORK Big data analytics is increasingly becoming one of the trending industry practices, but it has also brought major challenges for data processing, data maintenance and accurate prediction. One such major challenge is associated with the high cost of model features in many applications. In this paper, we introduced a DNN-based approach to developing deep learning models subject to budget constraints. Our approach can gradually reduce the model cost by removing the least important feature at each step. We present an algorithm to find weak links and weak neurons in a backward manner and identify the least important feature in a model. To support user selection of a suitable BCM under a given budget, or trade off between budget and predictive accuracy, we demonstrate how to generate a list of BCMs under predefined budget levels and a minimum required accuracy. Since our approach is based on deep neural network, it is scalable and provides a promising method for big data analysis. In our current work, we performed experiments using the FF-DNN on standard datasets. In future work, we will adopt more advanced DNNs such as RNN, further verify the performance of our approach using much larger datasets, and evaluate the computational cost of our approach. We will also look into the dependency among input features, and seek a more efficient method by removing a group of highly correlated but less important features. Instead of deriving a list of BCMs, we will explore to build dynamic models with mutable feature costs. This would require developing real-time classifiers as shown in previous work [15]. Finally, we plan to build partially connected FF-DNNs under given budget levels. This could be a challenging task because partially connected FF-DNNs are currently not supported in major deep learning tools such as TensorFlow. However, as in earlier work [5], using partially connected DNNs in our deep learning approach can simplify the computation process and lead to more efficient BCMs. REFERENCES [1] A. Shrestha and A. Mahmood, "Review of Deep Learning Algorithms and Architectures," IEEE Access, Vol. 7, 2019, pp. 53040-53065. [2] D. Yan, Z. Qin, S. Gu, H. Xu, and M. Shao, "Cost-Sensitive Selection of Variables by Ensemble of Model Sequences," To appear in Knowledge and Information Systems (KAIS), An International Journal, 2021. [3] N Jones, "Computer Science: the Learning Machines," Nature, Vol. 505, No. 7482, 2014, pp. 146-148. [4] A. Esteva, A. Robicquet, B Ramsundar et al., "A Guide to Deep Learning in Healthcare," Nature Medicine, Vol. 25, 2019, pp. 24-29. [5] H. Xu and A. Gade, "Smart Real Estate Assessments Using Structured Deep Neural Networks," In Proceedings of the 2017 IEEE International Conference on Smart City Innovations (IEEE SCI 2017), San Francisco, CA, USA, August 4-8, 2017, pp. 1126-1132. [6] C. Elkan, "The Foundations of Cost-Sensitive Learning," In Procedings of the 17th International Joint Conference on Articial Intelligence (IJCAI'01), Seattle, Washington, August 4-10, 2001, pp. 973-978. [7] V. S. Sheng and C. X. Ling, "Thresholding for Making Classifiers Cost- Sensitive," In Proceedings of the 21st National Conference on Artificial Intelligence (AAAI'06), Vol. 1, July 2006, pp. 476-481. [8] D. B. O'Brien, M. R. Gupta, and R. M. Gray, "Cost-Sensitive Multi-Class Classication from Probability Estimates," In Proceedings of the 25th International Conference on Machine Learning (ICML'08), Helsinki, Finland, July 2008, pp. 712-719. [9] Q. Zhou, H. Zhou, and T. Li. "Cost-Sensitive Feature Selection Using Random Forest: Selecting Low-Cost Subsets of Informative Features," Knowledge-Based Systems, Vol. 95, 2016, pp. 1-11. [10] S. Ji and L. Carin, "Cost-Sensitive Feature Acquisition and Classification," Pattern Recognition, Vol. 40, No. 5, 2007, pp. 1474-1485. [11] S. Maliah and G. Shani, "Using POMDPs for Learning Cost Sensitive Decision Trees," Artificial intelligence, Vol. 292, March 2021, 103400. [12] F. D. Frumosu, A. R. Khan, H. Schiøler, M. Kulahci, M. Zaki and P. Westermann-Rasmussen, "Cost-Sensitive Learning Classification Strategy for Predicting Product Failures," Expert Systems with Applications, 2020, Vol. 161, 113653. [13] D. Dua and C. Graff, UCI Machine Learning Repository, Retrived from http://archive.ics.uci.edu/ml, Irvine, CA, University of California, School of Information and Computer Science, 2019. [14] M. Abadi, A. Agarwal, P. Barham, et al., "TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems," TensorFlow White Papers, 2015. Software available from tensorflow.org. [15] B. J. Ford, H. Xu, and I. Valova, "A Real-Time Self-Adaptive Classifier for Identifying Suspicious Bidders in Online Auctions," The Computer Journal (COMPJ), Vol. 56, No. 5, 2013, pp. 646-663.
http://arxiv.org/abs/2302.11704v2
2023-09-10T00:22:22
2023-02-22T23:48:19
Mitigating Adversarial Attacks in Deepfake Detection: An Exploration of Perturbation and AI Techniques
Deep learning constitutes a pivotal component within the realm of machine learning, offering remarkable capabilities in tasks ranging from image recognition to natural language processing. However, this very strength also renders deep learning models susceptible to adversarial examples, a phenomenon pervasive across a diverse array of applications. These adversarial examples are characterized by subtle perturbations artfully injected into clean images or videos, thereby causing deep learning algorithms to misclassify or produce erroneous outputs. This susceptibility extends beyond the confines of digital domains, as adversarial examples can also be strategically designed to target human cognition, leading to the creation of deceptive media, such as deepfakes. Deepfakes, in particular, have emerged as a potent tool to manipulate public opinion and tarnish the reputations of public figures, underscoring the urgent need to address the security and ethical implications associated with adversarial examples. This article delves into the multifaceted world of adversarial examples, elucidating the underlying principles behind their capacity to deceive deep learning algorithms. We explore the various manifestations of this phenomenon, from their insidious role in compromising model reliability to their impact in shaping the contemporary landscape of disinformation and misinformation. To illustrate progress in combating adversarial examples, we showcase the development of a tailored Convolutional Neural Network (CNN) designed explicitly to detect deepfakes, a pivotal step towards enhancing model robustness in the face of adversarial threats. Impressively, this custom CNN has achieved a precision rate of 76.2% on the DFDC dataset.
[ "Saminder Dhesi", "Laura Fontes", "Pedro Machado", "Isibor Kennedy Ihianle", "Farhad Fassihi Tash", "David Ada Adama" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11704v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11704v2", "@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" ]
3 2 0 2 p e S 0 1 ] G L . s c [ 2 v 4 0 7 1 1 . 2 0 3 2 : v i X r a Mitigating Adversarial Attacks in Deepfake Detection: An Exploration of Perturbation and AI Techniques Saminder Dhesi, Laura Fontes , Pedro Machado , Isibor Kennedy Ihianle , David Ada Adama Department of Computer Science, Nottingham Trent University Nottingham, UK {N0774151,N1119003}@my.ntu.ac.uk {pedro.machado,isibor.ihianle,david.adama}@ntu.ac.uk Abstract-Deep learning constitutes a pivotal component within the realm of machine learning, offering remarkable capabilities in tasks ranging from image recognition to natural language processing. However, this very strength also renders deep learning models susceptible to adversarial examples, a phe- nomenon pervasive across a diverse array of applications. These adversarial examples are characterized by subtle perturbations artfully injected into clean images or videos, thereby causing deep learning algorithms to misclassify or produce erroneous outputs. This susceptibility extends beyond the confines of dig- ital domains, as adversarial examples can also be strategically designed to target human cognition, leading to the creation of in particular, deceptive media, such as deepfakes. Deepfakes, have emerged as a potent tool to manipulate public opinion and tarnish the reputations of public figures, underscoring the urgent need to address the security and ethical implications associated with adversarial examples. This article delves into the multifaceted world of adversarial examples, elucidating the underlying principles behind their capacity to deceive deep learning algorithms. We explore the various manifestations of this phenomenon, from their insidious role in compromising model reliability to their impact in shaping the contemporary landscape of disinformation and misinformation. To illustrate progress in combating adversarial examples, we showcase the development of a tailored Convolutional Neural Network (CNN) designed explicitly to detect deepfakes, a pivotal step towards enhancing model robustness in the face of adversarial threats. Impressively, this custom CNN has achieved a precision rate of 76.2% on the DFDC dataset. Index Terms-Deepfakes, Adversarial Attacks, CNN, GAN I. INTRODUCTION Nowadays, the falsification of images and videos on digital platforms is not a new problem, but the prior techniques for detecting these were mainly focused on face-swapping visualisation and its impact on the reputation of celebrities. Deepfakes, a type of synthetic media generated through Deep Learning (DL) and Machine Learning (ML) methods, were first these falsified media, classification techniques are required that focus on facial recognition through different features such as the eyes, lips, or cheeks. The most commonly used approach is binary image classification with supervised learning, which distinguishes introduced in 1997. To detect between real and fake. However, recent advancements have led to the development of more effective deepfake detection systems using Generative Adversarial Networks (GANs) or Autoencoders. But these require large datasets, and the limited availability of image and video data can be a challenge to the training models which results in poor performance, reduced predictiveness and responsiveness. To overcome the challenges posed by deepfakes, a pairwise learning approach can be employed to evaluate the similarity scores between inputs. Deepfakes involve the forging of faces, and the detection and recognition of real and fake faces is a major challenge due to factors such as lighting and facial expressions. Deep learning methods are prioritised for extracting discriminative features to improve robustness. Adversarial examples in deepfake detection present a chal- lenge to model accuracy, as these perturbed inputs can exploit vulnerabilities and manipulate the model output. To counteract these attacks, techniques such as cropping and compression can be used, as well as evaluation of the robustness of sub- sampled networks. The deepfake detection model architecture can be designed to withstand either white-box or black-box attacks, using face recognition and Convolutional Neural Net- work (CNN) for image classification and considering different perturbations in detection methods. Differential privacy is used to defend against adversarial attacks on ML models by balancing accuracy and information impact within the dataset. To address potential malicious use of ML systems, four main categories of mitigating strategies have been proposed: rate limiting, regression testing, anomaly de- tection, and human intervention. The countermeasures involve reducing the impact of perturbations through data encryption, data sanitation, and robust statistics, in order to minimise errors during training and testing. In this article, we examine the significance of deepfake detection by examining the presence of real images and the robustness of the data. The article will delve into the optimisation of Deep Learning models, such as CNNs and GANs, for deepfake detection. The models will operate on a frame-by-frame basis to analyse the temporal dependencies in videos, with Neural Networks being utilised to accurately classify fake videos. The main focus of this study is to address the challenges posed by deepfake generation and the use of publicly available, standardized datasets, such as the 140k real vs. fake and deepfake detection challenge available on Kaggle1. The structure of the article is as follows: related work is analysed in Section II, the methodology is presented in Section III, the results analysis in Section IV and the conclusions and future work in Section V. II. RELATED WORK Adversarial attacks are a growing concern in the field of arti- ficial intelligence and machine learning. These attacks involve manipulating input data in a way that causes a model to make incorrect predictions, often with the intent of compromising security or privacy. Some of the key challenges posed by adversarial attacks include the need to carefully design models that are robust against such manipulation, to develop methods for detecting and defending against attacks in real-world scenarios, and to improve understanding of the underlying reasons for why models can be vulnerable to these types of attacks [1]. In response to these challenges, researchers and practitioners are exploring a variety of countermeasures to improve the robustness of machine learning models. These countermeasures range from modifying model architecture and training procedures, to developing new techniques for detect- ing and defending against adversarial attacks, to using domain knowledge or other forms of auxiliary information to improve the robustness of predictions. Additionally, researchers are also exploring the use of formal methods and reasoning techniques to prove that models are robust against a wide range of potential attacks, and to identify potential weaknesses and vulnerabilities in advance. By addressing these challenges and developing effective countermeasures, researchers and practitioners aim to ensure that AI and machine learning systems can be deployed securely and with confidence, and that the benefits of these technologies can be fully realised [1]. The first reported introduction of adversarial attacks in neural networks was by Szegedy et al. [2]. However, the lack of understanding of these attacks and the newness of the subject area makes it difficult to criticise the potential limitations of the methods suggested for defence. A taxonomy of adversarial attacks has been developed through specific criteria and threat models, as proposed by McDaniel et al. [3]. The defence against adversarial attacks can be classified into supervised and unsupervised techniques. Supervised strategies aim to improve the generalisation of the learning models and to tailor specific perturbation patterns. Unsupervised strategies aim to smooth the decision boundaries through regularisation of loss functions and the removal of nuisance variables. The robustness of the decision boundary is crucial in the defence against adversarial attacks and requires more attention. The historical timeline of adversarial machine learning and the 1Available online, https://www.kaggle.com/, last accessed 09/02/2023 current limitations in secure machine learning algorithms for detecting malware have been discussed by Biggio and Roli [4]. The use of adversarial training was first introduced in Deep Neural Networkss (DNNs) to make the functions resistant to adversarial perturbations and maintain the accuracy of clean inputs. According to Goodfellow et al. [5], this was achieved by relying on the linearisation of lost data points. However, robust models against adversaries can still be vulnerable to more iterative attacks. The ImageNet recently observed the capacity for adversarial training using step methods. Training against multi-step methods is expected to have better resistance against adversaries, as indicated by Madry et al. [6]. Although the adversarial inputs may look similar to the original in- puts, the linearity of DNNs makes it possible for malicious perturbations to impact decision-making. It is vital to note that perturbations can only address certain types of attacks, as pointed out by Carrara et al. [7]. Adversarial attacks refer to inputs that aim to exploit flaws in a detection system and manipulate the behaviour of trained models. Adversarial mitigation aims to counter these attacks by making the models more robust to malicious inputs, both during the training and decision-making phases. Attackers can use two different techniques: data poisoning, which involves altering a few training inputs to mislead the model's output, and model poisoning, in which the attacker tries to direct the model to produce a false label for perturbed instances [8]. The issue of poison target attacks, used against DNNs, is widespread and exploits the influences of the functions. Koh and Liang [9] developed training with small perturbations to specific training points, making predictions for the target set test points. DNNs are altered by adding perturbations to input vectors, limited to modifying only one pixel in an image. For image recognition, the accuracy is maximised. The DNN adds noise and changes one pixel to alter the Confidence Value (CV), which is represented by the probability distribution used by the Differential Evolution (DE) algorithm to filter pixels and determine the correct image class. The fast-gradient sign algorithm is primarily used to calculate the effectiveness of perturbations for the hypothesis [10]. The linearity and high dimensionality of inputs lead to sensitivity to perturbations. This requires consideration for image classification, as it only works for small size (e.g. 32 × 32) images by modifying a specific colour to lower the network's confidence in iterations and resulting in new categories with the highest classification confidence being successfully chosen [10]. Adversarial attacks pose a threat to the accuracy and re- liability of machine learning models. These attacks use bi- level optimisation control, making them difficult to detect. Mitigation strategies to defend against these attacks include shielding adversarial inputs through normalising raw inputs, rate limiting, regression testing, anomaly detection, and human intervention. Rate limiting involves limiting the number of users who can contribute to the model and using mechanisms to prevent false positives and negatives [11]. Regression testing involves comparing a newly trained model to baseline stan- dards and estimating changes in outputs of previous models. Anomaly detection locates suspicious patterns through meta- data, IP-based analysis, heuristic analysis, analysis of temporal dynamics, and graph-based Sybil attack detection methods [11]. Machine learning models can be attacked in various forms such as spam emails, phishing attacks, and malware. The main types of adversarial attacks are white box and black box attacks [8]. In a white box attack, the attacker has complete access to the target model's network and can exploit its vulnerabilities. In a black box attack, the attacker does not have complete access but can still affect the model's performance.Another type of adversarial attack is the grey box attack which combines elements of both white box and black box attacks [8], [12]. Adversarial perturbation takes advantage of the geometric correlation between decision boundaries in classifiers. To counter adversarial attacks, methods have been proposed such as modifying the training process, changing the network function, and using external models for classification. A taxonomy has been created to categorise these defence methods based on whether they modify the original network or add to its architecture. The effectiveness of these defences against different attack methods is yet to be fully determined, and certification is required to ensure their reliability [13]. GANs are a type of generative model that can produce new content based on a dataset. The unsupervised learning method can analyse, capture, and copy variations in the data [14]. The model can add noise to improve its confidence in predictions, but this can also result in misclassifications. The generator and discriminator in a GAN can be used to generate fake samples of data and detect deepfakes. Face swapping was initially used for entertainment purposes on social media, but advancements in deep learning have made it more realistic and difficult for forensics models to detect the fakes [15]. Deepfakes use superimposition of faces to create synthetic media and have gained popularity due to the improved realism produced by the application of auto-encoders and GANs in facial recognition and media tracking. Deepfakes were first introduced in 2017 for creating synthetic media using face swaps from adult entertainment but have since had negative consequences for political campaigns due to falsification [16], [17]. While deepfakes have positive applications, such as being used in movies to reshoot scenes, the negative consequences and potential harm outweigh the positive implications [18]. Traditional methods for detecting deepfakes in images were introduced using CNN models and face-cropping techniques. Dolhansky et al. [19] used the CNN model with six convo- lution layers and TamperNet to detect low image manipula- tion [20]. Later, XceptionNet was introduced and trained on full-sized images using separable convolution layers, which improved the precision of TamperNet from 79.0% to 83.3% and the recall from 3.3% to 26.4% [21]. Deepfakes detection currently involves face-tracking and a CNN classifier to deter- mine if an image is real or fake. However, the current methods are vulnerable to adversarial attacks, which can mislead the classification, and a robust deepfake detector is still needed. The state-of-the-art method, iCaps-Dfake, uses different nature feature extraction to reduce the need for pre-processing, but it fails to consider the potential for human-created fake images [22]. The high potential risk of misinformation and disinfor- mation posed by deepfakes is a growing threat to cybersecu- rity, especially in areas such as non-consensual pornography, political disinformation, and financial fraud. However, full implementation of deepfake detection methods would require large sample datasets, which can be difficult to access. III. METHODOLOGY for The application was implemented in Python 3+, us- face recogni- ing Open Computer Vision (OpenCV) tion, NumPy/SciPy for computational linear algebra, and PyTorch/TensorFlow for ML and DL techniques. Jupyter Notebook was used as a web-based interactive computational environment for larger datasets for data analysis, data visuali- sations, and exploratory computing. OpenCV was incorporated for pre-processing the dataset to handle this data type. The project mainly used TensorFlow for high-level model devel- opment with more mature libraries and built-in artificial intel- ligence. The framework is prevalent under Central Processing Unit (CPU), but for faster training potential, Graphic Process- ing Unit (GPU) such as Compute Unified Device Architecture (CUDA) can be used. Nevertheless, the machine used for the project was an Intel(R) CoreTM i7 CPU @ 1.80GHz with 64GB of Random Access Memory (RAM) and was not equipped with an NVIDIA GPU. The project primarily used two datasets: the Deepfake Detection Challenge (DFDC)2 and COVID3. These datasets were chosen due to their ability to be used on wide range of models and techniques. The criteria for selecting these datasets included two classes, a large number of images or videos, and little to no noise in the real class. Noise in the dataset would include low resolution, poor quality images with low pixel count and irrelevant images. A large number of visual representations in each class is crucial to detecting deepfakes by adopting training within Python. The CNN requires a large number of images to differentiate between the classes. To create the fake visuals, the project uses competing neural networks between the generator network and the discriminator network. The noise in the dataset needs to be minimal for the optimum processing of data, as generating poor results would not apply to the class. Furthermore, the Real vs. Fake dataset is a large collection of non-celebrity face images, with 140,000 faces equally split between real and fake, collected by NVIDIA. These images were generated using StyleGAN and have been standardised by resizing to 256 pixels in JPG format. The dataset is split into train, test, and validation sets, with a 60:20:20 ratio, and each set has a corresponding CSV file. The dataset contains a variety of genders, ages, races, and facial features. Although unsupervised clustering was suggested for the dataset by the 2Available online, https://www.kaggle.com/c/deepfake-detection-challenge, last accessed: 15/02/2023 3Available online, https://www.kaggle.com/datasets/pranavraikokte/ COVID19-image-dataset, last accessed: 19/02/2023 DFDC Kaggle forum, it was considered out of the scope of this project. The test folder contains unclassified images that participants can use to test the accuracy of the models they create. The DFDC dataset [23] was released by Facebook and consists of 50 files of training data, with a total size of 470 GB, and a metadata JSON file with labels. The dataset is split into train and test sets in an 80:20 ratio. The test set contains a smaller sample of MP4s, which is used for validation. The videos were recorded under various conditions, with different lighting and backgrounds and a variety of people. We also tested the models against the COVID dataset which is composed of 137 cleaned images of COVID-19 based images and more 317 in total containing Viral Pneumonia and Normal Chest X-Rays structured into the test and train directories. The following step was to train and test the deepfake detection framework using CNN (see Figure 1) and GAN. Before training the model, the Real vs. Fake dataset was pre- processed, and the images resized to 256 × 256 JPG format. The dataset was split into 60% for training, 20% for validation, and 20% for testing, which allows the model to learn patterns to classify faces in the training set and validate the learning on the validation set before testing on the test set. This approach is important for preventing overfitting, which occurs when the model performs well on the training data but is unable to generalise to new data. While other datasets only have a train and test set, the Real vs. Fake dataset has a validation set to help the model generalise better. To ensure the model is effective, it was important to use a large sample size in each class while avoiding excessive data that could be time- consuming to process under CPU. The model's ability to distinguish between the labelled sets will be tested using the test set. It was crucial to accurately classify the detection to avoid potential errors caused by overfitting or underfitting. To customise the CNN and GAN models, the pre-trained models were split into specific algorithms with distinct uses. CNN, for example, was used for two-dimensional image classification and can learn position and scale variants in the data structure using spatial relationships. ResNet50 was used to boost neural network performance by adding more layers to the network and finding the predicted and residual of each result. GAN was used to distribute any data for generating instances, which is specifically useful for deepfake detection. To evaluate the performance of the models, appropriate pa- rameters such as epochs, batch size, and activation filters were standardised to enable comparisons and detect issues. During the testing phase, it is possible that the custom model may produce higher error rates due to false negatives that occur in the computational environment compared to real- world scenarios. This is a consequence of not having optimal labels with or without parallax errors that affect the position of the image or video. To ensure accurate results, it was important to clean the dataset of all noise and reduce the margin for error. The DFDC video dataset presents a different challenge as it is in MP4 format and requires analysis frame-by-frame for detection. The CNN classifies each frame as real or fake, and the goal is to minimise the adversary perturbation from Fig. 1. Customised 7-layer CNN architecture. The network is composed of 3 convolutional layers, 3 fully connected layer and the classification layer. the delta that was used to create the adversarial input, which is discussed further below. To classify an image in PyTorch, the first step is to normalise it by subtracting the mean and dividing the result by the standard deviation. This transfor- mation is applied using PyTorch layers, and the resulting image is resized to 224 × 224 pixels, which is the standard input size. A pre-trained ResNet50 model can then be used to classify the image, producing a probability vector by applying a SoftMax operator. The classifier can be fine-tuned to adjust the probabilities based on the specific task at hand. This is done using the hypothesis function: hθ : χ → Rk (1) where hθ is the mapping between input space and output space, which is a k-dimensional vector. Here, k is the number of classes predicted; θ represents all parameters within the model (such as convolution filters or fully convolved layers), which are typically optimised while training the neural net- work. The precision of the model object is linked to hθ. The loss function is given by: l : Rk.Z+ → R+ (2) Here, l maps the model's prediction and labels of non- negative numbers. The model output for the logics can be positive and negative for the second argument in the index for distinguishing the true class. For x ∈ X the input and y ∈ Z the true class, the loss function computes the difference between the model's prediction and the true label. The most prevalent form of loss in deep learning is the cross-entropy loss (SoftMax), defined as: l(hθ(x), y) = log   k (cid:88) j=1  exp(hθ(xj))  − hθ(x)y (3) Here, hθ(xj) denotes the jth term for the vector hθ(x). The adversarial example is used to manipulate the loaded image, which enables the classifier to lower the probability of recognising the deepfake image. The approach is used to train for optimisation on the parameters to minimise the average loss in the training set: min = 1 m i=1 (cid:88) m l(hθ(xi), yi) (4) Here, the parameter θ is optimised to minimise the average loss over part of the training set. Another form involves adjusting the image to optimise the network parameters that will adjust the image for maximising the loss. This is done to solve the optimisation problem with the equation below: max = l(hθ(ˆx), y) (5) Here, ˆx denotes the adversarial example for maximising the loss. The gradient step is used for adjusting the optimiser to perturbations for maximising the loss for the training set. This allows computing the probability and then adding the delta as random noise for the adversarial attack, which creates an image that looks identical, but the probability of classifying it is significantly reduced. Finally, targeted attacks can also be used to maximise the loss of a specific target class in the probability vector, by minimising the loss of that target class through linear optimisation. Adversarial robustness is a significant challenge when it comes to attacking deep learning classifiers, as these attacks aim to modify existing images in the training set. It is important to consider the potential adversarial risks that may arise, such as retaining specific regions of perturbations to encode the images. IV. RESULTS ANALYSIS Organising the dataset into the correct format is critical for the success of the project. One of the main challenges we encountered was resizing the images or video frames to dimensions suitable for specific models. Another issue was the limited availability of real images of target faces, which made it difficult to create a balanced dataset for binary classification. In comparison, there were more deepfake faces available in the real-life dataset. We started with binary classification, a supervised machine learning technique that involves making observations and classifications. We used a simple CNN to train the custom model on a variety of different faces in the Real vs. Fake dataset, and then moved on to the DFDC dataset. Since we were learning a new language, training the model on a CPU was time-consuming. To generate predictions, we trained a single model with balanced classes, and the dataset was categorised into distinct classes for labelling and targeting purposes. We also found that we needed to convert the DFDC dataset into images to apply any algorithm once frame-by- frame detection had occurred. In deep learning, the mapping process is used to detect deep- fakes by categorising them as either real or fake. CNNs are particularly effective in image recognition and are commonly used to train the dataset. The process involves training the weights with input images and validating the performance of the network. The input images are processed through a series of layers, including convolution layers, pooling layers, and fully connected layers, which are then activated by a sigmoid function. This efficient image recognition and classification is what makes CNNs an ideal technique for detecting deepfakes. This process can be visualised through the mathematical equation: n(out) = (cid:20) n(in) + 2p − k s (cid:21) + 1 (6) where n(in) is the number of input features, n(out) is the number of output features, k is the convolution kernel size, p is the convolution padding size, and s is the convolution stride size. The model summary provides insight into the architecture of the model, which includes 6 layers consisting of 4 convolution layers and 2 fully connected layers. To identify the 80,000 images belonging to 2 classes - real (1) or fake (0) - binary encoding is applied. The generator is then initialised to flow the data to the fit generator for training the model and validating its accuracy. As shown in Figure 2, the blue line represents the validation loss, while the orange line represents the validation accuracy. The trained CNN model demonstrated a precision value of 0.748, which indicates that around three quarters of the images were classified correctly. It's expected that larger models, such as ResNet50, may produce better precision, as their features are more selective. The number of epochs refers to the full pass of the training set through an algorithm, and hyperparameters can be specified to determine the number of epochs. The model's internal parameters are updated with each epoch, which results in the gradient learning algorithm. The epoch number and factor rate will become zero over time as the algorithm learns. Achievable reasonable test correctness is required to apply this complexity to real-world applications. To achieve a less biased estimate and enhance the model, k-fold cross-validation can be used. When evaluating classification performance, accuracy is a common metric used to measure how well the model has correctly classified the samples. It can be calculated using the equation: Acc = T P + T N T P + F P + T N + F N (7) Fig. 2. The epochs and Accuracy on Real vs. Fake dataset with CNN model where T P is the number of true positives, T N is the number of true negatives, F P is the number of false positives, and F N is the number of false negatives. The accuracy score gives the proportion of correctly classified samples out of the total number of samples. Accuracy is a common metric used to assess the perfor- mance of a classification model. It is calculated as the ratio of correctly classified samples to the total number of samples. However, accuracy alone does not take into account the loss function used by the model. To address this issue, the cross- entropy function is often used instead of accuracy. A high accuracy value is desirable, but the focus should also be on maximising the cross-entropy function to achieve the best results. Figure 2 shows the results of using the cross-entropy function to measure the performance of a model. The R2 value of 0.9987 indicates high accuracy of the predictions, but increasing the number of epochs may further improve the results. When training the model, it was found that the precision increased as the number of epochs increased. This suggests that the model is learning the specific patterns that are important for detecting deepfakes. In comparison to a custom model, the pretrained convolutional base used in this study achieved higher accuracy with consistent performance across different epochs. The pretrained model is tuned for quicker training time and is able to classify real and deepfake images with high accuracy. The study's accuracy of 87.3% for detecting deepfakes is higher than that reported in the literature for the DFDC dataset (79%), which could be attributed to the larger Real vs. Fake dataset used in this study. Overall, the results suggest that using a pretrained model can lead to better performance for deepfake detection. The classification model's matrix parameters are set to pre- dict the majority class frequency for null error rate conditions. This means that the model's error rate is preferred to be higher than the null Real error rate. The receiver operating characteristics (ROC) curve is used to evaluate the classifier's performance, and a desirable threshold is chosen, as seen in Figure 2. The linear regression model with the same model and parameters can also be used for classification, but if the classification exceeds 1, logistic regression is necessary to Fig. 3. Logarithmic loss using logistic regression for DFDC dataset for inception at 0.6 predict real and fake labels. The error function of the linear regression model includes weighting parameters that are used in the gradient descent optimisation algorithm to minimise the misclassification error. Figure 3 shows the logarithmic loss metric, which evaluates the probability of correctly classifying the data. This metric can be used to compare models based on the following equation, primarily for binary classification: − 1 N N (cid:88) i=1 yi.log(p(yi) + (1 + yi).log(1 − p(yi)) (8) the first In this equation, term is zero for the binary cross-entropy model when the actual class is 1 (real) and the other actual class is 0 (fake). Additionally, the binary cross-entropy model is less exponential than typical regression curves and tends to be more symmetric. This could be due to the possibility of overfitting when there is no validation set, as shown in Figure 3. Equation 8 shows the binary cross-entropy model used primarily for binary classification. When the actual class is 1 (real), and the other actual class is 0 (fake), the first term of the equation becomes 0. Unlike typical regression curves, this model is seen to be less exponential and tends to hold more symmetry. However, this could be due to the potential of overfitting, as shown in Figure 3, which may result from the absence of a validation set. Most models would have concluded that the entire video is real, regardless of whether a single frame is fake. However, state-of-the-art detection confirms that each frame needs to be investigated. The frame-by-frame detection can later be used in a white-box setting to propagate the loss in the entire model when adding perturbations, obtaining a gradient for adversarial frames. This is because current deepfake detection DNNs are assumed to be non-adaptive in attacks that aim to withstand human eyes, generating realistic fake videos. The customised GAN used to implement the losses of both the discriminator and generator models, and their training process does not exhibit a clear pattern. Recent advancements in deep learning have leveraged data augmentation techniques, such as cropping, flipping, and zooming, to improve model performance in a given domain, typically applied to image Fig. 4. GAN graph for D and G losses in Real vs. Fake dataset strength of real estimates for the epoch trained. The Y axis is the real indices that has been standardised and the x-axis represents the epoch data. In GANs, the generator and discriminator compete against each other, with each trying to achieve a higher loss than the other, creating an environment for learning from the training data based on the received loss. In Figure 4, the convergence of the Real vs. Fake plot indicates that the model has reached a maximum level of performance, and any additional enhancements are unlikely. It is worth noting that the D loss is less interactive than the G loss, which is not counterbalanced as in a traditional model. This implies that the generator will be improved in the next iteration, and synthetic observations of good quality can be generated. A generator with 100% accuracy would generate synthetic samples that the discriminator could classify as real, whereas a discriminator with 50% accuracy would be unable to distinguish fake observations from real ones. To illustrate how these models can be applied to real-world scenarios, let's consider the example of a COVID dataset. As shown in Figure 5, this dataset was used to train a binary classification model with a limited amount of data. Since there were only 100 images in each class, the model had to be carefully adapted to these weights in order to learn to accurately classify COVID positive and negative cases. It's worth noting that in real-life scenarios, obtaining a large, di- verse dataset can be challenging, and may require a significant amount of effort to collect and label the data. Nonetheless, even with limited data, it's possible to train a model that can provide valuable insights and predictions. As the field of deep learning continues to evolve, new techniques and approaches are being developed to address these challenges and improve the performance of models with limited data. White box perturbations refer to a type of attack where an adversary has access to a machine learning model's ar- chitecture and parameters. By exploiting this information, the adversary can create an output gradient that generates an adversarial example using the model's gradient and loss. This is done by adding perturbations to the input, which can cause the model to incorrectly classify the input, moving it closer to the decision boundary between the true class (real) and the Fig. 5. The epochs and validation for COVID dataset against validation loss (blue) and validation accuracy (orange) with CNN model. TABLE I PROBABILITY OF TRUE CLASS IN REAL VS. FAKE DATASET BEFORE ADDING DELTA FOR PERTURBATION. Delta 0 5 10 15 20 25 True Class probability 10.90469 35.33980 40.24509 37.24498 37.62185 40.85791 other class (fake). The goal of white box perturbations is to decrease the predictability of the input and generate an attack that is imperceptible to the human eye. In the image domain, the Lp norms are used to measure the amount of perturbation by quantifying the maximum distortion added to individual pixels in the image. The primary objective of adversarial perturbations is to generate an attack that is imperceptible to the human eye. For example, if a model's initial prediction for the true class probability of a given image is 10.9, indicating that it is a real image, an adversarial attack can reduce the true class probability to 2.26e−18 by subjecting the image to a delta (perturbation), leading to misclassification. Table I shows the Probability of true class in Real vs. Fake dataset as the iterations of each degradation that the attack applies to the image, ultimately resulting in misclassification. In summary, white box perturbations allow adversaries to create adversarial examples by exploiting a model's parameters and architecture. These attacks are difficult to detect because they generate imperceptible changes to the input, making them a serious threat to the security of machine learning models. It is important to note that the adversarial attack significantly degrades the accuracy of the model, reducing the probability of correctly detecting an actual attack. While the cost of an error on the adversarial input may not be high in real-life applica- tions, a decrease in accuracy can have severe consequences. In particular, classification errors can lead to the abstention of detecting inputs, and the significant amount of noise applied in these datasets can result in further classification refusals. It's crucial to consider the domain of the system being used, as the difference in error rates between random inputs and adversarial inputs can vary depending on the application. To ensure the validity of the testing results, it was crucial to avoid using the adversarial attacks on the training set, which is a common pitfall in evaluating the robustness of models. This was especially important when applying the attacks to a defence mechanism, as the overfitting can be against a particular attack that was included in the training set. Some attacks may be effective on both training and testing sets, which could potentially overestimate the model's robustness. Therefore, the strongest attack against a custom model requires a specifically tuned approach tailored to the model's architecture. To evaluate the potential of invalidating the model's robustness, it was necessary to consider errors that may deviate from classifying the correct class. To ensure the testing is effective, it was essential to define a precise threat model that assumes the attacker's knowledge, goals, and capabilities. Finally, to perform an adaptive upper bound of robustness, the loss function should be changed to cause misclassification, while the defence mechanism is evaluated. V. CONCLUSIONS AND FUTURE WORK threat This article proposes a state-of-the-art DeepFake detector network that utilises machine learning techniques to mitigate adversarial attacks on autonomous systems that are vulner- able to deepfakes. To evaluate the efficacy of the proposed approach, a transferable white-box attack via perturbations was developed to pose a practical to the deepfake detection system. The attack was applied to a variety of DFDC and COVID datasets, to demonstrate the effectiveness of the proposed algorithms on DL techniques such as CNN and GAN. The proposed approach showed promising results for detecting deepfakes, achieving a precision value of accuracy of 76.2% on the DFDC dataset. However, this result can be improved by increasing the volume of media in the datasets. The detection models were able to distinguish between real and fake media and can be applied in real-life scenarios such as the COVID dataset. To evaluate the system's robustness against adversarial attacks, white-box attacks via perturbation were applied to distort the images. The Real vs. Fake dataset's classification probability was reduced from 10.9 to 2.26e−18 with the addition of perturbation, and the COVID dataset's probability was reduced from 11.1 to 1.46e−16. The proposed method offers an effective approach to detecting deepfakes by incorporating adversarial examples through white-box attacks that use perturbations to decrease classification probability. The proposed work on mitigating adversarial attacks and detecting deepfakes has significant ethical impacts. Deepfakes, which are manipulated media that appear real, can be exploited to deceive, manipulate public opinion, spread misinformation, and facilitate cybercrime. The proposed DeepFake detector network aims to address these ethical concerns by safeguarding truth and trust in digital media, mitigating social and political manipulation, and protecting privacy and consent. This work has implications for individuals, organizations, and society as a whole.The proposed work on mitigating adversarial attacks and detecting deepfakes has significant ethical impacts. Deep- fakes, which are manipulated media that appear real, can be exploited to deceive, manipulate public opinion, spread misin- formation, and facilitate cybercrime. The proposed DeepFake detector network aims to address these ethical concerns by safeguarding truth and trust in digital media, mitigating social and political manipulation, and protecting privacy and consent. This work has implications for individuals, organizations, and society as a whole. From a business perspective, the impact of Artificial Intelligence (AI) in relation to deepfake detection and AI-based technologies is notable. By incorporating AI- powered deepfake detection systems, businesses can enhance trust and reliability in their digital media content. This helps demonstrate their commitment to authentic communication, transparent marketing practices, and reliable representation of products or services. Additionally, implementing robust deepfake detection mechanisms safeguards brand reputation threats by proactively identifying and addressing potential that manipulate brand images or spread false information. Furthermore, integrating deepfake detection systems into cy- bersecurity strategies strengthens defences against malicious activities such as impersonation, unauthorised access, and fraud, ensuring the integrity and authenticity of digital in- teractions. From a business perspective, the impact of AI in relation to deepfake detection and AI-based technologies is notable. By incorporating AI-powered deepfake detection systems, businesses can enhance trust and reliability in their digital media content. This helps demonstrate their com- mitment to authentic communication, transparent marketing practices, and reliable representation of products or services. Additionally, implementing robust deepfake detection mecha- nisms safeguards brand reputation by proactively identifying and addressing potential threats that manipulate brand images or spread false information. Furthermore, integrating deepfake detection systems into cybersecurity strategies strengthens defences against malicious activities such as impersonation, unauthorized access, and fraud, ensuring the integrity and authenticity of digital interactions. In terms of future work, this study can serve as a starting point for generating perturbations by minimising the likelihood of correct class classification. Another objective could be to work on detecting deepfakes in audio for video media. Additionally, further advancements in the field of deepfakes would require obtaining larger datasets and training models using OpenCV architecture in Python. To handle increased input size, it would be necessary to standardise parameters such as image or video size. This can help improve the model's performance. In addition, a promising direction of research would be to work on a physical "adversarial patch" which could enhance facial recognition by allowing the classifier to add any image or video to the chosen target class, mis- classifying the arbitrary modification of each pixel, ultimately defending against adversarial attacks. Lastly, the methodology developed in this study could be extended beyond the forensic domain of deepfake detection, to enable 3D object localisation for use in robotic applications such as self-driving vehicles. [23] B. Dolhansky, J. Bitton, B. Pflaum, J. Lu, R. Howes, M. Wang, and C. C. Ferrer, "The deepfake detection challenge (dfdc) dataset," 2020. [Online]. Available: https://arxiv.org/abs/2006.07397 REFERENCES [1] I. Ilahi, M. Usama, J. Qadir, M. U. Janjua, A. Al-Fuqaha, D. T. Hoang, and D. Niyato, "Challenges and countermeasures for adversarial attacks on deep reinforcement learning," IEEE Transactions on Artificial Intelligence, vol. 3, no. 2, pp. 90–109, 2021. [2] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus, "Intriguing properties of neural networks," arXiv preprint arXiv:1312.6199, 2013. [3] P. McDaniel, N. Papernot, and Z. B. Celik, "Machine learning in adversarial settings," IEEE Security & Privacy, vol. 14, no. 3, pp. 68–72, 2016. [4] A. Demontis, M. Melis, M. Pintor, J. Matthew, B. Biggio, O. Alina, N.-R. Cristina, F. Roli et al., "Why do adversarial attacks transfer? explaining transferability of evasion and poisoning attacks," in 28th USENIX security symposium. USENIX Association, 2019, pp. 321– 338. [5] I. J. Goodfellow, J. Shlens, and C. Szegedy, "Explaining and harnessing adversarial examples," arXiv preprint arXiv:1412.6572, 2014. [6] A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu, "Towards deep learning models resistant to adversarial attacks," arXiv preprint arXiv:1706.06083, 2017. [7] F. Carrara, F. Falchi, R. Caldelli, G. Amato, and R. Becarelli, "Adver- sarial image detection in deep neural networks," Multimedia Tools and Applications, vol. 78, pp. 2815–2835, 2019. [8] Deep Neural Network based Malicious Network Activity Detection Under Adversarial Machine Learning Attacks, ser. LNCS, vol. 5805. Springer, 2020. [9] P. W. Koh and P. Liang, "Understanding black-box predictions via influence functions," in International conference on machine learning. PMLR, 2017, pp. 1885–1894. [10] J. Su, D. V. Vargas, and K. Sakurai, "One pixel attack for fooling deep neural networks," IEEE Transactions on Evolutionary Computation, vol. 23, no. 5, pp. 828–841, 2019. [11] L. Mu ̃noz-Gonz ́alez, B. Pfitzner, M. Russo, J. Carnerero-Cano, and E. C. Lupu, "Poisoning attacks with generative adversarial nets," arXiv preprint arXiv:1906.07773, 2019. [12] Y. Wang, Y.-a. Tan, W. Zhang, Y. Zhao, and X. Kuang, "An adversarial attack on dnn-based black-box object detectors," Journal of Network and Computer Applications, vol. 161, p. 102634, 2020. [13] N. Akhtar and A. Mian, "Threat of adversarial attacks on deep learning in computer vision: A survey," Ieee Access, vol. 6, pp. 14 410–14 430, 2018. [14] H. Yang, D. Huang, Y. Wang, and A. K. Jain, "Learning face age progression: A pyramid architecture of gans," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2018, pp. 31–39. [15] I. Korshunova, W. Shi, J. Dambre, and L. Theis, "Fast face-swap using convolutional neural networks," in Proceedings of the IEEE international conference on computer vision, 2017, pp. 3677–3685. [16] V. Badrinarayanan, A. Kendall, and R. Cipolla, "Segnet: A deep con- volutional encoder-decoder architecture for image segmentation," IEEE transactions on pattern analysis and machine intelligence, vol. 39, no. 12, pp. 2481–2495, 2017. [17] E. Zamyatin and A. Filchenkov, "Learning to generate chairs with generative adversarial nets," Procedia Computer Science, vol. 136, pp. 200–209, 2018. [18] K. Demetrious, "Book review: Gareth thompson, post-truth public rela- tions: Communication in an era of digital disinformation jim macnamara, beyond post-communication: Challenging disinformation, deception and manipulation," 2021. [19] B. Dolhansky, R. Howes, B. Pflaum, N. Baram, and C. C. Ferrer, "The deepfake detection challenge (dfdc) preview dataset," arXiv preprint arXiv:1910.08854, 2019. [20] R. Skibba, "Accuracy eludes competitors in facebook deepfake detection challenge," 2020. [21] G. Wang, G. Yuan, T. Li, and M. Lv, "An multi-scale learning network with depthwise separable convolutions," IPSJ Transactions on Computer Vision and Applications, vol. 10, no. 1, pp. 1–8, 2018. [22] S. S. Khalil, S. M. Youssef, and S. N. Saleh, "icaps-dfake: An integrated capsule-based model for deepfake image and video detection," Future Internet, vol. 13, no. 4, p. 93, 2021.
http://arxiv.org/abs/2302.11703v1
2023-02-22T23:41:36
2023-02-22T23:41:36
fAIlureNotes: Supporting Designers in Understanding the Limits of AI Models for Computer Vision Tasks
To design with AI models, user experience (UX) designers must assess the fit between the model and user needs. Based on user research, they need to contextualize the model's behavior and potential failures within their product-specific data instances and user scenarios. However, our formative interviews with ten UX professionals revealed that such a proactive discovery of model limitations is challenging and time-intensive. Furthermore, designers often lack technical knowledge of AI and accessible exploration tools, which challenges their understanding of model capabilities and limitations. In this work, we introduced a failure-driven design approach to AI, a workflow that encourages designers to explore model behavior and failure patterns early in the design process. The implementation of fAIlureNotes, a designer-centered failure exploration and analysis tool, supports designers in evaluating models and identifying failures across diverse user groups and scenarios. Our evaluation with UX practitioners shows that fAIlureNotes outperforms today's interactive model cards in assessing context-specific model performance.
[ "Steven Moore", "Q. Vera Liao", "Hariharan Subramonyam" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11703v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11703v1", "@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", "cs.HC" ]
fAIlureNotes: Supporting Designers in Understanding the Limits of AI Models for Computer Vision Tasks Steven Moore [email protected] Technical University of Munich Munich, Germany Q. Vera Liao [email protected] Microsoft Research Montreal, Canada Hariharan Subramonyam [email protected] Stanford University Stanford, USA 3 2 0 2 b e F 2 2 ] G L . s c [ 1 v 3 0 7 1 1 . 2 0 3 2 : v i X r a Figure 1: Designerly understanding of AI model failures using fAIlureNotes: (a) The designer selects a user scenario based on their user research and (b) annotates the expected behavior of the AI model for an input image. Running the model for the image, (c) they compare differences in expected and actual behavior. fAIlureNotes summarizes the mismatches according to different AI failure modes. ABSTRACT To design with AI models, user experience (UX) designers must assess the fit between the model and user needs. Based on user research, they need to contextualize the model's behavior and po- tential failures within their product-specific data instances and user scenarios. However, our formative interviews with ten UX profes- sionals revealed that such a proactive discovery of model limitations is challenging and time-intensive. Furthermore, designers often lack technical knowledge of AI and accessible exploration tools, which challenges their understanding of model capabilities and limitations. In this work, we introduced a failure-driven design approach to AI, a workflow that encourages designers to explore model behavior and failure patterns early in the design process. The implementation of fAIlureNotes, a designer-centered failure exploration and analy- sis tool, supports designers in evaluating models and identifying failures across diverse user groups and scenarios. Our evaluation 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]. CHI '23, April 23–28, 2023, Hamburg, Germany © 2023 Copyright held by the owner/author(s). Publication rights licensed to ACM. ACM ISBN 978-1-4503-9421-5/23/04. . . $15.00 https://doi.org/10.1145/3544548.3581242 with UX practitioners shows that fAIlureNotes outperforms to- day's interactive model cards in assessing context-specific model performance. CCS CONCEPTS • Human-centered computing → Systems and tools for in- teraction design; Interface design prototyping; • Computing methodologies → Machine learning; • Software and its engi- neering → Designing software. KEYWORDS Human-Centered AI, Pre-trained Models, UX design ACM Reference Format: Steven Moore, Q. Vera Liao, and Hariharan Subramonyam. 2023. fAIl- ureNotes: Supporting Designers in Understanding the Limits of AI Models for Computer Vision Tasks. In Proceedings of the 2023 CHI Conference on Human Factors in Computing Systems (CHI '23), April 23–28, 2023, Ham- burg, Germany. ACM, New York, NY, USA, 19 pages. https://doi.org/10.1145/ 3544548.3581242 1 INTRODUCTION The probabilistic and evolving nature of AI has demanded changes in the user experience design process. When crafting the user expe- rience (UX) for an AI-powered application, product designers need to understand the capabilities and limitations of the AI model, an- ticipate model breakdowns, and provide users with a path forward from failure. In characterizing AI as a "design material", prior work Pre-trained AI ModelsUser ResearchAI Experience DesignDesignerly Understanding of Model Limitations with fAIlureNotesabcFailure notes with design considerations forhuman-centered AI design, failure recovery mechanisms, and model requirements for AI engineering team. User Personas and Scenarios Annotating the desired model behavior (user expectation)Exploring mismatch between expected and actual model behavior CHI '23, April 23–28, 2023, Hamburg, Germany Moore et al. recommends that designers build their understanding of AI mod- els by connecting models' material properties to end-user needs. Unfortunately, designers currently lack the means to explore AI models in a way that is compatible with their needs and work prac- tices. Moreover, designers often lack the necessary technical knowl- edge, and the complexity of model behavior can pose challenges in understanding AI limitations, such as discovering "unknown unknowns"-cases in which the model outputs a wrong prediction with high confidence. Further, UX-AI collaboration can be difficult due to a lack of com- mon language or shared processes [87]. In many cases, this results in an isolated AI experience design and development (AIX) process in which engineers develop the model with a limited understanding of its precise usage context while designers conceptualize the user experience with little direct exposure to the underlying technology. The UX-AI gap is becoming even larger with the popularity of off-the-shelf AI models-pre-trained models that are published on platforms such as Hugging Face [38]. Such models can make a valu- able resource for crafting AI UX by providing designers access to numerous models trained in a variety of AI capabilities, includ- ing object detection, image segmentation, and question-answering. However, they are often pre-trained on unknown or generic data. Documentation such as model cards provides an overview of train- ing, performance, and intended use but can be insufficient for de- signers to assess the fit for their specific application contexts. More generally, AI failures and their consequences are often tied to spe- cific user data and use contexts (e.g., failure to recognize text in a foreign language can disadvantage users who speak that language). Therefore, designers need to (1) explore pre-trained AI models by considering diverse users of their product and their contexts of use [79, 86] and (2) come up with design considerations for han- dling AI failures such as providing warnings or explanations, or handing over the control to the user. Through formative need-finding interviews, we learned that, at the current time, designers and product managers rely largely on Wizard of Oz simulations to explore model behavior rather than directly interacting with the model. Proactive approaches to model understanding are uncommon, as they are considered to be resource- intensive. Instead, designers respond reactively to model failures observed during controlled deployments such as beta launches. This approach is problematic as both upstream and downstream changes can be costly [35, 52]. Practitioners need tooling support for model exploration centered around their application and end- users, supporting the discovery of a range of AI failures that may require design interventions. To address these needs, we investigate how to support a designerly understanding of the capabilities and limitations of pre-trained AI models with a focus on computer vision tasks such as object detection in images. To facilitate this understanding and encourage a proactive ap- proach to AI failures, we introduce fAIlureNotes, a model explo- ration and analysis tool. fAIlureNotes implements an integrated workflow for guided model exploration, failure assessment, and UX design synthesis. Starting with user groups or personas, the designer can explore how the model behaves in a disaggregated manner with different inputs. For example, imagine designing a photo-based language learning application, one that identifies ob- jects in images in a new language. Ideally, such an application should work in a variety of contexts, such as a tourist walking through the city center in Germany or an immigrant exploring items in a supermarket. As shown in Figure 1, the designer selects an input (in this case, an image for language learning) and annotates it from a user's perspective. Calling the model API returns the model output for the input image, highlighting any mismatch between the annotated end-user expectations and the actual behavior. Fur- thermore, fAIlureNotes adopts a novel data augmentation approach to support exploring alternative inputs by leveraging an image generation model. Through iterative exploration, the designer can develop an in-depth understanding of the model behavior, examine the performance of the model for different personas, and synthesize design considerations based on observed model failures. fAIlureNotes provides a designerly way to explore computer vision models with image data by incorporating outputs from user research (e.g., common user scenarios and data instances) into the model exploration process. Our interactive interface and scaf- folding features enable designers to understand different types of model errors and proactively identify design interventions for AI failure cases. fAIlureNotes also enables a necessary first step in working with pre-trained AI models as a design material. Our key contributions include (1) design considerations for tools supporting designers' model exploration derived from need-finding interviews with practitioners, (2) fAIlureNotes- a model behavior analysis tool with an automated failure engine that is based on a taxon- omy of failure modes for computer vision tasks, and (3) empirical evaluation of our model exploration workflow. 2 RELATED WORK We situate our research within prior literature on AI design chal- lenges, tools for AI model behavior analysis, and existing approaches for AI failure exploration and recovery mechanisms. 2.1 AI Design Challenges Prior studies have highlighted different types of challenges in de- signing and prototyping AI UX. Yang et al. mapped out numer- ous challenges designers face in the user-centered design process (double-diamond). For example, designers have difficulty articulat- ing what AI can and cannot do, sketching divergent AI interactions, or anticipating unpredictable AI behaviors [87]. The probabilistic and evolving nature of AI systems makes it difficult for designers to understand AI as design material [87], while designers' limited technical understanding may prevent them from understanding the capabilities of the AI model [23, 86]. Designers often need to work closely with engineers to learn more about the technology and its capabilities and limitations. Still, such collaboration can be difficult because there is often a lack of common language or shared processes [44, 82, 89]. Breakdowns in interdisciplinary communica- tions can prevent efficient UX-AI collaboration and slow down the AI development process [35, 78, 86]. During prototyping, designers struggle to capture and test the dynamic behaviors of AI products. To reduce the technical devel- opment overhead, designers often turn to Wizard of Oz (WoZ) methods [9, 12, 19, 46, 80]. However, WoZ can be overly optimistic and easily overlook important details of AI implementation and the complexity of AI's output space, or fail to achieve a realistic error fAIlureNotes: Supporting Designers in Understanding the Limits of AI Models for Computer Vision Tasks CHI '23, April 23–28, 2023, Hamburg, Germany representation [9, 41]. With these difficulties, AI product teams often skip early prototype testing entirely or overly focus on ideal user journeys overlooking possible AI failure cases that deviate from this "golden path" [35]. Generally, designers lack tools that support their design and prototyping processes for AI-powered products. fAIlureNotes aims to enable designers to have exposure to the underlying technology in the early design phases. Through iterative model probing, designers can realistically capture the dy- namic AI behavior and derive design considerations for cases where the system fails. 2.2 Behavioral Analysis of AI Analyzing AI model behavior and performing error analysis can reveal more nuanced error patterns not captured by aggregate performance metrics. When performing model behavior analysis, AI engineers typically collect inputs from a variety of sources, such as users or synthetic data collection, and examine their model outputs. Engineers must then organize the inputs or outputs into schemas of semantically similar samples. Schemas can be groups, clusters, or slices of data. A common example of such a schema for model outputs is confusion matrices for classification problems [58]. Many other model-related problems can be found by grouping the inputs, often referred to as "data slicing" or "subgroup analysis." The analysis of model performance across subgroups forms the basis for much of the work assessing the fairness of AI systems [47, 59]. In particular, disaggregated evaluation [7], by comparing performance metrics across sub-groups, can help uncover biased systems, such as gender classification models that significantly underperform for women of color [13]. Testing AI iteratively with different inputs helps engineers formulate hypotheses about how and why the model fails and how to improve the model. The final evaluation of a model behavior analysis is usually documented in the form of reports such as a checklist [51] or model card [20, 53]. These reports can include performance metrics and major failure modes to facilitate suitability assessment and responsible use for those who want to use the model. Several tools have been developed to help engineers analyze the behavior of AI models from input generation [18, 63, 81], schema construction [3, 8, 57, 60], hypothesis definition [24, 84], to final evaluation [5]. For example, Affinity [16] allows AI engineers to filter images and visually inspect the model output. The tool also enables engineers to group images into schemas and define group- specific hypotheses as to why the model failed. Beat the Machine [6], DynaBench [45], and Patterned Beat the Machine [50] support input data collection by encouraging end users to find instances where the model fails. Another method to collect challenging data samples is data augmentation, by modifying existing instances to create new instances, e.g., by rotating or cropping images [88], or using recent AI techniques to generate new artifacts [26] such as generative adversarial networks (GANs) [30, 43]. All of the above tools aim to support engineers; designers have re- ceived little attention. fAIlureNotes is a model behavior analysis tool built for designers (broadly defined) rather than machine learning engineers. Similar to Beat the Machine [6], we encourage designers to find images that break the model. Similar to Affinity [16], our tool allows designers to group error cases into categories prior to assigning appropriate design interventions as recovery strategies. To allow data augmentation, fAIlureNotes uniquely integrates a generative text-to-image model (diffusion models) [68]. It supports the creation of prompts (text strings) describing desired images and feeds the prompts into the generative model to obtain the image instances. This approach solves a critical problem that product- and context-specific data can be costly to collect, especially in the early stage of product development. To support non-technical UX practitioners, fAIlureNotes also allows the creation of user scenar- ios to ground the exploration of model inputs and outputs, and contains a failure engine that automatically identifies and explains different failure modes to designers. Lastly, fAIlureNotes also al- lows designers to evaluate how well a model fits their various user groups by reviewing disaggregated failure metrics, a concept that was inspired by disaggregated evaluation [7]. 2.3 AI Failure Exploration and Recovery Numerous guidelines have been proposed to design AI experiences (AIX) [31, 33, 40, 42], including recommendations to mitigate and recover from AI failures [4, 32]. The PAIR playbook, for example, dedicates an entire chapter to errors and "graceful failure", offering best practices for designers to identify and diagnose AI errors and contextual failures while also providing potential paths forward from failures [32]. Microsoft's guidelines for human-AI interaction advise designers to make clear what the system can do and how well it can initially perform those tasks. If the system fails, designers should support efficient correction, scale down AI influence when in doubt, or provide users with local explanations [4]. Horvitz's principle of mixed-initiative user interface design [36] provides another best practice when designers decide to turn control over to humans in the face of AI uncertainties. These recommendations often provide high-level guidance but lack actionable details. Wizard of Error [41] allows designers to perform Wizard of Oz (WoZ) studies and simulate ML errors. To envision possible fail- ures early in the design process, Hong et al. developed the HAX Playbook, a low-cost tool that promotes proactive consideration of model-related failures in natural language processing. Neither tool allows working with a specific AI model, making it difficult for designers to get a sense of the realistic model behavior. Gra- dio [1] allows AI engineers to share their developed ML model with non-technical collaborators or end users. The Python package generates a visual interface that can be used to probe the model, view model outputs, and flag suspicious predictions. Alternatively, ProtoAI [79] uses a model-based prototyping approach that allows designers to incorporate model outputs directly into UI designs and analyze model failures as they occur. fAIlureNotes complements these approaches and helps designers find AI-related failures before deployment. Unlike ProtoAI, we place a stronger focus on discov- ering AI failures while developing a material understanding (i.e., before the design phase). 3 FORMATIVE INTERVIEWS Our goal for the formative need-finding interviews was to (1) inves- tigate current practices of UX designers to understand the limita- tions of AI models, and (2) derive design considerations for our tool by observing practitioners probing existing model APIs for errors. CHI '23, April 23–28, 2023, Hamburg, Germany Moore et al. The formative study does not aim for a comprehensive sample but is intended to determine system requirements based on qualitative feedback from a qualified and skilled group of participants. 3.1 Method 3.1.1 Procedure. We conducted semi-structured interviews with ten UX practitioners (UX researchers, product designers, and prod- uct managers) recruited through social media and using snowball sampling. To assess fit, potential candidates were asked to fill out a short form before participation. All participants had prior experi- ence working with AI-enabled products with an average experience of 5.2 years (SD = 2.4 years) (see Table 1). ID Role Work Experience in AI UX Researcher P1 UX Researcher P2 Senior UX Researcher P3 Lead Product Designer P4 Product Manager P5 Product Manager P6 Senior UX Researcher P7 Product Manager AI for Design P8 P9 UX Researcher P10 AI Product Manager 10 4 1 6 5 8 4 4 6 4 Table 1: Demography of Study Participants Each interview was conducted using the Zoom video conference tool and lasted approximately 60 minutes (a total of 10 interviews). Participants received a $30 Amazon gift card as an appreciation for their time. The study was approved by our Institutional Re- view Board. In each interview, the first 30-40 minutes were used to explore existing approaches to understand model-related fail- ures. Using an application context from participants' own work as an anchor, we questioned them about AI failure discovery and understanding, collaboration, knowledge sharing with engineers, and design approaches to address AI failures in their products. We also asked participants about specific methods, processes, and tools they use to learn about the capabilities and limitations of AI models. In the last 20-30 minutes of the interview, participants engaged in a hands-on activity to explore a pre-trained model using a provided application scenario (similar to [79]). We intended to understand whether and how model documentation and interactive APIs facili- tate a designerly understanding of model limitations. We asked participants to imagine designing an AI-powered lan- guage learning application that helps beginners learn single words in a foreign language. Specifically, end-users take a picture with their smartphone camera and pass it to an object detector. The com- puter vision system automatically detects all objects in a scene and shows or reads the words for these objects in a foreign language. We narrowed down on computer vision and object detection because computer vision models are popular among platforms that provide pre-trained model services. Also, image data is easy to work with, and the task is familiar to participants, as visual-verbal learning is commonly practiced in vocabulary learning. With this task in mind, we asked participants to explore Hugging Face's pre-trained DETR model [39] to understand its capabilities and limitations. Hugging Face is a rapidly growing service that requires AI developers to produce model and dataset documentation when submitting a pre- trained model [38]. The documentation (i.e., model card) for DETR model includes details about the architecture and intended uses, as well as training procedure and evaluation results. Hugging Face also provided a GUI that allows model consumers to test the model by uploading images. During exploration, we encouraged participants to find challenging but realistic samples to "break" the model. The participants hypothesized problematic images (e.g., sketch illustra- tion of a tomato) and used Google image search to find and test images using the interactive API. Depending on the participants' speed, they tested between three and ten images during the exercise. The insights from this activity helped us to derive design guidelines for fAIlureNotes. 3.1.2 Analysis. We transcribed the interview recording using a third-party service (approximately 600 minutes of recording). Us- ing an open-coding approach [21] the first author coded three transcripts to create an initial codebook. The resulting codebook consists of 86 codes, including challenges in hypothesizing about errors, awareness of AI failures, perception of the severity of fail- ures, biases in exploration, level of abstraction in documentation, and mental model building. Based on discussions with all authors, the first author revised and coded the remaining transcripts. Using MURAL, all authors grouped and categorized the codes and notes in multiple sessions and discussed the thematic relevance to the topic of successful AI failure discovery. In several cycles, we identi- fied the most important emergent themes. We refined the themes until all categories and subtopics were covered and no new topics emerged. We used memos to summarize findings across transcripts and as a basis for discussion among the authors [10]. 3.2 Findings As summarized in Figure 2, participants reported a variety of proac- tive and reactive failure exploration and model understanding strate- gies. We found that an effective approach to detect AI model failures is by detecting misalignment between expectations of real-world users and model behavior early on in the design ideation process. However, such proactive failure exploration is rarely practiced due to a variety of challenges, including time and effect cost, knowledge barriers, a lack of tooling support, etc. Instead, several participants relied on reactive approaches in which the first version of the AI- enabled solution is rolled out relatively quickly. End-user feedback and error logs are then used to iteratively improve the user expe- rience and model (fine-tuning, re-training, online training). Such reactive approaches have drawbacks, including technology blind- ness at design time, which may create technical or design debt, and causing harms to users. Here we elaborate on proactive approaches and challenges for UX practitioners to detect and avoid AI failures and derive design considerations for fAIlureNotes. Proactive practices without direct access to the AI model result in an incomplete understanding of model limitations. We found that a majority of proactive approaches today don't include the AI model fAIlureNotes: Supporting Designers in Understanding the Limits of AI Models for Computer Vision Tasks CHI '23, April 23–28, 2023, Hamburg, Germany Figure 2: Proactive and reactive approaches to designerly understanding of model limitations that participants discussed in the formative interview itself during exploration. In the early stages of design ideation, prac- titioners often relied on their imagination to anticipate AI failures ex-ante (no AI Model and no User Data). Several participants made use of anecdotal evidence (e.g., science news reports) and secondary sources to understand potential AI errors. P4, a product designer, reported reading science fiction to help him think about AI model failures. According to P4: "maybe this sounds fun to you, but we also spend a lot of time reading science fiction. Trying to see what other people are predicting about possible AI failure. . . ". Other participants reported sketching high-level user journeys based on personas to brainstorm failure cases for each step in the journey. To simulate AI behavior, practitioners relied on role-playing or Wizard of Oz techniques (No AI Model but User Data). P7, a product manager, commented: "Usually what I do is I'll partner with a designer, and we will create a high fidelity prototype that I will Wizard of Oz. So, I will pretend to be the model for the purpose of qualitative discovery". However, such approaches alone can be overly optimistic [9], and designers may have difficulty imagining all mistakes that an AI would make [41]. Additionally, as observed during hands-on exploration, with access to AI models, participants were able to refine their initial hy- potheses about model limitations by observing failure outputs. For instance, P5, a product manager, wanted to test the model on people of color because he had heard that computer vision models had dif- ficulty in this area. The model could not recognize a dark-skinned person in the top row. This prompted P5 to explore the model be- havior for a person who had many facial tattoos, which was also undetected by the model. Access to pre-trained models can support a richer designerly understanding of model limitations. Thus, model exploration tools should allow designers to incorporate existing practices typical to user research with interactive AI model APIs (D1). We also recommend model exploration tools should allow designers to apply an iterative approach to testing new or slightly modified hypotheses effortlessly (D2). Contextualizing AI models within use contexts are helpful for de- sign ideation. Three participants described approaches that allowed them to anticipate AI errors before deployment (proactively), in- cluding building specialized model exploration tools and having end-users in-the-loop (AI Model and User Data). P1, a UX researcher reported developing scenario-driven model probing tools along with AI engineers. Specifically, in the context of optimizing shelf space in stores using computer vision, P1 describes "we created this model debugging tool. . . and we would go into stores and take images of store shelves and look at the corrections the model would recommend and debug what the AI is getting right and wrong and try to figure out why?". Furthermore, P1 added that this understanding was critical to designing the user interface to guide the store agent in optimizing the shelves. Similarly, based on observations from the hands-on exploration, we noticed that the context and needs of the user served as a starting point for testing the model for failures. For example, P8, a Product Manager, imagined a science student during a semester abroad: "if, for example, I was to study abroad in Berlin and I was doing a physics course and I wanted to know what a particular object was called, then No AI Model/No User DataNo AI Model/User DataAI Model/No User DataAI Model/User DataProactiveReactiveSpeculationHistorical Failure CasesHypothesizing based on prior knowledgeScience FictionAI PersonaRole PlayWizard-of-OzUser ResearchModel DocumentationError Analysis /Performance ReportsPrototype DemosConversations withAI EngineersModel ProbingHuman-in-the-loopError Logs & Tracking End-user feedback to improve AIBeta-launchDebugging tools for User TestingScenario mapsAI Quality Assurance (QA)Semi-realistc Environments CHI '23, April 23–28, 2023, Hamburg, Germany Moore et al. translating would be really useful". She then looked for a picture of a solar system as input to the object detection model and observed that the model incorrectly classified the "planets" as "balls". Reflect- ing on their exploration behavior, P9, a user researcher explained that "As UX researchers, we try to ask first whom we are building it for, who's going to use it. So, that might help you to narrow down: Is there any model built for that specific type of user? Are we building it for a child or the elderly?. . . And we then select the model based on that. . . " Based on this insight, we propose end-user-centricity in model exploration tools for UX, i.e., model exploration tools should guide UX practitioners to test the model for different user groups and contexts (D3). Limited AI knowledge challenges designers' understanding of model failure types and ways to handle them. Testing a pre-trained model for failures was an unfamiliar task for many of our participants. Practitioners recognized the importance of AI engineering practices (AI Model but no User Data), such as conducting technical error anal- ysis, selecting appropriate value functions, defining performance metrics, etc. However, they reported difficulties in translating ob- jective performance metrics into the designerly understanding of model behavior. For example, in the context of supervised learning, a model error is defined as a discrepancy between the prediction of the AI model and the ground truth. Since UX experts are con- cerned about UX failures that can negatively impact users, the term error is defined more broadly to include not only errors within the distribution, but also out-of-distribution and context errors. Dur- ing the hands-on activity, P3, a UX researcher, imagined a tourist in France who wanted to find out about various objects in a café. She inserted a picture of a croissant, which the model incorrectly classified as a "cat" because it had not been trained on the class "croissant". The class "croissant" is not in the distribution of the model. P4, on the other hand, imagined that someone wanted to learn the plural. He first looked for a picture of a single apple and later for multiple apples and entered them into the model. P4 was disappointed that the model could not cover this context, even though it was a realistic case for a person who had just started to learn a new language. Without a clear view of possible error types, it is challenging for designers to ideate ways to address them in the user interface. Therefore, UX tools for model exploration should cover a wider range of failures and support UX profession- als to understand the underlying cause of AI model failure (D4). 4 FAILURENOTES Based on the design considerations identified in Section 3, we im- plemented a prototype tool, fAIlureNotes, for proactive exploration of AI model failures. While our approach can be generalized to a variety of machine learning tasks, we focus our implementa- tion on computer vision tasks using image data. Specifically, we demonstrate our approach for the task of object detection, making fAIlureNotes a scalable tool to probe any object detector, regardless of implementation details (e.g., fAIlureNotes works for single-stage [28, 29, 66] and two-stage detectors [17, 49, 65]). 4.1 User Experience of fAIlureNotes As shown in Figures 3 and 4, fAIlureNotes consists of a tab-based layout with three main views: (1) the user scenario view for import- ing insights from user research, (2) the model exploration view for iterative model probing and failure exploration, and (3) the design synthesis view to synthesize design considerations based on failure discovery. To better demonstrate how fAIlureNotes helps UX prac- titioners develop a designerly understanding of computer vision models and identify model failures, let us follow Eva, a UX designer with prior experience in designing AI-powered applications. Simi- lar to the example design task used in the need-finding study, Eva wishes to design a computer vision-based foreign language learning application similar to a vocabulary trainer. (a) User Scenarios: Based on user research, Eva has identified several user groups (personas) and usage scenarios along with ex- ample data instances (i.e., images that these users would upload for language learning). Eva opens fAIlureNotes on her web browser and begins by importing user research data into the tool (aligned with D1, D3). By clicking on the "add user" button in the user scenario view, Eva creates a new persona called Tom, a tourist exploring the city of Berlin. Next, Eva adds two scenarios for Tom, including vis- iting the city center on a guided walking tour and eating at a local restaurant. For each scenario, she creates a brief description and uploads images typical to those scenarios by dragging and dropping them under respective scenarios (Figure 3a). Eva also creates per- sonas representing a student involved in a study abroad program, and a business professional. Note that adding images at this initial stage is not mandatory; Eva can use the fAIlureNotes's inbuilt text-to-image generation functionality to generate images by writing text prompts describing the desired image. (b) Iterative Failure Exploration: Next, Eva opens the model exploration view to understand how well object detection models work for her application design context. As shown in Figure 3b, Eva has access to the user scenarios displayed on the side panel on the left. The main view shows a multi-selector dropdown on the top with a list of AI models and a prompt-based image generator right below it. Eva selects the DETR Object Detection model to begin exploring its capabilities and limitations. This creates a new tab for the DETR model in the main view. She can inspect the model documentation, if any, by clicking the "view details" button next to the model. Now Eva is ready to explore the model behaviors with different input images. Rather than choosing images at random, fAIlureNotes scaffolds Eva to assess the model behavior and limitations for each of the user scenarios created in the previous step. Eva selects a specific user scenario, "Tom is on a guided walking tour", and since Eva does not have a user-provided image for that, she generates an image of a Taxicab with the text prompt "Taxi in Berlin". Two images appear and Eva selects one for further analysis by clicking on it. The selected image appears in the main model exploration view. Instead of directly running the model, Eva first annotates her expectations about the model by creating bounding boxes and labels for objects in the image (in this case a single bounding box around the Taxicab in the image and the object "taxi"). This approach allows designers to input their definition of correct model behavior, and later analyze differences in the actual model behavior to detect fAIlureNotes: Supporting Designers in Understanding the Limits of AI Models for Computer Vision Tasks CHI '23, April 23–28, 2023, Hamburg, Germany Figure 3: fAIlureNotes's user interface for user research and model exploration: the designer (a) creates various user scenarios and uploads data inputs collected from user research. (b) The designer then conducts an iterative failure exploration. Create varioususer scenarios aUpload collected inputsfrom user researcha1Annotate desired model behavior(user expectation)b3a2Select AI model(s)b1Explore actual model behaviorb5Understand mismatch between expected and actual model behavior b4Use suggested prompts for further explorationCreate random augmentationsb6b7bGenerate imagesb2 CHI '23, April 23–28, 2023, Hamburg, Germany Moore et al. failures. Next, Eva runs the DETR model for the same image and the model outputs two objects, both labeled "car". She notices that the object she labeled "taxi" is detected as a "car" and another "car" is detected in the background. In the model tab, each object and label in the model's prediction is assigned a unique color, and by hovering over the bounding boxes, Eva can examine the prediction object by object. To facilitate analysis of the mismatches, fAIlureNotes imple- ments a failure engine that automatically compares model outputs with the annotated input image and highlights different types of model failures (D4). In this case, the system matched Eva's object "taxi" with the corresponding "car" in the prediction. The system used a red error tag to classify this case as "FD" (false detection). The failure engine further explains that "taxi" is misclassified be- cause it is not within the model's capabilities, indicating this with a blue info tag. In other words, the model has not been trained on data of this category. Additionally, the system classified the car in the background as "UD," which stands for an unnecessary detec- tion that seems less important to the user. Eva now has the option to rate the severity of each failure case on a 7-point Likert scale from the user's perspective (D1). She assigns a 5 (high severity) to the first failure by adjusting a slider and leaves the unnecessarily detected car at 1 (low severity). Clicking a button saves the two failure instances to the database. Last but not least, fAIlureNotes suggests prompts to generate alternative input images for Eva to continue her exploration (D2). For one suggestion feature, fAIlureNotes guides Eva to explore related images on which the model can produce correct outputs to help her understand the boundary of model failures. For example, here "taxi", is a lower-level sub-category for "car", so fAIlureNotes suggests trying with an instance image (or writing a prompt) about "car", which falls within the model's detectable categories. In other cases, if the model correctly detected an object in the previous exploration, the system takes common limitations of computer vi- sion models as a starting point to suggest variations that challenge the model to fail (D4). For example, it may suggest Eva try im- ages (or writing a prompt) such as "a Taxistand" or a "bus station." Alternatively, Eva can use the 'Generate Variations' feature in fAIlureNotes to augment her image of the Taxicab. fAIlureNotes generates variations of the image by adjusting brightness, rota- tion, and blurriness. These variations help Eva explore unknown unknowns and better understand model limitations. (c) Design Synthesis: After testing the model performance for different personas and scenarios, Eva proceeds to the last step- design synthesis and generation of failure notes. As shown in Fig- ure 4, for each persona, Eva sees a table summarising the model failure metrics including how many objects were correctly detected (CD) versus how many were misclassified (FD), missed (MD), or unnecessarily detected (UD). Such a disaggregated presentation of failure metrics helps Eva assess how well the model performs for each persona, which can help them identify disadvantaged user group that requires more UX interventions. Additionally, fAIl- ureNotes supports the comparison of multiple models. Eva can select other Object Detection models in the dropdown, compare performance across them, and find one that works best for a given or the majority of users or scenarios. Furthermore, fAIlureNotes provides a zoomable canvas for clus- tering failure instances and synthesizing design considerations for failure-specific recovery. The canvas is populated with all failure instances from the exploration stage as failure cards. Each card contains an image of the user's expectation (left), the model predic- tion (right), failure mode tags, and the failure severity Eva assigned during her failure exploration. Eva can group these cards, as well as ungroup and delete groups on the canvas. She can add group names and make notes about how to recover from the type of fail- ure in each group in interactive text fields. She can get suggestions about failure recovery by clicking on the "Add failure recovery" button. This grouping process would scaffold her to discover pat- terns amongst failure instances by shared UX recovery mechanisms rather than by model error type alone. For instance, she groups a set of cards with rotated images and adds a group name: "Model fails on rotated images." As a recovery, she imagines the application detecting rotated images automatically and notifying the user with "Please retake this image and make sure the camera is straight" on the UI. After synthesizing her failure groups and defining appropri- ate failure recoveries for all groups, Eva downloads each canvas as a JPEG image. The snapshot allows Eva to share her failure explo- ration and design considerations with the engineering team. Using her failure notes, the team can make technical choices from improv- ing the given model (e.g. retraining the model on additional classes or fine-tuning the model with rotated images) to developing addi- tional technical components required for the recovery mechanism (e.g., adding another model to detect rotated images). 4.2 Taxonomy of Failure Modes and Recovery Mechanisms for Computer Vision Tasks To support the features described above, we synthesized from prior literature an initial taxonomy of different types of AI model failures for computer vision (CV) tasks and UX recovery strategies. Taking a UX perspective, we identify ways in which CV models may fail (failure modes) as well as effective actions to prevent or recover from failures (failure recoveries) before deploying the AI-powered system. Note that we only cover failures that occur in a single human- AI interaction (local failures) and exclude the ones that span all or several interactions, such as mental model breakdowns (global failures). Through this synthesis, we implement the failure engine for the current instantiation of fAIlureNotes (see Section 4.3). Failure Modes in Computer Vision. To develop a taxonomy 4.2.1 of typical failure modes that occur in computer vision systems, we first reviewed existing taxonomies for the field of natural language processing [35] and Human-AI co-creative systems [14]. Similar to [74], we collected an initial set of failure modes by reviewing earlier work on human failures from the field of psychology and cognitive science. Our review included human failure types from Norman's taxonomy [54, 55], Rasmussen's taxonomy [62], Reason's taxonomy [64] as well as the HFACS taxonomy [73] which is based on Reason. We also integrated more recent failure categorizations, such as a taxonomy for human driving [75]. Through this review, the first author generated an initial list of failure modes. We then discussed and selected the ones that are rele- vant to computer vision technology. Through several meetings and discussions, we developed the categorization presented in Table 2. fAIlureNotes: Supporting Designers in Understanding the Limits of AI Models for Computer Vision Tasks CHI '23, April 23–28, 2023, Hamburg, Germany Figure 4: fAIlureNotes's user interface for design synthesis: the designer (c) assesses model performance, reviews, and groups failure instances, and derives design considerations for recovery. At a high level, our taxonomy consists of three levels of failure models: input level, observation or CV model level, and reaction or response level failures. This categorization roughly follows typical CV application architecture. We list several potential failure modes for each level and also provide an illustrative example for each focusing on the use case of autonomous driving. It is important to mention that not all failure modes will apply to every vision- empowered product. Instead, the taxonomy is designed to alert a designer or engineer to a wide range of potential failures but requires the designer to select and interpret the different failure modes for their specific context. We demonstrate how this can be done with our system-fAIlureNotes's failure engine is based on the failure modes of our taxonomy, focusing on the observation (com- puter vision level) layer. Lastly, to check for coverage and validate our taxonomy, we categorized a range of computer vision tasks using the items in our taxonomy. More specifically, we looked at the tasks of binary image classification, multi-class classification, object detection, single-object tracking, multiple-object tracking, semantic segmentation, instance segmentation, panoptic segmentation, video object segmentation, deep metric learning, and image generation. This exercise led to some adjustments in our final definitions. Failure Recovery. To support the creation of failure notes, we 4.2.2 identified a set of UX recovery mechanisms for AI failures based on human-AI guidelines (referred to as "graceful failure [32]"). We an- alyzed three different guidelines on AI experience design (Google's People + AI guidebook [32], Microsoft's Guidelines on Human-AI Interaction [4], and Apple's Human Interface Guidelines for Ma- chine Learning [40]). In an initial pass, the first author captured every failure recovery guideline, then we iteratively grouped simi- lar items to identify eight commonly applied recovery mechanisms that we present in Table 3. We acknowledge that there are many more ways to prevent or recover from AI failures (e.g., engineering best practices), but the mechanisms we identified provide a starting point for design synthesis using fAIlureNotes. 4.3 Implementation Details We implemented fAIlureNotes as a web-based application with Django [22]. The graphical user interface is written in HTML and JavaScript and connects to a Python Web Server that implements the modules described in Figure 5. At a high level, Input Images can be labeled with the Ground Truth Annotation module before being fed to the AI Model. The Failure Engine module calculates a Loss and performs a bipartite matching between the annotated labels and model prediction. Based on the matches it performs an automated Failure Classification. The Prompt Generator uses the information obtained from the failure engine and generates text Detect rotations automatically and notify user:"Please retake this image and make sure the camera is straight"Model fails on rotated imagescEvaluate user-specific model performancec1Group failure instances into patterns and assign failure recoveriesc2 CHI '23, April 23–28, 2023, Hamburg, Germany Moore et al. System level Failure Mode Example Autonomous Driving Sensing (Input level) Missed or delayed atten- tion False input Critical quality input False observation System fails to detect a triggering event or responds too late to be useful. System fails because it is unable to pro- cess a particular input. System fails because of quality issues with respect to the input. System generates output error. Motion detection system fails to trigger camera or triggers camera system too late. System is fed lidar data but can only process camera data. System fails because it was fed a blurry image. Vision system misclassifies a pedestrian as an- other car. Failing to observe System is unable to provide an output. Vision system is unable to detect any object for Observation (Computer Vision level) Incomplete observation Critical quality output Violation Failing to act Mistimed action Too much AI Limited AI Inappropriate action Reaction (Action level) System misses certain visual informa- tion. The output of the system bears unac- ceptable uncertainty. Computer vision system's output stands in conflict with ethical standards, rules, or regulations. System fails in executing the desired action. System acts correctly but at the wrong point in time. From a human perspective, the system enters the territory of the user or auto- mates too much of the process. From a human perspective, the system provides too little involvement in the process to provide value. System works as intended but the be- havior of the system stands in conflict with the needs, goals, or preferences of its user in a given context. a given frame. Vision system misses a pedestrian in a frame. The certainty score for the vision system's out- put is too low. System outputs include racial categories when such information is inappropriate. Vehicle does not break and hits a pedestrian. Vehicle breaks not fast enough to prevent an accident. Autonomous driving assistant takes over but the human driver would prefer driving in this given situation. Autonomous driving system supports human drivers with steering and acceleration but the driver expects it also to monitor the environ- ment. Autonomous vehicle speeds to be able to cross a traffic light in time but fails to take the pas- senger's driving anxiety into consideration. Table 2: A Taxonomy of failures in computer-vision-based systems: Describes failure modes on different system levels with examples. fAIlureNotes currently implements an failure engine focusing on the Observation layer prompts that can be fed to the Image Generator to generate new images. Alternatively, variations of an image can be created with the Image Augmentation module. Lastly, the system calculates and presents Disaggregated Failure Metrics, and provides a Visualizer to present the failure cards in the canvas for grouping and annotating design considerations. Ground Truth Annotation & AI Model. Designers can draw bound- ing boxes on an image and label individual objects. We built the annotation tool ourselves in JavaScript and did not rely on external libraries. Class labels and bounding boxes are saved in the database. For the evaluation study, we tested a common object detection net- work as our AI model- the DETR model with a ResNet50 backbone [17]. We rely on HuggingFace's implementation support; the hosted Inference API returns the model's prediction in JSON format. A prediction contains a certain number of objects, each containing a class label, a bounding box, and a confidence score. Failure Engine. The Failure Engine conducts an automated fail- ure classification. It takes M annotated objects (user expectation) and N predicted objects (model prediction) and creates an optimal matching based on the Hungarian algorithm [77]. The algorithm takes a matching cost as input and outputs the optimal assignment between user expectation and model prediction. Some objects may be matched and some may be left unmatched. The matching cost takes the object's class label and the bounding box into account. For the class loss, we set the cost to zero if the label of the user ex- pectation equals the model prediction and one otherwise. The box loss is a linear combination of a simple l1 loss and the generalized Intersection over Union (IoU) loss [69]. The final matching cost fed to the Hungarian algorithm is the class loss added to the box loss, both weighted by a hyperparameter. We set both hyperparameters to 0.5 (identified through manual testing). The matching allows us to classify different failure modes (Failure Classification) with simple rules, focusing on the observation layer of our failure mode taxonomy (Table 2). If objects were matched we fAIlureNotes: Supporting Designers in Understanding the Limits of AI Models for Computer Vision Tasks CHI '23, April 23–28, 2023, Hamburg, Germany Name Description Quality of output N-best options Hand-over of control Implicit feedback Explicit feedback Corrections by the user Local explanation Global explanation Communicate the quality of output (e.g. confidence or uncertainty score of the prediction) to the user, or adapt user experience when confidence is low. Show the top N predictions to the user (as opposed to only presenting the prediction with the highest confidence score). Return control over to the user in situations of possible failures. Degrade the AI system's automation level when uncertain about the user's satisfaction. Use implicit feedback information (e.g., users' engagement level on different outputs) to improve the AI model to align with user expectations or preferences. Consider eliciting explicit feedback to improve AI-powered experience. Give users a familiar and easy way to make corrections to the AI's output. Learn from corrections. Provide a local explanation for the model's prediction. Make clear why the system did what it did. Tie explanations to possible user actions. Provide global explanations of how the model works. Establish appropriate trust and expectations from the beginning by communicating the product's capabilities and limitations clearly. Table 3: Failure recovery mechanisms extracted from Human-AI guidelines. They are provided as suggestions on the Failure Synthesis & Recovery panel of fAIlureNotes. Figure 5: fAIlureNotes's System Architecture: Input Images are annotated and fed to the AI Model. The Failure Engine calcu- lates a Loss and performs a Failure Classification. The Exploration Assist module supports the exploration iterations and the Failure Summarizer helps assess model performance and analyze failure instances. compare the labels between the user expectation and model predic- tion. If they are the same, we classify the match as "CD", a correct detection, otherwise as "FD", a false detection. Unmatched user ex- pectations (annotated objects) are "MD", missing detections while unmatched model predictions are "UD", unnecessary detections. The Failure Engine also checks for three kinds of warnings. If an AI model was unable to detect any object the system categorizes this as an "FTD," failing to detect. If the confidence score of the prediction was below a threshold (e.g., 0.95 in our case) a "CQS" (critical quality score) warning is created. In case objects have been matched and the intersection over Union (IoU) between the boxes falls below a certain threshold set to 0.7 (according to [17]), the warning "CQB" (critical quality box) is created. Lastly, for all annotated objects (user expectation), the Failure Engine module Input ImageAI ModelGround Truth AnnotationFailure EngineExploration AssistFailure SummarizerPrompt GeneratorImage GeneratorImage Augmentation Loss (Matching)FailureClassificationVisualizerDisaggregated Failure MetricsGenerator CHI '23, April 23–28, 2023, Hamburg, Germany Moore et al. checks whether the desired class label is in-distribution ("ID") or out-of-distribution ("OOD"). We assume the AI's distribution is known and provided when a model is uploaded. Interested readers can find the mathematical equations in the appendix. We relied on PyTorch [61], NumPy [56] and SciPy [71] for the Failure Engine module. The Failure Classification is based on our failure modes (see section 4.2), while the technical implementation is inspired by the object detection loss from the original DETR paper [17]. Exploration Assist. Based on information from the Failure En- gine, fAIlureNotes's Prompt Generator proposes text prompts that can be fed into the Image Generator to generate new images during the iterative failure exploration. We distinguish three cases: (1) Guide: If a tested object is out-of-distribution, we use the Words API [83] to check whether any higher-level or lower-level abstrac- tions lie within the model's distribution. Hence, we guide designers back to the model's capabilities and help them understand the boundary of failure cases. (2) Challenge: If the model predicted an object correctly, we encour- age the designer to challenge the model. We create text prompts in a rule-based manner based on common limitations of computer vision models. For example, assuming the model correctly detected a cat, one of the suggested prompts may be "An image of a cat at night", or "Many cats" given that computer vision models tend to perform worse on dark or cluttered images. (3) Repeat: If the model made a wrong prediction (false detection) and the annotated label was in-distribution, we encourage the de- signer to find a similar object as the one depicted in the image. For that, we crop the respective object and feed it to a separate image-to-text model [67] to retrieve a new text prompt suggestion. A suggested or user-created text prompt (individual word or short sentence) can be used to generate two images in the Image Genera- tor module. We use a text-to-image network, the stable diffusion model [68] with the default parameters to generate the first image and the Google Search API [72] to generate the second image. All generated images are also stored on the server. Alternatively, different variations of an image can be created in the Image Augmentation Module. We rely on Pytorch's torchvision library to create four kinds of image augmentations. Failure Summarizer. The Disaggregated Failure Metrics Genera- tor takes all failure instances as input and calculates disaggregated failure metrics. The Visualizer presents failure instances and al- lows users to group, ungroup, delete them, and add interactive text strings to the zoomable canvas. This step helps users to find pat- terns amongst failure instances and to come up with failure-specific remedies. We used Fabric.js's Javascript HTML5 canvas library [25] to implement the Visualizer. 5 EXPERT REVIEW We conducted a user study with UX experts to gather feedback on the usefulness of fAIlureNotes in exploring pre-trained AI models. Specifically, our objective was to (1) evaluate the failure exploration workflow of fAIlureNotes, (2) collect feedback on the usefulness of our tool, and (3) evaluate the overall user experience of fAIl- ureNotes. We recruited 10 participants for the study, initially from our connections in the industry and then through snowball sampling, aiming to collect feedback from a skilled group of UX practitioners rather than a comprehensive sample. To avoid knowledge advan- tages, we recruited different participants for this study than for the formative interviews. For this study, we included UX practitioners with and without AI-specific experience. Our participants com- prised eight UX designers and two product managers. Seven partic- ipants reported previous experience in the design of AI-powered applications. Each session lasted 60 minutes, and participants could opt-in to receive a small gift of university merchandise. Sessions were conducted individually (ten sessions in total) using the Zoom video conferencing system. At the start of each session, we introduced the participants to the application use case of our computer vision- based language learning app. Then, we asked the participants to imagine how they would design the user experience for the ap- plication. We asked participants to explore the capabilities and limitations of the DETR Object Detection [39] AI model and to derive UX design considerations based on their analysis. We also provided participants with a potential user profile [34] similar to Section 4.1 and three image samples, but participants could also create their own target groups and provide samples. We set up the study as a comparative assessment. In one part, participants were first asked to perform the task using HuggingFace's interactive model card [39] for DETR, which includes model documentation and an API interface (playground) to test the model with image inputs. In the other part, we provided participants with a detailed walkthrough of fAIlureNotes's workflow and features. The partici- pants then performed the same task using our tool. We randomly counterbalanced the order of the two parts to reduce order and carryover effect. Once the participants completed the task, they engaged in an open discussion with the study coordinator to report on the design considerations and their understanding of model lim- itations. They also provided feedback on the tools, and discussed how designers would use fAIlureNotes for their own AI UX work. Finally, at the end of the study, all participants completed a user experience questionnaire (UEQ-S) [70]. 5.1 Analysis We used a mixture of quantitative and qualitative methods to an- alyze the results. For the quantitative analysis, the first author watched all recordings and annotated video segments to quan- tify how much time participants spent on different views and the frequency and sequential order of feature usage, and calculated descriptive statistics. This was done for both fAIlureNotes and Hug- gingFace. To assess whether fAIlureNotes helped UX practitioners explore and analyze failure cases, we also extracted all outputs of the failure engine from the screen recording (failure mode tags) and all failure notes created (design synthesis canvas). We analyzed participants' design synthesis boards by clustering failure groups across participants. For the qualitative findings, we analyzed in- terview transcripts inductively corresponding to our evaluation objectives. fAIlureNotes: Supporting Designers in Understanding the Limits of AI Models for Computer Vision Tasks CHI '23, April 23–28, 2023, Hamburg, Germany Figure 6: Findings from Evaluation: Participants' workflow with fAIlureNotes (left) and HuggingFace (right). The bar's color indicates the view, and the length of the bar encodes time. 5.2 Findings Our findings include observations about fAIlureNotes's usage, use- fulness, and user experience. We constantly compare participants' use of fAIlureNotes with HuggingFace's interactive model card, which is today's status quo for people to understand pre-trained models. 5.2.1 User-centered Failure Exploration with fAIlureNotes. All par- ticipants followed a fairly linear process as they examined the DETR model' failures using fAIlureNotes (see Figure 6). Only U6 and U10 went back to create additional user scenarios after examining the model for failures. Across all sessions, participants spent 19 percent of their time on the user scenario view, 49 percent on the model exploration view, 32 percent on the design synthesis view, and 1 percent on the browser. With fAIlureNotes, there was little need to switch between different tools. In contrast, on HuggingFace, de- signers left the interactive model card for 24 percent of their time to download images from Google, research information about the dataset, create data augmentations with local software, or sketch UI elements in Figma. In addition to the persona and scenario provided, designers had little difficulty imagining new user groups and scenarios. Across all sessions, participants created 0.9 users and 2.5 scenarios with fAIl- ureNotes. For example, U1 designed the fictional language learning app for "Geena - a cook who wants to learn about food in Japan", or U5 for "Maria - a professional who moved to Madrid". Often the scenarios helped envision new images a user would submit to the AI. Most participants used the system's built-in image generation function to generate sample images for examination. The image generation function was used an average of three times per session, and only once did a product designer search Google for images (U6). With HuggingFace, six out of ten participants relied on Google to download images to test the model. Image augmentations helped designers challenge the AI model. Four out of ten designers used the image augmentation module of fAIlureNotes. During the Hug- gingFace session, U5 and U10 also created image augmentations using local image editing software. Most times, participants came up with their own prompts, while the prompt generation module was used only once by U7. Most participants tested the AI model iteratively. Regarding the time spent, participants were slightly faster with HuggingFace's Model API (participants tested one image every 5 minutes and 2 sec- onds). With fAIlureNotes, on the other hand, it took 5 minutes and 59 seconds for each image tested. One reason is that fAIlureNotes provided expansive details and affordances to understand model failure. In addition to uploading an image and reviewing the model output (supported by both fAIlureNotes and HuggingFace), with our tool practitioners also need to annotate the image and review the failure engine's output. All 10 participants derived design considerations (i.e., failure notes) with fAIlureNotes. Across all sessions, designers and prod- uct managers created 1.6 failure groups and 1.4 recovery strategies. In contrast, no designer was able to derive design considerations in written or visual form using the HuggingFace model API. In Hug- gingFace, five designers verbally discussed failure patterns (e.g., U10 noted that the AI only seems to detect objects in the foreground or that the model fails with rotated images) but had difficulty translat- ing that into formal design considerations. By supporting designers to articulate different failure types, designers were able to ideate on design considerations to mitigate these failures. Further, discov- ering failure patterns requires looking across multiple failure cases, but designers cannot save and synthesize insights across all tested images with HuggingFace's interactive model card. In summary, while HuggingFace's model card allowed a slightly faster model exploration (but shallower understanding), partici- pants often switched between different tools. Most notably, fAIl- ureNotes significantly outperformed HuggingFace with respect to the quality of model assessment and design considerations. 5.2.2 Perceived Usefulness. When asked during the post-task open discussions, designers with prior AI design experience design and FAIlureNotesHuggingFace's Interactive Model CardU1User scenario viewModel exploration viewDesign synthesis viewBrowser (image search)Model cardInteractive model APILocal software (image editing & design software)Browser (image search & research)U2U3U4U5U6U7U8U9U10U1U2U3U4U5U6U7U8U9U10 CHI '23, April 23–28, 2023, Hamburg, Germany Moore et al. Figure 7: Findings from Evaluation: (a) Example failure notes of three participants and (b) an aggregated overview of the error, info, and warnings tags participants experienced. knowledge of HAI guidelines (n=7) saw value in fAIlureNotes. Re- flecting on the two tools used in our study, U5 said "If I'd be the product designer and [the AI] is really a fundamental part of this product, I would use fAIlureNotes instead of the HuggingFace ver- sion". U6 said "It's one thing to know the [HAI] guidelines and another to apply them in your work, and the tool made it very explicit how the user interface should respond in case of an error". Participants found that fAIlureNotes gave them a more structured approach to the task of model behavior analysis than today's in- teractive model cards. In particular, designers appreciated the user scenarios embedded within the model exploration context. For ex- ample, U1 commented, "I liked the fact that you could go and swap through the different personas and work on the different storylines. I think that is useful for setting the scope". Further, four participants explicitly remarked on the design syn- thesis view, allowing them to group failure instances into different categories. "I like having the option of grouping failures and having this canvas to do this. It is easier to connect stuff in your head with this visual representation, where you can connect different pictures or elements together" (U4). U7 and U10 said that such a feature would have helped them enormously during their work. U7 said that "a broad overview of possible failures would have given us a better way to organize our communication with the user". She would have used the failure canvas as a boundary object [76]: "there were always discussions between ML and product, and it would be really nice to communicate [the failure groups] visually to the whole team rather than writing it in words". Figure 7a shows some of the failure groups and recovery mecha- nisms participants created during their session with fAIlureNotes. U8 and U10 experienced a group of failure cases where the model detected background objects. As a remedy, U8 imagined that a user could delete unwanted objects on click within the language learning application, or work out a heuristic with an engineer that would prevent showing background objects in the first place. Three par- ticipants (U3, U4, and U7) found a group of failure cases where the AI model would predict objects with a higher level of abstraction (e.g., detecting a person instead of a dancer). U3 added a failure group named "Generic vs. specific object" and imagined providing users with an explanation of what classes the model can predict while also giving users a way to provide feedback. Lastly, five par- ticipants (U1, U2, U6, U8, and U10) discovered a group of objects that the user expected the model to detect, but the labels were out- of-distribution. U10 named this group "OOD - high impact" and noted that the model would need to be retrained by engineers. Across all participants, fAIlureNotes's failure engine helped iden- tify several failure modes (see Figure 7b). The most common error type was unnecessary detections (56.4%), followed by missing de- tections (24.5%) and false detections (8.2%). For 66.7% of objects, the annotated ground truth was outside of the model's capabilities (OOD) and 33.3% of annotated objects were in-distribution (ID). The failure engine's most commonly displayed warning was the critical ErrorsInfoWarningsGeneric object vs specificProvide user with class labels + give user option for feed-backOOD - high impactHave to train algorithm with these classesBackground objectsUser is able to delete object by click / heuristicaU8bU3U10Correct detection (CD) - 10.9%False detection (FD) - 8.2%Missing detection (MD) - 24.5%Unnecessarydetection (UD) - 56.4%Out-of-distribution(OOD) - 66.7%In-distribution(ID) - 33.3%Failing to detect (FTD) - 9.8%Critical quality score (CQS) - 73.2%Critical quality box (CQB) - 17.1% fAIlureNotes: Supporting Designers in Understanding the Limits of AI Models for Computer Vision Tasks CHI '23, April 23–28, 2023, Hamburg, Germany quality of score (CQS) with 73.2%, followed by critical quality of box (CQB). In 9.8% of cases, the AI model did not detect any object. 5.2.3 User Experience. Overall, designers found fAIlureNotes's user interface supportive and relatively intuitive to use. U1 con- trasted HuggingFace's model card to fAIlureNotes and said, "The UI of your tool was a lot friendlier for designers, especially if you are not familiar with code. It's less technical, not daunting, and is frictionless". U6 commented on fAIlureNotes saving him valu- able time during his manual image search and failure exploration. "What was also cool when I tried [HuggingFace], and I stumbled upon the cooking pot. . . I was thinking maybe it was the reflection, maybe this and that, and [fAIlureNotes] would have probably just given me it is out-of-distribution. So it would have saved me a lot of headaches to search for more cooking pots with less reflection, better lighting, or whatever". However, the failure modes were difficult for designers with little prior experience with object detection. For example, U1 had difficulty understanding automated matching and was confused about the coloring between user expectation and model prediction. She also commented that it takes time to become familiar with the acronyms (e.g., FD for false detection). Sometimes, designers wanted to provide feedback on the failure engine's classification. U8 said: "It would be nice to say, this was actually not an error and disagree with the machine". He also suggested a different user experience from the canvas to group failure cases and said: "I wonder if this kind of interface is the most efficient for grouping. . . I imagine you get like hundreds of these failure cases". Instead, he suggested a UX that allows designers to multi-select failure cases and create failure groups by dragging items into folders. We plan to incorporate these suggestions in future iterations of fAIlureNotes and explore ways to revise and embed more designer-centered interactive model cards into fAIlureNotes. Based on the usability questionnaire, on a seven-point scale, participants rated fAIlureNotes to be supportive rather than ob- structive (mean=5.91, SD=0.67) and efficient rather than inefficient (mean=5.00, SD=1.12). Participants rated our tool as exciting rather than boring (mean=5.10, SD=1.04) and interesting rather than not in- teresting (mean=5.8, SD=0.60). They evaluated it as easy rather than complicated (mean=4.70, SD=1.10) and clear rather than confusing (mean=4.40, SD=1.36). Lastly, designers found our tool inventive rather than conventional (mean=5.60, SD=0.80) and leading edge rather than usual (mean=5.60, SD=0.80). Encouraged by the pos- itive feedback, we plan to run follow-up deployment studies in real-world AI design tasks with improved onboarding experience (without having the guided walkthrough). 6 DISCUSSION AND FUTURE WORK In this section, we discuss the utility of our developed system, fAIlureNotes's generalizability, and the underlying assumptions and limitations of our two studies. 6.1 Utility of fAIlureNotes AI, often seen as a "general-purpose" technology that can be in- corporated into numerous applications, carries enormous potential and risks. AI failures can have negative consequences and create physical, psychological, or financial harm to humans [27, 52]. Yet, designers and engineers lack the means to foresee problems with AI models in real-world use [35]. As prior literature has shown, human-centered AI largely follows an "AI-first"workflow [78]. AI engineering practices have established error analysis tools [24, 84], processes, and artifacts for transparent reporting [20, 53]. However, it is difficult to anticipate downstream application performance and use through upstream model documentation. To facilitate this transition, it has been proposed that designers must acquire a "de- signerly understanding" [87] of AI models as a necessary first step to AI application design. However, current design processes and tools fail to meet this objective. Current HCI research has con- tributed guidelines [4, 32] and tools for designing AI experiences [35, 41, 79]. With fAIlureNotes, we have demonstrated an approach for early failure discovery of pre-trained object detection networks. Using fAIlureNotes, UX professionals can interactively explore AI models using insights from their user research. Our evaluation and the participants' feedback offer evidence that our system bridges understanding pre-trained models and designing application expe- riences around them. Further, since our system is intended to support the incorpora- tion of user research data, we can imagine designers collaboratively working with potential end-users or domain experts to explore, categorize and prioritize different failures. Oftentimes, designers alone cannot assess whether the model behavior constitutes a fail- ure as it can be subjective to use contexts. As opposed to current Wizard of Oz testing, fAIlureNotes can provide end-users with a more realistic expectation of AI behavior and performance while informing design considerations. In designing fAIlureNotes, we aimed to support designers along the entire model behavior anal- ysis journey-from generating samples, reviewing model outputs, and disaggregated model assessment-all within the same tool. As the results of our evaluation show, our image generation, editing, and prompting support features allow designers to stay within the system's workspace without switching application context. Given the range of artifacts and tools designers need to navigate in AI experience design, an integrated tool and workflow such as fAIl- ureNotes can greatly reduce friction in design work. However, we did not implement the transition between failure exploration and UI/UX design or modeling changes in our tool. To achieve a failure-driven design process, we aim to explore extensions that also allow designers to sketch, design, or prototype AI-powered applications (a relevant example is ProtoAI [79]). Additionally, our workflow and functionalities (e.g., image generation module) work particularly well for early design phases when data is scarce. How- ever, model testing is an ongoing challenge due to potential changes in user behavior or distribution drifts. Building on model behavior analysis tools for AI engineering (e.g. Affinity [16]), we hope to see the HCI community develop similar tools that are specifically tar- geted at product designers or product managers. This could include functionalities such as uploading existing datasets, slicing data into subsets [60], or filtering instances [16]. 6.2 Generalizability Our current prototype primarily supports the exploration and eval- uation of object detection models (single-stage [28, 29, 66] and two-stage detectors [17, 49, 65]). In order for the system to be used CHI '23, April 23–28, 2023, Hamburg, Germany Moore et al. for other machine learning tasks, the ground truth annotator, AI prediction module, failure engine, and prompt generator would need to be adapted. However, we believe that our approach of using generative models to augment data for exploring model failures is scalable to many other machine learning tasks, such as image classification or semantic segmentation in computer vision and text classification in natural language processing. For example, future studies could use large language models [11] to generate text inputs that could be annotated before being fed into text classification net- works. However, if the model to be explored is a generative model, fAIlureNotes's functionalities and workflow most likely would have to change (e.g., the annotation and failure modes would be different). Future HCI work could explore how to support failure exploration for large pre-trained generative models ("foundation models") such as image generation models [68] or large language models [48]. Moreover, our tool primarily focused on failures at the observa- tion layer of computer vision systems (see Table 2: A taxonomy of failure modes in computer vision). Others could explore how tools can support UX practitioners in understanding errors that occur at the sensing and reaction layers. Assessing input and label quality is an important part of the error analysis process [15] that our work has not addressed in detail. We also do not cover complex systems where the system contains multiple machine learning models. Pre- vious work [57] has highlighted these challenges from a technical perspective, but future work may help non-technical users (e.g., product managers) in (a) understanding the ML pipeline and (b) discovering failures at different system levels. 6.3 Assumptions and Limitations Our approach primarily emphasizes failure cases involving end- user experiences, but the scope of AI failures can be broader [52]. In cases such as adversarial attacks [2, 37], or privacy breaches [85], it is crucial to include a wider range of stakeholders. Addi- tionally, fAIlureNotes also does not directly consider systematic issues related to fairness, accessibility, or transparency [51], such as supporting testing model performance for different genders or races [13]. Future work should examine how early-stage model probing could push designers toward sociotechnical definitions of AI technology failure. Our evaluation study demonstrates the shortcomings of interac- tive model cards [53] in assessing the contextual fit of pre-trained AI models. In essence, none of our participants was able to find aggre- gated failure patterns or derive UX design considerations for failure recovery with HuggingFace's model card. However, our study did not cover other aspects of design with AI models (creating UIs) and the time given to participants was limited. We also acknowledge that the number of participants (n=10) is small. We also did not test our system in a real-world work setting nor did we include AI engineers (e.g., to assess the failure groups designers found). We are interested in how failure exploration and analysis tools such as fAIlureNotes can support product teams collaboratively in a real- world setting. Future work can focus on the design-engineering boundary [80] and support a collaborative error analysis process. 7 CONCLUSION Artificial Intelligence (AI) is becoming an integrated part of our so- ciety and lives. However, despite AI's promise to enable novel user experiences and services, errors will remain an inevitable byproduct of AI-powered applications. To proactively anticipate and address AI failures, UX designers need access to the underlying technology to understand the model's capabilities and limitations. In this work, we introduced a failure-driven design approach to AI, a workflow that encourages designers to explore model behavior and failure patterns early in the design process. Our implementation of fAIl- ureNotes, a designer-centered failure exploration and analysis tool, supports designers in evaluating models and identifying failures across diverse user groups and scenarios. We demonstrate how fAIl- ureNotes can support designers in operationalizing HAI guidelines and provide users with a path forward from AI failures. ACKNOWLEDGMENTS We thank our reviewers and study participants for their time and feedback. We also thank Dipti Ganeriwala and Raisul Ahsan for providing feedback on early prototypes and Natalija Wollny for her help with the demo video. REFERENCES [1] Abubakar Abid, Ali Abdalla, Ali Abid, Dawood Khan, Abdulrahman Alfozan, and James Y. Zou. 2019. Gradio: Hassle-Free Sharing and Testing of ML Models in the Wild. CoRR abs/1906.02569 (2019). arXiv:1906.02569 http://arxiv.org/abs/ 1906.02569 [2] Naveed Akhtar and Ajmal Mian. 2018. Threat of Adversarial Attacks on Deep IEEE Access 6 (2018), 14410–14430. Learning in Computer Vision: A Survey. https://doi.org/10.1109/ACCESS.2018.2807385 [3] Saleema Amershi, Max Chickering, Steven M. Drucker, Bongshin Lee, Patrice Simard, and Jina Suh. 2015. ModelTracker: Redesigning Performance Analysis Tools for Machine Learning. In Proceedings of the 33rd Annual ACM Conference on Human Factors in Computing Systems (Seoul, Republic of Korea) (CHI '15). Association for Computing Machinery, New York, NY, USA, 337–346. https: //doi.org/10.1145/2702123.2702509 [4] Saleema Amershi, Dan Weld, Mihaela Vorvoreanu, Adam Fourney, Besmira Nushi, Penny Collisson, Jina Suh, Shamsi Iqbal, Paul N. Bennett, Kori Inkpen, Jaime Teevan, Ruth Kikin-Gil, and Eric Horvitz. 2019. Guidelines for Human- AI Interaction. In Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems (Glasgow, Scotland Uk) (CHI '19). Association for Computing Machinery, New York, NY, USA, 1–13. https://doi.org/10.1145/3290605.3300233 [5] M. Arnold, R. K. E. Bellamy, M. Hind, S. Houde, S. Mehta, A. Mojsilović, R. Nair, K. Natesan Ramamurthy, A. Olteanu, D. Piorkowski, D. Reimer, J. Richards, J. Tsay, and K. R. Varshney. 2019. FactSheets: Increasing trust in AI services through supplier's declarations of conformity. IBM Journal of Research and Development 63, 4/5 (2019), 6:1–6:13. https://doi.org/10.1147/JRD.2019.2942288 [6] Joshua Attenberg, Panos Ipeirotis, and Foster Provost. 2015. Beat the Machine: Challenging Humans to Find a Predictive Model's "Unknown Unknowns". J. Data and Information Quality 6, 1, Article 1 (mar 2015), 17 pages. https://doi. org/10.1145/2700832 [7] Solon Barocas, Anhong Guo, Ece Kamar, Jacquelyn Krones, Meredith Ringel Mor- ris, Jennifer Wortman Vaughan, W. Duncan Wadsworth, and Hanna Wallach. 2021. Designing Disaggregated Evaluations of AI Systems: Choices, Considerations, and Tradeoffs. In Proceedings of the 2021 AAAI/ACM Conference on AI, Ethics, and Society (Virtual Event, USA) (AIES '21). Association for Computing Machinery, New York, NY, USA, 368–378. https://doi.org/10.1145/3461702.3462610 [8] Alex Bäuerle, Ángel Alexander Cabrera, Fred Hohman, Megan Maher, David Koski, Xavier Suau, Titus Barik, and Dominik Moritz. 2022. Symphony: Com- posing Interactive Interfaces for Machine Learning. In Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems (New Orleans, LA, USA) (CHI '22). Association for Computing Machinery, New York, NY, USA, Article 210, 14 pages. https://doi.org/10.1145/3491102.3502102 [9] Andrew Begel, John Tang, Sean Andrist, Michael Barnett, Tony Carbary, Piali Choudhury, Edward Cutrell, Alberto Fung, Sasa Junuzovic, Daniel McDuff, Kael Rowan, Shibashankar Sahoo, Jennifer Frances Waldern, Jessica Wolk, Hui Zheng, and Annuska Zolyomi. 2020. Lessons Learned in Designing AI for Autistic Adults. In The 22nd International ACM SIGACCESS Conference on Computers and fAIlureNotes: Supporting Designers in Understanding the Limits of AI Models for Computer Vision Tasks CHI '23, April 23–28, 2023, Hamburg, Germany Accessibility (Virtual Event, Greece) (ASSETS '20). Association for Computing Machinery, New York, NY, USA, Article 46, 6 pages. https://doi.org/10.1145/ 3373625.3418305 [10] Melanie Birks, Ysanne Chapman, and Karen Francis. 2008. Memoing in Journal of Research in https://doi.org/10.1177/1744987107081254 qualitative research: Probing data and processes. Nursing 13, 1 (2008), 68–75. arXiv:https://doi.org/10.1177/1744987107081254 [11] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language Models are Few-Shot Learners. CoRR abs/2005.14165 (2020). arXiv:2005.14165 https://arxiv.org/abs/2005.14165 [12] Jacob T. Browne. 2019. Wizard of Oz Prototyping for Machine Learning Experi- ences. In Extended Abstracts of the 2019 CHI Conference on Human Factors in Com- puting Systems (Glasgow, Scotland Uk) (CHI EA '19). Association for Computing Machinery, New York, NY, USA, 1–6. https://doi.org/10.1145/3290607.3312877 [13] Joy Buolamwini and Timnit Gebru. 2018. Gender Shades: Intersectional Accu- racy Disparities in Commercial Gender Classification. In Proceedings of the 1st Conference on Fairness, Accountability and Transparency (Proceedings of Machine Learning Research, Vol. 81), Sorelle A. Friedler and Christo Wilson (Eds.). PMLR, 77–91. https://proceedings.mlr.press/v81/buolamwini18a.html [14] Daniel Buschek, Lukas Mecke, Florian Lehmann, and Hai Dang. 2021. Nine Potential Pitfalls when Designing Human-AI Co-Creative Systems. CoRR abs/2104.00358 (2021). arXiv:2104.00358 https://arxiv.org/abs/2104.00358 [15] Ángel Alexander Cabrera, Abraham J. Druck, Jason I. Hong, and Adam Perer. 2021. Discovering and Validating AI Errors With Crowdsourced Failure Reports. Proc. ACM Hum.-Comput. Interact. 5, CSCW2, Article 425 (oct 2021), 22 pages. https://doi.org/10.1145/3479569 [16] Ángel Alexander Cabrera, Marco Tulio Ribeiro, Bongshin Lee, Rob DeLine, Adam Perer, and Steven M. Drucker. 2022. What Did My AI Learn? How Data Scientists Make Sense of Model Behavior. ACM Trans. Comput.-Hum. Interact. (may 2022). https://doi.org/10.1145/3542921 Just Accepted. [17] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. 2020. End-to-End Object Detection with Trans- formers. CoRR abs/2005.12872 (2020). arXiv:2005.12872 https://arxiv.org/abs/ 2005.12872 [18] Dylan Cashman, Shenyu Xu, Subhajit Das, Florian Heimerl, Cong Liu, Shah Humayoun, Michael Gleicher, Alex Endert, and Remco Chang. 2020. CAVA: A Visual Analytics System for Exploratory Columnar Data Augmentation Using Knowledge Graphs. IEEE Transactions on Visualization and Computer Graphics PP (10 2020), 1–1. https://doi.org/10.1109/TVCG.2020.3030443 [19] Justin Cranshaw, Emad Elwany, Todd Newman, Rafal Kocielnik, Bowen Yu, Sandeep Soni, Jaime Teevan, and Andrés Monroy-Hernández. 2017. Calen- dar.Help: Designing a Workflow-Based Scheduling Agent with Humans in the Loop. In Proceedings of the 2017 CHI Conference on Human Factors in Computing Systems (Denver, Colorado, USA) (CHI '17). Association for Computing Machin- ery, New York, NY, USA, 2382–2393. https://doi.org/10.1145/3025453.3025780 [20] Anamaria Crisan, Margaret Drouhard, Jesse Vig, and Nazneen Rajani. 2022. Interactive Model Cards: A Human-Centered Approach to Model Documentation. In 2022 ACM Conference on Fairness, Accountability, and Transparency (Seoul, Republic of Korea) (FAccT '22). Association for Computing Machinery, New York, NY, USA, 427–439. https://doi.org/10.1145/3531146.3533108 [21] Norman K Denzin and Yvonna S Lincoln. 2011. The Sage handbook of qualitative research. sage. [22] Django. 2005. The web framework for perfectionists with deadlines. https: //www.djangoproject.com/ [23] Graham Dove, Kim Halskov, Jodi Forlizzi, and John Zimmerman. 2017. UX Design Innovation: Challenges for Working with Machine Learning as a Design Material. In Proceedings of the 2017 CHI Conference on Human Factors in Computing Systems (Denver, Colorado, USA) (CHI '17). Association for Computing Machinery, New York, NY, USA, 278–288. https://doi.org/10.1145/3025453.3025739 [24] Sabri Eyuboglu, Maya Varma, Khaled Saab, Jean-Benoit Delbrouck, Christopher Lee-Messer, Jared Dunnmon, James Zou, and Christopher Ré. 2022. Domino: Discovering Systematic Errors with Cross-Modal Embeddings. https://doi.org/ 10.48550/ARXIV.2203.14960 [25] Fabric.js. 2010. A powerful and simple Javascript HTML5 canvas library. http: //fabricjs.com/ [26] Alvaro Figueira and Bruno Vaz. 2022. Survey on Synthetic Data Generation, Evaluation Methods and GANs. Mathematics 10, 15 (2022). https://doi.org/10. 3390/math10152733 [27] Timnit Gebru, Jamie Morgenstern, Briana Vecchione, Jennifer Wortman Vaughan, Hanna Wallach, Hal Daumé III, and Kate Crawford. 2021. Datasheets for Datasets. Commun. ACM 64, 12 (nov 2021), 86–92. https://doi.org/10.1145/3458723 [28] Ross Girshick. 2015. Fast R-CNN. In Proceedings of the 2015 IEEE International Conference on Computer Vision (ICCV) (ICCV '15). IEEE Computer Society, USA, 1440–1448. https://doi.org/10.1109/ICCV.2015.169 [29] Ross B. Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. 2013. Rich feature hierarchies for accurate object detection and semantic segmentation. CoRR abs/1311.2524 (2013). arXiv:1311.2524 http://arxiv.org/abs/1311.2524 [30] Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde- Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. 2014. Generative Adversarial Networks. https://doi.org/10.48550/ARXIV.1406.2661 [31] Google. 2019. IBM Design for AI: Conversation planning. https://www.ibm. com/design/ai/conversation [32] Google. 2019. People + AI Guidebook. https://pair.withgoogle.com/ [33] Thilo Hagendorff. 2020. The Ethics of AI Ethics: An Evaluation of Guidelines. Minds Mach. 30, 1 (mar 2020), 99–120. https://doi.org/10.1007/s11023-020-09517- 8 [34] Andreas Holzinger, Michaela Kargl, Bettina Kipperer, Peter Regitnig, Markus Plass, and Heimo Müller. 2022. Personas for Artificial Intelligence (AI) an Open Source Toolbox. IEEE Access 10 (2022), 23732–23747. https://doi.org/10.1109/ ACCESS.2022.3154776 [35] Matthew K. Hong, Adam Fourney, Derek DeBellis, and Saleema Amershi. 2021. Planning for Natural Language Failures with the AI Playbook. In Proceedings of the 2021 CHI Conference on Human Factors in Computing Systems (Yokohama, Japan) (CHI '21). Association for Computing Machinery, New York, NY, USA, Article 386, 11 pages. https://doi.org/10.1145/3411764.3445735 [36] Eric Horvitz. 1999. Principles of Mixed-Initiative User Interfaces. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems (Pittsburgh, Pennsylvania, USA) (CHI '99). Association for Computing Machinery, New York, NY, USA, 159–166. https://doi.org/10.1145/302979.303030 [37] Sandy H. Huang, Nicolas Papernot, Ian J. Goodfellow, Yan Duan, and Pieter CoRR Abbeel. 2017. Adversarial Attacks on Neural Network Policies. abs/1702.02284 (2017). arXiv:1702.02284 http://arxiv.org/abs/1702.02284 [38] HuggingFace. 2022. The AI Community Building the Future. https://huggingface. co [39] HuggingFace. 2022. DETR (End-to-End Object Detection) model with ResNet-50 backbone. https://huggingface.co/facebook/detr-resnet-50 [40] Apple Inc. 2019. Designing the UI and User Experience of a Machine Learning App. https://developer.apple.com/design/human-interface-guidelines/machine- learning/overview/introduction/ [41] Anniek Jansen and Sara Colombo. 2022. Wizard of Errors: Introducing and Evaluating Machine Learning Errors in Wizard of Oz Studies. In CHI Conference on Human Factors in Computing Systems Extended Abstracts (New Orleans, LA, USA) (CHI EA '22). Association for Computing Machinery, New York, NY, USA, Article 426, 7 pages. https://doi.org/10.1145/3491101.3519684 [42] Anna Jobin, Marcello Ienca, and Effy Vayena. 2019. The global landscape of AI ethics guidelines. Nature Machine Intelligence 1, 9 (2019), 389–399. [43] Tero Karras, Samuli Laine, and Timo Aila. 2018. A Style-Based Generator Ar- chitecture for Generative Adversarial Networks. CoRR abs/1812.04948 (2018). arXiv:1812.04948 http://arxiv.org/abs/1812.04948 [44] Claire Kayacik, Sherol Chen, Signe Noerly, Jess Holbrook, Adam Roberts, and Douglas Eck. 2019. Identifying the Intersections: User Experience + Research Scientist Collaboration in a Generative Machine Learning Interface. In Extended Abstracts of the 2019 CHI Conference on Human Factors in Computing Systems (Glasgow, Scotland Uk) (CHI EA '19). Association for Computing Machinery, New York, NY, USA, 1–8. https://doi.org/10.1145/3290607.3299059 [45] Douwe Kiela, Max Bartolo, Yixin Nie, Divyansh Kaushik, Atticus Geiger, Zhengx- uan Wu, Bertie Vidgen, Grusha Prasad, Amanpreet Singh, Pratik Ringshia, Zhiyi Ma, Tristan Thrush, Sebastian Riedel, Zeerak Waseem, Pontus Stenetorp, Robin Jia, Mohit Bansal, Christopher Potts, and Adina Williams. 2021. Dynabench: Rethinking Benchmarking in NLP. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Hu- man Language Technologies. Association for Computational Linguistics, Online, 4110–4124. https://doi.org/10.18653/v1/2021.naacl-main.324 [46] Scott R. Klemmer, Anoop K. Sinha, Jack Chen, James A. Landay, Nadeem Aboobaker, and Annie Wang. 2000. Suede: A Wizard of Oz Prototyping Tool for Speech User Interfaces. In Proceedings of the 13th Annual ACM Sympo- sium on User Interface Software and Technology (San Diego, California, USA) (UIST '00). Association for Computing Machinery, New York, NY, USA, 1–10. https://doi.org/10.1145/354401.354406 [47] Allison Koenecke, Andrew Nam, Emily Lake, Joe Nudell, Minnie Quartey, Zion Mengesha, Connor Toups, John R. Rickford, Dan Jurafsky, and Sharad Goel. 2020. Racial disparities in automated speech recognition. Proceedings of the National Academy of Sciences 117, 14 (2020), 7684–7689. https://doi.org/10.1073/pnas. 1915768117 arXiv:https://www.pnas.org/doi/pdf/10.1073/pnas.1915768117 [48] Percy Liang, Rishi Bommasani, Tony Lee, Dimitris Tsipras, Dilara Soylu, Michi- hiro Yasunaga, Yian Zhang, Deepak Narayanan, Yuhuai Wu, Ananya Kumar, Benjamin Newman, Binhang Yuan, Bobby Yan, Ce Zhang, Christian Cosgrove, Christopher D. Manning, Christopher Ré, Diana Acosta-Navas, Drew A. Hudson, Eric Zelikman, Esin Durmus, Faisal Ladhak, Frieda Rong, Hongyu Ren, Huaxiu Yao, Jue Wang, Keshav Santhanam, Laurel Orr, Lucia Zheng, Mert Yuksekgonul, Mirac Suzgun, Nathan Kim, Neel Guha, Niladri Chatterji, Omar Khattab, Peter CHI '23, April 23–28, 2023, Hamburg, Germany Moore et al. Henderson, Qian Huang, Ryan Chi, Sang Michael Xie, Shibani Santurkar, Surya Ganguli, Tatsunori Hashimoto, Thomas Icard, Tianyi Zhang, Vishrav Chaudhary, William Wang, Xuechen Li, Yifan Mai, Yuhui Zhang, and Yuta Koreeda. 2022. Holistic Evaluation of Language Models. https://doi.org/10.48550/ARXIV.2211. 09110 [49] Tsung-Yi Lin, Priya Goyal, Ross B. Girshick, Kaiming He, and Piotr Dollár. 2017. Focal Loss for Dense Object Detection. CoRR abs/1708.02002 (2017). arXiv:1708.02002 http://arxiv.org/abs/1708.02002 [50] Anthony Liu, Santiago Guerra, Isaac Fung, Gabriel Matute, Ece Kamar, and Walter Lasecki. 2020. Towards Hybrid Human-AI Workflows for Unknown Unknown Detection. In Proceedings of The Web Conference 2020 (Taipei, Taiwan) (WWW '20). Association for Computing Machinery, New York, NY, USA, 2432–2442. https://doi.org/10.1145/3366423.3380306 [51] Michael A. Madaio, Luke Stark, Jennifer Wortman Vaughan, and Hanna Wallach. 2020. Co-Designing Checklists to Understand Organizational Challenges and Opportunities around Fairness in AI. In Proceedings of the 2020 CHI Conference on Human Factors in Computing Systems (Honolulu, HI, USA) (CHI '20). Association for Computing Machinery, New York, NY, USA, 1–14. https://doi.org/10.1145/ 3313831.3376445 [52] Sean McGregor. 2020. Preventing Repeated Real World AI Failures by Cataloging Incidents: The AI Incident Database. https://doi.org/10.48550/ARXIV.2011.08512 [53] Margaret Mitchell, Simone Wu, Andrew Zaldivar, Parker Barnes, Lucy Vasserman, Ben Hutchinson, Elena Spitzer, Inioluwa Deborah Raji, and Timnit Gebru. 2019. Model Cards for Model Reporting. In Proceedings of the Conference on Fairness, Accountability, and Transparency (Atlanta, GA, USA) (FAT* '19). Association for Computing Machinery, New York, NY, USA, 220–229. https://doi.org/10.1145/ 3287560.3287596 [54] Donald Norman. 1981. Categorization of Action Slips. Psychological Review 88 (01 1981), 1–15. https://doi.org/10.1037//0033-295X.88.1.1 [55] Donald A. Norman. 1980. Errors in Human Performance. [56] NumPy. 1995. The fundamental package for scientific computing with Python. https://numpy.org/ [57] Besmira Nushi, Ece Kamar, and Eric Horvitz. 2018. Towards Accountable AI: Hybrid Human-Machine Analyses for Characterizing System Failure. CoRR abs/1809.07424 (2018). arXiv:1809.07424 http://arxiv.org/abs/1809.07424 [58] Luke Oakden-Rayner, Jared Dunnmon, Gustavo Carneiro, and Christopher Re. 2020. Hidden Stratification Causes Clinically Meaningful Failures in Machine Learning for Medical Imaging. In Proceedings of the ACM Conference on Health, Inference, and Learning (Toronto, Ontario, Canada) (CHIL '20). Association for Computing Machinery, New York, NY, USA, 151–159. https://doi.org/10.1145/ 3368555.3384468 [59] Ziad Obermeyer, Brian Powers, Christine Vogeli, and Sendhil Mullainathan. 2019. Dissecting racial bias in an algorithm used to manage the health of popula- tions. Science 366, 6464 (2019), 447–453. https://doi.org/10.1126/science.aax2342 arXiv:https://www.science.org/doi/pdf/10.1126/science.aax2342 [60] Neoklis Polyzotis, Steven Whang, Tim Klas Kraska, and Yeounoh Chung. 2019. Slice Finder: Automated Data Slicing for Model Validation. In Proceedings of the IEEE Int' Conf. on Data Engineering (ICDE), 2019. https://arxiv.org/pdf/1807.06068. pdf [61] PyTorch. 2016. From research to production. https://pytorch.org/ [62] Jens Rasmussen. 1982. Human errors. A taxonomy for describing human mal- function in industrial installations. Journal of Occupational Accidents 4, 2 (1982), 311–333. https://doi.org/10.1016/0376-6349(82)90041-4 [63] Alexander Ratner, Stephen H. Bach, Henry Ehrenberg, Jason Fries, Sen Wu, and Christopher Ré . 2017. Snorkel. Proceedings of the VLDB Endowment 11, 3 (nov 2017), 269–282. https://doi.org/10.14778/3157794.3157797 [64] J.T. Reason. 2016. The Human Contribution: Unsafe Acts, Accidents and Heroic Recoveries. London: Routledge. [65] Joseph Redmon, Santosh Kumar Divvala, Ross B. Girshick, and Ali Farhadi. 2015. You Only Look Once: Unified, Real-Time Object Detection. CoRR abs/1506.02640 (2015). arXiv:1506.02640 http://arxiv.org/abs/1506.02640 [66] Shaoqing Ren, Kaiming He, Ross B. Girshick, and Jian Sun. 2015. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. CoRR abs/1506.01497 (2015). arXiv:1506.01497 http://arxiv.org/abs/1506.01497 [67] Replicate. 2021. Simple image captioning model using CLIP and GPT-2. https: //replicate.com/rmokady/clip_prefix_caption [68] Replicate. 2022. Stable diffusion. https://replicate.com/stability-ai/stable- diffusion [69] Hamid Rezatofighi, Nathan Tsoi, JunYoung Gwak, Amir Sadeghian, Ian Reid, and Silvio Savarese. 2019. Generalized Intersection Over Union: A Metric and a Loss for Bounding Box Regression. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). [70] Martin Schrepp, Andreas Hinderks, and Jörg Thomaschewski. 2017. Design and Evaluation of a Short Version of the User Experience Questionnaire (UEQ-S). International Journal of Interactive Multimedia and Artificial Intelligence 4 (01 2017), 103. https://doi.org/10.9781/ijimai.2017.09.001 [71] SciPy. 2016. An open-source software for mathematics, science, and engineer- ing. https://docs.scipy.org/doc/scipy-0.18.1/reference/generated/scipy.optimize. linear_sum_assignment.html [72] SerpApi. 2022. Google Search API. https://serpapi.com/ [73] Scott Shappell and Douglas Wiegmann. 2000. The Human Factors Analysis and Classification System-HFACS. (01 2000). [74] Soheila Sheikh Bahaei and Barbara Gallina. 2019. Augmented Reality-extended Humans: Towards a Taxonomy of Failures – Focus on Visual Technologies. https://doi.org/10.3850/978-981-11-2724-3_0922-cd [75] Neville A. Stanton and Paul M. Salmon. 2009. Human error taxonomies applied to driving: A generic driver error taxonomy and its implications for intelligent transport systems. Safety Science 47, 2 (2009), 227–237. https://doi.org/10.1016/j. ssci.2008.03.006 [76] Susan Leigh Star. 1989. The structure of ill-structured solutions: Boundary objects and heterogeneous distributed problem solving. In Distributed artificial intelligence. Elsevier, 37–54. [77] Russell Stewart and Mykhaylo Andriluka. 2015. End-to-end people detection in crowded scenes. CoRR abs/1506.04878 (2015). arXiv:1506.04878 http://arxiv.org/ abs/1506.04878 [78] Hariharan Subramonyam, Jane Im, Colleen Seifert, and Eytan Adar. 2022. Solving Separation-of-Concerns Problems in Collaborative Design of Human-AI Systems through Leaky Abstractions. In Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems (New Orleans, LA, USA) (CHI '22). Association for Computing Machinery, New York, NY, USA, Article 481, 21 pages. https: //doi.org/10.1145/3491102.3517537 [79] Hariharan Subramonyam, Colleen Seifert, and Eytan Adar. 2021. ProtoAI: Model- Informed Prototyping for AI-Powered Interfaces. In 26th International Conference on Intelligent User Interfaces (College Station, TX, USA) (IUI '21). Association for Computing Machinery, New York, NY, USA, 48–58. https://doi.org/10.1145/ 3397481.3450640 [80] Hariharan Subramonyam, Colleen Seifert, and Eytan Adar. 2021. Towards a process model for co-creating AI experiences. In Designing Interactive Systems Conference 2021. 1529–1543. [81] James Wexler, Mahima Pushkarna, Tolga Bolukbasi, Martin Wattenberg, Fernanda Viégas, and Jimbo Wilson. 2020. The What-If Tool: Interactive Probing of Machine Learning Models. IEEE Transactions on Visualization and Computer Graphics 26, 1 (2020), 56–65. https://doi.org/10.1109/TVCG.2019.2934619 [82] Maximiliane Windl, Sebastian S. Feger, Lara Zijlstra, Albrecht Schmidt, and Pawel W. Wozniak. 2022. 'It Is Not Always Discovery Time': Four Pragmatic Approaches in Designing AI Systems. In Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems (New Orleans, LA, USA) (CHI '22). Association for Computing Machinery, New York, NY, USA, Article 50, 12 pages. https://doi.org/10.1145/3491102.3501943 [83] WordsAPI. 2015. An API for the English language. https://www.wordsapi.com/ [84] Tongshuang Wu, Marco Tulio Ribeiro, Jeffrey Heer, and Daniel Weld. 2019. Errudite: Scalable, Reproducible, and Testable Error Analysis. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. Association for Computational Linguistics, Florence, Italy, 747–763. https: //doi.org/10.18653/v1/P19-1073 [85] Pulei Xiong, Scott Buffett, Shahrear Iqbal, Philippe Lamontagne, Mohammad Saiful Islam Mamun, and Heather Molyneaux. 2021. Towards a Robust and Trustworthy Machine Learning System Development. CoRR abs/2101.03042 (2021). arXiv:2101.03042 https://arxiv.org/abs/2101.03042 [86] Qian Yang, Alex Scuito, John Zimmerman, Jodi Forlizzi, and Aaron Steinfeld. 2018. Investigating How Experienced UX Designers Effectively Work with Machine Learning. In Proceedings of the 2018 Designing Interactive Systems Conference (Hong Kong, China) (DIS '18). Association for Computing Machinery, New York, NY, USA, 585–596. https://doi.org/10.1145/3196709.3196730 [87] Qian Yang, Aaron Steinfeld, Carolyn Rosé, and John Zimmerman. 2020. Re- Examining Whether, Why, and How Human-AI Interaction Is Uniquely Difficult to Design. In Proceedings of the 2020 CHI Conference on Human Factors in Comput- ing Systems (Honolulu, HI, USA) (CHI '20). Association for Computing Machinery, New York, NY, USA, 1–13. https://doi.org/10.1145/3313831.3376301 [88] Suorong Yang, Weikang Xiao, Mengcheng Zhang, Suhan Guo, Jian Zhao, and Image Data Augmentation for Deep Learning: A Survey. Furao Shen. 2022. https://doi.org/10.48550/ARXIV.2204.08610 [89] Nur Yildirim, Alex Kass, Teresa Tung, Connor Upton, Donnacha Costello, Robert Giusti, Sinem Lacin, Sara Lovic, James M O'Neill, Rudi O'Reilly Meehan, Eoin Ó Loideáin, Azzurra Pini, Medb Corcoran, Jeremiah Hayes, Diarmuid J Cahalane, Gaurav Shivhare, Luigi Castoro, Giovanni Caruso, Changhoon Oh, James Mc- Cann, Jodi Forlizzi, and John Zimmerman. 2022. How Experienced Designers of Enterprise Applications Engage AI as a Design Material. In Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems (New Orleans, LA, USA) (CHI '22). Association for Computing Machinery, New York, NY, USA, Article 483, 13 pages. https://doi.org/10.1145/3491102.3517491 fAIlureNotes: Supporting Designers in Understanding the Limits of AI Models for Computer Vision Tasks CHI '23, April 23–28, 2023, Hamburg, Germany A APPENDIX A.1 Technical Details Here we outline the technical details of fAIlureNotes's failure en- gine which is inspired by the DETR loss [17]. Figure 8 illustrates the matching problem. Each image has M annotated objects and N predicted objects. In our example, the user expected the AI model to detect three objects (a man, a backpack, and a bicycle). However, the AI model predicted four objects (a person, another person, a backpack, and a bicycle). The goal is to match the annotations and model predictions based on a match- ing cost. More formally, let us denote y for the annotated set of objects and ˆy for the predicted set of objects. To find a matching between these two sets (annotations & predictions) we search for a permutation σ ∈ Σ with the lowest costs: ˆσ = arg min σ ∈Σ N ∑︁ i Lmatch (yi, ˆyσ (i)) The optimal assignment is essentially a MxN matrix where each match is indicated with "1". It is calculated with the Hungarian algorithm [77]. The algorithm takes a matching cost as an input and returns the optimal assignment between annotated and predicted objects. Formally, Lmatch is a pair-wise matching cost between ground truth yi and prediction ˆy with index σ (i). It returns the optimal assignment ˆσ between the annotated and predicted objects. Each object consists of a class label and a bounding box. For instance, each annotation can be seen as yi = (ci, bi ) where ci is the class and bi ∈ R4 is a vector that defines the four points of a bounding box. The matching cost needs to take both the class labels and bounding boxes into account. We can provide two examples to illustrate this point. The AI model predicted two "person", one on the bicycle and another in the background. By reviewing the user's expectations and model prediction we can see that the "person" on the bicycle (and not in the background) should be matched to the annotated "man". Alternatively, we can imagine a scenario where the user's bounding boxes do not overlap strongly with the model prediction but he or she still meant the same object. Formally, we can define the matching cost as: Lmatch = γclass ∗ Lclass (ci, ˆcσ (i) ) + γbox ∗ Lbox (bi, ˆbσ (i) ) The matching cost consists of a class loss and a bouding box loss weighted by two hyperparameters. We set both hyperparameters γclass and γbox to 0.5. The class loss compares the class labels of all annotations and predictions. We would like the cost to be low if the classes match (i.e, backpack, bicycle) and high in case they are different. We defined the class loss as: Lclass (ci, ˆcσ (i ) ) = (cid:40) 0 1 ci = ˆcσ (i) else In other words, the cost is set to zero if the class labels of the annotation and prediction match and one otherwise. In order to assess whether two objects are matching we would also like to take the bounding boxes into consideration. The bounding box loss is a linear combination of the l1 loss and the generalized IoU loss [69]. Lbox (bi, ˆbσ (i) ) = λl1 ∗ ∥bi − ˆbσ (i) ∥ + λiou ∗ Liou where λl1 and λiou are hyperparameters (we set both to 0.5 again). The l1 loss calculates the absolute distance between each point of the bounding box. The generalized IoU loss helps to make the loss scale invariant. Once the Hungarian algorithm returns the optimal assignment we can use simple heuristics to classify different failure modes. Figure 8: fAIlureNotes's Failure Engine: A matching algorithm finds an optimal assignment between M annotations and N predictions. {}M annotationsannotations111predictions{}N predictionsOptimal AssignmentHeuristicsUser ExpectationModel PredictionFailure Engine
http://arxiv.org/abs/2302.11700v2
2023-06-30T18:26:03
2023-02-22T23:35:50
Learning Revenue Maximizing Menus of Lotteries and Two-Part Tariffs
We advance a recently flourishing line of work at the intersection of learning theory and computational economics by studying the learnability of two classes of mechanisms prominent in economics, namely menus of lotteries and two-part tariffs. The former is a family of randomized mechanisms designed for selling multiple items, known to achieve revenue beyond deterministic mechanisms, while the latter is designed for selling multiple units (copies) of a single item with applications in real-world scenarios such as car or bike-sharing services. We focus on learning high-revenue mechanisms of this form from buyer valuation data in both distributional settings, where we have access to buyers' valuation samples up-front, and the more challenging and less-studied online settings, where buyers arrive one-at-a-time and no distributional assumption is made about their values. Our main contribution is proposing the first online learning algorithms for menus of lotteries and two-part tariffs with strong regret-bound guarantees. In the general case, we provide a reduction to a finite number of experts, and in the limited buyer type case, we show a reduction to online linear optimization, which allows us to obtain no-regret guarantees by presenting buyers with menus that correspond to a barycentric spanner. In addition, we provide algorithms with improved running times over prior work for the distributional settings. The key difficulty when deriving learning algorithms for these settings is that the relevant revenue functions have sharp transition boundaries. In stark contrast with the recent literature on learning such unstructured functions, we show that simple discretization-based techniques are sufficient for learning in these settings.
[ "Maria-Florina Balcan", "Hedyeh Beyhaghi" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11700v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11700v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.GT", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.GT", "cs.LG" ]
3 2 0 2 n u J 0 3 ] T G . s c [ 2 v 0 0 7 1 1 . 2 0 3 2 : v i X r a Learning Revenue Maximizing Menus of Lotteries and Two-Part Tariffs Maria-Florina Balcan Carnegie Mellon University Hedyeh Beyhaghi Carnegie Mellon University [email protected] [email protected] Abstract We advance a recently flourishing line of work at the intersection of learning theory and computational economics by studying the learnability of two classes of mechanisms prominent in economics, namely menus of lotteries and two-part tariffs. The former is a family of randomized mechanisms designed for selling multiple items, known to achieve revenue beyond deterministic mechanisms, while the latter is designed for sell- ing multiple units (copies) of a single item with applications in real-world scenarios such as car or bike-sharing services. We focus on learning high-revenue mechanisms of this form from buyer valuation data in both distributional settings, where we have access to buyers' valuation samples up-front, and the more challenging and less-studied online settings, where buyers arrive one-at-a-time and no distributional assumption is made about their values. Our main contribution is proposing the first online learning algorithms for menus of lotteries and two-part tariffs with strong regret-bound guarantees. In the general case, we provide a reduction to a finite number of experts, and in the limited buyer type case, we show a reduction to online linear optimization, which allows us to obtain no regret guarantees by presenting buyers with menus that correspond to a barycentric spanner. In addition, we provide algorithms with improved running times over prior work for the distributional settings. The key difficulty when deriving learning algorithms for these settings is that the relevant revenue functions have sharp transition boundaries. In stark contrast with the recent literature on learning such unstructured functions, we show that simple discretization-based techniques are sufficient for learning in these settings. 1 Introduction In recent years, a growing body of work has emerged in the field of machine learning for pricing and mechanism design problems. These problems involve selling items to buyers with the objective of maximizing revenue. The majority of the existing research has primarily concentrated on distributional settings, i.e., when the buyers' values for the items are drawn from an unknown distribution. Less attention has been paid to the more challenging case of online setting, where buyers arrive one-by-one and no distributional assumption about 1 In this case, the previous literature has mostly focused on buyers' values is considered. simple mechanisms such as posted pricing or, more generally, mechanisms that sell the items separately [Blum et al., 2004, Kleinberg and Leighton, 2003, Blum and Hartline, 2005, Balcan and Blum, 2006, Bubeck et al., 2017, Cesa-Bianchi et al., 2014, Balcan et al., 2018b, 2020a]. We advance this line of work by studying the learnability of two prominent classes of mechanisms, both represented as menus providing the buyers a list of allocation and payment options to choose from, namely menus of two-part tariffs and lotteries. These mechanisms go beyond selling the items separately, resulting in potentially higher revenue guarantees with applications to modern real-world scenarios. We provide the first online learning guarantees for these scenarios and improved guarantees for distributional learning. In the process, we discover the power of data-independent discretization for data-driven mechanism design and algorithm design more generally. The first class we study is menus of two-part tariffs [Lewis, 1941], used for selling multiple units (i.e., copies) of a single item. In this family of mechanisms, the buyer is presented with a list (menu) of two-part tariffs, where tariff i is a pair consisting of an up-front fee, p(i) 1 , and a per-unit fee, p(i) 1 units of tariff i, she pays in total p(i) 1 + kp(i) 2 , and if she does not want to buy anything, she does not pay anything. The buyer has the freedom to select any of the tariffs. In particular, the cost for purchasing k 1 units is the minimum cost among all the tariffs, i.e., mini(p(i) 2 ). Various products in the real world are sold via menus of two-part tariffs; for example, car or bike-sharing services and delivery service subscriptions. 2 . If the buyer wishes to buy k 1 + kp(i) ≥ ≥ The second class we study is the menus of lotteries for selling multiple items. In this con- text, the buyer is presented with a list (menu) of lotteries, where lottery i is defined as a pair consisting of a vector of probabilities for allocating each item, φ(i), and a price, p(i). If the buyer wishes to choose lottery i, she receives each item j with probability φ(i)[j] and pays p(i). Menus of lotteries are a crucial family of mechanisms because (1) this family captures all pos- sible mechanisms, including the optimal one [Dasgupta et al., 1979, Guesnerie and Oddou, 1981], and (2) menus of lotteries achieve revenue beyond other well-studied families of mecha- nisms such as posted pricing and, more generally, any deterministic mechanism [Briest et al., 2010, Hart and Nisan, 2019]. We study menus of two-part tariffs and lotteries in the context of parameter optimization, where the objective function (revenue) depends on parameter vectors. In menus of two-part tariffs, the parameters determining the mechanisms are the up-front fees and per-unit fees for each tariff, while for menus of lotteries, the allocation probability vectors and the prices for the lotteries determine the mechanism. In the parameter space, each point corresponds to a mechanism. A common approach in learning algorithms involves considering the objective function for a fixed buyer's valuation [Balcan et al., 2017, 2018c,b]. In our context, the mechanism designer faces a utility-maximizing buyer, who, given the parameters determining the menu, chooses the entry, i.e., a lottery or a two-part tariff, in the menu that maximizes her utility. Therefore, the revenue function at any parameter vector is equal to the payment corresponding to the entry selected by the buyer. 2 1.1 Our Contributions We study the learnability of menus of two-part tariffs and lotteries in both online and dis- tributional settings. We advance the state-of-the-art in several aspects. Technical challenges. Discretization is a natural technique in data-driven algorithm de- sign. In this approach, a finite set of parameter vectors, each representing a menu in the parameter space, are selected, and the algorithms optimize over that set. The smaller the set, the better the generalization guarantees will be in the distributional setting, and the better the regret guarantees will be in the online setting, with respect to the best menu in the set. In our setting, a proper data-independent discretization scheme would guarantee that independent of the buyer's valuation, this set always contains a nearly optimal menu. More specifically, for any arbitrary parameter vector representing a menu, a menu in the set should generate almost as much revenue, independent of the buyer's valuation. However, due to sharp discontinuities of revenue in the parameter space, devising such a discretization can be challenging. For instance, consider a menu with two high-utility entries for a buyer such that these entries have similar utility for the buyer but very different prices (e.g., one with high allocation and high price, the other with low allocation and low price). Minor changes in the parameters of these entries; e.g., rounding the parameters down to multiples of ǫ, may alter their utility order, causing the buyer to switch between them, resulting in arbitrary loss in revenue. Structural Properties and a Revenue Preserving Cover. By extracting structural properties for menus of two-part tariffs, we develop a novel discretization method that identifies a finite set of menus that approximate the revenue of any arbitrary limited-length menu (Theorem 1). In menus of lotteries, we extend the discretization of menus of lotteries developed by [Dughmi et al., 2014] (Theorem 16). Our extension is three-fold: we remove the lower bound assumption on value distribution, support additive valuations, and provide improved regret bounds and running times when the size of the menu is limited. In both settings (two-part tariffs lotteries), our discretization is data-independent; e.g., the set of discretized menus consists of all menus with parameters that are multiples of ε or powers ε). The novelty of the result, however, lies in the analysis, which illustrates despite of (1 the challenges discussed above, for each arbitrary menu and valuation, this set contains a corresponding approximately revenue-preserving menu. For finding corresponding menus, rounding is nontrivial in the sense that entries with higher prices need to experience a larger decrease in price and a smaller decrease in allocation so that no buyer switches from a high-price to a low-price entry. − Online Learning (adversarial inputs and smooth distributional assumptions). For menus of two-part tariffs, we provide the first no-regret online learning algorithms under adversarial inputs and also smooth distributional assumptions. For the full informa- tion setting, both settings lead to similar regret terms; however, the comparison of their running time depends on the support of the distribution and the maximum number of units available (Theorems 2 and 5). In the bandit setting, again, the regret of both settings are similar. However, the comparison between the efficiencies of the algorithms depends on the 3 smoothness factor of the distributions (Theorems 3 and 6). Furthermore, we provide the first no-regret algorithm for a semibandit-setting (Theorem 7) with a polynomial running time in the number of discontinuities in the parameter space. This setting lies between the full-information and bandit settings, and the learner observes the revenue function for a set of menus containing the menu used. For menus of lotteries, we provide the first no-regret online learning algorithms under adversarial inputs (Theorems 17 to 19). In addition, we provide evidence that menus of lotteries may not satisfy dispersion-a sufficient condition to provide a no-regret algorithm under smooth distributional assumption-without assum- ing extra structures about the optimal solution (Theorem 58). Menus of lotteries are the first family of mechanisms for which there is evidence of a potential failure of the dispersion property. Distributional Learning. We also provide novel distributional learning algorithms for menus of two-part tariffs and lotteries. Our algorithms choose several menus in a data- independent way (via data-independent discretization) and then select the best of them based on the data. In the context of two-part tariffs, our algorithm is much simpler than prior ones for the same problem, yet it enjoys improved worst-case runtime guarantees com- pared to them [Balcan et al., 2018c, 2020b] when the length of the menu is more than one (Theorem 15). We note that for other data-driven algorithm design problems, such as data- driven clustering and data-driven learning to branch, it was proven that algorithms that use data-independent discretization could perform very poorly [Balcan et al., 2017, 2018a]. Thus, by contrast, our work shows the power of data-independent discretization for data- driven mechanism design and algorithm design more generally. In the context of lotteries, compared to the previous distributional learning results for fixed-length menus [Balcan et al., 2018c], our algorithm requires similar sample complexity; however, it has an efficient imple- mentation (Theorems 22 and 56). Limited Buyer Types. For limited buyer types, we provide improved regret bounds for both the full-information and partial-information (bandit) settings for both menus of two-part tariffs and lotteries (Theorems 13, 14, 20 and 21). The high-level idea is as follows. Consider the revenue function in the parameter space for a fixed buyer. The parameter space is partitioned into regions where, within each region, the buyer selects the same option in the menu, e.g., the same lottery, resulting in a continuous revenue function. Discontinuity occurs across regions. For limited-type buyers, by superimposing the revenue functions for all types, the parameter space divides into more (albeit still a limited number of) regions. Regardless of the buyer type at hand, the revenue function is continuous within each region, and in our case, linear. Therefore, it is sufficient to only consider the corner points as potential parameter vectors that maximize the revenue. We show that in the full information case, running the weighted majority algorithm on the set of menus corresponding to the regions' corner points results in sublinear regret. In the partial information setting, in each round, we only observe the revenue of the current menu. To estimate the revenue from all the menus efficiently, or in other words, to find an unbiased estimator with a bounded range, we employ the notion of barycentric spanners in online learning introduced by Awerbuch and Kleinberg [2008]. By utilizing this 4 concept, we provide algorithms with a regret bound that is sublinear in the number of timesteps and polynomial in other parameters. This is the first time that barycentric spanner notion has been applied to an auction design setting. Similar contributions have been made in security games by [Balcan et al., 2015]. 1.2 Related Work In the distributional setting, various mechanism classes, Studying learnability of classes of mechanisms for the revenue maximization objective has been of great interest in recent years. These mechanisms have been studied mostly in a distributional setting, where buyers' values are drawn from an unknown distribution, and the online setting, where there is no distributional assumption on the buyers' values, has been explored less.∗ including posted-price mechanisms, second-price auctions with reserves, menus of two-part tariffs, and menus of lotteries, are known to be learnable [Morgenstern and Roughgarden, 2015, 2016, Balcan et al., 2016, 2018c, 2021a, Dughmi et al., 2014, Gonczarowski and Weinberg, 2021, Mohri and Medina, 2016, Syrgkanis, 2017, D ̈utting et al., 2019]. In the online setting, un- der adversarial input [Blum et al., 2004, Kleinberg and Leighton, 2003, Blum and Hartline, 2005, Balcan and Blum, 2006, Roughgarden and Wang, 2016, Bubeck et al., 2017], and also under stochastic input [Cesa-Bianchi et al., 2014, Balcan et al., 2018b, 2020a] mostly sim- ple mechanisms such as posted pricing and second-price auction are considered where both mechanisms sell the items separately. An exception is Roughgarden and Wang [2016] who study Vickrey-Clarke-Groves (VCG) mechanism with multiple reserves; however, the algo- rithms provided are not no-regret in the classic sense but are bounded-regret compared to a constant approximation of the optimal solution. Two of the prominent approaches used for developing distributional results are pseudo- dimension-based and discretization-based. In the first approach, despite the discontinuity present in the utility of buyers as a function of the parameters used in the mechanism, it is shown that the pseudo-dimension of the family is bounded by using smoothness assump- tions on the distribution. This approach applies to all the mechanisms mentioned above. In the discretization approach, a finite set of parameters are identified such that limiting the search space to this set is approximately optimal. This approach has been used for a lim- ited number of mechanisms, such as item-pricing for combinatorial auctions for unrestricted supply Balcan et al. [2008] and menus of lotteries in a limited setting [Dughmi et al., 2014]. In the online setting, Balcan et al. [2018b] and Balcan et al. [2020a] introduce dispersion as a sufficient condition for online learnability of families of mechanisms. They show several classes of mechanisms, such as posted-price mechanisms and second-price auctions with re- serves, satisfy dispersion and, therefore, establish strong regret bounds for online learning. Discretization-based techniques in online learning scenarios have been used for the simple cases of item-pricing [Blum et al., 2004] and the second-price auctions [Cesa-Bianchi et al., 2014]. ∗Some online learning algorithms, including those proved via the dispersion method, explained later, still make distributional assumptions; however, unlike the distributional learning setting, the draws are not necessarily from identical distributions. 5 Two-Part Tariffs. Two-part tariff pricing schemes were first introduced by Lewis [1941] and later analyzed by Oi [1971]. Menus of two-part tariffs have been studied recently in the context of distributional learning [Balcan et al., 2018c, 2020b, 2022a]. A recent work [Balcan et al., 2022a] provides improved running time bounds over [Balcan et al., 2020b] for distributional learning of two-part tariffs in the case where the number of pieces with continuous sum of utility functions u(xi, ) across all problem instances is small (as defined in Section 3.2.2 the utility function u(xi, .) measures the performance of our two-part tariff mechanisms on a fixed problem instance xi as a function of its parameters). However, for the case where the menu length is strictly greater than 1, [Balcan et al., 2022a] approach does not lead to improved running time over [Balcan et al., 2020b] for worst-case instances. So for worst-case instances and menu-length > 1, our approach for distributional learning improves over previously best known results. * Menus of Lotteries. Menus of lotteries capture all possible mechanisms, including the optimal one, for selling items to buyers. The Taxation Principle [Dasgupta et al., 1979, Guesnerie and Oddou, 1981] asserts that any mechanism for a single buyer can be repre- sented as a menu of lotteries, where the buyer selects their favorite lottery (that is, the one that maximizes the buyer's expected value for the randomized allocation minus the price paid). Furthermore, menus of lotteries achieve revenue beyond other well-studied families of mechanisms such as posted pricing and, more generally, any deterministic mechanism. For a correlated buyer (a buyer whose values for items are correlated), even in the simple cases where the buyer is additive (their value for a bundle of items is the sum of the value for individualized items) or unit-demand (their value for a bundle of items is the maximum value for an item in the bundle), the gap between optimal randomized mechanism (lotteries) and item-pricing is infinite [Briest et al., 2010, Hart and Nisan, 2019]. Daskalakis et al. [2014] show that even for an independent additive buyer (the values for the items are indepen- dent), lotteries (randomized mechanisms) are necessary and provide strictly more revenue compared to any deterministic mechanism, including pricing mechanisms. Failure of data-independent discretization-based learning. Discretization is a nat- ural approach for designing algorithms to tune parameters (e.g., prices for menus of two-part tariffs and allocation probabilities and prices for menus of lotteries) and is commonly used in applied fields such as applied machine learning. However, recent work has shown that in tuning parameters of algorithms for solving discrete combinatorial problems, discretiza- tion in the context of data-driven algorithm design does not always work if discretization is done in a data-independent way. For the case of tuning parameters for linkage-based algorithms, Balcan et al. [2017] showed that for several natural parameterized families of clustering procedures, for any data-independent discretization, there exists an infinite family of clustering instances such that any of the discrete parameters will output a clustering that is an Ω(n) factor worse than the optimal parameter, where n is the input size. Here, the quality of clustering can be defined according to several well-known objectives, including k- median, k-means, and k-center. Balcan et al. [2018a] show that for the data-driven problem of learning to branch for solving mixed integer linear programs (MILPs), data-independent discretization will not work either. More specifically, for any discretization of the parame- 6 ter space [0, 1], there exists an infinite family of distributions over MILP problem instances such that for any parameter in the discretization, the expected tree size is exponential in the input parameter. Yet, there exists an infinite number of parameters such that the tree size is just a constant (with probability 1). Remarkably, we show that in our context, even data-independent discretization works. Dispersion and Online Data-Driven Algorithm Design. Dispersion is a recently- developed notion for families of algorithmic and mechanism design problems and serves as a sufficient condition for the existence of bounded-regret online learning algorithms [Balcan et al., 2018b, 2020a] and differentially private distributional learning algorithms [Balcan et al., 2018b]. Generally speaking, this condition bounds the concentration of discontinuities of the objective function in any small regions in the parameter space. Dispersion-based techniques have been established successfully for a variety of algorithms [Balcan and Sharma, 2021, Balcan et al., 2021b, 2022b], among which is tuning parameters in combinatorial problems, such as clustering problems discussed above [Balcan et al., 2018b]. For menus of two-part tariffs, we show dispersion condition is satisfied, immediately implying no-regret online learn- ing algorithms and differentially-private algorithms for distributional learning. Surprisingly, we present evidence that dispersion might not apply to menus of lotteries. In particular, we show in menus of lotteries the objective function might have sharp discontinuities con- centrated in a small region. This structural property is in stark contrast with menus of two-part tariffs and other mechanism and algorithm families satisfying dispersion. Despite this evidence, we show that a simple discretization-based approach leads to no-regret online learning algorithms for menus of lotteries. Sample Complexity for Menus of Lotteries. The sample complexity for menus of lot- teries has been studied under two different assumptions: independence of valuation across items, as studied by Gonczarowski and Weinberg [2021] and correlated valuation across items, as studied by Dughmi et al. [2014]. By assuming independence simultaneously among the buyers and the items, a significant improvement over the sample complexity is possi- ble [Gonczarowski and Weinberg, 2021]. However, when the value for the items are possibly correlated, Dughmi et al. show a lower bound on the sample complexity verifying an ex- ponential gap on the dependence in the number of buyers compared to Gonczarowski and Weinberg. Similar to Dughmi et al. and in contrast with Gonczarowski and Weinberg, we do not assume independence across items and only assume independence among the buyers. 2 Model and Preliminaries We consider selling items to a single buyer for the revenue objective through parameterized families of mechanisms. In this paper the family of mechanisms is either the set of menus of two-part tariffs or lotteries. To put our notations in context, in this section we focus on menus of two-part tariffs as our running example. Menus of two-part tariffs are used for selling multiple units (i.e., copies) of a single item through a list of up-front and per-unit fee pairs that the buyer can choose from. Menu 7 2 2 ⊆ , . . . , 2 ∈ 1 , p(1) p(1) [0, H]. p(j) (cid:17) 1 , p(j) 1 , p(l) p(l) (cid:16) (cid:17)o 1 and p(j) R2l, is a length-l menu of two-part tariffs. Each menu M = 1 and p(j) M is parameterized by ρ which in this case is 2l-dimensional and contains all p(j) n(cid:16) 2 where all p(j) 2 are called the up-front fee (price) and per-unit fee (price) of tariff j, respectively. We denote a buyer's valuations for all 1, 2, . . . , K units by v = (v(1), . . . , v(K)), where the values are nonnegative, monotonically increasing, belong to [0, H], and v(0) = 0. Under the tariff j denoted by and the number of units 1 + kp(j) k 2 . The buyer's utility is her value for the number of units bought v(k) less the payment. Each buyer has the option of buying their utility-maximizing tariff and number of units. In other words, the buyer will buy k units using tariff j that maximizes v(k) 2 or does not buy and does not pay anything. that the buyer selects, she receives k units of the item and pays p(j) 1 , p(j) p(j) (cid:16) 1, . . . , K ∈ { − (cid:17) } 2 M M C ⊆ , such as a set of buyer valuations v, and let u : Π be an infinite set of mechanisms parameterized by a set Let is either the set of two-part tariff menus or lottery menus. Consider the case where M M is the set of two-part tariff menus for selling multiple units of a single item to a buyer with value v while the menu corresponds to parameter ρ . Next, let Π be a set of problem [0, H] be a utility instances for function where u(x, ρ) measures the performance of the mechanism with parameters ρ on Π. In our case, u(x, ρ) is the revenue of the mechanism (a menu of problem instance x two-part tariffs or lotteries) with parameters ρ on input x. For example, for the menus of is the set of possible menus M and since each menu is 2l-dimensional two-part tariffs, R2l. Π is the set of buyer valuations v and with each dimension in [0, H], [0, H] be a utility function where u(v, ρ) measures the revenue of the menu u : Π with parameters ρ on buyer valuations v = [0, H]2l × C → × C → ∈ C M Π. ⊆ ∈ C kp(j) p(j) 1 − Rd. In this paper, ∈ C → Online Setting In this setting, a sequence of functions u1, . . . , uT : [0, H] arrive one by one. Unlike u, ut only takes parameter ρt as the input and is defined as ut(ρt) := u(ρt, xt), where xt is the problem instance at timestep t. At the time t, the no-regret learning algorithm chooses a parameter vector ρt and then either observes the function ut in the full information setting, the scalar ut(ρt) in the bandit setting, or ut(ρt) for a set of ρ in the semibandit setting. The goal is to minimize the expected regret, E[maxρ − ut(ρt)]. We study the online setting both under adversarial input, where ut() are selected adversarially, and under smoothed distribution inputs which assume more structure. The expectation in the regret formula is taken over the randomness of the algorithm in the adversarial setting and over the randomness of the algorithm and distribution of buyers in the smoothed distributional setting. ut(ρ) P ∈C Distributional Setting In the distributional setting, the algorithm receives samples from over problem instances Π. The goal is to find a parameter vector an unknown distribution Ex ˆρ that nearly maximizes the expected utility, i.e., maxρ D[u(x, ρ)] similar to statistical ∼ learning theory [Vapnik, 1998] or PAC learning Valiant [1984]. D ∈C 8 3 Menus of Two-Part Tariffs 1 , p(l) p(l) In this section, we consider M = two-part tariffs. See Section 2 for a detailed description. (cid:16) 1 , p(1) p(1) , . . . , n(cid:16) (cid:17) 2 2 R2l as a length-l menu of ⊆ (cid:17)o 3.1 Discretization Procedure This section shows a discretization procedure for the menus of two-part tariffs. Given any menu and value 0 < α < 1, we provide an alternate menu such that all the price elements, p(i) 1 and p(i) for all i, are multiples of α and the alternate menu provides nearly as much revenue as the given menu up to a term that depends on α. The main result of this section is summarized in the following statement. 2 Theorem 1. Given a menu of two-part tariffs M and parameter 0 < α < 1, Algorithm 4 outputs menu M ′ whose revenue is at least the revenue of M less 2Kαl, for any buyer's valuation. Furthermore, for all i, all p(i) 1 and p(i) 2 are multiples of α. The set of potential menus, where H is the outcomes constitutes a space with at most min maximum value for any number of units. (H/α)2l, 2H 2/α2 } { Algorithm 1: (Almost) revenue preserving rounding for menus of two-part tariffs Input: Menu M, discretization parameter α. 1: Let M ′ be the menu of Pareto frontier tariffs in M, derived by one by one deleting tariffs i for which there exists tariff j = i such that p(i) 1 and p(i) p(j) p(j) 2 . 2 ≥ 1 ≥ 2: Reindex the tariffs in M ′ in increasing order of p1 (and hence, decreasing order of p2). 3: For each tariff i, decrease p(i) 4: Round down all p(i) 1 and p(i) 5: Remove the duplicate tariffs. 1 and p(i) to the closest multiple of α. ⊲ The revenue preserving step. 2 by (i 1)α. − 2 Output: Menu M ′. Proof idea of Theorem 1 and intuition behind Algorithm 1. The main structural ideas deriv- ing the algorithm and the proof of the revenue guarantee are as follows: (i) for a fixed number of units k to be purchased, the utility-maximizing tariff is the same across all the buyer's valuations; namely, the tariff that has the smallest overall price (upfront price plus k times per-unit price), and (ii) as the number of units to be purchased increases, the per-unit price of the utility-maximizing tariff decreases. The main idea of the rounding algorithm is decreasing the corresponding prices of tariffs with lower per-unit fees by a larger amount (Line 3). By doing so, for each buyer, the total price of buying more units decreases more than the total price of buying fewer units. This step ensures that the buyer does not switch from purchasing more units to fewer units after the rounding. This property is sufficient for the revenue guarantees. The other steps of the algorithm delete redundant tariffs (Lines 1 and 5) and ensure the final prices are multiples of α (Line 4). The theorem provides two upper bounds for the size of the discretized space. By Line 4, all the prices are multiples of α. Therefore, the 2l price components in a length-l menu each have H/α options, which 9 6 gives the first bound. On the other hand, if we consider a single tariff, each of the up-front fee and the per-unit fee has H/α possibilities, therefore, the total number of possible unique tariffs are H 2/α2. Each of these possible tariffs may or may not be on the menu, giving the second bound. The full proof is provided in Appendix A. 3.2 Online Learning We provide bounded-regret online learning algorithms in full and partial information settings. Sections 3.2.1 to 3.2.3 provide online algorithms under adversarial input, under smooth dis- tributions, and for limited type buyers, respectively. 3.2.1 Online Learning Under Adversarial Inputs The main statements are Theorems 2 and 3 which provide regret guarantees for the full- information case and partial-information case, respectively. Using the discretization in Section 3.1, we show a reduction to finite number of experts and run standard learning algorithms (weighted majority and Exp3) over the menus in the discretized set. Similar ideas were used in previous papers, for example [Blum et al., 2004, Balcan et al., 2018b]. Full Information In the full information setting, the seller sees the revenue generated for all the possible menus. To design an online algorithm in this case, we use a variant of the weighted majority algorithm by [Auer et al., 1995]. The experts in our case are the discretized menus from the previous section, denoted in the algorithm by set X = m1, . . . , mn. Furthermore vt is the valuation of the buyer are time t and Revk(v1, . . . , vt) is the cumulative revenue of menu mk for the buyers until time step t. Algorithm 2: Full-information (Weighted majority on discretized menus) (0, 1]. Input: Set of menus (experts) X = m1, . . . , mn, learning rate β ∈ 1: Initialize: For each menu mk, initialize Revk() = 0, wk(0) = 1 2: for buyer t = 1, . . . , T do Select menu at time t to be mk with probability πk[t] = wk(t 1) − j=1 wj(t Observe valuation of buyer t as vt ; For each menu mk, update Revk(v1, . . . , vt) and Pn − wk(t) = (1 + β)Revk(v1,v2,...,vt)/H ; 1) ; Theorem 2. In the full information case for length-l menus of two-part tariffs, running Algorithm 2 over discretized set of menus specified in Theorem 1 for α = β = 1/√T has regret bounded by ̃O , and running time O(T lK min l(K + H ln H)√T H 2lT l, 2H 2T ). { } (cid:16) (cid:17) The proof follows by combining the guarantees of the discretization procedure (Theorem 1) and previously known results (specifically [Auer et al., 1995], Theorem 3.2) and is deferred to Appendix A. 10 In the partial information setting, the seller does Partial Information (Bandit Setting) not see the outcome for all the possible menus and only observes the outcome of the menu used (the tariff and number of units chosen by the buyer). To design an online algorithm in this case, we use a version of the Exp3 algorithm in [Auer et al., 1995]. This variant of the Exp3 algorithm contains the weighted majority algorithm (Algorithm 2) a subroutine. At each step, we mix the probability distribution π, used by the weighted majority algorithm, with the uniform distribution to obtain a modified probability distribution π, which is then used to select a menu from our discretized set. Following the tariff and the number of units chosen by buyer t, we use the price paid (the gain from the chosen menu) to formulate a simulated gain vector, which is then used to update the weights maintained by the weighted majority algorithm. Algorithm 3: Partial-information (Exp3 on discretized menus) Input: Set of menus (experts) X = m1, . . . , mn, learning rate β γ (0, 1]. ∈ 1: Initialize: For each menu mk, initialize Revk() = 0, wk(0) = 1 2: for buyer t = 1, . . . , T do Select menu at time t to be mk with probability πk(t) = (1 (0, 1], parameter ∈ γ)πk(t) + γ/n − 1) where πk[t] = wk(t − j=1 wj(t Pn 1) ; − For the selected menu k∗, set gk∗(t) to be the price paid by buyer t. Set gk∗(t) = γ n gk∗ (t) πk∗ (t) ; For all other menus k, set gk(t) = 0; For all menus k, update 1) + gk(t) and wk(t) = (1 + β)Revk(t)/H ; Revk(t) = Revk(t − Theorem 3. In the partial information case for length-l menus of two-part tariffs, run- 1/(2(1+l)), β = γ = ning Algorithm 3 over discretized set of menus in Theorem 1 for α = T − T − 2H 2T 1/(4(1+l)) has regret bound ̃O , and running time O(T min 2(1+l) l(K + H 2l+1) min { , 2H 2T T 1 − ). (cid:17) (cid:16) { 1 H 2lT l, } } The proof follows by combining the guarantees of the discretization procedure (Theorem 1) and previously known results (specifically [Auer et al., 1995], Theorem 4.1) and is deferred to Appendix A. 3.2.2 Online Learning Under Smooth Distributions Recent papers studying online learning of mechanisms studied the problem in the restricted setting, where at each point in time, the buyers' valuations come from κ-bounded distribu- tions, where the density function is bounded at all points by κ. This assumption has proved to be sufficient for a few classes of mechanisms, including posted-pricing and second-price mechanisms, to establish dispersion. At a high-level, dispersion ensures that the number of discontinuities in a small ball in the parameter space is limited with high probability and is a sufficient condition for bounded-regret online algorithms. We prove that menus of two-part tariffs satisfy dispersion and use it to derive bounded-regret algorithms for full- information, bandit, and semi-bandit settings. The main difference between the algorithms 11 used in this suction compared to the adversarial input setting in Section 3.2.1 is that we previously needed to go through a careful data-independent discretization step (Section 3.1) to reduce the problem to a finite number of experts. However, under smooth distributions, the assumed properties of the distribution influence the set of experts chosen. We provide the main results in this setting, followed by a discussion of the key ideas behind the algorithms and proofs. After establishing the dispersion constraint for menus of two-part tariffs, it is sufficient to employ previously known algorithms designed for dispersed settings to achieve no-regret guarantees. The primary purpose of this section is to compare the regret guarantees from the recently developed online learning technique of dispersion and the discretization approach discussed in the previous section. The formal definition of dispersion and technical descriptions of the algorithms and proofs are deferred to the appendix. The main results are as follows†: Definition 4. [κ-bounded] A density function f : R κ. bution if max { R corresponds to a κ-bounded distri- f (x) } ≤ → (1) C → (T ). Suppose v(k) Theorem 5. Let u1, . . . , uT : [0, H] be the revenue functions of two-part tariff menus such that ut(ρ) denotes the revenue of a mechanism associated with menu parameters ρ for the buyer arriving at time t. Let the samples of buyers' values be drawn from [0, H] for any number of units k S ∼ [K]. Also, suppose that D × * * * × D (t), and every pair of number of units k and k′, v(k) and v(k′) have for each distribution a κ-bounded joint distribution. An efficient implementation of the exponentially weighted 2l ln(2H 2κ√T )/T /H (Algorithm 5) has expected regret bounded by forecaster with λ = ̃O((Hl2K 2√log κ + 1/(Hκ))√T ) and runs in time ̃O((T + 1)poly(l,K)poly(l, √T ) + KT √T ). q D ∈ ∈ (1) C → Theorem 6. Let u1, . . . , uT : [0, H] be the revenue functions of two-part tariff menus such that ut(ρ) denotes the revenue of a mechanism associated with menu parameters ρ for the buyer arriving at time t. Let the samples of buyers' values be drawn from S ∼ [K]. Also, suppose D (t), and every pair of number of units k and k′, v(k) and v(k′) that for each distribution have a κ-bounded joint distribution. There is a bandit-feedback online optimization algorithm with expected regret ̃O H 2K√lκd/2√log κ . The per-round running time is O(H 4lκ2lT l). [0, H] for any number of units k (T ). Suppose v(k) + 1/Hκ + Hl2K 2 T (2l+1)/(2l+2) × * * * × D D ∈ ∈ (cid:16) (cid:16) (cid:17) (cid:17) (t) is Theorem 7. Suppose the buyers' values are drawn from κ-bounded for κ = ̃o(T ). Then, running the continuous Exp3-SET algorithm (Algorithm 7) for menus of two-part tariffs under semi-bandit feedback has expected regret bounded by ̃O(H√lT ). An efficient implementation has the same regret bound and running time ̃O((T + 1)poly(l,K)poly(l, √T ) + KT √T ). (T ), where each × * * * × D D D (1) †The regret term in the semi-bandit algorithm (Theorem 7) is better than the full-information algorithm (Theorem 5) since different notions of dispersion are used. Also, the stated running time of both algorithms are the same; however, this is in the worst case, and the semi-bandit algorithm potentially performs fewer computations. 12 Partitioning of parameter space to convex regions with linear utilities [Balcan et al., 2018c] Consider the sequence of buyers valuations b. At each time step, a buyer is pre- sented a menu, and based on the menu and their valuation, they select the tariff index and number of units that maximizes their utility. Formally, given menu ρ, buyer i with valuation bi selects option (j, k), where j is the tariff index and k is the number of units if this option produces more utility for the buyer than any other options. Concretely, 1 p(j′) (cid:16) bi(k) I k 1 1 (ρ) + kp(j) p(j) (cid:16) 2 (ρ) bi(k′) I k′ 1 (ρ) + k′p(j′) 2 (ρ) j′, k′ (1) 1 { { } } k ∀ (cid:17) (cid:17) ≥ ≥ − ≥ ≥ − 1 (ρ) + kp(j) p(j) (cid:16) { } where p(j) 1 (ρ) and p(j) 2 (ρ) are the up-front fee and per-unit fee of tariff j in menu ρ. The above inequalities identify a convex polytope of parameter vectors (menus ρ) with hyperplane boundaries. Since the tariff index and the number of units that bi selects are fixed in the region, the revenue, I 2 (ρ) , is continuous and more specifically linear in the region (formally proved in Lemma 39). Following the same argument for the buyers in the sequence, the parameter space for each buyer is partitioned into convex polytopes where the revenue for the buyer's valuation is linear inside the polytopes. By superimposing these partitionings, since the intersections of convex regions are also convex, and the sum of linear is partitioned into convex regions functions (here revenues) is linear, the parameter space, such that the cumulative revenue for the sequence is linear in each region. Inside each region, the utility-maximizing choice of each buyer is fixed; therefore, each region is associated with a mapping from buyer valuations to their corresponding utility-maximizing tariff index and number of units. We may use the mapping, formally defined in Section 3.2.3, to denote the Pμ corresponding to mapping μ, or simply use cardinal indices for the region, e.g., region P2, . . .. P1, regions (cid:17) C Figure 1: The figure is an abstraction of the regions for parameter space of two-part tariffs drawn in two dimensions for illustration. The coordinates are the up-front and per-unit fees for the tariff indices. The dashed hyperplanes correspond to a buyer valuation having the same utility through two pairs of tariff indices and the number of units; see Equation (1). The colored region area is defined by hyperplane boundaries. Inside each such region, any buyer valuation selects a fixed tariff index and the number of units, resulting in a linear cumulative revenue function. 2 p(j′) H p(j) 1 H 13 Dispersion for menus of two-part tariffs We provide intuition why menus of two-part tariffs for bounded density distributions satisfy dispersion; that is, the discontinuities in the revenue function do not concentrate with high probability. To prove this, we focus on Equation (1) for fixed values of j, k, j′, k′, i.e., pairs of tariffs and units, and for all bi ∈ b. The equalities for all of these equations are met at parallel hyperplanes because, for each ρ and fixed pairs of tariffs and units, other parameters, i.e., k, k′, p(j) are fixed, and the equations are only different in bi. Assuming independence of distributions among buyers and κ-bounded joint distributions over bi(k) and bi(k′), with high probability the intersection of multisets of parallel hyperplanes, defined by Equation (1) do not concentrate, implying dispersion. A concrete definition of dispersion and a formal dispersion proof are presented in the appendix. 2 , p(j′) 1 , p(j) , p(j′) 2 1 − Overview of Algorithms We provide high-level ideas for the full-information, bandit- setting, and semibandit-setting algorithms used for Theorems 5 to 7, respectively. Generic forms of these algorithms were devised by Balcan et al. [2018b, 2020a] for dispersed families of algorithms. The full information algorithm considers the cumulative revenue function up until the time t 1 over the parameter space and samples the menu to present at time t proportional to an exponential function of its cumulative revenue. In order to have an efficient implementation, they use techniques from high-dimensional geometry and approximately sample menu ρt. Let Pi with probability approximately proportional to the region's cumulative weight and outputs a sample from the conditional distribution of menus in Pi. The bandit-setting algorithm considers a grid over the parameter space, whose granularity depends on the dispersion parameters, and runs the Exp3 algorithm over menus corresponding to the grid. The semi- bandit-setting algorithm is a continuous version of the Exp3-SET algorithm of Alon et al. [2017]. At each time step, the algorithm learns the revenue function (only) inside the region Pi that the presented menu belongs to and updates the menu weights for the next round accordingly. Pn be the partition of until time t. The algorithm picks P1, . . . , C Comparison to the results in Section 3.2.1 Although the discretization-based al- gorithms work under adversarial inputs and are more general, they provide similar regret bounds and even improved running times in some cases. In the full information case, the dependence on the regret bound in parameter T is similar in both algorithms. In running time, the discretization-based algorithm suffers worse dependence in H, but enjoys better dependence in T and K (the maximum number of units) compared to the dispersion-based algorithm. In the bandit setting, similarly, the regret bounds are similar in their dependence on T , while the running-time comparison depends on the value of κ (maximum density under smoothness assumption) such that lower-density distributions may result in better running times. 3.2.3 Limited Buyer Types In this section, we assume that there are a finite known number of buyer types. This information provides extra structures compared to the general setting considered previously. In particular, now the mechanism designer is aware of where the potential discontinuities 14 happen as a function of the parameter space. We provide algorithms with bounded regrets both for the full information and partial information settings specific to limited types. These algorithms improve the regret bounds significantly when the number of buyer types is small. This section is inspired by Balcan et al. [2015] and includes similar algorithms and notations. Balcan et al. [2015] study a security games setting, in which at each time step, the de- fender has a mixed strategy (a probability distribution) for protecting the attack targets. Knowing this mixed strategy, the attacker selects a target to attack, which maximizes the attacker's utility (depending on the attacker's type). Considering the target selected by each attacker type as a function of the defender's mixed strategy, the mixed strategy space is partitioned into regions where the action of each attacker type is fixed throughout each region. This is very similar to our setting, where the parameter space is partitioned into regions, where inside each region, each buyer type selects a fixed tariff index and the number of units (see the discussion on partitioning the parameter space in Section 3.2.2). Balcan et al. use the linear structure of utility inside each region to develop a no-regret full-information algorithm. In the partial information setting, other than the linearity of utility functions, they use the dependence of an agent's (in their case, attacker, and in our case, buyer) actions across different regions and identify a limited number of mixed strategies (corresponding to menus in our case) such that observing the agent's response to them suffice to estimate the utility of other strategies. We use similar machinery in both the full and partial information settings. However, the source of linearity of the utility is different across the two settings. In the security games context, the attackers' actions are fixed inside regions, and the cumulative utility is a weighted sum of the utility of those actions where the weights are the parameter space coordinates. In our setting, we utilize the specific structure of menus and show the cumulative utility is a linear function of coordinates. For completeness and making the paper self-contained, we include a full description of the algorithms and techniques adapted to our setting and using our terminology. In this setting, we utilize the knowledge of the potential buyer types to design a limited number of menus and optimize over this set. In contrast to the previous section, where the valuations were realized after the arrival of the buyers, here, we have access to all potential buyer types up-front, but similarly, as discussed in Section 3.2.2, the piecewise linear structure of the utility for the buyers partition the parameter space such that each part has linear cumulative utility [Balcan et al., 2018c]. This partitioning is equivalent to dividing the parameter space into convex regions such that in each region, there is a fixed mapping from the buyer types to the menu options that each buyer selects. We show that in each region, we need to consider only a limited number of menus, namely the extreme points. Consider v1, . . . , vV as the set of all potential buyer valuations. V denotes the number of buyer types. In order to define the behavior of buyers in each region, we need to define a concept called menu options, which determines the choices of the buyers. ). A pair (j, k), where j is the Definition 8 (menu option for menus of two-part tariffs, tariff index 1, . . . , l, and k is the number of units 0, 1, . . . , K is a menu option. We denote . This set identifies all potential actions of a buyer when the set of all menu options as presented with a menu. O O 15 Pμ). A mapping μ is a function from buyer Definition 9 (mapping μ, feasible mappings, types, v1, . . . , vV to menu options (j, k), where j and k are the tariff index and the number of units assigned to the buyer type respectively. Mapping μ is feasible if there is a menu corresponding to the mapping, i.e., a menu that if presented to the buyers, each buyer selects their corresponding option in the mapping as their utility maximizing option. Pμ denotes the region of the parameter space corresponding to μ, i.e., the set of menus inducing mapping μ. Using the discussion in Section 3.2.2 and as formally defined in Lemmas 38 and 39, the parameter space is partitioned to convex polytopes, each with a linear utility function for any sequence of buyer types. Therefore, for optimization purposes, it seems enough to only consider menus corresponding to the extreme points. This intuition is accurate conditioned on a small tweak. Depending on the tie-breaking rule of buyers among menu options producing the same utility, the polytopes Pμ may not be closed. Therefore depending on the tie-breaking rule, we consider a menu in proximity to the extreme point but inside the polytope. Definition 10 ( set E closure of , extended set of extreme points [Balcan et al., 2015]). For a given ε > 0, is the set of menus as follows: for any μ and any ρ that is an extreme point of the ∈ Pμ and , otherwise, there exists ρ′ E Pμ, if ρ ∈ Pμ, then ρ such that ρ′ ∈ E ∈ E ρ ρ′ ε. From now on, we may refer to − || Lemma 11. The number of extreme points, ||1 ≤ E as the extreme points. is at most (V l2K 2/4)2l. Proof. Length-l menus of two-part tariffs occupy a 2l-dimensional parameter space. In each d-dimensional space, an extreme point is the intersection of d linearly independent hyperplanes. The total number of hyperplanes defining the regions is , where for each buyer type compares the utility of any pair of options, i.e., number of units 0, . . . , K and tariff indices 1, . . . , l. Out of these hyperplanes, we need 2l of them to intersect to for an extreme point. Therefore, the number of extreme points is at most , implying the statement. = V (cid:1)(cid:0) H K 2 H2l l 2 (cid:0) (cid:1) |E| (cid:0) (cid:1) The following lemma bounds the loss in utility where the set of menus is limited to the . The proof is similar to Balcan et al. [2015], however, the loss depends on extreme points the problem-specific utility functions. E Lemma 12. Let b = b1, . . . , bT , and ρ∗ as the optimal menu in the hindsight: E be as defined in Definition 10, then for any sequence of buyer valuations T T maxρ ∈E u(bt, ρ) ≥ u(bt, ρ∗) 2KεT. − t=1 X t=1 X Proof. The proof consists of a few simple steps: (i) since the mappings partition the space into regions with a fixed mapping, there exists a mapping μ such that ρ∗ Pμ, (ii) the revenue of the buyer valuation sequence is linear in Pμ as shown in Lemma 39, (iii) the closure of Pμ is a convex polytope whose extreme points contain the maximizers of the linear b u(bi, ρ), (iv) one of the maximizers has cumulative utility at least as ρ∗ (v) function the parameter vectors in ε proximity of the extreme point inside Pμ approximately preserve the L1 distance of each member the revenue of the extreme points (vi) since by definition of to an extreme point is at most ε, there is at most ε distance in the upfront fee and per-unit fee for any tariffs, resulting in the bound in the statement. P ∈ E bi ∈ 16 Full Information We first provide an algorithm for the full information case specific to the finite number of buyers. The main result of this section is provided below. The algorithm to achieve this regret guarantee is a weighted majority algorithm (Algorithm 2) on the set of menus corresponding to the extreme points . E Theorem 13. In the full information case for length-l menus of two-part tariffs, when there are V types of buyers, running Algorithm 2 over the set of menus corresponding to set for β = 1/√T has regret bounded by ̃O(Hl√T ln(V lK)). E The proof follows from Lemma 12 and the guarantee of weighted majority algorithm and is deferred to the appendix. In the partial information setting, in each time step t, Partial Information (bandit) we present the arriving buyer a menu and only observe the option selected by the buyer (e.g., the tariff and the number of units) in the presented menu. A natural approach in this setting is running the EXP3 algorithm and using the weighted majority algorithm for the full information case as a subroutine. However, this approach leads to a regret bound that is exponential in the size of the menu (this result is presented formally in Appendix A). An alternative to this approach is estimating the revenue of other menus, more technically finding an unbiased estimator with bounded range for the revenue of all the menus, and then running the full information algorithm with the estimates, as introduced by [Awerbuch and Mansour, 2003]. We take the latter approach and find the estimates by employing the notion of barycentric spanners [Awerbuch and Kleinberg, 2008]. A barycentric spanner is a basis in a vector space such that any vector can be represented as a linear combination of basis vectors with bounded coefficients. By utilizing this concept, we provide algorithms with a regret bound that is sublinear in the number of timesteps and polynomial in other parameters. Similar ideas were employed in [Balcan et al., 2015]. There are two main ideas deriving our bounded-regret algorithm. The first is a reduction from the partial information case to the full information case assuming Oracle access to proper estimates of utilities for all the menus, and the second is deriving these estimates. The first idea was introduced by Awerbuch and Mansour [2003], and we directly use an inspired theorem by Balcan et al. [2015] that suits our setting more accurately. For the second, we also use similar machinery to Balcan et al. [2015]. We first show how to estimate the utility of any menu by only using the response of the buyers to a limited number of menus. In doing so, we take advantage of the dependence between responses of the buyers for different menus to obtain estimates for unused menus. In order to estimate the expected revenue of each menu over a time interval, it is sufficient to estimate the probability of selection of each option in the menu (tariff index and number of units) by the buyers. Since the price of each option is determined by the menu, we can infer the expected revenue using these probabilities. Note that the option that each buyer type selects is fixed throughout each region. Balcan et al. [2015] use the dependence between these probabilities across regions to find a limited set of menus that infer the estimates. be the set of length-V An analogous argument to theirs in our setting is as follows. Let Pμ and each option (j, k), indicate the (maximal set indicator vectors that, for each region of) buyer types that select the option (j, k) given menus in Pμ. The algorithm presents the I 17 I to buyers at random times and records menus corresponding to the barycentric spanner of whether the buyer selects the corresponding option. We show the utility of each menu can be represented as a linear function of its corresponding vectors in I and, therefore, a linear function of the barycentric spanner vectors of . This is enough to derive the estimates. I Now, we describe the overall structure of the algorithm. The algorithm operates in time blocks, with each block consisting of exploitation and exploration time steps. The exploration time steps are selected uniformly at random within the block and are limited In an exploitation step, the menu used is the output of the full information in number. algorithm, employing unbiased estimators from the previous time block. These menus are always the extreme points . During exploration time steps, the menus corresponding to the barycentric spanner are used. At the end of each time block, the algorithm refines the unbiased estimators of all corner points using the information gathered in the exploration phases. A detailed description and proof of the theorem are provided in the appendix. E Theorem 14. In the partial information (bandit) case for length-l menus of two-part tar- iffs, when there are V different types of buyers, there is an algorithm with regret bound of ̃O(T 2/3l(HKV )1/3 log1/3(V lK)). 3.3 Distributional Learning for Two-Part Tariffs We present distributional learning results for menus of two-part tariffs. The learning algo- rithm simply considers all menus in the discretized set specified by Theorem 1 and outputs the empirical revenue-maximizing menu given the samples. More specifically, for each menu in the discretized set, the algorithm computes the cumulative revenue achieved from the samples and outputs the menu with the maximum cumulative revenue. The revenue from each sample (buyer) for a fixed menu is the total payment corresponding to the buyer's utility maximizing option (tariff index and the number of units). This approach has a major [Balcan et al., 2018c, 2020b, 2022a], that did difference with the previous line of work, e.g., not use a discretization and optimized over the infinite parameter space. Theorem 15. In the distributional setting, for length-l menus of two-part tariffs, there exists a learning algorithm with sample complexity H 2 ) + ln (2/δ)), and running time H 2 2ε2 2ε2 (2l ln ( 2KHl + ln (2/δ) 2HKl ε 2KHl ε 2l ln Kl 2l . ε (cid:0) (cid:0) (cid:1) (cid:1) (cid:0) (cid:1) Remark. For menus of length larger than one, i.e., l > 1, The running time from Theorem 15 is roughly the square root of the running time of the previous result [Balcan et al., 2020b, 2022a] in the worst case in terms of parameters H, K, and 1/ε. Under extra structural assumptions, [Balcan et al., 2022a] may result in better running times. See Appendix B for more details. 4 Menus of Lotteries Consider selling m items to a buyer. A set M = Rm ⊆ R, where φ(0) = 0 and p(0) = 0 is a length-l menu of lotteries. Each φ(j) is a vector (cid:8)(cid:0) , . . . , (cid:1)(cid:9) (cid:1) (cid:0) (cid:1) (cid:0) , φ(1), p(1) φ(0), p(0) φ(l), p(l) × 18 φ(j), p(j) (cid:0) (cid:1) (cid:0) (cid:1) * φ(j)[i] φ(j), p(j) m i=1 v(ei) , a buyer receives each item i with probability of length m. Under the lottery φ(j)[i] and pays a price of p(j). The buyer's expected utility for the lottery is their expected value for the lottery less their payment. We consider additive and unit-demand φ(j)[i], where v(ei) is buyers. For additive buyers, their value for lottery j is m p(j). Note that for i=1 v(ei) their value for item i. The buyer's expected utility is P additive buyers, due to linearity of expectation, it does not matter whether the allocation of the items in a lottery, are independent or correlated. For unit-demand buyers, without loss 1. Under this constraint, for of generality, we only consider lotteries such that each lottery j, the allocation of the items are dependent, and the buyer never receives more than one item. In this case, the utility for lottery j has the same expression as for additive buyers. Presented with a menu of lotteries, the buyer selects a utility-maximizing lottery φ(j∗), p(j∗) and the mechanism achieves revenue p(j∗). Putting the problem formulation in the context of Section 2, is the set of all menus (cid:0) of lotteries, each parameterized by ρ which in this case contains all φ(j) and p(j), where each φ(j)[i] [0, H] for the unit-demand [0, mH] for the additive setting (and ∈ setting). Π is the set of buyer valuations and u : Π [0, mH] be a utility function where u(v, ρ) measures the revenue of the menu with parameters ρ on buyer valuations v P m i=1 φ(j)[i] [0, 1] and p(j) is × C → M P Π. − ≤ ∈ ∈ (cid:1) * ∈ 4.1 Discretization procedure In this section, we introduce a rounding procedure for menus of lotteries. In this procedure, given any vector of parameters (representing a menu) with arbitrary coordinates, we find a transformation to another vector that has two properties; first, the revenue of the output is nearly as high as the original menu for any valuation; secondly, the coordinates corresponding to allocation probabilities and prices belong to a finite set of values. This rounding procedure performed on all possible menus results in a final set of outcomes. We perform the learning algorithms over this finite set. Theorem 16. Given a menu of lotteries M and parameters 0 < α < 1, 0 < δ < 1, and K, an arbitrary natural number, Algorithm 4 outputs menu M ′ such that Rev(M ′) Rev(M)(1 mH(1 − 0, (1 bilities is − { the set of possible prices is most O ≥ δ)K. The set of possible allocation proba- , where K ′ = and . This constitutes a space with at discrete points, when limiting to length-l menus and (2K + 1)α − α)K ′ α)0 = 1 } 0, Hmα, 2Hmα, . . . Hm } (1/αlm+l) (ln (Hm/α))lm 1/α ln (Hm/α) ⌋ ⌊ α)K − α)K ′ − 1, . . . (1 − , (1 δ)(1 − − { − O (cid:16) 2(1/αm+1)(ln (Hm/α))m (cid:16) (cid:17) discrete points for arbitrary-length menus. (cid:17) Overview of Algorithm 4. The algorithm consists of three main steps and its logic is similar to that of Dughmi et al. [2014]. In step 1, we divide the lotteries in the menu exceeding a minimum price into K levels based on their price (and remove the ones below δ) with a higher the minimum). The division in prices is proportional to powers of (1 level k having a higher price, compared to a lower level k′ < k. Step 2 rounds down the k and allocation probability coordinates to a finite set. By multiplying φ by (1 α), the allocation probabilities of lower-price levels then rounding to integer powers of (1 decrease by a larger factor, making lower-price levels less desirable. Step 3 rounds down α)K, then by rounding to the prices, first by multiplying all prices by the same factor, (1 α)K − − − − − 19 multiples of α and finally by subtracting 2kα, which results in more subtraction of price for originally higher-price entries. The main insight behind nearly preserving the revenue of the original menu (and circumventing the issue with simple rounding) is that prices of the more expensive lotteries (higher-price level) are decreased more than the lower-price ones, while their allocation decreases by a lower factor. This ensures that no buyer with any valuation, switches from a higher-price level to a lower-price, after the rounding. Algorithm 4: (Almost) revenue preserving rounding for menus of lotteries − ∈ − δ)K N, and α such that k+1 < p Input: Menu of lotteries M with entries of pairs (φ, p), K 0 < α < 1. Step 1: Partition the entries (φ, p) of the menu M into levels, where each level k, for k = 1, . . . , K, contains all entries whose price is in the range mH(1 For every entry (φ, p) in level k, put an entry (φ′, p′) in M ′ where φ′ is the outcome of step 2 and p′ is obtained by step 3. Step 2: multiply φ by (1 of zero and all integer powers of (1 Step 3: First, multiplying p by a factor of (1 multiple of α, and then subtracting 2kα. Output: M ′: the modified menu. k, and round down all allocation probabilities to the set α)K, then rounding p down to an integer α) in the range [ α Hm, 1]. mH(1 α)K δ)K − − − ≤ − k. − − 4.2 Online Learning We provide bounded-regret online learning algorithms in full and partial information settings for fixed and arbitrary-length menus of lotteries. The setting considered is as follows. In each round, a new buyer arrives, and a length-l lottery menu is presented to the buyer. The buyer selects her utility-maximizing lottery j and pays p(j). The mechanism achieves revenue p(j). Missing proofs and explicit description of the algorithms are deferred to Appendix B. In the full information setting, the seller sees the revenue generated for all the possible menus. Similar to the previous section, we run Algorithm 2 (a weighted majority algorithm) over the discretized set as the outcome of Algorithm 4 and derive the following results for the length-l menus and arbitrary length menus. Theorem 17. In the full information case for length-l menus of lotteries, running Algorithm 2 over the discretized set of menus specified in Theorem 16 for α = T − and δ = T − 0.5 has regret ̃O(m2Hl√T ). 0.5, K = T 0.5, 1, β = T − Theorem 18. In the full information case for arbitrary length menus of lotteries, running 1/(m+1), K = Algorithm 2 on menus specified in Theorem 16 for α = T − T 1/(m+1), and δ = T − 1/(m+1) has regret ̃O(mHT 1 − 1/(2m+4) lnm (mHT )). 1/(2m+2), β = T − In the partial information setting, the seller only observes the revenue generated for the menu at hand. Similar to the previous section, we run Algorithm 3 (EXP3 algorithm) over the discretized set as the outcome of Algorithm 4 and derive the following result for length l menus. 20 Theorem 19. In the partial information case for length-l menus of lotteries, running 1/(lm+2), β = γ = Algorithm 3 over discretized set of menus in Theorem 16 for α = T − 1/(2lm+4) lnlm+1 (mHT )). T − 1/(4lm+8), K = T 1/(2lm+4), and δ = T − 1/(2lm+4) has regret ̃O(m2HlT 1 − For the case with V buyer types, we use similar machinery to Section 3.2.3 to derive bounded regret algorithms in the full and partial information settings. The discussion of how to adapt to the lotteries setting is deferred to the appendix. the partial information case. Theorem 20. In the full information case for length-l menus of lotteries, when there are V types of buyers, there is an algorithm with regret bound of O(m2Hl√T ln (V l)). Theorem 21. In the partial information (bandit) case for length-l menus of lotteries, when there are V different types of buyers, there is an algorithm with regret bound of O(T 2/3(lm)4/3(HV )1/3 log1/3(V l)). Remark The above results hold under adversarial input. Unlike menus of two-part tariffs (and many other families of algorithms and mechanisms discussed in Balcan et al. [2018b, 2020a]), for menus of lotteries, we provide evidence that dispersion, a sufficient condition for online learning under smooth distributions, may not hold. A formal result is stated as Theorem 58. 4.3 Distributional Learning In the distributional setting, we have sample access to buyers' valuations. The value of the buyer for item i is drawn from distribution Di with support [0, H]m; we do not assume independence among items. Similar to the distributional learning algorithm for menus of two-part tariffs, the algorithm simply considers all menus in the discretized set specified by Theorem 16 and outputs the empirical revenue-maximizing menu given the samples. The revenue from each sample (buyer) for a fixed menu is the payment corresponding to the buyer's utility-maximizing lottery in the menu. Theorem 22. For length-l menus of lotteries, there is a discretization-based distributional learning algorithm with sample complexity ̃O (m2H 2/ε2(lm + ln (2/δ))), and running time ̃O (2m2H 2/ε2)lm+l+1 l(lm + ln (2/δ)) lnlm (mH/ε ln (mH/ε)) (cid:16) (cid:17) . Remark For the limited menu length, the sample complexity of Theorem 22 is roughly the same as [Balcan et al., 2018c], but the advantage is that we provide an efficient algorithm when m and l are constant. The analysis for arbitrary-length menus is provided in the appendix as Theorem 56. The sample complexity and running time provided are similar to that of [Dughmi et al., 2014], however, Theorem 56 works for a more general setting. 21 5 Discussion This paper contributes to both learning theory and mechanism design by studying prominent families of mechanisms from a learning perspective. Our work is focused on learning menu mechanisms that go beyond selling the items separately. Menus of lotteries provide a list of randomized allocations and their corresponding prices to the buyers and are specifically advantageous for selling multiple items. Menus of two-part tariffs, on the other hand, are employed for selling multiple units (copies) of an item by presenting a list of up-front fees and per-unit fees to the buyer. Discretization versus Dispersion The majority of the paper focuses on online learn- ing of these families of mechanisms. Two of the commonly used techniques for this setting are (the more traditional) discretization-based and (the recently-developed) dispersion-based techniques. Menus of lotteries and two-part tariffs are examples of parametric algorithm or mechanism design, where the objective function, here revenue, has sharp discontinuities in the parameter space, and the standard procedures, such as rounding down the parameters to multiples of ε, may result in arbitrary revenue loss. A discretization scheme means that there exists a grid in the parameter space such that for any arbitrary parameter vector, there is a corresponding parameter vector in proximity over the grid generating similar rev- enue. However, finding the corresponding parameter vector (the direction to move from the original parameter vector in the space) needs taking extra care, and moving in arbitrary direction may cause a large revenue loss. In contrast to the discretization scheme, another method developed for proving online learnability of parameterized algorithms, called dis- persion Balcan et al. [2018b, 2020a], asserts that under smoothness assumptions moving in a small ball of parameter vectors, does not face sharp discontinuities with high prob- ability. This means that with high probability, moving in any direction preserves similar revenue. Nevertheless, we show evidence that the dispersion may not hold for menus of lot- teries Theorem 58 and while dispersion holds for menus of two-part tariffs Propositions 33 In conclusion, although a small but and 36, it heavily uses the smoothness assumption. arbitrary modification may change the revenue drastically when starting from a parameter vector, in designing our discretization scheme, we show a specific direction such that small modification along that direction preserves the revenue. See Theorems 1 and 16. Limitations While we present strong regret-bound guarantees both in the general case and limited buyer types, our algorithms are not always computationally efficient. Designing corresponding computationally efficient algorithms is an open direction. 6 Acknowledgement The authors would like to thank Avrim Blum, Misha Khodak, Rattana Pukdee and anony- mous reviewers for helpful feedback and comments. This material is based on work supported in part by the National Science Foundation under grant CCF-1910321 and a Simons Inves- tigator Award. 22 References Noga Alon, Nicol`o Cesa-Bianchi, Claudio Gentile, Shie Mannor, Yishay Mansour, and Ohad Shamir. Nonstochastic multi-armed bandits with graph-structured feed- back. 10.1137/140989455. URL https://doi.org/10.1137/140989455. SIAM J. Comput., 46(6):1785–1826, 2017. doi: Peter Auer, Nicolo Cesa-Bianchi, Yoav Freund, and Robert E Schapire. Gambling in a rigged casino: The adversarial multi-armed bandit problem. In Proceedings of IEEE 36th annual foundations of computer science, pages 322–331. IEEE, 1995. Baruch Awerbuch and Robert Kleinberg. Online linear optimization and adaptive rout- ing. J. Comput. Syst. Sci., 74(1):97–114, 2008. doi: 10.1016/j.jcss.2007.04.016. URL https://doi.org/10.1016/j.jcss.2007.04.016. Baruch Awerbuch and Yishay Mansour. Adapting to a reliable network path. In Eliza- beth Borowsky and Sergio Rajsbaum, editors, Proceedings of the Twenty-Second ACM Symposium on Principles of Distributed Computing, PODC 2003, Boston, Massachusetts, USA, July 13-16, 2003, pages 360–367. ACM, 2003. doi: 10.1145/872035.872090. URL https://doi.org/10.1145/872035.872090. Maria-Florina Balcan and Avrim Blum. Approximation algorithms and online mechanisms for item pricing. In Joan Feigenbaum, John C.-I. Chuang, and David M. Pennock, editors, Proceedings 7th ACM Conference on Electronic Commerce (EC-2006), Ann Arbor, Michi- gan, USA, June 11-15, 2006, pages 29–35. ACM, 2006. doi: 10.1145/1134707.1134711. URL https://doi.org/10.1145/1134707.1134711. Maria-Florina Balcan and Dravyansh Sharma. Data driven semi-supervised learn- ing. In Marc'Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wortman Vaughan, editors, Advances in Neural Information Process- ing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pages 14782–14794, 2021. URL https://proceedings.neurips.cc/paper/2021/hash/7c93ebe873ef213123c8af4b188e7558-Abstract.html. Maria-Florina Balcan, Avrim Blum, Jason D Hartline, and Yishay Mansour. Reducing mechanism design to algorithm design via machine learning. Journal of Computer and System Sciences, 74(8):1245–1270, 2008. Maria-Florina Balcan, Avrim Blum, Nika Haghtalab, and Ariel D. Procaccia. Com- mitment without regrets: Online learning in stackelberg security games. In Tim Roughgarden, Michal Feldman, and Michael Schwarz, editors, Proceedings of the Six- teenth ACM Conference on Economics and Computation, EC '15, Portland, OR, USA, June 15-19, 2015, pages 61–78. ACM, 2015. doi: 10.1145/2764468.2764478. URL https://doi.org/10.1145/2764468.2764478. Maria-Florina Balcan, Tuomas Sandholm, and Ellen Vitercik. Sample complexity of auto- mated mechanism design. Advances in Neural Information Processing Systems, 29, 2016. 23 Maria-Florina Balcan, Vaishnavh Nagarajan, Ellen Vitercik, and Colin White. Learning- theoretic foundations of algorithm configuration for combinatorial partitioning prob- lems. URL In Conference on Learning Theory, pages 213–274. PMLR, 2017. https://arxiv.org/abs/1611.04535. Maria-Florina Balcan, Travis Dick, Tuomas Sandholm, and Ellen Vitercik. Learning to branch. In International conference on machine learning, pages 344–353. PMLR, 2018a. URL https://arxiv.org/abs/1803.10150. Maria-Florina Balcan, Travis Dick, and Ellen Vitercik. Dispersion for data-driven algorithm design, online learning, and private optimization. In 2018 IEEE 59th Annual Symposium on Foundations of Computer Science (FOCS), pages 603–614. IEEE, 2018b. Maria-Florina Balcan, Tuomas Sandholm, and Ellen Vitercik. A general theory of sample complexity for multi-item profit maximization. In Proceedings of the 2018 ACM Conference on Economics and Computation, pages 173–174, 2018c. Maria-Florina Balcan, Travis Dick, and Wesley Pegden. Semi-bandit optimization in the dispersed setting. In Conference on Uncertainty in Artificial Intelligence, pages 909–918. PMLR, 2020a. Maria-Florina Balcan, Siddharth Prasad, and Tuomas Sandholm. Efficient algorithms for learning revenue-maximizing two-part tariffs. In Proceedings of the Twenty-Ninth Inter- national Joint Conference on Artificial Intelligence, IJCAI-20 , 2020b. { } Maria-Florina Balcan, Dan DeBlasio, Travis Dick, Carl Kingsford, Tuomas Sandholm, and Ellen Vitercik. How much data is sufficient to learn high-performing algorithms? gener- alization guarantees for data-driven algorithm design. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, pages 919–932, 2021a. Maria-Florina Balcan, Mikhail Khodak, Dravyansh Sharma, and Ameet Talwalkar. Learning-to-learn non-convex piecewise-lipschitz functions. In Marc'Aurelio Ran- zato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wort- Information Processing Systems man Vaughan, 2021, 34: Systems NeurIPS 2021, December 6-14, 2021, virtual, pages 15056–15069, 2021b. URL https://proceedings.neurips.cc/paper/2021/hash/7ee6f2b3b68a212d3b7a4f6557eb8cc7-Abstract.html. Information Processing Annual Conference editors, Advances on Neural in Neural Maria-Florina Balcan, Christopher Seiler, and Dravyansh Sharma. Faster algorithms arXiv preprint for learning to link, align sequences, and price two-part tariffs. arXiv:2204.03569, 2022a. Maria-Florina F. Balcan, Misha Khodak, Dravyansh Sharma, and Ameet Tal- In NeurIPS, 2022b. URL walkar. Provably tuning the elasticnet across instances. http://papers.nips.cc/paper_files/paper/2022/hash/b21a34c4e8dba253f05f4a5adc68ba73-Abstract-Conference.html. Raef Bassily, Adam D. Smith, and Abhradeep Thakurta. Private empirical risk minimiza- tion: Efficient algorithms and tight error bounds. In 55th IEEE Annual Symposium on 24 Foundations of Computer Science, FOCS 2014, Philadelphia, PA, USA, October 18-21, 2014, pages 464–473. IEEE Computer Society, 2014. doi: 10.1109/FOCS.2014.56. URL https://doi.org/10.1109/FOCS.2014.56. Avrim Blum and Jason D. Hartline. Near-optimal online auctions. In Proceedings of the Sixteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2005, Vancou- ver, British Columbia, Canada, January 23-25, 2005, pages 1156–1163. SIAM, 2005. URL http://dl.acm.org/citation.cfm?id=1070432.1070597. Avrim Blum, Vijay Kumar, Atri Rudra, and Felix Wu. Online learning in online auctions. Theoretical Computer Science, 324(2-3):137–146, 2004. Patrick Briest, Shuchi Chawla, Robert Kleinberg, and S Matthew Weinberg. Pricing ran- domized allocations. In Proceedings of the twenty-first annual ACM-SIAM symposium on Discrete Algorithms, pages 585–597. SIAM, 2010. S ́ebastien Bubeck, Nikhil R. Devanur, Zhiyi Huang, and Rad Niazadeh. Online auctions and multi-scale online learning. In Constantinos Daskalakis, Moshe Babaioff, and Herv ́e Moulin, editors, Proceedings of the 2017 ACM Conference on Economics and Computation, EC '17, Cambridge, MA, USA, June 26-30, 2017, pages 497–514. ACM, 2017. doi: 10. 1145/3033274.3085145. URL https://doi.org/10.1145/3033274.3085145. Nicolo Cesa-Bianchi, Claudio Gentile, and Yishay Mansour. Regret minimization for reserve prices in second-price auctions. IEEE Transactions on Information Theory, 61(1):549–564, 2014. Partha Dasgupta, Peter Hammond, and Eric Maskin. The implementation of social choice rules: Some general results on incentive compatibility. The Review of Economic Studies, 46(2):185–216, 1979. Constantinos Daskalakis, Alan Deckelbaum, and Christos Tzamos. The complexity of opti- mal mechanism design. In Proceedings of the twenty-fifth annual ACM-SIAM symposium on Discrete algorithms, pages 1302–1318. SIAM, 2014. Shaddin Dughmi, Li Han, and Noam Nisan. Sampling and representation complexity of revenue maximization. In International Conference on Web and Internet Economics, pages 277–291. Springer, 2014. Paul D ̈utting, Zhe Feng, Harikrishna Narasimhan, David Parkes, and Sai Srivatsa Ravin- dranath. Optimal auctions through deep learning. In International Conference on Machine Learning, pages 1706–1715. PMLR, 2019. Yannai A Gonczarowski and S Matthew Weinberg. The sample complexity of up-to-ε multi- dimensional revenue maximization. Journal of the ACM (JACM), 68(3):1–28, 2021. Roger Guesnerie and Claude Oddou. Second game. 0531. https://www.sciencedirect.com/science/article/pii/002205318190017X. https://doi.org/10.1016/0022-0531(81)90017-X. of Economic Theory, Journal doi: 25(1):67–91, best 1981. taxation a as ISSN 0022- URL 25 Sergiu Hart and Noam Nisan. Selling multiple correlated goods: Revenue maximization and menu-size complexity. Journal of Economic Theory, 183:991–1029, 2019. Robert D. Kleinberg and Frank Thomson Leighton. The value of knowing a demand curve: Bounds on regret for online posted-price auctions. In 44th Symposium on Foundations of Computer Science (FOCS 2003), 11-14 October 2003, Cambridge, MA, USA, Proceedings, pages 594–605. IEEE Computer Society, 2003. doi: 10.1109/SFCS.2003.1238232. URL https://doi.org/10.1109/SFCS.2003.1238232. W Arthur Lewis. The two-part tariff. Economica, 8(31):249–270, 1941. L ́aszl ́o Lov ́asz and Santosh S. Vempala. Fast algorithms for logconcave functions: Sampling, rounding, integration and optimization. In 47th Annual IEEE Symposium on Foundations of Computer Science (FOCS 2006), 21-24 October 2006, Berkeley, California, USA, Pro- ceedings, pages 57–68. IEEE Computer Society, 2006. doi: 10.1109/FOCS.2006.28. URL https://doi.org/10.1109/FOCS.2006.28. Mehryar Mohri and Andr ́es Munoz Medina. Learning algorithms for second-price auctions with reserve. The Journal of Machine Learning Research, 17(1):2632–2656, 2016. Jamie Morgenstern and Tim Roughgarden. Learning simple auctions. In Conference on Learning Theory, pages 1298–1318. PMLR, 2016. Jamie H Morgenstern and Tim Roughgarden. On the pseudo-dimension of nearly optimal auctions. Advances in Neural Information Processing Systems, 28, 2015. Walter Y Oi. A disneyland dilemma: Two-part tariffs for a mickey mouse monopoly. The Quarterly Journal of Economics, 85(1):77–96, 1971. Tim Roughgarden and Joshua R. Wang. Minimizing regret with multiple reserves. In Vincent Conitzer, Dirk Bergemann, and Yiling Chen, editors, Proceedings of the 2016 ACM Conference on Economics and Computation, EC '16, Maastricht, The Netherlands, July 24-28, 2016, pages 601–616. ACM, 2016. doi: 10.1145/2940716.2940792. URL https://doi.org/10.1145/2940716.2940792. Vasilis Syrgkanis. A sample complexity measure with applications to learning optimal auc- tions. Advances in Neural Information Processing Systems, 30, 2017. Leslie G Valiant. A theory of the learnable. Communications of the ACM, 27(11):1134–1142, 1984. Vladimir Vapnik. Statistical Learning Theory. Wiley, 1998. 26 A Missing Proofs of Section 3 A.1 Discretization Procedure Before providing the proof of the discretization procedure, we provide intuition why dis- cretization is a nontrivial procedure for menus of two-part tariffs. For this family of mecha- nisms, standard procedures, such as rounding down the prices to multiples of α, may result in arbitrary revenue loss because the price parameters of each tariff decrease by different amounts affecting unpredictable changes in utilities of selecting each tariff and number of units. It would be possible that the utility-maximizing choice for a buyer switches from a higher-price tariff and more units (that originally has slightly higher utility for the buyer) to a low-price tariff and fewer units (that originally has slightly lower utility for the buyer) after a simple rounding. Now, we provide structural results that enable us to design a discretization procedure. Given a menu of two-part tariffs, the following definition deletes the dominated tariffs (in- dependent of the valuation). Definition 23 (Pareto frontier tariffs). Given menu M with distinct tariffs, the Pareto = i such that frontier of M ′ is derived by deleting all tariffs i for which there exists a tariff j p(j) 1 ≤ Lemma 24. Given a menu of tariffs, a user only selects a tariff in the Pareto frontier. 1 and p(j) p(i) 2 ≤ p(i) 2 . Lemma 25. Sorting the tariffs in the Pareto frontier in increasing order of p1 is equivalent to sorting them in decreasing order of p2. Lemma 26. For any fixed number of units k, the highest utility tariff in M is argmin p(i) kp(i) 2 . This is independent of the buyers' values. 1 + The following lemma states that as we increase the number of units the utility-maximizing tariff has higher p1 and lower p2. Lemma 27. Let M ′ be the menu of Pareto frontier tariffs derived from menu M. Suppose the tariffs in M ′ are reindexed in increasing order of p1. Consider the index of the utility- maximizing tariff for each number of units. This index is increasing as a function of the number of units. Theorem 1. Given a menu of two-part tariffs M and parameter 0 < α < 1, Algorithm 4 outputs menu M ′ whose revenue is at least the revenue of M less 2Kαl, for any buyer's valuation. Furthermore, for all i, all p(i) 1 and p(i) 2 are multiples of α. The set of potential menus, where H is the outcomes constitutes a space with at most min maximum value for any number of units. (H/α)2l, 2H 2/α2 } { Proof. First, we reason about the length of the outcome menu. Let l and l′ be the length of the original menu and outcome menu, respectively. First, note that l′ is also the length of the menu after rounding down p(i) to their closest multiples of α. Observe that l′ is at most l (because we never add extra tariffs) and also at most H 2/α2 because there are H/α distinct options for each p1 and p2. Therefore, l′ 1 and p(i) l, H 2/α2 . 2 min { ≤ } 27 6 Then, we reason about the maximum loss in revenue. First, note that for any fixed tariff and number of units, the total price decreases by at most 2Kl′α. We only need to show that the buyer does not switch from buying more units to fewer. Switching in the opposite order does not decrease the revenue more than 2Kl′α. The reason is that the total price of each tariff is an increasing function as the number of units. Therefore, the minimum total price is increasing as a function of the number of units. Next, we prove that a buyer never switches from buying more units to less. We show two cases: switching between tariffs and staying with the same tariff. In the first case, by Lemma 27, this means that that a buyer never switches from a tariff with higher p1 (lower p2) to a lower p1 (higher p2). Since in the discretization procedure, the price of tariffs with higher p1 decreases more than lower p1, the lower p1 tariffs do not become utility-maximizing if they were not before. In the second case, by the rounding procedure, the total price of more units in the same tariff always decreases more; therefore, the lower number of units never becomes utility maximizing. Therefore, we conclude the payment of each tariff and therefore the revenue decreases at most by 2Kl′α. Thus, Rev(M ′) Rev(M) 2Kαl Finally, we find the total number of possible menus. Also, after the discretization all p(i) 1 and p(i) 2 are multiples of α. Therefore, when restricted to length-l menus, there are H/α choices for each 2l parameter of the menu, making an upper bound of (H/α)2l. On the other hand, there are at most H 2/α2 possible tariffs, and each one of them may appear or not in the menu. Therefore, the number of menus is also bounded by 2H 2/α2. ≥ − A.2 Online Learning A.2.1 Online Learning Under Adversarial Inputs Full Information Proposition 28 ([Auer et al., 1995], Theorem 3.2). For any sequence of valuations ̄v, RevWM ( ̄v) OPTX ( ̄v) ≥ β 2 − OPTX ( ̄v) H ln n β , − where X = m1, . . . , mn are the set of experts (two-part tariff menus), RevWM( ̄v) is the expected revenue outcome of Algorithm 2, and OPTX ( ̄v) is the revenue of the optimal menu in X. Theorem 2. In the full information case for length-l menus of two-part tariffs, running Algorithm 2 over discretized set of menus specified in Theorem 1 for α = β = 1/√T has regret bounded by ̃O , and running time O(T lK min l(K + H ln H)√T H 2lT l, 2H 2T ). { } (cid:16) (cid:17) Proof. Let n be the number of menus resulting from the discretization procedure in Section 3.1. Let vi be the valuation of the buyer at step i, and ̄v be the vector of valuation of all buyers in rounds 1 through T . We denote RevM ′() as the maximum revenue obtained in the set of menus resulting from the discretization procedure, OPT() as the optimal revenue, and RevWM() as the revenue obtained from the weighted majority algorithm discussed above on 28 the set of outcome menus of the discretization procedure. Then, n = (H/α)2l, RevWM ( ̄v) ≥ Rev(M ′) ( ̄v) β 2 − Rev(M ′) ( ̄v) H ln n β , − T RevM ′ ( ̄v) = RevM ′ (vi) , RevM ′ (vi) ≥ i=1 X OPT (vi) 2Klα; − where the first expression is a result of the discretization procedure, the second expres- sion uses Proposition 28, the third expands the revenue over T terms, and the last uses Theorem 1. Rearranging the terms, we have: RevM ′ (vi) RevM ′ ( ̄v) RevWM ( ̄v) RevWM ( ̄v) ≥ ≥ ≥ ≥ OPT (vi) OPT ( ̄v) 2Klα 2KlαT − − OPT ( ̄v) OPT ( ̄v) 2KlαT 2KlαT − − βHT − 2 − βHT − 2 − H ln n β 2Hl (ln (H/α)) β We set variables α and β to minimize the exponent of T in the regret. By substituting n, the regret is upper bounded by 2KlαT + βHT 2 + 2Hl (ln H β ln α) . − By setting α = β = 1 √T , The regret will be ̃O l(K + H ln H)√T . Based on the parameters H 2lT l, 2H 2T (cid:16) chosen, the number of menus is O(min ). The algorithm needs to maintain the { weights for these menus and update them based on the revenue at each time step. The revenue of each menu can be calculated in O(Kl) given the buyer's valuation, resulting in the stated running time. (cid:17) } Partial Information Proposition 29 ([Auer et al., 1995], Theorem 4.1). For any sequence of valuations ̄v, RevExp3 ( ̄v) OPTX − ≥ γ + (cid:18) β 2 (cid:19) OPTX − Hn ln n βγ , where X = m1, . . . , mn are the set of experts (two-part tariff menus), RevExp3( ̄v) is the expected revenue outcome of Algorithm 3, and OPTX ( ̄v) is the revenue of the optimal menu in X. Theorem 3. In the partial information case for length-l menus of two-part tariffs, run- 1/(2(1+l)), β = γ = ning Algorithm 3 over discretized set of menus in Theorem 1 for α = T − T − 2H 2T 1/(4(1+l)) has regret bound ̃O , and running time O(T min 2(1+l) l(K + H 2l+1) min { , 2H 2T T 1 − ). (cid:17) (cid:16) { 1 H 2lT l, } } 29 Proof. The proof follows the same logic as that of Theorem 2. We denote RevExp3() as the revenue obtained from Exp3 algorithm described above on the set of outcome menus of the discretization procedure. Similar to the proof of Theorem 2, in what follows n denotes the number of menus resulting from the discretization procedure in Section 3.1. vi is the valuation of the buyer at step i, and ̄v is the sequence of valuation of all buyers in rounds 1 through T . RevM ′() is the maximum revenue obtained in the set of menus resulting from the discretization procedure and OPT() is the optimal revenue. n = (H/α)2l, RevExp3 ( ̄v) ≥ Rev(M ′) ( ̄v) T − γ + (cid:18) β 2 (cid:19) Rev(M ′) ( ̄v) Hn ln n βγ , − RevM ′ ( ̄v) = RevM ′ (vi) , RevM ′ (vi) ≥ i=1 X OPT (vi) 2Klα; − where the first expression is a result of Theorem 1, the second expression uses Proposition 29, the third expands the revenue over T terms, and the last uses Theorem 1. Rearranging the terms gives: RevM ′ ( ̄v) RevExp3 ( ̄v) RevExp3 ( ̄v) OPT ( ̄v) OPT ( ̄v) OPT ( ̄v) 2KlαT 2KlαT 2KlαT − − − ≥ ≥ ≥ − − γ + (cid:18) γ + (cid:18) β 2 β 2 (cid:19) (cid:19) HT HT − − Hn ln n βγ 2H(H/α)2ll (ln H βγ ln α) − 1/(2(1+l)), β = γ = T − We set variables α and β as a function of T to minimize the exponent of T in the regret. By 1/(4(1+l)), the regret is O setting α = T − The algorithm involves maintaining weights for all the menus in the discretized set at each time step, therefore the running time at each time step is proportional to the number of the menus that is derived based on parameter α. 2(1+l) ln (T )l(K + H 2l+1 ln H) T 1 − (cid:16) 1 . (cid:17) A.2.2 Online Learning Under Smooth Distributions Smoothed Distributional Assumptions. In an online setting under smoothed distri- T , where is an arbitrary distribution over butions, the algorithm receives samples problem instances Π (which in our case is the buyer valuations). The goal is to find ˆρ that u(v, ρ). In this setting, the goal is to find a value ρ that is nearly nearly maximizes optimal in hindsight over a stream v1, . . . , vT of instances, or equivalently, over a stream (t), u1 = u(v1, which may be adversarial. Therefore, ) of functions. Each vt is drawn from a distribution ), . . . , uT = u(vT , S ∼ D (T ). P D D ∈S (1) * * v v1, . . . , vT } ∼ D { × * * * × D Rd to [0, H]. In this Dispersion. Let u1, . . . , uT be a set of functions mapping a set paper, we study the mechanism selection setting, given a collection of problem instances v1, . . . , vT ∈ ) might equal Π and a utility function u : Π [0, H], each function ui( × C → C ⊆ * 30 * the function u(vi, ), measuring a mechanism's performance on a fixed problem instance as a function of its parameters. Informally, dispersion is a constraint on the functions u1, . . . , uT that guarantees although each function ui may have discontinuities, they do not concentrate in a small region of space. We study two definitions of dispersion previously introduced in algorithm and mechanism selection problems. We show that menus of two-part tariffs satisfy both definitions; (k, w)-dispersion (Definition 32) and β-dispersion (Definition 35). Then, we use the first to establish online learning results for full-information and bandit settings and the second for the semi-bandit setting. In order to prove menus of two-part tariffs satisfy dispersion under smoothed assump- tions, we show this family of mechanisms satisfies certain structural properties. Balcan et al. [2018c] show in two-part tariff menus, for each function ui, the parameter space is par- Pn such that ui is L-Lipschitz on each piece, but ui may have titioned into sets discontinuities at the boundaries between pieces.‡ We refine this structural property and show that multi-sets of parallel hyperplanes, corresponding to the stream of buyer valua- into convex polytopes with bounded-degree linear tions, partition the parameter space utility functions inside each polytope. Later, we show this property is sufficient for proving dispersion and employing the related algorithms. P1, . . . , C C Lemma 30. Consider the sequence of buyer valuations v arrived until time t. For menus of two-part tariffs, the parameter space Pn by multisets of parallel hyperplanes, such that the utility function at each time step inside each region Pj is a linear function satisfying (K + 1)-Lipschitz continuity. is partitioned into convex polytopes, P1, . . . , C Proof. Part of the proof that identifies the regions with linear utilities has been shown previously in Balcan et al. [2018c], Lemma 3.15. We reiterate that part for completeness and also prove the extra structural properties. Consider the set of menus for which the buyer with valuation v(i) arriving at time i selects the tariff index j and the number of units k. The buyer selects this option for menu ρ if it produces more utility for the buyer than any other option. Formally, v(i)(k) I k { 1 } ≥ − 1 (ρ) + kp(j) p(j) (cid:16) 2 (ρ) (cid:17) ≥ v(i)(k′) k′ I { 1 } ≥ − 1 p(j′) (cid:16) (ρ) + k′p(j′) 2 (ρ) . (cid:17) j′, k′ ∀ (2) The above inequalities identify a convex polytope of parameter vectors (menus ρ) with hyperplane boundaries. Considering all the possible selections (j, k) (the tariff index and the number of units), the parameter space for v(i) is partitioned into convex polytopes where inside each polytope the payment of v(i) is linear; i.e., I . Considering the same analysis for all the buyers' valuations in the sequence, for each buyer, (cid:17) the parameter space is partitioned into convex polytopes where inside each polytope, the revenue function is linear and (K + 1)-Lipschitz. Since convex polytopes are closed under intersection, superimposing the partitions for i = 1, . . . , t results in polytopes with the properties in the statement. 1 (ρ) + kp(j) p(j) (cid:16) 2 (ρ) ≥ k } { 1 ‡This previously-known structural result suffices for the techniques used in the setting with the limited number of buyers (Section 3.2.3 and appendix A.2.3); however, we need a refined statement for proving dispersion. 31 For a fixed valuation vector v(i), the discontinuities in the utility function are defined = v(i)(k′) I k′ 1 (ρ) + kp(j) p(j) (cid:16) 2 (ρ) by at most l2K 2 hyperplanes: v(i)(k) I k 1 1 1 { } { (cid:17) S ∈ − − ≥ (cid:9) [K] and i (cid:8) [l] and k, k′ (ρ) 2 v(1), . . . , v(t) (cid:17) (ρ) + k′p(j′) = ≥ . Let Ψv be the multi-set union of all these hyperplanes. Consider with corresponding multi-sets Ψv(1), . . . , Ψv(t) of hyperplanes. We Bj,k,j′,k′ for Bj,k,j′,k′, the hyperplanes in Bj,k,j′,k′ . To this end, define a single multi-set p(j′) } (cid:16) a set now partition the multi-set union of Ψv(1), . . . , Ψv(t) into at most l2K 2 multi-sets all j, j′ ∈ are parallel with probability 1 over the draw of Bj,k,j′,k′ to consist of the hyperplanes 1 (ρ) + kp(j) p(j) k (cid:16) 1 (ρ) + kp(j) p(j) (cid:16) (ρ) + k′p(j′) (ρ) + k′p(j′) (ρ) (ρ) , , (cid:17) (cid:17) [t] such that for each = v(2) (k′) = v(1) (k′) v(2) (k) v(1) (k) 2 (ρ) 2 (ρ) ≥ − ≥ − − − ≥ ≥ k′ k′ ∈ S (cid:17) (cid:17) k } { { { } } { } { 1 1 1 1 I I I I 2 2 . . . , v(t) (k) I k { 1 } ≥ − 1 (ρ) + kp(j) p(j) (cid:16) 2 (ρ) (cid:17) = v(t) (k′) k′ I { 1 } ≥ − (ρ) + k′p(j′) 2 (ρ) ; } (cid:17) where the only variables are coordinates of ρ. The hyperplanes inside each multi-set are parallel and the utility of the regions defined by the hyperplanes are linear and K + 1- Lipschitz.§ 1 1 p(j′) (cid:16) p(j′) (cid:16) p(j′) (cid:16) 1 Next, we establish an upper bound on the number of regions with continuous (linear) regions. Lemma 31. The partitioning of the parameter space for menus of two-part tariffs explained in Lemma 30 after T rounds results in O((T + 1)l2K 2) regions, with linear cumulative utility function inside each region. Bj,k,j′,k′ of size T for each j, k, j′, k′ such that the Proof. Lemma 30 identifies multi-sets hyperplanes inside the multi-sets are parallel. Therefore, each multi-set divides the parameter space into T + 1 parts. Thus, each region with continuous utility can be defined as the intersection at most l2K 2 parts, where each part corresponds to a distinct multi-set. This results in at most O((T + 1)l2K 2) such regions. In order to prove dispersion, we need to use an assumption on the distributions called κ-boundedness. Definition 4. [κ-bounded] A density function f : R κ. bution if max { f (x) } ≤ R corresponds to a κ-bounded distri- → We first provide the definition of (w, k)-dispersion. Recall that Π is a set of instances, Rd is a parameter space, and u is an abstract utility function. We use the l2 distance denote a ball of radius r centered at ρ. We use C ⊂ and let B(ρ, r) = this notion of dispersion to derive our full-information and bandit setting results. k2 ≤ Rd : ρ′ ρ′ − ∈ ρ { k } r §Partitioning of the parameter space by parallel multisets of hyperplanes has been established before for other families of mechanism design such as posted pricing [Balcan et al., 2018b]. We extend this idea to the more complicated case of two-part tariffs. 32 Definition 32 ([Balcan et al., 2018b], (w, k)-dispersion). Let u1, . . . , uT : [0, H] be a collection of functions where ui is piecewise Lipschitz over a partition Pi of . We say that Pi splits a set A if A intersects with at least two sets in Pi. The collection of functions is (w, k)-dispersed if every ball of radius w is split by at most k of the partitions PT . More generally, the functions are (w, k)-dispersed at a maximizer if there exists a point T i=1 ui(ρ) such that the ball B(ρ∗, w) is split by at most k of the partitions ρ∗ ∈ P1, . . . , argmaxρ PT . P1, . . . , C → C ∈C P We now prove menus of two-part tariffs satisfy (w, k) dispersion, and use it to derive no-regret online learning results for full-information and bandit settings. Proposition 33. Suppose that u(v, ρ) is the revenue of the two-part tariff menu mechanism with prices ρ and buyer's values v. With probability at least 1 ζ over the draw (1) D × * * * × D Suppose v(k) ≥ (T ) for any α 1/2 the following statement holds: [0, H] for any number of units k [K]. Also, suppose that for each (t), and every pair of number of units k and k′, v(k) and v(k′) have a κ- ∈ ∈ − S ∼ distribution bounded joint distribution. Then u is D 1 2HκT 1 − α , O l2K 2T α ln s lK ζ !! -dispersed with respect to . S Proof. Lemma 30 gives multisets of parallel hyperplanes that partition the parameter space into regions with K+1-Lipschitz continuous utility functions. Since the samples are drawn in- dependently from κ-bounded distributions with support [0, H], the offsets of the hyperplanes Bj,k,j′,k′ are independent random variables with Hκ-bounded distributions. in each multiset Furthermore, the number of multisets is at most l2K 2. Using these properties, Theorem 32 of Balcan et al. [2018b] gives the statement. After establishing dispersion and showing that the parameter space is partitioned into convex regions with cumulative linear utility inside each region, the no-regret guarantees and their performances are implied by prior results. Full Information For completeness we include previously established algorithms for the full information setting, under dispersion condition, adapted to our setting. Overview of Algorithms 5 and 6, related to Theorem 5. Algorithm 5 [Balcan et al., 2018b] is an efficient algorithm for online learning in the full-information setting under smoothed distributional assumptions that uses Algorithm 6 [Balcan et al., 2018b] as a sub- routine. The algorithm considers the cumulative revenue function up until the time t 1 t 0 us, and samples the menu to be presented at time t approx- over the parameter space, − imately proportional to an exponential function of its cumulative revenue, i.e., eg(ρt), where t 0 us. In order to have an efficient implementation for sampling menu ρt approx- g = λ − eg(ρt), techniques from high-dimensional imately from distribution μ with density fμ(ρ) P − 1 1 P ∝ 33 Algorithm 5: Full-information two-part tariffs under smoothed distributional as- sumptions (Adapted to two-part tariffs from [Balcan et al., 2018b], Algorithm 4) Input: λ ∈ 1: Set u0( * 2: for buyer t = 1, 2, . . . , T do (0, 1). (0, 1/H], η, ζ ) = 0 (to be the constant 0 function over ∈ ). C Present menu ρt obtained from Algorithm 6 with g = λ t 1 s=0 us, − approximation parameter η/4, and confidence parameter ζ/T to the buyer. (Menu ρt is sampled with probability that is approximately proportional to eg(ρt).); P Observe the revenue for all the potential menus as function ut( 1 (ρt) + kp(i) payment ut(ρt) = I 2 (ρt)), where i and k are the tariff index and the number of units chosen by buyer t respectively given menu ρt. ). Receive (p(i) ≥ k { } 1 * Algorithm 6: Multi-dimensional sampling algorithm ([Balcan et al., 2018b], Algo- rithm 2) Input: Function g, partition with regions confidence parameter ζ. P1, . . . , Pn, approximation parameter η, 1: Define α = β = η/3. 2: Let h(ρ) = exp(g(ρ)) and hi(ρ) = I 3: For each i 4: Choose random partition index I = i with probability ˆZi/ 5: Let ˆρ be the sample output by ρ { Aintegrate(hi, α, ζ/(2n)). Asample(hI, β, ζ/2). [n], let ˆZi = ∈ Pi} ∈ Output: ρ ˆZj. j P h(ρ) be h restricted to Pi. 34 P1, . . . , Pn be the partition of geometry are used in Algorithm 6. This algorithm is used when g is piecewise concave (in our case, linear), and each piece is a convex set (in our case, convex polytopes where each buyer already in the sequence selects a fixed tariff index and the number of units) as shown until time t. The algorithm first picks in Lemma 30. Let Pi with probability proportional to the integral of fμ on that region and then outputs a sample from the conditional distribution of menus in Pi. The algorithm assumes access Aintegrate(h, α, ζ) and to two procedures for approximate integration and sampling, namely Aintegrate(hi, α, ζ) is a polynomial running-time procedure that takes the Asample(h, β, ζ). approximate integral of any logconcave function hi restricted to region Pi with accuracy Asample(hi, β, ζ) is a polynomial procedure that ap- parameter α and failure probability ζ. proximately samples a menu with probability distribution according to hi in the region Pi with accuracy parameter β and failure probability ζ. C R R Z ≤ eα Aintegrate(h, α, ζ) and → Aintegrate(h, α, ζ) outputs a number Z that with probability at least 1 h. For any logconcave function h : Rd ≤ Asample(h, β, ζ) [Balcan et al., 2018b]). For any log- Definition 34 ( concave function h : Rd R, any accuracy parameter α > 0, and any failure probability ζ > 0, ζ satisfies − R, any accuracy parame- α e− h ter β > 0, and any failure probability ζ > 0, Asample(h, β, ζ) outputs a sample X drawn from a distribution ˆuh that with probability at least 1 (μ, ˆμ) ≤ is the relative (multiplicative) distance between probability measures μ and ˆμ. Formally, D dˆμ denotes the Radon-Nikodym derivative. (μ, ˆμ) = supρ | Similar to [Balcan et al., 2018b], we use the implementation of Aintegrate by Lov ́asz and Vempala Asample by Bassily et al. [2014], Algorithm 6. These implementations satisfy the [2006] and ζ , log R conditions in Definition 34. The first runs in time poly(d, 1 r ), where the domain of function h is a subset of a ball of radius R and its level set of probability mass 1/8 is a superset of a ball with radius r. The second succeeds with probability 1 and runs in time poly(d, L, 1 log dμ dˆμ | , where dμ β, where D α, log 1 (μ, ˆμ) ζ, D → − ∞ ∞ ∞ β , log R r ). (1) C → (T ). Suppose v(k) Theorem 5. Let u1, . . . , uT : [0, H] be the revenue functions of two-part tariff menus such that ut(ρ) denotes the revenue of a mechanism associated with menu parameters ρ for the buyer arriving at time t. Let the samples of buyers' values be drawn from [0, H] for any number of units k S ∼ [K]. Also, suppose that D × * * * × D (t), and every pair of number of units k and k′, v(k) and v(k′) have for each distribution a κ-bounded joint distribution. An efficient implementation of the exponentially weighted 2l ln(2H 2κ√T )/T /H (Algorithm 5) has expected regret bounded by forecaster with λ = ̃O((Hl2K 2√log κ + 1/(Hκ))√T ) and runs in time ̃O((T + 1)poly(l,K)poly(l, √T ) + KT √T ). q D ∈ ∈ − Proof. Proposition 33 determines the dispersion for two-part tariff menus with probability ζ. Theorem 1 in Balcan et al. [2018b] relates dispersion to a regret bound for full informa- 1 tion online learning algorithms. It states if a sequence of piecewise L-Lipschitz functions in d dimensions is (w, k)-dispersed, there is an exponentially weighted forecaster with expected regret O(H( ζ, the T d log R/w + k) + T Lw)) + ζH. Substituting w and k final regret bound is O((1 p T d log R/w + k) + T Lw). Since dispersion holds with probability 1 ζ)(H( − − p 35 by dispersion found in Proposition 33 gives: O H 2T l log(2H 2κT 1 − α) + l2K 2T α lK ζ ! + T α 2Hκ ln s + ζHT . ! p [T ], the sum of utilities is linear over at most (T + 1)l2K 2 pieces, and all For all rounds, t the pieces are convex. In this case, we may use Algorithm 6 as a subroutine to Algorithm 5 for a more efficient but approximate implementation. Setting dispersion parameters ζ = 1/√T and α = 0.5 and approximation parameters η = ζ = 1/√T and using Theorem 1 in Balcan et al. [2018b], gives the statement's regret bound and running time. ∈ Bandit Setting The bandit-setting algorithm considers a grid over the parameter space, whose granularity depends on the dispersion parameters, and runs the Exp3 algorithm over menus correspond- ing to the grid. (1) C → Theorem 6. Let u1, . . . , uT : [0, H] be the revenue functions of two-part tariff menus such that ut(ρ) denotes the revenue of a mechanism associated with menu parameters ρ for the buyer arriving at time t. Let the samples of buyers' values be drawn from S ∼ [K]. Also, suppose D (t), and every pair of number of units k and k′, v(k) and v(k′) that for each distribution have a κ-bounded joint distribution. There is a bandit-feedback online optimization algorithm with expected regret ̃O H 2K√lκd/2√log κ . The per-round running time is O(H 4lκ2lT l). [0, H] for any number of units k (T ). Suppose v(k) + 1/Hκ + Hl2K 2 T (2l+1)/(2l+2) × * * * × D D ∈ ∈ (cid:17) (cid:16) (cid:17) (cid:16) ζ. Proof. Proposition 36 determines dispersion for two-part tariff menus with probability 1 Theorem 3 in Balcan et al. [2018b] relates dispersion to a regret bound for the bandit setting. It states if a sequence of piecewise L-Lipschitz functions that are (w, k)-dispersed and when the parameter space is contained in a ball of radius R, running Exp3 algorithm has regret − O H  T d s 3R w (cid:18) d log (cid:19) R w + T Lw + Hk .    The per-round running time is O((3R/w)d). Note that dispersion holds only with probability ζ and with probability ζ, regret is bounded by HT . In our case, L = K + 1, R = H 1 and d = 2l. Substituting these terms along with w and k, and setting α = 2l+1/2l+2 and ζ = 1/√T gives the regret bound and running time in the theorem statement. − Semi-Bandit Setting For the semi-bandit setting, we need to invoke a more recent defi- nition of dispersion. Definition 35 ([Balcan et al., 2020a], β-point-dispersion). The sequence of loss functions β, we l1, l2, . . . is β-point-dispersed for the Lipschitz constant L if for all T and for all ε have that, in expectation, the maximum number of functions among l1, . . . , lT that fail the L- is at most ̃O(εT ). That is, for all Lipschitz condition for any pair of points at distance ε in T − ≥ C 36 β, we have E ≥ t ρ [T ] : ρ′ T − T and for all ε where the max is taken over all ρ, ρ′ maxρ,ρ′ { : (cid:12) k (cid:12) Proposition 36. Suppose lt(ρ) = H ut(ρ), where ut(ρ) is the revenue of the two-part tariff menu mechanism with prices ρ and buyer's values vt at time t, where buyers' values (i) are κ-bounded, where κ = ̃o(T ), and K and l, are drawn from the maximum number of units and the number of tariffs, are polynomial in T , these loss functions are β-point-dispersed for β = 1/2. × * * * × D | k2 ≤ lt(ρ) ε. > L k (T ). If lt(ρ′) ∈ − k2} ∈ C (cid:12) (cid:3) (cid:12) − − − D D ρ′ (1) ρ (cid:2) | = ̃O(εT ). Proof. We use the following statement from Balcan and Sharma [2021], theorem 7. R be independent piece- Proposition 37. [Balcan and Sharma, 2021] Let l1, . . . , lT : Rd wise L-Lipschitz functions, each having discontinuities specified by a collection of at most K ′ algebraic hypersurfaces of bounded degree. Let P denote the set of axis-aligned paths between pairs of points in Rd, and for each s lt has a discontinuity along s O( P define D(T, s) = P D(T, s)] ∈ . Then we have E[sups ≤ | ≤ E[D(T, s)] + |{ sups ∈ T log(T K ′)). → }| ≤ ∈ T 1 t P The number of hyperplanes, defined as K ′ in the theorem, is at most T l2K 2 and lts p are piecewise (K + 1)-Lipschitz function (by Lemma 51); where T is the number of buyers (rounds), l is the number of tariffs, and K is the maximum number of units. Note that, as shown in Lemma 30. The independence of lts comes from the assumptions of this setting, where the buyer valuations for each round are drawn independently. | | P ρ − − p (cid:12) (cid:3) (cid:12) k2} ut(ρ) { (cid:12) (cid:12) maxρ,ρ′ P ∈ > L k t ∈ E[D(T, s)]. Definition 35 counts the number of times (in T time intervals) that the difference in utility of the pair violates the L-Lipschitz condition, and finds the worst pair for this property. Proposition 37, counts the number of times that in an axis-aligned path, the utility function E[D(T, s)] + O( T log(T K ′)) is an upper bound on has discontinuities. Therefore, sups E ρ′ ut(ρ′) [T ] : . To find the dispersion we need to find sups (cid:2) ∈ Recall from the proof of Proposition 33 that the discontinuities can be partitioned into l2K 2 multisets of parallel hyperplanes, such that multiset Bj,k,j′,k′ corresponds to pairs of tariffs and the number of units (j, k) and (j′, k′). In addition, since we assume the buyers' valuations are in the range [0, H] and are drawn from pairwise κ-bounded joint distributions, the offsets of the hyperplanes are independent draws from a Hκ-bounded distribution. The number of multi-sets is l2K 2, and the size of each multi-set is T . The hyperplanes within Bj,k,j′,k′, let Θj,k,j′,k′ be the multi-set of the each multi-set are well-dispersed. For a multi-set hyperplanes' offsets. By assumption, the elements of Θj,k,j′,k′ are independently drawn from Hκ-bounded distributions. Since the offsets are Hκ-bounded, the probability that it falls in any interval of length ε is O(Hκε). The expected number of hyperplanes crossed from , and since there are 2l each multiset in distance ε along each axis is at most Hκε |Bj,k,j′,k′ | dimensions, the total expected number of crossings is 2lHκε . Using the upper bound |Bj,k,j′,k′ | E[D(T, s)] = O(l3K 2HκεT ). , in total, for any pair of points at distance ε, sups on P E[D(T, s)] + O( By Proposition 37, E[sups T log(T Kl)), which in our sups P case is upper bounded by: O(l3K 2HκεT + T log(T Kl)). For κ = ̃o(T ), K = O(poly(T )) P D(T, s)] = ̃O(εT ). Therefore, these loss functions are β-point and l = O(poly(T )), E[sups dispersed for β = 1/2, satisfying the statement. P D(T, s)] ∈ |Bj,k,j′,k′ p p ≤ ∈ ∈ ∈ | 37 Overview of Algorithm 7 The generic algorithm for the semi-bandit case was previously developed in Balcan et al. [2020a]. We adapt it to our setting and consider an efficient implementation using the approximate integration and sampling from Balcan et al. [2018b] discussed in Definition 34. The semi-bandit-setting algorithm is a continuous version of the Exp3-SET algorithm of Alon et al. [2017]. At each time step, the algorithm learns the ρt that the presented menu belongs to and revenue function (only) inside the region updates the menu weights for the next round accordingly. P ∋ (t) Algorithm 7: Semi-bandit two-part tariff under smoothed distributional assump- tions (Adapted from [Balcan et al., 2020a], Algorithm 1 for two-part tariffs) ∈ [0, 1] Input: Step size λ 1: Let w1(ρ) = 1 for all ρ 2: for buyer t = 1, . . . , T do Let pt(ρ) = wt(ρ) wt(ρ) dρ; Wt Sample ρt from pt, present it to buyer t, observe the tariff index j and the , where Wt = ∈ C C R number of units k selected by the buyer and region P (t) is ut(ρ) = I takes this action; the revenue inside P { ≥ ut(ρ) and the normalized loss is lt(ρ) = H (t); for all ρ − H ∈ P I Let ˆlt(ρ) = ρ (t)) = (t)) lt(ρ), where we define pt( { pt( Let wt+1(ρ) = wt(ρ) exp( λˆlt(ρ)) for all ρ. ∈P P P (t) } } P R − (t) for which the buyer 1 (ρ) + kp(i) k (p(i) 1 2 (ρ)) (t) pt(ρ) dρ; (t) is Theorem 7. Suppose the buyers' values are drawn from κ-bounded for κ = ̃o(T ). Then, running the continuous Exp3-SET algorithm (Algorithm 7) for menus of two-part tariffs under semi-bandit feedback has expected regret bounded by ̃O(H√lT ). An efficient implementation has the same regret bound and running time ̃O((T + 1)poly(l,K)poly(l, √T ) + KT √T ). (T ), where each × * * * × D D D (1) Proof. For the regret bound, we invoke Theorem 2 of Balcan et al. [2020a], stating that if the loss functions are Lipschitz functions satisfying β-point-dispersion, running Algorithm 7 has expected regret bounded by ̃O(√dT + T 1 β), when the loss function is in [0, 1]. In our − case, d, the number of dimensions is 2l, the dispersion parameter β = 1/2, and the loss function is in [0, H]. This implies the regret bound. P Now, we discuss the running time of the algorithm. At each time t, using the buyer's valuation vector, the tariff j and the number of units k selected by the buyer, we can deter- (t), where the buyer makes the same selection and whose utility function mine the region is linear by solving a linear program (the inequalities in Equation (2)). This computation is done in time poly(l, K). Next, for the integration procedures inside the algorithm, we use the approximate version introduced in Definition 34 and for sampling, we use the efficient implementation demonstrated in Algorithm 6. In particular, we consider η = ζ = 1/(3√T ). wt(ρ) dρ, we use lines 1 through 3 of Algorithm 6 and take the sum of the integra- For (t) pt(ρ) dρ we do tion outcomes of line 3, for η′ = η/4 and ζ ′ = ζ/T . For pt( the same, except that now we do the integration operations in line 3 only for the regions (t). For sampling ρt from pt, we use the complete procedure Algorithm 6 that takes inside (t)) = P R C R P P 38 q 2l ln(2H 2κ√T )/T /H, g = λ t s=0 us and the regions with linear cumulative utility, λ = − η = ζ = 1/(3√T ). Note that since the loss is only updated for (t), for any regions out- P side this part, we do not need to repeat the integration operations in Algorithm 6. This may result in potentially better running time for semi-bandit compared to full-information; however, we do not quantify the improvement. Using union bound, with probability at least 1/√T , all the approximate integration and sampling operations performed in the algo- 1 rithm succeed and the density function of the approximate distribution used for sampling η) fraction of the exact distribution. Using these parameters together is always within (1 with Theorem 1 in [Balcan et al., 2018b] conclude that the same regret bound is achievable from the approximate operations and give the running time in the statement. − − P 1 A.2.3 Limited Buyer Types We reiterate the results of partitioning the parameter space into convex regions with linear cumulative utility functions where the statements are adapted to the limited buyer type setting and corresponding notations. Lemma 38. [Adapted from Balcan et al. [2018c], Lemma 3.15] For each feasible mapping μ, as defined in Definition 9, Pμ is a convex polytope with hyperplane boundaries. (i) Proof. For a fixed buyer type i and option (j, k), let (j,k) be the set of all parameter vectors ρ corresponding to the length-l menus that buyer type i selects option (j, k). The buyer selects option (j, k) for menu ρ if this option produces more utility for the buyer than any other option. Formally, P vi(k) I k { 1 } ≥ − 1 (ρ) + kp(j) p(j) (cid:16) 2 (ρ) (cid:17) vi(k′) k′ I { 1 } ≥ − ≥ 1 p(j′) (cid:16) (ρ) + k′p(j′) 2 (ρ) . j′, k′ ∀ (cid:17) The above inequalities identify a convex polytope of parameter vectors (menus ρ) with hyperplane boundaries. Pμ is also a convex region with hyperplane boundaries. (i) μ(i) for i = 1, . . . , V . Therefore, Pμ is the intersection of P Lemma 39. [Adapted from Balcan et al. [2018c], Lemma 3.15] For each feasible mapping μ and any sequence of buyer valuations b the cumulative utility, Pμ. Proof. We show that for any buyer valuation vi in the sequence, u(vi, ρ) is linear in the region. Proving this claim is sufficient for concluding the statement. Let (j, k) = μ(vi), i.e., j is the tariff index and k is number of units that buyer valuation vi selects under μ. Therefore, the utility for this buyer for menu ρ . Both p(j) each buyer valuation selects (the tariff index and the number of units) is fixed inside utility is also linear. (cid:17) 2 (ρ) grow linearly as a function of ρ. Therefore, since the option that Pμ, the 1 (ρ) + kp(j) p(j) (cid:16) i u(bi, ρ), is linear in ∈ Pμ is vi(k) 1 (ρ) and p(j) 2 (ρ) P ≥ − k } { 1 I Full Information Setting Theorem 13. In the full information case for length-l menus of two-part tariffs, when there are V types of buyers, running Algorithm 2 over the set of menus corresponding to set for β = 1/√T has regret bounded by ̃O(Hl√T ln(V lK)). E 39 E Proof. We run the weighted majority algorithm Algorithm 2 with parameter β = 1/√T on as the set of menus (experts). The proof directly follows from Lemma 12 and the set . Let bi be the valuation of the buyer at step i, and ̄b be the Proposition 28. Let n = vector of valuation of all buyers in rounds 1 through T . We denote Rev () as the maximum revenue obtained in the set of , OPT() as the optimal revenue, and RevWM() as the revenue obtained from Algorithm 2 on the set of experts X = . Then, |E| E E E n ̄b RevWM (cid:1) (cid:0) ̄b (cid:0) (cid:1) (bi) Rev E Rev E ≤ ≥ = ≥ (V l2K 2/4)2l, Rev( ) E ̄b β 2 − Rev( ) E ̄b H ln n β , − T (cid:0) Rev E i=1 X OPT (bi) (cid:0) (cid:1) (cid:1) (bi) , 2Kε; − where the first expression uses the size of in Lemma 11, the second expression uses E Proposition 28, the third expands the revenue over T terms, and the last uses Lemma 12. Rearranging the terms, we have: Rev E Rev (bi) ̄b E RevWM RevWM ̄b (cid:0) (cid:1) (cid:0) (cid:1) ̄b (cid:0) (cid:1) OPT (bi) OPT ̄b 2Kε 2KεT − − OPT ̄b (cid:0) (cid:1) OPT (cid:0) (cid:1) ̄b 2KεT 2KεT − − ≥ ≥ ≥ ≥ βHT − 2 − βHT − 2 − H ln n β 2lH (ln (V lK)) β We set variables ε and β to minimize the exponent of T in the regret. By setting β = 1 √T and ε = 1/(K√T ), The regret will be O(Hl√T ln (V lK)). (cid:0) (cid:1) Partial Information Setting We first show how to estimate the utility of any menu by only using the response of the buyer to a limited number of menus. In doing so, we take advantage of the interdependence of the buyers' responses for different menus to obtain estimates for unused menus. In particular, using barycentric spanner concept from [Awerbuch and Kleinberg, 2008], we devise a basis for the menus such that observing buyers' responses to them is sufficient for estimating the revenue of other menus. I Let be a set of length-V indicator vectors, such that for each feasible mapping μ and option to select (j, k), which is the tariff index and the number of units, there is a vector in . This vector indicates the (maximal) set of buyer types that select this option in mapping I μ. As an example, if in mapping μ, is the exact set of valuation types that select the same option (j, k), vector (0, 1, 1, 0, . . .) belongs to , μI and (j, k)I denote the corresponding mapping and option to I, respectively. Similarly, Iμ,(j,k) is the vector in , corresponding to mapping μ and option (j, k). Using principles from linear algebra, since such that any other is a linear combination of the vectors in this set. Awerbuch and Kleinberg make , called the barycentric I the vectors are V -dimensional, there is a set of at most V vectors in vector in this property stronger and show that there is a set of V vectors in v2, v3} . For I ∈ I I I I { I 40 S with coefficients in [ − such that, for all I 1, 1]. spanner or spanner for short, we denote it by as a linear combination of vectors in S , such that any member of can be written I S 1, 1], so that I = Lemma 40. There exists set λ1, . . . , λV ∈ Proof. The statement is a direct corollary of [Awerbuch and Kleinberg, 2008] Proposition 2.2. , there exists coefficients in I V j=1 λisj. ∈ I [ − P Here is the main idea on how to find estimates for the utility of all the menus by to the buyers. First, similar only presenting the menus corresponding to the spanner to Balcan et al. [2015], we define function fτ ( that will be instrumental * in computing the utility for all the menus based on the spanner. Recall that each vector I corresponds to a mapping μI and an option (j, k)I. Let fτ (I) be the number of times in during a time block τ that given a menu in Pμ the arriving buyer selects option (j, k). First, we show how the quantity of this function on inputs from the spanner is sufficient for finding the revenue of arbitrary menus and then show how to estimate it. ) for the vectors in S I I Lemma 41. For each menu ρ and any time block τ : t + 1, . . . , t + τl, let uτ (ρ) represent the average utility of ρ for buyer types in τ . Then, uτ (ρ) = 1 lτ I k { 1 } ≥ 1 (ρ) + kp(j) p(j) (cid:16) 2 (ρ) X(j,k) ∈O V (cid:17) i=1 X λi(Iμρ,(j,k))fτ (si) Proof. By definition, uτ (ρ) is the average utility of menu ρ for buyers arriving in τ . Menu ρ, corresponds to a feasible mapping μρ. By definition, the buyers in time block τ select option (j, k) equal to fτ (Iμρ,(j,k)) number of times. By Lemma 40, Iμρ,(j,k) can be written as a linear combination of the vectors in the spanner. Furthermore, fτ (.) is a linear function as it is equivalent to the dot product of a vector indicating the frequency, i.e., the number of arrivals, of each buyer type during τ and the function input. Therefore, uτ (ρ) = = 1 lτ 1 lτ X(j,k) ∈O X(j,k) ∈O I k { 1 } ≥ 1 (ρ) + kp(j) p(j) (cid:16) 2 (ρ) (cid:17) fτ (Iμρ,(j,k)) I k { 1 } ≥ 1 (ρ) + kp(j) p(j) (cid:16) 2 (ρ) V (cid:17) i=1 X λi(Iμρ,(j,k))fτ (si). Let ˆfτ (si) be the estimator to fτ (si)/lτ for the spanner vectors. Let μsi be the corre- sponding mapping to si. Recall that fτ (si) is the number of times during τ that given a Pμsi , the arriving buyer, selects option (j, k)si. In order to estimate this quantity we menu in present a corresponding menu to si, i.e., a menu in Pμsi , once uniformly at random during the time block τ . If the buyer selects option (j, k)si, we let ˆfτ (si) equal to 1 and otherwise set it to 0. The next lemma shows that ˆfτ (si) has the same expected value and has range [0, 1]. Intuitively, the reason is that due to uniform random selection of the time step, the estimator has the same expected value. 41 Lemma 42 (Adapted from Balcan et al. [2015] Lemma 6.3). For any s fτ (s). Proof. Note that ˆfτ (s) = 1 if and only if at the time step that menu ρs was presented, (j, k)s was selected. Since ρs is presented once uniformly at random over the time steps and is independent of the sequence of buyers, the buyer presented with ρs is also picked uniformly at random over the time steps. Therefore, E[ ˆfτ (s)] is the probability that a randomly chosen buyer from time block τ selects (j, k)s. ∈ S , E[ ˆfτ (s)]lτ = Now, we prove that the expected value of the utility estimator for each menu is equal to the utility of that manu, i.e., the estimator is an unbiased, and moreover, has a bounded range. The utility estimator is defined as follows, where fτ (si)/lτ in the utility formula is replaced by its estimator ˆfτ (si). ˆuτ (ρ) = I k { 1 } ≥ 1 (ρ) + kp(j) p(j) (cid:16) 2 (ρ) X(j,k) ∈O V (cid:17) i=1 X λi(Iμρ,(j,k)) ˆfτ (si) Lemma 43. For any menu ρ, E[ˆuτ (ρ)] = uτ (ρ) and ˆuτ (ρ) lKV H, lKV H]. [ − ∈ Proof. The proof of the equality of the expectation simply follows from ˆuτ (ρ) and uτ (ρ) definitions and Lemma 42. Now, we prove the range of the estimator. Since S is a barycentric spanner, for any I . Also, the utility of the buyer selecting each option in the menu, e.g., p(j) 2 (ρ), is always in [0, H]. Therefore, using the formula of the estimator, it is bounded by H times the number of options times the number of buyer types. 1, 1]. Also, ˆfτ (.) belongs to 1 (ρ)+kp(j) , λi(I) [ − ∈ I 0, 1 ∈ } { We use the algorithm below along with the weighted majority algorithm in the full- as information (similar to Algorithm 2) that uses the utility (revenue) estimates. We use the set of experts (menus) and obtain distribution q over set as the weight vector. E E Overview of Algorithm 8 First, we provide a high-level structure of the algorithm and then discuss the details. The algorithm operates in time blocks, with each block consisting of exploitation and exploration time steps. The exploration time steps are selected uniformly at random within the block and are limited in number. In an exploitation step, the menu used is the output of the full information algorithm, employing the utility estimators from the previous time block. These menus are always the extreme points of the continuity regions, as discussed at the beginning of the section. During exploration time steps, the corresponding menu to a vector in the spanner is used. At the end of each time block, the algorithm refines the unbiased estimators of the utility of all extreme points using the information gathered in the exploration phases. Z is the number of time blocks, with each time block consisting of T /Z time steps. The algorithm uniformly at random picks time steps t1, . . . , tV and their permutation π in the current time block. Whenever the time step is equal to ti, the algorithm runs an exploration step; otherwise, the algorithm runs an exploitation step. In the exploration step at time step ti, a menu corresponding to si, ρsπ(i), is presented to the arriving buyer and the estimator ˆfτ (sπ(i)) will be assigned as 1 if the buyer selects (j, k)sπ(i) and will be assigned as 42 Algorithm 8: Partial-Information Algorithm for Limited Buyer Types (adapted from [Balcan et al., 2015] Algorithm 1) : the set of menu options ( = l(K + 1)) Input: V : the number of buyer types, 2V log( = 1: Z ← 2: Create set V ))1/3 (T 2 O |O| I |O| Iμ,(j,k)| { for all options (j, k) and feasible mappings μ component of Iμ,(j,k) is 1 iff vi selects (j, k) in μ and is 0 otherwise. 3: Find a barycentric spanner s1, ..., sV } corresponding mapping, (j, k)s, the corresponding option, and ρs a menu in . For every s ∈ S for = S I { |O| ⊲ the number of time blocks such that the ith } 4: for all I do ∈ I let λ(I) be the representation of I in spanner . That is S 5: Let q1 be the uniform distribution over 6: for τ = 1, ..., Z do . E ⊲ initial weight vector over menus in P E ⊲ time blocks Choose a random permutation π over [V ] and t1, . . . , tV from [T /Z].; for t = (τ 1)(T /Z) + 1, ..., τ (T /Z), do ⊲ time steps in a time block ⊲ exploration time step , let μs be the Pμs. V i=1 λi(I)si = I. if t = ti for some i − ∈ ρt ← If (j, k)sπ(j) is selected, then ˆfτ (sπ(j)) [V ], then ρsπ(j); else ← 1, otherwise ˆfτ (sπ(j)) 0; ← ⊲ exploitation time step draw ρt at random from distribution qτ ; for all ρ ∈ E ˆuτ (ρ) = , for μ such that ρ I ∈ Pμ, do 1 (ρ) + kp(j) p(j) } and (ˆuτ ) as their revenue function; Call Algorithm 2 for experts (cid:16) P E And receive qτ +1 as a distribution over all mixed strategies in 2 (ρ) (cid:17) P (j,k) ≥ ∈O k { 1 V . i=1 λi(Iμρ,(j,k)) ˆfτ (si).; E 43 0, otherwise. At the end of the time block, we update the estimates of the revenue of the menus corresponding to the extreme points. Lemma 44. [[Balcan et al., 2015] Lemma 6.2] Let M be the set of all actions. For any M, let cT ′(j) be the average time block (set of consecutive time steps) T ′ and action j loss of action j over T ′. Assume that S M is such that by sampling all actions in S, M with the following properties: E[ˆcT ′(j)] = cT ′(j) and we can compute ˆcT ′(j) for all j Lmin+O ˆcT ′(j) , where Lmin is the loss of the best action in hindsight. ∈ κ, κ]. Then there is an algorithm with loss Lalg 3 log [ − 3 κ M 3 ( ⊆ ≤ ∈ ∈ S T ) 2 3 | | | | 1 1 1 (cid:16) (cid:17) We are now ready to prove the main result of this section. Theorem 14. In the partial information (bandit) case for length-l menus of two-part tar- iffs, when there are V different types of buyers, there is an algorithm with regret bound of ̃O(T 2/3l(HKV )1/3 log1/3(V lK)). | S is the number of dimensions (barycentric spanner set), κ is the Proof. In Lemma 44, maximum revenue times the number of buyer types times the number of their options (entries = 2l, κ = HlKV , and in the menu), (V l2K 2/4)2l. By Lemma 43, the expected value of the estimated utility is equal to M | the exact value of utility with range [ is the number of discrete points. In our case, HlKV, HlKV ]. | ≤ M S | | | | | − Using Lemma 44, the regret for menus of two-part tariffs is bounded by O(T 2/3l1/3(HlKV )1/3l1/3 log1/3(V lK)) O(T 2/3l(HKV )1/3 log1/3(V lK)). ∈ The following quantifies the regret of simply running the Exp3 algorithm on the set of extreme points. Proposition 45. In the partial information case for length-l menus of two-part tariffs when there are V buyer types, running Algorithm 3 over menus corresponding to for β = γ = T − T 2/3lH(V l2K 2/4)2l ln (V lK) 1/3 has regret bound O E . (cid:0) Proof. The proof is similar to that of Theorem 6. We denote RevExp3() as the revenue obtained from Exp3 algorithm as presented in Algorithm 3 on the set of menus corresponding . Let n denote the number of such menus. bi is the valuation of the buyer at step i, and to ̄b is the sequence of valuation of all buyers in rounds 1 through T . Rev () is the maximum revenue obtained in the set and OPT() is the optimal revenue. E E (cid:1) E γ + (cid:18) β 2 (cid:19) Rev( ) E ̄b Hn ln n βγ , − (cid:0) (cid:1) n ̄b RevExp3 (cid:0) (cid:1) ̄b (cid:1) (cid:0) (bi) Rev E Rev E ≤ ≥ = ≥ (V l2K 2/4)2l, Rev( ) E ̄b − T (cid:0) Rev (cid:1) (bi) , E i=1 X OPT (bi) 2Kε; − 44 where the first expression uses the size of Proposition 29, the third expands the revenue over T terms, and the last uses Lemma 12.Rearranging the terms, we have: in Lemma 11, the second expression uses E Rev E Rev E (bi) ̄b RevExp3 RevExp3 ̄b (cid:0) (cid:1) (cid:0) (cid:1) ̄b ≥ ≥ ≥ ≥ OPT (bi) OPT ̄b 2Kε 2KεT − − OPT ̄b (cid:0) (cid:1) (cid:0) (cid:1) ̄b OPT 2KεT 2KεT − − − − γ + (cid:18) γ + (cid:18) β 2 β 2 (cid:19) HT HT (cid:19) Hn ln n βγ 2lH(V l2K 2/4)2l (ln (V lK)) βγ − − . (cid:1) We set variables ε in (cid:0) (cid:1) regret. By setting β = γ = T − (cid:1) (cid:0) and β = γ as a function of T to minimize the exponent of T in the T 2/3lH(V l2K 2/4)2l ln (V lK) 1/2, the regret is O 1/3 and ε = T − E Remark. The standard technique for the partial information algorithm of running the Exp3 algorithm on the extreme points leads to a regret bound that is exponential in the size of the menu as stated in Proposition 45; however, Algorithm 8 has regret bound polynomial in the size of the menus. Therefore, the new technique results in a significant improvement. (cid:0) A.3 Distributional Learning Theorem 15. In the distributional setting, for length-l menus of two-part tariffs, there exists a learning algorithm with sample complexity H 2 ) + ln (2/δ)), and running time H 2 2ε2 2ε2 (2l ln ( 2KHl + ln (2/δ) 2HKl ε 2KHl ε 2l ln Kl 2l . ε (cid:1) (cid:0) (cid:1) (cid:0) (cid:0) (cid:1) δ, the difference Proof. We need to find the number of samples such that with probability 1 between the expected revenue of our algorithm and the optimal revenue is at most ε. Note that since our algorithm uses discretization of possible menus, we face two types of errors: the discretization error, and the usual empirical error in a PAC learning setting. We find the sample complexity and discretization parameters such that the total error is bounded by ε. The possible number of menus after discretization using parameter N is computed by − the following formula. = (H/α)2l. |H| Using uniform convergence in the PAC learning setting, the sample complexity for empirical error ε′ is as follows. Replacing ln we have, H S | | ≥ H 2 2ε′ 2 (ln + ln (2/δ)) . |H| S | | ≥ H 2 2ε′ 2 (2l ln (H/α) + ln (2/δ)) . Also, the revenue loss compared to the optimum for arbitrary buyer i with valuation vi is: RevM ′ (vi) OPT (vi) 2Klα. − ≥ 45 The total error (from discretization and empirical error), when the empirical error is set to ε′, is By setting 2Klα = ε′, we have 2Klα + ε′. α = ε′ 2Kl , Replacing α gives the following sample complexity: S | | ≥ ≥ H 2 2ε′ H 2 2ε′ 2 (2l ln (H/α) + ln (2/δ)) 2 (2l ln (2KlH/ε′) + ln (2/δ)) which by replacing ε′ with ε/2 results in ε total error. The computational complexity of finding the empirical optimal menu for menu of size l is: This implies the efficiency of the algorithm. O( S | | Kl |H| ) = Kl S | | 2HKl ε 2l . (cid:19) (cid:18) buyers and S | | Lemma 46. The running time of distributional learning algorithm for two-part tariffs in [Balcan et al., 2020b] is at least H ε c (cid:18) 2 18l log (82K 2l3) + log (cid:19) (cid:18) 2l+1 1 δ (cid:19)! K 4l+2(2l)2+1/18. Proof. The algorithm involves computing N 2lK 4l regions, where N is c(H/ε)2(18l log (8K 2l3)+ log 1 δ ), and solving a linear program for each region with 2l variables and NK 2 constraints, which takes ̃O((2l)2+1/18NK 2). Comparison with previous results. The sample complexity using the pseudo-dimension method of [Balcan et al., 2018c] is O(H 2/ε2(l log (Kl) + log (1/δ))) and the best previously- known running time [Balcan et al., 2022a] is O , where R the number of discontinuity regions is bounded by O([H 2/ε2(l log (Kl)+log (1/δ))]3K), (cid:0) (H 2/ε2(l log (Kl) + log (1/δ)))2l+1 K 4l+2(2l)2+1/18 resulting in the worst case running time of O due to [Balcan et al., 2020b, 2022a] (See Lemma 46). (cid:16) R2(2l)2l+1KH 2/ε2(l log (Kl) + log (1/δ)) (cid:1) (cid:17) B Missing Proofs of Section 4 B.1 Missing Proofs for the Discretization Procedure Before providing the proof of the discretization step, we note that this procedure for menus of lotteries needs extra care and the common rounding of the parameters may result in arbitrarily lower revenue. For example, if there are two lotteries with a similar utility for 46 the buyer but a large difference in prices, minor changes in the probability of allocations or the prices may make the user switch from the high-price lottery to the low-price one. What follows is a concrete example of why standard rounding procedures fail. Example 1. Consider a menu of three lotteries. alloc. prob. price 0 0.26 0.95 alloc. prob. 0 0.5 1 0 0.24 0.52 price 0 0.125 0.5 utility 0 -0.084 0.05 utility 0 0.175 0.1 alloc. prob. 0 0.25 0.5 utility 0 0.025 -0.2 alloc. prob. price utility price 0 0.125 0.5 0 0.5 1 0 0.25 1 0 0.05 -0.4 Consider the buyer that has value 0.6 for the item. The first table shows the original menu. With this menu the buyer's highest utility option is the last lottery that causes the highest revenue, i.e., Rev = 0.52. The following tables show the new menus after rounding down the allocation probabilities and prices, rounding up allocation probabilities and rounding down prices, and rounding up allocation probabilities and prices (all to powers of 1/2), respectively. All these transformations result in the highest utility lottery changing to the middle lottery which causes smaller revenue. Theorem 16. Given a menu of lotteries M and parameters 0 < α < 1, 0 < δ < 1, and K, an arbitrary natural number, Algorithm 4 outputs menu M ′ such that Rev(M ′) Rev(M)(1 mH(1 − 0, (1 bilities is − { the set of possible prices is most O ≥ δ)K. The set of possible allocation proba- , where K ′ = and . This constitutes a space with at discrete points, when limiting to length-l menus and (2K + 1)α − α)K ′ α)0 = 1 } 0, Hmα, 2Hmα, . . . Hm } (1/αlm+l) (ln (Hm/α))lm 1/α ln (Hm/α) ⌋ ⌊ α)K − α)K ′ − 1, . . . (1 − , (1 δ)(1 − − { − O (cid:16) 2(1/αm+1)(ln (Hm/α))m (cid:16) (cid:17) discrete points for arbitrary-length menus. (cid:17) Proof. Most of this proof is identical to that of Dughmi et al. [2014]. Note that in the algorithm, the original entries in a menu are divided into levels k = 1, . . . , K such that k = 1 is the lowest-price level and k = K is the highest price one. First, we show that if a buyer's utility-maximizing lottery is in level k given M, their utility-maximizing lottery in M ′ is never in a lower-price level k′ < k. Intuitively, the reason is that the lotteries with lower-level prices have their allocation reduced more and their prices reduced less than the ones in higher levels. More formally, let (x, p) be at level k and (y, q) at level k′ < k. Also, let (x′, p′) and (y′, q′) be the transformed lotteries in the output of the algorithm. Than, q) α, and for every 2k′α p′ − − − α)K(x valuation v, x′ α. Now, v (1 * − * consider an arbitrary valuation v that has higher utility choosing (x, p) than y, q. Therefore v. Combining this inequality with the x ≥ ones above implies x′ q, and therefore p v p′ ((1 − α)K − 2kα) − v > ((1 α)K(p (1 α)Kp y′ v α)Kq v (1 ≤ k′ y − − α) − − k+1x − α) α)K q ≤ q′. q′ < ((1 − − − v v) ≥ − − − − − − − − y′ x p y y y v v v v * * * * * * * * Secondly, we compute an upper bound on the loss incurred. Suppose the original utility- maximizing lottery was (x, p) in M. Also, suppose in M ′, the utility-maximizing lottery is * − ≥ * − − 47 − − (1 mH(1 (y′, q′) which is the transformation of (y, q). The first scenario is when p Note that in this case, q may be smaller by a factor (1 we first lost a multiplicative factor of (1 (2K + 1)α (including the rounding). Thus q′ second case where p < mH(1 q′ δ)K. ≥ δ) than p, then to obtain q′ α)K and then an additive factor of at most α)Kp (2K + 1)α. In the δ)K. Therefore, in any case, δ)(1 δ)K, the loss is at most mH(1 ≥ which is of size 1/α and Thirdly, the set of possible prices is , (1 , for the set of possible allocation probabilities is K ′ = which is of size 1/α ln(Hm/α). In the l-length menus, there are l prices and ml allocation probabilities in total. In the unlimited-length menus, we consider the possibility that each potential lottery (each distinct vector of parameters) belongs to the lottery or not. This analysis gives us the final size of the discrete points. 0, Hmα, 2Hmα, . . . Hm } α)K ′ 1/α ln (Hm/α) ⌋ ⌊ − (2K + 1)α α)0 = 1 1, . . . (1 mH(1 α)K ′ α)Kp − − δ)K. 0, (1 δ)(1 (1 − − ≥ − − − − − − − − − } { { − B.2 Online Learning Similar to the section on two-part tariffs, using the outcome of the discretization summarized in Theorem 16, we show a reduction to a finite number of experts and run standard learning algorithms (weighted majority and Exp3) over the menus in the discretized set. B.2.1 Full Information In the full information setting, the seller sees the revenue generated for all the possible menus. To design an online algorithm in this case, we use a variant of the weighted majority algorithm by [Auer et al., 1995]. The experts in our case are the discretized menus from the previous section, denoted in the algorithm by set X = m1, . . . , mn. Furthermore, vt is the valuation of the buyer are time t and Revk(v1, . . . , vt) is the cumulative revenue of menu mk for the buyers until time step t. Similar to two-part tariffs, we use Algorithm 2 for the full information case. The only difference is that since the maximum revenue in lotteries is mH, as opposed to two-part tariffs where it is H, in the algorithm we need to replace H with mH. Proposition 47 ([Auer et al., 1995], Theorem 3.2). For any sequence of valuations ̄v, RevWM ( ̄v) OPTX ( ̄v) β 2 ≥ 1 (cid:18) − mH ln n β , − (cid:19) where X = m1, . . . , mn are the set of experts (lottery menus), RevWM( ̄v) is the expected revenue outcome of Algorithm 2 where H is replaced with mH, and OPTX ( ̄v) is the revenue of the optimal menu in X. Theorem 17. In the full information case for length-l menus of lotteries, running Algorithm 2 over the discretized set of menus specified in Theorem 16 for α = T − and δ = T − 0.5 has regret ̃O(m2Hl√T ). 0.5, K = T 0.5, 1, β = T − Proof. Let n be the number of menus resulting from Algorithm 4. Let vi be the valuation of the buyer at step i, and ̄v be the vector of valuation of all buyers in rounds 1 through T . 48 We denote RevM ′() as the maximum revenue obtained in the set of menus resulting from Algorithm 4, OPT() as the optimal revenue, and RevWM() as the revenue obtained from the weighted majority algorithm discussed above on the set of outcome menus of Algorithm 4. We have n = (1/αlm+l) (ln (Hm/α))lm , RevWM ( ̄v) RevM ′ ( ̄v) ≥ β 2 − Rev(M ′) ( ̄v) mH ln n β , − T RevM ′ ( ̄v) = RevM ′ (vi) , RevM ′ (vi) i=1 X OPT (vi) (1 ≥ − where the first expression is a result of Algorithm 4, the second expression uses Proposition 47, the third expands the revenue over T terms, and the last uses Theorem 16. Rearranging the terms, we have: − − − − δ)(1 α)K (2K + 1)α mH(1 δ)K; RevM ′ (vi) RevM ′ ( ̄v) RevWM ( ̄v) ≥ ≥ ≥ ≥ ≥ OPT (vi) (1 OPT (vi) OPT (vi) OPT ( ̄v) − − OPT ( ̄v) α)K 1 δ)(1 − − OPT (vi) mH 1 − (1 − δ)(1 (1 (cid:0) (1 (1 − 1 − − 1 (cid:0) − − − − mHT (cid:0) mHT − − − (cid:0) mHT (1 δ)K − − δ)K (2K + 1)α − (2K + 1)α mH(1 − α)K − − δ)(1 − α)K α)K (cid:1) α)K − − δ)(1 δ)(1 − (2K + 1)α (cid:1) − T (2K + 1)α T (2K + 1)α − βmHT 2 (cid:1) − mH ln n (cid:1) β − δ)K − mH(1 mH(1 − δ)K − mHT (1 − δ)K − We set variables K, α, δ, and β as a function of T to minimize the exponent of T in the regret. The regret is upper bounded by mHT 1 (cid:0) 1 mHT ≤ (1 (1 − − − − δ)(1 δ)(1 − − α)K (cid:1) α)K + T (2K + 1)α + mHT (1 + T (2K + 1)α + mHT (1 δ)K + δ)K + − − (cid:0) (cid:1) where the inequality follows by upper bounding n. By setting α = T − and δ = T − 0.5 the regret is bounded by ̃O(m2Hl√T ). mH ln n β , + βmHT 2 βmHT 2 1, β = T − + mHO (lm ln (Hm/α)) β ; 0.5, K = T 0.5, Theorem 18. In the full information case for arbitrary length menus of lotteries, running 1/(m+1), K = Algorithm 2 on menus specified in Theorem 16 for α = T − T 1/(m+1), and δ = T − 1/(m+1) has regret ̃O(mHT 1 − 1/(2m+4) lnm (mHT )). 1/(2m+2), β = T − Proof. The proof follows the same argument as Theorem 17. The only difference in the parameters is n, the number of experts, which in this case is n = 2(1/αm+1)(ln (Hm/α))m. We set variables K, α, δ, and β as a function of T to minimize the exponent of T in the regret. The regret is upper bounded by the formula below after substituting n mHT 1 − βmHT (cid:0) 2 + (1 + δ)(1 α)K + T (2K + 1)α + mHT (1 − − mH(1/αm+1)(ln (Hm/α))mln2 β (cid:1) δ)K − 49 By setting α = T − is bounded by ̃O(mHT 1 − 1/(2m+4) lnm (mHT )). 1/(2m+2), β = T − 1/(m+1), K = T 1/(m+1), and δ = T − 1/(m+1), the regret B.2.2 Bandit Setting In the partial information setting, the seller does not see the outcome for all the possible menus and only observes the outcome of the menu used (the lottery chosen by the buyer). Similar to the two-part tariffs results, to design an online algorithm in this case, we use a version of the Exp3 algorithm in [Auer et al., 1995]. This variant of the Exp3 algorithm contains the weighted majority algorithm (Algorithm 2) a subroutine. At each step, we mix the probability distribution π, used by the weighted majority algorithm, with the uniform distribution to obtain a modified probability distribution π, which is then used to select a menu from our discretized set. Following the lottery chosen by buyer t, we use the price paid (the gain from the chosen menu) to formulate a simulated gain vector, which is then used to update the weights maintained by the weighted majority algorithm. Similar to two-part tariffs, we use Algorithm 3 for the bandit case. The only difference is that since the maximum revenue in lotteries is mH, as opposed to two-part tariffs where it is H, in the algorithm we need to replace H with mH. Proposition 48 ([Auer et al., 1995], Theorem 4.1). For any sequence of valuations ̄v, RevExp3 ( ̄v) OPTX − ≥ γ + (cid:18) β 2 (cid:19) OPTX − mHn ln n βγ , where X = m1, . . . , mn are the set of experts (lottery menus), RevExp3( ̄v) is the expected revenue outcome of Algorithm 3 where H is replaced with mH, and OPTX ( ̄v) is the revenue of the optimal menu in X. Theorem 19. In the partial information case for length-l menus of lotteries, running 1/(lm+2), β = γ = Algorithm 3 over discretized set of menus in Theorem 16 for α = T − 1/(2lm+4) lnlm+1 (mHT )). T − 1/(4lm+8), K = T 1/(2lm+4), and δ = T − 1/(2lm+4) has regret ̃O(m2HlT 1 − Proof. The proof follows the same logic as that of Theorem 17. We denote RevExp3() as the revenue obtained from Exp3 algorithm described above on the set of outcome menus of Algorithm 4. Similar to the proof of Theorem 17, in what follows n denotes the number of menus resulted from the procedure Algorithm 4. vi is the valuation of the buyer at step i, and ̄v is the vector of valuation of all buyers in rounds 1 through T . RevM ′() is the maximum revenue obtained in the set of menus resulted from Algorithm 4 and OPT() as the optimal revenue. n = (1/αlm+l) (ln (Hm/α))lm , RevExp3 ( ̄v) RevM ′ ≥ T γ + − (cid:18) β 2 (cid:19) RevM ′ mHn ln n βγ , − RevM ′ ( ̄v) = RevM ′ (vi) , RevM ′ (vi) ≥ i=1 X OPT (vi) (1 δ)(1 − − α)K − (2K + 1)α mH(1 δ)K; − − 50 where the first expression is a result of Algorithm 4, the second expression uses Proposition 48, the third expands the revenue over T terms, and the last uses Theorem 16. Rearranging the terms, we have: RevExp3 ( ̄v) ≥ ≥ ≥ β 2 β 2 1 (cid:19) (cid:19) RevM ′ ( ̄v) − γ + (cid:18) RevM ′ ( ̄v) RevM ′ ( ̄v) γ + mHT OPT ( ̄v) − − (cid:18) mHT β 2 γ + − (cid:18) (cid:0) (cid:19) (1 − mHT − − − mHn ln n βγ mHn ln n βγ − α)K δ)(1 − mHn ln n βγ − (cid:1) T (2K + 1)α mHT (1 δ)K − − We set variables K, α, δ, β, and γ as a function of T to minimize the exponent of T in the regret. After substituting n, the regret is upper bounded by mHT 1 (1 − − δ)(1 − α)K + T (2K + 1)α + mHT (1 (cid:0) 2lm2H(1/αlm+l) (ln (Hm/α))lm+1 βγ (cid:1) + − δ)K + γ + (cid:18) mHT β 2 (cid:19) By setting α = T − 1/(lm+2), β = γ = T − 1/(4lm+8), K = T 1/(2lm+4), and δ = T − 1/(2lm+4), the regret is bounded by ̃O(m2HlT 1 − 1/(2lm+4) lnlm+1 (mHT )). B.3 Limited Buyer Types The ideas for designing a specific algorithm specific to the limited buyer types in the menus of lotteries are similar to those for menus of two-part tariffs. There are a few changes that we overview here. One of the main differences is the menu options . Unlike two-part tariffs that given a menu, the buyer needed to select a tariff and number of units that maximized the buyer's utility; for menus of lotteries, the options are exactly aligned with menu entries, and = l + 1 for length-l lotteries. The mechanism designer's utility (revenue) given menu ρ is equal to p(j)(ρ) if the buyer selects entry j. The buyer selects entry j, if this entry results in higher utility than any other entry in menu ρ. These inequalities identify regions Pμ, where the buyer's utility maximizing option is aligned with μ. |O| O l Definition 49 (menu option for menus of lotteries, indicating a lottery index in the menu is a menu option. We denote the set of all menu options as . This set identifies all potential actions of a buyer when presented with a menu. ). Index j such that 0 O O ≤ ≤ j Definition 50 (mapping μ, feasible mappings, Pμ). A mapping μ is a function from buyer types, v1, . . . , vV to menu options j = 0, 1, . . . , l, where j is the lottery index assigned to the buyer type. Mapping μ is feasible if there is a menu corresponding to the mapping, i.e., 51 a menu that if presented to the buyers, each buyer selects their corresponding option in the mapping as their utility maximizing option. Pμ denotes the region of the parameter space corresponding to μ, i.e., the set of menus inducing mapping μ. Lemma 51. For each feasible mapping μ, as defined in Definition 50, with hyperplane boundaries. (i) Proof. For a fixed buyer type i and option j = 0, . . . , l, let j be the set of all parameter vectors ρ corresponding to the length-l menus that buyer type i selects option j. The buyer selects option j for menu ρ if this option produces more utility for the buyer than any other option. Formally, Pμ is a convex polytope P m v(ek)φ(j)[k](ρ) p(j)(ρ) − ≥ m v(ek)φ(j′)[k](ρ) p(j′)(ρ); − j′. ∀ Xk=1 Xk=1 The above inequalities identify a convex polytope of parameter vectors (menus ρ) with Pμ is also hyperplane boundaries. a convex region with hyperplane boundaries. (i) μ(i) for i = 1, . . . , V . Therefore, Pμ is the intersection of P P Pμ. i u(bi, ρ), is linear in Lemma 52. For each feasible mapping μ and any sequence of buyer valuations b the cumu- lative utility, Proof. We show that for any buyer valuation vi in the sequence, u(vi, ρ) is linear in the region. Proving this claim is sufficient for concluding the statement. Let j = μ(vi), i.e., j is the lottery index that buyer valuation vi selects under μ. Therefore, the utility for this buyer p(j)(ρ). Note that φ(j)[k](ρ) is a coordinate of for menu ρ ∈ Pμ is ρ and therefore, has a linear dependence on ρ. Therefore, since the option that each buyer Pμ, the utility is also linear. valuation selects is fixed inside m k=1 v(ek)φ(j)[k](ρ) Lemma 53. The number of extreme points for menus of lotteries, , is at most (V l2)m(l+1). Proof. Length-l menus of lotteries occupy a l(m+1)-dimensional parameter space. In each d- dimensional space, an extreme point is the intersection of d linearly independent hyperplanes. The total number of hyperplanes defining the regions is , where for each buyer type compares the utility of two menu entries. Out of these hyperplanes, we need l(m + 1) of them to intersect for an extreme point. Therefore, the number of extreme points is at most , implying the statement. = V |E| P H − l 2 (cid:0) (cid:1) Hl(m+1) (cid:0) The following lemma bounds the loss in utility where the set of menus is limited to the . The proof is similar to Balcan et al. [2015]; however, the loss depends on (cid:1) extreme points the problem-specific utility functions. E Lemma 54. Let b = b1, . . . , bT , and ρ∗ as the optimal menu in the hindsight: be as defined in Definition 10, then for any sequence of buyer valuations E T T maxρ ∈E u(bt, ρ) ≥ u(bt, ρ∗) εT. − t=1 X t=1 X Proof. The proof is similar to that of Lemma 12. The only difference is in step (vi) which computes the loss in revenue between menus that are at ε L1 distance. In menus of lotteries this distance implies a price difference of at most ε in any of the lotteries in the menu, and therefore causes ε total loss per time step. 52 Full Information Setting Theorem 20. In the full information case for length-l menus of lotteries, when there are V types of buyers, there is an algorithm with regret bound of O(m2Hl√T ln (V l)). Proof. The proof follows the same logic as of theorem 13. We run the weighted majority algorithm (Algorithm 2, where H is replaced by mH) with parameter β = 1/√T on the set E as the set of menus (experts). The proof directly follows from Lemma 54 and Proposition 47. . Let bi be the valuation of the buyer at step i, and ̄b be the vector of valuation Let n = of all buyers in rounds 1 through T . We denote Rev () as the maximum revenue obtained E in the set of , OPT() as the optimal revenue, and RevWM() as the revenue obtained from Algorithm 2 on the set of experts X = . Then, |E| E E (V l2)m(l+1), n ̄b (cid:0) (cid:1) ̄b ≤ ≥ = RevWM Rev E Rev (cid:0) (cid:1) (bi) Rev( ) E ̄b β 2 − Rev( ) E ̄b mH ln n β , − T (cid:0) Rev (cid:1) (bi) , (cid:0) (cid:1) E i=1 X OPT (bi) ε; E − in Lemma 53, the second expression uses where the first expression uses the size of E Proposition 47, the third expands the revenue over T terms, and the last uses Lemma 54. Rearranging the terms, we have: ≥ Rev E Rev (bi) ̄b E RevWM RevWM ̄b (cid:0) (cid:1) (cid:1) (cid:0) ̄b (cid:0) (cid:1) OPT (bi) OPT ̄b ε εT − − OPT ̄b (cid:0) (cid:1) (cid:1) (cid:0) ̄b OPT εT εT − − − − ≥ ≥ ≥ ≥ βmHT 2 βmHT 2 − − mH ln n β m2(l + 1)H (ln (V l)) β (cid:0) (cid:1) We set variables ε and β to minimize the exponent of T in the regret. By setting β = 1 √T and ε = 1/(√T ), The regret will be O(m2Hl√T ln (V l)). Partial Information (Bandit) Setting In the partial information setting, the change in the menu options also affects the definition of set that consists of indicator vectors over the buyer types that select the same menu entry j in a mapping μ. The changes that need to be to l+1, using option made in Algorithm 8 to work for menus of lotteries include changing 1 (ρ) + kp(j) p(j) (menu entry) j instead of (j, k), and changing utility from I to 1 p(j)(ρ). After making these changes, we can perform the modified algorithm to achieve a (cid:16) bounded regret. |O| } 2 (ρ) ≥ (cid:17) I k { Lemma 55. For any menu ρ, E[ˆuτ (ρ)] = uτ (ρ) and ˆuτ (ρ) mH(l + 1)V, mH(l + 1)V ]. [ − ∈ 53 Proof. The proof is similar to Lemma 55. The proof of the equality of the expectation simply follows from ˆuτ (ρ) and uτ (ρ) definitions and Lemma 42. Now, we prove the range of the estimator. Since S is a barycentric spanner, for any I 1, 1]. Also, ˆfτ (.) belongs to . Additionally, the utility of the buyer selecting each option in the menu, e.g., p(j)(ρ), is always in [0, mH]. Therefore, using the formula of the estimator, it is bounded by mH times the number of options times the number of buyer types. , λi(I) [ − ∈ I 0, 1 ∈ } { Theorem 21. In the partial information (bandit) case for length-l menus of lotteries, when there are V different types of buyers, there is an algorithm with regret bound of O(T 2/3(lm)4/3(HV )1/3 log1/3(V l)). is the number of Proof. The proof follows the same logic as of theorem 14. In Lemma 44, dimensions (barycentric spanner set), κ is the maximum revenue times the number of buyer M types times the number of their options (entries in the menu), is the number of discrete (V l2)m(l+1). By Lemma 55, points. In our case, the expected value of the estimated utility is equal to the exact value of utility with range [ − mH(l + 1)V, mH(l + 1)V ]. Using Lemma 44, the regret for menus of lotteries is bounded by = l(m + 1), κ = mHV (l + 1), and | | ≤ M S S | | | | | | O(T 2/3(lm)4/3(HV )1/3 log1/3(V l)). B.4 Distributional Learning Theorem 22. For length-l menus of lotteries, there is a discretization-based distributional learning algorithm with sample complexity ̃O (m2H 2/ε2(lm + ln (2/δ))), and running time ̃O (2m2H 2/ε2)lm+l+1 l(lm + ln (2/δ)) lnlm (mH/ε ln (mH/ε)) (cid:16) δ, the difference Proof. We need to find the number of samples such that with probability 1 between the expected revenue of our algorithm and the optimal revenue is at most ε. Note that since our algorithm uses discretization of possible menus, we face two types of errors: the discretization error, and the usual empirical error in a PAC learning setting. We find the sample complexity and discretization parameters such that the total error is bounded by ε. The possible number of menus after discretization using Algorithm 4 with parameter α − (cid:17) . is computed by the following formula. = (1/αlm+l) (ln (Hm/α))lm |H| Using uniform convergence in the PAC learning setting, the sample complexity for em- pirical error ε′ is as follows. S | | ≥ m2H 2 2 2ε′ (ln |H| + ln (2/δ)) Replacing ln we have, H S | | ≥ m2H 2 2 2ε′ (lm(ln(1/α) + ln ln (mH) + ln (2/δ)) 54 Also, the revenue loss compared to the optimum for arbitrary buyer i with valuation vi when using Algorithm 4 with parameters α, K, and d (we use d instead of δ in Algorithm 4 and reserve δ for (ε, δ)-learning) is computed by the following formula. RevM ′ (vi) OPT(vi)(1 d)(1 − − α)K − ≥ (2K + 1)α mH(1 d)K − − The total error (from discretization and empirical error), when the empirical error is set to ε′, is mH[1 (1 d)(1 − − − α)K] + (2K + 1)α + mH(1 d)K + ε′ − By setting d = ε′/(2mH), K = 2mH/ε′ ln(mH/ε′), and α = ε′/(2m2H 2 ln(mH/ε′)), the total mistake is less than 4ε′. Replacing these parameters and substituting ε′ with ε/4 to satify total error ε, we have the following sample complexity: (lm(ln(1/α) + ln ln (mH) + ln (2/δ)) S | | ≥ = ̃O m2H 2 2 2ε′ m2H 2 ε2 (cid:18) (lm + ln (2/δ)) (cid:19) Also, replacing the parameters we have: = O |H| (cid:18) 2m2H 2 ε2 lm+l (cid:19) lnlm (mH/ε ln (mH/ε)) ! The computational complexity of finding the empirical optimal menu for menu of size l is: buyers and S | | S l | | |H| = ̃O 2m2H 2 ε2 (cid:18) lm+l+1 (cid:19) l(lm + ln (2/δ)) lnlm (mH/ε ln (mH/ε)) ! This implies the computational complexity of the algorithm. Theorem 56. For arbitrary-length menus of lotteries, there is a discretization-based distri- butional learning algorithm with sample complexity (32m2H 2/ε2)m+1 lnm (mH/ε ln(mH/ε)) lnm+1 (mH/ε) + ln (1/δ) , O m2H 2 ε2 (cid:18) (cid:0) and running time O 2(32m2H 2/ε2)m+1 lnm (mH/ε ln(mH/ε)) lnm+1 (mH/ε) (cid:16) (cid:17) Proof. This proof follows the same line as the proof of Theorem 22. We need to find the δ, the difference between the expected number of samples such that with probability 1 revenue of our algorithm and the optimal revenue is at most ε. Note that since our algorithm − (cid:19) (cid:1) . 55 uses discretization of possible menus, we face two types of errors: the discretization error, and the usual empirical error in a PAC learning setting. We find the sample complexity and discretization parameters such that the total error is bounded by ε. The possible number of menus after discretization using Algorithm 4 with parameter α is computed by the following formula. = O 2(1/αm+1)(ln (Hm/α))m |H| (cid:16) (cid:17) Using uniform convergence in the PAC learning setting, the sample complexity for em- pirical error ε′ is as follows. Replacing ln we have, H S | | ≥ m2H 2 2 2ε′ (ln |H| + ln (2/δ)) S | | ≥ m2H 2 2 2ε′ (cid:18) lnm (Hm/α) αm+1 + ln (2/δ) (cid:19) Also, the revenue loss compared to the optimum for arbitrary buyer i with valuation vi when using Algorithm 4 with parameters α, K, and d (we use d instead of δ in Algorithm 4 and reserve δ for (ε, δ)-learning) is computed by the following formula. RevM ′ (vi) OPT(vi)(1 d)(1 − α)K − − ≥ (2K + 1)α mH(1 d)K − The total error (from discretization and empirical error) when the empirical error is set to ε′ is mH[1 (1 d)(1 − − − α)K] + (2K + 1)α + mH(1 d)K + ε′ By setting d = ε′/(2mH), K = 2mH/ε′ ln(mH/ε′), and α = ε′/(2m2H 2 ln(mH/ε′)), the total mistake is less than 4ε′. Replacing these parameters and substituting ε′ with ε/4 to satify total error ε, we have the following sample complexity: − − S | | ≥ m2H 2 2 2ε′ lnm (mH/α) αm+1 + ln (2/δ) (cid:19) (cid:18) m2H 2 ε2 = O (cid:18) (cid:0) Also, replacing the parameters we have: (32m2H 2/ε2)m+1 lnm (mH/ε ln(mH/ε)) lnm+1 (mH/ε) + ln (1/δ) (cid:19) (cid:1) |H| = O 2(1/αm+1) lnm (Hm/α) (cid:16) = O 2(32m2H 2/ε2)m+1 lnm (mH/ε ln(mH/ε)) lnm+1 (mH/ε) (cid:17) The computational complexity of finding the empirical optimal menu for number of potential menus times O(ln( buyers is the times the maximum size of a menu which is |H| )). S S | | | | (cid:16) (cid:17) H 56 Lemma 57. The sample complexity of length l menus of lotteries using the techniques in [Balcan et al., 2018b] is bounded by 2 9l(m + 1) log 4l(m + 1) (l + 1)2 + ml + log H ε c (cid:18) (cid:19) (cid:18) 1 δ . (cid:19) (cid:0) (cid:0) (cid:1)(cid:1) Proof. Balcan et al. [2018c] introduce delineability as a condition to upper bound the pseudo- dimension and therefore, the sample complexity. They show the class of lotteries is (l(m + 1), (l + 1)2 + ml)-delineable. Also, if is a mechanism class that is (d, t)-delineable, then is at most 9d log(4dt). Therefore, the pseudo-dimension for the pseudo dimension of menus of lotteries is bounded by 9l(m + 1) log (4l(m + 1) ((l + 1)2 + ml)). Furthermore, the sample complexity is at most c(H/ε)2 (Pdim( ) + log (1/δ)), which by replacing pseudo dimension for this class of mechanism completes the proof. M M H C Failure of Dispersion for menus of lotteries In this section, we prove that without making extra assumptions about optimal menus of lotteries, both definitions of dispersion (Definitions 32 and 35) fail. In particular, we show that the failure of both conditions happens if the optimal menu (maximizer) has two lotteries close to each other (similar coordinates) and satisfies some other properties. Example 2 illustrates a setting where there are lotteries with arbitrarily close coordinates in the optimal menu. Theorem 58. Let the maximizer ρ∗ have the following properties, where φ(1) ρ∗ , p(2) ρ∗ are the coordinates of ρ∗, respectively illustrating the probability of allocating item one in lottery 1, the price of lottery 1, the probability of allocating item one in lottery 2, the price of lottery 2, and the allocation probability for other items are the same across these lotteries. ρ∗ , φ(2) ρ∗ , p(1) 1. p(1) ρ∗ 2. φ(1) ρ∗ − − p(2) ρ∗ = (L + 1/2)ε, where L is the Lipschitz parameter. φ(2) ρ∗ = (L + 1)ε/c + ε/2. 3. c is a constant such that c H. ≤ In this case, for every κ-bounded distribution whose density is also lower-bounded by 1/κ, the conditions of Definitions 32 and 35, are violated. In particular, in Definition 32, the probability of a hyperplane crossing the ε-radius ball centered at the maximizer is a constant depending on c; and in Definition 35, there exists a pair of points such that the expected number of times that their loss function difference violates the Lipschitz condition for any Lipschitz constant L′ = L/2 is a constant depending on c. Proof. We first show why Definition 32 fails. Consider a ball of radius ε centered at the maximizer ρ∗. Let this ball be B. We show that the probability of a hyperplane crossing B. We first find the probability density of hyperplanes B is constant. Consider a point ρ going through ρ. Then, we integrate to find the probability of crossing the ball. The following equation shows for what value of v (the value for the item), the hyperplane goes through ρ. ∈ 57 vφ(1) ρ − ρ − ρ = vφ(2) p(1) p(1) ρ φ(1) ρ v = p(2) ρ p(2) ρ φ(2) ρ − − be the minimum value of v for which the hyperplane crosses the ball (i.e., Let vmin B and vmax B there is ρ ∈ B such that vmin B = p(1) ρ φ(1) ρ p(2) ρ φ(2) ρ − − probability that the hyperplane crosses the ball is function of the value for the item. R ), and the maximum value respectively. The vmax B vmin B f (v)dv, where f (v) is the density We consider the following points. These points are all in ε proximity of ρ∗, therefore, fall ρ∗ . Let p(1) in a ball of radius ε centered at ρ∗. Consider points with p(2) = p(2) be in [p(2) ρ∗ + (L + 1)ε]. Let φ(1) be in [φ(2) ρ∗ + (L + 1)ε/c, φ(2) ρ∗ and φ(2) = φ(2) ρ∗ + (L + 1)ε/c + ε]. ρ∗ + Lε, p(2) With the above construction, the numerator ranges from Lε to (L + 1)ε, and the denom- B = c. For inator ranges from (L + 1)ε/c to (L + 1)ε/c + ε. Therefore, vmin κ-bounded distribution with support [0, 1], L+c+1 and vmax f (v)dv is at least B = Lc vmax B vmin B c − R Lc L+c+1 κ = c(c+1) L+c+1 κ ; which is constant for a constant c. Now, we show that Definition 35 fails. To do so, we still consider pair of points ρ and ρ′ which correspond to vmin B , respectively. If we consider the line segment connecting ρ f (v)dv which and ρ′, the probability of the hyperplane crossing these two points is still again for κ-bounded distribution with support [0, 1] whose density is also lower-bounded by 1/κ, f (v)dv is at least B and vmax vmin B vmin B R vmax B vmin B R c − Lc L+c+1 κ = ; c(c+1) L+c+1 κ p(1) ρ which is constant for a constant c. Note that Lε which implies anytime the hyperplane crosses between ρ and ρ′, the difference in the loss, is at least Lε. Also, the Euclidean distance between ρ and ρ′ is less than 2ε. lt(ρ) | Therefore, the Lipschitz condition for constant L′ = L/2 is violated a constant fraction of times in expectation. Lε and lt(ρ′) | ≥ | ≥ − − − | | | p(2) ρ p(1) ρ′ p(2) ρ′ The following example shows that in the optimal menu of lotteries, lottery pairs can be arbitrarily close to each other. Example 2 ([Daskalakis et al., 2014]). Consider the case of two items, when the buyer's value for each item is drawn i.i.d. from the distribution supported on [0, 1] with density function f (x) = 2(1 x). Daskalakis et al. prove for this example that the unique (up to differences of measure zero) optimal mechanism has uncountable menu complexity. That is, − 58 3x the number of distinct options available for the buyer to purchase is uncountable. They show that the optimal mechanism contains the following four kinds of options: (a) the buyer can 2 5x)2 paying the price receive item one with probability 1, and item two with probability 2 [0, .0618), (b) the buyer can receive item two with probability 1, − 4 − 2 5x)2 paying the price 2 .0618), 5x)2 , for any x and item one with probability .5535, and (d) the buyer can receive neither (c) the buyer can receive both items and pay item and pay nothing. 5x)2 , for any x 5x + 2x 5x + 2x ≈ (4 [0, ≈ ≈ − − ∈ ∈ 3x (4 (4 (4 − − − − 4 59
http://arxiv.org/abs/2302.11679v1
2023-02-22T22:29:40
2023-02-22T22:29:40
On the contribution of pre-trained models to accuracy and utility in modeling distributed energy resources
Despite their growing popularity, data-driven models of real-world dynamical systems require lots of data. However, due to sensing limitations as well as privacy concerns, this data is not always available, especially in domains such as energy. Pre-trained models using data gathered in similar contexts have shown enormous potential in addressing these concerns: they can improve predictive accuracy at a much lower observational data expense. Theoretically, due to the risk posed by negative transfer, this improvement is however neither uniform for all agents nor is it guaranteed. In this paper, using data from several distributed energy resources, we investigate and report preliminary findings on several key questions in this regard. First, we evaluate the improvement in predictive accuracy due to pre-trained models, both with and without fine-tuning. Subsequently, we consider the question of fairness: do pre-trained models create equal improvements for heterogeneous agents, and how does this translate to downstream utility? Answering these questions can help enable improvements in the creation, fine-tuning, and adoption of such pre-trained models.
[ "Hussain Kazmi", "Pierre Pinson" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11679v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11679v1", "@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.AP" ]
3 2 0 2 b e F 2 2 ] G L . s c [ 1 v 9 7 6 1 1 . 2 0 3 2 : v i X r a On the contribution of pre-trained models to accuracy and utility in modeling distributed energy resources Hussain Kazmi [email protected] KU Leuven Belgium Pierre Pinson Imperial College London UK Abstract Despite their growing popularity, data-driven models of real- world dynamical systems require lots of data. However, due to sensing limitations as well as privacy concerns, this data is not always available, especially in domains such as energy. Pre-trained models using data gathered in similar contexts have shown enormous potential in addressing these con- cerns: they can improve predictive accuracy at a much lower observational data expense. Theoretically, due to the risk posed by negative transfer, this improvement is however neither uniform for all agents nor is it guaranteed. In this paper, using data from several distributed energy resources, we investigate and report preliminary findings on several key questions in this regard. First, we evaluate the improve- ment in predictive accuracy due to pre-trained models, both with and without fine-tuning. Subsequently, we consider the question of fairness: do pre-trained models create equal improvements for heterogeneous agents, and how does this translate to downstream utility? Answering these questions can help enable improvements in the creation, fine-tuning, and adoption of such pre-trained models. CCS Concepts: • Computing methodologies → Distributed artificial intelligence; • Hardware → Power and energy. Keywords: Pre-trained models, distributed energy resources, dynamics models, accuracy, fairness ACM Reference Format: Hussain Kazmi and Pierre Pinson. 2023. On the contribution of pre-trained models to accuracy and utility in modeling distributed energy resources. In E-Energy '23: 14th ACM International Confer- ence on Future Energy Systems, June 20–23, 2023, Orlando, FL. ACM, New York, NY, USA, 4 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]. E-Energy '23, June 20–23, 2023, Orlando, FL © 2023 Association for Computing Machinery. ACM ISBN 978-1-4503-XXXX-X/18/06. . . $15.00 https://doi.org/XXXXXXX.XXXXXXX 1 Introduction Data-driven modelling of complex dynamical systems typi- cally requires access to large amounts of data to generalize well [1]. In the absence of large datasets, model performance tends to be sub-par in regions of state-space that have been poorly explored [2]. Additionally, models trained with lim- ited data may learn relationships that are not causal [3]. Using such models for control can therefore lead to undesir- able outcomes in high stakes decision-making [4], such as in the operation of critical infrastructure or decisions that directly affect human well-being. However, in many domains, outside of computer vision and natural language processing, collecting large amounts of data is often infeasible [5]. This is frequently the case with predicting demand for new products or services, where data-driven models are not feasible due to the cold-start problem [6]. Another case where observational data tends to be limited is due to expensive sensing or communication infrastructure, as well as privacy concerns [7, 8]. This is frequently the case in the energy domain, where data on both demand and generation side is typically gathered in the form of time series, which need to be modelled and predicted. However, installing and maintaining sensors to continuously monitor electricity demand and generation at high spatiotemporal resolutions is an expensive and often privacy-compromising operation. As a result, several solutions have been proposed in recent years to reduce the data requirements or sample complexity of learning algorithms, including via the use of pre-trained models (PTMs), which rely on simulated or historically ob- served data, thereby eschewing the need for observational data [1]. More recently, this has also seen significant inter- est in the modeling and optimization of distributed energy resources [9, 10]. In this paper, we dive deeper into the topic to consider how (or whether) PTMs can accelerate the data- driven modelling of distributed energy resources, e.g. hot water storage systems. More concretely, we attempt to an- swer the following questions: (1) do PTMs outperform purely data-driven dynamics models; (2) (how) does the size of the source and target corpus, and fine-tuning affect the PTM's performance; and (3) do potential improvements induced by PTMs create uniform utility for heterogeneous agents. The remainder of this paper is organized as follows. In section 2, E-Energy '23, June 20–23, 2023, Orlando, FL Kazmi and Pinson temperature at the mid-point, Tm, in the storage vessel. To do so, it uses three fields as input: (1) the time since the last reheat cycle, t, (2) the hot water demand since the last reheat cycle, w and (3) the initial temperature of the ves- sel at its mid-point, T0. These features are extracted from three observational time series respectively: user hot water demand, heat pump operation (i.e. active or idle), and the observed temperature at the mid-point in the storage vessel. This means that at any given time point, the entire history of the three time series can be used to construct the input feature matrix, which is then ingested by the function ap- proximation model. Note that, by virtue of including time since the last reheat cycle in the input features, arbitrary future time horizon predictions can be obtained. The model, f (.) is chosen to be a neural network with two fully connected hidden layers and a normalization layer (shown in Fig. 1). It utilizes the ReLU activation function and L2 regularization, and is fit using the mean absolute error (MAE) loss function (i.e. it minimizes the error when predict- ing the mid-point temperature in the vessel). The reason for choosing a neural network as the function approximation technique is motivated by its prevalence in PTM literature. While theoretically linear models can be used in a similar fashion, they are incapable of modelling complex functions and non-linear dynamics, as is required here (heat losses are inherently non-linear). The sampling bias in the observational data manifests as a distributional shift in the three features for different house- holds, and predominantly affects the local models, which are trained only using data collected at each site. These local models are trained at four distinct time points, namely af- ter 4, 8, 16, and 32 weeks. The holdout test dataset for each site is derived locally by sampling the last three months of observations, and consequently does not overlap with the training set. As such, it is still subject to many of the same sampling biases (e.g., a high accuracy score for a local model on a local test set does not guarantee broad generalization). 2.3 Pre-trained models Instead of relying solely on observational data to fit model parameters, PTMs utilize what is essentially a sequential two-stage process. First, a model is trained on (abundant) simulated or prior observational data. Second, it is fine-tuned using (sparse) observational local data. The pre-training re- lies primarily on the fact that the processes being modelled are identical or, at the very least, share some similarities. In addition to similarity, the amount of the pre-collected train- ing data (i.e. source corpus size) is also important. Where both the quantity and quality of pre-collected data is suffi- cient, PTMs can lead to large speed-ups in the modelling of dynamical systems (typically observed as better initial accuracy, learning rate, and asymptotic accuracy). To make the comparison fair, we employ the same model architecture as before for creating the initial PTM, and investigate the Figure 1. Neural architecture for the trained models we describe the methodology we follow subsequently. Sec- tion 3 presents key results, while Section 4 concludes the paper with an eye to future research directions. 2 Methodology 2.1 Data and setup To answer the afore-mentioned questions, we utilize detailed (quarter-hourly) data spanning over one year from several identical heat pump hot water storage systems in a net-zero energy neighborhood, constituting a corpus of 24 buildings. The general idea is to construct a model for state estimation of the hot water storage system in a way that can then used for downstream control (e.g. to reduce energy demand, max- imize user comfort or minimize grid load etc.). Of the entire corpus, 8 systems were partitioned into a separate source set, S, for which data was assumed to be available before the start of the experiment, i.e. this data can be used off-the-shelf to create PTMs. The remaining 16 buildings are marked as the target set, T , which can be used to construct 'local' mod- els for the hot water systems. A local model identifies that only observational data from a particular building is used during the modeling process. However, for each individual building, even after an entire year of acquisition, this dataset is rather small at a few thousand training examples. Even ignoring the effects of serial and autocorrelation on the in- formation content, this corpus is smaller than even a single high-resolution image. Even though the systems are identical, the users and oper- ating conditions are not. Consequently, each system gener- ates data which is distributed differently, due to the sampling bias these two factors induce. This means the datasets ob- served at different systems, and used to train (and evaluate) the local models can be significantly different. 2.2 Local models We pose the problem as a standard one-step ahead regres- sion problem, y = f (x). Here, the model, f (.), predicts the On the contribution of pre-trained models to accuracy and utility in modeling distributed energy resources E-Energy '23, June 20–23, 2023, Orlando, FL effect of several variations, including: (1) the source corpus size (i.e. how much data was available to train the PTM), (2) fine-tuning (i.e. whether the PTM employs fine-tuning using local data or not), and (3) the target corpus size (i.e. the local dataset size, which is only relevant when we utilize fine-tuning). More concretely, to investigate the effect of the source cor- pus size, we created two models. The first model used a large training corpus, including data from eight systems (these sys- tems were not included in the local models discussed above) for eight months. The second model utilized a small corpus, referring to data from only a single system for a duration of eight months. After training to convergence, these two PTMs were then deployed in the households, where their performance was evaluated using the same local holdout datasets and methodology as described previously. In the case where these two PTMs were not fine-tuned using local data, their performance on the hold-out test set for any given system did not change over time (the holdout set is kept fixed to avoid any reporting bias). On the con- trary, to investigate the impact of fine-tuning, given varying amounts of target data, we followed the same logic as that of local models. Both the small and large corpus PTMs were fine-tuned at four distinct points in time: i.e. at 4, 8, 16, and 32 weeks. The fine-tuning process is carried out at a lower learning rate and for fewer iterations, when compared with the training of the PTMs or local models. The models are evaluated using the same method as that described previ- ously. 3 Results In this section, we present the most important results com- paring local models against different variants of PTMs. Sub- sequently, we take a look at the implications this has on donwstream operations. 3.1 The importance of corpus size and fine-tuning Fig. 2 shows the predictive performance of the different model configurations, using training corpus size (or observa- tion period) as the x-axis. As expected, increasing amounts of data, either during the pre-training phase or the local ac- quisition phase, improve performance. This holds for both local models, as well as small and large fine-tuned PTMs. Asymptotically, the small training corpus PTM performs the worst, but is still comparable to a local model during the ini- tial phase, when the local models have seen only four weeks of on-site training data. Increasing amounts of observational data lead to improvements in the local models, with the av- erage error falling from around 0.5°C after 4 weeks to 0.33°C after 32 weeks. Fine-tuning both PTMs shows considerable potential to improve this performance further, especially when only limited amounts of locally observed data has Figure 2. Mean absolute error (MAE) on holdout test dataset for different model configurations with increasing amounts of training data, averaged over 16 systems been collected. Even so, the local and fine-tuned small cor- pus PTM perform at roughly the same accuracy level as the large corpus PTM without any fine-tuning. With fine-tuning, the large corpus PTM significantly outperforms the local models with the average error falling as low as 0.28°C after 32 weeks. A curious trend emerges here. While the PTM with fine- tuning ends up being the best performing model at the end of 32 weeks, the best model in the low observational data regime is actually the large PTM without any fine-tuning. This makes sense since the PTM has arguably already learnt the correct system dynamics, and only a small amount of training data does not allow it to further reduce its error on the (biased) evaluation test dataset for each specific system. This also shows that perhaps the fine-tuning might be too aggressive in the low data regime. 3.2 The importance of choosing the correct PTM The small corpus PTM (without fine-tuning) exhibits signifi- cant deviation in the improvements it can bring to different systems (note the wide uncertainty bands plotted in Fig. 2). In some instances, the performance of these models can even begin to rival that of much better performing models (e.g. the large corpus PTM with fine-tuning). To investigate this effect further, we treat each individual local model trained for 8 months as a small corpus PTM. This leads to 16 additional candidate small source corpus PTMs. As there is no overlap in training or evaluation data, this does not pose any data leakage concerns. Fig. 3 shows results for evaluating these models without fine-tuning, and presents two key insights. The first is the enormous amount of diversity in accuracy for most systems when data from a different system is used to learn their dynamics. This is all the more surprising because the systems are identical, and the only difference is the sam- pling bias due to occupant and controller behavior. Second, E-Energy '23, June 20–23, 2023, Orlando, FL Kazmi and Pinson Figure 3. The cross-performance of local models evaluated on holdout test set for each individual building; the large markers represent the performance of the model trained using data from the system we see that the model trained on the system's data itself is usually, but not always the best performing model. This seems counter-intuitive at first but there are several explana- tions for it, including (1) non-stationarity in the training and evaluation data, i.e. the local dataset underwent some dis- tributional shifts, and (2) data quality, i.e. the data (training and/or validation) was rather noisy to begin with. 4 Conclusions and future work Fig. 3 has already demonstrated that there is a large difference in the use of one source model vs. a different one, even when they are sourced from similar data sources. This has profound implications in terms of downstream utility. In our downstream experiments, we found that this caused significant differences while optimizing heating demand for the storage vessel, constrained on occupant comfort. Local models were, for most houses (14 out of 16), unusable after the initial 4 week period, to the extent that they led to control policies that significantly violated user comfort due to not reheating the storage vessel at all or at incorrect times. After 32 weeks, the situation was reversed, as most local models (12 out of 16) were able to control the vessel in a near optimal manner. Surprisingly enough, the large corpus PTM, with no fine-tuning, led to the optimal control strategy for all systems. The small corpus PTM performed roughly on par with the local model with only 4 weeks of data (i.e. it was largely unusable). This obviously begs several question. First, if a large source corpus model with no fine-tuning can be used to control dis- tributed energy resources, then local data can be used solely for validation (or fine-tuning). This means local data can stay on the user's premises, leading to a simultaneous improve- ment in both downstream utility and reduction in privacy leakage. This would not be possible otherwise with classical machine learning based solutions. Furthermore, where large pre-trained models are not available, Fig. 3 shows that it is possible to use a carefully chosen small source corpus PTM to achieve comparable, if not better, performance as using a local model. In this paper, we have not explored in greater depth the drivers for this heterogeniety although similarities in feature space certainly seem to play a role here. This is an important avenue for future research. The results presented in the paper also have important implications for future electricity and data markets design. While scarce at the moment, movements to collect more behind-the-meter data are gathering momentum, raising several privacy concerns. By utilizing PTMs, this data can stay on-premises, but valuing their contribution in monetary terms, especially tying in with downstream utility, is an open and important direction for future research. Acknowledgments Hussain Kazmi acknowledges support from FWO, Belgium in the preparation of this manuscript. References [1] Xu Han, Zhengyan Zhang, Ning Ding, Yuxian Gu, Xiao Liu, Yuqi Huo, Jiezhong Qiu, Yuan Yao, Ao Zhang, Liang Zhang, et al. Pre-trained models: Past, present and future. AI Open, 2:225–250, 2021. [2] Yeounoh Chung, Tim Kraska, Neoklis Polyzotis, Ki Hyun Tae, and Steven Euijong Whang. Slice finder: Automated data slicing for model validation. In 2019 IEEE 35th International Conference on Data Engi- neering (ICDE), pages 1550–1553. IEEE, 2019. [3] Sebastian Lapuschkin, Stephan Wäldchen, Alexander Binder, Grégoire Montavon, Wojciech Samek, and Klaus-Robert Müller. Unmasking clever hans predictors and assessing what machines really learn. Na- ture communications, 10(1):1–8, 2019. [4] Cynthia Rudin, Chaofan Chen, Zhi Chen, Haiyang Huang, Lesia Se- menova, and Chudi Zhong. Interpretable machine learning: Funda- mental principles and 10 grand challenges. Statistics Surveys, 16:1–85, 2022. [5] Hussain Kazmi, Íngrid Munné-Collado, Fahad Mehmood, Tahir Abbas Syed, and Johan Driesen. Towards data-driven energy communities: A review of open-source datasets, models and tools. Renewable and Sustainable Energy Reviews, 148:111290, 2021. [6] Jihoon Moon, Junhong Kim, Pilsung Kang, and Eenjun Hwang. Solving the cold-start problem in short-term load forecasting using tree-based methods. Energies, 13(4):886, 2020. [7] Patrick McDaniel and Stephen McLaughlin. Security and privacy challenges in the smart grid. IEEE security & privacy, 7(3):75–77, 2009. [8] Victor Morel, Cristiana Santos, Yvonne Lintao, and Soheil Human. Your consent is worth 75 euros a year-measurement and lawfulness of cookie paywalls. In Proceedings of the 21st Workshop on Privacy in the Electronic Society, pages 213–218, 2022. [9] Thijs Peirelinck, Hussain Kazmi, Brida V Mbuwir, Chris Hermans, Fred Spiessens, Johan Suykens, and Geert Deconinck. Transfer learning in demand response: A review of algorithms for data-efficient modelling and control. Energy and AI, 7:100126, 2022. [10] Davy Didden, Nadia Wiesé, Hussain Kazmi, and Johan Driesen. Sam- ple efficient reinforcement learning with domain randomization for automated demand response in low-voltage grids. IEEE Journal of Emerging and Selected Topics in Industrial Electronics, 3(4):891–900, 2021.
http://arxiv.org/abs/2302.11665v2
2023-07-19T04:03:11
2023-02-22T21:41:34
AlpaServe: Statistical Multiplexing with Model Parallelism for Deep Learning Serving
Model parallelism is conventionally viewed as a method to scale a single large deep learning model beyond the memory limits of a single device. In this paper, we demonstrate that model parallelism can be additionally used for the statistical multiplexing of multiple devices when serving multiple models, even when a single model can fit into a single device. Our work reveals a fundamental trade-off between the overhead introduced by model parallelism and the opportunity to exploit statistical multiplexing to reduce serving latency in the presence of bursty workloads. We explore the new trade-off space and present a novel serving system, AlpaServe, that determines an efficient strategy for placing and parallelizing collections of large deep learning models across a distributed cluster. Evaluation results on production workloads show that AlpaServe can process requests at up to 10x higher rates or 6x more burstiness while staying within latency constraints for more than 99% of requests.
[ "Zhuohan Li", "Lianmin Zheng", "Yinmin Zhong", "Vincent Liu", "Ying Sheng", "Xin Jin", "Yanping Huang", "Zhifeng Chen", "Hao Zhang", "Joseph E. Gonzalez", "Ion Stoica" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11665v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11665v2", "@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", "cs.NI" ]
3 2 0 2 l u J 9 1 ] G L . s c [ 2 v 5 6 6 1 1 . 2 0 3 2 : v i X r a AlpaServe: Statistical Multiplexing with Model Parallelism for Deep Learning Serving Zhuohan Li1,∗ Lianmin Zheng1,∗ Yinmin Zhong2,∗ Vincent Liu3 Ying Sheng4 Xin Jin2 Yanping Huang5 Zhifeng Chen5 Hao Zhang6 Joseph E. Gonzalez1 Ion Stoica1 1UC Berkeley 2Peking University 3University of Pennsylvania 4Stanford University 5Google 6UC San Diego Abstract Model parallelism is conventionally viewed as a method to scale a single large deep learning model beyond the memory limits of a single device. In this paper, we demonstrate that model parallelism can be additionally used for the statistical multiplexing of multiple devices when serving multiple mod- els, even when a single model can fit into a single device. Our work reveals a fundamental trade-off between the overhead introduced by model parallelism and the opportunity to ex- ploit statistical multiplexing to reduce serving latency in the presence of bursty workloads. We explore the new trade-off space and present a novel serving system, AlpaServe, that determines an efficient strategy for placing and parallelizing collections of large deep learning models across a distributed cluster. Evaluation results on production workloads show that AlpaServe can process requests at up to 10× higher rates or 6× more burstiness while staying within latency constraints for more than 99% of requests. 1 Introduction Advances in self-supervised learning have enabled exponen- tial scaling in model sizes. For example, large pretrained mod- els like BERT [14] and GPT-3 [5] have unlocked a plethora of new machine learning (ML) applications from Copilot [18] to copy.ai [7] and ChatGPT [35]. Serving these very large models is challenging because of their high computational and memory requirements. For example, GPT-3 requires 325 GB of memory to store its pa- rameters as well as a requisite amount of computation to run inference. To serve this model, one would need at least 5 of Nvidia's newest Hopper 80 GB GPUs just to hold the weights and potentially many more to run in real-time. Worse yet, the explosive growth of model sizes continues unabated [6, 17]. Techniques like model compression and pruning are not suf- ficient in face of the exponential growth in model sizes and often come at the expense of reduced model quality [15]. ∗Equal contribution. Figure 1: Two placement strategies for serving two models on two GPUs. In each subfigure, the left part shows the model placements and the right part shows the timeline for handling bursty requests. At the time of "Burst 1", 4 requests of model A come at the same time. Colocation with model parallelism can reduce the average completion time of bursty requests. Provisioning sufficient resources to serve these models can be arduous as request rates are bursty. For example, using common workload traces, we observe frequent spikes in de- mand of up to 50× the average [54]. Meeting the service level objective (SLO) of latency usually means provisioning for these peak loads, which can be very expensive; additional devices allocated for this purpose would remain underutilized most of the time. Making matters worse, it is increasingly common to serve multiple models and multiple variations of the same large model in situations like A/B testing or serving fine-tuned models for specific domains (§2). This paper studies how to efficiently serve multiple large models concurrently. Specifically, we explore the underappre- ciated benefits of model parallelism in online model serving, even for smaller models that can fit on a single device. Model parallelism refers to partitioning and executing a model on dis- tributed devices (§2.1). The benefits of model parallelism have been well studied [23, 27, 31, 56] in the throughput-oriented training setting. However, its effects for model serving under latency-sensitive settings remains largely untapped. We observe that there are fundamental transition points in 1 (a) No colocationGPU 1Model AGPU 2Model BR1R2R3R4R5R6Burst 1:4requestsof model AModel placementBurst 2:2requestsof model B(b) Colocation with model parallelismGPU 1A.0GPU 2A.1R1R3R2R4Burst 1:4requestsof model AModel placementBurst 2:2requestsof model BB.0B.1R1R3R2R4R5R6R5R6 the model serving design space that challenge prior assump- tions about serving, even for models that fit on a single device. For example, consider the scenario with two models and two GPUs, each of which has sufficient memory to hold one com- plete model. As shown in Fig. 1(a), the natural approach assumed by almost all existing serving systems [9, 33, 34] is to allocate one dedicated GPU for one model. This approach appears rational because partitioning the model across GPUs would incur communication overheads that would likely in- crease the prediction latency. However, we find that inducing additional model parallelism (to the point where per-example execution time actually increases) enables a wider range of placement strategies, e.g., model co-location, which can im- prove the statistical multiplexing of the system under bursty workloads. In Fig. 1(a), assuming the execution time of a model is y, the average end-to-end latency of request 1 through 4 is (1y + 2y + 3y + 4y)/4 = 2.5y. In Fig. 1(b), assuming a 10% model-parallel overhead, the average latency of request 1 through 4 is reduced to (1.1y+1.6y+2.1y+2.6y)/4 = 1.85y. Co-location with model parallelism can utilize more devices to handle bursty requests and reduces the average comple- tion time, despite its overheads (§3.1). Even if we batch the requests, the case still holds (§6.5). Unfortunately, the decision of how to optimally split and place a collection of models is complex. Although leverag- ing model parallelism as above has its benefits, it still adds overheads that may negate those benefits for less bursty work- loads. For example, we find that a particularly influential axis on the efficacy of model parallelism is per-GPU memory ca- pacity (§3.2), although other factors (e.g., the arrival pattern, SLO) can also have a significant effect. Further, besides the inter-op model parallelism presented in Fig. 1, another kind of model parallelism, intra-op parallelism, presents its own distinct tradeoffs (§3.3). Ultimately, different styles of paral- lelism and their tradeoffs create a complex, multi-dimensional, and multi-objective design space that existing systems largely ignore and/or fail to navigate. However, not leveraging model parallelism in the serving setting is typically not an option for large models, and not addressing this trade-off space directly results in significant increases in cost and serving latency. To that end, we present AlpaServe2, a system that automat- ically and efficiently explores the tradeoffs among different parallelization and placement strategies for model serving. AlpaServe takes a cluster resource specification, a set of mod- els, and a periodic workload profile; it then partitions and places the models and schedules the requests to optimize SLO attainment (i.e., the percentage of requests served within SLO). To assist the design of AlpaServe, we first introduce a taxonomy and quantify the tradeoffs between different paral- lelization strategies in model serving (§3). We then present key algorithms to navigate the tradeoff space (§4). We de- sign an iterative simulator-guided model placement algorithm 2https://github.com/alpa-projects/mms to optimize the colocation of models and a group partition algorithm to search for the best way to partition the cluster into disjoint model-parallel groups. In addition, we extend the existing auto-parallelization algorithms for training to make them more suitable for inference. We evaluate AlpaServe with production workloads on a 64-GPU cluster (§6). Evaluation results show that, when opti- mizing one metric at a time, AlpaServe can choose to increase the request processing rate by 10×, achieve 2.5× lower la- tency deadlines, or tolerate 6× burstier traffic compared to previous state-of-the-art serving systems. In summary, we make the following contributions: • A detailed analysis of the tradeoff space of different model parallel strategies for efficient model serving. • Novel model placement algorithms to incorporate model parallelism in a serving system. • A comprehensive evaluation of AlpaServe with both synthetic and production workloads. 2 Background Over the past few years, increasingly capable models have been developed for everything from recommendations to text generation. As a result, serving predictions from these mod- els has become an essential workload in modern cloud sys- tems. The structure of these workloads often follows a simple request-response paradigm. Developers upload a pre-trained model and its weights ahead of time; at runtime, clients (either users or other applications) submit requests for that model to a serving system, which will queue the requests, dispatch them to available GPUs/TPUs, and return the results. The requirements of these model-serving systems can be stringent. To satisfy user demand, systems often must ad- here to aggressive SLO on latency. At the same time, serving systems that must run continuously need to minimize their operational costs associated with expensive accelerators. Min- imizing serving costs can be challenging because dynamically scaling compute resources would be too slow on the critical path of each prediction request: it can take multiple seconds just to swap a large model into accelerator memory [37]. Fur- thermore, there is significant and unpredictable burstiness in the arrival process of user requests. To meet tight SLO, contemporary serving systems are forced to over-provision compute resources, resulting in low cluster utilization [48]. Another pattern that emerges in serving large models is the use of multiple instances of the same or similar model archi- tectures. This is commonly seen in the practice of pretraining on large unlabeled data and fine-tuning for various down- stream tasks [14], which can significantly boost accuracy but results in multiple instances of the same model architecture. For example, Hugging Face serves more than 9,000 versions of fine-tuned BERT [24]. They either share a portion of the parameters or do not share any parameters at all for better accuracy. Prior works have [44, 57] exploited the property of shared parameters, but we do not consider the shared parame- 2 ters in this paper because AlpaServe targets general settings and full-weight tuning is still a major use case. 2.1 Model Parallelism in Model Serving Distributed parallel model execution is necessary when at- tempting to satisfy the serving performance requirements or support large models that do not fit in the memory of a single device. At a high level, distributed execution of deep learning mod- els can be classified into two categories: intra-operator paral- lelism and inter-operator parallelism [56]. Intra-operator parallelism. DL models are composed of a series of operators over multidimensional tensors, e.g., matrix multiplication over input and weight tensors. Intra-operator parallelism is when a single operator is partitioned across multiple devices, with each device executing a portion of the computation in parallel [43, 45, 50]. Depending on the specific partitioning strategy and its relationship to prior and subsequent operators in the model, partitioning can require communication among participating GPUs to split the input and then merge the output. The benefit of intra-operator parallelism for single-request execution is twofold. First, it can expand the total amount of computation available to the target model, reducing its end- to-end latency. In a similar fashion, it can expand the total memory available to the model for storing its inputs, weights, and intermediate values. The cost is the aforementioned com- munication overhead. Inter-operator parallelism. The other type of parallelism available to DL models is inter-operator parallelism, which assigns different operators of the model's execution graph to execute on distributed devices in a pipeline fashion (a.k.a. pipeline parallelism) [23, 28, 30]. Here, devices communicate only between pipeline stages, typically using point-to-point communication between device pairs. Unlike intra-operator parallelism, pipeline parallelism does not reduce the execution time of a single request. In fact, it typically increases the execution time due to modest amounts of communication latency between pipeline stages, although the total amount of transferred data is often lower than it is in intra-operator parallelism. Instead, the primary use of inter- operator parallelism in traditional serving systems is to allow the model to exceed the memory limitation of a single GPU. 3 Motivation and Tradeoff Analysis As mentioned, both types of model parallelism reduce per- device memory usage by partitioning a model on multiple devices. A key motivation for this work is that we can use this property to fit more models on one device, enabling better statistical multiplexing of the devices when handling bursty requests. We explore this idea through a series of empirical examinations and theoretical analysis, starting with an illus- trative example (§3.1), followed by an empirical analysis of when model parallelism is beneficial (§3.2), the overhead of model parallelism (§3.3), and a queueing theory-based analy- sis (§3.4). All the experiments in this section are performed on an AWS EC2 p3.16xlarge instance with 8 NVIDIA 16GB V100 GPUs. 3.1 Case Study: A Two-model Example We start with an illustrative experiment to show how model parallelism can benefit the serving of multiple models. We use two GPUs to serve two Transformer models with 6.7 billion parameters each (13.4 GB to store its FP16 weights). Because each GPU has 16 GB of memory, it can fit one and only one model. A single request takes around 0.4 s to process on one GPU. We compare the following model placements, correspond- ing to the strategies in Fig. 1. The first is simple placement, where we place one model on each GPU due to the memory constraint. The second is model-parallel placement, where we use inter-op parallelism to partition each model to a 2-stage pipeline and let each GPU execute half of each model. We evaluate the two placements when the requests to each model follow an independent Poisson process with an arrival rate of 1.5 request/s. Fig. 2a shows the cumulative distribu- tion function (CDF) and average of request latency (which includes the GPU execution time and queuing delay). Model- parallel placement reduces the average latency of the simple placement from 0.70s to 0.55s, a 1.3× speedup. The speedup comes from the better burst tolerance: when a burst arrives that exceeds the capability of a single GPU, simple placement must begin queuing requests. However, as long as the other model does not receive many requests, the model parallel placement can use both GPUs to serve the requests for the popular model via statistical multiplexing of the GPUs. This effect becomes more pronounced with higher bursti- ness, which we can demonstrate using a Gamma request ar- rival process with the same average request rate as above but a higher coefficient of variance (CV) of 3. As shown in Fig. 2b, the speedup on mean latency is now increased to 1.9×. Fig. 2d shows a representative trace of the corresponding total cluster utilization over time. Note that for each request burst, model- parallel placement can use the whole cluster and only take half of the time to process, while simple placement can only use half of the cluster. In addition, we also evaluate the case where one model re- ceives more requests than another. In Fig. 2c, we use Poisson arrival but let 20% of the requests ask for model 1 and 80% ask for model 2. Although replication performs slightly better for model 1 requests, it is drastically worse on model 2 requests compared to the model-parallel placement. For model-parallel placement, because both GPUs are shared across two models, the requests to both models follow the same latency distri- bution. Overall, model-parallel placement reduces the mean latency by 6.6×. 3 (a) Poisson arrival. (b) High CV Gamma arrival. (c) Different rates. (d) Cluster utilization. Figure 2: Latency CDF and cluster utilization in the 2-model example. Figure 3: Replication and model parallel placement illustra- tion with different memory budgets, where the memory bud- gets are set to be multiples of a single model's size. Figure 5: Serving performance with changing arrival rates. Model parallelism is beneficial for smaller rates. Figure 4: Serving performance with changing per-GPU mem- ory budgets. Model parallelism is beneficial for limited mem- ory budget. The dashed vertical line is the real per-GPU mem- ory bound of a 16GB V100. The value is around 13GB due to the need to store activations and other runtime context. 3.2 When is Model Parallelism Beneficial To further explore the nuances of model parallelism in serving, we increase the size of the deployment to 8 GPUs and 8 Transformer models with 2.6B parameters each. As a base setting, we set the requests to each model as a Gamma process with an average rate of 20 request/s and CV of 3; we then vary a range of factors to see their effects. Note that some of the settings we evaluate are impossible on real hardware (e.g., exceeding the memory capacity of a single device) so we leverage the simulator introduced in §5. The fidelity of the simulator is very high as verified in §6.1. The model in this case is smaller (5.2GB), so one GPU can also store multiple models without model parallelism. We compare two placement methods: (1) Replication. In this setting, we replicate the models to different devices until each device cannot hold any extra models. Because all the models receive equal amounts of loads on average, we replicate each model the same number of times (Fig. 3a). (2) Model Paral- 4 Figure 6: Serving performance with changing CVs. Model parallelism is beneficial for larger CVs. lelism. Here we use inter-operator parallelism and uniformly assign the Transformer layers to different GPUs. Device memory. We evaluate the mean and the tail latency of the two placement methods under different device memory capacities. For replication, more GPU memory can fit more models onto a single GPU. For model parallelism, more GPU memory can also reduce the number of pipeline stages and reduce the overhead as in Fig. 3b. The resulting mean and P99 latency is shown in Fig. 4. With more memory, more models can fit into a single GPU, so the benefit of statistical multi- plexing diminishes because replication can also effectively use multiple devices to serve the bursty requests to a single model. When the GPU memory capacity is large enough to hold all models, there is no gain from model parallelism. Request arrival. We vary the parameters of the arrival pro- cess and compare the replication placement with the model- parallel placement with 8-stage pipeline parallelism. The mean and P99 latency results of changing arrival rate are shown in Fig. 5. When the arrival rate is low, model paral- lelism can greatly reduce the serving latency. However, when the arrival rate approaches the peak serving rate of the clus- ter, the benefit of model-parallel placement starts to diminish. Eventually, it starts to perform worse than replication. This is because when all models are equally saturated, the replication 01234Latency (s)0.00.20.40.60.81.0CDFSimple PlacementSimple Placement Mean LatencyModel ParallelismModel Parallelism Mean Latency0102030Latency (s)0.00.20.40.60.81.0CDFSimple PlacementSimple Placement Mean LatencyModel ParallelismModel Parallelism Mean Latency0510152025Latency (s)0.00.20.40.60.81.0CDFSimple PlacementSimple Placement Model 1Simple Placement Model 2Simple Placement Mean LatencyModel ParallelismModel Parallelism Model 1Model Parallelism Model 2Model Parallelism Mean Latency0510152025Time (s)050100Utilization (%)Simple PlacementModel ParallelismGPU 1AGPU 2BGPU 3CGPU 4DABBCCDDACBDACBDACBDACBD1x2x4xAGPU 1GPU 2GPU 3GPU 4ACBDACBDACBDACBDA1B1C1D1A2B2C2D2A3B3C3D3A4B4C4D4A1B1C1D1A2B2C2D2A1B1C1D1A2B2C2D2Mem(a) Replication(b) Model Parallelism10203040Memory Budget (GB)12Mean Latency (s)Model ParallelismReplicationGPU Memory Bound10203040Memory Budget (GB)510P99 Latency (s)Model ParallelismReplicationGPU Memory Bound01020Total Rates (req/s)0.500.751.00Mean Latency (s)Model ParallelismReplication01020Total Rates (req/s)1234P99 Latency (s)Model ParallelismReplication02468Coefficient of Variance0246Mean Latency (s)Model ParallelismReplication02468Coefficient of Variance01020P99 Latency (s)Model ParallelismReplication (a) Real model latency. (b) Changing overhead. Figure 7: SLO attainment with changing SLOs. Model paral- lelism is beneficial for smaller SLOs. placement is able to achieve efficient cluster utilization and there is no benefit to the statistical multiplexing afforded by model parallelism. Instead, the overhead of model parallelism (§3.3) starts to become a significant factor. The mean and P99 latency results of changing CV are in Fig. 6. With a higher CV, the requests become more bursty, and the benefit of model parallelism becomes more significant. As shown in the results, with a higher CV, model parallelism can greatly outperform the performance of replication. Service level objectives. In prediction serving settings, it is common to have tight latency SLO and predictions made after these deadlines are often discarded [19]. For example, advertising systems may choose not to show an ad rather than delay rendering user content. In this case, the goal of the serving system is to optimize the percentage of requests that can be finished within the deadline, i.e., SLO attainment. In this experiment, we measure how SLOs affect the perfor- mance of the placement methods. We compare the replication and the model-parallel placement with 8-stage pipeline par- allelism. During execution, we drop the requests that will exceed the deadline even if we schedule it immediately. We scale the SLO to different multiplies of the single device exe- cution latency (SLO Scale in Fig. 7a) and compare the SLO attainment of the two methods. As in Fig. 7a, when SLO is tight (< 10× model latency), model parallelism can greatly improve SLO attainment. How- ever, when the SLO becomes looser, its SLO attainment plateaus but that of the replication placement keeps grow- ing. This result shares the same core logic as previous ex- periments: When SLO becomes looser, more requests can stay in the waiting queue, and thus the effective burstiness of the requests decreases. When many requests are queued, the system is bounded by its total processing capability, which might be affected by the model parallelism overhead. In the real world, the SLO requirement is often less than 5× of the model execution latency [19], where model parallelism can improve SLO attainment. Summary: Model parallelism benefits model serving through statistical multiplexing when the device mem- ory is limited, the request rate is low, the request CV is high, or the SLO is tight. 5 (a) Inter-op parallelism. (b) Intra-op parallelism. Figure 8: The overhead decomposition. The overhead of inter- op parallelism mainly comes from uneven partition while the overhead of intra-op parallelism comes from communication. 3.3 Overhead of Model Parallelism In this section, we further investigate the overheads of dif- ferent model parallel strategies and how they affect serving performance. Similar to the setup in Fig. 7a, we manually modify the overhead of model parallelism. Specifically, let the latency of a single model executing on the GPU be L and the number of pipeline stages be n. We set the total latency of pipeline execution to be αL and the latency of each pipeline stage to be αL/n, where α is a parameter that controls the overhead. When α = 1, model parallelism does not have any overhead and larger α means higher overhead. We show the results in Fig. 7b. If model parallelism does not have any overhead (α = 1), it can always outperform repli- cation due to its ability to multiplex the devices. When the overhead becomes larger and the SLO is low, model paral- lelism still outperforms replication. However, with a larger SLO, the effective burstiness is reduced and the performance is dominated by the overhead. Given that the overhead can greatly affect serving perfor- mance, we perform a detailed study of the multiple sources of model-parallel overhead in Fig. 8. For inter-op parallelism, when partitioning a single model into multiple stages, dif- ferent stages need to communicate the intermediate tensors, and we denote this overhead as the communication overhead. In addition, the pipeline execution will be bottlenecked by the execution time of the slowest stage, making the effective latency to be the number of pipeline stages times the latency of the slowest stage [23]. We denote this as the uneven par- tition overhead. As in Fig. 8a, for inter-op parallelism, most overhead comes from the latency imbalance among different pipeline stages, instead of the communication between stages. While our previous discussion mainly focuses on inter-op parallelism, the other type of model parallelism, intra-op par- allelism, has very different performance characteristics. Its overhead is merely brought by the collective communication across multiple devices [31], which cannot be overlapped with the neural network computation due to data dependency. From Fig. 8b, we can see that the communication overhead of intra-op parallelism is much higher than inter-op parallelism. Finally, we compare the latency, throughput, and memory consumption of different model-parallel placements and the 5101520SLO Scale050100SLO Attainment (%)Model ParallelismReplication5101520SLO Scale050100SLO Attainment (%)Model Parallelism (α=1.0)Model Parallelism (α=1.1)Model Parallelism (α=1.2)Model Parallelism (α=1.3)Model Parallelism (α=1.4)Model Parallelism (α=1.5)Replication1248Number of GPUs0.00.10.20.3Latency (s)CompuationCommunication OverheadUneven Partition Overhead1248Number of GPUs0.000.050.100.150.200.25Latency (s)CompuationCommunication Overhead (a) Single input latency. (b) Throughput. (c) Total memory usage. Figure 9: The latency, throughput and memory usage vs. #GPUs for inter-op parallelism, intra-op parallelism, and replication. In subfigure (c), the lines for inter-op and intra-op parallelism overlap. replication placement in Fig. 9. Because of the sequential dependence between the different stages, inter-op parallelism cannot reduce the execution latency of a single input data. In- stead, the latency is slightly higher due to the communication between the stages. On the other hand, intra-op parallelism can largely reduce the latency via the parallel execution of dif- ferent GPUs (Fig. 9a). However, because inter-op parallelism can pipeline the execution of different stages and only com- municate a relatively small amount of data, it attains higher throughput compared to intra-op parallelism (Fig. 9b). Be- cause both parallel methods split the model weight tensors across different GPUs, the total memory usage stays con- stant with increasing numbers of GPUs (Fig. 9c). This makes the statistical multiplexing of different GPUs across multiple models possible. In the end, the tradeoff between parallelization strategies and their interplay with cluster resources, arrival patterns, and serving objectives forms an intricate design space. 3.4 Queueing Theory Analysis In this section, we use queuing theory to mathematically ver- ify the conclusions in §3.2 and §3.3. Specifically, we analyze the case where the inputs follow the Poisson arrival process. Since the execution time of a deep learning inference task is highly predictable [19], we assume the request serving time is deterministic. For the single device case, suppose the request rate to a model is λ0 and the single device latency is D with the utilization λ0D < 1, then the average number of requests LQ and the average latency W in this M/D/1 queue [46] are: LQ = λ0D 2(1 − λ0D) , W = D + LQD = D + λ0D2 2(1 − λ0D) . Now consider the example in §3.1. Let pλ, (1 − p)λ be the average request rates for the two models respectively, where p ∈ [0, 1] controls the percentage of requests for both models. Then for the simple placement, the average latency can be derived as the average latency of two independent queues: Wsimple = D + p2λD2 2(1 − pλD) + (1 − p)2λD2 2(1 − (1 − p)λD) . 6 Figure 10: Maximal communication overhead α and uneven partition overhead β satisfy Wpipeline ≤ Wsimple as a function of total utilization λD. Note that Wsimple reaches minimum when p = 1/2. Intuitively, when p is not exactly half, one model receives more requests than the other. This larger portion of requests have a longer queueing delay, which leads to the higher overall mean la- tency. For the model-parallel case, the requests to both models merged to a single Poisson Process with rate λ. For pipeline parallelism, suppose the latency for a single input to be Ds and the maximum stage latency to be Dm, then the average latency would be Wpipeline = Ds + λD2 m 2(1 − λDm) . Suppose there is no model-parallel overhead, then Ds = 2Dm = D. Let's first consider the case where p = 1/2 (Fig. 2a). We have Wsimple = D + λD2 4 − 2λD , Wpipeline = D + λD2 8 − 4λD . In this case, the waiting time for model-parallel execution is half of the simple placement waiting time, as shown in the vertical lines in Fig. 2a. When the p is not 1/2, Wsimple will increase while Wpipeline will stay the same, so the gap between Wsimple and Wpipeline will be even larger, as in Fig. 2c. Next, we consider the case where model parallelism in- curs overhead. We measure the two types of overheads in §3.3 separately: With the overhead from communication, Ds = 2Dm = αD, where α ≥ 1 is the overhead factor. With the overhead from uneven stages, we suppose Ds = D still holds, but Dm = βD/2 where β ≥ 1 is the overhead factor. To keep Wpipeline ≤ Wsimple, we can get the maximal α and 2468#GPUs0.00.10.2Latency (s)Inter-op ParallelismIntra-op ParallelismReplication2468#GPUs102030Throughput (req/s)Inter-op ParallelismIntra-op ParallelismReplication2468#GPUs10203040Memory (GB)Inter-op ParallelismIntra-op ParallelismReplication0.00.51.01.52.0λD1.01.21.4αβ for generating efficient model parallel partitions: inter-op pass and intra-op pass. The inter-op pass uses a dynamic program- ming (DP) algorithm to figure out the optimal inter-op parallel plan, and it calls the intra-op pass for each potential pipeline stage, which is formulated as an integer linear programming (ILP) problem, to profile its latency with the optimal intra- op parallel plan. In AlpaServe, we keep the two compilation passes, but extends both passes for serving. The inter-op pass in Alpa optimizes the overall pipeline execution latency, which includes the time of forward and backward propagation and weight synchronization. However, in serving workloads, only forward propagation is being exe- cuted and there is no need for weight synchronization. There- fore, we reformulate the dynamic programming in AlpaServe to merely focus on minimizing the maximal stage latency. Specifically, denote F(s, k) to be the maximum latency when slicing layers 1 to k into s stages. We can derive F as F(s, k) = min 1≤i≤k {max{F(s − 1, i − 1), latency(i, k)}} , where latency(i, k) denotes the latency of a stage composes of layer i to k. In Alpa, the latency function of all possible O(K2) combinations is being profiled by the intra-op pass because of the complicated dependency between forward and backward passes. In AlpaServe, because the pipeline stages only perform forward propagation and only communicate intermediate results once between layer boundaries, we can accelerate the profiling by only profiling K layers and letting latency(i, k) to be the sum of the latencies for layer i to k. This acceleration enables us to efficiently enumerate different inter- and intra-op device partition setups and generate a list of parallel strategies for the placement algorithm in §4.2. For the intra-op pass, we extend the ILP in Alpa to drop all configurations that use data parallelism. For serving work- loads, because there is no need for weight synchronization, data parallelism can be achieved by the replication placement. We leave the decision of whether to replicate a model to the placement algorithm in §4.2. 4.2 Placement Algorithm Given a set of models and a fixed cluster, AlpaServe parti- tions the cluster into several groups of devices. Each group of devices selects a subset of models to serve using a shared model-parallel configuration. Different groups can hold the same model as replicas. The requests for a model are dis- patched to the groups with the requested model replica. We call a specific cluster group partition, model selection, and parallel configuration as a placement. Our goal is to find a placement that maximizes the SLO attainment. However, finding the optimal placement is a difficult combi- natorial optimization problem. The overall placement config- uration space grows exponentially with the number of devices and the number of models. To make things worse, the objec- tive "SLO attainment" has no simple analytical formula for Figure 11: AlpaServe Runtime System Architecture β as a function of the total utilization λD separately and we visualize the function in Fig. 10. When the utilization is high, the benefit of statistical multiplexing diminishes, and thus the overhead needs to be low, as in §3.2. On the other hand, when the utilization is very low, most requests will not be queued, and thus the communication overhead α needs to be low to keep the processing latency to be low. Note that the maximal overhead here is based on a uniform Poisson ar- rival distribution. A more bursty or more non-uniform arrival distribution will make the simple placement performs worse and make the model-parallelism placement outperforms the simple replication placement with even higher overhead. 4 Method From §3, we can see that there are several key challenges to effectively utilize model parallelism for deep learning serving: • Derive efficient model parallel strategies for inference to reduce the overhead of model parallelism. Specifically, find a partitioning strategy that minimizes the stage im- balance for inter-operator parallelism. • Determine model-parallel placements according to the arrival pattern to maximize SLO attainment. We built AlpaServe to specifically tackle these challenges. The runtime architecture of AlpaServe is shown in Fig. 11. Al- paServe utilizes a centralized controller to dispatch requests to different groups.3 Each group hosts several model replicas on a shared model-parallel runtime. This section describes the ar- chitecture of AlpaServe and the key algorithms for efficiently leveraging model parallelism in a model serving system. 4.1 Automatic Parallelization for Inference Since different parallelization configurations have different latency and throughput trade-offs, we need to enumerate mul- tiple possible configurations for every single model and let the placement algorithm choose the best combination for all mod- els in the whole cluster. Therefore, given a model, AlpaServe first runs an auto-parallelization compiler with various con- straints to generate a list of possible configurations. We build several extensions on top of an existing auto parallelization training system, Alpa [56], to make it suitable for generating serving parallelization strategies. Alpa includes two passes 3For a larger service, AlpaServe can be extended as a hierarchical deploy- ment with each controller only managing a subset of devices as in [52]. 7 ControllerHTTP RequestsModel aModel bModel cGPUGPUGPUGPUModel Parallel RuntimeModel aModel dModel eGPUGPUGPUGPUModel Parallel RuntimeModel fModel gGPUGPUModel Parallel RuntimeGroup 1Group 2Group 3 Algorithm 1 Simulator-Guided Greedy Model Selection. Input: Model list M, device group list G, group parallel con- figurations P, workload W , beam size k (default = 1). Output: The model selection best_sel. best_sel ← /0 beam_sels ← { /0} while true do new_sels ← /0 for sel ∈ beam_sels do for (m, (g, p)) ∈ M × (G, P) do // Parallelize the model as in §4.1. mparallelized ← parallelize(m, g, p) sel′ ← sel.add_model_to_group(mparallelized, g) if sel′ is in memory constraint then sel′.slo_attainment ← simulate(sel′,W ) new_sels.append(sel′) if new_sels = /0 then break beam_sels ← top-k_SLO_attainment(new_sels) sel∗ ← pick_highest_SLO_attainment(beam_sels) if sel∗.slo_att > best_sel.slo_att then best_sel ← sel∗ Algorithm 2 Enumeration-Based Group Partition and Model- Parallel Configuration Selection. Input: Model list M, cluster C, workload W . Output: The placement best_plm. best_plm ← /0 B ← get_potential_model_buckets(M) for (B1, B2, . . . , Bk) ∈ B do H ← get_potential_device_buckets(C, B, k) for (H1, H2, . . . , Hk) ∈ H do // Get the placement for each bucket individually. for i from 1 to k do i ← /0 plm∗ G ← get_potential_group_partitions(Hi) for G ∈ G do P ← get_potential_parallel_configs(G) for P ∈ P do plm ← greedy_selection(Bi, G, P,W ) if plm.slo_att > plm∗ i ← plm 1, ..., plm∗ k) plm∗ plm∗ ← concat(plm∗ if plm∗.slo_att > best_plm.slo_att then i .slo_att then best_plm ← plm∗ return best_sel return best_plm an arbitrary arrival distribution. Existing tools and approxima- tions from queueing theory can only analyze simple cases in §3.4 and cannot model more complex situations [46]. There- fore, we resort to a simulator-guided greedy algorithm that calls a simulator to compute SLO attainment. To compute the SLO attainment with a given set of requests and placement, in AlpaServe, we assume we know the arrival process in advance. Although short-term burstiness is impos- sible to predict, the arrival pattern over longer timescales (e.g., hours or days) is often predictable [48]. Given this predictabil- ity, AlpaServe either directly uses the history request traces or fits a distribution from the trace and resamples new traces from the distribution as the input workload to the simulator to compute the SLO attainment. We design a two-level placement algorithm: Given a cluster group partition and a shared model-parallel configuration for each group, Algorithm 1 uses a simulator-guided greedy algo- rithm to decide which models to select for each group. Then, Algorithm 2 enumerates various potential cluster partitions and parallel configurations and compares the SLO attainment from Algorithm 1 to determine the optimal placement. Given a cluster group partition with a fixed model-parallel configuration for each group, Algorithm 1 selects model repli- cas iteratively as a beam search algorithm: At each iteration, it enumerates all possible (model, group) pairs, parallelizes the model on the device group with the algorithms in §4.1, and checks whether the model can be put on the group under the memory constraint. For all valid selections, it runs the simulator and computes SLO attainment. It then picks the top-k solutions and enters the next iteration. The algorithm terminates when no more replicas can be put into any groups. The complexity of Algorithm 1 is O(MGRSB), where M is the number of models, G is the number of groups, R is the number of replicas we can put according to the memory constraint, S is the number of requests in the workload (the simulation time is proportional to the number of the requests) and B is the beam size. It runs reasonably fast for our medium- scale cluster when the number of requests is small. When the number of requests is very large, we propose another heuristic to accelerate: Instead of using the simulator to evaluate all (model, group) pairs at each iteration, we can run the simu- lator only once and place a model with the most unserved requests in an available group with the lowest utilization. This reduces the time complexity to O((M + G)RS). We find this heuristic gives solutions with SLO attainment higher than 98% of the SLO attainment get by the original algorithm in our benchmarks. Algorithm 2 enumerates different group partitions and model-parallel configurations and picks the best one via mul- tiple calls to Algorithm 1. When designing Algorithm 2, the first phenomenon we notice is that putting small and large models in the same group causes convoy effects, where the requests of small models have to wait for the requests of large models and miss the SLO. Therefore, in Algo- rithm 2, we first cluster models into model buckets. Each bucket contains a set of models with relatively similar sizes 8 and every model is assigned to one and only one bucket. Specifically, the function get_potential_model_buckets returns all the possible model bucket partitions that sepa- rate models whose latency difference is larger than a thresh- old into different disjoint buckets. We then enumerate all the potential ways to assign the devices to each bucket in get_potential_device_buckets. Because different buckets include a disjoint set of models, we can then figure out the optimal placement for each bucket individually. For each bucket, we enumerate possible ways to partition the devices in the bucket into several groups in get_potential_group_partitions and enumerate the po- tential parallel configurations for each group with the method in get_potential_parallel_configs. We then call Al- gorithm 1 with greedy_placement to place models in the model bucket to the groups in the device bucket. We send the whole workload W to Algorithm 1, which ignores the requests that hit the models outside of the current bucket. Finally, a complete solution is got by concatenating the solutions for all buckets. The algorithm returns the best solution it finds during the enumerative search process. Enumerating all possible choices can be slow, so we use the following heuristics to prune the search space. Intuitively, we want the different buckets to serve a similar number of requests per second. Therefore, we eliminate the bucket con- figurations with high discrepancies in the estimated num- ber of requests it can serve per second for each bucket. Additionally, in get_potential_group_partitions and get_potential_parallel_configs, we assume all groups have the same size and the same parallel configurations except for the last group which is used when the number of devices is not divisible by the group size. 4.3 Runtime Scheduling We use a simple policy to dispatch and schedule the requests at runtime. All requests are sent to a centralized controller. The controller dispatches each request to the group with the short- est queue length. Each group manages a first-come-first-serve queue. When a group receives a request, it checks whether it can serve the request under SLO and rejects the request if it cannot. This is possible because the execution time of a DNN model is very predictable and can be got in advance by profiling [19]. In most of our experiments, we do not include advanced runtime policies such as batching [19], swapping, and preemption [21]. These techniques are complementary to model parallelism. Nevertheless, we discuss how they fit into our system. Batching. Batching multiple requests of the same model to- gether can increase the GPU utilization and thus increase the throughput of a serving system. In our system, we do find batching is helpful, but the gain is limited. This is because we mainly target large models and a small batch size can already fully saturate the GPU, which is verified in §6.5. To isolate the benefits of model parallelism and make the results more explainable, we decide to disable any batching in this paper except for the experiments in §6.5. Preemption. The optimal scheduling decision often depends on future arrivals, and leveraging preemption can help cor- rect previous suboptimal decisions. The first-come-first-serve policy may result in convoy effects when models with signifi- cantly different execution times are placed in the same group. We anticipate a least-slack-time-first policy with preemption can alleviate the problems [12]. Swapping. The loading overheads from the CPU or Disk to GPU memory are significant for large models, which is the target of this paper, so we do not implement swapping in Al- paServe. We assume all models are placed on the GPUs. This is often required due to tight SLOs and high rates, especially for large models. The placement of models in AlpaServe can be updated in the periodic re-placement (e.g., every 24 hours). Fault tolerance. While the current design of AlpaServe does not have fault tolerance as a focus, we acknowledge several potential new challenges for fault tolerance: With model par- allelism, the failure of a single GPU could cause the entire group to malfunction. Additionally, the use of a centralized controller presents a single point of failure. 5 Implementation We implement a real system and a simulator for AlpaServe with about 4k lines of code in Python. The real system is implemented on top of an existing model-parallel training sys- tem, Alpa [56]. We extend its auto-parallelization algorithms for inference settings to get the model-parallel strategies. We then launch an Alpa runtime for each group and dispatch requests to these groups via a centralized controller. The simulator is a continuous-time, discrete-event simula- tor [39]. The simulator maintains a global clock and simulates all requests and model executions on the cluster. Because the simulator only models discrete events, it is orders of magni- tude faster than the real experiments. In our experiment, it takes less than 1 hour for a 24-hour trace. The fidelity of the simulator is very high because of the predictability of DNN model execution, which is verified in §6.1. 6 Evaluation In this section, we evaluate AlpaServe's serving ability under a variety of model and workload conditions. The evaluation is conducted on a range of model sizes, including those that do and do not fit into a single GPU, and we show that AlpaServe consistently outperforms strong baselines across all model sizes. In addition, we evaluate the robustness of AlpaServe against changing arrival patterns and do ablation studies of our proposed techniques. Evaluation results show that AlpaServe can greatly improve various performance metrics. Specifically, AlpaServe can choose to save up to 2.3× devices, handle 10× higher rates, 6× more burstiness, or 2.5× more stringent SLO, while meeting the latency SLOs for over 99% requests. 9 Name Size Latency (ms) BERT-1.3B BERT-2.7B BERT-6.7B BERT-104B MoE-1.3B MoE-2.4B MoE-5.3B 2.4 GB 5.4 GB 13.4 GB 208 GB 2.6 GB 4.8 GB 10.6 GB 151 238 395 4600 150 171 234 S1 32 0 0 0 0 0 0 S2 0 0 32 0 0 0 0 S3 10 10 10 0 10 10 10 S4 0 0 0 4 0 0 0 Table 1: The first three columns list the sizes and inference latency of the models. The latency is measured for a single query with a sequence length of 2048 on a single GPU. BERT- 104B's latency is reported using a minimal degree of inter-op parallelism. The latter columns list the number of instances for each model in different model sets named as S1-S4. 6.1 Experiment Setup Cluster testbed. We deploy AlpaServe on a cluster with 8 nodes and 64 GPUs. Each node is an AWS EC2 p3.16xlarge instance with 8 NVIDIA Tesla V100 (16GB) GPUs. Model setup. Since Transformer [47] is the default backbone for large models, we choose two representative large Trans- former model families: BERT [14] and GShard MoE [27] for evaluation.4 In ML practice, the large model weights are usually pretrained and then finetuned into different versions for different tasks. Hence, for each model family, we select several most commonly used model sizes [5], and then create multiple model instances at each size for experimentation. Also, we design some model sets to test the serving systems under different model conditions; details about model sizes, their inference latency on testbed GPUs, and the number of model instances in each model set are provided in Tab. 1. Metrics. We use SLO attainment as the major evaluation metric. Under a specific SLO attainment goal (say, 99%), we concern with another four measures: (1) the minimal num- ber of devices the system needs, (2) the maximum average request rate, (3) the maximum traffic burstiness the system can support, and (4) the minimal SLO the system can handle. We are particularly interested in a SLO attainment of 99% (in- dicated by vertical lines in all curve plots), but will also vary each variable in (1) - (4) and observe how the SLO attainment changes. Simulator fidelity. We want to study the system behavior under extensive models, workload, and resource settings, but some settings are just beyond the capacity of our testbed. Also, it is cost- and time-prohibitive to perform all experiments on the testbed for the days-long real traces. To mitigate the prob- lem, we use the simulator introduced in §5 for the majority of our experiments, noticing that DNN model execution [19] has high predictability, even under parallel settings [27, 56]. 4In this paper, we focus on non-autoregressive large models which per- form inference with one forward pass, but note that the techniques proposed in this paper can be extended to auto-regressive models like GPT-3. SLO Scale Selective Replication Real System Simulator AlpaServe Real System Simulator 0.5x 1x 1.5x 2x 3x 4x 5x 10x 00.0% 00.0% 29.7% 36.9% 49.5% 58.6% 64.9% 83.1% 00.0% 00.0% 30.2% 36.8% 48.5% 57.8% 64.0% 82.6% 33.3% 53.5% 64.1% 79.0% 91.4% 96.4% 97.6% 100.0% 33.3% 53.2% 64.7% 80.6% 92.1% 96.5% 97.9% 99.7% Table 2: Comparison of the SLO attainment reported by the simulator and the real system under different SLO scales. We study the fidelity of the simulator in Tab. 2. Given two model placement algorithms, we compare the SLO attain- ment reported by the simulator and by real runs on our testbed under different SLO Scales. The error is less than 2% in all cases, verifying the accuracy of our simulator. Additionally, we conduct experiments on cluster testbed for results in §6.3. 6.2 End-to-end Results with Real Workloads In this section, we compare AlpaServe against baseline meth- ods on publicly available real traces. Workloads. There does not exist an open-source production ML inference trace to the best of our knowledge. Therefore, we use the following two production traces as a proxy: Mi- crosoft Azure function trace 2019 (MAF1) [42] and 2021 (MAF2) [54]. They were originally collected from Azure serverless function invocations in two weeks, and have been repurposed for ML serving research [4, 25]. The two traces exhibit distinct traffic patterns. In MAF1, each function re- ceives steady and dense incoming requests with gradually changing rates; in MAF2, the traffic is very bursty and is distributed across functions in a highly skewed way – some function receives orders of magnitude more requests than others. Note that most previous works [19] are evaluated on MAF1 only. Since there are more functions than models, fol- lowing previous work [4, 25], given a model set from Tab. 1, we round-robin functions to models to generate traffic for each model. Setup. SLO attainment depends on many factors. For each metric (1) - (4) mentioned in §6.1, we set a default value, e.g., the default SLO is set as tight as 5× inference latency (SLO Scale=5). This forms a default setting, given which, we then vary one variable (while fixing others) at a time and observe how it affects the resulting SLO attainment. To change the two variables (3) and (4), which characterize traffic patterns, we follow Clockwork [19] and Inferline [8] and slice the original traces into time windows, and fit the arrivals in each time window with a Gamma Process parameterized by rate and coefficient of variance (CV). By scaling the rate and CV and resampling from the processes, we can control the rate and burstiness, respectively. Baselines. We compare AlpaServe to two baseline methods: 10 Figure 12: SLO attainment under various settings. In column S1@MAF1, we replay the MAF1 trace on the model set S1, and so on. In each row, we focus on one specific metric mentioned in §6.2 to see how its variation affects the performance of each serving system. If any, the dotted vertical line shows when the system can achieve 99% SLO attainment. (1) Selective Replication (SR): use AlpaServe's placement al- gorithm without model parallelism, which mimics the policy of a wide range of existing serving systems [9, 44]; (2) Clock- work++: an improved version of the state-of-the-art model serving system Clockwork [19]. The original Clockwork con- tinuously swaps models into and out of GPUs. This helps for very small models (e.g., w/ several million parameters) but incurs significant swapping overheads on larger models. For fair comparisons, we implement Clockwork++ in our simula- tor, which swaps models following Clockwork's replacement strategy at the boundary of every two windows5 of the trace using SR's algorithm, but assuming zero swapping overheads. We believe it represents a hypothetical upper bound of Clock- work's performance. Since all the baselines can only support models that can fit into one GPU memory,6 we use model set S1, S2 and S3 from Tab. 1 in this experiment. SLO attainment vs. cluster size. Fig. 12's first row shows the SLO attainment with varying cluster sizes when serving a specific (model set, trace) pair. AlpaServe outperforms the two baselines at all times and uses far fewer devices to achieve 99% SLO attainment thanks to model parallelism. By splitting 5For MAF1, we follow Clockwork to set the window size as 60 seconds. For MAF2, we set it as 5.4K seconds. 6In our cluster testbed, the per-GPU memory is 16GB, but the actual available space for model weights is around 13GB due to the need to store activations and other runtime context. one model replica onto N devices, AlpaServe can achieve similar throughput as if N replica were created for replication- only methods; but note AlpaServe uses only one replica of memory. Surprisingly, although we let Clockwork++ adjust to the traffic dynamically with zero overhead, AlpaServe still wins with a static placement; this is because model-parallel placement is by nature more robust to bursty traffic. It is worth noting that replication-only methods can at most place 2 replicas of BERT-2.6B on a V100 (13GB memory bud- get), resulting in a substantial memory fraction, while model parallelism can avoid such memory fractions and enable more flexible placement of models. SLO attainment vs. rate. Fig. 12's 2nd row varies the rate of the workloads. For a stable trace like MAF1, AlpaServe can handle a much higher rate than baselines. While for a skewed and highly dynamic trace MAF2, whose traffic is dominated by a few models and changes rapidly, the replication-based methods have to allocate the majority of the GPUs to create many replicas for "hot" models to combat their bursty traffic; those GPUs, however, may go idle between bursts, even with frequent re-placement as in Clockwork++. In AlpaServe, each model needs fewer replicas to handle its peak traffic. SLO attainment vs. CV. Fig. 12's 3rd row varies the CV of the workloads. The traffic becomes more bursty with a higher CV, which aggravates the queuing effect of the system and increases the possibility of SLO violation. The traditional 11 1020304050#devices60708090100S1 @ MAF16080100120#devices60708090100S2 @ MAF1406080#devices60708090100S3 @ MAF151015#devices60708090100S1 @ MAF2204060#devices60708090100S2 @ MAF2204060#devices60708090100S3 @ MAF2SLO Attainment (%)AlpaServeClockwork++SR0.0020.0040.0060.008Rate Scale607080901000.0020.0040.0060.008Rate Scale607080901000.0020.0040.0060.008Rate Scale6070809010020406080100Rate Scale6070809010020406080100Rate Scale607080901000204060Rate Scale60708090100SLO Attainment (%)2468CV Scale4060801002468CV Scale4060801002468CV Scale406080100246810CV Scale406080100246810CV Scale4060801002468CV Scale406080100SLO Attainment (%)2.55.07.510.0SLO Scale02550751002.55.07.510.0SLO Scale02550751002.55.07.510.0SLO Scale02550751001234SLO Scale02550751001234SLO Scale025507510012345SLO Scale0255075100SLO Attainment (%) solution to handle burstiness is by over-provision, wasting a lot of resources. AlpaServe reveals a hidden opportunity to handle this by model parallelism. SLO attainment vs. SLO. Fig. 12's 4th row shows the effect of different SLO. Previous work [19] which targets serving small models usually sets SLO to hundreds of milliseconds, even though the actual inference latency is less than 10 ms. Thanks to the intra-op parallelism, AlpaServe can maintain good performance under similar SLO when serving large models, whose inference latency can be over 100 ms. When SLO is tight, even less than the model inference time, Al- paServe favors intra-op parallelism to reduce the inference latency, which also reduces AlpaServe's peak throughput due to the communication overhead but can make more requests to meet their SLO. When SLO becomes looser, AlpaServe will automatically switch to use more inter-op parallelism to get higher throughput. 6.3 Serving Very Large Models Today's large models may possess hundreds of billions of parameters [5, 31, 53]. To serve large models at this scale, the common practice in production is to choose the model parallelism strategy manually and use dedicated GPUs for each model [51]. To show AlpaServe has improved capability in serving very large models, we deploy model set S4 on our testbed, each requiring at least 16 GPUs to serve in terms of memory usage. As baselines, for each model, we enumerate all combinations of inter- and intra-op parallelisms on 16 GPUs. In contrast, AlpaServe searches for the optimal GPU group allocation and model placement according to the arrival traffic and tries to achieve statistical multiplexing. Offered load. In the default setting, the traffic is generated via a Gamma Process with an average rate of 8 requests/s and CV of 4. We then split the requests to each model following a power law distribution with an exponent of 0.5 to simulate the real-world skewness.7 Similar to §6.2, we vary one of the rate, CV, or SLO in the default setting to see how each factor contributes to the resulting performance. It is worth noting that all results presented in this section are obtained via real execution on the testbed cluster. SLO attainment. Fig. 13 shows the SLO attainment of each system under various settings. Although enumerating par- allelism strategies and selecting the best can improve per- formance, it still remains a substantial gap compared to Al- paServe. This means that the traditional way of using ded- icated GPUs to serve large models is not ideal. We check the solution of AlpaServe and find it slices the cluster evenly into two groups, each with the (4, 8) inter-/intra-op parallel configuration, and groups the models in a way that balances the requests between two groups. This further proves that our motivation in §3.1 still holds for extremely large models. By 7Uniform split yielded similar results. Figure 13: SLO attainment as we vary the rate, CV, and SLO scale. (8,2) means 8-way inter-op parallelism and in each pipeline stage using 2-way intra-op parallelism. space-sharing the devices, AlpaServe can exploit new oppor- tunities for statistical multiplexing, which is advantageous for bursty workloads but largely under-explored by prior work. 6.4 Robustness to Changing Traffic Patterns Until now, AlpaServe's good performance is based on the assumption we make in its placement algorithm that we know the arrival process in advance. In practice, the arrival process can be approximated using historical traces but the unavoid- able real-world variance may make the prediction inaccurate. In this experiment, we study how AlpaServe performs if the traffic patterns change. We reuse the same setting for S2@MAF1 in §6.2, but this time for AlpaServe and SR, we randomly slice two one-hour traces from MAF1, one is what their algorithms are assumed, while the other one is used as the actual arrival process. While for Clockwork++, we still run its algorithm directly on the actual arrival process to respect its online nature. Similarly, we vary different factors and compute the SLO attainment for each system. We repeat the experiments three times and show the average results in Fig. 14. Unsurprisingly, SR's performance drops significantly when traffic changes. By contrast, AlpaServe maintains good per- formance and still outperforms Clockwork++, an online ad- justment algorithm, using a static placement generated from substantially different traffic patterns. This confirms that, in face of highly-dynamic traffic patterns, statistical multiplex- ing with model parallelism is a simple and better alternative than existing replication- or replacement-based algorithms. 6.5 Benefits of Dynamic Batching Batching is a common optimization in other serving sys- tems [19, 33, 34] and the choice of batch size is critical to the performance because it can increase GPU utilization and thus increase the system throughput. However, in large model scenarios, the benefit of batching is limited mainly due to two reasons. First, for large models, a small batch size will saturate the GPU, which means there is little gain to batching more requests. Second, the execution latency grows linearly with the batch size [44], so when the SLO is tight (say SLO Scale is less than 2), batching is simply not a choice. To isolate the benefits of model parallelism and make the 12 2.55.07.5Rate (r/s)607080901001234CV607080901002.55.07.5SLO Scale020406080100SLO Attainment (%)AlpaServe(16,1)(8,2)(4,4)(2,8) Figure 14: The actual arrival traffic for AlpaServe and SR is different from what their algorithms are assumed, while Clockwork++ runs directly on the actual traffic. Figure 15: SLO Attainment when batching is enabled. mb=2 means the maximum batch size is 2. results more explainable, we decide to disable any batching in other experiments but prove that the batching strategy is purely orthogonal to the scope of this paper in this subsection. To prove this, we implement a standard batching algorithm in AlpaServe and evaluate its performance. Batching strategy. When a request arrives, it will get exe- cuted immediately if any device group is available. Otherwise, it will be put into a per-model requests queue for batching. When a device group becomes idle, it will choose a model which has a replica on it and batch as many requests as possi- ble from the requests queue of the model while satisfying the SLO requirements. Setup. As the model size increases, the potential benefit of batching decreases. Therefore, we choose to evaluate model set S1. We generate a synthetic Gamma Process traffic with an average rate of 4 requests/s and a CV of 4 for each model. SLO attainment. Fig. 15 (left) shows the SLO attainment achieved by AlpaServe with different maximum batch size set- tings under various SLO scales. When the SLO requirement is tight, any batching will violate the SLO so there is no gain with batching enabled. Also, although we choose to serve the smallest model in Tab. 1, a small batch size like 2 combined with a long sequence length of 2048 already saturates the GPU, so a larger maximum batch size brings no performance improvement. Fig. 15 (right) compares the improvement for AlpaServe and Clockwork++ with our batching algorithm enabled.8 When the SLO requirement becomes loose, both AlpaServe and Clockwork++ have better SLO attainment to (a) Transformer 1.3B. (b) Transformer 2.6B. Figure 16: Comparison of the model parallel overhead be- tween manual partition (lighter color) and the partition found by the automatic algorithm (darker color). some extent. Since AlpaServe's performance is good even without batching and batched requests with different batch sizes will incur stage imbalance and pipeline bubble in inter- op parallel, the absolute improvement of Clockwork++ is slightly better. 6.6 Ablation Study In this section, we study the effectiveness of our proposed auto-parallelization (§4.1) and placement algorithms (§4.2). Benefits of auto-parallelization. We show that the auto- parallelization ability allows AlpaServe to not only gener- alize to arbitrary model architectures but even also reduce parallelism overheads – hence improved serving performance (see §3.3 for more discussion). To see that, typical manual model-parallel parallelization strategies offered in de facto systems [1, 31, 32] is to assign an equal number of (trans- former) layers to each pipeline stage. These strategies often fail to create balanced workloads across distributed GPUs be- cause contemporary large models have heterogeneous layers, such as embedding operations. The extensions introduced in §4.1 automatically partition the models at the computational graph level and generate nearly-balanced stages. Empirically, as shown in Fig. 16, for 8 pipeline stages, auto-parallelization reduces the total overhead by 32.9% and 46.7% for Trans- former 1.3B and 2.6B respectively, which is necessary for achieving good serving performance when model parallelism is used for serving. 8SR is left out to make the figure clearer as it is worse than Clockwork++. Effectiveness of the placement algorithm. We now test the 13 1020304050#devices0204060801000.0020.0040.0060.008Rate Scale0204060801002468CV Scale020406080100246810SLO Scale020406080100SLO Attainment (%)AlpaServeClockwork++SR0.02.55.07.510.012.5SLO Scale020406080100AlpaServeAlpaServe (mb=2)AlpaServe (mb=4)AlpaServe (mb=8)AlpaServe (mb=16)0.02.55.07.510.012.5SLO Scale020406080100AlpaServeClockwork++AlpaServe (mb=2)Clockwork++ (mb=2)SLO Attainment (%)1248Number of GPUs0.1000.1250.1500.1750.2000.2250.250Latency (s)CompuationCommunication OverheadUneven Partition Overhead1248Number of GPUs0.200.220.240.260.280.30Latency (s)CompuationCommunication OverheadUneven Partition Overhead Inference optimizations for large models. AlpaServe is com- plementary to another large body of work on optimizations for inference over large models. These include techniques like quantization [13], distillation [41], offloading [1], better oper- ator parallelism [36], and CUDA kernel optimization [11, 26]. Some of these optimizations are intended to stem the tide of increasing model sizes; however, all of these gains are partial- the challenge of serving large models has continued to escalate rapidly despite these efforts. Model parallelism for training. AlpaServe is largely orthog- onal to the large body of work on model parallelism in train- ing [23, 28, 31, 37, 56]. As described in §3, serving presents a unique set of constraints and opportunities not found in training workloads. Where these systems do intersect with AlpaServe, however, is in their methods for implementing model parallelism along various dimensions. In particular, AlpaServe builds on some of the parallelization techniques introduced in [56]. Resource allocation and multiplexing. The problem of how to multiplex limited resources to the incoming requests is one of the oldest topics in computer science and has been stud- ied in different application domains [3, 29, 38]. Recent work on DL scheduling uses swapping [2], preemption [20], inter- leaving [55], and space-sharing [49] to realize fine-grained resource sharing. Rather, the contribution of this paper is a deep empirical analysis of the applications of these ideas to an emerging space: the serving of multiple large models. Figure 17: Ablation study of placement algorithms. effectiveness of our placement algorithm on a synthetic work- load. We serve the most challenging model set S3 (Tab. 1) on our testbed. The rate distribution of the models follows a power law distribution. The arrival pattern of each model is a Gamma process. Three variants of the placement algo- rithms are evaluated. Round robin means placing models in a round-robin fashion and using 4-stage pipelines for all groups. Greedy placement uses our greedy placement and 4-stage pipeline for all groups. Greedy placement + Group partition- ing performs greedy placement plus group partitioning search. As shown in Fig. 17, both placement and group partitioning are necessary to achieve good SLO attainment. In the left subfigure, the group partitioning increases the rate by 1.5× compared to greedy placement without group partitioning over 99% SLO attainment, while round robin can never reach 99% SLO attainment. In the right subfigure, the group parti- tioning increases the traffic burstiness that can be handled to meet 99% SLO attainment by 1.3×. 7 Related Work 8 Conclusion and Future Work Model serving systems. There has been a proliferation of model serving systems recently. These range from general- purpose production-grade systems like TensorFlow Serv- ing [34] and NVIDIA Triton [33], which are widely used but do not provide any support for automatic placement or latency constraints. They also include systems that are optimized for single-model serving [51] or serving of specific classes of models (e.g., transformers) [16, 51, 57]. AlpaServe targets a broader set of models and features than these systems. For SLO-aware, distributed serving, most serving systems ignore placement-level interactions between models. Clock- work [19], for instance, primarily focuses on predictability; when scheduling, it greedily loads and executes models on available GPUs. Shepherd [52] utilizes preemption to correct sub-optimal scheduling decisions. For large models, loading model weights and preemption can easily overwhelm prac- tical SLOs. Other systems like Clipper [9], Infaas [40], and DVABatch [10] also do not reason about the latencies of co-located models. Nexus [44] is very related to our work in that it exam- ines the placement of models; however, Nexus is an example of a system that takes the traditional replication approach described in §3 and, thus, misses a broad class of potential parallelization strategies that we explore in this paper. In this paper, we presented AlpaServe, a system for prediction servings of multiple large deep-learning models. The key innovation of AlpaServe is integrating model parallelism into multi-model serving. Because of the inherent overheads of model parallelism, such parallelism is traditionally applied conservatively-reserved for cases where models simply do not fit within a single GPU or execute within the required SLO. AlpaServe demonstrates that model parallelism is useful for many other scenarios, quantifies the tradeoffs, and presents techniques to automatically navigate that tradeoff space. In the future, we will extend AlpaServe to more com- plicated scenarios, including serving multiple parameter- efficient adapted models (e.g., LoRA [22]), models with de- pendencies, and autoregressive models [5]. 9 Acknowledgement We thank the OSDI reviewers and our shepherd, Heming Cui, for their valuable feedback. This work is in part supported by NSF CISE Expeditions Award CCF1730628, NSFC under the grant number 62172008, and gifts from Astronomer, Google, IBM, Intel, Lacework, Microsoft, Nexla, Samsung SDS, Uber, and VMware. Yinmin Zhong and Xin Jin are also with the Key Laboratory of High Confidence Software Technologies (Peking University), Ministry of Education. 14 20406080100120Rate (r/s)6065707580859095100Round robinGreedy placementGreedy placement + Group partitioning246CV6065707580859095100Round robinGreedy placementGreedy placement + Group partitioningSLO Attainment (%) References [1] Reza Yazdani Aminabadi, Samyam Rajbhandari, Min- jia Zhang, Ammar Ahmad Awan, Cheng Li, Du Li, El- ton Zheng, Jeff Rasley, Shaden Smith, Olatunji Ruwase, et al. Deepspeed inference: Enabling efficient inference of transformer models at unprecedented scale. arXiv preprint arXiv:2207.00032, 2022. [2] Zhihao Bai, Zhen Zhang, Yibo Zhu, and Xin Jin. {PipeSwitch}: Fast pipelined context switching for deep learning applications. In 14th USENIX Symposium on Operating Systems Design and Implementation (OSDI 20), pages 499–514, 2020. [3] Nirvik Baruah, Peter Kraft, Fiodar Kazhamiaka, Pe- ter Bailis, and Matei Zaharia. Parallelism-optimizing data placement for faster data-parallel computations. Proceedings of the VLDB Endowment, 16(4):760–771, 2022. [4] Anirban Bhattacharjee, Ajay Dev Chhokra, Zhuangwei Kang, Hongyang Sun, Aniruddha Gokhale, and Gabor Karsai. Barista: Efficient and scalable serverless serving system for deep learning prediction services. In 2019 IEEE International Conference on Cloud Engineering (IC2E), pages 23–33. IEEE, 2019. [5] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learn- ers. Advances in neural information processing systems, 33:1877–1901, 2020. [6] Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022. [7] Copy.ai. Copy.ai: Write better marketing copy and con- tent with ai. https://www.copy.ai/. [8] Daniel Crankshaw, Gur-Eyal Sela, Xiangxi Mo, Corey Zumar, Ion Stoica, Joseph Gonzalez, and Alexey Tu- manov. Inferline: latency-aware provisioning and scal- ing for prediction serving pipelines. In Proceedings of the 11th ACM Symposium on Cloud Computing, pages 477–491, 2020. [9] Daniel Crankshaw, Xin Wang, Guilio Zhou, Michael J Franklin, Joseph E Gonzalez, and Ion Stoica. Clipper: A low-latency online prediction serving system. In 14th USENIX Symposium on Networked Systems Design and Implementation (NSDI 17), pages 613–627, 2017. [10] Weihao Cui, Han Zhao, Quan Chen, Hao Wei, Zirui Li, Deze Zeng, Chao Li, and Minyi Guo. Dvabatch: Diversity-aware multi-entry multi-exit batching for ef- In 2022 ficient processing of dnn services on gpus. USENIX Annual Technical Conference (USENIX ATC 22), pages 183–198, 2022. [11] Tri Dao, Daniel Y Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. Flashattention: Fast and memory- efficient exact attention with io-awareness. Advances in Neural Information Processing Systems, 2022. [12] Robert I Davis, Ken W Tindell, and Alan Burns. Scheduling slack time in fixed priority pre-emptive sys- tems. In 1993 Proceedings Real-Time Systems Sympo- sium, pages 222–231. IEEE, 1993. [13] Tim Dettmers, Mike Lewis, Younes Belkada, and Luke Zettlemoyer. Llm. int8 (): 8-bit matrix multiplication for transformers at scale. Advances in Neural Information Processing Systems, 2022. [14] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirec- tional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. [15] Mengnan Du, Subhabrata Mukherjee, Yu Cheng, Milad Shokouhi, Xia Hu, and Ahmed Hassan Awadallah. What do compressed large language models forget? robust- ness challenges in model compression. arXiv preprint arXiv:2110.08419, 2021. [16] Jiarui Fang, Yang Yu, Chengduo Zhao, and Jie Zhou. Turbotransformers: an efficient gpu serving system for transformer models. In Proceedings of the 26th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pages 389–402, 2021. [17] William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. Journal of Machine Learn- ing Research, 23(120):1–39, 2022. [18] Github. Github copilot: Your ai pair programmer. https://github.com/features/copilot. [19] Arpan Gujarati, Reza Karimi, Safya Alzayat, Wei Hao, Antoine Kaufmann, Ymir Vigfusson, and Jonathan Mace. Serving {DNNs} like clockwork: Performance In 14th USENIX predictability from the bottom up. Symposium on Operating Systems Design and Imple- mentation (OSDI 20), pages 443–462, 2020. [20] Mingcong Han, Hanze Zhang, Rong Chen, and Haibo Chen. Microsecond-scale preemption for concurrent In 16th USENIX GPU-accelerated DNN inferences. Symposium on Operating Systems Design and Imple- mentation (OSDI 22), pages 539–558, Carlsbad, CA, July 2022. USENIX Association. 15 [21] Mingcong Han, Hanze Zhang, Rong Chen, and Haibo Chen. Microsecond-scale preemption for concurrent {GPU-accelerated}{DNN} inferences. In 16th USENIX Symposium on Operating Systems Design and Imple- mentation (OSDI 22), pages 539–558, 2022. [22] Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large lan- guage models, 2021. [23] Yanping Huang, Youlong Cheng, Ankur Bapna, Orhan Firat, Dehao Chen, Mia Chen, HyoukJoong Lee, Jiquan Ngiam, Quoc V Le, Yonghui Wu, et al. Gpipe: Effi- cient training of giant neural networks using pipeline parallelism. Advances in neural information processing systems, 32, 2019. [24] Huggingface. Models - huggingface. https:// huggingface.co/models. [25] Vatche Ishakian, Vinod Muthusamy, and Aleksander Slominski. Serving deep learning models in a serverless platform. In 2018 IEEE International Conference on Cloud Engineering (IC2E), pages 257–262. IEEE, 2018. [26] Andrei Ivanov, Nikoli Dryden, Tal Ben-Nun, Shigang Li, and Torsten Hoefler. Data movement is all you need: A case study on optimizing transformers. Proceedings of Machine Learning and Systems, 3:711–732, 2021. [27] Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, De- hao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling gi- ant models with conditional computation and automatic sharding. In International Conference on Learning Rep- resentations, 2020. [28] Zhuohan Li, Siyuan Zhuang, Shiyuan Guo, Danyang Zhuo, Hao Zhang, Dawn Song, and Ion Stoica. Terapipe: Token-level pipeline parallelism for training large-scale language models. In International Conference on Ma- chine Learning, pages 6543–6552. PMLR, 2021. [29] Xiaoqiao Meng, Canturk Isci, Jeffrey Kephart, Li Zhang, Eric Bouillet, and Dimitrios Pendarakis. Efficient re- source provisioning in compute clouds via vm multiplex- ing. In Proceedings of the 7th international conference on Autonomic computing, pages 11–20, 2010. [30] Deepak Narayanan, Aaron Harlap, Amar Phanishayee, Vivek Seshadri, Nikhil R Devanur, Gregory R Ganger, Phillip B Gibbons, and Matei Zaharia. Pipedream: gen- eralized pipeline parallelism for dnn training. In Pro- ceedings of the 27th ACM Symposium on Operating Systems Principles, pages 1–15, 2019. [31] Deepak Narayanan, Mohammad Shoeybi, Jared Casper, Patrick LeGresley, Mostofa Patwary, Vijay Korthikanti, Dmitri Vainbrand, Prethvi Kashinkunti, Julie Bernauer, Bryan Catanzaro, Amar Phanishayee, and Matei Zaharia. Efficient large-scale language model training on gpu clusters using megatron-lm. In Proceedings of the Inter- national Conference for High Performance Computing, Networking, Storage and Analysis, SC '21, New York, NY, USA, 2021. Association for Computing Machinery. [32] NVIDIA. Fastertransformer. https://github.com/ NVIDIA/FasterTransformer. [33] NVIDIA. Triton inference server. https://developer.nvidia.com/ nvidia-triton-inference-server. [34] Christopher Olston, Noah Fiedel, Kiril Gorovoy, Jeremiah Harmsen, Li Lao, Fangwei Li, Vinu Rajashekhar, Sukriti Ramesh, and Jordan Soyke. Tensorflow-serving: Flexible, high-performance ml serving. arXiv preprint arXiv:1712.06139, 2017. [35] OpenAI. Chatgpt. https://chat.openai.com/chat. [36] Reiner Pope, Sholto Douglas, Aakanksha Chowdh- ery, Jacob Devlin, James Bradbury, Anselm Levskaya, Jonathan Heek, Kefan Xiao, Shivani Agrawal, and Jeff Dean. Efficiently scaling transformer inference. arXiv preprint arXiv:2211.05102, 2022. [37] Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, and Yuxiong He. Zero: Memory optimizations toward train- ing trillion parameter models. In SC20: International Conference for High Performance Computing, Network- ing, Storage and Analysis, pages 1–16. IEEE, 2020. [38] KV Rashmi, Mosharaf Chowdhury, Jack Kosaian, Ion Stoica, and Kannan Ramchandran. Ec-cache: Load- balanced, low-latency cluster caching with online era- sure coding. In 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16), pages 401–417, 2016. [39] Stewart Robinson. Simulation: the practice of model development and use. Bloomsbury Publishing, 2014. [40] Francisco Romero, Qian Li, Neeraja J. Yadwadkar, and Christos Kozyrakis. INFaaS: Automated model-less in- ference serving. In 2021 USENIX Annual Technical Con- ference (USENIX ATC 21), pages 397–411. USENIX Association, July 2021. [41] Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: arXiv preprint smaller, faster, cheaper and lighter. arXiv:1910.01108, 2019. 16 [42] Mohammad Shahrad, Rodrigo Fonseca, Íñigo Goiri, Go- har Chaudhry, Paul Batum, Jason Cooke, Eduardo Lau- reano, Colby Tresness, Mark Russinovich, and Ricardo Bianchini. Serverless in the wild: Characterizing and optimizing the serverless workload at a large cloud provider. In 2020 USENIX Annual Technical Conference (USENIX ATC 20), pages 205–218, 2020. [43] Noam Shazeer, Youlong Cheng, Niki Parmar, Dustin Tran, Ashish Vaswani, Penporn Koanantakool, Peter Hawkins, HyoukJoong Lee, Mingsheng Hong, Cliff Young, Ryan Sepassi, and Blake Hechtman. Mesh- TensorFlow: Deep learning for supercomputers. In Neu- ral Information Processing Systems, 2018. [44] Haichen Shen, Lequn Chen, Yuchen Jin, Liangyu Zhao, Bingyu Kong, Matthai Philipose, Arvind Krishnamurthy, and Ravi Sundaram. Nexus: A gpu cluster engine for accelerating dnn-based video analysis. In Proceedings of the 27th ACM Symposium on Operating Systems Prin- ciples, pages 322–337, 2019. [45] Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-lm: Training multi-billion parameter lan- guage models using model parallelism. arXiv preprint arXiv:1909.08053, 2019. [46] John F Shortle, James M Thompson, Donald Gross, and Carl M Harris. Fundamentals of queueing theory, vol- ume 399. John Wiley & Sons, 2018. [47] 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. [48] Qizhen Weng, Wencong Xiao, Yinghao Yu, Wei Wang, Cheng Wang, Jian He, Yong Li, Liping Zhang, Wei Lin, and Yu Ding. Mlaas in the wild: Workload analysis and scheduling in large-scale heterogeneous gpu clusters. In 19th USENIX Symposium on Networked Systems Design and Implementation (NSDI 22), pages 945–960, 2022. [49] Bingyang Wu, Zili Zhang, Zhihao Bai, Xuanzhe Liu, and Xin Jin. Transparent GPU sharing in container clouds for deep learning workloads. In 20th USENIX Symposium on Networked Systems Design and Imple- mentation (NSDI 23), pages 69–85, Boston, MA, April 2023. USENIX Association. [50] Yuanzhong Xu, HyoukJoong Lee, Dehao Chen, Blake Hechtman, Yanping Huang, Rahul Joshi, Maxim Krikun, Dmitry Lepikhin, Andy Ly, Marcello Maggioni, et al. Gspmd: general and scalable parallelization for ml com- arXiv preprint arXiv:2105.04663, putation graphs. 2021. [51] Gyeong-In Yu, Joo Seong Jeong, Geon-Woo Kim, Soo- jeong Kim, and Byung-Gon Chun. Orca: A distributed serving system for transformer-based generative mod- els. In 16th USENIX Symposium on Operating Systems Design and Implementation (OSDI 22), pages 521–538, 2022. [52] Hong Zhang, Yupeng Tang, Anurag Khandelwal, and Ion Stoica. {SHEPHERD}: Serving {DNNs} in the wild. In 20th USENIX Symposium on Networked Sys- tems Design and Implementation (NSDI 23), pages 787– 808, 2023. [53] Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher De- wan, Mona Diab, Xian Li, Xi Victoria Lin, et al. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068, 2022. [54] Yanqi Zhang, Íñigo Goiri, Gohar Irfan Chaudhry, Ro- drigo Fonseca, Sameh Elnikety, Christina Delimitrou, and Ricardo Bianchini. Faster and cheaper serverless computing on harvested resources. In Proceedings of the ACM SIGOPS 28th Symposium on Operating Systems Principles, pages 724–739, 2021. [55] Yihao Zhao, Yuanqiang Liu, Yanghua Peng, Yibo Zhu, Xuanzhe Liu, and Xin Jin. Multi-resource interleaving for deep learning training. In Proceedings of the ACM SIGCOMM 2022 Conference, pages 428–440, 2022. [56] Lianmin Zheng, Zhuohan Li, Hao Zhang, Yonghao Zhuang, Zhifeng Chen, Yanping Huang, Yida Wang, Yuanzhong Xu, Danyang Zhuo, Joseph E Gonzalez, et al. Alpa: Automating inter-and intra-operator parallelism for distributed deep learning. In 16th USENIX Sympo- sium on Operating Systems Design and Implementation (OSDI 22), 2022. [57] Zhe Zhou, Xuechao Wei, Jiejing Zhang, and Guangyu Sun. Pets: A unified framework for parameter-efficient transformers serving. In 2022 USENIX Annual Tech- nical Conference (USENIX ATC 22), pages 489–504, 2022. 17
http://arxiv.org/abs/2302.11640v1
2023-02-22T20:32:59
2023-02-22T20:32:59
A critical look at the evaluation of GNNs under heterophily: are we really making progress?
Node classification is a classical graph representation learning task on which Graph Neural Networks (GNNs) have recently achieved strong results. However, it is often believed that standard GNNs only work well for homophilous graphs, i.e., graphs where edges tend to connect nodes of the same class. Graphs without this property are called heterophilous, and it is typically assumed that specialized methods are required to achieve strong performance on such graphs. In this work, we challenge this assumption. First, we show that the standard datasets used for evaluating heterophily-specific models have serious drawbacks, making results obtained by using them unreliable. The most significant of these drawbacks is the presence of a large number of duplicate nodes in the datsets Squirrel and Chameleon, which leads to train-test data leakage. We show that removing duplicate nodes strongly affects GNN performance on these datasets. Then, we propose a set of heterophilous graphs of varying properties that we believe can serve as a better benchmark for evaluating the performance of GNNs under heterophily. We show that standard GNNs achieve strong results on these heterophilous graphs, almost always outperforming specialized models. Our datasets and the code for reproducing our experiments are available at https://github.com/yandex-research/heterophilous-graphs
[ "Oleg Platonov", "Denis Kuznedelev", "Michael Diskin", "Artem Babenko", "Liudmila Prokhorenkova" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11640v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11640v1", "@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 2 2 ] G L . s c [ 1 v 0 4 6 1 1 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 A CRITICAL LOOK AT THE EVALUATION OF GNNS UNDER HETEROPHILY: ARE WE REALLY MAKING PROGRESS? Oleg Platonov HSE University, Yandex Research [email protected] Denis Kuznedelev Skoltech, Yandex Research [email protected] Michael Diskin HSE University, Deepcake.io [email protected] Artem Babenko Yandex Research [email protected] Liudmila Prokhorenkova Yandex Research [email protected] ABSTRACT Node classification is a classical graph representation learning task on which Graph Neural Networks (GNNs) have recently achieved strong results. However, it is often believed that standard GNNs only work well for homophilous graphs, i.e., graphs where edges tend to connect nodes of the same class. Graphs without this property are called heterophilous, and it is typically assumed that specialized methods are required to achieve strong performance on such graphs. In this work, we challenge this assumption. First, we show that the standard datasets used for evaluating heterophily-specific models have serious drawbacks, making results obtained by using them unreliable. The most significant of these drawbacks is the presence of a large number of duplicate nodes in the datasets squirrel and chameleon, which leads to train-test data leakage. We show that removing duplicate nodes strongly affects GNN performance on these datasets. Then, we propose a set of heterophilous graphs of varying properties that we believe can serve as a better benchmark for evaluating the performance of GNNs under heterophily. We show that standard GNNs achieve strong results on these heterophilous graphs, almost always outperforming specialized models. Our datasets and the code for reproducing our experiments are available at https://github.com/yandex-research/heterophilous-graphs. 1 INTRODUCTION The field of machine learning on graph-structured data has recently attracted a lot of attention, with Graph Neural Networks (GNNs) achieving particularly strong results on most graph tasks. Thus, using GNNs has become a de-facto standard approach to graph machine learning, and many ver- sions of GNNs have been proposed in the literature (Kipf & Welling, 2017; Hamilton et al., 2017; Veliˇckovi ́c et al., 2018; Xu et al., 2019), most of them falling under a general Message Passing Neu- ral Networks (MPNNs) framework (Gilmer et al., 2017). MPNNs learn node representations by an iterative neighborhood-aggregation process, where each layer updates each node's representation by combining previous-layer representations of the node itself and its neighbors. The node feature vector is used as the initial node representation. Thus, MPNNs combine node features with graph topology, allowing them to learn complex dependencies between nodes. In many real-world networks, edges tend to connect similar nodes. This property is called ho- mophily. Typical examples of homophilous networks are social networks, where users tend to con- nect to users with similar interests, and citation networks, where papers mostly cite works from the 1 Published as a conference paper at ICLR 2023 same research area. The opposite of homophily is called heterophily: this property describes the preference of network nodes to connect to nodes not similar to them. For example, in financial transaction networks, fraudsters often perform transactions with non-fraudulent users, and in dating networks, most connections are between people of opposite genders. Early works on GNNs mostly evaluated their models on homophilous graphs. This has led to claims that GNNs implicitly use the homophily of a graph and are thus not suitable for heterophilous datasets (Zhu et al., 2021; 2020; He et al., 2022; Wang et al., 2022). Recently, many works have pro- posed new GNN models specifically designed for heterophilous graphs that are claimed to outper- form standard GNNs. However, these models are typically evaluated on the same six heterophilous graphs first used in the context of learning under heterophily by Pei et al. (2020). In this work, we challenge this evaluation setting. We highlight several downsides of the standard heterophilous datasets, such as low diversity, small size, extreme class imbalance of some datasets, and, most importantly, the presence of a large number of duplicate nodes in squirrel and chameleon datasets. We show that models rely on the train-test data leakage introduced by duplicated nodes to achieve strong results, and removing these nodes significantly affects the performance of the models. Motivated by the shortcomings of the currently used heterophilous benchmarks, we collect a set of diverse heterophilous graphs and propose to use them as a better benchmark. The proposed datasets come from different domains and exhibit a variety of structural properties. We evaluate a wide range of GNNs, both standard and heterophily-specific, on the proposed benchmark, which, to the best of our knowledge, constitutes the most extensive empirical study of heterophily-specific models. In doing so, we uncover that the standard baselines almost always outperform heterophily- specific models. Thus, the progress in learning under heterophily might have been limited to the standard datasets used for evaluation. Our results also show that there is, however, a trick that is useful for learning on heterophilous graphs - separating ego- and neighbor-embeddings, which was proposed in Zhu et al. (2020). This trick consistently improves the baselines (such as GAT and Graph Transformer) and allows one to achieve the best results. We hope that the proposed benchmark will be helpful for further progress in learning under heterophily. 2 RELATED WORK Measuring homophily While much effort has been put into developing graph representa- tion learning methods for heterophilous graphs, there is no universally agreed-upon mea- Homophily measures typically used in the literature are edge ho- sure of homophily. mophily (Abu-El-Haija et al., 2019; Zhu et al., 2020), which is simply the fraction of edges that connect nodes of the same class, and node homophily (Pei et al., 2020), which computes the pro- portion of neighbors that have the same class for each node and then averages these values across all nodes. These two measures are simple and intuitive; however, as shown in Lim et al. (2021); Platonov et al. (2022), they are sensitive to the number of classes and their balance, which makes these measures hard to interpret and incomparable across different datasets. To fix these issues, Lim et al. (2021) propose another homophily measure. However, Platonov et al. (2022) show that it also can provide unreliable results. To solve the issues with existing measures, Platonov et al. (2022) propose to use adjusted homophily, which corrects the number of intra-class edges by their expected value. Thus, adjusted homophily becomes insensitive to the number of classes and their balance. Platonov et al. (2022) show that adjusted homophily satisfies a number of desirable proper- ties, which makes it appropriate for comparing homophily levels between different datasets. Thus, in our work, we will use adjusted homophily for measuring homophily of graphs. The most popular of them are three citation networks: Graph datasets Early works on GNNs mostly evaluated their models on highly homophilous cora, citeseer, graphs. and pubmed (Giles et al., 1998; McCallum et al., 2000; Namata et al., 2012; Sen et al., 2008; Yang et al., 2016). Examples of other graph datasets for node classification that appear in the liter- ature include citation networks coauthor-cs, coauthor-physics and co-purchasing net- works amazon-computers, amazon-photo from Shchur et al. (2018), discussion network reddit from Hamilton et al. (2017). These datasets also have high levels of homophily. Recently, Open Graph Benchmark (Hu et al., 2020) was created to provide challenging large-scale graphs for evaluating GNN performance. The proposed datasets such as ogbn-arxiv, ogbn-products, ogbn-papers100M are also highly homophilous (Zhu et al., 2020; Platonov et al., 2022). 2 Published as a conference paper at ICLR 2023 As for heterophilous graphs, the datasets used in most studies dedicated to learning under het- erophily are limited to the six graphs adopted by Pei et al. (2020): squirrel, chameleon, actor, texas, cornell, and wisconsin. These graphs have become the de-facto standard benchmark for evaluating heterophily-specific models and were used in numerous papers (Zhu et al., 2021; 2020; Chien et al., 2021; Yan et al., 2022; Maurya et al., 2022; Li et al., 2022; He et al., 2022; Wang & Zhang, 2022; Wang et al., 2022; Du et al., 2022; Suresh et al., 2021; Bo et al., 2021; Ma et al., 2022; Luan et al., 2022; Bodnar et al., 2022). We further discuss these datasets in Sec- tion 3. Recently, a set of large-scale heterophilous graph datasets has been proposed in Lim et al. (2021). However, due to their size, these datasets are primarily suitable for evaluating scalable graph methods rather than GNNs, and thus have not seen a wide adoption in the GNN community yet. Specialized methods for learning under heterophily Many methods designed for achieving good results either specifically under heterophily or in both homophily and heterophily settings have been recently proposed. In this paragraph, we briefly describe some of them. Pei et al. (2020) were the first to attract attention to learning under heterophily. Their approach (Geom-GCN) pre- computes unsupervised node embeddings and defines convolution in the latent space of these em- beddings. Zhu et al. (2020) is another pioneering work on heterophily that identifies three designs in existing GNNs that allow the models to generalize to the heterophily setting: ego- and neighbor- embedding separation, aggregation across higher-order neighborhoods, and combining intermediate representations from different layers for the final node representation. Zhu et al. (2021) further pro- posed a new architecture CPGNN that incorporates a learnable class compatibility matrix in the GNN aggregation step that can model different levels of homophily. Chien et al. (2021) developed a Generalized PageRank-inspired architecture (GPR-GNN) with learnable weights designed to adapt to various node label patterns. Yan et al. (2022) related learning under heterophily to the problem of oversmoothing and suggested two modifications to the GCN architecture: degree corrections and signed messages. Maurya et al. (2022) proposed FSGNN which decouples feature aggregation from GNN layers and uses soft feature selection. Li et al. (2022) developed GloGNN and GloGNN++ models that aggregate information from global nodes in the graph. He et al. (2022) proposed block- modeling guided GNN architecture that can learn different aggregation rules for different nodes. Wang & Zhang (2022) introduced JacobiConv - a spectral GNN that is supposed to achieve strong results on both homophilous and heterophilous graphs. Wang et al. (2022) designed a new prop- agation mechanism that can adaptively change propagation and aggregation for different nodes. Du et al. (2022) proposed GBK-GNN that uses bi-kernel feature transformation and a selection gate to capture useful information in both homophily and heterophily settings. Suresh et al. (2021) sug- gested transforming the input graph into a computation graph based on both proximity and structural information. Bo et al. (2021) proposed a self-gating mechanism that allows their model to adaptively integrate both low-frequency and high-frequency signals. Luan et al. (2022) introduced the Adap- tive Channel Mixing (ACM) framework to address those cases of heterophily that are harmful for GNN performance. Bodnar et al. (2022) proposed neural sheaf diffusion models that learn cellular sheaves from data to achieve strong results on heterophilous graphs. Performance of standard GNNs under heterophily While it is widely considered that standard GNNs do not perform well under heterophily (Zhu et al., 2021; 2020; He et al., 2022; Wang et al., 2022), recently, there have been several works that show that standard GNNs can achieve strong results on some heterophilous graphs (Ma et al., 2022; Luan et al., 2022). However, these results were primarily obtained on synthetic or semi-synthetic datasets. Platonov et al. (2022) explain these observations by high label informativeness of the considered graphs: mutual information between neighbors' labels can be high even when these neighbors have different labels. We show that stan- dard GNNs also often achieve strong results and outperform specialized methods on real-world graphs with low label informativeness. 3 ISSUES WITH POPULAR HETEROPHILOUS DATASETS In this section, we revisit datasets commonly used for heterophilous node classification. As dis- cussed in Section 2, the following six datasets are the most popular: Wikipedia networks squirrel and chameleon, actor co-occurrence in Wikipedia pages network (actor), and WebKB datasets texas, wisconsin, and cornell. The standard preprocessing of these datasets is done by Pei et al. (2020). First, we note that these datasets only come from three sources; thus, they 3 Published as a conference paper at ICLR 2023 do not provide sufficient coverage of different heterophilous patterns that can be found in real data, and more diverse datasets are required for a fair evaluation of models under heterophily. However, that is not the only problem with this benchmark. In this section, we show that some of these datasets have certain drawbacks that may highly affect the evaluation results. 3.1 SQUIRREL AND CHAMELEON These datasets are initially collected by Rozemberczki et al. (2021): nodes represent articles from the English Wikipedia (December 2018), and edges reflect mutual links between them. Node fea- tures indicate the presence of particular nouns in the articles. The target variable is the average monthly traffic for the web page, and the task is node regression. Pei et al. (2020) converted the task to node classification by grouping nodes into five categories based on the original regression target, and this preprocessing became standard in the literature. While analyzing these datasets, we noticed many groups of nodes with exactly the same regression target and exactly the same neighborhood. For instance, in squirrel there is a group of 48 nodes that all have the same regression target 370193 and the same 15 neighbors, and in chameleon there is a group of 92 nodes with the same regression target 14480 and the same 18 neighbors. For brevity, we further call such nodes 'duplicates'. We note that while it is expected for some nodes in a natural graph to have the same neighborhood, it is highly unlikely for many nodes to share the same average monthly traffic (which in these datasets is an integer in the range 0-850K). However, not only do some nodes in these datasets simultaneously share the same regression target and neighborhood, but the number of such duplicates is very large. Since duplicates from the same group appear in the train, validation, and test parts of the datasets, they create a train-test data leakage: for duplicates from the test set, their labels can be predicted by simply matching the node's neighborhood to neighborhoods of train nodes. This leakage is present not only for the original node regression task, but also for the node classification task, since labels for the classification task are based on the regression target. We further show that removing this data leakage strongly affects the performance of GNNs. Upon further investigation of these datasets, we found the following: 1) the duplicate nodes may have different features, 2) all the edges of the duplicates are outgoing, 3) for (almost) every such group of duplicates, there is a unique node in the dataset with the same average monthly traffic and the same outgoing edges, but with some additional incoming edges. We hypothesize that this can be the actual version of the web page that should be present in the dataset, while all the other nodes with the same average monthly traffic and the same outgoing edges should be removed. squirrel Table 1: Duplicates in Wikipedia datasets number of nodes number of duplicates number of non-duplicates the number Table 1 shows of nodes in squirrel and chameleon, as well as the number of duplicates and non- duplicates. The duplicates con- stitute more than half of each In the same ta- dataset. ble, we report the accuracy of GraphSAGE (Hamilton et al., 2017) on duplicates and non- duplicates separately. We can see a significant difference in performance on these two types of nodes, confirming that the model implicitly relies on data leakage to make predictions. We additionally note that duplicates are present in all classes and provide the distribution of duplicates across classes in Table 5 in Appendix B. on duplicates on non-duplicates 51.69 ± 01.68 34.67 ± 02.30 74.89 ± 02.05 46.17 ± 03.21 GraphSAGE accuracy 2277 1387 890 5201 2978 2223 chameleon We further filtered these datasets by removing all duplicates, i.e., nodes with no incoming edges and for which there exists a node in the graph with the same average monthly traffic and the same set of outgoing edges. We evaluated several models on the original and filtered datasets; see Table 2 for the results (we refer to Section 5.1 and Appendix A for the description of the models and the evaluation setup). First, we see a significant performance drop for many models, particularly on the chameleon dataset. This performance drop confirms that the models implicitly rely on the leaked data to achieve strong results on unfiltered datasets. Moreover, we see that the exact drop in performance significantly differs between models, and thus the ranking of the models on the filtered datasets is very different from the ranking on the original datasets. This suggests that different 4 Published as a conference paper at ICLR 2023 Table 2: Accuracy of models on original and filtered squirrel and chameleon. The 'ranks' columns report the positions in the ranked list of models on the original and filtered datasets. accuracy on original dataset 33.88 ± 1.79 34.36 ± 1.21 65.46 ± 1.58 squirrel accuracy on filtered dataset 36.55 ± 1.82 38.36 ± 1.97 38.37 ± 1.99 39.06 ± 1.52 35.83 ± 1.32 32.21 ± 1.63 35.72 ± 1.98 31.61 ± 1.10 36.08 ± 1.58 29.45 ± 1.65 30.91 ± 1.98 33.39 ± 2.05 68.93 ± 1.69 61.21 ± 1.96 47.63 ± 1.85 37.06 ± 1.24 46.17 ± 4.34 39.47 ± 1.47 36.09 ± 1.99 35.62 ± 2.06 35.46 ± 3.10 36.30 ± 1.98 36.66 ± 1.63 35.10 ± 1.15 30.04 ± 2.03 38.95 ± 1.99 35.92 ± 1.32 35.11 ± 1.24 41.08 ± 2.27 35.51 ± 1.65 29.71 ± 1.66 accuracy on original dataset 49.52 ± 1.73 49.93 ± 2.27 71.07 ± 2.23 chameleon accuracy on filtered dataset 36.73 ± 4.71 41.01 ± 4.54 38.67 ± 3.87 50.18 ± 3.29 50.18 ± 1.78 45.02 ± 1.75 50.24 ± 2.22 44.93 ± 1.40 50.33 ± 2.57 46.27 ± 2.71 48.77 ± 2.10 47.26 ± 1.74 77.85 ± 0.46 70.04 ± 2.12 64.23 ± 2.04 51.36 ± 1.79 68.33 ± 1.38 40.89 ± 4.12 37.77 ± 4.14 39.21 ± 3.08 39.26 ± 2.50 38.87 ± 3.66 40.31 ± 3.01 26.75 ± 3.64 33.00 ± 3.15 39.93 ± 3.30 40.61 ± 2.97 25.90 ± 3.58 41.90 ± 2.72 39.61 ± 2.60 39.00 ± 4.20 ranks 12 / 7 11 / 5 2 / 4 6 / 2 9 / 9 14 / 11 10 / 13 15 / 8 8 / 6 17 / 15 16 / 16 13 / 3 1 / 10 3 / 14 4 / 1 7 / 12 5 / 17 ranks 12 / 14 11 / 2 2 / 12 10 / 3 9 / 13 16 / 9 8 / 8 17 / 11 7 / 5 15 / 16 13 / 15 14 / 6 1 / 4 3 / 17 5 / 1 6 / 7 4 / 10 ResNet ResNet+SGC ResNet+adj GCN SAGE GAT GAT-sep GT GT-sep H2GCN CPGNN GPR-GNN FSGNN GloGNN FAGCN GBK-GNN JacobiConv models have different capacity to utilize the data leakage. To better illustrate the difference in rankings, we report model ranks on both original and filtered datasets in Table 2. Some models have particularly strong performance changes. For example, FSGNN is the best model on both original datasets, however, on filtered squirrel and chameleon it achieves only 10th and 4th places, respectively. Such a substantial shake-up raises concerns about the validity of conclusions made in previous works that rely on analyzing the performance of different models on these datasets. 3.2 CORNELL, TEXAS, WISCONSIN Cornell, texas, and wisconsin were introduced by Pei et al. (2020). These are three sub- datasets of the WebKB1 webpage dataset collected from computer science departments of various universities. In these datasets, nodes are web pages, and edges are hyperlinks between them. Node features are the bag-of-words representation of the web pages. The target is the web page category: 'student', 'project', 'course', 'staff', or 'faculty'. We first note that these datasets are very small (183-251 nodes and 295-499 edges), which can lead to unstable and statistically insignificant results. Indeed, from the results of various models reported in previous works, it can be seen that the standard deviation on these datasets is very high. Moreover, these datasets have very imbalanced classes, to the point that the texas dataset has a class that consists of only one node, which makes using this class for training and evaluation meaningless. We report the number of nodes in different classes of these datasets in Table 6 in Appendix B. We note that all the previous works that use these datasets report accuracy on them, however, this metric is not designed for measuring performance under strong class imbalance and can provide misleading results in this setting. 4 NEW HETEROPHILOUS DATASETS Motivated by the observations described in the previous section, we collected several new datasets for evaluating GNNs under heterophily. We aim to obtain a set of datasets satisfying the following conditions: • Datasets should be heterophilous. We evaluate this using the adjusted homophily measure; see the formal definition below. 1http://www.cs.cmu.edu/afs/cs.cmu.edu/project/theo-11/www/wwkb 5 Published as a conference paper at ICLR 2023 • Graph structure should be helpful for the task. To verify this, we compare the performance of graph-agnostic ResNet with GNN methods. We expect GNNs to have a noticeable gain in performance. • Datasets should be diverse, i.e., come from various domains and have different structural properties. Thus, for each dataset, we report several characteristics that we describe below. • The size of the graphs should be large enough to provide statistically significant results, but small enough to allow for evaluating most of the heterophily-specific models proposed in the literature, which are often non-scalable. Thus, we only collect graphs that have 10K-50K nodes. For each of the proposed datasets, we report its basic characteristics, such as the number of nodes, edges, features, and classes, as well as various graph statistics, which we now define. First, we measure homophily. As discussed above, we focus on adjusted homophily, but we also report edge homophily to be comparable with previous studies reporting this measure. However, we emphasize that edge homophily does not produce meaningful results for datasets with unbalanced classes which are present in our benchmark. Formally, edge homophily is hedge = |(u, v) ∈ E : yu = yv}| |E| , where yu is the label of a node u and E is the set of edges. Adjusted homophily is based on the edge homophily and can be computed as follows: hadj = hedge − PC 1 − PC k=1 D2 k/(2|E|)2 k=1 D2 k/(2|E|)2 , where Dk := Pv : yv=k d(v) and d(v) denotes the degree of a node v. In Platonov et al. (2022) it was shown that adjusted homophily satisfies a number of desirable properties, which makes it appropriate for comparing datasets with different number of classes and class size balance. We also report label informativeness (LI) introduced in Platonov et al. (2022) and shown to better agree with GNN performance than homophily. Label informativeness quantifies how much infor- mation a neighbor's label gives about the node's label. To formally define this measure, we let (ξ, η) ∈ E be an edge sampled uniformly at random among all edges and define LI := I(yξ, yη)/H(yξ) . Here yξ and yη are (random) labels of ξ and η, H(yξ) is the entropy of yξ and I(yξ, yη) is the mutual information of ξ and η. We also report several standard graph characteristics, such as diameter and clustering coefficient. In the literature, there are two popular definitions of the clustering coefficient (Boccaletti et al., 2014). The global clustering coefficient is the ratio between the number of triangles and the number of pairs of adjusted edges. To get the average local clustering coefficient, we first compute the clustering for each node and then average the obtained values across all nodes. Table 3 provides statistics of the five new datasets we propose for evaluating GNN performance under heterophily. One can see that these datasets have diverse properties. Tolokers is the densest graph with an average node degree above 88, while the rest of the graphs are sparse, roman-empire being the sparsest one. Questions has very low values of clustering coeffi- cients compared to other graphs, which shows that it has a small proportion of closed node triplets. Roman-empire is the only graph in our benchmark with a value of label informativeness signifi- cantly larger than zero. Below we will describe each of the new datasets in more detail. Roman-empire This dataset is based on the Roman Empire article from English Wikipedia, which was selected since it is one of the longest articles on Wikipedia. The text was retrieved from the English Wikipedia 2022.03.01 dump from Lhoest et al. (2021). Each node in the graph corresponds to one (non-unique) word in the text. Thus, the number of nodes in the graph is equal to the article's length. Two words are connected with an edge if at least one of the following two conditions holds: either these words follow each other in the text, or these words are connected in the dependency tree of the sentence (one word depends on the other). Thus, the graph is a chain graph with additional 6 Published as a conference paper at ICLR 2023 Table 3: Statistics of the new heterophilous datasets roman-empire amazon-ratings minesweeper tolokers questions nodes edges avg degree global clustering avg local clustering diameter node features classes edge homophily adjusted homophily LI 22662 32927 2.91 0.29 0.39 6824 300 18 0.05 -0.05 0.11 24492 93050 7.60 0.32 0.58 46 300 5 0.38 0.14 0.04 10000 39402 7.88 0.43 0.44 99 7 2 0.68 0.01 0.00 11758 519000 88.28 0.23 0.53 11 10 2 0.59 0.09 0.01 48921 153540 6.28 0.02 0.03 16 301 2 0.84 0.02 0.00 shortcut edges corresponding to syntactic dependencies between words. The class of a node is its syntactic role (we select the 17 most frequent roles as unique classes and group all the other roles into the 18th class). The syntactic roles were obtained using spaCy (Honnibal et al., 2020). For node features, we use FastText word embeddings (Grave et al., 2018). While this task can probably be better solved with models from the field of NLP, we adapt it to evaluate GNNs in the setting of low homophily, sparse connectivity, and potential long-range dependencies. This graph has 22.7K nodes and 32.9K edges. By construction, the structure of this graph is chain- like; thus, it has the smallest average degree (2.9) and the largest diameter (6824). This graph is heterophilous, hadj = −0.05. Interestingly, this dataset has a larger value of label informativeness compared to all the other heterophilous datasets analyzed by Platonov et al. (2022). This means that there are non-trivial label connectivity patterns specific to this dataset. Amazon-ratings This dataset is based on the Amazon product co-purchasing network metadata dataset2 from SNAP Datasets (Leskovec & Krevl, 2014). Nodes are products (books, music CDs, DVDs, VHS video tapes), and edges connect products that are frequently bought together. The task is to predict the average rating given to a product by reviewers. We grouped possible rating values into five classes. For node features, we use the mean of FastText embeddings (Grave et al., 2018) for words in the product description. To reduce the size of the graph, we only consider the largest connected component of the 5-core of the graph. Minesweeper This dataset is inspired by the Minesweeper game, and it is the only synthetic dataset in our benchmark. The graph is a regular 100x100 grid where each node (cell) is con- nected to eight neighboring nodes (with the exception of nodes at the edge of the grid, which have fewer neighbors). 20% of the nodes are randomly selected as mines. The task is to predict which nodes are mines. The node features are one-hot-encoded numbers of neighboring mines. However, for randomly selected 50% of the nodes, the features are unknown, which is indicated by a separate binary feature. The structure of this graph is significantly different from the other datasets due to its regularity. The average degree is 7.88 since almost all the nodes have exactly eight neighbors. Since mines are placed randomly, both adjusted homophily and label informativeness are close to zero. Tolokers This dataset is based on data from the Toloka crowdsourcing platform (Likhobaba et al., 2023). The nodes represent tolokers (workers) that have participated in at least one of 13 selected projects. An edge connects two tolokers if they have worked on the same task. The goal is to predict which tolokers have been banned in one of the projects. Node features are based on the worker's profile information and task performance statistics. This graph has 11.8K nodes, with the average degree of 88.28. Thus, the graph is significantly denser than all the other graphs. About 22% of the tolokers in this dataset have been banned. 2https://snap.stanford.edu/data/amazon-meta.html 7 Published as a conference paper at ICLR 2023 Questions This dataset is based on data from the question-answering website Yandex Q. Nodes are users, and an edge connects two nodes if one user answered the other user's question during a one-year time interval (from September 2021 to August 2022). To restrict the size of the dataset, we consider only users interested in the topic 'medicine'. The task is to predict which users remained active on the website (were not deleted or blocked) at the end of the period. For node features, we use the mean of FastText embeddings (Grave et al., 2018) for words in the user description. Since some users (15%) do not have descriptions, we use an additional binary feature that indicates such users. The obtained dataset has 48.9K nodes, and the average degree is 6.28. We note that the classification task is highly unbalanced: 97% of the users are in the active class. This causes high edge homophily, but the adjusted homophily indicates that the graph is heterophilous: hadj = 0.02. This dataset has the smallest clustering coefficients among the proposed ones, which means it has a small fraction of closed node triplets. 5 BENCHMARKING EXISTING ALGORITHMS 5.1 SETUP Baselines We choose several representative neural architectures as our baselines. First, we use a ResNet-like model (He et al., 2016) as a graph-agnostic baseline. This model treats all nodes as independent samples and does not have access to the graph topology. Thus, if graph topology provides useful information for the task, we expect other models to outperform ResNet. Further, we use two simple node feature augmentation strategies to provide ResNet with some information about the graph structure. One strategy is multiplying the initial node feature matrix with a power of normalized graph adjacency matrix, which smooths node features along graph edges. This ap- proach was proposed in Wu et al. (2019) (their proposed model SGC is a linear classifier on top of the preprocessed features, while we use a ResNet-like model instead of the linear classifier). We name this model ResNet+SGC. Another strategy is augmenting node features with the rows of the adjacency matrix, thus directly providing information about the graph connectivity. This approach is inspired by LINK (Zheleva & Getoor, 2009) - a linear model using the adjacency matrix rows as features - and is very similar to the recently proposed LINKX model (Lim et al., 2021), which also combines node features and adjacency matrix rows, but uses a custom model. We name this version of the model ResNet+adj. Further, we use 2 classic GNN architectures: GCN (Kipf & Welling, 2017) and Graph- SAGE (Hamilton et al., 2017). For GraphSAGE, we use the version with the mean aggregation function and do not use the node sampling technique used in the original paper. As a more advanced GNN architecture, we take GAT (Veliˇckovi ́c et al., 2018), which uses attention- based aggregation. However, GAT uses a very simple attention mechanism and, as a result, can only compute a limited kind of attention - for instance, the ranking of the attention scores does not depend on the query node (Brody et al., 2022). To overcome this limitation, we also use a model with a more powerful attention mechanism - Graph Transformer (GT) (Shi et al., 2020), which is an adaptation of the popular Transformer architecture (Vaswani et al., 2017) to graphs. Note that in this version of GT, each node can only attend to its neighbors. Zhu et al. (2020) shows that separating ego- and neighbor-embeddings in the GNN aggregation step (as done in GraphSAGE, where the node's embedding is concatenated to the mean of its neighbors' embeddings instead of being summed with them) is beneficial when learning under heterophily. Thus, we add this simple architectural modification to GAT and GT models, which originally do not separate ego- and neighbor embeddings. We name these model modifications GAT-sep and GT-sep. We augment all our baseline models with skip connections (He et al., 2016) and layer normalization (Ba et al., 2016), which are standard neural architecture elements in modern deep learning. We found these techniques to be important for the strong performance of our baselines. Heterophily-specific models We use eight models designed for node classification under het- erophily: H2GCN (Zhu et al., 2020), CPGNN (Zhu et al., 2021), GPR-GNN (Chien et al., 2021), FSGNN (Maurya et al., 2022), GloGNN (Li et al., 2022), FAGCN (Bo et al., 2021), GBK- 8 Published as a conference paper at ICLR 2023 Table 4: The performance of models on the proposed datasets. Accuracy is reported for roman-empire and amazon-ratings, and ROC AUC is reported for minesweeper, tolokers, and questions. roman-empire amazon-ratings minesweeper tolokers questions ResNet ResNet+SGC ResNet+adj GCN SAGE GAT GAT-sep GT GT-sep H2GCN CPGNN GPR-GNN FSGNN GloGNN FAGCN GBK-GNN JacobiConv 65.88 ± 0.38 73.90 ± 0.51 52.25 ± 0.40 73.69 ± 0.74 85.74 ± 0.67 80.87 ± 0.30 88.75 ± 0.41 86.51 ± 0.73 87.32 ± 0.39 60.11 ± 0.52 63.96 ± 0.62 64.85 ± 0.27 79.92 ± 0.56 59.63 ± 0.69 65.22 ± 0.56 74.57 ± 0.47 71.14 ± 0.42 45.90 ± 0.52 50.66 ± 0.48 51.83 ± 0.57 48.70 ± 0.63 53.63 ± 0.39 49.09 ± 0.63 52.70 ± 0.62 51.17 ± 0.66 52.18 ± 0.80 36.47 ± 0.23 39.79 ± 0.77 44.88 ± 0.34 52.74 ± 0.83 36.89 ± 0.14 44.12 ± 0.30 45.98 ± 0.71 43.55 ± 0.48 50.89 ± 1.39 70.88 ± 0.90 50.42 ± 0.83 89.75 ± 0.52 93.51 ± 0.57 92.01 ± 0.68 93.91 ± 0.35 91.85 ± 0.76 92.29 ± 0.47 89.71 ± 0.31 52.03 ± 5.46 86.24 ± 0.61 90.08 ± 0.70 51.08 ± 1.23 88.17 ± 0.73 90.85 ± 0.58 89.66 ± 0.40 72.95 ± 1.06 80.70 ± 0.97 78.78 ± 1.11 83.64 ± 0.67 82.43 ± 0.44 83.70 ± 0.47 83.78 ± 0.43 83.23 ± 0.64 82.52 ± 0.92 73.35 ± 1.01 73.36 ± 1.01 72.94 ± 0.97 82.76 ± 0.61 73.39 ± 1.17 77.75 ± 1.05 81.01 ± 0.67 68.66 ± 0.65 70.34 ± 0.76 75.81 ± 0.96 75.77 ± 1.24 76.09 ± 1.27 76.44 ± 0.62 77.43 ± 1.20 76.79 ± 0.71 77.95 ± 0.68 78.05 ± 0.93 63.59 ± 1.46 65.96 ± 1.95 55.48 ± 0.91 78.86 ± 0.92 65.74 ± 1.19 77.24 ± 1.26 74.47 ± 0.86 73.88 ± 1.16 GNN (Du et al., 2022), and JacobiConv (Wang & Zhang, 2022). To the best of our knowledge, this is the most extensive comparison of heterophily-specific models in the literature. We provide details about our training setup and hyperparameter selection in Appendix A. 5.2 RESULTS Table 4 shows the performance of different models on our datasets. We can see that the best results are almost always achieved by baselines rather than heterophily-specific models. Among 15 of the top-3 performances on our 5 datasets, 13 belong to standard GNNs. Occasionally, some heterophily- specific models perform even worse than the graph-agnostic ResNet baseline. These results show that the progress in learning under heterophily made in recent years was limited to the particular datasets used for evaluation, while we observe that standard GNNs generally outperform specialized models. The only specialized model that consistently achieves strong performance and occasionally reaches top-3 best results is FSGNN, a simple model often overlooked in the literature. As for standard GNNs, we notice that the best results are almost always achieved by models that separate ego- and neighbor-embeddings (GraphSAGE, GAT-sep, GT-sep). GAT-sep and GT-sep typ- ically outperform their versions without embedding separation, which shows that this trick proposed in Zhu et al. (2020) is indeed helpful for learning under heterophily. 6 CONCLUSION In this paper, we uncover significant problems with the datasets typically used to evaluate the perfor- mance of GNNs under heterophily. The most sifnificant of these problems is the presence of a large number of duplicate nodes in squirrel and chameleon datasets, which leads to a train-test data leakage. We show that the removal of these duplicates drastically changes the relative performance of different models. Motivated by this issue, we propose several new heterophilous datasets of different nature and with diverse structural properties that can form a better benchmark. We evaluate a variety of standard GNNs and heterophily-specific models on these datasets and show that standard GNNs generally outperform specialized models. We hope that the proposed benchmark will be useful for further progress in learning under heterophily. 9 Published as a conference paper at ICLR 2023 ACKNOWLEDGMENTS We thank Daniil Likhobaba, Nikita Pavlichenko, and Dmitry Ustalov for providing the tolokers dataset. We also thank Alexandr Andreev and Irina Lialikova for collecting the Yandex Q data for the questions dataset. The publication was partly supported by the grant for research centers in the field of AI provided by the Analytical Center for the Government of the Russian Federation (ACRF) in accordance with the agreement on the provision of subsidies (identifier of the agreement 000000D730321P5Q0002) and the agreement with HSE University No. 70-2021-00139. REFERENCES Sami Abu-El-Haija, Bryan Perozzi, Amol Kapoor, Nazanin Alipourfard, Kristina Lerman, Hrayr Harutyunyan, Greg Ver Steeg, and Aram Galstyan. Mixhop: Higher-order graph convolutional architectures via sparsified neighborhood mixing. In International Conference on Machine Learn- ing, pp. 21–29. PMLR, 2019. Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. Deyu Bo, Xiao Wang, Chuan Shi, and Huawei Shen. Beyond low-frequency information in graph convolutional networks. In Proceedings of the AAAI Conference on Artificial Intelligence, vol- ume 35, pp. 3950–3957, 2021. Stefano Boccaletti, Ginestra Bianconi, Regino Criado, Charo I Del Genio, Jes ́us G ́omez-Gardenes, Miguel Romance, Irene Sendina-Nadal, Zhen Wang, and Massimiliano Zanin. The structure and dynamics of multilayer networks. Physics reports, 544(1):1–122, 2014. Cristian Bodnar, Francesco Di Giovanni, Benjamin Paul Chamberlain, Pietro Lio, and Michael M Bronstein. Neural sheaf diffusion: A topological perspective on heterophily and oversmoothing in gnns. In ICLR 2022 Workshop on Geometrical and Topological Representation Learning, 2022. Shaked Brody, Uri Alon, and Eran Yahav. How attentive are graph attention networks? In Interna- tional Conference on Learning Representations, 2022. Eli Chien, Jianhao Peng, Pan Li, and Olgica Milenkovic. Adaptive universal generalized PageRank graph neural network. International Conference on Learning Representations, 2021. Lun Du, Xiaozhou Shi, Qiang Fu, Xiaojun Ma, Hengyu Liu, Shi Han, and Dongmei Zhang. Gbk- gnn: Gated bi-kernel graph neural networks for modeling both homophily and heterophily. In Proceedings of the ACM Web Conference 2022, pp. 1550–1558, 2022. C Lee Giles, Kurt D Bollacker, and Steve Lawrence. Citeseer: An automatic citation indexing system. In Proceedings of the third ACM Conference on Digital Libraries, pp. 89–98, 1998. Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning, pp. 1263–1272. PMLR, 2017. Edouard Grave, Piotr Bojanowski, Prakhar Gupta, Armand Joulin, and Tomas Mikolov. Learning word vectors for 157 languages. In Proceedings of the International Conference on Language Resources and Evaluation, 2018. William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 1025–1035, 2017. Dongxiao He, Chundong Liang, Huixin Liu, Mingxiang Wen, Pengfei Jiao, and Zhiyong Feng. Block modeling-guided graph convolutional neural networks. In Proceedings of the AAAI Con- ference on Artificial Intelligence, volume 36, pp. 4022–4029, 2022. 10 Published as a conference paper at ICLR 2023 Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recog- nition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778, 2016. Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (GELUs). arXiv preprint arXiv:1606.08415, 2016. Matthew Honnibal, Ines Montani, Sofie Van Landeghem, and Adriane Boyd. spaCy: Industrial- strength natural language processing in python. 2020. Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. Advances in Neural Information Processing Systems, 33:22118–22133, 2020. Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations, 2015. Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional net- works. In International Conference on Learning Representations, 2017. Jure Leskovec and Andrej Krevl. SNAP Datasets: Stanford large network dataset collection. http://snap.stanford.edu/data, 2014. Quentin Lhoest, Albert Villanova del Moral, Yacine Jernite, Abhishek Thakur, Patrick von Platen, Suraj Patil, Julien Chaumond, Mariama Drame, Julien Plu, Lewis Tunstall, et al. Datasets: A community library for natural language processing. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 175–184, 2021. Xiang Li, Renyu Zhu, Yao Cheng, Caihua Shan, Siqiang Luo, Dongsheng Li, and Weining Qian. Finding global homophily in graph neural networks when meeting heterophily. In International Conference on Machine Learning, pp. 13242–13256. PMLR, 2022. Daniil Likhobaba, Nikita Pavlichenko, and Dmitry Ustalov. doi: teraction of Crowd Annotators. https://github.com/Toloka/TolokerGraph. 2023. Toloker Graph: 10.5281/zenodo.7620795. In- URL Derek Lim, Felix Hohne, Xiuyu Li, Sijia Linda Huang, Vaishnavi Gupta, Omkar Bhalerao, and Ser Nam Lim. Large scale learning on non-homophilous graphs: New benchmarks and strong simple methods. Advances in Neural Information Processing Systems, 34, 2021. Sitao Luan, Chenqing Hua, Qincheng Lu, Jiaqi Zhu, Mingde Zhao, Shuyuan Zhang, Xiao-Wen In Advances in Chang, and Doina Precup. Revisiting heterophily for graph neural networks. Neural Information Processing Systems, 2022. Yao Ma, Xiaorui Liu, Neil Shah, and Jiliang Tang. Is homophily a necessity for graph neural networks? In International Conference on Learning Representations, 2022. Sunil Kumar Maurya, Xin Liu, and Tsuyoshi Murata. Simplifying approach to node classification in graph neural networks. Journal of Computational Science, pp. 101695, 2022. Andrew Kachites McCallum, Kamal Nigam, Jason Rennie, and Kristie Seymore. Automating the Information Retrieval, 3(2):127–163, construction of internet portals with machine learning. 2000. Galileo Namata, Ben London, Lise Getoor, and Bert Huang. Query-driven active surveying for collective classification. In 10th International Workshop on Mining and Learning with Graphs, volume 8, pp. 1, 2012. Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. Advances in Neural Information Processing Systems, 32, 2019. 11 Published as a conference paper at ICLR 2023 Hongbin Pei, Bingzhe Wei, Kevin Chen-Chuan Chang, Yu Lei, and Bo Yang. Geom-GCN: Geo- metric graph convolutional networks. In International Conference on Learning Representations, 2020. Oleg Platonov, Denis Kuznedelev, Artem Babenko, and Liudmila Prokhorenkova. Characterizing graph datasets for node classification: Homophily–heterophily dichotomy and beyond. arXiv preprint arXiv:2209.06177, 2022. Benedek Rozemberczki, Carl Allen, and Rik Sarkar. Multi-scale attributed node embedding. Journal of Complex Networks, 9(2), 2021. Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3):93–93, 2008. Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan G ̈unnemann. Pitfalls of graph neural network evaluation. Relational Representation Learning Workshop, 2018. Yunsheng Shi, Zhengjie Huang, Shikun Feng, Hui Zhong, Wenjin Wang, and Yu Sun. Masked label prediction: Unified message passing model for semi-supervised classification. arXiv preprint arXiv:2009.03509, 2020. Susheel Suresh, Vinith Budde, Jennifer Neville, Pan Li, and Jianzhu Ma. Breaking the limit of graph neural networks by improving the assortativity of graphs with local mixing patterns. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, 2021. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, In Advances in Neural Infor- Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. mation Processing Systems, pp. 5998–6008, 2017. Petar Veliˇckovi ́c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li`o, and Yoshua International Conference on Learning Representations, Bengio. Graph Attention Networks. 2018. Minjie Wang, Da Zheng, Zihao Ye, Quan Gan, Mufei Li, Xiang Song, Jinjing Zhou, Chao Ma, Lingfan Yu, Yu Gai, et al. Deep graph library: A graph-centric, highly-performant package for graph neural networks. arXiv preprint arXiv:1909.01315, 2019. Tao Wang, Di Jin, Rui Wang, Dongxiao He, and Yuxiao Huang. Powerful graph convolutional networks with adaptive propagation mechanism for homophily and heterophily. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 4210–4218, 2022. Xiyuan Wang and Muhan Zhang. How powerful are spectral graph neural networks. In International Conference on Machine Learning, pp. 23341–23362. PMLR, 2022. Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. Sim- plifying graph convolutional networks. In International Conference on Machine Learning, pp. 6861–6871. PMLR, 2019. Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019. Yujun Yan, Milad Hashemi, Kevin Swersky, Yaoqing Yang, and Danai Koutra. Two sides of the In 2022 same coin: Heterophily and oversmoothing in graph convolutional neural networks. IEEE International Conference on Data Mining (ICDM), pp. 1287–1292. IEEE, 2022. Zhilin Yang, William Cohen, and Ruslan Salakhudinov. Revisiting semi-supervised learning with graph embeddings. In International Conference on Machine Learning, pp. 40–48. PMLR, 2016. Elena Zheleva and Lise Getoor. To join or not to join: the illusion of privacy in social networks with mixed public and private user profiles. In Proceedings of the 18th International Conference on World Wide Web, pp. 531–540, 2009. 12 Published as a conference paper at ICLR 2023 Jiong Zhu, Yujun Yan, Lingxiao Zhao, Mark Heimann, Leman Akoglu, and Danai Koutra. Beyond homophily in graph neural networks: Current limitations and effective designs. Advances in Neural Information Processing Systems, 33:7793–7804, 2020. Jiong Zhu, Ryan A Rossi, Anup Rao, Tung Mai, Nedim Lipka, Nesreen K Ahmed, and Danai In Proceedings of the AAAI Conference on Koutra. Graph neural networks with heterophily. Artificial Intelligence, volume 35, pp. 11168–11176, 2021. 13 Published as a conference paper at ICLR 2023 Table 5: Distribution of duplicates across classes in Wikipedia datasets class 1 class 2 class 3 class 4 class 5 number of nodes number of duplicates number of non-duplicates 1042 286 756 number of nodes number of duplicates number of non-duplicates 456 214 242 squirrel 1039 642 397 chameleon 453 244 209 1040 719 321 521 357 164 1040 524 516 460 326 134 1040 807 233 387 246 141 A TRAINING DETAILS AND HYPERPARAMETERS SELECTION In this section, we describe the details of our training setup for experiments in Section 3.1 and Sec- tion 5. For squirrel and chameleon, we use the 10 existing standard train/validation/test splits. For filtered versions of these datasets, we use the same splits with duplicates removed. For each of our new proposed datasets, we fix 10 random 50%/25%/25% train/validation/test splits. We train each model on each split once, reporting mean performance and standard deviation. For multiclass classification datasets (roman-empire, amazon-ratings) we report accuracy, and for binary classification datasets (minesweeper, tolokers, questions) we report ROC AUC. The squirrel and chameleon datasets are directed. Most codebases implementing heterophily- specific models do not convert these graphs to undirected; therefore, we also treat them as directed. In contrast, all the graphs in our proposed benchmark are undirected. We found that our baseline models are quite robust to hyperparameter values, so the only hyperpa- rameter that we tune for them is the number of layers. We choose it from the set {1, 2, 3, 4, 5} based on the validation performance. For all the other hyperparameters, we use the same values across all baseline models and datasets. Namely, we use the following hyperparameter values: the hidden dimension is 512, and the dropout probability is 0.2. For GAT and Graph Transformer models, the number of attention heads is set to 8. We use GELU activation functions (Hendrycks & Gimpel, 2016) in all our baseline models. We use the Adam optimizer (Kingma & Ba, 2015) with learning rate of 3 * 10−5. We train each model for 1000 steps and select the best step based on the perfor- mance on the validation set. Our baselines are implemented using PyTorch (Paszke et al., 2019) and DGL (Wang et al., 2019). For heterophily-specific models, we use the official code provided by the authors of these models. Unlike the baselines, heterophily-specific models turned out to be quite sensitive to the particular choice of hyperparameters. Namely, the choice of learning rate and weight decay may significantly impact the model performance. For different models, the range of optimal hyperparameter values may differ drastically. Therefore, for each model, we have searched over a specific hyperparameter grid. Many models under consideration have their specific hyperparameters. We have fixed them to the values set for the squirrel dataset in all cases except for the GloGNN model (Li et al., 2022), which turned out to be very sensitive to its specific hyperparameters. Models are trained for the same number of steps as in the original papers, and we use early stopping on the validation set with the patience of 100 steps to prevent overfitting. For each model, we swept over 4-5 values of learning rate and weight decay and selected the one with the best validation performance. B ADDITIONAL DATASET STATISTICS In Table 5, we show the distribution of duplicates across classes in the squirrel and chameleon datasets. We can see that there is a large number of duplicates in all classes, however, their distribu- tion is not even. In Table 6, we report the distribution of nodes across classes in the texas, cornell, and wisconsin datasets. 14 Published as a conference paper at ICLR 2023 Table 6: Number of nodes in different classes of texas, cornell, and wisconsin class 1 class 2 class 3 class 4 class 5 texas cornell wisconsin 33 38 10 1 16 70 18 30 118 101 82 32 30 17 21 C COMPARISON TO THE BENCHMARK PROPOSED IN LIM ET AL. (2021) Recently, a benchmark of large-scale heterophilous graph datasets has been proposed by Lim et al. (2021). This section describes how this benchmark differs from our proposed datasets. The first difference is the size of the graphs. Lim et al. (2021) specifically collect large datasets to evaluate the performance of scalable graph methods under heterophily. However, this prevents them from comparing to many GNNs designed for heterophilous graphs since such GNNs are often compute and memory intensive and thus cannot scale to the size of the graphs proposed by Lim et al. (2021). In contrast, for our benchmark, we purposefully collect graphs with less than 50K nodes, allowing us to compare many models for learning under heterophily proposed in the literature. Another difference is in the domains from which the datasets come. Graphs are a natural way to represent data from different fields; thus, a comprehensive graph benchmark should cover a wide variety of domains. Lim et al. (2021) use social networks (penn94, pokec, genius, twitch-gamers), citation networks (arxiv-year, snap-patents), and a web graph (wiki). Our graphs come from other diverse domains and thus naturally comple- ment the benchmark of Lim et al. (2021). Namely, our datasets are a word dependency graph (roman-empire), a product co-purchasing network (amazon-ratings), a synthetic graph emulating the minesweeper game (minesweeper), a crowdsourcing platform worker network (tolokers), and a question-answering website interaction network (questions). D TWO VERSIONS OF SQUIRREL AND CHAMELEON There exist two versions of squirrel and chameleon datasets. One is available on the website of the authors of Rozemberczki et al. (2021),3 while the other is available on SNAP Datasets.4 These datasets differ in their edge sets. Pei et al. (2020) adopted the version from SNAP Datasets for their experiments, and thus this version became standard in the literature. In our work, we also use this version, and our observations regarding edges of duplicate nodes only apply to this version. How- ever, regression targets in both versions of the datasets are the same (up to a logarithmic transform). Thus, duplicated targets are present in both versions of the datasets. 3https://graphmining.ai/datasets/ptg/wiki/ 4http://snap.stanford.edu/data/wikipedia-article-networks.html 15
http://arxiv.org/abs/2302.11636v1
2023-02-22T20:24:35
2023-02-22T20:24:35
Do We Really Need Complicated Model Architectures For Temporal Networks?
Recurrent neural network (RNN) and self-attention mechanism (SAM) are the de facto methods to extract spatial-temporal information for temporal graph learning. Interestingly, we found that although both RNN and SAM could lead to a good performance, in practice neither of them is always necessary. In this paper, we propose GraphMixer, a conceptually and technically simple architecture that consists of three components: (1) a link-encoder that is only based on multi-layer perceptrons (MLP) to summarize the information from temporal links, (2) a node-encoder that is only based on neighbor mean-pooling to summarize node information, and (3) an MLP-based link classifier that performs link prediction based on the outputs of the encoders. Despite its simplicity, GraphMixer attains an outstanding performance on temporal link prediction benchmarks with faster convergence and better generalization performance. These results motivate us to rethink the importance of simpler model architecture.
[ "Weilin Cong", "Si Zhang", "Jian Kang", "Baichuan Yuan", "Hao Wu", "Xin Zhou", "Hanghang Tong", "Mehrdad Mahdavi" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11636v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11636v1", "@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 2 2 ] G L . s c [ 1 v 6 3 6 1 1 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 DO WE REALLY NEED COMPLICATED MODEL ARCHI- TECTURES FOR TEMPORAL NETWORKS? Weilin Cong Penn State [email protected] Si Zhang Meta [email protected] Jian Kang University of Illinois at Urbana-Champaign [email protected] Baichuan Yuan & Hao Wu & Xin Zhou Meta {bcyuan,haowu1,markzhou}@meta.com Hanghang Tong University of Illinois at Urbana-Champaign [email protected] Mehrdad Mahdavi Penn State [email protected] ABSTRACT Recurrent neural network (RNN) and self-attention mechanism (SAM) are the de facto methods to extract spatial-temporal information for temporal graph learning. Interestingly, we found that although both RNN and SAM could lead to a good per- formance, in practice neither of them is always necessary. In this paper, we propose GraphMixer, a conceptually and technically simple architecture that consists of three components: 1 a link-encoder that is only based on multi-layer perceptrons (MLP) to summarize the information from temporal links, 2 a node-encoder that is only based on neighbor mean-pooling to summarize node information, and 3 an MLP-based link classifier that performs link prediction based on the outputs of the encoders. Despite its simplicity, GraphMixer attains an outstanding perfor- mance on temporal link prediction benchmarks with faster convergence and better generalization performance. These results motivate us to rethink the importance of simpler model architecture. [Code]. 1 INTRODUCTION In recent years, temporal graph learning has been recognized as an important machine learning problem and has become the cornerstone behind a wealth of high-impact applications Yu et al. (2018); Bui et al. (2021); Kazemi et al. (2020); Zhou et al. (2020); Cong et al. (2021b). Temporal link prediction is one of the classic downstream tasks which focuses on predicting the future interactions among nodes. For example, in an ads ranking system, the user-ad clicks can be modeled as a temporal bipartite graph whose nodes represent users and ads, and links are associated with timestamps indicating when users click ads. Link prediction between them can be used to predict whether a user will click an ad. Designing graph learning models that can capture node evolutionary patterns and accurately predict future links is a crucial direction for many real-world recommender systems. In temporal graph learning, recurrent neural network (RNN) and self-attention mechanism (SAM) have become the de facto standard for temporal graph learning Kumar et al. (2019); Sankar et al. (2020); Xu et al. (2020); Rossi et al. (2020); Wang et al. (2020), and the majority of the existing works focus on designing neural architectures with one of them and additional components to learn representations from raw data. Although powerful, these methods are conceptually and technically complicated with advanced model architectures. It is non-trivial to understand which parts of the model design truly contribute to its success, and whether these components are indispensable. Thus, in this paper, we aim at answering the following two questions: Q1: Are RNN and SAM always indispensable for temporal graph learning? To answer this question, we propose GraphMixer, a simple architecture based entirely on the multi-layer perceptrons (MLPs) and neighbor mean-pooling, which does not utilize any RNN or SAM in its model architecture (Section 3). Despite its simplicity, GraphMixer could obtain outstanding results when comparing it 1 Published as a conference paper at ICLR 2023 Figure 1: (Left) Temporal graph with nodes v1, . . . , v5, per-link timestamps t1, . . . , t6 indicate when two nodes interact. For example, v1, v2 interact at t1, t5. (Right) Each node has its node features (e.g., xnode 1,2 (t5) are link features 1 between v1, v2 at t1, t5). For scenarios without node or link features, we use all-zero vectors instead. for v1) and each temporal link has its link features (e.g., xlink 1,2 (t1), xlink against baselines that are equipped with the RNNs and SAM. In practice, it achieves state-of-the-art performance in terms of different evaluation metrics (e.g., average precision, AUC, Recall@K, and MRR) on real-world temporal graph datasets, with the even smaller number of model parameters and hyper-parameters, and a conceptually simpler input structure and model architecture (Section 4). Q2: What are the key factors that lead to the success of GraphMixer? We identify three key factors that contribute to the success of GraphMixer: 1 The simplicity of GraphMixer's input data and neural architecture. Different from most deep learning methods that focus on designing conceptually complicated data preparation techniques and technically complicated neural architectures, we choose to simplifying the neural architecture and utilize a conceptually simpler data as input. Both of which could lead to a better model performance and better generalization (Section 4.4). 2 A time-encoding function that encodes any timestamp as an easily distinguishable input vector for GraphMixer. Different from most of the existing methods that propose to learn the time-encoding function from the raw input data, our time-encoding function utilizes conceptually simple features and is fixed during training. Interestingly, we show that our fixed time-encoding function is more preferred than the trainable version (used by most previous studies), and could lead to a smoother optimization landscape, a faster convergence speed, and a better generalization (Section 4.2); 3 A link-encoder that could better distinguish temporal sequences. Different from most existing methods that summarize sequences using SAM, our encoder module is entirely based on MLPs. Interestingly, our encoder can distinguish temporal sequences that cannot be distinguished by SAM, and it could generalize better due to its simpler neural architecture and lower model complexity (Section 4.3). To this end, we summarize our contributions as follows: 1 We propose a conceptually and technically simple architecture GraphMixer; 2 Even without RNN and SAM, GraphMixer not only outperforms all baselines but also enjoys a faster convergence and better generalization ability; 3 Extensive study identifies three factors that contribute to the success of GraphMixer. 4 Our results could motivate future research to rethink the importance of the conceptually and technically simpler method. 2 PRELIMINARY AND EXISTING WORKS Preliminary. Figure 1 is an illustration on the temporal graph. Our goal is to predict whether two nodes are connected at a specific timestamp t0 based on all the available temporal graph information happened before that timestamp. For example, to predict whether v1, v2 are connected at t0, we only have access to the graph structure, node features, and link features with timestamps from t1 to t6. Related works. Most of the temporal graph learning methods are conceptually and technically complicated with advanced neural architectures. It is non-trivial to fully understand the algorithm details without looking into their implementations. Therefore, we select the four most representative and most closely-related methods to introduce and compare them in more details. • JODIE Kumar et al. (2019) is a RNN-based method. Let us denote xi(t) as the embedding of node vi at time t, xlink ij (t) as the link feature between vi, vj at time t, and mi as the timestamp that vi latest interact with other node. JODIE pre-processes and updates the representation of each node via RNNs (is it just one RNN or multiple RNNs). More specifically, when an interaction between vi, vj happens at time t, JODIE updates the temporal embedding using RNN by xi(t) = RNN . Then, the dynamic embedding of node vi at mi ij (t), t − xi(mi). Finally, the prediction on any node time t0 is computed by hi(t0) = (1 + (t0 − mi)w) (cid:1) pair at time t0 is computed by MLP([hi(t0) ] is the concatenate operation and MLP(x) is applying 2-layer MLP on x. xi(mi), xj(mj), xlink hj(t0)]), where [ *||* || (cid:0) * 2 23311Timegapt1t5t4t3t2vjvitimekRawtemporalgraphinputsxlinki,1xlinki,3xlinkj,3xlinkj,2Nodefeatures<latexit sha1_base64="xRFvcCAHe3sdZK6o49MLG0zyJbM=">AAAB6nicbVBNS8NAEJ3Ur1q/qh69LBbBU0lE1GPRi8eK9gPaUDbbSbt0swm7m0IJ/QlePCji1V/kzX/jts1BWx8MPN6bYWZekAiujet+O4W19Y3NreJ2aWd3b/+gfHjU1HGqGDZYLGLVDqhGwSU2DDcC24lCGgUCW8Hobua3xqg0j+WTmSToR3QgecgZNVZ6HPe8XrniVt05yCrxclKBHPVe+avbj1kaoTRMUK07npsYP6PKcCZwWuqmGhPKRnSAHUsljVD72fzUKTmzSp+EsbIlDZmrvycyGmk9iQLbGVEz1MveTPzP66QmvPEzLpPUoGSLRWEqiInJ7G/S5wqZERNLKFPc3krYkCrKjE2nZEPwll9eJc2LqndVvXy4rNRu8ziKcAKncA4eXEMN7qEODWAwgGd4hTdHOC/Ou/OxaC04+cwx/IHz+QMLko2n</latexit>v1<latexit sha1_base64="c5sR+1EAF9vcQu4vGyA+Q6WAKEI=">AAACAXicbVBNS8NAEN34WetX1YvgJVgETyWRoh6LXjxWsB/QxrDZTtqlm03YnUhLqBf/ihcPinj1X3jz37j9OGjrg4HHezPMzAsSwTU6zre1tLyyurae28hvbm3v7Bb29us6ThWDGotFrJoB1SC4hBpyFNBMFNAoENAI+tdjv/EASvNY3uEwAS+iXclDzigayS8ctiOKvSDMBiPfvW8jDDCTcQdGfqHolJwJ7EXizkiRzFD1C1/tTszSCCQyQbVuuU6CXkYVciZglG+nGhLK+rQLLUMljUB72eSDkX1ilI4dxsqURHui/p7IaKT1MApM5/hePe+Nxf+8VorhpZdxmaQIkk0XhamwMbbHcdgdroChGBpCmeLmVpv1qKIMTWh5E4I7//IiqZ+V3PNS+bZcrFzN4siRI3JMTolLLkiF3JAqqRFGHskzeSVv1pP1Yr1bH9PWJWs2c0D+wPr8AXf/l48=</latexit>xnode1<latexit sha1_base64="b/DKUfQyNm9yjjOSVwbaKuo7bpM=">AAACMXicbVBNS8NAEN34bf2qevSyWAQFKYmIehS9eFSwKjQ1bLaTunSTDbsTsaTpT/LiPxEvHhTx6p9wU3vwa2DZx3szzLwXplIYdN1nZ2x8YnJqema2Mje/sLhUXV65MCrTHBpcSaWvQmZAigQaKFDCVaqBxaGEy7B7XOqXt6CNUMk59lJoxayTiEhwhpYKqic+V2YTA89HEYOhfqhk2/Ri++W+iqHDiq1Bvz/wY4Y3YZTfFUHube8U1z7CHeZ2bbcox7eCas2tu8Oif4E3AjUyqtOg+ui3Fc9iSJBLZkzTc1Ns5Uyj4BKKip8ZSBnvsg40LUyYPa+VDx0XdMMybRopbV+CdMh+n8hZbEoXtrM83PzWSvI/rZlhdNDKRZJmCAn/WhRlkqKiZXy0LTRwlD0LGNfC3kr5DdOMow25YkPwflv+Cy526t5effdst3Z4NIpjhqyRdbJJPLJPDskJOSUNwsk9eSIv5NV5cJ6dN+f9q3XMGc2skh/lfHwCf4Srmg==</latexit>cos(t1⇥!)||xlink1,2(t1)<latexit sha1_base64="n+DhQ4BYpbk2Fc0Vx/SXip52Zo0=">AAACMXicbVBNS8NAEN34bf2qevSyWAQFKYkW9Sh68ahgVWhq2GwndekmG3YnYonxJ3nxn4gXD4p49U+4qT34NbDs470ZZt4LUykMuu6zMzI6Nj4xOTVdmZmdm1+oLi6dGZVpDk2upNIXITMgRQJNFCjhItXA4lDCedg7LPXza9BGqOQU+ym0Y9ZNRCQ4Q0sF1SOfK7OOwbaPIgZD/VDJjunH9st9FUOXFRt3t7d3fszwKozymyLItzYbxaWPcIO5XdsryvGNoFpz6+6g6F/gDUGNDOs4qD76HcWzGBLkkhnT8twU2znTKLiEouJnBlLGe6wLLQsTZs9r5wPHBV2zTIdGStuXIB2w3ydyFpvShe0sDze/tZL8T2tlGO21c5GkGULCvxZFmaSoaBkf7QgNHGXfAsa1sLdSfsU042hDrtgQvN+W/4Kzrbq3U2+cNGr7B8M4psgKWSXrxCO7ZJ8ckWPSJJzckyfyQl6dB+fZeXPev1pHnOHMMvlRzscnitqroQ==</latexit>cos(t3⇥!)||xlink2,4(t3)<latexit sha1_base64="ck25dJJvQiLZWJLJEDC+pG52Yls=">AAACMXicbVBNS8NAEN34bf2qevSyWAQFKUkp6lH04lHBqtDUsNlO6tJNNuxOxBLjT/LiPxEvHhTx6p9wU3vwa2DZx3szzLwXplIYdN1nZ2x8YnJqema2Mje/sLhUXV45MyrTHFpcSaUvQmZAigRaKFDCRaqBxaGE87B/WOrn16CNUMkpDlLoxKyXiEhwhpYKqkc+V2YTg6aPIgZD/VDJrhnE9st9FUOPFVt3t7d3fszwKozymyLIG9vN4tJHuMHcru0X5fhWUK25dXdY9C/wRqBGRnUcVB/9ruJZDAlyyYxpe26KnZxpFFxCUfEzAynjfdaDtoUJs+d18qHjgm5Ypksjpe1LkA7Z7xM5i03pwnaWh5vfWkn+p7UzjPY6uUjSDCHhX4uiTFJUtIyPdoUGjnJgAeNa2Fspv2KacbQhV2wI3m/Lf8FZo+7t1Jsnzdr+wSiOGbJG1skm8cgu2SdH5Ji0CCf35Im8kFfnwXl23pz3r9YxZzSzSn6U8/EJjiOrow==</latexit>cos(t4⇥!)||xlink2,4(t4)<latexit sha1_base64="Hjhn1h3jCPbX+0ZjoIicgA6DbX0=">AAACMXicbVDLSsNAFJ34tr6qLt0MFkFBSlJ8LUU3LhWsCk0Nk+lNHTrJhJkbscT4SW78E3HjQhG3/oST2oWvC8MczrmXe88JUykMuu6zMzI6Nj4xOTVdmZmdm1+oLi6dGZVpDk2upNIXITMgRQJNFCjhItXA4lDCedg7LPXza9BGqOQU+ym0Y9ZNRCQ4Q0sF1SOfK7OOwbaPIgZD/VDJjunH9st9FUOXFRt3t7d3fszwKozymyLIvc1Gcekj3GBu1/aKcnwjqNbcujso+hd4Q1AjwzoOqo9+R/EshgS5ZMa0PDfFds40Ci6hqPiZgZTxHutCy8KE2fPa+cBxQdcs06GR0vYlSAfs94mcxaZ0YTvLw81vrST/01oZRnvtXCRphpDwr0VRJikqWsZHO0IDR9m3gHEt7K2UXzHNONqQKzYE77flv+CsUfd26lsnW7X9g2EcU2SFrJJ14pFdsk+OyDFpEk7uyRN5Ia/Og/PsvDnvX60jznBmmfwo5+MTjKirog==</latexit>cos(t5⇥!)||xlink1,2(t5)<latexit sha1_base64="5w4U2nBCpzFXCfjJr7fAs5KmE0M=">AAACYHicbVFNTxsxEPUupQ0BSqA3erGIkKgqRbsRKhxRufRUUakBpGxYeZ1ZMPhjZc+mRGb/ZG899NJfUidEKg2MZOnpvTfj8XNRSeEwSX5F8cqr1ddvWmvt9Y3Nt1ud7Z1zZ2rLYcCNNPayYA6k0DBAgRIuKwtMFRIuirvTmX4xAeuE0d9xWsFIsWstSsEZBirv/MgUw5ui9PdN3r/KEO7RazOGhn6kWWkZ92njH+YmzqT/2hxM8v6Hh4ZmrlaZNlIogS73k/w2E3rZF2z/xt8+HZ93ukkvmRd9DtIF6JJFneWdn9nY8FqBRi6Zc8M0qXDkmUXBJTTtrHZQMX7HrmEYoGYK3MjPA2rofmDGtDQ2HI10zj7t8Ew5N1VFcM72dcvajHxJG9ZYHo+80FWNoPnjRWUtKRo6S5uOhQWOchoA41aEXSm/YSFWDH/SDiGky09+Ds77vfRT7/DbYffk8yKOFnlP9sgBSckROSFfyBkZEE5+RyvRRrQZ/Ylb8Va8/WiNo0XPO/Jfxbt/AYowuRo=</latexit>xnode2+1|N(v2)|Xvj2N(v2)xnodejGlobal LinearMLP-mixer<latexit sha1_base64="+dxkSr8Jvw9DKB6mlI+tnMVkJoY=">AAACAHicbVBNS8NAEN3Ur1q/oh48eAkWwVNJSlGPRS8eK9gPaGPYbDft0s0m7E7EEnLxr3jxoIhXf4Y3/42bNgdtfTDweG+GmXl+zJkC2/42Siura+sb5c3K1vbO7p65f9BRUSIJbZOIR7LnY0U5E7QNDDjtxZLi0Oe060+uc7/7QKVikbiDaUzdEI8ECxjBoCXPPBqEGMZ+kPYyr34/APoIKcQy88yqXbNnsJaJU5AqKtDyzK/BMCJJSAUQjpXqO3YMboolMMJpVhkkisaYTPCI9jUVOKTKTWcPZNapVoZWEEldAqyZ+nsixaFS09DXnfm5atHLxf+8fgLBpZsyESdABZkvChJuQWTlaVhDJikBPtUEE8n0rRYZY4kJ6MwqOgRn8eVl0qnXnPNa47ZRbV4VcZTRMTpBZ8hBF6iJblALtRFBGXpGr+jNeDJejHfjY95aMoqZQ/QHxucPn4SXFg==</latexit>Xtpr2<latexit sha1_base64="yTYT7Q6hlzOMXvEBT16aFkR5Nfc=">AAACAHicbVBNS8NAEN34WetX1IMHL8EieCpJKeqx6MVjBfsBbQyb7aZdutmE3Ym0hFz8K148KOLVn+HNf+OmzUFbHww83pthZp4fc6bAtr+NldW19Y3N0lZ5e2d3b988OGyrKJGEtkjEI9n1saKcCdoCBpx2Y0lx6HPa8cc3ud95pFKxSNzDNKZuiIeCBYxg0JJnHvdDDCM/SCeZV3voA51AqmKeeWbFrtozWMvEKUgFFWh65ld/EJEkpAIIx0r1HDsGN8USGOE0K/cTRWNMxnhIe5oKHFLlprMHMutMKwMriKQuAdZM/T2R4lCpaejrzvxctejl4n9eL4Hgyk2ZiBOggswXBQm3ILLyNKwBk5QAn2qCiWT6VouMsMQEdGZlHYKz+PIyadeqzkW1flevNK6LOEroBJ2ic+SgS9RAt6iJWoigDD2jV/RmPBkvxrvxMW9dMYqZI/QHxucPxx+XLw==</latexit>xspl2Zero-paddingLN+LinearTransposeLinearMean-pooling<latexit sha1_base64="HEKeveZVrlSrkTYZKO2jk9iG1rA=">AAADenicpZLfb9MwEMfdlB+j/OrgESFZqxit2Kqmy4AXpAleeBzSuk2qS+Q4l9Sq40TxBa3Ksr+Bv403/hJeeMBpiwYtL2gnWf7qzv747nxBpqTBweB7w2neun3n7ta91v0HDx89bm8/OTVpkQsYiVSl+XnADSipYYQSFZxnOfAkUHAWzD7U8bMvkBuZ6hOcZzBJeKxlJAVH6/K3G19ZwnEaROVJ5Q+7s16LvqMM4QJLg1zMKqYgwi4LIJa65ErGGsKqtTtmIjVd9F2GMgFDWZCq0MwTu5UsTSDmVe/q8vLqN/2i8kt3b1h9XrJturOqO9u3gN6EMnYNPPgP4HDP2wQerAG9mwK9NeDhTUs+XAIZ6PC6oyyX8RR7tOW3O4P+YGF0U7gr0SErO/bb31iYiiIBjUJxY8buIMNJyXOUQoElFwYy+5U8hrGVmtvkJ+VidCr6wnpCGqW5XRrpwvvnjZInpq7RnqzLMuux2vmv2LjA6O2klDorELRYPhQVimJK6zmkocxBoJpbwUUuba5UTHnOBdpprZvgrpe8KU6Hffd13/vkdY7er9qxRZ6RHdIlLnlDjshHckxGRDR+OM+dXeel87O50+w1Xy2POo3VnafkL2t6vwBo6CEH</latexit>T2(k)=stack0BBBB@[cos(t1⇥!)||xlink1,2(kt1)][cos(t3⇥!)||xlink2,4(kt3)][cos(t4⇥!)||xlink2,4(kt4)][cos(t5⇥!)||xlink1,2(kt5)]1CCCCA<latexit sha1_base64="fa76Vjfd/ZShd0U3/F8csNEblao=">AAACe3icbVFbSxtBFJ5d23rpLeqjUIYGMbYl7AZvL4LYlz4VC0aFbFxmJ7M6Zi7LzNlgGPdP+NN885/4InQ2ppCqBwY+vvOdy3wnKwS3EEX3QTj35u27+YXFpfcfPn763FheObG6NJR1qRbanGXEMsEV6wIHwc4Kw4jMBDvNhj/r/OmIGcu1OoZxwfqSXCiec0rAU2njNpEELrPc2SrttIabeB//Y649c54Auwan9IBV+DtOckOoiyt3MxFRItzvKh2eH7dGaWfzpsKJLWWitOCSg03dKL1KuHpNW82OuZods5Q2mlE7mgR+CeIpaKJpHKWNu2SgaSmZAiqItb04KqDviAFOhW+YlJYVhA7JBet5qIhktu8m3lV43TMDnGvjnwI8YWcrHJHWjmXmlfXC9nmuJl/L9UrI9/qOq6IEpujToLwUGDSuD4EH3DAKYuwBoYb7XTG9JN5f8OeqTYiff/klOOm045321p+t5sHh1I4FtIa+ohaK0S46QL/QEeoiih6CL8FG0Aoew2b4LfzxJA2Dac0q+i/C7b8gjsMt</latexit>s2(k)=xnode2+1|NTk(v2)|Xvj2NTk(v2)xnodej<latexit sha1_base64="Q8d2qGkWRhhPvnVvqGjD54CkP/s=">AAAB73icbVDJSgNBEK2JW4xb1KOXxiB4kDAjcTkGvXiMYBZIhqGn05M06VnsrhHCkJ/w4kERr/6ON//GTjIHTXxQ8Hiviqp6fiKFRtv+tgorq2vrG8XN0tb2zu5eef+gpeNUMd5ksYxVx6eaSxHxJgqUvJMoTkNf8rY/up367SeutIijBxwn3A3pIBKBYBSN1EHPOSPoXXjlil21ZyDLxMlJBXI0vPJXrx+zNOQRMkm17jp2gm5GFQom+aTUSzVPKBvRAe8aGtGQazeb3TshJ0bpkyBWpiIkM/X3REZDrcehbzpDikO96E3F/7xuisG1m4koSZFHbL4oSCXBmEyfJ32hOEM5NoQyJcythA2pogxNRCUTgrP48jJpnVedy2rtvlap3+RxFOEIjuEUHLiCOtxBA5rAQMIzvMKb9Wi9WO/Wx7y1YOUzh/AH1ucPy/uPKw==</latexit>t1,t5<latexit sha1_base64="/fBkRLvL0GW70fe4G8+OxYC36FI=">AAAB73icbVDLSgNBEOyNrxhfUY9eBoPgQcKuBvUY9OIxgnlAsiyzk9lkyOzDmV4hLPkJLx4U8ervePNvnCR70MSChqKqm+4uP5FCo21/W4WV1bX1jeJmaWt7Z3evvH/Q0nGqGG+yWMaq41PNpYh4EwVK3kkUp6Evedsf3U799hNXWsTRA44T7oZ0EIlAMIpG6qB3cUbQq3nlil21ZyDLxMlJBXI0vPJXrx+zNOQRMkm17jp2gm5GFQom+aTUSzVPKBvRAe8aGtGQazeb3TshJ0bpkyBWpiIkM/X3REZDrcehbzpDikO96E3F/7xuisG1m4koSZFHbL4oSCXBmEyfJ32hOEM5NoQyJcythA2pogxNRCUTgrP48jJpnVedy2rtvlap3+RxFOEIjuEUHLiCOtxBA5rAQMIzvMKb9Wi9WO/Wx7y1YOUzh/AH1ucPzYmPLA==</latexit>t3,t4<latexit sha1_base64="VfQlbjz14oEvJ+wNqJlCEmczKxA=">AAAB6nicbVBNS8NAEJ3Ur1q/qh69LBbBU0lKUY9FLx4r2lpoQ9lsN+3SzSbsToQS+hO8eFDEq7/Im//GbZuDtj4YeLw3w8y8IJHCoOt+O4W19Y3NreJ2aWd3b/+gfHjUNnGqGW+xWMa6E1DDpVC8hQIl7ySa0yiQ/DEY38z8xyeujYjVA04S7kd0qEQoGEUr3WO/1i9X3Ko7B1klXk4qkKPZL3/1BjFLI66QSWpM13MT9DOqUTDJp6VeanhC2ZgOeddSRSNu/Gx+6pScWWVAwljbUkjm6u+JjEbGTKLAdkYUR2bZm4n/ed0Uwys/EypJkSu2WBSmkmBMZn+TgdCcoZxYQpkW9lbCRlRThjadkg3BW355lbRrVe+iWr+rVxrXeRxFOIFTOAcPLqEBt9CEFjAYwjO8wpsjnRfn3flYtBacfOYY/sD5/AEKCo2m</latexit>t2<latexit sha1_base64="xRFvcCAHe3sdZK6o49MLG0zyJbM=">AAAB6nicbVBNS8NAEJ3Ur1q/qh69LBbBU0lE1GPRi8eK9gPaUDbbSbt0swm7m0IJ/QlePCji1V/kzX/jts1BWx8MPN6bYWZekAiujet+O4W19Y3NreJ2aWd3b/+gfHjU1HGqGDZYLGLVDqhGwSU2DDcC24lCGgUCW8Hobua3xqg0j+WTmSToR3QgecgZNVZ6HPe8XrniVt05yCrxclKBHPVe+avbj1kaoTRMUK07npsYP6PKcCZwWuqmGhPKRnSAHUsljVD72fzUKTmzSp+EsbIlDZmrvycyGmk9iQLbGVEz1MveTPzP66QmvPEzLpPUoGSLRWEqiInJ7G/S5wqZERNLKFPc3krYkCrKjE2nZEPwll9eJc2LqndVvXy4rNRu8ziKcAKncA4eXEMN7qEODWAwgGd4hTdHOC/Ou/OxaC04+cwx/IHz+QMLko2n</latexit>v1<latexit sha1_base64="pd6CG+fgXjPa9TrI/+SvifD5VxY=">AAAB6nicbVDLTgJBEOzFF+IL9ehlIjHxRHYJUY9ELx4xyiOBDZkdemHC7OxmZpaEED7BiweN8eoXefNvHGAPClbSSaWqO91dQSK4Nq777eQ2Nre2d/K7hb39g8Oj4vFJU8epYthgsYhVO6AaBZfYMNwIbCcKaRQIbAWju7nfGqPSPJZPZpKgH9GB5CFn1Fjpcdyr9Iolt+wuQNaJl5ESZKj3il/dfszSCKVhgmrd8dzE+FOqDGcCZ4VuqjGhbEQH2LFU0gi1P12cOiMXVumTMFa2pCEL9ffElEZaT6LAdkbUDPWqNxf/8zqpCW/8KZdJalCy5aIwFcTEZP436XOFzIiJJZQpbm8lbEgVZcamU7AheKsvr5NmpexdlasP1VLtNosjD2dwDpfgwTXU4B7q0AAGA3iGV3hzhPPivDsfy9ack82cwh84nz8NFo2o</latexit>v2<latexit sha1_base64="b2tEeKlWWv/DNO1wXN9nzf05O4M=">AAAB6nicbVDLTgJBEOzFF+IL9ehlIjHxRHaVqEeiF48Y5ZHAhswOvTBhdnYzM0tCCJ/gxYPGePWLvPk3DrAHBSvppFLVne6uIBFcG9f9dnJr6xubW/ntws7u3v5B8fCooeNUMayzWMSqFVCNgkusG24EthKFNAoENoPh3cxvjlBpHssnM07Qj2hf8pAzaqz0OOpedoslt+zOQVaJl5ESZKh1i1+dXszSCKVhgmrd9tzE+BOqDGcCp4VOqjGhbEj72LZU0gi1P5mfOiVnVumRMFa2pCFz9ffEhEZaj6PAdkbUDPSyNxP/89qpCW/8CZdJalCyxaIwFcTEZPY36XGFzIixJZQpbm8lbEAVZcamU7AheMsvr5LGRdm7KlceKqXqbRZHHk7gFM7Bg2uowj3UoA4M+vAMr/DmCOfFeXc+Fq05J5s5hj9wPn8ADpqNqQ==</latexit>v3<latexit sha1_base64="hO320iBa8sEmbXNNilQxEqLdr0Y=">AAAB6nicbVBNS8NAEJ34WetX1aOXxSJ4KokU9Vj04rGi/YA2lM120y7dbMLupFBCf4IXD4p49Rd589+4bXPQ1gcDj/dmmJkXJFIYdN1vZ219Y3Nru7BT3N3bPzgsHR03TZxqxhsslrFuB9RwKRRvoEDJ24nmNAokbwWju5nfGnNtRKyecJJwP6IDJULBKFrpcdyr9kplt+LOQVaJl5My5Kj3Sl/dfszSiCtkkhrT8dwE/YxqFEzyabGbGp5QNqID3rFU0YgbP5ufOiXnVumTMNa2FJK5+nsio5ExkyiwnRHFoVn2ZuJ/XifF8MbPhEpS5IotFoWpJBiT2d+kLzRnKCeWUKaFvZWwIdWUoU2naEPwll9eJc3LindVqT5Uy7XbPI4CnMIZXIAH11CDe6hDAxgM4Ble4c2Rzovz7nwsWtecfOYE/sD5/AEQHo2q</latexit>v4<latexit sha1_base64="Vx17vpUuOe1Mymv9gb2X5BrXIdI=">AAAB6nicbVDLTgJBEOzFF+IL9ehlIjHxRHYNPo5ELx4xyiOBDZkdemHC7OxmZpaEED7BiweN8eoXefNvHGAPClbSSaWqO91dQSK4Nq777eTW1jc2t/LbhZ3dvf2D4uFRQ8epYlhnsYhVK6AaBZdYN9wIbCUKaRQIbAbDu5nfHKHSPJZPZpygH9G+5CFn1FjpcdS97BZLbtmdg6wSLyMlyFDrFr86vZilEUrDBNW67bmJ8SdUGc4ETgudVGNC2ZD2sW2ppBFqfzI/dUrOrNIjYaxsSUPm6u+JCY20HkeB7YyoGehlbyb+57VTE974Ey6T1KBki0VhKoiJyexv0uMKmRFjSyhT3N5K2IAqyoxNp2BD8JZfXiWNi7J3Va48VErV2yyOPJzAKZyDB9dQhXuoQR0Y9OEZXuHNEc6L8+58LFpzTjZzDH/gfP4AEaKNqw==</latexit>v5Temporal graph(now)(past)<latexit sha1_base64="Q8d2qGkWRhhPvnVvqGjD54CkP/s=">AAAB73icbVDJSgNBEK2JW4xb1KOXxiB4kDAjcTkGvXiMYBZIhqGn05M06VnsrhHCkJ/w4kERr/6ON//GTjIHTXxQ8Hiviqp6fiKFRtv+tgorq2vrG8XN0tb2zu5eef+gpeNUMd5ksYxVx6eaSxHxJgqUvJMoTkNf8rY/up367SeutIijBxwn3A3pIBKBYBSN1EHPOSPoXXjlil21ZyDLxMlJBXI0vPJXrx+zNOQRMkm17jp2gm5GFQom+aTUSzVPKBvRAe8aGtGQazeb3TshJ0bpkyBWpiIkM/X3REZDrcehbzpDikO96E3F/7xuisG1m4koSZFHbL4oSCXBmEyfJ32hOEM5NoQyJcythA2pogxNRCUTgrP48jJpnVedy2rtvlap3+RxFOEIjuEUHLiCOtxBA5rAQMIzvMKb9Wi9WO/Wx7y1YOUzh/AH1ucPy/uPKw==</latexit>t1,t5<latexit sha1_base64="xRFvcCAHe3sdZK6o49MLG0zyJbM=">AAAB6nicbVBNS8NAEJ3Ur1q/qh69LBbBU0lE1GPRi8eK9gPaUDbbSbt0swm7m0IJ/QlePCji1V/kzX/jts1BWx8MPN6bYWZekAiujet+O4W19Y3NreJ2aWd3b/+gfHjU1HGqGDZYLGLVDqhGwSU2DDcC24lCGgUCW8Hobua3xqg0j+WTmSToR3QgecgZNVZ6HPe8XrniVt05yCrxclKBHPVe+avbj1kaoTRMUK07npsYP6PKcCZwWuqmGhPKRnSAHUsljVD72fzUKTmzSp+EsbIlDZmrvycyGmk9iQLbGVEz1MveTPzP66QmvPEzLpPUoGSLRWEqiInJ7G/S5wqZERNLKFPc3krYkCrKjE2nZEPwll9eJc2LqndVvXy4rNRu8ziKcAKncA4eXEMN7qEODWAwgGd4hTdHOC/Ou/OxaC04+cwx/IHz+QMLko2n</latexit>v1<latexit sha1_base64="pd6CG+fgXjPa9TrI/+SvifD5VxY=">AAAB6nicbVDLTgJBEOzFF+IL9ehlIjHxRHYJUY9ELx4xyiOBDZkdemHC7OxmZpaEED7BiweN8eoXefNvHGAPClbSSaWqO91dQSK4Nq777eQ2Nre2d/K7hb39g8Oj4vFJU8epYthgsYhVO6AaBZfYMNwIbCcKaRQIbAWju7nfGqPSPJZPZpKgH9GB5CFn1Fjpcdyr9Iolt+wuQNaJl5ESZKj3il/dfszSCKVhgmrd8dzE+FOqDGcCZ4VuqjGhbEQH2LFU0gi1P12cOiMXVumTMFa2pCEL9ffElEZaT6LAdkbUDPWqNxf/8zqpCW/8KZdJalCy5aIwFcTEZP436XOFzIiJJZQpbm8lbEgVZcamU7AheKsvr5NmpexdlasP1VLtNosjD2dwDpfgwTXU4B7q0AAGA3iGV3hzhPPivDsfy9ack82cwh84nz8NFo2o</latexit>v2Linkfeaturest1t2t3t4t5<latexit sha1_base64="zwv9/bOlmoJktBdHYC6VZVWyUXg=">AAACLXichVDJSgNBEO2JW4zbqEcvg0FIIISZEJdjUA8eI5gFkjj0dHqSJj0L3TWSMIwf5MVfEcFDRLz6G3aWgyaCDxoer15VVz0n5EyCaY611Mrq2vpGejOztb2zu6fvH9RlEAlCayTggWg6WFLOfFoDBpw2Q0Gx53DacAZXk3rjgQrJAv8ORiHteLjnM5cRDEqy9eu2h6HvuPEwsWOrUEru20CHEKt5gyQHtpUvPP5jOc3betYsmlMYy8Sakyyao2rrr+1uQCKP+kA4lrJlmSF0YiyAEU6TTDuSNMRkgHu0paiPPSo78fTaxDhRStdwA6GeD8ZU/dkRY0/Kkeco52RxuVibiH/VWhG4F52Y+WEE1Cezj9yIGxAYk+iMLhOUAB8pgolgaleD9LHABFTAGRWCtXjyMqmXitZZsXxbzlYu53Gk0RE6RjlkoXNUQTeoimqIoCf0gsboXXvW3rQP7XNmTWnznkP0C9rXNyXkqUY=</latexit>xlink1,2(t1),xlink1,2(t5)<latexit sha1_base64="N1bQF1eqDfmDxCplzsJmDBdgCjc=">AAAB6nicbVBNS8NAEJ3Ur1q/qh69LBbBU0mkqMeiF48V7Qe0oWy2m3bpZhN2J0IJ/QlePCji1V/kzX/jts1BWx8MPN6bYWZekEhh0HW/ncLa+sbmVnG7tLO7t39QPjxqmTjVjDdZLGPdCajhUijeRIGSdxLNaRRI3g7GtzO//cS1EbF6xEnC/YgOlQgFo2ilB+y7/XLFrbpzkFXi5aQCORr98ldvELM04gqZpMZ0PTdBP6MaBZN8WuqlhieUjemQdy1VNOLGz+anTsmZVQYkjLUthWSu/p7IaGTMJApsZ0RxZJa9mfif100xvPYzoZIUuWKLRWEqCcZk9jcZCM0ZyokllGlhbyVsRDVlaNMp2RC85ZdXSeui6l1Wa/e1Sv0mj6MIJ3AK5+DBFdThDhrQBAZDeIZXeHOk8+K8Ox+L1oKTzxzDHzifPwcCjaQ=</latexit>t0<latexit sha1_base64="z81ix6QeHP3t69NC0TOp7j1UnKc=">AAAB6nicbVBNS8NAEJ3Ur1q/qh69LBbBU0lEqseiF48V7Qe0oWy2m3bpZhN2J0IJ/QlePCji1V/kzX/jts1BWx8MPN6bYWZekEhh0HW/ncLa+sbmVnG7tLO7t39QPjxqmTjVjDdZLGPdCajhUijeRIGSdxLNaRRI3g7GtzO//cS1EbF6xEnC/YgOlQgFo2ilB+zX+uWKW3XnIKvEy0kFcjT65a/eIGZpxBUySY3pem6CfkY1Cib5tNRLDU8oG9Mh71qqaMSNn81PnZIzqwxIGGtbCslc/T2R0ciYSRTYzojiyCx7M/E/r5tieO1nQiUpcsUWi8JUEozJ7G8yEJozlBNLKNPC3krYiGrK0KZTsiF4yy+vktZF1atVL+8vK/WbPI4inMApnIMHV1CHO2hAExgM4Rle4c2Rzovz7nwsWgtOPnMMf+B8/gAQGo2q</latexit>t6<latexit sha1_base64="z81ix6QeHP3t69NC0TOp7j1UnKc=">AAAB6nicbVBNS8NAEJ3Ur1q/qh69LBbBU0lEqseiF48V7Qe0oWy2m3bpZhN2J0IJ/QlePCji1V/kzX/jts1BWx8MPN6bYWZekEhh0HW/ncLa+sbmVnG7tLO7t39QPjxqmTjVjDdZLGPdCajhUijeRIGSdxLNaRRI3g7GtzO//cS1EbF6xEnC/YgOlQgFo2ilB+zX+uWKW3XnIKvEy0kFcjT65a/eIGZpxBUySY3pem6CfkY1Cib5tNRLDU8oG9Mh71qqaMSNn81PnZIzqwxIGGtbCslc/T2R0ciYSRTYzojiyCx7M/E/r5tieO1nQiUpcsUWi8JUEozJ7G8yEJozlBNLKNPC3krYiGrK0KZTsiF4yy+vktZF1atVL+8vK/WbPI4inMApnIMHV1CHO2hAExgM4Rle4c2Rzovz7nwsWgtOPnMMf+B8/gAQGo2q</latexit>t6 Published as a conference paper at ICLR 2023 • DySAT Sankar et al. (2020) is a SAM-based method. DySAT requires pre-processing the temporal graph into multiple snapshot graphs by first splitting all timestamps into multiple time-slots, then merging all edges in each time-slot. Let Et) denote the t-th snapshot graph. To capture , spatial information, DySAT first applies Graph Attention Network (GAT) Veliˇckovi ́c et al. (2018) Gt). Then, to capture of temporal on each snapshot graph information for each node, Transformer is applied to xi(t) = [X(t)]i at different timestamps to capture the temporal information by hi(tk), . . . hi(t0) = Transformer xi(tk), . . . , xi(t0) . Finally, the prediction on any node pair at time t0 is computed by MLP([hi(t0) hj(t0)]). Gt( V Gt independently by X(t) = GAT( (cid:1) • TGAT Xu et al. (2020) is a SAM-based method that could capture the spatial and temporal information simultaneously. TGAT first generates the time augmented feature of node i at time t by concatenating the raw feature xi with a trainable time encoding z(t) of time t, i.e., z(t)] and z(t) = cos(tw+b). Then, SAM is applied to the time augmented features xi(t) = [xi || and produces node representation hi(t0) = SAM (xi(t0), Nt0 (i) denotes the neighbors of node i at time t0 and hu denotes the timestamp of the latest interaction of node u. Finally, the prediction on any node pair at time t0 is computed by MLP([hi(t0) hj(t0)]). • TGN Rossi et al. (2020) is a mixture of RNN- and SAM-based method. In practice, TGN first captures the temporal information using RNN (similarly to JODIE), and then applies graph attention convolution to capture the spatial and temporal information jointly (similarly to TGAT). ∈ Nt0(i) } xu(hu) { ), where u || || (cid:0) | Besides, we also consider the following temporal graph learning methods as baselines. These methods could be thought of as an extension on top of the above four most representative methods, but with the underlying idea behind the model design much more conceptually complicated. CAWs Wang et al. (2020) is a mixer of RNN- and SAM- based method that proposes to represent network dynamics by extracting temporal network motifs using temporal random walks. CAWs replaces node identities with the hitting counts of the nodes based on a set of sampled walks to establish the correlation between motifs. Then, the extracted motifs are fed into RNNs to encode each walk as a representation, and use SAM to aggregate the representations of multi-walks into a single vector for downstream tasks. TGSRec Fan et al. (2021) is a SAM-based method that proposes to unify sequential patterns and temporal collaborative signals to improve the quality of recommendation. To achieve this goal, they propose to advance the SAM by adopting novel collaborative attention, such that SAM can simultaneously capture collaborative signals from both users and items, as well as consider temporal dynamics inside sequential patterns. APAN Wang et al. (2021b) is a RNN-based method that proposes to decouple model inference and graph computation to alleviate the damage of the heavy graph query operation to the speed of model inference. More related works are deferred to Appendix B. 3 GRAPHMIXER: A CONCEPTUALLY AND TECHNICALLY SIMPLE METHOD In this section, we first introduce the neural architecture of GraphMixer in Section 3.1 then explicitly highlight its difference to baseline methods in Section 3.2. 3.1 DETAILS ON GRAPHMIXER: NEURAL ARCHITECTURE AND INPUT DATA GraphMixer has three modules: 1 link-encoder is designed to summarize the information from temporal links (e.g., link timestamps and link features); 2 node-encoder is designed to summarize the information from nodes (e.g., node features and node identity); 3 link classifier predicts whether a link exists based on the output of the aforementioned two encoders. Link-encoder. The link-encoder is designed to summarize the temporal link information asso- ciated with each node sorted by timestamps, where temporal link information is referring to the timestamp and features of each link. For example in Figure 1, the temporal link informa- 2,4 (t4)), (t5, xlink 2,4 (t3)), (t4, xlink tion for node v2 is and for node v5 is (t2, xlink . In practice, we only keep the top K most recent temporal link infor- } { mation, where K is a dataset dependent hyper-parameter. If multiple links have the same timestamps, we simply keep them the same order as the input raw data. To summarize temporal link informa- tion, our link-encoder should have the ability to distinguish different timestamps (achieved by our time-encoding function) and different temporal link information (achieved by the Mixer module). 1,2 (t1)), (t3, xlink 3,5 (t2)), (t6, xlink (t1, xlink 4,5 (t6)) 1,2 (t5)) } { • Time-encoding function. To distinguish different timestamps, we introduce our time-encoding d i=1 to encode each timestamps into } function cos(tω), which utilizes features ω = α− 1)/β { − (i 3 Published as a conference paper at ICLR 2023 Figure 2: (a) Time-encoding function that pre-process timestamp t into a vector cos(tω). The x-axis is the vector dimension and the y-axis is the cosine value. (b) link-encoder takes the temporal link information of node v2 as inputs and outputs a vector t2(t0) that will be used for link prediction. a d-dimensional vector. More specifically, we first map each t to a vector with monotonically (0, t] among the feature dimension, then use cosine function exponentially decreasing values tω to project all values to cos(tω) 1, +1]. The selection of α, β is depending on the scale of the maximum timestamp tmax we wish to encode. In order to distinguish all timestamps, we d to distinguish all timestamps. In practice, we have to make sure tmax × → found d = 100 and α = β = √d works well for all datasets. Notice that ω is fixed and will not be updated during training. As shown in Figure 2a, the output of this time-encoding function has two main properties that could help GraphMixer distinguish different timestamps: similar timestamps have similar time-encodings (e.g., the plot of t1, t2) and the larger the timestamp the later the values in time-encodings converge to +1 (e.g., the plot of t1, t3 or t1, t4). ∈ [ − ∈ 1)/β 0 as i α− → − (i 1,2 (t1)), (t3, xlink • Mixer for information summarizing. We use a 1-layer MLP-mixer Tolstikhin et al. (2021) to summarize the temporal link information. Figure 2b is an example on summarizing the temporal link information of node v2. Recall that the temporal link information of node v2 is (t1, xlink . We first encode timestamps by our { time-encoding function then concatenate it with its corresponding link features. For example, we encode (t1, xlink 1,2 (t1))] where t0 is the timestamp that we want to predict whether the link exists. Then, we stack all the outputs into a big matrix and zero-pad to the fixed length K denoted as T2(t0). Finally, we use an 1-layer MLP-mixer with mean-pooling to compress T2(t0) into a single vector t2(t0). Specifically, the MLP-mixer takes T2(t0) as input 1,2 (t1)) as [cos((t0 − 2,4 (t4)), (t5, xlink 2,4 (t3)), (t4, xlink 1,2 (t5)) t1)ω) xlink || } T2(t0) → Hinput, Htoken = Hinput + W(2) tokenGeLU(W(1) Hchannel = Htoken + GeLU(LayerNorm(Htoken)W(1) tokenLayerNorm(Hinput)), channel)W(2) channel, and output the temporal encoding t2(t0) = Mean(Hchannel). Please notice that zero-padding operator is important to capture how often a node interacts with other nodes. The node with more zero-padded dimensions has less temporal linked neighbors. This information is very important in practice according to our experimental observation. Node-encoder. The node-encoder is designed to capture the node identity and node feature in- formation via neighbor mean-pooling. Let us define the 1-hop neighbor of node vi with link timestamps from t to t0 as v1, v4} { . Then, the node-info feature is computed based on the 1-hop neighbor and v3} (v5; t4, t0) = { by si(t0) = xnode i + Mean , where T is a dataset-dependent hyper- T, t0) } | { parameter. In practice, we found 1-hop neighbors are enough to achieve good performance, and we use one-hot node representations for datasets without node features. (vi; t, t0). For example in Figure 1, we have N xnode j (vi; t0 − (v2; t4, t0) = vj ∈ N N N Link classifier. Link classifier is designed to classify whether a link exists at time t0 using the output of link-encoder ti(t0) and the output of node-encoder si(t0). Let us denote the node vi's representation at time t0 as the concatenation of the above two encodings hi(t0) = [si(t0) ti(t0)]. Then, the prediction on whether an interaction between node vi, vj happens at time t0 is computed by applying a 2-layer MLP model on [hi(t0) hj(t0)], i.e., pij = MLP([hi(t0) || hj(t0)]). || || 3.2 COMPARISON TO EXISTING METHODS In the following, we highlight some differences between GraphMixer and other methods, which will be explicitly ablation studied in the experiment section (Section 4.4). Temporal graph as undirected graph. Most of the existing works consider temporal graphs as directed graphs with information only flows from the source node (e.g., users in the recommender system) to the destination nodes (e.g., ads in the recommender system). However, we consider the 4 ti(k)Xtimei(k)=cos(t1ω)...cos(t4ω)xidentity(i),where[xidentity(i)]j=1ifj=i1/N(i)ifj∈N(i)0otherwisez(i)=[xnode(i)||xidentity(i)||xtemporal(i)]zij=ReLU!Wsrcz(i)+Wdstz(j)+b"ˆyij=Sigmoid(w!zij+b)Xmixeri=!XtimeiXlinki00"xtemporali(k)Token-mixerChannel-mixerMean-poolingMLP-Mixerxtemporal(i)Xlinki(k)<latexit sha1_base64="r35mnhe9SYilnfI/p+c5xK7HpxY=">AAAC0nicfZJNbxMxEIa9y1cJH03hyMUiApVLtJtGwLGCCzeK1LSV4iia9U42Vr32yp4FpatQVVz5ddz4CfwLnG2EoA0dyfKrd/zIM2NnlVaekuRnFN+6fefuva37nQcPHz3e7u48OfK2dhJH0mrrTjLwqJXBESnSeFI5hDLTeJydvl/ljz+j88qaQ1pUOCmhMGqmJFCwpt1fIsNCmQa0Kgzmy85LTtOUC6eKOYFz9gsX0vrd1syszv2iDFsjbIkFLF9xIVpksAkZ3IjsbUL2bkSGm5DhfxGBJv/T2bTbS/pJG/y6SNeix9ZxMO3+ELmVdYmGpAbvx2lS0aQBR0pqXHZE7bECeQoFjoM0UKKfNO2TLPmL4OR8Zl1Yhnjr/k00UPpVxeFkCTT3V3Mrc1NuXNPs7aRRpqoJjby8aFZrTpav3pfnyqEkvQgCpFOhVi7n4EBS+AWdMIT0asvXxdGgn77uDz8Ne/vv1uPYYs/Yc7bLUvaG7bMP7ICNmIw+RnX0NTqPD+Oz+CL+dnk0jtbMU/ZPxN9/AwKf4NU=</latexit>t1!cos(t1!)t2!cos(t2!)t3!cos(t3!)t4!cos(t4!)<latexit sha1_base64="r35mnhe9SYilnfI/p+c5xK7HpxY=">AAAC0nicfZJNbxMxEIa9y1cJH03hyMUiApVLtJtGwLGCCzeK1LSV4iia9U42Vr32yp4FpatQVVz5ddz4CfwLnG2EoA0dyfKrd/zIM2NnlVaekuRnFN+6fefuva37nQcPHz3e7u48OfK2dhJH0mrrTjLwqJXBESnSeFI5hDLTeJydvl/ljz+j88qaQ1pUOCmhMGqmJFCwpt1fIsNCmQa0Kgzmy85LTtOUC6eKOYFz9gsX0vrd1syszv2iDFsjbIkFLF9xIVpksAkZ3IjsbUL2bkSGm5DhfxGBJv/T2bTbS/pJG/y6SNeix9ZxMO3+ELmVdYmGpAbvx2lS0aQBR0pqXHZE7bECeQoFjoM0UKKfNO2TLPmL4OR8Zl1Yhnjr/k00UPpVxeFkCTT3V3Mrc1NuXNPs7aRRpqoJjby8aFZrTpav3pfnyqEkvQgCpFOhVi7n4EBS+AWdMIT0asvXxdGgn77uDz8Ne/vv1uPYYs/Yc7bLUvaG7bMP7ICNmIw+RnX0NTqPD+Oz+CL+dnk0jtbMU/ZPxN9/AwKf4NU=</latexit>t1!cos(t1!)t2!cos(t2!)t3!cos(t3!)t4!cos(t4!)<latexit sha1_base64="wDNeVYaoNqi9UkgrM1troqRKxM4=">AAADgHicpVJbb9MwFHYTLqPcuvHIi0UFSqWuS7qMIZ4meOFxSHSbVIfIcZzUquNE8QlalWU/gx/GGz8GCaetBLR9QTuS5U/f8fnOxScqpNDguj87ln3v/oOHe4+6j588ffa8t39wofOqZHzCcpmXVxHVXArFJyBA8qui5DSLJL+M5h9b/+U3XmqRqy+wKHiQ0VSJRDAKhgr3O98xAX4NtQbK5g2RPAGHRDwVqqZSpIrHTffNlLBcOw6ELj7EEHoDAiLjGpMol7FeZOaqSZ7xlDaD25ubW5JRmEVJfd2EtTccN19XOUyR88Zp4wNMyJbs8f/Ijof+puzxbln/jrL+btmTOw7hZCVLuIr/TJqUIp3BAHfDXt8duUvD28Bbgz5a23nY+0HinFUZV8Ak1XrquQUENS1BMMmNcqV5Yb6YpnxqoKKm9KBeLlCDXxsmxklemqMAL9m/I2qa6bZD87JtSm/6WnKXb1pB8i6ohSoq4IqtEiWVxJDjdhtxLErOQC4MoKwUplbMZrSkDMzOtkPwNlveBhfjkfd25H/2+2cf1uPYQy/RK+QgD52iM/QJnaMJYp1fVt8aWoe2ZTv2ke2tnlqddcwL9I/Z738DTqQfGg==</latexit>stack0BBBB@[cos((t0t1)⇥!)||xlink1,2(t1)][cos((t0t3)⇥!)||xlink2,4(t3)][cos((t0t4)⇥!)||xlink2,4(t4)][cos((t0t5)⇥!)||xlink1,2(t5)]1CCCCAToken-mixerChannel-mixerMean-pooling1-layer MLP-MixerZero-padding(a)(b)<latexit sha1_base64="+ujstVMefRZdmv+UsCS0LrqJoAo=">AAAB+nicbVBNT8JAFNziF+JX0aOXjcQEL6QlRD0SvXjERMAEmma7bGHDdtvsvmpI5ad48aAxXv0l3vw3LtCDgpNsMpl5L292gkRwDY7zbRXW1jc2t4rbpZ3dvf0Du3zY0XGqKGvTWMTqPiCaCS5ZGzgIdp8oRqJAsG4wvp753QemNI/lHUwS5kVkKHnIKQEj+Xa5HxEYBWEGU79eBd858+2KU3PmwKvEzUkF5Wj59ld/ENM0YhKoIFr3XCcBLyMKOBVsWuqnmiWEjsmQ9QyVJGLay+bRp/jUKAMcxso8CXiu/t7ISKT1JArM5CyoXvZm4n9eL4Xw0su4TFJgki4OhanAEONZD3jAFaMgJoYQqrjJiumIKELBtFUyJbjLX14lnXrNPa81bhuV5lVeRxEdoxNURS66QE10g1qojSh6RM/oFb1ZT9aL9W59LEYLVr5zhP7A+vwBd/2TfQ==</latexit>t2(t0) Published as a conference paper at ICLR 2023 Table 1: Comparison on the average precision score for link prediction. GraphMixer uses one-hot node encoding for datasets without node features (marked by (cid:92)). For each dataset, we indicate whether we have the corresponding feature ("L" link features, "N" node features, and "T" link timestamps). Red is the best score, Blue is the best score excluding GraphMixer and its variants. Reddit L, T Wiki L, T MOOC T LastFM T GDELT L, N, T GDELT-ne T GDELT-e N, T JODIE 99.30 DySAT 98.52 TGAT 99.66 TGN 99.80 CAWs-mean 98.43 CAWs-attn 98.51 TGSRec 95.21 APAN 99.24 GraphMixer-L 99.84 GraphMixer-N 99.24 GraphMixer 99.93 0.01 0.01 0.01 0.01 0.02 0.02 0.08 0.02 0.01 0.01(cid:92) 0.01(cid:92) ± ± ± ± ± ± ± ± ± ± ± 98.81 96.71 97.75 99.55 97.72 97.95 91.64 98.14 99.70 90.33 99.85 0.01 0.02 0.02 0.01 0.03 0.03 0.12 0.01 0.01 0.01(cid:92) 0.01(cid:92) ± ± ± ± ± ± ± ± ± ± ± 99.16 98.82 98.43 99.62 62.99 63.07 83.62 98.70 99.81 97.35 99.91 0.01 0.02 0.01 0.01 0.87 0.82 0.34 0.98 0.01 0.02(cid:92) 0.01(cid:92) ± ± ± ± ± ± ± ± ± ± ± 67.51 76.40 54.77 82.23 76.35 76.31 76.91 69.39 95.50 63.80 96.31 0.87 0.77 1.01 0.50 0.08 0.10 0.87 0.81 0.03 0.03(cid:92) 0.02(cid:92) ± ± ± ± ± ± ± ± ± ± ± 98.27 98.52 98.25 98.15 95.11 95.06 97.03 95.96 98.99 94.44 98.89 97.13 0.02 82.47 0.02 84.30 0.02 97.13 0.02 69.20 0.12 69.54 0.11 97.03 0.61 97.38 0.10 0.02 96.14 0.02 96.00 0.02 98.39 0.02 0.13 0.10 0.02 0.10 0.19 0.61 0.23 0.02 0.02(cid:92) 0.02(cid:92) ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± 96.96 97.25 96.96 96.04 91.72 91.54 97.03 96.77 98.99 98.81 98.22 0.02 0.02 0.02 0.02 0.19 0.22 0.61 0.18 0.02 0.02(cid:92) 0.02(cid:92) ± ± ± ± ± ± ± ± ± ± ± temporal graph as an undirected graph. By doing so, if two nodes are frequently connected in the last few timestamps, the "most recent 1-hop neighbors" sampled for the two nodes on the "undirected" temporal graph would be similar. In other words, the similarity between the sampled neighbors provides information on whether two nodes are frequently connected in the last few timestamps, which is essential for temporal graph link prediction. Intuitively, if two nodes are frequently connected in the last few timestamps, they are also likely to be connected in the recent future. Selection on neighbors. Existing methods consider either "multi-hop recent neighbors" or "multi- hop uniform sampled neighbors", whereas we only consider the "1-hop most recent neighbors". For example, TGAT Xu et al. (2020), DySAT Sankar et al. (2020), and TGSRe Fan et al. (2021) consider multi-hop uniform sampled neighbors; JODIE Kumar et al. (2019), TGN Rossi et al. (2020), and APAN Wang et al. (2021b) maintain the historical node interactions via RNN, which can be think of as multi-hop recent neighbors; CAWs Wang et al. (2020) samples neighbors by random walks, which can also be think of as multi-hop recent neighbors. Although sampling more neighbors could provide a sufficient amount of information for models to reason about, it could also carry much spurious or noisy information. As a result, more complicated model architectures (e.g., RNN or SAM) are required to extract useful information from the raw data, which could lead to a poor model trainability and potentially weaker generalization ability. Instead, we only take the "most recent 1-hop neighbors" into consideration, which is conceptually simpler and enjoys better performance. 4 EXPERIMENTS Dataset. We conduct experiments on five real-world datasets, including the Reddit, Wiki, MOOC, LastFM datasets that are used in Kumar et al. (2019) and the GDELT dataset1 which is introduced in Zhou et al. (2022). Besides, since GDELT is the only dataset with both node and link features, we create its two variants to understand the effect of training data on model performance: GDELT-e removes the link feature from GDELT and keep the node feature and link timestamps, GDELT-ne removes both the link and edge features from GDELT and only keep the link timestamps. For each dataset, we use the same 70%/15%/15% chronological splits for the train/validation/test sets as existing works. The detailed dataset statistics are summarized in Appendix A.2. Baselines. We compare baselines that are introduced in Section 2. Besides, we create two variants to better understand how node- and link-information contribute to our results, where GraphMixer-L is only using link-encoder and GraphMixer-N is only using node-encoder. We conduct experiments under the transductive learning setting and use average precision for evaluation. The detailed model configuration, training and evaluation process are summarized in Appendix A.3. Due to the space limit, more experiment results on using Recall@K, MRR, and AUC as the evaluation metrics, comparison on wall-clock time and number of parameters are deferred to Appendix C Outline. We first compare GraphMixer with baselines in Section 4.1 then highlight the three key factors that contribute to the success of GraphMixer in Section 4.2, Section 4.3, and Section 4.4. 1The GDELT dataset used in our paper is a sub-sampled version because the original dataset is too big to fit into memory for single-machine training. In practice, we keep 1 temporal link per 100 continuous temporal link. 5 Published as a conference paper at ICLR 2023 4.1 MAIN EMPIRICAL RESULTS. GraphMixer achieves outstanding performance. We compare the average precision score with baselines in Table 1. We have the following observations: 1 GraphMixer outperforms all baselines on all datasets. The experiment results provide sufficient support on our argument that neither RNN nor SAM is necessary for temporal graph link prediction. 2 According to the performance of GraphMixer-L on datasets only have link timestamp information (MOOC, LastFM, and GDELT-ne), we know that our time-encoding function could successfully pre-process each timestamp into a meaningful vector. In fact, we will show later in Section 4.2 that our time-encoding function is more preferred than baselines' trainable version. 3 By comparing the performance GraphMixer-N and GraphMixer on Wiki, MOOC, and LastFM datasets, we know that node-encoder alone is not enough to achieve a good performance. However, it provides useful information that could benefit the link-encoder. 4 By comparing the performance of GraphMixer-N on GDELT and GDELT-ne, we observe that using one-hot encoding outperforms using node features. This also shows the importance of node identity information because one-hot encoding only captures such information. 5 More complicated methods (e.g., CAWs, TGSRec, and DDGCL) do not perform well when using the default hyper-parameters2, which is understandable because these methods have more components with an excessive amount of hyper-parameters to tune. Figure 3: Comparison on the training set average precision and generalization gap for the first 100 training epochs. Results on other datasets can be found in Figure 8. GraphMixer enjoys better convergence and generalization ability. To better understand the model performance, we take a closer look at the dynamic of training accuracy and the generalization gap (the absolute difference between training and evaluation score). The results are reported in Figure 3 and Figure 8: 1 The slope of training curves reflects the expressive power and convergence speed of an algorithm. From the first row figures, we can observe that GraphMixer always converge to a high average precision score in just a few epochs, and the training curve is very smooth when compared to baselines. Interestingly, we can observe that the baseline methods cannot always fit the training data, and their training curves fluctuate a lot throughout the training process. 2 The generalization gap reflects how well the model could generalize and how stable the model could perform on unseen data (the smaller the better). From the second row figures, the generalization gap curve of GraphMixer is lesser and smoother than baselines, which indicates the generalization power of GraphMixer. GraphMixer enjoys a smoother loss landscape. To understand why "GraphMixer converges faster and generalizes better, while baselines suffer training unstable issue and generalize poorly", we explore the loss landscape by using the visualization tools introduced in Li et al. (2018a). We illustrate the loss landscape in Figure 4 by calculating and visualizing the loss surface along two random directions near the pre-trained optimal parameters. The x- and y-axis indicate how much the optimal solution is stretched along the two random directions, and the optimal point is when x- and y-axis are zero. 1 From Figure 4a, 4d, we know GraphMixer enjoys a smoother landscape with a flatter surface at the optimal point, the slope becomes steeper when stretching along the two random directions. The steeper slope on the periphery explains why GraphMixer could converge fast, the flatter surface at the optimal point explains why it could generalize well. 2 Surprisingly, we find that baselines have a non-smooth landscape with many spikes on its surface from Figure 4b, 4c, 4e, 4f. This observation provides sufficient explanation on the training instability and poor generalization issue of baselines as shown in Figure 3, 8. Interestingly, as we will show later in Section 4.2, the trainable time-encoding 2In fact, we tried different hyper-parameters based on their default values, but the results are similar. 6 Published as a conference paper at ICLR 2023 (a) GraphMixer on Wiki (b) TGAT on Wiki (c) TGN on Wiki (d) GraphMixer on GDELT-e (e) TGAT on GDELT-e Figure 4: Comparison on the training loss landscape. Results on other datasets and other baselines can be found in Appendix E. (f) TGN on GDELT-e function in baselines is the key to this non-smooth landscape issue. Replacing it with our fixed time-encoding function could flatten the landscape and boost their model performance. 4.2 ON THE IMPORTANCE OF OUR FIXED TIME-ENCODING FUNCTION. × ∂w = t Existing works (i.e., JODIE, TGAT, and TGN) leverage a trainable time-encoding function z(t) = cos(tw(cid:62) + b) to represent timestamps3. However, we argue that using trainable time-encoding function could cause instability during training because its gradient ∂ cos(tw+b) sin(tw + b) scales proportional to the timestamps, which could lead to training instability issue and cause the baselines' the non-smooth landscape issue as shown in Figure 4. As an alternative, we utilize the fixed time-encoding function z(t) = cos(tω) with fixed features ω that could capture the relative difference between two timestamps (introduced in Section 3.1). To verify this, we introduce a simple experiment to test whether the time-encoding functions (both our fixed version and baselines' trainable version) are expressive enough, such that a simple linear classifier can distinguish the time-encodings of two different timestamps produced by the time-encoding functions. Specially, our goal is to classify if t1 > t2 by learning a linear classifier on [z(t1) z(t2)]. During training, || [0, 106] and ask a fully connected layer to classify we randomly generate two timestamps t1, t2 ∈ whether a timestamp is greater than another. As shown in Figure 5a, using the trainable time-encoding function (orange curve) will suffer from the unstable exploding gradient issue (left upper figure) and its performance remains almost the same during the training process (left lower figure). However, using our fixed time-encoding function (blue curve) does not have the unstable exploding gradient issue and can quickly achieve high accuracy within several iterations. Meanwhile, we compare the parameter trajectories of the two models in Figure 5b. We observe that the change of parameters on the trainable time-encoding function is drastically larger than our fixed version. A huge change in weight parameters could deteriorate the model's performance. Most importantly, by replacing baselines' trainable time-encoding function with our fixed version, most baselines have a smoother optimization landscape (Figure 6) and a better model performance (in Table 2), which further verifies our argument that our fixed time-encoding function is more preferred than the trainable version. Table 2: Comparison on average precision score with fixed/trainable time encoding function (TEF). The results before " Reddit " is for trainable TEF (same as Table 1) and after " MOOC " is for fixed TEF. → GDELT-ne GDELT-e LastFM Wiki → JODIE 99.30 TGAT 98.66 TGN 99.80 99.76 99.48 99.83 → → → 98.81 96.71 99.55 99.00 98.55 99.54 → → → 99.16 98.43 99.62 → → → 99.17 99.33 99.62 67.51 54.77 82.23 → → → 79.89 76.26 87.58 97.13 84.30 98.15 → → → 98.23 92.31 98.25 96.96 96.96 96.04 → → → 96.96 96.28 97.34 3In fact, other baselines (e.g., CAWs, TGSRec, APAN) also utilize this trainable time-encoding function. However, we focus our discussion on the selected methods for the ease of presentation. 7 1.51.00.50.00.51.01.00.50.00.51.01.512345Train loss 3d surface123451.51.00.50.00.51.01.00.50.00.51.01.52468Train loss 3d surface24681.51.00.50.00.51.01.00.50.00.51.01.5123Train loss 3d surface1.01.52.02.53.03.51.00.50.00.51.01.00.50.00.51.0246Train loss 3d surface2461.00.50.00.51.01.00.50.00.51.00.51.01.52.02.5Train loss 3d surface0.51.01.52.02.51.00.50.00.51.01.00.50.00.51.01.01.52.02.5Train loss 3d surface0.60.81.01.21.4 Published as a conference paper at ICLR 2023 (a) Figure 5: (a) Comparison on the gradient / parameters norm and accuracy at each iteration. (b) Comparison on the trajectories of parameter change, where the radius is rt = , the angle is δ0(cid:107) / (cid:107) w(cid:63) is the difference between wt to optimal point , and δt = wt − θt = arccos δt(cid:107)2, δ0/ δt/ (cid:107) (cid:104) w(cid:63). The more the model parameters change during training, the larger the semicircle. δ0(cid:107)2(cid:105) (cid:107) δt(cid:107) (cid:107) (b) (a) TGAT on GDELT-e (b) TGN on GDELT-e (c) TGAT on Wiki (d) TGN on Wiki Figure 6: Comparison on the training loss landscape fixed time-encoding function. Results on other datasets and baselines can be found in Appendix F. 4.3 ON THE IMPORTANCE OF MLP-MIXER IN GRAPHMIXER'S LINK-ENCODER In this section, we aim to achieve a deeper understanding on the expressive power of the link-encoder by answering the following two questions: "Can we replace the MLP-mixer in link-encoder with self- attention?" and "Why MLP-mixer is a good alternative of self-attention?" To answer these questions, let us first conduct experiments by replacing the MLP-mixer in link-encoder with full/1-hop self- attention and sum/mean-pooling, where full self-attention is widely used in Transformers and 1-hop self-attention is widely used in graph attention networks. As shown in Table 3, GraphMixer suffers from performance degradation when using self-attention: the best performance is achieved when using MLP-mixer with zero-padding, while the model performance drop slightly when using self- attention with sum-pooling (row 2 and 4), and the performance drop significantly when using self-attention with mean-pooling (row 3 and 5). Self-attention with mean-pooling has a weaker model performance because it cannot distinguish "temporal sequences with identical link timestamps and features" (e.g., cannot distinguish [a1, a1] and [a1] and it cannot explicitly capture "the length of temporal sequences" (e.g., cannot distinguish if [a1, a2] is longer than [a3]), which are both very important for GraphMixer understand how frequent a node interacts with other nodes. We explicitly verify this in Figure 7 by first generating two temporal sequences (with timestamps but without link features), then encoding the timestamps into vectors via time-encoding function, and asking full self-attention and MLP-mixer to distinguish. As shown in Figure 7, self-attention with mean-pooling cannot distinguish two temporal sequences with identical timestamps (because all the self-attention weights are equivalent if the features of the node on the two sides of a link are identical) and cannot capture the sequence length (because of mean-pooling simply averages the inputs and does not take the input size into consideration). However, MLP-mixer in GraphMixer can distinguish the above two sequences because of zero-padding. Fortunately, the aforementioned two weaknesses could be alleviated by replacing the mean-pooling in temporal self-attention with the sum-pooling, which explains why using sum-pooling brings better model performance than mean-pooling. However, since self-attention modules have more parameters and are harder to train, they could generalize poor when the downstream task is not too complicated. 4.4 KEY FACTORS TO THE BETTER PERFORMANCE One of the major factors that contributes to GraphMixer's success is the simplicity of GraphMixer's neural architecture and input data. Using conceptually simple input data that better aligned with their labels allows a simple neural network model to capture the underlying mapping between the input to 8 (b)(a)(b)(a)1.00.50.00.51.01.00.50.00.51.012345Train loss 3d surface123451.00.50.00.51.01.00.50.00.51.00.60.81.01.2Train loss 3d surface0.60.81.01.21.51.00.50.00.51.01.00.50.00.51.01.52468Train loss 3d surface2461.51.00.50.00.51.01.00.50.00.51.01.512345Train loss 3d surface12345 Published as a conference paper at ICLR 2023 Table 3: Comparison on the average precision score. (cid:92) use 20 neighbors due to out of GPU memory. Link-info encoder with (Default) MLP-mixer Full self-attention 1-hop self-attention + Zero-padding + Sum pooling + Mean pooling + Sum pooling + Mean pooling Reddit 99.93 99.81 99.00 99.81 98.94 Wiki 99.85 98.19 98.05 98.01 97.29 MOOC 99.91 99.55 99.31 99.30 98.96 LastFM 96.31 93.97 89.15 93.69 72.32 GDELT-ne 98.39 98.28(cid:92) 97.13(cid:92) 98.16 97.09 (a) e.g., classify if [a1, a1] = [a1] (b) e.g., classify if size[a1, a2] > size[a3] Figure 7: (a) We generate identical timestamp sequences with different length, then ask MLP-mixer and GAT to distinguish whether the generated sequence are identical (b) We generate random sequence with different length, then ask MLP-mixer and GAT to classify which sequence is longer. their labels, which could lead to a better generalization ability. In the following, we explicitly verify this by comparing the performance of GraphMixer with different input data in Table 4: 1 Recall from Section 3.2 that the "most recent 1-hop neighbors" sampled for the two nodes on the "undirected" temporal graph could provide information on whether two nodes are frequently connected in the last few timestamps, which is essential for temporal graph link prediction. To verify this, we conduct ablation study by comparing the model performance on direct and undirected temporal graphs. As shown in the 1st and 2nd row of Table 4, changing from undirected to direct graph results in a significant performance drop because such information is missing. 2 Recall from Section 3.1 that instead of feeding the raw timestamp to GraphMixer and encoding each timestamp with a trainable time-encoding function, GraphMixer encodes the timestamps via our fixed time-encoding function and feed the encoded representation to GraphMixer, which reduces the model complexity of learning a time-encoding function from data. This could be verified by the 3rd and 4th rows of Table 4, where using the pre-encoded time information could give us a better performance. 3 Selecting the input data that has similar distribution in training and evaluation set could also potentially improve the evaluation error. For example, using relative timestamps (i.e., each neighbor's timestamp is subtracted by its root node's timestamp) is better than absolute timestamps (e.g., using Unix timestamp)because the absolute timestamps in the evaluation set and training set are from different range when using chronological splits, but they are very likely to overlap if using relative timestamps. As shown in the 3rd to 6th rows of Table 4, using relative time information always gives a better model performance than using absolute time information. 4 Selecting the most representative neighbors for each node. For example, we found 1-hop most recent interacted neighbors are the most representative for link prediction. Switching to either 2-hop neighbors or uniform sampled neighbors will hurt the model performance according to the 7th to the 10th row of Table 4. Table 4: Comparison on the average precision score of GraphMixer with different input data. The highlighted rows are identical to our default setting. Relative time-encoding cos((ti − Directed temporal graph Undirected temporal graph Relative timestamp (ti − t0) t0)ω) Absolute timestamp ti Absolute time-encoding cos(tiω) Most recent neighbors Most recent neighbors Uniform sample neighbors Uniform sample neighbors 2-hop 1-hop 2-hop 1-hop Reddit 99.69 99.93 99.79 99.93 98.90 99.52 99.39 99.93 97.66 98.19 Wiki 88.37 99.85 99.80 99.85 98.23 99.13 98.05 99.85 92.57 94.74 MOOC 97.87 99.91 99.81 99.91 98.73 99.74 99.11 99.91 98.87 98.40 LastFM 78.34 96.31 95.32 96.31 92.25 95.28 89.36 96.31 65.72 60.02 Direct vs undirect temporal graph Time information Neighbor selection 5 CONCLUSION In this paper, we propose a conceptually and technically simple architecture GraphMixer for temporal link prediction. GraphMixer not only outperforms all baselines but also enjoys a faster convergence 9 020406080100Number of epochs0.60.81.0AccuracyDistinguish repeated sequence with diff lengthGAT mean poolGAT sum poolMLP-mixer020406080100Number of epochs0.40.60.81.0AccuracyDistinguish random sequence with diff lengthGAT mean poolGAT sum poolMLP-mixer Published as a conference paper at ICLR 2023 speed and better generalization ability. An extensive study identifies three key factors that contribute to the success of GraphMixer and highlights the importance of simpler neural architecture and input data structure. An interesting future direction, not limited to temporal graph learning, is designing algorithms that could automatically select the best input data and data pre-processing strategies for different downstream tasks. ACKNOWLEDGEMENTS This work was supported in part by NSF grant 2008398. Majority of this work was completed during Weilin Cong's internship at Meta AI under the mentorship of Si Zhang. We also extend our gratitude to Long Jin for his co-mentorship and for his contribution to the idea of using MLP-Mixer on graphs. REFERENCES Uri Alon and Eran Yahav. On the bottleneck of graph neural networks and its practical implications. arXiv preprint arXiv:2006.05205, 2020. Khac-Hoai Nam Bui, Jiho Cho, and Hongsuk Yi. Spatial-temporal graph neural network for traffic forecasting: An overview and open research issues. Applied Intelligence, pp. 1–12, 2021. Huixuan Chi, Hao Xu, Hao Fu, Mengya Liu, Mengdi Zhang, Yuji Yang, Qinfen Hao, and Wei Wu. Long short-term preference modeling for continuous-time sequential recommendation. arXiv preprint arXiv:2208.00593, 2022. Weilin Cong, Morteza Ramezani, and Mehrdad Mahdavi. On provable benefits of depth in training graph convolutional networks. Advances in Neural Information Processing Systems, 34:9936–9949, 2021a. Weilin Cong, Yanhong Wu, Yuandong Tian, Mengting Gu, Yinglong Xia, Chun cheng Jason Chen, and Mehrdad Mahdavi. Dyformer: A scalable dynamic graph transformer with provable benefits on generalization ability. 2021b. Ziwei Fan, Zhiwei Liu, Jiawei Zhang, Yun Xiong, Lei Zheng, and Philip S Yu. Continuous-time sequential recommendation with temporal graph collaborative transformer. In Proceedings of the 30th ACM International Conference on Information & Knowledge Management, pp. 433–442, 2021. Palash Goyal, Sujit Rokka Chhetri, and Arquimedes Canedo. dyngraph2vec: Capturing network dynamics using dynamic graph representation learning. arXiv preprint arXiv:1809.02657, 2018. Ehsan Hajiramezanali, Arman Hasanzadeh, Krishna Narayanan, Nick Duffield, Mingyuan Zhou, and Xiaoning Qian. Variational graph recurrent neural networks. Advances in neural information processing systems, 32, 2019. Seyed Mehran Kazemi, Rishab Goel, Kshitij Jain, Ivan Kobyzev, Akshay Sethi, Peter Forsyth, and Pascal Poupart. Representation learning for dynamic graphs: A survey. J. Mach. Learn. Res., 21 (70):1–73, 2020. Thomas N Kipf and Max Welling. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308, 2016. Srijan Kumar, Xikun Zhang, and Jure Leskovec. Predicting dynamic embedding trajectory in temporal interaction networks. In Proceedings of the 25th ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2019. Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, and Tom Goldstein. Visualizing the loss landscape of neural nets. In Neural Information Processing Systems, 2018a. Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In Thirty-Second AAAI conference on artificial intelligence, 2018b. 10 Published as a conference paper at ICLR 2023 Yuhong Luo and Pan Li. Neighborhood-aware scalable temporal network representation learning. arXiv preprint arXiv:2209.01084, 2022. Aldo Pareja, Giacomo Domeniconi, Jie Chen, Tengfei Ma, Toyotaro Suzumura, Hiroki Kanezashi, Tim Kaler, Tao Schardl, and Charles Leiserson. Evolvegcn: Evolving graph convolutional networks for dynamic graphs. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 5363–5370, 2020. Emanuele Rossi, Ben Chamberlain, Fabrizio Frasca, Davide Eynard, Federico Monti, and Michael Bronstein. Temporal graph networks for deep learning on dynamic graphs. In ICML 2020 Workshop on Graph Representation Learning, 2020. Aravind Sankar, Yanhong Wu, Liang Gou, Wei Zhang, and Hao Yang. Dysat: Deep neural rep- resentation learning on dynamic graphs via self-attention networks. In Proceedings of the 13th International Conference on Web Search and Data Mining, pp. 519–527, 2020. Amauri H Souza, Diego Mesquita, Samuel Kaski, and Vikas Garg. Provably expressive temporal graph networks. arXiv preprint arXiv:2209.15059, 2022. Sheng Tian, Ruofan Wu, Leilei Shi, Liang Zhu, and Tao Xiong. Self-supervised representation learning on dynamic graphs. CIKM '21, 2021. doi: 10.1145/3459637.3482389. Ilya O Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Un- terthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, et al. Mlp-mixer: An all-mlp architecture for vision. Advances in Neural Information Processing Systems, 34: 24261–24272, 2021. Rakshit Trivedi, Mehrdad Farajtabar, Prasenjeet Biswal, and Hongyuan Zha. Dyrep: Learning representations over dynamic graphs. In International conference on learning representations, 2019. Petar Veliˇckovi ́c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio. Graph attention networks. In International Conference on Learning Representations, 2018. Lu Wang, Xiaofu Chang, Shuang Li, Yunfei Chu, Hui Li, Wei Zhang, Xiaofeng He, Le Song, Jingren Zhou, and Hongxia Yang. Tcl: Transformer-based dynamic graph modelling via contrastive learning. arXiv preprint arXiv:2105.07944, 2021a. Minjie Wang, Da Zheng, Zihao Ye, Quan Gan, Mufei Li, Xiang Song, Jinjing Zhou, Chao Ma, Lingfan Yu, Yu Gai, Tianjun Xiao, Tong He, George Karypis, Jinyang Li, and Zheng Zhang. Deep graph library: A graph-centric, highly-performant package for graph neural networks. arXiv preprint arXiv:1909.01315, 2019. Xuhong Wang, Ding Lyu, Mengjian Li, Yang Xia, Qi Yang, Xinwen Wang, Xinguang Wang, Ping Cui, Yupu Yang, Bowen Sun, et al. Apan: Asynchronous propagation attention network for real-time temporal graph embedding. In Proceedings of the 2021 International Conference on Management of Data, pp. 2628–2638, 2021b. Yanbang Wang, Yen-Yu Chang, Yunyu Liu, Jure Leskovec, and Pan Li. Inductive representation In International Conference on learning in temporal networks via causal anonymous walks. Learning Representations, 2020. Yiwei Wang, Yujun Cai, Yuxuan Liang, Henghui Ding, Changhu Wang, Siddharth Bhatia, and Bryan Hooi. Adaptive data augmentation on temporal graphs. Advances in Neural Information Processing Systems, 34:1440–1452, 2021c. Yiwei Wang, Yujun Cai, Yuxuan Liang, Henghui Ding, Changhu Wang, and Bryan Hooi. Time-aware neighbor sampling for temporal graph networks. arXiv preprint arXiv:2112.09845, 2021d. Da Xu, Chuanwei Ruan, Evren Korpeoglu, Sushant Kumar, and Kannan Achan. Inductive representa- tion learning on temporal graphs. arXiv preprint arXiv:2002.07962, 2020. 11 Published as a conference paper at ICLR 2023 Bing Yu, Haoteng Yin, and Zhanxing Zhu. Spatio-temporal graph convolutional networks: A deep learning framework for traffic forecasting. In IJCAI, 2018. Hongkuan Zhou, Da Zheng, Israt Nisa, Vasileios Ioannidis, Xiang Song, and George Karypis. Tgl: A general framework for temporal gnn training on billion-scale graphs. arXiv preprint arXiv:2203.14883, 2022. Jie Zhou, Ganqu Cui, Shengding Hu, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. Graph neural networks: A review of methods and applications. AI Open, 1:57–81, 2020. 12 Published as a conference paper at ICLR 2023 A EXPERIMENT SETUP DETAILS A.1 HARDWARE SPECIFICATION AND ENVIRONMENT We run our experiments on a single machine with Intel i9-10850K, Nvidia RTX 3090 GPU, and 64GB RAM memory. The code is written in Python 3.8 and we use PyTorch 1.12.1 on CUDA 11.6 to train the model on the GPU. Implementation details could be found at https://github.com/CongWeilin/GraphMixer. A.2 DETAILS ON DATASET The dataset used in this paper could be automatically downloaded by this script. Reddit dataset4 consists of one month of posts made by users on subreddits. The link feature is extracted by converting the text of each post into a feature vector. Wikipedia dataset5 consists of one month of edits made by edits on Wikipedia pages. The link feature is extracted by converting the edit test into an LIWC- feature vector. LastFM dataset6: consists of one month of who listens-to-which song information. MOOC dataset7 consists of actions done by students on a MOOC online course. GDELT dataset8 is a temporal knowledge graph dataset originated from the Event Database which records events happening in the world from news and articles. (tmax − Reddit Wiki MOOC LastFM GDELT GDELT-ne GDELT-n |E| |V| 672,447 10,984 157,474 9,227 7,144 411,749 1,980 1,293,103 8,831 1,912,909 8,831 1,912,909 8,831 1,912,909 i tmin)/ Table 5: Dataset statistic. ) dim(xlink dim(xnode ij ) Node features Link features Timestamps 172 0 172 0 0 0 0 0 186 413 0 0 186 0 |E| 4 17 3.6 106 0.1 0.1 0.1 Yes Yes Yes Yes Yes Yes Yes No No No No Yes No No Yes Yes No No Yes No Yes A.3 MODEL CONFIGURATIONS, TRAINING AND EVALUATION PROCESS Baseline implementations. The implementation on JODIE, DySAT, TGAT, TGN, and APPN follows the temporal graph learning framework Zhou et al. (2022)9. Compared to the original baselines' implementation, this framework's implementation could achieve a better overall score than its original implementation. The implementation of CAWs-mean and CAWs-attn follows their official implementation10, we choose the number of random walk steps from 8, 16, 32 to balance the training time. The implementation of TGSRec follows their official implementation11. The implementation of DDGCL follows their official implementation12. We directly test using their official implementation by changing our data structure to their required structure and using their default hyper-parameters. GraphMixer implementation. We implement GraphMixer under the TGL framework Zhou et al. 6, batch (2022) and use their default hyper-parameters (e.g., learning rate 0.0001, weight decay 10− size 600, hidden dimension 100, etc) to achieve a fair comparison. In GraphMixer, there are only two hyper-parameters as introduced in Section 3: The number of 1-hop most recent neighbors K and the time-slot size T . In practice, hyper-parameter T is set the time-gap of the last 2, 000 interactions, which is fixed for all datasets; hyper-parameter K = 10 for Reddit and LastFM, K = 20 for MOOC, and K = 30 for GDELT and Wiki. 4Download from http://snap.stanford.edu/jodie/reddit.csv 5Download from http://snap.stanford.edu/jodie/wikipedia.csv 6Download from http://snap.stanford.edu/jodie/lastfm.csv 7Download from http://snap.stanford.edu/jodie/mooc.csv 8Download from https://github.com/amazon-research/tgl/blob/main/down.sh 9The TGL framework can be found at https://github.com/amazon-research/tgl 10CAW's official implementation can be found at https://github.com/snap-stanford/CAW 11TGSRec's official implementation can be found at https://github.com/DyGRec/TGSRec 12DDGCL's official implementation can be found at https://github.com/ckldan520/DDGCL 13 Published as a conference paper at ICLR 2023 Training and evaluation. A unified training and evaluation process (e.g., mini-batch and data preparation) is used for GraphMixer and baselines. Specifically, each mini-batch is constructed by first sampling a set of positive node pairs and an equal amount of negative node pairs. Then, an algorithm-dependent node sampler is used to sample the neighboring of each mini-batch node and computed their node representation based on the sampled neighborhood. Finally, we concatenate each node pair and use the link prediction classifier (introduced in Section 3.1) for binary classification. We conduct experiments under the transduction learning setting and use average precision for evaluation. B MORE DISCUSSION ON EXISTING TEMPORAL GRAPH METHODS B.1 RECENT METHODS THAT WE DO NOT COMPARE WITH There are other temporal graph learning algorithms that are related to the temporal link prediction task but we did not compare GraphMixer with them because (1) the official implementation of some of the above works are not released by the authors and we could not reproduce their results as reported in the paper, and (2) we already compare many recent baselines that we believe it is enough to verify the success of GraphMixer. For example, MeTA Wang et al. (2021c) proposes data augmentation to overcome the over-fitting issue in temporal graph learning. More specifically, they generate a few graphs with different data augmentation magnitudes and perform the message passing between these graphs to provide adaptively augmented inputs for every prediction. TCL Wang et al. (2021a) proposes to use a transformer to separately extract the temporal neighborhoods representations associated with the two interaction nodes and then utilizes a co-attentional transformer to model inter-dependencies at a semantic level. To boost model performance, contrastive learning is used to maximize mutual information between the predictive representations of two future interaction nodes. TNS Wang et al. (2021d) proposes a temporal-aware neighbor sampling strategy that can provide an adaptive receptive neighborhood for every node at any time. LSTSR Chi et al. (2022) propose Long Short-Term Preference Modeling for Continuous-Time Sequential Recommendation to capture the evolution of short-term preference under dynamic graph. DyRep Trivedi et al. (2019) uses RNNs to propagate messages in interactions to update node representations. DynAERNN Goyal et al. (2018) uses a fully connected layer to first encode the network representation, then pass the encoded features to the RNN, and use the fully connected network to decode the future network structure. VRGNN Hajiramezanali et al. (2019) generalizes variational GAE Kipf & Welling (2016) to temporal graphs, which makes priors dependent on historical dynamics and captures these dynamics using RNN. EvolveGCN Pareja et al. (2020) uses RNN to estimate GCN parameters for future snapshots. DDGCL Tian et al. (2021) is a SAM-based method that propose a debiased GAN-type contrastive loss as the learning objective to correct the sampling bias that occurred in the negative sample construction process of temporal graph learning. NAT Luo & Li (2022) maintain two sets of representations for each node, i.e., node representations and link representations. For each node, NAT not only preserve a node representation, but also keep node pair representations for a subset of neighbors of the node. PINT Souza et al. (2022) studies the expressive power of temporal graph networks using 1-WL test and proposes temporal encoding to boost the expressive power. B.2 WHY EXISTING METHODS ARE CONCEPTUALLY AND TECHNICALLY COMPLICATED? Please notice that we are not claiming conceptually and technically complicated is bad. Instead, we are simply suggesting that the conceptually and technically complicated simpler methods might be more preferred than the complicated one if they could achieve similar performance. • We say a method is conceptually complicated if the underlying idea behind the method is non-trivial. For example, CAWs represents network dynamics by "motifs extracted using temporal random walks", represents node identity by "hitting counts of the nodes based on a set of sampled walks"; TGSRec takes "temporal collaborative signals" into consideration. These concepts are non-trivial to understand in the first place and could potentially require much domain knowledge from other fields to understand the behavior of the method. • We say a method is technically complicated if the method is non-trivial to implement due to many hyper-parameters and many details that need to be taken care of, which could potentially make the application to a real-world scenario challenge. For example, JODIE and TGN require maintaining 14 Published as a conference paper at ICLR 2023 a "memory" for each node by using RNN, and this "memory" needs to be reset every time after evaluation because then it might carry information about the evaluation data. CAWs extracts features by using multiple temporal random walks, which makes implementing and hyper-parameter fine- tuning more challenging. MeTA and TCL consider many data augmentation strategies, each of which is not trivial to implement and could affect the model's performance in different ways. C MORE EXPERIMENT RESULTS C.1 COMPARISON ON CONVERGENCE SPEED AND GENERALIZATION We include the missing figures of Section 4. Results on other datasets and the discussion on the experiment results could be found next to Figure 3. Figure 8: Comparison of the link prediction training average precision and generalization gap for the first 100 training epochs. Results on other datasets can be found in Figure 3. C.2 TRANSDUCTIVE LEARNING WITH RECALL@K AND MRR AS EVALUATION METRIC Recall@K and MRR (mean reciprocal rank) are popular evaluation metrics used in the real-world recommendation system. The larger the numbers, the better the model performance. Our Recall@K and MRR is implemented based on the Open Graph Benchmark's link prediction evaluation metrics' implementation13. More specifically, we first sample 100 negative destination nodes for the source node of each temporal link node pair, then our goal is to rank the positive temporal link node pairs higher than 100 negative destination nodes. In the following, we compare the Recall@5 and MRR score of GraphMixer with the selected four most representative baselines. Please notice that since these methods are implemented under the same framework, the model performance is evaluated by using the same model used in Table 1, the comparison is guaranteed to be fair. Table 6: Comparison on the Recall@K and MRR. Reddit Wiki MOOC LastFM GDELT R@5 0.9181 0.9189 0.9774 0.9787 1.0 MRR 0.6271 0.7774 0.8709 0.9093 0.9965 R@5 0.9098 0.8889 0.8508 0.8878 0.9972 MRR 0.7752 0.7561 0.6132 0.8016 0.9876 R@5 0.9818 0.9989 0.9736 0.9904 0.9999 MRR 0.7551 0.7906 0.7425 0.9904 0.9910 R@5 0.2034 0.4159 0.1040 0.1649 0.9998 MRR 0.1206 0.3322 0.0769 0.1153 0.9649 R@5 0.8554 0.8302 0.3513 0.9297 0.9930 MRR 0.6048 0.4236 0.2366 0.7295 0.8934 JODIE DySAT TGAT TGN GraphMixer We have the following observations on Table 1: • According to the results in Table 6, GraphMixer could achieve outstanding performance across all datasets. Especially on the LastFM and GDELT datasets (denser graphs than other datasets). This might implies GraphMixer is more suitable for denser graphs than other baseline methods. • The results of some baseline methods behave less better with Recall@K and MRR evaluation metrics. For example, TGN on LastFM dataset, TGAT on LastFM and GDELT, etc. The above results also imply the limitation of only considering average precision and AUC score for temporal link evaluation. 13https://github.com/snap-stanford/ogb/blob/master/ogb/linkproppred/ evaluate.py 15 Published as a conference paper at ICLR 2023 C.3 COMPARISON ON WALL-CLOCK TIME In the following, we compare the wall-clock time it takes for GraphMixer and baselines to finish a single epoch of training. Table 7: Comparison on the wall-clock computation time for single-epoch of training. GDELT 16 sec 83 sec 41 sec 32 sec 4, 544 sec 4, 634 sec 3, 707 sec 25 sec 32 sec JODIE DySAT TGAT TGN CAWs-mean CAWs-attn TGSRec APAN GraphMixer Reddit 5 sec 33 sec 15 sec 8 sec 1, 893 sec 1, 930 sec 538 sec 13 sec 12 sec LastFM 11 sec 41 sec 28 sec 15 sec 1, 797 sec 1, 832 sec 1, 810 sec 28 sec 21 sec MOOC 4 sec 16 sec 8 sec 5 sec 641 sec 653 sec 656 sec 9 sec 7 sec Wiki 2 sec 6 sec 4 sec 2 sec 277 sec 282 sec 157 sec 4 sec 3 sec When comparing the computation time of GraphMixer with CAWs, TGSRec, and DDGCL, we found that GraphMixer takes significantly lesser time than these baselines, which indicates the effectiveness of GraphMixer. When comparing the computation time of GraphMixer with JODIE, DySAT, TGAT, APAN, and TGN, we found that GraphMixer is very close to or even slightly faster than some baseline methods. Our computation time is slightly slower than other baseline methods (e.g., JODIE and TGN) mainly because these baselines are using well-optimized computation functions from DGL Wang et al. (2019), while GraphMixer is just using a composition of basic PyTorch functions. In fact, according to the Table 8, GraphMixer has a similar/smaller amount of parameters with these baselines. Table 8: Comparison on the number of model parameters. # Parameters ( × 105) GraphMixer GraphMixer-T GraphMixer-S 1.42 2.07 2.25 Jodie DySAT TGAT TGN 3.54 1.21 9.38 3.80 Besides, our current implementation also need to preprocess the input data for each epoch of training, e.g., sorting nodes in subgraph according to temporal order and removing duplicated edges. For example, the data preparation at each epoch takes 41 sec on Reddit, 9 sec on Wiki, 20 sec on MOOC, 48 sec on LastFM, and 71 sec on GDELT. However, by caching the pre-processed data in the memory, we only need to pre-process the input data at the first epoch of the training process because our neighbor selection is deterministic and the input data does not change at each epoch. C.4 TRANSDUCTIVE LEARNING WITH AUC AS EVALUATION METRIC AUC (Under the ROC Curve) is one of the most widely accepted evaluation metric for link prediction, which has been used in many existing works Xu et al. (2020); Rossi et al. (2020). In the following, we compare the AUC score of GraphMixer with baselines. We have the following observations: 1 GraphMixer outperforms all baselines on all datasets. In particular, GraphMixer attains more than 1% gain over all baselines on the LastFM, GDELT-ne, and GDELT-e datasets, attains around 2% gain over non-RNN methods DySAT and TGAT on the Wiki dataset, and attains around 11% gain over non-RNN methods DySAT and TGAT on the GDELT-ne dataset. The experiment results provide sufficient support on our argument that neither RNN nor SAM is necessary for temporal graph link prediction. 2 According to the performance of GraphMixer-L on datasets only have link timestamp information (MOOC, LastFM, and GDELT-ne), we know that our time-encoding function could successfully pre-process each timestamp into a meaningful vector. 3 By comparing the performance GraphMixer-N and GraphMixer on Wiki, MOOC, and LastFM datasets, we know that node-info encoder alone is not enough to achieve a good performance. However, it provides useful information that could benefit the link-info encoder. 4 By comparing the performance of GraphMixer-N on GDELT and GDELT-ne, we observe that using one-hot encoding outperforms using node features. This also shows the importance of node identity information because one-hot encoding only captures such information. C.5 BASELINES WITH UNDIRECTED TEMPORAL GRAPH GraphMixer utilizes undirected temporal graph to capture whether two nodes are frequently connected in the last few timestamps. In the following, we test whether using undirected temporal graph could 16 Published as a conference paper at ICLR 2023 Table 9: Comparison on the AUC score for link prediction. GraphMixer uses one-hot node encoding for datasets without node features (marked by (cid:92)). For each dataset we indicate whether we have the corresponding feature ("L" link features, "N" node features, and "T" link timestamps). GDELT-ne T GDELT-e N, T GDELT L, N, T LastFM T MOOC T Reddit L, T Wiki L, T JODIE 99.30 DySAT 98.52 TGAT 99.66 TGN 99.80 CAWs-mean 98.18 CAWs-attn 98.30 TGSRec 94.74 APAN 99.24 GraphMixer-L 99.84 GraphMixer-N 99.53 GraphMixer 99.94 98.81 0.01 96.71 0.01 97.75 0.01 99.55 0.01 97.25 0.01 97.89 0.01 91.32 0.20 97.25 0.01 0.01 99.70 0.01(cid:92) 91.49 0.01(cid:92) 99.82 0.01 99.16 0.02 98.82 0.02 98.43 0.01 99.62 0.03 63.88 0.02 63.95 0.19 80.70 0.01 98.58 0.01 99.87 0.01(cid:92) 98.66 0.01(cid:92) 99.93 0.01 67.51 0.01 76.40 0.01 54.77 0.01 82.23 0.92 72.92 0.81 72.93 2.31 76.66 0.01 62.73 0.01 97.04 0.02(cid:92) 71.51 0.01(cid:92) 97.38 1.99 98.55 0.81 98.52 1.02 98.25 0.50 98.15 0.33 95.19 0.54 95.13 1.54 96.72 0.64 96.46 0.02 98.99 0.03(cid:92) 94.44 0.02(cid:92) 98.89 ± ± ± ± ± ± ± ± ± ± ± 0.01 97.13 0.01 82.47 0.01 84.30 0.01 97.13 0.09 71.82 0.11 71.82 0.42 96.72 0.11 98.39 0.02 96.54 0.02 96.00 0.02 98.50 0.02 96.96 0.04 97.25 0.03 96.96 0.02 96.04 0.08 91.40 0.08 91.64 0.42 96.72 0.17 97.85 0.02 98.99 0.02(cid:92) 98.81 0.02(cid:92) 98.48 0.02 0.02 0.02 0.02 0.19 0.24 0.42 0.19 0.02 0.02(cid:92) 0.02(cid:92) ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± ± improve the performance of baseline methods. As we can see from Table 10, using undirected temporal graph cannot improve the performance of baseline methods much because such information are already implicitly captured via their neural architecture design or sampling methods. Table 10: Comparison on baselines with undirected temporal graph (Average precision | AUC score). Reddit Wiki MOOC LastFM JODIE 99.24 DySAT 98.53 TGAT 99.70 TGN 99.84 99.40 98.42 99.73 99.87 | | | | 98.91 96.61 97.35 99.59 99.07 96.88 97.68 99.61 | | | | 99.18 98.80 98.41 99.44 99.53 99.26 98.85 99.66 | | | | 73.25 76.23 54.58 91.96 80.24 73.90 57.03 93.20 | | | | D DISCUSSION ABOUT MODEL PERFORMANCE ON LASTFM Our results show that GraphMixer could outperform baselines on LastFM dataset with a large margin, which is due to a composite effect of multiple factors. In the following, we summarize several potential factors that lead to our observation on the model performance. • Larger average time-gap. LastFM has a larger average time-gap (tmax − than other datasets. As shown in the dataset statistic (Table 5), LastFM has an average time gap of 106, which is significantly larger than other datasets. For example, Reddit's average time gap is 4, Wiki's average time gap is 17, MOOC's average time gap is 3.6, and GDELT's average time gap is 0.1. Since baseline methods are relying on RNN and SAM to process the historical temporal information, they implicitly assumes the temporal information is "smooth" and with smaller average time gap. Therefore, baseline methods could potentially work better on the dataset with a smaller average time gap but are less ideal on LastFM. GraphMixer is not relying on RNN or SAM, therefore could be less affected by the aforementioned issue. tmin)/ |E| / |E| • Larger average node degree. LastFM has a larger average node degree than other datasets, which potentially prone to over-smoothing (aggregating features from many neighbors make output representation less distinguishable Li et al. (2018b)), over-squashing (aggregating much information into a limited memory might compress too much useful information Alon & Yahav (2020)) and over-fitting Cong et al. (2021a) effect. For example, according to the dataset statistic in Table 5, LastFM has an average node degree of 653, which is larger than the Reddit's average node degree 61, Wiki's average node degree 17, MOOC's average node degree 57, and GDELT's average node degree 216. Existing methods either use the memory cell in RNN to store temporal information or use SAM to aggregate temporal information from multi-hops, which could be less ideal on a dense graph due to over-smoothing and over-squashing. However, GraphMixer is less relying on the aggregation schema, therefore its performance is better than the baseline methods. |V| • Larger maximum timestamp. GraphMixer is using fixed time encoder but baselines are using trainable time-encoders. Since the largest timestamp tmax in LastFM is larger than other datasets, the trainable time-encoder is more affected by the unbounded gradient issue as discussed in Table 2 and Section 4.2. For example, the tmax in LastFM is 137 millon, while tmax in GDELT 0.2 millon, tmax in Reddit 2.6 millon, tmax in Wiki 2.6 millon, and tmax in MOOC 2.6 millon. 17 Published as a conference paper at ICLR 2023 E MISSING FIGURES ON LOSS LANDSCAPE E.1 LOSS LANDSCAPE ON WIKI (a) TGN (b) TGAT (c) DySAT (d) JODIE (e) GraphMixer Figure 9: Comparison on the training loss landscape (Contour) on Wiki Dataset. (a) TGN (b) TGAT (c) DySAT (d) JODIE (e) GraphMixer Figure 10: Comparison on the training loss landscape (Surface) on Wiki Dataset. 18 1.51.00.50.00.51.01.00.50.00.51.01.5Train loss 2d contours1.01.51.52.02.02.52.52.53.03.03.51.51.00.50.00.51.01.00.50.00.51.01.5Train loss 2d contours0.51.01.52.02.52.53.03.03.03.53.54.04.55.05.55.56.06.06.57.07.58.08.59.01.51.00.50.00.51.01.00.50.00.51.01.5Train loss 2d contours1.51.52.01.51.00.50.00.51.01.00.50.00.51.01.5Train loss 2d contours1.01.51.52.02.02.53.03.03.53.54.04.04.55.05.56.01.51.00.50.00.51.01.00.50.00.51.01.5Train loss 2d contours0.51.01.52.02.02.02.52.53.03.03.53.54.04.04.55.01.51.00.50.00.51.01.00.50.00.51.01.5123Train loss 3d surface1.01.52.02.53.03.51.51.00.50.00.51.01.00.50.00.51.01.52468Train loss 3d surface24681.51.00.50.00.51.01.00.50.00.51.01.51.251.501.752.002.252.50Train loss 3d surface1.61.82.02.22.41.51.00.50.00.51.01.00.50.00.51.01.5246Train loss 3d surface1234561.51.00.50.00.51.01.00.50.00.51.01.512345Train loss 3d surface12345 Published as a conference paper at ICLR 2023 E.2 LOSS LANDSCAPE ON REDDIT (a) TGN (b) TGAT (c) DySAT (d) JODIE (e) GraphMixer Figure 11: Comparison on the training loss landscape (Contour) on Reddit Dataset. (a) TGN (b) TGAT (c) DySAT (d) JODIE (e) GraphMixer Figure 12: Comparison on the training loss landscape (Surface) on Reddit Dataset. 19 1.51.00.50.00.51.01.51.51.00.50.00.51.0Train loss 2d contours0.51.01.52.02.52.53.03.03.03.53.53.53.54.04.04.54.54.55.05.05.55.56.06.51.51.00.50.00.51.01.51.51.00.50.00.51.0Train loss 2d contours0.51.01.52.02.53.03.54.04.04.54.55.05.05.05.55.55.56.06.06.06.56.56.57.07.07.57.58.08.59.01.51.00.50.00.51.01.51.51.00.50.00.51.0Train loss 2d contours1.52.02.02.02.51.51.00.50.00.51.01.51.51.00.50.00.51.0Train loss 2d contours0.51.01.52.02.53.03.53.54.04.04.04.54.54.54.54.55.05.05.05.05.05.55.56.06.06.56.57.07.07.58.01.51.00.50.00.51.01.51.51.00.50.00.51.0Train loss 2d contours0.51.01.52.02.53.03.54.04.55.05.05.55.56.06.06.56.57.07.07.57.57.58.08.08.08.58.58.59.09.09.09.59.59.51011.51.00.50.00.51.0246Train loss 3d surface2461011.51.00.50.00.51.0246810Train loss 3d surface24681011.51.00.50.00.51.01.01.52.02.5Train loss 3d surface1.52.02.51011.51.00.50.00.51.02468Train loss 3d surface24681011.51.00.50.00.51.051015Train loss 3d surface51015 Published as a conference paper at ICLR 2023 E.3 LOSS LANDSCAPE ON MOOC (a) TGN (b) TGAT (c) DySAT (d) JODIE (e) GraphMixer Figure 13: Comparison on the training loss landscape (Contour) on MOOC Dataset. (a) TGN (b) TGAT (c) DySAT (d) JODIE (e) GraphMixer Figure 14: Comparison on the training loss landscape (Surface) on MOOC Dataset. 20 1.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours0.50.51.01.01.51.51.51.52.02.02.02.52.51.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours0.51.01.52.02.02.52.52.53.03.54.04.55.05.01.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours0.50.51.01.51.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours0.50.50.50.50.50.50.50.51.01.01.01.01.01.01.51.51.51.51.52.02.02.02.02.02.52.53.03.03.53.54.04.55.01.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours0.51.01.52.02.53.03.03.53.54.04.04.54.55.05.05.55.56.06.06.56.57.07.07.58.08.58.59.09.09.59.51.51.00.50.00.51.01.51.00.50.00.51.00.51.01.52.02.5Train loss 3d surface0.51.01.52.02.51.51.00.50.00.51.01.51.00.50.00.51.012345Train loss 3d surface123451.51.00.50.00.51.01.51.00.50.00.51.00.51.01.5Train loss 3d surface0.250.500.751.001.251.501.51.00.50.00.51.01.51.00.50.00.51.0123456Train loss 3d surface123451.51.00.50.00.51.01.51.00.50.00.51.02.55.07.510.012.5Train loss 3d surface2.55.07.510.012.5 Published as a conference paper at ICLR 2023 E.4 LOSS LANDSCAPE ON LASTFM (a) TGN (b) TGAT (c) DySAT (d) JODIE (e) GraphMixer Figure 15: Comparison on the training loss landscape (Contour) on LastFM Dataset. (a) TGN (b) TGAT (c) DySAT (d) JODIE (e) GraphMixer Figure 16: Comparison on the training loss landscape (Surface) on LastFM Dataset. 21 1.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours2.02.02.02.51.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours1.52.02.52.52.53.03.53.54.04.04.54.55.05.05.55.51.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours1.51.51.52.02.02.52.53.01.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours1.52.02.53.03.03.03.03.03.53.53.53.54.04.04.54.54.54.55.05.05.05.55.55.55.56.06.06.56.57.07.07.07.57.57.58.08.08.08.59.01.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours0.51.01.52.02.53.03.54.04.55.05.56.06.57.07.07.57.58.08.08.58.59.09.09.59.51.51.00.50.00.51.01.51.00.50.00.51.01.61.82.02.22.42.6Train loss 3d surface1.82.02.22.41.51.00.50.00.51.01.51.00.50.00.51.023456Train loss 3d surface234561.51.00.50.00.51.01.51.00.50.00.51.02345Train loss 3d surface1.52.02.53.01.51.00.50.00.51.01.51.00.50.00.51.024681012Train loss 3d surface24681.51.00.50.00.51.01.51.00.50.00.51.01020304050Train loss 3d surface10203040 Published as a conference paper at ICLR 2023 E.5 LOSS LANDSCAPE ON GDELT-NE (a) TGN (b) TGAT (c) DySAT Figure 17: Comparison on the training loss landscape (Contour) on GDELT-ne Dataset. (d) JODIE (e) GraphMixer (a) TGN (b) TGAT (c) DySAT (d) JODIE (e) GraphMixer Figure 18: Comparison on the training loss landscape (Surface) on GDELT-ne Dataset. 22 1.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours1.01.01.01.51.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours1.01.51.51.51.52.02.02.53.03.54.04.51.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours1.01.01.01.51.51.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours1.01.01.51.52.02.02.52.52.53.03.03.03.53.53.53.54.04.04.04.54.51.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours0.51.01.52.02.02.52.53.03.54.04.04.04.54.54.55.05.05.05.55.55.56.06.06.06.56.56.57.07.07.07.57.58.08.08.58.59.09.09.59.51.00.50.00.51.01.00.50.00.51.01.01.52.0Train loss 3d surface0.751.001.251.501.751.00.50.00.51.01.00.50.00.51.01234Train loss 3d surface12341.00.50.00.51.01.00.50.00.51.00.751.001.251.501.752.00Train loss 3d surface0.751.001.251.501.751.00.50.00.51.01.00.50.00.51.012345Train loss 3d surface12341.00.50.00.51.01.00.50.00.51.051015Train loss 3d surface51015 Published as a conference paper at ICLR 2023 E.6 LOSS LANDSCAPE ON GDELT-E (a) TGN (b) TGAT (c) DySAT Figure 19: Comparison on the training loss landscape (Contour) on GDELT-e Dataset. (d) JODIE (e) GraphMixer (a) TGN (b) TGAT (c) DySAT (d) JODIE (e) GraphMixer Figure 20: Comparison on the training loss landscape (Surface) on GDELT-e Dataset. 23 1.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours1.01.01.01.51.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours0.51.01.52.02.02.02.02.02.52.52.52.51.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours0.51.01.51.51.51.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours1.01.01.01.51.51.51.51.52.02.02.52.53.01.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours0.51.01.51.52.02.02.52.53.03.03.53.54.04.04.55.05.56.01.00.50.00.51.01.00.50.00.51.01.01.52.02.5Train loss 3d surface0.60.81.01.21.41.00.50.00.51.01.00.50.00.51.00.51.01.52.02.5Train loss 3d surface0.51.01.52.02.51.00.50.00.51.01.00.50.00.51.00.51.01.52.0Train loss 3d surface0.51.01.52.01.00.50.00.51.01.00.50.00.51.01234Train loss 3d surface1231.00.50.00.51.01.00.50.00.51.0246Train loss 3d surface246 Published as a conference paper at ICLR 2023 F MISSING FIGURES ON LOSS LANDSCAPE WITH OUR TIME-ENCODING FUNCTION F.1 TGAT WITH FIXED TIME-ENCODING FUNCTION (a) Reddit (b) Wiki (c) MOOC (d) LastFM (e) GDELT-e Figure 21: Training loss landscape (Contour) of TGAT with fixed time-encoding function. (a) Reddit (b) Wiki (c) MOOC (d) LastFM (e) GDELT-e Figure 22: Training loss landscape (Surface) of TGAT with fixed time-encoding function. 24 1.51.00.50.00.51.01.51.51.00.50.00.51.0Train loss 2d contours0.51.01.52.02.53.03.54.04.54.54.55.05.05.05.55.55.56.06.06.06.56.56.57.07.07.07.57.51.51.00.50.00.51.01.00.50.00.51.01.5Train loss 2d contours0.51.01.52.02.52.52.53.03.03.53.54.04.04.55.05.56.06.57.01.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours0.51.01.51.52.02.02.53.03.54.04.55.05.56.06.57.01.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours1.01.52.02.53.03.54.04.55.05.56.06.57.07.58.08.59.09.51.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours0.51.01.01.51.51.52.02.02.52.53.03.54.04.55.05.51011.51.00.50.00.51.02468Train loss 3d surface24681.51.00.50.00.51.01.00.50.00.51.01.52468Train loss 3d surface2461.51.00.50.00.51.01.51.00.50.00.51.0246Train loss 3d surface2461.51.00.50.00.51.01.51.00.50.00.51.024681012Train loss 3d surface246810121.00.50.00.51.01.00.50.00.51.012345Train loss 3d surface12345 Published as a conference paper at ICLR 2023 F.2 TGN WITH FIXED TIME-ENCODING FUNCTION (a) Reddit (b) Wiki (c) MOOC (d) LastFM (e) GDELT-e Figure 23: Training loss landscape (Contour) of TGN with fixed time-encoding function. (a) Reddit (b) Wiki (c) MOOC (d) LastFM (e) GDELT-e Figure 24: Training loss landscape (Surface) of TGN with fixed time-encoding function. 25 1.51.00.50.00.51.01.51.51.00.50.00.51.0Train loss 2d contours0.51.01.52.02.02.52.53.03.03.03.53.53.54.04.04.04.54.54.54.55.05.05.55.56.06.06.56.57.07.58.08.59.01.51.00.50.00.51.01.00.50.00.51.01.5Train loss 2d contours1.01.52.02.53.03.03.53.54.04.55.05.51.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours0.50.51.01.01.01.01.52.02.53.01.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours1.52.02.02.53.01.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours1.01011.51.00.50.00.51.02468Train loss 3d surface24681.51.00.50.00.51.01.00.50.00.51.01.512345Train loss 3d surface123451.51.00.50.00.51.01.51.00.50.00.51.0123Train loss 3d surface1231.51.00.50.00.51.01.51.00.50.00.51.01.52.02.53.03.5Train loss 3d surface1.52.02.53.01.00.50.00.51.01.00.50.00.51.00.60.81.01.2Train loss 3d surface0.60.81.01.2 Published as a conference paper at ICLR 2023 F.3 JODIE WITH FIXED TIME-ENCODING FUNCTION (a) Reddit (b) Wiki (c) MOOC (d) LastFM (e) GDELT-e Figure 25: Training loss landscape (Contour) of JODIE with fixed time-encoding function. (a) Reddit (b) Wiki (c) MOOC (d) LastFM (e) GDELT-e Figure 26: Training loss landscape (Surface) of JODIE with fixed time-encoding function. 26 1.51.00.50.00.51.01.51.51.00.50.00.51.0Train loss 2d contours1.01.52.02.53.03.53.54.04.04.54.55.05.05.55.56.06.06.06.56.56.57.07.07.07.57.58.08.08.58.59.09.09.59.51.51.00.50.00.51.01.00.50.00.51.01.5Train loss 2d contours1.01.52.02.53.03.03.53.54.04.04.54.54.55.05.05.55.56.06.57.07.58.08.59.09.51.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours0.51.01.01.51.52.02.02.52.53.03.03.03.53.53.54.04.51.51.00.50.00.51.01.51.00.50.00.51.0Train loss 2d contours1.52.02.53.03.53.54.04.04.54.55.05.55.56.06.06.56.57.07.58.08.59.09.51.00.50.00.51.01.000.750.500.250.000.250.500.751.00Train loss 2d contours1.01.01.51.51.51.52.02.02.02.53.03.51011.51.00.50.00.51.051015Train loss 3d surface510151.51.00.50.00.51.01.00.50.00.51.01.551015Train loss 3d surface510151.51.00.50.00.51.01.51.00.50.00.51.012345Train loss 3d surface123451.51.00.50.00.51.01.51.00.50.00.51.051015Train loss 3d surface2.55.07.510.012.515.01.00.50.00.51.01.00.50.00.51.01234Train loss 3d surface123
http://arxiv.org/abs/2302.11634v1
2023-02-22T20:21:25
2023-02-22T20:21:25
Provably Efficient Reinforcement Learning via Surprise Bound
Value function approximation is important in modern reinforcement learning (RL) problems especially when the state space is (infinitely) large. Despite the importance and wide applicability of value function approximation, its theoretical understanding is still not as sophisticated as its empirical success, especially in the context of general function approximation. In this paper, we propose a provably efficient RL algorithm (both computationally and statistically) with general value function approximations. We show that if the value functions can be approximated by a function class that satisfies the Bellman-completeness assumption, our algorithm achieves an $\widetilde{O}(\text{poly}(\iota H)\sqrt{T})$ regret bound where $\iota$ is the product of the surprise bound and log-covering numbers, $H$ is the planning horizon, $K$ is the number of episodes and $T = HK$ is the total number of steps the agent interacts with the environment. Our algorithm achieves reasonable regret bounds when applied to both the linear setting and the sparse high-dimensional linear setting. Moreover, our algorithm only needs to solve $O(H\log K)$ empirical risk minimization (ERM) problems, which is far more efficient than previous algorithms that need to solve ERM problems for $\Omega(HK)$ times.
[ "Hanlin Zhu", "Ruosong Wang", "Jason D. Lee" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11634v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11634v1", "@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 2 2 ] G L . s c [ 1 v 4 3 6 1 1 . 2 0 3 2 : v i X r a Provably Efficient Reinforcement Learning via Surprise Bound Hanlin Zhu∗ Ruosong Wang† Jason D. Lee ‡ February 24, 2023 Abstract Value function approximation is important in modern reinforcement learning (RL) problems especially when the state space is (infinitely) large. Despite the importance and wide applicabil- ity of value function approximation, its theoretical understanding is still not as sophisticated as its empirical success, especially in the context of general function approximation. In this paper, we propose a provably efficient RL algorithm (both computationally and statistically) with gen- eral value function approximations. We show that if the value functions can be approximated by a function class which satisfies the Bellman-completeness assumption, our algorithm achieves O(poly(ιH)√T ) regret bound where ι is the product of the surprise bound and log-covering an numbers, H is the planning horizon, K is the number of episodes and T = HK is the total number of steps the agent interacts with the environment. Our algorithm achieves reasonable regret bounds when applied to both the linear setting and the sparse high-dimensional linear setting. Moreover, our algorithm only needs to solve O(H log K) empirical risk minimization (ERM) problems, which is far more efficient than previous algorithms that need to solve ERM problems for Ω(HK) times. F e 1 Introduction Modern Reinforcement Learning (RL) problems are often challenging due to the huge state spaces, and in practice, value function approximation schemes are usually employed to tackle this issue. Em- pirically, combining various reinforcement learning algorithms with function approximation schemes has led to tremendous success on various tasks (Mnih et al., 2013, 2015; Silver et al., 2017). How- ever, despite the great empirical success, our theoretical understanding of RL with function ap- proximation is still not as sophisticated as its empirical counterpart. Until recently, most existing theoretical work in RL has been focusing on the tabular setting or the linear setting (Azar et al., 2017; Jin et al., 2018; Yang and Wang, 2019; Wang et al., 2019; Du et al., 2019b,a; Agarwal et al., 2020; Wang et al., 2020a; Du et al., 2020; Jin et al., 2020; Zanette et al., 2020; Li et al., 2020), while in practice, complex function approximators like neural networks are usually employed. Over the years, understanding conditions on the function class that permit sample-efficient RL has evolved into an important open research problem in machine learning theory. Existing provably efficient RL algorithms that can handle general function approximation (Jiang et al., 2017; Sun et al., 2019; Ayoub et al., 2020; Jin et al., 2021; Du et al., 2021) usually require solving computationally intractable optimization problems and are therefore computationally inefficient. Recently, Wang et al. (2020b) proposed a provably efficient RL algorithm with general function ∗Department of Electrical Engineering and Computer Sciences, UC Berkeley. [email protected] †Paul G. Allen Science & Engineering, of Computer University School of Washington. [email protected] ‡Electrical and Computer Engineering, Princeton University. [email protected] 1 approximation for function classes with bounded eluder dimensions. The algorithm by Wang et al. (2020b) is based on Least Squares Value Iteration (LSVI) and the principle of "optimism in the face of uncertainty". There are two shortcomings in the work of Wang et al. (2020b). First, in order to cal- culate the exploration bonus, their algorithm applies sensitivity sampling (Langberg and Schulman, 2010; Feldman and Langberg, 2011; Feldman et al., 2013) to reduce the size of the replay buffer. Using a replay buffer with bounded complexity to calculate the exploration bonus is crucial for the correctness of their algorithm. On the other hand, such a step is complicated in nature and could be hard to implement in practice. Therefore, to make the algorithm practical, it is much more desirable to use simpler dimensionality reduction techniques (like uniform sampling) without sac- rificing the theoretical guarantee. Second, as mentioned in Foster et al. (2018), showing examples with a small eluder dimension beyond linearly parameterized functions is challenging. In addition, taking the worst-case over all histories, as in the definition of the eluder dimension, is usually overly pessimistic in practice. In contextual bandits, it is known that provable efficiency can be established by assuming distributional conditions on the problem. For example, Foster et al. (2018) establishes regret bound for an optimism-based contextual bandits algorithm by assuming bounded surprise bound. It is natural to ask whether similar conditions can be used to establish provable efficiencies of RL algorithms. Recently, Foster et al. (2020) established instance-dependent regret bounds for contextual ban- dits and reinforcement learning problems by assuming a bounded disagreement coefficient, which is a distribution-dependent assumption. Foster et al. (2020) show that the disagreement coeffi- cient is always upper bounded by the eluder dimension of the function class. The RL algorithm in Foster et al. (2020), which is also based on Least Squares Value Iteration (LSVI) and the principle of "optimism in the face of uncertainty", has two drawbacks. First, their algorithm achieves provable guarantees only in the block MDP setting which might not be realistic in practice. Second, when calculating the exploration bonus, their algorithm uses the star hull to reduce the complexity of the replay buffer, which is also complicated in nature and therefore difficult to implement in practice. In this paper, we develop a novel provably efficient RL algorithm with general function approxi- mation. Similar to previous algorithms (Wang et al., 2020b; Foster et al., 2020), our algorithm is an optimistic version of LSVI. Compared to previous ones, our algorithm has the following advantages: • The regret bound of our algorithm is based on a variant of surprise bound proposed in (Foster et al., 2018), which is a distribution-dependent quantity and could therefore be smaller than the eluder dimension which considers the worst-case over all histories. Moreover, our theory does not rely on the block MDP assumption. Furthermore, the surprise bound can be upper bounded in the tabular setting, the linear setting and the high dimensional sparse linear set- ting, which implies our algorithm achieves reasonable regret bound in all these three settings. • The dimensionality reduction technique for reducing the complexity of the replay buffer is based on uniform sampling. This is much simpler than the sensitivity sampling framework in Wang et al. (2020b) and the method based on star hull in Foster et al. (2020). • Our algorithm requires solving only O(H log K) empirical risk minimization (ERM) problems, while previous algorithms (Wang et al., 2020b; Foster et al., 2020) require solving Ω(HK) ERM problems. 1.1 Related work Tabular reinforcement learning. Tabular RL is well studied in the context of sample complex- ity and regret bound in numerous literature (Kearns and Singh, 2002; Kakade, 2003; Strehl et al., 2 2006, 2009; Jaksch et al., 2010; Azar et al., 2013; Lattimore and Hutter, 2014; Dann and Brunskill, 2015; Agrawal and Jia, 2017; Azar et al., 2017; Jin et al., 2018; Dann et al., 2019; Zanette and Brunskill, 2019; Zhang et al., 2020; Wang et al., 2020a; Yang et al., 2021). In particular, for episodic MDP without further assumptions, the best regret bound is 2017) and model-free (Zhang et al., 2020) algorithms, which matches the lower bound Ω proved by Jin et al. (2018). Recently, Yang et al. (2021) propose an RL algorithm with a regret (cid:17) bound of O assuming the existence of a positive sub-optimality gap. How- ever, all algorithms mentioned above cannot be applied to RL problems with huge or infinite state spaces due to the polynomial dependence on √S in the regret bound. Therefore, in this paper, we assume the value function lies in a function class with bounded complexity and design a provably efficient algorithm whose regret bound depends polynomially on the complexity of the function class instead of the size of the state space. O(√H 2SAT ) for both model-based (Azar et al., SApoly(H) ∆min √H 2SAT log(SAT ) (cid:16) (cid:16) (cid:17) e Bandits. There is also rich literature studying stochastic (contextual) bandits, which can be viewed as a special case of MDP without state transitions (Auer, 2002; Dani et al., 2008; Li et al., 2010; Rusmevichientong and Tsitsiklis, 2010; Chu et al., 2011; Abbasi-Yadkori et al., 2011; Foster et al., 2018, 2020; Li et al., 2019). In particular, Foster et al. (2018) study contextual bandit problems with general value function approximation, and prove their algorithms could achieve a regret bound de- pending polynomially on the surprise bound and the implicit exploration coefficient (IEC). In this paper, we study RL with general value function approximation, and prove that the regret bound of our algorithm also depends on the (slightly modified) surprise bound as well as the log-covering numbers. However, we note that the RL setting is much more complicated than the contextual bandits setting since there is no state transition in bandit problems. Reinforcement learning with function approximation. In the setting of linear function approximation, there has been great interest recently in the theoretical analysis of the sample com- plexity of RL algorithms (Yang and Wang, 2019, 2020; Jin et al., 2020; Cai et al., 2020; Du et al., 2019b, 2020; Wang et al., 2019; Zanette et al., 2020; Zhou et al., 2021). Compared to linear func- tion approximation, however, many current provably efficient algorithms for general value function approximation are relatively impractical. For example, algorithms in Jiang et al. (2017); Sun et al. (2019); Dong et al. (2020) achieve regret bound in terms of the witness rank or the Bellman rank, but they are not computationally efficient. Foster et al. (2020) devise RegRL algorithm which is both computationally and statistically efficient. However, it requires the block MDP assumption which greatly alleviates the difficulty of (infinitely) huge state space and might not be realistic in practice. Ayoub et al. (2020) propose a model-based algorithm and Wang et al. (2020b) propose a model-free algorithm for general value function approximation, and the regret bound of both algorithms depend on the eluder dimension. Kong et al. (2021) propose an efficient algorithm both computationally and statistically for general value function approximation, of which the regret bound also depends on the eluder dimension. However, the eluder dimension considers the worst-case over all histories and is thus often overly pessimistic. Instead, the regret bound of our algorithm depends polyno- mially on the surprise bound which is a distribution-dependent quantity and thus could be smaller than the eluder dimension for practical scenarios. 3 2 Preliminaries In this paper, we study episodic Markov Decision Process (MDP) S is the state space, ) S ∈ is the transition kernel which maps a state-action pair to a distribution over the state space, r : M N+ is the planning horizon, P : , H, P, r, μ), where ∆( is the finite action space, H S × A → = ( A A S , [0, 1] is the reward function and μ S × A → A (stochastic) policy ∆( S ∈ ) is the initial state distribution 1. π = H h=1 : πh} { [H] ) ∆( A → S × maps any state s to a distribution over the action space at each step h, where we use [N ] to denote the set for any positive integer N . A trajectory 1, 2, . . . , N { } (s1, a1, r1), (s2, a2, r2), . . . , (sH, aH , rH ) is induced by a policy π if s1 ∼ [H maps a state to only one action. 1]. Furthermore, a policy π = μ, ah ∼ πh} { − πh(sh), rh = r(sh, ah), H h=1 is deterministic if for each step h [H], πh : h ∀ ∈ [H] and sh+1 ∼ ∈ P (sh, ah), h ∈ ∀ S → A For any policy π, the expected cumulative reward starting from state s at step h is defined as the value function H " Xh′=h where we use superscript π to denote that the trajectory is induced by π. Similarly, the expected cumulative reward starting from state-action pair (s, a) at step h is defined as the Q-function # h (s) = Eπ V π rh′ sh = s | , H Qπ h(s, a) = Eπ[ Xh′=h rh′ sh = s, ah = a]. | Let π∗ denote the optimal policy which maximizes Es1 Q∗h(s, a) = Qπ∗ h (s, a). ∼ μ[V π 1 (s1)]. Also, let V ∗h (s) = V π∗ h (s) and ∈ The agent interacts with the environment for K episodes. At the beginning of each episode [K], the agent specifies a policy πk based on previous trajectories and interacts with the k environment using πk for H steps. We assume the agent knows the number of episodes K, and we define T = KH to be the total number of steps that the agent interacts with the environment. The regret of an algorithm after K episodes is defined as Reg(K) = K Xk=1 (cid:16) V ∗1 (sk 1) − V πk 1 (sk 1) , (cid:17) which compares the accumulated rewards between the agent's policy and the optimal policy. The goal of the agent is to minimize the regret. In this paper, we consider the typical regime that H is fixed while K grows to infinity. 1Our analysis can be naturally extended to the time-inhomogeneous settings where the reward function and the transition kernel are different for each h ∈ [H]. 4 Width function and norms. For notation convenience, we define the width function for any R. The width function class F ⊆ { function is defined as and several norms for any function f : S × A → S × A → R } f : w( F f,f ′ f (s, a) , s, a) = max ∈F (cid:0) and D ⊆ S × A × Z ⊆ S × A − f ′(s, a) , (cid:1) R, define -norm Z (s, a) ∀ ∈ S × A . For any dataset -norm D and infinite norm f k kZ = s X(s,a) ∈Z f 2(s, a), f k kD = s X(s,a,r) ∈D (f (s, a) r)2, − respectively. In addition, define v k k∞ = maxs ∈S | f k k∞ = max (s,a) f (s, a) | | ∈S×A v(s) | for any v : R. S → Additional notations for algorithms. For any finite multiset ) denote the uni- form distribution over and Cardd( . For any R+, let + 1 if x is not an integer and x x ⌊ ⌋ ), ̃Ω( ) notations to hide constants and use ̃O( otherwise ) ), Ω( = x. We use the standard O( x * * * * ⌉ ⌈ to suppress log factors. Also, we use x . y to denote that there exists a constant c > 0 s.t. x cy, and use x & y if y . x. ) denote the number of distinct elements in = denote the integer part of x and define , let Unif( x ⌊ x ⌈ ≤ X X X X X ∈ ⌉ ⌋ 3 Algorithm In this section, we first introduce the assumptions for the algorithm and then present our main algorithm (Algorithm 1). The theoretical guarantee of our algorithm is presented in Section 4. 3.1 Assumptions Assume our algorithm (Algorithm 1) receives a function class as part f : determines the efficiency of the algorithm, it is natural and of the input. Since the complexity of necessary to require bounded complexities of the function class under appropriate measures. We make the following assumptions on the function class [0, H + 1] } S × A → F ⊆ { F . F Assumption 1 (Bellman-completeness). For any function V : fV ∈ F , s.t. S → [0, H], there exists a function , fV ( * , ) = r( * * ) + * P (s′ , |* )V (s′). * Xs′ ∈S Assumption 1 indicates the closedness under Bellman equations. This is a general assumption that summarizes many previous assumptions in special settings and is commonly adopted in pre- vious literature for general value function approximation (Wang et al., 2020b; Foster et al., 2020; Kong et al., 2021). For tabular RL, S × A to [0, H +1]. In the linear MDP setting (Bradtke and Barto, 1996; Jin et al., 2020; Yang and Wang, can be chosen as the set of all functions mapping from F 5 2019, 2020; Wang et al., 2019) where the transition kernel and the reward function are both linear in a feature map φ : can be the set of all linear functions with respect to φ. In sparse high-dimensional linear MDP settings where the transition kernel and the reward function are both s-sparse linear functions in φ, can be the set of all (2s)-sparse linear functions with respect to φ. is rich enough (e.g., deep Furthermore, Assumption 1 approximately holds in practice as long as neural networks) and we show in Section 5 that our algorithm is robust to model misspecification. S × A → Rd, F F F Assumption 2 (Bounded covering number). Given any ε > 0, there exist covering sets and ( F C , ε) respectively, where with bounded size , ε) and , ε) , ε) ⊆ F C • ( S × A f ∈ F (s, a) ∀ • ∀ , ∃ ⊆ S × A f ′ ∈ C , ( F (s′, a′) , ε), s.t. ∈ S × A ∃ − f k ( S × A ∈ C N f ′k∞≤ ( F ε. , ε), s.t. maxf ( S × A N f (s′, a′) ε. |≤ f (s, a) − ∈F | , ε) for both ( * Assumption 2 requires bounded covering numbers , and the regret bound of our algorithm depends only logarithmically on the covering numbers (Theorem 1). In the )). In d-dimensional tabular RL setting, ln N linear MDP settings, ln O(d). In s-sparse high-dimensional linear MDP settings, ln If we further assume that φ(s, a) is s-sparse for all (s, a) O(d) and ln , ε) = e , ε) = e , ε) = ) and ln N ( S × A ( S × A , ε) = O(ln( , then ln S × A |S||A| |S||A| , ε) = , ε) = and O( N N F e ( F ( F N ( N F ( S × A N ∈ S × A Surprise bound. Another important complexity measure in this paper is surprise bound, which was first introduced in Foster et al. (2018) to characterize the complexity of the function class in the contextual bandit setting. O(s). O(s). e e Definition 1 (Surprise bound). The surprise bound is the smallest positive constant L1 s.t. for all f, f ′ ∈ F the policy is π. , s ∈ S − , a (f (s, a) f ′(s, a))2 L1E s′ E a′ h(π) ∼ ∼D ≤ πh(s′) (f (s′, a′) f ′(s′, a′))2 − , h ∈ [H] and any policy π, where (cid:2) (cid:3) Dh(π) is the distribution of sh when ∈ A Intuitively, the surprise bound is small if all pairs of functions with a small expected squared error with respect to any policy, do not encounter a much larger squared error on any state-action pair. The following proposition gives upper bounds of the surprise bound for linear and sparse linear settings (see Appendix C for the proof). Proposition 3.1. In the (sparse) linear MDP setting with a fixed feature map φ : consider the function class for some Rd. = F (s, a) (s, a) { ∈ S × A 7→ and wTφ(s, a) w | 2H√d, ∈ W} w w k k2≤ ∀ W ⊆ , then ∈ W • If φ(s, a) k k2≤ 1, ∀ Rd, S × A → L1 ≤ sup π,h [H] ∈ λmin E s h(π),a ∼ ∼D 1 πh(s) [φ(s, a)φ(s, a)T] . • If φ(s, a) k k∞≤ 1, ∀ (s, a) ∈ S × A (cid:0) and w k k∞≤ 2H√d, w k k0≤ 2s, w ∀ (cid:1) ∈ W , then L1≤ sup π,h [H] ∈ ψmin E s h(π),a ∼ ∼D 4s πh(s) [φ(s, a)φ(s, a)T] , where ψmin(A) = minw sparse predictors (Raskutti et al., 2010). =0: 0 k ≤ w k 4s wTAw/wTw is the minimum restricted eigenvalue for (4s)- (cid:0) (cid:1) 6 6 Algorithm 1 Optimistic LSVI with doubling epoch schedule 1: Input: number of epochs M , number of warm-start epochs M0, failure probability δ 2: for episode k = 1, 2, . . . , τM0 − Receive initial state sk μ for h = 1, 2, . . . , H do 1 ∼ 3: 4: (0, 1) ∈ 1 do h+1 ∼ P ( h, ak sk *| h) and receive rk h = r(sk h, ak h) , (h′, k) ∀ [H] × ∈ [τm] (cid:1)(cid:9) m, δ) (Algorithm 3) h ∼ A 5: Take action ak Unif( ), observe sk 1] 0 end for [H] ← ← 6: 7: end for 8: for epoch m = M0, M0 + 1, . . . , M do 9: Qm , H+1( * m 10: h′+1) ) * (sk − h+1(sk ) H+1( * [τm 0 and V m ← h, ak h) (h,k) Z ∈ × for h = H, H 1, . . . , 1 do (cid:9) (cid:8) − h′ + V m h′, rk h′, ak sk m h ← D f m 2 f arg minf h ← (cid:8)(cid:0) k ∈F k D , f m bm Bonus( h , ) , h ( Z F ← * * ) + bm Qm f m h ( , , h ( , ) h ( min * * * * * { ← V m Qm maxa , a) h ( ) h ( * ← * ∈A Qm πm , a) h ( arg maxa ) h ( * ← * end for for episode k = τm, τm + 1, . . . , τm+1 − ), H * ∈A m h } Receive initial state sk 1 ∼ for h = 1, 2, . . . , H do h (sk πm Take action ak μ h ← end for 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 1 do end for 24: 25: end for 7 h), observe sk h+1 ∼ P ( h, ak sk *| h) and receive rk h = r(sk h, ak h) 3.2 Algorithm In this section, we present our main algorithm (Algorithm 1) and discuss in detail several important components of our algorithm. 3.2.1 Doubling epoch schedule 1 and consists of Tm = 2m − Our algorithm consists of M epochs where each epoch m τm = 2m − and M = O(log K). At the beginning of epoch m, the algorithm fixes a policy πm = the agent executes πm for all episodes k two phases. [M ] starts at the beginning of episode 1 − H h=1 and 1]. The M epochs can be divided into 1 episodes. Thus, the total number of episodes K = 2M [τm, τm + Tm − πm h } { ∈ ∈ • Phase 1: Warm-up epochs. For the first (M0 − 1) epochs, the agent plays a uniformly random policy. These warm-up epochs are designed to encourage exploration at the initial episodes. • Phase 2: Optimistic LSVI. Starting from epoch M0, we use an optimistic version of Least Squares Value Iteration (LSVI) similar to Jin et al. (2020); Wang et al. (2019, 2020b); M0, we maintain all previous Foster et al. (2020). At the beginning of each epoch m H with respect to the H trajectories as a replay buffer, and find the best fit f m = h=1 ∈ F replay buffer in the sense of mean squared error (MSE), i.e., ≥ f m h } { f m h ← arg min f ∈F f k 2 k D m h D m h is the replay buffer (see definition in Algorithm 1). To avoid overfitting and encour- where age exploration, we design a bonus function bm , h ( ) which we will discuss later in Section 3.2.2, * * ) by , and approximate the optimal Q function Q∗h( * * f m , h ( * { ) + bm , h ( * * Our design of the bonus function ensures that Qm h is an optimistic estimator of Q∗h with high probability (Lemma 6). Finally, for each episode k 1] in epoch m, the agent plays the greedy policy with respect to Qm [τm, τm+1 − h and collect the trajectory in episode k. ) = min * Qm , h ( * ), H * ∈ } . The advantages of the doubling epoch schedule are two folded: • Computationally efficient. Since our algorithm only conducts large amount of computa- tion at the beginning of each epoch (computing f m h by the width function as in Section 3.2.2, which can often be solved efficiently by appropriate op- timization methods or assuming access to appropriate regression oracles (Wang et al., 2020b; Foster et al., 2018)) and there are only O(log K) epochs, our algorithm is much more com- putationally efficient than previous methods (Wang et al., 2020b; Foster et al., 2020) which require to solve Ω(HK) equivalent optimization problems. h by empirical risk minimization and bm Recently, Kong et al. (2021) proposes an online sub-sampling technique which improves the computational complexity of Wang et al. (2020b). However, our algorithm is still much more computationally efficient than Kong et al. (2021). The algorithm of Kong et al. (2021) adopts sensitivity sampling, which requires computing sensitivities for each state action pair (sk h). Since the calculation of sensitivity requires solving a regression oracle for Ω(log(T H)) times in Kong et al. (2021)), and there are T = KH such state-action pairs, (see Section 4.4. h, ak 8 their algorithm needs to solve Ω(KH log(T H)) regression oracles to calculate sensitivities and subsample the dataset. While in our algorithm, we use uniform sampling to avoid the complex and time-consuming sensitivity calculation and thus does not need any oracle to perform the subsampling procedure. • Stabilizing adjacent trajectories. The doubling epoch schedule together with the warm- up epochs stabilizes the adjacent trajectories by ensuring that at the beginning of each epoch, at least half of the historical trajectories in the replay buffer are induced by the same policy. This property enables us to adopt uniform sampling (Algorithm 2) to reduce the complexity of the replay buffer. 3.2.2 Uniform sampling h , we can choose bm A naive way to choose the confidence region is h . If we are able to obtain a confidence region An important technical novelty of our algorithm is the design of the bonus function via uniform sampling. To ensure optimism of our estimator Qm h as the upper bound of the m difference between Q∗h and f m h which contains both F f m h and Q∗h, it suffices to define the bonus function as the width function of 2 f m h k Z with a carefully F selected β. However, since the confidence region depends on the whole replay buffer with size at most T , the confidence region and thus the bonus function would suffer extremely high complexity. This implies that β needs to be set extremely large to ensure the accuracy of the confidence region. To obtain a bonus function with low complexity, we reduce the complexity of the replay buffer by uniform sampling, which is formally stated in Algorithm 2. f k (cid:12) (cid:12) F m ≤ m h . β m h = ∈ F − (cid:9) (cid:8) f Algorithm 2 Uniform-Sampling( , F , dataset , λ, ε, δ) , parameters λ, ε > 0 and failure probability δ (0, 1) ∈ Z Z F |Z| 384L1 1 ε/72 * max 1: Input: function class λδ/ 2: Set ε0 ← 3: Set p− 1, p ← 4: Initialize n Z ′ ← {} 5: for z do 6: 7: end for 8: Output: ∈ Z j Add 1/p copies of z to Z ′ ln(4 N * 1 ,ε0)/δ)/(ε2 ( F ) *|Z| ko Z ′ with probability p Comparison to previous methods. Actually, the algorithms in Wang et al. (2020b); Foster et al. (2020) also suffer the high complexity of the bonus function and address the issue by sensitivity sampling and star hull respectively. However, sensitivity sampling requires estimating the sensitiv- ity of each state-action pair, which is time-consuming; the star hull is complicated in nature and thus is hard to implement in practice. In contrast, our uniform sampling is conceptually simple and easy to implement. Note that there is only one single parameter p to be determined in Algorithm 2. When the surprise bound L1 is known in advance, we can directly calculate the value of p. When L1 is unknown, we can perform a grid-search in a log-space of L1. Specifically, we can set a small value Lmin as the lower bound of L1 and a large value Lmax as the upper bound, and perform . Then we can pick the policy with the Algorithm 1 for L1 ∈ L best performance under different choices of L1. Lmin, 2Lmin, 22Lmin, . . . , Lmax} { Theorem 1 shows that the regret of our main algorithm (Algorithm 1) is ̃O(√T ) in T dependence. We also emphasize that the above grid-search procedure won't result in higher total regret, since one , 9 can first try each possible L1 ∈ L O(T √T log(Lmax/Lmin)) = O(T ) steps. The resulting total regret is still ̃O(√T ). for O(√T ) times, and then exploit the best L1 for the remaining − , ̄f , F Algorithm 3 Bonus( 1: Input: function class 2: Uniform-Sampling( , F Z > 64T 2/δ or Cardd( Z ′) F , δ) Z , reference function ̄f , dataset (16T )2 , 1 2 , 9216L1 * δ 16T ) (Algorithm 2) ( ln(64T F N ≥ Z , δ and failure probability δ (0, 1) ∈ , δ/(9216T 2 ))/δ) then Z ′ ← |Z ′| Z ′ ← {} 3: if 4: 5: end if 6: Let ˆf 7: 8: for z b 9: , 1/(8 Let ˆz Z ← {} ( ∈ C F ∈ Z ′ do ( S × A ∈ C ˆz } Z ∪ { c′ * ← f ∈ F | k 14: Output: ˆw( ) , * * 10: Z ← 11: end for 12: β , β( F ← b , δ) F f 13: ← n b b 64T 2/δ)) such that ˆf k − ̄f k∞≤ 1/(8 64T 2/δ) p p , 1/(8 64T 2/δ)) such that supf f (z) ∈F | f (ˆz) |≤ − 1/(8 64T 2/δ) p p , δ/T 3)) ( F ln( N ( S × A × , δ/T 2)) for some constant c′ > 0 N L1H 2 ln3(T /δ) ln( − ˆf 2 b Z ≤ k , , w( * F 3β + 2 ) * o b Z ′, we round each data in Design of the bonus function via uniform sampling. Now we are able to design a bonus function with low complexity as in Algorithm 3 via uniform sampling. After obtaining the reduced Z ′ and the reference function ̄f to their nearest neighbors in dataset covering sets. The confidence region and the bonus function is then defined by the rounded reference function and the rounded dataset. Note that in Algorithm 3, the rounding operation does not need to be performed explicitly since all the data are stored in computers with bounded precision, and thus all the data will be implicitly rounded. For the choice of β, we can use the same grid-search method of L1 since β is also determined by L1. Efficient computation of the bonus function. The computation of the bonus function is equivalent to an optimization problem of the following form: max ∈F f1,f2 s.t. f1(s, a) f2(s, a) − f2kZ ≤ ε. f1 − k This problem can be solved efficiently by either assuming access to an optimization oracle, or assuming access to only a regression oracle (which is a milder assumption than optimization oracles) as mentioned in Section 4.4 of Kong et al. (2021). 4 Theoretical results In this section, we formally present our main theorem of the regret bound and defer the proof to Appendix B. 10 Theorem 1 (Main theorem). Under Assumption 1, 2, let M0 = where the number of total steps T = H the regret of Algorithm 1 is at most (2M − * 1) is sufficiently large. With probability at least 1 (cid:16) l δ, (cid:17)m − ln 16L2 1 ln 128T ( F N ,δ/(9216T 2))2 δ O(ι * H 3/2 * √T ), ln2(T /δ) where ι = L1 * N Proof sketch. In this proof sketch, we ignore the rounding operation in Algorithm 3 for convenience. The proof can be decomposed into three main steps. ( S × A max(ln( ( F N * , δ/T 3)), ln( , δ/T 2))). • Step 1: Bounding the complexity of the bonus function. First, we show that our bonus function has low complexity (Proposition A.2). Note that the bonus function is defined as the width function of the confidence region ˆ m h = F f ∈ F ˆf m 2 ˆZm≤ h k − β . f k (cid:12) (cid:12) (cid:12) 2 n − , the − f k o Since the reduced dataset ˆ m has bounded size (Lemma 1) and bounded number of distinct Z elements (Lemma 3), our bonus function which is defined by ˆ m also has low complexity. Now Z it remains to show that the bonus function defined over the reduced dataset ˆ m is (almost) Z m. It is equivalent to show the same as the bonus function defined over the original dataset that the confidence region remains (almost) unchanged after uniform sampling. This can be f ′ approximates proved by showing that for any function pairs f, f ′ ∈ F − 2 ′ is an f ′k f well the -norm of f k − Z and its variance can be controlled, since the trajectories in unbiased estimator of f ′k Z the replay buffer are stabilized by the doubling epoch and thus Z ′ has low complexity after uniform sampling. Then we can apply the Bernstein inequality to a fixed function pair (f, f ′) with high probability. Applying a union bound f ′k to show that f ′k Z , we can obtain the desired result. over all function pairs in the covering set of Z Z ′-norm of f f ′ (Lemma 2). For a fixed function pair (f, f ′), Z F • Step 2: Optimism of the estimated Q-function. The next step is to show that the estimated Q-function is an optimistic version of the true Q-function of the optimal pol- icy (Lemma 6). To achieve this, we need to show that the best fit f m ) + * h and V m h+1 are independent, a standard concentration argu- h+1(s′). h+1 and f m ment concludes the result. However, V m h are subtly dependent since they are both P determined by the previous dataset. To address the difficulty, we first apply the standard concentration result on a fixed V (Lemma 4), and then apply a union bound over all V in a covering set (Lemma 5) to obtain the result. This method is similar to Wang et al. (2020b). , h is close to r( * ′ is close to , P (s′|* )V m * If f m f k f k − − ∈S s′ Z 2 2 • Step 3: Regret decomposition. Finally, we decompose the regret by the summation of the bonus functions (Lemma 7). Then, we use similar arguments as in Foster et al. (2018) to bound each bonus term by the surprise bound separately since the bonus function is defined as the (approximate) width function of the confidence region. Remark 1. Recently, Foster et al. (2021) proposes a high-level algorithm E2D. When applying E2D algorithm to our settings, one can show that it also achieves a similar regret bound ̃O(poly(L1)√T ) (other parameters omitted). However, we want to emphasize that E2D algorithm is too high-level to 11 implement in practice. The implementation of E2D algorithm requires an online estimation oracle (see Algorithm 1 in Foster et al. (2021)), which is a very strong assumption in RL settings. While in our algorithm, we only require a ERM oracle and a regression oracle, which are mild and common assumptions in machine learning problems. While our algorithm works for general value function class, it also achieves reasonable regret in special cases. Tabular settings. , ε) = O(ln( In the tabular RL setting, it holds that ln |S||A| ε and P (s′| )), which implies that the regret bound is ̃O(poly( N ε for all s, s′ ∈ S A positive value ε, L1 = O(poly( This is a reasonable regret bound since it is optimal in terms of T , the most important term in the regret bound, and has polynomial dependency in other parameters. ( S × for a (not too) small )). When μ(s) ≥ |S||A| , ε) = , a ) and ln ∈ A e |S||A| |S||A| ( F s, a) O( N ≥ )H 3/2√T ). Linear settings. When O(d). When , ε) = A e is a d-dimensional linear function class, we have ln ( F N , ε) = ln ( S × N F λmin E s′ E a′ h(π) πh(s′) ∼ ∼D φ(s′, a′)φ(s′, a′) T * * is lower bounded (of order Ω(1/d)) and thus L1 = O(d) by Proposition 3.1, the regret bound is H 3/2 O(d2 √T ), which is optimal in T -dependency and matches the result of Wang et al. (2020b) in d-dependency. e Sparse linear settings. Furthermore, when F ( class where typically d F is an s-sparse high-dimensional linear function s , we have ln O(s). When , ε) = ≫ N ≥ T ψmin E s′ E a′ h(π) πh(s′) ∼ ∼D φ(s′, a′)φ(s′, a′) e T i(cid:17) i(cid:17) (cid:16) (cid:16) h h N , δ/T 2))) max(s, ln( ( S × A , we have ln is lower bounded (of order Ω(1)) and thus L1 is O(s) by Proposition 3.1, the regret bound is √T ). If we further assume that φ(s′, a′) is s-sparse for O(s * * * √T ) regret , ε) = ( all (s′, a′) S × A e bound. However, directly applying the result in linear settings of Wang et al. (2020b) can only e obtain a linear regret when d T . This shows the superiority of our algorithm since we can provide theoretical guarantee for more general function classes, and thus it is an important step toward studying general value function approximation beyond the tabular and linear settings. O(s) and thus obtain an ∈ S × A H 3/2 H 3/2 O(s2 N ≥ e * * s′ E E We also emphasize a subtle difference between linear and sparse linear settings. In linear settings, is lower bounded, we typically expect it to be 1. While for sparse linear settings, when φ k2≤ (cid:3)(cid:1) k is lower bounded, we typically expect it to be of order when λmin a′ of order Ω(1/d) since we assume the 2-norm ψmin ∼ Ω(1) since we assume the infinity norm φ(s′, a′)φ(s′, a′)T 1 in this setting. (cid:0) h(π) πh(s′) πh(s′) h(π) φ(s′, a′)φ(s′, a′)T φ (cid:3)(cid:1) k∞≤ k ∼D ∼D E E a′ s′ (cid:0) ∼ (cid:2) (cid:2) 5 Model Misspecification Our main theorem (Theorem 1) requires Bellman-completeness assumption (Assumption 1). Al- though the Bellman-completeness assumption is fairly common in theoretical analysis, especially in the presence of general value function approximation, the ground truth model together with the function class might slightly violate this assumption in real-world scenario. This phenomenon is known as model misspecification (Jin et al., 2020; Wang et al., 2020b). 12 In this section, we show that as long as the violation of the Bellman-completeness assumption is small, the regret of our algorithm is still bounded. To state the result formally, we first introduce the following assumption, which can be viewed as a model misspecification version of the Bellman- completeness assumption. Assumption 3 (Model misspecification). There exists a constant ζ > 0 satisfying that for any function V : , s.t. S → [0, H], there exists a function fV ∈ F , fV ( * ) * , r( * ) + * − P (s′ , |* Xs′ ∈S )V (s′) * ζ. ≤ ∞ (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) Under Assumption 3, one can directly apply Algorithm 1 to the model misspecification setting with only a different choice of the parameter β in Algorithm 3. Specifically, for some constant c′ > 0 we set β = c′(L1H 2 ln3(T /δ) ln( , δ/T 3)) ln( , δ/T 2)) + HT ζ). (1) ( F N ( S × A N Note that when Assumption 1 holds, it is equivalent to Assumption 3 with ζ = 0, and thus the parameter β is exactly the same as the one in our original algorithm. The following theorem provides theoretical guarantees of our algorithm for model misspecification, and the proof is attached in Appendix D, which is very similar to the proof of Theorem 1. Theorem 2 (Theoretical guarantee for model misspecification). Under Assumption 3, 2, let M0 = ln 1). With probability and the number of total steps T = H δ, the regret of Algorithm 1 (where the parameter β is defined as in (1)) is at most 16L2 at least 1 l (cid:16) 1 ln 128T ,δ/(9216T 2 ))2 (2M (cid:17)m ( F − N * δ − O(ι * max(ln( H 3/2 √T + * p , δ/T 3)), ln( ( F N * ζ H 2 L1 * ( S × A N T ), log T * * , δ/T 2))). where ι = L1 * ln2(T /δ) * 6 Conclusion In this paper, we propose a provably efficient RL algorithm (both computationally and statistically) with general value function approximation. The regret bound of our algorithm depends on the surprise bound, which is a distribution-dependent quantity and could therefore be smaller than the eluder dimension considered in previous work. Our algorithm achieves reasonable regret bound when instantiating to special function classes. As a future direction, it would be interesting to see if it is possible to establish the provable efficiency of RL algorithms using other distribution-dependent complexity measures. For example, it would be interesting to study whether it is possible to design a provably efficient RL algorithm by assuming a bounded disagreement coefficient (as in Foster et al. (2020)) but without the block MDP assumption. References Yasin Abbasi-Yadkori, Dávid Pál, and Csaba Szepesvári. Improved algorithms for linear stochastic bandits. In NIPS, volume 11, pages 2312–2320, 2011. Alekh Agarwal, Sham Kakade, and Lin F Yang. Model-based reinforcement learning with a gen- In Conference on Learning Theory, pages 67–83. PMLR, erative model is minimax optimal. 2020. 13 Shipra Agrawal and Randy Jia. Posterior sampling for reinforcement learning: worst-case regret bounds. arXiv preprint arXiv:1705.07041, 2017. Peter Auer. Using confidence bounds for exploitation-exploration trade-offs. Journal of Machine Learning Research, 3(Nov):397–422, 2002. Alex Ayoub, Zeyu Jia, Csaba Szepesvari, Mengdi Wang, and Lin Yang. Model-based reinforcement learning with value-targeted regression. In International Conference on Machine Learning, pages 463–474. PMLR, 2020. Mohammad Gheshlaghi Azar, Rémi Munos, and Hilbert J Kappen. Minimax pac bounds on the sample complexity of reinforcement learning with a generative model. Machine learning, 91(3): 325–349, 2013. Mohammad Gheshlaghi Azar, Ian Osband, and Rémi Munos. Minimax regret bounds for rein- forcement learning. In International Conference on Machine Learning, pages 263–272. PMLR, 2017. Steven J Bradtke and Andrew G Barto. Linear least-squares algorithms for temporal difference learning. Machine learning, 22(1):33–57, 1996. Qi Cai, Zhuoran Yang, Chi Jin, and Zhaoran Wang. Provably efficient exploration in policy opti- mization. In International Conference on Machine Learning, pages 1283–1294. PMLR, 2020. Wei Chu, Lihong Li, Lev Reyzin, and Robert Schapire. Contextual bandits with linear payoff In Proceedings of the Fourteenth International Conference on Artificial Intelligence functions. and Statistics, pages 208–214. JMLR Workshop and Conference Proceedings, 2011. Varsha Dani, Thomas P Hayes, and Sham M Kakade. Stochastic linear optimization under bandit feedback. 2008. Christoph Dann and Emma Brunskill. Sample complexity of episodic fixed-horizon reinforcement learning. arXiv preprint arXiv:1510.08906, 2015. Christoph Dann, Lihong Li, Wei Wei, and Emma Brunskill. Policy certificates: Towards accountable In International Conference on Machine Learning, pages 1507–1516. reinforcement learning. PMLR, 2019. Kefan Dong, Jian Peng, Yining Wang, and Yuan Zhou. Root-n-regret for learning in markov decision processes with function approximation and low bellman rank. In Conference on Learning Theory, pages 1554–1557. PMLR, 2020. Simon S Du, Sham M Kakade, Ruosong Wang, and Lin F Yang. Is a good representation sufficient for sample efficient reinforcement learning? arXiv preprint arXiv:1910.03016, 2019a. Simon S Du, Yuping Luo, Ruosong Wang, and Hanrui Zhang. Provably efficient q-learning with func- tion approximation via distribution shift error checking oracle. arXiv preprint arXiv:1906.06321, 2019b. Simon S Du, Jason D Lee, Gaurav Mahajan, and Ruosong Wang. Agnostic q-learning with func- tion approximation in deterministic systems: Tight bounds on approximation error and sample complexity. arXiv preprint arXiv:2002.07125, 2020. 14 Simon S Du, Sham M Kakade, Jason D Lee, Shachar Lovett, Gaurav Mahajan, Wen Sun, and Ruosong Wang. Bilinear classes: A structural framework for provable generalization in rl. arXiv preprint arXiv:2103.10897, 2021. Dan Feldman and Michael Langberg. A unified framework for approximating and clustering data. In Proceedings of the forty-third annual ACM symposium on Theory of computing, pages 569–578, 2011. Dan Feldman, Melanie Schmidt, and Christian Sohler. Turning big data into tiny data: constant-size coresets for k-means, pca and projective clustering. In Proceedings of the twenty-fourth annual ACM-SIAM symposium on Discrete algorithms, pages 1434–1453, 2013. Dylan Foster, Alekh Agarwal, Miroslav Dudik, Haipeng Luo, and Robert Schapire. Practical con- textual bandits with regression oracles. In International Conference on Machine Learning, pages 1539–1548. PMLR, 2018. Dylan J Foster, Alexander Rakhlin, David Simchi-Levi, and Yunzong Xu. Instance-dependent complexity of contextual bandits and reinforcement learning: A disagreement-based perspective. arXiv preprint arXiv:2010.03104, 2020. Dylan J Foster, Sham M Kakade, Jian Qian, and Alexander Rakhlin. The statistical complexity of interactive decision making. arXiv preprint arXiv:2112.13487, 2021. Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 11(4), 2010. 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, pages 1704–1713. PMLR, 2017. Chi Jin, Zeyuan Allen-Zhu, Sebastien Bubeck, and Michael I Jordan. Is q-learning provably efficient? arXiv preprint arXiv:1807.03765, 2018. Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement In Conference on Learning Theory, pages 2137– learning with linear function approximation. 2143. PMLR, 2020. Chi Jin, Qinghua Liu, and Sobhan Miryoosefi. Bellman eluder dimension: New rich classes of rl problems, and sample-efficient algorithms. arXiv preprint arXiv:2102.00815, 2021. Sham Machandranath Kakade. On the sample complexity of reinforcement learning. PhD thesis, UCL (University College London), 2003. Michael Kearns and Satinder Singh. Near-optimal reinforcement learning in polynomial time. Ma- chine learning, 49(2):209–232, 2002. Johannes Kirschner and Andreas Krause. Information directed sampling and bandits with het- eroscedastic noise. In Conference On Learning Theory, pages 358–384. PMLR, 2018. 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. 15 Michael Langberg and Leonard J Schulman. Universal ε-approximators for integrals. In Proceedings of the twenty-first annual ACM-SIAM symposium on Discrete Algorithms, pages 598–607. SIAM, 2010. Tor Lattimore and Marcus Hutter. Near-optimal pac bounds for discounted mdps. Theoretical Computer Science, 558:125–143, 2014. Gen Li, Yuting Wei, Yuejie Chi, Yuantao Gu, and Yuxin Chen. Breaking the sample size barrier in model-based reinforcement learning with a generative model. Advances in Neural Information Processing Systems, 33, 2020. Lihong Li, Wei Chu, John Langford, and Robert E Schapire. A contextual-bandit approach to personalized news article recommendation. In Proceedings of the 19th international conference on World wide web, pages 661–670, 2010. Yingkai Li, Yining Wang, and Yuan Zhou. Nearly minimax-optimal regret for linearly parameterized bandits. In Conference on Learning Theory, pages 2173–2174. PMLR, 2019. Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wier- stra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. nature, 518(7540):529–533, 2015. Garvesh Raskutti, Martin J Wainwright, and Bin Yu. Restricted eigenvalue properties for correlated gaussian designs. The Journal of Machine Learning Research, 11:2241–2259, 2010. Paat Rusmevichientong and John N Tsitsiklis. Linearly parameterized bandits. Mathematics of Operations Research, 35(2):395–411, 2010. David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. nature, 550(7676):354–359, 2017. Alexander L Strehl, Lihong Li, Eric Wiewiora, John Langford, and Michael L Littman. Pac model- free reinforcement learning. In Proceedings of the 23rd international conference on Machine learn- ing, pages 881–888, 2006. Alexander L Strehl, Lihong Li, and Michael L Littman. Reinforcement learning in finite mdps: Pac analysis. Journal of Machine Learning Research, 10(11), 2009. 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. Ruosong Wang, Simon S Du, Lin F Yang, and Sham M Kakade. Is long horizon reinforcement learn- ing more difficult than short horizon reinforcement learning? arXiv preprint arXiv:2005.00527, 2020a. 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, 2020b. 16 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. Kunhe Yang, Lin Yang, and Simon Du. Q-learning with logarithmic regret. In International Conference on Artificial Intelligence and Statistics, pages 1576–1584. PMLR, 2021. 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. Lin Yang and Mengdi Wang. Reinforcement learning in feature space: Matrix bandit, kernels, and In International Conference on Machine Learning, pages 10746–10756. PMLR, regret bound. 2020. Andrea Zanette and Emma Brunskill. Tighter problem-dependent regret bounds in reinforcement learning without domain knowledge using value function bounds. In International Conference on Machine Learning, pages 7304–7312. PMLR, 2019. 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. Zihan Zhang, Yuan Zhou, and Xiangyang Ji. Almost optimal model-free reinforcement learningvia reference-advantage decomposition. Advances in Neural Information Processing Systems, 33, 2020. Dongruo Zhou, Quanquan Gu, and Csaba Szepesvari. Nearly minimax optimal reinforcement learn- In Conference on Learning Theory, pages ing for linear mixture markov decision processes. 4532–4576. PMLR, 2021. 17 A Analysis of the bonus function In this section, we analyze our bonus function, and the main proposition is presented in Proposition A.2. A.1 Analysis of Algorithm 2 Note that the notation δ in Algorithm 3 and Algorithm 2 are different. In this subsection, all the notation δ refer to δ in Algorithm 2, and therefore, λ = δ/(16T ). Also, let ε0 = ε/72 throughout this subsection. λδ/ |Z| * We assume that the input dataset of Algorithm 2 is half of the trajectories are induced by the same policy and the number of trajectories = h, ak h) (sk { Z }(h,k) ∈ [H] × [t] where more than p 4L2 1 ln t ≥ 8 N ( F δ , ε0)2 τM0 and M0 is chosen as in Theorem 1. which is satisfied if t ≥ The first lemma gives an upper bound on the size of the dataset produced by uniform sampling. Lemma 1. With probability at least 1 δ/4, |Z ′|≤ /δ. 4 |Z| − Proof. We define random variable Xz = 1/p z is added into 0 ( otherwise ′ for 1/p times Z . Xz and E[Xz] = 1, we can obtain Pr ′ {|Z > 4 | |Z| /δ δ/4 } ≤ Since = |Z ′| z ∈Z P by Markov inequality. The next lemma proves that after uniform sampling, the norms of difference of any function pairs are approximately preserved with high probability. Lemma 2. With probability at least 1 (1 f ε) k − Proof. When p = 1, which means Z = − f ′ δ/2, for any f, f ′ ∈ F f (1 + ε) f k − ≤ k Z ′, the result directly holds. So we only consider the case when p < 1, 2 Z − k 2 k Z 2 k Z λ/δ. |Z| +8 2λ f ′ f ′ − ≤ − , ′ p ≥ ln(4 384L1 * We separately consider the cases when where For any function pair f, f ′ ∈ F which holds with probability at least 1 4 /δ − |Z| conclude that ( F f ′k − f ′k − λ/δ. Also, by the fact that 8 |Z| 2 Z ≤ f * k f ′k N − 2 f k f k f k δ/4, we can obtain that f k < 2λ and 2λ. Z 2 < 2λ, conditioned on the event in Lemma 1 f ′k f k f ′k f k − < 2λ and f ≤ |Z ′|k Z 2 f ′k ≥ − Z 2 f ′k − Z ≤ 0, we can f ′k − − Z Z 2 2 ′ ′ 2 Z ≥ , ε0)/δ)/(ε2 ). * |Z| (1 f ε) k − − f ′ 2 Z − k 2λ f ≤ k f ′ ′ 2 k Z ≤ − f (1 + ε) k f ′ 2 k Z − In the remaining part of the proof, we consider the case that f k − 18 +8 λ/δ. |Z| 2 Z ≥ f ′k 2λ. We first fix any pair of distinct functions f, f ′ ∈ C trajectories are all induced by the same policy π. Also, for any 1 ( F , ε0). Assume the first u = k ≤ ≤ u, let (t + 1)/2 ⌋ ⌊ H gk = (f (sk h, ak h) Xh=1 − f ′(sk h, ak h))2. Therefore, Note that E [gk] = H Xh=1 E s ∼D E h(π) πh(s) a ∼ (f (s, a) − f ′(s, a))2 . (cid:2) (cid:3) 0 gk ≤ ≤ H × Also, by Definition 1, E [gk] H L1 s ≥ max (s,a) ∈S×A (f (s, a) − f ′(s, a))2 = H f k − f ′ . 2 k ∞ (f (s, a) max ,a ∈S ∈A f ′(s, a))2 = − H f L1 k f ′ . 2 k ∞ − Therefore, by Hoeffding's inequality, E [gk]) vE [g1] ≤ − exp − Pr 1 u ( u Xk=1 (gk − 2uv2 f k exp exp ≤ ≤ − (cid:18) − (cid:18) H 2 v2 L2 1 * 4 f ′k − ∞ 8 4L2 1 ln N * ( F δ H 2 f k − L2 1 , ε0)2 ) ≤ 4 f ′k ∞ ≤ (cid:19) exp (cid:18) 4v2 ln exp − (cid:18) ≤ (cid:19) − 2u2v2E [g1]2 4 uH 2 f ′k f k ∞ tv2 L2 − 1 (cid:19) ( 8 F N δ , ε0)2 ! . (cid:19) Setting v = 1 2 , we can obtain Pr 1 u ( u Xk=1 gk ≤ 1 2 E [g1] ) ≤ δ 8 N ( F , ε0)2 . Let E1 denote the event that 1 u u Xk=1 gk ≥ 1 2 E [g1] , then Pr {E1} ≥ 1 δ ( F − 8 N Now, we condition on ,ε0)2 . E1 for the following analysis. For each z 1 p (f (z) 0 ( z is added into otherwise f ′(z))2 − Z , define ∈ Z ′ for 1/p times . Xz = 19 Obviously, f k − 2 Z ′= f ′k Var[Xz] Xz, and E[Xz] = (f (z) f ′(z))2. Also, − z ∈Z f ′(z))2/p − * Xz ∈Z (f (z) − f ′(z))2 (f (z) ≤ max z ∈Z f ′(z))2 − f ′(z))2 − E s E[X 2 z ] P ≤ Xz ∈Z maxz * 4 4 Z Z ≤ f k Xz ∈Z f ′k f = k − p f ′k − p f ′k Z uH * f ′k − H * f k − p * f 2L1k pu ≤ ≤ 4 * ∈Z (f (z) (f (z) h=1 L1E ∈Z H z 1 P H u k=1 P L1E[g1] P u k=1 gk f k − ln(4 P ≤ 96 1 u 4 Z * P ε2 4 f ′k Z * , ε0)/δ) ( F N . a h(π) πh(s) ∼ ∼D H h, ak h=1(f (sk h) (cid:2) − (f (s, a) f ′(sk f ′(s, a))2 − h, ak h))2 (cid:3) Moreover, max z ∈Z (f (z) f ′(z))2 Xz = max z ∈Z f k 2 Z f ′k − p ε2 f k ln(4 ≤ = 96 − p maxz * z ∈Z 2 f ′k P − Z , ε0)/δ) ( F N ∈Z (f (z) (f (z) f ′(z))2 − f ′(z))2 − * Then, by Azuma-Bernstein's Inequality, Pr f |k − (cid:8) = Pr ((cid:12) Xz (cid:12) ∈Z (cid:12) (cid:12) (cid:12) (cid:18) − 2 exp 2 exp (cid:18) 2 exp ( − (δ/8)/( ≤ ≤ ≤ f ′ 2 f k Z −k E[Xz] − f ′ ′ 2 k Z − |≥ ε/4 f * k − f ′ 2 Z |E1 k (cid:9) ) f ′ f * k E1 2 k Z (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ε/4 4 Z f * k − f ′k Xz * ∈Z , ε0)/δ) ( F N 4 ε2/576 f ′k Z * − (cid:19) Xz ∈Z Xz ε/4 ≥ (cid:12) (cid:12) (cid:12) ε2/16 (cid:12) (cid:12) − Var[Xz] + 2/3 maxz 4 f ′k Z * − ε2/48 + ln(4 f k 2 z ∈Z ε2/16 P f k − 2 ln(4 − f * k 4 f ′k Z * , ε0)/δ)) ( F N , ε0))2 . ( F f * k − f ′k 2 Z (cid:19) N Since the above inequality holds conditioned on ≤ E1, if we do not condition on f (δ/4)/( * k E1, , ε0))2 . 2 k Z 2 ( k F Z By union bound, the inequality above implies that with probability at least 1 2 f Z −k k f |k ε/4 Pr |≥ f ′ f ′ f ′ N − ≤ − − (cid:8) (cid:9) ′ , ε0), ( F C (1 f ε/4) k − f ′ 2 f Z ≤ k k − f ′ ′ 2 k Z ≤ − Denote the event above and the event in Lemma 1 by f ′ . 2 k Z − f (1 + ε/4) k E2, where E2 = (1 (cid:8) ∩ |Z − /δ ′ 4 |Z| |≤ f ε/4) k − (cid:8) 2 f f ′ (cid:9) Z ≤ k k f ′ ′ 2 k Z ≤ − f (1 + ε/4) k f ′ , 2 k Z ∀ − f, f ′ ( F ∈ C , ε0) . (cid:9) 20 δ/4, for any f, f ′ ∈ − Now we condition on 2λ, there exists ˆf , ˆf ′ ∈ C f k ˆf k∞≤ E2 where Pr ( F ε0 = ε/72 − , ε0), s.t. Therefore, {E2} ≥ 1 δ/2. For any function pair f, f ′ ∈ F − where f k f ′k 2 Z ≥ − λδ/ |Z| ≤ * p p λ/(25 ), |Z| f ′ k − ˆf ′k∞≤ p λ/(25 ). |Z| ˆf ε/4) k E2. Then we can obtain that (1 − − by ˆf ′k 2 Z ≤ k ˆf − ˆf ′k 2 Z ˆf (1 + ε/4) k − ′ ≤ ˆf ′k 2 Z ′+ ˆf ′ − k f ′ 2 ′ kZ 2 (cid:17) ˆf ′kZ +2 f k − f ′ ′ 2 k Z ≤ ≤ = (cid:16) (cid:16) − ′+ f k ˆf kZ ˆf k ˆf (1 + ε/8) k ˆf (1 + ε/8) k − − /δ (cid:16) Z ′ | Z | |≤ 4 | ≤ ˆf (1 + ε/8) k − f (1 + ε/8) k f (1 + ε/8) k f (1 + ε/8) k − − − (cid:16) (cid:16) (cid:16) ≤ ≤ ≤ √λ f k − f ′ Z k ≤ ≥ (cid:16) f (1 + ε) k f ′ . 2 k Z − − ˆf ′kZ ˆf ′kZ ˆf ′kZ f ′ kZ f ′ f ′ kZ kZ p +2 p +√λ +√λ +√λ +√λ * * * * ε0 |Z ′| * |Z ′| * (cid:17) ε/72 λδ/ |Z| * 2 (cid:17) 2 p ε/18 (cid:17) ˆf ε/18 + 2 k f − kZ |Z| * ε/18 + 4 2 p ε/9 (cid:17) f ′ ˆf ′ − +2 k λδ/ ε/72 2 kZ (cid:17) 2 * p |Z| (cid:17) By similar methods, we can also obtain that f k − f ′ ′ 2 k Z ≥ Z ′ | Z |≤ 4 | ≥ ≥ /δ | ≥ ≥ 2 ˆf − kZ ˆf ′kZ − ˆf ′kZ − f ′ kZ − ˆf k (cid:16) (1 ′ ˆf ′kZ f −k ˆf ε/6) k − − − (cid:16) (1 (cid:16) (1 (cid:16) (1 (cid:16) (1 ˆf ε/6) k − − f ε/6) k − f ε/6) k − f ε/6) k − − − − ≥ √λ (cid:16) (1 f k − f ′ Z k ≥ ≥ f ε) k − − f ′ . 2 k Z ′ ˆf ′ − −k f ′ kZ ε/72 |Z ′| * 2 ′ (cid:17) * p √λ 2 p ε/18 λδ/ |Z| 2 (cid:17) * * * * √λ ε/18 (cid:17) − k ˆf f − ˆf ′ − kZ −k f ′ kZ 2 f ′ f ′ kZ − kZ − √λ √λ ε/18 ε/12 − 2 2 p ε/72 |Z| * * p (cid:17) λδ/ (cid:17) |Z| 2 (cid:17) We also give the bound of the number of distinct elements in Lemma 3. With probability at least 1 δ/4, Cardd( Z ′) − ≤ 21 Z ′. 2304L1 * ln(4 , ε0)/δ)/ε2. ( F N Proof. First, note that p 768L1 * since for any 0 < x < 1, there must exists ˆx Z ′ and ln(4 When p = 1, which means ≤ = Z 768L1 * ∈ ln(4 ( F , ε0)/δ)/(ε2 N [x, 2x] s.t. 1/ˆx is an integer. ) * |Z| , ε0)/δ)/(ε2 ( F ) * |Z| ≥ 1, N we have When p < 1, we have p ≥ ′ = |Z | 384L1 * |Z|≤ ln(4 768L1 * ( F N ln(4 ( F , ε0)/δ)/(ε2 N , ε0)/δ)/ε2. ). Now, For each z * |Z| , define ∈ Z Xz = 1 z is added into ( 0 otherwise ′ for 1/p times Z . Then the number of distinct elements in Z ′ is upper bounded by z ∈Z Xz. Since E[Xz] = p, By Chernoff bound, Xz ∈Z E[Xz] = p * |Z|≤ 768L1 * ln(4 N ( F P , ε0)/δ)/ε2. Pr ( Xz ∈Z p {− exp ≤ Xz ≥ 3 × 768L1 * ln(4 N ( F , ε0)/δ)/ε2 Pr ) ≤ , ε0)/δ)/ε2 ( Xz ∈Z exp Xz ≥ 3 Xz ∈Z ln(4/δ) } {− E[Xz] ) = δ/4. * |Z|} ≤ exp 384L1 * − ln(4 N ( F (cid:8) ≤ (cid:9) A.2 Analysis of Algorithm 3 In this subsection, all the notation δ refer to δ in Algorithm 3. In other words, we replace all the δ in Appendix A.1 by δ/(16T ). Also, we still assume that the input dataset of Algorithm 3 is [t] where more than half of the trajectories are induced by the same policy = h, ak h) (sk { [H] }(h,k) Z ∈ and the number of trajectories t satisfies × 4L2 1 ln 128T ( F N , δ/(9216T 2 ))2 δ t ≤ ≤ K = T /H, τM0 and M0 is chosen as in Theorem 1. which is satisfied if t ≥ proposition. Combining the three lemmas in Appendix A.1 with a union bound, we can obtain the following Proposition A.1. Let 1 δ/(16T ), Z ′ denote the dataset returned by Algorithm 2. With probability at least 64T 2/δ, the number of distinct elements in Z ′ does not exceed − Z ′|≤ | 9216L1 * ln(64T ( F N , δ/(9216T 2 ))/δ), and for any f, f ′ ∈ F , f k − f ′ 2 k Z /2 − 1/2 f ≤ k − f ′ ′ 2 k Z ≤ f 3 k f ′ 2 k Z − /2 + 1/2. 22 By Proposition A.1, we can deduce the following proposition. Proposition A.2. For Algorithm 3, the following holds. 1. With probability at least 1 δ/(16T ), − where = f − (cid:8) 2. There exists a function set F f ∈ F | k ≤ = , s, a), w( F f f ∈ F | k − ̄f 2 k Z ≤ 12β( F , δ) + 12 . w( , s, a) ˆw(s, a) ≤ F β( ̄f 2 k Z ≤ W , δ) and F , s.t. ˆw( * (cid:9) ) ∈ W * , δ/(9216T 2))/δ F and (cid:8) (cid:9) 64T 2/δ × (cid:17) ln |W|≤ 9216L1 * + ln N (cid:16) L1 * ln C ≤ * ln 64T N (cid:0) , 1/(8 ( F ( F 64T 2/δ)) + 1 (cid:1) ( S × A ln N (cid:16) , 1/(8 64T 2/δ)) p , δ/T 3) p ( F N (cid:17) T /δ ln × ( S × A N , δ/T 2) T /δ × for some absolute constant C > 0 when T is sufficiently large. (cid:1) (cid:0) (cid:0) (cid:1) Proof. For the first part, we condition on the event defined in Proposition A.1. We only need to prove that is defined in Algorithm 3. For any f , we have , where F ⊆ F ⊆ F b f k − Therefore, F ̄f 2 /2 b k Z 1/2 − f ≤ k − ̄f 2 k Z ′ ≤ f 3 k ̄f 2 k Z − /2 + 1/2. ∈ F f k − ˆf 2 b Z ≤ k f k (cid:16) f k ≤ (cid:16) f 2 k ≤ − − ˆf kZ ̄f kZ ̄f 2 k Z − ′+ 64T 2/δ/(4 64T 2/δ) 2 p ′+ 64T 2/δ/(8 p (cid:17) 64T 2/δ) + 64T 2/δ/(4 64T 2/δ) 2 p ′+1/2 − f 3 k ≤ ̄f 2 Z ≤ k − ̄f 2 p k Z +2. p p (cid:17) , δ), which implies β( F f k − ˆf 2 b Z ≤ k 3β( F , δ) + 2, i.e., This means for any f f ∈ F . Similarly, , we have f k ∈ F b f k − ˆf 2 b Z ≥ k f k (cid:16) f k (cid:16) f ≥k ≥ − ′ − ˆf kZ ̄f − kZ ̄f 2 ′/2 k Z ′ − − p − ˆf 2 b Z ≤ k So for any f f . ∈ F b , we have f k − ∈ F 64T 2/δ/(4 64T 2/δ) 2 p 64T 2/δ/(8 p 64T 2/δ) 1/4 f ≥ k ̄f 2 p k Z − /4 − (cid:17) − 1. 64T 2/δ/(4 64T 2/δ) 2 p p (cid:17) 3β( F , δ) + 2, which implies f k − ̄f 2 Z ≤ k 12β( F , δ) + 12, i.e., , For the second part, since function ˆw( * ) is uniquely defined by * the maximal number of different possible function classes Z ′ is larger than distinct elements in F . When , we only need to analyze F > 64T 2/δ or the number of |Z ′| b 9216L1 * ln(64T ( F N b , δ/(9216T 2 ))/δ), = 0 and thus = |Z ′| the number of different ˆf does not exceed . Otherwise, F F F is determined by and ˆf . Since ˆf 64T 2/δ)), ∈ C 64T 2/δ)). Moreover, since there are at most , 1/(8 ( F Z p b b 9216L1 * , 1/(8 ( N F ln(64T b p , δ/(9216T 2))/δ) ( F N 23 distinct elements in Z the number of different b Z , where Z|≤ | is upper bounded by b , 1/(8 64T 2/δ)) p 64T 2/δ × (cid:17) b ( S × A N (cid:16) 64T 2/δ and each element belongs to ( S × A C , 1/(8 64T 2/δ)), p 9216L1 ln(64T * ( F N ,δ/(9216T 2 ))/δ) . B Analysis of the main algorithm Now we start to prove the regret bound of Algorithm 1. The following lemma provides a bound on the estimation of a single backup. Lemma 4 (Single step optimization error). Consider a fixed epoch m [M0]. We define [M ] \ ∈ as in Algorithm 1. Also, for any function V : and m V = D n(cid:16) m = (sk h, ak h) Z n o (h,k) [H] [τm 1] ∈ × [0, H], we define − S → h + V (sk h+1) h, ak sk h, rk (h,k) [H] ∈ [τm 1] − × (cid:17)o ˆfV = arg min ∈F f f k 2 k D m V . Then, for any function V : δ, s.t. conditioned on 1 [0, H] and δ S → EV,δ, for any V ′ : ∈ S → (0, 1), there exists an event V [0, H] with k V ′k∞≤ − EV,δ where Pr 1/T , we have {EV,δ} ≥ − ˆfV ′( , * (cid:13) (cid:13) (cid:13) (cid:13) for some constant c′ > 0. (cid:13) ) * − , r( * ) * − Xs′ ∈S P (s′ , |* )V ′(s′) * (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) m ≤ Z c′H ln(T /δ) + ln ( F N , 1/T ). p Proof. For any V : [0, H], we define S → , fV ( * , ) = r( * * and now we consider a fixed V . For any f ) + * P (s′ , |* )V (s′), * Xs′ ∈S , define h(f ) = 2(f (sk ξk h, ak h) − fV (sk h, ak h)) h, ak h) rk h − − V (sk h+1)), (h, k) ∀ [H] [τm − × 1]. ∈ ∈ F (fV (sk * 1], define Fk h as the filtration induced by Also, for any (h, k) ∈ [H] [τm − × (sk′ h′, ak′ h′, rk′ h′) { Fk h] = 0 and E[(ξk h(f ) | }(h′,k′) [H] [k ∈ h(f ))2 × − Fk h] | Then we have E[ξk Lemma 10 of Kirschner and Krause (2018) by setting probability at least 1 ≤ δ, − 1] ∪ { (sk h′, ak h′, rk h′) [h]. }h′ ∈ 4(H + 1)2(f (sk h, ak h))2. Applying h) ξk , we can obtain that with h(f ) } { Xt} { fV (sk h, ak = − ξk h(f ) ≤ 8(H + 1)2 log 2T + 2 δ f + 4(H + 1) k m fV kZ − log 2T + 2 δ . r [H] X(h,k) × ∈ [τm 1] − 24 Applying a union bound of ξk probability at least 1 δ, h(f ), − ξk h(f ) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) N [τm 1] − (cid:12) (cid:12) [H] X(h,k) (cid:12) × ∈ (cid:12) (cid:12) O (cid:12) ≤ H 2(ln(T /δ) + ln (cid:16) ( F ∈ C , 1/T ). holds for all f ξk h(f ) over all f − ( F ∈ C , 1/T ), we can further obtain that with ( F , 1/T )) + H f k m fV kZ − ln(T /δ) + ln ( F N , 1/T ) p (cid:17) Let Now, for any f EV,δ denote the above event, and for the rest of the proof, we condition on EV,δ. , there exists a function g , 1/T ), s.t. 1/T . Therefore, ( F ∈ C f k g − k∞≤ ∈ F For any V ′ : S → [0, H] with fV ′ k fV k∞ = − Furthermore, for any f , (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) − [τm [H] X(h,k) 1] × ∈ .H 2(ln(T /δ) + ln .H 2(ln(T /δ) + ln f + 2(H + 1) k g − m k∞|Z | [τm 1] − ξk h(g) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) p m m ξk h(f ) (cid:12) (cid:12) (cid:12) (cid:12) , 1/T )) + H (cid:12) (cid:12) , 1/T )) + H ≤ (cid:12) (cid:12) [H] X(h,k) (cid:12) × ∈ (cid:12) g (cid:12) k (cid:12) f k N ( F ( N F V ′ − k V k∞≤ − fV kZ fV kZ 1/T , we can obtain that p − ln(T /δ) + ln ln(T /δ) + ln ( F ( F N N , 1/T ) , 1/T ). P (s′ , |* )(V ′(s′) * − Xs′ ∈S (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) V ′ ≤ k V − k∞≤ 1/T. V (s′)) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) ∞ fV ′ ∈ F 2 f m V ′ −k k D h, ak (f (sk h) m fV ′ 2 k − Z h, ak fV ′(sk − h)) (fV ′(sk h, ak h) rk h − − V ′(sk h+1)) * (f (sk h, ak h) ξk h(f ) fV (sk h, ak h)) (fV (sk h, ak h) rk h − − V (sk h+1)) − * 6(H + 1) 6(H + 1) − − ( F ( F N N , 1/T )) , 1/T )) H H f k f k − − − − fV kZ fV ′ kZ m ln(T /δ) + ln N , 1/T ) p m ln(T /δ) + ln , 1/T ). ( F ( F N 2 k D f k =2 m V ′ −k h,ak X(sk h) ∈Z m h,ak X(sk h) ∈Z m 2 ≥ = & & 1] − [H] X(h,k) × ∈ [τm H 2(ln(T /δ) + ln H 2(ln(T /δ) + ln − − If we let f = ˆfV ′, since ˆfV ′ = arg minf f ∈F k kD m V ′ , we have p ( F N , 1/T )) H ˆfV ′ k − fV ′ m kZ − ln(T /δ) + ln ( F N , 1/T ), p fV ′ 0 ≥k & ˆfV ′ ˆfV ′ k 2 k D − m V ′ −k 2 fV ′ k Z m − 2 m V ′ k D H 2(ln(T /δ) + ln which implies for some constant c′ > 0. ˆfV ′ k fV ′ m kZ ≤ − c′H ln(T /δ) + ln ( F N , 1/T ). p 25 Lemma 5 (Confidence region). In Algorithm 1, for m > M0, define confidence region F Then with probability at least 1 m h = f ∈ F 2 f m h k Z (cid:12) δ/16, for all (h, m) (cid:12) f k − (cid:8) m ≤ [H] β( , δ) . F (cid:9) [M0]), ([M ] \ m h , ∈ × )V m h+1(s′) * ∈ F − , r( * ) + * Xs′ ∈S P (s′ , |* given , δ) β( F ≥ c′H 2(ln(T /δ) + ln ( F N , 1/T ) + ln ). |W| for some constant c′ > 0. Here, W Proof. By Proposition A.2, bm ) , h ( * * , f ( * { min { Q = is given in Proposition A.2. , (h, m) ∀ ∈ W , ) + w( * * ), H * [H] ∈ C [M0]). Note that ([M ] \ , 1/T ), w 0 } ∈ W} ∪ { × ( F ∈ f }| is a (1/T )-cover of Qm , h+1( * ) = * min f m , h+1( * { ) + bm * , h+1( * ), H * , h < H } ( 0, h = H , i.e., there exists q , s.t. ∈ Q q k − Qm h+1k∞≤ 1/T . Therefore, = V (cid:26) max A a ∈ + ln q , a) q( | * ∈ Q (cid:27) , 1/T ) + 1. is a (1/T )-cover of V m Now, for each V ∈V EV,δ/(16 ∈ V T )} ≥ |V| h = arg minf Pr { Since f m T we have V ln h+1 with ln |V|≤ , let EV,δ/(16 δ/(16T ). In the rest of the proof, we condition on the event 1 − 2 f k ∈F k D |W| T ) denote the event defined in Lemma 4. By union bound, ∈V EV,δ/(16 V 1/T , by Lemma 4, , and there exists V V m h+1k∞≤ ( F V k ∈ V s.t. T N − |V| m h T ). |V| f m , h ( * (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) )V m * h+1(s′) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) ) * , r( * ) * − − P (s′ , |* Xs′ ∈S m ≤ Z c′H ln(T /δ) + ln ( F N , 1/T ) + ln |W| p for some constant c′ > 0. Applying a union bound over all (h, m) δ/16, with probability at least 1 [H] [M0]), we have that ([M ] \ × ∈ − , r( * ) + * Xs′ ∈S P (s′ , |* )V m * h+1(s′) m h , ∈ F ∀ (h, m) [H] [M0]). ([M ] \ × ∈ h+1(s′) ) + The above lemma proves that the confidence region contains r( , , P (s′|* * * with high probability, which implies that all the estimated Q-function Qm h are optimistic with high probability as well. We formally state the conclusion in the next lemma. P ∈S s′ )V m * Lemma 6 (Optimistic Q-function). With probability at least 1 δ/8, Q∗h(s, a) ≤ Qm h (s, a) ≤ r(s, a) + P (s′ Xs′ ∈S for all (h, m) [H] [M0]) and (s, a) ([M ] \ × ∈ . ∈ S × A 26 − h+1(s′) + 2bm s, a)V m | h (s, a) Proof. Let m h be the confidence region as defined in Lemma 5. Let F , r( * ) + * P (s′ , |* )V m * h+1(s′) m h , ∈ F ∀ (h, m) [H] ∈ × E1 denote the event that [M0]). ([M ] \ ∈S Xs′ 1 − δ/16. Let By Lemma 5, Pr {E1} ≥ bm h (s, a) E2 denote the event that [H] (h, m) w( F ≥ m h , s, a), ∀ ∈ [M0]), (s, a) ([M ] \ . ∈ S × A × By Proposition A.2 and union bound over all (h, m) condition on ∈ E1 ∩ E2 in the rest of the proof, which holds with failure probability at most δ/8. [M0]), Pr ([M ] \ {E2} ≥ [H] − × 1 δ/16. We By the definition of width function, f (s, a) max m h | f ∈F f m h (s, a) |≤ − m h , s, a) w( F bm h (s, a), (s, a) ∀ ≤ . ∈ S × A , Since r( * ) + * s′ ∈S , P (s′|* )V m * h+1(s′) m h , we have ∈ F P r(s, a) + (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) P (s′ s, a)V m | h+1(s′) − Xs′ ∈S bm h (s, a), ≤ (s, a) ∀ . ∈ S × A (2) f m h (s, a) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Therefore, for all (s, a) , ∈ S × A h (s, a) + bm f m h (s, a) Qm h (s, a) ≤ ≤ r(s, a) + P (s′ Xs′ ∈S s, a)V m | h+1(s′) + 2bm h (s, a). , Next, we start to prove Q∗h( * ) * ≤ ) = Qm * ) ). This also implies V ∗h+1( * * directly holds since Q∗H+1( , * Qm , h+1( * ≤ Qm ) by induction on h. When h = H + 1, the inequality , h ( * * ) = 0. Now for any h H+1( , * ∈ * V m ). Therefore, for any (s, a) h+1( * , [H], assume Q∗h+1( * ∈ S × A ) * ≤ , Q∗h(s, a) =r(s, a) + P (s′ s, a)V ∗h+1(s′) | ∈S Xs′ H, r(s, a) + ( min min ≤ (2) ≤ H, f m { Xs′ ∈S h (s, a) + bm P (s′ s, a)V m | h+1(s′) ) h (s, a) } = Qm h (s, a), which completes the proof. Now, we can decompose the regret and bound it by the summation of bonus functions. Lemma 7 (Regret decomposition). With probability at least 1 δ/4, − Reg(K) τM0+1 * ≤ H + 2 Proof. For any step h ∈ [H], epoch m M τm+1 1 − H h (sk bm h, ak h) + 8H T ln(16/δ) Xk=τm Xm=M0+1 [M0] and episode k in epoch m, define [M ] \ Xh=1 p ∈ ξk h = Xs′ ∈S P (s′ h, ak sk h) | V m h+1(s′) − V πm h+1(s′) (cid:0) (cid:1) 27 − h+1) h+1(sk V m (cid:16) − V πm h+1(sk h+1) , (cid:17) and define Fk h as the filtration induced by h′, ak′ h′, rk′ h′) (sk′ { Fk h] = 0 and ξk h|≤ | Then E[ξk h| }(h′,k′) ∈ [H] [k × − 1] ∪ { (sk h′, ak h′, rk h′) }h′ 1]. [h ∈ − 2H. By Azuma-Hoeffding inequality, with probability at least 1 δ/8, − M τm+1 1 − H Xm=M0+1 Xk=τm Xh=1 ξk h ≤ 8H T ln(16/δ). p We condition on both this event and the event defined in Lemma 6 which also holds with probability at least 1 δ/8 in the rest of the proof. Let π0 denote the uniformly random policy adopted in the first (M0 − 1) epochs. By Lemma 6, − τM0−1 Reg(K) = V ∗1 (sk 1) V π0 1 (sk 1) + M τm+1 1 − V ∗1 (sk 1) Xk=1 (cid:16) τM0+1 * ≤ H + − M τm+1 (cid:17) − 1 Xm=M0+1 Xk=τm (cid:16) Xm=M0 1 (sk V m 1) Xk=τm (cid:16) V πm 1 − − V πm 1 (sk 1) (cid:17) (sk 1) . (cid:17) P (s′ − Xs′ ∈S 1)V πm 2 1, ak sk | (s′) For each k and corresponding m, we have 1 (sk V m 1) − 1, ak 1 (sk =Qm 1) V πm 1 (sk 1) 1, ak r(sk 1) − − P (s′ 1)V πm 2 1, ak sk | (s′) Xs′ ∈S 1)V m r(sk 1, ak 1) + ≤ P (s′ 1, ak sk | 2 (s′) + 2bm 1 (sk 1, ak 1) r(sk 1, ak 1) − Xs′ ∈S 1)(V m 1, ak sk | 2 (s′) V πm 2 − (s′)) + 2bm 1 (sk 1, ak 1) V πm 2 V πm 3 − − (sk (sk 2)) + ξk 3)) + ξk 1 + 2bm 1 + ξk 1, ak 1 (sk 1) 1 (sk 2 + 2bm 1, ak 1) + 2bm 2 (sk 2, ak 2) = P (s′ Xs′ ∈S 2 (sk =(V m 2) 3 (sk (V m 3) ≤ ≤ * * * H h + 2bm ξk h (sk . h, ak h) (cid:17) ≤ Xh=1 (cid:16) Therefore, Reg(K) τM0+1 * ≤ H + 2 M τm+1 1 − H Xm=M0+1 Xk=τm Xh=1 h (sk bm h, ak h) + 8H T ln(16/δ). p To prove the main theorem, we also need the next lemma. Lemma 8. With probability at least 1 − δ/2, for all (h, m) [H] [M0]) and any f, f ′ ∈ F ([M ] \ , × Tm − 1E s ∼D h(πm−1),a ∼ m−1 h π (s)[(f (s, a) − f ′(s, a))2] 4 ≤ 28 ∈ τm 1 − Xk=τm−1 (f (sk h, ak h) − f ′(sk h, ak h))2 + 64. Proof. We first fix any (h, m) ∈ [H] [M0]). Define dataset ([M ] \ h, ak (sk h) × m h = . k [τm−1,τm 1] Z n o ∈ − Now we fix any pair of distinct functions f, f ′ ∈ C let ( F , 1/T ). Also, for any episode k [τm − 1, τm − ∈ 1 ] , h = (f (sk ξk h, ak h) − f ′(sk h, ak h))2. Therefore, Note that = E s E ξk h h i h(πm−1),a ∼ ∼D m−1 h π (s) (f (s, a) − f ′(s, a))2 . (cid:2) (cid:3) 0 ξk h ≤ ≤ max (s,a) ∈S×A (f (s, a) − f ′(s, a))2 = f k − f ′ . 2 k ∞ Also, by Definition 1, E ξk h Therefore, by Hoeffding's inequality, h i τm 1 − 1 L1 s ≥ (f (s, a) max ,a ∈S ∈A f ′(s, a))2 = − 1 f L1 k f ′ . 2 k ∞ − 1 Tm Pr   ξk h − E ξk h f k h f ′k − L2 1 4 ∞ vE ξτm−1 h (cid:3) 2Tm ≤   1v2  − L2 1 (cid:2) − (cid:18) 2T 2 m − Tm 1v2E f 1k − ξτm−1 h 4 f ′k (cid:3) ∞ 2 ! (cid:2) − exp − . (cid:19) ≤ − i(cid:17) exp ≤ (cid:19) 1 − 2Tm f k Xk=τm−1 (cid:16) 1v2 4 f ′k ∞ − − * ≤ exp  (cid:18) − Since 1 = 2m − 2 Tm − ≥ 2M0 − 1 ≥ 8L2 1 ln 128T ( F N , δ/(9216T 2 ))2 δ 2L2 1 ln 2T N , 1/T )2 ( F δ , ≥ by setting v = 1 2 , we can obtain that Pr 1 Tm − 1 ( ≤ exp ln − (cid:18) u ξk h ≤ E 1 2 ξτm−1 h Xk=1 2T N (cid:2) , 1/T )2 ( F δ ) ≤ (cid:3) δ , 1/T )2 . ≤ 2T (cid:19) ( F exp v2 L2 1 * − (cid:18) 4L2 1 ln 2T N , 1/T )2 ( F δ (cid:19) N By a union bound over all such function pairs (f, f ′), this implies that with probaiblity at least 1 , 1/T ), δ/(2T ), for any f, f ′ ∈ C ( F − Tm 1E s − h(πm−1),a m−1 h π (s) (f (s, a) f ′(s, a))2 − f 2 k f ′ 2 k Z m h . − ≤ ∼ Now we condition on the event above in the following part of the proof. ∼D (cid:2) (cid:3) To simplify the notation, we denote f k − f ′ 2 π k m−1 h = E s ∼D h(πm−1),a ∼ m−1 h π (s) (f (s, a) − f ′(s, a))2 , f, f ′ ∀ . ∈ F (cid:2) 29 (cid:3) For any pair of functions f, f ′ ∈ F 1/T . When f ′ − k ˆf ′k∞≤ f ′k f k − 2 π , there exists ˆf , ˆf ′ ∈ C m−1 h ≤ f ( k F 1, we can directly obtain that , 1/T ), s.t. 64/Tm − ˆf k∞≤ − 1/T and Tm − f 1k − f ′ 2 π k m−1 h ≤ f 4 k f ′ 2 k Z − m h +64. So we only consider the case when f k − 64/Tm − 1. Then, we have f k − f ′ kZ m h ≥k ˆf ˆf ′ − Tm kZ 1/2 − f m h −k − ˆf ′ ˆf k ≥ ≥ ≥ ≥ p Tm − p Tm − p Tm − 1/2 1/2 1/2 kπ f ′ f ′ (cid:16) − f k f k (cid:16) f k − − − f ′ m−1 h ≥ 2 π f ′k ˆf kZ m−1 h − m h −k f ′ − 2/√T ˆf ′ m h kZ f m−1 h −k − kπ ˆf kπ m−1 h − kπ m−1 h − kπ 2/T 4/√T − (cid:17) ≥ 0. m−1 h −k 2/√T f ′ ˆf ′ − m−1 h kπ − (cid:17) 2/√T Therefore, p f k − f ′ 2 k Z m h ≥ (Tm − 1/4) f * k − f ′ 2 π k m−1 h − 16/T (Tm − 1/4) ≥ f * k − f ′ 2 π k m−1 h − 16, which means Tm − 1E s ∼D h(πm−1),a ∼ m−1 h π (s)[(f (s, a) − f ′(s, a))2] 4 ≤ τm 1 − Xk=τm−1 (f (sk h, ak h) − f ′(sk h, ak h))2 + 64. Finally, we complete the proof by directly applying a union bound over all (h, m) [H] [M0]). ([M ] \ × ∈ Now we are ready to prove the main theorem. Proof of Theorem 1. We condition on the event defined in Lemma 5, Lemma 6, Lemma 7 and Lemma 8. Also, we condition on the event in Proposition A.2 after applying a union bound over all (h, m) δ, all the above events hold. [M0]). With probability at least 1 ([M ] \ − [H] By Lemma 7, we have × ∈ M τm+1 1 − H H + 2 h (sk bm h, ak h) + 8H Xk=τm Xh=1 T ln(16/δ). p Reg(K) For any (h, m) [H] ∈ ≤ × where τM0+1 * Xm=M0+1 [M0]), we define ([M ] \ m h = f ∈ F | k F f − 2 f m h k Z m ≤ 12β( F , δ) + 12 , (cid:9) (cid:8) Z m = (sk h, ak h) n o (h,k) [H] ∈ [τm 1] − × as defined in Algorithm 1. Let High F m h (s, a) = max ∈F m h f f (s, a), Low F 30 m h (s, a) = min ∈F f m h f (s, a). By Proposition A.2, bm , h ( * w( F ≤ m h , , * ). Then, for any episode k * ∈ ) * 2 h, ak h) h (sk bm (cid:16) High ≤ (cid:17) (cid:16) h, ak (sk h) − m h w( m h , sk h, ak h) F h (sk f m h, ak 1], [τm, τm+1 − Low h (sk m h, ak h) 2 (cid:17) 2 High m h (sk h, ak h) F ≤ (cid:17) (cid:16) h, ak h (sk h) + f m h) 2 Low m h F − h, ak h (sk f m h) Low − − h, ak (sk h) F 2 m h F 2 (cid:17) h, ak (sk h) (cid:17) (sk h, ak h) m h F f (sk h, ak h) h (sk f m − h (sk f m h, ak h) (cid:17) 2 h, ak h) − + 2 (cid:16) ≤ ≤ ≤ ≤ Lemma 8 ≤ ≤ ≤ = Therefore, F High (cid:16) 2 (cid:16) 4 sup m f h (cid:16) ∈F 4L1 sup m f h ∈F 1 * 1 * sup m h ∈F f sup m h ∈F f (4 × 1 * 4L1 Tm − 4L1 Tm − 4L1 Tm − 64L1 Tm − E s ∼D h(πm−1) (cid:17) m−1 h π (s) E a ∼ (f (s, a) − h (s, a))2 f m τm 1 − 4 (cid:2) h , ak′ h ) (f (sk′ h (sk′ f m h , ak′ − (cid:3) h ))2 + 64   Xk′=τm−1  2 f m f 4 h k k Z − (cid:0) (12β( F , δ) + 12) + 64) m+64 (cid:1)  (3β( F , δ) + 7) . 1 * M τm+1 1 − H Xm=M0+1 M Xk=τm τm+1 − 1 Xh=1 H 2 h (sk bm h, ak h)   h, ak h) h (sk bm 2   ≤  Xm=M0+1 M Xk=τm Xh=1 (cid:16) 1 − τm+1 H  64T L1 Xm=M0+1 128T L1HM (3β( Xh=1 , δ) + 7), Xk=τm F T  * (cid:17)  3β( , δ) + 7 F Tm 1 − ≤ ≤ which implies M τm+1 1 − H 2 Xm=M0+1 Xk=τm Xh=1 h (sk bm h, ak h) 32 ≤ L1T HM (3β( F , δ) + 7). p 31 Then, we can obtain that Reg(K) 2M0 * 64L2 1H ln ≤ ≤ ≤ ≤ H + 32 L1T HM (3β( , δ) + 7) + 8H T ln(16/δ) F , δ/(9216T 2 ))2 128T p N ( F δ + 32 L1T HM (3β( , δ) + 7) + 8H T ln(16/δ) p F p p 1H(ln(T /δ) + ln( N 1H 3/2 ln2(T /δ) O(L2 + O(L2 O(L1H 3/2 ln2(T /δ) * , δ/T 2)))) ( F max(ln( , δ/T 3)), ln( ( F , δ/T 3)), ln( ( S × A N ( S × A N N ( F , δ/T 2))) * √T ) * , δ/T 2))) √T ) max(ln( N * C Proof of Proposition 3.1 In this section, we provide the proof of Proposition 3.1. Proof of Proposition 3.1. For linear settings, let , then by Definition 1, W ∗ = w′| w − { (wTφ(s, a) w, w′ ∈ W} w′ T φ(s, a))2 L1 ≤ sup π max [H] h ∈ sup w,w′ ∈W E s′ sup π ≤ max [H] h ∈ sup w ∈W E ∗ s′ sup(s,a) E a′ ∼ h(π) ∼D sup(s,a) ∈S×A E a′ h(π) ∈S×A πh(s′) − (wTφ(s′, a′) (wTφ(s, a))2 πh(s′) [(wTφ(s′, a′))2] (cid:2) ∼D ∼ − T w′ φ(s′, a′))2 (cid:3) sup π ≤ max [H] h ∈ sup w ∈W E ∗ s′ ∼D E a′ h(π) ∼ 2 2 k w k πh(s′) [(wTφ(s′, a′))2] 2 2 k w k sup π ≤ max [H] h ∈ sup w ∈W ∗ wTE s′ h(π) ∼D ∼ E a′ πh(s′) [φ(s′, a′)φ(s′, a′)T] w sup π ≤ max [H] h ∈ sup w ∈W ∗ w k 2 2λmin k E s′ sup π ≤ max [H] h ∈ λmin E s′ (cid:0) E a′ ∼ h(π) ∼D E h(π) ∼D 1 2 w 2 k k πh(s′) [φ(s′, a′)φ(s′, a′)T] a′ ∼ πh(s′) [φ(s′, a′)φ(s′, a′)T] . (cid:1) (cid:0) (cid:1) 32 For sparse high-dimensional linear settings, let , then by Definition 1, L1 ≤ sup π max [H] h ∈ sup w,w′ ∈W E s′ sup π ≤ max [H] h ∈ sup w ∈W E ∗ s′ ∼D W ∗ = w w′| { (wTφ(s, a) − w, w′ ∈ W} w′ φ(s, a))2 T − T w′ φ(s′, a′))2 (cid:3) sup(s,a) E a′ ∼ h(π) ∼D sup(s,a) ∈S×A E a′ h(π) ∈S×A πh(s′) − (wTφ(s′, a′) (cid:2) (wTφ(s, a))2 πh(s′) [(wTφ(s′, a′))2] ∼ 4s πh(s′) [(wTφ(s′, a′))2] 2 2 k w k w k 2 2 k ∼ sup π ≤ max [H] h ∈ sup w ∈W E ∗ s′ ∼D E a′ h(π) sup π ≤ max [H] h ∈ sup w ∈W ∗ wTE s′ h(π) ∼D E a′ ∼ sup π ≤ max [H] h ∈ sup w ∈W ∗ w k 2 2ψmin k E s′ sup π ≤ max [H] h ∈ ψmin E s′ (cid:0) E a′ ∼ h(π) ∼D 4s πh(s′) [φ(s′, a′)φ(s′, a′)T] w 4s E 2 w 2 k k πh(s′) [φ(s′, a′)φ(s′, a′)T] a′ h(π) ∼ ∼D 4s πh(s′) [φ(s′, a′)φ(s′, a′)T] . (cid:1) (cid:0) (cid:1) D Proof of Theorem 2 In this section, we provide the proof of Theorem 2 for model misspecification. First, we slightly modify Lemma 4 and reprove it in model misspecification case. Lemma 9 (Single step optimization error for misspecification). Assume that our function class satisfies Assumption 3. Consider a fixed epoch m [M0]. We define [M ] \ ∈ F as in Algorithm 1. Also, for any function V : and m V = D n(cid:16) Z m = (sk h, ak h) n o S → h + V (sk h+1) h, ak sk h, rk (h,k) [H] [τm 1] ∈ × [0, H], we define − (h,k) [H] ∈ [τm 1] − × (cid:17)o ˆfV = arg min ∈F f f k 2 k D m V . Then, for any function V : δ, s.t. conditioned on 1 [0, H] and δ S → EV,δ, for any V ′ : ∈ S → (0, 1), there exists an event V [0, H] with k V ′k∞≤ − EV,δ where Pr 1/T , we have {EV,δ} ≥ − ˆfV ′( , * (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) ) * , r( * ) * − − P (s′ , |* Xs′ ∈S )V ′(s′) * (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) m ≤ Z c′ H 2(ln(T /δ) + ln ( F N , 1/T )) + HT ζ. p for some constant c′ > 0. Proof. For any V : [0, H], we define S → , fV ( * , ) = r( * * ) + * P (s′ , |* )V (s′), * Xs′ ∈S 33 and now we consider a fixed V . Note that under Assumption 3, it does not necessary hold that fV ∈ F , but it can be ensured that f min k f ∈F − fV k 2 Z m ≤ |Z m ζ 2 | ≤ T ζ 2. For any f ∈ F , define h, ak h) h(f ) = 2(f (sk ξk fV (sk h, ak h)) (fV (sk h, ak h) rk h − − V (sk h+1)), (h, k) ∀ [H] ∈ * − By the same method as in Lemma 4, we can prove that with probability at least 1 1]. [τm − δ, × − . 8(H + 1)2 log [τm (cid:12) (cid:12) [H] X(h,k) (cid:12) × ∈ (cid:12) (cid:12) (cid:12) r EV,δ. EV,δ denote the above event, and for the rest of the proof, we condition on Similarly, by the same method as in Lemma 4, for any f , we have − − 1] f + 4(H + 1) k fV kZ m log ξk h(f ) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Let 2T + 2 δ 2T + 2 δ . ∈ F (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) For any V ′ : [H] X(h,k) 1] × ∈ .H 2(ln(T /δ) + ln [τm − N [0, H] with S → ξk h(f ) (cid:12) (cid:12) (cid:12) (cid:12) , 1/T )) + H ( (cid:12) F (cid:12) V ′ − k k∞≤ V m fV kZ f k 1/T , we can obtain that ln(T /δ) + ln p − ( F N , 1/T ). fV ′ k fV k∞ = − P (s′ , |* )(V ′(s′) * − Xs′ ∈S V (s′)) V ′ ≤ k V − k∞≤ 1/T. Furthermore, again by the same method as in Lemma 4, we can obtain that for any f ∞ (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) , ∈ F 2 k D fV ′ f k & f k m V ′ −k 2 fV ′ k Z If we let f = ˆfV ′ = arg minf − − m 2 m V ′ k D H 2(ln(T /δ) + ln f ∈F k kD , 1/T )) N ( F V ′ , we have m 2 k D ˆfV ′ k ˆfV ′ k & fV ′ m m V ′ −k 2 fV ′ k Z − Now let ̃fV ′ = arg minf − 2 m V ′ k D H 2(ln(T /δ) + ln , 1/T )) ( F N m, then f ∈F k − ̃fV ′ m V ′ ≤ k fV ′ 2 k Z m V ′ ≤ k fV ′ √T ζ kD m fV ′ m V ′ −k fV ′ m V ′ −k kD 2 k D V ′ ≤ m V ′ ≤ ˆfV ′ k ˆfV ′ ˆfV ′ = = ⇒k ⇒k kD kD 2 k D H f k − − fV ′ kZ m ln(T /δ) + ln ( F N , 1/T ). p H ˆfV ′ k − fV ′ m kZ − ln(T /δ) + ln ( F N , 1/T ). p m V ′ + fV ′ k kD − ̃fV ′ m kZ fV ′ ≤ k kD m V ′ +√T ζ ˆfV ′ √T ζ( k m V ′ + fV ′ k kD kD m V ′ ) ≤ √T ζ * 4√T H = 4HT ζ. Therefore, ˆfV ′ k fV ′ m 2 k Z − .H 2(ln(T /δ) + ln ( F N , 1/T )) + H ˆfV ′ k fV ′ m kZ − ln(T /δ) + ln ( F N , 1/T ) + 4HT ζ. which implies p ˆfV ′ k fV ′ m kZ ≤ c′ − H 2(ln(T /δ) + ln ( F N , 1/T )) + HT ζ. for some constant c′ > 0. p 34 Using the above lemma, we can obtain the following lemma similar to Lemma 5. Lemma 10 (Confidence region for misspecification). Assume that our function class Assumption 3. In Algorithm 1, for m > M0, define confidence region F satisfies m h = F f ∈ F 2 f m h k Z (cid:12) δ/16, for all (h, m) (cid:12) f k − (cid:8) m ≤ [H] , δ) . β( F (cid:9) [M0]), ([M ] \ × ∈ )V m * h+1(s′) m h , ∈ F Then with probability at least 1 − given , r( * ) + * P (s′ , |* Xs′ ∈S , δ) β( F ≥ c′(H 2(ln(T /δ) + ln ( F N , 1/T ) + ln ) + HT ζ). |W| for some constant c′ > 0. Here, W is given in Proposition A.2. Proof. The proof is almost identical to that of Lemma 5. Proof of Theorem 2. By Lemma 10, Lemma 6, Lemma 7, Lemma 8, the proof is almost the same as the proof of Theorem 1. 35
http://arxiv.org/abs/2302.11628v2
2023-07-03T05:35:48
2023-02-22T20:08:20
Feature Partition Aggregation: A Fast Certified Defense Against a Union of $\ell_0$ Attacks
Sparse or $\ell_0$ adversarial attacks arbitrarily perturb an unknown subset of the features. $\ell_0$ robustness analysis is particularly well-suited for heterogeneous (tabular) data where features have different types or scales. State-of-the-art $\ell_0$ certified defenses are based on randomized smoothing and apply to evasion attacks only. This paper proposes feature partition aggregation (FPA) -- a certified defense against the union of $\ell_0$ evasion, backdoor, and poisoning attacks. FPA generates its stronger robustness guarantees via an ensemble whose submodels are trained on disjoint feature sets. Compared to state-of-the-art $\ell_0$ defenses, FPA is up to 3,000${\times}$ faster and provides larger median robustness guarantees (e.g., median certificates of 13 pixels over 10 for CIFAR10, 12 pixels over 10 for MNIST, 4 features over 1 for Weather, and 3 features over 1 for Ames), meaning FPA provides the additional dimensions of robustness essentially for free.
[ "Zayd Hammoudeh", "Daniel Lowd" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11628v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11628v2", "@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 l u J 3 ] G L . s c [ 2 v 8 2 6 1 1 . 2 0 3 2 : v i X r a Feature Partition Aggregation: A Fast Certified Defense Against a Union of l0 Attacks Zayd Hammoudeh∗ Daniel Lowd University of Oregon Abstract Sparse or l0 adversarial attacks arbitrarily perturb an unknown subset of the features. l0 robustness analysis is particularly well-suited for heterogeneous (tabular) data where features have different types or scales. State-of-the-art l0 certified defenses are based on randomized smoothing and apply to evasion attacks only. This paper proposes feature partition aggregation (FPA) – a certified defense against the union of l0 evasion, backdoor, and poisoning attacks. FPA generates its stronger robustness guarantees via an ensemble whose submodels are trained on disjoint feature sets. Compared to state-of-the-art l0 defenses, FPA is up to 3,000× faster and provides larger median robustness guarantees (e.g., median certificates of 13 pixels over 10 for CIFAR10, 12 pixels over 10 for MNIST, 4 features over 1 for Weather, and 3 features over 1 for Ames), meaning FPA provides the additional dimensions of robustness essentially for free. Keywords: Certified classifier, sparse adversarial attack, l0 attack, evasion attack, data poisoning, backdoor attack 1 Introduction Machine learning models are vulnerable to numerous types of adversarial attacks, including (1) evasion attacks which manipulate a model by perturbing test instances [Sze+14], (2) poisoning attacks which manipulate predictions by perturbing a model's training set [BNL12], (3) backdoor attacks which combine training and test perturbations [Li+22], and (4) patch attacks – a specialized evasion attack where the adversarial perturbation is restricted to a specific shape [Bro+17]. Certified defenses provide provable guarantees of a prediction's robustness against adversarial attack [LXL23]. This work focuses on l0 or sparse attacks, where an adversary controls an unknown subset of the features. By certifying robustness w.r.t. the number of perturbed features, l0 analysis is particularly well-suited to heterogeneous (tabular) data where the features have different types (e.g., numerical, categorical) or scales. Moreover, l0 defenses provide provable robustness against real-world patch attacks [LF20a]. Several certified l0 defenses have been pro- posed [Lee+19; LF20b; Cal+21; Jia+22b], but these methods apply to evasion only, which can be limiting. For example, consider a distributed sensor network where each (tabular) feature is independently measured by a different sensor. Under this type of vertical partitioning where features are sourced from multiple parties, an attacker that controls a single feature (i.e., sensor) can partially perturb every instance – training and test – up to 100% poisoning rate [LDD21; Wei+22]. Existing l0 evasion defenses do not certify robustness over any training perturbation rendering them moot under such an attack. Moreover, existing l0 defenses could not be combined with instance-wise poisoning defenses here since typically, the latter are only provably robust under small poisoning rates, e.g., ≤1% [WLF22b; Rez+23]. To address these limitations, we propose feature partition aggregation (FPA) – a certified sparse defense jointly robust against both training and test feature perturbations. FPA uses a model ensemble approach, where each submodel is trained on a disjoint feature set, meaning any adversarially perturbed feature – training or test – affects at most one submodel prediction. Hence, FPA guarantees robustness over the union of l0 evasion, backdoor, and ∗Correspondence to [email protected]. This is an extended version of a paper presented at the ICML 2023 Workshop on New Frontiers in Adversarial Machine Learning (AdvML-Frontiers) [HL23a]. 1 poisoning attacks – a strictly stronger guarantee than existing l0 methods [LF20b]. In our empirical evaluation, FPA's certified median guarantees are up to 4× larger than state-of-the-art l0 defenses [Jia+22b] with little to no decrease in classification accuracy; FPA is also up to 3,000× faster. In other words, FPA provided additional dimensions of l0 robustness essentially for free. Our primary contributions are summarized below; additional theoretical analysis and all proofs are in the supplement. • We define a new robustness paradigm we term certified feature robustness that generalizes l0 (sparse) robustness to encompass training set feature perturbations. • We propose feature partition aggregation, a certified feature defense that uses an ensemble of submodels trained on disjoint feature sets. We detail two certification schemes – a simple one based on plurality voting and the other based on multi-round elections. • We empirically evaluate FPA on two classification and two regression datasets. FPA provided simultaneously larger and stronger median guarantees than the state-of-the-art certified l0 defenses while also being 2 to 3 orders of magnitude faster. 2 Preliminaries Notation Supplemental Sec. A provides a full nomenclature reference. Let [m] denote integer set {1, . . . , m}. 1[a] is the indicator function, which equals 1 if predicate a is true and 0 otherwise. l0 norm ∥w∥0 is the number of non-zero elements in vector w. Given some matrix A, denote its j-th column as Aj. In a slight abuse of notation, let A ⊖ A′ := (cid:8)j : Aj ̸= A′ (cid:9) denote the set of column indices over which equal-size matrices A and A′ differ. Similarly, let v ⊖ v′ ⊆ [|v|] denote the set of dimensions where vectors v and v′ differ. j Let x ∈ X ⊆ Rd be a feature vector (d := |x|) and y ∈ Y ⊆ N a label. A training set {(xi, yi)}n i=1 consists of where X ∈ Rn×d, and denote the label n instances. Denote the training set's feature matrix as X := [ x1 * * * xn ] vector y := [y1, . . . , yn]. Let f : X → Y be a model. For feature partition aggregation (FPA), f is an ensemble of T submodels (see Figure 1). A decision function aggregates the T submodel predictions to form f 's overall prediction. The model architecture and decision function combined dictate how a prediction's certified robustness is calculated. For instance (x, y), let gt(x, y) be the t-th submodel's logit value for label y, where gt : X × Y → R. Let ft(x) denote the t-th submodel's predicted label for x, where ft : X → Y and ft(x) := arg maxy∈Y gt(x, y). Throughout this work, all ties are broken by selecting the label with the smallest index. ⊺ Feature set [d] is partitioned across FPA's T submodels. Let St ⊂ [d] be the features used by the t-th submodel where (cid:70)T t=1 St = [d]. In other words, each FPA submodel considers a fixed, disjoint subset of the features for all training and test instances. The t-th submodel's training set, Dt, consists of: label vector y and the St columns in X. FPA submodels are deterministic, meaning fixing Dt, St, and x, in turn, fixes label ft(x) and logits ∀y gt(x, y). 1[ft(x) = y]. The plurality and runner-up ̇cy(x). labels receive the most and second-most votes (resp.), i.e., ypl = arg maxy∈Y ̇cy(x) and yru = arg maxy∈Y\ypl The pointwise submodel vote gap between labels y, y′ ∈ Y is Given x and y, the pointwise submodel vote count is ̇cy(x) := (cid:80)T t=1 Gapvote(y, y′; x) := ̇cy(x) − ̇cy′ (x) − 1(cid:2)y′ < y(cid:3), (1) with the indicator function used to break ties. Let ̈cy(x; y′) := (cid:80)T w.r.t. y′ ∈ Y. The pointwise logit vote gap for y w.r.t. y′ is t=1 1[gt(x, y) > gt(x, y′)] be y's logit vote count Gaplogit(y, y′; x) := ̈cy(x; y′) − ̈cy′ (x; y) − 1(cid:2)y′ < y(cid:3). (2) Below, x is dropped from Gapvote and Gaplogit when the feature vector of interest is clear from context. Threat Model Given arbitrary (x, y), the attacker's objective is to ensure that y ̸= f (x). The adversary achieves this objective via two methods: (1) modify training features X or (2) modify test instance x's features.1 An adversary may use either method individually or both methods jointly. An attacker can perturb up to 100% of the training instances. Our Objective For arbitrary (x, y), determine the certified feature robustness, r (defined below). Note that pointwise guarantees certify the robustness of each instance (x, y) individually. 1Our primary threat model assumes a clean-label attacker that does not modify training labels. Suppl. Sec. E provides additional theoretical results for an adversary that modifies training labels. 2 Training Set Feature Partitioning X x x x ⊺ 1 ⊺ 2 ⊺ 3 1 0 0 0 1 0 1 1 0 0 0 1 X1 1 0 0 X2 0 1 0 X3 1 1 0 X4 0 0 1 y1 y2 y3 y1 y2 y3 y1 y2 y3 y1 y2 y3 D1 D2 D3 D4 Logits (gt) Labels (ft) xS1 D1 xS2 D2 xS3 D3 xS4 D4 f1 f2 f3 f4 0.2 0.0 0.8 0.9 0.0 0.1 0.7 0.1 0.2 0.4 0.5 0.1 2 0 0 1 Figure 1: Feature partition aggregation example prediction for: test instance x ∈ X , n = 3, d = 4, and |Y| = 3. Feature partitioning across T = 4 submodels, where the t-th submodel uses only feature dimensions St = {t} ⊂ [4] and training set Dt, i.e., the tuple containing the t-th column of feature matrix X (denoted Xt) and label vector y := [y1, y2, y3]. xSt denotes the subvector of x restricted to the feature dimensions in St. Plurality label ypl = 0; runner-up label yru = 1; and run-off label yRO = 0. Under the plurality voting decision function (Sec. 4.1), f (x) has certified feature robustness rpl = 0. With run-off (Sec. 4.2), f (x)'s certified feature robustness is rRO = 1. Def. 1. Certified Feature Robustness Given training set (X, y), model f ′ trained on (X′, y), and arbitrary feature vector x′ ∈ X , certified feature robustness r ∈ N is a pointwise, deterministic guarantee w.r.t. instance (x, y) where |X ⊖ X′ ∪ x ⊖ x′| ≤ r =⇒ y = f ′(x′). Certified robustness r is not w.r.t. individual feature values. Rather, certified feature robustness provides a stronger guarantee allowing all values of a feature – training and test – to be perturbed. 3 Related Work FPA marries ideas from two classes of certified adversarial defenses, which are discussed below. A more detailed discussion of related work is deferred to suppl. Sec. C. l0-Norm Certified Evasion Defenses Representing the work most closely related to ours, these methods certify l0-norm robustness (also known as "sparse robustness"), which we formalize below. Def. 2. l0-Norm Certified Robustness Given model f , α ∈ (0, 1), and arbitrary feature vector x′ ∈ X , l0-norm certified robustness ρ ∈ N is a pointwise guarantee w.r.t. instance (x, y) where if ∥x − x′∥0 ≤ ρ, then y = f (x′) with probability at least 1 − α. There are two main differences between certified l0-norm robustness (Def. 2) and our certified feature robustness (Def. 1). (1) l0-norm methods are not certifiably robust against any adversarial training perturbations (e.g., poisoning and backdoors). (2) l0-norm robustness guarantees are probabilistic, while our feature guarantees are deterministic. Put simply, our certified feature guarantees are strictly stronger than l0-norm guarantees. Randomized ablation (RA) is the state-of-the-art certified l0-norm defense [LF20b; Jia+22b]. RA adapts ideas from randomized smoothing [CRK19] to l0 evasion attacks [LF20b]. Specifically, RA creates a smoothed classifier by repeatedly evaluating different ablated inputs, each of which keeps a random subset of the features unchanged and masks outs (ablates) all other features. RA's ablated training generally permits only stochastically-trained, parametric model architectures. At inference, certifying a single prediction with RA requires evaluating up to 100k 3 ablated inputs [Lee+19; Jia+22b]. Jia et al. [Jia+22b] improve RA's guarantees via new certification analysis that is tight for top-1 predictions, meaning Jia et al.'s version of RA always performs at least as well as the original. Jia et al. [Jia+22b] also extend RA to certify l0-norm robustness for top-k predictions. Certified patch robustness is a restricted form of l0-norm robustness where the perturbed test features are con- strained to a specific, contiguous shape, e.g., square [MY21]. Existing patch defenses include (de)randomized smooth- ing (DRS) [LF20a] – a specialized version of randomized ablation for patch attacks. Like RA, DRS performs ablated training and inference. By assuming a single patch shape, the number of possible attacks becomes linear in d, allow- ing DRS to only evaluate O(d) ablations during inference; this derandomizes the ablation set, making DRS's patch guarantees deterministic.2 More recently, Metzen and Yatsura [MY21] propose, BagCert – a certified patch defense that is less sensitive to patch shape than DRS. Note any certified feature or l0-norm defense (e.g., FPA, RA) is also a certified patch defense, given the former's stronger guarantees. Instance-wise Certified Poisoning Defenses The second class of related defenses certify robustness under the arbitrary insertion or deletion of entire instances in the training set [Che+22; WF23] – generally a small poisoning rate (e.g., ≤1%). Like FPA, most instance-wise poisoning defenses are voting-based [JCG21; Jia+22a; WLF22a]. For example, deep partition aggregation (DPA) randomly partitions the training instances across an ensemble of T submodels [LF21]. More recently, Rezaei et al. [Rez+23] propose run-off elections, a novel decision function for DPA that can improve DPA's certified robustness by several percentage points. While certified instance-wise poisoning defenses show promise, they are still vulnerable to test perturbations – even of a single feature. 4 Certifying Feature Robustness Our certified defense, feature partition aggregation (FPA), can be viewed as the transpose of Levine and Feizi's [LF21] deep partition aggregation (DPA). Both defenses are (1) ensembles, (2) rely on voting-based decision functions, and (3) partition the training set; the key difference is in the partitioning operation. DPA horizontally partitions the set of training instances (rows of feature matrix X), enabling DPA to certify instance-wise robustness. In contrast, FPA vertically partitions along an orthogonal dimension – the feature set (columns of X) – enabling FPA to certify feature- wise robustness. Intuitively, partitioning along orthogonal dimensions means that DPA and FPA certify orthogonal types of robustness. Training FPA submodels on disjoint feature subsets (e.g., Figure 1) entails that a perturbed feature affects, at most, one submodel prediction. FPA leverages this property to certify feature robustness r. Below we describe two FPA decision functions: (1) a simpler scheme using plurality voting and (2) an enhanced multi-round voting procedure specialized for multiclass classification. The decision function combined with FPA's architecture dictates how our robustness guarantee is calculated. 4.1 Feature Robustness Under Plurality Voting For x ∈ X , the plurality voting decision function defines the model prediction as f (x) := ypl, i.e., the label that receives the most submodel votes. A successful attack requires perturbing enough submodels to change ypl. Specifically, each submodel perturbation decreases the submodel vote gap (Gapvote) between ypl and the adversary's selected label by two. Hence, the minimum number of submodel perturbations equals half the vote gap between ypl and runner-up label yru. Thm. 3 formalizes this idea as a deterministic feature robustness guarantee. Eq. (3)'s decomposed form is similar to other voting-based certified defenses, including DPA [LF21; Jia+22a; HL23b]. Theorem 3. Certified Feature Robustness with Plurality Voting For feature partition S1, . . . , ST , let f be an ensemble of T submodels using the plurality-voting decision function, where the t-th submodel uses the features in St. For instance (x, y), the pointwise certified feature robustness is rpl := (cid:22) Gapvote(ypl, yru) 2 (cid:23) . (3) Understanding Thm. 3 More Intuitively Let Atr ⊆ [d] be the set of features (i.e., dimensions) an attacker modified in the training set, and let Ax ⊆ [d] be the set of features the attacker modified in instance x. As long as |Atr ∪ Ax| ≤ r, the adversarial perturbations did not change the model prediction. The union over the perturbed feature sets entails that a feature perturbed in both training and test counts only once against guarantee r. Put simply, there is no double counting of a perturbed feature. Thm. 3's certified guarantees are implicitly agnostic to the l0 attack type. Certified feature robustness r applies equally to an l0 evasion attack (Ax only) as it does to l0 poisoning (Atr only). Thm. 3's guarantees also encompass more complex l0 backdoor attacks (Atr ∪ Ax). 2(De)randomized smoothing's deterministic guarantees do not scale to RA which considers O(2d) possible attacks. 4 Top-k Certified Feature Robustness In top-k predictions, a classifier predicts k labels for each instance x, with the accuracy calculated based on whether x's true label is among the k predicted labels. In line with Jia et al.'s [Jia+22b] extension of RA to top-k predictions, suppl. Sec. D extends FPA with plurality voting to certify top-k feature robustness. 4.2 Feature Robustness Under Run-Off Elections Under plurality voting, only submodels that predict either ypl or yru are considered when determining the certified feature robustness (Eq. (3)). In other words, submodels predicting other labels essentially contribute nothing to plurality voting's pointwise guarantees. Decision functions that leverage these "wasted" submodels may certify larger guarantees (see Figure 1). For instance, Rezaei et al. [Rez+23] propose run-off elections, an enhanced two-round DPA decision function for multiclass classification.3 Since FPA and DPA share the same basic architecture (excluding the partitioning dimension), run-off can be directly combined with FPA to improve our certified robustness. We now describe run-off. Our presentation is similar to Rezaei et al.'s [Rez+23] except we standardize the formulation to align with previous work and to correct an error in Rezaei et al.'s preprint version. Formally, run-off's decision function procedure is: Round #1: Determine plurality and runner-up labels ypl and yru (resp.) as above. Round #2: Set run-off prediction yRO to either label ypl or yru based on the logit vote gap where f (x) = yRO := (cid:40) ypl Gaplogit(ypl, yru) ≥ 0 yru Otherwise . (4) Under run-off, ensemble prediction yRO can only be perturbed in two ways: (1) overtake yRO in round #2 or (2) eject yRO from round #1's top-two labels. Run-off's certified (feature) robustness is lower bounded by whichever case takes fewer submodel perturbations. We discuss these two cases separately below; Thm. 4 combines these analyses to define run-off's overall feature robustness. Case #1: Overtake yRO in Round #2 Let (cid:101)yRO := {ypl, yru} \ yRO denote the label not selected in round #2. For a label y to overtake yRO in round #2, y must simultaneously satisfy two requirements: (a) be in round #1's top- two labels (in turn ejecting (cid:101)yRO from the top two) and (b) receive more logit votes than yRO in round #2. Hence, the certified robustness for this case is bounded by whichever of these requirements requires more feature perturbations. Therefore, an attacker may control up to rCase1 RO := min y∈Y\yRO max (cid:26)(cid:22) Gapvote((cid:101)yRO, y) 2 (cid:23) , (cid:22) Gaplogit(yRO, y) 2 (cid:23)(cid:27) (5) features, without yRO being overtaken in round #2 (Lemma 6). Case #2: Eject yRO from Round #1's Top-Two Labels In round #1, a label y is preferred over a different label y′ iff Gapvote(y, y′) ≥ 0 (Lemma 5). Therefore, ejecting yRO from round #1's top-two labels requires perturbing sufficient submodels such that two labels have negative submodel vote gaps w.r.t. yRO. Let dp be a function that takes two submodel vote gaps (e.g., i, j ∈ N) and returns yRO's round #1 certified feature robustness. Recall that perturbing a submodel vote from yRO to a different y decreases Gapvote(yRO, y) by 2; observe that this same submodel perturbation also decreases Gapvote(yRO, y′) by 1 for all y′ ∈ Y \ {yRO, y}. Combining these interactions, dp can be defined recursively as (cid:40) dp[i, j] = 0 1 + min{dp[i − 2, j − 1], dp[i − 1, j − 2]} Otherwise max{i, j} ≤ 1 and (i, j) ̸= (1, 1) , (6) where the base case ensures at least one submodel vote gap is non-negative. Therefore, case #2's total certified robustness is rCase2 RO := min y,y′∈Y\yRO dp(cid:2)gapy, gapy′ (cid:3) (7) where gapy∗ = max{0, Gapvote(yRO, y∗)} (Lemma 7). Recursive formulations like Eq. (6) are solvable using clas- sic dynamic programming. O(T 2)-space matrix dp is prepopulated once, meaning the incremental lookup cost is only O(1) and rCase2 RO 's total time complexity O(|Y|2). 3Run-off only changes the decision function; no training or model architecture changes are required. 5 Combining Cases #1 and #2 to Certify Feature Robustness Thm. 4 provides the certified feature robustness for an FPA prediction using the run-off decision function. Intuitively, an optimal attacker selects whichever of the two cases above requires fewer feature perturbations; hence, Eq. (8) below takes the minimum of rCase1 and rCase2 RO . RO Theorem 4. Certified Feature Robustness with Run-off For feature partition S1, . . . , ST , let f be an ensemble of T submodels using the run-off decision function, where the t-th submodel uses only the features in St. Then, for instance (x, y), the pointwise certified feature robustness is rRO = min{rCase1 RO , rCase2 RO }. (8) 4.3 Advantages of Feature Partition Aggregation Below, we summarize FPA's advantages over state-of-the-art certified l0-norm defense randomized ablation (RA). These advantages apply irrespective of whether FPA uses plurality voting or run-off. (1) Stronger Guarantees FPA's certified feature robustness guarantee (Def. 1) is strictly stronger than RA's l0-norm guarantee (Def. 2). First, FPA's guarantees apply equally to l0 evasion, poisoning, and backdoor attacks while RA only applies to evasion. Second, FPA's guarantees are deterministic while RA's guarantees are only probabilistic. (2) Faster RA requires up to 100k forward passes to certify one prediction. FPA requires only T forward passes – one for each submodel – where T < 200 in general. FPA certification is, therefore, orders of magnitude faster than RA. (3) Model Architecture Agnostic RA's feature ablation is specialized for parametric models like neural networks and generally prevents the use of tree-based models like gradient-boosted decision trees (GBDTs). By contrast, FPA supports any submodel architecture. 5 Feature Partitioning Strategies The certification analysis above holds irrespective of the feature partitioning strategy. However, how the features are partitioned can have a major impact on the size of FPA's certified guarantees. Below, we very briefly describe two insights into the properties of good feature partitions. Insight #1 Ensure sufficient feature information is available to each submodel. Each incorrect submodel or logit vote cancels out a correct one, meaning the goal should be to simultaneously maximize the number of correct submodel predictions and minimize incorrect ones. In other words, robustness is maximized when all submodels perform well, and feature information is divided equally. Insight #2 Limit information loss due to feature partitioning. Feature partitioning is lossy from an information theoretic perspective. Fixing T , some partitions are more lossy than others, and good partitions limit the information lost. 5.1 Feature Partitioning Paradigms Applying the above insights, we propose two general feature partitioning paradigms. In practice, the partitioning strategy is essentially a hyperparameter tunable on validation data. The validation set need not be clean so long as the perturbations are representative of the test distribution. Balanced Random Partitioning Given no domain-specific knowledge, each feature's expected information content is equal. Balanced random partitioning assigns each submodel a disjoint feature subset sampled uniformly at random, with subsets differing in size by at most one. Random partitioning has two primary benefits. First, each submodel has the same a priori expected information content. Second, random partitioning can be applied to any dataset. FPA with random partitioning is usually a good initial strategy and empirically performs quite well. 6 Deterministic Partitioning One may have application-related insights into quality feature partitions. For example, consider feature partitioning of images. Features (i.e., pixels) in an image are ordered, and that structure can be leveraged to design better feature partitions. Often the most salient features are clustered in an image's center. To ensure all submodels are high-quality, each submodel should be assigned as many highly salient features as possible. Moreover, adjacent pixels can be highly correlated, i.e., contain mostly the same information. Given a fixed set of pixels to analyze, the information contained in those limited features should be maximized, so a good strategy can be to select a subset of pixels spread uniformly across the image. Put simply, for images, random partitioning can have larger information loss than deterministic strategies. Suppl. Sec. H.7 empirically compares random and deterministic partitioning. In short, a simple strided strategy that distributes features regularly across an image tends to work well for vision. Formally, given d pixels and T submodels, the t-th submodel's feature set under strided partitioning is St = {j ∈ [d] : j mod T = t − 1}. 5.2 Beyond Partitioned Feature Subsets Everything above should not be interpreted to imply that certifying feature robustness necessarily requires partitioned feature sets. Submodel feature sets can partially overlap, but determining optimal r under overlapping sets is NP-hard in general via reduction to (partial) set cover. FPA's computational efficiency is an important strength over methods like randomized ablation. Tying FPA to an NP-hard optimization destroys this differentiator. Nonetheless, suppl. In summary, overlapping Sec. F extends FPA to overlapping feature sets and provides an empirical comparison. feature sets can marginally outperform random partitioning but often lags deterministic partitions. 6 Evaluation Our empirical evaluation is modeled after Levine and Feizi's [LF20b] evaluation of randomized ablation. Due to space, additional results are deferred to the supplement including: the base (non-robust) accuracy for each dataset (H.1), full numerical results (H.2 & H.3), hyperparameter sensitivity analysis (H.4 & H.5), plurality voting vs. run-off comparison (H.6), random vs. deterministic partitioning comparison (H.7), and model training times (H.8). 6.1 Experimental Setup Due to space, most evaluation setup details are deferred to suppl. Sec. G with a brief summary below. We evaluate FPA with both the plurality-voting (Sec. 4.1) and run-off (Sec. 4.2) decision functions. Baselines Randomized ablation (RA) is FPA's most closely related work and the primary baseline below. We report the performance of both Levine and Feizi's [LF20b] original version of RA as well as Jia et al.'s [Jia+22b] improved version, where the certification analysis is tight for top-1 predictions. RA performs feature ablation during training and inference. Each ablated input keeps e randomly selected features unchanged and masks out the remaining (d − e) features; RA evaluates up to 100,000 ablated inputs to certify each prediction. Recall that RA's l0-norm robustness only applies to evasion attacks (Def. 2), while FPA provides strictly stronger feature guarantees that cover manipulation of both training and test data (Def. 1). We also compare FPA to three certified patch defenses: (de)randomized smoothing [LF20a], patch interval bound propagation (IBP) [Chi+20b], and BagCert [MY21]. Performance Metrics Certified defenses generally trade-off robustness and (clean) accuracy. Hence, following Levine and Feizi's [LF20b] evaluation of randomized ablation, performance is measured using two complementary metrics: (1) median certified robustness, the median value of the certified robustness across a dataset's entire test set with misclassified instances assigned robustness −∞ and (2) classification accuracy, the fraction of test predictions classified correctly. Below, rmed and ρmed denote the median certified feature robustness (Def. 1) and l0-norm robustness (Def. 2) resp. Mean certification time measures the time to certify a single prediction. Performance is also quantified using certified accuracy, i.e., the fraction of correctly-classified test instances that satisfy some specific robustness criterion; this criterion can be patch robustness or certified robustness of at least ψ ∈ N. Datasets We compare the methods on standard datasets used in data poisoning evaluation. First, following Levine and Feizi's [LF20b] evaluation of baseline RA, we consider MNIST and CIFAR104 where each feature corresponds to 4Existing certified poisoning defenses do not evaluate on full ImageNet due to the high training cost [Web+20; LF21; Jia+22a; WLF22a; WLF22b; Rez+23]. 7 Table 1: Median certified robustness. Each dataset's best performing method is in bold. Our median robustness was 20–30% larger for classifica- tion and 3 to 4× larger for regression while simulta- neously providing stronger guarantees. For detailed results, see Sec. H.2. Table 2: Classification accuracy (% – larger is better). We report FPA's accuracy at both RA's (middle, bold) and FPA's (blue) best median ro- bustness levels. At RA's best median robustness, FPA had better classification accuracy for all four datasets. For full results, see Sec. H.2. Dataset Dim. (d) FPA (ours) RA Dataset FPA (ours) RA [Jia+22b] Plural Run-Off [LF20b] [Jia+22b] rmed Acc. rmed Acc. ρmed CIFAR10 MNIST Weather Ames 1024 784 128 352 11 9 4 3 13 12 – – 7 8 0 1 10 10 1 1 CIFAR10 MNIST Weather Ames 13 12 4 3 62.4 87.2 76.1 65.5 10 10 1 1 75.0 96.1 85.3 84.6 10 10 1 1 Acc. 64.7 93.1 75.2 67.2 one (RGB) pixel. Second, Hammoudeh and Lowd [HL23b] prove that certified regression reduces to certified binary classification when median is used as the regressor's decision function (see Sec. G.6 for details). We apply their reduction to both FPA and RA where for instance (x, y) and hyperparameter ξ ∈ R≥0, the goal is to certify that y − ξ ≤ f (x) ≤ y + ξ. We consider two tabular regression datasets evaluated by Hammoudeh and Lowd [HL23b]. (1) Weather [Mal+21] predicts the temperature using features such as date, longitude, and latitude (ξ = 3◦C). (2) Ames [De 11] predicts housing prices using features such as square footage (ξ = 15%y). These two regression datasets serve as a stand-in for vertically partitioned data, which are commonly tabular and, as Sec. 1 mentions, particularly vulnerable to our union of l0 attacks threat model. Note run-off and plurality voting are identical under binary classification so we only report FPA's plurality voting regression results. Model Architectures For vision datasets MNIST and CIFAR10, all methods used convolutional neural net- works. Gradient-boosted decision trees (GBDTs) generally work exceptionally well on tabular data [BHL23] so for regression datasets Weather and Ames, FPA used LightGBM GBDTs [Ke+17]. In contrast, RA's feature abla- tion prevents the use of tree-based models like GBDTs, so RA instead used linear models for these two datasets (Hammoudeh and Lowd [HL23b] also used linear models for Weather). Even when restricted to linear submodels, FPA still had better median robustness and classification accuracy than RA; see suppl. Tables 24 and 25. Feature Partitioning Strategy For CIFAR10 and MNIST, FPA used strided feature partitioning; each sub- model considered the full image dimensions with any pixels not in St set to 0. For Weather and Ames, FPA used balanced random partitioning as the tabular features are unordered. Hyperparameters Hyperparameters T (FPA's submodel count) and e (RA's kept feature count) control the corresponding method's robustness vs. accuracy tradeoff. When optimizing patch and median robustness, hyperpa- rameters T and e were tuned on validation data.5 Patch Robustness We consider two CIFAR10 patch attacks: (1) a 5 × 5 pixel square [LF20a] and (2) all 24- pixel rectangles (e.g., 1 × 24 pixels, 24 × 1, 2 × 12, etc.), reporting each method's minimum and maximum certified accuracies across the eight valid shapes [MY21]. 6.2 Main Results Tables 1 and 2 summarize the median certified robustness and classification accuracy (resp.) for FPA and baseline RA. Table 3 details each method's mean certification time. Note that due to space, Tables 2 and 3 only report results for Jia et al.'s [Jia+22b] (significantly) better performing version of baseline RA. Table 4 analyzes FPA as a patch defense. We briefly summarize the experiments' takeaways below. See suppl. Secs. H.2 and H.3 for the full numerical results, including comparing the methods at additional robustness levels. Takeaway #1 FPA simultaneously provided larger and stronger median robustness guarantees than RA. As Ta- ble 1 details, FPA's median certified robustness was 20–30% larger than RA for classification and 3 to 4× larger for 5Secs. H.2 & H.3 compare each method's certified accuracy across a range of hyperparameter settings. 8 Table 3: Mean certification time in seconds for FPA and Jia et al.'s [Jia+22b] randomized ablation (RA). FPA is 2 to 3 orders of magnitude faster than baseline RA. Dataset CIFAR10 MNIST Weather Ames RA [Jia+22b] FPA (ours) Speedup e 15 25 45 60 Time T Time 5.4E+0 6.8E−1 3.1E−1 3.8E−1 115 60 21 21 7.3E−3 2.9E−3 1.0E−4 3.5E−4 743× 235× 3,134× 1,082× Table 4: CIFAR10 certified patch accuracy (% – larger is better) for FPA, RA, and three dedicated patch defenses. FPA is competitive despite making fewer assumptions and providing stronger guarantees than patch defenses. Method 24 Pixel Rect. Square Min. Max. 5 × 5 FPA Plurality (T = 180, ours) ←− 38.53 −→ 37.77 FPA Run-Off (T = 180, ours) ←− 41.60 −→ 40.95 Rand. Ablation [LF20b] ←− 28.95 −→ 28.21 Rand. Ablation [Jia+22b] ←− 37.31 −→ 36.43 (De)Random. Smoothing BagCert Patch IBP 0.0 43.11 - 72.68 60.17 57.69 59.95 - 30.30 regression. Importantly, FPA's certified feature guarantees apply to evasion, poisoning, and backdoor attacks, while baseline RA only covers evasion attacks. Takeaway #2 FPA's median robustness gains come at little cost in classification accuracy. Table 2 reports FPA's classification accuracy at two robustness levels: (1) FPA's best median robustness (blue) and (2) RA's best median robustness (bold). Table 2 also reports RA's classification accuracy at its own best median robustness (last column). For CIFAR10 at median robustness of 10 pixels, FPA's classification accuracy was 10.2 percentage points (pp) better than RA (75.0% vs. 64.7%). At rmed = 13, FPA's CIFAR10 classification accuracy was 62.4%, only 2.3pp lower than RA's classification accuracy at ρmed = 10. For Weather at median robustness 1, FPA's classification accuracy was 10.1pp better than RA (85.3% vs. 75.2%); even at rmed = 4, FPA's classification accuracy was 76.1%, 0.9pp better than RA at ρmed = 1. For MNIST at median robustness 10, FPA's classification accuracy was 3pp better than RA (96.1% vs. 93.1%). At rmed = 12, FPA's MNIST classification accuracy was 5.9pp lower than RA's classification accuracy at ρmed = 10 (87.2% vs. 93.1%). Takeaway #3 FPA certifies predictions 2 to 3 orders of magnitude faster than RA. Table 3 compares the mean certification times using the hyperparameter settings with the best median robustness. To certify one prediction, Jia et al.'s [Jia+22b] improved RA evaluates 100k ablated inputs. In contrast, FPA requires exactly T forward passes per prediction (one per submodel). Takeaway #4 FPA provides strong patch robustness without any assumptions about patch shape or the number of patches. As Table 4 details, FPA certifies 41.6% of CIFAR10 predictions at r = 24 perturbed pixels (2.3% of d) – regardless of patch shape or the number of patches. In contrast, (de)randomized smoothing's [LF20a] (BS, s = 12) 24-pixel certified accuracy varies between 0% to 72.7% based on patch shape alone. BagCert's certified accuracy drops as low as 43.1% for 24-pixel column and row patches – only 1.5pp better than FPA. Unlike FPA, patch defenses' certified accuracy guarantees decline further or even evaporate under (1) multiple patches, (2) training data perturbations, and (3) amorphous shapes. While less effective in some settings than dedicated patch defenses that 9 make stronger assumptions and weaker guarantees, FPA is still competitive, providing patch guarantees essentially for free. Takeaway #5 FPA is the first integrated defense to provide significant pointwise robustness guarantees over the union of evasion, backdoor, and poisoning attacks – l0 or otherwise. Consider CIFAR10 (n = 50,000) where FPA feature robustness r ≥ 25 (Table 4) certifies 41.0% of predictions' robustness against 1.25M arbitrarily perturbed pixels. In contrast, the only other certified defense robust over the union of evasion, backdoor, and poisoning attacks [Web+20] certifies the equivalent of 3 or fewer arbitrarily perturbed CIFAR10 pixels (i.e., a total training and test l2 perturbation distance of ≤3). Moreover, FPA certifies r ≥ 7 for 35.1% of Weather predictions (n > 3M – Table 28) – a pointwise guaranteed robustness of up to 21M arbitrarily perturbed feature values. 7 Conclusions This paper proposes feature partition aggregation – a certified defense against the union of l0 evasion, poisoning, and backdoor attacks. FPA provided stronger and larger robustness guarantees than the state-of-the-art l0 evasion defense, randomized ablation. FPA's certified feature guarantees are particularly important for vertically partitioned data where a single compromised data source allows an attacker to arbitrarily modify a limited number of features for all instances – training and test. To our knowledge, FPA is the first integrated defense providing non-trivial pointwise robustness guarantees against the union of evasion, poisoning, and backdoor attacks – l0 or otherwise [Web+20]. Future work remains to develop other lp certified defenses over this union of attack types. Acknowledgments The authors thank Jonathan Brophy for helpful discussions and feedback on earlier drafts of this manuscript. This work was supported by a grant from the Air Force Research Laboratory and the Defense Advanced Research Projects Agency (DARPA) - agreement number FA8750-16-C-0166, subcontract K001892-00-S05, as well as a second grant from DARPA, agreement number HR00112090135. This work benefited from access to the University of Oregon high-performance computer, Talapas. References [Bar17] [BNL12] [BHL23] [Bro+17] [Cal+21] [Che+22] [Che+17] [Chi+20a] Jonathan T. Barron. Continuously Differentiable Exponential Linear Units. 2017. arXiv: 1704.07483 [cs.LG]. Battista Biggio, Blaine Nelson, and Pavel Laskov. "Poisoning Attacks against Support Vector Machines". In: Proceedings of the 29th International Conference on Machine Learning. ICML'12. Edinburgh, Great Britain: PMLR, 2012. url: https://arxiv.org/abs/1206.6389. Jonathan Brophy, Zayd Hammoudeh, and Daniel Lowd. "Adapting and Evaluating Influence-Estimation Methods for Gradient-Boosted Decision Trees". In: Journal of Machine Learning Research 24 (2023), pp. 1–48. url: http: //jmlr.org/papers/v24/22-0449.html. Tom B. Brown, Dandelion Man ́e, Aurko Roy, Mart ́ın Abadi, and Justin Gilmer. Adversarial Patch. 2017. arXiv: 1712.09665 [cs.CV]. Stefano Calzavara, Claudio Lucchese, Federico Marcuzzi, and Salvatore Orlando. "Feature Partitioning for Robust Tree Ensembles and their Certification in Adversarial Scenarios". In: EURASIP Journal on Information Security (Dec. 2021), pp. 245–317. Ruoxin Chen, Zenan Li, Jie Li, Chentao Wu, and Junchi Yan. "On Collective Robustness of Bagging Against Data Poisoning". In: Proceedings of the 39th International Conference on Machine Learning. ICML'22. PMLR, 2022. url: https://arxiv.org/abs/2205.13176. Xinyun Chen, Chang Liu, Bo Li, Kimberly Lu, and Dawn Song. Targeted Backdoor Attacks on Deep Learning Systems Using Data Poisoning. 2017. arXiv: 1712.05526 [cs.CR]. Ping-yeh Chiang, Michael J. Curry, Ahmed Abdelkader, Aounon Kumar, John Dickerson, and Tom Goldstein. "Detection as Regression: Certified Object Detection by Median Smoothing". In: Proceedings of the 34th Confer- ence on Neural Information Processing Systems. NeurIPS'20. Virtual Only: Curran Associates, Inc., 2020. url: https://arxiv.org/abs/2007.03730. [Chi+20b] Ping-yeh Chiang, Renkun Ni, Ahmed Abdelkader, Chen Zhu, Christoph Studor, and Tom Goldstein. "Certified Defenses for Adversarial Patches". In: Proceedings of the 8th International Conference on Learning Representa- tions. ICLR'20. 2020. url: https://openreview.net/forum?id=HyeaSkrYPH. 10 [CRK19] [Col+17] [De 11] [Gu+19] [HL22] [HL23a] [HL23b] [Hua+20] [JCG21] [Jia+22a] [Jia+22b] Jeremy Cohen, Elan Rosenfeld, and Zico Kolter. "Certified Adversarial Robustness via Randomized Smoothing". In: Proceedings of the 36th International Conference on Machine Learning. ICML'19. PMLR, 2019. url: https: //proceedings.mlr.press/v97/cohen19c.html. Cody A. Coleman, Deepak Narayanan, Daniel Kang, Tian Zhao, Jian Zhang, Luigi Nardi, Peter Bailis, Kunle Olukotun, Chris R ́e, and Matei Zaharia. "DAWNBench: An End-to-End Deep Learning Benchmark and Compe- tition". In: Proceedings of the 2017 NeurIPS Workshop on Machine Learning Systems. Long Beach, California, USA: Curran Associates, Inc., 2017. url: https://dawn.cs.stanford.edu/benchmark/. Dean De Cock. "Ames, Iowa: Alternative to the Boston Housing Data as an End of Semester Regression Project". In: Journal of Statistics Education 19.3 (2011). Tianyu Gu, Kang Liu, Brendan Dolan-Gavitt, and Siddharth Garg. "BadNets: Evaluating Backdooring Attacks on Deep Neural Networks". In: IEEE Access 7 (2019), pp. 47230–47244. url: https://ieeexplore.ieee.org/ document/8685687. Zayd Hammoudeh and Daniel Lowd. "Identifying a Training-Set Attack's Target Using Renormalized Influence Estimation". In: Proceedings of the 29th ACM SIGSAC Conference on Computer and Communications Security. CCS'22. Los Angeles, CA: Association for Computing Machinery, 2022. url: https://arxiv.org/abs/2201. 10055. Zayd Hammoudeh and Daniel Lowd. "Feature Partition Aggregation: A Fast Certified Defense Against a Union of l0 Attacks". In: Proceedings of the 2nd ICML Workshop on New Frontiers in Adversarial Machine Learning. AdvML-Frontiers'23. 2023. url: https://arxiv.org/abs/2302.11628. Zayd Hammoudeh and Daniel Lowd. "Reducing Certified Regression to Certified Classification for General Poi- soning Attacks". In: Proceedings of the 1st IEEE Conference on Secure and Trustworthy Machine Learning. SaTML'23. 2023. url: https://arxiv.org/abs/2208.13904. W. Ronny Huang, Jonas Geiping, Liam Fowl, Gavin Taylor, and Tom Goldstein. "MetaPoison: Practical General- purpose Clean-label Data Poisoning". In: Proceedings of the 34th Conference on Neural Information Processing Systems. NeurIPS'20. Virtual Only: Curran Associates, Inc., 2020. url: https://arxiv.org/abs/2004.00225. Jinyuan Jia, Xiaoyu Cao, and Neil Zhenqiang Gong. "Intrinsic Certified Robustness of Bagging against Data Poisoning Attacks". In: Proceedings of the 35th AAAI Conference on Artificial Intelligence. AAAI'21. 2021. url: https://arxiv.org/abs/2008.04495. Jinyuan Jia, Yupei Liu, Xiaoyu Cao, and Neil Zhenqiang Gong. "Certified Robustness of Nearest Neighbors against Data Poisoning and Backdoor Attacks". In: Proceedings of the 36th AAAI Conference on Artificial Intelligence. AAAI'22. 2022. url: https://arxiv.org/abs/2012.03765. Jinyuan Jia, Binghui Wang, Xiaoyu Cao, Hongbin Liu, and Neil Zhenqiang Gong. "Almost Tight l0-norm Certi- fied Robustness of Top-k Predictions against Adversarial Perturbations". In: Proceedings of the 10th International Conference on Learning Representations. ICLR'22. 2022. url: https://openreview.net/forum?id=gJLEXy3ySpu. [Ke+17] [KT06] Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, Weidong Ma, Qiwei Ye, and Tie-Yan Liu. "LightGBM: A Highly Efficient Gradient Boosting Decision Tree". In: Proceedings of the 31st International Conference on Neural Information Processing Systems. NeurIPS'17. 2017. Jon Kleinberg and ́Eva Tardos. Algorithm Design. Addison Wesley, 2006. [KNH14] Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. The CIFAR-10 Dataset. 2014. [LeC+98] [Lee+19] [LF20a] [LF20b] [LF21] [LXL23] [LDD21] Yann LeCun, L ́eon Bottou, Yoshua Bengio, and Patrick Haffner. "Gradient-Based Learning Applied to Document Recognition". In: Proceedings of the IEEE. Vol. 86. 1998, pp. 2278–2324. Guang-He Lee, Yang Yuan, Shiyu Chang, and Tommi Jaakkola. "Tight Certificates of Adversarial Robustness for Randomly Smoothed Classifiers". In: Proceedings of the 33rd Conference on Neural Information Processing Systems. NeurIPS'19. 2019. url: https://arxiv.org/abs/1906.04948. Alexander Levine and Soheil Feizi. "(De)Randomized Smoothing for Certifiable Defense against Patch Attacks". In: Proceedings of the 34th International Conference on Neural Information Processing Systems. NeurIPS'20. Red Hook, NY, USA: Curran Associates Inc., 2020. url: https://arxiv.org/abs/2002.10733. Alexander Levine and Soheil Feizi. "Robustness Certificates for Sparse Adversarial Attacks by Randomized Ablation". In: Proceedings of the 34th AAAI Conference on Artificial Intelligence. AAAI Press, 2020. url: https://arxiv.org/abs/1911.09272. Alexander Levine and Soheil Feizi. "Deep Partition Aggregation: Provable Defenses against General Poisoning Attacks". In: Proceedings of the 9th International Conference on Learning Representations. ICLR'21. Virtual Only, 2021. url: https://arxiv.org/abs/2006.14768. Linyi Li, Tao Xie, and Bo Li. "SoK: Certified Robustness for Deep Neural Networks". In: Proceedings of the 44th IEEE Symposium on Security and Privacy. SP'23. IEEE, 2023. url: https://arxiv.org/abs/2009.04131. Xiling Li, Rafael Dowsley, and Martine De Cock. "Privacy-Preserving Feature Selection with Secure Multiparty Computation". In: Proceedings of the 38th International Conference on Machine Learning. ICML'21. 2021. url: https://arxiv.org/abs/2102.03517. 11 [Li+22] [LCY14] [Mal+21] [MY21] [Pag20] [Pas+19] [Rez+23] [Ros+20] [Sha+18] [SD20] [Sze+14] [Wal+21] Yiming Li, Baoyuan Wu, Yong Jiang, Zhifeng Li, and Shu-Tao Xia. "Backdoor Learning: A Survey". In: IEEE Transactions on Neural Networks and Learning Systems (2022). doi: 10 . 1109 / TNNLS . 2022 . 3182979. url: https://arxiv.org/abs/2007.08745. Min Lin, Qiang Chen, and Shuicheng Yan. "Network in Network". In: Proceedings of the 2nd International Conference on Learning Representations. ICLR'14. 2014. url: https://arxiv.org/abs/1312.4400. Andrey Malinin, Neil Band, Yarin Gal, Mark Gales, Alexander Ganshin, German Chesnokov, Alexey Noskov, An- drey Ploskonosov, Liudmila Prokhorenkova, Ivan Provilkov, Vatsal Raina, Vyas Raina, Denis Roginskiy, Mariya Shmatova, Panagiotis Tigas, and Boris Yangel. "Shifts: A Dataset of Real Distributional Shift Across Mul- tiple Large-Scale Tasks". In: Proceedings of the 35th Conference on Neural Information Processing Systems. NeurIPS'21. Curran Associates, Inc., 2021. url: https://arxiv.org/abs/2107.07455. Jan Hendrik Metzen and Maksym Yatsura. "Efficient Certified Defenses Against Patch Attacks on Image Clas- sifiers". In: Proceedings of the 9th International Conference on Learning Representations. ICLR'21. 2021. url: https://openreview.net/forum?id=hr-3PMvDpil. David Page. "How to Train Your ResNet". In: (May 2020). url: https://myrtle.ai/learn/how- to- train- your-resnet/. Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zem- ing Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Mar- tin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. "PyTorch: An Imperative Style, High-Performance Deep Learning Library". In: Proceedings of the 33rd Confer- ence on Neural Information Processing Systems. NeurIPS'19. 2019. url: https://arxiv.org/abs/1912.01703. Keivan Rezaei, Kiarash Banihashem, Atoosa Chegini, and Soheil Feizi. "Run-Off Election: Improved Provable Defense against Data Poisoning Attacks". In: Proceedings of the 40th International Conference on Machine Learning. ICML'23. 2023. url: https://arxiv.org/abs/2302.02300. Elan Rosenfeld, Ezra Winston, Pradeep Ravikumar, and J. Zico Kolter. "Certified Robustness to Label-Flipping Attacks via Randomized Smoothing". In: Proceedings of the 37th International Conference on Machine Learning. ICML'20. 2020. url: https://arxiv.org/abs/2002.03018. Ali Shafahi, W. Ronny Huang, Mahyar Najibi, Octavian Suciu, Christoph Studer, Tudor Dumitras, and Tom Goldstein. "Poison Frogs! Targeted Clean-Label Poisoning Attacks on Neural Networks". In: Proceedings of the 32nd Conference on Neural Information Processing Systems. NeurIPS'18. 2018. url: https://arxiv.org/abs/ 1804.00792. Cecilia Summers and Michael J. Dinneen. "Four Things Everyone Should Know to Improve Batch Normalization". In: Proceedings of the 8th International Conference on Learning Representations. ICLR'20. Virtual Only, 2020. url: https://arxiv.org/abs/1906.03548. Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. "Intriguing Properties of Neural Networks". In: Proceedings of the 2nd International Conference on Learning Representations. ICLR'14. 2014. url: https://arxiv.org/abs/1312.6199. Eric Wallace, Tony Z. Zhao, Shi Feng, and Sameer Singh. "Concealed Data Poisoning Attacks on NLP Models". In: Proceedings of the North American Chapter of the Association for Computational Linguistics. NAACL'21. 2021. url: https://arxiv.org/abs/2010.12563. [WF23] Wenxiao Wang and Soheil Feizi. Temporal Robustness Against Data Poisoning. 2023. arXiv: 2302.03684 [cs.LG]. [WLF22a] Wenxiao Wang, Alexander Levine, and Soheil Feizi. "Improved Certified Defenses against Data Poisoning with (Deterministic) Finite Aggregation". In: Proceedings of the 39th International Conference on Machine Learning. ICML'22. 2022. url: https://arxiv.org/abs/2202.02628. [WLF22b] Wenxiao Wang, Alexander Levine, and Soheil Feizi. "Lethal Dose Conjecture on Data Poisoning". In: Proceedings of the 36th Conference on Neural Information Processing Systems. NeurIPS'22. Curran Associates, Inc., 2022. url: https://arxiv.org/abs/2208.03309. [Web+20] [Wei+22] Maurice Weber, Xiaojun Xu, Bojan Karlaˇs, Ce Zhang, and Bo Li. RAB: Provable Robustness Against Backdoor Attacks. 2020. arXiv: 2003.08904 [cs.LG]. Kang Wei, Jun Li, Chuan Ma, Ming Ding, Sha Wei, Fan Wu, Guihai Chen, and Thilina Ranbaduge. Vertical Federated Learning: Challenges, Methodologies and Experiments. 2022. arXiv: 2202.04309 [cs.LG]. 12 Feature Partition Aggregation: A Fast Certified Defense Against a Union of l0 Attacks Supplemental Materials Organization of the Appendix A Nomenclature Reference B Proofs A3 A5 B.1 Theorems from the Main Paper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A5 B.2 Lemmas from the Supplemental Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A7 C Related Work: Extended Discussion A10 C.1 Summarized Comparison of Closely Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . A10 C.2 l0-Norm Certified Evasion Defenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A10 C.3 Instance-wise Certified Poisoning Defenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A11 C.4 Certified Defenses against the Union of lp Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . A12 D Certifying a Top-k Prediction E On a Sparse Attacker that Modifies Training Labels A13 A15 E.1 Training Instance Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A15 E.2 Training Label Partitioning with Semi-Supervised Learning . . . . . . . . . . . . . . . . . . . . . A16 F On Overlapping Submodel Feature Sets A17 F.1 Certified Feature Robustness with Overlapping Feature Sets . . . . . . . . . . . . . . . . . . . . . A17 F.2 Limitations of Overlapping Feature Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A18 F.3 Empirical Evaluation of Overlapping Feature Sets for Certified Feature Robustness . . . . . . . . A18 G Evaluation Setup A22 G.1 Hardware Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A22 G.2 Baselines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A22 G.3 Datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A22 G.4 Network Architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A23 G.5 Hyperparameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A23 G.6 Overview of the Certified Regression to Certified Classification Reduction . . . . . . . . . . . . . A25 H Additional Experiments A28 H.1 Non-Robust Accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A28 H.2 Detailed Median Certified Robustness Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A29 H.3 Feature Partition Aggregation and Randomized Ablation Certified Accuracy Comparison . . . . A34 H.4 Feature Partition Aggregation Model Count Hyperparameter Analysis . . . . . . . . . . . . . . . A42 H.5 Randomized Ablation Number of Kept Features (e) Hyperparameter Analysis . . . . . . . . . . . A44 H.6 Comparing FPA Plurality Voting and Run-Off Certification . . . . . . . . . . . . . . . . . . . . . A46 H.7 Random vs. Deterministic Feature Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . A49 H.8 Model Training Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A51 A2 A Nomenclature Reference Scalars and functions are denoted with lowercase italics letters. Vectors are denoted as lowercase bold letters. Matrices are denoted as uppercase bold letters. The j-th column of a matrix A is denoted Aj. Table 5: Nomenclature Reference: Related symbols are grouped together. For example, the first group lists the acronyms of methods evaluated in this work. This table also includes nomenclature symbols that only appear in the supplement. FPA RA DPA DRS Patch IBP BagCert Our certified defense, feature partition aggregation, against sparse poisoning, backdoor, evasion, and patch attacks Randomized ablation. Certified l0-norm evasion defense. Proposed by Levine and Feizi [LF20b] and subsequently improved by Jia et al. [Jia+22b] Deep partition aggregation certified instance-wise poisoning defense proposed by Levine and Feizi [LF21] (De)randomized smoothing certified patch defense proposed by Levine and Feizi [LF20a]. Based on randomized ablation Certified patch defense based on interval bound propagation proposed by Chiang et al. [Chi+20b] Certified patch defense proposed by Metzen and Yatsura [MY21] RAB Robustness against backdoors certified defense proposed by Weber et al. [Web+20] LightGBM Gradient-boosted decision tree model architecture [Ke+17] r rmed ρ ρmed ̄ρ (cid:101)r [m] 1[q] ∥w∥0 Xj X ⊖ X′ xj x ⊖ x′ dsym(D, D′) pp n X x d [d] Y y (xi, yi) X y Pointwise certified feature robustness – feature partition aggregation's certification objective (Def. 1) Median certified feature robustness w.r.t. a dataset's test set Pointwise l0-norm certified evasion-only robustness (Def. 2). A weaker guarantee than certified feature robustness. Median l0-norm certified evasion-only robustness w.r.t. a dataset's test set Certified instance-wise poisoning robustness. (Def. 9 – Sec. C). Pointwise certified feature and label-flipping robustness (Def. 11 – Sec. E) Integer set {1, . . . , m} where m ∈ N Indicator function where 1[q] = 1 if q is true and 0 otherwise l0 norm for vector w, i.e., the number of non-zero elements in w j-th column of matrix X where j ∈ [d] and Xj ∈ Rn Set column X ⊖ X′ = {j ∈ [d] : Xj ̸= X′ j-th dimension of vector x where j ∈ [d] and xj ∈ R Set of dimensions over which vectors x and x′ differ where x ⊖ x′ = {j ∈ [d] : xj ̸= x′ Symmetric difference between sets D and D′ Percentage points equal-size matrices X and X′ over which indices j} of j} differ, where Number of training instances Feature domain where X ⊆ Rd Feature vector where ∀x x ∈ X Feature dimension where ∀x|x| = d Complete feature set Label set where Y ⊆ N Instance label where ∀y y ∈ Y Arbitrary training instance where xi ∈ X , yi ∈ Y, and i ∈ [n] ⊺ Training feature matrix where X := [ x1 * * * xn ] Training label vector where y := [y1, . . . , yn] and X ∈ Rn×d A3 (Continued . . . ) Table 5: Nomenclature Reference (Continued): Related symbols are grouped together. f T St xSt Dt φ f (x) ft(x) ̇cy(x) Gapvote(y, y′; x) ypl yru gt(x, y) yRO (cid:101)yRO ̈cx(y; y′) Gaplogit(y, y′; x) f (x; k) (cid:101)y htr hS e BS Voting-based, ensemble classifier trained over partitioned feature sets where f : X → Y Number of submodels in ensemble f Feature subset considered by the t-th submodel during training and test where St ⊂ [d] and (cid:70)T t=1 St = [d] Subvector of x ∈ X restricted to feature subset St ⊂ [d] Training set for the t-th submodel vote Spread degree of the (overlapping) feature subsets D1, D2, . . . ; by default, φ = 1 (Sec. F). Model prediction for instance x ∈ X and f (x) ∈ Y Label predicted by the t-th submodel for instance x ∈ X where ft(x) := arg maxy∈Y gt(x, y) Submodel vote count for label y and feature vector x where ̇cy(x) := (cid:80)T Submodel Gapvote(y, y′; x) := ̇cy(x) − ̇cy′ (x) − 1[y′ < y] Submodel plurality label where ypl := arg maxy∈Y ̇cy(x) and ties broken by preferring the smaller label. FPA ensemble prediction under the plurality label decision function (Sec. 4.1) Label with the second-most submodel votes (i.e., the "runner up") where yru := arg maxy′∈Y\ypl ̇cy′ (x) Logit value predicted by the t-th submodel for instance x ∈ X and label y ∈ Y where gt(x, y) ∈ [0, 1] FPA ensemble prediction under the run-off decision function (Sec. 4.2). 1[ft(x) = y] t=1 labels y, y′ ∈ Y instance where x ∈ X and gap for Label in the run-off decision function's second round that is not selected as the run-off prediction where (cid:101)yRO := {ypl, yru} \ yRO Pairwise logit ̈cy(x; y′) := (cid:80)T Submodel logit vote gap for labels y, y′ ∈ Y where Gaplogit(y, y′; x) := ̈cy(x; y′) − ̈cy′ (x; y) − 1[y′ < y] Top-k model prediction for instance x ∈ X (Sec. D) count for 1[gt(x, y) > gt(x, y′)] y′ ∈ Y where y ∈ Y w.r.t. instance label label and t=1 x Label with the (k + 1)-th most submodel votes (Sec. D) Instance space mapping function where htr : X × Y → [T ] (Sec. E). Feature subset mapping function for overlapping feature sets where hS : [φT ] → [φT ] (Sec. F) Randomized ablation hyperparameter – number of kept features with the other (d − e) ablated where e ∈ N. Blocking smoothing ablation paradigm used by (de)randomized smoothing [LF20a] A4 B Proofs This section contains all proofs for our theoretical contributions. Sec. B.1 provides the proofs for the main paper's theoretical contributions. Due to space, some of our theoretical contributions appear only in the supplement. Sec. B.2 contains the proofs for these supplement-only theoretical contributions. B.1 Theorems from the Main Paper This section provides the proofs for our theoretical contributions in the main paper. Proof of Theorem 3 Proof. Let ∆ := ̇cypl (x) − ̇cyru (x) ≤ ∀y′ /∈Y\{ypl,yru} ̇cypl (x) − ̇cy′ (x). In words, vote-count difference ∆ between plurality label ypl and runner-up label yru is at least as small as the gap between ypl and any other label. (9) In the worst case, a single feature perturbation changes a single submodel's vote from plurality label ypl to a label of the adversary's choosing. Each perturbed submodel prediction reduces the gap between the plurality label and the adversary's chosen label by two. By Eq. (9), it takes the fewest number of vote changes for yru to overtake plurality label ypl with the proof following by induction. ∆ then lower bounds the certified robustness. When determining r, ∆ may be even or odd. We separately consider both cases below. Case #1: ∆ is odd. Since ∆ is odd, there can never be a tie between labels ypl and yru, simplifying the analysis. Then, the maximum number of submodel predictions that can change without changing the plurality label is any r ∈ N satisfying ̇cyru (x) + 2r < ̇cypl (x) r < r = ̇cypl (x) − ̇cyru (x) 2 (cid:22) ̇cypl (x) − ̇cyru (x) 2 (cid:23) = = (cid:22) ̇cypl (x) − ̇cyru (x) − 1[yru < ypl] 2 (cid:23) (cid:22) Gapvote(ypl, yru; x) 2 (cid:23) (10) (11) ▷ r must be a whole number (12) ▷ Subtracting 1 has no effect when ∆ odd (13) ▷ Eq. (1). (14) Case #2: ∆ is even. For even-valued ∆, ties can occur. If yru < ypl, the tie between ypl and yru is broken in favor of yru. Then, the number of submodel predictions that can change without changing the plurality label is any r ∈ N satisfying ̇cyru (x) + 1[yru < ypl] + 2r < ̇cypl (x) r ≤ r = ̇cypl (x) − ̇cyru (x) − 1[yru < ypl] 2 (cid:22) ̇cypl (x) − ̇cyru (x) − 1[yru < ypl] 2 (cid:23) = (cid:22) Gapvote(ypl, yru; x) 2 (cid:23) (15) (16) ▷ r must be a whole number (17) ▷ Eq. (1). (18) A5 Theorem 3's definition of r follows the same basic structure as that of deep partition aggregation [LF21, Eq. (10)]. Proof of Claims Related to Theorem 4 Lemma 5. Let f1, . . . , fT be a set of T models where ∀t∈[T ] ft : X → Y. Under submodel voting, label y ∈ Y is preferred over label y′ ∈ Y \ y w.r.t. instance x ∈ X if and only if Gapvote(y, y′; x) ≥ 0. Proof. Label y is preferred over label y′ in only two cases: 1. y receives more (sub)model votes than y′, i.e., ̇cy(x) > ̇cy′ (x). 2. y and y′ receive the same number of votes and y < y′. In the first case, In the second case, Gapvote(y, y′; x) := ̇cy(x) − ̇cy′ (x) − 1(cid:2)y′ < y(cid:3) ≥ 1 − 1(cid:2)y′ < y(cid:3) ≥ 1 − 1 = 0. Gapvote(y, y′; x) := ̇cy(x) − ̇cy′ (x) − 1(cid:2)y′ < y(cid:3) = 0 − 1(cid:2)y′ < y(cid:3) = 0 − 0 = 0. The reverse direction where Gapvote(y, y′; x) ≥ 0 =⇒ y is preferred over y′ can be proven by contradiction using If y′ receives more votes than y, then Gapvote(y, y′; x) < 0, a contradiction. Similarly, if similar logic as above. ̇cy(x) = ̇cy′ (x) then necessarily y′ < y. This also leads to a contradiction as Gapvote(y, y′; x) would be negative. Lemma 6. Runoff Elections Case #1 Certified Feature Robustness Given submodel feature partition S1, . . . , ST , let f be a voting-based ensemble of T submodels, where the t-th submodel uses only the features in St. For instance x ∈ X , let yRO be the label selected by the run-off decision function. The certified feature robustness of yRO getting overtaken in round #2 of the run-off election is rCase1 RO := min y∈Y\yRO max (cid:26)(cid:22) Gapvote((cid:101)yRO, y) 2 (cid:23) , (cid:22) Gaplogit(yRO, y) 2 (cid:23)(cid:27) Proof. For a label y ∈ Y \ yRO to overtake yRO, two requirements must be simultaneously met: • y and yRO must be round #1's top-two labels, and • y must be preferred over yRO in round #2. Let (cid:101)yRO ∈ Y \ ypl denote the other top-two label in round #1. Note that (cid:101)yRO may or may not be the same as y. The robustness of (cid:101)yRO to being overtaken by y in round #1 follows directly from Theorem 3 and equals r′ = (cid:22) Gapvote((cid:101)yRO, y; x) 2 (cid:23) . (19) Concerning the second requirement, yRO is preferred over y in round #2 so long as Gaplogit(yRO, y; x) ≥ 0. Following similar logic as above, yRO's certified feature robustness in round #2 is (cid:22) Gaplogit(yRO, y; x) 2 r′′ = (20) (cid:23) . Since both requirements must hold, the certified feature robustness is lower bounded by both (i.e., the maximum) of Eqs. (19) and (20). Moreover, the optimal label y ∈ Y \ yRO is not determined a priori meaning all labels need to be checked. A6 Lemma 7. Runoff Elections Case #2 Certified Feature Robustness Given submodel feature partition S1, . . . , ST , let f be a voting-based ensemble of T submodels, where the t-th submodel uses only the features in St. For instance x ∈ X , let yRO be the label selected by the run-off decision function. Define recursive function dp as (cid:40) dp[i, j] = 0 1 + min{dp[i − 2, j − 1], dp[i − 1, j − 2]} Otherwise min{i, j} ≤ 1 and (i, j) ̸= (1, 1) (21) Then yRO's certified feature robustness of remaining in the top-two round #1 labels predicted by the submodels is where gapy∗ = max{0, Gapvote(yRO, y∗)}. rCase2 RO := min y,y′∈Y\yRO dp(cid:2)gapy, gapy′ (cid:3) Proof. Lemma 5 proves that a label y is preferred over another label y′ iff Gapvote(y, y′; x) ≥ 0. For label yRO to be in round #1's top two, no pair of labels can have negative submodel vote gaps w.r.t. yRO. Determining yRO's round #1 certified feature robustness reduces to determining the maximum number of submodel votes that can be perturbed with it remaining guaranteed that both labels do not have negative submodel vote gaps. In the best case for an attacker, perturbing a single submodel changes the submodel's predicted label from yRO to a label of the attacker's choosing, e.g., y ̸= yRO; this perturbation decreases Gapvote(yRO, y; x) by 2. For all other y′ ∈ Y \ {yRO, y}, this perturbation also decreases Gapvote(yRO, y′; x) by 1. By definition, yRO is in the top-two round #1 labels, meaning rCase2 Consider first when max{Gapvote(yRO, y), Gapvote(yRO, y′)} ≤ 1 and (i, j) ̸= (1, 1). The attacker perturbs whichever label y, y′ has the larger submodel vote gap. Since at most one of these two labels has a positive gap, an additional submodel pertur- bation could make both Gapvote(yRO, y) and Gapvote(yRO, y′) negative meaning no further feature perturbations are possible. In the special case of i = j = 1, perturbing a submodel predicting either label y or y′ never causes the other label's submodel vote gap to be negative meaning one additional submodel feature perturbation is possible. When max{Gapvote(yRO, y), Gapvote(yRO, y′)} > 1, the proof follows by induction where recursive function dp returns the fewest number of submodel perturbations required given y, y′ ∈ Y. RO ≥ 0. Since the attacker's optimal pair of labels y, y′ is not determined a priori, Eq. (7)'s feature guarantee considers all pairs of labels and returns the robustness of the pair most advantageous to the attacker. Proof of Theorem 4 Proof. For a given x ∈ X , there are only two possible ways that run-off prediction yRO ∈ Y can be perturbed, namely: 1. yRO loses in run-off's second round. 2. yRO fails to qualify for the second round by not being in the top two labels in round #1. These two cases align directly with Lemmas 6 and 7, respectively. An optimal attacker targets whichever of the two cases requires fewer feature perturbations. Therefore, run-off's certified feature robustness is the minimum of Eqs. (5) and (7). B.2 Lemmas from the Supplemental Materials This section provides the proofs for our theoretical contributions that appear only in the supplement. A7 Proof of Theorem 10 Alg. 1's iterative greedy strategy is formalized below. Def. 8. Certified Feature Robustness Greedy Strategy Given target label y ∈ Y, plurality label ypl ∈ Y, and label (cid:101)y ∈ Y with the (k + 1)-th most votes, if ̇cy(x) > 0, decrement ̇cy(x) by 1; otherwise, decrement ̇cypl (x) by 1. Increment both ̇c (cid:101)y(x) and certified feature robustness r by 1. Theorem 10's proof references Def. 8 for brevity. Proof. We follow the classic "greedy stays ahead " proof strategy [KT06]. In short, given some iterative greedy strategy, the greedy algorithm always does better at each iteration than any other algorithm. Also, observe that the order that the greedy strategy perturbs the labels does not affect the optimality of the bound since each perturbation is strictly increasing, additive, and fully commutative. In short, Def. 8's greedy strategy minimizes at each iteration the margin between y's vote count, ̇cy(x), and the vote count of the label with the (k + 1)-th most votes, i.e., (cid:101)y(x). Recall that Theorem 3's proof above for top-1 certified robustness only considers the runner-up label yru since all other labels y′ /∈ Y \ {y, yru} require at least as many label changes as runner-up yru to overtake plurality label y. Def. 8's greedy strategy generalizes this idea where now only the top (k + 1) labels are considered and the rest of the labels ignored. ̇c Each iteration of Alg. 1 may have a different label with the (k + 1)-th most votes. For a given iteration, denote this label (cid:101)y, making label y's margin of remaining in the top k ∆ := ̇cy(x) − ̇c (cid:101)y(x). (cid:101)y(x) has the effect of maximally reducing their differ- Trivially, maximally reducing ̇cy(x) and maximally increasing ̇c ence ∆. While it is always possible to increase ̇c (cid:101)y(x), it is not always possible to always reduce ̇cy(x). Our greedy approach, as implemented in Alg. 1, conditions each iteration's strategy based on whether ̇cy(x) can be reduced, i.e., whether ̇cy(x) > 0. (22) Case #1: ̇cy(x) > 0. In each iteration, a single submodel prediction is changed. Changing one submodel prediction ft(x) from label y (cid:101)y(x). No other allocation to label (cid:101)y maximally decreases ̇cy(x). Moreover, transferring the vote to (cid:101)y also increases ̇c of the votes could reduce ∆ more in particular since the order of the votes being reallocated does not matter. Case #2: ̇cy(x) = 0. No label can have negative votes so ̇cy(x) cannot be further reduced. Reducing the margin exclusively entails (cid:101)y(x). Def. 8 and Alg. 1 transfer a vote from the plurality label ypl := arg maxy′∈Y ̇cy′ (x) to (cid:101)y(x) monotonically increases and no vote is maximally increasing ̇c label (cid:101)y. Transferring the vote from the plurality label guarantees that ̇c ever transferred twice since k < T . Proof of Lemma 12 Proof. This proof follows directly from the proof of Thm. 3 with one difference. When training labels y1, . . . , yn may not be pristine, an adversary can use malicious training labels to modify a submodel prediction. Each training label is considered by exactly one submodel. An adversarial label change has the same worst-case effect as an adversarial feature perturbation, meaning the certified robustness derivation in Thm. 3's proof applies here unchanged (other than the definition of robustness). Hence, similar to Eq. (3), (cid:22) Gapvote(ypl, yru) 2 (cid:23) . (cid:101)r = (23) A8 Proof of Lemma 13 Proof. This proof follows directly from Lem. 12's proof. As above, a single adversarial label flip or feature perturbation still changes at most one submodel prediction. Training submodels with (deterministic) semi-supervised learning does not change the mechanics of the ensemble decision. Therefore, Lem. 12's certified guarantee derivation remains unchanged between partitioning the training instances versus partitioning the training labels with semi-supervised learning. Proof of Lemma 14 Proof. This proof follows directly from Wang et al.'s [WLF22a] Theorem 2; we direct the reader to the original paper for Wang et al.'s complete derivation. For brevity, we directly apply Wang et al.'s result below. Both FPA and Wang et al.'s deterministic finite aggregation (DFA) train an ensemble of φT submodels, with each submodel considering the union of φ disjoint sets of objects. The only difference between the two formulations is that DFA considers sets of training instances while FPA considers sets of features; the differences in the two methods' certified guarantees arise solely out of this one difference in formulation. DFA provides guarantees w.r.t. training instances, i.e., w.r.t. overlapping objects in the sets. Since FPA's sets instead contain feature dimensions, FPA certifies feature robustness. Eq. (31)'s robustness bound is identical to Wang et al.'s Theorem 2, albeit with slightly different notation. Note that Wang et al. do not contextualize their Theorem 2 w.r.t. top-k predictions. Rather Wang et al. specify their guarantees w.r.t. correct/incorrect predictions, which is equivalent to top-1 accuracy. A9 C Related Work: Extended Discussion Section 3 briefly summarizes work closely related to our certified defense, feature partition aggregation (FPA). Due to space, we deferred this more extensive discussion of related work to the supplement. C.1 Summarized Comparison of Closely Related Work Table 6 provides a summarized comparison of the certified defenses most relevant to this work. Table 6: Certified defense comparison for the primary methods considered in this work, namely: fea- ture partition aggregation (FPA), randomized ablation (RA), (de)randomized smoothing (DRS), and deep partition aggregation (DPA). This comparison covers the types of guarantees each method provides as well as each method's model architecture. Property Evasion Defense Patch Defense Poison Defense Backdoor Defense FPA (ours) Rand. Ablate. (De)Rand. Smooth. DPA Method ✓ ✓ ✓* ✓ ✓ ✓ ✓ ✓ Guarantee Type Guarantee Dimension Deterministic Feature-wise Probabilistic Feature-Wise Deterministic Square Patch* Model Type Ensemble Smoothed Smoothed ✓ Deterministic Instance-wise Ensemble C.2 l0-Norm Certified Evasion Defenses These defenses represent the most closely related work. Given (test) instance (x, y), l0-norm defenses certify the number of features that change in test instance x without changing prediction f (x) (Def. 2). Originally proposed by Levine and Feizi [LF20b] and subsequently improved by Jia et al. [Jia+22b], randomized ablation (RA) is the current state-of-the-art l0-norm certified defense. RA is smoothing-based [CRK19; Ros+20]. Given some feature vector x, RA's underlying classifier labels multiple random perturbations of x; the model's smoothed prediction is the plurality label across these randomly perturbed predictions. Also generated from the perturbed predictions is a lower bound on the probability of predicting the plurality label as well as upper bounds on probabilities all other labels.6 These probability bounds are then used to calculate RA's certified probabilistic guarantee ρ. The type of perturbation dictates the type of certified guarantee smoothing yields. For example, to certify robustness against label-flipping attacks, Rosenfeld et al. [Ros+20] train multiple submodels, each using a different set of randomly perturbed training labels (y). Randomized ablation uses a novel ablation strategy customized for l0 attacks; specifically, for each ablated input of x, (d − e) randomly-selected features are "turned off" (i.e., ablated),7 with the remaining e features left unchanged. If an attacker perturbs m unknown features in x, then via combinatorics, we can determine the probability that one or more perturbed features intersect with the ablated input's kept features; if the feature-set intersection is empty, then the adversarial perturbation had no effect on the ablated prediction. RA combines this insight with the Neyman-Pearson Lemma to calculate l0-norm robustness ρ [Jia+22b]. Levine and Feizi's [LF20b] RA guarantees are often loose in practice, particularly for larger values of ρ. More recently, Jia et al. [Jia+22b] propose improved certification analysis that generates tight RA guarantees for top-1 predictions and almost tight guarantees for top-k predictions. 6These upper and lower bounds are probabilistic given some user-specific hyperparameter α ∈ (0, 1). 7To mark a feature as turned-off, randomized ablation relies on a custom feature encoding that doubles the number of features. For details, see the original randomized ablation paper [LF20b]. A10 Given the looseness of Levine and Feizi's [LF20b] certified guarantees, RA's effectiveness as certified patch defense is limited. To that end, Levine and Feizi [LF20a] propose (de)randomized smoothing (DRS) – a specialized version of RA for patch attacks. The primary differences between RA and DRS are: 1. RA provides l0-norm guarantees (Def. 2) while DRS provides patch guarantees. Both of these guarantees apply to evasion attacks only. 2. As its name indicates, randomized ablation's smoothing process selects the set of kept (i.e., non-ablated) features uniformly at random. By restricting consideration to just patches, DRS restricts the number of possible attacks from order O((cid:0) d (cid:1)) to O(d). More practically, exponentially fewer possible perturbations allow DRS to certify a prediction with far fewer ablated inputs – so few that DRS's ablation set can usually be tested exhaustively. m 3. Since RA considers only a random subset of the possible ablations, RA provides only probabilistic guarantees. By exhaustively testing a deterministic set of possible ablations, DRS provides deterministic guarantees. Levine and Feizi's [LF20a] empirical evaluation of DRS considers exclusively square patches. Table 4 details how some rectangular patch shapes drop DRS's certified accuracy to 0%. Table 6 above lists DRS as providing guarantees w.r.t. specifically square patches since as Metzen and Yatsura [MY21] state in the BagCert paper, "we do not consider [(de)randomized smoothing] with column smoothing...[a] general patch defense, despite good performance for square patches and efficient certification analysis..." To summarize the differences between the various certified l0 and patch defenses: 1. FPA provides guarantees over the union of l0 evasion, backdoor, and poisoning attacks, while RA and DRS provide no training robustness guarantees. 2. FPA trains an ensemble of (non-smoothed) classifiers, while RA and DRS train a single smoothed classifier. 3. During both training and inference, feature ablation functionally marks any ablated feature as missing; this generally restricts RA and DRS to model architectures that are robust under missing data. In practice, feature ablation works best when combined with parametric model architectures (e.g., neural networks) that are trained using first-order methods. Ablated training and inference cannot be directly combined with tree- based methods such as gradient-boosted decision trees (GBDTs). By contrast, FPA supports any submodel architecture. Therefore, unlike RA and DRS, FPA can use whichever submodel architectures works best for a given application. 4. FPA and RA consider more general l0 attacks, while DRS considers more restrictive patch attacks. 5. FPA and DRS provide deterministic guarantees, while RA provides only probabilistic guarantees. 6. DRS's deterministic ablation patterns (e.g., band smoothing and block smoothing) generally perform poorly when used as deterministic feature partitions. Calzavara et al. [Cal+21] propose a binary classification only l0-norm certified defense based on decision tree ensembles. Like FPA, Calzavara et al. use feature partitioning to bootstrap their guarantees. However, Calzavara et al.'s certification procedure is NP-complete in the worst case via reduction to partial set cover. Moreover, each of Calzavara et al.'s models certifies a single l0-norm robustness level, potentially requiring a different model to be trained for each target robustness level ρ. C.3 Instance-wise Certified Poisoning Defenses The second class of defenses related to FPA certify robustness against instance-wise data poisoning. Specifically, these methods provide pointwise guarantees on the number of arbitrary instances that can be inserted into or deleted from the training set without changing model prediction f (x).8 Def. 9 formalizes instance-wise poisoning guarantees as commonly defined in related work [LF21; WLF22b; WLF22a; Rez+23; WF23], where function dsym denotes the symmetric difference. Def. 9. Instance-wise Certified Poisoning Robustness Given model f trained on training set D = {(xi, yi)}n and model f ′ trained on D′ = {(xj, yj)}m ministic guarantee w.r.t. instance x where |dsym(D, D′)| ≤ ̄ρ =⇒ f (x) = f ′(x). i=1 j=1, instance-wise certified poisoning robustness ̄ρ ∈ N is a pointwise, deter- 8Recall that FPA's certified feature robustness (Def. 1) provides guarantees on the number of features – training or test – an attacker can perturb. FPA does not certify robustness w.r.t. instances like DPA. A11 The first poisoning defense to provide non-trivial instance-wise guarantees was deep partition aggregation (DPA) [LF21]. Described briefly, let htr : Rd → [T ] be a deterministic function that partitions the instance space into T disjoint sub- regions. DPA trains an ensemble of T deterministic submodels where each submodel's training set is drawn from a different htr subregion. Levine and Feizi's [LF21] formulation of DPA relies on plurality voting as the decision function. FPA is heavily inspired by DPA, so we chose to name our method similarly. Rezaei et al. [Rez+23] propose run-off elections – an alternate DPA decision function and certification procedure. Run-off elections require no retraining of the DPA ensemble, meaning run-off can increase DPA's certified guarantees essentially for free. Additional instance-wise poisoning defenses include Jia et al.'s [Jia+22a] nearest-neighbor defense and Wang et al.'s [WLF22a] finite aggregation. A major strength of FPA is its ability to directly leverage the properties implicit in existing voting-based tech- niques. More specifically, FPA can directly leverage both plurality voting and run-off election decision functions to maximize our certified guarantees. C.4 Certified Defenses against the Union of lp Attacks Feature partition aggregation (FPA) is the first certified defense robust against the union of l0 evasion, backdoor, and poisoning attacks. To our knowledge, the only other certified method robust over this union of attack types is Weber et al.'s [Web+20] robustness against backdoors (RAB) defense, which focuses on l2 robustness. RAB extends randomized smoothing by training an ensemble of smoothed classifiers. Each smoothed RAB submodel is trained on a unique smoothed training set where i.i.d. random (Gaussian) noise is added to each training instance's feature vector. To better understand RAB's certified guarantees, let δi ∈ Rd denote the adversarial perturbation added to the i-th training instance, δx ∈ Rd denote the backdoor trigger added to target test instance x, and b ∈ R≥0 denote RAB's certified guarantee. Then, RAB defines a prediction as pointwise certifiably robust whenever (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) ∥δi∥2 2 < b (24) i=1 implies (with high probability) that clean and poisoned training sets would have the same prediction for feature vector x + δx. In practice, RAB provides comparatively small robustness guarantees b. For example, consider CIFAR10 where RAB's maximum reported certified robustness is bmax ≤ 3 [Web+20, Fig. 4b]. An attacker could violate this bound by arbitrarily modifying as few as three RGB pixels across the entire training set. In contrast, FPA can certify 41.0% of CIFAR10 predictions up to 1.25M arbitrarily perturbed pixels (see Takeaway #5 in Sec. 6.2). A12 D Certifying a Top-k Prediction In line with Jia et al.'s [Jia+22b] extension of randomized ablation to top-k certification, below we generalize FPA with plurality voting to top-k predictions below. For simplicity of presentation, we restrict consideration to the meaningful case where k < T . Updated Nomenclature f 's plurality-voting decision function generalizes to top-k prediction as f (x; k) := arg max Yk⊂Y, |Yk|=k (cid:88) y∈Yk ̇cy(x), (25) where ties are broken by selecting the smallest class indices. Extending Plurality Voting to Top-k Intuitively, Thm. 3's certified feature robustness r quantifies the number of submodel "votes" that can switch from plurality label ypl to runner-up label yru without changing the model's prediction. The simplicity of top-1 predictions permits Eq. (3)'s neat closed form. Thm. 3's guarantee r can also be calculated greedily, where submodel "votes" are switched, one at a time, from ypl to yru, with the vote-flipping stopping right before the plurality label changes. While top-k feature robustness under plurality voting does not have a convenient closed form like Eq. (3), an (optimal) greedy strategy still applies. Intuitively, a label y is not in the top k if there exist k labels with more votes. Hence, two approaches to eject a label y from the top k are: (1) reduce ̇cy(x), the number of submodels that predict y, and (2) increase the number of votes for (cid:101)y, i.e., the label with (k + 1)-th most votes. Note that for k > 1, label (cid:101)y may change after each greedy iteration; it is this interaction that complicates providing a compact closed-form top-k guarantee r that is tight. Alg. 1 formalizes the above intuition into a complete method to calculate top-k certified feature robustness r. With linear-time sorting (e.g., counting sort), Alg. 1 has O(T ) time complexity – same as plurality-voting top-1 certification.9 Theorem 10. Top-k Greedy Strategy Optimality Alg. 1 returns plurality voting's top-k certified feature ro- bustness r that is tight under worst-case perturbations. Alg. 1 addresses an edge case to ensure r is tight. Based on how ties are broken, a label y can be in the top k without receiving any votes (i.e., ̇cy(x) = 0). In such cases, Alg. 1 transfers votes from plurality label ypl. Perturbing ypl ensures ̇c (cid:101)y(x) is monotonically increasing. Like (cid:101)y, the plurality label can change between loop iterations. Generalizing our Top-k Greedy Algorithm Observe that Alg. 1 deals only in submodel vote counts (i.e., ̇cy′ (x)) and is agnostic to how these independent votes are generated – be it over partitioned features or oth- erwise. Multiple existing certified defenses (e.g., deep partition aggregation [LF21] and the nearest neighbor-based instance-wise poisoning defense [Jia+22a]) are top-1 only and voting-based, with the votes independent. Alg. 1 can be directly reused to generalize those existing certified defenses to provide robustness guarantees over top-k predictions. Alg. 1 also applies to alternate FPA formulations with non-pristine training labels (see suppl. Sec. E). Combining our Top-k Greedy Algorithm with Run-Off Sec. 4.2 describes two possible ways an attacker can perturb run-off prediction yRO. Consider Case #2 where the goal is to eject yRO from round #1's top-two labels. Observe that this case reduces to calculating yRO's top-2 robustness. Rezaei et al.'s [Rez+23] dynamic programming- based formulation in Eq. (7) could be directly replaced by Alg. 1's greedy approach. Sec. 4.2's presentation was chosen to better align with Rezaei et al.'s preprint formulation (while correcting an error in the definition of dp). 9With a more sophisticated greedy strategy, certifying a top-k prediction under plurality voting requires no more than O(k) greedy iterations. We provide the less efficient Alg. 1 here for simplicity. Our source code implements both greedy algorithms. A13 Algorithm 1 Top-k Greedy Robustness Certification under Plurality Vot- ing Input: Instance x ∈ X ; target label y ∈ Y; k ∈ N; label vote counts ∀y′∈Y ̇cy′ (x) Output: Certified feature robustness r 1: r ← −1 2: while ̇cy(x) is in the top k do 3: 4: 5: 6: 7: 8: 9: 10: (cid:101)y ← Label with the (k + 1)-th most votes if ̇cy(x) > 0 then ̇cy(x) ← ̇cy(x) − 1 else ̇cy′ (x) ypl ← arg maxy′ ̇cypl (x) ← ̇cypl (x) − 1 ̇c (cid:101)y(x) + 1 (cid:101)y(x) ← ̇c r ← r + 1 11: return r ▷ Plurality label ▷ Update certified robustness A14 E On a Sparse Attacker that Modifies Training Labels Sec. 2's base formulation of feature partition aggregation trains each submodel on a subset of the features from all training instances. Each submodel also considers full label vector y := [y1, . . . , yn] (see Fig. 1). In the worst case, a single adversarial label flip could manipulate all T predictions, invalidating FPA's guarantees. Whether an attacker is able to manipulate the training labels is application dependent. Previous work commonly views clean-label attacks (where y is pristine) as the stronger threat model [Che+17; Sha+18; Hua+20; Wal+21]. To simplify the formulation and allow for a more direct comparison to existing work, we chose for our primary presentation to assume clean labels. Nonetheless, FPA's underlying formulation can be generalized to a threat model where an adversary can modify training labels. Def. 11 formalizes a joint robustness guarantee over feature perturbations and training-label flips. Def. 11. Certified Feature and Label-Flipping Robustness Given training set (X, y), model f ′ trained on (X′, y′), and arbitrary feature vector x′ ∈ X , certified feature and label-flipping robustness (cid:101)r ∈ N is a pointwise, deterministic guarantee w.r.t. instance (x, y) where |X ⊖ X′ ∪ x ⊖ x′| + |y ⊖ y′| ≤ (cid:101)r =⇒ y = f ′(x′). Similar to certified feature robustness r in Def. 1, certified feature and label robustness (cid:101)r is not w.r.t. feature values. Instead, (cid:101)r provides a stronger guarantee allowing all values – training and test – for a feature to be perturbed. Robustness (cid:101)r arbitrarily divides between feature perturbations and training-label flips. Below we propose two extended FPA formulations, which provide certified feature and label-flipping robustness guarantees. We focus on plurality voting below with the extension to run-off straightforward. E.1 Training Instance Partitioning FPA's base formulation is particularly vulnerable to adversarial label flipping since each submodel considers full label vector y. This vulnerability's fix is very simple: partition both the features and training instances across the T submodels. Under this alternate formulation, a single adversarial label flip affects at most one submodel prediction, i.e., the submodel trained on that instance. Lem. 12 formalizes certified feature and label-flipping robustness for FPA under training instance partitioning. Like Thm. 3, Lem. 12 generalizes to certify top-k predictions via Alg. 1. Alternatively, (cid:101)r could be certified using run-off elections similar to Theorem 4. Lemma 12. Certified Robustness with Partitioned Training Instances Given feature partition S1, . . . , ST , let f be an ensemble of T submodels using the plurality-voting decision function. Let htr : X × Y → [T ] be a deterministic function that partitions the instance space. The t-th submodel is trained exclusively on the features in set St as well as only those training instances (xi, yi) where htr(xi, yi) = t. Then, for instance (x, y), the pointwise certified feature and label-flipping robustness is (cid:22) Gapvote(ypl, yru) 2 (cid:23) (cid:101)r = . (26) While Lem. 12's guarantees appear similar to existing certified poisoning defenses such as deep partition ag- gregation (DPA) [LF21], there is a subtle yet important difference. As explained in Sec. 3, DPA's threat model encompasses only data poisoning attacks, meaning test instance x is assumed pristine. DPA does not certifiably improve the model's robustness under backdoor or evasion attacks when x is adversarially manipulated. By contrast, Lem. 12 provides certifiable robustness under sparse poisoning, backdoor, and evasion attacks – as well as adversarial label flipping. There exist backdoor attacks where Lem. 12 is provably robust but DPA is not (e.g., Gu et al.'s [Gu+19] pixel-based attacks) and vice versa. Lem. 12 is no free lunch. Partitioning the training instances across the ensemble entails that each submodel is trained on even fewer data. This can degrade submodel performance, potentially degrading the certified robust- ness [WLF22b]. Next, we modify the above formulation to restore some of the feature information that is lost when the training instances are partitioned. A15 E.2 Training Label Partitioning with Semi-Supervised Learning Sec. 2's threat model places no constraint on the poisoning rate, i.e., the fraction of the training instances an attacker may adversarially perturb. In other words, under this threat model, perturbing a feature for one instance is equivalent, from a certification perspective, to perturbing that feature for all instances. In Section E.1 above, our revised feature partition aggregation (FPA) formulation above discards significant feature information. Formally, for training instance (xi, yi) assigned to t-th submodel model (i.e., htr(xi, yi) = t), features dimensions [d] \ St in xi are not used in the training of any submodel. In other words, xi's feature dimensions [d] \ St are totally ignored. Since our threat model allows a 100% poisoning rate, discarding these features does not improve the theoretical robustness. Rethinking Sec. E.1, the primary motivation for partitioning the training instances was to ensure that a single adversarial label flip did not affect more than one submodel. To achieve that, the formulation above not only restricts each submodel's access to some training labels, it also restricts access to the corresponding training instance's feature information. This is heavy-handed, and a more careful partitioning is possible. This section's revised FPA formulation is inspired by semi-supervised learning. The t-th submodel still considers the St columns of matrix X. The sole difference is in the training-label vector used by each submodel. Rather than partitioning the training instances like in the previous section, our semi-supervised FPA uses function htr to partition just the training labels. The t-th submodel treats as unlabeled any training instance (xi, yi) were htr(xi, yi) ̸= t. Put simply, the only difference between the submodel training sets of our base and semi-supervised formulations lies in the training labels available to each submodel. Both formulations train each submodel on the same feature submatrix. Lem. 13 formalizes the certified feature and label-flipping robustness (Def. 11) for FPA under training label partitioning with semi-supervised learning. Observe that Eqs. (26) and (27) define the certified feature and label-flip robustness (cid:101)r identically. Like Thm. 3 and Lem. 13 above, Lem. 13 generalizes to certify top-k predictions via Alg. 1. Again, Lem. 13 can be trivially modified to instead certify feature and label-flipping robustness using run-off elections similar to Theorem 4. Lemma 13. Certified Robustness with Partitioned Training Labels Given feature partition S1, . . . , ST , let f be an ensemble of T submodels using the plurality-voting decision function. Let htr : X × Y → [T ] be a deterministic function that partitions the instance space. The t-th submodel is trained exclusively on the features in set St as well as the training labels for those training instances (xi, yi) where htr(xi, yi) = t. For all training instances (xi, yi) where htr(xi, yi) ̸= t, the t-th submodel treats the instance as unlabeled. Then, for instance (x, y), the pointwise certified feature and label-flipping robustness is (cid:22) Gapvote(ypl, yru) 2 (cid:23) (cid:101)r = . (27) Whether partitioning the training labels (Sec. E.2) or the training instances (Sec. E.1) yields larger certified guarantees is an empirical question, whose answer depends on the application and semi-supervised learning algorithm. A16 F On Overlapping Submodel Feature Sets feature partition aggregation does not necessarily require that feature subsets S1, . . . , ST be a partition of the full feature set [d]. Rather, the feature subsets can partially overlap, but the certification analysis becomes NP-hard in the general case via reduction to (partial) set cover [HL22, Lem. 11]. Recall also that deep partition aggregation (DPA) is a certified defense against poisoning attacks under a limited poisoning rate. Like FPA, DPA trains submodels on partitioned sets – specifically, partitioned training instances. Wang et al.'s [WLF22a] deterministic finite aggregation (DFA) extends DPA where submodels are trained on over- lapping instance sets. Just as FPA with partitioned feature sets can be viewed as the transpose of DPA, FPA with overlapping feature sets can be viewed as the transpose of Wang et al.'s DFA. Below we formulate FPA with overlapping feature sets as inspired by deterministic finite aggregation. Rather than partitioning feature set [d] into T subsets, consider partitioning [d] into φT disjoint subsets where φ ∈ N. By definition, it should hold that φT ≤ d. Otherwise, some subsets in the partition will be empty by the pigeonhole principle. In our base FPA formulation, each submodel is trained on approximately 1 T -th of the features, and each feature subset is assigned to exactly one submodel. For FPA with overlapping features, each submodel is still trained on 1 T -th of the features. However, since each feature set is now 1 φ -th the size, each overlapping submodel is assigned φ feature subsets. Following Wang et al. [WLF22a], each feature subset is similarly assigned to φ submodels. Hence, φ is referred to as the feature subsets' spread degree. Deterministic function hS : [φT ] → [φT ]φ maps the φT feature subsets to the φT submodels. Our overlapping features empirical evaluation below defines hS identically to Wang et al.'s hspread function. Formally, let T ⊂ [φT ] be a set drawn uniformly at random without replacement from [φT ] where |T | = φ. Then, the set of submodels that use feature partition l ∈ [φT ] is hS (l) := {τ + l mod φT : τ ∈ T } . (28) Since T is constructed randomly, overlapping feature sets more closely resemble balanced random partitioning than deterministic partitioning. There are two important differences in the analysis of FPA with partitioned versus overlapping feature sets. First, under partitioned feature sets, a single perturbed feature affects exactly one submodel. For overlapping features, each feature subset is used in the training of φ submodels, meaning a single perturbed feature affects φ submodel votes. Second, under partitioned feature sets, certification analysis exclusively considered the minimum number of models required for the runner-up label to overtake the plurality label. Under overlapping features, the runner-up label may not be the most efficient to perturb, meaning all labels must be considered in certification analysis. The next section formalizes the certified feature robustness under overlapping feature sets with plurality voting. F.1 Certified Feature Robustness with Overlapping Feature Sets Recall that for any y ∈ Y and x ∈ X , ̇cy(x) := |{t ∈ [T ] : ft(x) = y}| denotes the number of submodels that predict label y for x. Given φT disjoint feature subsets where (cid:70)φ T let l=1 Sl = [φT ], ̇cy(x; l) := |{t ∈ [T ] : ft(x) = y ∧ t ∈ hS (l)}|, (29) denote the number of submodels that both use feature subset Sl and predict label y for x. Define the multiset w.r.t. x ∈ X as and let ∆r′ ∆(y,y′) := {φ + ̇cy(x; l) − ̇cy′ (x; l) : l ∈ [φT ]} , (y,y′) denote the sum of the r′ ∈ N largest elements in multiset ∆(y,y′). (30) Lem. 14 defines the certified feature robustness with overlapping feature sets, plurality voting, and fixed spread degree φ. Lem. 14 follows directly from Wang et al.'s [WLF22a] Thm. 2. Lemma 14. Certified Feature Robustness with Overlapping Feature Sets and Fixed Spread De- gree Given submodel feature partition S1, . . . , Sφ T and function hS , let f be a voting-based ensemble of φT submodels A17 using plurality-voting, where each deterministic submodel ft uses the features in set (cid:71) Sl. l∈[φ T ] t∈hS (l) Then the pointwise certified feature robustness of prediction is y := f (x) is r = miny′̸=y ry′ where ry′ := arg max r′∈N s.t. ∆r′ (y,y′) ≤ ̇cy(x) − ̇cy′ (x) − 1(cid:2)y′ < y(cid:3) (31) The next section discusses the limitations of training FPA's submodels on overlapping feature subsets. F.2 Limitations of Overlapping Feature Sets Combining FPA with overlapping feature sets has two primary limitations. First, overlapping feature sets increase the computational cost versus Thm. 3's disjoint feature sets – even without an NP-hard optimization. One of FPA's key advantages over previous related methods like randomized ablation is FPA's computational efficiency (Tab. 3). FPA with disjoint feature sets has computational complexity in O(T ). In contrast, FPA as formulated in Lem. 14 with overlapping feature sets has computation complexity in O(φT ). Any performance gains derived from overlapping features need to be weighed against the multiplicative increase in training and certification time. The other major limitation is that supplemental Sec. D's greedy algorithm does not apply to overlapping feature sets. Like any NP-hard problem, greedy methods may overestimate the solution necessitating an approximation factor to address any overestimation. A greedy-based, top-k certification algorithm for overlapping feature sets is left as future work. As an alternative to Wang et al.'s [WLF22a] closed-form lower bound for the certified robustness on overlapping sets of instances, Hammoudeh and Lowd [HL23b] use an integer linear program to find the optimal certified robustness. In short, Hammoudeh and Lowd's formulation trades a better certified bound for a potentially (significantly) more complex optimization. Hammoudeh and Lowd's [HL23b] linear program could be modified to determine overlapping FPA's optimal top-k robustness. F.3 Empirical Evaluation of Overlapping Feature Sets for Certified Feature Robustness This section evaluates FPA's performance with disjoint and overlapping feature sets under plurality voting. The results for CIFAR10 are in Tables 7 and 8. MNIST's results are in Tables 9, 10, and 11. Weather's results are in Tables 12 and 13. Beyond the overlapping feature sets, the evaluation setup is identical to Sec. 6. Recall that under overlapping features, the total number of feature partitions is φT . As discussed above, this quantity is functionally bounded by the dataset dimension d. For each model configuration below, we evaluate performance with spread degree φ set as large as possible given T without exceeding the dataset's corresponding dimension d. We briefly summarize these experiments' takeaways. Takeaway #1: The benefits of overlapping feature sets is largest for smaller T values. We see this trend for all three datasets. For example with CIFAR10, overlapping feature sets improved random partitioning's performance by up to 3.5 percentage points when T = 25. By contrast, for CIFAR10 with T = 115, overlapping feature sets improved the performance by only 0.6 percentage points. We conjecture that the primary cause of this behavior is that T and the maximum spread degree are inversely related. Since feature dimension d is fixed, larger T restricts φ and in turn the potential benefits of overlapping feature sets. By comparison, the spread degree of Wang et al.'s [WLF22a] DFA is capped by the number of training instances. For modern datasets, the training set's size is much larger than the feature dimension. We believe this partially explains why overlapping sets are more useful for certified poisoning defenses than FPA. A18 Takeaway #2: For vision datasets, deterministic partitioning generally outperforms overlapping feature sets. The trend is most visible for CIFAR10 where overlapping feature sets only marginally outperformed strided partitioning under one small case. By contrast, CIFAR10 deterministic partitioning outperformed overlapping feature sets by multiple percentage points in many cases. For MNIST, overlapping feature sets did outperform strided deterministic partitioning in particular when r is small. In many of those cases, random partitioning also performed as well as or better than strided partitioning. Takeaway #3: Overlapping feature sets reduce the certified accuracy's variance for random partitioning. For Weather [Mal+21], we report both the certified accuracy's mean and standard deviation. As spread degree φ increased, the certified accuracy's variance decreased by up to two-thirds. In short, overlapping feature sets mitigate the effect of poor feature partitions, which can severely degrade random partitioning's performance. Takeaway #4: The benefits of overlapping feature sets decrease as r increases. This trend is consistent across all three datasets over all T values. At the largest certified robustness values, overlapping feature sets can even significantly underperform random partitioning. We theorize the primary cause for this phenomenon is that while guarantees for disjoint feature sets are tight, Lem. 14 only lower bounds overlapping feature set's maximum certifiable robustness. As r increases, this looseness becomes increasingly visible. Table 7: CIFAR10 Overlapping Feature Sets (T = 25): CIFAR10 certified accuracy for our sparse defense, feature partition aggregation (FPA), with T = 25. "Random" denotes balanced random partitioning with disjoint submodel feature sets (i.e., spread degree φ = 1). "Overlapping" denotes that the submodel feature sets were trained using Sec. F.1's overlapping feature set formulation with the corresponding spread degree (φ) specified above each column. "Strided" denotes deterministic strided partitioning with disjoint submodel feature sets (Eq. (33)). The configuration with the best mean certified accuracy is shown in bold. Cert. Robust. Random Overlapping Strided φ = 10 φ = 20 φ = 40 1 4 8 12 72.1 60.8 42.5 14.2 73.2 62.4 43.6 13.1 73.6 63.6 44.4 12.8 73.7 64.3 45.8 12.7 76.1 67.6 53.0 25.0 Table 8: CIFAR10 Overlapping Feature Sets (T = 115): CIFAR10 certified accuracy for our sparse de- fense, feature partition aggregation (FPA), with T = 115. "Random" denotes balanced random partitioning with disjoint submodel feature sets (i.e., spread degree φ = 1). "Overlapping" denotes that the submodel feature sets were trained using Sec. F.1's overlapping feature set formulation with the corresponding spread degree (φ) specified above each column. "Strided" denotes deterministic strided partitioning with disjoint submodel feature sets (Eq. (33)). The configuration with the best mean certified accuracy is shown in bold. Cert. Robust. Random Overlapping φ = 4 φ = 8 Strided 1 10 20 30 40 50 61.3 49.6 36.9 25.1 14.7 5.7 61.5 49.6 36.8 24.7 14.1 5.5 61.6 50.2 37.3 24.8 14.0 5.4 61.2 51.2 40.0 29.1 18.9 8.9 A19 Table 9: MNIST Overlapping Feature Sets (T = 25): MNIST certified accuracy for our sparse defense, feature partition aggregation (FPA), with T = 25. "Random" denotes balanced random partitioning with disjoint submodel feature sets (i.e., spread degree φ = 1). "Overlapping" denotes that the submodel feature sets were trained using Sec. F.1's overlapping feature set formulation with the corresponding spread degree (φ) specified above each column. "Strided" denotes deterministic strided partitioning with disjoint submodel feature sets (Eq. (33)). The configuration with the best mean certified accuracy is shown in bold. Cert. Robust. Random Overlapping Strided φ = 10 φ = 20 φ = 30 1 4 8 12 93.6 84.0 57.5 11.3 94.7 86.5 59.9 11.5 94.9 87.4 60.6 10.5 95.0 87.6 61.8 10.8 94.1 86.5 66.4 20.1 Table 10: MNIST Overlapping Feature Sets (T = 60): MNIST certified accuracy for our sparse defense, feature partition aggregation (FPA), with T = 60. "Random" denotes balanced random partitioning with disjoint submodel feature sets (i.e., spread degree φ = 1). "Overlapping" denotes that the submodel feature sets were trained using Sec. F.1's overlapping feature set formulation with the corresponding spread degree (φ) specified above each column. "Strided" denotes deterministic strided partitioning with disjoint submodel feature sets (Eq. (33)). The configuration with the best mean certified accuracy is shown in bold. Cert. Robust. Random Overlapping φ = 6 φ = 12 Strided 1 5 10 15 20 25 80.8 64.9 43.1 26.1 14.2 5.2 82.6 67.3 43.9 25.9 14.2 5.2 82.7 68.4 46.5 27.1 14.6 5.7 80.8 66.6 46.9 29.2 16.1 6.3 Table 11: MNIST Overlapping Feature Sets (T = 80): MNIST certified accuracy for our sparse defense, feature partition aggregation (FPA), with T = 80. "Random" denotes balanced random partitioning with disjoint submodel feature sets (i.e., spread degree φ = 1). "Overlapping" denotes that the submodel feature sets were trained using Sec. F.1's overlapping feature set formulation with the corresponding spread degree (φ) specified above each column. "Strided" denotes deterministic strided partitioning with disjoint submodel feature sets (Eq. (33)). The configuration with the best mean certified accuracy is shown in bold. Cert. Robust. Random Overlapping φ = 6 φ = 9 Strided 1 8 16 24 32 72.2 46.3 24.0 12.0 3.1 73.8 47.2 24.0 12.1 2.6 74.5 48.3 24.5 12.1 3.2 68.0 46.2 25.5 13.2 5.3 A20 Table 12: Weather Overlapping Feature Sets (T = 11): Certified accuracy mean and standard devi- ation for the Weather tabular dataset for FPA (FPA) with T = 11. "Random" denotes balanced random partitioning with disjoint submodel feature sets (i.e., spread degree φ = 1). "Overlapping" denotes that the submodel feature sets were trained using Sec. F.1's overlapping feature set formulation with the correspond- ing spread degree (φ) specified above each column. The configuration with the best mean certified accuracy is shown in bold. Results averaged over 10 trials. Cert. Robust. Random Overlapping φ = 3 φ = 7 φ = 9 φ = 11 1 2 3 4 5 78.9 ± 1.5 70.6 ± 2.5 58.9 ± 3.6 42.5 ± 4.4 19.4 ± 4.4 80.1 ± 1.1 72.6 ± 1.9 61.2 ± 3.0 43.7 ± 3.8 18.2 ± 2.9 79.8 ± 0.4 73.2 ± 0.9 61.8 ± 1.7 40.7 ± 2.7 17.2 ± 2.6 80.1 ± 0.4 72.1 ± 0.7 61.7 ± 1.1 43.9 ± 1.5 17.3 ± 1.5 80.7 ± 0.5 73.2 ± 0.9 61.9 ± 1.5 44.2 ± 1.9 17.5 ± 1.3 Table 13: Weather Overlapping Feature Sets (T = 31): Certified accuracy mean and standard devi- ation for the Weather tabular dataset for FPA (FPA) with T = 31. "Random" denotes balanced random partitioning with disjoint submodel feature sets (i.e., spread degree φ = 1). "Overlapping" denotes that the submodel feature sets were trained using Sec. F.1's overlapping feature set formulation with the correspond- ing spread degree (φ) specified above each column. The configuration with the best mean certified accuracy is shown in bold. Results averaged over 10 trials. Cert. Robust. Random Overlapping φ = 3 61.0 ± 0.9 53.3 ± 0.9 37.6 ± 1.0 17.7 ± 1.9 3.1 ± 1.1 1 3 6 9 12 61.9 ± 1.4 52.7 ± 1.4 36.8 ± 1.6 18.3 ± 2.4 3.0 ± 1.7 A21 G Evaluation Setup This section details the evaluation setup used in the experiments in Sections 6, F, and H. Below, we provide our experiments' implementation details, dataset configurations, and hyperparameter settings. The evaluation setup details below apply irrespective of whether the decision function uses plurality voting or run-off. Our source code can be downloaded from https://github.com/ZaydH/feature-partition. All experiments were implemented and tested in either Python 3.7.13 or 3.10.10. All neural networks were implemented in PyTorch version 1.12.0 [Pas+19]. LightGBM decision forests were trained using the official lightgbm Python module, version 3.3.3.99 [Ke+17]. G.1 Hardware Setup Experiments were performed on a desktop system with a single AMD 5950X 16-core CPU, 64GB of 3200MHz DDR4 RAM, and a single NVIDIA 3090 GPU. G.2 Baselines To the extent of our knowledge, no existing method considers certified feature robustness guarantees (Def. 1). Ran- domized ablation – our most closely related method – considers l0-norm certified robustness (Def. 2) [LF20b]. RA is a specialized form of randomized smoothing [CRK19; LXL23] targeted towards sparse evasion attacks. In terms of the state of the art, Jia et al. [Jia+22b] provide the tightest certification analysis for randomized ablation. Recall that feature partition aggregation (FPA) provides strictly stronger certified guarantees than baseline RA. Put simply, FPA is solving a harder task than baseline randomized ablation. Therefore, when FPA achieves the same certified accuracy as the baseline, FPA is performing provably better, given FPA's stronger guarantees. We also compare FPA to three certified patch defenses, namely: (de)randomized smoothing (DRS) [LF20a], patch interval bound propagation (IBP) [Chi+20b], and BagCert [MY21]. Note that BagCert's implementation is not open source, and Metzen and Yatsura [MY21] have indicated they do not plan to open source the code in the future.10 As such, BagCert's results in the main paper were provided by Metzen and Yatsura via personal correspondence. BagCert's closed source code prohibited the collection of its certification time. Nonetheless, comparing FPA's certification time to that of BagCert provides only limited insight since FPA and BagCert certify very different types of guarantees. G.3 Datasets Our empirical evaluation considers four datasets. First, MNIST [LeC+98] and CIFAR10 [KNH14] are vision classifi- cation datasets with 10 classes each. Although all certified sparse defenses considered in this work are exclusively proposed in the context of classifi- cation, Hammoudeh and Lowd [HL23b] prove that certified regression reduces to voting-based certified classification. Hence, it is straightforward to transform FPA and randomized ablation into certified regression defenses. We reuse this reduction and evaluate two tabular regression datasets, Weather [Mal+21] and Ames [De 11]. For Weather, we follow Hammoudeh and Lowd's [HL23b] empirical evaluation, where the objective is to predict ground temperature within ±3◦C using features that include the date, time of day, longitude, and latitude. Similarly, we follow Hammoudeh and Lowd's [HL23b]'s empirical evaluation for Ames, where the objective is to predict a property's sale price within ±15% of the actual price. Since ablated training requires a custom feature encoding to differentiate ablated and non-ablated features, min-max scaling was applied to both datasets' features for RA to normalize all feature values to the range [0, 1]. We chose these two regression datasets as a stand-in for vertically partitioned data, which are commonly tabular and particularly vulnerable to sparse backdoor and evasion attacks. 10The author's comments regarding open-sourcing their code can be found on BagCert's OpenReview page. A22 Table 14 provides basic information about the four datasets, including their sizes and feature dimension. Table 15 provides summary statistics for the regression datasets' test target-value (i.e., y) distribution. Table 14: Evaluation dataset information Dataset # Classes # Feats # Train # Test CIFAR10 MNIST Weather Ames 10 10 N/A N/A 1,024 784 128 352 50,000 60,000 3,012,917 2,637 10,000 10,000 531,720 293 Table 15: Target Value Test Distribution Statistics: Mean ( ̄y), standard deviation (σy), minimum value (ymin) and maximum value (ymax) for the test instances' target y value for regression datasets Weather and Ames. ̄y σy ymin ymax Weather Ames 14.9◦C 10.3◦C −44.0◦C 54.0◦C $585k $184k $12.8k $83.4k Our source code automatically downloads all necessary dataset files. G.4 Network Architectures Table 16 details the CIFAR10 neural network architecture. Specifically, we follow previous work on CIFAR10 data poisoning [HL22] and use Page's [Pag20] ResNet9 architecture. ResNet9 is ideal for our experiments since it is very fast to train, as ranked on DAWNBench [Col+17]. ResNet9's fast training significantly reduces the overhead of training T submodels for FPA. We directly adapt Page's [Pag20] published implementation11 including the use of ghost batch normalization [SD20] and the CELU activation function with α = 0.075 [Bar17]. Three forms of data augmentation were also used in line with Page's [Pag20] implementation. First, a random crop with four pixels of padding was performed. Next, the image was flipped horizontally with a 50% probability. Finally, a random 8 × 8 pixel portion of the image was randomly erased. Note that these transformations were performed after the pixels were disabled in the image, meaning these transformations do not result in a network seeing additional pixel information. In a separate paper, Levine and Feizi [LF21] propose deep partition aggregation (DPA), a certified defense against poisoning attacks. Here, we follow Levine and Feizi's [LF21] public implementation12 and use the Network-in- Network (NiN) architecture [LCY14] when evaluating our method on MNIST. Table 17 visualizes the MNIST NiN architecture. G.5 Hyperparameters For simplicity, FPA used the same hyperparameter settings for a given dataset irrespective of T . Therefore, FPA's results could be further improved in practice by tuning the hyperparameter settings to optimize the ensemble's performance for a specific submodel count. Table 18 details the CIFAR10 and MNIST hyperparameter settings for feature partition aggregation. For CIFAR10 and MNIST, we directly used Levine and Feizi's [LF20b] published randomized ablation training source code, which includes pre-specified hyperparameter settings for the learning rate, weight decay, and optimizer hyperparameters. 11Source code: https://github.com/davidcpage/cifar10-fast. 12Source code: https://github.com/alevine0/DPA. A23 Table 16: ResNet9 neural network architecture In=3 Conv1 BatchNorm2D Out=64 CELU Out=64 Kernel=3 × 3 Pad=1 Out=128 Kernel=3 × 3 Pad=1 Out=128 Kernel=3 × 3 Pad=1 Out=128 Kernel=3 × 3 Pad=1 Out=256 Kernel=3 × 3 Pad=1 Out=512 Kernel=3 × 3 Pad=1 Out=512 Kernel=3 × 3 Pad=1 Out=512 Kernel=3 × 3 Pad=1 In=64 Conv2 BatchNorm2D Out=128 CELU MaxPool2D 2 × 2 ↑ ResNet1 ↓ In=128 ConvA BatchNorm2D Out=128 CELU In=128 ConvB BatchNorm2D Out=128 CELU In=128 Conv3 BatchNorm2D Out=256 CELU MaxPool2D 2 × 2 In=256 Conv4 BatchNorm2D Out=512 CELU MaxPool2D 2 × 2 ↑ ResNet2 ↓ In=512 ConvA BatchNorm2D Out=512 CELU In=512 ConvB BatchNorm2D Out=512 CELU MaxPool2D 4 × 4 Linear Out=10 Recall from Sec. 6 that for the Weather and Ames datasets, FPA's submodels are LightGBM [Ke+17] gradient- boosted decision tree (GBDT) regressors. Table 19 details FPA's LightGBM hyperparameter settings. For a more direct comparison with randomized ablation which cannot use a GBDT, we also evaluated FPA with linear submodels. FPA's linear submodel hyperparameter settings for the regression datasets are in Table 20. Levine and Feizi [LF20b] only evaluate classification datasets in their original paper. As such, there are no existing hyperparameter settings for randomized ablation on Weather and Ames. We manually tuned randomized ablation's learning rate for the regression datasets considering all values in the set {10−2, 10−3, 10−4}. We also tested numerous different settings for the number of training epochs. To ensure a strong baseline, we report the best performing randomized ablation hyperparameter settings. Recall from Sec. 3 that randomized ablation only provides probabilistic guarantees. By contrast, feature partition aggregation provides deterministic guarantees. To facilitate a more direct comparison between certified feature and l0-norm guarantees, α = 0.0001 in all experiments. A24 G.6 Overview of the Certified Regression to Certified Classification Reduction Hammoudeh and Lowd [HL23b] provide a reduction from certified regression to (voting-based) certified classification. Hammoudeh and Lowd [HL23b] frame this reduction primarily in the context of poisoning attacks, but the reduction generalizes to other voting-based certified classifiers. For full details on the reduction from certified regression to certified classification, we direct the reader to Hammoudeh and Lowd's [HL23b] original paper. We briefly summarize the reduction below. Consider a multiset of real-valued "votes" V ∈ RT , where Hammoudeh and Lowd [HL23b] assume for simplicity that T is odd. These "votes" could be generated from an ensemble of independent submodels in the case of deep partition aggregation [LF21] and FPA. These votes could also be generated from a smoothing-based classifier such as randomized ablation. Regardless, for voting-based real-valued regression, model f 's decision function for arbitrary instance x ∈ X is f (x) := med V, (32) where med denotes the median operator. Let y ∈ R denote the true target value for x and let ξl, ξu ∈ R≥0 be arbitrary non-negative constants. Hammoudeh and Lowd's [HL23b] formulation seeks to certify the pointwise robustness of ξl ≤ f (x) ≤ ξu.13 Below, we discuss certifying a one-sided upper bound f (x) ≤ ξu. As Hammoudeh and Lowd [HL23b] explain, certifying a two-sided bound is equivalent to taking the minimum robustness of the one-sided lower and upper bounds. Consider binarizing multiset V as V±1 := {sgn (v − ξu) : v ∈ V}, where sgn (*) is the signum function. Intuitively, our goal is to transform each real-valued instance in the multiset into a binary label, either −1 or +1. Certified defenses such as deep partition aggregation [LF20b], our sparse defense feature partition aggregation (FPA), and randomized ablation (RA) turn a multiset of votes into certified guarantees. Hammoudeh and Lowd's [HL23b] key insight is that the median and plurality labels of a binary multiset (e.g., V±1) with odd-valued cardinality are always equal. In short, certifying when a multiset's median exceeds some threshold (e.g., ξu) is equivalent to certifying the perturbation of the plurality label of binarized multiset V±1 [HL23b, Lem 6]. Hammoudeh and Lowd's [HL23b] reduction allows us to change the underlying prediction mechanism from a classifier to a regressor and directly reuse a voting-based certified classifier's robustness certification mechanism. Hence, while our feature partition aggregation (FPA) and baseline randomized ablation are formulated as certified classifiers, both can be reformulated as certified regressors using the reduction of Hammoudeh and Lowd [HL23b]. In practice, the primary change made to both defenses is that the underlying learner(s) predict a real value instead of a label. For regression, certified accuracy denotes that the model prediction satisfies ξl ≤ f (x) ≤ ξu, even after r feature perturbations. For smoothing-based methods like randomized ablation, the reduction of Hammoudeh and Lowd [HL23b] is functionally very similar to Chiang et al.'s [Chi+20a] median smoothing. The two methods have slightly different formulations depending on the specification of the bounds. 13We use the exact same definitions for ξl and ξu as Hammoudeh and Lowd [HL23b]. Specifically for the Weather dataset, our experiments used ξl = y − 3◦C and ξu = y + 3◦C. For the Ames dataset, our experiments used ξl = y − 15%y and ξu = y + 15%y. A25 Table 17: Network-in-Network neural network architecture Out=192 Kernel=5 × 5 Pad=2 Out=160 Kernel=1 × 1 Pad=1 Out=96 Kernel=1 × 1 Pad=1 Out=192 Kernel=5 × 5 Pad=2 Out=192 Kernel=1 × 1 Pad=1 Out=192 Kernel=1 × 1 Pad=1 Out=192 Kernel=3 × 3 Pad=1 Out=192 Kernel=1 × 1 Pad=1 Out=192 Kernel=1 × 1 Pad=1 Block 1 Block 2 Block 3 Conv1 BatchNorm2D ReLU Conv2 BatchNorm2D ReLU Conv3 BatchNorm2D ReLU In=3 Out=192 In=192 Out=160 In=160 Out=96 MaxPool2D 3 × 3 Conv1 BatchNorm2D ReLU Conv2 BatchNorm2D ReLU Conv3 BatchNorm2D ReLU In=96 Out=192 In=192 Out=192 In=192 Out=192 AvgPool2D 3 × 3 Conv1 BatchNorm2D ReLU Conv2 BatchNorm2D ReLU Conv3 BatchNorm2D ReLU In=192 Out=192 In=192 Out=192 In=192 Out=192 GlobalAvgPool2D Out=192 Linear Out=10 A26 Table 18: FPA's neural network training hyperparameters CIFAR10 MNIST Data Augmentation? Validation Split Optimizer ✓ N/A SGD Batch Size # Epochs 512 80 1 * 10−3 Learning Rate (Peak) Learning Rate Scheduler One cycle 1 * 10−1 Weight Decay (L2) 5% AdamW 128 25 3.16 * 10−4 Cosine 1 * 10−3 Table 19: Regression datasets LightGBM submodel training hyperparameters Boosting Type # Estimators Max. Depth Min. Child Samples Max. # Leaves L1 Regularizer L2 Regularizer Objective Learning Rate Subsampling Weather Ames GBDT GBDT 500 10 20 127 0 0 Huber 0.5 0.9 1,000 6 5 127 1 * 10−3 1 * 102 MAE 1 * 102 0.9 Table 20: Regression datasets linear submodel training hyperparameters Weather Ames L1 Regularizer Max. # Iterations Tolerance 3.16 * 10−3 1 * 104 1 * 10−3 4.15 * 10−5 1 * 106 1 * 10−8 A27 H Additional Experiments Limited space prevents us from including all experimental results in the main paper. We provide additional results below. H.1 Non-Robust Accuracy Table 21 provides the non-robust (i.e., uncertified) accuracy when training a single model (T = 1) on each of Sec. 6's four datasets. The non-robust accuracy provides an upper-bound reference for the maximum achievable accuracy given the training set and the model architectures we used. For regression, the "non-robust accuracy" denotes the single model's prediction satisfies the error bounds, i.e., ξl ≤ f (x) ≤ ξu. Given arbitrary instance (x, y), we follow Hammoudeh and Lowd [HL23b] and use for Weather ξl = y − 3◦C and ξu = y + 3◦C as well as for Ames ξl = y − 15%y and ξu = y + 15%y. Table 21: Non-Robust Accuracy: Prediction accuracy when training a single model on all model features, i.e., T = 1. These values represent an upper bound on the potential accuracy of our method given the training set, model architecture, and hyperparameters. Dataset Accuracy CIFAR10 MNIST Weather Ames 95.40% 99.57% 92.61% 88.05% A28 H.2 Detailed Median Certified Robustness Results In Section 6.2 of the main paper, Tables 1 and 2 summarize the median certified robustness and classification accuracies of feature partition aggregation (FPA) and baseline randomized ablation [LF20b; Jia+22b]. In the tables, "[LF20b]" denotes Levine and Feizi's [LF20b] original version of RA, and "[Jia+22b]" denotes Jia et al.'s [Jia+22b] improved RA; "Plural" denotes FPA using plurality voting as the decision function (Sec. 4.1) while "Run-Off" denotes FPA with Sec. 4.2's run-off elections. Recall that FPA's primary hyperparameter is T – the number of ensemble submodels. RA's primary hyperpa- rameter is e – the number of kept (unchanged) pixels in each ablated input. T and e control the corresponding method's accuracy-robustness trade-off where smaller T and larger e entail better accuracy. As a rule of thumb, the fairest comparison across methods sets T ≈ d e , since this relationship entails that each FPA and RA prediction uses approximately the same number of features from instance x. This section explores the relationship between each method's hyperparameter settings and the corresponding median robustness and classification accuracy. Each dataset's results are split into separate tables similar to Levine and Feizi's [LF20b, Tables 1 and 2] presentation in the original RA paper. For CIFAR10 and MNIST, FPA uses deterministic partitioning. Specifically, we use a striding strategy as Sec- tion 5.1 details. Depending on the image dimensions, some stride lengths are substantially worse than others, leading to non-monotonic changes in median robustness as a function of T . Tables 22 and 23 do not report the particularly poor choices of T that severely degrade median robustness, e.g., when T is evenly divisible by the image width. Below, any misclassified prediction is assigned robustness of −∞, meaning the median certified robustness can in some cases be negative. A29 Table 22: CIFAR10 Detailed Results: Classification accuracy (%) and median certified robustness (larger is better) for the CIFAR10 [KNH14] dataset (d = 1024) for our certified sparse defense, feature partition aggregation (FPA), and baseline randomized ablation (RA) across various hyperparameter settings. Each certification method's hyperparameter setting with the best median robustness is shown in bold. The best overall median robustness is shown in blue. (a) Feature Partition Aggregation (FPA – Ours) (b) Randomized Ablation (RA – Baseline) T 5 10 20 25 40 55 70 85 105 115 140 165 185 200 225 250 Plural Run-Off Acc. (%) rmed Acc. (%) rmed 91.46 86.09 81.38 78.65 74.74 70.44 67.46 66.24 63.55 62.39 60.35 57.91 56.08 55.80 56.27 53.30 2 4 7 8 9 10 9 10 10 11 10 8 7 7 6 4 91.77 86.20 81.40 78.58 74.95 70.34 67.47 66.61 63.61 62.35 60.57 58.48 56.39 56.43 56.56 53.46 2 4 7 8 10 11 11 12 12 13 12 10 9 9 8 5 e 250 225 200 175 150 125 100 75 50 35 30 25 20 15 12 10 8 7 5 [LF20b] [Jia+22b] Acc. (%) ρmed Acc. (%) ρmed 88.77 88.05 86.76 86.16 84.23 82.66 80.43 78.48 73.26 70.34 69.62 68.81 67.01 65.68 63.93 62.73 60.24 59.08 53.20 2 2 3 3 4 5 6 7 7 7 7 6 5 3 0 0 0 0 0 88.56 87.90 86.54 85.94 84.08 82.49 80.05 78.11 72.79 69.72 69.01 68.08 66.15 64.74 62.91 61.71 59.12 57.83 51.84 2 2 3 3 4 5 6 7 8 9 9 9 9 10 10 10 9 8 3 A30 Table 23: MNIST Detailed Results: Classification accuracy (%) and median certified robustness (larger is better) for the MNIST [LeC+98] dataset (d = 784) for our certified sparse defense, feature partition aggregation (FPA), and baseline randomized ablation (RA) across various hyperparameter settings. Each certification method's hyperparameter setting with the best median robustness is shown in bold. The best overall median robustness is shown in blue. (a) Feature Partition Aggregation (FPA – Ours) (b) Randomized Ablation (RA – Baseline) T 5 10 15 20 25 35 40 50 60 70 80 90 105 120 130 150 Plural Run-Off Acc. (%) rmed Acc. (%) rmed 99.50 98.64 96.82 96.36 95.77 91.70 89.37 84.54 83.54 79.71 71.29 69.94 62.53 63.03 57.48 52.51 2 4 7 8 9 9 9 8 9 8 6 6 4 3 2 0 99.51 98.67 97.02 96.53 96.06 93.05 91.32 88.46 87.22 85.87 79.05 79.25 74.45 74.09 69.93 67.30 2 4 7 8 10 11 11 11 12 11 9 9 8 7 7 5 e 100 95 90 85 80 75 70 65 60 55 50 45 40 35 30 25 20 15 10 5 [LF20b] [Jia+22b] Acc. (%) ρmed Acc. (%) ρmed 98.78 98.75 98.62 98.60 98.46 98.35 98.14 98.04 97.85 97.58 97.26 96.88 96.42 95.69 94.87 93.55 90.99 86.71 76.78 35.54 4 5 5 5 6 6 6 7 7 7 7 8 8 8 7 6 3 0 0 −∞ 98.75 98.72 98.56 98.52 98.40 98.27 98.07 97.98 97.78 97.39 97.07 96.68 96.13 95.32 94.47 93.09 90.07 85.24 74.69 32.89 4 5 5 5 6 6 6 7 7 8 8 8 9 9 9 10 9 8 6 −∞ A31 Table 24: Weather Detailed Results: Classification accuracy (%) and median certified robustness (larger is better) for the Weather [Mal+21] dataset (d = 128) for our certified sparse defense, feature partition aggregation (FPA), and baseline randomized ablation (RA) across various hyperparameter settings. FPA considers only plurality voting-based certification (Sec. 4.1) since Hammoudeh and Lowd's [HL23b] reduction is from certified regression to certified binary classification (see Sec. G.6 for details). FPA results are reported using both GBDTs [Ke+17] and linear submodels. Median robustness "−∞" denotes that the classification accuracy was less than 50%. Each approach's hyperparameter setting with the best median robustness is shown in bold. The best overall median robustness is shown in blue. Takeaway: FPA with both GBDT and linear submodels achieved better median robustness than baseline RA. (a) Feature Partition Aggregation (FPA – Ours) (b) Randomized Ablation (RA – Baseline) T 1 5 11 15 21 25 31 35 41 51 75 101 LightGBM Linear Acc. (%) rmed Acc. (%) rmed 92.70 85.29 82.48 81.09 76.10 71.40 67.06 62.56 60.19 55.34 42.20 28.67 0 2 3 3 4 3 3 3 2 1 −∞ −∞ 86.05 83.34 79.55 76.15 67.09 64.77 58.71 55.95 51.57 45.84 26.93 21.26 0 2 2 3 2 2 2 1 0 −∞ −∞ −∞ e 65 60 55 50 45 40 35 30 25 20 16 12 8 6 4 [LF20b] [Jia+22b] Acc. (%) ρmed Acc. (%) ρmed 80.70 80.33 79.52 78.62 77.20 76.56 74.76 72.04 69.77 66.94 63.89 58.59 53.44 47.94 40.70 0 0 0 0 0 0 0 0 0 0 0 0 0 −∞ −∞ 78.63 78.01 77.05 76.59 75.19 74.82 73.22 70.74 68.72 65.87 63.10 57.74 52.82 47.25 39.91 0 0 0 0 1 1 1 1 1 1 1 1 0 −∞ −∞ A32 Table 25: Ames Detailed Results: Classification accuracy (%) and median certified robustness (larger is better) for the Ames [De 11] dataset (d = 352) for our certified sparse defense, feature partition aggrega- tion (FPA), and baseline randomized ablation (RA) across various hyperparameter settings. FPA considers only plurality voting-based certification (Sec. 4.1) since Hammoudeh and Lowd's [HL23b] reduction is from certified regression to certified binary classification (see Sec. G.6 for details). FPA results are reported using both GBDTs [Ke+17] and linear submodels. Median robustness "−∞" denotes that the classification accu- racy was less than 50%. Each approach's hyperparameter setting with the best median robustness is shown in bold. The best overall median robustness is shown in blue. Takeaway: FPA with both GBDT and linear submodels achieved better median robustness than baseline RA. (a) Feature Partition Aggregation (FPA – Ours) (b) Randomized Ablation (RA – Baseline) T 1 5 11 15 21 25 31 35 41 51 75 LightGBM Linear Acc. (%) rmed Acc. (%) rmed 88.05 84.64 78.50 73.04 65.53 61.77 57.68 55.97 52.90 47.10 36.86 0 1 2 2 3 2 2 1 1 −∞ −∞ 89.25 82.08 74.40 66.55 61.60 57.34 53.58 50.34 46.42 40.10 35.15 0 1 1 2 2 1 0 0 −∞ −∞ −∞ e 70 60 50 40 35 30 25 20 15 10 5 [LF20b] [Jia+22b] Acc. (%) ρmed Acc. (%) ρmed 68.60 68.94 67.58 61.77 61.09 57.68 53.58 51.54 45.05 37.20 33.79 0 0 1 1 0 0 0 0 −∞ −∞ −∞ 66.89 67.24 66.89 61.77 60.07 57.00 52.56 49.49 44.37 37.54 33.79 0 1 1 1 1 1 1 −∞ −∞ −∞ −∞ A33 H.3 Feature Partition Aggregation and Randomized Ablation Certified Accu- racy Comparison Levine and Feizi [LF20b] use median certified robustness and classification accuracy as the two primary metrics In this section, we present an alternative evaluation strategy by which they compare RA against previous work. comparing the methods' certified accuracy across a range of robustness levels. Specifically, we consider the same four datasets from Section 6, namely classification datasets CIFAR10 [KNH14] and MNIST [LeC+98] as well as regression datasets Weather [Mal+21] and Ames [De 11]. Like in Section 6, we report FPA's performance using both the plurality-voting and run-off decision functions for classification and only plurality voting for regression. For baseline randomized ablation (RA), we again report the performance of Levine and Feizi's [LF20b] original version of RA as well as the improved version by Jia et al. [Jia+22b]. This section also compares FPA and RA against a naive baseline that is generally low accuracy but maximally robust. For classification, the naive baseline always predicts f (x) = 1; for regression, the naive baseline always predicts the training set's median target value. Recall that hyperparameters T for FPA and e for baseline randomized ablation control the corresponding method's accuracy versus robustness trade-off. Specifically, a smaller value of T and a larger value of e entails better accuracy. As a rule of thumb, the fairest comparison between FPA and RA is when T ≈ d e as each FPA and RA prediction, in expectation, uses a comparable amount of information (i.e., number of features). For each dataset, we report each method's certified accuracy across 10 hyperparameter settings, roughly following the rule of thumb above. Section H.3.1 presents the experimental results in tabular form, and Section H.3.2 visualizes the methods' certified accuracy graphically. H.3.1 Numerical Comparison of Feature Partition Aggregation and Randomized Ablation Certified accuracy w.r.t. ψ ∈ N quantifies the fraction of correctly-classified test instances with certified robustness at least ψ. Tables 26, 27, 28, and 29 numerically display the certified accuracies for our certified feature defense, feature partition aggregation (FPA), and baseline randomized ablation (RA) for CIFAR10, MNIST, Weather, and Ames, respectively. For each dataset, the corresponding table lists the certified accuracy at 11 equally spaced certified robustness levels. Recall that RA's l0-norm robustness (Def. 2) is a strictly weaker guarantee than FPA's certified feature robustness (Def. 1). Put simply, a true direct comparison is not possible here since FPA provides stronger certified guarantees than the baseline. Despite that, FPA can achieve larger certified accuracies than the baseline while simultaneously providing stronger guarantees. A34 Table 26: CIFAR10 Certified Accuracy Comparison: CIFAR10 (d = 1024) certified accuracy (% – larger is better) for our certified feature defense, feature partition aggregation (FPA), and baseline randomized abla- tion (RA). "Plurality" denotes FPA with plurality voting as the decision function (Sec. 4.1) while "Run-Off" denotes FPA using run-off elections as the decision function (Sec. 4.2). "[LF20b]" denotes Levine and Feizi's [LF20b] original version of randomized ablation while "[Jia+22b]" denotes Jia et al.'s [Jia+22b] improved ver- sion of RA that is tight for top-1 predictions. We also consider an additional naive baseline that always predicts f (x) = 1, where, for correct predictions, the feature robustness equals d. For each certified robustness level, each method's best performing hyperparameter setting is shown in bold with the overall best performing method shown in blue. These numerical results are visualized graphically as envelope plots in Figure 2. Method Cert. Alg. Hyper. Setting 0 13 26 39 52 65 78 91 104 117 130 Certified Robustness Always f (x) = 1 N/A 10.00 10.00 10.00 10.00 10.00 10.00 10.00 10.00 10.00 10.00 10.00 FPA (T ) (ours) RA (e) Plurality Run-Off [LF20b] [Jia+22b] 0.00 0.00 0.00 0.00 0.00 6.97 9.00 21.54 24.65 21.68 0.00 0.00 0.00 0.00 0.00 8.21 11.96 25.24 27.60 23.22 0.00 0.00 0.00 0.00 0.00 9.74 12.56 14.04 9.12 2.91 0.00 0.00 0.00 0.00 0.00 11.99 17.70 20.77 21.22 12.48 0.00 0.00 0.00 0.00 0.00 0.00 3.89 15.57 20.86 19.33 0.00 0.00 0.00 0.00 0.00 0.00 5.06 19.02 24.21 20.74 0.00 0.00 0.00 0.00 0.00 1.89 7.77 10.10 7.91 2.58 0.00 0.00 0.00 0.00 0.00 2.31 10.79 15.27 17.95 11.18 0.00 0.00 0.00 0.00 0.00 0.00 0.52 10.91 17.56 17.24 0.00 0.00 0.00 0.00 0.00 0.00 0.56 13.48 20.57 18.63 0.00 0.00 0.00 0.00 0.00 0.00 3.71 6.87 6.96 2.35 0.00 0.00 0.00 0.00 0.00 0.00 4.96 10.36 14.90 10.17 0.00 0.00 0.00 0.00 0.00 0.00 0.00 7.04 14.32 15.41 0.00 0.00 0.00 0.00 0.00 0.00 0.00 8.94 17.62 16.85 0.00 0.00 0.00 0.00 0.00 0.00 1.09 4.20 5.95 1.90 0.00 0.00 0.00 0.00 0.00 0.00 1.33 6.32 12.49 9.06 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4.02 11.56 13.92 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4.99 14.74 15.20 0.00 0.00 0.00 0.00 0.00 0.00 0.00 2.31 5.16 1.68 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3.34 10.33 8.24 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1.62 9.38 12.29 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1.88 12.33 13.80 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.94 4.51 1.42 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1.21 8.54 7.35 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 7.66 11.05 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10.25 12.57 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.05 3.98 1.21 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.06 7.03 6.48 5 25 35 55 85 115 160 250 500 1024 5 25 35 55 85 115 160 250 500 1024 250 75 50 25 15 10 7 5 2 1 250 75 50 25 15 10 7 5 2 1 91.46 78.65 69.62 70.44 66.24 62.39 60.94 53.30 43.79 33.01 91.77 78.58 69.92 70.34 66.61 62.35 61.34 53.46 44.58 35.50 88.77 78.48 73.26 68.81 65.68 62.73 59.08 53.20 40.44 21.16 88.56 78.11 72.79 68.08 64.74 61.71 57.83 51.84 38.70 19.64 0.00 0.00 36.35 44.06 46.67 47.74 42.27 43.98 38.75 29.70 0.00 0.00 37.45 46.71 49.26 50.04 45.54 45.48 39.58 32.01 0.00 0.00 25.80 38.82 38.81 37.60 33.44 28.47 14.03 4.37 0.00 0.00 26.98 43.10 46.17 47.54 46.43 43.08 33.84 17.96 0.00 0.00 0.00 10.06 26.87 33.48 27.77 35.63 33.63 26.95 0.00 0.00 0.00 11.18 30.25 36.76 32.71 38.40 35.25 28.80 0.00 0.00 0.00 11.25 23.59 27.46 25.65 22.80 12.37 3.87 0.00 0.00 0.00 12.28 28.17 34.36 35.75 34.70 29.15 15.83 0.00 0.00 0.00 0.00 7.77 19.67 16.95 28.37 28.86 24.14 0.00 0.00 0.00 0.00 8.91 22.64 21.16 31.70 31.17 25.89 0.00 0.00 0.00 0.00 9.42 17.72 18.58 17.85 10.62 3.37 0.00 0.00 0.00 0.00 11.25 22.44 26.23 27.14 25.01 14.06 A35 Table 27: MNIST Certified Accuracy Comparison: MNIST (d = 784) certified accuracy (% – larger is better) for our certified feature defense, feature partition aggregation (FPA), and baseline randomized abla- tion (RA). "Plurality" denotes FPA with plurality voting as the decision function (Sec. 4.1) while "Run-Off" denotes FPA using run-off elections as the decision function (Sec. 4.2). "[LF20b]" denotes Levine and Feizi's [LF20b] original version of randomized ablation while "[Jia+22b]" denotes Jia et al.'s [Jia+22b] improved ver- sion of RA that is tight for top-1 predictions. We also consider an additional naive baseline that always predicts f (x) = 1, where, for correct predictions, the feature robustness equals d. For each certified robustness level, each method's best performing hyperparameter setting is shown in bold with the overall best performing method shown in blue. These numerical results are visualized graphically as envelope plots in Figure 2. Method Cert. Alg. Hyper. Setting 0 4 8 12 16 20 24 28 32 36 40 Certified Robustness Always f (x) = 1 N/A 11.35 11.35 11.35 11.35 11.35 11.35 11.35 11.35 11.35 11.35 11.35 FPA (T ) (ours) RA (e) Plurality Run-Off [LF20b] [Jia+22b] 0.00 0.00 0.00 13.18 26.26 25.34 24.52 22.13 22.70 17.63 0.00 0.00 0.00 14.36 37.10 34.68 33.92 31.38 31.04 24.57 0.00 0.00 0.00 0.00 0.00 7.30 15.23 10.62 9.17 10.51 0.00 0.00 0.00 0.00 0.00 11.20 24.36 23.94 15.76 12.46 0.00 0.00 0.00 0.00 16.08 17.90 17.89 16.52 18.52 16.33 0.00 0.00 0.00 0.00 23.91 25.48 26.20 24.57 25.06 21.29 0.00 0.00 0.00 0.00 0.00 0.00 7.50 8.40 8.69 10.19 0.00 0.00 0.00 0.00 0.00 0.00 12.98 17.91 14.46 12.01 0.00 0.00 0.00 0.00 7.95 12.43 12.99 13.04 15.23 15.16 0.00 0.00 0.00 0.00 12.14 17.82 20.14 19.00 20.82 18.71 0.00 0.00 0.00 0.00 0.00 0.00 0.96 5.99 7.86 9.84 0.00 0.00 0.00 0.00 0.00 0.00 2.70 13.49 13.43 11.71 0.00 0.00 0.00 0.00 1.78 8.11 9.16 10.51 12.54 14.40 0.00 0.00 0.00 0.00 2.97 11.09 14.71 14.85 17.47 17.17 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3.72 6.90 9.41 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10.38 12.52 11.50 0.00 0.00 0.00 0.00 0.00 3.89 6.24 8.42 10.45 13.79 0.00 0.00 0.00 0.00 0.00 5.28 9.98 11.80 14.69 15.82 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1.54 5.73 8.87 0.00 0.00 0.00 0.00 0.00 0.00 0.00 7.33 11.51 11.40 0.00 0.00 0.00 0.00 0.00 0.42 3.22 6.61 8.38 13.00 0.00 0.00 0.00 0.00 0.00 0.45 6.02 9.05 12.00 14.82 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.16 4.42 8.21 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3.73 10.77 11.30 0.00 0.00 0.00 0.00 0.00 0.00 0.71 4.63 6.30 12.30 0.00 0.00 0.00 0.00 0.00 0.00 2.34 6.46 9.85 13.81 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3.23 7.04 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.80 10.05 11.30 5 10 25 35 60 75 90 105 130 240 5 10 25 35 60 75 90 105 130 240 100 85 60 50 40 30 20 10 5 3 100 85 60 50 40 30 20 10 5 3 99.50 98.64 95.77 91.70 83.54 74.99 69.94 62.53 57.48 28.13 99.51 98.67 96.06 93.05 87.22 81.74 79.25 74.45 69.93 48.33 98.78 98.60 97.85 97.26 96.42 94.87 90.99 76.78 35.54 16.91 98.75 98.52 97.78 97.07 96.13 94.47 90.07 74.69 32.89 15.91 0.00 87.16 86.48 79.49 70.30 61.44 57.11 50.33 46.68 24.67 0.00 87.50 88.72 83.56 76.59 68.54 66.38 61.76 58.88 40.31 84.16 86.08 84.30 81.56 76.53 66.97 48.11 20.36 10.85 11.13 86.10 88.21 88.45 87.28 85.69 82.47 76.29 59.11 26.17 14.97 0.00 0.00 66.42 59.53 54.72 47.75 43.89 39.10 36.45 21.81 0.00 0.00 71.52 67.58 63.67 56.44 53.93 50.73 48.44 33.37 0.00 0.00 35.32 49.77 51.99 46.33 34.38 16.22 10.31 10.96 0.00 0.00 39.75 57.28 62.37 62.32 58.26 44.55 21.19 13.90 0.00 0.00 20.05 35.95 39.10 34.97 33.01 29.27 28.38 19.57 0.00 0.00 20.28 44.72 50.52 44.65 43.35 40.32 38.73 28.30 0.00 0.00 0.00 0.00 16.85 26.88 23.77 13.08 9.75 10.70 0.00 0.00 0.00 0.00 21.15 36.45 39.39 32.87 17.56 13.10 A36 Table 28: Weather Certified Accuracy Comparison: Weather [Mal+21] dataset (d = 128) certified accu- racy (% – larger is better) for our certified feature defense, feature partition aggregation (FPA), and baseline randomized ablation (RA). "[LF20b]" denotes Levine and Feizi's [LF20b] original version of randomized abla- tion while "[Jia+22b]" denotes Jia et al.'s [Jia+22b] improved version of RA that is tight for top-1 predictions. Hammoudeh and Lowd's [HL23b] reduction is from certified regression to certified binary classification. Run-off is identical to plurality voting under binary classification, so we report only the plurality voting results below. We also consider an additional naive baseline that always predicts the median training set target value (i.e., f (x) = med{yi}n i=1), where, for correct predictions, the feature robustness equals d. For each certified robustness level, each method's best performing hyperparameter setting is shown in bold with the overall best performing method shown in blue. These numerical results are visualized graphically as envelope plots in Figure 3. Method Cert. Alg. Hyper. Setting 0 1 2 3 4 5 6 7 8 9 10 Certified Robustness Always f (x) = med{yi}n i=1 N/A 21.90 21.90 21.90 21.90 21.90 21.90 21.90 21.90 21.90 21.90 21.90 0.00 39.02 48.08 50.01 49.17 48.76 46.54 45.99 45.57 21.61 0.00 0.00 0.00 0.00 3.83 9.67 15.88 22.32 25.63 20.35 0.00 0.00 0.00 3.94 19.75 29.53 35.62 36.21 31.02 20.58 0.00 18.42 35.81 41.48 42.93 43.85 42.03 42.34 42.26 21.19 0.00 0.00 0.00 0.00 0.04 4.37 9.48 16.45 23.08 20.19 0.00 0.00 0.00 0.00 5.20 19.26 29.11 33.00 29.72 20.50 0.00 0.00 19.92 33.04 35.88 38.49 37.62 38.55 38.78 20.77 0.00 0.00 0.00 0.00 0.00 1.06 5.26 11.82 20.58 20.05 0.00 0.00 0.00 0.00 0.00 10.88 21.44 29.54 28.46 20.41 0.00 0.00 7.77 23.78 28.92 32.77 33.08 34.60 35.11 20.38 0.00 0.00 0.00 0.00 0.00 0.00 2.26 8.60 18.16 19.93 0.00 0.00 0.00 0.00 0.00 0.00 14.51 25.82 27.33 20.31 0.00 0.00 0.00 14.30 21.58 27.12 28.10 30.44 31.29 20.00 0.00 0.00 0.00 0.00 0.00 0.00 0.61 6.00 15.97 19.77 0.00 0.00 0.00 0.00 0.00 0.00 9.10 21.18 26.28 20.25 0.00 0.00 0.00 6.47 14.29 21.51 22.76 26.09 27.23 19.61 0.00 0.00 0.00 0.00 0.00 0.00 0.01 3.90 13.91 19.67 0.00 0.00 0.00 0.00 0.00 0.00 2.63 16.82 25.21 20.14 0.00 0.00 0.00 0.91 7.12 15.81 17.18 21.47 22.91 19.23 0.00 0.00 0.00 0.00 0.00 0.00 0.00 2.37 11.87 19.43 0.00 0.00 0.00 0.00 0.00 0.00 0.00 13.31 23.99 20.03 FPA (T ) (ours) Plurality RA (e) [LF20b] [Jia+22b] 5 11 15 21 25 31 35 41 45 127 50 40 30 20 16 12 9 6 3 1 50 40 30 20 16 12 9 6 3 1 85.29 82.48 81.09 76.10 71.40 67.06 62.56 60.19 57.96 23.43 78.62 76.56 72.04 66.94 63.89 58.59 54.68 47.94 36.88 21.00 76.59 74.82 70.74 65.87 63.10 57.74 53.97 47.25 36.01 20.84 77.38 76.34 75.23 70.78 66.29 62.80 58.84 56.83 54.99 22.95 22.32 31.26 39.64 45.11 45.77 45.19 44.55 41.22 33.32 20.68 47.32 53.84 56.18 56.66 55.29 51.96 49.95 44.86 34.97 20.76 62.69 67.59 68.16 64.73 60.70 58.18 54.93 53.34 51.94 22.49 0.00 0.00 9.53 20.61 26.67 31.87 35.11 34.84 30.57 20.61 0.00 0.00 31.24 44.24 46.24 45.73 45.97 41.94 33.59 20.72 0.00 55.50 58.98 57.69 55.03 53.39 50.72 49.72 48.81 22.04 0.00 0.00 0.00 6.82 11.64 18.36 25.05 28.60 27.90 20.48 0.00 0.00 0.00 26.06 34.49 38.47 41.18 39.16 32.19 20.63 A37 Table 29: Ames Certified Accuracy Comparison: Ames [De 11] dataset (d = 352) certified accuracy (% – larger is better) for our certified feature defense, feature partition aggregation (FPA), and baseline randomized ablation (RA). "[LF20b]" denotes Levine and Feizi's [LF20b] original version of randomized ablation while "[Jia+22b]" denotes Jia et al.'s [Jia+22b] improved version of RA that is tight for top-1 predictions. Hammoudeh and Lowd's [HL23b] reduction is from certified regression to certified binary classification. Run-off is identical to plurality voting under binary classification, so we report only the plurality voting results below. We also consider an additional naive baseline that always predicts the median training set target value (i.e., f (x) = med{yi}n i=1), where, for correct predictions, the feature robustness equals d. For each certified robustness level, each method's best performing hyperparameter setting is shown in bold with the overall best performing method shown in blue. These numerical results are visualized graphically as envelope plots in Figure 3. Method Cert. Alg. Hyper. Setting 0 1 2 3 4 5 6 7 8 9 10 Certified Robustness Always f (x) = med{yi}n i=1 N/A 31.40 31.40 31.40 31.40 31.40 31.40 31.40 31.40 31.40 31.40 31.40 0.00 22.53 41.64 43.69 42.66 42.32 40.96 37.88 36.01 32.42 0.00 0.00 4.10 10.24 16.38 20.82 26.28 29.69 32.76 32.08 0.00 7.17 25.60 31.06 34.81 35.84 37.54 35.84 33.79 33.11 0.00 5.12 32.42 35.84 37.20 38.23 37.20 35.49 34.47 32.08 0.00 0.00 0.00 1.71 5.46 15.02 20.48 27.99 31.40 32.08 0.00 0.00 6.48 16.38 26.96 31.06 33.79 35.49 33.45 33.11 0.00 0.00 22.87 28.67 32.08 33.79 34.47 34.13 33.45 32.08 0.00 0.00 0.00 0.00 0.00 4.10 15.02 23.21 28.67 31.74 0.00 0.00 0.00 2.39 15.36 24.91 30.38 32.76 32.42 32.76 0.00 0.00 12.63 20.82 26.28 29.01 31.06 32.08 32.42 31.74 0.00 0.00 0.00 0.00 0.00 0.34 7.85 19.45 26.62 31.40 0.00 0.00 0.00 0.00 2.39 17.06 25.94 30.72 31.06 32.76 0.00 0.00 5.46 12.63 20.82 24.57 27.65 30.03 31.40 31.74 0.00 0.00 0.00 0.00 0.00 0.00 2.39 13.99 25.26 31.06 0.00 0.00 0.00 0.00 0.00 6.48 22.53 27.65 30.38 32.42 0.00 0.00 1.37 6.14 15.02 19.45 24.23 28.33 30.38 31.74 0.00 0.00 0.00 0.00 0.00 0.00 0.00 9.90 24.57 30.38 0.00 0.00 0.00 0.00 0.00 0.34 13.99 24.91 29.35 32.08 0.00 0.00 0.00 2.39 10.24 14.68 20.82 26.28 29.69 31.40 0.00 0.00 0.00 0.00 0.00 0.00 0.00 5.80 22.87 30.38 0.00 0.00 0.00 0.00 0.00 0.00 6.83 22.18 29.01 32.08 FPA (T ) (ours) Plurality RA (e) [LF20b] [Jia+22b] 5 11 21 25 31 35 41 51 65 101 60 50 40 35 30 25 20 15 10 5 60 50 40 35 30 25 20 15 10 5 84.64 78.50 65.53 61.77 57.68 55.97 52.90 47.10 41.64 33.45 68.94 67.58 61.77 61.09 57.68 53.58 51.54 45.05 37.20 33.79 67.24 66.89 61.77 60.07 57.00 52.56 49.49 44.37 37.54 33.79 72.01 70.99 60.41 58.36 54.95 52.56 50.51 44.37 39.25 33.11 43.34 52.56 50.17 49.49 48.46 47.78 43.34 39.25 36.18 33.11 59.73 59.73 55.63 52.90 51.88 50.17 45.73 42.32 36.52 33.45 39.93 58.70 54.95 54.27 51.54 48.81 47.10 41.98 37.88 32.76 11.95 32.08 38.23 39.93 39.59 38.91 38.23 36.18 35.15 32.76 46.76 48.81 49.49 48.12 47.10 45.39 44.03 40.96 35.84 33.45 0.00 40.96 50.17 49.83 48.12 45.73 43.34 39.25 37.20 32.76 0.00 7.85 18.09 20.48 26.96 27.65 32.76 34.81 33.11 32.08 13.99 31.40 38.57 38.91 41.30 40.27 41.30 39.93 33.79 33.11 A38 H.3.2 Graphical Comparison of Feature Partition Aggregation and Randomized Ablation Recall that hyperparameters T for FPA and e for baseline randomized ablation control the corresponding method's accuracy-robustness trade-off. Specifically, a smaller value of T and a larger value of e entails better accuracy. This section emulates a defender that tunes FPA's and randomized ablation's hyperparameters to maximize the certified accuracy at each individual robustness level individually. Tables 26 through 29 above report each method's certified accuracy across 10 comparable hyperparameter settings. For a given method, each hyperparameter setting provides a certified accuracy versus certified robustness curve (example curves are shown in Figures 4 and 5). This section considers each defense's certified accuracy envelope. Specifically, an envelope in mathematics represents the supremum of a set of curves. Intuitively, taking the certified accuracy envelope emulates maximizing a method's performance at each certified robustness level individually across the 10 hyperparameter settings. Figures 2 and 3 visualize the certified accuracy envelopes in two ways. First, Figures 2a, 2b, 3a, and 3b visualize the envelope curves themselves. These figures also visualize the same naive baselines considered in Sec. H.3.1 above (e.g., always predict label 1 for classification and median med{yi}n i=1 for regression). Second, Figures 2c, 2d, 3c, and 3d visualize the improvement in certified accuracy between FPA and the two versions of randomized ablation across the range of certified robustness levels. A positive value in these four subfigures entails that FPA outperformed the corresponding baseline (i.e., FPA had a larger certified accuracy), while a negative value entails the baseline outperformed FPA. For CIFAR10 and MNIST, FPA with run-off's envelope had larger certified accuracy than the envelope of both versions of baseline RA across the entire certified robustness range (x-axis). Specifically, for Levine and Feizi's [LF20b] version of RA, FPA with run-off's certified accuracy advantage was as large as 14.17 and 24.28 percentage points (pp) for CIFAR10 and MNIST, respectively. For Jia et al.'s [Jia+22b] version of RA, FPA with run-off's certified accuracy advantage was as large as 6.54pp and 12.74pp for CIFAR10 and MNIST, respectively. For regression datasets Weather and Ames, FPA's envelope had larger certified accuracy than the envelope of both versions of baseline RA across most of the certified accuracy range. At the largest robustness values, [Jia+22b] marginally outperformed both FPA and the naive baseline by <2pp. At smaller certified robustness values, FPA outperformed Jia et al.'s [Jia+22b] version of RA by up to 21.9pp and 17.4pp for Weather and Ames, respectively. A39 Always f (x) = 1 FPA Plural (ours) FPA Run-Off (ours) RA [LF20b] RA [Jia+22b] 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 0 30 60 90 120 150 0 10 20 30 40 50 Certified Robustness Certified Robustness (a) CIFAR10: Certified Accuracy Envelope (b) MNIST: Certified Accuracy Envelope FPA Run-Off vs. RA [LF20b] FPA Run-Off vs. RA [Jia+22b] ) % ( . c c A d e fi i t r e C n i t n e m e v o r p m I 12 9 6 3 0 0 30 60 90 120 150 Certified Robustness ) % ( . c c A d e fi i t r e C n i t n e m e v o r p m I 24 20 16 12 8 4 0 0 10 20 30 40 50 Certified Robustness (c) CIFAR10: FPA's Certified Accuracy Improvement over RA (d) MNIST: FPA's Certified Accuracy Improvement over RA Figure 2: Classification certified accuracy envelope for datasets CIFAR10 (d = 1024) and MNIST (d = 784) for feature partition aggregation (FPA) and baseline randomized ablation (RA). Each method's envelope considers the corresponding hyperparameters in Tables 26 and 27, emulating a certified defense where the hyperparameters are roughly tuned to maximize the certified accuracy at each robustness level. Subfigures 2a and 2b visualize each method's certified accuracy envelope (larger is better); also shown in these subfigures is a naive baseline where the decision function always predicts label f (x) = 1. Subfigures 2c and 2d visualize the improvement in certified accuracy when using FPA with the run-off decision function over the two randomized ablation baselines from Levine and Feizi [LF20b] and Jia et al. [Jia+22b]. FPA with run-off's certified accuracy advantage over Jia et al.'s version of RA was as large as 6.54pp and 12.74pp for CIFAR10 and MNIST, respectively. FPA's performance advantage was even larger over Levine and Feizi's [LF20b] version of RA. The envelope plots' underlying numerical values are provided in Table 26 for CIFAR10 and Table 27 for MNIST. A40 Always f (x) = med{yi}n i=1 FPA (Plural) (ours) RA [LF20b] RA [Jia+22b] 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 0 2 4 6 8 10 12 0 2 4 6 8 Certified Robustness Certified Robustness (a) Weather: Certified Accuracy Envelope (b) Ames: Certified Accuracy Envelope FPA Plural vs. RA [LF20b] FPA Plural vs. RA [Jia+22b] ) % ( . c c A d e fi i t r e C n i t n e m e v o r p m I 32 24 16 8 0 0 ) % ( . c c A d e fi i t r e C n i t n e m e v o r p m I 20 16 12 8 4 0 0 2 4 6 8 3 6 9 12 Certified Robustness Certified Robustness (c) Weather: FPA's Certified Accuracy Improvement over RA (d) Ames: FPA's Certified Accuracy Improvement over RA Figure 3: Regression certified accuracy envelope for the Weather [Mal+21] (d = 128) and Ames [De 11] (d = 352) datasets for feature partition aggregation (FPA) and baseline randomized ablation (RA). Each method's envelope considers the corresponding hyperparameters in Tables 28 and 29, emulating a certified defense where the hyperparameters are tuned to maximize each robustness level's certified accuracy. Subfigures 3a and 3b visualize each method's certified accuracy envelope (larger is better); also shown in these subfigures is a naive baseline that always predicts the median training data target value. Subfigures 3c and 3d visualize the improvement in certified accuracy when using FPA (with plurality voting) as the decision function over the two randomized ablation baselines from Levine and Feizi [LF20b] and Jia et al. [Jia+22b]. FPA with run-off's certified accuracy advantage over Jia et al.'s version of RA was as large as 21.9pp and 17.4pp for Weather and Ames, respectively. FPA's performance advantage was even larger over Levine and Feizi's [LF20b] version of RA. FPA outperforms randomized ablation for smaller certified robustness values, while Jia et al.'s [Jia+22b] version of RA marginally outperformed both FPA and the naive baseline at larger robustness values. The envelope plots' underlying numerical values are provided in Table 28 for Weather and Table 29 for Ames. A41 H.4 Feature Partition Aggregation Model Count Hyperparameter Analysis Figure 4 visualizes the certified accuracy14 of FPA for multiple T values for all four datasets in Section 6. Figure 4 also ), where a single model is trained on all features. visualizes each dataset's non-robust (i.e., uncertified) accuracy ( These experiments used the same evaluation setup as Section 6. For classification datasets CIFAR10 [KNH14] and MNIST [LeC+98], results using plurality voting and run-off decisions are provided. For regression datasets Weather [Mal+21] and Ames [De 11], plurality voting and run-off are identical; we provide regression results for both LightGBM [Ke+17] and linear submodels. The exact effect of T differs by dataset. As a general rule, increasing T decreases the ensemble's classification accuracy (although not necessarily monotonically in the case of deterministic partitioning). Figure 4 visualizes this basic relationship where increasing T generally increases the maximum certified robustness. 14Certified accuracy w.r.t. ψ ∈ N quantifies the fraction of correctly-classified test instances with certified robustness at least ψ. A42 Non-Robust (T = 1) T = 115 T = 5 T = 160 T = 25 T = 250 T = 35 T = 500 T = 55 T = 1024 T = 85 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 0 15 30 45 60 75 90 0 15 30 45 60 75 90 Certified Robustness (r) Certified Robustness (r) (a) CIFAR10 Plurality Voting (b) CIFAR10 Run-Off Non-Robust (T = 1) T = 75 T = 5 T = 90 T = 10 T = 105 T = 25 T = 130 T = 35 T = 240 T = 60 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 0 10 20 30 40 0 10 20 30 40 Certified Robustness (r) Certified Robustness (r) (c) MNIST Plurality Voting Non-Robust (T = 1) T = 31 T = 5 T = 35 T = 11 T = 41 (d) MNIST Run-Off T = 21 T = 127 T = 25 T = 15 T = 45 100 ) % ( . c c A d e fi i t r e C 80 60 40 20 0 4 8 12 16 20 0 4 8 12 16 20 Certified Robustness (r) Certified Robustness (r) (e) Weather (LightGBM Submodels) (f) Weather (Linear Submodels) Non-Robust (T = 1) T = 35 T = 5 T = 41 T = 11 T = 51 T = 25 T = 101 T = 31 T = 21 T = 65 100 ) % ( . c c A d e fi i t r e C 80 60 40 20 100 80 60 40 20 100 80 60 40 20 100 80 60 40 20 100 80 60 40 20 ) % ( . c c A d e fi i t r e C ) % ( . c c A d e fi i t r e C ) % ( . c c A d e fi i t r e C ) % ( . c c A d e fi i t r e C 0 4 8 12 16 20 0 4 8 12 16 20 Certified Robustness (r) Certified Robustness (r) (g) Ames (LightGBM Submodels) (h) Ames (Linear Submodels) Figure 4: Effect of Submodel Count T on the Certified Feature Robustness: Mean certified accuracy (%) for our sparse defense, feature partition aggregation (FPA), across different submodel counts (T ). The non-robust accuracy ( ) visualizes the classification accuracy of a single model (T = 1) trained on all features; these single model prediction results are provided only for reference. For all four datasets, increasing T decreases the classifi- cation accuracy but increases the maximum certifiable robustness. A43 H.5 Randomized Ablation Number of Kept Features (e) Hyperparameter Analysis As discussed in Sections 3, 6, and C, l0-norm certified defense randomized ablation (RA) is based on randomized smoothing where predictions are averaged across multiple randomly perturbed inputs. For each input, e ∈ N features in x ∈ X are randomly selected to be kept at their original value, and the rest of the features are ablated, i.e., marked as unused or "turned off." In short, e controls RA's accuracy versus robustness tradeoff where larger e increases the classifier's accuracy at the expense of a smaller maximum achievable robustness (ρ). By contrast, a small e decreases the model's accuracy but increases the maximum achievable certified robustness. Figure 5 visualizes RA's certified accuracy15 for a range of e settings for all four datasets in Sec. 6, namely CIFAR10 [KNH14], MNIST [LeC+98], Weather [Mal+21], and Ames [De 11]. Fig. 5 also visualizes each dataset's non-robust accuracy ( ), where a single non-smoothed model is trained on all features. 15Certified accuracy w.r.t. ψ ∈ N quantifies the fraction of correctly-classified test instances with certified robustness at least ψ. A44 Non-Robust (T = 1) e = 10 e = 250 e = 7 e = 75 e = 5 e = 50 e = 2 e = 25 e = 1 e = 15 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 0 15 30 45 60 75 90 0 15 30 45 60 75 90 Certified l0-Norm Robustness (ρ) Certified l0-Norm Robustness (ρ) (a) CIFAR10 RA [LF20b] (b) CIFAR10 RA [Jia+22b] Non-Robust (T = 1) e = 30 e = 100 e = 20 e = 85 e = 10 e = 60 e = 5 e = 50 e = 3 e = 40 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 0 10 20 30 40 0 10 20 30 40 Certified l0-Norm Robustness (ρ) Certified l0-Norm Robustness (ρ) (c) MNIST RA [LF20b] (d) MNIST RA [Jia+22b] Non-Robust (T = 1) e = 12 e = 50 e = 9 e = 40 e = 6 e = 20 e = 1 e = 16 e = 30 e = 3 100 ) % ( . c c A d e fi i t r e C 80 60 40 20 0 4 8 12 16 20 0 4 8 12 16 20 Certified l0-Norm Robustness (ρ) Certified l0-Norm Robustness (ρ) (e) Weather RA [LF20b] (f) Weather RA [Jia+22b] Non-Robust (T = 1) e = 25 e = 60 e = 20 e = 50 e = 15 e = 35 e = 5 e = 30 e = 40 e = 10 100 ) % ( . c c A d e fi i t r e C 80 60 40 20 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 0 4 8 12 16 20 0 4 8 12 16 20 Certified l0-Norm Robustness (ρ) Certified l0-Norm Robustness (ρ) (g) Ames RA [LF20b] (h) Ames RA [Jia+22b] Figure 5: Effect of the Number of Kept Features (e) on RA's Certified l0-Norm Robustness: Mean certified accuracy (%) for baseline randomized ablation across different quantities of kept pixels (e). Non-robust accuracy ( ) visualizes the peak accuracy of a single model (T = 1) trained on all features; these single model predictions are provided only for reference. A45 H.6 Comparing FPA Plurality Voting and Run-Off Certification Sec. 4 proposes two decision functions for FPA, namely plurality voting (4.1) and run-off elections (4.2). Both decision functions can be used to certify feature robustness (Def. 1). However, the two decision functions' guarantees may differ significantly in size.16 Below, Figures 6, 7, and 8 show the improvement in FPA's certified accuracy 17 for CIFAR10 and MNIST when robustness certification is enhanced using run-off elections. Specifically, Figure 6 visualizes the improvement in certified accuracy when run-off is used instead of plurality voting for each certified robustness value r, where a positive value denotes that run-off performed better, while a negative value entails that plurality voting had better performance. Across almost all values of r and submodel counts T , combining FPA with run-off improved the certified accuracy, with performance improvements as large as 12.3 percentage points (pp) for MNIST and 3.8pp for CIFAR10. Figures 7 and 8 visualize the performance of FPA with plurality voting directly against that of FPA with run-off for CIFAR10 and MNIST, respectively. T = 25 T = 50 T = 115 T = 145 T = 25 T = 60 T = 90 T = 120 ) p p ( y c a r u c c A d e fi i t r e C n i t n e m e v o r p m I 3.75 3 2.25 1.5 0.75 0 15 30 45 60 75 Certified Robustness (a) CIFAR10 ) p p ( y c a r u c c A d e fi i t r e C n i t n e m e v o r p m I 12 10 8 6 4 2 0 10 20 30 40 50 Certified Robustness (b) MNIST Figure 6: Improvement in FPA's Certified Accuracy with Run-Off Elections for CIFAR10 and MNIST: Effect of the decision function on FPA's certified accuracy. 0 on the y-axis denotes the baseline performance of FPA using plurality voting-based (Sec. 4.1). A positive value denotes that run-off-based certification improves FPA's certified accuracy, while a negative value denotes run-off degrades performance. Across almost all submodel counts T and certified robustness levels r, run-off improves FPA's certified accuracy, with improvements up to 12.3 percentage points (pp) on MNIST and 3.8pp on CIFAR10. 16Recall that run-off and plurality voting are identical for regression datasets Weather [Mal+21] and Ames [De 11] since Hammoudeh and Lowd's [HL23b] reduction is from certified regression to certified binary classification. 17Certified accuracy w.r.t. ψ ∈ N quantifies the fraction of correctly-classified test instances with certified robustness at least ψ. A46 Non-Robust (T = 1) Plurality Run-Off 100 80 60 40 20 ) % ( y c a r u c c A d e fi i t r e C 0 3 6 9 12 0 5 10 15 20 25 Certified Robustness (a) CIFAR10: T = 25 Certified Robustness (b) CIFAR10: T = 50 100 80 60 40 20 ) % ( y c a r u c c A d e fi i t r e C 100 80 60 40 20 ) % ( y c a r u c c A d e fi i t r e C 100 80 60 40 20 ) % ( y c a r u c c A d e fi i t r e C 0 15 30 45 60 0 15 30 45 60 75 Certified Robustness (c) CIFAR10: T = 115 Certified Robustness (d) CIFAR10: T = 145 Figure 7: Effect of the Decision Function on FPA's CIFAR10 Certified Accuracy: Comparison of the certified accuracy of FPA when using the plurality-voting decision function (Sec. 4.1) versus the run-off decision function (Sec. 4.2). Across all model counts (T ) and certified robustness levels (r), run-off improved the certified accuracy, with the maximum improvement up to 3.8 percentage points on CIFAR10. A47 Non-Robust (T = 1) Plurality Run-Off 100 80 60 40 20 ) % ( y c a r u c c A d e fi i t r e C 0 3 6 9 12 0 8 16 24 32 Certified Robustness (a) MNIST: T = 25 Certified Robustness (b) MNIST: T = 60 100 80 60 40 20 ) % ( y c a r u c c A d e fi i t r e C 100 80 60 40 20 100 80 60 40 20 ) % ( y c a r u c c A d e fi i t r e C ) % ( y c a r u c c A d e fi i t r e C 0 10 20 30 40 0 10 20 30 40 50 60 Certified Robustness (c) MNIST: T = 90 Certified Robustness (d) MNIST: T = 120 Figure 8: Effect of the Decision Function on FPA's MNIST Certified Accuracy: Comparison of the certified accuracy of FPA when using the plurality-voting decision function (Sec. 4.1) versus the run-off decision function (Sec. 4.2). Across all model counts (T ) and certified robustness levels (r), run-off improved the certified accuracy, with the maximum improvement up to 12.3 percentage points on MNIST. A48 H.7 Random vs. Deterministic Feature Partitioning Sec. 5 proposes two paradigms for partitioning the d features between the T submodels. The first option, balanced random partitioning, assigns each submodel approximately the same number of features uniformly at random. The second option, deterministic partitioning, uses a deterministic scheme to decide the set of features assigned to each submodel. In the main paper, we propose what we term "strided partitioning," a deterministic partitioning strategy where for submodel ft, the corresponding feature set is St = {j ∈ [d] : j mod T = t − 1}. (33) Strided partitioning is specifically targeted toward structured, two-dimensional feature sets (e.g., images). Striding ensures that each subset St contains feature information across the 2D grid. Alternative deterministic strategies we considered include "patching," where the image is broken up into a grid of disjoint 2D patches. Each submodel is then trained on a different subpatch. Patching performed exceptionally poorly (much worse than random partitioning) because, in short, each submodel is trained on highly correlated pixels limiting the information available to each. Moreover, many of the submodel patches contained no information from the highly salient center pixels. A third deterministic partitioning strategy we considered assigned pixels to each submodel starting from the center of the image. In essence, this "spiral" strategy renumbers the pixels, defining the center pixel as feature 1 and then assigning pixels indices in order based on their Manhattan distance from the center. The intuition behind the "spiral" strategy is to maximize the number of highly-salient center pixels used by each submodel. Figure 9 compares FPA with plurality voting's certified accuracy using random partitioning versus the consistently best performing deterministic strategy – striding. We consider three datasets from Sec. 6. CIFAR10 [KNH14] (d = 1024) and MNIST [LeC+98] (d = 784) are image classification datasets, while Weather [Mal+21] is a tabular regression dataset. For all three datasets, the partitioning strategy used in Sec. 6 is shown as a solid line, while the other partitioning strategy is shown as a dashed line. Below we briefly summarize the key takeaways from Fig. 9. Takeaway #1: Deterministic feature partitioning significantly improves FPA's performance on vision datasets. For both CIFAR10 and MNIST, deterministic (strided) feature partitioning significantly outperforms random partitioning. For example, on CIFAR10 and MNIST T = 25, strided partitioning improves the mean certified accuracy by up to 15.6% and 11.9%, respectively. Takeaway #2: Deterministic partitioning's benefits decrease with increasing submodel count. For CIFAR10 with T = 115 submodels, deterministic partitioning improved FPA's mean certified accuracy by at most 5.8%; in contrast, for CIFAR10 with T = 25 submodels, deterministic partitioning improved performance by up to 15.6%. A similar trend is observed for MNIST. As T increases, each submodel is trained on (substantially) fewer pixels. As feature sparsity increases, the benefit of a regular pixel pattern decreases. Takeaway #3: Deterministic and random partitioning perform comparably for the Weather dataset. Tabular features are generally unstructured or, in some cases, loosely structured. Intuitively, there is no consistent advantage in ensuring that the tabular features considered by each submodel are well-spaced. A deterministic tabular feature partition can be viewed as a random variable drawn from the set of all random partitions. Some deterministic partitions outperform the mean random partition; other deterministic partitions underperform the mean random partition. We see this behavior in Fig. 9c, where for T = 11, strided partitioning outperforms balanced random while for T = 21, balanced random is better. For T = 31, strided and random partitioning perform similarly. A49 Rand. T = 25 Strided T = 25 Rand. T = 115 Strided T = 115 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 0 15 30 45 60 Certified Robustness (r) (a) CIFAR10 Rand. T = 25 Strided T = 25 Rand. T = 60 Strided T = 60 Rand. T = 80 Strided T = 80 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 0 10 20 30 40 Certified Robustness (r) (b) MNIST Rand. T = 11 Strided T = 11 Rand. T = 21 Strided T = 21 Rand. T = 31 Strided T = 31 100 80 60 40 20 ) % ( . c c A d e fi i t r e C 0 3 6 9 12 15 Certified Robustness (r) (c) Weather (LightGBM) Figure 9: Effect of the Feature Partitioning Paradigm on Certified Feature Robustness: Certified accuracy for feature partition aggregation (FPA) with plurality voting across different feature partitioning paradigms. Uncertified accuracy ( ) visualizes the peak accuracy of a single model (T = 1) trained on all features; these single model predictions are completely non-robust and provided only for reference. For each dataset, the feature partitioning strategy used in Sec. 6 is shown as a solid line. The alternate feature partitioning strategy is shown in the same color but as dashed lines. A50 H.8 Model Training Time This section summarizes the (sub)model training times of feature partition aggregation (FPA) and baseline random- ized ablation (RA). These experiments were performed on a desktop system with a single AMD 5950X 16-core CPU, 64GB of 3200MHz DDR4 RAM, and a single NVIDIA 3090 GPU. Recall that certified defenses against sparse attacks – both ours and randomized ablation – trade off accuracy against robustness. Put simply, larger certified guarantees are generally achieved at the expense of reduced accuracy (and vice versa). To capture the nature of this trade-off, supplemental Sec. H.3 reports performance at various hyperparameter settings. Hyperparameter settings can affect (sub)model training times so Table 30 reports the mean training times for two hyperparameter settings per method – one a higher accuracy setting and the other a more robust setting. For FPA, we separately report the mean training time for a single submodel as well as the total training time of the entire ensemble. Model training for randomized ablation used Levine and Feizi's [LF20b] original source code for MNIST and CIFAR10. Levine and Feizi's code was modified to support the Weather and Ames datasets, which are not included in RA's published implementation. For the tabular Weather and Ames dataset, FPA was 18× to 90× faster to train than randomized ablation. Randomized ablation is only compatible with model types that support stochastic, ablated training. By contrast, FPA supports any submodel type, including LightGBM gradient-boosted decision trees (GBDTs) used here. For vision datasets MNIST and CIFAR10, FPA's total ensemble training times are 2.1× to 11× slower than randomized ablation. Note that the training of each FPA submodel is fully independent. In other words, FPA ensemble training is embarrassingly parallel with up to T degrees of parallelism. Provided sufficient hardware, an FPA ensemble can be (significantly) faster to train in parallel than a randomized ablation model, as evidenced by Table 30's single FPA submodel training times. Training is identical for both Levine and Feizi's [LF20b] and Jia et al.'s [Jia+22b] versions of randomized abla- tion (RA). Table 30: Model Training Time: Mean model training time (in seconds) for feature partition aggre- gation (FPA) and baseline randomized ablation. For each dataset, we report the training times for two hyperparameter settings – one that achieves higher certified accuracy and the other that achieves larger certified robustness. For FPA, the time to train a single submodel and the total time to train the entire ensemble are reported. "<1" denotes that training took less than 1 second. Dataset CIFAR10 MNIST Weather Ames Random. Abl. FPA (ours) T Single Total 25 115 25 60 11 31 11 51 541 544 153 161 13 9 <1 <1 13,526 62,613 3,834 9,669 141 278 1 <1 e 75 25 45 20 20 8 50 15 Time 6,278 6,085 904 883 5,186 5,210 63 64 A51
http://arxiv.org/abs/2303.07122v5
2023-09-25T20:28:27
2023-02-22T19:35:28
Quantifying Causes of Arctic Amplification via Deep Learning based Time-series Causal Inference
The warming of the Arctic, also known as Arctic amplification, is led by several atmospheric and oceanic drivers. However, the details of its underlying thermodynamic causes are still unknown. Inferring the causal effects of atmospheric processes on sea ice melt using fixed treatment effect strategies leads to unrealistic counterfactual estimations. Such models are also prone to bias due to time-varying confoundedness. Further, the complex non-linearity in Earth science data makes it infeasible to perform causal inference using existing marginal structural techniques. In order to tackle these challenges, we propose TCINet - time-series causal inference model to infer causation under continuous treatment using recurrent neural networks and a novel probabilistic balancing technique. Through experiments on synthetic and observational data, we show how our research can substantially improve the ability to quantify leading causes of Arctic sea ice melt, further paving paths for causal inference in observational Earth science.
[ "Sahara Ali", "Omar Faruque", "Yiyi Huang", "Md. Osman Gani", "Aneesh Subramanian", "Nicole-Jienne Shchlegel", "Jianwu Wang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2303.07122v5", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2303.07122v5", "@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", "physics.ao-ph", "stat.ME" ]
3 2 0 2 p e S 5 2 ] I A . s c [ 5 v 2 2 1 7 0 . 3 0 3 2 : v i X r a Quantifying Causes of Arctic Amplification via Deep Learning based Time-series Causal Inference Sahara Ali∗§, Omar Faruque∗, Yiyi Huang∗, Md. Osman Gani∗§, Aneesh Subramanian†§, Nicole-Jeanne Schlegel‡, Jianwu Wang∗§ ∗Department of Information Systems, University of Maryland, Baltimore County, Baltimore, MD, United States †Department of Atmospheric and Oceanic Sciences, University of Colorado Boulder, Boulder, CO, United States ‡Geophysical Fluid Dynamics Laboratory, NOAA, Princeton, NJ, United States §NSF HDR Institute for Harnessing Data and Model Revolution in the Polar Regions (iHARP), United States Emails: ∗{sali9,omarf1,yhuang10,mogani,jianwu}@umbc.edu, †[email protected], ‡[email protected] Abstract-The warming of the Arctic, also known as Arctic amplification, is led by several atmospheric and oceanic drivers. However, the details of its underlying thermodynamic causes are still unknown. Inferring the causal effects of atmospheric processes on sea ice melt using fixed treatment effect strategies leads to unrealistic counterfactual estimations. Such methods are also prone to bias due to time-varying confoundedness. Further, the complex non-linearity in Earth science data makes it infeasible to perform causal inference using existing marginal structural techniques. In order to tackle these challenges, we propose TCINet - Time-series Causal Inference Network to infer causation under continuous treatment using recurrent neural networks and a novel probabilistic balancing technique. More specifically, we propose a neural network based potential outcome model using the long-short-term-memory (LSTM) layers for time-delayed factual and counterfactual predictions with a custom weighted loss. To tackle the confounding bias, we experiment with multiple balancing strategies, namely TCINet with the inverse probability weighting (IPTW), TCINet with stabilized weights using Gaussian Mixture Model (GMMs) and TCINet without any balancing technique. Through experiments on synthetic and observational data, we show how our research can substantially improve the ability to quantify leading causes of Arctic sea ice melt, further paving paths for causal inference in observational Earth science. Index Terms-Causal Inference, Deep Learning, LSTM, Arctic Amplification I. INTRODUCTION In the last few decades, Earth and Atmospheric scientists have observed greater climate change near the polar regions as compared to the rest of the world [20]. In 2018, the observed mean sea ice extent (SIE) at Kara Sea during the summer months of June, July and August (JJA) reduced to half of what it was in 1979, i.e. from 1.25 million km2 to just 0.5 million km2. What we are observing can happen in response to a change in global climate forcing. Due to the melting of highly reflective sea ice and snow regions in the Arctic and Antarctic, there is an increased absorption of solar radiation which amplifies the warming. This phenomenon, also known as polar amplification is causing the melting of polar ice sheets, resulting in sea level rise, and the rate of carbon uptake in the polar regions [20]. In light of this phenomenon, the warming of Arctic sea ice is referred to Arctic Amplification [28]. Though, it has not been scientifically proven if the Arctic has warmed more than the rest of the hemisphere, studying the cause of thinning and retreat of the Arctic sea ice is a significant and substantial topic of atmospheric research [10]. In this paper, we dive deeper into the concept of time- series Causal Inference (CI) and present the challenges and opportunities for performing CI to study Arctic amplification under continuous treatment effect. Causal inference can be de- fined as the process of estimating the causal effects (influence) of one event, process, state or object (a cause) on another event, process, state or object (an effect). For estimation of causal effect, there are two main categories of techniques, potential outcome framework and do-calculus. The potential outcome framework relies on hypothetical interventions such that it defines the causal effect as the difference between the outcomes that would be observed with and without exposure to the intervention [32]. This technique is widely used in epidemiology where patients are randomly divided into treated and controlled groups and the effectiveness of treatment is inferred by observing patients condition with and without undergoing a treatment [33]. The treatment effect can be measured at individual, treated group, sub-treated group and entire population levels [25]. At the treatment effect measured is called Average Treatment Effect (ATE). In case of Earth science observational data, we consider ATE a more suitable metric as a causal estimand which quantifies the mean difference observed in potential outcomes Y given the exposure to treatment X, i.e., Y (X = 1) versus the inexposure to the treatment, i.e., Y (X = 0). The estab- lished standard approach of performing time-varying causal inference in case of linear time-series data is through the use of marginal structural models [30], whereas, recent development in deep learning has paved paths for robust techniques for performing causal inference on non-linear observational and longitudinal data [17]. While existing deep learning models majorly handle independent and identically distributed (i.i.d) data [17], we see only a handful of techniques capable of joint representation learning of continuous treatment and covariates in time-varying setting [4], [5], [21]. We compare in Table I the capability of existing deep learning and machine learning the population level, methods in fulfilling Earth science requirements. In light of above background, this paper presents a deep learning based time-series causal inference method that over- comes the limitations of existing causal effect estimation ap- proaches in answering important research questions pertaining to the climate change effects in the Arctic. We present TCINet, inference model, a deep learning based time-series causal for counterfactual prediction under time-delayed continuous treatment. Our major contributions can be summarized as follows: • We propose a deep learning based time-series causal inference model suitable for both time-varying and time- invariant treatment effect estimation, which includes a new definition for average treatment effect estimation in case of time-delayed continuous treatment. • We propose a novel probabilistic weighting technique to balance time-varying confoundedness by leveraging Gaussian Mixture Model (GMM). • We perform extensive experiments evaluating our ap- proach and compare it with the state-of-the-art (SOTA) approaches using synthetic time series data for fixed and continuous time-delayed treatments; further verifying our quantified causal effect results of thermodynamic pro- cesses on the Arctic sea ice melt with domain knowledge. Moving forward, we will use the following terminologies: treatment variable (which is an identified cause), potential out- come (the variable identified as effect) and covariates (a set of variables that are either common cause of both treatment and outcome or are descendants of treatment variables identified in the causal graph). A. Formulating Causal Inference for Earth Science Climate data is non-stationary with climatological trends and visible annual seasonality cycles, therefore, binary or fixed treatment effect estimation can be an unrealistic way of quantifying causation. Further, in the absence of ground truth, the exposure to a policy change or applying dynamic treatment regime cannot be observed. This leads to the inability to evaluate model's performance for counterfactual predictions in observational data [34], [38]. Existing techniques such as marginal structural models [30], time-series regression [16], matching methods [38] and deep learning based counterfactual predictions struggle in accurately inferring causation under time-delayed continuous intervention [17]. To fill this gap, we propose a deep learning based inference model, based on the potential outcomes framework [32] and extending the recurrent methods based counterfactual approach [21] to study the impact of time-delayed treatment in the presence of time- varying covariates. More formally, given treatment Xt at timestep t, our model infers the time-delayed outcome Yt+l at l steps ahead in future, in the presence of a set of M time-dependent covariates Zt. We give a generic formulation of our problem as follows. Y ( ˆXt) is the potential outcome, i.e., forecasted values under intervened treatment ˆX at time t, and Y (Xt) is the potential outcome under treatment X at time t without intervention (also called placebo effect), whereas Zt represents the covariates at time t, and f represents our proposed deep learning based inference model. We utilize both factual and counterfactual predictions of Y for all N timesteps to estimate lagged average treatment effect (LATE) under continuous intervention: Yt+l(X = xt) = f (Zt, xt) Yt+l( ˆX = ˆxt) = f (Zt, ˆxt) LAT E(l) = 1 N N (cid:88) t=1 E[Yt+l( ˆXt) − Yt+l(Xt)] (1) (2) (3) For consistent causal effect estimation under time-varying treatment, our proposed model holds the standard identifiabil- ity conditions or causal assumptions of consistency, positivity and conditional exchangeability [25], [30]. Our implementa- tion code can be accessed at the iHARP GitHub repository1. II. RELATED WORK Though causality based study is a comparatively a new paradigm in Earth science, causal inference has been a widely studied topic for decades in statistics, economics, public policy and even healthcare [17], [25], [41]. 1) G-Methods for Time-Varying Causal Inference: Esti- mating time-varying causal or treatment effects leads to the problem of time-varying confounding, that is the common influence a past treatment or covariate might have on the future treatments and the future outcome. Robin's g-methods have shown to provide promising results on reducing bias caused by time-varying treatment and covariates on the potential outcome [26]. G-methods provide metrics to overcome the problem of time-varying confounding through standardization, g-computation, and inverse probability of treatment weighted (IPTW) estimators [26]. The prediction models of these es- timators are typically based on linear or logistic regression such as Causal-ARIMA [24], Time Based Regression (TBR) [16] and Marginal Structural Models (MSMs) [30]. One big limitation of these methods is that, in case of complex non- linearity in treatment or outcome variables, the methods will lead to inaccurate results. 2) Deep Learning based Causal Inference: Causal in- ference methods based on representation learning or deep learning techniques [3] learn the representation of input data by extracting features from the covariate space [17], where majority of the existing deep learning based methods are developed for i.i.d data [17]. In these deep learning based CI methods, a single neural network (also called meta learner) can be trained to make predictions for both treatment and control groups individually to estimate the average treatment effect (ATE). Existing meta-learners include S(ingle)-learner [18], and T-learner or multi-task learners [15], [36] that jointly predict outcome for treated and controlled groups. X-learner [18] or cross-group learners are a hybrid form of meta learners that overcome the problem of unbalanced data in treatment and controlled groups. U-learner [27] and R-learner utilizes 1github.com/iharp-institute/causality-for-arctic-amplification Robinson transformation to develop a custom loss function for conditional ATE estimation [27]. SCIGAN is another causal inference method for estimating the effects of continuous- valued interventions that aim to learn the distribution of unob- served counterfactuals using Generative Adversarial Networks (GANs) [6]. The limitations of CI methods for i.i.d. data is that these methods perform poorly on sequential or time-series data with no capability to handle time lags or time-varying confounding effects, thereby leading to invalid causal effect estimation results. For time-series causal inference, researchers have proposed methodologies based on machine learning and deep learning models that can also tackle the problem of time- varying confounding [25]. Recurrent Marginal Structural Net- works (R-MSN) [21] and Counterfactual Recurrent Network (CRN) [5] are some of the recent models that claim to estimate causal effects in the presence of time-varying confounders, however, contrary to the claim, these methods are healthcare- specific and cannot be generalized for other domain areas like Earth science because these models require on-hot encoded treatment flags with multivariate combined dosage. Talking about counterfactuals, the most recent model, Time Series Deconfounder - a multi-task method, leverages the assignment of multiple treatments over time to enable the estimation of treatment effects in the presence of multi-cause hidden confounders [4]. The Conditional Instrumental Variable (CIV) [39] method measures the causal effect β from covariates to the target variable using instrument variables that have a relation with covariates and target but are independent of any hidden confounder. To yield a better estimation the instrument variables are conditioned for single or multiple previous time steps in CIV. Though deep representation learning methods are capable of automatically learning the intrinsic correlations and are also effective in accurate counterfactual estimation, they often lead to predictions with high variance or uncertainty estimates. III. DATASETS To evaluate our model, we first generate synthetic data with time-delayed continuous treatment and time-varying covari- ates. We further provide details of the real world observational dataset pertaining to our research problem. A. Synthetic Data Using gaussian white noise, we generate four non-linear time-series given in Equations 4 to 7, mimicking the non- linearity in dynamic climate models. The corresponding true causal graph for these time-series is given in Figure 1. Here, we have taken S3 to be the treatment and S4 as the potential outcome. S1 and S2 will be considered as covariates where S1 is an observed time-varying confounder of both treatment and outcome. To generate coun- terfactuals, we intervene on S3, in two settings. First, we intervene on S3 as fixed treatment with binary values of [0, 1] to generate counterfactual values of S4. Next, we intervene on S3 by increasing S3 by 10% and generate corresponding S4 counterfactuals under continuous treatment. S1t = cos( t 10 ) + log(|S1t−6 − S1t−10| + 1) + 0.1ε1 (4) S2t = 1.2e S12 t−1 2 + ε2 S3t = −1.05e −S12 t−1 2 + ε3 (5) (6) S4t = −1.15e −S12 t−1 2 + 1.35e −S32 t−1 2 + 0.28e −S42 t−1 2 + ε4 (7) 3) Time-Varying Causal Inference for Earth Science: From climate or atmospheric science perspective, causality remains a lesser tapped area [14], [34], [35] and climatologist still rely on dynamical modeling techniques where certain atmospheric variables are nudged or perturbed as initial conditions in the physical simulation models (also called Earth System Models) to evaluate the outcome of these interventions on target variables [12], [22], [40]. Applying deep learning techniques to infer causal effects of climate change offers a data-driven and cost-effective solution to the problem. Deep learning (DL) models can work more efficiently and effectively than current climate model simulators that are highly computationally expensive. Our work will build on top of deep learning based predictive models where we will extend them from fixed treatment to continuous treatment setting. Table I shows a holistic comparison of some of the time-series based causal inference methods and their capabilities to handles different causal inference scenarios. Fig. 1. Causal graph of non-linear synthetic data. B. Observational Arctic Data We used observational sea-ice and reanalysis atmospheric and meteorological data which is available from 1979 till present. The reanalysis data is available with open access and can be obtained from European Centre for Medium- Range Weather Forecasts (ECMWF) ERA-5 global reanalysis product [2]. Whereas the sea ice concentration (SIC) values are obtained from Nimbus-7 SSMR and DMSP SSM/I-SSMIS passive microwave data version 1 [8] provided by the National Snow and Ice Data Center (NSIDC). The original data format is spatiotemporal from which we generated spatially averaged time-series combining sea ice extent values, oceanic and atmospheric variables. For this, daily gridded data over the regions of Barents Sea and Kara Sea, during 1979-2018, has been averaged using area-weighted method. The details of these variables are enlisted in Table II. TABLE I COMPARISON OF TCINET WITH EXISTING TIME-SERIES CAUSAL INFERENCE METHODS. Method Binary/ fixed treatment Continuous treatment Time varying treatment Time varying covariates Applicable on Earth Science Difference in Difference [19] Causal Impact [7] CIV [39] CRN [5] MSM [30] R-MSN [21] Time-series Deconfounder [4] TCINet (ours) ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✗ ✗ ✗ ✗ ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✗ ✓ ✓ ✗ ✗ ✗ ✗ ✓ TABLE II VARIABLES IN THE ARCTIC DATASET VARIABLE SPECIFIC HUMIDITY SHORTWAVE RADIATION LONGWAVE RADIATION RAINFALL RATE SEA SURFACE TEMPERATURE AIR TEMPERATURE GREENLAND BLOCKING INDEX SEA ICE EXTENT RANGE [0,0.1] [0,1500] [0,700] [0,800] [200,350] [200,350] UNIT KG/KG W/m2 W/m2 MM/DAY K K [5000,5500] [4, 13] M MILLION Km2 IV. METHODOLOGY Following the same principle of meta-learning used in existing deep learning based causal inference approaches, we propose a time-varying causal inference model, called Time- series Causal Inference Network (TCINet), on top of our previous work on LSTM based sea-ice forecasting model [1]. The training and inference phases of our TCINet pipeline are illustrated in Figure 2. In the training phase, time-delayed treatments Xt−l and time-varying covariates Zt−l are fed to our potential outcome model (see Subsection IV-B). To balance the bias due to time-varying covariates, we leverage Gaussian mixture modeling to compute stabilized weights (see Subsection IV-A). We also define a custom weighted loss to incorporate the balancing weights into our potential outcome model (see Subsection IV-C). In the inference phase, we perturb the treatment variable and feed it to the pretained outcome model to make factual and counterfactual predictions (see Subsection IV-D). We further explain how we estimate uncertainty during inference arguing on the feasibility of bootstrapping for time-series data. A. Balancing Time-varying Covariates Balancing is a treatment adjustment strategy that aims to deconfound the treatment from outcome by forcing the treated and control covariate distributions as close as possible. When conducting observational studies, researchers often face the challenge that treatment assignment is not randomized, leading to potential confounding variables that can bias the treatment effect estimates. Inverse Probability of Treatment Weights (IPTW) [31] is a statistical technique used in causal inference to address confounding bias in observational studies. IPTW generates a pseudo-population in which treatments are independent of confounders. To calculate IPTW, we first need the predicted probabilities of the observed treatments given the covariates. This is also known as the propensity score, given by prob(X|Z = z). When treatment and con- founders are time-varying, these IPTW weights for time- fixed treatments need to be generalized. For a time-varying treatment ̄Xt = (X1, X2, ..., Xt) and time-varying covariate ̄Zt = (Z1, Z2, ..., Zt), the IP weights for every timestep t are given by [13]: IP T W (l) = Πl t=1 1 f ( ̄Xt| ̄Zt) (8) Here, l represents the lag or length of treatment sequence, f (.) is the propensity score model, widely implemented using logistic regression following marginal structural modeling technique [30]. However, the propensity scores that are near 0 or 1 can yield extreme IPTW weights, leading to unstable estimates and inflated variances. To tackle this, [30] proposed the stabilized weights in which the IPTW is multiplied by the probability of receiving treatment, as given in Equation 9. Stabilized weights offer greater stability and reduce the variance in treatment effect estimation, which can improve the precision of the estimates. They are generally preferred in practice because of their improved numerical properties and stability. SW (l) = t=1f (Xt| ̄Xt−1) Πl t=1f (Xt| ̄Xt−1, ̄Zt) Πl (9) Here, f (.) represents the probability density function (PDF) of treatment at every timestep given covariates and treatment history. In case of binary or discrete treatment, the PDF can be estimated using logistic regression or sigmoid function. However, in case of continuous treatment such as our case, this estimation becomes complex as it requires a parametric model to estimate the PDF at every stage t [13]. We implement a Gaussian Mixture Model (GMM) [29] to estimate the probability density of treatment Xt at every timestep t. The step-by-step implementation of GMM for calculating stabilized weights is given in Algorithm 1. We refer to the conditional probability densities in Equation 9 as X pdf and XZ pdf in our algorithm. Whereas, the mean μ, covariance Σ and parameter α, estimated as mixing co- efficients, are all learned by the GMM model. First, we fit the GMM model on treatment history and covariates to learn these parameters. We then estimate the probability density of Xt given these parameter values at every timestep t using Equation 10. f (Xt|μ, Σ) = ( 1 (2π)d/2(cid:112)|Σ| (cid:20) ) exp − 1 2 (cid:21) (Xt − μ)T Σ−1(Xt − μ) (10) Algorithm 1: Stabilized Weights for Continuous Treat- ment Data: Treatment Data: X, Treatment History: ̄Xhist, Time-varying Covariates: ̄Z Result: Stabilized Weight Estimates SW 1 Function PDF_calc(X, ̄Xhist, ̄Z = []): // Concatenate the treatment history and covariates 2 3 4 5 6 7 8 9 10 11 XZ ← concat( ̄Xhist, ̄Z) ; l ← length of sequence XZ; for i ← 1 to l do ncomp ← Number of components for GMM; // Create a GMM object gmm ← GaussianMixture(ncomp) ; // Fit the GMM model gmm.fit(XZi); // Extract model parameters: (α, μ, Σ) ← (gmm.weights, gmm.means, gmm.covariances); // Estimate PDF for every component for j ← 1 to ncomp do pdfcomp[j] ← ( exp (cid:2)− 1 1 √ (2π)d/2 |Σj | 2 (Xi − μj)T Σ−1 // Sum PDF over all components pdf [i] ← (cid:80)ncomp j (Xi − μj)(cid:3); j=1 (pdfcomp[j] × α[j]); ) ∗ // Take product of PDFs over all sub-sequences pdfproduct ← Πl 12 13 X pdf ←PDF calc(X, ̄Xhist) ; 14 XZ pdf ←PDF calc(X, ̄Xhist, ̄Z) ; i=1pdf [i] return pdfproduct // Calculate stabilized weights at every timestep 15 for k ← 1 to ttimesteps do SW [k] ← X pdf [k] XZ pdf [k] ; 16 B. Potential Outcome Model (POM) We develop an LSTM-based prediction model as our poten- tial outcome model (POM), following the S-learner approach [17]. POM takes in input a 3D tensor of shape N × T × F . Here N represents the mini-batch size, T represents the time lag and F comprises the covariates and the treatment variable at timestep t. The model comprises three LSTM layers with RELU activation, where first two many-to-many (also called seq2seq) layers are followed by a Dropout layer to cater uncertainty estimation. These seq2seq layers take in a se- quence of input of length l and learn the latent representations φ of treatment and covariates. The third LSTM layer is a many-to-one layer succeeded by three fully connected Dense layers with linear activation. The purpose of these layers is to combine the learned representations to jointly predict the potential outcome Yt+l at timestep t + l where l is the time-dependency or lag. The model is compiled using Adam optimizer using the early stopping technique. For a joint input, the model will learn mixed representations of covariates and treatment. This will be problematic in causal effect estimation as we want to keep the covariates independent of the intervention on the treatment variable. This is where the balancing strategy comes into play. To debias the confoundedness, we use Gaussian Mixture Model (GMM), as discussed in Subsection IV-A, to get the stabilized weights SWt for time-varying treatment at each timestep t given the confounders. To train POM to make weighted predictions for potential outcome Yt+l, we implement a custom-weighted loss function. C. Custom Weighted Loss We introduce the stabilized weights into the POM model using a custom weighted loss technique, to regularize the predictive model. The SW weights SWt calculated using GMM are inducted to the predictive model loss Lpred. This implies the final loss of the model will be a weighted average of prediction loss over observed data points N , as shown in Equation 11, where Lpred is the mean squared error (MSE) loss. SWt ∗ Lpred t (11) Ltot = 1 N D. Inference N (cid:88) t=1 Once the predictive model, namely POM, is trained on the observational data, the next step is to predict factual and counterfactual outcomes. We do this by perturbing the treatment variables at every timestep while retaining the ob- served values of time-varying covariates. The updated data is fed to the model to make counterfactual predictions while factual predictions are made without performing any nudging or intervention on the treatment variable. Once we have both predictions for all timesteps, we calculate LATE using Equation 3. To gain confidence in the predicted counterfactual values, we analyze the predictive skill of the underlying deep learning Fig. 2. Training and inference/test phase pipeline of our proposed TCINet model. model and measure the model's epistemic uncertainty. Boot- strapping is a common approach used for quantifying model uncertainty in causal inference techniques [37], however, boot- strapping will lead to two potential problems in case of our data. First, bootstrapping requires random sampling of data for train and test split but sampling randomly from time-series data will corrupt the sequential pattern and lead to unrealistic results. Second, bootstrapping involves retraining the model every time a random number of samples are taken from the data. In case of TCINet, it will be computationally expensive to retrain the deep learning model n number of times as required by bootstrapping. We therefore take an alternative approach, where we train the TCINet modules POM and GMM once and make pre- dictions n times for each interventional scenario. We then calculate the mean and standard deviation of these predictions. The ATEs are recorded for observational data after making predictions for each case 50 times with a 95% confidence interval. V. RESULTS & ANALYSIS In this section, we report our experimental setup and results obtained on synthetic and observational data, followed by a critical analysis of our findings using RMSE, LATE and PEHE scores. A. Evaluation Metrics 1) Root Mean Square Error (RMSE): We evaluate the performance of our predictive models using the Root Mean Square Error (RMSE) which can be only calculated for fac- tual observational data but cannot be done for counterfactual predictions. RM SE = (cid:114) 1 N i=1(Yi − ˆYi)2 ΣN (12) 2) Precision in Estimated Heterogeneous Effects (PEHE): This metric is commonly used in machine learning literature for calculating the average error across the predicted ATEs [9]. PEHE metric, measuring causal effect estimation skill, can only be calculated for synthetic data which has ground truth information. √ P EHE = (cid:114) 1 N B. Experimental Setup i=1(AT Ei − ˆAT Ei)2 ΣN (13) We implement TCINet using Keras functional API with TensorFlow backend. The model has a total of 40, 551 train- able parameters. We compile the model using Adam optimizer with a 0.001 learning rate and train it using early stopping technique. We train three variants of our model depending upon the underlying balancing strategies used in custom weighted loss: TCINet with SW weights using GMM which we refer to as TCINet-GMM, TCINet with IPTW weights using Logistic Regression model, which we refer to as TCINet- LR; and TCINet without any weighting using standard Mean Squared Error loss which we refer to as TCINet− in Table III. C. Results on Synthetic Data We report our results on the three variants of the model; TCINet-GMM, TCINet-LR and TCINet and compare them with two state-of-the-art (SOTA) methods: time-varying CIV technique [39] and time-invariant Causal Impact [7] causal inference methods. We evaluate both the CIV and Causal Impact method using the synthetic dataset to measure the causal effect from the cause S3 to the target variable S4 in case of the fixed and continuous treatments explained in III-A. We report these results in Table III. Comparing the performance of three TCINet variants in Table III, we notice that all variants have marginal differences in RMSE scores, however, we see substantial differences in ATE estimation by these models. This performance difference is also evident from the low PEHE scores for TCINet-GMM in Table III. Since CIV does not provide RMSE values on factual estimation, we compare its performance based on estimated ATE values. Though CIV is an easier model to implement, we notice that in both cases, i.e., fixed and continuous treatment effect estimation, CIV performs poorly as compared to TCINet variants and Causal Impact, which gives us more confidence in our model performance. It is important to note here that Causal Impact provides the second best performance in case of fixed and continuous treatments, however, inherently Causal Impact cannot work with time-varying covariates and is therefore not suitable for our case. Moving forward, we analyze the observational data using TCINet-GMM owing to its superior performance. TABLE III CAUSAL INFERENCE MODELS PERFORMANCE ON SYNTHETIC DATA UNDER FIXED AND CONTINUOUS TREATMENTS FOR ONE-STEP AHEAD PREDICTION (TRUE ATE = -0.0514) MODEL TEST RMSE ESTIMATED LATE PEHE FIXED TREATMENT TCINET− TCINET-LR TCINET-GMM CIV [39] CAUSAL IMPACT [7] TCINET− TCINET-LR TCINET-GMM CIV [39] CAUSAL IMPACT [7] 1.079 1.142 1.023 N/A N/A -0.040 -0.037 -0.051 -0.219 -0.060 CONTINUOUS TREATMENT -0.036 -0.049 -0.050 0.515 -0.040 1.026 1.000 0.998 N/A N/A 1.132 1.227 1.004 N/A 1.110 1.221 1.143 1.102 N/A 1.112 D. TCINet for Arctic Amplification After gaining confidence in the predictive skill of TCINet for synthetic data, we use the model to answer an important domain science question on the observational data as identified by Atmospheric scientists [11]: How does increased Greenland Blocking (GBI) affect summertime regional Arctic sea ice melting given snowfall rate and solar radiation data? The Greenland block is a ridge of high pressure that sits near or over Greenland. It is the normalised area-weighted 500 hPa geopotential height over the region 60 − 80◦N, 20 − 80◦W . To identify the regions of interest and time lag by which GBI affects sea ice extent, we performed lagged correlation test between daily GBI values and regional sea ice extent given by [23] for sixteen sub-regions. We conducted experiments for a lag of 0 to 30 days and found the highest correlation at day 8 between GBI and SIE in Barents Sea and Kara Sea (combined as BarKara Sea in our analysis). To answer the domain science question, we first trained TCINet-GMM on forty years of our observational data. We then predict sea ice extent by perturbing the values of sum- mertime (June, July, August) GBI to the following four values: 1) 40-year-averaged daily GBI, 2) double GBI annual trend, 3) triple GBI annual trend, 4) quadruple GBI annual trend. In our efforts to quantify the effects of increasing GBI on declining sea ice, we first make predictions for summertime (June, July, August) sea ice for mean daily GBI values. We then perturb the GBI values by increasing them by a multiplicative factor of the daily recorded trend, i.e. 0.039. Our interpretation of ATE in case of observational sea ice data is that it reflects the average increase or decrease in sea ice extent under interventional treatment. Fig. 3. Comparison of annual mean sea ice extent (SIE) predictions given observational data (factual) versus predictions under interventional GBI (coun- terfactual) between 2003-2018. Here, each data point represents summer (JJA) mean SIE predicted for that year. As shown in Figure 3, we notice that increasing GBI leads to decrease in sea ice extent (blue line with counterfactual pre- dictions). Quantitatively, our model predicts that the average daily sea ice extent value in JJA summer months would have decreased by 0.64, 0.65 and 0.69 million km2 between 2003 to 2018, given the GBI was increased by 2, 3 and 4 times the daily trend. This aligns with the findings of [11] where summertime low clouds play an important role in driving sea ice melt by amplifying the adiabatic warming induced by a stronger anticyclonic circulation aloft. VI. DISCUSSION & FUTURE WORK In this paper, we propose a deep learning based time-series inference method for time-varying causal inference under continuous treatment effects using stabilized weights. We introduce a probabilistic method of implementing stabilized weights through gaussian modeling. Through ablative study, we show how our proposed model balances confoundedness in case of time-delayed treatment. We presented one use-case of analyzing the causal relation between Greenland blocking and sea ice melt. Through experiments, we noticed our data-driven findings align with the literature on "increasing GBI leads to decreasing SIE". For our ongoing research, we will continue to analyze similar other use cases in the realm of Arctic Amplification, such as the effects of atmospheric processes on Arctic sea ice melt. We will further extend our work to spatiotemporal causal inference to explore the potential of neural networks in learning and answering important Earth Science questions in the presence of temporal and spatial confounders. ACKNOWLEDGEMENT This work is supported by NSF grants: CAREER: Big Data Climate Causality (OAC-1942714) and HDR Institute: HARP - Harnessing Data and Model Revolution in the Polar Regions (OAC-2118285). REFERENCES [1] S. Ali, Y. Huang, X. Huang, and J. Wang. Sea ice forecasting using attention-based ensemble LSTM. Tackling Climate Change with Machine Learning Workshop at International Conference on Machine Learning (ICML). arXiv:2108.00853, 2021. [2] B. Bell, H. Hersbach, A. Simmons, P. Berrisford, P. Dahlgren, A. Hor ́anyi, J. Mu ̃noz-Sabater, J. Nicolas, R. Radu, D. Schepers, et al. The era5 global reanalysis: Preliminary extension to 1950. Quarterly the Royal Meteorological Society, 147(741):4186–4227, Journal of 2021. [3] Y. Bengio, A. Courville, and P. Vincent. Representation learning: A IEEE transactions on pattern analysis review and new perspectives. and machine intelligence, 35(8):1798–1828, 2013. [4] I. Bica, A. Alaa, and M. Van Der Schaar. Time series deconfounder: Estimating treatment effects over time in the presence of hidden con- founders. In International Conference on Machine Learning, pages 884– 895. PMLR, 2020. [5] I. Bica, A. M. Alaa, J. Jordon, and M. van der Schaar. Estimating coun- terfactual treatment outcomes over time through adversarially balanced representations. arXiv preprint arXiv:2002.04083, 2020. [6] I. Bica, J. Jordon, and M. van der Schaar. Estimating the effects of continuous-valued interventions using generative adversarial networks. Advances in Neural Information Processing Systems, 33:16434–16445, 2020. [7] K. H. Brodersen, F. Gallusser, J. Koehler, N. Remy, and S. L. Scott. Inferring causal impact using bayesian structural time-series models. Annals of Applied Statistics, 9:247–274, 2015. [8] D. Cavalieri, C. Parkinson, P. Gloersen, and H. Zwally. Sea Ice Con- centrations from Nimbus-7 SMMR and DMSP SSM/I-SSMIS Passive Microwave Data, Version 1. Technical report, NASA DAAC at the National Snow and Ice Data Center, 1996. [9] J. L. Hill. Bayesian nonparametric modeling for causal inference. Journal of Computational and Graphical Statistics, 20(1):217–240, 2011. [10] M. M. Holland and C. M. Bitz. Polar amplification of climate change in coupled models. Climate Dynamics, 21(3):221–232, 2003. [11] Y. Huang, Q. Ding, X. Dong, B. Xi, and I. Baxter. Summertime low clouds mediate the impact of the large-scale circulation on arctic sea ice. Communications Earth & Environment, 2(1):1–10, 2021. [12] Y. Huang, X. Dong, B. Xi, and Y. Deng. A survey of the atmospheric physical processes key to the onset of arctic sea ice melt in spring. Climate Dynamics, 52(7):4907–4922, 2019. [13] C. Huffman and E. van Gameren. Covariate balancing inverse probability weights for time-varying continuous interventions. Journal of Causal Inference, 6(2):20170002, 2018. [14] C. T. Jerzak, F. Johansson, and A. Daoud. Integrating earth observation data into causal inference: challenges and opportunities. arXiv preprint arXiv:2301.12985, 2023. [15] F. D. Johansson, U. Shalit, N. Kallus, and D. Sontag. Generalization bounds and representation learning for estimation of potential outcomes The Journal of Machine Learning Research, and causal effects. 23(1):7489–7538, 2022. [16] J. Kerman, P. Wang, and J. Vaver. Estimating ad effectiveness using geo experiments in a time-based regression framework. Technical report, Google, Inc., 2017. [17] B. Koch, T. Sainburg, P. Geraldo, S. Jiang, Y. Sun, and J. G. Foster. Deep learning of potential outcomes. arXiv preprint arXiv:2110.04442, 2021. [18] S. R. K ̈unzel, J. S. Sekhon, P. J. Bickel, and B. Yu. Metalearners for estimating heterogeneous treatment effects using machine learning. Proceedings of the national academy of sciences, 116(10):4156–4165, 2019. [19] M. Lechner. The estimation of causal effects by difference-in-difference methods. Foundations and Trends in Econometrics, 4(3):165–224, 2011. [20] S. Lee. A theory for polar amplification from a general circulation perspective. Asia-Pacific Journal of Atmospheric Sciences, 50(1):31–43, 2014. [21] B. Lim. Forecasting treatment responses over time using recurrent marginal structural networks. Advances in Neural Information Process- ing Systems, 31, 2018. [22] A. Marcovecchio, A. Behrangi, X. Dong, B. Xi, and Y. Huang. Precipita- tion influence on and response to early and late arctic sea ice melt onset during melt season. International Journal of Climatology, 42(1):81–96, 2022. [23] W. N. Meier and J. S. Stewart. Arctic and Antarctic regional masks for sea ice and related data products, Version 1, 2023. [24] F. Menchetti, F. Cipollini, and F. Mealli. Estimating the causal effect of an intervention in a time series setting: the C-ARIMA approach. arXiv preprint arXiv:2103.06740, 2021. [25] R. Moraffah, P. Sheth, M. Karami, A. Bhattacharya, Q. Wang, A. Tahir, A. Raglin, and H. Liu. Causal inference for time series analysis: Problems, methods and evaluation. Knowledge and Information Systems, pages 1–45, 2021. [26] A. I. Naimi, S. R. Cole, and E. H. Kennedy. An introduction to g methods. International journal of epidemiology, 46(2):756–762, 2017. [27] X. Nie and S. Wager. Quasi-oracle estimation of heterogeneous treatment effects. Biometrika, 108(2):299–319, 2021. [28] M. Rantanen, A. Y. Karpechko, A. Lipponen, K. Nordling, O. Hyv ̈arinen, K. Ruosteenoja, T. Vihma, and A. Laaksonen. The arctic has warmed nearly four times faster than the globe since 1979. Communications Earth & Environment, 3(1):1–10, 2022. [29] D. A. Reynolds et al. Gaussian mixture models. Encyclopedia of biometrics, 741(659-663), 2009. [30] J. M. Robins, M. A. Hernan, and B. Brumback. Marginal structural models and causal inference in epidemiology. Epidemiology, pages 550– 560, 2000. [31] D. B. Rubin. Estimating causal effects of treatments in randomized and nonrandomized studies. Journal of educational Psychology, 66(5):688, 1974. [32] D. B. Rubin. Comment: Neyman (1923) and causal inference in experiments and observational studies. Statistical Science, 5(4):472– 480, 1990. [33] D. B. Rubin. Causal inference using potential outcomes: Design, modeling, decisions. Journal of the American Statistical Association, 100(469):322–331, 2005. [34] J. Runge, S. Bathiany, E. Bollt, G. Camps-Valls, D. Coumou, E. Deyle, C. Glymour, M. Kretschmer, M. D. Mahecha, J. Mu ̃noz-Mar ́ı, et al. Inferring causation from time series in earth system sciences. Nature communications, 10(1):1–13, 2019. [35] J. Runge, A. Gerhardus, G. Varando, V. Eyring, and G. Camps-Valls. Causal inference for time series. Nature Reviews Earth & Environment, pages 1–19, 2023. [36] U. Shalit, F. D. Johansson, and D. Sontag. Estimating individual treatment effect: generalization bounds and algorithms. In International conference on machine learning, pages 3076–3085. PMLR, 2017. [37] M. J. Smith, M. A. Mansournia, C. Maringe, P. N. Zivich, S. R. Cole, C. Leyrat, A. Belot, B. Rachet, and M. A. Luque-Fernandez. Introduction to computational causal inference using reproducible stata, r, and python code: A tutorial. Statistics in medicine, 41(2):407–432, 2022. [38] E. A. Stuart, D. B. Rubin, and J. Osborne. Matching methods for causal inference: Designing observational studies. Harvard University Department of Statistics mimeo, 2004. [39] N. Thams, R. Søndergaard, S. Weichwald, and J. Peters. Identifying causal effects using instrumental time series: Nuisance iv and correcting for the past. arXiv preprint arXiv:2203.06056, 2022. [40] L. van Garderen, F. Feser, and T. G. Shepherd. A methodology for attributing the role of climate change in extreme events: a global spectrally nudged storyline. Natural Hazards and Earth System Sciences, 21(1):171–186, 2021. [41] L. Yao, Z. Chu, S. Li, Y. Li, J. Gao, and A. Zhang. A survey on causal inference. ACM Transactions on Knowledge Discovery from Data (TKDD), 15(5):1–46, 2021.
http://arxiv.org/abs/2302.13784v1
2023-02-22T19:06:58
2023-02-22T19:06:58
Solution for the EPO CodeFest on Green Plastics: Hierarchical multi-label classification of patents relating to green plastics using deep learning
This work aims at hierarchical multi-label patents classification for patents disclosing technologies related to green plastics. This is an emerging field for which there is currently no classification scheme, and hence, no labeled data is available, making this task particularly challenging. We first propose a classification scheme for this technology and a way to learn a machine learning model to classify patents into the proposed classification scheme. To achieve this, we come up with a strategy to automatically assign labels to patents in order to create a labeled training dataset that can be used to learn a classification model in a supervised learning setting. Using said training dataset, we come up with two classification models, a SciBERT Neural Network (SBNN) model and a SciBERT Hierarchical Neural Network (SBHNN) model. Both models use a BERT model as a feature extractor and on top of it, a neural network as a classifier. We carry out extensive experiments and report commonly evaluation metrics for this challenging classification problem. The experiment results verify the validity of our approach and show that our model sets a very strong benchmark for this problem. We also interpret our models by visualizing the word importance given by the trained model, which indicates the model is capable to extract high-level semantic information of input documents. Finally, we highlight how our solution fulfills the evaluation criteria for the EPO CodeFest and we also outline possible directions for future work. Our code has been made available at https://github.com/epo/CF22-Green-Hands
[ "Tingting Qiao", "Gonzalo Moro Perez" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.13784v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.13784v1", "@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.LG" ]
3 2 0 2 b e F 2 2 ] L C . s c [ 1 v 4 8 7 3 1 . 2 0 3 2 : v i X r a Solution for the EPO CodeFest on Green Plastics: Hierarchical multi-label classification of patents relating to green plastics using deep learning Tingting Qiao1∗ Gonzalo Moro Pérez1∗ 1Team GreenHands [email protected], [email protected] Abstract This work aims at hierarchical multi-label patents classification for patents dis- closing technologies related to green plastics. This is an emerging field for which there is currently no classification scheme, and hence, no labeled data is available, making this task particularly challenging. We first propose a classification scheme for this technology and a way to learn a machine learning model to classify patents into the proposed classification scheme. To achieve this, we come up with a strategy to automatically assign labels to patents in order to create a labeled training dataset that can be used to learn a classification model in a supervised learning setting. Using said training dataset, we come up with two classification models, a SciBERT Neural Network (SBNN) model and a SciBERT Hierarchical Neural Network (SBHNN) model. Both models use a BERT model as a feature extractor and on top of it, a neural network as a classifier. We carry out extensive experiments and report commonly evaluation metrics for this challenging classification problem. The experiment results verify the validity of our approach and show that our model sets a very strong benchmark for this problem. We also interpret our models by visualizing the word importance given by the trained model, which indicates the model is capable to extract high-level semantic information of input documents. Finally, we highlight how our solution fulfills the evaluation criteria for the EPO CodeFest and we also outline possible directions for future work. Our code has been made available at https://github.com/epo/CF22-Green-Hands. 1 Introduction A patent is a type of intellectual property that gives its owner the legal right to exclude others from making, using, or selling an invention for a limited period of time in exchange for publishing an enabling disclosure of the invention. Soon after filing, patent applications are classified following a classification scheme. The International Patent Classification (IPC) and the Cooperative Patent Classification (CPC), which is a more specific version of the IPC, are two of the most commonly used classification schemes. Both the IPC and the CPC are hierarchical classification schemes and patents are classified as deeply as possible, i.e. there is no double classification in "parent" and "child" classes. It goes without saying that performing this classification manually by humans, e.g. by patent examiners, as it is currently done, is a very time-consuming task. Therefore, it would be very beneficial to be able to perform this classification automatically and there is an increasing amount of effort in using machine learning models for this purpose. ∗indicates equal contribution. An additional challenge is that the classification schemes are not static. As technology evolves, some technical areas become obsolete while new ones appear. To reflect this, the IPC and CPC are revised periodically and, if needed, updated. Upon updating the classification scheme, classification models also need to be updated to take into account the changes. Just to provide an example, in 2022, several "child" classes were added to the class G06N10/00 for quantum computing, namely G06N10/20, G06N10/40, G06N10/60, G06N10/70 and G06N10/80. This adds a layer of complexity on top of the patent classification task as there is no training data available for the new classes. The obvious solution is to manually check all the patents classified in G06N10/00, assign "child" classes as necessary, and subsequently, update the classification model using this manually labeled data. However, this is a very time-consuming approach and it would be very beneficial to find an alternative way to update the classification model. In this work, we focus on technologies relating to green plastics. The term "green plastics" refers to a way of achieving a more circular plastics industry, for example by plastics with a reduced or minimized environmental impact or by processes for improved plastics recycling and minimizing plastic waste. In the last couple of decades, the amount of patents disclosing technologies related to green plastics has increased considerably. In order to make the knowledge contained in said patents more readily available to everybody, there is a need for having a patent classification scheme relating to this technology. We propose a classification scheme, based on [21], for technologies relating to green plastics and an automatic way to assign weak labels to patents so that a machine learning model, based on BERT as a feature extractor and a neural network as a classifier, can be learned in a supervised setting. To the best of our knowledge, this is the first work that applies a weak supervision strategy for the classification of patents in a new classification scheme. The paper is organized as follows: First, related work is briefly discussed. Second, the classification scheme is introduced and a labeled training dataset is obtained. Consequently, a machine learning model is proposed and trained on the training dataset. Subsequently, several experiments are carried out and the results are reported and discussed. Finally, the fulfillment of the EPO CodeFest criteria is presented and future work is thoroughly discussed. 2 Related work In the last decades, there is a large number of works focusing on building machine learning models for patent classification. Earlier works used traditional machine learning methods such as k-Nearest neighbors (k-NN) [6], support vector machine (SVM) [6, 26, 5], Naive Bayes (NB) [6, 5], k-means clustering [10] and artificial neural networks [24, 8]. In the past decade, deep learning techniques have also been applied to patent classification outper- forming previous methods. [15] proposed a deep learning algorithm based on pre-trained word embeddings and convolutional neural networks (CNN). The input to the models consists of the title and the abstract of the patent and the output consists of one or multiple classes at the sub-class label. [9] proposed using BiLSTM initialized with word2vec and a hierarchical attention-based memory unit. The input to the model consists of the title and the abstract of the patent and the output consists of a probability value for each class in the hierarchy. Recently, transformer-based neural language models such as BERT [4] have outperformed previous state-of-the-art models in several natural language processing tasks. Unsurprisingly, BERT has also been applied to patent classification. [14] proposed to fine-tune a pre-trained BERT model for patent classification. Very recently, [22] proposed to fine-tune a pre-trained BERT model combined with a neural network based hierarchical classifier. In particular, they used SciBERT [1], which is a BERT model trained on a corpus of scientific publications and is hence closer to the patent domain. It is worthwhile to point out that most of these works focus on learning a model for classifying patent documents locally at a single hierarchical level, i.e. only "child" classes are assigned by the model, as e.g. [15] or [14], or globally by treating all labels independently, e.g. [9]. However, recent work [22] proposes a hierarchical neural network classifier with as many output heads as classes in the hierarchy. All prior-art works mentioned above assume the existence of a labeled training dataset, i.e. they perform patent classification based on an already existing classification scheme. This is however not 2 the case in our work as we first need to propose a classification scheme and subsequently, we learn a classification model for the proposed classification scheme. Weak supervision is an approach for machine learning in which noisy or imprecise labels are provided to learn a model in a supervised learning setting. There are plenty of works using weak supervision in different natural language processing tasks, such as text classification. Recently, [2] proposed multiple weak supervision strategies to label text data automatically. One of the strategies proposed is based on heuristic rules consisting of regular expression matching. 3 Classification scheme As discussed above, there is no existing classification scheme for technologies relating to green plastics. Therefore, a classification scheme, based on [21], is proposed as shown in Figure 1a. The class definitions are summarized in Table 1. The root node is Y02G for technologies relating to green plastics, which is divided into Y02G10/00 for recycling plastic waste and Y02G20/00 for alternative plastics. Y02G10/00 is in turn divided into Y02G10/10 for plastic waste recovery, including collecting, sorting, separating and cleaning plastic waste; and Y02G10/20 for plastic waste recycling, including recycling methods such as plastic-to-compost, plastic-to-monomer, plastic-to- incineration and plastic-to-energy. Y02G10/20 also has two child classes, which are Y02G10/22 for plastic-to-product recycling, including mechanical recycling, such as melting and reforming thermoplastics, and Y02G10/24 for plastic-to-feedstock recycling, such as cracking, gasification and pyrolysis. Y02G20/00 is divided into Y02G20/10 for bioplastics and Y02G20/20 for designs for easier recycling. Figure 1: a) Proposed classification scheme for technologies related to green plastics. b) Hierarchical labels: A patent belonging to class Y02G10/22 (shown in green) is considered to also belong to all the ancestor classes (shown in blue) and it is given the label l = [1, 1, 0, 1, 1, 0, 0, 0, 0]; as opposed to merely l = [0, 0, 0, 0, 1, 0, 0, 0, 0]. Note that the label list corresponds to the class list [Y02G, Y02G10/00, Y02G10/10, Y02G10/20, Y02G10/22, Y02G10/24, Y02G20/00, Y02G20/10, Y02G20/20]. Best viewed in color. 4 Solution design Now that we have a classification scheme, we need to propose a way to classify patents. An option could be to assign keywords to classes and, if any of those keywords are present in a patent, assign the corresponding classes to the patent accordingly. However, such a simple approach has several weaknesses. It is limited to the specified keywords and cannot extend to any synonyms which have not been explicitly specified. Moreover, it is unable to find semantically equivalent expressions which do not match the specified keywords. However, machine learning models have the capacity of learning high-level semantic representations from data without the need for domain experts. For this reason, we decided to propose a machine learning model. However, at this point, we do not have a labeled training dataset for our classification scheme. Learning a machine learning classification model in an unsupervised setting (when the training dataset is unlabeled) is not feasible as it would not be possible to control the classes that the model learns. Therefore, we decided to learn a classification model in a supervised setting (when the training dataset is labeled). In the following sections, we explain how we build our labeled training dataset and how we obtain our classification models. 3 Y02GY02G10/00Y02G20/00Y02G10/24Y02G10/22Y02G10/20Y02G10/10Y02G20/20Y02G20/10Y02GY02G10/00Y02G20/00Y02G10/24Y02G10/22Y02G10/20Y02G10/10Y02G20/20Y02G20/10a)b) Class Y02G Definition Green plastics Keywords green+ 4d plastic+ Y02G10/00 Recycling of plastic waste recycl+ 4d plastic+ Y02G10/10 Plastic waste recovery Y02G10/20 Plastic waste recycling (plastic+ 3d wast+) or ((collect+ or sort+ or separat+ or clean+) 6d plastic+) ((recycle+ 4d plastic+) 20d (compost+ or fertili+)) or ((recycle+ 4d plastic+) 20d (depolymer+ or repolymer+)) or ((recycle+ 4d plastic+) 4d incinerat+) Y02G10/22 Plastic-to-product (plastic+ 4d recycle+) 20d (+melt+ or extrud+ or pellet+) Y02G10/24 Plastic-to-feedstock ((feedstock+ 2d recycl+) 20d plastic+) Y02G20/00 Alternative plastics alternativ+ 2d plastic+ Y02G20/10 Bioplastics Y02G20/20 Designs for easier recycling bioplastic+ or ((biolog+ or biodegrad+ or biobased+ or compostable+) 4d plastic+) vitrimer+ or ((covalent+ 2d adapt+) 2d net+) or ((selfheal+ or selfrepair+) 2d polymer+) 20d recycl+ Table 1: Definition and keywords for each class in the proposed classification scheme. The symbol "+" means none or more characters. The expression "w1 nd w2" means that between words w1 and w2 there may be n other words and the relative order in the sequence of words between w1 and w2 is irrelevant. 5 Training dataset To learn a machine learning classification model in a supervised setting, we need to prepare a labeled training dataset X = {(P1, l1), (P2, l2), ..., (PM , LM )}, where each patent Pi consists of a sequence of N words, i.e. Pi = {w1, w2, ..., wN }, and is associated with a label l. Ideally, the labels would be assigned to the patents manually by humans. However, this is a very time-consuming task and therefore, we explore a way to provide weak labels in an automatic manner. 5.1 Raw dataset To build the training dataset, we use the EP full text data [16] which contains all publications of EP patent applications and patent specifications from 1978 until the end of January 2022. The dataset comprises over 6 million publications, each comprising several fields such as title, abstract, description, claims, language, filing date, publication date, classes, search report, etc. The entire dataset is about 260 gigabytes in size. EP patents may be published in English, French or German. Since available pre-trained language models are usually monolingual [4, 1], we select only patents written in English. For each patent, the title, the abstract and the description are obtained while the other fields are discarded. Some standard text pre-processing steps, such as removing punctuation marks and stop-words, minimizing capital letters and tokenization, are carried out. This dataset is unlabeled since the patents are not assigned classes in the classification hierarchy described in Figure 1a. In the following, we explain the structure of the labels and how to assign them to build a labeled training dataset. 5.2 Hierarchical label definition According to our classification scheme, there are nine classes and hence, each patent will be assigned a label l consisting of a 9-dimensional binary vector, where 1 means that the patent belongs to the corresponding class and 0 means that the patent does not belong to the corresponding class. The labels look as follows: l = [Y02G, Y02G10/00, Y02G10/10, Y02G10/20, Y02G10/22, Y02G10/24, Y02G20/00, Y02G20/10, Y02G20/20], where each element is a binary value associated with the corresponding class. 4 In order to provide more informative labels to the model for training, we propose to use hierarchical labels, meaning that for a patent belonging to a certain class, we also assign all the ancestor classes of said class. The idea behind this is that the model should learn that the given patent belongs to all the corresponding ancestors as well. This is illustrated in Figure 1b. 5.3 Labeling process To assign the labels to the patents in an automatic way, we first define the keywords to each class. The list of keywords is provided in Table 1. Consequently, we translate the keywords into regular expressions and search for them in the description of each patent. If the keyword is found a k number of times, the patent is assigned to the class corresponding to the found keyword. This process is represented schematically in Figure 2. Figure 2: Schematic representation of the labeling process. 5.4 Building the training dataset The labeling process described in Figure 2 is then performed to all the raw data that survived our raw data quality check and filters, e.g. English files, without missing content etc. In order to obtain a labeled training dataset. we sample all patents which have been labeled as belonging to green plastics (positive samples) and around two times more patents which have not been labeled as belonging to green plastics (negative samples). For the negative samples, we randomly sample patents related to any other field of technology. Specifically, in a similar way as for the patents related to green plastics, we also sample patents related to conventional plastics in our negative sample set, so that the classification model can learn to differentiate between conventional plastics and green plastics. The number of patents belonging to green plastics and the number of patents belonging to other fields of technology are shown in Figure 3a. It can be see that the constructed dataset is imbalanced meaning that the samples of one class (in this case, green plastics) are considerably lower than the samples of other classes. This is done on purpose to mimic the real situation and also to challeng model to learn better parameters. A sample of the labeled training dataset can be seen in Figure 3b, where the column TITLE_ABSTR is the input which is a combination of the title and the abstract of one patent file, the target column is to indicate if the patent belongs to certain classes, 1 means yes. Figure 3: a) Number of patents belonging to green plastics and number of patents belonging to other fields of technology. b) Sample from the labeled training dataset. After labeling, the description is dropped and only the title and the abstract are used as input for the classification model. We split the resulting labeled dataset into a training set, a validation set and a test set. The breakdown of the number of patents for each class in each of these sets is shown in Table 2. This table shows the number of positive samples (+) and negative samples (-) for each class. As can be seen, the 5 RegularexpressionmatchingKeywordsUnlabeleddatasetLabeleddataseta)b) dataset is heavily imbalanced, above all for some classes that are deeper in the class hierarchy, such as Y02G10/24 or Y02G20/20, which have less than 100 positive samples. At this point, it could be possible to try to obtain more positive samples for those classes by enlarging the set of keywords in Table 1. However, expert knowledge would be required to suggest more relevant keywords. Another possibility could be to ignore classes that have less than a threshold number of samples (e.g. 100 or 500), since it will be very hard for the machine learning model to learn those classes given the large imbalance. However, we decided to continue with the dataset of Table 2. In the evaluation section, we discuss how we believe that this imbalance could be tackled. Moreover, we also report results for each level of the classification hierarchy level and for each class, which should not be considerably affected by the presence of these heavily imbalanced classes during training. Class Training set Validation set Test set + - Y02G 26286 47160 Y02G10/00 19106 54340 Y02G10/10 17452 55994 Y02G10/20 Y02G10/22 Y02G10/24 Y02G20/00 Y02G20/10 Y02G20/20 494 400 72952 73046 33 73413 7755 2901 65691 70545 10 73436 + 3244 2335 2150 63 50 3 977 375 0 - 5937 6846 7031 9118 9131 9178 8204 8806 9181 + 3259 2376 2171 61 51 4 946 376 1 - 5922 6805 7010 9120 9130 9177 8235 8805 9180 Total 73446 9181 9181 Table 2: Number of patents for each class in the training, validation and test sets. This is obtained with a threshold k = 1. "+" indicates positive samples, i.e. patents belonging to the corresponding class, and "-" indicates negative samples, i.e. patents not belonging to the corresponding class. Patents counted for a given class are also counted for all the ancestors of that class. For example, if a patent is counted for Y02G10/22, it is also counted for Y02G10/20, Y02G10/00 and Y02G, in line with the labeling process described in Figure 1b. The last row indicates the total amount of patents in each of the training, validation and test sets. 6 Classification model Our goal is to learn a classification model Ω with parameters Θ such that given a patent P , it returns a 9-dimensional classification result y, where each element in y corresponds to the probability of the patent P belonging to the corresponding class in the classification scheme of Figure 1a. Mathematically, 6.1 Architecture y = Ω(P; Θ); We propose two classification models as shown in Figure 4. Both models use a BERT model as a feature extractor and a neural network as a classifier. In the first model, SBNN, the classifier is a conventional neural network and in the second model, SBHNN, the classifier is a hierarchical neural network. Similar to [22], the BERT model is a pre-trained SciBERT model [1]. The input to the model is a 256-dimensional vector consisting of a concatenation of the patent's title and abstract, as done in [15, 9, 14, 22] and the output is a 768-dimensional feature vector h corresponding to the CLS embedding, as done in [14, 22]: 6 where ΘB represents the parameters of SciBERT. h = SciBERT (w1, w2, ..., wN ; ΘB); The feature vector h is subsequently input to a neural network classifier N N which outputs a classification result: where ΘN represents the parameters of the neural network. y = N N (h; ΘN ); The neural network is implemented by cascading fully connected layers (FC), which implement a linear matrix multiplication and add a bias term, and a non-linear activation function, e.g. ReLU or sigmoid, σ. Mathematically, a fully connected layer with a non-linear activation function is implemented as follows: where x and t are the input and output, W is a learnable weight matrix, b is a learnable bias vector and a(z) denotes a non-linear function, such as: t = a(W x + b); ReLU (z) = max{0, z}; σ(z) = 1 1 + e−z In SBNN, the neural network classifier consists of a fully connected layer with ReLU activation followed by another fully connected layer with sigmoid activation. In SBHNN, inspired by [22], the neural network classifier consists of a hierarchical neural network with one classification head per class in which the connections between different classification heads, implemented as element-wise additions, directly reflect the classification scheme of Figure 1a. Figure 4: a) Architecture of SBNN. b) Architecture of SBHNN. The feature extractor is displayed in orange and the classifier is displayed in green. The blue arrows indicate the hierarchical connections between classification heads. The sizes of the vectors are shown in grey. Best viewed in color. 6.2 Loss function The model Ω is trained using the labeled training dataset X to minimize the binary cross-entropy loss, which, for a single patent, is expressed as follows: 7 FC<CLS> w1, w2, ... wn<SEP>SciBERTmodely<CLS> w1, w2, ... wn<SEP>SciBERTmodela) SBNN:b) SBHNN:FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCσσσσσσσσσy[5]y[4]y[3]y[2]y[1]y[6]y[7]y[8]y[0]σReLUReLUReLUReLUReLUReLUReLUReLUReLUReLU1x2561x7681x1281x1281x91x91x2561x7681x1281x1281x11x1 L = − C=8 (cid:88) i=0 βi[γi * li * log(yi) + (1 − li) * log(1 − yi)]; where C represents the number of classes, β is a class importance weight (if β = [1, 1, 1, 1, 1, 1, 1, 1, 1], all classes are given the same importance) and γ is a positive sample weight to compensate the imbalanced training set, and in the end, it will be reflected as a trade-off between precision and recall (if, for a given class c, γc = 1, false positives and false negative are given the same importance). During training, we update the parameters ΘB and ΘN to minimize this loss function by mini-batch gradient descent with Adam optimizer [11]. 7 Evaluation We evaluate the performance of our models on our training dataset based on several evaluation metrics which are commonly used in hierarchical text classification tasks. In the following, we report and analyze the results. 7.1 Evaluation metrics Prior-art [22] used hierarchical precision, hierarchical recall and hierarchical F1-score as proposed by [12]. These metrics are more suitable for hierarchical classification tasks than the conventional precision, recall and F1 score as they give credits to partially correct classifications and discriminate errors by both distance and depth in the classification hierarchy. These are defined as follows: hP = (cid:80) i |Yi ∩ Li| (cid:80) i |Li| ; hR = (cid:80) i |Yi ∩ Li| (cid:80) i |Li| ; hF 1 = 2 * hP * hR hP + hR ; wherein, for each test instance i, the set Yi consists of all predicted labels and their respective ancestors, the set Li consists of all true labels including ancestors, | * | denotes the cardinality of a set and ∩ denotes the intersection of sets. Hence, if for a given patent the predicted class is Y02G10/20 while the target class is Y02G10/22, the set Yi = {Y02G10/20, Y02G10/00, Y02G} and the set Li = {Y02G10/22, Y02G10/20, Y02G10/00, Y02G}. The patent is correctly assigned the classes from the extended set |Yi ∩ Li| = 3, there are |Yi| = 3 assigned classes and |Li| = 4 target classes. Therefore, we get hP = 3 3 and hR = 3 4 . As done by [22], we report per instance macro-scores, that compute the scores independently per class and then average them, as well as micro-scores, that aggregate the contributions of each class to compute an global average score. Both are implemented with scikit-learn [20]. Unless otherwise stated, the decision threshold is set to 0.5, meaning that we consider that a patent is classified to class if the probability of the classification model output, i.e. after the sigmoid layer, is at least 0.5. In addition, we compute the Area Under the Precision-Recall Curve (AUPRC) [3], which does not require defining a decision threshold. We also compute the accuracy, even though this is not the best metric when the dataset is imbalanced. We use the implementation from scikit-learn [20] to compute both the AUPRC and the accuracy. 7.2 Implementation details We build the labeled training dataset using the EP full text data [16] as indicated in Figure 2. We download and store all the data in a Toshiba Canvio Basics USB 3.0 Hard Drive with 1 TB of storage. Consequently, we label and sample the training dataset in a MacBook Pro with a 2,7 GHz Dual-Core Intel Core i5. We implement our models in Python using Pytorch [19]. We use the HuggingFace Transformers library [25] for instantiating SciBERT. We use the same hyper-parameters for training both classifi- cation models. We have a learning rate of 2e-6, a batch size of 96 and a dropout of 0.5. The class importance is set to β = [4, 3, 2, 2, 1, 1, 3, 2, 2], and hence, we give more importance to classes that are higher up in the classification hierarchy. The positive sample weight is set to γ = [2, 2, 2, 2, 2, 8 2, 2, 2, 2] to compensate for the class imbalance. The parameters of SciBERT are initialized to the pre-trained values and the parameters of the neural network are initialized randomly. We train the models until the loss in the validation set stops decrease and the error stops to decrease in order to avoid overfitting. In Figure 5, we show the evolution of the train and validation loss and error. For SBNN, we chose the model after 6 training epochs; and for SBHNN, we chose the model after 5 epochs. The training of a single model takes approximately 1.2 hours on an Nvidia GeForce RTX 3090 with 24GB of GDDR6X memory. Figure 5: Evolution of the train and validation loss and error. Best viewed in color. 7.3 Experimental results We perform experiments to verify the validity of our classification models. Since we are dealing with a hierarchical multi-label classification problem with imbalanced data, in order to give a complete overview, we report results based on the whole classification hierarchy, based on each level in the classification hierarchy and based on each class. Performance for the whole classification hierarchy. Table 3 shows the overall results obtained for SBNN and SBHNN. From Table 3 we can also see that SBHNN achieves better performance than SBNN in terms of both macro and micro F1 scores. For both models, the micro scores are considerably higher than the macro scores. This is due to the fact that macro scores calculate metrics for each class, and compute their unweighted mean, without taking class imbalance into account. On the other hand, micro scores calculate the metrics globally by considering each output independently. Therefore, they are relatively less biased towards the classes which have less positive training samples, and hence, provide higher scores. It is noticeable that the overall results of both models don't seem to be very satisfactory. This is actually quite commonly shown in the literature [22]. The overall low performance is due to the challenging nature of the hierarchical classification problem. Moreover, in our case, the lower the class level is, the less number of positive samples we have, and therefore, the more challenging it is to train a good performing classification model. It should be kept in mind that the calculations of these evaluation metrics are negatively biased by these classes with insufficient data. Performance for each level in the classification hierarchy. Table 4 shows the results per level obtained for SBNN and SBHNN. It is clearly shown that both SBNN and SBHNN have a better performance, both in precision and recall, the higher the class is in the classification hierarchy. For the first level (Y02G), the precision and recall of both models are higher than 70%. For the second level (Y02G10/00 and Y02G20/00), they still reach 60-50% and for the third level (Y02G10/10, Y02G10/20, Y02G20/10 and Y02G20/20) and the fourth level (Y02G10/22 and Y02G10/24), they are around 40-30%. This is to be expected as the number of positive training samples in lower levels is considerably lower, see Table 2, therefore, there is not much information for both models to learn from. Moreover, we also gave a higher class importance, i.e. β, to classes in higher levels in the classification scheme during the training process, so the model was trained to focus more on the classes which have more positive samples. 9 a)b)SBNNSBHNNEpochsEpochs We can also see that SBNN actually performs slightly better in level 1 in terms of both macro and micro F1 scores, whereas SBHNN obtains better results in lower levels. This is probably because of the unique architecture of SBHNN, in which there are independent classification heads for each class. The model can thus take advantage of the more complex neural network and learn better from the data. macro-avg. micro-avg. AUPRC Accuracy Model SBNN hP hR hF1 hP hR hF1 0.3587 0.2290 0.2584 0.6113 0.5087 0.5553 SBHNN 0.4856 0.2807 0.3197 0.5882 0.5398 0.5629 0.6317 0.6032 0.6026 0.6087 Table 3: Evaluation metrics for the whole classification hierarchy. Model SBNN SBHNN macro-avg. hR 0.7160 0.4436 0.2944 0.2290 0.7208 0.4873 0.3441 0.2807 hF1 0.7166 0.4805 0.3322 0.2584 0.7131 0.5052 0.3820 0.3197 hP 0.7173 0.6276 0.4612 0.3587 0.7096 0.5546 0.5172 0.4856 micro-avg. hR 0.7412 0.5341 0.5118 0.5087 0.7294 0.5716 0.5423 0.5398 hF1 0.7412 0.5738 0.5571 0.5553 0.7294 0.5802 0.5642 0.5629 hP 0.7412 0.6198 0.6113 0.6113 0.7294 0.5890 0.5880 0.5882 Level 1 2 3 4 1 2 3 4 AUPRC Accuracy 0.7076 0.6325 0.6058 0.6026 0.7057 0.6342 0.6108 0.6087 0.7412 0.6580 0.6317 0.6317 0.7294 0.6269 0.6032 0.6032 Table 4: Evaluation metrics for each level in the classification hierarchy. Level 1 corresponds to Y02G; level 2 to Y02G10/00 and Y02G20/00; level 3 to Y02G10/10, Y02G10/20, Y02G20/10 and Y02G20/20; and level 4 to Y02G10/22 and Y02G10/24. Performance for each class. Table 5 shows the results per class obtained for SBNN and SBHNN. In line with the results obtained in Table 4, classes that are on top of the classification hierarchy have better scores and as we get deeper in the hierarchy, both models struggle to maintain the performance. As mentioned in relation with the results of Table 4, this is to be expected due to the heavy class imbalance and to the class importance β. Another potential explanation is that the model currently only considers the title and the abstract. It is possible that, based solely on this information, it is challenging, if not impossible, to classify the patent so deep in the hierarchy. We believe that more input information could help with this issue. In the future work, we discuss an approach that could be used to overcome this limitation, i.e. enrich the input by some content from the description of patents. Figure 6 shows the hierarchical precision - hierarchical recall curves for each class when modifying the decision threshold (which for the results shown in Tables 3, 4 and 5 was set to 0.5). These curves show how it is possible to trade off precision and recall by modifying the decision threshold. 7.4 Explainability There is an increasing interest in being able to explain the predictions of machine learning models. For this purpose, we implemented the method of integrated gradients [23], which allows us to find out which of the input words are the most important for the classification model when making a prediction. We implemented this method with the Captum library [13]. In Figure 7a, we show an example of a patent that does not relate to green plastics and in Figure 7b, we show an example of a patent that relates to green plastics. This information is useful for understanding how the classification model is making the predictions. We believe that showing this information could help patent examiners gain trust in the classification model and also quickly decide whether the predictions of the classification model are reasonable or not. 10 macro-avg. micro-avg. AUPRC Accuracy Model Class Y02G hP hR hF1 hP hR hF1 0.7173 0.7160 0.7166 0.7412 0.7412 0.7412 0.7076 Y02G10/00 0.6145 0.5946 0.6043 0.6186 0.6000 0.6091 0.6710 Y02G10/10 0.6020 0.5661 0.5832 0.6078 0.5747 0.5908 0.6443 Y02G10/20 0.4097 0.3964 0.4029 0.6186 0.5936 0.6058 0.6665 SBNN Y02G10/22 0.3073 0.2973 0.3022 0.6186 0.5883 0.6031 0.6627 Y02G10/24 0.3073 0.2973 0.3022 0.6186 0.5932 0.6056 0.6658 Y02G20/00 0.6454 0.3853 0.4330 0.6382 0.5194 0.5727 0.6414 Y02G20/10 0.6865 0.3305 0.4030 0.6422 0.4949 0.5590 0.6229 Y02G20/20 0.4303 0.2569 0.2886 0.6382 0.5193 0.5726 0.6411 Y02G 0.7096 0.7208 0.7131 0.7294 0.7294 0.7294 0.7057 Y02G10/00 0.5958 0.6184 0.6053 0.5979 0.6298 0.6134 0.6710 Y02G10/10 0.5904 0.5789 0.5824 0.5935 0.5936 0.5936 0.6447 Y02G10/20 0.6472 0.4451 0.4615 0.5981 0.6241 0.6108 0.6676 SBHNN Y02G10/22 0.6729 0.3632 0.3970 0.5983 0.6196 0.6088 0.6645 Y02G10/24 0.4854 0.3338 0.3461 0.5981 0.6237 0.6106 0.6672 Y02G20/00 0.5381 0.4581 0.4747 0.5897 0.5862 0.5880 0.6429 Y02G20/10 0.5677 0.4215 0.4658 0.5915 0.5667 0.5788 0.6288 Y02G20/20 0.3587 0.3054 0.3165 0.5897 0.5861 0.5879 0.6428 Table 5: Evaluation metrics for each class in the classification hierarchy. 0.7412 0.6833 0.6596 0.6780 0.6780 0.6780 0.6913 0.6872 0.6913 0.7294 0.6584 0.6365 0.6537 0.6537 0.6537 0.6731 0.6679 0.6731 Figure 6: Hierarchical precision - hierarchical recall curves for each class. Best viewed in color. 11 Figure 7: a) Negative sample. b) Positive sample. Red means that the highlighted words decrease the probability of the patent being classified as belonging to green plastics whereas green means that the highlighted words increase the probability of the patent being classified as belonging to green plastics. We can also see how the BERT tokenizer tokenizes the input text. [CLS], [SEP] and [PAD] are special tokens of the BERT tokenizer. "##" means that the rest of the token should be attached to the previous one, without space. These results were obtained with SBHNN. Best viewed in color. 8 EPO CodeFest evaluation criteria In this section, we highlight how we believe that our solution fulfills the evaluation criteria. 8.1 Completeness and transferability. We have provided an end-to-end solution that covers all the steps, i.e. from pre-processing of the raw xml data to building a labeled training dataset, to training and evaluating classification models based on state-of-the-art machine learning algorithms. Together with the code repository in GitHub, we also submit slides to help people quickly understand our approach and this paper to present all the relevant technical details. Our solution and code base are far from being limited to this specific problem of classifying patents relating to green plastics but can easily be applied to different situations. Whenever there is an update of the classification scheme, it is possible to use our code to construct a labeled training dataset and to train and evaluate a classification model for the updated classification scheme. Our code is very flexible and most modifications only need to be done in a configuration file. Moreover, it is also possible to skip the labeling process and to use our code to directly train a classification model with a given labeled training dataset for an already existing classification scheme. 12 a)b) 8.2 Effectiveness and efficiency. The effectiveness of the approach has been thoroughly discussed in Section 7.3 in relation to the results of Tables 3, 4 and 5. The models' performance shows that our solution sets up a strong benchmark for this challenging problem. Possible ways that we believe could lead to still better results are discussed in the future work section. This approach can be applied whenever new classes are added to the classification scheme. Currently, this is done by humans which is a very time-consuming task and also prone to errors. With our solution, this could be done in a more automatic fashion by (re-)training a classification model for the updated classification scheme. Moreover, during inference, it takes our models less than a second to assign classes to a patent. 8.3 Design and usability. We have designed an end-to-end flexible pipeline to tackle this challenging problem. Moreover, we allow feedback from domain experts to be seamlessly incorporated (for example, by enriching the keywords associated with each class). Our code repository is very well-structured and commented which makes it very easy to understand and use. Moreover, we follow industry best coding practices, e.g.: 1) The model results are re- producible and we provided all the pre-trained models which are ready to use; 2) we use popular open-sourced python packages, see the 'requirements.txt' file to see all the packages' dependencies and corresponding versions, e.g. Pandas [17] for raw data pre-processing, PyTorch [19] for deep learning framework, HuggingFace [25]) for pre-trained BERT models; 3) the code is highly modular, there are no hard-coded variables and all the important parameters related to the projects are clearly defined in a configuration file; 4) we provided Jupyter Notebooks to help readers or users test the code and "play" with the pre-trained models; 5) we have this paper to document all the details related to this project and the ReadMe.md file in the code repository to help quickly set up the right python environment to test the code; and 6) the project can be installed as a python package and all of our functions can be imported and reused in any other projects. 8.4 Creativity and innovation. All of the research in patent classification focuses on an existing classification scheme. However, in our problem, we would like to classify patents in a classification scheme that does not exist yet. This is a very challenging problem and to the best of our knowledge, there is no prior art disclosing any solution. We made several creative design choices in order to solve this problem. We proposed to assign labels based on keyword matching to obtain a labeled dataset in order to train a machine learning classification model. We also proposed to have hierarchical labels in order to provide more positive training samples for the classification model. The two proposed models have novel structures and loss functions that are able to be trained for the complex multi-label hierarchical classification problem. We believe that our solution of assigning labels based on keyword matching to obtain a labeled dataset in order to learn a machine learning classification model is an innovative solution to the problem of re-classification of patents upon an update of the classification scheme. This solution can allow to speed up this laborious task. It could also be possible to use our solution in combination with the current human work. For example, our classification model could classify the patents and also provide an explanation as shown in Section 7.4. A human, e.g. a patent examiner, could quickly review the classes proposed by the classification model together with the explanation, and in many cases, probably directly take the proposed classes without the need to further review the patent. 9 Conclusion We have provided an approach for the classification of patents related to green plastics based on an automatically obtained labeled training dataset. We have come up with two innovative and effective classification models and reported several evaluation metrics that give a complete overview of the performance of the models. Our models set a strong benchmark for this challenging and new problem. Our solution has great potential to improve the productivity of patent classification. Moreover, we 13 highlight that this approach is not limited to the classification of green plastics, but it can be easily adapted for other fields whenever the classification hierarchy is updated. 10 Future work Here, we discuss some future work which, we believe, could help to further improve our solution. The next step would be to discuss the proposed classification scheme and the list of keywords assigned to each class with domain experts. Both the classification scheme and the list of keywords can be updated based on feedback. For example, as pointed out earlier, for classes such as Y02G10/24 or Y02G20/20, there are very few patents. It could be possible to either remove these classes from the classification scheme or to provide more relevant keywords to identify more patents belonging to those classes. Our code is very flexible and both modifications can be implemented almost effortlessly. An interesting experiment to double-check the performance of our models could be to manually build a test dataset with samples from all classes in the classification hierarchy and to evaluate the performance of the model. In the future, as incoming patents will be manually labeled in these classes, it would also be possible to periodically update the model with the newly labeled data. It would then be possible to give higher importance to the manually labeled patents in comparison to patents having automatically assigned labels. So far, we have limited our approach to dealing with patents written in English. In order to be able to also classify patents in French and German, it is possible to re-use this code to build a specific classification model for each language. Alternatively, we saw that, recently, a pre-trained language-agnostic BERT model has been open-sourced [7], so it could be interesting to explore the possibility of using such a model to process all three languages. Most of the prior-art works [15, 9, 14, 22] use the title and the abstract as input for the classification. However, patent examiners usually classify patents based on the content of the description. Since the descriptions are usually at least a couple of pages long, it is not straightforward to obtain a proper embedding using a transformer model such as BERT. It could be possible to try some of the approaches proposed in [18] so that the content of the description is also taken into account. References [1] I. Beltagy, K. Lo, and A. Cohan. SciBERT: A pretrained language model for scientific text. 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 3615–3620, Hong Kong, China, Nov. 2019. Association for Computational Linguistics. [2] L.-M. Chen, B.-X. Xiu, and Z.-Y. Ding. Multiple weak supervision for short text classification. Applied Intelligence, 52(8):9101–9116, jun 2022. [3] J. Davis and M. Goadrich. The relationship between precision-recall and roc curves. In Proceedings of the 23rd international conference on Machine learning, pages 233–240, 2006. [4] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. [5] E. D'hondt, S. Verberne, C. Koster, and L. Boves. Text representations for patent classification. Computa- tional Linguistics, 39(3):755–775, 2013. [6] C. J. Fall, A. Törcsvári, K. Benzineb, and G. Karetka. Automated categorization in the international patent classification. In Acm Sigir Forum, volume 37, pages 10–25. ACM New York, NY, USA, 2003. [7] F. Feng, Y. Yang, D. Cer, N. Arivazhagan, and W. Wang. Language-agnostic BERT sentence embedding. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 878–891, Dublin, Ireland, May 2022. Association for Computational Linguistics. [8] J. Guyot, K. Benzineb, G. Falquet, and S. Shift. myclass: A mature tool for patent classification. In CLEF (Notebook papers/LABs/workshops), 2010. [9] W. Huang, E. Chen, Q. Liu, Y. Chen, Z. Huang, Y. Liu, Z. Zhao, D. Zhang, and S. Wang. Hierarchical multi-label text classification: An attention-based recurrent network approach. In Proceedings of the 28th ACM international conference on information and knowledge management, pages 1051–1060, 2019. [10] Y. G. Kim, J. H. Suh, and S. C. Park. Visualization of patent analysis for emerging technology. Expert systems with applications, 34(3):1804–1812, 2008. [11] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 14 [12] S. Kiritchenko, S. Matwin, A. F. Famili, et al. Functional annotation of genes using hierarchical text categorization. In Proc. of the ACL Workshop on Linking Biological Literature, Ontologies and Databases: Mining Biological Semantics, 2005. [13] N. Kokhlikyan, V. Miglani, M. Martin, E. Wang, B. Alsallakh, J. Reynolds, A. Melnikov, N. Kliushkina, C. Araya, S. Yan, and O. Reblitz-Richardson. Captum: A unified and generic model interpretability library for pytorch, 2020. [14] J.-S. Lee and J. Hsiang. Patent classification by fine-tuning bert language model. World Patent Information, 61:101965, 2020. [15] S. Li, J. Hu, Y. Cui, and J. Hu. Deeppatent: patent classification with convolutional neural networks and word embedding. Scientometrics, 117(2):721–744, 2018. [16] E. P. Office. Ep full-text data for text analytics. [17] T. pandas development team. pandas-dev/pandas: Pandas, Feb. 2020. [18] H. H. Park, Y. Vyas, and K. Shah. Efficient classification of long documents using transformers. arXiv preprint arXiv:2203.11258, 2022. [19] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, and S. Chintala. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc., 2019. [20] 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. [21] J. Pose-Rodriguez, Y. Ménière, I. Rudyk, M. Dossin, M. Grilli, D. Marsitzky, W. Meiser, J. Philpott, C. Rossatto, F. Tassinari, P. Vandoolaeghe, and S. Wewege. Patents for tomorrow's plastics global innovation trends in recycling, circular design and alternative sources. 10 2021. [22] S. C. Pujari, A. Friedrich, and J. Strötgen. A multi-task approach to neural multi-label hierarchical patent classification using transformers. In European Conference on Information Retrieval, pages 513–528. Springer, 2021. [23] M. Sundararajan, A. Taly, and Q. Yan. Axiomatic attribution for deep networks. CoRR, abs/1703.01365, 2017. [24] A. J. Trappey, F.-C. Hsu, C. V. Trappey, and C.-I. Lin. Development of a patent document classification and search platform using a back-propagation network. Expert Systems with Applications, 31(4):755–765, 2006. [25] T. Wolf, L. Debut, V. Sanh, J. Chaumond, C. Delangue, A. Moi, P. Cistac, T. Rault, R. Louf, M. Funtowicz, J. Davison, S. Shleifer, P. von Platen, C. Ma, Y. Jernite, J. Plu, C. Xu, T. L. Scao, S. Gugger, M. Drame, Q. Lhoest, and A. M. Rush. Huggingface's transformers: State-of-the-art natural language processing, 2019. [26] C.-H. Wu, Y. Ken, and T. Huang. Patent classification system using a new hybrid genetic algorithm support vector machine. Applied Soft Computing, 10(4):1164–1177, 2010. 15
http://arxiv.org/abs/2302.11603v2
2023-05-19T10:34:37
2023-02-22T19:01:52
Some Might Say All You Need Is Sum
The expressivity of Graph Neural Networks (GNNs) is dependent on the aggregation functions they employ. Theoretical works have pointed towards Sum aggregation GNNs subsuming every other GNNs, while certain practical works have observed a clear advantage to using Mean and Max. An examination of the theoretical guarantee identifies two caveats. First, it is size-restricted, that is, the power of every specific GNN is limited to graphs of a specific size. Successfully processing larger graphs may require an other GNN, and so on. Second, it concerns the power to distinguish non-isomorphic graphs, not the power to approximate general functions on graphs, and the former does not necessarily imply the latter. It is desired that a GNN's usability will not be limited to graphs of any specific size. Therefore, we explore the realm of unrestricted-size expressivity. We prove that basic functions, which can be computed exactly by Mean or Max GNNs, are inapproximable by any Sum GNN. We prove that under certain restrictions, every Mean or Max GNN can be approximated by a Sum GNN, but even there, a combination of (Sum, [Mean/Max]) is more expressive than Sum alone. Lastly, we prove further expressivity limitations for GNNs with a broad class of aggregations.
[ "Eran Rosenbluth", "Jan Toenshoff", "Martin Grohe" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11603v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11603v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "68T05, 68T07", "I.2.6" ]
Some Might Say All You Need Is Sum Eran Rosenbluth1,∗ , Jan Toenshoff1,† , Martin Grohe1 [rosenbluth | toenshoff | grohe]@informatik.rwth-aachen.de 1RWTH Aachen University 3 2 0 2 y a M 9 1 ] G L . s c [ 2 v 3 0 6 1 1 . 2 0 3 2 : v i X r a Abstract The expressivity of Graph Neural Networks (GNNs) is dependent on the aggregation functions they employ. Theoretical works have pointed to- wards Sum aggregation GNNs subsuming every other GNNs, while certain practical works have ob- served a clear advantage to using Mean and Max. An examination of the theoretical guarantee iden- tifies two caveats. First, it is size-restricted, that is, the power of every specific GNN is limited to graphs of a specific size. Successfully processing larger graphs may require an other GNN, and so on. Second, it concerns the power to distinguish non-isomorphic graphs, not the power to approxi- mate general functions on graphs, and the former does not necessarily imply the latter. It is desired that a GNN's usability will not be lim- ited to graphs of any specific size. Therefore, we explore the realm of unrestricted-size expressivity. We prove that basic functions, which can be com- puted exactly by Mean or Max GNNs, are inap- proximable by any Sum GNN. We prove that under certain restrictions, every Mean or Max GNN can be approximated by a Sum GNN, but even there, a combination of (Sum, [Mean/Max]) is more ex- pressive than Sum alone. Lastly, we prove fur- ther expressivity limitations for GNNs with a broad class of aggregations. 1 Introduction Message passing graph neural networks (GNNs) are a fun- damental deep learning architecture for machine learning on graphs. Most state-of-the-art machine learning techniques for graphs are based on GNNs. It is therefore worthwhile to un- derstand their theoretical properties. Expressivity is one im- portant aspect: which functions on graphs or their vertices can ∗Funded by the German Research Council (DFG), RTG 2236 (UnRAVeL) †Funded by the German Research Council (DFG), grants GR 1492/16-1; KI 2348/1-1 "Quantitative Reasoning About Database Queries" be computed by GNN models? To start with, functions com- puted by GNNs are always isomorphism invariant, or equiv- ariant for node-level functions. A second important feature of GNNs is that a GNN can operate on input graphs of ev- ery size, since it is defined as a series of node-level compu- tations with an optional graph-aggregating readout computa- tion. These are desirable features that motivated the intro- duction of GNNs in the first place and may be seen as a cru- cial factor for their success. Research on the expressivity of GNNs has had a considerable impact in the field. A GNN computation transforms a graph with an initial fea- ture map (a.k.a. graph signal or node embedding) into a new feature map. The new map can represent a node-level func- tion or can be "read out" as a function of the whole graph. The computation is carried out by a finite sequence of sep- arate layers. On each layer, each node sends a real-valued message vector which depends on its current feature vector, to all its neighbours. Then each node aggregates the mes- sages it receives, using an order-invariant multiset function, typically being entrywise summation (Sum), mean (Mean), or maximum (Max). Finally, the node features are updated using a neural network which receives as arguments the ag- gregation value and the node's current feature. In the eyes of a GNN all vertices are euqal: the message, aggregation and update functions of every layer are identical for every node, making GNNs auto-scalable and isomorphism-invariant. By now, numerous works have researched the expressiv- ity of GNNs considering various variants of them. However, many of the theoretical results have the following caveats: 1. The expressivity considered is non-uniform: for a func- tion that is defined on graphs of all sizes, it is asked if for every n there exists a GNN that expresses the function on graphs of size n. The expressing GNN may depend on n, and it may even be exponentially large in n. For some proofs, this exponential blow-up is necessary [Abboud et al., 2021; Xu et al., 2019]. This notion of expressivity is in contrast to uniform expressivity: for a function that is defined on graphs of all sizes, asking whether there exists one GNN that ex- presses the function on graphs of all sizes. In addition to being a significantly weaker theoretical notion, non-uniform expressivity leaves much to be desired also from a practical standpoint: It implies that a GNN may be no good for graphs of sizes larger than the sizes well-represented in the training data. This means that training may have to be done on very large graphs, and may have to be often repeated. 2. The expressivity considered is the power to distinguish non-isomorphic graphs. A key theoretical result is the char- acterisation of the power of GNNs in terms of the Weisfeiler- Leman (WL) isomorphism test [Morris et al., 2019; Xu et al., 2019], and subsequent works have used WL as a yard- stick (see 'Related Work'). In applications of GNNs though, the goal is not to distinguish graphs but to regress or classify them or their nodes. There seem to be a hidden assumption that higher distinguishing power implies better ability to ex- press general functions. While this is indeed the case in some settings [Chen et al., 2019], it is not the case with uniform expressivity notion. Our goal is to better understand the role that the aggrega- tion function plays in the expressivity of GNNs. Specifically, we ask: Do Sum aggregation GNNs subsume Mean and Max GNNs, in terms of uniform expressivity of general functions? A common perception is that an answer is already found in [Xu et al., 2019]: Sum-GNNs strictly subsume all other ag- gregations GNNs. Examining the details though, what is in the non-uniform notion, con- actually proven there is: sidering a finite input domain, the distinguishing power of Sum-GNNs subsume the distinguishing power of all other aggregations GNNs. Furthermore, in practice it has been observed that for certain tasks there is a clear advantage to using Mean and Max aggregations [Cappart et al., 2021; Hamilton et al., 2017; T ̈onshoff et al., 2022], with one of the most common models in practice using a variation of Mean aggregation [Kipf and Welling, 2017]. While the difference between theoretical belief and practical evidence may be at- tributed to a learnability rather than to expressivity, it calls for better theoretical understanding of expressivity. 1.1 Our Contribution All our results are in the uniform expressivity notion. Mainly, we prove that Sum-GNNs do not subsume Mean-GNNs nor Max-GNNs (and vice versa), in terms of vertices-embedding expressivity as well as graph-embedding expressivity. The statements in this paper consider additive approximation, yet the no-subsumption ones hold true also for multiplicative ap- proximation. • Advantage Sum. For the sake of completeness, in Sec- tion 3 we prove that even with single-value input fea- tures, the neighbors-sum function which can be trivially exactly computed by a Sum-GNN cannot be approxi- mated by any Mean-GNN or Max-GNN. • Sum subsumes. In Section 4 we prove that if the in- put features are bounded, Sum-GNNs can approximate all Mean-GNNs or Max-GNNs, though not without an increase in size which depends polynomially on the re- quired accuracy, and exponentially on the depth of the approximated Mean-GNNs or Max-GNNs. • Advantage Mean and Max. In Section 5.1 we show that if we allow unbounded input features then functions that are exactly computable by Mean-GNNs ; Max-GNNs; and others, cannot be approximated by Sum-GNNs. • Essential also with finite input-features domain. In Sec- tion 5.2 we prove that even with just single-value in- put features, there are functions that can be exactly computed by a (Sum, Mean)-GNN (a GNN that use both Sum-aggregation and Mean-aggregation) or by a (Sum, Max)-GNN, but cannot be approximated by Sum- GNNs. • The world is not enough. In Section 6, we examine GNNs with any finite combination of Sum; Mean; Max and other aggregations, and prove upper bounds on their expressivity already in the single-value input features setting. Lastly, in Section 7 we experiment with synthetic data and observe that what we proved to be expressible is to an ex- tent also learnable, and that in practice inexpressivity is man- ifested in a significantly higher error than implied in theory. All proofs, some of the lemmas, and extended illustra- tion and analysis of the experimentation, are found in the ap- pendix. 1.2 Related Work The term Graph Neural Network, along with one of the basic models of GNNs, was introduced in [Scarselli et al., 2008]. Since then, more than a few works have explored aspects of expressivity of GNNs. Some have explored the distinguish- ing power of different models of GNNs [Abboud et al., 2021; Barcel ́o et al., 2021; Geerts and Reutter, 2022; Maron et al., 2019; Morris et al., 2019; Morris et al., 2020; Sato et al., 2021], and some have examined the expressivity of GNNs depending on the aggregations they use [Corso et al., 2020; In [Chen et al., 2019], a connection be- Xu et al., 2019]. tween distinguishing power and function approximation is described. In all of the above, the non-uniform notion was considered. In the uniform notion, it was proven that Sum- GNNs can express every logical formula in Guarded Count- able Logic with 2 variables (GC2) [Barcel ́o et al., 2020b; Barcel ́o et al., 2020a]. A theoretical survey of the expressiv- ity of GNNs is found in [Grohe, 2021], and a practical survey of different models of GNNs is found in [Wu et al., 2020]. 2 Preliminaries By N, N>0, Q, R we denote the sets of nonnegative integers, positive integers, rational numbers, an d real numbers, respec- tively. For a, b ∈ N : a ≤ b we denote the set {n ∈ N : a ≤ n ≤ b} by [a..b]. For b ∈ N>0 we denote the set [1..b] by [b]. For a, b ∈ R : a ≤ b, we denote the set {r ∈ R : a ≤ r ≤ b} by [a, b] . We may use the terms "average" and "mean" interchangeably to denote the arithmetic mean. We use "{}" as notation for a (cid:17) (cid:66) {x, . . . , x} the multiset. Let x ∈ R, b ∈ N>0, we define multiset consisting of b instances of x. Let d ∈ N>0 and let a vector v ∈ Rd, we define |v| (cid:66) max(|vi|i∈[d]). Let two vectors u, v ∈ Rd, we define (cid:48) ≤(cid:48): u ≤ v ⇔ ∀i ∈ [d]ui ≤ vi. (cid:16){x} b 2.1 Graphs An undirected graph G = (cid:104)V(G), E(G)(cid:105) is a pair, V(G) being a set of vertices and E(G) ⊆ {{u, v} | u, v ∈ V(G)} being a set of undirected edges. For a vertex v ∈ V(G) we denote by N(v) (cid:66) {w ∈ V(G) | {w, v} ∈ E(G)} the neighbourhood of v in G, and we denote the size of it by nv (cid:66) |N(v)|. A (vertex) featured graph G = (cid:104)V(G), E(G), S d, Z(G)(cid:105) is a 4-tuple being a graph with a feature map Z(G) : V(G) → S d, mapping each vertex to a d-tuple over a set S . We de- note the set of graphs featured over S d by GS d , we define GS (cid:66) (cid:83) d∈N GS d , and we denote the set of all featured graphs by G∗. The special set of graphs featured over {1} is denoted G1. We denote the set of all feature maps that map to S d by ZS d , we denote (cid:83) d∈N ZS d by ZS , and we denote the set of all feature maps by Z∗. Let a featured-graph domain D ⊆ G∗, a mapping f : GD → Z∗ to new feature maps is called a feature transformation. For a featured graph G and a vertex v ∈ V(G) we define sum(v) (cid:66) Σw∈N(v)Z(G)(w), avg(v) (cid:66) 1 sum(v), and max(v) (cid:66) nv max(Z(G)(w) : w ∈ N(v)). In this paper, we consider the size of a graph G to be its number of vertices, that is, |G| (cid:66) |V(G)|. 2.2 Feedforward Neural Networks A feedforward neural network (FNN) F is directed acyclic graph where each edge e carries a weight wF e ∈ R, each node v of positive in-degree carries a bias bF v ∈ R, and each node v has an associated continuous activation function aF v : R → R. The nodes of in-degree 0, usually X1, . . . , Xp, are the input nodes and the nodes of out-degree 0, usually Y1, . . . , Yq, are the output nodes. We denote the underlying directed graph of an FNN F by (V(F), E(F)), and we call (cid:0)V(F), E(F), (aF (cid:1) the architecture of F, notated A(F). We drop the indices F at the weights and the activation func- tion if F is clear from the context. v )v∈V(F) The input dimension of an FNN is the number of input nodes, and the output dimension is the number of output nodes. The depth depth(F) of an FNN F is the maximum length of a path from an input node to an output node. To define the semantics, let F be an FNN of input dimen- sion p and output dimension q. For each node v ∈ V(F), we define a function fF,v : Rp → R by fF,Xi(x1, . . . , xp) (cid:66) xi for the ith input node Xi and fF,v((cid:126)x) (cid:66) av   bv + k(cid:88) j=1 fF,u j((cid:126)x) * we j   for every node v with incoming edges e j = (u j, v). Then F computes the function fF : Rp → Rq defined by fF((cid:126)x) (cid:66) (cid:0) fF,Y1 ((cid:126)x), . . . , fF,Yq ((cid:126)x)(cid:1) Let F an FNN, we consider the size of F to be the size of its underlying graph. That is, |F| = |V(F)|. A common activation function is the ReLU activation, de- fined as ReLU(x) (cid:66) max(0, x). In this paper, we assume all FNNs to be ReLU activated. ReLU activated FNNs subsume every finitely-many-pieces piecewise-linear activated FNN, thus the results of this paper hold true for every such FNNs. Every ReLU activated FNN F is Lipschitz-Continuous. That is, there exists a minimal aF ∈ R≥0 such that for every input and output coordinates (i, j), for every specific input argu- ments x1, . . . , xn, and for every δ > 0, it holds that (cid:12)(cid:12)(cid:12) fF(x1, . . . , xn) j − fF(x1, . . . xi−1, xi + δ, . . . , xn) j (cid:12)(cid:12)(cid:12) /δ ≤ aF We call aF the Lipschitz-Constant of f . 2.3 Graph Neural Networks Several GNN models are described in the literature. In this paper, we define and consider the Aggregate-Combine (AC- GNN) model [Xu et al., 2019; Barcel ́o et al., 2020b]. Some of our results extend straightforwardly to the messaging scheme of MPNN [Gilmer et al., 2017], yet such extensions are out of scope of this paper. A GNN layer, of input and output (I/O) dimensions p; q, is a pair (F, agg) such that: F is an FNN of I/O di- mensions 2p; q, and agg is an order-invariant p-dimension multiset-to-one aggregation function. An m-layer GNN N = ((F1, agg1), . . . , (Fm, aggm)), of I/O dimensions p; q, is a se- quence of m GNN layers of I/O dimensions p(i); q(i) such that: p(1) = p, q(m) = q and ∀i ∈ [m − 1] p(i+1) = q(i). It determines a series of m feature transformations as follows: Let a graph G ∈ GRp and vertex v ∈ V(G), then N (0)(G, v) (cid:66) Z(G)(v), and for i ∈ [m] we define a transformation N (i)(G, v) (cid:66) fFi(N (i−1)(G, v), aggi(N (i−1)(G, w) : w ∈ N(v))) We notate by N(G, v) (cid:66) N (m)(G, v) the final output of N for v. We define the size of N to be |N| (cid:66) Σi∈[m] |Fi| the sum of We call (cid:0)(A(F1), agg1), . . . , (A(Fm), aggm)(cid:1) the architecture of N, no- tated A(N), and say that N realizes A(N). For an aggregation function agg, we denote by agg-GNNs the class of GNNs for which ∀i ∈ [m] aggi = agg. For ag- gregation functions agg1, agg2, we denote by (agg1, agg2)- GNNs the class of GNNs with m = 2n layers such that ∀i ∈ [n] agg2i−1 = agg1, agg2i = agg2. its underlying FNNs' sizes. 2.4 Expressivity Let p, q ∈ N, and a set S . Let F = { f : GS p → ZRq } a set of feature transformations, and let a feature transformation h : GS p → ZRq . We say F uniformly additively approximates h, notated F ≈ h, if and only if ∀ε > 0∃ f ∈ F : ∀G ∈ GS p ∀v ∈ V(G) | f (G)(v) − h(G)(v)| ≤ ε The essence of uniformity is that one function "works" for graphs of all sizes, unlike non-uniformity where it is enough to have a specific function for each specific size of input graphs. The proximity measure is additive - as opposed to multiplicative where it is required that In this paper, approximation always means uniform addi- tive approximation and we use the term "approximates" syn- onymously with expresses. Although our no-approximation statements consider additive approximation, they hold true also for multiplicative approximation, and the respective proofs (in the appendix) require not much additional argu- mentation to show that. f (G)(v)−h(G)(v) h(G)(v) (cid:12)(cid:12)(cid:12)(cid:12) ≤ ε. (cid:12)(cid:12)(cid:12)(cid:12) Let F, H be sets of feature transformations f : GS p → ZRq , we say F subsumes H, notated F ≥ H if and only if for every h : GS p → ZRq it holds that H ≈ h ⇒ F ≈ h. If the subsump- tion holds only for graphs featured with a subset T p ⊂ S p we notate it as F ≥T H. Let p, q ∈ N. We call an order-invariant mapping f : ZRp → Rq, from feature maps to q-tuples, a readout func- tion. Both sum and avg are commonly used to aggregate feature maps, possibly followed by an FNN that maps the aggregation value to a final output. We call a mapping f : GS p → Rq, from featured graphs to q-tuples, a graph em- bedding. Let w ∈ N, let a set of feature transformations F = { f : GS p → ZRq }, and let a readout r : ZRq → Rw, we no- tate the set of embeddings {r ◦ f : f ∈ F} by r ◦ F. We use the expressivity terms and notations defined for feature transfor- mations, for graph embeddings as well. 3 Mean and Max Do Not Subsume It has already been stated that Sum-GNNs can express func- tions that Mean-GNNs and Max-GNNs cannot [Xu et al., 2019]. For the sake of completeness we provide formal proofs that Mean-GNNs and Max-GNNs subsume neither Sum-GNNs nor each other. 3.1 Mean and Max do not subsume Sum Neither Mean-GNNs nor Max-GNNs subsume Sum-GNNs, even when the input-feature domain is a single value. We define a featured star graph with (a parameter) k leaves, Gk (see Figure 1): For every k ∈ N>0: • V(Gk) = {u} ∪ {v1, . . . , vk} • E(Gk) = (cid:83) • Z(Gk) = {(u, 1)} (cid:83) i∈[k]{{u, vi}} i∈[k]{(vi, 1)} k = N(Gk, u). Let N be an m-layer GNN. We define u(t) (cid:66) N (t)(Gk, u), the k feature of u ∈ V(Gk) after operating the first t layers of N. Note that u(m) Lemma 3.1. Assume N is a Mean-GNN or a Max-GNN . Let the maximum input dimension of any layer be d, and let the maximum Lipschitz-Constant of any FNN of N be a. Then, for every k it holds that Theorem 3.2. Let such that for every k it holds that Mean-GNNs (cid:48) f and Max-GNNs (cid:48) f . f : G1 → ZR a feature transformation Then, (cid:12)(cid:12)(cid:12) ≤ (da)m. f (Gk)(u) = k. (cid:12)(cid:12)(cid:12)u(m) k Note that by Theorem 3.2, a function such as neighbors- count is inexpressible by Mean-GNNs and Max-GNNs . Corollary 3.3. We have that Mean-GNNs (cid:3){1} Sum-GNNs, Max-GNNs (cid:3){1} Sum-GNNs. 3.2 Mean and Max do not subsume each other Mean-GNNs and Max-GNNs do not subsume each other, even in a finite input-feature domain setting. We define a parameterized graph in which, depending on the parameters' arguments, the average of the center's neighbors is in [0, 1 2 ] while their max can be either 0 or 1. For every k ∈ N and b ∈ {0, 1}: • V(Gk,b) = {u} ∪ {v1, . . . , vk} ∪ {w} • E(Gk,b) = (cid:83) i∈[k]{{u, vi}} ∪ {{u, w}} • Z(Gk,b) = {(u, 0)} (cid:83) i∈[k]{(vi, 0)} ∪ {(w, b)} Theorem 3.4. Let f : G{0,1} → ZR a feature transformation such that for every k it holds that k+1 . Then, Max-GNNs (cid:48) f . Theorem 3.5. Let f : G{0,1} → ZR a feature transformation such that for every k it holds that f (Gk,b)(u) = b. Then, Mean- GNNs (cid:48) f . f (Gk,b)(u) = b Corollary 3.6. We have that Mean-GNNs (cid:3){0,1} Max-GNNs , Max-GNNs (cid:3){0,1} Mean-GNNs . 4 Sometimes Sum Subsumes In a bounded input-feature domain setting, Sum-GNNs can express every function that Mean-GNNs and Max-GNNs can. The bounded input-feature domain results in a bounded range for Mean and Max, a fact which can be exploited to approx- imate the target GNN with a Sum-GNN. The approximating Sum-GNNs, that we describe, come at a size cost. We do not know if an asymptotically-lower-cost construction exist. 4.1 Mean by Sum Sum-GNNs subsume Mean-GNNs in a bounded input-feature domain setting. Lemma 4.1. For every ε > 0 and d ∈ N>0, there exists a Sum- GNN N of size O(d 1 ε ) such that for every featured graph G ∈ G[0,1]⊂Rd it holds that ∀v ∈ V(G) Theorem 4.2. Let a Mean-GNN NM consisting of m layers, let the maximum input dimension of any layer be d, and let the maximum Lipschitz-Constant of any FNN of NM be a. Then, for every ε > 0 there exists a Sum-GNN NS such that: (cid:12)(cid:12)(cid:12)N(G, v) − avg(v) (cid:12)(cid:12)(cid:12) ≤ ε. 1. ∀G ∈ G[0,1]d ∀v ∈ V(G) 2. |NS | ≤ O(|NM| + d*m*ad(1−(2ad)m) ε(1−(2ad)) ). |NM(G, v) − NS (G, v)| ≤ ε. Corollary 4.3. Sum-GNNs ≥[0,1] Mean-GNNs. 4.2 Max by Sum Sum-GNNs subsume Max-GNNs in a bounded input-feature domain setting. Lemma 4.4. For every ε > 0 and d ∈ N>0, there exists a Sum- GNN N of size O(d 1 ε ) such that for every featured graph G ∈ G[0,1]d and vertex v ∈ V(G) it holds that |N(G, v) − max(v)| ≤ ε. Theorem 4.5. Let a Max-GNN NM consisting of m layers, let the maximum input dimension of any layer be d, and let the maximum Lipschitz-Constant of any FNN of NM be a. Then, for every ε > 0 there exists a Sum-GNN NS such that: 1. ∀G ∈ G[0,1]d ∀v ∈ V(G) 2. |NS | ≤ O(|NM| + d*m*ad(1−(2ad)m) ε(1−(2ad)) ). |NM(G, v) − NS (G, v)| ≤ ε. Corollary 4.6. Sum-GNNs ≥[0,1] Max-GNNs. 5 Mean and Max Have Their Place In two important settings, Mean and Max aggregations en- able expressing functions that cannot be expressed with Sum alone. As in Section 3, we define a graph Gθ parameterized by θ over domain Θ. We define a feature transformation f on that graph and prove that it cannot be approximated by Sum- GNNs. The line of proofs (in the appendix) is as follows: 1. We show that for every Sum-GNN N there exists a finite set FN of polynomials of θ, those polynomials obtain a certain property φ, and it holds that: ∀θ ∈ Θ ∃uθ ∈ V(Gθ) ∃p ∈ FN : N(Gθ, uθ) = p(θ) 2. We show that for every finite set F of polynomials (of θ) that obtain φ, it holds that: ∀ε > 0 ∃θ ∈ Θ : ∀p ∈ F |p(θ) − f (Gθ)(uθ)| > ε Figure 1: A star graph with k leaves, featured over a single-value input-feature domain. Figure 2: A star graph with k leaves, featured over N>0. Figure 3: A tripartite graph, with k intermedi- ates fully connected to c leaves, featured over a single-value input-feature domain. 5.1 Unbounded, Countable, Input-Feature 5.2 Finite Input-Feature Domain Domain In an unbounded input-feature domain setting, Mean;Max and other GNNs are not subsumed by Sum-GNNs. We de- fine a graph Gk,c (see Figure 2): For (k, c) ∈ N2 >0, Mean and Max aggregations are essential also when the input-feature domain is just a single value i.e. when the in- put is featureless graphs. We define a new graph Gk,c (see Figure 3): For every (k, c) ∈ N2 >0, • V(Gk,c) = {u} ∪ {v1, . . . , vk} • E(Gk,c) = (cid:83) • Z(Gk,c) = {(u, 0)} (cid:83) i∈[k]{{u, vi}} i∈[k]{(vi, c)} f : GN1 → ZR a feature transformation, f (Gk,c)(u) = c. Then, Theorem 5.1. Let such that for every k, c it holds that Sum-GNNs (cid:48) f . Corollary 5.2. Denote by S the set of all multisets over N>0. (cid:17) Let g : S → R an aggregation such that ∀a, b ∈ N>0 g( ) = a, that is, g aggregates every homogeneous multiset to its single unique value. Then, Sum-GNNs (cid:3)N g-aggregation GNNs. (cid:16){a} b Corollary 5.2 implies a limitation of Sum-GNNs compared to GNNs that use Mean; Max; or many other aggregations. i∈[k2], j∈[k]{{ui, v j}} i∈[k2]{(ui, 0)} (cid:83) Graph Embedding Sum-GNNs are limited compared to Mean; Max; and other GNNs, not only when used to approximate vertices' feature transformations but also when used in combination with a readout function to approximate graph embeddings. Consider another variant of Gk,c: For (k, c) ∈ N2 >0, • V(Gk,c) = {u1, . . . , uk2 } ∪ {v1, . . . , vk} • E(Gk,c) = (cid:83) • Z(Gk,c) = (cid:83) f : GN1 → R a graph embedding such Theorem 5.3. Let that ∀k, c f (Gk,c) = kc k+1 . Let an aggregation a ∈ {sum, avg} and an FNN F, and define a readout ro (cid:66) fF ◦ a. Then, ro ◦ Sum-GNNs (cid:48) f . Corollary 5.4. Denote by S the set of all multisets over N>0. (cid:17) Let g : S → R an aggregation such that ∀a, b ∈ N>0 g( ) = a. Let an aggregation a ∈ {sum, avg} and an FNN F, and define a readout ro (cid:66) fF ◦ a. Then, ro ◦ Sum-GNNs (cid:3)N avg ◦ g-GNNs. We have shown that Sum-GNNs do not subsume Mean and Max (and many other) GNNs. The setting though, consisted of an input-feature domain N>0, that is, countable unbounded. i∈[k]{(vi, c)} (cid:16){a} b • V(Gk,c) = {u} ∪ {v1, . . . , vk} ∪ {w1, . . . , wc} • E(Gk,c) = (cid:83) i∈[k]{{u, vi}} (cid:83) i∈[k], j∈[c]{{vi, w j}} • Z(Gk,c) = {(u, 1)} (cid:83) i∈[k]{(vi, 1)} (cid:83) i∈[c]{(wi, 1)} f : G1 → ZR a feature transformation, Theorem 5.5. Let such that for every k, c it holds that f (Gk,c)(u) = c. Then, Sum- GNNs (cid:48) f . Corollary 5.6. Denote by S the set of all multisets over N>0, and let g : S → R an aggregation such that ∀a, b ∈ N>0 g( ) = a. Then, Sum-GNNs (cid:3){1} (Sum, g)-GNNs. (cid:17) (cid:16){a} b Corollary 5.6 implies a limitation of Sum-GNNs compared to stereo aggergation GNNs that combine Sum with Mean; Max; or many other aggregations. The limitation exists even when the input-feature domain consists of only a single value. Graph Embedding Completing the no-subsumption picture, Sum-GNNs are not subsuming, in a 2-values input-feature domain setting, also when used in combination with a readout function to ap- proximate graph embeddings. We define Gk,c: For every (k, c) ∈ N2 >0, i∈[k3], j∈[kc]{{vi, w j}} j∈[k2],i∈[k3]{{u j, vi}} (cid:83) i∈[k2]{(ui, 0)} (cid:83) • V(Gk,c) = {u1, . . . , uk2 } ∪ {v1, . . . , vk3 } ∪ {w1, . . . , wkc} • E(Gk,c) = (cid:83) • Z(Gk,c) = (cid:83) f : G{0,1}1 → R a graph embedding such Theorem 5.7. Let that ∀k, c f (Gk,c) = (k2+kc)kc k3+k2+kc . Let an aggregation a ∈ {sum, avg} and an FNN F, and define a readout ro (cid:66) fF ◦ a. Then, ro ◦ Sum-GNNs (cid:48) f . i∈[k3]{(vi, 0)} (cid:83) i∈[kc]{(wi, 1)} Corollary 5.8. Denote by S the set of all multisets Let g : S → R an aggregation such that over N>0. (cid:17) (cid:16){a} ∀a, b ∈ N>0 g( Let an aggregation a ∈ {sum, avg} b and an FNN F, and define a readout ro (cid:66) fF ◦ a. Then, ro ◦ Sum-GNNs (cid:3){0,1} avg ◦ (Sum, g)-GNNs. ) = a. u(1)v1(1)vk(1)...u(0)v1(c)vk(c)...u(1)v1(1)vk(1)w1(1)wc(1)...... 6 Sum and More are Not Enough In previous sections we showed that Sum-GNNs do not sub- sume Mean-GNNsand Max-GNNs , by proving that they can- not express specific functions. In this section, rather than comparing different GNNs classes we focus on one broad GNNs class and show that it is limited in its ability to express any one of a certain range of functions. (cid:17) (cid:16){x} b , x ∈ R, b ∈ N>0 it holds that a( Denote by S the set of all multisets over R, and let an ag- gregation a : S → R. We say that a is a uniform polynomial aggregation (UPA) if and only if for every homogeneous mul- ) is either a polyno- tiset mial of x or a polynomial of (bx). Note that Sum; Mean; and Max are all UPAs. We say that a GNN N = (L(1), . . . , L(m)) is an MUPA-GNN (Multiple UPA) if and only if the aggrega- tion input to each of its layers is defined by a series of UPAs. That is, L(i) = (F(i), (a(i) )), for some bi UPAs. (cid:16){x} b (cid:17) 1 , . . . , a(i) bi We define a parameterized graph Gk (see Figure 1): For every k ∈ N>0: • V(Gk) = {u} ∪ {v1, . . . , vk} • E(Gk) = (cid:83) • Z(Gk) = {(u, 1)} (cid:83) i∈[k]{{u, vi}} i∈[k]{(vi, 1)} Lemma 6.1. Let A an m-layer MUPA-GNN architecture, let l be the maximum depth of any FNN in A, and let d be the maximum in-degree of any node in any FNN in A. Then, there exists r ∈ N such that: for every GNN N that realizes A it holds that N(Gk, u) is piecewise-polynomial (of k) with at most ((d + 1)l)m pieces, and each piece is of degree at most r. Lemma 6.1 implies that the architecture bounds (from above) the number of polynomial pieces, and their degrees, that make the function computed by any particular realiza- tion of the architecture. With Lemma 6.1 at our disposal, we consider any feature transformation that does not converge to a polynomial when applied to u ∈ V(Gk) and viewed as a function of k. We show that such a function is inexpressible by MUPA-GNNs. Theorem 6.2. Let f : G1 → ZR a feature transformation, and define g(k) (cid:66) f (Gk)(u). Assume that g does not converge to any polynomial, that is, there exists ε > 0 such that for ev- ery polynomial p, for every K0, there exists k ≥ K0 such that |g(k) − p(k)| ≥ ε. Then, MUPA-GNNs(cid:48) f . The last inexpressivity property we prove, concerns a class of functions which we call PIL (Polynomial-Intersection Limited). For n ∈ N denote by Pn the set of all polynomials of degree ≤ n. We say that a function f : N → R is PIL if and only if for every n ∈ N there exists kn ∈ N such that for every poly- nomial p ∈ Pn there exist at most kn − 1 consecutive integer points on which p and f assume the same value. Formally, sup (cid:0)k : ∀p ∈ Pn ∀x ∈ N ∀y ∈ [x..(x + k − 1)] f (y) = p(y)(cid:1) ∈ N We consider every feature transformation f such that for g(k) (cid:66) f (Gk)(u) it holds that g is PIL. This is a different characterization than "no polynomial-convergence" (in Theo- rem 6.2), and neither one implies the other. The result though, is weaker for the current characterization. We show that ev- ery MUPA-GNN architecture can approximate such a func- tion only down to a certain ε > 0. That is, every GNN that realizes the architecture - no matter the specific weights of its FNNs - is far from the function by at least ε (at least in one point). The following lemma is an adaptation of the Polynomial of Best Approximation theorem [Mayans, 2006; Golomb, 1962] to the integer domain. There, it is a step in the proof of the Equioscillation theorem attributed to Chebyshev [anonymous, 2022]. Lemma 6.3. For x, k ∈ N define Ix,k (cid:66) {x, x + 1, . . . , x + k − 1} the set of consecutive k integers starting at x. Let f : N → R be a PIL, let n ∈ N, and define kn (cid:66) 1 + max(k : ∀p ∈ Pn ∀x ∈ N ∀y ∈ [x..(x + k − 1)] f (y) = p(y)) Then, for every x ∈ N there exists εx,kn > 0 such that: for every p ∈ Pn there exists y ∈ Ix,kn for which |p(y) − f (y)| ≥ εx,kn . That is, for every starting point x there is a bounded interval Ix,kn, and a gap εx,kn , such that no polynomial of degree ≤ n can approximate f on that interval below that gap. Lemma 6.4. For every q, n ∈ N there exists a point Tq,n ∈ N and a gap δTq,n > 0 such that: for every PIL f : N → R, and every piecewise-polynomial g with q many pieces of degree ≤ n, there exists y ∈ N, 0 ≤ y ≤ Tq,n for which |g(y) − f (y)| ≥ δTq,n . That is, the number of pieces and the max degree of a piecewise-polynomial g determine a guaranteed minimum gap by which g misses f within a guaranteed interval. Theorem 6.5. Let f : G1 → ZR a feature transformation, let g(k) (cid:66) f (Gk)(u), and assume that g is PIL. Then, for every MUPA-GNN architecture A, there exists εA > 0 such that for every MUPA-GNN N that realizes A there exists k such that |N(Gk, u) − f (Gk)(u)| ≥ ε. 7 Experimentation We experiment with vertex-level regression tasks. In previous sections we formally proved certain expressivity properties of Sum; Mean; and Max GNNs. Our goal in experimentation is to examine how these properties may affect practical learn- ability: searching for an approximating GNN using stochas- tic gradient-descend. With training data ranging over only a small subsection of the true-distribution range, does the ex- istence of a uniformly-expressing GNN increase the chance that a well-generalizing GNN will be learned? Specific details concerning training and architecture, as well additional illustrations and extended analysis, can be found in the appendix 1. 7.1 Data and Setup For the graphs in the experiments, and with our GNN archi- tecture consisting of two GNN layers (see appendix), Mean and Max aggregations output the same value for every vertex, up to machine precision. Thus, it is enough to experiment with Mean and assume identical results for Max. We conduct experiments with two different datasets, one corresponds to the approximation task in Section 5.1, and the other to the task in Section 5.2: 1code for running the experiments is found at https://github.com/ toenshoff/Uniform Graph Learning (a) Unbounded Countable Features (b) Single Value Features Figure 4: Relative Error of different aggregations on UC and SV. errors of less than 10−4 across all considered combinations of k and c. Their relative error falls to less than 10−6 when c is within the range seen during training (≤ 100), Therefore, Mean-GNNs do show some degree of overfitting. Notably, the value of k has virtually no effect on the error of Mean- GNNs . This is expected, since mean aggregation should not be affected by the degree k of a center vertex whose neighbors are identical, up to machine precision. Sum-GNNs yield a substantially higher relative error. For k = 500 and c ≤ 100 the relative error is roughly 1, but this value increases as c grows beyond the training range. Crucially, the relative error of Sum-GNNs also increases with k. For k = 1000, the relative error is above 1 even when c is within the range seen during training. Therefore, Sum-GNNs do generalize significantly worse than Mean-GNNs in both parameters k and c. ' Single-Value Feature Domain Figure 4b provides the test results for SV. Again, we plot the relative error against different values of c. Sum-GNNs yield similar relative errors as in the UC experiment. As expected, learned (Sum,Mean)-GNNs do perform significantly better than Sum-GNNs. However, the learning of (Sum,Mean)- GNNs is not as successful as the learning of Mean-GNNs relative error is around 10−1 for in the UC experiment: k = 500, and slightly larger for k = 1000, clearly worse than the UC-experiment performance. In particular, the learned (Sum,Mean)-GNN is sensitive to increases in k. Note that each (Sum,Mean)-GNN layer receives both Sum and Mean aggregations arguments and needs to choose the right one, thus it is a different learning challenge than in the first exper- iment. 1. Unbounded Countable Feature Domain (UC): This dataset consists of the star graphs {Gk,c} from Sec- tion 5.1, for k, c ∈ [1..1000]. The center's ground truth value is c, and it is the only vertex whose value we want to predict. 2. Single-Value Feature Domain (SV): This dataset con- sists of the graphs {Gk,c} from Section 5.2, for k, c ∈ [1..1000]. Again, the center's ground truth value is c, and we do not consider the other vertices' predicted val- ues. As training data, we vary k ∈ [1..100] and c ∈ [1..100]. We therefore train on 10K graphs in each experiment. After- wards, we test each GNN model on larger graphs with k ∈ [101..1000} and c ∈ [101..1000]. Here, we illustrate our re- sults for two representing values of k: 500, 1000, for all val- ues of c. Illustrations of the full results can be found in the appendix. The increased range of k and c in testing simulates the scenario of unbounded graph sizes and unbounded fea- ture values, allowing us to study the performance in terms of uniform expressivity with unbounded features. 7.2 Results Our primary evaluation metric is the relative error. Formally, if ypred is the prediction of the GNN for the center vertex of an input graph G, with truth label c, we define the relative error as (cid:16) ypred, c (cid:17) = RE |ypred − c| |c| . A relative error greater or equal to 1 is a strong evidence for inability to approximate, as the assessed approximation is no- better than an always-0 output. It is also reasonable that in practice, when judging the regression of a function whose range vary by a factor of 1000, relative error would be the relevant measure. Unbounded, Countable, Feature Domain Figure 4a provides the test results for UC. We plot the relative error against different values of c. Note that the error has a logarithmic scale. Mean-GNNs achieve very low relative 11002003004005006007008009001000c108107106105104103102101100101102Error (RE)Sum,k=500Sum,k=1000Mean,k=500Mean,k=100011002003004005006007008009001000c108107106105104103102101100101102Error (RE)Sum,k=500Sum,k=1000Sum+Mean,k=500Sum+Mean,k=1000 References [Abboud et al., 2021] Ralph Abboud, ̇Ismail ̇Ilkan Ceylan, Martin Grohe, and Thomas Lukasiewicz. The surprising power of graph neural networks with random node ini- In Zhi-Hua Zhou, editor, Proceedings of the tialization. Thirtieth International Joint Conference on Artificial In- telligence, IJCAI 2021, Virtual Event / Montreal, Canada, 19-27 August 2021, pages 2112–2118. ijcai.org, 2021. [anonymous, 2022] anonymous. theorem. lation Equioscillation theorem, 2022. equioscil- The https://en.wikipedia.org/wiki/ [Barcel ́o et al., 2020a] Pablo Barcel ́o, Egor V Kostylev, Mikael Monet, Jorge P ́erez, Juan Reutter, and Juan-Pablo Silva. The logical expressiveness of graph neural net- works. In 8th International Conference on Learning Rep- resentations (ICLR 2020), 2020. [Barcel ́o et al., 2020b] Pablo Barcel ́o, Egor V Kostylev, Mika ̈el Monet, Jorge P ́erez, Juan L Reutter, and Juan- Pablo Silva. The expressive power of graph neural net- ACM SIGMOD Record, works as a query language. 49(2):6–17, 2020. [Barcel ́o et al., 2021] Pablo Barcel ́o, Floris Geerts, Juan Reutter, and Maksimilian Ryschkov. Graph neural net- works with local graph parameters. Advances in Neural Information Processing Systems, 34:25280–25293, 2021. [Cappart et al., 2021] Quentin Cappart, Didier Ch ́etelat, Elias B. Khalil, Andrea Lodi, Christopher Morris, and Petar Velickovic. Combinatorial optimization and reason- ing with graph neural networks. In Zhi-Hua Zhou, editor, Proceedings of the Thirtieth International Joint Confer- ence on Artificial Intelligence, IJCAI 2021, Virtual Event / Montreal, Canada, 19-27 August 2021, pages 4348–4355. ijcai.org, 2021. [Chen et al., 2019] Zhengdao Chen, Soledad Villar, Lei Chen, and Joan Bruna. On the equivalence between graph isomorphism testing and function approximation with gnns. Advances in neural information processing sys- tems, 32, 2019. [Corso et al., 2020] Gabriele Corso, Luca Cavalleri, Do- minique Beaini, Pietro Li`o, and Petar Veliˇckovi ́c. Principal neighbourhood aggregation for graph nets. Advances in Neural Information Processing Systems, 33:13260–13271, 2020. [Fey and Lenssen, 2019] Matthias Fey and Jan E. Lenssen. Fast graph representation learning with PyTorch Geomet- In ICLR Workshop on Representation Learning on ric. Graphs and Manifolds, 2019. [Geerts and Reutter, 2022] Floris Geerts and Juan L. Reut- ter. Expressiveness and approximation properties of graph In The Tenth International Conference neural networks. on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net, 2022. [Gilmer et al., 2017] Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neu- In Interna- ral message passing for quantum chemistry. tional conference on machine learning, pages 1263–1272. PMLR, 2017. [Golomb, 1962] Michael Golomb. Lectures on theory of approximation. Argonne National Laboratory, Applied Mathematics Division, 1962. [Grohe, 2021] Martin Grohe. The logic of graph neural net- In 2021 36th Annual ACM/IEEE Symposium on works. Logic in Computer Science (LICS), pages 1–17. IEEE, 2021. [Hamilton et al., 2017] Will Hamilton, Zhitao Ying, and Jure Inductive representation learning on large Leskovec. graphs. Advances in neural information processing sys- tems, 30, 2017. [Kingma and Ba, 2015] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun, editors, 3rd International Con- ference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Pro- ceedings, 2015. [Kipf and Welling, 2017] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional In 5th International Conference on Learning networks. Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. [Loshchilov and Hutter, 2017] Ilya Loshchilov and Frank Hutter. SGDR: stochastic gradient descent with warm restarts. In 5th International Conference on Learning Rep- resentations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. [Maron et al., 2019] Haggai Maron, Heli Ben-Hamu, Hadar Serviansky, and Yaron Lipman. Provably powerful graph networks. Advances in neural information processing sys- tems, 32, 2019. [Mayans, 2006] Robert Mayans. The polynomial of best https://www.maa.org/sites/default/files/ approximation. images/upload library/4/vol6/Mayans/Best.html, 2006. [Morris et al., 2019] Christopher Morris, Martin Ritzert, Matthias Fey, William L Hamilton, Jan Eric Lenssen, Gau- rav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In Proceed- ings of the AAAI conference on artificial intelligence, vol- ume 33, pages 4602–4609, 2019. [Morris et al., 2020] Christopher Morris, Gaurav Rattan, and Petra Mutzel. Weisfeiler and leman go sparse: Towards scalable higher-order graph embeddings. Advances in Neural Information Processing Systems, 33:21824–21840, 2020. [Sato et al., 2021] Ryoma Sato, Makoto Yamada, and Hisashi Kashima. Random features strengthen graph neu- ral networks. In Proceedings of the 2021 SIAM Interna- tional Conference on Data Mining (SDM), pages 333–341. SIAM, 2021. [Scarselli et al., 2008] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele IEEE Monfardini. The graph neural network model. transactions on neural networks, 20(1):61–80, 2008. [T ̈onshoff et al., 2022] Jan T ̈onshoff, Berke Kisin, Jakob Lindner, and Martin Grohe. One model, any csp: Graph neural networks as fast global search heuristics for con- arXiv preprint arXiv:2208.10227, straint satisfaction. 2022. [Wu et al., 2020] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A com- prehensive survey on graph neural networks. IEEE trans- actions on neural networks and learning systems, 32(1):4– 24, 2020. [Xu et al., 2019] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural net- works? In 7th International Conference on Learning Rep- resentations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. A Proofs For the reader's convenience, we re-state the results that are proven in this appendix. Proofs for Section 3 Lemma 3.1 Assume N is a Mean-GNN or a Max-GNN . Let the maxi- mum input dimension of any layer be d, and let the maximum Lipschitz-Constant of any FNN of N be a. Then, for every k it holds that (cid:12)(cid:12)(cid:12) ≤ (da)m. (cid:12)(cid:12)(cid:12)u(m) k k k , v(t) Proof. For every i, j ∈ [k] there is an automorphism of Gk that maps vi to v j, thus they receive the same feature through- out the computation. We define v(t) (cid:66) N (t)(Gk, vi) for ev- k ery i ∈ [k]. We view u(t) k as functions of k. First, as- sume Assume N is a Mean-GNN . We show by induc- (cid:12)(cid:12)(cid:12)v(t) (cid:12)(cid:12)(cid:12) ≤ (cid:12)(cid:12)(cid:12)u(t) tion that for any t ∈ [m] it holds that k (2da)t. For t = 1, v(t) = f1(1, 1) for some FNN f1 whose k (cid:12)(cid:12)(cid:12) ≤ 2a. Also, (cid:12)(cid:12)(cid:12) f1(1, 1 Lipschitz-Constant is at most a, hence 1 ) u(t) k ) = f1(1, 1) ≤ 2a. Assume correctness for t = k n. For t = n + 1 we have v(n+1) k ) for some k FNN fn+1 whose Lipschitz-Constant is at most a. Hence, v(n+1) ) = k fn+1(u(n) ≤ 2da(2da)n = (2da)n+1. Also, u(n+1) k ) ≤ 2da(2da)n = (2da)n+1. k , v(n) (cid:12)(cid:12)(cid:12) ≤ (2da)t, = fn+1(u(n) k , = fn+1(v(n) Next, assume N is a Max-GNN . Notice that for ev- u(t) = k 1 k ). Hence, the proof idea for a Mean-GNN (cid:3) ery t ∈ [0..(m − 1)] it holds that max(v(t) applies also for a Max-GNN . k , . . . , v(t) = max(u(t) = f1(1, k k , u(n) k ) and kv(n) k ) k kv(t) k k k Theorem 3.2 Let f : G1 → ZR a feature transformation such that for every k it holds that f (Gk)(u) = k. Then, Mean-GNNs (cid:48) f and Max- GNNs (cid:48) f . Proof. Choose any ε > 0. Let N be either Mean-GNN or Max-GNN . Let the maximum input dimension of any layer be d, and let the maximum Lipschitz-Constant of any FNN of N be a. Choose k = (2da)m + ε, then by Lemma 3.1 we have (cid:3) that |N(Gk, u) − f (Gk)(u)| ≥ ε. Corollary 3.3 We have that Mean-GNNs (cid:3){1} Sum-GNNs, Max-GNNs (cid:3){1} Sum-GNNs. Proof. Clearly, there is a Sum-GNN that computes f exactly. By Theorem 3.2, there is no Mean-GNN or Max-GNN that (cid:3) approximates f . Theorem 3.4 Let f : G{0,1} → ZR a feature transformation such that for ev- ery k it holds that f (Gk,b)(u) = b k+1 . Then, Max-GNNs (cid:48) f . Proof. Let N be an m-layer Max-GNNs. is not hard to see by induction on m that for every i > 0, j > Hence, ∃k : 0 it holds (cid:12)(cid:12)(cid:12) f (Gk,1)(u) − N(Gk,1, u) (cid:3) that N(Gi,1, u) = N(G j,1, u). (cid:12)(cid:12)(cid:12) > 0.24. It Theorem 3.5 Let f : G{0,1} → ZR a feature transformation such that for ev- ery k it holds that f (Gk,b)(u) = b. Then, Mean-GNNs (cid:48) f . Proof. Let N be an m-layer Mean-GNNs. It is not hard to show that N(Gk,b, u) is Lipschitz-Continuous with respect to the aggregation and that with the aggregation being Mean we (cid:12)(cid:12)(cid:12)N(Gk,0, u) − N(Gk,1, u) (cid:3) have that limk→∞ (cid:12)(cid:12)(cid:12) = 0. Corollary 3.6 We have that Mean-GNNs (cid:3){0,1} Max-GNNs , Max-GNNs (cid:3){0,1} Mean-GNNs . Proof. Clearly, there is a Mean-GNN that computes f of The- orem 3.4 exactly, and by Theorem 3.4 there is no Max-GNN that approximates f . Clearly, there is a Max-GNN that com- putes f of Theorem 3.5 exactly, and by Theorem 3.5 there is (cid:3) no Mean-GNN that approximates f . Proofs for Section 4 Every reference in Lemma A.1 (and its proof) to a vertex- related value-vector is element-wise: for every vertex v and a value-function f (v) of output dimension d we use the notation f (v) to represent f (v)i for all i ∈ [d]. Lemma A.1. Let d ∈ N>0, let s ∈ [0, 1], and let 0 < a ≤ s. Then, there is a Sum-GNN N such that for every featured graph G ∈ G[0,1]d and every vertex v ∈ V(G) it holds that N(G, v) = 1 1 − nv(s−avg(v)−a) a  0 nv(s−avg(v)) a   0 < avg(v) < s s ≤ avg(v) s − a nv s − a ≤ avg(v) ≤ s − a nv s − a − a < nv avg(v) < s − a avg(v) ≤ s − a − a nv v Proof. Please refer to Figure 5 for an illustration of the con- struction. Let v(t) be the value of a vertex v after layer t and let v = (cid:80) g(t) w∈N(v) w(t) the sum of v(cid:48)s neighbors' values after layer t. We denote the function computed in layer t of N by ft, that is, v(t) = ft(v(t−1), g(t−1) ). First, we map the value of a ver- tex (and the sum of its neighbors) to a 2-tuple with the first coordinate being 1 and the second being the vertex' value. That is, we define f1 : R2 → R2 to be f1(x, y) = (1, x). Then, we define f2 : R2 × R2 → R to be f2(x, y) = ReLU( sy1−y2 ) − a ReLU( sy1−y2 a − 1) + ReLU( sy1−y2 a − nv). That is, v(2) = ReLU( nv(s−avg(v)) − 1) + ReLU( nv(s−avg(v)) −nv −1)−ReLU( nv(s−avg(v)) −nv). To see why v(2) fulfills the requirements, we describe the values of each of the three components for the different ranges of avg(v). a − nv − 1) − ReLU( sy1−y2 ) − ReLU( nv(s−avg(v)) a a a a • s ≤ avg(v) ⇒ nv(s−avg(v)) ≤ 0 ⇒ ReLU( nv(s−avg(v)) a − 1) = ReLU( nv(s−avg(v)) a a − nv) = 0 ⇒ v(2) = 0 ) = − nv) = < avg(v) < s ⇒ 0 < nv(s−avg(v)) a nv < 1 ⇒ − 1) = nv(s−avg(v)) ; a a ) − ReLU( nv(s−avg(v)) a ReLU( nv(s−avg(v)) ReLU( nv(s−avg(v)) a a • s − ReLU( nv(s−avg(v)) a a a ReLU( nv(s−avg(v)) 0 ⇒ v(2) = nv(s−avg(v)) a a − nv − 1) = ReLU( nv(s−avg(v)) − nv) = • s − a ≤ avg(v) ≤ s − a nv ⇒ 1 ≤ nv(s−avg(v)) a ) − ReLU( nv(s−avg(v)) − nv − 1) = ReLU( nv(s−avg(v)) a ≤ nv ⇒ − 1) = 1; − nv) = a ReLU( nv(s−avg(v)) ReLU( nv(s−avg(v)) a 0 ⇒ v(2) v = 1 • s − a − a nv nv + 1 ⇒ ReLU( nv(s−avg(v)) ReLU( nv(s−avg(v)) a nv(s−avg(v)−a) ⇒ h(2) a < avg(v) < s − a ⇒ nv < nv(s−avg(v)) ) − ReLU( nv(s−avg(v)) − nv − 1) = 0; ReLU( nv(s−avg(v)) v = 1 − nv(s−avg(v)−a) < a − 1) = 1; − nv) = a a a a ⇒ nv + 1 ≤ nv(s−avg(v)) • avg(v) ≤ s − a − a a ⇒ nv ReLU( nv(s−avg(v)) 1) = − − − nv − 1) + ReLU( nv(s−avg(v)) − nv) = a a ReLU( nv(s−avg(v)) ) 1; ReLU( nv(s−avg(v)) 1 ⇒ h(2) v = 0 a a (cid:3) (cid:12)(cid:12)(cid:12) ≤ ε. Lemma 4.1 For every ε > 0 and d ∈ N>0, there exists a Sum-GNN N of size O(d 1 ε ) such that for every featured graph G ∈ G[0,1]⊂Rd it (cid:12)(cid:12)(cid:12)N(G, v) − avg(v) holds that ∀v ∈ V(G) Proof. Please refer to Figure 6 for an illustration of the con- struction. We describe a construction of size O( 1 ε ) which ap- proximates Mean for one coordinate, the extension to d is by a simple duplication. Every reference to a vertex-related value-vector is element-wise: for every vertex v and a value- function f (v) of output dimension d, we use the notation f (v) to represent f (v)i for all i ∈ [d]. Let q ∈ N>0 be the minimal natural such that 1 q < ε, and de- fine a = 1 q . Define {s1 = a, s2 = 2a, . . . , sq+1 = 1 + a)}. The first layer of N is identical to f1 in the Lemma A.1. The second layer uses a copy of f2 from the Lemma A.1, for each si, mul- tiplied by si, and then sums the q + 1 outputs. To see why this j > i + 1 is correct, assume si − a ≤ avg(v) ≤ si. For j < i or we have by Lemma A.1 zero contribution of s j to the final sum. Next, if si − a ≤ avg(v) then by Lemma A.1 we have a nv contribution of (cid:16) (cid:17) + si (cid:16) nv(si − avg(v)) a (cid:17) = si+1 1 − nv(si+1 − avg(v) − a) a nv(si − avg(v)) a 1 − (cid:16) si+1 (cid:17) + si (cid:16) nv(si − avg(v)) a (cid:17) Denoting the last term by x and considering that si − a ≤ nv avg(v) ≤ si we have that avg(v) ≤ x ≤ avg(v) + a. Finally, if avg(v) ≤ s − a then by Lemma A.1 we have zero contribution nv of si+1 and a contribution of si ≤ avg(v) + a. Overall, we have (cid:3) that avg(v) ≤ N(G, v) ≤ avg(v) + a. Theorem 4.2 Let a Mean-GNN NM consisting of m layers, let the maxi- mum input dimension of any layer be d, and let the maximum Lipschitz-Constant of any FNN of NM be a. Then, for every ε > 0 there exists a Sum-GNN NS such that: 1. ∀G ∈ G[0,1]d ∀v ∈ V(G) 2. |NS | ≤ O(|NM| + d*m*ad(1−(2ad)m) ε(1−(2ad)) ). |NM(G, v) − NS (G, v)| ≤ ε. that Proof. Let NM = (( f1, Mean), . . . , ( fm, Mean)), is, f1, . . . , fm are the FNNs constituting NM's layers. Let ˆε > 0 and let N ˆε = ((g1, Sum), (g2, Sum)) the GNN constructed in Lemma 4.1, with parameter ˆε. Note that g1 is indifferent to the aggregation parameter and g2 is indifferent to the vertex's state parameter, thus, for both parameters an argument of '0' is as good as any other. Define a Sum-GNN with 2m layers NS = (( ˆf1, Sum), . . . , ( ˆf2m, Sum)). For j = 0 . . . (m − 1), each pair of layers ( ˆf2 j+1, Sum), ( ˆf2( j+1), Sum) approximates the operation of ( f j+1, Mean). For a graph G and a vertex v ∈ V(G), denote the feature of v after the (2( j + 1))th layer of NS by ˆv(2( j+1)), with ˆv(0) (cid:66) Z(G)(v). We define ( ˆf2 j+1, ˆf2( j+1)) as follows. i ˆf2 j+1(ˆv(2 j), Σw∈N(v) ˆw(2 j)) (cid:66) (ˆv(2 j), g1(ˆv(2 j), 0)) ˆf2( j+1)((ˆv(2 j), g1(ˆv(2 j), 0)), Σw∈N(v)( ˆw(2 j), g1( ˆw(2 j), 0)) (cid:66) f j+1(ˆv(2 j), g2(0, Σw∈N(v)g1( ˆw(2 j), 0))) For t ∈ [m] denote the feature of v after the tth layer of NM (cid:12)(cid:12)(cid:12) by v(t), with v(0) (cid:66) Z(G)(v), and denote by et (cid:66) (cid:12)(cid:12)(cid:12)ˆv(2t) i − v(t) the maximum error of any coordinate of the output of the (2t)th layer of NS . We prove by induction on t that et ≤ ad ˆεΣi∈[t](2ad)i−1. Denote that upper bound by bt. For t = 1, we have e1 = (cid:12)(cid:12)(cid:12)ˆv(2) − v(1)(cid:12)(cid:12)(cid:12) = f1(ˆv(0), g2(0, Σw∈N(v)g1( ˆw(0), 0)))− f1(v(0), Mean({w(0)|w ∈ N(v)})| The first d input coordinates to f1 are identical. For each coordinate i of the last d coordinates, by definition of g1 and g2 we have (cid:12)(cid:12)(cid:12) ≤ ˆε (cid:12)(cid:12)(cid:12)g2(0, Σw∈N(v)g1( ˆw(0), 0))i − Mean({w(0) : w ∈ N(v)})i That difference translates to a difference of at most a ˆε in any (cid:12)(cid:12)(cid:12)ˆv(2) − v(1)(cid:12)(cid:12)(cid:12). In total, we have e1 ≤ ad ˆε. Assume coordinate of correctness for t = n. Layer 2(n+1) of NS is, by definition, the operation of fn+1 on at most 2 * d coordinates. The first d co- ordinates constitute ˆv(2n) and the last d coordinates constitute g2(0, Σw∈N(v)g1( ˆw(2n), 0)). The error of each of the first d co- ordinates is, by assumption, at most bn. For each coordinate i of the last d coordinates, we have by assumption ∀w ∈ N(v) (cid:12)(cid:12)(cid:12) ˆw(2n) i − w(n) i (cid:12)(cid:12)(cid:12) ≤ bn hence (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) 1 |N(v)| Σw∈N(v) ˆw(2n) 1 |N(v)| hence, by definition of g1 and g2, i − Σw∈N(v)w(n) i (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) ≤ bn (1) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) g2(0, Σw∈N(v)g1( ˆw(2n), 0))i − 1 |N(v)| (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) ≤ Σw∈N(v)w(n) i bn + ˆε (2) Combining the error bounds for the two types of input, we have that en+1 = max( (cid:12)(cid:12)(cid:12)ˆv(2(n+1)) i − v(n+1) i (cid:12)(cid:12)(cid:12) : i ∈ [d]) = max(| fn+1(ˆv(2n), g2(0, Σw∈N(v)g1( ˆw(2n), 0)))i− fn+1(v(n), Mean({w(n) : w ∈ N(v)}))i| : i ∈ [d]) ≤ adbn + ad(bn + ˆε) = 2adbn + ad ˆε = ad ˆεΣn+1 i=2 (2ad)i−1 + ad ˆε = ad ˆεΣi∈[n+1](2ad)i−1 With the induction proven, we have that bm = ad ˆεΣi∈[m](2ad)i−1 = ˆεad (1 − (2ad)m) 1 − 2ad Hence, the requirement that bm ≤ ε can be satisfied by setting implying ˆε = ε 1 − 2ad ad(1 − (2ad)m) 1 ˆε = ad(1 − (2ad)m) ε(1 − 2ad) Finally, using Lemma 4.1 we have that for each i ∈ [m] it holds (cid:12)(cid:12)(cid:12) ˆf2i−1 (cid:12)(cid:12)(cid:12) + (cid:12)(cid:12)(cid:12) ˆf2i (cid:12)(cid:12)(cid:12) = O (cid:16) d * ad(1 − (2ad)m) ε(1 − 2ad) (cid:17) + | fi| Proof. We describe a construction of size O( 1 ε ) that approx- imates Max for one coordinate, the extension to d is by a simple duplication. Every reference to a vertex-related value-vector is element-wise: for every vertex v and a value- function f (v) of output dimension d, we use the notation f (v) to represent f (v)i for all i ∈ [d]. Let q ∈ N>0 be the minimal natural such that 1 q < ε and de- fine a (cid:66) 1 q . The first GNN layer computes for each vertex v a vector v(1) ∈ [0, a]q such that (v(1))i = ReLU(Z(v) − (i − 1)a) − ReLU(Z(v) − (i − 1)a − a). Observe that the computa- tion corresponds to the mapping f in Lemma A.2. The sec- ond GNN layer first caps the sum-aggregation of the neigh- bors' vectors, then sums the coordinates of the capped vec- tor. That is, for a vertex v, let yv = Σw∈N(v)w(1), then v(2) = Σi∈[q](ReLU((yv)i) − ReLU((yv)i − a)). Using Lemma A.2, we (cid:3) get that max(v) ≤ v(2) ≤ max(v) + a < max(v) + ε. Theorem 4.5 Let a Max-GNN NM consisting of m layers, let the maxi- mum input dimension of any layer be d, and let the maximum Lipschitz-Constant of any FNN of NM be a. Then, for every ε > 0 there exists a Sum-GNN NS such that: 1. ∀G ∈ G[0,1]d ∀v ∈ V(G) 2. |NS | ≤ O(|NM| + d*m*ad(1−(2ad)m) ε(1−(2ad)) ). |NM(G, v) − NS (G, v)| ≤ ε. hence |NS | = |NM| + O (cid:16) m * d * ad(1 − (2ad)m) ε(1 − 2ad) (cid:17) Proof. The proof is identical to the Theorem 4.2 with the fol- lowing adaptations: 1. Replacing any mention of 'Mean', with 'Max'. (cid:3) 2. Replacing any usage of Lemma 4.1, with Lemma 4.4. 3. Replacing equations (1),(2), with equations (3),(4) here- Lemma A.2. Let q ∈ N>0, define a (cid:66) 1 f : [0, 1] → Rq such that q , and define a function inafter. f (x)i (cid:66) max(0, min(x − a(i − 1), a)) That is, f is an almost-unary representation of x in units of 1 q , "almsot" because it may contain a fraction (between 0 and 1) in its last coordinate. For a finite multiset x = {x1, . . . , xn}, xi ∈ [0, 1], define g(x) (cid:66) min((a, . . . , a), Σi∈[n] f (xi)) a mapping from the multiset to the sum of its elements' repre- sentation, coordinate-wise capped at a. Then, max(x) ≤ Σi∈[q]g(x)i ≤ max(x) + a Proof. w.l.o.g assume max(x) = x1. For the lower bound, is not hard to verify that ∀i ∈ [q] g(x)i ≥ f (x1)i, hence it Σi∈[q]g(x)i ≥ Σi∈[q] f (x1)i = x1. For the upper bound, as- sume j = max(i : g(x)i > 0), then necessarily x1 ≥ ( j − 1)a and (cid:3) Σi∈[q]g(x)i ≤ ja, hence Σi∈[q]g(x)i ≤ x1 + a. Lemma 4.4 For every ε > 0 and d ∈ N>0, there exists a Sum-GNN N of size O(d 1 ε ) such that for every featured graph G ∈ G[0,1]d and vertex v ∈ V(G) it holds that |N(G, v) − max(v)| ≤ ε. : w ∈ N(v))− (cid:12)(cid:12)(cid:12)(cid:12) max( ˆw(2n) max(w(n) i i : w ∈ N(v)) (cid:12)(cid:12)(cid:12)(cid:12) ≤ bn (cid:12)(cid:12)(cid:12)(cid:12)g2(0, Σw∈N(v)g1( ˆw(2n), 0))i− (cid:12)(cid:12)(cid:12)(cid:12) ≤ bn + ˆε max(w(n) i : w ∈ N(v)) (3) (4) (cid:3) Proofs for Section 5 A.1 Describability Let F be a set of polynomials in k, c, and let g(k, c) be a func- tion in k, c. We say that F weakly-describes g if and only if: a. F is finite. b. ∀k, c ∈ N ∃p ∈ F : p(k, c) = g(k, c). We identify a polynomial p(k, c) as being good if and only if p(k, c) = Σi∈[n], j∈[n]ai, jkic j + Σn i=0biki for some real coeffi- cients {ai, j}, {bi} and some maximum degree n ∈ N. That is, p(k, c) is a polynomial in k, c with max degrees n for k, c, and every appearance of c is with multiplication by a polynomial Figure 5: A single "position indicator", as constructed in Lemma A.1, for interval a = 0.25 and position s = 0.75. The full = 4. The x-axis repre- line is for n− v sents avg(v) in the domain [0, 1] and the corresponding sum(v) in the domain [0, k]. = 1 and the dotted line is for n− v Figure 6: An illustration of the construction in Lemma 4.1, for a = 0.25, n− = 4. The solid red trapezoids are indicators scaled ac- v cording to the position they are indicating. The dashed magenta steps-line is the sum of the indicators, which is the final function. The dotted blue line is the line to approximate. The x-axis repre- sents avg(v) in the domain [0, 1] and the corresponding sum(v) in the domain [0, k]. of k of degree at least 1. We say that F is good if and only if every polynomial in it is good. We say that F describes g if and only if: F weakly- describes g and F is good. We say that g is describable (w- describable) if and only if there exists a set that (weakly-) describes it. Let F be a finite set of polynomials in k, c, we de- note by B(F) (cid:66) {kic j : ∃p ∈ F p = (... + ai, jkic j) ai, j (cid:44) 0} the building blocks of F, that is, the degree combinations that appear in any of the polynomials in F. Let b ∈ {k, c}, we define bB(F) (cid:66) {b * kic j : kic j ∈ B(F)}. For every a ∈ R and a set of functions F of k, c, we define aF (cid:66) {a f : f ∈ F}, and (a+F) (cid:66) {a+ f : f ∈ F}. For two sets of functions F, H of k, c, we define F + H (cid:66) { f + h : f ∈ F, h ∈ H}. Lemma A.3. a. Let f (k, c) a function (w-)describable by a set F. Let g(k, c) := ReLU( f (k, c)) the composition of ReLU over f (k, c), then g is (w-)describable by a set F(cid:48) such that B(F(cid:48)) ⊆ (B(F) ∪ {k0c0}). b. Let f1(k, c), . . . , fl(k, c) be functions (w-)describable by F1, . . . , Fl respectively. Then, for every real coefficients i=1ai fi) + b is (w-)describable {ai}, b the affine function (Σn by a set F such that B(F) ⊆ ({k0c0} (cid:83) i∈[l] B(Fi)). c. Each output of a ReLU activated FNN whose inputs are all (w-)describable by a set F is (w-)describable by a set F(cid:48) such that B(F(cid:48)) ⊆ (B(F) ∪ {k0c0}). d. Let f (k, c) a function w-describable by a set F, then k f (k, c) is describable by some set F(cid:48) such that B(F(cid:48)) ⊆ kB(F), and c f (k, c) is w-describable by a set F(cid:48)(cid:48) such that B(F(cid:48)(cid:48)) ⊆ cB(F). Proof. a. Let F a set that (w-)describes the function f . For any k, c either g(k, c) = f (k, c) or g(k, c) = 0, hence ReLU( f ) is (w-)describable by F ∪ {0}. b. It is not hard to verify that if fi is (w-)describable by Fi then for every a ∈ R it holds that a fi is (w-)describable by aFi, and fi + a is (w-)describable by Fi + a. It is also not hard to verify then that for any ai, a j ∈ R it holds that ai fi + a j f j is (w-)describable by (aiFi) + (a jF j). A straightforward induction proves that a linear combination of arbitrarily many (w-)describable functions is (w-)describable. Finally, let F a set that (w-)describes the linear combination, then F + b is a set that (w-)describes the affine function. c. Implied by (a)+(b). d. It is not hard to verify that if f is w-describable by F then k f is describable by kF. Also, it is not hard to verify that if f (cid:3) is w-describable by F then c f is w-describable by cF. (cid:12)(cid:12)(cid:12)N(Hk,c, u) − c Lemma A.4. Let a series of graphs {Hk,c}, parametarized in k, c ∈ N>0, each having an identified vertex u, such that for ev- ery m-layer Sum-GNN N it holds that N(Hk,c, u), viewed as a function of k, c, is describable. Then, for every Sum-GNN (cid:12)(cid:12)(cid:12) > ε. N and for every ε > 0 there exist k, c s.t Proof. Let F be a finite set of polynomials that describes Fix any specific c ∈ N>0, and for K ∈ N>0 N(Hk,c, u). denote by FK,c = {p ∈ F : ∃k ≥ K : N(Hk,c, u) = p(k, c)} only those polynomials in F that intersect with u(m) in the do- k,c main [K, ∞) × {c}. Denote the polynomials in FK,c that are a constant, by (cid:98)FK,c = {p : p ∈ FK,c, p constant}. Let ε > 0 and assume by contradiction that for every k ∈ N>0 it holds (cid:12)(cid:12)(cid:12) ≤ ε. Then, there must exist Kc ∈ N>0 for that which (cid:98)FKc,c = FKc,c. Otherwise, as F is assumed to describe N(Hk,c, u), any appearance of c, in any p ∈ Fk,c, is tied to k, and we would have (cid:12)(cid:12)(cid:12)N(Hk,c, u) − c inf p∈(Fk,c\(cid:98)Fk,c) |p(k, c)| −−−−→ k→∞ ∞ and (cid:12)(cid:12)(cid:12) = ∞ (cid:12)(cid:12)(cid:12)N(Hk,c, u) − c sup k∈N (cid:12)(cid:12)(cid:12)N(Hk,c, u) − c (cid:12)(cid:12)(cid:12) ≤ ε. By definition, (cid:98)FK,c is in contradiction to a subset of F which is finite, and so max((cid:98)FKc,c) ≤ max(p ∈ F : p constant). Denote the last term by maxF. As our reason- ing thus far is true for any c, it holds that max(max((cid:98)FKc,c) : 0.25(k)0.5(k)0.75(k)00.20.40.60.811.2mean(sum)0.25(k)0.5(k)0.75(k)00.20.40.60.811.2mean(sum) c ∈ N) ≤ maxF. Finally, for c = (cid:100)maxF + ε + 1(cid:101) necessarily for (cid:12)(cid:12)(cid:12)N(Hk,c, u) − c (cid:3) all k ≥ Kc it holds that (cid:12)(cid:12)(cid:12) > c − maxF > ε. Section 5.1 Define a series of featured star graphs {Gk,c} as follows: For (k, c) ∈ N2 >0, i∈[k]{{u, vi}} • V(Gk,c) = {u} ∪ {v1, . . . , vk} • E(Gk,c) = (cid:83) • Z(Gk,c) = {(u, 0)} (cid:83) i∈[k]{(vi, c)} Let N be an m-layer Sum-GNN. We define u(t) (cid:66) k,c N (t)(Gk,c, u), the feature of u ∈ V(Gk,c) after operating the first t layers of N. Note that u(m) = N(Gk,c, u). For every i, j ∈ [k] k,c there is an automorphism of Gk that maps vi to v j, thus they receive the same feature throughout the computation. We de- fine v(t) (cid:66) N (t)(Gk,c, vi) for every i ∈ [k]. In our argumenta- k,c tion, we view u(t) k,c as functions of k, c. k,c, v(t) Lemma A.5. It holds that u(m) k,c is describable. = 0, v(t) k,c k,c is w-describable and that u(t) Proof. We show by induction that for every t ∈ [m] it holds that v(t) k,c is describable. For t = 0 we have u(t) = c and the assumption holds. Assume k,c correctness for t = n. By definition, u(n+1) = fn+1(u(n) k,c, kv(n) k,c) where fn+1 is a ReLU FNN. By assumption, v(n) k,c is w- describable and so by Lemma A.3 we have that kv(n) k,c is de- scribable. Also, by assumption, u(n) k,c is describable. Hence, by Lemma A.3 we have that u(n+1) is describable. The proof for v(n+1) (cid:3) is in similar fashion. k,c k,c k,c Theorem 5.1 Let f : GN1 → ZR a feature transformation, such that for ev- ery k, c it holds that f (Gk,c)(u) = c. Then, Sum-GNNs (cid:48) f . Proof. Immediate Lemma A.4. from combining Lemma A.5 and (cid:3) Corollary 5.2 Denote by S the set of all multisets over N>0. Let g : S → R an aggregation such that ∀a, b ∈ N>0 g( ) = a, that is, g aggregates every homogeneous multiset to its single unique value. Then, Sum-GNNs (cid:3)N g-aggregation GNNs. (cid:17) (cid:16){a} b Proof. Let f : GN1 → ZR a feature transformation, such that for every featured graph G, and for every vertex v ∈ V(G), it holds that f (G)(v) (cid:66) g(N(v)). Then, by Theorem 5.1, Sum- GNNs (cid:48) f . Clearly, there is a g-aggregation GNN that exactly (cid:3) computes f . Consider another variant of {Gk,c}: • V(Gk,c) = {u1, . . . , uk2 } ∪ {v1, . . . , vk} • E(Gk,c) = (cid:83) • Z(Gk,c) = (cid:83) i∈[k2], j∈[k]{{ui, v j}} i∈[k2]{(ui, 0)} (cid:83) i∈[k]{(vi, c)} Let N be an m-layer Sum-GNN. We use the notations u(t) v(t) k,c with similar meaning to before, where u(t) each of the ui vertices. Lemma A.6. It holds that k2u(m) k,c is describable by a k,c set F such that for every p ∈ F it holds that p does not contain k2c (with coefficient (cid:44) 0). k,c and k,c now refers to + kv(m) Proof. We prove the correctness of the following statements for every t ∈ [m], from which the lemma clearly follows. 1. u(t) k,c is describable. 2. v(t) k,c is weakly-describable by a set F such that for every p ∈ F it holds that p does not contain kc. Proof is by induction on t. Correctness for t = 0 is clear. As- sume correctness for t = n. 1. By definition, u(n+1) k,c) for some FNN k,c is describable and k,c is also describable. Hence, by Lemma A.3 we fn+1. By the induction assumption, u(n) clearly kv(n) have that u(n+1) is describable. = fn+1(u(n) k,c, kv(n) k,c k,c k,c, k2u(n) = fn+1(v(n) 2. By definition, v(n+1) fn+1. By the induction assumption, v(n) property, and clearly so does k2u(n) have that the output of operating fn+1 on v(n) the stated property. k,c) for some FNN k,c obtains the stated k,c. By Lemma A.3, we k,c, k2u(n) k,c obtains (cid:3) k,c Lemma A.7. Let f : GN1 → R a graph embedding such that k+1 . Let an FNN F, and define a readout ro (cid:66) ∀k, c f (Gk,c) = kc fF ◦ avg. Then, ro ◦ Sum-GNNs (cid:48) f . a By k,c (k+1) +k*v(m) k,c k,c k(k+1) = k*u(m) definition, Sum-GNN N. +v(m) k,c Proof. Let avg ◦N(Gk,c) = k2*u(m) By Lemma A.6, . k * u(m) + v(m) is weakly-describable by a set F(cid:48) such that k,c k,c for every p ∈ F(cid:48) it holds that p does not contain kc. Using a similar technique to the one in proof of Lemma A.3, it is not fF ◦ avg ◦N(Gk,c) is weakly-describable hard to show that by a set F such that for every p ∈ F it holds that p does not contain kc. Let any polynomial p ∈ F and let b ∈ R be the coefficient of k in p. It is not hard to verify that for every c (cid:12)(cid:12)(cid:12)(cid:12) ∈ {0, |b|, ∞}. The finiteness of F it holds that limk→∞ implies that there is a maximal such |b| over all p ∈ F, denote it by bmax. The finiteness of F also implies that: p(k,c) k+1 (cid:12)(cid:12)(cid:12)(cid:12) 1. Given c and δ > 0 there exists K0 such that for every l > K0 and every p ∈ F with a finite limit (as k → ∞) it holds (cid:12)(cid:12)(cid:12)(cid:12) < δ. that p(l,c) l+1 − limk→∞ p(k,c) k+1 (cid:12)(cid:12)(cid:12)(cid:12) 2. Given c and δ > 0 there exists K0 such that for every l > K0 and every p ∈ F with an infinite limit (as k → ∞) it holds that p(l,c) l+1 − c (cid:12)(cid:12)(cid:12)(cid:12) > δ. (cid:12)(cid:12)(cid:12)(cid:12) = c. Let ε > 0, Finally, for every c it holds that limk→∞ then for c = (cid:100)2ε + bmax(cid:101) there exists k such that for every p ∈ F (cid:3) it holds that kc k+1 p(k,c)−kc k+1 (cid:12)(cid:12)(cid:12)(cid:12) > ε. (cid:12)(cid:12)(cid:12)(cid:12) Lemma A.8. Let f : GN1 → R a graph embedding such that ∀k, c f (Gk,c) = kc k+1 . Let an FNN F, and define a readout ro (cid:66) fF ◦ sum. Then, ro ◦ Sum-GNNs (cid:48) f . +k*v(m) then sum ◦N(Gk,c) = k2 * u(m) + k * v(m) Proof. Let ε > 0, k,c . k,c Clearly, k2*u(m) k,c is describable. Hence, by Lemma A.3, k,c it holds that fF ◦sum ◦N(Gk,c) is describable. Let F a describ- ing set of k2 * u(m) k,c , let any polynomial p ∈ F, and let k,c b ∈ R be the coefficient of k0 in p. It is not hard to verify that for every c it holds that limk→∞ |p(k, c)| ∈ {0, |b|, ∞}. The finiteness of F implies that there is a maximal such |b| over all p ∈ F, denote it by bmax. The finiteness of F also implies that: + k * v(m) 1. Given c and δ > 0 there exists K0 such that for every l > K0 and every p ∈ F with a finite limit (as k → ∞) it holds that p(l, c) − limk→∞ p(k, c) < δ. 2. Given c and δ > 0 there exists K0 such that for every l > K0 and every p ∈ F with an infinite limit (as k → ∞) it holds that |p(l, c) − c| > δ. = c. Let ε > 0, Finally, for every c it holds that limk→∞ then for c = (cid:100)2ε + bmax(cid:101) there exists k such that for every then for c = p ∈ F it holds that (cid:100)2ε + bmax(cid:101) there exists k such that for every p ∈ F it holds (cid:12)(cid:12)(cid:12)p(k, c) − kc (cid:3) that (cid:12)(cid:12)(cid:12)(cid:12) > ε. Let ε > 0, (cid:12)(cid:12)(cid:12)(cid:12) (cid:12)(cid:12)(cid:12) > ε. p(k,c)−kc k+1 kc k+1 k+1 Theorem 5.3 Let f : GN1 → R a graph embedding such that ∀k, c f (Gk,c) = kc k+1 . Let an aggregation a ∈ {sum, avg} and an FNN F, and define a readout ro (cid:66) fF ◦ a. Then, ro ◦ Sum-GNNs (cid:48) f . Proof. Follows Lemma A.8. from combining Lemma A.7 and (cid:3) Corollary 5.4 Denote by S the set of all multisets over N>0. Let g : S → R an aggregation such that ∀a, b ∈ N>0 g( ) = a. Let an ag- gregation a ∈ {sum, avg} and an FNN F, and define a readout ro (cid:66) fF ◦ a. Then, ro ◦ Sum-GNNs (cid:3)N avg ◦ g-GNNs. (cid:16){a} b (cid:17) Proof. Clearly, for a straightforward g-aggregation GNN Ng it holds that Ng(Gk,c)(ui) = c and Ng(Gk,c)(vi) = 0, hence avg ◦Ng(Gk,c) = k2c k+1 . By Theorem 5.3, no composition k2+k (cid:3) of ro with a Sum-GNN can approximate f (G) = Ng(G). = kc Section 5.2 We define a new series of featured graphs {Gk,c} (see Fig- ure 3). For every (k, c) ∈ N2 >0: • V(Gk,c) = {u} ∪ {v1, . . . , vk} ∪ {w1, . . . , wc} i∈[k]{{u, vi}} (cid:83) • E(Gk,c) = (cid:83) i∈[k], j∈[c]{{vi, w j}} • Z(Gk,c) = {(u, 1)} (cid:83) i∈[k]{(vi, 1)} (cid:83) Let N be an m-layer Sum-GNN. We define u(t) (cid:66) k,c N (t)(Gk,c, u), v(t) (cid:66) N (t)(Gk,c, vi), and w(t) (cid:66) N (t)(Gk,c, wi), k,c k,c following a reasoning similar to Section 5.1, and view k,c, v(t) u(t) k,c as functions of k, c i∈[c]{(wi, 1)} k,c, w(t) Lemma A.9. It holds that u(m) k,c is describable. = w(t) k,c k,c, kv(n) k,c is w-describable and that u(t) Proof. We show by induction that for every t ∈ [m] it holds that v(t) k,c, w(t) k,c are describable. For t = 0 we have u(t) = v(t) = 1 and the assumption k,c k,c holds. Assume correctness for t = n. By definition, u(n+1) = fn+1(u(n) k,c) where fn+1 is a ReLU FNN. By assumption, v(n) k,c is w-describable and so by Lemma A.3 we have that kv(n) k,c is describable. Also by assumption, u(n) k,c is describable. Hence, by Lemma A.3 we have that u(n+1) is describable. For v(n+1) k,c, cw(n) k,c), and k,c by assumption u(n) k,c are w-describable. Hence, by Lemma A.3 we have that v(n+1) is w-describable. The proof k,c for w(n+1) (cid:3) is in similar fashion. k,c , by definition, v(n+1) k,c, v(n) k,c = fn+1(v(n) k,c, w(n) + u(n) k,c k,c k,c Theorem 5.5 Let f : G1 → ZR a feature transformation, such that for every k, c it holds that f (Gk,c)(u) = c. Then, Sum-GNNs (cid:48) f . Proof. Immediate Lemma A.4. from combining Lemma A.9 and (cid:3) Corollary 5.6 Denote by S the set of all multisets over N>0, and let g : (cid:17) S → R an aggregation such that ∀a, b ∈ N>0 g( ) = a. Then, Sum-GNNs (cid:3){1} (Sum, g)-GNNs. (cid:16){a} b Proof. Let f : G{1} → ZR a feature transformation such that for every featured graph G, for every vertex v ∈ V(G), it holds that f (G)(v) (cid:66) g({sum(w) : w ∈ N(v)}). Then, by Theorem 5.5, Sum-GNNs (cid:48) f . Clearly, there is a GNN that uses Sum aggre- gation in its first layer and g aggregation in its second layer, (cid:3) that exactly computes f . We define one last variant of a {Gk,c} series: • V(Gk,c) = {u1, . . . , uk2 } ∪ {v1, . . . , vk3 } ∪ {w1, . . . , wkc} • E(Gk,c) = (cid:83) • Z(Gk,c) = (cid:83) j∈[k2],i∈[k3]{{u j, vi}} (cid:83) i∈[k2]{(ui, 0)} (cid:83) Let N be an m-layer Sum-GNN. The notations u(t) w(t) i∈[kc]{(wi, 1)} k,c, v(t) i∈[k3]{(vi, 0)} (cid:83) i∈[k3], j∈[kc]{{vi, w j}} k,c, are used as before. k,c, and Lemma A.10. It holds that k2u(m) k,c is describ- k,c able by a set F and for every p ∈ F it holds that p does not contain k3c (with coefficient (cid:44) 0). +k3v(m) k,c +kcw(m) Proof. We prove the correctness of the following statements, from which the lemma clearly follows. 1. u(t) k,c is weakly-describable by a set F such that for every p ∈ F it holds that p does not contain kc. 2. v(t) k,c is describable. 3. w(t) k,c is weakly-describable by a set F such that for every p ∈ F it holds that p does not contain k2. Proof is by induction on t. Correctness for t = 0 is immediate. Assume correctness for t = n. 1. By definition, u(n+1) = fn+1(u(n) k,c, k3v(n) k,c fn+1. By the induction assumption, u(n) property and the same holds for k3v(n) have that the output of operating fn+1 on u(n) the stated property. k,c) for some FNN k,c obtains the stated k,c. By Lemma A.3, we k,c, k3v(n) k,c obtains 2. By definition, v(n+1) k,c = fn+1(v(n) k,c, k2u(n) k,c + kcw(n) FNN fn+1. By the induction assumption, v(n) k,c, kcw(n) stated property, and clearly so do k2u(n) lows similarly to the end of (1). 3. By definition, w(n+1) = fn+1(w(n) k,c k,c) for some k,c obtains the k,c. The rest fol- fn+1. By the induction assumption, w(n) property, and clearly so does k3v(n) to the end of (1). k,c, k3v(n) k,c) for some FNN k,c obtains the stated k,c. The rest follows similarly (cid:3) Lemma A.11. Let f : G{0,1}1 → R a graph embedding such that ∀k, c f (Gk,c) = (k2+kc)kc k3+k2+kc . Let an aggregation a ∈ {sum, avg} and an FNN F, and define a readout ro (cid:66) fF ◦ a. Then, ro ◦ Sum-GNNs (cid:48) f . + kcw(m) + k3v(m) k,c Proof. Let ε > 0. Define A (cid:66) k2u(m) k,c , then k,c avg ◦N(Gk,c) = A k3+k2+kc . By Lemma A.10, A is describable by a set F(cid:48) such that for every p ∈ F(cid:48) it holds that p does not contain k3c, hence avg ◦N(Gk,c) is describable. Hence, by Lemma A.3 fF ◦avg ◦N(Gk,c) is describable. Let F a describ- ing set be . Let any polynomial p ∈ F and let b ∈ R the coeffi- cient of the component k3 in p. Then, it is not hard to verify (cid:12)(cid:12)(cid:12)(cid:12) ∈ {0, |b|, ∞}. The that for every c it holds that limk→∞ finiteness of F implies that there is a maximal such |b| over all p ∈ F, denote it by bmax. The finiteness of F also implies that: p(k,c) k3+k2+kc (cid:12)(cid:12)(cid:12)(cid:12) (cid:12)(cid:12)(cid:12)(cid:12) p(l,c) l3+l2+lc 1. Given c and δ > 0 there exists K0 such that for every l > K0 and every p ∈ F with a finite limit (as k → ∞) it holds that p(k,c) k3+k2+kc 2. Given c and δ > 0 there exists K0 such that for every l > K0 and every p ∈ F with an infinite limit (as k → ∞) it holds that − limk→∞ (cid:12)(cid:12)(cid:12)(cid:12) < δ. − c > δ. p(l,c) l3+l2+lc (k2+kc)kc k3+k2+kc limk→∞ = c. for every c it holds that for c = (cid:100)2ε + bmax(cid:101) there exists k such that for implying (cid:3) Finally, Hence, every p ∈ F it holds (cid:12)(cid:12)(cid:12)avg ◦N(Gk,c) − f (Gk,c) Lemma A.12. Let f : GN1 → R a graph embedding, such that k3+k2+kc . Then, sum ◦ for every k, c it holds that Sum-GNNs (cid:48) f . f (Gk,c) = (k2+kc)kc p(k,c)−(k2+kc)kc k3+k2+kc that (cid:12)(cid:12)(cid:12) > ε. (cid:12)(cid:12)(cid:12)(cid:12) > ε, (cid:12)(cid:12)(cid:12)(cid:12) Proof. Let ε > 0. Clearly, k2u(m) + k3v(m) k,c is describ- k,c k,c able. Let F a describing set of k2u(m) + kcw(m) + k3v(m) k,c , let k,c k,c any polynomial p ∈ F, and let b ∈ R be the coefficient of k0 in p. Then, it is not hard to verify that for every c it holds that limk→∞ |p(k, c)| ∈ {0, |b|, ∞}. The finiteness of F implies that + kcw(m) there is a maximal such |b| over all p ∈ F, denote it by bmax. The finiteness of F also implies that: 1. Given c and δ > 0 there exists K0 such that for every l > K0 and every p ∈ F with a finite limit (as k → ∞) it holds that |p(l, c) − limk→∞ p(k, c)| < δ. 2. Given c and δ > 0 there exists K0 such that for every l > K0 and every p ∈ F with an infinite limit (as k → ∞) it holds that |p(l, c) − c| > δ. (k2+kc)kc k3+k2+kc Finally, for every c it holds that limk→∞ for c = (cid:100)2ε + max(0, bmax)(cid:101) there exists k such that every p ∈ F it holds that (cid:12)(cid:12)(cid:12)sum ◦N(Gk,c) − f (Gk,c) Theorem 5.7 (cid:12)(cid:12)(cid:12)(cid:12)p(k, c) − (k2+kc)kc = c. Hence, for implying (cid:3) (cid:12)(cid:12)(cid:12)(cid:12) > ε, (cid:12)(cid:12)(cid:12) > ε. k3+k2+kc Let f : G{0,1}1 → R a graph embedding such that ∀k, c f (Gk,c) = (k2+kc)kc k3+k2+kc . Let an aggregation a ∈ {sum, avg} and an FNN F, and define a readout ro (cid:66) fF ◦ a. Then, ro ◦ Sum-GNNs (cid:48) f . Proof. Follows Lemma A.12. from combining Lemma A.11 and (cid:3) Corollary 5.8 Denote by S the set of all multisets over N>0. Let g : S → R an (cid:17) aggregation such that ∀a, b ∈ N>0 g( ) = a. Let an aggrega- tion a ∈ {sum, avg} and an FNN F, and define a readout ro (cid:66) fF ◦ a. Then, ro ◦ Sum-GNNs (cid:3){0,1} avg ◦ (Sum, g)-GNNs. (cid:16){a} b for Proof. Clearly, straightforward stereo aggrega- a it holds that Ng(Gk,c)(ui) = kc, tion (Sum,g)-GNN Ng Ng(Gk,c)(wi) = kc, Ng(Gk,c)(vi) = 0, hence and avg ◦Ng(Gk,c) = (k2+kc)kc k3+k2+kc . By Theorem 5.7, no composi- tion of ro with a Sum-GNN can approximate the graph (cid:3) embedding f (G) (cid:66) avg ◦Ng(G). Proofs for Section 6 Lemma 6.1 Let A an m-layer MUPA-GNN architecture, let l be the max- imum depth of any FNN in A, and let d be the maximum in-degree of any node in any FNN in A. Then, there exists r ∈ N such that: for every GNN N that realizes A it holds that N(Gk, u) is piecewise-polynomial (of k) with at most ((d + 1)l)m pieces, and each piece is of degree at most r. Proof. Note the following observations: a. Let f1, f2 be piecewise polynomial with p1, p2 pieces, then a linear combination of f1, f2 has at most p1 + p2 pieces. This can be seen by considering the set of pieces-joint points of f1 + f2, and noticing that it is the union of such points of f1 and such points of f2. Accordingly, let f1, . . . , fd be piecewise polynomial with at most p pieces each, then a linear combi- nation of f1, . . . , fd has at most p * d pieces. b. Let f be piecewise polynomial with at most p pieces, then ReLU( f ) has at most p + 1 pieces. c. Let g be an output of a ReLU FNN of depth l with max- imal in-degree d for any node, with inputs which are at most p-pieces polynomial each. Then, by (a)+(b), g is piecewise- polynomial with (((pd + 1)d + 1)d + 1).. ≤ p * (d + 1)l pieces. d. Let f (x) be piecewise polynomial with at most p pieces, and let g(x) a polynomial, then g( f (x)) is piecewise polynomial, with at most p pieces, each of degree at most deg( f )deg(g) e. Let f (x) be piecewise polynomial with at most p pieces, and let g(y) a polynomial, then g(x f (x)) is piecewise polynomial, with at most p pieces, each of degree at most (deg( f ) + 1)deg(g). k Let N be a GNN that realizes A. We define u(t) (cid:66) k N (t)(Gk, u), the feature of u ∈ V(Gk) after operating the first t layers of N. Note that u(m) = N(Gk, u). For every i, j ∈ [k] there is an automorphism of Gk that maps vi to v j, thus they receive the same feature throughout the computation. We de- fine v(t) (cid:66) N (t)(Gk, vi) for every i ∈ [k]. In our argumentation, k we view u(t) k as functions of k. k , v(t) k , u(t) = fn+1(u(n) k , a(n+1) Using observations [a..e] above, we prove by induction on t that v(t) k , in each coordinate, are piecewise polynomial in k with no more than ((d + 1)l)t pieces, each of degree at most rt for some rt ∈ N. For t = 0 we have that v(t) k , u(t) k are constants. Assume correctness for t = n. By definition, u(n+1) ) where a(n+1) , . . . , a(n+1) is a shorthand k bn+1 for the aggregation value a(n+1) ({v(n) k,c}k). By (d),(e), and the induction assumption, each of the input coordinates to fn+1 is piecewise polynomial in k with at most ((d+1)l)n pieces, each of degree at most rn+1 for some rn+1 ∈ N. Hence, by (c), each coordinate of u(n+1) has at most ((d+1)l)n*(d+1)l = ((d+1)l)n+1 pieces, each of degree at most rn+1. By similar reasoning, v(n+1) can be shown to have no more than ((d + 1)l)n+1 pieces, k (cid:3) each of a certain maximal degree. k,c 1 j j Theorem 6.2 Let f : G1 → ZR a feature transformation, and define g(k) (cid:66) f (Gk)(u). Assume that g does not converge to any polynomial, that is, there exists ε > 0 such that for every polynomial p, for every K0, there exists k ≥ K0 such that |g(k) − p(k)| ≥ ε. Then, MUPA-GNNs(cid:48) f . Proof. Let an ε by which g does not get forever close to any polynomial, and let a MUPA-GNN N. By Lemma 6.1, there is a K0 such that for every k ≥ K0 it holds that N(Gk, u) = p(k) for some polynomial p. By assumption, there exists k > K0 such that |g(k) − p(k)| ≥ ε. Hence, |N(Gk, u) − f (Gk, u)| ≥ (cid:3) ε. Lemma 6.3 For x, k ∈ N define Ix,k (cid:66) {x, x + 1, . . . , x + k − 1} the set of consecutive k integers starting at x. Let f : N → R be a PIL, let n ∈ N, and define kn (cid:66) 1 + max(k : ∀p ∈ Pn ∀x ∈ N ∀y ∈ [x..(x + k − 1)] f (y) = p(y)) Then, for every x ∈ N there exists εx,kn > 0 such that: for every p ∈ Pn there exists y ∈ Ix,kn for which |p(y) − f (y)| ≥ εx,kn . That is, for every starting point x there is a bounded interval Ix,kn , and a gap εx,kn , such that no polynomial of degree ≤ n can approximate f on that interval below that gap. Proof. Define I (cid:66) Ix,kn . For a real-valued function h whose domain contains I, we define (cid:107)h(cid:107)I (cid:66) max(|h(y)| : y ∈ Ix,kn ), the maximum absolute value h attains on Ix,kn . Define (cid:66) inf((cid:107) f − p(cid:107)I : p ∈ Pn), the distance of f from the clos- εx,kn est polynomial of degree ≤ n, in the segment Ix,kn . We need to show that εx,kn > 0. For a vector a = (a0, . . . , an) ∈ Rn+1 de- note by (cid:107)a(cid:107)2 the Euclidean norm of a. For a, b ∈ Rn+1 we use d(a, b) (cid:66) (cid:107)a − b(cid:107)2 as the metric in our continuity argumenta- tion. Define pa(x) (cid:66) a0+* * *+anxn the polynomial determined by a. Note the following: a) For a ∈ Rn+1, let g(a) (cid:66) (cid:107)pa(cid:107)I, then g is continuous. b) For a ∈ Rm+1, let g(a) (cid:66) (cid:107) f − pa(cid:107)I, then g is continuous. c) There exists T ∈ R such that εx,kn = inf((cid:107) f − pa(cid:107)I : (cid:107)a(cid:107)2 ≤ T ) Let = 1} (cid:107)pa(cid:107)I S = {a ∈ Rn+1 : (cid:107)a(cid:107)2 By (a), then by definition of (cid:107)pa∗ (cid:107)I and define Proof: δS (cid:66) inf((cid:107)pa(cid:107)I : a ∈ S ). is continu- ous, and as S is compact we have that there exists = δS . Note that necessarily a∗ ∈ S such that (cid:107)pa∗ (cid:107)I kn ≥ n + 1, it must be that either δS > 0 or pa∗ = 0. Since a∗ ∈ S , nec- essarily it for Hence, is the former that holds. (cid:13)(cid:13)(cid:13)pa/(cid:107)a(cid:107)2 every a ∈ Rn+1 we have that ≥ δS , and by (cid:13)(cid:13)(cid:13)pa/(cid:107)a(cid:107)2 ∞. Finally, (cid:107)pa(cid:107)I note that (cid:107) f − pa(cid:107)I ≥ (cid:107)pa(cid:107)I − (cid:107) f (cid:107)I, and let T such that +1+(cid:107) f (cid:107)I, then for all a : (cid:107)a(cid:107)2 ≥ T (cid:107)a(cid:107)2 ≥ T ⇒ (cid:107)pa(cid:107)I > εx,kn + 1. we have (cid:107) f − pa(cid:107)I ≥ εx,kn Hence, inf((cid:107) f − p(cid:107)I : p ∈ Pn) = inf((cid:107) f − pa(cid:107)I : (cid:107)a(cid:107)2 ≤ T ). By (b) and (c), εx,kn is the infimum of a continuous function on a closed ball, hence there exists a∗ ∈ Rn+1 such that εx,kn = (cid:107) f − pa∗(cid:107)I. By the assumption that f is PIL, and the definition (cid:3) of kn, we have (cid:107) f − pa∗(cid:107)I > 0. (cid:13)(cid:13)(cid:13)I we have (cid:107)pa(cid:107)I −−−−−−→ + 1 + (cid:107) f (cid:107)I − (cid:107) f (cid:107)I = (cid:107)a(cid:107)2 * = εx,kn (cid:107)a(cid:107)2→∞ (cid:13)(cid:13)(cid:13)I Lemma 6.4 For every q, n ∈ N there exists a point Tq,n ∈ N and a gap for every PIL f : N → R, and every δTq,n > 0 such that: piecewise-polynomial g with q many pieces of degree ≤ n, there exists y ∈ N, 0 ≤ y ≤ Tq,n for which |g(y) − f (y)| ≥ δTq,n. That is, the number of pieces and the max degree of a piecewise-polynomial g determine a guaranteed minimum gap by which g misses f within a guaranteed interval. Using the notation of kn Proof. Define T0 = 1. from for every i ∈ [q] define Ti (cid:66) (kn − 1)(i) + Lemma 6.3, 1, define Ii (cid:66) ITi−1,kn , and define δi (cid:66) inf((cid:107) f − p(cid:107)Ii : p ∈ Pn). Note that δi > 0 by Lemma 6.3. Finally, define Tq,n (cid:66) Tq, δTq,n (cid:66) min(δi : i ∈ [q]). Assume by contradiction that g is close to f by less than δTq,n for every y ∈ [0..Tq,n], then, necessarily the first polynomial piece of g ends at most at T1−1, the second at T2−1 and the q−1 piece at Tq−1−1, then the last polynomial piece starts the latest at Tq−1 and by Tq,n it must have missed at least one point by at least δTq,n > 0. (cid:3) (a) Unbounded Countable Features (b) Single Value Features Figure 7: Relative Error of different aggregations on UC and SV. Theorem 6.5 Let f : G1 → ZR a feature transformation, let g(k) (cid:66) f (Gk)(u), and assume that g is PIL. Then, for every MUPA- GNN architecture A, there exists εA > 0 such that for ev- ery MUPA-GNN N that realizes A there exists k such that |N(Gk, u) − f (Gk)(u)| ≥ ε. Proof. Let the q, r guaranteed by Lemma 6.1 for A, and let the Tq,r, δTq,r guaranteed by Lemma 6.4 for q pieces of de- gree ≤ r. Then, by Lemma 6.4, for εA (cid:66) δTq,r and k (cid:66) Tq,r the (cid:3) statement holds. B Experimentation Ext. Architecture and Training We implement all GNNs using PyTorch Geometric [Fey and Lenssen, 2019]. The update function fF of each GNN layer is a standard 2-layer MLP with a ReLU-activated hidden layer and a linear output layer. We set the intermediate embed- ding dimension to 256 and use 2 message passing layers in all models. We minimize the smooth L1 loss on the training data using the Adam Optimizer [Kingma and Ba, 2015]. No read- out function is needed. For both considered graph families the ground truth is a label of the root vertex. The prediction and loss of all other vertices are simply masked out. Before each training run we randomly choose 500 graphs from the training data as a validation dataset. Each model is trained for 500 epochs with a batch size of 100. The initial learning rate is selected from {10−3, 10−4, 10−5} based on val- idation performance. The learning rate decays with a cosine annealing schedule [Loshchilov and Hutter, 2017] through- out training. We average all results over 5 models trained with different random seeds. All experiments are conducted on a machine with an NVIDIA RTX A6000 GPU (48GB) and 512GB of RAM running Ubuntu 22.04 LTS. Extended Results An illustration of the full experimental results can be seen in fig. 7. For both datasets, and each tested architecture, we provide the relative error (RE) over the full test range (k ∈ [1..1000], c ∈ [1..1000]) as a 3D plot. The error is pro- vided on the z-axis, which is linearly scaled. The color map is linear as well and is scaled individually for each subplot to highlight additional details. The results for the unbounded countable features (UC) ex- periment are provided in fig. 7a. Note that the color map for the trained Mean-GNN is scaled by 10−5, since the learned function is very close to the ground truth. The trained Sum- GNN performs significantly worse. Relative to itself though, as long as c is in the training range [1..100] it generalizes well along the k axis. Operating the trained Sum-GNN , on c in the training range, resembles the bounded input-feature domain setting examined in Section 4. Hence, the generaliza- tion in k, when c is in the training range, resembles the result in Section 4: Sum-GNNs can approximate Mean when the input-feature domain is bounded. Once c is beyond the train- ing range, the relative error grows rapidly, both along the k axis (for fixed c) and along the c axis. Interestingly, the error of the trained Sum-GNN also tends upwards at c < 10. The learned function therefore lacks robustness even towards the lower end of the training range of c. The results for the single value features (SV) experiment are provided in fig. 7b. Overall, the trained (Sum,Mean)- GNN achieves a significantly lower error than the Sum-GNN. Like in the UC experiment, as long as c is in the training range [1..100] the trained Sum-GNN generalizes relatively well along the k axis, and the performance deteriorates sharply (in both axis) when c > 100. We do note though, that the results of the (Sum,Mean)-GNN in this experiment are substantially worse than those of the Mean-GNN in the UC experiment. While there exists a (Sum,Mean)-GNN that computes ex- actly the SV-experiment function (see proof of Corollary 5.6), Stochastic Gradient Descend (SGD) was not able to learn this function in fine detail. To arrive in a good (Sum,Mean)-GNN instance, the first GNN-layer has to learn to ignore the coor- dinates of the Mean-aggregation and to use the coordinates of the Sum-aggregation properly, and the second GNN-layer has to learn to ignore the Sum and use the Mean. These require- ments constitute a more challenging learning problem than that of learning a good Mean-GNN for the UC task, and the difference is reflected in the results. Interestingly, the relative error of the (Sum,Mean)-GNN is worst at the lower end of the training range c < 10 for high values of k. C02004006008001000K02004006008001000Error (RE)0102030405060Mean Aggr.0.51.01.52.01e5C02004006008001000K02004006008001000Error (RE)0102030405060Sum Aggr.1020304050C02004006008001000K02004006008001000Error (RE)020406080100120Sum + Mean Aggr.0.20.40.6C02004006008001000K02004006008001000Error (RE)020406080100120Sum Aggr.20406080100
http://arxiv.org/abs/2302.11556v2
2023-06-04T08:14:37
2023-02-22T18:53:38
Equivariant Polynomials for Graph Neural Networks
Graph Neural Networks (GNN) are inherently limited in their expressive power. Recent seminal works (Xu et al., 2019; Morris et al., 2019b) introduced the Weisfeiler-Lehman (WL) hierarchy as a measure of expressive power. Although this hierarchy has propelled significant advances in GNN analysis and architecture developments, it suffers from several significant limitations. These include a complex definition that lacks direct guidance for model improvement and a WL hierarchy that is too coarse to study current GNNs. This paper introduces an alternative expressive power hierarchy based on the ability of GNNs to calculate equivariant polynomials of a certain degree. As a first step, we provide a full characterization of all equivariant graph polynomials by introducing a concrete basis, significantly generalizing previous results. Each basis element corresponds to a specific multi-graph, and its computation over some graph data input corresponds to a tensor contraction problem. Second, we propose algorithmic tools for evaluating the expressiveness of GNNs using tensor contraction sequences, and calculate the expressive power of popular GNNs. Finally, we enhance the expressivity of common GNN architectures by adding polynomial features or additional operations / aggregations inspired by our theory. These enhanced GNNs demonstrate state-of-the-art results in experiments across multiple graph learning benchmarks.
[ "Omri Puny", "Derek Lim", "Bobak T. Kiani", "Haggai Maron", "Yaron Lipman" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11556v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11556v2", "@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" ]
Equivariant Polynomials for Graph Neural Networks Omri Puny * 1 Derek Lim * 2 Bobak T. Kiani * 2 Haggai Maron 3 Yaron Lipman 1 4 Abstract Graph Neural Networks (GNN) are inherently limited in their expressive power. Recent seminal works (Xu et al., 2019; Morris et al., 2019b) intro- duced the Weisfeiler-Lehman (WL) hierarchy as a measure of expressive power. Although this hier- archy has propelled significant advances in GNN analysis and architecture developments, it suffers from several significant limitations. These include a complex definition that lacks direct guidance for model improvement and a WL hierarchy that is too coarse to study current GNNs. This paper introduces an alternative expressive power hier- archy based on the ability of GNNs to calculate equivariant polynomials of a certain degree. As a first step, we provide a full characterization of all equivariant graph polynomials by introducing a concrete basis, significantly generalizing previous results. Each basis element corresponds to a spe- cific multi-graph, and its computation over some graph data input corresponds to a tensor contrac- tion problem. Second, we propose algorithmic tools for evaluating the expressiveness of GNNs using tensor contraction sequences, and calculate the expressive power of popular GNNs. Finally, we enhance the expressivity of common GNN architectures by adding polynomial features or ad- ditional operations / aggregations inspired by our theory. These enhanced GNNs demonstrate state- of-the-art results in experiments across multiple graph learning benchmarks. 3 2 0 2 n u J 4 ] G L . s c [ 2 v 6 5 5 1 1 . 2 0 3 2 : v i X r a 1. Introduction In recent years, graph neural networks (GNNs) have become one of the most popular and extensively studied classes of *Equal contribution 1Weizmann Institute of Science 2MIT CSAIL 3NVIDIA Research 4Meta AI Research Centre for Artificial Correspondence to: Omri Puny Intelligence. <[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 4 4 1 3 1 3 PH (X)j2j2 = (cid:80)n j1,j3,j4=1 Xj1j4Xj1j3Xj1j2Xj3j2 = einsum(12, 13, 14, 32 → 22, X, X, X, X)j2j2 PH (X)j1j2 = (cid:80)n j3,j4=1 Xj1,j2Xj1,j3Xj1,j4Xj3,j2 = einsum(12, 13, 14, 32 → 12, X, X, X, X)j1j2 2 2 Figure 1. Example of two basis elements of equivariant graph poly- nomials: node-valued (top), and edge-valued (bottom). Basis elements PH can be described by tensor contraction networks H (left), corresponding to a matching einsum expression. machine learning models for processing graph-structured data. However, one of the most significant limitations of these architectures is their limited expressive power. In re- cent years, the Weisfeiler-Lehman (WL) hierarchy has been used to measure the expressive power of GNNs (Morris et al., 2019b; Xu et al., 2019; Morris et al., 2021). The introduction of the WL hierarchy marked an extremely sig- nificant step in the graph learning field, as researchers were able to evaluate and compare the expressive power of their architectures, and used higher-order WL tests to motivate the development of new, more powerful architectures. The WL hierarchy, however, is not an optimal choice for either purpose. First, its definition is rather complex and not intuitive, particularly for k ≥ 3. One implication is that it is often difficult to analyze WL expressiveness of a particular architecture class. As a result, many models lack a theoretical understanding of their expressive power. A second implication is that WL does not provide practical guidance in the search for more expressive architecture. Lastly, as was noted in recent works (Morris et al., 2022; 2019a), the WL test appears to be too coarse to be used to evaluate the expressive power of current graph models. As an example, many architectures (e.g., (Frasca et al., 2022)) are strictly more powerful than 2-WL and bounded by 3-WL, and there is no clear way to compare them. The goal of this paper is to offer an alternative expressive power hierarchy, which we call polynomial expressiveness that mitigates the limitations of the WL hierarchy. Our pro- posed hierarchy relies on the concept of graph polynomials, which are, for graphs with n nodes, polynomial functions P : Rn2 that are also permutation equivariant - → Rn2 Equivariant Polynomials for Graph Neural Networks that is, well defined on graph data. The polynomial expres- siveness hierarchy is based on a natural and simple idea - the ability of GNNs to compute or approximate equivariant graph polynomials up to a certain degree. This paper provides a number of theoretical and algorithmic contributions aimed at defining the polynomial hierarchy, providing tools to analyze the polynomial expressive power of GNNs, and demonstrating how this analysis can suggest practical improvements in existing models that give state- of-the-art performance in GNN benchmarks. First, while some polynomial functions were used in GNNs in the past (Maron et al., 2019; Chen et al., 2019b; Azizian & Lelarge, 2021), a complete characterization of the space of polynomials is lacking. In this paper, we provide the first characterization of graph polynomials with arbitrary degrees. In particular, we propose a basis for this vector space of polynomials, where each basis polynomial PH of degree d corresponds to a specific multi-graph H with d edges. This characterization provides a significant general- ization of known results, such as the basis of constant and linear equivariant functions on graphs (Maron et al., 2018). Furthermore, this graphical representation H can be viewed as a type of a tensor network, which provides a concrete way to compute those polynomials by performing a series of tensor (node) contractions. This is illustrated in Figure 1. As a second contribution, we propose tools for measuring polynomial expressiveness of graph models and placing them in the hierarchy. This is accomplished by analyzing tensor networks using standard contraction operators, simi- lar to those found in Einstein summation (einsum) algo- rithms. Using these, we analyze two popular graph models: Message Passing Neural Networks (MPNNs) and Provably Powerful Graph Networks (PPGNs). This is done by first studying the polynomial expressive power of prototypical versions of these algorithms, which we define. Our third contribution demonstrates how to improve MPNN and PPGN by using the polynomial hierarchy. Specifically, we identify polynomial basis elements that are not com- putable by existing graph architectures and add those poly- nomial basis elements to the model as feature layers. Also, we add two simple operations to the PPGN architecture (ma- trix transpose and diagonal / off-diagonal MLPs) to achieve the power of a Prototypical edge-based graph model. After precomputing the polynomial features, we achieve strictly better than 3-WL expressive power while only requiring O(n2) memory - to the best of our knowledge this is the first equivariant model to achieve this. We demonstrate that these additions result in state-of-the-art performance across a wide variety of datasets. 2. Equivariant Graph Polynomials We represent a graph with n nodes as a matrix X ∈ Rn2 , where edge values are stored at off-diagonal entries, Xij, i ̸= j, i, j ∈ [n] = {1, 2, . . . , n}, and node values are stored at diagonal entries Xii, i ∈ [n]. → Rn2 An equivariant graph polynomial is a matrix polynomial map P : Rn2 that is also equivariant to node permu- tations. More precisely, P is a polynomial map if each of its entries, P (X)ij, i, j ∈ [n], is a polynomial in the inputs Xrs, r, s ∈ [n]. P is equivariant if it satisfies P (g * X) = g * P (X), (1) for all permutations g ∈ Sn, where Sn denotes the per- mutation group on [n], and g acts on a matrix Y as usual by (g * Y)ij = Yg−1(i),g−1(j). (2) 2.1. PH : Basis for equivariant graph polynomials We next provide a full characterization of equivariant graph polynomials by enumerating a particular basis, denoted PH . In later sections we use this basis to analyze expressive properties of graph models and improve expressiveness of existing GNNs. The basis elements PH of degree d equivariant graph polyno- mials are enumerated from non-isomorphic directed multi- graphs, H = (V, E, (a, b)), where V = [m] is the node set; E = {(r1, s1), . . . , (rd, sd)}, ri, si ∈ [m], the edge set, where parallel edges and self-loops are allowed; and a, b ∈ V is a pair of not necessarily distinct nodes represent- ing the output dimension. The pair (a, b) will be marked in our graphical notation as a red edge. Defining the basis PH will be facilitated by the use of Einstein summation operator defined next. Note that the multi-graph H can be represented as the following string that encodes both its list of edges and the single red edge: H ∼= ′r1s1, . . . , rdsd → ab′. The einsum operator is: einsum(H, X1, . . . , Xd)ia,ib = einsum(r1s1, . . . , rdsd → ab, X1, . . . , Xd)ia,ib = (cid:88) j1,...jm∈[n] ja=ia,jb=ib X1 jr1 ,js1 * * * Xd jrd ,jsd Figure 2 shows how matrix multiplication can be defined us- ing a corresponding multigraph H and Einstein summation. Such multigraphs span the basis of equivariant polynomials: 2 Equivariant Polynomials for Graph Neural Networks 1 X 3 einsum(H, X, Y)j1j2 = einsum(13, 32 → 12, X, Y) = Y 2 (cid:80)n j3=1 Xj1j3Yj3j2 = (XY)j1j2 Figure 2. Example of matrix multiplication, XY. Computation defined by a multigraph H and Einstein summation. Theorem 2.1 (Graph equivariant basis). A basis for all equivariant graph polynomials P : Rn2 of degree ≤ d is enumerated by directed multigraphs H = (V, E, (a, b)), where |V | ≤ min {n, 2 + 2d}, |E| ≤ d, and V \{a, b} does not contain isolated nodes. The polynomial basis elements corresponding to H are → Rn2 i,j = 1 if a = i, b = j, and δa,b where A ∈ Nn2 0 , N0 = {0, 1, . . .} is the matrix of powers, and δa,b i,j = 0 otherwise. A natural way to encode these monomials is with labeled multi-graphs H = (V, E, (a, b)), where V = [n], E is defined by the adjacency matrix A, and (a, b) is a special (red) edge. We therefore denote M = MH . These monomials can be projected onto equivariant polyno- mials via the Reynolds operator that takes the form, QH (X) = = (cid:88) g∈Sn (cid:88) g∈Sn g * MH (g−1 * X, δg(a),g(b)) Mg*H (X, δa,b), (6) PH (X) = einsum(H, d times (cid:122) (cid:125)(cid:124) X, . . . , X). (cid:123) where the action of g ∈ Sn on the multi-graph H is de- fined (rather naturally) as node relabeling of H using the permutation g. (3) An explicit formula for PH can be achieved by plugging in the definition of einsum and equation 3: PH (X)ia,ib = (cid:88) (cid:89) Xjr,js . (4) j1,...jm∈[n] ja=ia,jb=ib (r,s)∈E Figure 1 depicts an example of graph equivariant basis el- ements PH corresponding to two particular multigraphs H. Note that a repeated pair (a, a) in H leads to a node- valued equivariant polynomial, while a distinct pair (a, b), a ̸= b leads to an edge-valued equivariant polynomial. Fur- thermore, we make the convention that if E is empty then (cid:81) (r,s)∈E Xir,is = 1. The number of such polynomials in- creases exponentially with the degree of the polynomial; the first few counts of degree d equivariant graph polynomials are 2 (d = 0), 15 (d = 1), 117 (d = 2), 877 (d = 3), 6719 (d = 4), . . . Further details and proofs of these sequences are provided in Appendix I. The full proof of Theorem 2.1 is provided in Appendix B. → Rn2 Proof idea for Theorem 2.1. Since the set of monomials form a basis of all (not necessarily invariant) polynomials P : Rn2 , we can project them onto the space of equivariant polynomials via the symmetrization (Reynolds) operator to form a basis for the equivariant polynomials. This projection operation will group the monomials into orbits that form the equivariant basis. To find these orbits, the basic idea is to consider the mono- mials in the input variables {Xi,j : i, j ∈ [n]} and an additional variable {δi,j : i, j ∈ [n]} to denote the possible output entries of the equivariant map. Any given monomial M (X, δa,b) takes the form M (X, δa,b)i,j = δa,b i,j n (cid:89) r,s=1 XAr,s r,s , (5) 3 (i) QH sums all monomi- From the above, we note: als with multi-graphs in the orbit of H, namely [H] = {g * H|g ∈ Sn}. This shows that, in contrast to MH , QH is represented by an unlabeled multi-graph H and enumer- ated by non-isomorphic multi-graphs H. (ii) Since the symmetrization is a projection operator, any equivariant polynomial is spanned by QH . (iii) Since each QH is a sum of MH belonging to a different orbit, and since orbits are disjoint, the set {QH } for non-isomorphic H is linearly independent. These three points establish that {QH } for non-isomorphic multi-graphs H is a basis of equivariant graph polynomials. Noting that QH (X)ij δg(a),g(b) = δi,j, the explicit form below can be derived: includes only terms for which QH (X)ia,ib = (cid:88) (cid:89) Xjr,js. (7) j1̸=...̸=jm∈[n] ja=ia,jb=ib (r,s)∈E QH is similar to PH in equation 4, except we only sum over non-repeated indices. The proof in Appendix B shows that PH is also a basis for such equivariant polynomials. Simple graphs. It is often the case that the input data X is restricted to some subdomain of Rn2 , e.g., sym- metric 0/1 matrices with diagonal en- tries set to zero correspond to simple graph data. In such cases, polynomi- als PH that correspond to different multi-graphs H can coincide, resulting in a smaller basis. For simple graph data X, existence of self loops in H would result in PH (X) = 0, parallel edges in H can be replaced with single edges without changing the value of PH (X), and since the direction of black edges in H do not change the value of PH (X) we can consider only undirected multi- graphs H. That is, for simple graph data it is enough to Figure 4. Simple H corresponding to simple graph data. Equivariant Polynomials for Graph Neural Networks to study properties of graphs (Thi ́ery, 2000; Lov ́asz, 2012; Komiske et al., 2018). Subgraph counting. The previous work on invariant poly- nomials mentioned above as well as our proof of Theo- rem 2.1 suggest QH (see equation 7) as another basis of equivariant graph polynomials. In Appendix G, we show that when applied to binary input X ∈ {0, 1}n×n, QH performs subgraph counting; essentially, QH (X)ia,ib is pro- portional to the number of subgraphs of X isomorphic to H such that ia is mapped to a and ib is mapped to b. This QH basis is interpretable, but does not lend itself to efficient vectorized computation or the tensor contraction perspective that the PH basis has. Equivariant polynomials for attributed graphs. Our basis for equivariant graph polynomials can be extended to cover the more general case of attributed graphs (i.e., graphs with Rf features attached to nodes and/or edges), P : Rn2×f → Rn2 . A similar basis to PH can be used in this case, as described in Appendix F. Figure 6 visualizes this extension. 2 1 2 1 3 3 PH (X)j2j2 = (cid:80)n j1,j3=1 Xj2j11Xj1j30Xj1j32 = einsum(21, 13, 13 → 22, X[:, :, 1], X[:, :, 0], X[:, :, 2])j2j2 PH (X)j2j1 = (cid:80)n j3=1 X2 j2j30Xj2j11 = einsum(23, 23, 21 → 21, X[:, :, 0], X[:, :, 0], X[:, :, 1])j2j1 from Figure 6. Basis elements of equivariant polynomials Rn2×3 → Rn2 . The output edge is indicated by a dotted red edge and the feature dimension is indexed by three colors for index zero (orange), index one (green), and index two (blue). 3. Expressive Power of Graph Models → Rnk In this section we evaluate the expressive power of equivari- ant graph models from the new, yet natural hierarchy aris- ing from equivariant graph polynomials. By graph model, F = {F }, we mean any collection of equivariant functions F : Rn2 , where k = 1 corresponds to a family of node-valued functions, F (X) ∈ Rn, and k = 2 to node and edge-valued functions, F (X) ∈ Rn2 . For expositional simplicity we focus on graph data X representing simple graphs, but note that the general graph data case can be analysed using similar methods. We will use two notions of polynomial expressiveness: exact and approximate. The exact case is used for analyzing Prototypical graph models, whereas the approximate case is used for analyzing practical graph models. Definition 3.1. A graph model F is d node/edge polynomial exact if it can compute all the degree d polynomial basis elements PH (X) for every simple graph X. 4 Figure 3. Basis of equivariant constant (left of bold line) and linear (right of bold line) graph polynomials. consider simple graphs H (ignoring the red edge). Figure 4 shows two examples of H for simple graph data. Example: linear basis. Employing Theorem 2.1 for the d = 0, 1 case reproduces the graph equivariant constant and linear functions from Maron et al. (2018). Figure 3 depicts the graphical enumeration of the 2 constant and 15 linear basis elements. Computing PH (X) with tensor contractions. A useful observation for the graph model analysis performed later is that computing PH (X) is equivalent to a tensor contraction guided by H. Similarly to einsum, computing PH (X) can be done iteratively in multiple ways by finding a sequence of contraction paths for H where we start with each edge of H endowed with X and our end goal is to have a single black edge aligned with the red edge. Figure 5 provides an example of computing a 4th degree polynomial, PH (X)j1,j2 = n (cid:88) j3,j4=1 Xj1j4Xj1j3Xj3j2Xj1j2. The computation of the polynomial is decomposed to a se- quence of operations, portrayed in the figure. Each step is labeled by the tensor contraction operation and the cor- responding explicit computation. Nodes colored in gray correspond to contracted nodes whose indices are summed in the einsum. The output of each contraction step is rep- resented by a new black edge (labeled as Y, Z and R in our example). 2.2. Generalizations and discussion Invariant graph polynomials. This approach also gives a basis for the invariant polynomials P : Rn2 → R. In this case, we let H be a directed multigraph without a red edge, and define PH (X) = (cid:80) r,s∈E(H) Xjr,js. Computing PH then corresponds to contracting H to the trivial graph (with no nodes or edges). Our equivariant basis is a generalization of previous work, which used invariant polynomials analogous to PH or the alternative basis QH j1,...,jm∈[n] (cid:81) Equivariant Polynomials for Graph Neural Networks 4 1 Yj1j1 = (cid:88) j4 Xj1j4 −−−−−−−−−−−−−−−−−−−−−−−−−→ 4 X 1 X 3 X X 2 Y 1 X X X 3 2 1 3 Zj1j2 = 2 (cid:88) j3 Xj1j3Xj3j2 −−−−−−−−−−−−−−−−−−−−−−−−−−−→ Y 1 X Z 2 1 2 Rj1j2 = Yj1j1Zj1j2Xj1j2 −−−−−−−−−−−−−−−−−−−−−−−−−→ 1 R 2 Figure 5. Computation of PH (X) with a sequence of tensor contractions: The polynomial PH (X) (left-most) is computed when a single black edge parallel to the red edge is left (right-most); above each arrow is the tensor contraction applied (contracted nodes are in gray). C1 C2 C3 C4 C1 C2 C3 C4 C5 C6 C7 Figure 7. Prototypical node-based (left) and edge-based (right) graph models' contraction banks. Gray nodes indicate nodes that are contracted. Explicit formula of each element can be found in Appendix D. Definition 3.2. A graph model F is d node/edge polyno- mial expressive if for arbitrary ε > 0 and degree d polyno- mial basis element PH (X) there exists an F ∈ F such that maxX simple |F (X) − P (X)| < ε. As a primary application of the equivariant graph basis PH , we develop tools here for analyzing the polynomial expres- sive power of graph models F. We define Prototypical graph models which provide a structure to analyze or im- prove existing popular GNNs such as MPNN (Gilmer et al., 2017) and PPGN (Maron et al., 2019). 3.1. Prototypical graph models We consider graph computation models, FB, that are fi- nite sequences of tensor contractions taken from a bank of primitive contractions B. FB = (cid:8)Ci1 Ci2 * * * Cil |Cij ∈ B(cid:9) , (8) a different primitive can PH (X) if where the bank B = {C1, . . . , Ck} consists of multi-graphs Ci = (Vi, Ei, (ai, bi)), each repre- senting contraction. tensor A model FB compute = a polynomial einsum(H, X, . . . , X) it can contract H to the red edge by apply- ing a finite sequence of contractions from its bank. If there exists such a sequence then PH is deemed computable by FB, otherwise it is not computable by FB. For example, the model with the bank presented in Figure 8 can compute PH in Figure 5; removing any element from this model, will make PH (X) non-computable. We recap: Figure 8. A bank B of a model FB that can compute the ex- ample in Figure 5. Definition 3.3. The polynomial PH is computable by F iff there exists a sequence of tensor contractions from F that computes PH (X) = einsum(H, X, . . . , X). We henceforth focus on two Prototypical models: the node- based model Fn and edge-based model Fe. Their respective contraction banks are depicted in Figure 7, each motivated by the desire to achieve polynomial exactness (see Defini- tion 3.1) and contract multi-graphs H where a member of the bank can always be used to contract nodes with up to N neighbors. Taking N = 1 results in the node-based bank in Figure 7 (left), and N = 2 in the edge-based bank in Figure 7 (right). These choices are not unique - other contraction banks can satisfy these requirements. Lemma 3.4. Fn (for simple graphs) and Fe (for general graphs) can always contract a node in H iff its number of neighbors is at-most 1 and 2, respectively. A few comments are in order. Node-based contractions can only add self-edges during the contraction process (i.e., new node-valued data) thus requiring only O(n) additional memory to perform computation. Further note that since we assume simple graph data, H is also a simple graph, and no directed edges (i.e., non-symmetric intermediate tensors) are created during contraction. Contraction banks with undirected graphs suffice in this setting. We later show that the node-based model acts analogously to message- passing. The edge-based model targets exactness over both node and edge valued polynomial. It generates new edges that can be directed even if X is simple, and thus includes directed contractions in its bank. The edge-based model will later be connected to the graph models PPGN (Maron et al., 2019) and Ring-GNN (Chen et al., 2019b). We later show that the node-based model is 1-WL expressive and the edge-based model is 3-WL expressive. Deciding computability of PH (X) with FB. A key com- ponent in analyzing the expressive power of a Prototypical model is determining which polynomials PH (X) can be computed with F, given H and X encoding simple graph data. A naive algorithm traversing all possible enumerations of nodes in H and their contractions would lead to a com- binatorial explosion that is too costly - especially since this procedure needs to be repeated for a large number of polynomials. Here, we show that at least for contraction banks Fn and Fe, Algorithm 1 is a linear time (in |V |, |E|), 5 Equivariant Polynomials for Graph Neural Networks Algorithm 1 Decide if PH is computable by Fn or Fe. Input: contraction bank F ∈ {Fn, Fe}, multi-graph H set d = 1 for F = Fn, or d = 2 for F = Fe. set doneContracting = f alse while not doneContracting do if exists a node in V \ {a, b} with ≤ d neighbors then contract the node using F else doneContracting = true end if end while if V \ {a, b} is empty then return computable else return non-computable end if greedy algorithm for deciding computability of a given poly- nomial. Algorithm 1 finds a sequence of contractions using the greedy step until no more nodes are left to contract. That is, it terminates when all nodes, aside from a, b, have more than 1 or 2 neighbors for Fn or Fe, respectively. If it terminates with just {a, b} as vertices it deems PH com- putable and otherwise it deems PH non-computable. To show correctness of this algorithm we prove: Theorem 3.5. Let H be some multi-graph and FB ∈ {Fn, Fe}. Further, let H ′ be the multi-graph resulting after contracting a single node in H using one or more opera- tions from B to H. Then, H is FB-computable iff H ′ is FB-computable. To verify the correctness of this procedure, note that the algorithm has to terminate after at most |V | − | {a, b} | node contractions. Now consider two cases: if the algorithm terminates successfully, it must have found a sequence of tensor contractions to compute PH (X). If it terminates unsuccessfully, the theorem implies its last network H ′ is computable iff the input network H is computable. Now since there is no further node contraction possible to do in H ′ using operations from B it is not computable by defini- tion, making H not computable. Polynomial exactness. To compute the d polynomial ex- actness (see Definition 3.1) for the node-based and edge-based Prototypical graph models we enumerate all non-isomorphic simple graphs H with up to d edges and one red edge and run Algorithm 1 on each H. This reveals that the node- based model Fn is 2-node-polynomial-exact, while the smallest Figure 9. The H non-computable for: Fn (left: node- valued), and Fe (middle: right: node-valued; edge-valued). 6 edge-based model Fe is 5-node-polynomial-exact and 4- edge-polynomial-exact. See Figure 9 for the lowest degree polynomials, represented by H with the smallest number of edges, that are non-computable for Fn and Fe. k-WL expressive power. For simple graphs, there is a natural connection between our Prototypical graph models and the k-WL graph isomorphism tests. This stems from a result of Dvoˇr ́ak (2010); Dell et al. (2018), which states that two graphs X(1) and X(2) are k-FWL equivalent if and only if hom(H, X(1)) = hom(H, X(2)) for all H of tree- width at most k. Recall that hom(H, X) is the number of homomorphisms from H to X (where H has no red edges), which we show is equivalent to the output of PH (X) for the invariant polynomial PH in Appendix G. By showing that the Prototypical node-based graph model can contract any H of tree-width 1 (and no others), and that the Prototypical edge-based graph model can contract any H of tree-width at most 2 (and no others), we thus have the following result. Proposition 3.6. The Prototypical node-based model can distinguish a pair of simple graphs if and only if 1-WL can. The Prototypical edge-based model can distinguish a pair of simple graphs if and only if 3-WL / 2-FWL can. This proposition indicates that Fn and Fe can contract an invariant polynomial, represented by a graph H, if and only if the tree-width of H is 1 and 2, respectively. Therefore computability of invariant PH can be decided by checking the tree width of H. We leave generalizing this approach to equivariant PH to future work. 3.2. GNNs and their expressive power In this section we turn our attention to commonly used graph neural networks (GNNs), and provide lower bounds on their polynomial expressive power as in Definition 3.2. The Message Passing Neural Network (MPNN) we consider consists of layers of the form Y(k+1) = m (cid:104) XY(k), 11T Y(k), Y(k)(cid:105) , (9) where the intermediate tensor variables are Y ∈ Rn×d, 1 ∈ Rn is the vector of all ones, Y(0) = 1, brackets indicate concatenation in the feature dimension, and m means a mul- tilayer perceptron (MLP) applied to the feature dimension. As an application of the Prototypical edge-based model, we propose and implement a new model architecture (PPGN++) that is at least as expressive as the full versions of PPGN/Ring-GNN (Maron et al., 2019; Chen et al., 2019b) (which incorporate all 15 linear basis elements), but is more efficient - PPGN++ uses a smaller number of "primitive" operations than the full PPGN/Ring-GNN, and does not need parameters for each linear basis element: Z(k+1) = ̄m3 (cid:104) ̄m1 (cid:104) Z(k), Z(k)T (cid:105) ⊛ ̄m2(Z(k)), Z(k)(cid:105) , (10) Equivariant Polynomials for Graph Neural Networks where Z ∈ Rn2×d are intermediate tensor variables, Z(0) = X, ⊛ performs matrix multiplication of matching features, and ̄mi, for i ∈ [3], is a pair of MLPs: one applied to all diagonal and off-diagonal features of Z separately. We lower bound the polynomial expressiveness of MPNN and PPGN++ in the next theorem: Theorem 3.7. PPGN++ is at-least 4 edge polynomial ex- pressive and 5 node polynomial expressive. MPNN is at- least 2 node polynomial expressive. Proof idea. We prove the theorem in two steps. First, show- ing that an MPNN or PPGN++ layer can approximate any primitive contraction C ∈ B from the bank of the Prototypi- cal node based Fn or edge based Fe models, respectively. Second, we use a lemma from Lim et al. (2022) stating that layer-wise universality leads to overall universality. The complete proof is in Appendix D. Comparison of PPGN++ and PPGN. Proposition 3.6 and the proof of Theorem 3.7 indicate that PPGN++ is 3-WL/2-FWL expressive for simple graphs, similarly to PPGN (Maron et al., 2019). However, the following propo- sition shows that there is a significant expressiveness gap between PPGN and PPGN++ in approximating equivariant polynomials. Proposition 3.8. PPGN is at most 0 edge polynomial ex- pressive. Proof idea. We claim that PPGN is at most 0 edge polyno- mial expressive by proving that there exist a linear polyno- mial (the transpose operator) that cannot be approximated by PPGN. The proof shows that for an input tensor of the form Algorithm 1, considering all non-isomorphic, simple and connected H. Indeed any H with two disconnected compo- nents corresponds to a multiplication of two lower degree polynomials approximable by the GNN itself (or using lower degree polynomial features). Any non-computable polyno- mials discovered in this process are added as node/edge input features to the architecture, effectively increasing the polynomial expressiveness of the model to d. Table 1. Numbers of non-computable polynomials (left) out of all relevant polynomials (right) for the Prototypical models. d = 3 2/8 0/18 d = 4 6/18 0/53 d = 5 23/49 1/174 d = 6 85/144 11/604 d = 7 308/446 72/2193 Fn Fe In Table 1 we list, for each Prototypical model and degree d, the number of polynomials that are found non-computable by the Prototypical models (left), out of the total number of relevant polynomials PH (right). For the node based model we count only node-valued polynomials, while for the edge based model we count both node and edge-valued polynomi- als. Note that the number of non-computable polynomials is substantially smaller than the total number, especially in Fe. Since polynomials are calculated at the data pre- processing step, there is an upfront computational cost for this procedure that must be accounted for. Finding the op- timal contraction path that minimizes runtime complexity for a general matrix polynomial is an NP-hard problem (Biamonte et al., 2015) with a naive upper bound in run- time complexity of O(nd). An empirical evaluation of the preprocessing time is in Appendix A; in our experiments, preprocessing time is small compared to training time. Z = (cid:21) (cid:20)a a b b , a, b ∈ R, 4. Related Work a PPGN model cannot approximate the transpose operator PH (Z) = ZT since it preserves the row structure. The complete proof is in Appendix E. 3.3. Increasing the expressive power of GNNs Theorem 3.7 proves a lower bound on the polynomial ex- pressiveness of two popular GNN models - a natural ques- tion is how to increase the expressiveness beyond the lower bound. Polynomial expressiveness provides a simple path forward to add network operations or input features that complement these architectures with polynomials that are otherwise uncomputable. In our study, we add input features to enhance expressiveness. Suppose we have a d′ polynomial expressive GNN model (with a corresponding d′ exact Prototypical graph model FB) that we want to extend it to be d > d′ polynomial ex- pressive. For every l ∈ N, d′ + 1 ≤ l ≤ d, we can compute all FB non-computable l-degree basis elements of PH using Relation to Homomorphisms and Subgraph Counts. Past work has studied invariant polynomials on graphs (Thi ́ery, 2000; Lov ́asz, 2012; Komiske et al., 2018). Viewed as functions on binary inputs, the basis consists of functions that count homomorphisms or injective homomorphisms of H into an input graph X. Homomorphisms are related to the PH basis, and injective homomorphisms are related to QH (see Appendix G). Also, equivariant homomorphism counts that relate to our PH or QH has been studied (Manˇcinska & Roberson, 2020; Grohe et al., 2021; Maehara & NT, 2019; Bouritsas et al., 2022; Barcel ́o et al., 2021; Welke et al., 2022). However, these works do not exhibit a basis of equivariant polynomials. Also, our tensor contraction interpretation and analysis does not appear in past work. Expressivity Measures for Graph Models. The k-WL hierarchy has been widely used for studying graph machine learning (Morris et al., 2021), starting with the works of Mor- ris et al. (2019b) and Xu et al. (2019), which show an equiv- 7 Equivariant Polynomials for Graph Neural Networks alence between message passing neural networks and 1-WL. Tensor methods resembling k-WL such as k-IGN (Maron et al., 2018) and PPGN-like methods (Maron et al., 2019; Azizian & Lelarge, 2021) achieve k-WL power (Azizian & Lelarge, 2021; Geerts & Reutter, 2022), but scale in mem- ory as nk or nk−1 for n-node graphs. Morris et al. (2019a; 2022) define new k-WL variants with locality and sparsity biases, which gives a finer hierarchy and offers a trade-off between efficiency and expressiveness. Various works measure the expressivity of graph neural net- works by the types of subgraphs that they can count (Chen et al., 2020; Tahmasebi et al., 2020; Arvind et al., 2020). On simple graphs, subgraph counting of H is equivalent to eval- uating an invariant polynomial QH . Additional works have studied the ability of graph models to compute numerous other graph properties. For instance, graph machine learning models have been studied in the context of approximating combinatorial algorithms (Sato et al., 2019), solving bicon- nectivity problems (Zhang et al., 2023), computing spectral invariants (Lim et al., 2022), distinguishing rooted graphs at the node level (Chen et al., 2021), and computing various other graph properties (Garg et al., 2020). As opposed to our framework, these expressivity measures generally do not induce a hierarchy of increasing expressivity, and they often do not directly suggest improvements for graph models A matrix query language (MATLANG) (Brijder et al., 2019; Geerts, 2021) and a more general tensor language (TL) (Geerts & Reutter, 2022) have been used to study ex- pressive power of GNNs (Balcilar et al., 2021; Geerts & Reutter, 2022). These languages define operations and ways to compose them for processing graphs in a permutation equivariant or invariant way. Our edge-based Prototypical model result gives a new perspective on a result of Geerts (2021), which shows that MATLANG can distinguish any two graphs that 2-FWL / 3-WL can. Indeed, our edge-based graph model includes the five linear algebra operations that form the 3-WL expressive MATLANG. While the opera- tions of MATLANG were included in a somewhat ad-hoc manner ("motivated by operations supported in linear al- gebra package" (Geerts, 2021)), our framework shows that these are the at-most quadratic equivariant polynomials that are required to contract all tree-width 2 graphs. Other Expressive GNNs. Various approaches have been used to develop expressive graph neural networks. One approach adds node or edge features, oftentimes positional or structural encodings, to base graph models (Sato et al., 2021; Abboud et al., 2021; Bouritsas et al., 2022; Lim et al., 2022; Zhang et al., 2023; Li et al., 2020; Loukas, 2020). Subgraph GNNs treat an input graph as a collection of subgraphs (Bevilacqua et al., 2022; Frasca et al., 2022; Qian et al., 2022; Cotta et al., 2021; Zhao et al., 2021; You et al., 2021; Zhang & Li, 2021). Some models utilize modified message passing and higher-order convolutions (Bodnar et al., 2021a;b; Thiede et al., 2021; de Haan et al., 2020). One can also take a base model and perform group averaging or frame averaging to make it have the desired equivariances while preserving expressive power (Murphy et al., 2019; Puny et al., 2022). 5. Experiments In this section we demonstrate the impact of increasing the polynomial expressive power of GNNs. We test two families of models. PPGN++ (d) uses the architecture in equation 10, derived using our edge based Prototypi- cal model, and achieves d polynomial expressive power by pre-computing polynomial features found in Subsection 3.3; missing (d) notation means using just PPGN++ with- out pre-computed features. GatedGCN (d) uses the base MPNN architecture of (Bresson & Laurent, 2017) with the d-expressive polynomials pre-computed. We experiment with 4 datasets: a graph isomorphism dataset SR (Bod- nar et al., 2021b), which measures the ability of GNNs to distinguish strongly regular graphs; and 3 real-world molec- ular property prediction datasets including ZINC, ZINC-full (Dwivedi et al., 2020) and Alchemy (Chen et al., 2019a). 5.1. Graph Isomorphism Expressiveness Distinguishing non-isomorphic graphs from families of strongly regular graphs is a challenging task (Bodnar et al., 2021a;b). The SR dataset (Bouritsas et al., 2022) is com- posed of 9 strongly regular families. This dataset is chal- lenging since any pair of graphs in the SR dataset cannot be distinguished by the 3-WL algorithm. This experiment is done without any training (same procedure as in (Bodnar et al., 2021b)) and the evaluation is done by randomly ini- tialized models. For every family in the dataset, we iterate over all pairs of graphs and report the fraction that the model determines are isomorphic. Two graphs are considered iso- morphic if the L2 distance between their embeddings is smaller than a certain threshold (ε = 0.01). This procedure was repeated for 5 different random seeds and the averaged fraction rate was reported in Figure 10. This figure por- trays the expressiveness boost gained by using high degree polynomial features. While the base models, GatedGCN and PPGN (and PPGN++), cannot distinguish any pair of graphs (as theoretically expected), adding higher degree polynomial features significantly improves the ability of the model to distinguish non-isomorphic graphs in this dataset. Optimal results of 0% failure rate are obtained for PPGN++ (d) with d ≥ 6 (i.e., adding at-least degree 6 polynomial features). For the GatedGCN model, although we do not reach the 0% failure rate, adding the right polynomial fea- tures makes GatedGCN outperform 3-WL based models in distinguishing non-isomorphic graphs in this dataset. 8 Equivariant Polynomials for Graph Neural Networks Table 2. Results on Alchemy (Chen et al., 2019a) and ZINC-full (Dwivedi et al., 2020) datasets. Lower is better, best models are marked in bold. Model GIN (Xu et al., 2019) δ-2-GNN (Morris et al., 2019a) SpeqNet (Morris et al., 2022) PF-GNN (Dupty et al., 2022) HIMP (Fey et al., 2020) SignNet (Lim et al., 2022) CIN (Bodnar et al., 2021a) PPGN (Maron et al., 2019) PPGN++ PPGN++ (5) PPGN++ (6) Alchemy ZINC-Full Test MAE Test MAE .180 ± .006 .088 ± .002 .118 ± .001 .042 ± .003 .115 ± .001 - .111 ± .010 - .036 ± .002 - .113 ± .002 .024 ± .003 .022 ± .002 - .113 ± .001 .022 ± .003 .022 ± .001 .111 ± .002 .020 ± .001 .110 ± .001 .020 ± .001 .109 ± .001 Figure 10. Failure rate (log scale) for distinguishing SR graphs, the lower the better. 5.2. Real-World Datasets The efficacy of increasing polynomial expressive power on real-world data (molecular graphs datasets) was evaluated on 3 graph regression tasks: ZINC, ZINC-full and Alchemy. Training. We followed the training protocol mentioned in (Dwivedi et al., 2020) for ZINC and ZINC-full and the protocol from (Lim et al., 2022) for Alchemy. All of our trained models obey a 500K parameter budget. Further de- tails regarding the training procedure and model parameters can be found in Appendix A. Baselines. The baseline results for the ZINC 12K exper- iment were obtained from (Zhao et al., 2022), except for PPGN and GatedGCN, which we calculated. For ZINC-full and Alchemy we used the results from (Lim et al., 2022). Results. The mean absolute error (MAE) over the test set is reported in Table 3 for ZINC 12K and Table 2 for ZINC- full and alchemy. In both tables, PPGN++ (6) achieves SOTA results across all 3 datasets. In addition, for both test model families there is a clear correlation between higher d (polynomial expressiveness) and test error. Furthermore, PPGN++ (5) and PPGN++ (6), which produce the top re- sults in all 3 experiments, are the only 2 models (including 9 all baselines) which are provably strictly more powerful than 3-WL. Our results add evidence to the guiding hy- pothesis that increases in expressivity facilitate improved downstream performance. Table 3. Results on ZINC 12K (Dwivedi et al., 2020) dataset. Lower is better, best model is marked in bold. Model GCN (Kipf & Welling, 2016) GIN (Xu et al., 2019) PNA (Corso et al., 2020) GSN (Bouritsas et al., 2022) PF-GNN (Dupty et al., 2022) GIN-AK (Zhao et al., 2021) CIN (Bodnar et al., 2021a) SetGNN (Zhao et al., 2022) GatedGCN (Bresson & Laurent, 2017) GatedGCN (4) GatedGCN (5) GatedGCN (6) PPGN (Maron et al., 2019) PPGN++ PPGN++ (5) PPGN++ (6) Test MAE .321 ± .009 .163 ± .003 .140 ± .006 .115 ± .012 .122 ± .010 .080 ± .001 .079 ± .006 .075 ± .003 .265 ± .015 .150 ± .005 .138 ± .003 .106 ± .003 .079 ± .005 .076 ± .003 .072 ± .005 .071 ± .001 6. Conclusions We propose a novel framework for evaluating the expressive power of GNNs by evaluating their ability to approximate equivariant graph polynomials. Our first step was introduc- ing a basis for those polynomials of any degree. We then utilized Prototypical graph models to determine the com- putability of these polynomials with practical GNNs. This led to a method for increasing the expressivity of GNNs through the use of precomputed polynomial features, result- ing in a significant improvement in empirical performance. Future research could focus on several promising directions. One direction can reduce the number of features passed into GNNs by working with a generating set of polynomials rather than the complete basis. Additionally, incorporating features on nodes and edges, as outlined in Section 2.2 and Appendix F, could further improve performance. Another exciting avenue for exploration can incorporate otherwise uncomputable polynomials as computational primitives into GNN layers, rather than as features, to increase expressive- ness. Finally, it would be beneficial to study Prototypical graph models to identify families with optimal properties related to expressiveness, memory/computation complexity, and the size of the contraction bank. 7. Acknowledgments OP is supported by a grant from Israel CHE Program for Data Science Research Centers. DL is supported by an NSF Graduate Fellowship. We thank Nicolas Usunier for his insightful remarks and the anonymous reviewers for their helpful comments. sr251256sr291467sr401224sr281264sr351668sr361446sr16622sr261034sr35189910μ100μ0.0010.010.110GatedGCNGatedGCN (5)GatedGCN (6)GatedGCN (7)PPGNPPGN++PPGN++ (5)PPGN++ (6)PPGN++ (7)FamiliesFailure Rate Equivariant Polynomials for Graph Neural Networks References Abboud, R., Ceylan, I. I., Grohe, M., and Lukasiewicz, T. The surprising power of graph neural networks with random node initialization. In IJCAI, 2021. Antoneli, F., Dias, A. P. S., and Matthews, P. C. Invari- ants, equivariants and characters in symmetric bifurcation theory. Proceedings of the Royal Society of Edinburgh Section A: Mathematics, 138(3):477–512, 2008. Bouritsas, G., Frasca, F., Zafeiriou, S., and Bronstein, M. M. Improving graph neural network expressivity via sub- graph isomorphism counting. IEEE Transactions on Pat- tern Analysis and Machine Intelligence, 45(1):657–668, 2022. Bresson, X. and Laurent, T. Residual gated graph con- vnets, 2017. URL https://arxiv.org/abs/ 1711.07553. Arvind, V., Fuhlbr ̈uck, F., K ̈obler, J., and Verbitsky, O. On weisfeiler-leman invariance: Subgraph counts and related graph properties. Journal of Computer and System Sciences, 113:42–59, 2020. Brijder, R., Geerts, F., Bussche, J. V. D., and Weerwag, T. On the expressive power of query languages for matrices. ACM Transactions on Database Systems (TODS), 44(4): 1–31, 2019. Azizian, W. and Lelarge, M. Expressive power of in- In In- variant and equivariant graph neural networks. ternational Conference on Learning Representations, 2021. URL https://openreview.net/forum? id=lxHgXYN4bwl. Chen, G., Chen, P., Hsieh, C.-Y., Lee, C.-K., Liao, B., Liao, R., Liu, W., Qiu, J., Sun, Q., Tang, J., Zemel, R., and Zhang, S. Alchemy: A quantum chemistry dataset for benchmarking ai models, 2019a. URL https:// arxiv.org/abs/1906.09427. Balcilar, M., H ́eroux, P., Gauzere, B., Vasseur, P., Adam, S., and Honeine, P. Breaking the limits of message passing graph neural networks. In International Conference on Machine Learning, pp. 599–608. PMLR, 2021. Barcel ́o, P., Geerts, F., Reutter, J., and Ryschkov, M. Graph neural networks with local graph parameters, 2021. URL https://arxiv.org/abs/2106.06707. Bedratyuk, L. A new formula for the generating func- tion of the numbers of simple graphs. arXiv preprint arXiv:1512.06355, 2015. Bevilacqua, B., Frasca, F., Lim, D., Srinivasan, B., Cai, C., Balamurugan, G., Bronstein, M. M., and Maron, H. Equivariant subgraph aggregation networks. In Interna- tional Conference on Learning Representations, 2022. Biamonte, J. D., Morton, J., and Turner, J. Tensor net- Journal of Statistical work contractions for #SAT. Physics, 160(5):1389–1404, jun 2015. doi: 10.1007/ s10955-015-1276-z. URL https://doi.org/10. 1007%2Fs10955-015-1276-z. Bodlaender, H. L. A partial k-arboretum of graphs with bounded treewidth. Theoretical computer science, 209 (1-2):1–45, 1998. Bodnar, C., Frasca, F., Otter, N., Wang, Y. G., Li`o, P., Mont ́ufar, G., and Bronstein, M. Weisfeiler and lehman go cellular: Cw networks, 2021a. URL https:// arxiv.org/abs/2106.12575. Bodnar, C., Frasca, F., Wang, Y. G., Otter, N., Mont ́ufar, G., Li`o, P., and Bronstein, M. Weisfeiler and lehman go topological: Message passing simplicial networks, 2021b. URL https://arxiv.org/abs/2103.03212. Chen, L., Chen, Z., and Bruna, J. On graph neural networks versus graph-augmented mlps. In International Confer- ence on Learning Representations, 2021. URL https: //openreview.net/forum?id=tiqI7w64JG2. Chen, Z., Villar, S., Chen, L., and Bruna, J. On the equiv- alence between graph isomorphism testing and function approximation with gnns. Advances in neural information processing systems, 32, 2019b. Chen, Z., Chen, L., Villar, S., and Bruna, J. Can graph neural networks count substructures? Advances in neural information processing systems, 33:10383–10395, 2020. Corso, G., Cavalleri, L., Beaini, D., Li`o, P., and Veliˇckovi ́c, P. Principal neighbourhood aggregation for graph nets, 2020. URL https://arxiv.org/abs/2004. 05718. Cotta, L., Morris, C., and Ribeiro, B. Reconstruction for powerful graph representations. Advances in Neural In- formation Processing Systems, 34:1713–1726, 2021. de Haan, P., Cohen, T. S., and Welling, M. Natural graph networks. Advances in Neural Information Processing Systems, 33:3636–3646, 2020. Dell, H., Grohe, M., and Rattan, G. Lov'asz meets weis- feiler and leman. In 45th International Colloquium on Automata, Languages, and Programming (ICALP 2018), volume 107, pp. 40. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 2018. Derksen, H. and Kemper, G. Computational invariant the- ory. Springer, 2015. 10 Equivariant Polynomials for Graph Neural Networks Diestel, R. Graph Theory (Graduate Texts in Mathe- matics). Springer, August 2005. ISBN 3540261826. URL http://www.amazon.ca/exec/obidos/ redirect?tag=citeulike04-20{&}path= ASIN/3540261826. Duffin, R. J. Topology of series-parallel networks. Journal of Mathematical Analysis and Applications, 10(2):303– 318, 1965. Dupty, M. H., Dong, Y., and Lee, W. S. PF-GNN: Dif- ferentiable particle filtering based approximation of uni- In International Confer- versal graph representations. ence on Learning Representations, 2022. URL https: //openreview.net/forum?id=oh4TirnfSem. Dvoˇr ́ak, Z. On recognizing graphs by numbers of homo- morphisms. Journal of Graph Theory, 64(4):330–342, 2010. Dwivedi, V. P., Joshi, C. K., Luu, A. T., Laurent, T., Bengio, Y., and Bresson, X. Benchmarking graph neural networks. 2020. doi: 10.48550/ARXIV.2003.00982. URL https: //arxiv.org/abs/2003.00982. Fey, M. and Lenssen, J. E. Fast graph representation learning with PyTorch Geometric. In ICLR Workshop on Repre- sentation Learning on Graphs and Manifolds, 2019. Fey, M., Yuen, J.-G., and Weichert, F. Hierarchical inter- message passing for learning on molecular graphs, 2020. URL https://arxiv.org/abs/2006.12179. Frasca, F., Bevilacqua, B., Bronstein, M. M., and Maron, H. Understanding and extending subgraph GNNs by rethinking their symmetries. In Oh, A. H., Agarwal, A., Belgrave, D., and Cho, K. (eds.), Advances in Neural Information Processing Systems, 2022. Garg, V., Jegelka, S., and Jaakkola, T. Generalization and representational limits of graph neural networks. In In- ternational Conference on Machine Learning, pp. 3419– 3430. PMLR, 2020. Geerts, F. On the expressive power of linear algebra on graphs. Theory of Computing Systems, 65(1):179–239, 2021. Geerts, F. and Reutter, J. L. Expressiveness and approx- In In- imation properties of graph neural networks. ternational Conference on Learning Representations, 2022. URL https://openreview.net/forum? id=wIzUeM3TAU. Gilmer, J., Schoenholz, S. S., Riley, P. F., Vinyals, O., and Dahl, G. E. Neural message passing for quantum chem- istry. In International conference on machine learning, pp. 1263–1272. PMLR, 2017. Grohe, M., Rattan, G., and Seppelt, T. Homomor- arXiv preprint phism tensors and linear equations. arXiv:2111.11313, 2021. Harary, F. and Palmer, E. M. Graphical enumeration. Else- vier, 2014. Hardy, G. H., Wright, E. M., et al. An introduction to the theory of numbers. Oxford university press, 1979. Hornik, K. feedforward networks. Approximation capabilities of multi- Neural Networks, doi: layer 4(2):251–257, 1991. https://doi.org/10.1016/0893-6080(91)90009-T. URL science/article/pii/089360809190009T. https://www.sciencedirect.com/ ISSN 0893-6080. Kipf, T. N. and Welling, M. Semi-supervised classification with graph convolutional networks, 2016. URL https: //arxiv.org/abs/1609.02907. Komiske, P. T., Metodiev, E. M., and Thaler, J. Energy flow polynomials: A complete linear basis for jet substructure. Journal of High Energy Physics, 2018(4):1–54, 2018. Li, P., Wang, Y., Wang, H., and Leskovec, J. Distance en- coding: Design provably more powerful neural networks for graph representation learning. Advances in Neural Information Processing Systems, 33:4465–4478, 2020. Lim, D., Robinson, J., Zhao, L., Smidt, T., Sra, S., Maron, H., and Jegelka, S. Sign and basis invariant networks for spectral graph representation learning. arXiv preprint arXiv:2202.13013, 2022. Loukas, A. What graph neural networks cannot learn: depth vs width. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id=B1l2bp4YwS. Lov ́asz, L. Large networks and graph limits, volume 60. American Mathematical Soc., 2012. Maehara, T. and NT, H. A simple proof of the universality of invariant/equivariant graph neural networks. arXiv preprint arXiv:1910.03802, 2019. Manˇcinska, L. and Roberson, D. E. Quantum isomorphism is equivalent to equality of homomorphism counts from planar graphs. In 2020 IEEE 61st Annual Symposium on Foundations of Computer Science (FOCS), pp. 661–672. IEEE, 2020. Maron, H., Ben-Hamu, H., Shamir, N., and Lipman, Y. Invariant and equivariant graph networks. arXiv preprint arXiv:1812.09902, 2018. 11 Equivariant Polynomials for Graph Neural Networks Maron, H., Ben-Hamu, H., Serviansky, H., and Lipman, Y. Provably powerful graph networks. Advances in neural information processing systems, 32, 2019. Ramp ́aˇsek, L., Galkin, M., Dwivedi, V. P., Luu, A. T., Wolf, G., and Beaini, D. Recipe for a general, powerful, scal- able graph transformer, 2023. Molien, T. Uber die invarianten der linearen substitutions- gruppen. Sitzungber. Konig. Preuss. Akad. Wiss. (J. Berl. Ber.), 52:1152–1156, 1897. Morris, C., Rattan, G., and Mutzel, P. Weisfeiler and le- man go sparse: Towards scalable higher-order graph em- beddings, 2019a. URL https://arxiv.org/abs/ 1904.01543. Morris, C., Ritzert, M., Fey, M., Hamilton, W. L., Lenssen, J. E., Rattan, G., and Grohe, M. Weisfeiler and leman go neural: Higher-order graph neural networks. In Pro- ceedings of the AAAI conference on artificial intelligence, volume 33, pp. 4602–4609, 2019b. Morris, C., Lipman, Y., Maron, H., Rieck, B., Kriege, N. M., Grohe, M., Fey, M., and Borgwardt, K. Weisfeiler and leman go machine learning: The story so far. arXiv preprint arXiv:2112.09992, 2021. Morris, C., Rattan, G., Kiefer, S., and Ravanbakhsh, S. Speqnets: Sparsity-aware permutation-equivariant graph networks, 2022. URL https://arxiv.org/abs/ 2203.13913. Murphy, R., Srinivasan, B., Rao, V., and Ribeiro, B. Re- lational pooling for graph representations. In Interna- tional Conference on Machine Learning, pp. 4663–4673. PMLR, 2019. 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., Rai- son, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., and Chintala, S. Pytorch: An imperative style, high-performance deep learning library, 2019. URL https://arxiv.org/abs/1912.01703. P ́olya, G. Kombinatorische anzahlbestimmungen f ̈ur grup- pen, graphen und chemische verbindungen. Acta mathe- matica, 68:145–254, 1937. Puny, O., Atzmon, M., Smith, E. J., Misra, I., Grover, A., Ben-Hamu, H., and Lipman, Y. Frame averag- ing for invariant and equivariant network design. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum? id=zIUyj55nXR. Qian, C., Rattan, G., Geerts, F., Niepert, M., and Morris, C. Ordered subgraph aggregation networks. In Oh, A. H., Agarwal, A., Belgrave, D., and Cho, K. (eds.), Advances in Neural Information Processing Systems, 2022. Sato, R., Yamada, M., and Kashima, H. Approximation ra- tios of graph neural networks for combinatorial problems. Advances in Neural Information Processing Systems, 32, 2019. Sato, R., Yamada, M., and Kashima, H. Random features strengthen graph neural networks. In Proceedings of the 2021 SIAM International Conference on Data Mining (SDM), pp. 333–341. SIAM, 2021. Segol, N. and Lipman, Y. On universal equivariant set networks. arXiv preprint arXiv:1910.02421, 2019. Tahmasebi, B., Lim, D., and Jegelka, S. Counting substructures with higher-order graph neural networks: arXiv preprint Possibility and impossibility results. arXiv:2012.03174, 2020. Thiede, E., Zhou, W., and Kondor, R. Autobahn: Automorphism-based graph neural nets. Advances in Neu- ral Information Processing Systems, 34:29922–29934, 2021. Thi ́ery, N. M. Algebraic invariants of graphs; a study based on computer exploration. ACM SIGSAM Bulletin, 34(3): 9–20, 2000. Tucker, A. Applied combinatorics. John Wiley & Sons, Inc., 1994. Welke, P., Thiessen, M., and G ̈artner, T. Expectation complete graph representations using graph homomor- phisms. In The First Learning on Graphs Conference, 2022. URL https://openreview.net/forum? id=8GJyW4i2oST. Xu, K., Hu, W., Leskovec, J., and Jegelka, S. How powerful are graph neural networks? In International Conference on Learning Representations, 2019. URL https:// openreview.net/forum?id=ryGs6iA5Km. You, J., Gomes-Selman, J. M., Ying, R., and Leskovec, J. Identity-aware graph neural networks. In Proceed- ings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 10737–10745, 2021. You, Y., Li, J., Reddi, S., Hseu, J., Kumar, S., Bhojanapalli, S., Song, X., Demmel, J., Keutzer, K., and Hsieh, C.-J. Large batch optimization for deep learning: Training bert in 76 minutes, 2019. URL https://arxiv.org/ abs/1904.00962. Zhang, B., Luo, S., Wang, L., and Di, H. Rethinking the expressive power of gnns via graph biconnectivity. arXiv preprint arXiv:2301.09505, 2023. 12 Equivariant Polynomials for Graph Neural Networks Zhang, M. and Li, P. Nested graph neural networks. Ad- vances in Neural Information Processing Systems, 34: 15734–15747, 2021. Zhao, L., Jin, W., Akoglu, L., and Shah, N. From stars to subgraphs: Uplifting any gnn with local structure awareness, 2021. URL https://arxiv.org/abs/ 2110.03753. Zhao, L., Shah, N., and Akoglu, L. A practical, progressively-expressive GNN. In Oh, A. H., Agarwal, A., Belgrave, D., and Cho, K. (eds.), Advances in Neural Information Processing Systems, 2022. URL https: //openreview.net/forum?id=WBv9Z6qpA8x. 13 Equivariant Polynomials for Graph Neural Networks A. Implementation Details A.1. Datasets SR. The SR dataset (Bouritsas et al., 2022) is composed of 9 families of Strongly Regular graphs. Each family has a 4 dimensional representation: n the number of nodes in the graph, d the degree of each node, λ the number of mutual neighbors of adjacent nodes and μ the number of mutual neighbors of non-adjacent nodes. Table 4 shows the size of each Strongly Regular family from the dataset. Table 4. Sizes of Strongly Regular Families (Bouritsas et al., 2022) Familty Number of Graphs (16,6,2,2) (25,12,5,6) (26,10,3,4) (28,12,6,4) (29,14,6,7) (35,16,6,8) (35,18,9,9) (36,14,4,6) (40,12,2,4) 41 3854 227 180 15 28 10 4 2 ZINC. The ZINC dataset is a molecular graph dataset composed of ∼ 250K molecules. The regression criterion is a molecular property known as the constrained solubility. Each molecule has both node features and edge features. Node features represent the type of heavy atoms (4 types) and edge features the type of bonds between them (28). The average number of nodes in a graph is 23.15 and the number of edges is 49.8. There are two versions of the dataset used for learning: ZINC 12K which has train/val/test split of 10000/1000/1000 and ZINC-full with a 2200011/24445/5000 split. Both data splits can be obtained from (Fey & Lenssen, 2019) Alchemy. Alchemy is also a molecular graph dataset composoed of 12000 graphs (10000/1000/1000 split taken from (Lim et al., 2022)). The average number of nodes is 10.1 and the number of edges is 20.9. The Regression target in this dataset is a 12-dimensional vector composed of a collection molecular properties : dipole moment, polarizability, HOMO, LUMO, gap, R2, zero point energy, internal energy, internal energy at 298.15K, enthalpy at 298.15K , free energy at 298.15K and heat capacity at 298.15K. Each graph has node features (6-dimensional atom type indicator) and edge features (4-dimensional bond type indicator). A.2. Training Protocol ZINC. For the ZINC and ZINC-full experiments we followed the training protocol from (Dwivedi et al., 2020). The protocol includes parameter budget (500K), predefined 4 random seeds and a learning rate decay scheme that reduces the rate based on the validation error (factor 0.5 and patience factor of 10 epochs). Initial learning rate was set to 0.002 and training stopped when reached 10−5. Batch size was set to 128. Test error at last epoch was reported. When using polynomial features, we removed the polynomials that had no response over the dataset. Namely, let f : Rn2 be an equivariant polynomial and X = {X} be a graph dataset. f does not have a response over X if ∀X ∈ X , f (X) = 0. Similarly to (Barcel ́o et al., 2021) we normalized the additional features to have a unit norm. For PPGN++ we used 1/1 of the edge based 5-degree polynomials and 8/11 of the 6-degree polynomials. For GatedGCN we used 2/2 of the node based 3-degree polynomials, 6/6 of the 4-degree polynomials, 23/23 of the 5-degree polynomials and 83/85 of the 6-degree polynomials. models were trained using the LAMB optimizer (You et al., 2019) on a single Nvidia V-100 GPU. The models were trained using the PyTorch framework (Paszke et al., 2019). → Rn2 Alchemy. We followed the training protocol from (Lim et al., 2022). The protocol includes averaging results on 5 random seeds and learning rate decay scheme that reduces the rate based on the validation error (factor 0.5 and patience factor of 20 epochs). Initial learning rate was set to 10−3 and training stopped when reached 10−5. Batch size was set to 128. Test error at last epoch was reported. When using polynomial features, we removed the polynomials that had no response over the dataset and normalized them in the same way as in the ZINC experiment. For PPGN++ we used 1/1 of the edge based 5-degree polynomials and 8/11 of the 6-degree polynomials. models were trained using the LAMB optimizer (You et al., 2019) on a single Nvidia V-100 GPU. The models were trained using the PyTorch framework (Paszke et al., 2019). A.3. Architectures GatedGCN. We used the model as it defined in (Bresson & Laurent, 2017) and implemented in (Lim et al., 2022). For the ZINC 12K experiment we to used a 16-layer model (same baseline as used in (Lim et al., 2022)) with feature dimension of size 77 for the baseline model and 75 for the models with polynomial features. For the SR dataset we used a 4-layer network with hidden dimension size of 150. The polynomial features were added to the initial input node features via concatenation. 14 Equivariant Polynomials for Graph Neural Networks PPGN++. The PPGN++ architecture is based on the PPGN architecture (Maron et al., 2019). The original PPGN layer is defined by the following equation: Z(k+1) = m3 (cid:104) m1(Z(k)) ⊛ m2(Z(k)), Z(k)(cid:105) For Z ∈ Rn2×d. While this layer definition cannot approximate all C ∈ B from Fe, it is possible to naively incorporate all the linear and constant basis (Maron et al., 2018) to obtain full approximation power. As mentioned in Section 3.2 we suggest to add this expressiveness to the layer in a more compact manner: where Z(k+1) = ̄m3 (cid:104) ̄m1 (cid:104) Z(k), Z(k)T (cid:105) ⊛ ̄m2(Z(k)), Z(k)(cid:105) (cid:16) ̄mi = ̄mdiag i , ̄moff-diag i (cid:17) , defines a separate MLP for diagonal elements and off-diagonal elements. In practice, we implement this separation by adding an identity matrix as additional feature before applying an MLP on the tensor's features. For the ZINC 12K experiment we used a 8-layer network with hidden dimension size of 95. For ZINC-full and Alchemy we used a 6-layer network with hidden dimension size of 110. We ran parameter search over the number of layers L ∈ {4, 6, 8} and hidden dimension size h ∈ {95, 110, 130} while maintaining the 500K parameter budget. For the SR experiment we used a 4-layer network with hidden dimension of size 75. The polynomial features were added to the initial input features via concatenation. A.4. Timing Table 5 shows a runtime comparison between the preprocessing require to compute polynomial features and training a PPGN++ (6) model on the ZINC 12K dataset. The time it takes to compute polynomials of degree 7 is non-negligible and most likely that for higher degrees (or in cases of larger graphs) the runtime will be longer and intractable from some degree. However, for SOTA results which we report in Section 5 we only use up to 6 degree polynomial features and the added time used for computing those features is equivalent to only 3 training epochs. Moreover, comparing the running time of other methods puts in perspective the computational time required for computing polynomial features. SetGNN (Zhao et al., 2022) reports that the epoch running of their best ZINC model (0.075 compared to 0.071 of PPGN++ (6)) is around 25 seconds. In addition GraphGPS (Ramp ́aˇsek et al., 2023), a state of the art Graph Transformer (test error of 0.07 on the ZINC dataset), takes ∼ 11.7 hours to train. Table 5. Runtime comparison on ZINC 12K: preprocessing vs. training. finding all Fe non-computable polynomials up to degree 7. compute all 5 degree polynomial features for the entire ZINC 12K dataset. compute all 6 degree polynomial features for the entire ZINC 12K dataset. compute all 7 degree polynomial features for the entire ZINC 12K dataset. Average runtime of training PPGN++ (6) on ZINC 12K Time (Seconds) 5 10 23 310 4110 (15.5 per epoch) B. Proof of Theorem 2.1. General definitions and setup. We denote an input graph data points represented by X ∈ Rn2 space of all polynomials P : Rn2 by P = Rn2 of polynomials with indeterminate X11, . . . , Xnn. The space of polynomials P is spanned by the monomial basis . We denote by the vector ⊗ R[X], where ⊗ is the tensor product and R[X] denotes the module → Rn2 M (X) = δa,b ⊗ n (cid:89) r,s=1 XAr,s r,s (11) where A ∈ Nn2 0 , N0 = {0, 1, . . .}, and δa,b ∈ Rn2 is a matrix satisfying δa,b i,j = (cid:40) 1 0 if a = i,b=j o/w 15 Equivariant Polynomials for Graph Neural Networks That is δa,b, a, b ∈ [n] is a basis for Rn2 . The degree of a polynomial is the maximal degree of its monomials defined by deg M (X) = n (cid:88) r,s=1 Ar,s (12) We denote by Pd the space of all polynomials of degree at most d. Enumerating monomials with multi-graphs H. Next, we define H = (V, E, (a, b)) to be a multi-graph with node set V = [n], and edge multiset defined by the matrix A, that is (r, s) appears k ∈ N0 times in E iff Ar,s = k. Lastly (a, b) is the red edge. We can therefore identify monomials with multi-graphs H, i.e., MH = M, (13) where M is defined in equation 11. Action of permutations Sn on polynomials. We consider the group of permutations Sn that consists of bijections g : [n] → [n]. The action of Sn on a matrix X is defined in the standard way in equation 2, i.e., (g * X)i,j = Xg−1(i),g−1(j) (14) where the inverse is used to make this a left action. We define PSn to be the space of permutation equivariant polynomials, namely P ∈ P that satisfy g * P (X) = P (g * X) for all g ∈ Sn and X ∈ Rn2 via the symmetrization (Reynolds) operators: . A standard method of projecting a polynomial in P onto the equivariant polynomials PSn is ̄P (X) = (cid:88) g∈Sn g * P (g−1 * X) (15) Let us verify that indeed ̄P ∈ PSn : ̄P (h * X) = = = (cid:88) g∈Sn (cid:88) g∈Sn (cid:88) g * P (g−1 * (h * X)) g * P ((h−1g)−1 * X) hg * P (g−1 * X) g∈Sn = h * ̄P (X) 16 Equivariant Polynomials for Graph Neural Networks Symmetrization of monomials. The key part of the proof is computing the symmetrization of the monomial basis MH via the symmetrization operator: QH (X)i,j = = = (cid:88) g∈Sn (cid:88) g∈Sn (cid:88) g∈Sn (cid:88) = g∈Sn (cid:88) = g∈Sn (cid:88) g∈Sn (cid:88) g∈Sn = = (cid:2)g * MH (g−1 * X)(cid:3) i,j (cid:2)MH (g−1 * X)(cid:3) g−1(i),g−1(j) (cid:34) (cid:34) (cid:34) n (cid:89) δa,b ⊗ (g−1 * X)Ar,s r,s (cid:35) r,s=1 n (cid:89) r,s=1 n (cid:89) r,s=1 δa,b ⊗ δa,b ⊗ g−1(i),g−1(j) (cid:35) XAr,s g(r),g(s) g−1(i),g−1(j) (cid:35) Ag−1(r),g−1(s) r,s X g−1(i),g−1(j) δa,b g−1(i),g−1(j) n (cid:89) r,s=1 Ag−1(r),g−1 (s) r,s X δg(a),g(b) i,j n (cid:89) r,s=1 Ag−1(r),g−1 (s) r,s X where in the second and fourth equality we used the action definition (equation 23), in the fifth equality we re-enumerated (r, s) ∈ [n] × [n] with (r′, s′) = (g(r), g(s)), and the last equality uses the fact that a = g−1(i) and b = g−1(j) iff g(a) = i and g(b) = j. Now let us define the action of Sn on the multi-graph H, also in a natural manner: g * H is the multi-graph that results from relabeling each node i ∈ [n] in H as g(i) ∈ [n]. The multi-graph g * H is isomorphic to H and (r, s) ∈ E with multiplicity l iff (g(r), g(s)) ∈ g * E with multiplicity l. If we let A be the adjacency matrix of H then g * A (defined via equation 23) is the adjacency of g * H, i.e., (g * A)i,j = Ag−1(i),g−1(j). Furthermore, the red edge in g * H is (g(a), g(b)). With these definitions, the above equation takes the form QH (X) = (cid:88) g∈Sn Mg*H (X) (16) Equation 16 is the key to the proof. It shows that QH is a sum over all monomials corresponding to the orbit of H under node relabeling g, therefore, any two isomorphic multi-graphs H ∼= H ′ would correspond to the same equivariant polynomials QH = QH ′. Differently put, in contrast to MH that are enumerated by labeled multi-graphs H, QH are enumerated by non-isomorphic multi-graphs H. Note that if H has isolated nodes (i.e., not touching any edge), these can be discarded without changing QH , so for degree d polynomials we really just need to consider graphs with d edges and a single red edge with no isolated nodes, so the maximal number of nodes is at most min {2d + 2, n}. We next show that {QH }, corresponding to all non-isomorphic H with up to d edges, is a basis for Pd. First, we claim it spans Pd. Indeed, since every polynomial P ∈ Pd can be written as a linear combination of monomials MH , P = (cid:80) k ckMHk (X). Now, P (X) = ̄P (X) = ck ̄MHk (X) = (cid:88) k (cid:88) k ckQHk (X) where in the first equality we used the fact that the symmetrization operator fixes P , i.e., ̄P = P , and in the second equality the fact that the symmetrization operator is linear. Next, we claim that {QH } for non-isomorphic H is an independent set. This is true since each QH is a sum over the orbit of H, {g * H|g ∈ Sn}, and the orbits are disjoint sets. Therefore, since the set of all monomials, MH , is independent, also {QH } is independent. 17 Equivariant Polynomials for Graph Neural Networks Formula for QH . We found that QH is a basis for the equivariant graph polynomials Pd. Let us write down an explicit formula for it next. The (ia, ib) entry of QH (X) takes the form n (cid:89) r,s=1 (cid:89) δg(a),g(b) ia,ib δg(a),g(b) ia,ib XAr,s g(r)g(s) Xg(r)g(s) (cid:88) g∈Sn (cid:88) g∈Sn QH (X)ia,ib = = = (cid:88) (r,s)∈E (cid:89) Xjr,js (17) j1̸=***̸=jm∈[n] ja=ia,jb=ib (r,s)∈E where in the third equality we denote j1 = g(1), j2 = g(2), . . . , jm = g(m), and j1 ̸= * * * ̸= jm ∈ [n] stands for all assignments of different indices j1, . . . , jm ∈ [n]. Note that QH is proved a basis but is still different from PH in equation 4 in that it does not sum over repeated indices. The fact that allowing repeated indices is still a basis is proved next. This seemingly small change of basis is crucial for our tensor network connection and analysis in the paper. PH is a basis. We now prove that PH defined in equation 4 is a basis. For convenience we repeat it below: PH (X)ia,ib = (cid:88) (cid:89) Xjr,js j1,...,jm∈[n] ja=ia,jb=ia (r,s)∈E (18) Denote by Hm the set of all multigraphs H = (V, E, (a, b)) with |V | ≤ m. Since the cardinality of {PH }H∈Hm that of {QH }H∈Hm The proof follows an induction on m. For the base m = 1 consider all multigraphs H = (V, E, (a, a)), where V = {a}. In this case both equation 17 and equation 18 have vacant sums and it is enough to show that {PH }H∈Hm spans the same space as {QH }H∈Hm is at most . PH (X)ia,ia = (cid:89) (r,s)∈E Xir,is = QH (X)ia,ia , where for all (r, s) ∈ E we have r, s ∈ {a}. Now, for m ≥ 2, assume and consider an arbitrary H ∈ Hm \ Hm−1. span {PH }H∈Hm−1 = span {QH }H∈Hm−1 If m = 2, and a ̸= b, then H = (V, E, (a, b)), and V = {a, b}. In this case again both equation 17 and equation 18 have vacant sums and PH (X)ia,ib = Xir,is = QH (X)ia,ib , (cid:89) where for all (r, s) ∈ E we have r, s ∈ {a, b}. (r,s)∈E In all other cases, consider the space of tuples [n]m = {(j1, . . . , jm)|ji ∈ [n], i ∈ [m]}, and the action of Sn on this collection via g * (j1, . . . , jm) = (g(j1), . . . , g(jm)). The orbits, denoted o1, . . . , oB correspond to equality patterns of indices, and B = Bell(m), the Bell number of m. By convention we define o1 to be the orbit o1 = [(1, 2, . . . , m)] where we use the orbit notation [(j1, . . . , jm)] = {(g(j1), . . . , g(jm))|g ∈ Sn}. Now, we decompose the index set {(j1, . . . , jm) ∈ [n]m|ja = ia, jb = ib} to disjoint index sets by intersecting it with ol, l ∈ [B]. Note that some of these 18 index sets may be empty; we let cl = 1 in case this index set is not empty, and cl = 0 otherwise. Equivariant Polynomials for Graph Neural Networks PH (X)ia,ib = B (cid:88) l=1 (cid:88) (cid:89) Xjr,js (j1,...,jm)∈[n]m∩ol ja=ia,jb=ib (r,s)∈E (cid:88) = j1̸=...̸=jm ja=ia,jb=ib (cid:89) (r,s)∈E Xjr,js + B (cid:88) l=2 (cid:88) (cid:89) Xjr,js (j1,...,jm)∈[n]m∩ol ja=ia,jb=ib (r,s)∈E = QH (X)ia,ib + B (cid:88) l=2 (cid:88) (cid:89) Xjr,js (j1,...,jm)∈[n]m∩ol ja=ia,jb=ib (r,s)∈E For l ≥ 2 consider the polynomial (cid:88) (cid:89) Xjr,js (j1,...,jm)∈[n]m∩ol ja=ia,jb=ib (r,s)∈E In case cl = 1, this polynomial corresponds to QHl(X)ia,ib , where we denote by Hl = (Vl, El, (a, b)) the multigraph that results from unifying nodes in H that correspond to equal indices in ol. We therefore have PH (X)ia,ib = QH (X)ia,ib + B (cid:88) l=2 clQHl(X)ia,ib Since for all l ≥ 2 there is at-least one pair of equal indices in ok, |Vl| ≤ m − 1. We can therefore use the induction assumption and express these polynomials using polynomials in {PH }H∈Hm−1 . This shows that QH can be spanned by . Since H ∈ Hm \ Hm−1 was arbitrary this shows that all QH ∈ Hm \ Hm−1 can be spanned by elements in {PH }H∈Hm . Now using the induction assumption again and the fact that Hm−1 ⊂ Hm we get that {PH }H∈Hm span {Qh}H∈Hm ⊂ span {Ph}H∈Hm as required. C. Proof of Theorem 3.5 Theorem 3.5. Let H be some multi-graph and FB ∈ {Fn, Fe}. Further, let H ′ be the multi-graph resulting after contracting a single node in H using one or more operations from B to H. Then, H is F-computable iff H ′ is F-computable. Proof. We will use Lemma 3.4 and two auxiliary lemmas: Lemma C.1. All the tensor contractions used in Fn and Fe only affect the 1-ring neighborhood of the contracted node. Lemma C.2. Assumption (I) for Hk and H ′ k imply that the k-th node can be contracted from H ′ k. For conciseness we will use F = FB to denote a graph model. If H ′ is F computable then there exists a sequence of contractions Ci1, Ci2 , ..., Cik ∈ F that contracts H ′ to the red edge. Then C, Ci1 , Ci2, ..., Cik is a sequence contracting H to the red edge. Therefore H is computable with F. The other direction is more challenging. We assume H is computable with F and need to prove H ′ is computable with F. H = (V = [m], E, (a, b)) has some sequence of tensor contraction contracting all vertices in H until only a and b are left (a and b could be the same node). Without losing generality a ≤ b, and we assume the order of the node contraction from H is 1, 2, . . . , a − 1. We will say that nodes i, j ∈ [m] are neighbors (in H) if they share an edge. A key property we use is proved in Lemma 3.4 that shows that using contractions from B, we can always contract a node if it has at-most 1 and 2 neighbors for Fn and Fe, respectively. We have that H ′ = (V ′, E′, (a, b)) resulted from H by contracting a single node using contractions in F. Therefore |V ′| = m − 1, and we let c be the contracted node. Since c is contracted then necessarily c ̸= a, b. Therefore c belongs to 19 Equivariant Polynomials for Graph Neural Networks the H contraction series, and in our notation that means c < a. Now we will use the series 1, 2, . . . , ̄c, . . . , a − 1 (a bar indicates a missing index) as a node contraction series for H ′. What we need to prove is that this is indeed a series of node contractions that can be implemented with tensor contractions from B. To show that we will prove by induction the following claim. We will compare the two node contraction sequences: H : 1, 2, . . . , c − 1, c, c + 1, . . . , a − 1 H ′ : 1, 2, . . . , c − 1, ∅, c + 1, . . . , a − 1 where ∅ means no node contraction done. We enumerate these steps using k = 1, . . . , a. We denote by Hk and H ′ corresponding graphs before performing the k-th contraction. So H1 = H, and H ′ the k-th step: k the 1 = H ′. We claim the following holds at (I) Any pair of nodes i, j where at-least one node is not c or a neighbor of c satisfy: i, j are neighbors in HK iff they are neighbors in H ′ k Where we define the 1-ring of a node c to be the set of nodes that includes: c and all the nodes that share an edge with c. Before proving this by induction we note that if the induction hypothesis holds at the k-th step then the k-th node can be contracted from H ′ using operations from B, see Lemma C.2. Base case, k = 1: For k = 1 we compare the original H and H ′. Consider two nodes i, j not in the 1-ring of c in H. Lemma C.1 asserts that contraction of a node only affect its immediate neighbors. Therefore any edge/no edge between i and j will be identical in H and H ′. Induction step: We assume by the induction assumption that the Hk−1, H ′ k−1 satisfy (I) and prove it for Hk, H ′ k. Consider the node k − 1 that was contracted at the k − 1 stage. Let {d, e} be its neighbor set in Hk−1 (could be empty, with a single node, or at-most two nodes). There are three cases: (i) k − 1 = c, (ii) k − 1 is a neighbor of c in Hk−1 (i.e., k − 1 ∈ {d, e}), and (iii) k − 1 is not in the 1-ring of c in Hk−1 (i.e., k − 1 /∈ {c, e, d}). In case (i), its contraction will only affect its 1-ring in Hk−1 (see Lemma C.1), and in H ′ Therefore assumption (I) can be carried to Hk and H ′ k. k−1 no contraction will happen. In case (ii), k − 1 is a neighbor of c in Hk−1. Since the contraction of k − 1 only affects its 1-ring in Hk−1 (according to Lemma C.1) and the 1-ring of k − 1 in Hk−1 is included, aside of k − 1, in the 1-ring of c at Hk. Therefore the neighboring relations in Hk and H ′ k−1 now implies the assumption holds for Hk and H ′ k outside the 1-ring of c in Hk do not change. The induction assumption (I) on Hk−1 and H ′ k . In case (iii), k − 1 is not in the 1-ring of c in Hk−1. Then Lemma C.1 implies that the 1-ring of c in Hk will not change and the neighborhood changes in the 1-ring of k − 1 will be identical to Hk and H ′ k due to induction assumption (I). Lemma 3.4. Fn (for simple graphs) and Fe (for general graphs) can always contract a node in H iff its number of neighbors is at-most 1 and 2, respectively. Proof. We start with Fn: We will use contraction notations from the contraction banks presented in Figure 7, left. For simple graphs H is simple (see Section 2.1), and therefore does not have parallel edges. Applications of contractions from the bank of Fn cannot introduce parallel edges and therefore any two neighbors in the graph will share a single edge. Furthermore, using C2 we can always reduce the number of self-loops generated during the tensor computation path to 1. Lastly, any node, with or without a single self-loop, and with at-most 1 neighbor is connected to it with at-most a single edge, and therefore C3 or C4 will be able to contract it. For Fe: We will use contraction notations from the contraction bank in Figure 7, right. First note that any number of self-loops and parallel edges can be reduced to 1 using C2 and C6, respectively. Now if a node with a single self-loop has no neighbors in H then is can be contracted with C1. Now in the case a node i has 1 or 2 neighbors in H we can cancel its self-loop (if it has one) as follows. Let j denote one of its neighbors. Then we first apply C5 between i (top) and j (bottom), then we apply C6 if necessary to make the existing edge between i, j directing towards j, and lastly apply C6 to have a single edge between i and j. 20 Equivariant Polynomials for Graph Neural Networks Lets recap: we have now a node i, without self-loops, with a single edge going to its 1 or 2 neighbors. We can change the direction of these edges by applying C6, if required. Now, we can use C3 or C7 to contract node i. In the other direction if the number of neighbors is greater than 1 for Fn and 2 for Fe then inspection of the respective contraction banks shows that edges cannot be completely removed between nodes without contraction and no contraction operators for nodes with valence 2 and 3 exists for Fn and Fe, respectively. Lemma C.1. All the tensor contractions used in Fn and Fe only affect the 1-ring neighborhood of the contracted node. Proof. Inspection of the tensor contraction banks of Fn and Fe (see Figure 7, contracted nodes are in gray) shows that any contraction of a node can introduce new edges in its 1-ring but does not affect neighboring relation outside the 1-ring. Lemma C.2. Assumption (I) for Hk and H ′ k imply that the k-th node can be contracted from H ′ k. Proof. Indeed, there are 3 options for the k-th node: (i) k = c, (ii) k is a neighbor of c in Hk, and (iii) k is not in the 1-ring of c in Hk. Since k can be contracted from Hk by definition, Lemma 3.4 imply that we only need to show that k has at-most the same number of neighbors in H ′ k in order to prove the lemma. We show that next. In case (i): since k = c no contraction is to take place in H ′ of k in H ′ k is at most that in Hk. In case (iii): Hypothesis (I) implies that k has the same neighbors in Hk and H ′ k. k. In case (ii): hypothesis (I) imply that the number of neighbors D. Proof of Theorem 3.7 To prove Theorem 3.7 it is enough to show that MPNN and PPGN++ can approximate any polynomial computable by the matching Prototypical models, namely node based Fn and edge based Fe. We show that in the following theorem: Theorem D.1. For any compact input domain, PPGN++ and MPNN can arbitrarily approximate any polynomial computable by the Prototypical graph models Fe and Fn, respectively. Proof. The proof of this theorem has two parts. First, we will show that for ε > 0, a single layer of PPGN++ and MPNN can approximate any contraction operation C ∈ B of the corresponding graph model. The second part will show that a composition of those layers can approximate any finite sequence f ∈ FB, i.e any polynomial computable by FB. Part I. Let Ω ⊂ Rn×d be an arbitrary compact set and Yi ∈ Rn be the ith column of Y ∈ Ω. Consider C ∈ Bn, the tensor contraction bank of Fn. We will show that a single layer of MPNN (eq 9) can approximate C. To do so we will write the operations explicitly and verify that a MPNN layer can approximate them: • C1 → Y(k+1) j = 11T Y(k) i . • C2 → Y(k+1) l = Y(k) i ⊙ Y(k) j where ⊙ is element-wise product. • C3 → Y(k+1) j = X1. • C4 → Y(k+1) j = XY(k) i . In order for MPNN approximate the mentioned functions we need to argue that m can approximate several functions. We assume that simple functions, such as constant functions and feature retrieving, can be computed exactly for m. To justify approximation of element-wise product we use the universal approximation theorem (Hornik, 1991): Theorem D.2. The set of one hidden layer MLPs with a continuous σ, i.e, M (σ) = span (cid:8)σ(wT x + b)|w ∈ Rn, b ∈ R(cid:9) is dense in C(Rn) in the topology of uniform convergence over compact sets if and only if σ is not a polynomial. In the next case we set Ω ⊂ Rn2×d be an arbitrary compact set (Zi ∈ Rn2 PPGN++ (eq 10) and C ∈ B of Fe: for Z ∈ Ω). We repeat the same process for 21 Equivariant Polynomials for Graph Neural Networks Figure 11. The number of graph invariant and equivariant polynomials scales exponentially with the degree of the polynomial. Here, we count the number of polynomials in the asymptotic limit of graphs of n → ∞ nodes. Graphs with a fixed number of nodes will have fewer invariant polynomials. See Appendix I for further details on the generating functions and explicit counts. • C1 → Z(k+1) j = 11T (diag(Z(k) i )11T ). • C2 → Z(k+1) l = diag(Z(k) i * Z(k) j ). • C3 → Z(k+1) j = diag(11T Z(k) i ). • C4 → Z(k+1) j = diag(Z(k) i )11T . • C5 → Z(k+1) l = Z(k) i * Z(k) j . • C6 → Z(k+1) j = Z(k)T i . • C7 → Z(k+1) l = Z(k) i Z(k) j . Here the only addition is the diag function, which given a matrix returns a diagonal matrix with the matrix diagonal. This could computed using ̄mi since it computes different functions for the diagonal and off-diagonal elements. Part II. This part of the proof will show that any sequence f ∈ Fe (or ∈ Fn), namely a polynomial computable by this graph model, can be approximated by a composition of PPGN++ (or MPNN) layers. To prove that we can use Lemma 6 from (Lim et al., 2022) that states the following: Lemma D.3 (Layer-wise universality implies universality). Let Z ⊆ Rd0 be a compact domain, let F1, * * * , FL be a families of continuous functinos where Fi consists of functions from Rdi−1 → Rdi for some d1, * * * , dL. Let F be a family of functions (cid:8)fL ◦ * * * ◦ f1 : Z → RdL, fi ∈ Fi For each i, let Φi, be a family of continuous functions that universally approximates Fi. Then the family of compositions {φL ◦ * * * ◦ φ1 : φi ∈ Φi} universally approximates F. (cid:9) that are compositions of functions fi ∈ Fi. Based on the first part proof, using this lemma while pluging in B as Fi for every i and the corresponding GNN layer as Φi (also for every i) shows that PPGN++ and MPNN are universal approximators for Fe and Fn, respectively. E. Proof of Proposition 3.8 Let f : Rn2×d → Rn2×d′ be a PPGN block, defined by the following equation (as portrayed in (Maron et al., 2019)): Z(k+1) = ̄m3 (cid:104) ̄m1(Z(k)) ⊛ ̄m2(Z(k)), Z(k)(cid:105) . (19) 22 02468degree101103105107number of polynomialsInvariantEquivariant Equivariant Polynomials for Graph Neural Networks Also, let Z = (cid:21) (cid:20)a a b b a, b ∈ R to be an input tensor. A PPGN network (composition of PPGN blocks) cannot approximate the transpose operator PH (Z) = ZT due to the fact that the PPGN block maintains the row structure of Z, i.e f (Z)i = (cid:21) (cid:20)x x y y x, y ∈ R, when f (Z)i ∈ Rn2 (for i ∈ [d′]) denotes the ith slice of f (Z) along the last dimension. This holds since each PPGN block is composed of Siamese element-wise operations and matrix multiplications which preserve this structure. a simple induction can generalize this claim for a composition of blocks while the extension for larger size graphs is also trivial. F. Equivariant Polynomials of Attributed Graphs Repeating the derivations in Appendix B for the case of equivariant polynomials of attributed graphs, P : Rn2×f → Rn2 , suggests that we should enumerate each QH and PH with a multi-graph H = (V, E, (a, b)), where there are also f types of edges types (e.g., colors); we denote by (r, s; k) ∈ E an edge (r, s) with type k ∈ [f ]. This gives the formulas QH (X)ia,ib = (cid:88) (cid:89) Xjr,js,k PH (X)ia,ib = j1̸=...̸=jm∈[n] ja=ia,jb=ib (cid:88) (r,s;k)∈E (cid:89) Xjr,js,k j1,...jm∈[n] ja=ia,jb=ib (r,s;k)∈E (20) (21) where the degree of PH , QH is the total number of edges of all types, counting multiplicities. The basis {QH } (and consequently {PH }) for equivariant polynomials in this case is achieved by considering all non-isomorphic H (comparing both edge types and multiplicity) with total number of edges up to f . )Sn , where R[Rn2×f ] is Equivariant maps Rn2×f → Rn2 the polynomial ring on the vector space Rn2×f . Similarly to the proof in Appendix B, via the Reynolds operator applied to monomials in variables Xijk, we obtain orbits which as before, correspond to unique subgraphs. For a given monomial, if the variable Xijk is contained in that monomial, then we add an edge between i to j and color that edge according to the index k. The k-index remains invariant under the group operation and is not permuted by the group action. are isomorphically equivalent to the module (R[Rn2×f ] × Rn2 To continue the graphical notation, we label this basis by labeling its orbits according to the monomials that appear. We pick a given monomial in the orbit and then for each variable in that monomial, we add an edge with the appropriate color. As before, the equivariant output dimension is colored red, but we make such an edge dotted to more clearly differentiate it with other edges. In this expanded graphical notation, we provide two examples below: The proof that the above forms a basis follows directly from the proof in Appendix B. We follow the basic steps below. We denote by the vector space of all polynomials P : Rn2×f → Rn2 by P = Rn2×f ⊗ R[X], where ⊗ is the tensor product and R[X] denotes the module of polynomials with indeterminate X11, . . . , Xnn. The space of polynomials P is now spanned by the expanded monomial basis M (X) = δa,b ⊗ n (cid:89) f (cid:89) r,s=1 k=1 XAr,s,k r,s,k (22) where A ∈ Nn2×f 0 , N0 = {0, 1, . . .}, and δa,b ∈ Rn2 is a matrix satisfying δa,b i,j = (cid:40) 1 0 if a = i, b = j o/w 23 Permuations now only act on the first two indices, i.e., Equivariant Polynomials for Graph Neural Networks (g * X)i,j,k = Xg−1(i),g−1(j),k. (23) Given the last index is invariant to permutations, symmetrization of monomials continues as before where we add the feature dimension: QH (X)i,j = (cid:2)g * MH (g−1 * X)(cid:3) i,j (cid:88) g∈Sn (cid:88) = δg(a),g(b) i,j n (cid:89) f (cid:89) X Ag−1(r),g−1(s),k r,s,k . g∈Sn r,s=1 k=1 QH is a sum over all monomials corresponding to the orbit of H under node relabeling g. This forms an equivalence class over orbits of H (i.e., two graphs H and H ′ are in the same class if they can be obtained from one another via permutations). Since every polynomial is a sum over monomials, symmetrization over these monomials implies each symmetrization falls into one of these orbits. Therefore, similar to the proof as before, the multigraphs H compose the set of equivariant polynomials. F.1. Equivariant set polynomials As a note, we show here via an example how to form set polynomials from the structure described before. In correspondence with the equivariant polynomials on sets (Rn×d → Rn), Segol & Lipman (2019) proved any polynomial in this setting takes the following form: Theorem F.1 (Theorem 2 of (Segol & Lipman, 2019), paraphrased). Any equivariant map on sets Rn×d → Rn can be generated by polynomials of the form P (X) = bαqα,j(s1, . . . , st), (24) (cid:88) where bα = [xα possible such polynomials up to degree d, and qα,j(s1, . . . , st) is a polynomial in its power sum polynomial inputs. are the power sum symmetric polynomials indexed by j ∈ 1 , . . . , xα n ]⊤, sj(X) = (cid:80)n i=1 xαj i (cid:104)(cid:0)n+d d (cid:1)(cid:105) |α|≤n In our graphical language, set polynomials correspond to graphs with only multi-edges that are self loops. To recover the above theorem in our graphical notation, we consider each element in the sum above. We identify a given bα with the self loops on the equivariant edge with the dotted line. The polynomial qα,j is identified with the polynomial on the rest of the nodes, e.g. let us consider the below graph. (25) As before, for colors indexed by index zero (orange), index one (green), and index two (blue), the above corresponds to the polynomial P (X) =           X1,2 X2,2 ... Xn,2  *  n (cid:88) i,j=1  Xi,0Xj,1  . (26) By inspection, one can see that the above is of the form as stated in (Segol & Lipman, 2019), i.e. choose qα,j = ((cid:80)n ) only for α = [0, 0, 1] and qα,j = 0 otherwise. )((cid:80)n i=1 x[1,0,0] i i=1 x[0,1,0] i G. Relationship between Equivariant Polynomials, Homomorphisms, and Subgraph Counting There is a close correspondence between homomorphism counts, subgraph counts, and the evaluation of our polynomials on binary graphs X, meaning directed graphs with self-loops but no multiedges, i.e. those graphs with adjacency in 24 Equivariant Polynomials for Graph Neural Networks {0, 1}n×n. For binary graphs H and X, a homomorphism is a function φ : V (H) → V (X) such that if (r, s) ∈ E(H), then (φ(r), φ(s)) ∈ E(X). An isomorphism is a bijective homomorphism whose inverse is also a homomorphism. We let hom(H, X) denote the number of homomorphisms from H to X. We let inj(H, X) denote the number of injective homomorphisms from H to X. The injective homomorphism number is closely related to subgraph counts. If we let count(H, X) denote the number of subgraphs isomorphic to H, and let Aut(H) denote the automorphism group of H (i.e. the set of isomorphisms from H to H), then inj(H, X) = |Aut(H)| * count(H, X). The |Aut(H)| term is due to overcounting when H has symmetries. G.1. Invariant Polynomials and Standard Homomorphisms PH and standard homomorphisms. Let H and X be binary graphs. Then it can be seen that the homomorphism count hom(H, X) can be written as (Lov ́asz, 2012): hom(H, X) = (cid:88) (cid:89) Xφ(r),φ(s), φ:V (H)→V (X) (r,s)∈E(H) (27) where the sum ranges over all functions from V (H) to V (X). Choose an ordering 1, . . . , m of the nodes of V (H) and 1, . . . , n of the nodes of X; writing φ(l) = jl, we see that hom(H, X) is exactly equivalent to our (invariant) polynomial basis element PH : PH (X) = hom(H, X) = Xjr,js . (28) (cid:88) (cid:89) j1,...,jm∈[n] (r,s)∈E(H) If H has multiple edges, then let ̃H be the graph H with any multiple edges reduced to a single edge. If X is still a binary graph, it is easy to see that PH (X) = P ̃H (X), so in this case PH (X) = hom( ̃H, X). QH and injective homomorphisms / subgraph counts. Once again, let H and X be binary graphs. The injective homomorphism number can be written in a similar form to the homomorphism count (Lov ́asz, 2012): inj(H, X) = (cid:88) (cid:89) Xφ(r),φ(s). φ:V (H)→V (X) φ injective (r,s)∈E(H) (29) In this case, the sum ranges over all injective functions φ : V (H) → V (X). As in the non-injective case, we write jl = φ(l) for each l = 1, . . . , m. By injectivity j1 ̸= . . . ̸= jm. Thus, we have a corrspondence between inj(H, X) and our invariant basis polynomial QH : QH (X) = inj(H, X) = (cid:88) (cid:89) Xφ(r),φ(s) = |Aut(H)| * count(H, X). (30) j1̸=...̸=jm∈[n] (r,s)∈E(H) G.2. Equivariant Polynomials and Homomorphism Tensors Here, we consider our equivariant polynomials basis elements PH , QH : Rn2 . On binary graphs, this will also correspond to counts of homomorphisms, except now we have to restrict the homomorphisms to preserve the red edge in an equivariant way. Let (a, b) be the red edge of H, and consider any two nodes (possibly the same) ia, ib of X. Then we may define a tensor of homomorphism counts Hom(H, X) ∈ Rn2 , where Hom(H, X)ia,ib is the number of homomorphisms φ : V (H) → V (X) such that φ(a) = ia and φ(b) = ib. We define a tensor Inj(H, X) of injective homomorphism counts similarly. → Rn2 Following the arguments for the invariant case, it is easy to see that PH (X)ia,ib = Hom(H, X)ia,ib QH (X)ia,ib = Inj(H, X)ia,ib . (31) (32) Thus, this gives an interpretation of PH (X)ia,ib and QH (X)ia,ib , when H and X are binary graphs. We expand on this interpretation for QH in the next section. 25 Equivariant Polynomials for Graph Neural Networks H ̃H |Aut( ̃H)| = 2 QH (X)i,i = (cid:80) QH (X)3,3 = 4 QH (X)i,i = 0, i ̸= 3 j̸=k∈[n]\{i} Xi,jX2 i,kX2 j,k X 1 5 2 4 3 Figure 12. Relationship between QH and subgraph counts. The directed multigraph H (top left) has its multiedges turned to single edges to form ̃H (top right). The size of the automorphism group Aut( ̃H) is 2, as we may swap the bottom left and bottom right node while preserving the graph structure. QH (X)3,3 = 4 because node 3 participates in 2 subgraphs isomorphic to ̃H, and this subgraph count is scaled by |Aut( ̃H)| = 2 to get QH (X)3,3. G.3. QH as Subgraph Counts The basis QH can be interpreted as subgraph counts when the input is a simple binary graph X ∈ {0, 1}n2 . For any directed multigraph H with red edge (a, b), let ̃H denote the same graph H but where any multiple black edges are collapsed to just one black edge; the difference between H and ̃H is that if H has more than one black edge from node i to j, then ̃H only has one edge. Then we have that QH (X)ia,ib = |Aut( ̃H)| * count( ̃H, X, (ia, ib)), (33) where count( ̃H, X, (ia, ib)) is the number of subgraphs of X that are isomorphic to ̃H, after adding a red edge (ia, ib) to X and labelling edge (a, b) in ̃H as red. |Aut( ̃H)| is the size of the automorphism group of ̃H, which contains the automorphisms φ : V (H) → V (H) that have φ(a) = a and φ(b) = b. Now, suppose H has a red self loop (a, a), and let i be any node in X. We have that QH (X)ia,ia is equal to |Aut( ̃H)| multiplied by the number of subgraphs of X that are isomorphic to ̃H, where the isomorphism maps ia in X to a (the node with the self loop in H). Intuitively, this is proportional to the number of subgraphs isomorphic to ̃H that ia participates in as the designated red-self-loop node. See Figure 12 for an illustration. Derivation. Here, we derive the relationship between QH (X) and subgraph counts. First, we write out some definitions more precisely. Let Aut( ̃H) denote the automorphism group of ̃H. This is the set of permutations σ : V ( ̃H) → V ( ̃H) such that σ(a) = a, σ(b) = b, and (r, s) ∈ E( ̃H) if and only if (σ(r), σ(s)) ∈ E( ̃H). Further, let count( ̃H, X, (ia, ib)) denote the number of subgraphs of X isomorphic to ̃H, where the isomorphism maps a to ia and b to ib. In other words, it is the number of choices (V ′, E′) such that V ′ ⊆ V (X) and E′ ⊆ E(X) ∩ (V ′ × V ′) where there exists a bijection φ : V ( ̃H) → V ′ such that φ(a) = ia, φ(b) = ib, and (r, s) ∈ E( ̃H) if and only if (φ(r), φ(s)) ∈ E′. We call any such map φ a subgraph isomorphism, and we may also view it as an injective function V ( ̃H) → V (X). We will use the fact that for any subgraph isomorphism φ and any automorphism σ ∈ Aut( ̃H), the map φ ◦ σ : V ( ̃H) → V (X) is also a subgraph isomorphism. Let (V ′, E′) be the subgraph that φ maps to. To see that φ is a subgraph isomorphism, first note that φ ◦ σ is injective, φ ◦ σ(a) = φ(a) = ia, and φ ◦ σ(b) = φ(b) = ib. To see the edge preserving property, note that (r, s) ∈ E( ̃H) if and only if (σ(r), σ(s)) ∈ E( ̃H) since σ ∈ Aut( ̃H). Moreover, (σ(r), σ(s)) ∈ E( ̃H) if and only if (φ(σ(r)), φ(σ(s))) ∈ E′ since φ is a subgraph isomorphism. Thus, φ ◦ σ is a subgraph isomorphism. We now derive the formula for QH (X) in terms of subgraph counts: Proposition G.1. If X ∈ {0, 1}n2 , then Proof. Note that we can write QH (X)ia,ib = |Aut( ̃H)| * count( ̃H, X, (ia, ib)) QH (X)ia,ib = (cid:88) (cid:89) Xjr,js, j1̸=***̸=jm ja=ia,jb=ib (r,s)∈E( ̃H) 26 (34) (35) Equivariant Polynomials for Graph Neural Networks where we replace the product over E(H) with the product over E( ̃H), due to the assumption that X is binary. Further, note that the summand (cid:81) (r,s)∈E Xjr,js is either 0 or 1 for each setting of (j1, . . . , jm). We show that the number of nonzero terms of the sum in QH (X)ia,ib is equal to |Aut( ̃H)| * count( ̃H, X, (ia, ib)). Let (j1, . . . , jm) correspond to a nonzero term in the sum. Define φ : V (H) → V (X) by φ(i) = ji. Note that φ is injective since j1 ̸= . . . ̸= jm. Moreover, φ(a) = ja = ia and φ(b) = jb = ib. Now, define Vφ = {φ(i) : i ∈ V (H)}, Eφ = {(φ(r), φ(s)) : (r, s) ∈ E( ̃H)}. (36) (r,s)∈E( ̃H) Xjr,js = 1 implies that (φ(r), φ(s)) ∈ E(X) This is the vertex set and edge set of a subgraph in X, because (cid:81) for all (r, s) ∈ E( ̃H). Thus, φ corresponds to an isomorphism between ̃H and a subgraph of X. Suppose (j1, . . . , jm) ̸= ( ̃j1, . . . , ̃jm) are both indices corresponding to nonzero summands, with corresponding subgraph isomorphisms φ and ̃φ. Note that φ ̸= ̃φ, so each nonzero summand corresponds to a unique subgraph isomorphism φ. Hence, it suffices to show that the number of subgraph isomorphisms is |Aut( ̃H)| * count( ̃H, X, (ia, ib)). For each l ∈ {1, . . . , count( ̃H, X, (ia, ib))}, let Gl = (Vl, El) be a subgraph of X that is isomorphic to ̃H. Then choose a subgraph isomorphism φl : V (H) → V (X) associated to Gl. For this φl, as in our argument above we know that φl ◦ σ : V (H) → V (X) is a subgraph isomorphism for every σ ∈ Aut( ̃H). Thus, there are at least |Aut( ̃H)| * count( ̃H, X, (ia, ib)) subgraph isomorphisms φl ◦ σ. To show that there are at most |Aut( ̃H)| * count( ̃H, X, (ia, ib)) subgraph isomorphisms, assume for sake of contradiction that ψ : V (H) → V (X) is a subgraph isomorphism that is not of the form φl ◦ σ above. Denote the vertex set and If (Vψ, Eψ) ̸= (Vl, El) for each l, then we have edge set of the associated subgraph as Vψ and Eψ, respectively. the existence of count( ̃H, X, (ia, ib)) + 1 subgraphs in X isomorphic to ̃H, which contradicts the definition of count. Thus, (Vψ, Eψ) = (Vl, El) for some l. As φl and ψ are both bijective from V ( ̃H) → Vψ, there is a unique bijection σ : V ( ̃H) → V ( ̃H) such that φl = ψ ◦ σ. We will show that σ ∈ Aut( ̃H), which contradicts our definition of ψ. Note that σ(a) = a and σ(b) = b, because φl(a) = ψ(a) = ia and φl(b) = ψ(b) = ib. Now, suppose (r, s) ∈ E( ̃H). Since (ψ ◦ σ(r), ψ ◦ σ(s)) = (φ(r), φ(s)) ∈ Eφl = Eψ, we know that (σ(r), σ(s)) ∈ E( ̃H) as ψ is a subgraph isomorphism. On the other hand, if (σ(r), σ(s)) ∈ E( ̃H), then (φl(r), φl(s)) = (ψ ◦ σ(r), ψ ◦ σ(s)) ∈ Eψ since ψ is a subgraph isomorphism, so that (r, s) ∈ E( ̃H) because φl is a subgraph isomorphism. Thus, σ ∈ Aut( ̃H), and we are done. H. k-WL Equivalence C1 C2 C3 C4 C1 C2 C3 C4 C5 C6 C7 Figure 13. For convenience, we redraw our Prototypical graph models here. We show these the node-based model (left) is equivalent to 1-WL on simple graphs, and the edge-based model (right) is equivalent to 2-FWL / 3-WL on simple graphs. In this section, we demonstrate that our studied Prototypical graph models achieve 1-WL and 3-WL/2-FWL expressive power, thus showing that our framework can be used to design and analyze k-WL style models. The key connection comes from a result of Dvoˇr ́ak (2010); Dell et al. (2018), which states that k-FWL indistinguishability is equivalent to hom(H, X) indistinguishability for all H of tree-width at most k. Lemma H.1 (Dvoˇr ́ak (2010); Dell et al. (2018)). Two simple graphs X(1) and X(2) are k-FWL distinguishable if and only if there is a graph H of tree-width at most k such that hom(H, X(1)) ̸= hom(H, X(2)) 27 Equivariant Polynomials for Graph Neural Networks Recall from Appendix G that hom(H, X) is equal to the evaluation of the invariant polynomial PH (X) when X ∈ {0, 1}n×n. Thus, an Prototypical graph model can compute hom(H, X) if it can contract H into the trivial graph (that has zero nodes and zero edges) using contractions from its bank. Proposition H.2. The Prototypical node-based graph model can distinguish any two simple graphs if and only if 1-WL can. Proof. ( ⇐= ) Suppose 1-WL can distinguish two simple graphs X(1) and X(2). Then there is a graph H of tree-width 1 such that hom(H, X(1)) ̸= hom(H, X(2)). We will show that the node-based Prototypical model can contract H to the trivial graph. As H has tree-width 1, it is a forest or a tree. We can assume it is a tree as we can contract each tree connected component one by one if it is a forest. We will show that the node-based model can contract any tree T with or without self-loops. Suppose T consists of one node. If T has no self-loops, it is the constant polynomial, which is a trivial case. Otherwise, the node has at least one self-loop, and C1 and C2 can of course contract it the trivial graph. Now, suppose T consists of m ≥ 2 nodes. Then there is a leaf (a node that has degree 1 when we ignore self-loops). If this leaf does not have a self-loop, we can contract it to remove this node using C3. Otherwise, we can use C2 to remove any multiple self-loops (if needed), and then use C4 to remove the node once we are left with one self-loop. This gives a tree T ′ with at least one self-loop of m − 1 nodes, so T ′ can be contracted by induction. ( =⇒ ) Suppose 1-WL cannot distinguish the two simple graphs X(1) and X(2), so hom(H, X(1)) = hom(H, X(2)) for all H of tree-width 1. We show that the node-based contraction bank cannot contract any hom(H, X) for H of tree-width greater than 1. Suppose H has tree-width greater than 1, so it cannot be a forest or a tree. Hence, H must have a cycle. However, the node-based model cannot contract any graph that has a cycle; this is because if it could, then the first node of the cycle that is contracted would have had at least two different neighbors, but such a node cannot be contracted by C1, C2, C3 or C4. Hence, the node-based graph model cannot distinguish X(1) and X(2). Proposition H.3. The Prototypical edge-based graph model can distinguish any two simple graphs if and only if 2-FWL / 3-WL can. Proof. ( ⇐= ) Suppose 2-FWL can distinguish the two simple graphs X(1) and X(2), so there is a graph H of tree-width 2 such that hom(H, X(1)) ̸= hom(H, X(2)). We will show that the edge-based model can contract H. We can assume H is connected because otherwise we can separately contract each connected component. Moreover, we can assume that H has no self-loops or multiple edges. This is because if a node has a self-loop and it has no neighbors, then C2 and C1 can remove the node, and if it has neighbors then C4 can contract the self-loop and add an edge to a neighbor, thus forming a multiple edge. For multiple edges, C6 can align the direction of the edges between if necessary, and then C5 can remove the multiple edges. Since H has tree-width 2, we know it is a partial 2-tree. Thus, there is an ordering of the m vertices of H, say v1, . . . , vm, such that when deleting each vertex and all incident edges in turn, we only ever delete vertices of degree at most 2. We show that our edge-based Prototypical model can contract edges in this order by induction. For i ∈ [m], suppose we have deleted nodes v1, . . . , vi−1 (in the base case i = 1 we have not deleted any nodes), we are deleting vi, the current graph has no multiple edges, and the any self-loops in the current graph belong to nodes with no neighbors • If node vi has degree zero, then it can be contracted to a trivial graph by C1 and C2. • If node vi has degree one, then we use C3 to contract it, thus adding a self-loop to its neighbor. If its neighbor then has degree 0, then we do not need to remove self-loops for our induction. Otherwise, if its neighbor has nonzero degree, then we use C4, C6 (if necessary), and C5 to remove the self-loop of the neighbor, and remove any multiple edges. • If node vi has degree two, then we use C6 if necessary, then use C7 to contract vi, and use C6 and C5 to remove any multiple edges formed. After any of these operations, we have deleted the node vi, and maintained the assumptions of our induction. In particular, note that the degree of a node (ignoring self-loops) never increases, so we indeed only ever contract nodes of degree at most 2. Thus, the Prototypical edge model is capable of contracting H to a trivial graph. 28 Equivariant Polynomials for Graph Neural Networks ( =⇒ ) Consider a pair of graphs that are not distinguishable by 3-WL. Let k > 3 be the smallest integer such that k-WL distinguishes this pair. This pair of graphs differs in the number of homomorphisms for a subgraph that has at least tree-width k − 1 ≥ 3 (Grohe et al., 2021) (e.g. see figure 2 of (Bouritsas et al., 2022) for explicit example). Series of eliminations of nodes of a subgraph form a tree decomposition of the subgraph via its chordal completion as described below. Subgraphs of tree-width ≥ 3 have at least one bag of 4 or more nodes in their tree decomposition. Since the Prototypical edge-based graph model can only contract with bags of size 3 or fewer, such a homomorphism count cannot be performed using the contractions. To show that any set of contractions forms a valid tree decomposition of the graph, consider the chordal completion of the graph formed by the eliminations. This chordal completion consists of the original graph with all edges added between nodes that were part of a contraction which eliminated any other node. E.g., if nodes in {a, b, c} were part of a contraction eliminating node a, then all edges between the nodes in {a, b, c} are added to its chordal completion. Note that this chordal completion follows naturally in any contraction as once a node is eliminated in a contraction, an edge must be made between its remaining neighbors to store the output of the contraction. Any chordal completion of a subgraph has the property that via the same elimination order of its construction, no more edges are added. I.e., the subgraph constructed by each eliminated node and its neighbors forms a clique. This elimination ordering forms a tree decomposition with bags consisting of the cliques in the elimination ordering. Thus, the tree-width of a graph is upper bounded by the size of the maximal clique in its chordal completion minus one (Diestel, 2005). Since the Prototypical edge based model can only contract up to 3 nodes at once, cliques of size at most 3 can be constructed in the chordal completion and the tree-width of such a tree decomposition is at most 2. Another way to approach this result is through the relationship between graphs of tree-width 2 and series-parallel graphs. Any biconnected graph H of tree-width 2 is a series-parallel graph (more generally, a graph has tree-width 2 if and only if all biconnected components are series-parallel) (Bodlaender, 1998). Suppose H is series-parallel. Then it is known that it can be contracted to a single edge by two operations (Duffin, 1965): (op1) Delete a node of exactly degree 2, and connecting its two neighbors. (op2) If there are two edges between the same two nodes, delete one of the edges. The edge-based Prototypical model can implement these two operations, so it can contract H into a single edge. The first operation (op1) is C7 (matrix multiplication), possibly with a C6 (matrix transpose) beforehand to align the directions of the edges. The second operation (op2) is C5 (replace two parallel edges with one edge), again possibly with a C6 (matrix transpose) beforehand to align the directions of the edges. After contraction to a single edge, the remaining operations C1, C2, C3 can be used to contract H to the trivial graph. If H is not biconnected, then we can use the block-cut tree of H to get the biconnected components. Then we can contract each biconnected component that is a leaf of the block-cut-tree (as it is a series parallel graph) in a way such that we add a self-loop to the cut vertex it is connected to. After pruning cut vertices appropriately, we can continue this process until reaching the trivial graph. I. Counting of Invariant Polynomials of Symmetric Group Various methods exist to count the number of invariant polynomials of the Symmetric group (in our case, also isomorphic to multigraphs) of a given form (Harary & Palmer, 2014; P ́olya, 1937; Molien, 1897; Thi ́ery, 2000; Bedratyuk, 2015). Here, we follow a standard strategy to count the number of invariant polynomials by summing over partitions corresponding to cycle indices of the permutation group. Given Sn as the symmetric group on n elements, let S(k) n be the symmetric group acting on the representation X ∈ (Rn)⊗k. Let Pn denote the set of integer partitions of n where each partition m ∈ Pn is a length n vector whose j-th element is the number of elements of size j in the given partition. For example, for the partition of 4 into (1, 1, 2), the corresponding value of m = [2, 1, 0, 0]. Let si for i ∈ N be arbitrary variables for now (their meaning will become clear later). We define the cycle index Z(S(k) n as a power series in variables si for i ∈ N as n )[si] of S(k) Z(S(k) n )[si] = (cid:88) m∈Pn 1 t=1 tmtmt! (cid:81)n k (cid:89) n (cid:89) i=1 ji=1 29 t=1 mjt jt/ lcm(j1,...,jk) (cid:81)k s lcm(j1,...,jk) , (37) where lcm(*) is the least common multiple of the arguments. Equivariant Polynomials for Graph Neural Networks As an example, we have Z(S(2) 3 )[si] = 1 6 s9 1 + 1 2 s1s4 2 + 1 3 s3 3. (38) For the equivariant case, we need a weighted cycle index which we denote as ZW (S(k) as n × S(d) n )[si] which can be calculated ZW (S(k) n × S(d) n )[si] = (cid:88) m∈Pn md 1 t=1 tmtmt! (cid:81)n k (cid:89) n (cid:89) i=1 ji=1 (cid:81)k s t=1 mjt jt/ lcm(j1,...,jk) lcm(j1,...,jk) , (39) From here, we can generate the Molien series which counts the number of invariant/equivariant polynomials on S(k) n . (x) for invariant polynomials on S(k) Theorem I.1. The Molien series MS(k) n is generated by n invariant: MS(k) n (x) = Z(S(k) n )[si = 1 + xi + x2i + * * * ], (40) and more generally, the Molien series for the polynomials which are equivariant to S(d) by: n outputs and S(k) n inputs is generated equivariant: MS(k) n ×S(d) n (x) = ZW (S(k) n × S(d) n )[si = 1 + xi + x2i + * * * ]. (41) Proof. We enumerate the Molien series of order k invariant polynomials RG k in the invariant ring of polynomials RG using Molien's formula (Derksen & Kemper, 2015; Molien, 1897). A similar proof can be obtained via the P ́olya enumeration theorem (Tucker, 1994; P ́olya, 1937). Given a representation ρ : G → GL (V ), Molien's formula states that MG(x) = (cid:88) dim(RG k )xk = |G|−1 (cid:88) k g∈G 1 det (I − xρ(g)) . (42) First, let us consider the invariant setting for S(k) n – the symmetric group with representation acting on the vector space X ∈ (Rn)⊗k. Eigenvalues of a permutation matrix depend only on the cycle index of the permutation. Therefore, we decompose the sum of group elements in the symmetric group by their cycle indices MS(k) n (x) = (cid:88) m∈Pn 1 t=1 tmtmt! (cid:81)n 1 I − xρ(g(k) m ) (cid:16) (cid:17) , det (43) where ρ(gm(k) ) is any permutation with cycle index mt for the representation on S(k) n , the representation of the permutation group is the standard representation corresponding to permutations of indices of the vector space. For cycle index m, the representation ρ(gm(1)) has mj eigenvalues equal to the j different powers of the j-th root of unity. Denoting si = 1 + xi + x2i + * * * , this then results in the following: n . For S(1) 1 I − xρ(g(1) m ) (cid:17) = (cid:16) det n (cid:89) ji=1 s mji ji . (44) ρ(gm(k) ) acts as a k-fold tensor product of the representation ρ(gm(1)), i.e. ρ(gm(k)) = [ρ(gm(1))](⊗k). Therefore, to generalize the above formula to higher order k, we enumerate the possible eigenvalues of the tensor product of ρ(gm(1). Since the eigenvalues of a tensor product of operators are simply the product of the eigenvalues of the elements of the tensor product, we can perform this enumeration over products of the operators. As we noted before, for cycle index m, the representation ρ(gm(1)) has mj eigenvalues equal to the j different powers of the j-th root of unity. Given the product of two elements of this cycle index, we now consider the product of eigenvalues 30 Equivariant Polynomials for Graph Neural Networks equal to the different powers of the j-th and k-th roots of unity. This results in all the eigenvalues which are products of the lcm(j, k)-roots of unity where lcm(*) denotes the least common multiple. Given mj and mk cycles of j-th and k-th order respectively, powers of the lcm(j, k)-roots of unity will appear a total of mjmk/ lcm(j, k) number of times. Generalizing this to products of more than two eigenvalues, we arrive at 1 I − xρ(g(k) m ) (cid:17) = (cid:16) det k (cid:89) n (cid:89) i=1 ji=1 (cid:81)k s t=1 mjt jt/ lcm(j1,...,jk) lcm(j1,...,jk) . (45) Plugging the above into Equation (43), we obtain the desired result. For the equivariant setting, we use the equivariant form of Molien's formula. For maps from a vector space V to another vector space W , we consider a representation ρ : G → GL (V ) acting on the input space and a representation σ : G → GL (W ) acting on the output space. Here, Molien's formula takes the form (Derksen & Kemper, 2015; Antoneli et al., 2008) MG(x) = (cid:88) dim(RG k )xk = |G|−1 (cid:88) k g∈G Tr(σ(g)−1) det (I − xρ(g)) . (46) The above can be shown by noting that the module of equivariant polynomials corresponds to (R[V ] ⊗ W )G where R[V ] is the ring of polynomials on the vector space V . The representation of S(d) n corresponds to the d-fold tensor product of the standard representation of the symmetric group. For a cycle index m this representation has one nonzero entries on the diagonal for each cycle of size 1. Therefore, there are md 1 total nonzero entries each equal to one. Plugging this in, we arrive at the final solution. As an example, returning to Equation (38), we have for invariant polynomials on S(2) 3 : MS(2) 3 (x) = 1 6 (cid:2)(1 + x + x2 + * * * )9 + 3(1 + x + x2 + * * * )(1 + x2 + x4 + * * * )4 + 2(1 + x3 + x6 + * * * )3(cid:3) (47) = 1 + 2x + 10x2 + * * * Theorem I.1 quantifies the Molien series for polynomials on n nodes. To obtain the asymptotic limit MS(2) (x) for invariant (x) agree in powers xc up to c = ⌊n/2⌋. Therefore, polynomials on graphs of arbitrary size, we note that MS(2) to generate the asymptotic series up to power n, it suffices to calculate the corresponding Molien series for MS(2) (x). A similar logic can be applied for equivariant polynomials which also have a "red" edge as well as described in the main text. Corollary I.2. The number of invariant polynomials quantified in the Molien series MS(2) n → ∞ nodes agrees with MS(2) quantified in the Molien series MS(2) ⌊n/2⌋ − 1 degrees. (x) for the asymptotic limit of (x) for n up to the first ⌊n/2⌋ degrees. Similarly, the number of equivariant polynomials (x) for n up to the first (x) for the asymptotic limit of n → ∞ nodes agrees with MS(2) (x) and MS(2) 2n ∞ ∞ ∞ ∞ n n n Counts of invariant polynomials. The Molien series of the number of invariant polynomials on graphs, i.e., Rn2 for sufficiently large n, begins with → R 1, 2, 11, 52, 296, 1724, 11060, 74527, 533046, 3999187, 31412182, 257150093, 2188063401, 19299062896, 176059781439, 1657961491087, . . . (48) Counts of equivariant polynomials. The Molien series of the number of equivariant polynomials on graphs, i.e., Rn2 for sufficiently large n, begins with → Rn2 2, 15, 117, 877, 6719, 52505, 422824, 3508753, 30036833, 265100322, 2410638644, 22563597944, 217175819474, 2147355853088, 21790101729085, 226707665717377, . . . (49) 31 Equivariant Polynomials for Graph Neural Networks For the setting of the standard representation of the symmetric group on nodes (S(1) n in our notation), the above recovers the generating series for partitions for which there exist efficiently calculable recurrences via the pentagonal number theorem (Hardy et al., 1979). We do not know of a similarly more direct way to compute the Molien series above in the general case. 32
http://arxiv.org/abs/2302.11552v3
2023-06-08T17:39:01
2023-02-22T18:48:46
Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC
Since their introduction, diffusion models have quickly become the prevailing approach to generative modeling in many domains. They can be interpreted as learning the gradients of a time-varying sequence of log-probability density functions. This interpretation has motivated classifier-based and classifier-free guidance as methods for post-hoc control of diffusion models. In this work, we build upon these ideas using the score-based interpretation of diffusion models, and explore alternative ways to condition, modify, and reuse diffusion models for tasks involving compositional generation and guidance. In particular, we investigate why certain types of composition fail using current techniques and present a number of solutions. We conclude that the sampler (not the model) is responsible for this failure and propose new samplers, inspired by MCMC, which enable successful compositional generation. Further, we propose an energy-based parameterization of diffusion models which enables the use of new compositional operators and more sophisticated, Metropolis-corrected samplers. Intriguingly we find these samplers lead to notable improvements in compositional generation across a wide set of problems such as classifier-guided ImageNet modeling and compositional text-to-image generation.
[ "Yilun Du", "Conor Durkan", "Robin Strudel", "Joshua B. Tenenbaum", "Sander Dieleman", "Rob Fergus", "Jascha Sohl-Dickstein", "Arnaud Doucet", "Will Grathwohl" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11552v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11552v3", "@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", "stat.ML" ]
Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Yilun Du 1 Conor Durkan 2 Robin Strudel 2 Joshua B. Tenenbaum 1 Sander Dieleman 2 Rob Fergus 2 Jascha Sohl-Dickstein 2 Arnaud Doucet 2 Will Grathwohl 2 3 2 0 2 n u J 8 ] G L . s c [ 3 v 2 5 5 1 1 . 2 0 3 2 : v i X r a Abstract Since their introduction, diffusion models have quickly become the prevailing approach to gen- erative modeling in many domains. They can be interpreted as learning the gradients of a time- varying sequence of log-probability density func- tions. This interpretation has motivated classifier- based and classifier-free guidance as methods for post-hoc control of diffusion models. In this work, we build upon these ideas using the score- based interpretation of diffusion models, and ex- plore alternative ways to condition, modify, and reuse diffusion models for tasks involving com- positional generation and guidance. In particu- lar, we investigate why certain types of compo- sition fail using current techniques and present a number of solutions. We conclude that the sampler (not the model) is responsible for this failure and propose new samplers, inspired by MCMC, which enable successful compositional generation. Further, we propose an energy-based parameterization of diffusion models which en- ables the use of new compositional operators and more sophisticated, Metropolis-corrected sam- plers. Intriguingly we find these samplers lead to notable improvements in compositional gen- eration across a wide set of problems such as classifier-guided ImageNet modeling and compo- sitional text-to-image generation. Project web- https://energy-based-model. page: github.io/reduce-reuse-recycle/. 1 Introduction In recent years, tremendous progress has been made in gen- erative modeling across a variety of domains (Brown et al., 1MIT 2Google Deepmind. Correspondence to: Yilun Du <[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 2020; Brock et al., 2018; Ho et al., 2020). These models now serve as powerful priors for downstream applications such as code generation (Li et al., 2022), text-to-image gen- eration (Saharia et al., 2022), question-answering (Brown et al., 2020) and many more. However, to fit these complex data, generative models have grown inexorably larger (re- quiring 10's or even 100's of billions of parameters) (Kaplan et al., 2020) and require datasets containing non-negligible fractions of the entire internet, making it costly and difficult to train and or finetune such models. Despite this, some of the most compelling applications of large generative models do not rely on finetuning. For example, prompting (Brown et al., 2020) has been a successful strategy to selectively extract insights from large models. In this paper, we ex- plore an alternative to finetuning and prompting, through which we may repurpose the underlying prior learned by generative models for downstream tasks. Diffusion Models (Sohl-Dickstein et al., 2015; Song & Er- mon, 2019; Ho et al., 2020) are a recently popular approach to generative modeling which have demonstrated a favor- able combination of scalability, sample quality, and log- likelihood. A key feature of diffusion models is the ability for their sampling to be "guided" after training. This in- volves combining the pre-trained Diffusion Model pθ(x) with a predictive model pθ(y|x) to generate samples from pθ(x|y). This predictive model can be either explicitly de- fined (such as a pre-trained classifier) (Sohl-Dickstein et al., 2015; Dhariwal & Nichol, 2021) or an implicit predictive model defined through the combination of a conditional and unconditional generative model (Ho & Salimans, 2022). These forms of conditioning are particularly appealing (es- pecially the former) as they allow us to reuse pre-trained generative models for many downstream applications, be- yond those considered at training time. These conditioning methods are a form of model composi- tion, i.e. combining probabilistic models together to create new models. Compositional models have a long history back to early work on Mixtures-Of-Experts (Jacobs et al., 1991) and Product-Of-Experts models (Hinton, 2002; Mayraz & Hinton, 2000). Here, many simple models or predictors were combined to increase their capacity. Much of this early work on model composition was done in the context of Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Figure 1: Creating new models through composition. Simple operators enable diffusion models to be composed without retraining in settings such (a) products, (b) classifier conditioning, (c) compositional text-to-image generation with products and mixtures, (d) image tapestries with different content at different locations (captions shortened, see Appendix G for full text). All samples are generated. Energy-Based Models (Hinton, 2002), an alternative class of generative model which bears many similarities to diffu- sion models. In this work, we explore the ways that diffusion models can be reused and composed with one-another. First, we introduce a set of methods which allow pre-trained diffusion models to be composed, with one-another and with other models, to create new models without retraining. Second, we illustrate how existing methods for composing diffusion models are not fully correct, and propose a remedy to these issues with MCMC-derived sampling. Next, we propose the use of an energy-based parameterization for diffusion models, where the unnormalized density of each reverse diffusion distribution is explicitly modeled. We illustrate how this parameterization enables both additional ways to compose diffusion models, as well as the use of more powerful Metropolis-adjusted MCMC samplers. Finally, we demonstrate the effectiveness of our approach in settings from 2D data to high-resolution text-to-image generation. An illustration of our domains can be found in Figure 1. 2 Background 2.1 Diffusion Models Diffusion models seek to model a data distribution q(x0). this distribution with auxiliary variables We augment {xt}T t=1 defining a Gaussian diffusion q(x0, . . . , xT ) = q(x0)q(x1|x0) . . . q(xT |xT −1) where each transition is de- √ fined by q(xt|xt−1) = N (xt; 1 − βtxt−1, βtI) for some 0 < βt ≤ 1. This transition first scales down xt−1 by √ 1 − βt and then adds Gaussian noise of variance βt. For large enough T , we will have q(xT ) ≈ N (0, I). Our model takes the form pθ(xt−1|xt) and seeks to learn the "reverse" distribution q(xt−1|xt) which denoises xt to xt−1. In the limit of small βt this reversal becomes Gaus- sian (Sohl-Dickstein et al., 2015) so we parameterize our model pθ(xt−1|xt) = N (xt−1; μθ(xt, t), ̃βtI) with: μθ(xt, t) = (cid:18) xt − 1 √ αt βt√ 1 − ̄αt (cid:19) εθ(xt, t) . (1) where εθ(xt, t) is a neural network, and αt, ̄αt, ̃βt are func- tions of {βt}T t=1. t x0, σ2 A useful feature of the diffusion distribution q(x0, ..., xT ) is that we can analytically derive any time marginal q(xt|x0) = N (xt; (cid:112)1 − σ2 t I) where again σt is a function of {βt}T t=1. We can sample xt from this distribu- tion using reparameterization, i.e xt(x0, ε) = (cid:112)1 − σ2 t x0 + σtε where ε ∼ N (0, I). Exploiting this, diffusion mod- els are typically trained with the loss L(θ) = (cid:80)T t=1 Lt(θ), where Lt(θ) = Eq(x0)N (ε;0,I) (cid:2)||ε − εθ(xt(x0, ε), t)||2(cid:3) . (2) Once εθ(x, t) is trained, we recover μθ(x, t) with Equa- tion 1 to parameterize pθ(xt−1|xt) and perform ancestral sampling (also known as the reverse process) to reverse the diffusion, i.e sample xT ∼ N (0, I), then for t = T −1 → 1, sample xt−1 ∼ pθ(xt−1|xt). A more detailed description can be found in Appendix B. 2.2 Energy-Based Models and MCMC Sampling Energy-Based Models (EBMs) are a class of probabilistic model which parameterize a distribution as pθ(x) = efθ (x) Z(θ) where the normalizing constant Z(θ) = (cid:82) efθ(x)dx is not modeled. Choosing not to model this quantity gives the model much more flexibility but comes with considerable limitations. We can no longer efficiently compute likeli- hoods or draw samples from the model. This complicates training, as most generative models are trained by maximiz- ing likelihood. 2 p!(x)p"(x)Zp!(x)p"(x)=Xp#(x)p!(pizza|x)"Not Pizza"=Xp!(x|pizza)"Pizza""A dog""A cat""A dog"OR "Acat"=+(a)(b)(c)(d)=A large sailing ship. An oil painting of an ocean scene.A mermaid sunning herself.A lighthouse.A curious whale surfacing.The ocean. Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC One popular method for EBM training is denoising score matching. This approach minimizes the Fisher Divergence1 between the model and a Gaussian-smoothed version of the data distribution qσ(x) = (cid:82) q(x′)N (x; x′, σ2I)dx′ by minimizing the following objective inspection that the training objective of diffusion models is identical (up to a constant) to the denoising score matching objective t Jσt(θ) = Eq(x)N (ε;0,I) σ2 (cid:104) ||ε + σt∇xfθ(x + σtε)||2(cid:105) = Lt(θ) (5) Jσ(θ) = Eq(x)N (ε;0,I) (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ε σ (cid:12) (cid:12) + ∇xfθ(x + σε) (cid:12) (cid:12) (cid:12) (cid:12) 2(cid:21) . (3) When minimized, this ensures that efθ(x) ∝ qσ(x) and therefore ∇xfθ(x) = ∇x log qσ(x). To estimate likeli- hoods or sample from our model, we must rely on approxi- mate methods, such as MCMC sampling or numerical ODE integration. MCMC works by simulating a Markov chain beginning at x0 ∼ p(x0) and using a transition distribution xt ∼ k(xt|xt−1). If k(*|*) has certain properties, namely invariance w.r.t. the target and ergodicity, then as t → ∞, xt converges to a sample from our target distribution. Perhaps the most popular MCMC sampling algorithm for EBMs is Unadjusted Langevin Dynamics (ULA) (Roberts & Tweedie, 1996; Du & Mordatch, 2019; Nijkamp et al., 2020) which is defined by k(xt|xt−1) = N (cid:16) xt; xt−1 + σ2 2 ∇xfθ(xt−1), σ2I (cid:17) . (4) This resembles a step of gradient ascent (with step-size σ2 2 ) with added Gaussian noise of variance σ2. This transition is based on a discretization of the Langevin SDE. In the limit of infinitesimally small σ this approach will draw ex- act samples. To handle the error accrued when using larger step sizes, a Metropolis correction can be added giving the Metropolis-Adjusted-Langevin-Algorithm (MALA) (Be- sag, 1994). With Metropolis correction, we first generate a proposed update ˆx ∼ k(x|xt−1), then with probabil- (cid:17) ity min we set xt = ˆx, otherwise 1, xt = xt−1. efθ (ˆx) efθ (xt−1) k(xt−1|ˆx) k(ˆx|xt−1) (cid:16) Hamiltonian Monte Carlo (HMC) (Duane et al., 1987; Neal, 1996) is a more advanced MCMC sampling method which augments the state-space with auxiliary momentum variables and numerically integrates energy-conserving Hamiltonian dynamics to explore the space. HMC is typically applied with a Metropolis correction, but an ap- proximate variant can be used without it (U-HMC) (Geffner & Domke, 2021). See Appendix C.1 for details of HMC variants we use. 2.3 Connection Between Diffusion Models and EBMs Diffusion models and EBMs are closely related. For in- stance, Song & Ermon (2019) uses an EBM perspective to propose a close cousin to diffusion models. We can see from 1The Fisher (cid:2)||∇x log p(x) − ∇x log q(x)||2(cid:3). divergence is Ep defined: F(p||q) = 3 where we have replaced εθ(x, t) with −σt∇xfθ(x + σtε). Thus by training εθ(x, t) to minimize Equation 2, we can recover the diffused data distribution score with ∇x log qσt(x) ≈ − εθ(x,t) . From this, we can define εθ(x, t) = ∇xfθ(x, t) (the derivative of an explicitly de- fined scalar function) to learn a noise-conditional potential function fθ(x, t). We later demonstrate the benefits of this in two ways; it enables the use of more sophisticated sam- pling algorithms and more forms of composition. σt 2.4 Controllable Generation It may be convenient to train a model of p(x) where x is, say, the distribution of all images, but in practice we often want to generate samples from p(x|y) where y is some attribute, label, or feature. This can be accomplished within the framework of diffusion models by introducing a learned predictive model pθ(y|x; t), i.e a time-conditional model of the distribution of some feature y given x. We can then exploit Bayes' rule to notice that (for λ = 1), ∇x log pθ(x|y; t) = ∇x log pθ(x; t) + λ∇x log pθ(y|x; t). (6) In practice, when using the right side of Equation 6 for sampling, it is beneficial to increase the 'guidance scale' λ to be > 1 (Dhariwal & Nichol, 2021). Thus, we can re- purpose the unconditional diffusion model and turn it into a conditional model. If instead of a classifier, we have a both an unconditional diffusion model ∇x log pθ(x; t) and a conditional diffusion model ∇x log pθ(x|y; t), we can again utilize Bayes' rule to derive an implicit predictive model's gradients ∇x log pθ(y|x; t) = ∇x log pθ(x|y; t) − ∇x log pθ(x; t) (7) which can be used to replace the explicit model in Equation 6, giving what is known as classifier-free guidance (Ho & Salimans, 2022). This method has led to incredible perfor- mance, but comes at a cost to modularity. This contrasts with the classifier-guidance setting, where we only need to train a single (costly) generative model. We can then at- tach any predictive model we would like to for conditioning. This is beneficial as it is often much easier and cheaper to train predictive models than a flexible generative model. In the classifier-free setting, we must know exactly which y we would like to condition on, and incorporate these labels into model training. In both guidance settings, we use our (possibly implicit) predictive model to modify the learned score of our model. We then perform diffusion model sam- pling as we would in the unconditional setting. We will see Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC later that even in toy settings, this is often not the optimal thing to do. 3 Compositional Generation Beyond Guidance Most work on conditional diffusion models has come in the form of classifier or classifier-free guidance, but these are far from the only ways we can compose distributions to obtain new models. These ideas have been studied primarily in the context of EBMs because most compositional operators leave the resulting distribution unnormalized. We outline various options below. Products: We can take a product of N distributions and re-normalize to create a new distribution, roughly equivalent to the "intersection" of the composite distributions, qprod(x) = 1 Z (cid:81)N i=1 qi(x), Z = (cid:82) (cid:81)N i=1 qi(x)dx. (8) Regions of high probability under qprod(x) will typically have high probability under all qi(x). A simple product model can be seen in Figure 2. These ideas were initially proposed to increase the capacity of weaker models by al- lowing individual "experts" to model specific features in the input (Hinton, 2002), and were recently demonstrated at scale in the image domain using Deep Energy-Based Models (Du et al., 2020a). The approaches to guidance discussed in Section 2.4 define product models with only two experts. The first models the relative density of the input data and the second models the conditional probability of y. Combining these by a product models likely inputs which have the desired property y. This form of composition has become popular for diffusion models since they do not directly model the probability, but instead the gradient of the log-probability which can also be composed in this way. Mixtures: Complementary to the product or intersection is the mixture or union of multiple distributions. We can combine N distributions through a mixture to create a new distribution equivalent to the union of the concepts captured in each distribution qmix(x) = 1 N (cid:80)N i=1 qi(x) (9) where regions of high probability consist of regions of high probability under any qi(x). We cannot compose score- functions to define mixtures (unlike products). Instead, we need a model which specifies probability. Generating from mixtures of energy based models requires knowing the ratio of normalizers between the models. In our experiments, we assume this ratio is 1, though a different unknown ratio of normalizers would correspond to a weighted mixture. A simple compositional mixture model can be seen in Figure 2. respect to p0(x), which constructs a new distribution which assigns high likelihood to points in p0(x) that are not in p1(x) (Du et al., 2020a), where α controls the degree we invert p1(x) (we use α = 0.5 in our experiments). qneg(x) ∝ q0(x) q1(x)α . (10) We can combine negation with our previous operators, in a nested manner to construct complex combinations of distri- butions (Figure 6). In Section 2.3, we showed how diffusion models can be interpreted as approximating the gradient ∇x log q(x), but do not learn an explicit model of the log-likelihood log q(x). This means with the standard εθ(x, t)-parameterization we can, in theory, utilize product and negation composition, but not mixture composition. 4 Scaling Compositional generation with Diffusion Models While highly compositional, EBMs present many chal- lenges. The lack of a normalized probability function makes training, evaluation, and sampling very difficult. Much progress has been made to scale these models (Du & Mor- datch, 2019; Nijkamp et al., 2020; Grathwohl et al., 2019; Du et al., 2020b; Grathwohl et al., 2021; Gao et al., 2021; Xie et al., 2016; 2021), but EBMs still lag behind other ap- proaches in terms of efficiency and scalability. In contrast, diffusion models have demonstrated very impressive scal- ability. Fortuitously, diffusion models have similarities to EBMs, such as their training objective and their score-based interpretation, which makes many forms of composition readily applicable. Unfortunately, when two diffusion models are composed into, for example, a product model qprod(x) ∝ q1(x)q2(x), issues arise if the model which reverses the diffusion uses a score estimate obtained by adding the score estimates of the two models as done in prior work (Liu et al., 2022; Bao et al., 2022; Zhao et al., 2022). We see in Figure 2 that composing two models in such a way leads indeed to sub- par samples. This is because to sample from this product distribution using standard reverse diffusion (Song et al., 2021), one would need to compute instead the score of the diffused target product distribution given by ∇x log ̃q prod t (xt) = ∇x log (cid:0)(cid:82) dx0q1(x0)q2(x0) q(xt|x0)(cid:1) . (11) For t > 0, this quantity is not equal to the sum of the scores of the two models which is given by ∇x log qprod t (xt) = ∇x log + ∇x log (cid:18)(cid:90) (cid:18)(cid:90) dx0q1(x0)q(xt|x0) (cid:19) dx0q2(x0)q(xt|x0) (cid:19) . (12) Finally, given two distributions p0(x) and Negation: p1(x), we can explicitly invert the density of p1(x) with Therefore, plugging the composed score function into the standard diffusion ancestral sampling procedure discussed 4 Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Figure 2: An illustration of product and mixture compositional models, and the improved sampling performance of MCMC in both cases. Left to right: Component distributions, ground truth composed distribution, reverse diffusion samples, HMC samples. Top: product, bottom: mixture. Reverse diffusion fails to sample from composed models. t in Section 2.1, which we refer to as "reverse diffusion," does not correspond to sampling from the composed model, and thus reverse diffusion sampling will generate incorrect samples from composed distributions. This effect can be seen in Figure 2, with details in Appendix D. The score of the distribution qprod (xt) in Equation 12 is easy to compute, unlike that of ̃q prod (xt) from Equation 11. In addition, qprod (xt) describes a sequence of distributions which smoothly interpolate between qprod(x) at t = 0 and N (0, I) at t = T , though this sequence of distributions does not correspond to the distributions that result from the standard forward diffusion process described in Section 2.1, leading the reverse diffusion sampling to generate poor samples. We discuss how we may utilize MCMC samplers, which use our knowledge of ∇x log qprod (xt), to correctly sample from intermediate distributions ̃q prod (xt), leading to accurate composed sample generation. t t t t 4.1 Improving Sampling with MCMC In order to sample from qprod(x) using the combined score function from Equation 12, we can use annealed MCMC sampling, described below in Algorithm 1. This method applies MCMC transition kernels to a sequence of distri- butions which begins with a known, tractable distribution and concludes at our target distribution. Annealed MCMC has a long history enabling sampling from very complex distributions (Neal, 2001; Song & Ermon, 2019). Algorithm 1 Annealed MCMC Input: Transition kernels kt(*|*), Initial distribution pT (*), Number of steps N xT ∼ pT (*) for t = T, . . . , 0 do # Initialize. for i = 1, . . . , N do xt ∼ kt(*|xt) end for xt−1 = xt end for return x0 We explore two types of transition kernels kt(*|*) based on Langevin Dynamics (Equation 4) and HMC. When using the standard εθ(x, t)-parameterization, we do not have ac- 5 Model Sampler Product Mixture RAISE ↑ LL ↑ Var ↓ ln(MMD) ↓ LL ↑ Var ↓ Score EBM Reverse ULA U-HMC Reverse (equal steps) Reverse ULA MALA U-HMC HMC 1.55 2.37 2.52 2.27 1.37 2.36 2.64 2.63 2.71 -6.47 0.063 1.79 0.026 2.40 0.021 -2.92 0.046 -6.03 0.064 1.84 0.027 2.73 0.013 2.45 0.022 2.72 0.009 - - - - -3.84 -4.21 -4.38 -4.69 -4.48 - - - - - - - - -2.17 0.020 0.57 0.013 1.29 0.008 1.03 0.010 1.30 0.007 Table 1: Quantitative results on 2D composition. Energy based parameterization enables mixture compositional models, and MCMC sampling leads to better samples from compositional diffusion models. cess to an explicitly defined energy-function meaning we cannot utilize any MCMC sampler with Metropolis correc- tions. Thus, we only utilize the ULA and U-HMC samplers described in Section 2.2. These samplers are not exact, but can in practice generate good results. In the next section we detail how Metropolis corrections may be incorporated. Full details of our samplers can be found in Appendix C.1. While continuous time sampling in diffusion models (Song et al., 2021) is also referred to as ULA, the MCMC sampling procedure is run across time (and is the same sampling pro- cedure as discretized diffusion in Section 2.1), as opposed to being used to sample from each intermediate distribution ̃q prod (xt). Thus applying continuous sampling gives the t same issues as reverse diffusion sampling. We can see again in Figure 2 that applying this MCMC sampling procedure allows samples from the composed dis- tribution to be faithfully generated with no modification to the underlying diffusion models. Quantitative results can be found in Table 1 which further imply that the choice of sam- pler may be responsible for prior failures in compositional generation with diffusion models. Concurrent to our work, Geffner et al. (2022) also explores using MCMC to sample from diffusion product distributions. 4.2 Energy-Based Parameterization As noted in Section 3, we are unable to use mixture com- position without an explicit likelihood function. But, if we parameterize a potential function fθ(x, t) and implicitly define εθ(x, t) = −∇xfθ(x, t) we can recover an explicit HMCReverseDiffusionTrue Resultp!(x)p"(x)==+× Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC estimate of the (unnormalized) log-likelihood – enabling us to utilize all presented forms for model composition. Additionally, an explicit estimate of log-likelihood enables the use of more accurate samplers. As explained above, with the standard εθ(x, t)-parameterization we can only utilize unadjusted samplers. While they can perform well in prac- tice, there exist many distributions from which they cannot generate decent samples (Roberts & Tweedie, 1996) such as targets with lighter-than-Gaussian tails where the ULA chain is transient. Additionally, for an accurate approxima- tion to the Langevin SDE, ULA will need increasingly small stepsizes as the curvature of the log-likelihood gradient in- creases which can lead to arbitrarily slow mixing (Durmus & Moulines, 2019). In these settings a Metropolis correction can greatly improve sample quality and convergence. Again this issue can be solved by defining εθ(x, t) = ∇xfθ(x, t) for some explicitly defined scalar potential function fθ(x, t). Energy-based parameterizations have been explored in the past (Salimans & Ho, 2021) and were found to perform com- parably to score-based models for unconditional generative modeling. In that setting the score parameterization is then preferable as computing the gradient of the energy requires more computation. In the compositional setting, however, the additional flexibility enabled by explicit (unnormalized) log-probability estimation motivates a re-exploration of the energy-parameterization. We explored a number of energy-based parameterizations for diffusion models and ran a pilot study on ImageNet. In this study we found it best to parameterize the log prob- ability as fθ(x, t) = −||sθ(x, t)||2, where sθ(x, t) is a vector-output neural network, like those used in εθ(x, t)- parameterized diffusion models. Full details on our study can be found in Appendix E. From here on, all energy-based diffusion models take the above form. Our energy-parameterized models enable us to use MALA and HMC samplers which produce our best compositional generation results by a large margin. An additional benefit of these samplers is that, through monitoring their acceptance rates, we are able to derive an effective automated method for tuning their hyper-parameters (a notoriously difficult task prior) which is not available for unadjusted samplers. Details of our samplers and tuning procedures can be found in Appendix C.1. 5 Experiments We experiment with various model parameterizations and sampling schemes for compositional generation with dif- fusion models. We first investigate these ideas on some illustrative 2D datasets, then move to the image domain with an artificial dataset of shapes. Here, we compose a model conditioned on the location of a single shape with Figure 3: Composition enables the positions of multiple shapes to be simultaneously controlled, while training only conditions on the location of one object per image. Reverse diffusion samples place shapes in incorrect locations. MCMC generates samples that satisfy all constraints. Model Sampler Combinations 4 3 2 1 5 Score 70.8 68.2 66.3 64.1 57.4 Reverse ULA 75.0 73.4 71.8 67.9 60.2 U-HMC 79.1 76.0 73.6 71.1 62.3 EBM 71.0 67.1 62.5 58.1 51.0 Reverse ULA 81.3 71.8 66.6 59.6 54.8 MALA 85.4 74.4 71.1 65.6 63.9 U-HMC 84.5 81.3 79.2 74.2 68.1 91.6 82.9 80.1 76.5 72.7 HMC Table 2: Quantitative performance (accuracy) of composing multi- ple cubes positions on the CLEVR dataset. itself to condition on the location of all of the shapes in the image. After this we experiment with classifier guidance on the ImageNet dataset. Finally, we self-compose text-to- image models to generate from compositions of various text prompts and image tapestries. Full details of all experiments can be found in Appendix G. Throughout we compare our proposed improvements with a score-parameterized model using standard reverse diffusion sampling. We note that this baseline is exactly the approach of Liu et al. (2022). 5.1 2D densities We train diffusion models using both parameterizations and study the impact of various sampling approaches for compositional generation. Samples are evaluated using RAISE (Burda et al., 2015) (which gives lower bounds on log-likelihood) and MMD2, LL (log-likelihood of gen- erated samples under composed distribution), and Var (L2 difference of variance of GMMs fit on generated samples compared to GMMs of the composed distribution). Results can be found in Table 1 and visualizations can be seen in Figure 2. All MCMC sampling methods improve sample quality and likelihood, with Metropolis adjusted methods 2For the mixture we use MMD to replace RAISE likelihood based evaluation as we encountered numerical stability issues with RAISE when applying to the mixture. 6 1 Shape3 Shapes5 ShapesGroundTruthEBMHMCReverseDiffusion Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Figure 4: Classifier-guided generation on ImageNet. HMC leads to higher fidelity and more class-identified images than reverse diffusion sampling. Model Sampler Inception Score ↑ FID ↓ Accuracy ↑ Score Energy Reverse LA U-HMC Reverse LA MALA U-HMC HMC 29.10 29.35 32.19 28.05 28.12 30.43 31.39 33.46 30.46 30.49 26.89 33.58 33.45 32.22 32.08 30.52 18.64 65.81 89.93 18.60 66.28 83.65 90.83 94.61 Table 3: MCMC Sampling enables better classifier guidance on 128x128 ImageNet dataset. the energy-based parameterization leads to further improve- ments. We qualitatively illustrate results in Figure 3, and see more accurate generations with more steps of sampling, with more substantial increases with Metropolis adjustment. 5.3 Classifier conditioning Next, we train unconditional diffusion models and a noise- conditioned classifier on ImageNet. We compose these models as ∇x log pθ(x|y, t) = ∇x log pθ(x|t) + ∇x log pθ(y|x, t). (14) and sample using the corresponding score functions. We compare various samplers and model parameterizations on classifier accuracy, FID (Heusel et al., 2017) and Incep- tion Score. Quantitative results can be seen in Table 3 and qualitative results seen in Figure 4. We find that MCMC improves performance over reverse sampling, with further improvements from Metropolis corrections. 5.4 Text-2-Image Perhaps the most well-known results achieved with diffusion models are in text-to-image generation (Ramesh et al., 2022; Saharia et al., 2022). Here we model pθ(ximage|ytext). While generated images generated are photo-realistic, they can fail to generate images from prompts which specify multiple concepts at a time (Liu et al., 2022) such as ytext = "A horse on a sandy beach or a grass plain on a not sunny day". To deal with these issues we can dissect the prompt into smaller components y1, . . . , yc, parameterize models conditioned on each component pθ(x|yi) and compose these models using our introduced operators. We can parse the above Figure 5: Metropolis adjustment significantly improves genera- tion performance across sampling steps. As more MCMC steps are run (at each timestep), generation accuracy of combinations of 5 cubes improves significantly. performing the best. All MCMC experiments use the same number of score function evaluations. We include a baseline, labeled "Reverse (equal steps)" which is a diffusion model trained with more steps such that reverse diffusion sampling has the same cost as our MCMC samplers. We see that sim- ply adding more time-steps does not solve compositional sampling. 5.2 Composing Cubes Next, we train models on a dataset of images containing between 1 and 5 examples of various shapes taken from CLEVR (Johnson et al., 2017). We train our models to fit p(x|y) where y is the location of one of the shapes in the image. We then compose this conditional model with itself to create a product model which defines the distribu- tion of images conditioned on c shapes as a distribution log pθ(x|y1, . . . , yc) equal to log pθ(x) + c (cid:88) i=1 (log pθ(x|yi) − log pθ(x)) . (13) We then sample using various methods, where for each num- ber of combination of cubes, the same number of score function evaluations are used, and evaluate each by the frac- tion of samples which have all objects placed in the correct location (as determined by a learned classifier). Results can be found in Table 2, where we see MCMC sampling leads to improvements and the Metropolis adjustment enabled by 7 DaisyPizzaReverseDiffusionHMCGoldenRetrieverValley0510152025Steps of Sampling52.555.057.560.062.565.0AccuracyAccuracy vs MCMC Sampling StepsMALALAReverse Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Figure 6: Energy based parameterization enables high-resolution compositional text-to-image synthesis. Figure 7: Composing text descriptions spatially enables accu- rate specifications of image landscapes. example into "A horse" AND ("A sandy beach" OR "Grass plains") AND (NOT "Sunny") which can be used to define the following (unnormalized) distribution pcomp (x|ytext) θ pθ(x|"A horse")[ 1 2 pθ(x|"A sandy beach")+ 1 2 pθ(x|"Grass plains")] pθ(x|"Sunny")α Liu et al. (2022) demonstrated that composing models this way can improve the efficacy of these kinds of generations, but was restricted to composition using classifier-free guid- ance. We train a energy-parameterized diffusion model for text conditional 64x64 image generation and illustrate com- posed results in Figure 6 (upsampled to 1024x1024). We find that composition enables more faithful generations of scenes in Figure 7 with more results in Appendix A. 5.5 Tapestries of Energy Functions While text-to-image models generate images given natural language prompts, it is difficult to control the spatial loca- tion of different content, and difficult to generate images at higher resolutions than used during training. By composing multiple overlapping text-to-image models, at a variety of scales, we may construct an image tapestry with different 8 Figure 8: Composition enables controllable image tapestries. Different diffusion models are composed at different scales on an images. Captions are shortened, see Appendix G for full text. specified content at different locations and scales. We il- lustrate in Figure 8 using this approach to generate images with content at specified spatial locations and scales. See Appendix G for details. 6 Discussion Limitations. Our work demonstrates that diffusion mod- els, in combination with MCMC-based sampling proce- dures, can be composed in novel ways capable of generating high-quality samples. However, our proposed solutions have a number of drawbacks. First, more sophisticated MCMC samplers come at a higher cost than the standard sampling approach and can take 5-times longer to gener- ate samples than typical diffusion sampling. Second, we have shown that energy-parameterized models enable the use of more sophisticated sampling techniques, garnering further improvements. Unfortunately, this requires a second backward-pass through the model to compute the derivative implicitly, leading them to have double the memory and compute cost of score-parameterized models. While these are considerable drawbacks, we note the focus of this work is to demonstrate that such things are possible within the framework of diffusion models. We believe there is much that can be done to achieve the benefits of our sam- pling procedures at less cost such as distillation (Salimans & "A horse""A horse"AND"Grass plains""A horse"AND"A sandy beach""A horse"AND("A sandy beach" OR "Grass plains")"A horse"AND("A sandy beach" OR "Grass plains")AND(NOT ("Sunny"))"A lake with purple trees.""A lake with purple trees." AND"Purple trees."Starship Enterprise firing phasersGiant mecharobot holding a glowing swordMovie still of epic space battleGlowing phaser beamSun with lens flarePortion of Mars. Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Ho, 2022) and easier-to-differentiate neural networks (Chen & Duvenaud, 2019). Conclusion. We have explored the ways that pretrained diffusion models can be composed to model new distribu- tions. We demonstrate ways that na ̈ıve implementations fail, and present two ways that performance can be improved: MCMC sampling and energy-parameterized diffusion mod- els. Our approach leads to notable improvement across a variety of domains, scales, and compositional operators. In future work, it would further be interesting to explore how such compositional operations may further be applied to related generative models (Wang et al., 2021). Acknowledgements. We gratefully acknowledge support from NSF grant 2214177; from AFOSR grant FA9550-22- 1-0249; from ONR MURI grant N00014-22-1-2740; from ARO grant W911NF-23-1-0034; from the MIT-IBM Watson Lab; and from the MIT Quest for Intelligence. Yilun Du is supported by a NSF Graduate Research Fellowship. References Fan Bao, Min Zhao, Zhongkai Hao, Peiyao Li, Chongxuan Li, and Jun Zhu. Equivariant energy-guided sde for in- verse molecular design. arXiv preprint arXiv:2209.15408, 2022. 4 Julian Besag. Comments on "Representations of knowledge in complex systems" by U. Grenander and MI Miller. J. Roy. Statist. Soc. Ser. B, 56(591-592):4, 1994. 3 Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image syn- thesis. arXiv preprint arXiv:1809.11096, 2018. 1 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. 1 Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Ac- curate and conservative estimates of mrf log-likelihood using reverse annealing. In Artificial Intelligence and Statistics, pp. 102–110. PMLR, 2015. 6 Ricky TQ Chen and David K Duvenaud. Neural networks with cheap differential operators. Advances in Neural Information Processing Systems, 32, 2019. 9 Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat GANs on image synthesis. In Advances in Neural Information Processing Systems, 2021. 1, 3 Yilun Du and Igor Mordatch. Implicit generation and generalization in energy-based models. arXiv preprint arXiv:1903.08689, 2019. 3, 4, 18 Yilun Du, Shuang Li, and Igor Mordatch. Compositional visual generation with energy based models. Advances in Neural Information Processing Systems, 33:6637–6647, 2020a. 4 Yilun Du, Shuang Li, Joshua Tenenbaum, and Igor Mor- datch. Improved contrastive divergence training of energy based models. arXiv preprint arXiv:2012.01316, 2020b. 4 Simon Duane, Anthony D Kennedy, Brian J Pendleton, and Duncan Roweth. Hybrid Monte Carlo. Physics letters B, 195(2):216–222, 1987. 3 Alain Durmus and Eric Moulines. High-dimensional Bayesian inference via the unadjusted Langevin algo- rithm. Bernoulli, 25(4A):2854–2882, 2019. 6 Ruiqi Gao, Yang Song, Ben Poole, Ying Nian Wu, Learning energy-based and Diederik P Kingma. In In- models by diffusion recovery likelihood. ternational Conference on Learning Representations, 2021. URL https://openreview.net/forum? id=v_1Soh8QUNc. 4 Tomas Geffner and Justin Domke. MCMC variational infer- ence via uncorrected Hamiltonian annealing. Advances in Neural Information Processing Systems, 34:639–651, 2021. 3 Tomas Geffner, George Papamakarios, and Andriy Mnih. Score modeling for simulation-based inference. arXiv preprint arXiv:2209.14249, 2022. 5 Will Grathwohl, Kuan-Chieh Wang, J ̈orn-Henrik Jacob- sen, David Duvenaud, Mohammad Norouzi, and Kevin Swersky. Your classifier is secretly an energy based model and you should treat it like one. arXiv preprint arXiv:1912.03263, 2019. 4 Will Grathwohl, Jacob Jin Kelly, Milad Hashemi, Moham- mad Norouzi, Kevin Swersky, and David Duvenaud. No MCMC for me: Amortized sampling for fast and sta- ble training of energy-based models. In International Conference on Learning Representations, 2021. 4 Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local Nash equilibrium. Advances in Neural Information Processing Systems, 30, 2017. 7 Geoffrey E Hinton. Training products of experts by mini- mizing contrastive divergence. Neural Computation, 14 (8):1771–1800, 2002. 1, 2, 4 Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598, 2022. 1, 3 9 Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Infor- mation Processing Systems, 33:6840–6851, 2020. 1, 20, 21 Robert A Jacobs, Michael I Jordan, Steven J Nowlan, and Geoffrey E Hinton. Adaptive mixtures of local experts. Neural Computation, 3(1):79–87, 1991. 1 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 Proceed- ings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 2901–2910, 2017. 7 Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scal- ing laws for neural language models. arXiv preprint arXiv:2001.08361, 2020. 1 image generation with clip latents. arXiv:2204.06125, 2022. 7 arXiv preprint Gareth O Roberts and Richard L Tweedie. Exponential convergence of Langevin distributions and their discrete approximations. Bernoulli, pp. 341–363, 1996. 3, 6 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 understand- ing. arXiv preprint arXiv:2205.11487, 2022. 1, 7 Tim Salimans and Jonathan Ho. Should ebms model the energy or the score? In Energy Based Models Workshop- ICLR 2021, 2021. 6, 18, 19 Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of diffusion models. arXiv preprint arXiv:2202.00512, 2022. 8 Yujia Li, David Choi, Junyoung Chung, Nate Kush- man, Julian Schrittwieser, R ́emi Leblond, Tom Eccles, James Keeling, Felix Gimeno, Agustin Dal Lago, et al. Competition-level code generation with alphacode. arXiv preprint arXiv:2203.07814, 2022. 1 Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Con- ference on Machine Learning, pp. 2256–2265. PMLR, 2015. 1, 2 Nan Liu, Shuang Li, Yilun Du, Josh Tenenbaum, and An- tonio Torralba. Learning to compose visual relations. Advances in Neural Information Processing Systems, 34, 2021. 20 Nan Liu, Shuang Li, Yilun Du, Antonio Torralba, and Joshua B Tenenbaum. Compositional visual genera- tion with composable diffusion models. arXiv preprint arXiv:2206.01714, 2022. 4, 6, 7, 8 Guy Mayraz and Geoffrey E Hinton. Recognizing hand- written digits using hierarchical products of experts. Ad- vances in Neural Information Processing Systems, 13, 2000. 1 Radford M Neal. Monte Carlo implementation. In Bayesian Learning for Neural Networks, pp. 55–98. Springer, 1996. 3, 13, 14 Radford M Neal. Annealed importance sampling. Statistics and Computing, 11(2):125–139, 2001. 5 Erik Nijkamp, Mitch Hill, Tian Han, Song-Chun Zhu, and Ying Nian Wu. On the anatomy of mcmc-based maximum likelihood learning of energy-based models. In Proceed- ings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 5272–5280, 2020. 3, 4, 18 Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. Advances in Neural Information Processing Systems, 32, 2019. 1, 3, 5 Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score- based generative modeling through stochastic differential equations. In International Conference on Learning Rep- resentations, 2021. 4, 5, 17 Gefei Wang, Yuling Jiao, Qian Xu, Yang Wang, and Can Yang. Deep generative learning via schr ̈odinger bridge. In International Conference on Machine Learning, pp. 10794–10804. PMLR, 2021. 9 Jianwen Xie, Yang Lu, Song-Chun Zhu, and Yingnian Wu. A theory of generative convnet. In International Confer- ence on Machine Learning, pp. 2635–2644. PMLR, 2016. 4 Jianwen Xie, Zilong Zheng, and Ping Li. Learning energy- based model with variational auto-encoder as amortized sampler. In Proceedings of the AAAI Conference on Ar- tificial Intelligence, volume 35, pp. 10441–10451, 2021. 4 Hongyi Zhang, Yann N Dauphin, and Tengyu Ma. Fixup initialization: Residual learning without normalization. arXiv preprint arXiv:1901.09321, 2019. 20 10 Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Min Zhao, Fan Bao, Chongxuan Li, and Jun Zhu. Egsde: Unpaired image-to-image translation via energy- guided stochastic differential equations. arXiv preprint arXiv:2207.06635, 2022. 4 11 Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Appendix In this appendix, we present additional text-to-image results in Section A. We present detailed derivations of diffusion models in Section B. We present additional information on MCMC sampling in Section C.1. We provide additional derivations on composing diffusion models in Section D. We discuss different parameterizations of energy based diffusion models in Section E. We further provide additional example 2D compositions in Section F. Finally, we provide experimental details in Section G. A Text-to-Image Results We present additional use cases of composing models in different text-to-image domains. First, in Figure A1, we illustrate how composing two separate energy parameterized diffusion models enables us to more accurately generate images that have more detailed information in the caption. Next, in Figure A2, we illustrate how composing two separate energy parameterized diffusion models further enable us to accurately generate images with the correct colors assigned to each object. We further show in Figure A3 how composing the negation of one energy parameterized diffusion model with another other enables us to generate images where one commonly occurring co-founding factor does occur (i.e. a sandy beach without coastal water). Finally, we illustrate in Figure A4, how composing multiple diffusion models enables us to render the number of objects in a scene accurately. B Detailed Derivation of Diffusion Models Diffusion models seek to model a data distribution q(x0) (written this way for notational convenience) and define a series of latent variables x1, . . . , xT generated from a Markov process xt ∼ q(xt|xt−1) where q(xt|xt−1) = N (cid:16) xt; (cid:112)1 − βtxt−1, βtI (cid:17) . (A1) A unique and useful property of this process is that all time marginals q(xt|x0) can be computed in closed form and are Gaussian (cid:18) q(xt|x0) = N xt; (cid:113) 1 − σ2 t x0, σ2 t I (cid:19) . (A2) where σ2 t = 1 − ̄αt and ̄αt = (cid:81)T t=1(1 − βt). We can see that if all βt > 0, then as t → ∞ q(xt|x0) → N (xt; 0, I). We seek to train a model pθ(xt−1|xt) which reverses q(xt|xt−1) step-wise with a parametric model. We can analytically derive the variance of the reversal as ̃βt = 1− ̄αt−1 1− ̄αt and define and set p(xT ) = N (0, I). We train this model to maximize a variational bound on the marginal likelihood pθ(xt|xt+1) = N (xt; μθ(xt−1, t), ̃βtI) log pθ(x0) ≥ Eq(x1,...,xT |x0)[log pθ(x0|x1) + T (cid:88) t=1 DKL(q(xt|xt−1, x0)||p(xt||xt−1)) + DKL(q(xT |x0)||p(xT ))]. (A3) (A4) (A5) The first term lacks parameters and the final is approximately 0 from the convergence of the q-process so we focus on the middle terms. Typically, the model μθ(xt−t, t) is not parameterized to predict the mean of xt. Instead it is parameterized to predict the noise added to xt to arrive at xt−1. This motivates the following parameterization (cid:19) (cid:18) μθ(xt, t) = 1 √ αt βt√ xt − 1 − ̄αt εθ(xt, t) . In this form we can rewrite the important terms in the objective as E[DKL(q(xt|xt−1, x0)||p(xt||xt−1))] = CtEq(x0)N (ε;0,I) (cid:2)||ε − εθ(xt, t)||2(cid:3) = CtLt(θ) 12 (A6) (A7) Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Figure A1: By composing energy based diffusion models, we can render more detailed information in images. In the above images, we can more accurately render details such as Central Park (top) or the effect of snowing (bottom). where Ct is a time-dependent constant. Typically these are dropped and all objectives are weighted equally. Once we finish training, we can draw samples from our model by first sampling xT ∼ p(xT ) and then equentially sampling xt = μθ(xt−1, t) + ̃βtε where ε ∼ N (0, I). (cid:113) C MCMC Sampling Details C.1 Hamiltonian Monte Carlo and its Variants to sample from an unnormalized probability distribution Hamiltonian Monte Carlo (Neal, 1996) log p(x) = f (x) + log Z. To do this, we augment our distribution over x with auxiliary variables v and define the joint distribution p(x, v) = p(x)N (v; 0, M ) where the covariance M is known as the "mass-matrix." We now seek to draw samples x, v ∼ p(x, v) and since x and v are independent under the joint, we can simply throw away our v samples leaving us with a sample x ∼ p(x). seeks Like other MCMC methods we sequentially update a particle (xi, vi) in such a way that as i → ∞ we arrive at a sample from p(x, v). For a step of HMC, starting at (xi, vi) we first sample vi′ ∼ N (vi; 0, M ) since the target distribution factorizes 13 Central Park 1900s. Its snowy in New York.Central Park 1900s. AND Its snowy in New York.Taj Mahal1900s.Snow falling down.Taj Mahal 1900s.ANDSnowfallingdown Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Figure A2: By composing energy based diffusion models, we can more accurately render different colors of objects in a scene. and p(v) is known and tractable. We then integrate a Hamiltonian-conserving ODE defined on x, v known as "Hamiltonian Dynamics." We can use the leapfrog integrator which will guarantee which is a symplectic integrator. Thus, the Metropolis acceptance probability simplifies to min . An overview of the HMC algorithm can be found in Algorithm 2. We refer the reader to Neal (1996) for a more complete description of the algorithm. 1, p(x′,v′) p(x,v) (cid:16) (cid:17) Since our εθ(x, t) parameterized models do not admit an explicit likelihood function, we use an unadjusted variant of HMC (U-HMC) where the accept/reject step is simply ignored. We can see in Algorithm 2 that at every step, the momentum is re-sampled. This can be sub-optimal, as the momentum determines the initial direction of x's movement and if a good direction is found, it may be beneficial to continue in that direction. To deal with this, Neal (1996) presents a variant of HMC where the momentum v is partially retained between sampling steps. We add an additional sampler parameter γ ∈ [0, 1] (known as the "damping-factor") which controls the amount to which v is retained. When γ is close to 1, v is mostly kept and when it is near 0, v is mostly refreshed. This variant is summarized in Algorithm 3. The (potentially confusing) momentum negations ensure the validity of the sampler. Intuitively, when the proposal is accepted, the momentum is retained and when it is rejected the momentum is flipped. For this reason, one should maintain a reasonably high acceptance rate when using this approach. 14 A red car in front of a pink forestA red car in front of pink forest AND pink forestA lake with purple treesA lake with purple trees AND purple trees Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Figure A3: By composing an energy parameterized diffusion model with the negation of another energy parameterized diffusion model, we can render images in unusual configurations not typically found in the data. Algorithm 2 Hamiltonian Monte Carlo Input: Initial state x0, Mass matrix M , Number of steps N , Number leapfrog steps L, step-size ε for i = 1, . . . , N do Sample vi ∼ N (0, M ) x′, v′ = Leapfrog(xi−1, vi; ε, L) 1, p(x′,v′) a = min p(xi−1,vi) With probability a (cid:16) (cid:17) # Sample momentum # Integrate dynamics with stepsize ε for L steps # Compute acceptance probability else set xi = x′ set xi = xi−1 end for return xN 15 Sandy BeachSandy BanchAND (NOT (Coastal Water))ForestForest AND (NOT (Green Foliage)) Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Figure A4: By composing multiple energy parameterized diffusion models, we can more accurately render the underlying number of objects in ascene. Algorithm 3 Hamiltonian Monte Carlo with Partial Momentum Refreshment Input: Initial state x0, Mass matrix M , Number of steps N , Number leapfrog steps L, step-size ε, damping-factor γ # Sample initial momentum Sample v0 ∼ N (0, M ) for i = 1, . . . , N do λ ∼ N (0, M ) = γvi−1 + (cid:112)1 − γ2λ v(i−1)′ x′, v′ = Leapfrog(xi−1, v(i−1)′ v′ = −v′ a = min With probability a p(x′,v′) p(xi−1,v(i−1)′ ) 1, (cid:16) (cid:17) # Negate momentum # Partially refresh momentum ; ε, L) # Integrate dynamics with stepsize ε for L steps # Compute acceptance probability set xi = x′, vi = v′ else set xi = xi−1, vi = v(i−1)′ vi = −vi end for return xN # Negate momentum C.2 MCMC Tuning A crucial component to ensure successful MCMC sampling in diffusion models is the choice of step sizes for samplers. We initialize step sizes for all samplers at each distribution t to be roughly proportional to the βt noise values added to distribution t in the diffusion process. 16 Two OrangesTwo of the same fruitTwo Oranges AND Two of the same fruit Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC To tune step sizes across timesteps for both HMC and MALA samplers, to set step sizes at each timestep t to be constant multiplied by βt. We searched different constants to multiply βt, and chose a value so that the average acceptance rate of MALA and HMC samplers across timesteps is approximately 60% and 70% respectively. For un-adjusted variants of these samplers, we set step sizes to be the same as adjusted samplers, and found limited gains when step sizes were specifically tuned towards the un-adjusted samplers. We utilize a mass matrix of βt for HMC samplers. Precise details on the exact MCMC steps sizes used in experiments can be detailed in Section G. C.3 MCMC Implementation Details When initially running MCMC sampling on diffusion models in the image domain, we found that our samplers tended to converge to images which had uniform textures. After experimentation, we found that the primary cause of this issue was fact that by default, typical implementations of the reverse diffusion process clip samples at intermediate time-steps of sampling to be between -1 and 1. To enable proper MCMC sampling, we found that it was important to not clip intermediate values of diffusion sampling. When running MCMC sampling on image domains, we further found that it was helpful for mixing to run a single step of the reverse process to initialize MCMC sampling, before running many steps of MCMC sampling at each timestep t, and in all MCMC sampling settings on the image domain, we run one step of the reverse process before running MCMC sampling. Such a MCMC sampling procedure is similar to the predictor-corrector sampling procedure introduced in (Song et al., 2021) for alleviating discretization errors when sampling continuous time diffusion models. D Compositional Diffusions t(xt) = (cid:82) qi(x0)q(xt|x0)dx0, the In Equations 11 and 12, we demonstrate that for diffused distributions {qi diffusion of the product of qi's is not the same as the product of the diffusions, meaning plugging the product of diffusions into standard reverse diffusion sampling will not draw samples from the product model. We present similar results for tempering and predictive model composition. t(xt)} where qi D.1 Sampling from a tempered version of q using diffusion? It is tempting to believe that we can sample from a tempered/annealed version of the data distribution qλ(x) ∝ q(x)λ using the tempered diffused data distribution λ∇ logt q(xt) but this is incorrect. For this procedure to be correct, we would need to have ∇ log qλ 0 (x0) = λ∇ log q0(x0), this equality does not hold for t > 0 t (xt) = λ∇ log qt(xt) for all t. However, while we do have ∇ log qλ ∇ log qλ t (xt) = ∇ log (cid:90) qλ(x0)q(xt|x0)dx0 (cid:90) ̸= λ∇ log q(x0)q(xt|x0)dx0 = λ∇ log qt(xt). D.2 Guidance For conditional generation, we should use in the reverse diffusion the score of the diffused conditional distribution ∇ log qt(xt|y) where (cid:90) qt(xt|y) = q(x0|y)q(xt|x0)dx0. We also have so that ∇ log qt(xt|y) = ∇ log qt(xt) + ∇ log qt(y|xt) ∇ log qt(y|xt) := ∇ log qt(xt|y) − ∇ log qt(xt) 17 Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC allows you to do guidance without having to train say a classifier if y is categorical. In practice, it was found that using in the reverse time diffusion the score ∇ log qt(xt) + λ∇ log qt(y|xt) generates much nicer images for λ > 1. However, it is also often claimed that it samples from a modified posterior where the likelihood has been annealed. This is incorrect. For a modified posterior with annealed likelihood, we would have and it is not true again that qλ(x0|y) ∝ q(x0|y) {q(y|x0)}λ ∇ log qλ t (xt|y) = ∇ log (cid:90) qλ(x0|y)q(xt|x0)dx0 ̸= ∇ log qt(xt) + λ∇ log qt(y|xt). D.3 Sampling from Composed Distributions We can see that products, tempering, and guidance applied to diffused distributions do not give diffusions of the modified target distributions. Thus, we should not expect to arrive at our desired result by applying a sampling procedure which reverses a diffusion applied to the target distribution. Thankfully, as stated in Section 4, these operators do give us a sequence of distributions which anneals from N (0, I) to the composed target which means we can utilize the family of annealed MCMC sampling methods mentioned in Section 4.1 to draw samples from our composed models in all of these settings, directly using the available score estimate. E Energy-Based Parameterizations As mentioned in section 4.2, when using the εθ(x, t) parameterization, we can recover an estimate of the time-conditional score function with ∇x log pt(x) ≈ − εθ(x,t) . This estimate of the log-likelihood gradient can be used for MCMC sampling methods which only require the log-likelihood gradient – such as ULA or U-HMC. These methods can work well, but will never generate exact samples when using non-zero step-sizes. Exact samplers can be derived from approximate samplers like the above methods using Metropolis corrections. Unfortunately, even if the samplers' transition distribution k(*, *) does not require log pθ(xt) evaluation, the Metropolis correction probability: σt (cid:18) min 1, efθ(ˆx) efθ(xt−1) k(xt−1|ˆx) k(ˆx|xt−1) (cid:19) does. Futhermore, when we only have an estimate of the score at our disposal, we are only able to compose models using products. To enable the use of Metropolis corrections and more compositional operators, we propose to change the parameterization of our diffusion model. Instead of using a neural net εθ(x, t) : {Rd × N} → Rd, we define a scalar-output neural network fθ(x, t) : {Rd × N} → R. We then compute the gradient of this function and define εθ(x, t) = ∇xfθ(x, t). From here, we use this implicitly-defined εθ(x) as in standard diffusion model training. As before, we can recover ∇x log pt(x) ≈ − εθ(x,t) , but now we are also able to recover log pt(x) ≈ − fθ(x,t) + log Z which enables the application of Metropolis corrected sampling. σt σt Much prior work on EBMs parameterizes fθ(x, t) using a feed-forward neural network, whose final layer has a single output (Nijkamp et al., 2020; Du & Mordatch, 2019). Salimans & Ho (2021) compare this approach with the standard εθ(x, t) parameterization and find the εθ(x, t) parameterization to perform better for unconditional image generation. We believe this has to do with the relative sparsity of the gradients of feed-forward neural networks. This can cause difficulties when training to optimize a function of their implicitly computed gradients. Intriguingly, Salimans & Ho (2021) also explore a more structured energy function definition inspired by denoising autoencoders: f DAE θ (x, t) = − ||x − sθ(x, t)||2 1 2 18 Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC where sθ(x, t) : {Rd × N} → Rd is a neural network (identical to the standard εθ(x, t)) model. We can simply evaluate the gradients of this function to obtain ∇xf DAE θ (x, t) = (x − sθ(x, t)) − (x − sθ(x, t))∇xsθ(x, t). In their study, this parameterization was found to perform near identically to the εθ(x, t) parameterization while admitting an explicit energy function. We believe this energy parameterization performs better because its gradients include the feed- forward network sθ(x, t), making optimization easier. Salimans & Ho (2021) conclude that the εθ(x, t) parameterization should be favored since the computing ∇xf DAE (x, t) requires computing ∇sθ(x, t) which requires an extra backward pass through the neural network, increasing compute. θ We reexamine this energy parameterization and two other choices now that our application motivates having access to an explicit energy function. The other parameterizations are based different transformations of the sθ(x, t) architecture; the negative L2 norm (L2) and an inner product (IP). They are defined as: and f L2 θ (x, t) = − 1 2 ||sθ(x, t)||2 ∇xf L2(x, t) = −sθ(x, t)∇xsθ(x, t) f IP θ (x, t) = xT sθ(x, t) ∇xf IP (x, t) = sθ(x, t) + xT ∇xsθ(x, t). We train models with each parameterization on ImageNet and compare using FID for unconditional sampling. Results can be seen in Table A1. We see that L2 and Inner-Product perform the best, but are both outperformed by the standard parameterization. We initially experimented with these two parameterizations but found that the L2-norm parameterization to be more stable for compositional sampling due, we believe, to the fact that the energy-function is bounded above meaning that MCMC sampling is incapable of running off to infinity to increase likelihood. Parameterization (1) DAE (2) L2 Norm (3) Inner-Product εθ(x, t) 97.4 91.5 90.9 86.7 Table A1: FID (1k samples) of various energy-parameterizations on unconditional ImageNet generation. F Synthetic Distribution Compositions Mixture We provide additional 2D illustrations of mixtures of two diffusion models in Figure A5. We find that HMC sampling enables more accurate mixtures of different synthetic distributions. Figure A5: Examples of mixture applied to diffusion models. Left to right: Component distributions, reverse diffusion, HMC sampling. Reverse diffusion fails to sample accurately from mixed distributions distributions. Negation We provide additional 2D illustrations of negating two diffusion model with respect to each other in Figure A7. We find that HMC sampling enables accurate negations of different sythetic distributions. Failure Cases Next we illustrate a failure case of composition using our approach in Figure A7. Our approach fails to generate the product of two distribution when they are disjoint with respect to each other. 19 p!(x)p"(x)=ReverseDiffusionHMC=++ Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC Figure A6: Examples of negation applied to diffusion models. Left to right: Component distributions, reverse diffusion, HMC sampling. Reverse diffusion fails to sample accurately from negated distributions. Figure A7: Failure Cases of Our Approach. Left to right: Component distributions, reverse diffusion, HMC sampling. Our approach fails to generate products of distributions with no overlap. G Experimental Details We provide detailed experimental details including underlying quantitative metrics, training details, and architectures on 2D synthetic, CLEVR, ImageNet, and test-to-image settings below. To enable stable training of energy-based diffusion models in image settings, we clip gradient norms to be less than 10, and initialize convolutional layers using zero-initialization (Zhang et al., 2019). Synthetic Datasets For synthetic datasets, we train both score and energy based diffusion models using a small residual MLP model with 4 residual blocks, with a internal hidden dimension of 128 dimensions. We train models for 15000 iterations (10 minutes on a 8 TPUv2 cores) using the Adam optimizer with learning rate of 1e-3, and train diffusion models on 100 discrete timesteps with linear schedule of β values. When evaluating product of diffusion models, we generate two separate distributions, where train two separate diffusion mod- els. In our first distribution, we construct a GMM of 8 Gaussians in a ring of radius 0.5 around the origin, with each Gaussian having a standard deviation of 0.3. In our second dataset, we construct a uniform distribution of points with x between -0.1 and 0.1 and y between -1 and 1. When evaluating mixture diffusion models, we generate one distribution consisting of a mix- ture of 3 Gaussian with standard deviation 0.03 and centers at (−0.25, 0.5), (−0.25, 0.0), (−0.25, −0.5), and another distri- bution consisting of a mixture of 3 Gaussian with standard deviation 0.03 and centers at (0.25, 0.5), (0.25, 0.0), (0.25, −0.5). To construct MCMC samplers from models on synthetic datasets, we run 3 steps of HMC per timestep, with 3 leapfrog steps per step of HMC. We run 10 steps of MALA sampling per timestep. We found that MCMC performed robustly in the 2D dimensional setting and set the step size of MALA to be 0.002 across all distributions and the step size of HMC to be 0.03 across all distributions (with a mass matrix of 1) CLEVR For CLEVR, we generated a dataset of 200,000 64 × 64 images with between 1 to 5 different cubes using dataset generation code in (Liu et al., 2021). To evaluate the accuracy in which generated images had cubes at each specified position, we trained a binary classifier on these images, and marked a cube as correctly generated if the confidence of the binary confidence of classifier is greater than 0.5. To parameterize our diffusion architecture, we follow the architecture of (Ho et al., 2020), where we use a base hidden dimension of 128, and multiply the hidden dimensions by [1, 2, 3, 4] at different resolutions of the image. We utilize 3 20 p!(x)p"(x)-=ReverseDiffusionHMC-=×p!(x)p"(x)=ReverseDiffusionHMC=× Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC residual blocks at each resolution of the image. We trained diffusion models with 100 discrete timesteps with a linear β schedule. CLEVR models were trained for 20000 iterations with a batch size of 1024 using the Adam optimizer with step size 1e-4, corresponding to roughly 8 hours on 8 TPUv2 cores. To initialize MCMC sampling on the CLEVR domain, at each timestep, before applying MCMC sampling, we run one step of the reverse process in the trained diffusion model. We run 40 steps of MCMC sampling per timestep for MALA samplers, and 13 steps of HMC sampling (with 3 leapfrog step per HMC step) (with the mass matrix of HMC samplers set to β). We use HMC with partial momentum refreshment, and use a dampening coefficient of 0.9 across HMC iterations. MALA step sizes are set to 0.035 ∗ βt , and HMC step sizes are set to 0.1 ∗ βt For ImageNet, we train an unconditional diffusion model 128 × 128 images. We train diffusion models for 1 ImageNet million iterations of ImageNet with a batch size of 64 (3 days on 16 TPUv2 cores), using Adam optimizer with learning rate 1e-4, for 1 million iterations. We train diffusion models with 1000 discrete timesteps using the cosine beta schedule. On the ImageNet dataset, we report three seperate metrics. To report classifier accuracy, we feed generated sample into a ImageNet classifier trained on clean images, and label a image as correctly generated if the classifier of a generated image having the specified class is greater than 50%. We further report the Inception Score and FID, which are calculated on 50000 generated samples. We follow the architecture of (Ho et al., 2020), where we use a base hidden dimension of 128 and multiply the hidden dimensions by [1, 1, 2, 3, 4] at the different resolution of the image. We utilize 2 residual blocks at each resolution of the image. To initialize MCMC sampling on the ImageNet domain, at each timestep, before applying MCMC sampling, we run one step of the reverse process in the trained diffusion model. We run 6 steps of MCMC sampling per timestep for MALA samplers, and 2 steps of HMC sampling (with 3 leapfrog steps per HMC step and with the mass matrix of HMC samplers set to β). MALA step sizes are set to 0.5 ∗ βt , and HMC step sizes are set to 0.6 ∗ β1.5 t Text-to-Image For text-to-image models, we train models for one week on an internal text/image dataset consisting of 400 million images using 32 TPUv3 cores, with a training data batch size of 256. We train our energy-based text-to-image model using a total of 1000 timesteps with a cosine beta schedule. We follow the architecture of (Ho et al., 2020), where we use a base hidden dimension of 256, and multiply the hidden dimensions by [1, 2, 3, 4] at different resolution of the image. We utilize 3 residual blocks at each resolution of the image. To upsample images from 64 × 64 resolution to 1024 × 1024 resolution, we utilize two trained unconditional diffusion models, one trained to upsample from 64×64 resolution to 256×256 resolution and one trained to upsample from 256×256 resolution to 1024 × 1024 resolution. To initialize MCMC sampling on the text-to-image domain, at each timestep, before applying MCMC sampling, we run one step of the reverse process in the trained diffusion model. We ran 2 steps of HMC sampling per timestep, with 3 leapfrog step per HMC step and a mass matrix of HMC samplers set to β). We use HMC with partial momentum refreshment, and use a dampening coefficient of 0.9 across HMC iterations. HMC step sizes are set to 0.1 ∗ βt. Image Tapestries To construct image tapestries, we used the Imagen 64x64 base diffusion model. We did not use the Imagen super-res stages. We arranged overlapping image models, with one placed every 32 pixels on a grid horizontally and vertically (so each image model overlapped by 50% with its neighbors to the left, right, top, and bottom). We additionally applied 2x2 average-pooling to the canvas, and applied an image model to the resulting downsampled image, to capture global structure at a lower resolution. Each image model was given its own text prompt, as shown in Figures 1d and 7. All image models used a guidance weight of 30. The full captions used in in Figure 1(d) are "A detailed oil painting of a fantastical ocean scene, with a mermaid, a ship, a lighthouse, and a whale", "A detailed closeup of a fantastical oil painting showing a large sailing ship", "A detailed closeup of a fantastical oil painting showing a mermaid sunning herself", "A detailed closeup of a fantastical oil painting showing a lighthouse", "A detailed closeup of a fantastical oil painting showing a curious whale surfacing", and "A detailed closeup of a oil painting of the ocean". The full captions used in Figure 8 are "Detailed movie still of an epic space battle. The starship Enterprise fights a giant mech robot over the planet Mars", "Detailed closeup of a movie still. The starship Enterprise in a space battle, firing its phasers. NCC-1701", "Detailed closeup of a movie still. A giant mecha robot is fighting in space, holding a glowing sword", "Detailed closeup of a movie still of an epic space battle, showing glowing phaser beams", "Detailed closeup of a movie still of an epic space battle. Sun with lens flare", and "Detailed closeup of a movie still of an 21 Reduce, Reuse, Recycle: Compositional Generation with Energy-Based Diffusion Models and MCMC epic space battle, showing a portion of the red planet Mars. Debris falling into the atmosphere". Imagen models produce an score estimate corresponding to the Gaussian noise vector εt between the image xt at time t and the predicted image x0 at time 0. In order to combine the score function from the overlapping models, we took a weighted sum of their estimated noise vectors, and normalized the resulting vector to have variance 1. The highest resolution models were given a weight of 1. The coarse resolution model was given a weight of [downsampling fraction] = 0.25. Since it is applied over 4 times as many pixels, this corresponds to an equal weighting of the coarse and fine scale energy functions that tile the canvas. In order to hide seams, weights were linearly tapered to 0 near the image edge, with the tapering performed over the outer 6 pixels. We use 2 steps of LA sampling after each ancestral sampling step, so as to better approach the equilibrium distribution of the composed energy functions. We performed 256 ancestral sampling steps. We did not perform LA sampling for the final 16 ancestral sampling steps. 22
http://arxiv.org/abs/2302.11550v1
2023-02-22T18:47:51
2023-02-22T18:47:51
Scaling Robot Learning with Semantically Imagined Experience
Recent advances in robot learning have shown promise in enabling robots to perform a variety of manipulation tasks and generalize to novel scenarios. One of the key contributing factors to this progress is the scale of robot data used to train the models. To obtain large-scale datasets, prior approaches have relied on either demonstrations requiring high human involvement or engineering-heavy autonomous data collection schemes, both of which are challenging to scale. To mitigate this issue, we propose an alternative route and leverage text-to-image foundation models widely used in computer vision and natural language processing to obtain meaningful data for robot learning without requiring additional robot data. We term our method Robot Learning with Semantically Imagened Experience (ROSIE). Specifically, we make use of the state of the art text-to-image diffusion models and perform aggressive data augmentation on top of our existing robotic manipulation datasets via inpainting various unseen objects for manipulation, backgrounds, and distractors with text guidance. Through extensive real-world experiments, we show that manipulation policies trained on data augmented this way are able to solve completely unseen tasks with new objects and can behave more robustly w.r.t. novel distractors. In addition, we find that we can improve the robustness and generalization of high-level robot learning tasks such as success detection through training with the diffusion-based data augmentation. The project's website and videos can be found at diffusion-rosie.github.io
[ "Tianhe Yu", "Ted Xiao", "Austin Stone", "Jonathan Tompson", "Anthony Brohan", "Su Wang", "Jaspiar Singh", "Clayton Tan", "Dee M", "Jodilyn Peralta", "Brian Ichter", "Karol Hausman", "Fei Xia" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11550v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11550v1", "@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.AI", "cs.CL", "cs.CV", "cs.LG" ]
3 2 0 2 b e F 2 2 ] O R . s c [ 1 v 0 5 5 1 1 . 2 0 3 2 : v i X r a Scaling Robot Learning with Semantically Imagined Experience Tianhe Yu1, Ted Xiao1, Austin Stone1, Jonathan Tompson1, Anthony Brohan1, Su Wang2, Jaspiar Singh1, Clayton Tan1, Dee M1, Jodilyn Peralta1, Brian Ichter1, Karol Hausman1, Fei Xia1 1Robotics at Google, 2Google Research Project website: https://diffusion-rosie.github.io Abstract: Recent advances in robot learning have shown promise in enabling robots to perform a variety of manipulation tasks and generalize to novel scenarios. One of the key contributing factors to this progress is the scale of robot data used to train the models. To obtain large-scale datasets, prior approaches have relied on either demonstrations requiring high human involvement or engineering-heavy autonomous data collection schemes, both of which are challenging to scale. To mitigate this issue, we propose an alternative route and leverage text-to-image foundation models widely used in computer vision and natural language processing to obtain meaningful data for robot learning without requiring additional robot data. We term our method Robot Learning with Semantically Imagened Experience (ROSIE). Specifically, we make use of the state of the art text-to-image diffusion models and perform aggressive data augmentation on top of our existing robotic manipulation datasets via inpainting various unseen objects for manipulation, backgrounds, and distractors with text guidance. Through extensive real-world experiments, we show that manipulation policies trained on data augmented this way are able to solve completely unseen tasks with new objects and can behave more robustly w.r.t. novel distractors. In addition, we find that we can improve the robustness and generalization of high-level robot learning tasks such as success detection through training with the diffusion-based data augmentation. 1 Introduction Though recent progress in robotic learning has shown the ability to learn a number of language- conditioned tasks [1, 2, 3, 4], the generalization properties of such policies is still far less than that of recent large-scale vision-language models [5, 6, 7]. One of the fundamental reasons for these limitations is the lack of diverse data that covers not only a large variety of motor skills, but also a variety of objects and visual domains. This becomes apparent by observing more recent trends in robot learning research – when scaled to larger, more diverse datasets, current robotic learning algorithms have demonstrated promising signs towards more robust and performant robotic systems [1, 2]. However, this promise comes with an arduous challenge: it is difficult to significantly scale up diverse, real-world data collected by robots as it requires either engineering-heavy autonomous schemes such as scripted policies [8, 9] or laborious human teleoperations [10, 2]. To put it into perspective, it took 17 months and 13 robots to collect 130k demonstrations in [2]. In [8], the authors used 7 robots and 16 months to collect 800k autonomous episodes. While some works [11, 12, 13] have proposed potential solutions to this conundrum by generating simulated data to satisfy these robot data needs, they come with their own set of challenges such as generating diverse and accurate enough simulations [1] or solving sim-to-real transfer [14, 15]. Can we find other ways to synthetically generate realistic diverse data without requiring realistic simulations or data collection on real robots? To investigate this question we look to the field of computer vision. Traditionally, synthetic generation of additional data, whether to improve the accuracy or robustify a machine learning model, has been addressed through data augmentation techniques. These commonly include randomly perturbing the images including cropping, flipping, adding noise, augmenting colors or changing brightness. While Correspond to {tianheyu,xiafei}@google.com. Figure 1: We propose using text-guided diffusion models for data augmentation within the sphere of robot learning. These augmentations can produce highly convincing images suitable for learning downstream tasks. As demonstrated in the figure, some of the objects were produced using our system, and it is difficult to identify which are real and which are generated due to the photorealism of our system. effective in some computer vision applications, these data augmentation strategies do not suffice to provide novel robotic experiences that can result in a robot mastering a new skill or generalizing to semantically new environments [15, 16, 17]. However, recent progress in high-quality text-to-image diffusion models such as DALL-E 2 [5], Imagen [6] or StableDiffusion [18] provides a new level of data augmentation capability. Such diffusion-based image-generation methods allow us to move beyond traditional data augmentation techniques, for three reasons. First, they can meaningfully augment the semantic aspects of the robotic task through a natural language interface. Second, these methods are built on internet-scale data and thus can be used zero-shot to generate photorealistic images of many objects and backgrounds. Third, they have the capability to meaningfully change only part of the image using methods such as inpainting [19]. These capabilities allow us to generate realistic scenes by incorporating novel distractors, backgrounds, and environments while reflecting the semantics of the new task or scene – essentially distilling the vast knowledge of large generative vision models into robot experience. As an example, given data for a task such as "move the green chip bag near the orange", we may want to teach the robot to move the chip bag of any colors near many new objects that it has not interacted with, such as "move the yellow chip bag near the peach" (Fig 1). These techniques allow us to exchange the objects from real data for arbitrary relevant objects. Furthermore, they can leave the semantically relevant part of the scene untouched, e.g. the grasp of the chip bag remains, while the orange becomes a peach. This results in a novel, semantically-labelled data point to teach the model a new task. Such a technique can reasonably generate many more examples such as "move the apple near the orange on a wooden desk", "move the plum near the orange", or even "place the coke can in the sink". In this paper, we investigate how off-the-shelf image-generation methods can vastly expand robot capabilities, enabling new tasks and robust performance. We propose Robot Learning with Semantically Imagened Experience (ROSIE), a general and semantically-aware data augmentation strategy. ROSIE works by first parsing human provided novel instructions and identifying areas of the scene to alter. It then leverages inpainting to make the necessary alterations, while leaving the rest of the image untouched. This amounts to a free lunch of novel tasks, distractors, semantically meaningful backgrounds, and more, as generated by internet-scale-trained generative models. We demonstrate this approach on a large dataset of robotic data and show how a subsequently trained policy is able to perform novel, unseen tasks, and becomes more robust to distractors and backgrounds. Moreover, we show that ROSIE can also improve the robustness of success detection in robotic learning especially in out-of-distribution (OOD) scenarios. 2 Related Work Scaling robot learning. Given the recent results on scaling data and models in other fields of AI such as language [20, 21, 22] and vision [23, 24, 7], there are multiple approaches trying to do the same in the field of robot learning. One group of methods focuses on scaling up robotic data via simulation [1, 4, 25, 13, 26, 27, 28, 29] with the hopes that the resulting policies and methods will transfer to the real world. The other direction focuses on collecting large diverse datasets in the real world by either teleoperating robots [30, 10, 2, 31] or autonomously collecting data via reinforcement 2 learning [8, 32, 9] or scripting behaviors [33]. In this work, we present a complementary view on scaling the robot data by making use of state-of-the-art text-conditioned image generation models to enable new robot capabilities, tasks and more robust performance. Data augmentation and domain randomization. Domain randomization [14, 34, 35] is a common technique for training machine learning models on synthetically generated data. The advantage of domain randomization is that it makes it possible to train models on a wide variety of data to improve generalization. Domain randomization usually involves changing the physical parameters or rendering parameters (lighting, texture, backgrounds) in simulation models [36, 37, 38, 39]. Others use data augmentation to transformer simulated data to be more realistic [15, 16, 40, 41] or vice-versa [42]. Contrary to these methods, we propose to directly augment data collected in the real world. We operate directly on the real-world data and leverage diffusion models to perform photorealistic image manipulation on this data. Diffusion models for robot control. Though diffusion models [43, 44, 45, 46, 47, 48, 49, 50, 6, 5] have become common-place in computer vision, their application to robotic domains is relatively nascent. Janner et al. [51] uses diffusion models to generate motion plans in robot behavior synthesis. Some works have used the ability of image diffusion models to generate images and perform common sense geometric reasoning to propose goal images fed to object-conditioned policies [52, 53]. The recent concurrent works CACTI [54] and GenAug [55] are most similar to ours. CACTI proposes to use diffusion model for augmenting data collected from the real world via adding new distractors and requires manually provided masks and semantic labels. GenAug explores the usage of depth-guided diffusion models for augmenting new tasks and objects in real-world robotic data with human-specified masks and object meshes. In contrast, our work generates both novel distractors and new tasks without requiring depth. In addition, it automatically selects regions for inpainting with text guidance and leverages text-guided diffusion models to generate novel, realistic augmentations. 3 Preliminaries Diffusion models and inpainting. Diffusion models are a class of generative models that have shown remarkable success in modeling complex distributions [43]. Diffusion models work through an iterative denoising process, transforming Gaussian noise into samples of the distribution guided by a mean squared error loss. Many such models also have the capability for high-quality inpainting, essentially filling in masked areas of an image [56, 57, 58, 19]. In addition, such approaches can be guided by language, thus generating areas consistent with both a language prompt and the image as a whole [59]. Multi-task language-conditioned robot learning. Herein we learn vision and language-conditioned robot policies via imitation learning. We denote a dataset D := {ej}N j=1 of N episodes e = {(oi,ai,oi+1,(cid:96))}T i=1 where o denotes the observation, which correspond to the image in our setting, a denotes the action, and (cid:96) denotes the language instruction of the episode, identifying the target task. We then learn a policy π(*|oi,(cid:96)) to generate an action distribution by minimizing the negative-log liklihood of actions, i.e. behavioral cloning [60]. To perform large-scale vision-language robot learning, we train the RT-1 architecture [2], which utilizes FiLM-conditioned EfficientNet [61], a TokenLearner [62], and a Transformer [63] to output actions. 4 Robot Learning with Semantically Imagened Experience (ROSIE) In this section, we introduce our approach, ROSIE, an automated pipeline for scaling up robot data generation via semantic image augmentation. We assume that we have access to episodes of state and action pairs demonstrating a robot executing a task that is labelled with a natural language instruction. As the first step of the pipeline we augment the natural language instruction with a semantically different circumstance. For example, given a demonstration of placing an object in an empty drawer, we add "there is a coke can in the opened drawer". With this natural language prompt, ROSIE generates the mask of the region of interest that is relevant to the language query. Next, given the augmentation text, ROSIE performs inpainting on the selected mask with Imagen Editor [59] to insert semantically accurate objects that follow the augmented text instruction. Importantly, the entire process is applied throughout the robot trajectory, which is now consistently augmented across all the time steps. We present the overview of this pipeline in Fig. 2. We describe the details of each component of ROSIE in the following sections. In Section 4.1, we show how we obtain the mask of the target region using open vocabulary segmentation. In Section 4.2, we discuss two main approaches to proposing prompts used for Imagen Editor, which can be either specified manually or generated automatically with a 3 Figure 2: The proposed architecture of ROSIE. First, we localize the augmentation region with open vocabulary segmentation model. Second, we run Imagen Editor to perform text-guided image editing. Finally, we use the augmented data to train an RT-1 manipulation policy [2]. Concretely, we explain ROSIE using the example shown in the figure as follows. We take the original episode with the instruction "place coke can into top drawer" and the goal is to add distractors in the opened drawer to improve the robustness of the policy. For each image in the episode, we detect the masks of the open drawer, the robot arm, and the coke can using our first step. We obtain the mask of the target region to add the distractor via subtracting the masks of the robot arm and the coke can that is picked up from the mask of the open drawer. Then, we generate our augmentation proposal leveraging LLMs as described in Section 4.2. We run Imagen Editor with the augmentation text and the selected mask to generate a coke can in the drawer discussed in Section 4.3. We combine both the original episodes and the augmented episodes and perform policy training using multi-task imitation learning. large language model. In Section 4.3, we discuss how we perform inpainting with Imagen Editor based on the augmentation prompt. Finally, we show how we use the generated data in downstream tasks such as policy learning and learning high-level tasks such as success detection in Section 4.4. Figure 3: Our augmentation scheme generates more targeted and physically realistic augmentations that are useful for learning downstream tasks, while other text-to-image generation methods such as InstructPix2Pix [64] often makes global changes rendering the image unusable for training. 4.1 Augmentation Region Localization using Open Vocabulary Segmentation In order to generate semantically meaningful augmentations on top of existing robotic datasets, we first need to detect the region of the image where such augmentation should be performed. To this end, we perform open-vocabulary instance segmentation leveraging the OWL-ViT open-vocabulary detector [65] with an additional instance segmentation head. This additional head predicts fixed resolution instance masks for each bounding box detected by OWL-ViT (similar in style to 4 Source task: place coke can into top drawerTarget Task: place coke can into cluttered top drawerMask Region LocalizationImagen EditorInpainting prompt: Add a can of coke into the drawerRT-1 TrainingLLMProposed AugmentationsViT region prompt: opened drawerpassthrough object prompt: robot arm, robot gripper Inpainting prompt: Add a toy block in the drawer, the block has different colors PromptLLM-assisted Augmentation Prompt GenerationImageMaskEncoder 1Encoder 2256 x 256 SR64 x 64 Base❄ T5-XXL EncoderPromptOutputImagen EditorInpainting prompt: Add a toy block in the drawer, the block has different colors LLM" Add a can of coke ..""Add a coke to the drawer"InstructPix2Pix"Add a coke to the drawer"ROSIE(Ours)Original Figure 4: Augmentations of in-hand objects during manipulation. We show examples where ROSIE effectively inpaint novel objects into the original in-hand objects during manipulation. On the top row, we show the original episode with detected masks where the robot picks up the green chip bag. On the following row, we show that ROSIE can inpaint various microfiber cloth with different colors and styles into the original green chip bag. For example, we can simply pass the original episode with the masks and the prompt Robot picking up a polka dot cloth to get an episode the robot picking such cloth in a photorealistic manner. Mask-RCNN [66]). In particular, we freeze the main OWL-ViT model and fine-tune a mask head on Open-Images-V5 instance segmentations [67, 68]. The instance segmentation model provided by OWL-ViT requires a language query that specifies which part of the image should be detected. We can generate masks for objects that the robot arm interacts with. Given each episode e in our robotic dataset, we first identify the target objects specified in the language instruction (cid:96). For example, if (cid:96) is "pick coke can", the target object of the task is a coke can. We pass the target object as a prompt to the OWL-ViT model to perform segmentation and obtain the resulting mask. We can also generate masks in regions where distractors can be inpainted to improve the robustness of policy. In this setting, we use the OWL-ViT to detect both the table (shown in Figure 2) and all the objects on the table. This allows us to sample a mask on the table in a way that it does not overlap with existing objects (which we call passthrough objects). We provide more examples of masks detected by OWL-ViT from our robotic dataset in Figure 5. 4.2 Augmentation Text Proposal Next, we discuss two main approaches to attain the augmentation prompt for the text-to-image diffusion model: hand-engineered prompt and LLM-proposed prompt. 5 Original + detectionRobot picking up a [ ] clothredblueblueand white stripepolkadot Figure 5: We show the original images from RT-1 datasets on the top row and the images with detected masks and mask labels on the bottom row. Hand-engineered prompt. The first method involves manually specifying the object to augment. For generating new tasks, we choose objects that lie outside of our training data to ensure that the augmentations are able to expand the data support. For improving robustness of the learned policy and success detection, we randomly pick objects that are semantically meaningful and add them in the prompt to generate meaningful distractors in the scene. For example, in Figure 4 where we aim to generate novel in-hand objects by replacing the original object (green chip bag) with various microfiber cloth, we use the following prompt Robot picking up a blue and white stripe cloth to effectively perform inpainting. LLM-proposed prompt. While hand-engineered prompt may guarantee the generated data to be out-of-distribution, it makes the data generation process less scalable. Therefore, we propose to leverage the power of large language models in proposing objects to augment. We leverage the rich semantics learned in LLMs to propose a vast list of objects with detailed descriptions of visual features for augmentation. We employ GPT-3 [20] as our choice of LLM to propose the augmentation text. In particular, we specify the original task of the episode and the target task after augmentation in the LLM prompt, and ask the LLM to propose the OWL-ViT prompt for detecting masks of both the target region and the passthrough objects. We present an example of LLM-assisted augmentation prompt proposal in Figure 2, where LLM-generated augmentation text is highly informative, which in turn benefits the text-guided image editing. Therefore, we use LLM-proposed prompts in our experiments. Despite that there is some noise in the LLM-proposed prompts (see Appendix C), it generally does not hurt robotic control performance in practice. 4.3 Diffusion Model for Text-Guided Inpainting Given the segmentation mask and the augmentation prompt, we perform text-guided image editing via a text-to-image diffusion model. Herein, we use Imagen Editor [59], the latest state-of-the-art text-guided image inpainting model fine-tuned on pre-trained text-to-image generator Imagen [6], though we note that our approach, ROSIE, is agnostic to the choice of inpainting models. Imagen Editor [59] is a cascaded diffusion architecture. All of the diffusion models, i.e., the base model and super-resolution (SR) models (i.e., conditioned on high-resolution 1024×1024 image and mask inputs) are trained with new convolutional image encoders shown in the bottom right corner of Figure 2. Imagen Editor is capable of generating high-resolution photorealistic augmentations, which is crucial for robot learning as it relies on realistic images capturing physical interactions. Moreover, Imagen Editor is trained to de-noise object-oriented masks provided by off-the-shelf object detectors [69] along with random box/stroke masks [70], enabling inpainting with our mask generation procedure. To summarize more formally, given a robotic episode e = {(oi,ai,oi+1,(cid:96))}T i=1, the mask m designating the target area(s) to be modified, and our generated augmentation text (cid:96)aug, we iteratively query Imagen Editor with input oi, m and (cid:96)aug over i = 1,...,T . As a result, Imagen Editor generates the masked region according to the input text (cid:96)aug (e.g. inserting novel objects or distractors) while ensuring consistency with the unmasked and unedited content of oi. This results in generating augmented image ̃oi. In 6 (a) (b) (c) Figure 6: We show visualizations of the episodes generated by ROSIE where we replace the regular tabletop in front of the robot with a dish rack, a marble sink and a wooden counter, which never appears in the training dataset. Our results in Section 5.1 and Figure 7 show that the policy trained on such augmentations enables the robot to place objects into a real metal sink. scenarios where (cid:96)aug creates a new task, we modify the instruction (cid:96) to ̃(cid:96). For example, as shown in Figure 4 where we replace the green chip bag with various styles of microfiber cloth, we modify the original instruction (cid:96) = "pick green rice chip bag" to ̃(cid:96) = "pick blue microfiber cloth", pick "polka dot microfiber cloth" and etc. The actions {ai}T i=1 remain unchanged, as Imagen Editor alters novel objects consistently with the semantics of overall image. In summary, ROSIE eventually yields the augmented episode ̃e = {( ̃oi,ai, ̃oi+1, ̃(cid:96))}T i=1. Powered by the expressiveness of diffusion models and priors learned from internet-scale data, ROSIE is able to provide physically realistic augmentations (e.g. Figure 3) that are valuable in making robot learning more generalizable and robust, which we will show in Section 5. 4.4 Manipulation Model Training The goal of the augmentation is to improve learning of downstream tasks, e.g. robot manipulation. We train a manipulation policy based on Robotics Transformer (RT-1) architecture [2] discussed in Section 3. Given the ROSIE augmented dataset ̃D := { ̃ej} ̃N j=1, where ̃N is the number of augmented episodes, we train a policy on top of a pre-trained RT-1 model [2]. The finetuning uses a 1:1 mixing ratio of D and ̃D. We follow the same training procedure described in [2] except that we use a smaller learning rate 1×10−6 to ensure the stability of fine-tuning. 7 Original"Robot pick up a coke from a dish rack""... a wooden counter""... a white marble sink"Original"Robot pick up a coke from white and green plaid tablecloth""... blue striped tablecloth"Original"Robot pick up a pepsi from front of sink""... front of sink" Figure 7: We show an episode augmented by ROSIE (top row) where ROSIE inpaints the metal sink onto the top drawer of the counter and a rollout of policy trained with both the original episodes and the augmented episodes in a real kitchen with a metal sink. The policy successfully performs the task "place pepsi can into sink" even if it is not trained on real data with sink before, suggesting that leveraging the prior of the diffusion models trained with internet-scale data is able to improve generalization of robotic learning in the real world. 5 Experiments In our experimental evaluation, we focus on robot manipulation and embodied reasoning (e.g. detecting if a manipulation task is performed successfully). We design experiments to answer the following research questions: 1. RQ1: Can we leverage semantic-aware augmentation to learn completely new skills only seen through diffusion models? 2. RQ2: Can we leverage semantic-aware augmentation to make our policy more robust to visual distractors? 3. RQ3: Can we leverage semantic-aware augmentation to bootstrap high-level embodied reasoning such as success detection? To answer these questions, we perform empirical evaluations of ROSIE using the multi-task robotic dataset collected in [2], which consists of ∼130k robot demonstrations with 744 language instructions collected in laboratory offices and kitchens. These tasks include skills such as picking, placing, opening and closing drawers, moving objects near target containers, manipulating objects into or out of the drawers, and rearranging objects. For more details regarding the tasks and the data used we refer to Brohan et al. [2]. In our experiments, we aim to understand the effects of both the augmented text and the augmented images on policy learning. We thus perform two comparisons, ablating these changes: 1. Pre-trained RT-1 (NoAug): we take the RT-1 policy trained on the 744 tasks in [2]. While pre-trained RT-1 is not trained on tasks with the augmentation text and generated objects, it has been shown to enjoy promising pre-training capability and demonstrate excellent zero-shot generalization to unseen scenarios [2] and therefore, should have the ability to tackle the novel tasks to some extent. 2. Fine-tuned RT-1 with Instruction Augmentation (InstructionAug): Similar to Xiao et al. [71], we relabel the original episodes in RT-1 dataset to new instructions generated via our augmentation text proposal 4.2 while keeping the images unchanged. We expect this method to bring the text instructions in-distribution but fail to recognize the visuals of the augmented objects. For implementation details and hyperparameters, please see Appendix A. 5.1 RQ1: Learning new skills To answer RQ1, we augment the RT-1 dataset via generating new objects that the robot needs to manipulate. We evaluate our method and the baselines in the following four categories with increasing level of difficulty. 8 ROSIE AugmentationRollout of learned policy In realOriginalmask region prompt: large gray drawer with objects in itpassthrough object prompt: robot arm, robot gripper Inpainting prompt: A metal sink in an office kitchen Learning to move objects near generated novel containers First, we test the tasks of moving training objects near unseen containers. We visualize such unseen containers in Figure 10 in Appendix B. We select the tasks "move {some object} near white bowl" and "move {some object} near paper bowl" within the RT-1 dataset, which yields 254 episodes in total. We use the augmentation text proposals to replace the white bowl and the paper bowl with the following list of objects {lunch box, woven basket, ceramic pot, glass mason jar, orange paper plate}, which are visualized in Figure 10. For each augmentation, we augment the same number of episodes as the original task. As shown in Table 1, our ROSIE fine-tuned RT-1 policy (trained on both the whole RT-1 training set of 130k episodes and the generated novel tasks) outperforms pre-trained RT-1 policy and fine-tuned RT-1 with instruction augmentations, suggesting that ROSIE is able to generate fully unseen tasks that are beneficial for control and exceeds the inherent transfer ability of RT-1. Learning to place objects into generated unseen containers Second, we perform a similar experiment, where we focus on placing objects into the novel target containers, rather than just nearby. Example augmentations are shown in Figure 10. Table 1 again shows ROSIE outperforms both pre-trained RT-1 and RT-1 with instruction augmentation by at least 75%. Learning to grasp generated unknown deformable objects Third, we test the limits of ROSIE on novel tasks where the object to be manipulated is generated via ROSIE. We pick the set of tasks "pick green chip bag" from the RT-1 dataset consisting of 1309 episodes. To accurately generate the mask of the chip bag throughout the trajectory, we run our open-vocabulary segmentation to detect the chip bag and the robot gripper as the passthrough objects so that we can filter out the robot gripper to obtain the accurate mask of the chip bag when it is grasped. We further query Imagen Editor to substitute the chip bag with a fully unknown microfiber cloth with distinctive colors (black and blue), with augmentations shown in Figure 4. Table 1 again demonstrates that ROSIE outperforms pre-trained RT-1 and RT-1 with instruction augmentation by at least 150%, proving that ROSIE is able to expand the manipulation task family via diversifying the manipulation targets and boost the policy performance in the real world. Learning to place objects into an unseen kitchen sink in a new background Finally, to further stress-test our diffusion-based augmentation pipeline, we try to learn to place object into a sink. Note that the robot has never collected data for that task in the real world. We generate a challenging scenario where we take the all the RT-1 tasks that perform placing a can into the top drawer of a counter (779 episodes in total) and deploy ROSIE to detect the open drawer and replace the drawer with a metal sink using Imagen Editor (see the first row of Figure 7 for the visualization). Similar to the above two experiments, we dynamically compute the mask of the open drawer at each frame of the episode while removing the robot arm and the can in the robot hand from the mask. Note that the generated sink makes the scene completely out of the training distribution, which poses considerable difficulty to the pre-trained RT-1 policy. The results in the last row in Table 1 confirm this. ROSIE achieves 60% overall success rate in placing the coke can and the pepsi can into the sink whereas the RT-1 policy is not able to locate the can and fails to achieve any success. In Figure 7, we include the visualizations of a trajectory of the original episode with augmentations that replaces the drawer with the sink and a trajectory of the policy rollout performing the task near a real metal sink. Our method effectively learns from the episodes with the sink generated by ROSIE and completes the task that involve the sink in the real kitchen. Overall, through these experiments, ROSIE is shown to be capable of effectively inpainting both the objects that require rich manipulation and the target object of the manipulation policy, significantly augmenting the number of tasks in robotic manipulation. These results indicate a promising path to scaling robot learning without extra effort of real data collection. 5.2 RQ2: Robustifying manipulation policies We investigate RQ2 with two scenarios: policy robustness w.r.t. different backgrounds and new distractors. Unseen background. We employ ROSIE to augment the background in our training data. We perform two types of augmentations: replacing the table top with a colorful table cloth and inserting a sink on the table top. We select two manipulation tasks, "pick coke can" and "pick pepsi can" from our training set, which consists of 1222 episodes in total. We run open-vocabulary segmentation to detect the table and passthrough objects, which consist of the robot arm and the target can. To generate a diverse set of table cloth during augmentation, we query GPT-3 with the following prompt: 9 Task Family / Text Instruction NoAug InstructionAug ROSIE Move object near novel object move coke can/orange near lunch box move coke can/orange near woven basket move coke can/orange near ceramic pot move coke can/orange near glass mason jar move coke can/orange near orange paper plate Pick up novel object pick blue microfiber cloth pick black microfiber cloth Place object into novel container place coke can into orange plastic plate place coke can into blue plastic plate Place object into sink place coke can into sink place pepsi can into sink Pick up object in new backgrounds pick coke can on an orange table cloth pick pepsi can on an orange table cloth pick coke can on an blue and white table cloth pick pepsi can on an blue and white table cloth pick coke can near the side of a sink pick pepsi can near the side of a sink pick coke can in front of a sink pick pepsi can in front of a sink Place object into cluttered drawer place blue chip bag into top drawer place green jalapeno chip bag into top drawer place green rice chip bag into top drawer place brown chip bag into top drawer Pick up object (with OOD distractors) pick coke can 0.86 0.8 0.7 1.0 0.9 0.9 0.25 0.1 0.4 0.13 0.0 0.25 0.0 0.0 0.0 0.33 0.0 0.0 0.2 0.8 0.4 0.3 0.4 0.5 0.38 0.5 0.4 0.4 0.2 0.33 0.33 0.78 0.6 0.6 0.9 0.8 1.0 0.3 0.4 0.2 0.25 0.19 0.06 - - - - - - - - - - - - - - - - - - - 0.94 0.9 0.9 1.0 1.0 0.9 0.75 0.8 0.7 0.44 0.5 0.38 0.6 0.8 0.4 0.71 0.4 0.7 0.7 0.8 0.5 0.7 0.9 1.0 0.55 0.4 0.5 0.5 0.8 0.37 0.37 Table 1: Full Experimental Results for ROSIE. The blue shaded results correspond to RQ1 and the orange shaded results correspond to RQ2. For each task family from top to the bottom, we performed evaluations with 50, 20, 16, 10, 80, 40, and 27 episodes respectively (243 episodes in total). ROSIE outperforms NoAug (pre-trained RT-1 policy) and InstructionAug (fine-tuned RT-1 policy with instruction augmentation [71]) in both categories, suggesting that ROSIE can significantly improve the generalization to novel tasks and robustness w.r.t. different distractors. inpainting prompt: pick coke can from a red and yellow table cloth goal: list 30 more table cloth with different vivid colors and styles with visual details inpainting prompt: pick coke can from 1. Navy blue and white striped table cloth 2. White and pink polka dot table cloth 3. Mint green and light blue checkered table cloth 4. Cream and gray floral table cloth 5. Hot pink and red floral table cloth ... We show the some example answers from GPT-3 in blue, which are semantically meaningful. We use Imagen Editor to replace the table top except the target can with the LLM-proposed table cloth. To inpaint a sink on the table, we follow the same procedure described in the placing objects into unseen sink task in Section 5.1 except that we inpaint the sink on the table top rather than the open drawer. We present visualizations of such augmentations in Figure 6. We fine-tune the pre-trained RT-1 policy on both the 10 original data and the augmented episodes with generated table cloth and metal sink. As shown in Table 1, ROSIE + RT-1 signifcantly outperforms RT-1 NoAug in 7 out of 8 settings while performing similarly to NoAug in the remaining scenario, achieving an overall 115% improvement. Therefore, ROSIE is highly effectively in robustifying policy performance under varying table textures and background. Novel distractors. To test whether ROSIE can improve policy robustness w.r.t. novel distractors and cluttered scenes, we consider the following two tasks. First, we train a policy solely from the task "pick coke can" and investigate its ability to perform this task with distractor coke cans, which have not been seen in the 615 training episodes. To this end, we employ ROSIE to add an equal number of augmented episodes with additional coke cans on the table (see Figure 8 in Appendix B for visualizations). As shown in Table 1, RT-1 + ROSIE augmentations improves the performance over RT-1 trained with "pick coke can" data only in scenarios where there are multiple coke cans on the table. Second, we evaluate a task that places a chip bag into a drawer and investigate its ability to perform this task with distractor objects already in the drawer, also unseen during training. This scenario is challenging for RT-1, since the distractor object in the drawer will confuse the model and make it more likely to directly output termination action. We use ROSIE to add novel objects to the drawer, as shown in Figure 9 in Appendix B and follow the same training procedure as in the coke can experiment. Table 1 shows that RT-1 trained with both the original data and ROSIE generated data outperforms RT-1 with only original data. Our interpretation is that RT-1 trained from the training data never sees this situation before and it incorrectly believes that the task is already solved at the first frame, whereas ROSIE can mitigate this issue via expanding the dataset using generative models. 5.3 RQ3: A Case Study on Success Detection In this section, we show that ROSIE is also effective in improving high-level robotic embodied reasoning tasks, such as success detection. Success detection (or failure detection) is an important capability for autonomous robots for accomplishing tasks in dynamic situations that may require adaptive feedback from the environment. Given large diversity of potential situations that a robot might encounter, a general solution to this problem may involve deploying learned failure detection systems [72] that can improve with more data. As recent work [71] has shown, visual-language models (VLMs) such as CLIP [73] with internet scale pre-training can be fine-tuned on domain specific robotic experience to perform embodied reasoning such as success detection. However, collecting domain specific fine-tuning data is often expensive, and it is difficult to scale data collection to cover all potential success and failure cases. This challenge is similar to the one of learning a robust policy that we presented in the previous sections, where the dataset of robot data might include data distribution biases that are difficult to correct with on-robot data collection alone. As a motivating example, consider the experimental setting from Section 5.1 where a large dataset of teleoperated demonstrations was collected for placing various household objects into empty cabinet drawers. A success detector trained on this dataset would require additional priors and/or data to generalize to images of cluttered drawers. To study this setting, we utilize ROSIE to augment 22764 episodes of placing objects into drawers tasks from the dataset used in [71] and then fine-tune a CLIP-based success detector following the procedure in [71]. Starting from the episodes of robotic placing into empty drawers, we create two augmented datasets with ROSIE to emulate visual clutter: one dataset (A) that includes generated distractor chip bags inside the drawer and one dataset (B) that includes generated soda cans inside the drawer. Both datasets have the same number of episodes as the original dataset. We evaluate the fine- tuned CLIP-based success detector with and without ROSIE-augmented episodes in two datasets: the in-distribution set and the OOD set. Our in-distribution set contains 76 episodes of robot putting green rice chip bag into the drawer and taking it out of the drawer, while the OOD set contains 58 episodes of robot putting (green rice, green japaleno, blue, brown) chip bag into the drawer, but the drawer contains other items, which are not observed in the training set. Note that this OOD set makes success detection particularly challenging as the model can easily be misguided by the cluttered distractors in the drawer and make incorrect predictions even if the robot fails to place the target object into the drawer. By utilizing increasing amounts of augmentation from ROSIE, we find that learned success detectors become increasingly robust detecting successes and failures in real-world difficult cluttered OOD drawer scenarios in terms of F1 score, as seen in Table 2. Note that our OOD dataset is highly challenging, as discussed above, so that the prior work [71] without augmentations struggles a lot in this setting whereas ROSIE obtains a reasonable performance. Furthermore, we find that the accuracy 11 No Aug ROSIE Aug (A) ROSIE Aug ((A) + (B)) Overall In-Distribution set OOD set 0.43 0.66 0.19 0.56 0.67 0.45 0.62 0.66 0.57 Table 2: CLIP success detection Results. ROSIE improves the robustness of the success detection on hard OOD cases as the number of augmentations increases. All numbers are the F1 score and we use 0.5 as the threshold. We augment the data with datasets A and B, which include different distractors as described in text. on the standard, in-distribution tasks remains unchanged. This indicates that ROSIE can be used as a general semantically-consistent data augmentation technique across various tasks such as policy learning and embodied reasoning. 6 Societal Impact The model used in this work is a text-guided image generation model, which open many new possibilities for content creation and subsequently many risks. Our approach attempts to minimize many of these risks through a controlled usage of these technologies, by only modifying local patches of images and using narrowly scoped semantic labels. We further follow accepted responsible AI practices, such as regularly inspecting data before training on it, and in general recommend researchers to establish robust inspection and filtering mechanisms when utilizing text-guided image generation models for data augmentation. 7 Discussion, Future Work, and Conclusion In summary, we presented ROSIE, a system that uses off-the-shelf text-guided image generation models to vastly expand robotics datasets without any real-world data collection. To accomplish this, we generated new instructions and their corresponding text prompts for alternating the images, enabling robots to achieve tasks that were only seen through the lens of image generation process. We were also able to generate semantically meaningful augmentations of the images, enabling various learned models trained on the data to be more robust with respect to OOD scenes. Lastly, we experimentally validated the proposed method on a variety of language-conditioned manipulation tasks. Though the method is general and flexible, there are a few limitations of this work that we aim to address in the future. First, we only augment the appearance of the objects and scenes, and do not generate new motions. To alleviate this limitation of not augmenting physics and motions, we could consider mixing in simulation data as a potential source of diverse motion data. Another limitation of the proposed method is that it performs image augmentation per frame, which can lead to a loss in temporal consistency. However, we find that at least for the architecture that we use (Robotics Transformer [2]), we do not suffer from a performance drop. State of the art text-to-video diffusion models [74, 75, 76, 77] can generate temporally consistent videos but might lose photorealism and physics realism. We speculate that this can cause downstream task learning performance to deteriorate. The trade off between photorealism and temporally consistency remains an interesting topic for future studies. Finally, we use a diffusion model for image augmentation, which is computationally heavy and limits our capability to perform on-the-fly augmentation. As a future direction, we could consider other models such as the mask transformer-based architecture [78], which is 10x more efficient. Acknowledgments We would like to acknowledge Sharath Maddineni, Brianna Zitkovich, Vincent Vanhoucke, Kanishka Rao, Quan Vuong, Alex Irpan, Sarah Laszlo, Bob Wei, Sean Kirmani, Pierre Sermanet and the greater teams at Robotics at Google for their feedback and contributions. References [1] Y. Jiang, A. Gupta, Z. Zhang, G. Wang, Y. Dou, Y. Chen, L. Fei-Fei, A. Anandkumar, Y. Zhu, and L. Fan. Vima: General robot manipulation with multimodal prompts. arXiv preprint arXiv:2210.03094, 2022. [2] A. Brohan, N. Brown, J. Carbajal, Y. Chebotar, J. Dabis, C. Finn, K. Gopalakrishnan, K. Hausman, A. Herzog, J. Hsu, et al. Rt-1: Robotics transformer for real-world control at scale. arXiv preprint arXiv:2212.06817, 2022. 12 [3] M. Shridhar, L. Manuelli, and D. Fox. Cliport: What and where pathways for robotic manipulation. In Conference on Robot Learning, 2022. [4] M. Shridhar, L. Manuelli, and D. Fox. Perceiver-actor: A multi-task transformer for robotic manipulation. arXiv preprint arXiv:2209.05451, 2022. [5] A. Ramesh, P. Dhariwal, A. Nichol, C. Chu, and M. Chen. Hierarchical Text-Conditional Image Generation with CLIP Latents. In arXiv:2204.06125, 2022. [6] 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. [7] X. Chen, X. Wang, S. Changpinyo, A. Piergiovanni, P. Padlewski, D. Salz, S. Goodman, A. Grycner, B. Mustafa, L. Beyer, et al. Pali: A jointly-scaled multilingual language-image model. arXiv preprint arXiv:2209.06794, 2022. [8] D. Kalashnikov, J. Varley, Y. Chebotar, B. Swanson, R. Jonschkowski, C. Finn, S. Levine, and K. Hausman. Mt-opt: Continuous multi-task robotic reinforcement learning at scale. arXiv preprint arXiv:2104.08212, 2021. [9] A. X. Lee, C. M. Devin, Y. Zhou, T. Lampe, K. Bousmalis, J. T. Springenberg, A. Byravan, A. Abdolmaleki, N. Gileadi, D. Khosid, et al. Beyond pick-and-place: Tackling robotic stacking of diverse shapes. In 5th Annual Conference on Robot Learning, 2021. [10] E. Jang, A. Irpan, M. Khansari, D. Kappler, F. Ebert, C. Lynch, S. Levine, and C. Finn. Bc-z: Zero-shot task generalization with robotic imitation learning. In Conference on Robot Learning, pages 991–1002. PMLR, 2022. [11] F. Xia, A. R. Zamir, Z. He, A. Sax, J. Malik, and S. Savarese. Gibson env: Real-world perception for embodied agents. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 9068–9079, 2018. [12] E. Kolve, R. Mottaghi, W. Han, E. VanderBilt, L. Weihs, A. Herrasti, D. Gordon, Y. Zhu, A. Gupta, and A. Farhadi. Ai2-thor: An interactive 3d environment for visual ai. arXiv preprint arXiv:1712.05474, 2017. [13] M. Savva, A. Kadian, O. Maksymets, Y. Zhao, E. Wijmans, B. Jain, J. Straub, J. Liu, V. Koltun, J. Malik, et al. Habitat: A platform for embodied ai research. In Proceedings of the IEEE/CVF international conference on computer vision, pages 9339–9347, 2019. [14] B. Mehta, M. Diaz, F. Golemo, C. J. Pal, and L. Paull. Active domain randomization. In Conference on Robot Learning, pages 1162–1176. PMLR, 2020. [15] F. Sadeghi, A. Toshev, E. Jang, and S. Levine. Sim2real view invariant visual servoing by recurrent control. arXiv preprint arXiv:1712.07642, 2017. [16] I. Akkaya, M. Andrychowicz, M. Chociej, M. Litwin, B. McGrew, A. Petron, A. Paino, M. Plappert, G. Powell, R. Ribas, et al. Solving rubik's cube with a robot hand. arXiv preprint arXiv:1910.07113, 2019. [17] M. Laskin, A. Srinivas, and P. Abbeel. Curl: Contrastive unsupervised representations for reinforcement learning. In International Conference on Machine Learning, pages 5639–5650. PMLR, 2020. [18] R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and B. Ommer. High-Resolution Image Synthesis with Latent Diffusion Models. In CVPR, 2022. [19] J. Yu, Z. Lin, J. Yang, X. Shen, X. Lu, and T. S. Huang. Generative image inpainting with contextual attention. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5505–5514, 2018. [20] T. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020. 13 [21] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. [22] A. Chowdhery, S. Narang, J. Devlin, M. Bosma, G. Mishra, A. Roberts, P. Barham, H. W. Chung, C. Sutton, S. Gehrmann, et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022. [23] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. [24] J.-B. Alayrac, J. Donahue, P. Luc, A. Miech, I. Barr, Y. Hasson, K. Lenc, A. Mensch, K. Millican, M. Reynolds, et al. Flamingo: a visual language model for few-shot learning. arXiv preprint arXiv:2204.14198, 2022. [25] M. Shridhar, J. Thomason, D. Gordon, Y. Bisk, W. Han, R. Mottaghi, L. Zettlemoyer, and D. Fox. Alfred: A benchmark for interpreting grounded instructions for everyday tasks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 10740–10749, 2020. [26] S. James, Z. Ma, D. R. Arrojo, and A. J. Davison. Rlbench: The robot learning benchmark & learning environment. IEEE Robotics and Automation Letters, 5(2):3019–3026, 2020. [27] T. Yu, D. Quillen, Z. He, R. Julian, K. Hausman, C. Finn, and S. Levine. Meta-world: A benchmark and evaluation for multi-task and meta reinforcement learning. In Conference on robot learning, pages 1094–1100. PMLR, 2020. [28] M. Mittal, C. Yu, Q. Yu, J. Liu, N. Rudin, D. Hoeller, J. L. Yuan, P. P. Tehrani, R. Singh, Y. Guo, et al. Orbit: A unified simulation framework for interactive robot learning environments. arXiv preprint arXiv:2301.04195, 2023. [29] F. Xiang, Y. Qin, K. Mo, Y. Xia, H. Zhu, F. Liu, M. Liu, H. Jiang, Y. Yuan, H. Wang, et al. Sapien: A simulated part-based interactive environment. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11097–11107, 2020. [30] A. Mandlekar, J. Booher, M. Spero, A. Tung, A. Gupta, Y. Zhu, A. Garg, S. Savarese, and L. Fei-Fei. Scaling robot supervision to hundreds of hours with roboturk: Robotic manipulation dataset through human reasoning and dexterity. In 2019 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 1048–1055. IEEE, 2019. [31] F. Ebert, Y. Yang, K. Schmeckpeper, B. Bucher, G. Georgakis, K. Daniilidis, C. Finn, and S. Levine. Bridge data: Boosting generalization of robotic skills with cross-domain datasets. arXiv preprint arXiv:2109.13396, 2021. [32] D. Kalashnikov, A. Irpan, P. Pastor, J. Ibarz, A. Herzog, E. Jang, D. Quillen, E. Holly, M. Kalakrishnan, V. Vanhoucke, et al. Scalable deep reinforcement learning for vision-based robotic manipulation. In Conference on Robot Learning, pages 651–673. PMLR, 2018. [33] S. Dasari, F. Ebert, S. Tian, S. Nair, B. Bucher, K. Schmeckpeper, S. Singh, S. Levine, and C. Finn. Robonet: Large-scale multi-robot learning. arXiv preprint arXiv:1910.11215, 2019. [34] J. Tobin, R. Fong, A. Ray, J. Schneider, W. Zaremba, and P. Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. In 2017 IEEE/RSJ international conference on intelligent robots and systems (IROS), pages 23–30. IEEE, 2017. [35] J. Tremblay, A. Prakash, D. Acuna, M. Brophy, V. Jampani, C. Anil, T. To, E. Cameracci, S. Boochoon, and S. Birchfield. Training deep networks with synthetic data: Bridging the reality gap by domain randomization. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pages 969–977, 2018. [36] M. Laskin, K. Lee, A. Stooke, L. Pinto, P. Abbeel, and A. Srinivas. Reinforcement learning with augmented data. Advances in neural information processing systems, 33:19884–19895, 2020. [37] I. Kostrikov, D. Yarats, and R. Fergus. Image augmentation is all you need: Regularizing deep reinforcement learning from pixels. arXiv preprint arXiv:2004.13649, 2020. 14 [38] N. Hansen, R. Jangir, Y. Sun, G. Aleny`a, P. Abbeel, A. A. Efros, L. Pinto, and X. Wang. Self-supervised policy adaptation during deployment. arXiv preprint arXiv:2007.04309, 2020. [39] B. Li, V. Franc ̧ois-Lavet, T. Doan, and J. Pineau. Domain adversarial reinforcement learning. arXiv preprint arXiv:2102.07097, 2021. [40] K. Rao, C. Harris, A. Irpan, S. Levine, J. Ibarz, and M. Khansari. Rl-cyclegan: Reinforcement learning aware simulation-to-real. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11157–11166, 2020. [41] D. Ho, K. Rao, Z. Xu, E. Jang, M. Khansari, and Y. Bai. Retinagan: An object-aware approach to sim-to-real transfer. In 2021 IEEE International Conference on Robotics and Automation (ICRA), pages 10920–10926. IEEE, 2021. [42] S. James, P. Wohlhart, M. Kalakrishnan, D. Kalashnikov, A. Irpan, J. Ibarz, S. Levine, R. Hadsell, and K. Bousmalis. Sim-to-real via sim-to-sim: Data-efficient robotic grasping via randomized-to-canonical adaptation networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12627–12637, 2019. [43] J. Sohl-Dickstein, E. Weiss, N. Maheswaranathan, and S. Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pages 2256–2265. PMLR, 2015. [44] J. Ho, A. Jain, and P. Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840–6851, 2020. [45] Y. Song, J. Sohl-Dickstein, D. P. Kingma, A. Kumar, S. Ermon, and B. Poole. Score-based gener- ative modeling through stochastic differential equations. arXiv preprint arXiv:2011.13456, 2020. [46] Y. Song and S. Ermon. Improved techniques for training score-based generative models. Advances in neural information processing systems, 33:12438–12448, 2020. [47] J. Song, C. Meng, and S. Ermon. Denoising diffusion implicit models. arXiv preprint arXiv:2010.02502, 2020. [48] A. Q. Nichol and P. Dhariwal. Improved denoising diffusion probabilistic models. In International Conference on Machine Learning, pages 8162–8171. PMLR, 2021. [49] P. Dhariwal and A. Nichol. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34:8780–8794, 2021. [50] J. Ho and T. Salimans. Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598, 2022. [51] M. Janner, Y. Du, J. B. Tenenbaum, and S. Levine. Planning with diffusion for flexible behavior synthesis. arXiv preprint arXiv:2205.09991, 2022. [52] W. Liu, T. Hermans, S. Chernova, and C. Paxton. Structdiffusion: Object-centric diffusion for semantic rearrangement of novel objects. arXiv preprint arXiv:2211.04604, 2022. [53] I. Kapelyukh, V. Vosylius, and E. Johns. Dall-e-bot: Introducing web-scale diffusion models to robotics. arXiv preprint arXiv:2210.02438, 2022. [54] Z. Mandi, H. Bharadhwaj, V. Moens, S. Song, A. Rajeswaran, and V. Kumar. Cacti: A framework for scalable multi-task multi-scene visual imitation learning. arXiv preprint arXiv:2212.05711, 2022. [55] Z. Chen, S. Kiami, A. Gupta, and V. Kumar. Genaug: Retargeting behaviors to unseen situations via generative augmentation. arXiv preprint arXiv:2302.06671, 2023. [56] A. A. Efros and W. T. Freeman. Image quilting for texture synthesis and transfer. In Proceedings of the 28th annual conference on Computer graphics and interactive techniques, pages 341–346, 2001. 15 [57] D. Pathak, P. Krahenbuhl, J. Donahue, T. Darrell, and A. A. Efros. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2536–2544, 2016. [58] S. Iizuka, E. Simo-Serra, and H. Ishikawa. Globally and locally consistent image completion. ACM Transactions on Graphics (ToG), 36(4):1–14, 2017. [59] S. Wang, C. Saharia, C. Montgomery, J. Pont-Tuset, S. Noy, S. Pellegrini, Y. Onoe, S. Laszlo, D. J. Fleet, R. Soricut, et al. Imagen editor and editbench: Advancing and evaluating text-guided image inpainting. arXiv preprint arXiv:2212.06909, 2022. [60] D. A. Pomerleau. Alvinn: An autonomous land vehicle in a neural network. Advances in neural information processing systems, 1, 1988. [61] M. Tan and Q. Le. EfficientNet: Rethinking model scaling for convolutional neural networks. In K. Chaudhuri and R. 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. URL https://proceedings.mlr.press/v97/tan19a.html. [62] M. Ryoo, A. Piergiovanni, A. Arnab, M. Dehghani, and A. Angelova. Tokenlearner: Adaptive space-time tokenization for videos. Advances in Neural Information Processing Systems, 34: 12786–12797, 2021. [63] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polo- sukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. [64] T. Brooks, A. Holynski, and A. A. Efros. Instructpix2pix: Learning to follow image editing instructions. arXiv preprint arXiv:2211.09800, 2022. [65] M. Minderer, A. Gritsenko, A. Stone, M. Neumann, D. Weissenborn, A. Dosovitskiy, A. Mahendran, A. Arnab, M. Dehghani, Z. Shen, et al. Simple open-vocabulary object detection with vision transformers. arXiv preprint arXiv:2205.06230, 2022. [66] K. He, G. Gkioxari, P. Doll ́ar, and R. Girshick. Mask r-cnn. In 2017 IEEE International Conference on Computer Vision (ICCV), pages 2980–2988, 2017. doi:10.1109/ICCV.2017.322. [67] A. Kuznetsova, H. Rom, N. Alldrin, J. Uijlings, I. Krasin, J. Pont-Tuset, S. Kamali, S. Popov, M. Malloci, T. Duerig, and V. Ferrari. The open images dataset v4: Unified image classification, object detection, and visual relationship detection at scale. arXiv:1811.00982, 2018. [68] R. Benenson, S. Popov, and V. Ferrari. Large-scale interactive object segmentation with human annotators. In CVPR, 2019. [69] M. Sandler, A. G. Howard, M. Zhu, A. Zhmoginov, and L. Chen. Inverted residuals and linear bottlenecks: Mobile networks for classification, detection and segmentation. CoRR, abs/1801.04381, 2018. URL http://arxiv.org/abs/1801.04381. [70] R. Suvorov, E. Logacheva, A. Mashikhin, A. Remizova, A. Ashukha, A. Silvestrov, N. Kong, H. Goka, K. Park, and V. Lempitsky. Resolution-robust large mask inpainting with fourier convolutions. arXiv preprint arXiv:2109.07161, 2021. [71] T. Xiao, H. Chan, P. Sermanet, A. Wahid, A. Brohan, K. Hausman, S. Levine, and J. Tompson. Robotic skill acquisition via instruction augmentation with vision-language models. arXiv preprint arXiv:2211.11736, 2022. [72] D. Kalashnkov, J. Varley, Y. Chebotar, B. Swanson, R. Jonschkowski, C. Finn, S. Levine, and K. Hausman. Mt-opt: Continuous multi-task robotic reinforcement learning at scale. arXiv, 2021. [73] 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. [74] J. Ho, W. Chan, C. Saharia, J. Whang, R. Gao, A. Gritsenko, D. P. Kingma, B. Poole, M. Norouzi, D. J. Fleet, et al. Imagen video: High definition video generation with diffusion models. arXiv preprint arXiv:2210.02303, 2022. 16 [75] U. Singer, A. Polyak, T. Hayes, X. Yin, J. An, S. Zhang, Q. Hu, H. Yang, O. Ashual, O. Gafni, et al. Make-a-video: Text-to-video generation without text-video data. arXiv preprint arXiv:2209.14792, 2022. [76] R. Villegas, M. Babaeizadeh, P.-J. Kindermans, H. Moraldo, H. Zhang, M. T. Saffar, S. Castro, J. Kunze, and D. Erhan. Phenaki: Variable length video generation from open domain textual description. arXiv preprint arXiv:2210.02399, 2022. [77] E. Molad, E. Horwitz, D. Valevski, A. R. Acha, Y. Matias, Y. Pritch, Y. Leviathan, and Y. Hoshen. Dreamix: Video diffusion models are general video editors, 2023. URL https://arxiv.org/abs/2302.01329. [78] H. Chang, H. Zhang, J. Barber, A. Maschinot, J. Lezama, L. Jiang, M.-H. Yang, K. Murphy, W. T. Freeman, M. Rubinstein, et al. Muse: Text-to-image generation via masked generative transformers. arXiv preprint arXiv:2301.00704, 2023. 17 Appendices A Experiment Details A.1 Implementation Details and Hyperparameters We take a pre-trained RT-1 policy with 35M parameters and trained for 315k steps at a learning rate of 1×10−4 and fine-tune the RT-1 policy with 1:1 mixing ratio of the original 130k episodes of RT-1 data and the ROSIE-generated episodes with for 85k steps with learning rate 1 × 10−6. We follow all the other policy training hyperparameters used in [2]. To obtain the accurate segmentation mask of the target region of augmentations, we set a threshold for filtering out predicted masks with low prediction scores of both the region of the interest and passthrough objects given by OWL-ViT. In cases where we have multiple detected masks, we always select the one with highest prediction score. Specifically, for experiments where the robot is required to pick novel objects or place objects into novel containers or move objects near unseen containers (Section 5.1), we use a threshold of 0.07 to detect the in-hand objects and the containers while using a threshold of 0.05 to detect passthrough objects, which are the robot arm and robot gripper. In experiments where the robot is instructed to place the coke can or the pepsi can into the unknown sink or pick up coke can and the pepsi can with new background , we use a threshold of 0.04 to detect the table with all objects and a threshold of 0.03 to detect the passthrough objects, which are the robot arm, robot gripper and the coke can or the blue can in this case. In experiments discussed in Sections 5.2 and 5.3, we use the threshold of 0.3 to detect the table or the open drawer where we want to add new distractors. For generating LLM-assisted prompts, we perform 1-shot prompting to the LLM. For example, in the setting of generating novel distractors in the task where we place objects into the drawer (Section 5.2), we use the following prompt to the LLM: Source task: place pepsi can on the counter Target task: place pepsi can on the clutter counter ViT region prompt: empty counter passthrough object prompt: robot arm, robot gripper inpainting prompt: add a chip bag on the counter Source task: place coke can into top drawer Target task: place coke can into cluttered top drawer and LLM generates the following prompt for detecting masks and augmentations (light blue means LLM generated): ViT region prompt: empty drawer passthrough object prompt: robot arm, robot gripper inpainting prompt: add a box of crackers in the drawer which is semantically meaningful for performing mask detection and Imagen Editor augmentation. We follow this recipe of prompting for all of the tasks in our experiments. During inpainting, we take the checkpoint of Imagen Editor 64x64 base model and the 256x256 super-resolution model trained in [59] and directly run inference to produce augmentations. During evaluation, for the tasks that perform moving objects near novel containers and grasping unseen microfiber cloth, we perform 10 policy rollouts per new container/microfiber cloth of each method. For tasks that perform placing objects into novel containers, we perform 8 policy rollouts per new container for each method. For the task where the robot is instructed to place coke can or pepsi can into the unseen kitchen sink, for each method, we perform 5 policy rollouts for coke can and pepsi can respectively. For the task where the robot is instructed to grasp the coke can and the pepsi can in new backgrounds, we eval- uate each method with 10 rollouts. For the task where the robot places the object into the cluttered drawer, we perform 10 policy rollouts per object for each method. Finally, for the task that requires the robot to pick up coke can in a scene with multiple coke cans, we perform 27 policy rollouts for each approach. A.2 Computation Complexity We train our policy on 16 TPUs for 1 day. For obtaining segmentation masks, we perform inference of OWL-ViT on 1 TPU for 1 hour to generate 1k episodes. During augmentation, we perform inference of Imagen Editor using 4 TPUs of the 64 x 64 base model and the 256 x 256 super-resolution model respectively for 2 hours to generate 1k episodes. 18 B Examples of Augmentations We include more visualizations of augmentations generated by ROSIE in this section. In Figure 10, we show the generated episodes of ROSIE where we inpaint novel containers in the scene, which are used in the Learning to move objects near generated novel containers and Learning to place objects into generated unseen containers experiments in Section 5.1. In Figure 8 and Figure 9, we visualize augmented episodes with new distractors, e.g. cluttered coke cans on the table and chip bags in the empty open drawer. These augmentations correspond experiments conducted in Section 5.2. We also visualize the attention layers in RT-1 when training on our augmented data. As seen in Fig. 11, there are attention heads focusing on our augmented objects, which indicates the augmentation seem to be effective. Overall, note that ROSIE is able generate semantically realistic novel objects and distractors in the manipulation setting. For example, ROSIE-generated objects typically has realistic shades on the table or the drawer, which is beneficial for training manipulation policies on top of such data. Figure 8: Augmentation Example - adding a distractor can on the table. Figure 9: Augmentation Example - adding distractor objects into the drawer. Figure 10: Augmentation Example - changing the container. C Failure Cases of Generated Prompts and Images While our LLM-assisted prompts generally work very well, we would like to note that it requires few-shot prompting to work well. In the zero-shot case, LLM would just hallucinate and output 19 Figure 11: Visualization of some attention heads focusing on our augmented objects. This visualization is an overlay of observation and the spatial attention (bright regions means high attention). unuseful augmentation prompts. For example, if we provide the following zero-shot prompt: Source task: pick coke can on a table Target task: pick coke can near a sink Goal: replace the scene in the source task with the scene in the target task inpainting prompt: and LLM gives the following response: Pick up the coke can near the sink, replacing the one originally on the table ,which is not correct. Therefore few-shot prompting is crucial in ROSIE. We show the failure cases of the augmented images in Figure 12. For the two examples on the left, ROSIE is supposed to generate woven basket and glass mason jar respectively, but it fails to generate such containers and instead generate some bowl-shape containers. For the two examples on the right, ROSIE is supposed to replace the in-hand green chip bag with blue microfiber cloth and a yellow rubber duck respectively. However, as the mask of the in-hand object becomes irregular, the performance of ROSIE degrades and ROSIE is unable to generate blue microfiber cloth and the yellow rubber duck in full shape and half of the in-hand object remains as the green chip bag. We suspect that with fine-tuning Imagen Editor on robotic datasets that show more manipulation-related data, we can improve the generation results drastically. Note that while the generation could be suboptimal at times, our insight is that such imperfect generation can only lead to misalignment between the task instruction and images, which may not have a big negative impact on the policy results and could give extra data augmentation benefit for free. Our policy performance in Section 5 validates this insight to some degree. 20 pick blue/red microfiber clothplace coke in sink Figure 12: Failure cases of image augmentations. 21
http://arxiv.org/abs/2302.11533v1
2023-02-22T18:20:36
2023-02-22T18:20:36
MONGOOSE: Path-wise Smooth Bayesian Optimisation via Meta-learning
In Bayesian optimisation, we often seek to minimise the black-box objective functions that arise in real-world physical systems. A primary contributor to the cost of evaluating such black-box objective functions is often the effort required to prepare the system for measurement. We consider a common scenario where preparation costs grow as the distance between successive evaluations increases. In this setting, smooth optimisation trajectories are preferred and the jumpy paths produced by the standard myopic (i.e.\ one-step-optimal) Bayesian optimisation methods are sub-optimal. Our algorithm, MONGOOSE, uses a meta-learnt parametric policy to generate smooth optimisation trajectories, achieving performance gains over existing methods when optimising functions with large movement costs.
[ "Adam X. Yang", "Laurence Aitchison", "Henry B. Moss" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11533v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11533v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
MONGOOSE: Path-wise Smooth Bayesian Optimisation via Meta-learning Adam X. Yang1,2 Laurence Aitchison1 Henry B. Moss2 1University of Bristol, UK 2Secondmind Labs, Cambridge, UK 3 2 0 2 b e F 2 2 ] G L . s c [ 1 v 3 3 5 1 1 . 2 0 3 2 : v i X r a Abstract In Bayesian optimisation, we often seek to min- imise the black-box objective functions that arise in real-world physical systems. A primary contrib- utor to the cost of evaluating such black-box objec- tive functions is often the effort required to prepare the system for measurement. We consider a com- mon scenario where preparation costs grow as the distance between successive evaluations increases. In this setting, smooth optimisation trajectories are preferred and the jumpy paths produced by the stan- dard myopic (i.e. one-step-optimal) Bayesian opti- misation methods are sub-optimal. Our algorithm, MONGOOSE, uses a meta-learnt parametric pol- icy to generate smooth optimisation trajectories, achieving performance gains over existing meth- ods when optimising functions with large move- ment costs. 1 INTRODUCTION The task of optimising high-cost black-box functions is in- escapable across science and industry. For many of these problems, evaluating the black-box is expensive, not due to the resources expended to take the measurement itself, but instead due to the substantial movement cost required to transition the system to be ready for the next high-quality measurement - a cost that increases with the distance (in the input space) between successive measurements. Exam- ple movement costs include: the financial outlay of moving mining machinery between drill sites when seeking areas dense in valuable ores [Jafrasteh and Suárez, 2021]; the time taken for mixtures of chemicals to reach steady state when trying to identify optimal mixtures [Teh et al., 2008, Rankovi ́c et al., 2022]; or the effort required to reconfigure mechanical systems like particle accelerators [Roussel et al., 2021] or heat exchangers [Paleyes et al., 2022]. (a) EI (c) MONGOOSE (b) EI per unit cost Figure 1: 50 minisation steps (orange dots to yellow dots) on a toy function (background). Standard BO with EI (a) incurs large movement costs, whereas EI per unit cost (b) fails to reach the global minima (star). Our non-myopic approach (c) finds the minima whilst following a smooth trajectory. Bayesian Optimisation [Shahriari et al., 2015, BO] is a popular approach for black-box optimisation under con- strained budgets. At first glance, BO appears to be a promis- ing method for the problems above. However, standard BO is not designed for settings with movement cost constraints. As such, most methods, including those driven by acquisi- tion functions such as Expected Improvement, favour reduc- ing uncertainty in previously unexplored areas, a strategy that results in large jumps between successive evaluations. Therefore, while efficient in terms of the number of evalu- ations, standard BO is not efficient in terms of movement costs (see Figure 1a). At the same time, encouraging smooth optimisation paths by simply penalising large movements, e.g. considering the EI per unit movement cost (discussed in Folch et al. [2022]), can lead to a failure to escape local optima (see Figure 1b). This is due to the myopic nature of such an approach: it takes into account only the immediate benefit provided by making an evaluation. However, in order to acheive a global optimum by following a smooth evaluation path, we must accept the immediate sub-optimality of steadily traversing a low-quality region in order to access new promising areas, instead of jumping to the greedy solution - a trade-off that will never be made under myopia. 01x101x201x101x1-1.24.2 Successful movement-cost constrained BO thus requires non-myopic decision making. Unfortunately, there has been limited success in developing non-myopic BO methods. Solving the multi-step look-ahead problem [Osborne et al., 2009] is challenging since calculating non-myopic acqui- sition functions requires nested maximisations and expec- tations when conditioning the surrogate model over each future time step (see González et al. [2016] for a discussion). Therefore the computational cost of existing non-myopic BO methods like Jiang et al. [2020b] and Lee et al. [2021] scales prohibitively for the longer time horizons ((cid:29) 10) required for smooth global optimisation. In this work, we propose a new algorithm, Meta-learning Of Non-myopic Global Optimisation fOr Smooth Explo- ration (MONGOOSE), for the optimisation of black-box functions under high movement costs (See Figure 1c). We sidestep the need to calculate non-myopic acquisition func- tions by leveraging recent developments in memory-based optimisation to instead learn a non-myopic policy directly. In particular, we train a recurrent neural network to provide efficient cost-efficient optimisation over carefully crafted test functions based on samples from a Gaussian Process [Rasmussen et al., 2006, GP]. Our chosen network archi- tecture enjoys an inductive bias for smooth paths and our proposed loss function allows the degree of smoothness to be customised to the task at hand. Finally, we show that MONGOOSE improves over baselines for a variety of test functions. 2 BACKGROUND In this work, we seek to find the minimum of a smooth black- box function f : X → R over a compact search space X = [0, 1]d under a total evaluation budget of T steps. Critically, we wish to perform this optimisation whilst incurring min- imal cumulative moving cost C(τ ) = (cid:80)T −1 t=0 C(xt, xt+1). The cost function C : X × X → R denotes the resources required to move between evaluations at xt and xt+1. Our framework is agnostic to the exact form of the cost function, as long as it is differentiable, with the L1 and L2 distances being common examples. The remainder of this Section details existing methods that are relevant for optimisation under movement costs, laying out important groundwork for our proposed MONGOOSE algorithm. 2.1 BAYESIAN OPTIMISATION In standard Bayesian Optimisation (BO) the goal is typically to minimise f in as few evaluations as possible. Although this goal is not guaranteed to correspond to efficient optimi- sation under movement costs, we introduce it here as BO forms the basis for most existing methods for optimisation under movement costs. BO achieves high data efficiency by using previously col- lected function evaluations to build a probabilistic surro- gate model of the objective function. Typically GPs are used for these surrogates, however neural networks [Snoek et al., 2015] and sparse GPs [Chang et al., 2022, Moss et al., 2023] have also been considered. This surrogate model is then used, through a search strategy known as an acqui- sition function α : X → R, to carefully select the next value of x at which to evaluate f , aiming to focus future resources promising areas of the space. Popular acquisi- tion functions include those based on expected improve- ment [Jones et al., 1998], knowledge gradient [Frazier et al., 2008], and Thompson sampling [Kandasamy et al., 2018], as well a range of entropy-based methods [Hennig and Schuler, 2012, Hernández-Lobato et al., 2014, Wang and Jegelka, 2017, Moss et al., 2021]. 2.2 BO UNDER MOVEMENT COSTS A simple way to adapt BO to provide efficient optimisa- tion with respect to movement costs is to incorporate these movement costs into its acquisition function. For instance the Expected Improvement per unit cost (EIpu) is defined as αEIpu(xt, xt+1) = αEI(xt+1)/(γ + C(xt, xt+1)), (1) where αEI the standard EI acqusition function and γ is a small tuneable parameter (set as γ = 1 by Folch et al. [2022]). Unfortunately, EIpu heavily penalises the acquisi- tion function away from the current location and often strug- gles to achieve global optimisation due to over-exploitation (recall Figure 1). The current state-of-the-art BO method for optimisation un- der movement costs is the Sequential Bayesian Optimisation via Adaptive Connecting Samples (SnAKe) of Folch et al. [2022]. SnaKe follows the shortest path that connects a large number of promising regions, as identified through an ap- proximate Thompson sampling scheme [Wilson et al., 2020, Vakili et al., 2021]. However, as demonstrated empirically by Folch et al. [2022], SnAKe has several shortcomings in- cluding the requirement of an additional heuristic to ensure that it avoids getting stuck in local modes and a drop in performance when considering higher dimensions and/or shorter time horizons. 2.3 MEMORY-BASED OPTIMISATION There is a growing trend of training neural networks as black-box optimisers; that is, teaching a network Mθ to take in t previous evaluations and output a new promising lo- cation, i.e. Mθ : (X , Y)t → X where θ denotes learnable weights. One immediate advantage over BO-based methods is that generating the next query point requires only a single forward pass of the network rather than the significant ex- pense of fitting a GP and maximising an acquisition function. In particular, as the dimensionality of the problem increases, learning a decision policy directly side-steps the need to optimise an acquisitionn function in a high dimensional space. Network Architecture A common choice for meta- optimisers is a memory-based network (e.g. recurrent neural networks) [Chen et al., 2022], which typically stores an internal memory state that summarises the history of ob- servations {(xt(cid:48), f (xt(cid:48))}t t(cid:48)=1 and merges it with a current observation (xt, f (xt) to produce a new location at which to evaluate xt+1. Such meta-trained meomory-based opti- misers can memorise an effective adaptive search strategy based on the information learnt during meta-training, and reassuringly, they are known to achieve close to (Bayes) op- timal performance [Ortega et al., 2019, Mikulik et al., 2020]. Consequently, a widely used architecture for memory-based optimisers is the Long Short-Term Memory (LSTM) of Hochreiter and Schmidhuber [1997] (see for example Chen et al. [2017], Mikulik et al. [2020], Chen et al. [2022], Ni et al. [2021] or Metz et al. [2022]). Training Objective To train a memory-based optimiser it is common to use a meta-learning approach. More precisely, the network is trained to optimise a large set of objectives drawn from a distribution over functions which hopefully captures the true target objective, e.g. Chen et al. [2017] use functions sampled from a Gaussian process prior. When measuring the performance of a particular optimiser over a fixed optimisation budget T , a natural non-myopic metric is to consider the overall improvement found by the optimiser. More precisely, we can write this training objective as L(θ) = Ef (cid:20) f (x1) − min t=1,...,T (cid:21) f (xt) , (2) where the expectation is taken with respect to a chosen prior over training functions p(f ). xt denotes the location of the tth evaluation chosen by our optimiser when applied to the function f , so xt is a function of both θ and the previous function evaluations, f (x1), . . . , f (xt−1). Although this training objective (2) appears equivalent to the one discussed by Chen et al. [2017], due to a subtle imple- mentation detail regarding the "detaching" of gradient terms related to non-myopia, the objective they actually optimise ends up being myopic. In contrast, we do not detach any gradients and instead use the full non-myopic objective for meta-training. Additional discussions and empirical results demonstrating a significant difference in performance be- tween these two approaches are included in Appendix A.2. Meta-training The objective in Equation 2 is intractable, and therefore we use Monte-Carlo approximations during meta-training. At each optimisation step, we sample a set of B functions {f1, .., fB} from our prior distribution for f , and roll out our LSTM optimiser for each function, i.e we use the approximate objective LMC(θ) = 1 B B (cid:88) b=1 (fb(x1) − min t=1,...,T fb(xt)). (3) During meta-training, we maximise the objective with re- spect to the LSTM weights θ using a stochastic optimiser. If the memory-based optimiser is to be deployed on noisy objective functions, then we can simply add noise to the training functions to account for this, i.e. f (x)+η(x), where η is an arbitrary but known noise distribution. Note that standard BO methods are typically limited to Gaussian noise to ensure computational tractability. 3 MONGOOSE We now present our proposed algorithm, Meta-learning Of Non-myopic Global Optimisation fOr Smooth Explo- ration (MONGOOSE), which builds upon recent advances in memory-based meta learning and Bayesian optimisation to provide a black-box function minimiser that is efficient under large movement costs. At a high-level, MONGOOSE follows the ideas of Chen et al. [2017] and meta-trains an LSTM, Mθ, to optimise black-box functions. However, we introduce a number of key differences, including the use of a full non-myopic objective that incorporates moving cost, a better designed meta-training distribution, and a more efficient sampling and training scheme. Our proposed MONGOOSE algorithm introduces three ex- tensions to the work of Chen et al. [2017] which improve the efficiency and applicability of memory-based optimisation. These are 1. A training objective that encourages smooth optimisa- tion paths. 2. A new prior that generates more realistic training ob- jective functions. 3. A light-weight training scheme built upon efficient sampling methods. We expand on all three of these in the subsequent sections. 3.1 TRAINING OBJECTIVE FOR SMOOTH PATHS We already have a non-myopic training objective for meta- training (2), however, it does not yet favour optimisation paths that incur minimal movement costs. Fortunately, we can easily incorporate a moving cost into our training objec- tive as follows Ldiv(θ) = LMC(θ) 1 + α (cid:80)T −1 1 c(xt, xt+1) . (4) (We also consider an additive moving cost in Appendix A.1.) Here, α is a hyperparameter controlling the weight of mov- ing cost, and c(*, *) is a distance function. Any differentiable function, c(xt, xt+1) is admissible. One of the key advantages of this training objective is that we can control the relative importance of moving costs using α, an important degree of freedom that allows MONGOOSE to be customised to specific problem settings. In contrast, the current state-of-the-art SnAKe Folch et al. [2022] lacks this flexibility. Figure 2 demonstrates that increasing α trades off cost for exploration, a trade that would be appropriate for problems where movement costs significantly dominate the cost of each function evaluation. Interestingly, even without any moving penalty (i.e. set- ting α = 0) MONGOOSE still generates relatively smooth trajectories. We suspect this is an inductive-bias of memory- based models, where the memory-state may retain more information from the closest previous evaluation xt (see Appendix C for a discussion). 3.2 INJECTING GLOBAL STRUCTURE To guarantee performance at test time, it is of critical impor- tance that the surrogate objective functions that we minimise at training-time are representative of the true test-time ob- jective function. However, there is an emerging consensus that GP samples may not be representative of real-world objective functions. First, Le Riche and Picheny [2021] and Picheny et al. [2022] emphasise that real-world objectives often have a single global optimum, and "global" structure around that optimum. In contrast, functions sampled from GP priors with e.g. Matérn or squared exponential kernels, have no global structure that extends beyond the GP length- scale, and hence may have many comparably performing minima. Second, Hvarfner et al. [2022] argue that global minima are likely to lie centrally in the search space (as the search space has been designed by experts to cover the likely value of the global optimum), while, due to the curse of dimensionality, GP samples have their minima focused along the edges of the search domains. Therefore, to alleviate the shortcomings described above, we deviate from standard training function priors when training MONGOOSE. We sample a quadratic bowl and add this to the training functions sampled from GPs. This addition adds global structure to the training functions and increases the likelihood of having a single central global optima. In particular, to generate a single training objective function, we first generate a sample f from a GP prior, then add a randomly generated convex quadratic, fquad(x) = f (x) + 1 d (x − a)T W(x − a) + c. (5) Here, W is sampled from a Wishart distribution W( 1 d I, d) to ensure convexity, a ∼ U (0.2, 0.8)d to encourage a central (cid:80) minima, and c = 1 i,j[W]ij (half the expected maxi- 8d mum value of the quadratic) to ensure that the inclusion of the quadratic doesn't dramatically change the output range of the sampled functions. We found that including this global structure gives an improvement in optimisation performance downstream, especially in higher dimensions (see Appendix B). 3.3 META-TRAINING BY FOURIER FEATURES Recall that calculating our training objective (3) requires the evaluation of K samples from a GP prior, each across T locations. Previous meta-training approaches sample the GP exactly, however, due to a Cholesky decomposition step [Diggle et al., 1998], this incurs a O(T 3) cost which be- comes prohibitively expensive for longer time-horizons. A natural answer to these scalability issues is to rely instead on an approximate sampling schemes already commonly used throughout BO literature known as Random Fourier Features (RFF). In particular, it is well-known that for many common choices of kernels, GP samples can be expressed as a weighted sum of the kernel's Fourier features [Rahimi and Recht, 2007]. This sum can then be truncated to only its M largest contributors, leaving approximate but analytically tractable samples that can be queried with only O(M T ) cost. See Appendix A of Hernández-Lobato et al. [2014] for full details. In our experiments, we found that using these approximate samples for training allowed a dramatic reduction in training costs without a loss in training stability or in the performance of the trained optimisers. We can now summarise the full algorithm for MONGOOSE in Algorithm 1. Note that the roll-out of MONGOOSE over the B training functions (i.e. line 5 of Algorithm 1) is en- tirely parallelisable. Algorithm 1 Training MONGOOSE (cid:46) Training loop for b ∈ {1, .., B} do 1: Choose Horizon H, # training steps N , Batch size B 2: for n ∈ {1, .., N } do 3: Generate B approximate GP samples {f1, .., fB} 4: Add random quadratic effects fb ← fb + fquad 5: 6: xh = Mθ({(xi, fb(xi))}h−1 i=1 ) 7: 8: Use the B roll-outs to calculate Ldiv(θ) 9: Backpropogate through Ldiv(θ) and update θ 10: return A trained MONGOOSE Mθ (cid:46) Can be parallelised (cid:46) Rollout for h ∈ {1, .., H} do (cid:46) Eq. 6 4 RELATED WORK Cost-constrained BO There are many examples of BO where the cost of evaluations depends on their location (rather than the relative distance from previous evaluations Figure 2: Top: trajectories MONGOOSE with different cost scalings on a single function sample from the meta-training distribution (background colour). Cost scalings α = 0.00, 0.01, 0.05 from left to right as labelled on titles. Background with colour scale represent the function sample. Orange/yellow dots denote the evaluations chosen by each method, where darker colours (more orange) denote points earlier in the optimisation, and lighter colors (more yellow) denote points later in the optimisation. Consecutive evaluations are joined by lines. Bottom: L2 distance (i.e. moving cost) to traverse each optimisation trajectory. we consider). In this popular setting, building a simple cost- weighted acquisition function like the EI per unit evaluation cost, can sometimes be an effective heuristici, e.g. when tuning the architecture of neural networks where certain design choices increase training times [Snoek et al., 2012] or when multiple evaluation methods are available but each with differing costs, as arise in multi-task [Swersky et al., 2013], multi-source [Poloczek et al., 2017] or multi-fidelity [Moss et al., 2020b] optimisation. Unfortunately, as dis- cussed above and demonstrated in our experiments, apply- ing a simple cost-weighting idea (similar to that proposed by Roussel et al. [2021]) for the movement cost setting can lead to arbitrarily poor optimisation. Recently, Lee et al. [2020, 2021] reformulated BO under location dependent costs as a constrained Markov decision process, trading a performance improvement over cost-weighted baselines for significant additional computational complexity. In other related work, Ramesh et al. [2022] considers a similar movement penalty but in a specific contextual BO setting inspired by wind energy systems. Non-myopic BO When performing global optimisation un- der a fixed evaluation budget, it should be advantageous to think non-myopically. Consequently, many non-myopic BO approaches have been proposed outside of the cost- constrained setting, ranging from cheap heuristics like GLASSES [González et al., 2016] and BINOCULARS [Jiang et al., 2020a], which approximate multi-step look- ahead as batch experimental design problem, to expensive approximations of optimal non-myopic policies [Jiang et al., 2020b, Yue and Kontar, 2020, Lee et al., 2021] suitable for shorter time-horizons (< 10 steps). Note that SnAKE can be interpreted as an extension of GLASSES [González et al., 2016] to the movement constrained setting, achieving a degree of non-myopic decision making via constructing batches. Meta-learnt optimisers Chen et al. [2017] meta-trained a long short-term memory (LSTM) network [Hochreiter and Schmidhuber, 1997] over samples from a GP. However, their training framework involves conditional sampling of GPs which is both computational and memory intensive. Similarly, Lange et al. [2022] meta-learned an evolution- ary strategy for BO rollout through an attention network, which itself is learned by another outer-loop evolutionary strategy.Volpp et al. [2019] amortised the acquisition func- tion by a meta-learned neural acquisition function over GP a posterior, and subsequently learned a categorical policy on a grid of points through proximal policy optimisation [Schulman et al., 2017]. Meta-learning with memory-based agents also achieves state-of-the-art performance in many sequential decision making tasks [Ni et al., 2021]. However, none of these existing methods support optimisation under large movement costs. 01x101x2MONGOOSE α=0.001x1MONGOOSE α=0.00101x1MONGOOSE α=0.0101x1MONGOOSE α=0.0502550steps051015cost02550steps02550steps02550steps-1.24.2 5 EXPERIMENTS We now investigate the performance of MONGOOSE across three different settings: standard BO benchmark functions, across the extensive COCO testing suite[Finck et al., 2010, Hansen et al., 2021], and on a real world example from Folch et al. [2022]. For clarity, all our results follow a similar for- mat, presenting regret against the movement costs incurred over 50 (main text) and 100 (Appendix E) evaluations. All results are based on 50 runs across different random seeds except for MONGOOSE which, due to computational con- siderations, was ran 10 times for each experiment. Results on noiseless functions are included in the main text. See Appendix D for the corresponding results on noisy objective functions. 5.1 IMPLEMENTATION DETAILS MONGOOSE Our architecture comprises an LSTM with a hidden cell state dimension of 128, and a decoder with a sigmoid activation that maps hidden states to locations in the search space, with some additional design choices that were helpful in improving training stability. Firstly, we initialised MONGOOSE with a single evaluation at the origin x0 = 0 (i.e a corner of the search space), with all subsequent evaluations chosen by the model. We found that starting with a randomly located evaluation could lead to less stable model fitting. Secondly, we also found curriculum learning [Bengio et al., 2009] to be important for stability, i.e. we began the optimisation process with shorter horizon lengths and gradually increased it to the desired longer horizons. Each curriculum phase comprised 5, 000 optimisation steps, with each training loss evaluation calculated using a new random batch of 128 training functions. Back propagation through time is used to collect gradients [Werbos, 1990]. Finally, we decayed the learning rate from 1e−3 to 1e−4 when the curriculum's horizon length reaches 40. To generate each function used to train MONGOOSE, we first sample a per-dimension lengthscale vector (cid:96) ∈ Rd from an inverse Gamma distribution with 99% confidence inter- val at [0.1, 0.4], and then use this length-scale to build a GP with a Màtern 5/2 kernel with unit variance from which we approximately sample using 100 RFFs. Our choice of ran- domly sampled lengthscale gives the GP sample variability across input dimensions while being realistic and covers a wide range of possible test functions. The source code for our experiments has been made publicly available1. Competitors We use the implementation for EI, EIpu and SnAKe provided by Folch et al. [2022]2 based on the BOTorch BO library [Balandat et al., 2020]. We follow the recommendations of Folch et al. [2022], setting SnAKe's 1https://anonymous.4open.science/r/ mongoose_submission-5131/ 2https://github.com/cog-imperial/SnAKe (cid:15)-Point deletion scale to (cid:15) = 0.1 (a tune-able parameter that helps encourage global exploration) and EIpu's cost-scale coefficient to γ = 1 (for other choices of γ, see Appendix F). Critical to the performance of BO methods, is access to an initial set of evaluations, from which reliable estimates of model parameters (e.g. lengthscales) can be calculated. Under movement costs, standard space-filling designs incur significant costs and so are likely sub-optimal, however, reliable estimates of model parameters are still required to ensure effective optimisation. We follow the setup of Folch et al. [2022] and "warm-start" the BO methods (SnAKE, EI and EIpu) by providing them with a reasonable initialisation of GP model parameters (as calculated over an initial design of 10d points). As these evaluations are not used directly to fit surrogate models (only indirectly to provide an initial lengthscale), Folch et al. [2022] chose not to include the cost of this design in the reported cost of their algorithm, a convention we also follow. In contrast, MONGOOSE starts from scratch from a single evaluation at the origin, i.e. with no warm-starting. Despite this substantial advantage given to the baseline methods, we will see that MONGOOSE still achieves superior performance. 5.2 BAYESIAN OPTIMISATION BENCHMARKS Firstly, we investigate the performance of MONGOOSE on standard BO benchmark functions as presented in Fig. 3. In lower dimensions all algorithms perform similarly, however, when considering higher dimensions (> 3), MONGOOSE consistently achieves lower regret with lower cost, a dif- ference especially pronounced on the challenging highly multi-modal Ackley function. Note that these results match those claimed for EI, EIpu and SnAKe in Figure 11(b), Fig- ure 12(b), Figure 13(b), Figure 14(b), and Figure 15(b) of Folch et al. [2022]. 5.3 COCO TEST SUITE For a more thorough evaluation across different types of functions and across dimensions, we now consider the chal- lenging COCO (COmparing Continuous Optimisers) test suite [Finck et al., 2010, Hansen et al., 2021], a suite of 23 functions designed to benchmark black-box optimis- ers. Each function designed specifically to exhibit differ- ent attributes (e.g. multi-modality, low/high conditioning, weak/adequate global structure) and can be defined for arbi- trary dimensions. We standardised these functions to make their values lie in a reasonable range (see Appendix G for more details). The amortised results for dimensions two to six are included in Figure 4 (see Appendix H for a per- function breakdown). MONGOOSE reliably achieves the best tradeoff between movement costs and regret across across all dimensions. We believe that the poor performance of SnAKe in five and size dimensions is due to the require- Figure 3: Regret versus cost on standard benchmark objective functions for two versions of MONGOOSE and BO baselines. We plot the mean and a 90% confidence interval of regret for each method. Table 1: Averaged time for 50 optimisation steps (in sec- onds) over the COCO test suite. methods 2D 3D 4D 5D 6D EI EIpu SnAKe 36 37 92 MONGOOSE 0.02 0.02 0.02 0.02 0.02 33 34 33 33 33 23 35 36 46 36 36 70 ment for a batch of points to achieve good coverage of the space, which becomes increasingly difficult in higher dimen- sions and under time horizons of only 50. In Appendix E, we show similar results for time horizons of 100 evaluations. The computational overhead incurred by MONGOOSE when optimising the COCO functions is around three or- ders of magnitude faster than achieved by the BO baseline methods (see Table 1). Of course, MONGOOSE has the additional cost of requiring meta-training, however, as this takes less than 30 minutes on one RTX2080Ti (when consid- ering a 50 step time horizon) and only needs to be performed once for each considered input dimensionality (i.e. not for each objective function), we do not consider meta-training a serious computational bottleneck. 5.4 REAL WORLD EXAMPLE For our final example, we turn to the Ypacarai Lake problem [Samaniego et al., 2021, Folch et al., 2022] - a real world black-box optimisation problem that suffers from substantial movement costs. Here, the task is to direct an autonomous surface vehicle to locate contamination sources in the lake, thus travelling a minimal distance is preferred to minimise time and energy consumption. The ground-truth contamina- tion levels over the lake are given over a fine grid. For the BO baselines of EI, EIpu and SnAKe, we use this pre-specified grid as their search space, whereas for MONGOOSE, we project the locations to closest grid point and evaluate the objective at the projected location. Figure 5 compares the trajectories from a single run of EI, EIpu, SnAKe and MON- GOOSE, demonstrating that MONGOOSE with α = 0.01 is able to generate an entirely smooth trajectory that explores both modes. Figure 6 shows the maximum contamination found against distance travelled by different methods. 6 DISCUSSION In this work, we developed a memory-based meta-learning approach for the optimisation of black box functions where inputs incur large costs. and our results showed MON- GOOSE performs better than competing methods (EI, EIpu and SnAKe) over horizons of 50-100 steps, especially in higher dimensions. In future work we will investigate the use of dimensional agnostic architectures to avoid the need to train separate net- work for objective functions with different input dimensions. Attention-based architectures [Lee et al., 2019, Simpson et al., 2021] may provide a solution, with the additional 0246regretBranin (2D)0.00.20.40.6Michalewicz (2D)0510Kim1 (2D)EIEIpuSnAKeMONGOOSE =0.05MONGOOSE =0.0102Hartmann (3D)01020cost46regretAckley (4D)01020cost8910Shekel (4D)01020cost1520Ackley (5D)01020cost123Hartmann (6D) Figure 4: Regret against cost averaged across 24 Coco functions for a range of dimensions. Figure 5: Optimisation trajectories generated when searching for contaminates across the Ypacarai Lake. References Maximilian Balandat, Brian Karrer, Daniel Jiang, Samuel Daulton, Ben Letham, Andrew G Wilson, and Eytan Bak- shy. Botorch: A framework for efficient monte-carlo bayesian optimization. NeurIPS, 2020. Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ICML, 2009. Paul E Chang, Prakhar Verma, ST John, Victor Picheny, Henry Moss, and Arno Solin. Fantasizing with dual gps in bayesian optimization and active learning. arXiv, 2022. Tianlong Chen, Xiaohan Chen, Wuyang Chen, Howard Heaton, Jialin Liu, Zhangyang Wang, and Wotao Yin. Learning to optimize: A primer and a benchmark. JMLR, 2022. Yutian Chen, Matthew W Hoffman, Sergio Gómez Col- menarejo, Misha Denil, Timothy P Lillicrap, Matt Botvinick, and Nando Freitas. Learning to learn without gradient descent by gradient descent. In ICML, 2017. Aryan Deshwal, Syrine Belakaria, and Janardhan Rao Doppa. Mercer features for efficient combinatorial bayesian optimization. In AAAI, 2021. Figure 6: The maximum contamination found against dis- tance travelled by EI, EIpu, SnAKe and MONGOOSE. benefit of being invariant to the ordering of query points (a property that should hold for Bayes optimal agents, see Ortega et al. [2019] or Mikulik et al. [2020]). Another open question is how to extend memory-based optimisers to non- Euclidean search spaces, a jump recently made by BO in the context of gene design Moss et al. [2020a], molecular search Griffiths et al. [2022a,b] and combinatorial optimisa- tion Deshwal et al. [2021]. 01020cost12regret2D01020cost123D01020cost124DEIEIpuSnAKeMONGOOSE =0.05MONGOOSE =0.0101020cost125D01020cost126D01x101x2EI01x1EIpu01x1SnAKe01x1MONGOOSE =0.011.20.0051015202530distance travelled0.80.91.01.11.21.3negative contaminationEIEIpuSnAKeMONGOOSE =0.01MONGOOSE =0.001 Peter J Diggle, Jonathan A Tawn, and Rana A Moyeed. Model-based geostatistics. Journal of the Royal Statisti- cal Society Series C: Applied Statistics, 1998. Shali Jiang, Henry Chai, Javier Gonzalez, and Roman Gar- nett. Binoculars for efficient, nonmyopic sequential ex- perimental design. In ICML, 2020a. Steffen Finck, Nikolaus Hansen, Raymond Ros, and Anne Auger. Real-parameter black-box optimization bench- marking 2009: Presentation of the noiseless functions. Technical report, Citeseer, 2010. Shali Jiang, Daniel Jiang, Maximilian Balandat, Brian Kar- rer, Jacob Gardner, and Roman Garnett. Efficient nonmy- opic bayesian optimization via one-shot multi-step trees. NeurIPS, 2020b. Jose Pablo Folch, Shiqiang Zhang, Robert M Lee, Behrang Shafei, David Walz, Calvin Tsay, Mark van der Wilk, and Ruth Misener. Snake: Bayesian optimization with pathwise exploration. In NeurIPS, 2022. Peter I Frazier, Warren B Powell, and Savas Dayanik. A knowledge-gradient policy for sequential information col- lection. SICON, 2008. Javier González, Michael Osborne, and Neil Lawrence. Glasses: Relieving the myopia of bayesian optimisation. In AISTATS, 2016. Ryan-Rhys Griffiths, Jake L Greenfield, Aditya R Thawani, Arian R Jamasb, Henry B Moss, Anthony Bourached, Penelope Jones, William McCorkindale, Alexander A Aldrick, Matthew J Fuchter, et al. Data-driven discovery of molecular photoswitches with multioutput gaussian processes. Chemical Science, 2022a. Ryan-Rhys Griffiths, Leo Klarner, Henry B Moss, Aditya Ravuri, Sang Truong, Bojana Rankovic, Yuanqi Du, Arian Jamasb, Julius Schwartz, Austin Tripp, et al. Gauche: A library for gaussian processes in chemistry. arXiv, 2022b. Nikolaus Hansen, Anne Auger, Raymond Ros, Olaf Mers- mann, Tea Tušar, and Dimo Brockhoff. Coco: A platform for comparing continuous optimizers in a black-box set- ting. Optimization Methods and Software, 2021. Philipp Hennig and Christian J Schuler. Entropy search for information-efficient global optimization. JMLR, 2012. José Miguel Hernández-Lobato, Matthew W Hoffman, and Zoubin Ghahramani. Predictive entropy search for effi- cient global optimization of black-box functions. arXiv, 2014. Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 1997. Carl Hvarfner, Danny Stoll, Artur Souza, Marius Lindauer, Frank Hutter, and Luigi Nardi. π bo: Augmenting acquisi- tion functions with user beliefs for bayesian optimization. arXiv, 2022. Donald R Jones, Matthias Schonlau, and William J Welch. Efficient global optimization of expensive black-box func- tions. Journal of Global Optimization, 1998. Kirthevasan Kandasamy, Akshay Krishnamurthy, Jeff Schneider, and Barnabás Póczos. Parallelised Bayesian optimisation via Thompson sampling. In AISTATS, 2018. Robert Tjarko Lange, Tom Schaul, Yutian Chen, Tom Za- havy, Valenti Dallibard, Chris Lu, Satinder Singh, and Sebastian Flennerhag. Discovering evolution strategies via meta-black-box optimization. arXiv, 2022. Rodolphe Le Riche and Victor Picheny. Revisiting bayesian optimization in the light of the coco benchmark. Struc- tural and Multidisciplinary Optimization, 2021. Eric Lee, David Eriksson, David Bindel, Bolong Cheng, and Mike Mccourt. Efficient rollout strategies for bayesian optimization. In UAI, 2020. Eric Hans Lee, David Eriksson, Valerio Perrone, and Matthias Seeger. A nonmyopic approach to cost- constrained bayesian optimization. In UAI, 2021. Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation-invariant neural networks. In ICML, 2019. Luke Metz, James Harrison, C Daniel Freeman, Amil Mer- chant, Lucas Beyer, James Bradbury, Naman Agrawal, Ben Poole, Igor Mordatch, Adam Roberts, et al. Velo: Training versatile learned optimizers by scaling up. arXiv, 2022. Vladimir Mikulik, Grégoire Delétang, Tom McGrath, Tim Genewein, Miljan Martic, Shane Legg, and Pedro Ortega. Meta-trained agents implement bayes-optimal agents. NeurIPS, 2020. Henry Moss, David Leslie, Daniel Beck, Javier Gonzalez, and Paul Rayson. Boss: Bayesian optimization over string spaces. NeurIPS, 2020a. Henry B Moss, David S Leslie, and Paul Rayson. Mumbo: Multi-task max-value bayesian optimization. In Machine Learning and Knowledge Discovery in Databases, 2020b. Bahram Jafrasteh and Alberto Suárez. Objective functions from bayesian optimization to locate additional drillholes. Computers & Geosciences, 2021. Henry B Moss, David S Leslie, Javier Gonzalez, and Paul Rayson. Gibbon: General-purpose information-based bayesian optimisation. JMLR, 2021. Bobak Shahriari, Kevin Swersky, Ziyu Wang, Ryan P Adams, and Nando De Freitas. Taking the human out of the loop: A review of Bayesian optimization. IEEE, 2015. Fergus Simpson, Ian Davies, Vidhi Lalchand, Alessandro Vullo, Nicolas Durrande, and Carl Edward Rasmussen. Kernel identification through transformers. NeurIPS, 2021. Jasper Snoek, Hugo Larochelle, and Ryan P Adams. Practi- cal bayesian optimization of machine learning algorithms. NeurIPS, 2012. Jasper Snoek, Oren Rippel, Kevin Swersky, Ryan Kiros, Nadathur Satish, Narayanan Sundaram, Mostofa Patwary, Mr Prabhat, and Ryan Adams. Scalable bayesian opti- mization using deep neural networks. In ICML, 2015. Kevin Swersky, Jasper Snoek, and Ryan P Adams. Multi- task bayesian optimization. NeurIPS, 2013. Shia-Yen Teh, Robert Lin, Lung-Hsin Hung, and Abraham P Lee. Droplet microfluidics. Lab on a Chip, 2008. Sattar Vakili, Henry Moss, Artem Artemev, Vincent Dutor- doir, and Victor Picheny. Scalable thompson sampling using sparse gaussian process models. NeurIPS, 2021. Michael Volpp, Lukas P Fröhlich, Kirsten Fischer, Andreas Doerr, Stefan Falkner, Frank Hutter, and Christian Daniel. Meta-learning acquisition functions for transfer learning in bayesian optimization. arXiv, 2019. Zi Wang and Stefanie Jegelka. Max-value entropy search for efficient Bayesian optimization. In ICML, 2017. Paul J Werbos. Backpropagation through time: what it does and how to do it. IEEE, 1990. James Wilson, Viacheslav Borovitskiy, Alexander Terenin, Peter Mostowsky, and Marc Deisenroth. Efficiently sam- In pling functions from gaussian process posteriors. ICML, 2020. Xubo Yue and Raed AL Kontar. Why non-myopic bayesian optimization is promising and how far should we look- ahead? a study via rollout. In AISTATS, 2020. Henry B Moss, Sebastian W Ober, and Victor Picheny. In- ducing point allocation for sparse gaussian processes in high-throughput bayesian optimisation. arXiv, 2023. Tianwei Ni, Benjamin Eysenbach, and Ruslan Salakhutdi- nov. Recurrent model-free rl is a strong baseline for many pomdps. arXiv, 2021. Pedro A Ortega, Jane X Wang, Mark Rowland, Tim Ge- newein, Zeb Kurth-Nelson, Razvan Pascanu, Nicolas Heess, Joel Veness, Alex Pritzel, Pablo Sprechmann, et al. Meta-learning of sequential strategies. arXiv, 2019. Michael A Osborne, Roman Garnett, and Stephen J Roberts. Gaussian processes for global optimization. In LION, 2009. Andrei Paleyes, Henry B Moss, Victor Picheny, Piotr Zu- lawski, and Felix Newman. A penalisation method for batch multi-objective bayesian optimisation with applica- tion in heat exchanger design. arXiv, 2022. Victor Picheny, Henry Moss, Léonard Torossian, and Nico- las Durrande. Bayesian quantile and expectile optimisa- tion. In UAI, 2022. Matthias Poloczek, Jialei Wang, and Peter Frazier. Multi- information source optimization. NeurIPS, 2017. Ali Rahimi and Benjamin Recht. Random features for large- scale kernel machines. NeurIPS, 2007. Shyam Sundhar Ramesh, Pier Giuseppe Sessa, Andreas Krause, and Ilija Bogunovic. Movement penalized bayesian optimization with application to wind energy systems. NeurIPS, 2022. Bojana Rankovi ́c, Ryan-Rhys Griffiths, Henry B Moss, and Philippe Schwaller. Bayesian optimisation for additive screening and yield improvements in chemical reactions– beyond one-hot encodings. arXiv, 2022. Carl Edward Rasmussen, Christopher KI Williams, et al. Gaussian processes for machine learning. Springer, 2006. Ryan Roussel, Adi Hanuka, and Auralee Edelen. Multi- objective bayesian optimization for online accelerator tuning. Physical Review Accelerators and Beams, 2021. Federico Peralta Samaniego, Daniel Gutiérrez Reina, Sergio L Toral Marín, Mario Arzamendia, and Derlis O Gregor. A bayesian optimization approach for water resources monitoring through an autonomous surface vehicle: The ypacarai lake case study. IEEE Access, 2021. John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Rad- ford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv, 2017. MONGOOSE: Path-wise Smooth Bayesian Optimisation via Meta-learning (Supplementary Material) Adam X. Yang1,2 Laurence Aitchison1 Henry B. Moss2 1University of Bristol, UK 2Secondmind Labs, Cambridge, UK A ALTERNATIVE OBJECTIVES A.1 ADDITIVE MOVING COST In the main text, we considered incorporating moving cost through division, Ldiv(θ) = 1 + α (cid:80) L(θ) t c(xt, xt+1) . Here, we consider the alternative option to add the cost Ladd(θ) = L(θ) + α H−1 (cid:88) t=1 c(xt, xt+1), , (6) (7) however, this is not the ideal choice for black-box functions since the choice of cost scaling α in the additive case needs to be proportional to the scaling of the function and so is difficult to predetermine. Figure 7 compares their performance on normalised COCO functions, notice that they perform similarly under slightly different choices of cost scaling α. In particular, Ldiv with α = 0.001 gives very similar performance as Ladd with α = 0.01, and Ldiv with α = 0.01 is similar to Ladd with α = 0.05. Figure 7: Comparison of Ldiv(θ) versus Ladd(θ) averaged across the COCO benchmark. Individual plots for each COCO function are shown in Figure 25,26,27,28. 051015cost12regret2D051015cost123D051015cost124DMONGOOSE div =0.05MONGOOSE div =0.01MONGOOSE add =0.05MONGOOSE add =0.01051015cost125D051015cost126D A.2 THE MYOPIC OBJECTIVE The objective we use in our meta-training, as defined in Equation 2, is given by L(θ) = Ef (cid:20) f (x1) − min t=1,...,T (cid:21) f (xt) . This is the expected improvement over our prior with respect to the minimum function value reached during a trajectory of T steps. It is worth noting that this loss can be expressed as a cumulative sum of improvement, which has the same form as the 'observed improvement' proposed by Chen et al. [2017], L(θ) = Ef (cid:34) T (cid:88) t=1 max( min t(cid:48)=1,...,t−1 f (xt(cid:48)) − f (xt), 0) . (cid:35) However, when optimising this loss, Chen et al. [2017] detached the previous best function value max(mint(cid:48)=1,...,t fk(xt(cid:48)) during back-propagation, effectively making the objective myopic. In contrast, we do not detach gradients and calculate the loss exactly as it is written. To aid intuition, consider a horizon length of 2 with a single training function and x0 = 0. Under these assumption, our objective becomes LOI(θ) = max(f (x0) − f (x1), 0) + max(min{f (x0), f (x1)} (cid:125) (cid:124) (cid:123)(cid:122) detach −f (x2), 0). Now consider detaching the gradient of f (x1) from the second term. This leads to myopia because, when updating x1, its only contribution now comes from the first term which is only a one-step (i.e. myopic) improvement max(f (x0) − f (x1), 0). In contrast, a truly non-myopic approach should consider the effect of changing x1 on all subsequent improvements. From a more practical perspective, we saw a significant performance degradation when mimicking the gradient detaching of Chen et al. [2017], as shown in Figure 8. Figure 8: Comparing the non-myopic (red/orange) versus myopic (blues) meta-training objectives averaged across the COCO benchmark, with α = 0.01, 0.05. Individual plots for each COCO function are shown in Figure 29,30,31,32. 05cost12regret2D05cost123D05cost124DMONGOOSE =0.05MONGOOSE =0.01MONGOOSE detach =0.05MONGOOSE detach =0.0105cost125D05cost126D B EFFECT OF INJECTING GLOBAL STRUCTURE We now illustrate the effect of injecting the global structure we described in the main text into GP samples as Figure 9. The major effects of adding global structure include (1) moving global optimum from corners and edges towards the centre and (2) eliminating some modes at corners. Adding this global structure boosts the performance on standard BO benchmarks especially in 4D-6D functions (see Figure 10). When averaged across the COCO benchmark, MONGOOSE trained without global structure consistently achieves lower regret with a lower moving cost, and the advantage grows as dimensionality increases. Figure 9: Top: original GP samples obtained from a Màtern 5/2 kernel. Bottom: The same samples injected with randomly sampled global structure. 0101x2GP sample01GP sample01GP sample01GP sample01x101x2GP sample + glob01x1GP sample + glob01x1GP sample + glob01x1GP sample + glob-2.42.6-5.25.4-2.11.1-2.62.3-1.32.3-1.82.6-2.21.4-3.42.3 Figure 10: Investigating the effect of adding global structure during meta-training on standard BO benchmarks. Figure 11: Investigating the effect of adding global structure (red/orange) against standard GP sample (blue) during meta- training averaged across the COCO benchmark, with α = 0.01, 0.05. Individual plots for each COCO function are shown in Figure 21,22,23,24. 0246regretBranin (2D)0.00.20.40.6Michalewicz (2D)0510Kim1 (2D)MONGOOSE glob 0.05MONGOOSE glob 0.01MONGOOSE 0.05MONGOOSE 0.010123Hartmann (3D)0510cost46regretAckley (4D)0510cost8910Shekel (4D)0510cost12.515.017.520.0Ackley (5D)0510cost123Hartmann (6D)051015cost12regret2D051015cost123D051015cost124DMONGOOSE glob =0.05MONGOOSE glob =0.01MONGOOSE =0.05MONGOOSE =0.01051015cost125D051015cost126D C INDUCTIVE BIAS OF MEMORY-BASED META-OPTIMISERS We found that meta-trained memory-based optimisers using the non-myopic objective (Eq. 2 and Eq. 6) have an inductive bias of generating smooth trajectories with low cost. As illustrated in Figure 12, even with α = 0, the trajectory of MONGOOSE is than the jumpy trajectory of EI (Figure 12a). Further evidence is provided in Figure 14, which shows MONGOOSE α = 0 outperforming EI, EIpu and SnAKe in terms of averaged regret versus cost on the COCO benchmark (for dimensions higher than 2D). We suspect that MONGOOSE's inducitve bias for smooth paths is due to hidden states in memory-based learners containing more information from closest previous steps, thus biasing the output to lie close to previous outputs. (a) Top: trajectories of EI, EIpu, SnAKe, colour scale same as in Figure 1. Bottom: cumulative L2 cost along the trajectory. (b) Top: trajectories of MONGOOSE with α = 0, 0.001, 0.01, 0.05, colour scale same as in Figure 2. Bottom: cumulative L2 cost along the optimisation trajectory. Figure 12: Comparing trajectories and costs from a single run of EI, EIpu, SnAKe, and MONGOOSE with α = 0, 0.001, 0.01, 0.05. 01x101x2EI01x1EIpu01x1SnAKe02040steps051015cost02040steps02040steps-1.24.201x101x2MONGOOSE α=0.001x1MONGOOSE α=0.00101x1MONGOOSE α=0.0101x1MONGOOSE α=0.0502550steps051015cost02550steps02550steps02550steps-1.24.2 Figure 13: Comparison of EI, EIpu, SnAKe, MONGOOSE with α = 0.001 and α = 0 on standard BO benchmarks. Figure 14: Comparison of EI, EIpu, SnAKe, MONGOOSE with α = 0 and α = 0.001 averaged across the COCO benchmark. Individual plots for each COCO function are shown in Figure 33,34,35,36. 0246regretBranin (2D)0.000.250.50Michalewicz (2D)0510Kim1 (2D)EIEIpuSnAKeMONGOOSE =0.01MONGOOSE =0.00102Hartmann (3D)01020cost46regretAckley (4D)01020cost8910Shekel (4D)01020cost161820Ackley (5D)01020cost123Hartmann (6D)01020cost12regret2D01020cost123D01020cost124DEIEIpuSnAKeMONGOOSE =0.01MONGOOSE =0.00101020cost125D01020cost126D D EXPERIMENTS ON NOISY FUNCTIONS In the main text, we presented results on noiseless functions. Here, we consider adding Gaussian observation noise to function evaluations. Specifically, we sample noise η ∼ N (0, σ2), and let the model (GP for EI, EIpu and SnAKe; LSTM for MONGOOSE) observe new evaluation pair (xt, f (xt) + η), and choose next evaluation location based on noisy observations. when computing the final regret for all methods at test time, we still use the true function value without observation noise. The results for σ2 = 0.1 on standard BO benchmarks are shown in Figure 15 and on the COCO benchmark are shown in Figure 16 Figure 15: Comparison of EI, EIpu, SnAKe, MONGOOSE with α = 0.01 and α = 0.05 on standard BO benchmarks with observation noise η ∼ N (0, 0.1). Figure 16: Comparison of EI, EIpu, SnAKe, MONGOOSE with α = 0.01 and α = 0.05 averaged across the COCO bench- marks with observation noise η ∼ N (0, 0.1). Individual plots for each COCO function are shown in Figure 37,38,39,40. 0246regretBranin (2D)0.000.250.50Michalewicz (2D)0510Kim1 (2D)EIEIpuSnAKeMONGOOSE =0.05MONGOOSE =0.0102Hartmann (3D)01020cost46regretAckley (4D)01020cost910Shekel (4D)01020cost101520Ackley (5D)01020cost123Hartmann (6D)01020cost12regret2D01020cost123D01020cost124DEIEIpuSnAKeMONGOOSE =0.05MONGOOSE =0.0101020cost125D01020cost126D E EXPERIMENTS FOR 100 STEPS HORIZON In the main text, we showed results for a horizon of 50 steps. Here, we show the results for a horizon of 100 steps on standard benchmarks in Figure 17 and on COCO benchmarks Figure 18. Our conclusions from the main paper still hold, although SnAKe does perform noticeable better on Hartmann 6D as well as all COCO functions, which is its expected behaviour as the number of steps in a BO loop grows [Folch et al., 2022]. Figure 17: Comparison of EI, EIpu, SnAKe, MONGOOSE with α = 0.01 and α = 0.05 on standard BO benchmarks for a horizon of 100 steps. Figure 18: Comparison of EI, EIpu, SnAKe, MONGOOSE with α = 0.01 and α = 0.05 averaged across the COCO benchmarks for a horizon of 100 steps. Individual plots for each COCO function are shown in Figure 41,42,43,44. 0246regretBranin (2D)0.00.20.40.6Michalewicz (2D)0510Kim1 (2D)EIEIpuSnAKeMONGOOSE =0.05MONGOOSE =0.0102Hartmann (3D)01020cost46regretAckley (4D)01020cost78910Shekel (4D)01020cost1520Ackley (5D)01020cost123Hartmann (6D)01020cost12regret2D01020cost123D01020cost124DEIEIpuSnAKeMONGOOSE =0.05MONGOOSE =0.0101020cost125D01020cost126D F EI PER UNIT COST In this section we investigate the effect of the hyperparameter γ in EI per unit cost (EIpu). Recall EIpu is defined as EIpu(x) = EI(x) γ + 1 . In the main text, we chose γ = 1 following [Folch et al., 2022]. As demonstrated in Figure 19, EIpu with γ = 1, 0.1, 0.01 are all outperfomed by MONGOOSE Figure 19: Comparison of EIpu with γ = 0.01, 0.1, 1, and MONGOOSE with α = 0.01, 0.05, averaged across the COCO benchmarks for a horizon of 100 steps. Individual plots for each COCO function are shown in Figure 45,46,47,48. G COCO FUNCTIONS There are a total of 24 functions in the COCO benchmark Finck et al. [2010], Hansen et al. [2021], all of them are positive and have a known global minima with a corresponding minimum function value. Many have random parameters that we can sample to generate slightly different but similar functions. Since not all functions have this randomness and the random parameters are usually just rotations in the input space, we fixed all random parameters for our tests. One potential issue with functions in this benchmark is their outputs have vastly different ranges, for example, the ellipsoidal function (2D) ranges from 0 to 3e7 (Finck et al. [2010, p. 10]), the Rastrigin function (2D) ranges from 0 to 800 (Finck et al. [2010, p. 15]), the (log) Rosenbrock function (2D) ranges from 0 to 4 (Finck et al. [2010, p. 40]), etc. Therefore, we chose to standardise these functions ̃f (x) = f (x) maxx f (x) × 6 − 3 + fopt, where maxx f (x) is obtained through random search. Following, [Finck et al., 2010] we add fopt ∼ U [0, 1] for additional randomness of the optimum value. Figure 20 shows plots for all functions after normalisation in the COCO benchmark. Note that since we are plotting with a grid of points, they might not cover the exact minimas/maximas especially when they are in a thin valley, so the minimums/maximums on the colourscales do not represent the exact minimum/maximum values of functions. As described in the main text, for all experiments on the COCO benchmark, we meta-train 10 different MONGOOSE with 10 seeds, and we run EI, EIpu and SnAKe with 50 seeds each. 01020cost12regret2D01020cost123D01020cost124DEIpu =1EIpu =0.1EIpu =0.01MONGOOSE =0.05MONGOOSE =0.0101020cost125D01020cost126D Figure 20: Plots of all 24 functions (noramlised) in the COCO benchmark. 01x2sphereellipsoidalRastriginBuche Rastrigin01x2linearstep ellipsoidalattractive sectorRosenbrock01x2Rosenbrock rotateellipsoidal (non-sep)discusbent cigar01x2sharp ridgedifferent powersRastrigin (non-sep)Weierstrass01x2SchaffersSchaffers (ill)Griewank RosenbrockSchwefel01x101x2Gallagher 10101x1Gallagher 2101x1Katsuura01x1Lunacek bi-Rastrigin-3.52.5-3.52.5-3.52.4-3.52.5-3.52.5-3.52.5-3.52.5-1.02.5-1.82.5-3.52.5-3.52.5-3.52.5-3.52.5-0.62.5-3.52.5-3.52.0-2.12.4-2.12.4-3.52.5-2.12.4-3.52.6-3.52.5-3.52.5-3.52.4 H COCO INDIVIDUAL REGRET PLOTS In this final section, we present individual regret plots for each of the 24 COCO functions [Finck et al., 2010, Hansen et al., 2021], which are split into four plots of 6 functions for each setting above with an averaged COCO benchmark plot. We set the same y-axis scale across all regret plot to more easily see the results on which functions contribute more to the averaged differences in regret versus cost. Figure 21: Individual COCO plots for Figure 11. COCO functions 1-6: sphere function, ellipsoidal function, Rastrigin function, Büche-Rastrigin function, linear slope, step ellipsoidal function. 02468regret2D3D4DMONGOOSE glob =0.05MONGOOSE glob =0.01MONGOOSE =0.05MONGOOSE =0.015Dsphere6D02468regretBuche Rastrigin02468regretlinear02468regretstep ellipsoidal02468regretRosenbrock05101502468regret051015051015051015051015Rosenbrock rotate Figure 22: Individual COCO plots for Figure 11. COCO functions 7-12: attractive sector function, Rosenbrock (original) function, Rosenbrock (rotated) function, ellipsoidal (non-separable) function, discus function, bent cigar function. 02468regret2D3D4DMONGOOSE glob =0.05MONGOOSE glob =0.01MONGOOSE =0.05MONGOOSE =0.015Dellipsoidal6D02468regretsharp ridge02468regretdifferent powers02468regretSchwefel02468regretelliptic05101502468regret051015051015051015051015Rastrigin Figure 23: Individual COCO plots for Figure 11. COCO functions 13-18: sharp ridge function, different powers function, Rastrigin (non-separable) function, Weierstrrass function, Schaffers F7 function, Schaffers F7 (moderately ill-conditioned) function. 02468regret2D3D4DMONGOOSE glob =0.05MONGOOSE glob =0.01MONGOOSE =0.05MONGOOSE =0.015Dattractive sector6D02468regretdiscuss02468regretbent cigar02468regretrastrigin02468regretweierstrass05101502468regret051015051015051015051015schaffers Figure 24: Individual COCO plots for Figure 11. COCO functions 19-24: composite Griewank-Rosenbrock function, Schwefel function, Gallagher's Gaussian 101-me peaks function, Gallagher's Gaussian 21-hi peaks function, Kastsuura function, Lunacek bi-Rastrigin function. 02468regret2D3D4DMONGOOSE glob =0.05MONGOOSE glob =0.01MONGOOSE =0.05MONGOOSE =0.015Dschaffers6D02468regretGriewank rosenbrock02468regretGallagher02468regretGallagher02468regretKatsuura05101502468regret051015051015051015051015Lunacek Figure 25: Individual COCO plots for Figure 7. COCO functions 1-6: sphere function, ellipsoidal function, Rastrigin function, Büche-Rastrigin function, linear slope, step ellipsoidal function. 02468regret2D3D4DMONGOOSE div =0.05MONGOOSE div =0.01MONGOOSE add =0.05MONGOOSE add =0.015Dsphere6D02468regretBuche Rastrigin02468regretlinear02468regretstep ellipsoidal02468regretRosenbrock05101502468regret051015051015051015051015Rosenbrock rotate Figure 26: Individual COCO plots for Figure 7. COCO functions 7-12: attractive sector function, Rosenbrock (original) function, Rosenbrock (rotated) function, ellipsoidal (non-separable) function, discus function, bent cigar function. 02468regret2D3D4DMONGOOSE div =0.05MONGOOSE div =0.01MONGOOSE add =0.05MONGOOSE add =0.015Dellipsoidal6D02468regretsharp ridge02468regretdifferent powers02468regretSchwefel02468regretelliptic05101502468regret051015051015051015051015Rastrigin Figure 27: Individual COCO plots for Figure 7. COCO functions 13-18: sharp ridge function, different powers function, Rastrigin (non-separable) function, Weierstrrass function, Schaffers F7 function, Schaffers F7 (moderately ill-conditioned) function. 02468regret2D3D4DMONGOOSE div =0.05MONGOOSE div =0.01MONGOOSE add =0.05MONGOOSE add =0.015Dattractive sector6D02468regretdiscuss02468regretbent cigar02468regretrastrigin02468regretweierstrass05101502468regret051015051015051015051015schaffers Figure 28: Individual COCO plots for Figure 7. COCO functions 19-24: composite Griewank-Rosenbrock function, Schwefel function, Gallagher's Gaussian 101-me peaks function, Gallagher's Gaussian 21-hi peaks function, Kastsuura function, Lunacek bi-Rastrigin function. 02468regret2D3D4DMONGOOSE div =0.05MONGOOSE div =0.01MONGOOSE add =0.05MONGOOSE add =0.015Dschaffers6D02468regretGriewank rosenbrock02468regretGallagher02468regretGallagher02468regretKatsuura05101502468regret051015051015051015051015Lunacek Figure 29: Individual COCO plots for Figure 7. COCO functions 1-6: sphere function, ellipsoidal function, Rastrigin function, Büche-Rastrigin function, linear slope, step ellipsoidal function. 02468regret2D3D4DMONGOOSE detach =0.05MONGOOSE detach =0.015Dsphere6D02468regretBuche Rastrigin02468regretlinear02468regretstep ellipsoidal02468regretRosenbrock051002468regret0510051005100510Rosenbrock rotate Figure 30: Individual COCO plots for Figure 7. COCO functions 7-12: attractive sector function, Rosenbrock (original) function, Rosenbrock (rotated) function, ellipsoidal (non-separable) function, discus function, bent cigar function. 02468regret2D3D4DMONGOOSE detach =0.05MONGOOSE detach =0.015Dellipsoidal6D02468regretsharp ridge02468regretdifferent powers02468regretSchwefel02468regretelliptic051002468regret0510051005100510Rastrigin Figure 31: Individual COCO plots for Figure 7. COCO functions 13-18: sharp ridge function, different powers function, Rastrigin (non-separable) function, Weierstrrass function, Schaffers F7 function, Schaffers F7 (moderately ill-conditioned) function. 02468regret2D3D4DMONGOOSE detach =0.05MONGOOSE detach =0.015Dattractive sector6D02468regretdiscuss02468regretbent cigar02468regretrastrigin02468regretweierstrass051002468regret0510051005100510schaffers Figure 32: Individual COCO plots for Figure 8. COCO functions 19-24: composite Griewank-Rosenbrock function, Schwefel function, Gallagher's Gaussian 101-me peaks function, Gallagher's Gaussian 21-hi peaks function, Kastsuura function, Lunacek bi-Rastrigin function. 02468regret2D3D4DMONGOOSE detach =0.05MONGOOSE detach =0.015Dschaffers6D02468regretGriewank rosenbrock02468regretGallagher02468regretGallagher02468regretKatsuura051002468regret0510051005100510Lunacek Figure 33: Individual COCO plots for Figure 14. COCO functions 1-6: sphere function, ellipsoidal function, Rastrigin function, Büche-Rastrigin function, linear slope, step ellipsoidal function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.01MONGOOSE =0.0015Dsphere6D02468regretellipsoidal02468regretRastrigin02468regretBuche Rastrigin02468regretlinear0102002468regret01020010200102001020step ellipsoidal Figure 34: Individual COCO plots for Figure 14. COCO functions 7-12: attractive sector function, Rosenbrock (original) function, Rosenbrock (rotated) function, ellipsoidal (non-separable) function, discus function, bent cigar function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.01MONGOOSE =0.0015Dattractive sector6D02468regretRosenbrock02468regretRosenbrock rotate02468regretellipsoidal (non-sep)02468regretdiscus0102002468regret01020010200102001020bent cigar Figure 35: Individual COCO plots for Figure 14. COCO functions 13-18: sharp ridge function, different powers function, Rastrigin (non-separable) function, Weierstrrass function, Schaffers F7 function, Schaffers F7 (moderately ill-conditioned) function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.01MONGOOSE =0.0015Dsharp ridge6D02468regretdifferent powers02468regretRastrigin (non-sep)02468regretWeierstrass02468regretSchaffers0102002468regret01020010200102001020Schaffers (ill) Figure 36: Individual COCO plots for Figure 14. COCO functions 19-24: composite Griewank-Rosenbrock function, Schwefel function, Gallagher's Gaussian 101-me peaks function, Gallagher's Gaussian 21-hi peaks function, Kastsuura function, Lunacek bi-Rastrigin function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.01MONGOOSE =0.0015DGriewank Rosenbrock6D02468regretSchwefel02468regretGallagher 10102468regretGallagher 2102468regretKatsuura0102002468regret01020010200102001020Lunacek bi-Rastrigin Figure 37: Individual COCO plots for Figure 37. COCO functions 1-6: sphere function, ellipsoidal function, Rastrigin function, Büche-Rastrigin function, linear slope, step ellipsoidal function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.01MONGOOSE =0.0015Dsphere6D02468regretellipsoidal02468regretRastrigin02468regretBuche Rastrigin02468regretlinear0102002468regret01020010200102001020step ellipsoidal Figure 38: Individual COCO plots for Figure 37. COCO functions 7-12: attractive sector function, Rosenbrock (original) function, Rosenbrock (rotated) function, ellipsoidal (non-separable) function, discus function, bent cigar function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.01MONGOOSE =0.0015Dattractive sector6D02468regretRosenbrock02468regretRosenbrock rotate02468regretellipsoidal (non-sep)02468regretdiscus0102002468regret01020010200102001020bent cigar Figure 39: Individual COCO plots for Figure 37. COCO functions 13-18: sharp ridge function, different powers function, Rastrigin (non-separable) function, Weierstrrass function, Schaffers F7 function, Schaffers F7 (moderately ill-conditioned) function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.01MONGOOSE =0.0015Dsharp ridge6D02468regretdifferent powers02468regretRastrigin (non-sep)02468regretWeierstrass02468regretSchaffers0102002468regret01020010200102001020Schaffers (ill) Figure 40: Individual COCO plots for Figure 37. COCO functions 19-24: composite Griewank-Rosenbrock function, Schwefel function, Gallagher's Gaussian 101-me peaks function, Gallagher's Gaussian 21-hi peaks function, Kastsuura function, Lunacek bi-Rastrigin function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.01MONGOOSE =0.0015DGriewank Rosenbrock6D02468regretSchwefel02468regretGallagher 10102468regretGallagher 2102468regretKatsuura0102002468regret01020010200102001020Lunacek bi-Rastrigin Figure 41: Individual COCO plots for Figure 18. COCO functions 1-6: sphere function, ellipsoidal function, Rastrigin function, Büche-Rastrigin function, linear slope, step ellipsoidal function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.05MONGOOSE =0.015Dsphere6D02468regretellipsoidal02468regretRastrigin02468regretBuche Rastrigin02468regretlinear0102002468regret01020010200102001020step ellipsoidal Figure 42: Individual COCO plots for Figure 18. COCO functions 7-12: attractive sector function, Rosenbrock (original) function, Rosenbrock (rotated) function, ellipsoidal (non-separable) function, discus function, bent cigar function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.05MONGOOSE =0.015Dattractive sector6D02468regretRosenbrock02468regretRosenbrock rotate02468regretellipsoidal (non-sep)02468regretdiscus0102002468regret01020010200102001020bent cigar Figure 43: Individual COCO plots for Figure 18. COCO functions 13-18: sharp ridge function, different powers function, Rastrigin (non-separable) function, Weierstrrass function, Schaffers F7 function, Schaffers F7 (moderately ill-conditioned) function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.05MONGOOSE =0.015Dsharp ridge6D02468regretdifferent powers02468regretRastrigin (non-sep)02468regretWeierstrass02468regretSchaffers0102002468regret01020010200102001020Schaffers (ill) Figure 44: Individual COCO plots for Figure 18. COCO functions 19-24: composite Griewank-Rosenbrock function, Schwefel function, Gallagher's Gaussian 101-me peaks function, Gallagher's Gaussian 21-hi peaks function, Kastsuura function, Lunacek bi-Rastrigin function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.05MONGOOSE =0.015DGriewank Rosenbrock6D02468regretSchwefel02468regretGallagher 10102468regretGallagher 2102468regretKatsuura0102002468regret01020010200102001020Lunacek bi-Rastrigin Figure 45: Individual COCO plots for Figure 19. COCO functions 1-6: sphere function, ellipsoidal function, Rastrigin function, Büche-Rastrigin function, linear slope, step ellipsoidal function. 02468regret2D3D4DEIpu =0.01EIpu =0.1EIpu =1MONGOOSE =0.05MONGOOSE =0.015Dsphere6D02468regretellipsoidal02468regretRastrigin02468regretBuche Rastrigin02468regretlinear0102002468regret01020010200102001020step ellipsoidal Figure 46: Individual COCO plots for Figure 19. COCO functions 7-12: attractive sector function, Rosenbrock (original) function, Rosenbrock (rotated) function, ellipsoidal (non-separable) function, discus function, bent cigar function. 02468regret2D3D4DEIpu =0.01EIpu =0.1EIpu =1MONGOOSE =0.05MONGOOSE =0.015Dattractive sector6D02468regretRosenbrock02468regretRosenbrock rotate02468regretellipsoidal (non-sep)02468regretdiscus0102002468regret01020010200102001020bent cigar Figure 47: Individual COCO plots for Figure 19. COCO functions 13-18: sharp ridge function, different powers function, Rastrigin (non-separable) function, Weierstrrass function, Schaffers F7 function, Schaffers F7 (moderately ill-conditioned) function. 02468regret2D3D4DEIpu =0.01EIpu =0.1EIpu =1MONGOOSE =0.05MONGOOSE =0.015Dsharp ridge6D02468regretdifferent powers02468regretRastrigin (non-sep)02468regretWeierstrass02468regretSchaffers0102002468regret01020010200102001020Schaffers (ill) Figure 48: Individual COCO plots for Figure 19. COCO functions 19-24: composite Griewank-Rosenbrock function, Schwefel function, Gallagher's Gaussian 101-me peaks function, Gallagher's Gaussian 21-hi peaks function, Kastsuura function, Lunacek bi-Rastrigin function. 02468regret2D3D4DEIpu =0.01EIpu =0.1EIpu =1MONGOOSE =0.05MONGOOSE =0.015DGriewank Rosenbrock6D02468regretSchwefel02468regretGallagher 10102468regretGallagher 2102468regretKatsuura0102002468regret01020010200102001020Lunacek bi-Rastrigin Figure 49: Individual COCO plots for Figure 4. COCO functions 1-6: sphere function, ellipsoidal function, Rastrigin function, Büche-Rastrigin function, linear slope, step ellipsoidal function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.05MONGOOSE =0.015Dsphere6D02468regretellipsoidal02468regretRastrigin02468regretBuche Rastrigin02468regretlinear0102002468regret01020010200102001020step ellipsoidal Figure 50: Individual COCO plots for Figure 4. COCO functions 7-12: attractive sector function, Rosenbrock (original) function, Rosenbrock (rotated) function, ellipsoidal (non-separable) function, discus function, bent cigar function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.05MONGOOSE =0.015Dattractive sector6D02468regretRosenbrock02468regretRosenbrock rotate02468regretellipsoidal (non-sep)02468regretdiscus0102002468regret01020010200102001020bent cigar Figure 51: Individual COCO plots for Figure 4. COCO functions 13-18: sharp ridge function, different powers function, Rastrigin (non-separable) function, Weierstrrass function, Schaffers F7 function, Schaffers F7 (moderately ill-conditioned) function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.05MONGOOSE =0.015Dsharp ridge6D02468regretdifferent powers02468regretRastrigin (non-sep)02468regretWeierstrass02468regretSchaffers0102002468regret01020010200102001020Schaffers (ill) Figure 52: Individual COCO plots for Figure 4. COCO functions 19-24: composite Griewank-Rosenbrock function, Schwefel function, Gallagher's Gaussian 101-me peaks function, Gallagher's Gaussian 21-hi peaks function, Kastsuura function, Lunacek bi-Rastrigin function. 02468regret2D3D4DSnAKeEIpuEIMONGOOSE =0.05MONGOOSE =0.015DGriewank Rosenbrock6D02468regretSchwefel02468regretGallagher 10102468regretGallagher 2102468regretKatsuura0102002468regret01020010200102001020Lunacek bi-Rastrigin
http://arxiv.org/abs/2302.11529v1
2023-02-22T18:11:25
2023-02-22T18:11:25
Modular Deep Learning
Transfer learning has recently become the dominant paradigm of machine learning. Pre-trained models fine-tuned for downstream tasks achieve better performance with fewer labelled examples. Nonetheless, it remains unclear how to develop models that specialise towards multiple tasks without incurring negative interference and that generalise systematically to non-identically distributed tasks. Modular deep learning has emerged as a promising solution to these challenges. In this framework, units of computation are often implemented as autonomous parameter-efficient modules. Information is conditionally routed to a subset of modules and subsequently aggregated. These properties enable positive transfer and systematic generalisation by separating computation from routing and updating modules locally. We offer a survey of modular architectures, providing a unified view over several threads of research that evolved independently in the scientific literature. Moreover, we explore various additional purposes of modularity, including scaling language models, causal inference, programme induction, and planning in reinforcement learning. Finally, we report various concrete applications where modularity has been successfully deployed such as cross-lingual and cross-modal knowledge transfer. Related talks and projects to this survey, are available at https://www.modulardeeplearning.com/.
[ "Jonas Pfeiffer", "Sebastian Ruder", "Ivan Vulić", "Edoardo Maria Ponti" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11529v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11529v1", "@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 2 2 ] G L . s c [ 1 v 9 2 5 1 1 . 2 0 3 2 : v i X r a Modular Deep Learning Jonas Pfeiffer∗ Google Research Sebastian Ruder∗ Google Research Ivan Vulić University of Cambridge Edoardo M. Ponti∗ University of Edinburgh University of Cambridge [email protected] [email protected] [email protected] [email protected] Abstract Transfer learning has recently become the dominant paradigm of machine learning. Pre- trained models fine-tuned for downstream tasks achieve better performance with fewer labelled examples. Nonetheless, it remains unclear how to develop models that specialise towards multiple tasks without incurring negative interference and that generalise systematically to non-identically distributed tasks. Modular deep learning has emerged as a promising solution to these challenges. In this framework, units of computation are often implemented as autonomous parameter-efficient modules. Information is conditionally routed to a subset of modules and subsequently aggregated. These properties enable positive transfer and systematic generalisation by separating computation from routing and updating modules locally. We offer a survey of modular architectures, providing a unified view over several threads of research that evolved independently in the scientific literature. Moreover, we explore various additional purposes of modularity, including scaling language models, causal inference and discovery, programme simulation, and hierarchical reinforcement learning. Finally, we report various concrete applications where modularity has been successfully deployed such as cross-lingual and cross-modal knowledge transfer. More information on modular deep learning is available at www.modulardeeplearning.com/. 1 Introduction and Motivation Transfer learning has recently become pervasive in machine learning technology, such as in natural language processing (Ruder et al., 2019b; Brown et al., 2020), computer vision (Dosovitskiy et al., 2021), and reinforcement learning (Reed et al., 2022), among other areas. In its most successful incarnation, transfer learning consists of pre-training a model on vast amounts of raw data in a self-supervised fashion and subsequently fine-tuning it for new tasks based on a small number of labelled examples. Despite its success, this paradigm for transfer learning suffers from a series of limitations in various settings. Firstly, in multi-task fine-tuning, the learning signals from different tasks may negatively interfere with each other (McCloskey & Cohen, 1989). Similarly, in continuous learning, adapting to new examples can result in catastrophic forgetting of knowledge acquired from previous examples (Sutton, 1986; French, 1999).1 Secondly, in settings where the training and evaluation distributions are not identical, these models fail in generalising systematically (Lake & Baroni, 2018; Hupkes et al., 2020). This makes models brittle and inaccurate and hampers their deployment in real-world applications, where distribution shifts are common. ∗Authors contributed equally. 1These phenomena have also been referred to as spatial and temporal 'crosstalk' (Jacobs et al., 1991b). 1 (a) MAD-X (b) Polytropon (c) Mixture-of-Expert Transformer Figure 1: Case studies of modular deep learning; best viewed in colour. Green components illustrate different routing functions (see § 4), shade-of-purple components illustrate modular computation functions (see §3). 1a) MAD-X (Pfeiffer et al., 2020b) uses Adapter layers with fixed routing for zero-shot cross-lingual transfer. 1b) Polytropon (Ponti et al., 2022) uses low-rank adapters (LoRA; Hu et al., 2022) with hard learned routing for few-shot task adaptation. 1c) MoE Transformers (Fedus et al., 2021; Clark et al., 2022, inter alia) use Multi-Layer Perceptrons with top-k soft routing, in order to scale to larger model sizes. The three representative models illustrated here are only a fraction of possible configurations from the 'configuration manifold' that can be created by varying the components surveyed in §3-§6. In contrast, many biological and artificial systems do not suffer from these weaknesses by virtue of their modularity (Fodor, 1983; Ballard, 1986), defined as the correspondence between strongly interconnected components of a system (i.e., modules) and the functions they perform (Baldwin & Clark, 2000; Ulrich, 1995). In other words, each module is specialised for a unique purpose, for which it is reused consistently. In animal brains, this favours evolvability, the ability to adapt quickly to new environments, and resilience to environment perturbations (Wagner et al., 2005) because it makes rewiring connections easier than in monolithic, entangled networks (Kashtan & Alon, 2005). Artificial systems, such as programming languages and computer hardware, are similarly designed in a modular fashion (Booch et al., 2008; Baldwin & Clark, 2000) because this modular design favours consistency, ease of adaptation, and interpretability. To what extent, then, do 'vanilla' neural networks display the desirable property of being modular? In principle, given their fully connected nature, they could develop such a structure as a by-product of optimising a loss for a downstream task. Recent structural analyses based on hierarchical clustering of neurons revealed that vanilla neural networks can indeed learn such a modular pattern (Watanabe, 2019; Casper et al., 2022; Foroutan et al., 2022). Favourable conditions for the emergence of modularity include multi-task learning (Dobs et al., 2022) and regularisation through dropout (Lange et al., 2022). In particular, from a structural perspective, populations of neurons may activate jointly in response to specific features of the input or the output classes,2 resulting in similar changes in model performance when ablated (Meyes et al., 2020). From a functional perspective, multi-task learning may lead to segregated, specialised sub-networks (Yang et al., 2019; Dobs et al., 2022). On the other hand, Csordás et al. (2021) revealed that a given sub-network does not tend to be re-used for similar sub-tasks nor to be combined with others to express more complex functions. 2Lange et al. (2022) found that clusters identified through downstream (output) information do not match with the clusters identified through upstream (input) information. They attribute this phenomenon to their different roles, namely disentanglement of the input structure and composition of the output structure, respectively. 2 In fact, in many cases, the performance of a model on simple tasks requiring a certain skill and composite tasks requiring a combination thereof is entirely uncorrelated (Li et al., 2022a). For this reason, previous work explored the idea of designing neural networks that are explicitly modular (Jacobs et al., 1991a; Rosenbaum et al., 2018; Ponti, 2021; Mittal et al., 2022). This has the goal of achieving not only functional specialisation (Zhang et al., 2022b), but also re-usability and composability. In particular, these methods involve identifying 1) modules in a neural network that can be updated locally and asynchronously, without affecting the rest of the parameters; 2) a routing function that chooses a subset of modules for each example or task; and 3) an aggregation function that aggregates the outputs of the active modules. Each of these three ingredients can be manually specified or learned. We provide several case studies of different configurations of these components in Figure 1. The main advantages of modular neural architectures are positive transfer, compositionality, and parameter efficiency. Firstly, modularity encourages positive transfer by encoding similar functions with the same module. At the same time, it prevents interference and forgetting by allocating distinct functions to different dedicated modules (Jacobs et al., 1991b). For instance, massively multilingual Transformer-based models in NLP are known to suffer from a 'curse of multilinguality' (Conneau et al., 2020) due to the conflicting information that the gradient from each language-specific loss carries (Wang et al., 2021b). A possible solution is augmenting these entangled, fully shared models with specialised modules responsible for individual languages (Pfeiffer et al., 2020b; 2022b). More generally, as the range of tasks modelled jointly by a single model becomes increasingly diverse, modularity may be instrumental in the advent of general-purpose, multi-modal agents that encompass vision, language, and action (Reed et al., 2022). Secondly, modules representing different skills (at the task level) or features (at the example level) can be composed together and updated locally, without affecting the rest of the network. These two properties are crucial in two main settings, which correspond to different aspects of systematic generalisation: one is the ability to re-compose, i.e. zero-shot transfer to tasks consisting of new combinations of learned skills, or examples consisting of new combinations of observed features (Hupkes et al., 2020). For instance, while modules for the Guaraní language and for dependency parsing can only be trained separately due to the lack of annotated data for dependency parsing in Guaraní, they can be composed to perform inference on this unobserved task–language combination (Pfeiffer et al., 2020b). Similarly, in hierarchical reinforcement learning, an agent can follow different sequences of modular policies known as options in tasks requiring the completion of similar sub-goals in different orders (Sutton et al., 1999; Precup, 2000). The other aspect of systematic generalisation is robustness. In fact, if modules are taken to correspond to independent and reusable physical mechanisms (Schölkopf et al., 2012), local shifts in their distributions require updating only the parameters accounting for the affected skills or features (Goyal et al., 2021; Schölkopf et al., 2021), while the rest of the model remains invariant to the change. In practice, the ability to perform local updates facilitates sample efficiency, as fewer examples are necessary to adapt models to new tasks (Bengio et al., 2020; Ponti et al., 2022). Thirdly, an additional advantage of modular neural architectures is parameter and time efficiency. In this framework, fine-tuning a model on a specific task only requires storing a modular adapter rather than a separate copy of the entire (typically large) model. What is more, modules can be added or removed on-the-fly in an incremental manner, adjusting the model capacity according to the task complexity. This ability is known as conditional computation (Bengio et al., 2015). Finally, modularity enables language models to scale to larger numbers of parameters while retaining the same time complexity, by selecting only a small set of experts per example (Shazeer et al., 2017; Fedus et al., 2021). As the main contribution of this survey, we offer a unified view of modular deep learning, illustrating how many families of methods can be defined along four key dimensions: 1) how they implement modules, which constitute the minimum unit of computation; 2) how they select active modules through a routing function; 3) how module outputs are aggregated; and 4) how the modules are trained with the rest of the model. For module implementation, we discuss sparse subnetworks (Hu et al., 2022; Ansell et al., 2022), adapter layers (Rebuffi et al., 2018; Pfeiffer et al., 2020b), and prefix tuning (Li & Liang, 2021), among others. These methods have been proven as an effective way to adapt large pre-trained models, achieving better performance and sample efficiency than alternative strategies such as in-context learning (Liu et al., 2022b), which may be 3 brittle (Lu et al., 2022). In fact, modules can also take the form of human-engineered prompts, where the model is provided with input–output examples (Brown et al., 2020) or task instructions (Wei et al., 2022). While many module implementations share the same underlying functional form (He et al., 2021), they offer different trade-offs between efficiency and performance. We then discuss how routing functions control the flow of information to the modules: in fixed routing, module allocation is manually defined when expert knowledge is available(Hampshire & Waibel, 1992; Rajendran et al., 2017, inter alia). In learned routing, a parameterised routing function is inferred during training. This, however, poses a series of challenges, such as training instability, module collapse, and overfitting (Rosenbaum et al., 2019). Orthogonally, we also distinguish between hard and soft routing. In hard routing, only a subset of modules is activated (Rosenbaum et al., 2018; Ponti et al., 2022; Fernando et al., 2017, inter alia). In soft routing, all modules are aggregated according to continuous scores (Jacobs et al., 1991b; Jordan & Jacobs, 1994). While soft routing is amenable to vanilla gradient descent, it is highly inefficient. On the other hand, hard routing requires approximate inference but facilitates conditional computation and module specialisation. When multiple modules are selected, several aggregation strategies are possible. For instance, these can be based on interpolating the parameters of active modules (Ansell et al., 2022) or an attention mechanism over the module outputs (Pfeiffer et al., 2021a). Alternative methods include input prompt concatenation (Vu et al., 2022b) and function composition (Andreas et al., 2016b). Finally, modules can be trained jointly with the rest of the base model in multi-task learning (Caruana, 1997; Ruder, 2017), added sequentially in classic continual learning (Rusu et al., 2016), or integrated post-hoc into an already pre-trained and frozen model (Rebuffi et al., 2017; Houlsby et al., 2019). The last scenario is most common with current state-of-the-art models, which are trained as dense, fully shared models and may be 'modularised' after pre-training. Crucially, this taxonomy reveals unexpected connections between several independent threads of research, including aggregation functions and mode connectivity (Frankle et al., 2020), routing and hypernetworks (Ha et al., 2017), among others. We further illustrate a series of applications of modular networks in transfer learning across different areas such as natural language processing, computer vision, and speech processing. In addition, we show how modularity plays an important role in causal inference and discovery, programme simulation, and hierarchical reinforcement learning. We hope that our overview will spark future research on modular deep learning in areas that may benefit from it such as community-driven efforts to develop and maintain machine learning technology. This survey, as well as related talks and projects, is available at https://www.modulardeeplearning.com/. 2 Modular Deep Learning This survey focuses on modular deep learning: namely, on models composed of modules. These are autonomous computation functions that, depending on their architecture and purpose, are variously referred to as adapters (Rebuffi et al., 2017; Pfeiffer et al., 2020a), options (Sutton et al., 1999; Precup, 2000), or experts (Jacobs et al., 1991a; Jordan & Jacobs, 1994). Crucially, these modules are distinguished from a routing function, which controls the information flow to the modules. Finally, an aggregation function aggregates their outputs. Modules can be optionally combined with fully shared (thus, non-modular) parameters as part of the same neural architecture. In order to provide a unified view of the landscape of modular deep learning, we create a taxonomy of four dimensions of variation: computation, routing, aggregation, and training. These dimensions are mutually independent; hence, many methods can be interpreted as different combinations of these dimensions, listed in § 2.1. Concurrently, we provide a unified, consistent notation in § 2.2, which helps illuminate the relationship among such methods. 2.1 Taxonomy 1) Computation function: How is each module implemented? (§ 3) A module may consist of any component of a neural architecture, such as multiple copies of a model (Jacobs et al., 1991a) or one of its layers (Fedus et al., 2021). Alternatively, as it is common in transfer learning, modules can be combined with a function parameterised by fully shared pre-trained weights. In this case, we distinguish between modification of 4 Notation Definition Input data Output data Hidden representation Task index x ∈ X y ∈ Y h ∈ H t ∈ T f : X ∪ H → Y ∪ H A computation function θ M = {φ1, . . . , φ|M |} α ∈ A r : X ∪ H ∪ T → A ρ g γ Shared parameters Set of module parameters Vector of routing scores Routing function Routing parameters Aggregation function Aggregation parameters Table 1: Notation and definition of important variables, functions, and operators. parameters (parameter composition), concatenation with input features (input composition), and function composition by stacking neural modules. 2) Routing function: How are active modules selected? (§ 4) Under fixed routing, we categorise approaches where the routing function is fixed. This assumes that the specialisation of each module, as well as the combination of modules required for each task, is known a priori. In learned routing, the parameters of the routing mechanism are learned during training. In this case, routing is soft if all modules are ranked through a continuous score, or hard if each module is given a binary score (active or inactive). 3) Aggregation function: How are the outputs of the active modules aggregated? (§ 5) We differentiate between methods that compose the outputs of the active modules deterministically (e.g., based on a weighted average) from those where the aggregation function is implemented as a learnable neural network that depends on the output of all modules. 4) Training setting: How are the modules trained? (§ 6) Some methods, such as MoEs, train the modules (and possibly the routing function) jointly with the shared weights of a randomly initialised model. As an alternative, transfer learning approaches introduce modules post-hoc after pre-training weights and adapt them during fine-tuning. In continuous learning settings, instead, new modules may be introduced iteratively for every new task in a sequence. 2.2 Notation More formally, let a neural network fθ : X → Y be decomposed into a graph of sub-functions. In the simplest case, this graph is a linear chain fθ1 ◦ fθ2 ◦ * * * ◦ fθl , where ◦ stands for function composition. These sub-functions refer to the model's l layers, each with unique indexed parameters θi, i = 1, . . . , l.3 In turn, these can be further decomposed recursively into a graph of their constituent sub-functions: for instance, a Transformer layer (Vaswani et al., 2017) includes linear mappings for the query, key, value, and output, as well as a non-linear feed-forward network, and residual connections. We further denote the values of the parameters at initialisation as θ0, and the parameters after training are denoted as θ?. Any i-th sub-function with input x can be modified by a module with parameters φ from the inventory Mi in the following different ways: 1. parameter composition: f 0 i (x) = fθi⊕φ(x), where ⊕ stands for an operation that composes the original parameters with the module parameters, such as element-wise addition. An example is low-rank (Hu et al., 2022) or sparse (Ansell et al., 2022) adapters. 3We abuse notation by treating indexing over functions, fi, as identical to indexing over the parameters of a function, fθi . In this survey, both are used interchangeably. 5 2. input composition: f 0 i Li & Liang (2021). (x) = fθi ([φ, x]), where [*, *] stands for concatenation. An example is prefix tuning 3. function composition: f 0 i (x) = fφ ◦ fθi function. An example are adapter layers (Rebuffi et al., 2017). (x), where the outputs of the first function is fed into the second can be selected through For each i-th sub-function, multiple modules from an inventory Mi = fφ1 , . . . , fφ|M | a routing function r(*), which returns a score αj for each module fφj conditioned on the data itself, such as a language token or a visual region x or the full input x, or metadata such as the task identity t ∈ T . Note that α can be fixed a priori through expert knowledge or learned through an appropriate parameterisation rρ(*), where ρ refers to (learnable) parameters of the routing function. Often, the routing function takes special forms: 1. In hard routing, α ∈ {0, 1}|M | is a discrete binary vector. If these parameters are learned, inference usually relies on score function estimators, stochastic re-parameterisation, or evolutionary algorithms. 2. In soft routing, α ∈ [0, 1]|M | is a continuous probability distribution, such that P j αj = 1. 3. Finally, α ∈ R|M | can be an unnormalised score vector. This is the case in linear hypernetworks (Ha et al., 2017), where α is usually interpreted as a task embedding and the row-wise stacked module parameters Φ = [φ1, . . . , φ|M |] act as a parameter generator. Finally, the output of each module is combined through an aggregation function g(*).4 The aggregation function usually takes two possible forms. One consists of a deterministic operation based on the routing scores (e.g., weighted averaging of module parameters or outputs). The other consists of a learnable neural network, such as an attention mechanism between the modules' inputs and outputs (Pfeiffer et al., 2021a). When we put the computation function, routing function, and aggregation function together, we obtain the general recipe for a modular function, illustrated in Algorithm 1. Algorithm 1: Forward pass of a modular function 1 Inputs: example x, task t 2 α ← rρ(x, t) // Routing 3 H ← {} 4 for φj ∈ Mi do 5 hj ← f (x; θi, φj) // Computation H ← H ∪ hj 6 7 y ← gγ(α, H) // Aggregation Given shared parameters θi for the i-th sub-function and a corresponding inventory of modules Mi, we first sample a task t, and an input x. The routing scores α are obtained from the routing function r(*). We now compute the hidden representation hj of each module φj and aggregate them with the function g(*) into the output y. We elaborate on the settings for training these different components in § 6. We provide an overview of representative computation, routing, and aggregation functions in Table 2. 3 Computation Function The computation function determines the design of a module. Various module architectures have been proposed such as MLP layers (Rosenbaum et al., 2018; Kirsch et al., 2018; Chang et al., 2019), independent RNNs (Goyal et al., 2021), independent CNNs (Parascandolo et al., 2018), or special-purpose architectures (Andreas et al., 2016b). However, in transfer learning, modules are most often integrated into a base architecture whose parameters are fully shared. We identify three core methods to merge a single module with 4To avoid clutter in terminology, throughout this work we use the term composition to refer to the merger of computation functions (§ 3), and the term aggregation to refer to different approaches of combining the outputs of different modules (§ 5). 6 Method Reference Function Sparse subnetwork Supermasks Sparse fine-tuning Intrinsic dimension Low-rank adaptation Prompting Prompt tuning Multi-layer prompt tuning Parameter sharing Convolutional adapter Transformer adapter Compacter Parallel adapter Rescaling Hypernetwork Frankle & Carbin (2019) Wortsman et al. (2020) Ansell et al. (2022) Li et al. (2018) Hu et al. (2022) Brown et al. (2020) Lester et al. (2021) Li & Liang (2021) Ruder (2017) Rebuffi et al. (2017) Houlsby et al. (2019) Mahabadi et al. (2021) Rebuffi et al. (2018) Bilen & Vedaldi (2017) Platanios et al. (2018) Fixed routing Top-1 learned routing Top-k learned routing Variable-size (threshold) Variable-size (soft partition) Ponti et al. (2022) Hampshire & Waibel (1992) Rosenbaum et al. (2018) Goyal et al. (2021) Rahaman et al. (2021) Mixture of experts Weighted top-k routing Jacobs et al. (1991b) Shazeer et al. (2017) Sparse weight addition Representation averaging Input concatenation Attention-based aggregation Pfeiffer et al. (2021a) Pfeiffer et al. (2020b) Sequential aggregation Ansell et al. (2022) Ma et al. (2018) Vu et al. (2022b) n o i t a t u p m o C n o i t c n u f g n i t u o R n o i t c n u f n o i t a g e r g g A n o i t c n u f (x) = F ∗ x (x) = W d(σ(W ux)) (x) = W d(σ(W ux)), j=1 Aj ⊗ Bj W = Pn f 0 = fθ?(cid:12)b f 0 = fθ0(cid:12)b f 0 = fθ+b(cid:12)φ f 0 = fθ+φM = fθi+vec(BiAi) f 0 i ([φ, x]) where φ = Emb(p) = fθ1 f 0 1 ([φ, x]) = fθ1 f 0 1 ([φi, x]) = fθi f 0 i = f s f t ∀i ∈ G φi φi (fθi = fφi f 0 i (fθi = fφi f 0 i (fθi = fφi f 0 i (x) + fφi = fθi f 0 i = fθi (x) (cid:12) φ f 0 i = (αW )x f 0 i = 1 f 0 i |K| = f (x; θi, φj) where j = argmax[α] f 0 i = catj∈ topk[α] f (x; θi, φj) f 0 i = catj∈M s.t. αj >t f (x; θi, φj) f 0 i = 1 f 0 i = P f 0 i = P f 0 i (x)) where fφi (x)) where fφi (x)) where fφi (x) j∈M αj f (x; θi, φj) j∈ topk[α] f 0 = fθ0+φl+φt = P|Mi| f 0 αjhj i j = fθ([φt, φl, x]) f 0 i = Attn(hi−1Qi, HiKi, HiVi) f 0 i = fφt f 0 i j∈M s.t. αj =1 f (x; θi, φj) j f (φj) 1j(K) f (x; θi, φj) αjP α (x))) (fφl (fθ0 P α P P Table 2: An overview of representative computation, routing, and aggregation functions. Each method is paired with a representative reference. In computation functions, skip connections are omitted for simplicity. Definitions: the model f , a model's sub-function fi, model parameters θ, module parameters φ, parameters at initialisation θ0, parameters after training θ?, binary mask b ∈ {0, 1}|θ|, random matrix M, group G, input x, a model's embedding layer Emb(*), text prompt p, filter bank F , routing scores or task embedding α, routing function r, subset of modules K, module inventory M . 7 (a) Parameter Composition (b) Input Composition (c) Function Composition (d) Hypernetwork Figure 2: Different modular designs for Transformer architectures; best viewed in colour. Task-specific modular components are illustrated in magenta and purple, respectively. (a) Parameter Composition (§ 3.1): A sparse sub-network in the linear layer as part of multi-head-attention. (b) Input Composition (§ 3.2): Prefix-tuning (Li & Liang, 2021) extends the input by prepending embeddings to the key and value matrices in the Transformer layer. (c) Function Composition (§ 3.3): Task-specific bottleneck layers that transform the hidden representations are inserted in each layer (Houlsby et al., 2019). (d) Hypernetwork (§ 3.4): A small separate neural network generates modular parameters conditioned on metadata. We show its application to function composition but it is compatible with all computation functions. the corresponding sub-function: parameter composition, input composition, and function composition. While all three methods instantiate modules differently, we demonstrate how they can be seen in a unified view in § 3.5. We provide example illustrations of the three computation functions (in addition to a hypernetwork) as part of a Transformer architecture in Figure 2 and provide a high-level overview of their trade-offs in Table 3, which we further discuss in the respective sections.5 3.1 Parameter Composition Parameter composition methods augment the function fW of a base model with weights W ∈ Ro×i with module parameters Φ ∈ Ro×i, where i is the input dimensionality, and o is the output dimensionality. In particular, the module inventory consists of a set of sparse or low-rank weights to ensure that the modules , where ⊕ stands for are parameter-efficient. Therefore, the resulting function is parameterised as fθ⊕φi element-wise addition. Sparse Subnetworks Sparsity is a common inductive bias based on the assumptions (i) that only a small number of parameters of an over-parameterised model are relevant for a particular task, and that (ii) similar tasks share similar sub-networks. This is the case, for instance, for language subnetworks in multilingual language models (Stanczak et al., 2022; Foroutan et al., 2022). The most widespread method to induce sparsity is pruning. This can be interpreted as the application of a binary mask b ∈ {0, 1}|θ| that selectively keeps or removes each connection in a model with trained parameters θ?: f 0 = fθ?(cid:12)b. The merger of θ and b results in a sparse subnetwork, but the corresponding model parameters usually remain dense for hardware and software reasons.6 After training, the trained weights are sorted based on a criterion and a fraction (bottom-k) of the weights are set to zero. Examples of 5The comparison is mainly meant as a high-level guideline. Individual methods may have different trade-offs and mitigate certain weaknesses indicated in the table. 6In fact, sparse linear algebra operations on graphic processing units remain highly inefficient, if available at all. Examples include the sparse tensor classes in Pytorch: https://pytorch.org/docs/stable/sparse.html 8 criteria include magnitude after convergence (Han et al., 2017) and change of magnitude between initialisation and convergence (Frankle & Carbin, 2019). As pruning generally leads to a loss in performance due to the change in network connections, the non-pruned weights are typically re-wound to their initialisation value and re-trained. In practice, rather than pruning all weights in a single run, iterative pruning is carried out (Han et al., 2015; Frankle & Carbin, 2019) over multiple stages. The models pruned in this fashion often retain-if not surpass -the performance of the original dense model. The existence of a subnetwork with such property in any given randomly initialised model is known as the Lottery Ticket Hypothesis (LTH; Frankle & Carbin, 2019; Chen et al., 2020). These 'winning tickets' have also been shown to exist in RL and NLP (Yu et al., 2020), as well as in computer vision (Frankle et al., 2020). Subnetworks achieve above-random performance even when kept fixed at their random initialisation (Zhou et al., 2019; Wortsman et al., 2020; Zhao et al., 2020), so f 0 = fθ0(cid:12)b. In this case, they are known as supermasks. Winning tickets also occur in pre-trained models, such as language models (Chen et al., 2020; Prasanna et al., 2020). These often outperform tickets from randomly initialised models (Prasanna et al., 2020) and are less sensitive to specific hyper-parameter choices (Sun et al., 2020a). Magnitude pruning, which relies on zeroth-order information (the absolute value of a weight), is sub-optimal in this setting as fine-tuned weights typically stay close to their pre-trained values. Thus, magnitude pruning selects a similar set of weights for pruning regardless of the downstream task. Pruning based on first-order (gradient-based) information better captures the task-specific relevance of each weight (Molchanov et al., 2017). For instance, movement pruning (Sanh et al., 2020) learns the mask b jointly with the parameters θ. As the mask is a discrete binary variable, they rely on straight-through estimators (Bengio et al., 2013). Alternatively, b can be first learned as a real-valued mask and then binarised via a thresholding function (Mallya et al., 2018). In addition to pruning, sparsification techniques can be employed for adaptation. In particular, a sparse module φ can be merged with pre-trained parameters θ. For instance, in Sparse Fine-Tuning (SFT; Ansell et al., 2022) the LTH is re-purposed such that, instead of zeroing out weights with the lowest change in magnitude, they are simply frozen. Thus, only a subset of weights is fine-tuned.7 The difference between these and the original pre-trained model results in a sparse module φ where φi = 0 if bi = 0, which can be = fθ⊕φ. Diff pruning (Guo et al., 2021) instead obtains a sparse plugged in and out of the model as f 0 θ adapter by fine-tuning a dense difference vector φ regularised to be sparse with a differentiable approximation to the L0-norm penalty. Sung et al. (2021) induce a fixed sparse mask by selecting the top-k weights ranked according to (a diagonal approximation of) their Fisher information. This second-order information reveals the impact of the change of a parameter on the model predictions. Thus, bj = (1 0 if j ∈ top-k 1 n otherwise Pn i=1 Ey∼fθ? (y|xi) (∇θ log fθ? (y | xi))2 (1) Beyond the sparsification of individual weights, sparse model adaptation can also be structured. In this case, only a group of model sub-functions is fine-tuned, while the rest of the parameters remain frozen. The most common setting is for such a group to correspond to a subset of layers, e.g. the last one (Donahue et al., 2014). Groups can also relate to more fine-grained parts of the model. For instance, a group consisting of a model's bias parameters is a practical choice as this removes the need to store the model's intermediate activations (Cai et al., 2020; Ben Zaken et al., 2022). At the level of parameter tensors, some methods prune filters in CNNs (Anwar et al., 2017; Newell et al., 2019) or attention heads in pre-trained Transformers (Voita et al., 2019; Michel et al., 2019). In structured diff pruning, members of a group are encouraged to share the same mask value (Guo et al., 2021). Low-Rank Modules Similar to sparsity, another efficient solution is for the module parameters φi to lie in a low-dimensional subspace. Li et al. (2018) show that models can be optimised in a low-dimensional, randomly oriented subspace rather than the full parameter space. In this setting, the module parameters φ ∈ Rd are low-dimensional compared to the model parameters θ ∈ RD and d (cid:28) D. A random matrix M ∈ Rd×D can 7This is typically implemented by masking the gradient based on the binary mask b (cid:12) ∇θL(fθ, D) where L is a loss function and D is a dataset (Ansell et al., 2022). 9 Parameter Training efficiency efficiency Inference efficiency Performance Compositionality Parameter composition Input composition Function composition + ++ – – – + ++ – – + – ++ + + + Table 3: Comparison of computation functions along different dimensions. See the end of § 3.1 (parameter com- position), 3.2 (input composition), and 3.3 (function composition) for further explanation. Compositionality is discussed in § 5. be used to project from d to D: f 0 = fθ+φM. An efficient way to compute M is via the Fastfood transform θ (Le et al., 2014), which factorises M as random linear matrices. Specifically, M = HGΠHB consists of a Hadamard matrix H, a random diagonal matrix with independent standard normal entries G, a random diagonal matrix with equal probability ±1 entries B, and a random permutation matrix Π. Li et al. (2018) refer to the minimum d that achieves within 90% of the full-parameter model performance as the intrinsic dimensionality of a given task. Aghajanyan et al. (2021) investigate the intrinsic dimensionality of various NLP tasks with different pre-trained models. They observe that it decreases during pre-training and that larger models have lower values. However, storing the random matrices results in a substantial memory overhead and is slow to train (Mahabadi et al., 2021). If the weight matrix W ∈ Ro×i is small enough, we can directly compose it into low-rank matrices W = λBA where A ∈ Rk×i and B ∈ Ro×k, where i is the input dimensionality, o is the output dimensionality, k is the rank of the matrix, and λ is a scaling hyper-parameter. To save space, the factorisation may be only applied to certain groups of parameters G. In LoRA (Hu et al., 2022), this group corresponds to j ∈ G. the linear projections in the self-attention mechanisms of each Transformer layer: f 0 j Overall, parameter composition methods (both sparse and low-rank) are very parameter-efficient and often require updating less than 0.5% of a model's parameters (Guo et al., 2021). At inference time, they keep the model size constant or even reduce it, if the resulting model is sparse. Sparse modules, however, increase the time complexity of optimisation as they typically require multiple iterations of re-training. Finally, state-of-the-art parameter composition methods, e.g., LoRA (Hu et al., 2022) and SFT (Ansell et al., 2022) achieve strong performance in zero-shot and few-shot transfer. = fθj +vec(Bj Aj )∀f 0 3.2 Input Composition (x) = fθi Input composition methods augment a function's input x by concatenating it with a parameter vector φi: ([φi, x]). The most common strategy is to augment the input fed to the model's first layer f1. In f 0 i a prompting setup with auto-regressive language models (Brown et al., 2020) or encoders (Schick & Schütze, 2021a;b), the input prompt p consists of (optional) instructions and (optional) in-context examples that have been converted to natural language. From a different perspective, the task-specific text prompt, when encoded using the model's embedding layer Emb(*), corresponds to modular parameters φ that elicit the desired behaviour (Gao et al., 2021b; Liu et al., 2023): Emb(p) = φ. However, models are ostensibly sensitive to the formulation of the prompt as well as to the set and order of the (few-shot) examples (Zhao et al., 2021; Lu et al., 2022; Webson & Pavlick, 2022). Instead, a continuous prompt vector φ can be learned directly (Lester et al., 2021; Liu et al., 2021b; Zhong et al., 2021; Hambardzumyan et al., 2021). However, if φ is only concatenated with the first layer's input, the model has limited capacity to adapt to a specific task. As a result, such continuous (also called soft) prompts perform poorly at smaller model sizes and on some harder tasks (Mahabadi et al., 2021; Liu et al., 2022c). To mitigate this, initialisation via multi-task learning has been proposed (Vu et al., 2022c). As an alternative, module vectors φi can be learned for each layer of the model (Figure 2b; Li & Liang, 2021; Liu et al., 2022c). 10 While this increases the number of parameters, it increases the modules' capacity to adapt to a given task. In v ∈ Rl×d are prepended to the keys and practice, module parameters in the form of prefix vectors φi = P i values of every multi-head attention layer. Attention is defined as fi(x) = Attn(xW i ) where q , CW i Wq, Wk, Wv ∈ Rd×dh are the projections that produce the queries, keys, and values, and C ∈ Rm×d is a sequence of context vectors. Multi-layer prompt tuning thus takes the following form: k, CW i v k, P i f 0 i (x) = Attn(xW i q , [P i k, CW i k ], [P i v, CW i v ]). (2) In summary, input composition is exceptionally parameter-efficient as it only adds a very small number of parameters. However, these parameters extend a model's context window, which makes them less efficient during training and inference. Prompt tuning methods also require large models to achieve decent performance. 3.3 Function Composition While parameter composition deals with individual weights and input composition methods act only on a function's input, function composition methods augment the model with new task-specific sub-functions (see Figure 2c): f 0 i (x)), where ◦ stands for function composition. (x) = fφi ◦ fθi (x) = fφi (fθi Parameter Sharing Models in multi-task learning traditionally consist of shared layers fθ stacked under task-specific modules fφ (Ruder, 2017). Conversely, given models for tasks t and s expressed as a composition , respectively, a multi-task architecture can also be obtained by of functions f t ◦ . . . ◦ f t φ1 φl tying sets of parameters between the models: f t ∀i ∈ G where the group G contains the set of shared = f s φi φi layer indices.8 Many multi-task neural architectures can be characterised in terms of their definition of G, which determines which modules are task-specific and which ones are shared. This is the case, for instance, of 'shared trunk' approaches in computer vision (Zhang et al., 2014; Ma et al., 2018) and approaches with supervision at different layers in NLP (Søgaard & Goldberg, 2016; Sanh et al., 2019; Liu et al., 2019). ◦ . . . ◦ f s φl and f s φ1 Some approaches learn finer-grained interactions between pairs of modules. Misra et al. (2016) propose the cross-stitch unit, which linearly combines the inputs at every layer9: ( ext, exs) = W [xt, xs] where " ij ext exs ij # = (cid:20)αtt αts αst αss # (cid:21) "xt ij xs ij and α ∈ R. Sluice networks (Ruder et al., 2019a) extend cross-stitch units to multiple modules per layer and additionally employ a soft selection of the skip connections from all layers at the output layer l: ext> =   βt 1 * * * βt l  >  h xt 1 > , >i . . . , xt l and β ∈ R. On the other hand, Gao et al. (2019) fuse features from multiple tasks through a 1x1 convolution. Bragman et al. (2019) employ variational inference to assign filters in a CNN to task-specific or shared roles. Rather than learning which modules should be shared among which tasks, which is a combinatorially large problem, Lu et al. (2017) and Vandenhende et al. (2020) start with a fully shared model and then dynamically widen it during training, by cloning function fθi shared among a smaller subset of tasks, in top-down order across layers. More information on parameter-sharing strategies in multi-task learning can be found in relevant surveys (Ruder, 2017; Crawshaw, 2020). into new modules fφi,1, . . . , fφi,k can Adapter Layers As an alternative to parameter sharing, a new task-specific learnable function fφi be composed with an (often frozen) shared function fθi . As the main purpose of such modules is adapting a pre-trained model to new tasks, they are also simply known as 'adapter layers'. We provide examples of different adapter layers in Figure 3. 8In this view, there is no clear differentiation between model parameters θ and module parameters φ. 9We omit the layer index n to simplify the presentation. 11 (a) Sequential Bottleneck Adapter (b) Parallel Bottleneck Adapter (c) (IA)3 Figure 3: Different approaches of function composition. (a) Sequential Bottleneck Adapter: The first adapter architecture proposed for transformers which consists of two bottleneck layers placed after the multi-head attention (MHA) and feed-forward (FF) layers (Houlsby et al., 2019). (b) Parallel Bottleneck Adapter: Bottleneck layers processed in parallel to the MHA and FF layers of the pre-trained transformer components (Rebuffi et al., 2018; Stickland & Murray, 2019; He et al., 2022a). (c) (IA)3: Rescaling operations performed within the MHA and FF layers (Liu et al., 2022b). The adapter's design and composition with the pre-trained model are often modality-specific. In computer vision, the adapter typically consists of a 1×1 convolution, i.e., fφi (x) = F ∗x where F is a bank of 1×1 filters and ∗ is the convolution operation (Rebuffi et al., 2017). The module is then inserted between the convolutional blocks of a pre-trained model, such as a ResNet (He et al., 2016). In NLP, a bottleneck architecture has become popular which consists of a down- and up-projection, coupled with an intermediate activation function σ: fφi (x) = W d(σ(W ux)) where W d ∈ Rdx×k and W U ∈ Rk×dx, dx is the dimensionality of the input (typically the hidden dimension), and k is the bottleneck dimension. σ is commonly a non-linearity such as a ReLU unit (Figure 3a; Houlsby et al., 2019; Pfeiffer et al., 2020b). In a Transformer model, adapters are placed both after the multi-head attention and the feed-forward layer (Houlsby et al., 2019), just after the multi-head attention (Bapna & Firat, 2019), or just after the feed-forward layer (Pfeiffer et al., 2020b). Other variants for σ such as the identity function, standard multi-head attention, and multi-head attention with shared projection matrices have also been explored (Stickland & Murray, 2019). Mahabadi et al. (2021) propose Compacter, a hyper-complex, low-rank adapter that reparameterises W in the adapter as: W = Pn i=1 Ai ⊗ Bi where Ai ∈ Rn×n is shared across layers (n is a hyper-parameter), Bi ∈ R k n is (r is the rank of Bi), and ⊗ is the Kronecker product. parameterised as a low-rank matrix Bi = sit> i Adapters can be routed sequentially or in parallel. Sequential adapters, are inserted between existing functions: (x)) (Rebuffi et al., 2017; Houlsby et al., 2019). Parallel adapters are applied in parallel to a (fθi f 0 i (x) (Figure 3b; Rebuffi et al., 2018; Stickland & Murray, model pretrained function: f 0 i 2019; He et al., 2022a). Moreover, adapters involve two residual connections: between the output of fθi and the output of fφi , which is further added to x and normalised. Adapters have been shown to lead to increased sample efficiency, flatter minima, and more robustness to hyper-parameter choices compared to standard model fine-tuning (Karimi Mahabadi et al., 2021; He et al., 2021; Han et al., 2021). (x) = x + fθi (x) = fφi (x) + fφi n × d Rescaling The output representations can also be directly transformed via element-wise multiplication with a vector of learned parameters: f 0 (x) (cid:12) φ. Crucially, this is equivalent to stacking the original i with a linear transformation W = Iφ. Such task-specific rescaling is typically applied to batch function fθi (x) = fθi 12 normalisation parameters in computer vision (Bilen & Vedaldi, 2017) and to layer normalisation parameters in NLP (Houlsby et al., 2019). The adapter (IA)3 (Figure 3c; Liu et al., 2022b) multiplies learned vectors with the keys and values in self-attention blocks and the intermediate activations in position-wise feedforward networks in the Transformer. Rescaling activations favours dimensions that are important for a given task. Multiplication with a binary mask is a special case of rescaling that incorporates sparsity: Strezoski et al. (2019) multiply a task-specific random binary mask b with a function's input x at every layer. Overall, standard function composition methods such as adapter layers typically require more parameters as the new function depends on a model's input size and hidden size. While they do not require storing the gradients of the frozen parameters, they increase the number of operations at training and inference time. State-of-the-art function composition methods match or outperform standard fine-tuning. 3.4 Hypernetworks In the above-mentioned adapters, different modules φ1, . . . , φ|M | correspond to disjoint sets of parameters. However, the modules may benefit from sharing information. Rather than learning φi directly, a (small) neural network W , known as a hypernetwork, can generate the module parameters instead, conditioned on an embedding α (Ha et al., 2017; Platanios et al., 2018). Thus, φ = W α. As a result, the modules are 'entangled', which violates the strong definition of modularity that postulates that modules are autonomous (Goyal et al., 2021). In fact, in hypernetworks, computation and routing are inseparably intertwined. In fact, foreshadowing our discussion in § 4.2.4, the embedding α can also be interpreted as unnormalised, learned routing scores for each task. In turn, the parameter generator weight would correspond to a set of modules stacked column-wise: W = [φ1, . . . , φ|M |]. Hypernetworks can also be conditioned on inputs x (Figure 2d). For instance, in conditional batch normalisa- tion (de Vries et al., 2017), rescaling parameters are generated based on a representation of the model input obtained via an LSTM. Feature-wise linear modulation (FiLM; Perez et al., 2018) generates an element-wise affine transformation that is applied to image features, conditioned on the linguistic input of the model, for text-and-vision tasks. In self-modulation for Generative Adversarial Networks (Chen et al., 2019), the affine transformation is applied to hidden representations of the generator conditioned on the noise sample. Bertinetto et al. (2016) conditions the parameter generator on individual examples, in order to perform one-shot learning. Hypernetworks have been used to generate a diverse set of module parameters, including classifier heads (Ponti et al., 2021), continuous prompts (He et al., 2022c), and adapter layers (Üstün et al., 2020; Ansell et al., 2021; Karimi Mahabadi et al., 2021), most commonly conditioned on task (Karimi Mahabadi et al., 2021) or language embeddings (Üstün et al., 2020; Baziotis et al., 2022). Such task or language embeddings α can themselves be learned directly from random initialisations or fixed as the typological features of a language (Üstün et al., 2020; Ansell et al., 2021). This is a strategy to integrate side (or metadata) information about the relationship among languages. Other examples of side information, such as the example label y, can be integrated into the hypernetwork input embedding via bi-linear interaction (Chen et al., 2019). Nevertheless, even the smallest possible module generator network is a linear projection W ∈ Rdφ×dα. To make the hypernetwork more parameter-efficient, it can be shared across layers by conditioning it on the module position in the neural architecture, in addition to the task index (Karimi Mahabadi et al., 2021). In general, the hypernet can be conditioned on multiple (concatenated) embeddings: e.g., one corresponding to the task index and another to the language index. This allows the hypernetwork to generalise systematically to new task–language combinations at inference time. In particular, the hypernet can either generate a single module from all the embeddings (Ponti et al., 2021) or separate modules (Ansell et al., 2021; Üstün et al., 2022). In turn, the embedding combination chosen for any example is a form of hard routing (cf. § 4.2.2). 3.5 Unifying Parameter, Input, and Function Composition While the above methods may seem different, they all covertly share a similar functional form. He et al. (2022a) cast LoRA (Hu et al., 2022), prefix tuning (Li & Liang, 2021), and bottleneck adapters (Houlsby 13 (x) = fθi of a model is added to a new term that depends on a learned function fφ: f 0 i et al., 2019), representative methods of the three composition functions, into the same framework. We extend their framework to cover parameter composition, input composition, and function composition in general. Specifically, all modular computation functions can be reduced to function composition: the output of the (x). function fθi For function composition methods, this form is the most natural. In the case of parallel adapters, for instance, (x) = MHA(C, x) = f 0 i [head1, . . . , headh]Wo, with headj = Attn(xW j (x) = W d(σ(W ux)). In this setting, θi and φi are independent and must only agree regarding the dimensionality of their inputs and outputs. For parameter composition methods, which modify the parameters directly, the dimensionality of the module parameters φ should match exactly the original parameters θi. For instance, if we apply the module to a linear projection, then they should consist of weight matrices θi = Wi ∈ Rdx×k and φi = Vi ∈ Rdx×k, respectively. Because of linearity: (x) may be a multi-head attention module fθi k , CW j v (x) = fθ(x) + fφi (x) where fθi ), and fφi (x) + fφi q , CW j f 0 i (x) = fθi⊕φ(x) = fW +V (x) = (W + V )x = W x + V x = fθi (x) + fφi (x) For instance, in the case of LoRA (Hu et al., 2022), V = λBiAi. In the case of sparse adapters (Ansell et al., 2022), V is a sparse matrix. For input composition methods, with the form f 0 ([φi, x]), the equivalence is derived as follows. i Prefix tuning (Li & Liang, 2021) generalises other continuous prompt methods by concatenating prefix vectors φi = P i v ∈ Rl×d to the keys and values of self-attention. He et al. (2022a) show that prefix tuning can be expressed in the following way: (x) = fθi k, P i f 0 i (x) = Attn(xW i q , [P i = (1 − λ(x))fθi ], [P i k, CW i k (x) + λ(x) softmax(xWqP > k v, CW i v ]) )Pv where λ(x) is a scalar that represents the sum of normalised attention weights on the prefixes and fθi the attention module in a Transformer. If we set, fφi composition (1 − λ(x))fθi (x) + λ(x)fφi that for function and parameter composition, the sum is unweighted. (x) is )Pv, then we obtain a function (x) = softmax(xWqP > k (x) that incorporates a weighted addition. On the contrary, note Overall, despite their conceptual differences, most modular approaches are similar in their functional form and can be expressed as function composition. In practice, the way different methods are realised, however, leads to different trade-offs, which we illustrate in Table 3. Recent empirical studies (Mahabadi et al., 2021; He et al., 2022a; Liu et al., 2022b) provide further evidence for the strengths and weaknesses of different methods. For instance, prompt tuning (Vu et al., 2022a) underperforms other methods due to limited capacity while intrinsic dimensionality (Aghajanyan et al., 2021) uses a very small number of parameters but leads to a large memory footprint and poor performance. Fine-tuning only biases (Ben Zaken et al., 2022) has a small memory footprint but achieves lower performance. Finally, function composition methods such as adapter layers (Pfeiffer et al., 2021a) and compacter layers (Mahabadi et al., 2021), achieve the best performance, but add more parameters. (IA)3 (Liu et al., 2022b) mitigates this by composing a lightweight linear diagonal weight. Modular deep learning architectures, however, have many other differences beyond their choice of computation function. In the following sections, we discuss the routing, aggregation, and training settings for the modules presented so far. 4 Routing Function In § 3, we described how to compose a sub-function fi with shared weights θ with a single module function with weights φ. However, in a modular neural architecture, multiple modules are available from an inventory M = φ1, . . . , φ|M |. A decision-making process is required to determine which modules are active, conditioned on the model input or auxiliary metadata. This process is implemented through a routing function r(*) that assigns a score αi to each module from the inventory M . These scores determine which subset of modules is active, i.e. contributes to the computation. We provide an overview of different routing methods in Figure 4. When metadata such as expert knowledge about sub-tasks (or skills) involved in a task is available, r(*) can be designed as a fixed function, that is, each routing decision can be made a priori (Figure 4a). For instance, 14 (a) Fixed Routing (b) Learned Routing (Hard) (c) Learned Routing (Soft) Figure 4: Different routing methods. (a) Fixed Routing: Examples are passed to modules based on a pre-defined logic, known a priori. (b) Hard Learned Routing: Learned hard selection modules. (c) Soft Learned Routing: Soft selection and weighting of modules. when using a language model to generate dialogue in Swahili, a task module for dialogue generation and a language module for Swahili can be selected. When no such prior information is available-for instance when modelling heterogeneous unlabelled data-routing of a given example needs to be learned (Figures 4b-4c). In this case, the routing function can be conditioned on the current example x.10 Unfortunately, learned routing is crucially under-constrained, as multiple possible ways of decomposing tasks into sub-tasks are reasonable (Jacobs et al., 1991a). In addition, it presents a series of unique challenges (see § 4.2.1). In an empirical study on synthetic data, Mittal et al. (2022) found that learned routing is sub-optimal compared to fixed routing, as it tends to under-utilise modules and to specialise them to a lesser degree. This behaviour is exacerbated as the number of tasks in the data grows. In real-world applications, Muqeeth et al. (2022) report similar results; however, Ponti et al. (2022) find that learned routing may surpass expert module selection even in settings where tasks are procedurally constructed to require certain skills, such as instruction following in simulated environments. Learning-to-route can roughly be split into hard routing and soft routing (Rosenbaum et al., 2019). Hard routing methods learn a binary selection of modules, similarly to the fixed routing scheme, where only a subset of modules is selected for each decision-making step (Figure 4b). Inference for hard routing systems typically builds on score function estimators (Williams, 1988; 1992) or stochastic re-parameterisation (Jang et al., 2017). On the other hand, soft routing methods learn a probability distribution over modules (Figure 4c; Jacobs et al., 1991a). While soft selection is more easily amenable to end-to-end learning via gradient descent, hard selection may lead to a sparse architectural design, owing to the fact that inactive modules are not part of the forward and backward computation graph. This reduces time complexity while augmenting the model capacity (Bengio et al., 2013). 4.1 Fixed Routing Making the routing decision a priori-i.e. when we utilise metadata (e.g. task identity t) to make the discrete routing decisions before training-is referred to as fixed routing (Figure 4a). Here the routing function r(*) simplifies to a selection of a subset of modules K ⊆ M for the examples with certain metadata: r(φi) = (1 0 if i ∈ K otherwise (3) This function defines a binary matrix A ∈ {0, 1}|T |×|M |, where the number of rows corresponds to possible tasks and the number of columns corresponds to the size of the module inventory. 10Alternative non-parametric routing strategies include random routing (Zuo et al., 2022; Wang et al., 2022) or routing based on hash functions (Roller et al., 2021). 15 One simple example of fixed routing in multi-task learning is when all parameters, except the final classification layer, are shared among all tasks (Ruder, 2017). Independently from the task identity, the examples are passed through the same network until after the penultimate layer. The penultimate layer's representations are then routed to their respective final classification layer according to the task identity. This boils down to setting |K| = 1, with the additional constraint that tasks cannot share modules, which results in the allocation matrix being an identity matrix, A = I. While not immediately apparent, methods that adapt pre-trained models towards individual tasks (Rebuffi et al., 2017; 2018; Houlsby et al., 2019; Bapna & Firat, 2019; Li & Liang, 2021; Liu et al., 2022b; Hu et al., 2022; Ansell et al., 2022; Ben Zaken et al., 2022, inter alia)–as discussed in § 3–deterministically route representations through the newly introduced module fφ. Given that the pre-trained weights are frozen and modules trained on different tasks can be added or removed, the components become modular even if they are developed asynchronously and independently of each other (Pfeiffer et al., 2021a). In a sense, community-based hubs of pre-trained adapters such as AdapterHub (Pfeiffer et al., 2020a) can be considered as ever-evolving multi-task models, the development of whose components has been distributed throughout the community.11 Moreover, since newly introduced weights are encapsulated between frozen (shared) weights, adapted representations of intermediate layers are implicitly aligned as they are passed as input to the same frozen components. Hampshire & Waibel (1992) were possibly among the first to train independent experts for a series of sub-tasks known a priori. In this case, the (fixed-size) subset of experts K associated with each task t is assumed as given, resulting in the rows of A being k-way vectors. In cross-lingual transfer, any problem can be decomposed into a task and language variety. Fixed routing can select separate language and task components, and facilitate generalisation to new, unobserved combinations of tasks and languages at inference time (Pfeiffer et al., 2020b; Ponti et al., 2021; Üstün et al., 2022). In this case, |K| = 2. Similarly, in reinforcement learning, Heess et al. (2016) and Devin et al. (2017) design a modular policy that is composed of a robot-specific module and a task-specific module, which are instantiated as separate neural networks. Composing these modules enables generalisation to unseen robot–task combinations. Beyond task identity, routing can be performed based on other metadata such as language, domain, or modality information. Pfeiffer et al. (2022b) add adapters for each language to a multilingual language model during pre-training on unlabelled text. Fan et al. (2021) route deterministically for multilingual machine translation according to the language family: as a consequence, all languages in a family share the same expert. In a similar vein, Gururangan et al. (2022) add domain-specific adapters to language models, deterministically routing based on the text source domain. This concept was further extended by Li et al. (2022b), who proposed the branch–train–merge method: copies of the same model are trained on different domains and then averaged. Finally, modality can also inform fixed routing, such as in vision-and-language models (Pfeiffer et al., 2022a). This allows for adapting the encoders of different modality streams. 4.2 Learned Routing When the routing function r(*) is not known in advance, it can be implemented as a learnable neural network with parameters ρ. In input, it receives the example representation x or metadata such as the task t. In output, it returns routing scores α. Usually, rρ is a linear projection or a Multi-Layer Perceptron. While the former represents a less expressive family of functions, the latter may collapse into ignoring the input features. Note that learning the routing function also implies that the specialisation of each module is unknown. Thus, modules are not trained on different sets of examples; rather, they are all trained jointly with the routing function. 4.2.1 Challenges of Learned Routing Learned routing introduces a number of challenges, including training instability, module collapse (Kirsch et al., 2018), and overfitting. These were first systematically described by Rosenbaum et al. (2019), and we 11Alternatively, combining entire models stored in model repositories via distillation (Khanuja et al., 2021) or averaging (Matena & Raffel, 2021) can also help avoid negative interference (Don-Yehiya et al., 2022); however, this is usually less efficient and subject to limitations such as those discussed later in § 5. 16 follow a similar taxonomy. In general, they identify two root causes for all these challenges: first, the need to balance between exploration and exploitation (Sutton, 1986). More specifically, routing must find the optimal trade-off between allocating information to the most suitable modules versus under-explored modules. Second, routing must share modules across examples or tasks in such a way as to reap the benefits of positive transfer while avoiding negative interference. We elaborate on the individual challenges below. Training Instability emerges especially in the early phases of training; at this point, modules are randomly initialised and have no clear functional specialisation. Thus, the router cannot make any principled decision in selecting modules. On the other hand, modules do not start specialising until they are consistently routed to different subsets of tasks or examples. Curriculum learning can mitigate this challenge to some extent (Chang et al., 2019), as simpler tasks require simpler sets of skills. However, this assumes that information about task complexity is available and that the data can be ordered accordingly. As an alternative, the router parameters can be trained with a different learning rate than the module parameters, either lower (Rosenbaum et al., 2018) or higher (Ponti et al., 2022). These create two different dynamics: either the necessary skills for a task are determined after specialisation, or the relationship among tasks is figured out first and modules are updated accordingly. Module Collapse describes scenarios where only a small number of modules (in the extreme case, one) from the available inventory are selected. This leaves the remaining modules untrained and negatively impacts their overall diversity. Often, this results from excessively favouring exploitation over exploration, which leads to sub-optimal results. To amend this, Ahn et al. (2019) use (cid:15)-greedy routing for initial exploration of all modules and afterwards switch to learned routing. Other strategies to avoid module collapse include auxiliary losses for load balancing (Shazeer et al., 2017; Fedus et al., 2021) and intrinsic rewards that encourage diversity in module selection (Cases et al., 2019). The choice of information that conditions the router also plays an important role: metadata, e.g. text genre (Cases et al., 2019) or task identity (Kudugunta et al., 2021), make routing more robust than individual examples. The diversity of training tasks also facilitates diversity in routing selections (Chang et al., 2019; Caccia et al., 2022). Dua et al. (2022) warms up the sampling temperature over training, in order to over-sample domains with fewer examples in unbalanced distributions. Overfitting to noise is a risk faced by deep modular networks due to their ability to model subsets of examples independently (Rosenbaum et al., 2019). For instance, routing at the token level was shown to lead to performance drops in out-of-domain generalisation for MoEs (Artetxe et al., 2022). For a similar reason, gains in pre-training do not always translate into gains in fine-tuning for MoEs (Fedus et al., 2021). Increased robustness can be achieved by routing conditioned on metadata if available (Chang et al., 2019; Cases et al., 2019; Kudugunta et al., 2021). In addition, strategies that favour the combinatorial behaviour of modules yield superior generalisation (Chang et al., 2019; Ponti et al., 2022). 4.2.2 Hard Learned Routing A model may learn how to select modules through hard routing. This implies that the choice of whether a module is active or excluded from the computation graph is binary. Discrete decisions are not amenable to be learned through vanilla gradient descent: since small perturbations of parameters do not affect the selection of modules, the gradient of the loss with respect to the routing parameters is zero. Thus, various methods, including reinforcement learning, evolutionary algorithms, and stochastic re-parameterisation, have been proposed for inference. These are discussed separately below. On the other hand, hard routing is more efficient than soft routing in terms of time and space complexity. In addition, binary selection implies that parameter updates are localised to a subset of modules. This reflects the intuition that the shifts in distribution of the variables in an environment are similarly local (Parascandolo et al., 2018; Goyal et al., 2021). Since the inactive module parameters are not affected, they remain invariant with respect to the distribution shift. On top of this, this type of routing may result in variable-size sets of active modules. This allocates model capacity according to task complexity, which follows the principle of conditional computation (Bengio et al., 2015). In fact, it is fair to assume that the skills required for complex tasks are a superset of those of simpler tasks. For instance, dialogue modelling requires (among others) intent detection, slot filling, and conditional response generation. 17 Reinforcement Learning In Routing Networks (Rosenbaum et al., 2018), Modular Networks (Kirsch et al., 2018), and the Compositional Recursive Learner (CRL; Chang et al., 2019), a router network is trained through reinforcement learning. Specifically, Routing Networks rely on multi-agent RL (MARL), Modular Networks rely on the score function estimator (REINFORCE), whereas the CRL relies on Proximal Policy Optimisation (PPO). Commonly, this family of methods alternate between a score function estimator for the routing parameters ρ and SGD for module parameters {φ1, . . . , φ|M |}. For a vanilla score function estimator, where routing is conditioned on the input example and m ∈ M , the update takes the form: ∇ρ Ex,y p(y | x, θ, φ1, . . . , φ|M |, ρ) ≈ 1 n n X i=0 [ p(yi | xi, θ, φm) ∇ρ log p(m | xi)] (4) Under this lens, routing becomes a policy π(m | x). If applied layer-wise, each hidden representation at a given layer 1 ≥ t ≤ l constitutes a state ht ∈ H. The routing policy determines the action, i.e. the selection of a module index m. In particular, this assumes that the inventory M is shared across layers.12 In turn, applying the transformation of the corresponding module on the input is equivalent to a transition function π : H → H, which returns the next layer's hidden state ht+1. The loss function at the top layer corresponds to a (delayed) negative reward, i.e. L(*) = −R.13 Crucially, in this setting the transition functions are non-stationary, as the module parameters are amenable to change. Because modules are applied sequentially based on the policy, the number of steps of computation in the model can vary when a special halting action is available. Evolutionary Algorithms Alternatively, routing can be learned via a genetic algorithm. In PathNet (Fernando et al., 2017), the loss function indicates the fitness of a configuration of active modules K ⊆ M . For each task, two configurations are selected at random and trained until a stopping criterion is met. The one incurring the lower loss on a validation set overwrites the other. This copy, in turn, receives a random mutation, and then the procedure is repeated. In μNet (Gesmundo & Dean, 2022a;b), mutations involve cloning, insertion, and removal of layers. The fitness criteria include not only performance but also parameter efficiency. This approach has been extended to a multi-task setting where multiple agents update different modules asynchronously (Gesmundo, 2022). However, as is common for evolutionary algorithms, this search is brute-force and thus highly inefficient. Stochastic Re-parametrisation Hard routing can also be performed via a continuous relaxation of the discrete latent variable α determining the module allocation. Several stochastic re-parameterisations such as Gumbel-Softmax (Jang et al., 2017) or the Concrete distribution (Maddison et al., 2017) have been proposed for this purpose. Compared to the score function estimator, stochastic re-parameterisations are biased but have lower variance. Moreover, they are differentiable, which makes a hard router trainable in an end-to-end fashion. For instance, AdaShare (Sun et al., 2020b) uses Gumbel-Sigmoid to learn a binary vector for each task that indicates whether a model layer should be included in the forward pass or skipped entirely. This may be interpreted as choosing between a parameterised module and an identity function at each layer. Stochastic re-parameterisation also allows for selecting module subsets of varying sizes for each layer. In Neural Interpreters (Rahaman et al., 2021), this is based on a threshold. Each module is associated with a 'signature vector'. The dot product between this vector and the output of an unnormalised routing function ('type inference') conditioned on a token determines a score. If this surpasses a certain threshold, then the module is allowed to access the given token. As an alternative, variable-size module routing can be achieved by learning a soft clustering (a.k.a. soft partition) of modules (Ponti et al., 2022; Caccia et al., 2022). Thus, each entry αij, which represents the routing of the j-th module to the i-th task, is constructed as follows: " αi,j = sigmoid log sigmoid(ˆαi,j) u (1 − sigmoid(ˆαi,j)) (1 − u) 1/τ # u ∼ Uniform(0, 1). (5) 12This encourages module re-usage at different layers. 13Intrinsic rewards can be added, for instance favouring diversity in the module selection across time steps (Rosenbaum et al., 2018). 18 where ˆαij represents the unnormalised routing score. This latent variable also admits priors such as the Indian Buffet Process (Griffiths & Ghahramani, 2011) to encourage both diversification and sharing of module subsets across tasks (Ponti et al., 2022). Caccia et al. (2022) extend this framework to multi-head routing, where different modules can be allocated to contiguous subsets of dimensions of the layer's input and output. While this just requires as many copies of α as the number of subsets of dimension, it provides higher expressivity to the routing function. Top-k Selection Finally, hard selection can rely on top-k selection from (possibly unnormalised) scores α over modules. In the case of Independent Causal Mechanisms (Parascandolo et al., 2018), α is given by a discriminator that scores the outputs of a generator, and k = 1. In the case of Recurrent Independent Mechanisms (Goyal et al., 2021), the scores are derived from attention between modules and the input, and k > 1. These methods are grounded on the assumption that the competition among modules to be activated facilitates their specialisation (see § 8.3 for more details). 4.2.3 Soft Learned Routing Mixture of Experts To sidestep discrete selections of modules, several works propose soft routing methods, where all modules are selected and aggregated according to a weighted combination, i.e. a mixture of experts (MoE; Jacobs et al., 1991b; Jordan & Jacobs, 1994).14 Here, the router learns a probability distribution over the available modules, i.e. p(M ) = rρ(*). Hence, routing and aggregation take place as: (x) = X f 0 i r(φj) f (x; θi, φj) φj ∈M (6) In contrast to the discrete selection of hard routing methods, this setup is easily trained end-to-end via gradient descent. A number of works (Eigen et al., 2014; Meyerson & Miikkulainen, 2018; Wortsman et al., 2020, inter alia) train a continuous weighting (i.e. a mixture) of all modules; however, this limits the degree of modularity as parameter updates are not local; instead, they always affect all modules. Additionally, activating all modules for each example significantly increases the computational cost for each forward and backward pass through the network. To circumvent this, Shazeer et al. (2017) and Lepikhin et al. (2021) only route to the top-k of |M | modules, where 1 < k < |M |. The output representations of the k active modules are averaged according to the respective routing weights, whose sum is re-normalised to 1. Thus, top-k MoEs stand between hard routing, as only a subset of modules is active, and soft routing, as their average is weighted by the routing scores. In practice, a layer performs the following computation: (x) = X f 0 i φj ∈ topk[r(φ)] r(φj) 1 r(φ) Pk f (x; θi, φj) (7) Fedus et al. (2021) and Clark et al. (2022) demonstrate that even top-1 routing can achieve competitive results for language modelling. Token-Level Routing MoEs have recently undergone a revival as part of the efforts to scale Transformers. In particular, MoE Transformers route to a subset of Feed-Forward Network (FFN) modules per layer instead of a single FFN. The focus of these works is on computationally efficient training of very large models. This is achieved by splitting the input tokens across different (hardware) accelerators. The MoE routing algorithm is therefore required to (ideally) uniformly distribute the tokens of all the examples in an input batch across all accelerators, i.e. to load balance computation across "experts". The dominating routing strategy is for each token to choose the top-k experts (Shazeer et al., 2017; Lepikhin et al., 2021; Fedus et al., 2021; Clark et al., 2022; Yang et al., 2021; Dua et al., 2022; Hazimeh et al., 2021; Rajbhandari et al., 2022; Riquelme et al., 2021; Du et al., 2022; Zoph et al., 2022). Alternative approaches let each expert choose the top-k tokens (You et al., 2022; Zhou et al., 2022b) or globally determine the best routing path (Lewis et al., 2021).15 14In the following sections we use the term "expert" and "module" interchangeably to reflect common practice in the body of research on MoEs. 15For more details on load balancing methods we refer to Fedus et al. (2022), Chapter 4. 19 (a) Layer-wise routing (b) Global routing (naive) (c) Global routing Figure 5: Different routing levels. (a) Layer-wise Routing: The indices are chosen based on the input to the current layer. (b) Naive Global Routing: The same indices of modules are chosen for all the layers of the model. (c) Global Routing: The configuration (possibly different for each layer) is chosen globally. However, since routing is conditioned on the token level, and the load balancing restriction limits the system from routing an entire example to a single module, the system potentially has to relearn similar concepts in multiple modules. Hence, load balancing hinders the router from selecting the single best module for longer (e.g., repetitive) sequences. This is investigated further by Lewis et al. (2021), who find that sparse models route syntactically and semantically similar words (in contrast to sentences or phrases) to the same modules. This sheds light on the limited expressiveness of modules which are learned on the token-level. Since scaling is the main focus of these works, their goals are orthogonal to modular approaches centred on parameter efficiency, transfer–interference trade-offs, and combinatorial generalisation. Example-Level Routing Nevertheless, one could imagine obtaining the best of both worlds by hybridising sparse MoE Transformers models with deterministic or learned routing strategies from § 4.1 and § 4.2.2. Instead of routing each individual token separately, all tokens of a single example can be routed to the same experts. Kudugunta et al. (2021) experiment with two versions of example-level routing for machine translation: In sentence-level routing, they average pool over the token embeddings, and condition the router on the resulting representation. In task-level routing, a task embedding is trained, based on which the router learns the distribution over modules. In a similar vein, Gupta et al. (2022) and Xi et al. (2022) implement task-level routing across modular experts to improve the amount of knowledge sharing during multi-task learning in NLP and computer vision, respectively. Since task identity (or other metadata) is not always given, especially in continual learning, it can be inferred through an auxiliary model. Van de Ven & Tolias (2019) refer to this scenario as 'class-incremental learning'. For instance, the current task can be identified based on the lowest predictive uncertainty or an auxiliary task classifier (von Oswald et al., 2020). In these cases, routing can depend on the predicted task identity. 4.2.4 Hypernetworks In addition to hard and soft routing, hypernetworks (Ha et al., 2017), as introduced in § 3.4, can be considered a third kind of routing, with unnormalised routing scores. More formally, the parameters θt ∈ Rd for a task t can be generated by a linear function Φαt. The task embedding αt ∈ R|M | can be interpreted as the output of a task-level routing function with unnormalised scores over |M | modules. In turn, the generator Φ ∈ Rd×|M | can be considered a matrix of module parameters stacked column-wise, where each module has d parameters. Thus, the generated parameters θt is a linear combination of the columns of the linear generator. This is also reminiscent of tensor factorisation models where parameters are factorised into shared tensors and task-specific tensors (Yang & Hospedales, 2017), which in hypernetworks correspond to the generator and the task embedding, respectively. However, hypernetworks learn both sets of parameters jointly rather than obtaining them from a factorisation of task-specific networks a posteriori. 20 4.3 Level of Routing Another aspect of designing a routing function is its level of granularity. Routing can select modules globally for the entire network, make different allocation decisions per layer, or even hierarchically select sub-routers. This last method is also referred to as 'dispatched routing' by Rosenbaum et al. (2018). A naive version of global routing (Figure 5b) assumes that a single routing configuration is shared across layers. Allowing for different decisions per layer (Figure 5a) is more challenging as the space of potential architectures grows exponentially as |M |l, where l is the number of layers or sub-functions of the network. In fact, to compute the posterior over parameters, one would need to marginalise over every possible configuration of A = [α1, . . . , αl]. Kirsch et al. (2018) resort to Expectation Maximisation to make it tractable. Instead, per-layer routing (Figure 5c) assumes conditional independence among decisions, thus facilitating scaling. Crucially, routing scores are sometimes employed not only to select a subset of modules but also to aggregate their outputs. This second purpose is addressed in more depth in § 5. Most methods assume that routing decisions occur in a sequence, whose length is bounded or unbounded. This is the case where the output of every layer is fed into the next. However, routing may also involve defining both the selection of modules and their order of composition (i.e., the model architecture). For instance, in Neural Module Networks (NMNs; Andreas et al., 2016b; 2017), the routing function consists of a parser that takes in a query and produces a dependency tree. This is post-processed and transformed into a tree graph where nodes are modules and directed edges control the flow of the information, i.e. route the output(s) of a subset of modules as input to another module. in Modular Meta Learning, Alet et al. (2018) alternate between sampling compositional graphs using simulated annealing (Kirkpatrick et al., 1983) and performing a step of gradient descent on the network parameters for a set of meta-training tasks. 5 Aggregation Function While in the previous section on routing we have covered the topic of how to select different modules during training, we will now focus on how we can aggregate these functions in order to combine the respective information. It is important to emphasise that, for the majority of current approaches, routing and aggregation are inseparable; that is, the selection and aggregation of modules are performed simultaneously. On the other hand, the strategies for aggregating functions in this section are reminiscent of the taxonomy previously discussed for computation functions (see §3); while in the latter we looked into the composition of shared components with modules, in this section we provide insights into the composition of multiple modules. This is often required when modules are recombined for zero-shot transfer or task-level generalisation (for more details on these applications, see § 7). In particular, for a subset of active modules K ⊆ Mi the aggregation of modular components can (similarly) ([φ1, . . . , φ|K|, x]), as be realised on the parameter level f 0 i well as function level f 0 (x) = i (x). Crucially, this differs from parameter aggregation if f is non-linear. We fθi discuss these different strategies in the following sections. (x). In addition, we cover output level aggregation f 0 i (x) = fφ1 ◦ ... ◦ fφ|K| (x), input level f 0 i (x) = fφ1⊕***⊕φ|K| (x) ⊕ * * * ⊕ fφ|K| (x) = fθi (x) ⊕ fφ1 5.1 Parameter Aggregation Mode Connectivity A natural strategy to aggregate information from multiple modules is interpolating their weights. However, given that neural architectures differ, and that hidden representations might not necessarily be equivalent (e.g. under invariance to invertible linear transformations) even if the model architectures are the same (Kornblith et al., 2019), naively aggregating module weights may have catastrophic consequences. However, recent work on linear mode connectivity (Frankle et al., 2020) suggests that under certain conditions, it is in fact possible to interpolate between multiple models, which has positive ramifications for modular aggregation methods. To understand these conditions, we first provide a brief introduction to the constraints under which parameter aggregation is permissible. The phenomenon where the minima found by two networks are connected by a path of non-increasing error, has been the subject of research for many years (Freeman & Bruna, 2017; Draxler et al., 2018; Garipov 21 et al., 2018; Nagarajan & Kolter, 2019). However, most works demonstrate that mode paths are in fact not linear. While Nagarajan & Kolter (2019) find linear paths between networks, their experimental setup requires initialising models with the same set of weights. Frankle et al. (2020) and Neyshabur et al. (2020) demonstrate that this linear mode connectivity phenomenon is closely linked to the Lottery Ticket Hypothesis (Frankle & Carbin, 2019), which suggests that only a small subset of randomly initialised weights are the main drivers for the final performance of a model-the so-called winning tickets (see § 3.1). When interpolating between models trained on different tasks but initialised with the same set of weights, the models tend to stay in the same loss basin, indicated by the lack of a sudden increase in loss when interpolating the weights. Consequently, it appears that the flatness of the basin of the loss landscape translates to better generalisation capabilities of a model. On the other hand, Ainsworth et al. (2022) argue that the success of such interpolation is strongly connected to the inherent bias of the optimiser being used, and not the neural network architecture itself. Weight Interpolation Building on the findings of interpolating the weights of models, Ansell et al. (2022) propose Lottery Ticket Sparse Fine-Tuning (LT-SFT), described in § 3.1. In particular, they identify language-, and task-specific sub-networks φl and φt. These can be aggregated by simply adding them to the base model, i.e. θ0 = θ0 + φl + φt. Instead of identifying task adaptations on subsets of model parameters, Ilharco et al. (2022) propose to edit entire models with further arithmetic operations. For example, tasks can include toxic language generation and general language modelling. By performing the arithmetic negation operation θ0 = θ0 + (φgeneral − φtoxic), their new model fθ0(x) generates less toxic text. This idea was influenced by the word analogy task (i.e., 'word arithmetics') (Mikolov et al., 2013).16 Rather than sparse adapters, Asai et al. (2022) aggregate parameters of soft prompts learned via prefix tuning (§ 3.2). In order to generalise to new tasks, (frozen) modules from past tasks and a learnable module created for the new task are interpolated according to the weights of an attention mechanism between the modules and the input. 5.2 Representation Aggregation Closely related to parameter aggregation, representation aggregation consists of interpolating the outputs of individual modules. Crucially, both operations are equivalent if the functions are linear: (αiΦi + αjΦj)x = αiΦix + αjΦjx. However, this does not hold true for non-linear functions, e.g. if the module is an adapter layer (Houlsby et al., 2019) or a feed-forward component of a Transformer layer (Fedus et al., 2021). Weighted Representation Averaging At the i-th sub-function of the model, where multiple modules φ ∈ Mi exist, the representations are passed through the (active) modules, outputting |Ki| (latent) representations h1, . . . , h|Ki|. One way of performing aggregation is to learn the weights α to interpolate over the hidden representations: f 0 i (x) = |Ki| X j αjhj (8) with αj being a module-specific scalar weighting. This aggregation is equivalent to Equation (6) when interpreting each weight αj ∈ [0, 1] as the output of a soft router, i.e. αj = r(φj). Consequently, all soft-learned routing approaches (e.g. MoE) that do not perform top-1 routing (see § 4.2.3) also determine how to aggregate the representations of different modules. As an extension to the traditional MoE aggregation/routing function, Ma et al. (2018) propose to learn one aggregation function per task t in a multi-task setup. Gururangan et al. (2022) pre-train modular components for different textual domains d ∈ D. When utilising the pre-trained modules on unseen data, they weight the output representations hd of the respective domain modules φd according to the posterior distribution over the input examples, i.e. α = p(D | x): 16vec('King') − vec('Man') + vec('Woman') ≈ vec('Queen'), with vec(*) denoting word embeddings of the respective words. 22 (x) = X f 0 i p(d | x) fφd (x) d∈D (9) This posterior is inferred through the Bayes rule. This does not require any auxiliary model, and only relies on the original d-conditioned language model. In fixed routing, module representations are often averaged without weighting (Zhang et al., 2022a; Chronopoulou et al., 2022a). Similarly, in hard routing methods, the representations of all active modules are averaged, such as in Polytropon (Ponti et al., 2022), or summed, as in PathNet (Fernando et al., 2017).17 One disadvantage of simply learning gating parameters is that the weights do not depend on the hidden representations. Thus, they do not take into account their information content. This issue is tackled by attention-based aggregation functions. Attention-Based Representation Aggregation Instead of inferring the weighting before a module has performed its transformation on the latent representation, the aggregation decision can take place afterwards. This allows for identifying whether or not the information added by the respective module is ancillary to the target task. In AdapterFusion, Pfeiffer et al. (2021a) propose an attention mechanism (Bahdanau et al., 2015) between the stacked hidden representations Hi produced by the modules and their input x: fi(x) = Attn(xQi, HiKi, HiVi) (10) where Q, K, V ∈ Rd×h are the projections that produce the queries, keys, and values, and x is the input representation to each of the modules (i.e., the output representation of the previous layer). Hi ∈ R|M |×d is a matrix consisting of row-wise stacking of the output representations h1, . . . , h|Mi| of each module. In other words, the input of each module is interpreted as the query and the output of each module is interpreted as the value and key. The attention mechanism thus learns to attend over the module representations and weigh them according to their relevance for the current task. Instead of aggregating module outputs into a single representation, Recurrent Independent Mechanisms (Goyal et al., 2021) concatenate the outputs of the top-k active modules. However, in between the application of recurrent computation functions, they exploit an attention mechanism over hidden representations to enable sparse communication among modules. One major disadvantage of both weighted and attention-based representation averaging, is that-when used in combination with soft routing-they require a full forward pass through all modules, even if they contribute only marginally to the final aggregation. Thus, they incur significant increases in time and space complexity. While this can be mitigated by pruning (i.e., dropping) some modules during inference (Rücklé et al., 2021), latency still remains an issue for scalability. Thus, top-k hard routing offers a more efficient solution for both weighted averaging (Shazeer et al., 2017; Lepikhin et al., 2021) and attention-based aggregation (Goyal et al., 2021). 5.3 Input Aggregation Input aggregation lends itself naturally to adapters such as prompts or prefix tuning (Brown et al., 2020; Lester et al., 2021; Li & Liang, 2021, see § 3.2). In prompting, we have a set of instructions or few-shot examples φ1, . . . , φ|K|. Given that the nature of prompting is to prepend the prompts to the input, aggregating the respective modules boils down to concatenating all prompts. That is, providing the model with multiple instructions, or with multiple examples (i.e. few-shot in-context learning) is a version of module input ([φ1, . . . , φ|K|, x]). This concept also extends to prefix-tuning, where we can simply aggregation f 0 1 , x]). concatenate all prefixes at every layer: f 0 i i , . . . , φ|K| (x) = fθ1 (x) = fθi ([φ1 i In the context of prompting, Schick et al. (2021) leverage input aggregation by concatenating multiple textual descriptions of undesired behaviours of a language model to generate toxic text for model debiasing. In 17Note that the latter strategy leads to high variance in the norms of hidden representations if the router can select variable-size subsets of modules. 23 the context of prompt tuning, Vu et al. (2022b) learn separate task and language soft prompts that are recombined for zero-shot cross-lingual transfer in summarization. Nayak et al. (2022) compose soft prompts of attributes and objects in visual tasks to generalise to new classes. Note, however, that soft prompts can be aggregated with methods different from concatenation, such as attention-based parameter interpolation (Asai et al., 2022). Hypernetworks Similarly to soft prompts, hypernetworks may aggregate information from different embeddings by combining them in the input to the parameter generator. For instance, in (Ponti et al., 2021) task and language embeddings are concatenated in the input when training a multilingual multi- task architecture where the encoder is fully shared and the hypernetwork generates the classifier head. By recombining embeddings appropriately, this method allows for inferring the parameters of unseen task–language combinations. Similar combinations of embeddings have been used to generate adapters in multilingual (Üstün et al., 2020) and multi-task settings (Karimi Mahabadi et al., 2021; Pilault et al., 2021). Embeddings may also represent the position of the generated parameters in the neural architecture (Ansell et al., 2021; Üstün et al., 2022). 5.4 Function Aggregation Finally, aggregation can be achieved on the function level; f 0 i methods infer either a sequence or a (tree) structure that determines the order of the aggregation. (x) = fφ1 ◦ fφ2 (x). Different aggregation Sequential Aggregation By performing a forward pass through multiple modules, where the input to the next module is the output of the previous one, the respective hidden representations are sequentially transformed: f 0 i (. . . (fφ|M | (x) = fφ1 (x)))). (fφ2 and fφlt This form of information aggregation is often chosen in conjunction with fixed routing, as discussed in § 4.1, given that the routing order is determined by the role of each module (e.g. language and task adapters). Pfeiffer et al. (2020b; 2021b) propose a two-stage setup where language-specific components are disentangled from task-specific components, in order to perform zero-shot cross-lingual transfer. First, language (adapter) are trained on monolingual unlabelled data for the source language s and the target modules fφls language t, respectively. Then, in the second stage, the language component fφls is inserted but frozen, and a new (adapter) module is added for a task fφt and trained on annotated data for the source language: (x)). Since this effectively disentangles language from task information, this also enables zero-shot fφt is substituted with fφlt inference on the target language t without annotated data. In particular, fφls , (fφlt thereby hierarchically aggregating the information from the respective modular components: fφt (x)). Similarly, Stickland et al. (2021) performs function composition of a language module fφl and a domain module fφd for multilingual multi-domain machine translation. For more examples, see § 7.1. (fφls Hierarchical Aggregation Alternatively, when global routers jointly determine the selection of modules and the model architecture, the order of function composition follows the structure of a tree. For instance, Neural Module Networks (Andreas et al., 2016b) leverage a semantic parse to infer a graphical structure for module aggregation. While all leaf nodes find objects by identifying regions of an image through attention, intermediate nodes either transform or combine these representations (depending on the arity of the node). The root then predicts the label by describing or measuring the attended objects. 6 Training Setting Finally, we explore the training settings for modular architectures. We can identify three main strategies in the literature: 1) all modules are jointly trained for multi-task learning; 2) modules are introduced at different stages during continual learning; and 3) in transfer learning, modules are added post-hoc after pre-training, often as a way to fine-tune the model in a parameter-efficient fashion. However, it is important to note that these strategies do not necessarily rule out each other, as they can all be realised in combination. 24 6.1 Joint Multitask Learning In joint multi-task learning, there are two main settings. Firstly, task-specific parameterised components can be integrated into shared neural network architectures as a means to mitigate catastrophic forgetting or negative interference (McCloskey & Cohen, 1989; French, 1999) and as a way to scale the model size efficiently (Kudugunta et al., 2021). In these scenarios, modules are often optimised on individual tasks via fixed routing and specialise accordingly (Hampshire & Waibel, 1992; Rajendran et al., 2017, inter alia; see § 4.1 for more details). As an alternative, the architecture can be fully modular, sharing only the parameters for learned routing (Jacobs et al., 1991b;a; Rosenbaum et al., 2018; Kirsch et al., 2018; Chang et al., 2019, inter alia; see § 4.2.3 for more details). Joint training can also be performed before post-hoc training: a shared base model can be pre-trained on multiple tasks as a warm-up before creating task-specific sparse subnetworks (Sun et al., 2020a) or as a way to provide a useful initialisation for modular parameters (Vu et al., 2022c). Dua et al. (2022) converts a dense language model pre-trained on text data into an MoE by decomposing the learned feed-forward layers. Pfeiffer et al. (2022b) add language-specific layers during multilingual pre-training of a language model. This prepares the model to be extended to more languages post-hoc; when new languages become available, a new (randomly initialised) learnable layer can be added to the inventory of modules, whereas the shared parameters remain untouched. 6.2 Continual Learning In a similar vein to countering negative interference in multi-task learning, continual learning-that is, continuously integrating new data into the model-often aims at mitigating catastrophic forgetting (i.e., the knowledge learned at early stages of training should not get overwritten by updates to the model later on). Similar to the multi-task learning approaches discussed in § 6.1, new layers can be continuously introduced within the network which are only updated on the new data, keeping the others untouched. In methods like Progressive Networks (Rusu et al., 2016), PathNet (Fernando et al., 2017), and PackNet (Mallya & Lazebnik, 2018) when the model is trained on a new task, the parameters of the previous tasks are frozen; however, for new tasks, new modules may be learned, which connect to the existing set of modules. Often, the decision of inserting new modules at a given stage is made dynamically based on outlier detection (Ostapenko et al., 2021). Progressive Networks (Rusu et al., 2016), on the other hand, scale the model capacity linearly with the number of tasks. Aljundi et al. (2017) train separate experts for every task and route new examples based on the distribution of the reconstruction errors of task-specific auto-encoders. Instead of adding new parameters to the model, other works in the continual learning landscape identify subnetworks for different tasks. For instance, some works identify subnetworks of the model, which have not been used by previous tasks. Consequently, updating these parts of the model will have little effect on the previously learned knowledge (Javaloy & Valera, 2022). Similarly, 'supermasks' (§3.1; Wortsman et al., 2020), which learn a binary mask over a randomly initialised model, enable the extension to a potentially vast number of tasks during continual learning. Supermasks of previous tasks can be also linearly combined as a way to generalise to new tasks. 6.3 Parameter-efficient Transfer Learning Recently, transfer learning has become the dominating strategy for state-of-the-art results on most tasks. Auxiliary self-supervised objectives are utilised to pre-train models on a large amount of data. Subsequently, the model's weights are fine-tuned on the target tasks (Howard & Ruder, 2018; Devlin et al., 2019). Updating a small set of parameters of these large models has been demonstrated to perform equally well as full model fine-tuning, leading to the emergence of parameter-efficient fine-tuning strategies. Most methods discussed in § 3 that are applied to large pre-trained models can be considered as post-hoc adaptation. Modularity can be achieved through parameter composition (§ 3.1) using sparse subnetworks (Mehta, 2019; Chen et al., 2020; Donahue et al., 2014; Cai et al., 2020; Ben Zaken et al., 2022; Guo et al., 2021), or low-rank adapters (Li et al., 2018; Hu et al., 2022), input composition (§ 3.2) by augmenting 25 the function's input (Brown et al., 2020; Li & Liang, 2021), and function composition (§ 3.3) through adapter layers (Rebuffi et al., 2017; Houlsby et al., 2019) and rescaling (Liu et al., 2022b). Additionally, hypernetworks can be used to generate the parameters of any of the above-mentioned types of modules (§ 3.4). Essentially, all of these methods are tightly connected as they share the same functional form (§ 3.5). 7 Applications in Transfer Learning Most applications of modular deep learning revolve around transfer learning. In particular, the two main purposes are: 1) parameter-efficient fine-tuning (§ 7.1), which achieves superior efficiency, prevents negative interference, and enables zero-shot transfer; and 2) zero/few-shot generalisation to new tasks (§ 7.2). In what follows, we provide a quick overview of transfer learning applications of modular deep learning. For the in-depth discussions and illustrations of the key concepts, we will first focus on applications in NLP, and then draw direct analogies with other deep learning areas such as speech processing, computer vision, and multi-modal (representation) learning. In § 8, we will explore additional purposes of modular deep learning, including hierarchical reinforcement learning, programme simulation, and causal inference. 7.1 Parameter-Efficient Fine-tuning Regardless of the application area, one of the principal uses of modules has been to boost parameter efficiency and decrease model storage requirements of fine-tuning, eschewing so-called full model fine-tuning which requires storing a separate copy of the full model per task (Howard & Ruder, 2018; Devlin et al., 2019), see §6.3. In the simplest formulation, all task-specific updates are pushed to the parameters of the lightweight modules, while the parameters of the large base model are kept frozen throughout task fine-tuning. The modules then store task-specific knowledge that can be composed with the 'general-purpose' knowledge of the base model to adapt it to the task at hand. In NLP, this led to a number of research papers that introduced diverse modular architectures, as surveyed in § 3 and § 6. A typical evaluation protocol is fine-tuning a type of module on the popular GLUE and SuperGLUE benchmarks (Wang et al., 2019), comparing against full model fine-tuning or alternative modular architectures. The results usually corroborate either of two main goals: (i) improving performance with the same parameter budget versus (ii) maintaining performance with a smaller parameter budget (Mahabadi et al., 2021; Zhou et al., 2023). In addition, modular adaptation has further benefits: first, it prevents negative interference between tasks (Bapna & Firat, 2019). Second, it allows for combining adapters to enable zero-shot transfer (Pfeiffer et al., 2020b). 7.1.1 Machine Translation In the seminal work of Bapna & Firat (2019), bilingual (i.e., language-pair) adapters (see §3.3) were used to adapt a massively multilingual NMT model (spanning 103 languages) to a particular source–target translation direction. One benefit of such bilingual adapters is their ability to 'skew' the multilingual model to the language pair at hand without losing the benefits of massively multilingual training for low-resource languages. Another positive effect of bilingual adapters concerns recovering the MT performance also for high-resource languages. High-resource languages might typically suffer from performance deterioration due to the particular interference phenomenon known as the 'curse of multilinguality' (Conneau et al., 2020; Wang et al., 2020): when (too) many languages compete for the fixed parameter budget of the model, the model's expressiveness and representation power deteriorates for all languages. The use of modules extends the parameter budget to recover the detrimental effects of multilingual inference through dedicated (i.e., modular) bilingual adaptation. Their work also demonstrates the superior performance of a multilingual model specialised towards a particular language pair over merely training a bilingual NMT model for the same pair from scratch. However, fine-tuning bilingual adapters (or more generally, modules) for each translation direction assumes parallel data for all language pairs and requires n(n − 1) modules to cater for all possible language pairs (one dedicated module in the encoder and another module in the decoder). Therefore, follow-up work (Philip et al., 2020; Üstün et al., 2021) aimed to learn monolingual (i.e., language-specific) adapters. Again assuming standard encoder-decoder architectures for MT such as mBART (Liu et al., 2020), this design requires only 2n modules in total. Besides improving parameter efficiency, this also bypasses the critical dependency on parallel data for all language pairs and allows for learning from monolingual data. Crucially, this design 26 also enables translation to or from languages without parallel data, in a fully unsupervised way, and even to/from languages unseen by the base pre-trained encoder-decoder model. Put simply, when translating from language ls to lt, only the encoder adapters for ls plus the decoder adapters for lt are activated: the model is able to translate from ls to lt without seeing a single parallel ls to lt sentence. This application in the field of NMT exemplifies the power of modular design: available components, which were previously learned locally and asynchronously, can be recombined in novel ways to generalise systematically to unseen applications (i.e., in this particular case, to unseen translation directions). This is one of the main goals of modular deep learning (§ 1). The separation into dedicated language-specific modules mitigates interference and catastrophic forgetting; however, it also hinders any positive transfer between modules of similar languages. The positive transfer can be achieved through the use of hypernetworks (see §3.4): Baziotis et al. (2022) learn to generate monolingual language-specific adapters for NMT. In fact, sharing the parameter generator takes advantage of language similarities (Platanios et al., 2018). As discussed in more detail later in §7.1.2, similar ideas of combining the modular design with hypernetworks have also been applied earlier and beyond NMT, e.g., for task fine-tuning with adapters in monolingual multi-task setups (Karimi Mahabadi et al., 2021) and for cross-lingual transfer in single-task (Ansell et al., 2021) as well as in multi-task setups (Ponti et al., 2021; Üstün et al., 2022). The curse of multilinguality and catastrophic interference in multilingual MT models have also been tackled through sparse sub-networks (see § 3.1). Lin et al. (2021) extract sparse sub-networks for specific language pairs from a trained multilingual MT model via pruning. Subnetworks are then trained separately in order to specialise towards the particular translation direction. In fact, there exist dedicated small sub-networks (which can be obtained via standard masking) that store language pair-specific knowledge within the large network, where such knowledge should not interfere with other language pair-specific sub-networks (Dua et al., 2022). The same high-level idea has also been applied to domain adaptation of bilingual MT systems: e.g., Liang et al. (2021) show that it is possible to learn domain-specific sub-networks when fine-tuning the MT system on new domains, where a single large network (i.e., the full neural MT system) comprises multiple disjoint domain-specific sub-networks specialised to particular domains. Another approach that leverages modularity for an increased language-specific capacity in MT is mixture- of-experts. Each expert is typically dedicated to a particular language or translation direction (Kudugunta et al., 2021; Costa-jussà et al., 2022). To maintain feasible decoding time, the procedure works as follows: (i) during training, mix the inputs from different translation directions in the same batch, in order to learn the routing network and encourage positive transfer among related tasks; (ii) at inference time, different translation directions are decoded separately, and only the corresponding subset for elevant experts is loaded. 7.1.2 Cross-Lingual Transfer NMT focuses on translation as a single task and modularity was exploited mainly to carve language-specific and/or domain-specific modules that can support multilingual and multi-domain systems, respectively. In more general cross-lingual transfer setups, the aim is to transfer large models (Devlin et al., 2019; Conneau et al., 2020) fine-tuned for any task (e.g., sequence labelling tasks such as NER, text classification tasks such as NLI, sentiment analysis or intent detection for dialogue systems) on one or more source languages (where such task annotations exist) to one or more target languages (Hu et al., 2020; Ruder et al., 2021). Ideally, the transfer should be achieved without fine-tuning the full large model (Hu et al., 2020), which either results in catastrophic forgetting and negative interference, or requires the creation of separate model copies for each task. The idea of training language modules thus largely follows what already outlined for MT in §7.1.1, with the addition of another set of dedicated modules that aim to capture task-related knowledge: task modules. Such language modules and task modules can then be combined to 1) favour zero-shot cross-lingual transfer for particular source-target directions (Pfeiffer et al., 2020b; Ansell et al., 2021; 2022; Parović et al., 2022); 2) provide extra capacity to low-resource languages under-represented (or even not covered) in the large multilingual models such as mBERT or XLM-R (Pfeiffer et al., 2021b; 2022b; Ponti et al., 2020; Faisal & Anastasopoulos, 2022), independently from task knowledge; and 3) enable handling unseen language–task or even language–domain–task configurations (Ponti et al., 2021; Stickland et al., 2021). 27 As an example of zero-shot cross-lingual transfer, the original MAD-X framework (Pfeiffer et al., 2020b, Figure 1a) relies on bottleneck adapters to implement language and task modules: In particular: 1) Language modules are inserted into each layer of the original neural model and are fine-tuned on (unsupervised) data of the particular language (e.g., via Masked Language Modelling) while the weights of the original model are kept fixed. 2) After obtaining language modules, task modules are stacked on top of the source language module(s) and are fine-tuned relying on the task objective and task-annotated data in the source language(s), while both the original model and language modules are kept fixed. 3) At inference, source language module(s) are replaced with the desired target language module while retaining the task module: this enables zero-shot task inference in the target language. Recent work has introduced a spectrum of variations and enhance- ments to this core idea. For instance, inspired by the bilingual 'translation direction' adapters for NMT systems (§7.1.1), Parović et al. (2022) learn bilingual adapters instead of single language adapters to boost transfer for a particular language pair. Faisal & Anastasopoulos (2022) and Chronopoulou et al. (2022b) learn language family adapters to reduce data sparsity for low-resource languages and capitalise on language similarity and cross-language sharing. Stickland et al. (2021) decouple language and domain knowledge into dedicated modules (see also §7.1.3 later). Fur- ther, Ansell et al. (2022) implement dedicated modules as sparse sub-networks, the so-called language and task masks, which can be composed with the base model via parameter composition. Following the analogy between language-specific and bilingual adapters, instead of learning separate language and task sub- networks, Foroutan et al. (2022) learn dedicated task–language sub-networks, demonstrating the variance in the extracted sub- networks across different task–language combinations. The use of such language sub-networks as language modules, even without dedicated task modules, improves cross-lingual transfer for depen- dency parsing when used within a meta-learning setup (Choenni et al., 2022). Litschko et al. (2022) compare sparse sub-networks and bottleneck adapters for transferring ranking functions for infor- mation retrieval tasks across languages and find them both superior to full model fine-tuning. Figure 6: Hyper-X (Üstün et al., 2022): an example application of contextual module generation where a hypernetwork takes the concatenation of task, language and layer embeddings as input and gen- erates a flat parameter vector. This is further reshaped into an adapter module within each Transformer layer. Learn- ing independent layer embeddings and sharing a single hypernetwork across all layers (Ansell et al., 2021) (i) enables information sharing across layers, and (ii) reduces trainable parameters of the hyper-network by a factor corresponding to the number of layers. Finally, a body of work again focuses on 'contextually generating' the modules via hypernetworks, aiming to increase efficiency and benefit from connections between different languages and tasks. A representative example is the Hyper-X framework (Üstün et al., 2022) provided in Figure 6, where the module parameter generation is conditioned on the (disentangled) task and language, and addi- tionally on the index of the Transformer layer where the generated module is inserted. Each task and language are parameterised via separate embeddings, which enables adaptation to any task– language combination, where these embeddings are low-dimensional vectors which are learned together with the parameters of the hypernetwork (see Figure 6 again). The framework thus leverages supervision and positive transfer from both multiple tasks and languages. Hyper-X can be seen as a more general variant of a series of precursors backed by the idea of contextual generation: Ponti et al. (2021) condition the hypernetwork on both task and language embeddings but generates only the model's classifier head. Other methods generate modules but condition the hypernetwork only on tasks in a monolingual setup (Karimi Mahabadi et al., 2021) or only on languages in a cross-lingual transfer setup (Üstün et al., 2020; Ansell et al., 2021). 28 7.1.3 Domain Adaptation As already hinted at in §7.1.1 and §7.1.2, dealing with different domains adds another tier to the modular design: domain-specific knowledge might be captured within dedicated domain modules.18 This can again be accomplished through similar modular architectures as with language and task adapters. For instance, it is possible to inject domain-specific knowledge into (bottleneck) adapters (Zhang et al., 2021; Chronopoulou et al., 2022a) or to extract sparse domain-specific or task-specific sub-networks (Thompson et al., 2018; Ke et al., 2021b) for multi-domain and multi-task learning. Mixture-of-experts also enable multi-domain joint learning as well as domain adaptation (Guo et al., 2018; Zhong et al., 2022). Similar strategies have also been used in multi-domain and cross-domain speech processing and computer vision applications (see §7.1.5 and §7.1.6 later). In domain adaptation, it is common to combine both shared parameters and domain modules that are learned jointly (Bousmalis et al., 2016). Beyond this standard setting, many approaches employ additional regularisation terms. The most common are 1) a domain-adversarial loss on the shared parameters in order to encourage them to be domain-invariant (Ganin et al., 2016; Chen & Cardie, 2018); 2) an orthogonality constraint on the domain modules to ensure that they capture different information (Baktashmotlagh et al., 2013; Kim et al., 2017); and 3) similarity constraints that bring representations of similar modules close together (Bousmalis et al., 2016). 7.1.4 Knowledge Injection Naturally, dedicated modules can also be assigned to inject and store external knowledge (e.g., from manually curated external knowledge bases), which can then interact with language, domain, or task knowledge. This idea has been explored with diverse external knowledge sources. For instance, Lauscher et al. (2020) aimed at complementing the distributional knowledge of large language models with conceptual and commonsense knowledge from ConceptNet (Speer et al., 2017). The external knowledge was captured within dedicated bottleneck adapters: they were fine-tuned via language modelling on synthetically created sentences from random walks over the ConceptNet graph structures. Majewska et al. (2021) stored verb-related knowledge from VerbNet (Schuler, 2005), a human-created verb classification repository, into bottleneck adapters, and demonstrated its usefulness in a range of tasks that require understanding of verb semantics. Along similar lines, Wang et al. (2021a) offered a generalisation of these approaches where different knowledge sources (e.g., Wikipedia, WikiData) are mapped to different dedicated adapters, which can be aggregated according to the task at hand. The same idea has been explored by Lu et al. (2021) in the biomedical domain, where the main knowledge sources were the UMLS Metathesaurus graph (Bodenreider, 2004) and biomedical Wikipedia articles. Lu et al. (2021) also introduce another component, the so-called knowledge controller, which can be seen as a standard attention-based function aggregator from §5.4. Finally, Lauscher et al. (2021) learned bottleneck adapters without manually curated external data, with the focus on model debiasing: the debiasing adapters were fine-tuned via standard language modelling on a counterfactually augmented corpus. 7.1.5 Speech Processing The use of modular deep learning for speech processing applications closely matches the ideas already exposed for NLP tasks. The landscape of the possible modular designs is exactly the same, where the only crucial differences are (i) the choice of the underlying large model, and (ii) the corresponding objective functions used to inject the specialised knowledge into the modules. For instance, the typical choice of the base model for automatic speech recognition (ASR) applications is one from the wav2vec family (Baevski et al., 2020; Babu et al., 2022), while the ASR-oriented objective function is the standard Connectionist Temporal Classification (CTC) loss (Graves et al., 2006). The high-level modular structure remains the same, as illustrated in Figure 7 with an example from Thomas et al. (2022), which utilises standard bottleneck adapters. 18For instance, disentangling domain and language information yields benefits for NMT and cross-lingual transfer applications (Vilar, 2018; Cooper Stickland et al., 2021; Pham et al., 2021; Saunders, 2022). 29 While in theory a large variety of possible modular configurations from § 3-§ 6 can be applied to diverse speech processing tasks, the majority of current work in the area has indeed focused on the use of bottleneck (sequentially placed) adapters for ASR in monolingual and multilingual contexts. Before that, the concept of modularity can be traced to the work of Swietojanski et al. (2016), where the model re-weights hidden units using small amounts of unsupervised data to better adapt to a particular speaker or an environment. More recently, bottleneck adapters have been used to perform ASR adaptation to atypical and accented speech (Tomanek et al., 2021), unseen speakers with limited adaptation data (Wang & Van hamme, 2022; Eeckt & Van hamme, 2022; Chen et al., 2023), new domains and manners of speaking (e.g., children's speech) (Fan & Alwan, 2022; Zhu et al., 2022), or to perform further model customisation to specific speakers (Biadsy et al., 2022; Sathyendra et al., 2022) and for multilingual learning (Kannan et al., 2019; Hou et al., 2022). A notable exception, not resorting to adapter layers, is the method of (Winata et al., 2020) which aims to learn low-rank modules (§ 3.1), akin to the idea of LoRA (Hu et al., 2022), for end-to-end ASR. Multi-task (where the term 'task' in this context can e.g. refer to different languages, domains, speakers, or accents) ASR setups have also witnessed the usage of mixture-of-experts, closely following the basic ideas already discussed for NMT (§7.1.1) where different languages are assigned their dedicated modules through fixed routing. For instance, in speech processing, MoEs have been applied to multilingual ASR and cross-lingual ASR transfer (Bai et al., 2022; Gaur et al., 2021; Kumatani et al., 2021), while You et al. (2022) propose MoE for ASR with learned routing. Beyond ASR, bottleneck adapters have also been used for speech translation (Le et al., 2021). Most recently, modular adapter-based approaches have been applied to text-to-speech methods (TTS) (Hsieh et al., 2022; Morioka et al., 2022), aiming to extend standard large multi-speaker TTS models such as FastPitch (Lancucki, 2021) to new speakers without compromising the TTS quality for the seen speakers. From a high-level perspective, one can see a direct analogy of this goal to the objectives in the MT literature of extending multilingual MT systems to unseen languages without compromising seen languages (see §7.1.1 again). 7.1.6 Computer Vision and Cross-Modal Learning In computer vision, similar to NLP and speech processing (§7.1.5), dedicated modules are again used to enable parameter-efficient fine-tuning across mul- tiple tasks and domains (Rusu et al., 2016; Rebuffi et al., 2018; Berriel et al., 2019; He et al., 2022b, among others). The core difference, again, is the choice of the actual neural architecture for the underlying model as well as for the modules: e.g., residual adapters (Rebuffi et al., 2017) consisted of simple 1 × 1 convolutions combined with the base ResNet neural model (He et al., 2016) while other work learned task-specific convolutional filters (Newell et al., 2019; Bragman et al., 2019). More recent work aims to exploit modular architectures from NLP (e.g., sequential or parallel adapters, LoRA, prefix tuning) with pretrained Vision Transformer (ViT) architectures (Dosovitskiy et al., 2021): e.g., He et al. (2022b) run a comparative empirical analysis of various modular architectures for vision tasks, while Chen et al. (2021) rely on sparse sub-networks. Modular design lends itself naturally to cross-modal and multi-modal ap- plications, where different modalities may be captured by modality-specific parameters and routing can also be modality-conditioned. For instance, in multilingual vision-and-language (V&L) settings, it is possible to conduct inference in languages that lack labelled task examples. In fact, language knowledge is again disentangled from the task and modality knowledge, and the knowledge for different input modality streams can be captured in ded- 30 Figure 7: The structure of the wav2vec 2.0 model with task- specific bottleneck adapters for parameter-efficient ASR fine-tuning from Thomas et al. (2022); f (*) denotes a con- volutional encoder followed by 12 standard Transformer encoder blocks. For down- stream ASR a linear classifier, CT C(*), is applied to the final encoder output. QKVf( ).CTC( ).x12 icated modules. This idea has been heavily explored in recent work in multi-modal multi-task scenarios, both in monolingual (Sung et al., 2022) and multilingual contexts (Bugliarello et al., 2022; Pfeiffer et al., 2022a), for tasks such as image captioning (Zhou et al., 2022a; Gao et al., 2021a), text-to-image generation (Maharana et al., 2022), visual question answering (Liu et al., 2022a; Sung et al., 2022), visual reasoning (Liu et al., 2021a), etc. For instance, Flamingo (Alayrac et al., 2022) uses frozen pretrained vision and language models, and only trains adapter layers to handle sequences of arbitrarily interleaved visual and textual data. It is trained with a sequence modelling objective on Web-scale data (Li et al., 2021) and displays impressive zero-shot and few-shot capabilities. Pfeiffer et al. (2022a) use adapter modules to equip multilingual text-only models with the ability to also process the visual modality, as well as to equip monolingual multi-modal models to deal with input from multiple languages. Papalampidi & Lapata (2022) rely on hierarchical adapters (akin to hierarchical representation aggregation discussed in § 5) for the task of summarising long videos into textual descriptions. Pan et al. (2022) demonstrate that modular design also helps in image-to-video transfer tasks: they use adapter modules to equip a large image-based model without temporal knowledge with the ability to reason about dynamic video content. We note that in this survey, we aim to list some exemplary applications and draw parallels between different yet similar application areas such as NLP, speech processing, and computer vision. While we acknowledge that there exists a wealth of other work in these areas, we have no pretence of exhaustiveness. 7.1.7 Comparison and Design Principles While a full-fledged comprehensive empirical study of the plethora of modular architectures across various application tasks and areas is still lacking, there exist initiatives such as the publicly available AdapterHub platform (Pfeiffer et al., 2020a): it provides (re)implementations of representative modular NLP architectures, within a unified framework tied to HuggingFace Transformers (Wolf et al., 2020). Among others, AdapterHub includes representatives of each computation method in § 3: LoRA (Hu et al., 2022) (i.e., low-rank parameter composition), prefix tuning of Li & Liang (2021) (input composition) and a number of bottleneck adapter configurations (function composition). The existence of AdapterHub delineates another crucial advantage of modularity: reusability of existing, already fine-tuned modules which can be (re)combined with the large neural models. In short, any practitioner can share or reuse a module specialised for a particular purpose (e.g., capturing specific task or language knowledge) with the community, facilitating community-wide sharing and thus avoiding time- and energy-costly repetitions of the same fine-tuning procedure.19 As discussed in § 4, one can observe initiatives such as AdapterHub as continuously updating community-distributed multi-task models. The discussion in this section also points to a more general principle: different end-goals even within the same end-application (e.g., NMT, cross-lingual transfer, domain adaptation) require rethinking the actual modular design, and the desired level and nature of modularity. For instance, if the goal in NMT (or cross-lingual transfer) is to boost performance for a particular translation or transfer direction, it might be useful to trade off some modularity for a better final performance by replacing language-specific monolingual modules with bilingual modules (Bapna & Firat, 2019; Parović et al., 2022). On the other hand, if the goal is to enable zero-shot or few-shot translation or transfer, the design with monolingual modules might be a better choice. In another example, if the focus is on MT or transfer for a particular low-resource language, the model designer should enable positive transfer to that language by 'opening' the flow of information from a module storing knowledge on high-resource languages similar to the target language if such languages exist (e.g., from Spanish to Galician) (Üstün et al., 2021), or by learning modules for families or groups of similar languages (Chronopoulou et al., 2022b; Faisal & Anastasopoulos, 2022). Analogously, related domains can also be grouped and hierarchically organised to enable positive transfer for domain adaptation (Chronopoulou et al., 2022a). Other practical desiderata may also influence the selection of the actual modular design. If the final task performance is paramount, larger modules might be preferred, e.g., in order to offer enough extra capacity to store the wealth of language-specific information (Ansell et al., 2022). However, if model compactness is paramount, the criterion for choosing a specific design is instead the trade-off between efficiency (in terms of 19The (concept of) reusability enabled by the modular design also positively impacts energy consumption (Strubell et al., 2019), making an important leap towards Green(er) AI (Schwartz et al., 2020). 31 Figure 8: An example of Hierarchical Reinforcement Learning (§ 8.1), Policy Sketches (Andreas et al., 2017). Two high-level policies Π corresponding to task instructions τ are illustrated. Each iteratively selects low-level policies π (options) corresponding to sub-tasks b from a shared inventory. These determine the choice of action given observations. In this case, options are implemented as predicate–argument pairs. parameters and/or train and test time) and task performance; the optimisation of this trade-off has been the focus of recent research (Rücklé et al., 2021; Mahabadi et al., 2021; Karimi Mahabadi et al., 2021; Sun et al., 2022). In another example, if time efficiency during inference is a crucial requirement (e.g., real-time ASR in dialogue systems, low latency for information search systems) parameter composition methods such as sparse subnetworks or low-rank composition methods may be preferred over function composition methods as the latter increase the number of computations required during the forward pass, (see Table 3). In yet another example, if storage requirements are a critical constraint, one cannot resort to huge mixture-of-expert models where billions of parameters must be stored (Lepikhin et al., 2021). 7.2 Task Generalisation The diverse applications of modular deep learning covered so far almost exclusively focus on learning modules associated with (arguably) well-formed and interpretable 'units of knowledge' such as languages, tasks, domains, dialects, accents, and speakers. However, modularity might also be achieved when such units are unknown. This relies on jointly learning arbitrarily sized inventories of so-called latent skills and a learned routing function (§ 4.2). Since such skills are learned end-to-end on a mixture of data from multiple tasks, they are often not straightforwardly interpretable. On the other hand, since arbitrary subsets of skills can be combined and each skill can be updated locally, these modular neural architectures are ideal for systematic generalisation to new tasks (Zhang et al., 2022a; Ponti et al., 2022). In fact, another fundamental application in transfer learning is achieving zero-shot or few-shot generalisation to new tasks, where test examples are not i.i.d. with respect to training examples. The general experimental setup involves disjoint sets of training and test tasks. A model is pre-trained through multi-task learning on training tasks and then adapted to each new test task based on zero or few data points. Common examples of evaluation benchmarks for this setting include CrossFit (Ye et al., 2021), the T0 task suite (Sanh et al., 2022), or Natural Instructions (Mishra et al., 2022). While a common strategy to tackle this problem is instruction tuning (Sanh et al., 2022; Wei et al., 2022), where models are fine-tuned prepending the instructions for each task, modular deep learning has emerged as a strong contender (Alet et al., 2018; Kudugunta et al., 2021; Ponti et al., 2022). 32 π1π2b1:getwoodb1:getwoodΠ2K1K2τ1:makeplanksb2:useworkbenchτ2:makesticksb3:usetoolshedΠ1π1π2π1π3π3π1 8 Other Purposes of Modularity In addition to scaling large models (for instance, through MoEs, as discussed in § 4.2.3) and facilitating transfer learning, which we covered in § 7, modularity serves multiple additional purposes. In particular, we devote this section to a cursory view of modularity for i) hierarchical reinforcement learning (§ 8.1); ii) neural programme simulation (§ 8.2); iii) neural causal inference (§ 8.3). While most of these applications predate the advent of neural networks, (modular) deep learning expands the scope and potential of these lines of research for a series of reasons. First, it holds promise to induce the relevant latent structures (such as options, programmes, or causal graphs, respectively) in an end-to-end fashion. Second, it marries these traditional problems with the ability to jointly model low-level perception, such as vision and language. 8.1 Hierarchical Reinforcement Learning The goal of reinforcement learning is to learn a policy, which predicts the next action of an agent based on past observation(s) from the environment, that maximises the return, i.e. the sum of future discounted rewards. However, many tasks span extremely dilated temporal horizons or provide only highly sparse or delayed rewards. In these cases, it becomes helpful to model intermediate abstractions between high-level goal specifications and low-level actions and observations (Sutton et al., 1999; Precup, 2000). This facilitates the planning abilities of the agent as well as their sample efficiency. In fact, the above-mentioned intermediate abstractions, known as options or skills, consist of sub-policies that are transferable across tasks. More formally, each reinforcement learning task is a Markov Decision Process (MDP) consisting of states S and actions A, a transition function p : S × A × S → [0, 1] and a reward function r : S × A → R. We aim to learn a policy π : S × A → [0, 1]. We also define a value function as the expected (discounted) return from a given state s as Vπ(s) = Eπ[P∞ t=0 γtrt+1 | s0 = s], as well as a Q function from a state s and an action a as Qπ(s, a) = Eπ[P∞ t=0 γtrt+1 | s0 = s, a0 = a]. Following Sutton et al. (1999) and Precup (2000), each option ω ∈ Ω is defined as a tuple (Iω, πω, βω), where Iω ⊆ S is the initiation set, πω : S × Ω → [0, 1] the option-specific policy, and βω : S → [0, 1] is the termination function. For simplicity, many works assume that ∀s ∈ S, ∀ω ∈ Ω, s ∈ Iω: in other words, all options are available at every state. Augmenting a task with options transforms it into a Semi-MDP, with corresponding functions VΩ(ω) and QΩ(s, ω). Learning options involves a series of challenges (Jiang et al., 2019). Firstly, it is not trivial to specialise sub-policies towards distinct behaviours. This shortcoming is common to many modular architectures with learned routing (Mittal et al., 2022, see § 4.2). Not only this, the problem of hard learned routing has often been cast in a reinforcement learning framework (§ 4.2.2). Secondly, one must define the space where the actions of the high-level policy, which are latent variables, lie. In practice, one could treat them as a discrete, unordered set. In this case, a module from an inventory is chosen for a certain amount of time steps. However, alternative methods operate in structured spaces such as language, which is more transferable and scalable due to its combinatorial nature. Thirdly, training multiple options dilates the training time and requires collecting an appropriate amount of experiences for each of them. Fourthly, if trained jointly, options change simultaneously with the master policy, which is a source of non-stationarity. As a consequence, previous experiences for the master policy become invalid if the options have been updated in the meantime. Again, this is reminiscent of the challenges of learned routing exposed in § 4.2. The simplest solution to circumvent end-to-end joint learning of the master policy and options is to provide separate supervision to both (Sutton et al., 1999; Dayan & Hinton, 1992). However, this may require extensive annotation, which is often not available. Thus, an alternative method is defining sub-goals, i.e. states an agent should reach as a stepping stone towards the high-level goal Dietterich (2000). Nevertheless, this similarly fails to scale due to the exponentially growing number of combinations of sub-goals some tasks may entail. Moreover, this does not eschew the need to train individual sub-policies for each sub-goal. A partial remedy is offered by hindsight learning, where an off-policy correction is introduced (Nachum et al., 2018). Specifically, the original target sub-goal of the current option is substituted with the one maximising the probability of the past sequence of low-level actions. Similarly, the master policy can be trained in hindsight through the currently predicted sequence of high-level sub-goals. Overall, relabelling past experiences significantly improves the model's sample efficiency. 33 Figure 9: An example of Programme Simulation (§ 8.2): Differentiable Neural Computer (Graves et al., 2016). A recurrent neural controller iteratively receives an input from the environment, writes to / reads from memory, and produces an output. Read and write operations are based on attention between generated keys and memory entries. A special mechanism keeps track of memory usage and temporal links between entries. A more radical solution to the challenge of scalability is jointly training both the master policy and options in an end-to-end fashion. To this end, Bacon et al. (2017) put forth a new architecture, the option–critic, that discovers options from data, without supervision for the intermediate abstractions. This architecture is trained based on policy gradient theorems Bacon et al. (2017) derive for options. Moreover, they augment the set of actions A available to each policy πω with a special end-of-policy action eop instead of explicitly modelling βω. Intuitively, formulating the execution as call-and-return, a master policy πΩ determines the active option ω, whose policy πω is followed until the eop action is chosen. At this point, control returns to the master policy to choose the next option, and so on until termination. A downside of this method is that it is unstable and often diverges to degenerate solutions (Jiang et al., 2019). Thus, several inductive biases have been proposed to correct it. A popular method is leveraging intrinsic rewards: an auxiliary loss diversifies options by maximising the mutual information between each option and the next state conditioned on the current state (Florensa et al., 2017; Kulkarni et al., 2016). An orthogonal question revolves around the ideal space for the option variables. In fact, compared to a discrete, unordered inventory of (possibly hard-coded) options, language affords more flexibility (Andreas et al., 2017; Jiang et al., 2019) as it solves many of the above-mentioned challenges. In fact, all sub-policies can be implemented through a single model conditioned on the linguistic label of the current option. This not only allows options to borrow statistical strength from each other but also makes options reusable in new tasks. Moreover, the nature of language (through its infinite use of finite means) is suitable to capture the extremely complex combination of sub-goals of many reinforcement learning tasks. Note that linguistic options can be interpreted as a generalisation of sub-goals, as every instruction implicitly corresponds to a subset of states (Jiang et al., 2019). In practice, to learn linguistic options, Andreas et al. (2017) assumes that 'sketches' of options are provided for supervision (see Figure 8). To induce them, subsequent methods rely instead on synthetic experiences through relabelling (Jiang et al., 2019), or restricted vocabularies and syntax such as predicate–argument pairs (Das et al., 2018). Recently, the master policy has been frequently implemented as a large language model. Since these are pre-trained on text, they already contain world knowledge that can serve as a powerful inductive bias for grounded learning. For instance, Huang et al. (2022) use frozen language models to generate options through prompting in a zero-shot fashion. 34 aControllerbReadandwriteheadscMemorydMemoryusageandtemporallinksOutputInputWritevectorReadkeyReadmodeReadkeyReadvectorsReadmodeErasevectorWritekeyWWNWriteRead1Read2 8.2 Programme Simulation Another distinct purpose of modular architectures is to model programmes, as a means to induce them from data or to simulate symbolic algorithms. The simplest (and least expressive) family of programmes are Finite State Automata (FSA). These receive a neural implementation in the Compositional Recursive Learner (CRL; Chang et al., 2019), similarly to Routing Networks (Rosenbaum et al., 2018) and Modular Networks (Kirsch et al., 2018). In these neural architectures, a loose equivalence can be drawn as follows: transformations induced by modules are transition functions (arcs in the graph), input and output representations are the states (nodes in the graph), and the input is the starting state. A memoryless routing function selects the transition based on the current state. Thus, the programme graph is constructed dynamically. The final states are defined as those reached after the router selects a special end-of-computation action. On the other hand, a programme graph can be constructed globally based on the task description before processing the data. In particular, Neural Module Networks (NMNs; Andreas et al., 2016b;a) rely on an off-the-shelf semantic parser (and custom rules) to map a query in natural language into a tree graph. The nodes of this graph are learnable modules characterised by: 1) their types of input (raw image features and/or attention scores) and output (attention scores or labels); and 2) the particular instances of a type, indicated as an argument in the form of a natural language string. For instance, the module find[cat] takes an image and returns attention scores over the regions that contain cats. Compositionality is achieved by sharing weights across modules with the same type or instance. NMNs have been further extended to be amenable to end-to-end training without the aid of an external parser (Hu et al., 2017). In this case, the mapping from queries to programme graphs is learned by imitating expert demonstrations while the module parameters are learned based on the downstream loss of visual question answering. In addition to the routing function and computation functions, a model can be extended with an external memory. In fact, these three mirror the fundamental components of a computer architecture: elementary operations, logical flow control, and a random-access memory that can be read and written to (von Neumann, 1945; Graves et al., 2014). While (appropriately wired) recurrent neural networks have been shown to be Turing-complete (Siegelmann & Sontag, 1995), separating the three functions into distinct components provides an inductive bias to simulate the workflow or a computer programme. Neural Turing Machines (NTMs; Graves et al., 2014) introduced a fully differentiable read–write memory matrix that interfaces with the main recurrent network through an attentional mechanism. In particular, this memory can be addressed both based on content (i.e., the match between its entries and the current input) and based on location, in order to store and retrieve temporally ordered information in contiguous entries. NTMs were further extended into the Differentiable Neural Computer (DNCs; Graves et al., 2016, Figure 9), which amended some of the limitations of NMTs, such as avoiding interference in the memory, freeing up previously written locations, and storing temporally ordered sequences in non-contiguous chunks. Another family of memory-augmented methods include the Neural Programmer Interpreter (NPI; Reed & de Freitas, 2016). This model is trained with full supervision from execution traces or through reinforcement learning (Pierrot et al., 2019). In particular, a core recurrent network receives information from a programme module, as well as representations from the environment module. In its output, it produces the index for the next sub-programme and its arguments (as well as a special termination symbol). Finally, a recent thread of research focused on simulating the behaviour of symbolic algorithms with vanilla (non-modular) neural networks. An example is neural algorithmic reasoning (Veličković & Blundell, 2021). First, a processor network is trained to emulate the output of a symbolic programme (e.g., Dijkstra's algorithm for shortest paths) that operates on abstract representations (e.g., weighted graphs). Second, encoder and decoder networks can be trained to operate on sensory real-world data while matching the input–output types expected by the processor network. Among the main applications for programme simulations are settings where sub-problems are shared, such as multi-task or curriculum learning. By distilling the most common functionalities into modules, these can be reused to generalise compositionally to new sequences of sub-tasks. Another application is compositional reasoning, such as (visual) question answering (Andreas et al., 2016b;a). In general, external memory is useful for reasoning over complex data structures, such as graphs (Graves et al., 2014; 2016; Reed & de Freitas, 35 Figure 10: An example of Causal Inference (§ 8.3): Causal Independent Mechanisms (Parascandolo et al., 2018). A transformed example is routed to an expert which maps it to the original distribution. An adversarial discriminator attempts to distinguish between reconstructed and original examples. 2016). Finally, neural models can emulate symbolic algorithms to extend their capabilities to operate on sensory real-world data. 8.3 Causal Discovery and Inference Modularity in the design of a model may be assumed to reflect the modularity in the (physical) mechanisms of the world. In fact, a crucial assumption in causal inference (Schölkopf et al., 2012) is that such mechanisms underlying data generation are independent, as they do not influence each other, and reusable, as they may play a role in multiple distributions. Consequently, if one of the mechanisms, which defines a conditional distribution in the model graph, changes-possibly because of an intervention-the other modules remain invariant. If a machine learning model mirrors this modular structure, it is better suited to generalise in a sample-efficient way to new tasks: in fact, local distribution shifts require updating only the corresponding module parameters, which in turn results in faster adaptation (Bengio et al., 2020; Mittal et al., 2022). The key challenge for this problem is how to specialise each module towards a specific mechanism based uniquely on observational data, especially when the number and nature of the mechanisms are unknown. Competition among the modules through top-k routing (see § 4.2.2) is a common feature of many proposed solutions.20 Parascandolo et al. (2018) show how to invert causal independent mechanisms through a modular neural architecture, given data from the original distribution and an unlabelled mixture of their transformations (see Figure 10). Their model consists of a mixture of experts and an adversarial discriminator, which enforces that the inverted transformation lies in the support of the original distribution. Another architecture relying on module competition and capable of modelling sequential data is Recurrent Independent Mechanisms (RIMs; Goyal et al., 2021). Here, the modules are recurrent networks with separate parameters, each representing a different transition dynamics. However, their states are not entirely independent, as active modules are allowed to communicate through attention. This reflects a second assumption, namely that the dependencies among variables are highly sparse (Mittal et al., 2022). Attention can also serve to direct the flow of bottom-up and top-down information (Mittal et al., 2020). 20In addition to causal inference, this strategy is also inspired by the global workspace theory (Baars, 2005). This theory postulates specialised modules compete to update a shared workspace, and the resulting communication bottleneck creates a crucial inductive bias in human cognition. 36 TransformedexampleExperts...E1E2E3EnCanonicalMNIST0.00.1ARGMAX0.50.2DISCRIMINATOR Another challenge of neural causal discovery is jointly inducing abstract latent variables (such as objects or entities) from low-level perception (e.g., pixels of an image) while simultaneously learning the causal graph underlying such variables, which determines how they interact (Ke et al., 2021a). The lacklustre abilities of vanilla neural models to understand the compositional properties of symbolic building blocks, i.e. their 'binding problem', arguably explains their current shortfalls in systematic generalisation (Greff et al., 2020). Object-centric learning holds promise to mitigate these limitations. For instance, it can be facilitated by slot attention, which is a fully differentiable and iterative attention mechanism that interfaces between perceptual representations and slots, a set of unordered placeholder variables (Locatello et al., 2020). (Didolkar et al., 2021) propose Neural Production Systems, where rule templates can be bound to specific entities present in the working memory, in order to update their representations. In particular, rules are MLP modules and the matching with entities (triggering updates) is parameterised by attention. Crucially, observational data alone is often21 insufficient to learn structural causal models as they may not be identifiable (Pearl, 2009). Hence the necessity to augment observation with interventions and counterfactuals. These allow for answering questions about cause–effect relationships rather than mere correlations. In real-world scenarios, however, the nature and number of interventions are unknown Ke et al. (2021a). In this setting, there is no formal guarantee that causal discovery succeeds. Yet, Ke et al. (2019) finds that DAG discovery on interventional data based on continuous optimisation recovers causal graphs reliably. In particular, modular architectures surpass both vanilla models and graph neural networks (Ke et al., 2021a). Recently, Geffner et al. (2022) perform causal inference in a deep non-linear additive noise structural equation model, based on autoregressive flows. Variational inference is used to learn a posterior over causal graphs. The learned functions can be further used to estimate conditional average treatment effects based on simulations. The main purpose of these deep modular methods is causal inference and discovery, which has applications in several branches of medicine and economics (Geffner et al., 2022). In addition, these methods are particularly relevant in grounded settings, where the distribution of the observations from the environment changes as the agent learns better policies (Goyal et al., 2021). Moreover, causal discovery can be combined with model-based RL methods to learn a self-supervised model of the environment, i.e. its variables and their causal dependencies, from trajectories of observations, actions, and rewards. This allows for simulating the potential outcomes of a policy before execution and thus estimating better value functions, which dramatically improves sample efficiency in agents (Ke et al., 2021a). Another common application of this family of modular neural architectures is out-of-distribution generalisation: for instance, zero-shot transfer to images of different sizes or sequences of different lengths (Goyal et al., 2021). 21Unless specific assumptions are made about the data generating process, such as linear but non-Gaussian data. 37 9 Conclusions • Modularity is defined as the functional specialisation of the components of a system. • Specialised sub-networks may emerge in vanilla neural modules (from multitask training or regularisation), but they are seldom reused and recombined. • Deep modular architectures rest on the separation between computation functions on the one hand and routing and aggregation functions on the other. • Computation functions may consist of any neural module. Modules may modify the original parameters, be concatenated to the input, or composed with the original function. • All composition strategies are equivalent to summing the original output with a term depending on the new module. In practice, however, they offer different trade-offs between efficiency (in time and space, during training and inference) and performance. • Routing controls the flow of information, i.e., module selection. In fixed routing, it is determined a priori based on expert knowledge. When this is not available, routing parameters are learned. • Learned routing is challenging because of training instability, module collapse, and overfit- ting. Thus, learned routing often underperforms fixed routing. • Routing can be conditioned on (parts of) the input or metadata such as task identity. Routing can take place at different levels, such as globally for the whole model or layer-wise. • Soft routing assigns every module a continuous score and performs a weighted combination of their outputs. It is amenable to being learned via gradient descent but is highly inefficient. • Hard routing activates only a subset of modules via top-1, top-k, or variable-size selection. It is learned via reinforcement learning, evolutionary algorithms, or stochastic re-parameterisation. It corresponds to the principles of conditional computation and information bottleneck in cognition. • Hypernetworks can be interpreted as combining unnormalised routing (task embedding) with modules (generator). They can in turn generate parameters of other modules. • If routing selects multiple modules, these must be aggregated via a function. • Module parameters or outputs can be interpolated for aggregation, according to scores from the routing function, an attention mechanism, or via simple averaging. • Alternatively, aggregation may involve composing the module functions, either sequentially or based on a tree graph obtained from global routing. • The applications include parameter-efficient fine-tuning in NLP, computer vision, and speech processing. These rely on the same types of modules and fixed routing. In addition to increased efficiency, this prevents negative interference and enables zero-shot transfer. • Modularity also serves the purpose of generalising to new tasks systematically, by recombining modules and locally updating them. • Modular deep learning transcends the confines of private research: it enables community-driven sharing, expanding, reusing, and updating of the modules. • In hierarchical reinforcement learning, modular options serve as abstractions between task goals and low-level actions and observations. They facilitate planning in long-horizon and sparse-reward tasks and increase sample efficiency due to transferability. • In programme induction, the components of deep models can mirror a computer architecture: modules are elementary operations and routing is logical flow control. These are often augmented by an external read–write memory. Modules can also simulate symbolic algorithms. • In causal discovery and inference, modules may be taken to correspond to physical mechanisms that are independent and reusable. • Modular deep learning empowers these traditional applications by learning abstractions (options, programmes, causal graphs) end-to-end from perceptual stimuli. 38 9.1 Future Work While recently modularity has attracted increasing attention in research, there remain many interesting open research questions along the axes of modularity introduced in this survey. We provide an overview of some of these directions for future work. Combination of Different Types of Computation Functions Existing computation functions (see § 3) are mostly associated with a single category: parameter composition, input composition, or function composition. There are a few exceptions such as compacter (Mahabadi et al., 2021)-low-rank adapters- which combine multiple types. In general, techniques from parameter composition that incorporate sparsity, a low-rank or structural constraint are agnostic of the form of the module. In practice, this should enable more efficient learning and aggregation. Learned Module Structure Most modules used in current works share the same architecture, which is reused across different settings. Depending on the skill or knowledge that should be learned, a module may need to be structured differently and might require access to another component or other type of data. In the extreme, a model may require a special-purpose architecture to be able to perform a specific capability (Andreas et al., 2016b). As modules are more widely used, they may benefit from being learned in a more flexible manner, perhaps incorporating ideas from neural architecture search (Negrinho et al., 2019) in a module-specific space of architecture primitives. Standardising Modularity Evaluation Depending on the dimension studied, modular approaches may be evaluated based on a variety of factors including downstream performance, memory footprint, number of parameters, latency, and compositional generalisation. In order to make progress on modular models in general, evaluation should be standardised. Current evaluation is additionally mainly based on existing datasets that are re-purposed to enable modular evaluation such as by framing them in a zero-shot transfer setting. Future work on modularity evaluation should design forward-looking evaluation benchmarks that are designed to test the capabilities of the next generation of modular models such as assessing the composition of skills and acquisition of new types of reasoning abilities. Nature of Modular Representations While modular representations have been aggregated and com- posed, it remains mostly unclear how the inductive bias of a computation function influences the modular representation that is learned. In addition, it remains unclear how computation functions differ on a represen- tation level. Beyond the computation function, it is also unclear how the other dimensions of our taxonomy, i.e., the routing function, the aggregation function, and the training setting influence the nature of the modular representations. Hierarchical Modularity Current approaches mostly do not differentiate between high-level and low-level skills and how they relate to each other. It might also be possible to designate particular parts of the model or dedicated modules to capture a set of specialised skills or options, and clearly distinguish between other (sets of) skills. At fine-tuning, even more specialised sub-modules could be learned focused only on the previously designated modules. One example might be learning fine-grained specialised subnetworks over larger subnetworks of the original model, offering gradual module specialisation. Learned Routing for Pre-training Fixed routing (see § 4) is the most common strategy to disentangle knowledge into modular parts of the model. However, fixed routing limits the usability of the proposed methods as they cannot be used on data, which lacks the metadata needed for fixed routing; for instance, when training on heterogeneous data, metadata such as domain information often does not exist. While learned routing methods do not require this metadata to perform routing a priori, they suffer from training difficulties (as discussed in § 4.2). This opens up research directions that enable modular pre-training with learned routing, which would make modular models applicable to a broader set of data. Benchmarking Routing Methods Existing studies mainly evaluate routing methods based on perfor- mance but do not take into account how different routing strategies influence modular representations. In 39 order to make progress on better routing methods, benchmarks and metrics are necessary that compare routing mechanisms from a modularity perspective across different settings. Structured and Sparse Aggregation Current aggregation methods (see § 5) combine the information from multiple modular components by applying arithmetic operations such as addition and subtraction across all parameters, which likely includes parameters that should not be modified. Structured or sparse aggregation methods could focus on aggregating information within salient subnetworks or parameter groups, which might make aggregation more efficient and improve out-of-distribution generalisation. Learned Aggregation Methods Most aggregation methods are based on arithmetic operations. Depend- ing on the nature of the modular information, it may be useful to (non-)linearly transform the representations. More complex domain-specific aggregation methods can be learned in conjunction with the modular represen- tations to enable better generalisation to new settings. In recent work, merging models trained with different settings has led to Merging Modular Models improved performance (Wortsman et al., 2022, inter alia). Rather than requiring separate training runs of a model, a multi-task model can alternatively be trained with modular components that are designed to be merged at a later stage. This potentially allows for an architecture, which can be computationally efficiently trained while covering many modalities. Extensible Multi-task Models Most approaches in multi-task learning have focused on training dense models, with a key limitation being that models cannot easily be extended to new settings. Focusing on training multi-task models with modular components ensures that the baseline models are much easier to adapt and extend to new settings. Given the trend of pre-training larger and larger models from scratch, modularising parts of such models and developing modular methods that can be shared across different architectures and model sizes may lead to more sustainable model development. Acknowledgements Ivan Vulić is supported by a personal Royal Society University Research Fellowship (no 221137; 2022-). We are grateful to Colin Raffel for his comments and suggestions, which have greatly improved the manuscript. We thank Andrea Gesmundo for feedback on a draft of this paper. We are thankful to Kyunghyun Cho and Alessandro Sordoni for stimulating discussions. References Armen Aghajanyan, Sonal Gupta, and Luke Zettlemoyer. Intrinsic dimensionality explains the effectiveness of language model fine-tuning. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 7319–7328, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.568. URL https://aclanthology.org/2021.acl-long.568. Chanho Ahn, Eunwoo Kim, and Songhwai Oh. Deep elastic networks with model selection for multi-task learning. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pp. 6528–6537. IEEE, 2019. doi: 10.1109/ICCV.2019.00663. URL https://doi.org/10.1109/ICCV.2019.00663. Samuel K. Ainsworth, Jonathan Hayase, and Siddhartha S. Srinivasa. Git re-basin: Merging models modulo permutation symmetries. CoRR, abs/2209.04836, 2022. doi: 10.48550/arXiv.2209.04836. URL https://doi.org/10.48550/arXiv.2209.04836. Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katie Millican, Malcolm Reynolds, Roman Ring, Eliza Rutherford, Serkan Cabi, Tengda Han, Zhitao Gong, Sina Samangooei, Marianne Monteiro, Jacob Menick, Sebastian Borgeaud, Andrew 40 Brock, Aida Nematzadeh, Sahand Sharifzadeh, Mikolaj Binkowski, Ricardo Barreira, Oriol Vinyals, Andrew Zisserman, and Karen Simonyan. Flamingo: a visual language model for few-shot learning. CoRR, abs/2204.14198, 2022. doi: 10.48550/arXiv.2204.14198. URL https://doi.org/10.48550/arXiv.2204. 14198. Ferran Alet, Tomás Lozano-Pérez, and Leslie Pack Kaelbling. Modular meta-learning. In 2nd Annual Conference on Robot Learning, CoRL 2018, Zürich, Switzerland, 29-31 October 2018, Proceedings, volume 87 of Proceedings of Machine Learning Research, pp. 856–868. PMLR, 2018. URL http://proceedings.mlr. press/v87/alet18a.html. Rahaf Aljundi, Punarjay Chakravarty, and Tinne Tuytelaars. Expert gate: Lifelong learning with a network of experts. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, pp. 7120–7129. IEEE Computer Society, 2017. doi: 10.1109/CVPR.2017.753. URL https://doi.org/10.1109/CVPR.2017.753. Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Learning to compose neural networks for question answering. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 1545–1554, San Diego, California, June 2016a. Association for Computational Linguistics. doi: 10.18653/v1/N16-1181. URL https://aclanthology.org/N16-1181. Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Neural module networks. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 39–48. IEEE Computer Society, 2016b. doi: 10.1109/CVPR.2016.12. URL https: //doi.org/10.1109/CVPR.2016.12. Jacob Andreas, Dan Klein, and Sergey Levine. Modular multitask reinforcement learning with policy sketches. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, pp. 166–175. PMLR, 2017. URL http://proceedings.mlr.press/v70/andreas17a.html. Alan Ansell, Edoardo Maria Ponti, Jonas Pfeiffer, Sebastian Ruder, Goran Glavaš, Ivan Vulić, and Anna Korhonen. MAD-G: Multilingual adapter generation for efficient cross-lingual transfer. In Findings of the Association for Computational Linguistics: EMNLP 2021, pp. 4762–4781, Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.findings-emnlp.410. URL https://aclanthology.org/2021.findings-emnlp.410. Alan Ansell, Edoardo Ponti, Anna Korhonen, and Ivan Vulić. Composable sparse fine-tuning for cross-lingual transfer. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1778–1796, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.125. URL https://aclanthology.org/2022.acl-long.125. Sajid Anwar, Kyuyeon Hwang, and Wonyong Sung. Structured pruning of deep convolutional neural networks. ACM Journal on Emerging Technologies in Computing Systems (JETC), 13(3):32:1–32:18, 2017. doi: 10.1145/3005348. URL https://doi.org/10.1145/3005348. Mikel Artetxe, Shruti Bhosale, Naman Goyal, Todor Mihaylov, Myle Ott, Sam Shleifer, Xi Victoria Lin, Jingfei Du, Srinivasan Iyer, Ramakanth Pasunuru, Giridharan Anantharaman, Xian Li, Shuohui Chen, Halil Akin, Mandeep Baines, Louis Martin, Xing Zhou, Punit Singh Koura, Brian O'Horo, Jeffrey Wang, Luke Zettlemoyer, Mona Diab, Zornitsa Kozareva, and Veselin Stoyanov. Efficient large scale language modeling with mixtures of experts. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 11699–11732, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https://aclanthology.org/2022.emnlp-main.804. Akari Asai, Mohammadreza Salehi, Matthew Peters, and Hannaneh Hajishirzi. ATTEMPT: Parameter-efficient multi-task tuning via attentional mixtures of soft prompts. In Proceedings of the 2022 Conference on Empir- ical Methods in Natural Language Processing, pp. 6655–6672, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https://aclanthology.org/2022.emnlp-main.446. 41 Bernard J. Baars. Global workspace theory of consciousness: toward a cognitive neuroscience of human experience. Progress in Brain Research, 150:45–53, 2005. doi: 10.1016/S0079-6123(05)50004-9. URL https://10.1016/S0079-6123(05)50004-9. Arun Babu, Changhan Wang, Andros Tjandra, Kushal Lakhotia, Qiantong Xu, Naman Goyal, Kritika Singh, Patrick von Platen, Yatharth Saraf, Juan Pino, Alexei Baevski, Alexis Conneau, and Michael Auli. XLS-R: self-supervised cross-lingual speech representation learning at scale. In Interspeech 2022, 23rd Annual Conference of the International Speech Communication Association, Incheon, Korea, 18-22 September 2022, pp. 2278–2282. ISCA, 2022. doi: 10.21437/Interspeech.2022-143. URL https://doi.org/10.21437/ Interspeech.2022-143. Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In Satinder Singh and Shaul Markovitch (eds.), Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pp. 1726–1734. AAAI Press, 2017. URL http: //aaai.org/ocs/index.php/AAAI/AAAI17/paper/view/14858. Alexei Baevski, Yuhao Zhou, Abdelrahman Mohamed, and Michael Auli. wav2vec 2.0: A frame- In Advances in Neural Information Pro- work for self-supervised learning of speech representations. cessing 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/ 92d1e1eb1cd6f9fba3227870bb6d7f07-Abstract.html. Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1409.0473. Ye Bai, Jie Li, Wenjing Han, Hao Ni, Kaituo Xu, Zhuo Zhang, Cheng Yi, and Xiaorui Wang. Parameter- efficient conformers via sharing sparsely-gated experts for end-to-end speech recognition. In Interspeech 2022, 23rd Annual Conference of the International Speech Communication Association, Incheon, Korea, 18-22 September 2022, pp. 1676–1680. ISCA, 2022. doi: 10.21437/Interspeech.2022-709. URL https: //doi.org/10.21437/Interspeech.2022-709. Mahsa Baktashmotlagh, Mehrtash Tafazzoli Harandi, Brian C. Lovell, and Mathieu Salzmann. Unsupervised domain adaptation by domain invariant projection. In IEEE International Conference on Computer Vision, ICCV 2013, Sydney, Australia, December 1-8, 2013, pp. 769–776. IEEE Computer Society, 2013. doi: 10.1109/ICCV.2013.100. URL https://doi.org/10.1109/ICCV.2013.100. Carliss Young Baldwin and Kim B. Clark. Design rules: The power of modularity. MIT Press, 2000. URL https://doi.org/10.7551/mitpress/2366.001.0001. Dana H Ballard. Cortical connections and parallel processing: Structure and function. Behavioral and Brain Sciences, 9(1):67–90, 1986. URL https://psycnet.apa.org/doi/10.1017/S0140525X00021555. Ankur Bapna and Orhan Firat. Simple, scalable adaptation for neural machine translation. 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. 1538–1548, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1165. URL https: //aclanthology.org/D19-1165. Christos Baziotis, Mikel Artetxe, James Cross, and Shruti Bhosale. Multilingual machine translation with hyper-adapters. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 1170–1185, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https://aclanthology.org/2022.emnlp-main.77. Elad Ben Zaken, Yoav Goldberg, and Shauli Ravfogel. BitFit: Simple parameter-efficient fine-tuning for transformer-based masked language-models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 1–9, Dublin, Ireland, May 2022. Association 42 for Computational Linguistics. doi: 10.18653/v1/2022.acl-short.1. URL https://aclanthology.org/2022. acl-short.1. Emmanuel Bengio, Pierre-Luc Bacon, Joelle Pineau, and Doina Precup. Conditional computation in neural networks for faster models. CoRR, abs/1511.06297, 2015. URL http://arxiv.org/abs/1511.06297. Yoshua Bengio, Nicholas Léonard, and Aaron C. Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. CoRR, abs/1308.3432, 2013. URL http://arxiv.org/ abs/1308.3432. Yoshua Bengio, Tristan Deleu, Nasim Rahaman, Nan Rosemary Ke, Sébastien Lachapelle, Olexa Bilaniuk, Anirudh Goyal, and Christopher J. Pal. A meta-transfer objective for learning to disentangle causal mechanisms. 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=ryxWIgBFPS. Rodrigo Ferreira Berriel, Stéphane Lathuilière, Moin Nabi, Tassilo Klein, Thiago Oliveira-Santos, Nicu Sebe, and Elisa Ricci. Budget-aware adapters for multi-domain learning. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pp. 382–391, 2019. doi: 10.1109/ICCV.2019.00047. URL https://doi.org/10.1109/ICCV.2019.00047. Luca Bertinetto, João F. Henriques, Jack Valmadre, Philip H. S. Torr, and Andrea Vedaldi. Learning feed-forward one-shot learners. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 523–531, 2016. URL https://proceedings.neurips.cc/paper/2016/hash/ 839ab46820b524afda05122893c2fe8e-Abstract.html. Fadi Biadsy, Youzheng Chen, Xia Zhang, Oleg Rybakov, Andrew Rosenberg, and Pedro J. Moreno. A scalable model specialization framework for training and inference using submodels and its application to speech model personalization. In Interspeech 2022, 23rd Annual Conference of the International Speech Communication Association, Incheon, Korea, 18-22 September 2022, pp. 5125–5129. ISCA, 2022. doi: 10.21437/Interspeech.2022-10613. URL https://doi.org/10.21437/Interspeech.2022-10613. Hakan Bilen and Andrea Vedaldi. Universal representations: The missing link between faces, text, planktons, and cat breeds. CoRR, abs/1701.07275, 2017. URL http://arxiv.org/abs/1701.07275. Olivier Bodenreider. The unified medical language system (UMLS): integrating biomedical terminology. Nucleic Acids Research, 32(suppl_1):D267–D270, 2004. URL https://www.ncbi.nlm.nih.gov/pmc/articles/ PMC308795/. Grady Booch, Robert A. Maksimchuk, Michael W. Engle, Bobbi J. Young, Jim Conallen, and Kelli A. Houston. Object-oriented analysis and design with applications, third edition. ACM SIGSOFT Software Engineering Notes, 33(5), 2008. doi: 10.1145/1402521.1413138. URL https://doi.org/10.1145/1402521.1413138. Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. Domain separation networks. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 29: Annual Conference on Neural Infor- mation Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 343–351, 2016. URL https: //proceedings.neurips.cc/paper/2016/hash/45fbc6d3e05ebd93369ce542e8f2322d-Abstract.html. Felix J. S. Bragman, Ryutaro Tanno, Sébastien Ourselin, Daniel C. Alexander, and Manuel Jorge Cardoso. Stochastic filter groups for multi-task cnns: Learning specialist and generalist convolution kernels. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pp. 1385–1394. IEEE, 2019. doi: 10.1109/ICCV.2019.00147. URL https://doi.org/10.1109/ICCV.2019.00147. Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Nee- lakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, 43 Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Advances in Neural Information Processing Systems 33: Annual Conference on Neu- ral Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https: //proceedings.neurips.cc/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html. Emanuele Bugliarello, Fangyu Liu, Jonas Pfeiffer, Siva Reddy, Desmond Elliott, Edoardo Maria Ponti, and Ivan Vulić. IGLUE: A benchmark for transfer learning across modalities, tasks, and languages. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 2370–2392. PMLR, 2022. URL https://proceedings.mlr.press/v162/bugliarello22a.html. Lucas Caccia, Edoardo Ponti, Lucas Liu, Matheus Pereira, Nicolas Le Roux, and Alessandro Sordoni. Multi-head adapter routing for data-efficient fine-tuning, 2022. URL https://arxiv.org/abs/2211.03831. Han Cai, Chuang Gan, Ligeng Zhu, and Song Han. Tinytl: Reduce memory, not parameters for efficient on-device learning. In 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/81f7acabd411274fcf65ce2070ed568a-Abstract.html. Rich Caruana. Multitask learning. Machine Learning, 28(1):41–75, 1997. doi: 10.1023/A:1007379606734. URL https://doi.org/10.1023/A:1007379606734. Ignacio Cases, Clemens Rosenbaum, Matthew Riemer, Atticus Geiger, Tim Klinger, Alex Tamkin, Olivia Li, Sandhini Agarwal, Joshua D. Greene, Dan Jurafsky, Christopher Potts, and Lauri Karttunen. Recursive routing networks: Learning to compose modules 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), pp. 3631–3648, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1365. URL https://aclanthology. org/N19-1365. Stephen Casper, Shlomi Hod, Daniel Filan, Cody Wild, Andrew Critch, and Stuart Russell. Graphical clusterability and local specialization in deep neural networks. In ICLR 2022 Workshop on PAIR2Struct, 2022. URL https://openreview.net/pdf?id=HreeeJvkue9. Michael Chang, Abhishek Gupta, Sergey Levine, and Thomas L. Griffiths. Automatically composing representation transformations as a means for generalization. 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=B1ffQnRcKX. Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Zhangyang Wang, and Michael Carbin. The lottery ticket hypothesis for pre-trained BERT networks. In 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/ b6af2c9703f203a2794be03d443af2e3-Abstract.html. Tianlong Chen, Yu Cheng, Zhe Gan, Lu Yuan, Lei Zhang, and Zhangyang Wang. Chasing sparsity in vision transformers: An end-to-end exploration. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6- 14, 2021, virtual, pp. 19974–19988, 2021. URL https://proceedings.neurips.cc/paper/2021/hash/ a61f27ab2165df0e18cc9433bd7f27c5-Abstract.html. Ting Chen, Mario Lučić, Neil Houlsby, and Sylvain Gelly. On self modulation for generative adversarial networks. 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=Hkl5aoR5tm. Xilun Chen and Claire Cardie. Multinomial adversarial networks for multi-domain text classification. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational 44 Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 1226–1240, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-1111. URL https://aclanthology.org/N18-1111. Zih-Ching Chen, Chin-Lun Fu, Chih-Ying Liu, Shang-Wen (Daniel) Li, and Hung-yi Lee. Exploring efficient- tuning methods in self-supervised speech models. In IEEE Spoken Language Technology Workshop, SLT 2022, Doha, Qatar, January 9-12, 2023, pp. 1120–1127. IEEE, 2023. doi: 10.1109/SLT54892.2023.10023274. URL https://doi.org/10.1109/SLT54892.2023.10023274. Rochelle Choenni, Dan Garrette, and Ekaterina Shutova. Data-efficient cross-lingual transfer with language- specific subnetworks. CoRR, abs/2211.00106, 2022. doi: 10.48550/arXiv.2211.00106. URL https://doi. org/10.48550/arXiv.2211.00106. Alexandra Chronopoulou, Matthew Peters, and Jesse Dodge. Efficient hierarchical domain adaptation for pretrained language models. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 1336–1351, Seattle, United States, July 2022a. Association for Computational Linguistics. doi: 10.18653/v1/2022.naacl-main.96. URL https://aclanthology.org/2022.naacl-main.96. Alexandra Chronopoulou, Dario Stojanovski, and Alexander Fraser. Language-family adapters for multilingual neural machine translation. CoRR, abs/2209.15236, 2022b. doi: 10.48550/arXiv.2209.15236. URL https://doi.org/10.48550/arXiv.2209.15236. Aidan Clark, Diego de Las Casas, Aurelia Guy, Arthur Mensch, Michela Paganini, Jordan Hoffmann, Bogdan Damoc, Blake A. Hechtman, Trevor Cai, Sebastian Borgeaud, George van den Driessche, Eliza Rutherford, Tom Hennigan, Matthew J. Johnson, Albin Cassirer, Chris Jones, Elena Buchatskaya, David Budden, Laurent Sifre, Simon Osindero, Oriol Vinyals, Marc'Aurelio Ranzato, Jack W. Rae, Erich Elsen, Koray Kavukcuoglu, and Karen Simonyan. Unified scaling laws for routed language models. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 4057–4086. PMLR, 2022. URL https://proceedings.mlr.press/v162/clark22a.html. Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. Unsupervised cross- lingual representation learning at scale. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 8440–8451, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.747. URL https://aclanthology.org/2020.acl-main.747. Asa Cooper Stickland, Alexandre Berard, and Vassilina Nikoulina. Multilingual domain adaptation for NMT: Decoupling language and domain information with adapters. In Proceedings of the Sixth Conference on Machine Translation, pp. 578–598, Online, November 2021. Association for Computational Linguistics. URL https://aclanthology.org/2021.wmt-1.64. Marta R. Costa-jussà, James Cross, Onur Çelebi, Maha Elbayad, Kenneth Heafield, Kevin Heffernan, Elahe Kalbassi, Janice Lam, Daniel Licht, Jean Maillard, Anna Sun, Skyler Wang, Guillaume Wenzek, Al Youngblood, Bapi Akula, Loïc Barrault, Gabriel Mejia Gonzalez, Prangthip Hansanti, John Hoffman, Semarley Jarrett, Kaushik Ram Sadagopan, Dirk Rowe, Shannon Spruit, Chau Tran, Pierre Andrews, Necip Fazil Ayan, Shruti Bhosale, Sergey Edunov, Angela Fan, Cynthia Gao, Vedanuj Goswami, Francisco Guzmán, Philipp Koehn, Alexandre Mourachko, Christophe Ropers, Safiyyah Saleem, Holger Schwenk, and Jeff Wang. No language left behind: Scaling human-centered machine translation. CoRR, abs/2207.04672, 2022. doi: 10.48550/arXiv.2207.04672. URL https://doi.org/10.48550/arXiv.2207.04672. Michael Crawshaw. Multi-task learning with deep neural networks: A survey. CoRR, abs/2009.09796, 2020. URL https://arxiv.org/abs/2009.09796. Róbert Csordás, Sjoerd van Steenkiste, and Jürgen Schmidhuber. Are neural nets modular? inspecting functional modularity through differentiable weight masks. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=7uVcpu-gMD. 45 Abhishek Das, Georgia Gkioxari, Stefan Lee, Devi Parikh, and Dhruv Batra. Neural modular control for embodied question answering. In 2nd Annual Conference on Robot Learning, CoRL 2018, Zürich, Switzerland, 29-31 October 2018, Proceedings, volume 87 of Proceedings of Machine Learning Research, pp. 53–62. PMLR, 2018. URL http://proceedings.mlr.press/v87/das18a.html. Peter Dayan and Geoffrey E. Hinton. Feudal reinforcement learning. formation Processing Systems 5, cember 3, 1992], pp. 271–278. Morgan Kaufmann, 1992. 714-feudal-reinforcement-learning. In Advances in Neural In- [NIPS Conference, Denver, Colorado, USA, November 30 - De- URL http://papers.nips.cc/paper/ Harm de Vries, Florian Strub, Jérémie Mary, Hugo Larochelle, Olivier Pietquin, and Aaron C. Courville. Modulating early visual processing by language. In Advances in Neural Information Processing Sys- tems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 6594–6604, 2017. URL https://proceedings.neurips.cc/paper/2017/hash/ 6fab6e3aa34248ec1e34a4aeedecddc8-Abstract.html. Coline Devin, Abhishek Gupta, Trevor Darrell, Pieter Abbeel, and Sergey Levine. Learning modular neural In 2017 IEEE International Conference on network policies for multi-task and multi-robot transfer. Robotics and Automation, ICRA 2017, Singapore, Singapore, May 29 - June 3, 2017, pp. 2169–2176. IEEE, 2017. doi: 10.1109/ICRA.2017.7989250. URL https://doi.org/10.1109/ICRA.2017.7989250. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina 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), pp. 4171–4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. URL https://aclanthology.org/N19-1423. Aniket Didolkar, Anirudh Goyal, Nan Rosemary Ke, Charles Blundell, Philippe Beaudoin, Nicolas Heess, Michael Mozer, and Yoshua Bengio. Neural production systems. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 25673–25687, 2021. URL https://proceedings.neurips.cc/paper/ 2021/hash/d785bf9067f8af9e078b93cf26de2b54-Abstract.html. Thomas G. Dietterich. Hierarchical reinforcement learning with the MAXQ value function decomposition. Journal of Artificial Intelligence Research, 13:227–303, 2000. doi: 10.1613/jair.639. URL https://doi. org/10.1613/jair.639. Katharina Dobs, Julio Martinez, Alexander JE Kell, and Nancy Kanwisher. Brain-like functional specialization emerges spontaneously in deep neural networks. Science Advances, 8(11):eabl8913, 2022. URL https: //pubmed.ncbi.nlm.nih.gov/35294241/. Shachar Don-Yehiya, Elad Venezian, Colin Raffel, Noam Slonim, Yoav Katz, and Leshem Choshen. Cold fusion: Collaborative descent for distributed multitask finetuning. arXiv prerint, 2022. doi: 10.48550/ arXiv.2212.01378. URL https://doi.org/10.48550/arXiv.2212.01378. Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21-26 June 2014, volume 32 of JMLR Workshop and Conference Proceedings, pp. 647–655. JMLR.org, 2014. URL http: //proceedings.mlr.press/v32/donahue14.html. 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. An image is worth 16x16 words: Transformers for image recognition at scale. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=YicbFdNTTy. 46 Felix Draxler, Kambis Veschgini, Manfred Salmhofer, and Fred A. Hamprecht. Essentially no barriers in neural network energy landscape. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pp. 1308–1317. PMLR, 2018. URL http://proceedings.mlr.press/v80/draxler18a. html. Nan Du, Yanping Huang, Andrew M. Dai, Simon Tong, Dmitry Lepikhin, Yuanzhong Xu, Maxim Krikun, Yanqi Zhou, Adams Wei Yu, Orhan Firat, Barret Zoph, Liam Fedus, Maarten P. Bosma, Zongwei Zhou, Tao Wang, Yu Emma Wang, Kellie Webster, Marie Pellat, Kevin Robinson, Kathleen S. Meier-Hellstern, Toju Duke, Lucas Dixon, Kun Zhang, Quoc V. Le, Yonghui Wu, Zhifeng Chen, and Claire Cui. Glam: Efficient scaling of language models with mixture-of-experts. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 5547–5569. PMLR, 2022. URL https://proceedings.mlr.press/v162/du22c.html. Dheeru Dua, Shruti Bhosale, Vedanuj Goswami, James Cross, Mike Lewis, and Angela Fan. Tricks for training sparse translation models. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 3340–3345, Seattle, United States, July 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.naacl-main.244. URL https://aclanthology.org/2022.naacl-main.244. Steven Vander Eeckt and Hugo Van hamme. Using adapters to overcome catastrophic forgetting in end-to- end automatic speech recognition. CoRR, abs/203.16082, 2022. doi: 10.48550/arXiv.2203.16082. URL https://arxiv.org/abs/2203.16082. David Eigen, Marc'Aurelio Ranzato, and Ilya Sutskever. Learning factored representations in a deep mixture of experts. In 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Workshop Track Proceedings, 2014. URL http://arxiv.org/abs/1312.4314. Fahim Faisal and Antonios Anastasopoulos. Phylogeny-inspired adaptation of multilingual models to new languages. In Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing, pp. 434–452, Online only, November 2022. Association for Computational Linguistics. URL https: //aclanthology.org/2022.aacl-main.34. Angela Fan, Shruti Bhosale, Holger Schwenk, Zhiyi Ma, Ahmed El-Kishky, Siddharth Goyal, Mandeep Baines, Onur Celebi, Guillaume Wenzek, Vishrav Chaudhary, Naman Goyal, Tom Birch, Vitaliy Liptchinsky, Sergey Edunov, Michael Auli, and Armand Joulin. Beyond english-centric multilingual machine translation. Journal of Machine Learning Research, 22:107:1–107:48, 2021. URL http://jmlr.org/papers/v22/20-1307.html. Ruchao Fan and Abeer Alwan. DRAFT: A novel framework to reduce domain shifting in self-supervised learning and its application to children's ASR. In Hanseok Ko and John H. L. Hansen (eds.), Interspeech 2022, 23rd Annual Conference of the International Speech Communication Association, Incheon, Korea, 18-22 September 2022, pp. 4900–4904. ISCA, 2022. doi: 10.21437/Interspeech.2022-11128. URL https: //doi.org/10.21437/Interspeech.2022-11128. William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. CoRR, abs/2101.03961, 2021. URL https://arxiv.org/abs/2101.03961. William Fedus, Jeff Dean, and Barret Zoph. A review of sparse expert models in deep learning. CoRR, abs/2209.01667, 2022. doi: 10.48550/arXiv.2209.01667. URL https://doi.org/10.48550/arXiv.2209. 01667. Chrisantha Fernando, Dylan Banarse, Charles Blundell, Yori Zwols, David Ha, Andrei A. Rusu, Alexander Pritzel, and Daan Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. CoRR, abs/1701.08734, 2017. URL http://arxiv.org/abs/1701.08734. Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic neural networks for hierarchical reinforcement learning. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 47 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum? id=B1oK8aoxe. Jerry A. Fodor. The modularity of Mind. MIT Press, 1983. URL https://mitpress.mit.edu/9780262560252/ the-modularity-of-mind/. Negar Foroutan, Mohammadreza Banaei, Rémi Lebret, Antoine Bosselut, and Karl Aberer. Discovering language-neutral sub-networks in multilingual language models. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 7560–7575, Abu Dhabi, United Arab Emi- rates, December 2022. Association for Computational Linguistics. URL https://aclanthology.org/2022. emnlp-main.513. Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. 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=rJl-b3RcF7. 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 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pp. 3259–3269. PMLR, 2020. URL http://proceedings.mlr.press/v119/frankle20a.html. C. Daniel Freeman and Joan Bruna. Topology and geometry of half-rectified network optimization. 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= Bk0FWVcgx. Robert M. French. Catastrophic forgetting in connectionist networks. Trends in Cognitive Sciences, 3(4): 128–135, 1999. doi: https://doi.org/10.1016/S1364-6613(99)01294-2. URL https://www.sciencedirect. com/science/article/pii/S1364661399012942. Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor S. Lempitsky. Domain-adversarial training of neural networks. Journal of Machine Learning Research, 17:59:1–59:35, 2016. URL http://jmlr.org/papers/v17/15-239.html. Peng Gao, Shijie Geng, Renrui Zhang, Teli Ma, Rongyao Fang, Yongfeng Zhang, Hongsheng Li, and Yu Qiao. CLIP-Adapter: Better vision-language models with feature adapters. CoRR, abs/2110.04544, 2021a. URL https://arxiv.org/abs/2110.04544. Tianyu Gao, Adam Fisch, and Danqi Chen. Making pre-trained language models better few-shot learners. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 3816–3830, Online, August 2021b. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.295. URL https://aclanthology.org/2021.acl-long.295. layerwise fea- Yuan Gao, Jiayi Ma, Mingbo Zhao, Wei Liu, and Alan L. Yuille. NDDR-CNN: ture fusing in multi-task cnns by neural discriminative dimensionality reduction. In IEEE Con- ference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 10.1109/CVPR. 16-20, 2019, pp. 3205–3214. Computer Vision Foundation / IEEE, 2019. 2019.00332. URL http://openaccess.thecvf.com/content_CVPR_2019/html/Gao_NDDR-CNN_Layerwise_ Feature_Fusing_in_Multi-Task_CNNs_by_Neural_Discriminative_CVPR_2019_paper.html. doi: Timur Garipov, Pavel Izmailov, Dmitrii Podoprikhin, Dmitry P. Vetrov, and Andrew Gordon Wilson. Loss surfaces, mode connectivity, and fast ensembling of dnns. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp. 8803–8812, 2018. URL https://proceedings.neurips.cc/paper/2018/ hash/be3087e74e9100d4bc4c6268cdbe8456-Abstract.html. 48 Neeraj Gaur, Brian Farris, Parisa Haghani, Isabel Leal, Pedro J. Moreno, Manasa Prasad, Bhuvana Ram- abhadran, and Yun Zhu. Mixture of informed experts for multilingual speech recognition. In IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2021, Toronto, ON, Canada, June 6-11, 2021, pp. 6234–6238. IEEE, 2021. URL https://doi.org/10.1109/ICASSP39728.2021.9414379. Tomas Geffner, Javier Antoran, Adam Foster, Wenbo Gong, Chao Ma, Emre Kiciman, Amit Sharma, Angus Lamb, Martin Kukla, Nick Pawlowski, Miltiadis Allamanis, and Cheng Zhang. Deep end-to- end causal inference. In NeurIPS 2022 Workshop on Causality for Real-world Impact, 2022. URL https://openreview.net/forum?id=6DPVXzjnbDK. Andrea Gesmundo. A multi-agent framework for the asynchronous and collaborative extension of multitask ML systems. CoRR, abs/2209.14745, 2022. doi: 10.48550/arXiv.2209.14745. URL https://doi.org/10. 48550/arXiv.2209.14745. Andrea Gesmundo and Jeff Dean. An evolutionary approach to dynamic introduction of tasks in large- scale multitask learning systems. CoRR, abs/2205.12755, 2022a. doi: 10.48550/arXiv.2205.12755. URL https://doi.org/10.48550/arXiv.2205.12755. Andrea Gesmundo and Jeff Dean. munet: Evolving pretrained deep neural networks into scalable auto- tuning multitask systems. CoRR, abs/2205.10937, 2022b. doi: 10.48550/arXiv.2205.10937. URL https: //doi.org/10.48550/arXiv.2205.10937. Anirudh Goyal, Alex Lamb, Jordan Hoffmann, Shagun Sodhani, Sergey Levine, Yoshua Bengio, and Bernhard Schölkopf. Recurrent independent mechanisms. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview. net/forum?id=mLcmdlEUxy-. Alex Graves, Santiago Fernández, Faustino J. Gomez, and Jürgen Schmidhuber. Connectionist temporal classification: labelling unsegmented sequence data with recurrent neural networks. In William W. Cohen and Andrew W. Moore (eds.), Machine Learning, Proceedings of the Twenty-Third International Conference (ICML 2006), Pittsburgh, Pennsylvania, USA, June 25-29, 2006, volume 148 of ACM International Conference Proceeding Series, pp. 369–376. ACM, 2006. doi: 10.1145/1143844.1143891. URL https: //doi.org/10.1145/1143844.1143891. Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. CoRR, abs/1410.5401, 2014. URL http://arxiv.org/abs/1410.5401. Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka Grabska-Barwinska, Sergio Gomez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John P. Agapiou, Adrià Puigdomènech Badia, Karl Moritz Hermann, Yori Zwols, Georg Ostrovski, Adam Cain, Helen King, Christopher Sum- merfield, Phil Blunsom, Koray Kavukcuoglu, and Demis Hassabis. Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626):471–476, 2016. doi: 10.1038/nature20101. URL https://doi.org/10.1038/nature20101. Klaus Greff, Sjoerd van Steenkiste, and Jürgen Schmidhuber. On the binding problem in artificial neural networks. CoRR, abs/2012.05208, 2020. URL https://arxiv.org/abs/2012.05208. Thomas L Griffiths and Zoubin Ghahramani. The indian buffet process: An introduction and review. Journal of Machine Learning Research, 12(4), 2011. URL https://www.jmlr.org/papers/volume12/griffiths11a/ griffiths11a.pdf. Demi Guo, Alexander Rush, and Yoon Kim. Parameter-efficient transfer learning with diff pruning. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 4884–4896, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.378. URL https://aclanthology.org/2021.acl-long.378. 49 Jiang Guo, Darsh Shah, and Regina Barzilay. Multi-source domain adaptation with mixture of experts. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 4694–4703, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/ D18-1498. URL https://aclanthology.org/D18-1498. Shashank Gupta, Subhabrata Mukherjee, Krishan Subudhi, Eduardo Gonzalez, Damien Jose, Ahmed Hassan Awadallah, and Jianfeng Gao. Sparsely activated mixture-of-experts are robust multi-task learners. CoRR, abs/2204.07689, 2022. doi: 10.48550/arXiv.2204.07689. URL https://doi.org/10.48550/arXiv.2204. 07689. Suchin Gururangan, Mike Lewis, Ari Holtzman, Noah A. Smith, and Luke Zettlemoyer. DEMix layers: Disentangling domains for modular language modeling. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 5557–5576, Seattle, United States, July 2022. Association for Computational Linguistics. doi: 10.18653/v1/ 2022.naacl-main.407. URL https://aclanthology.org/2022.naacl-main.407. David Ha, Andrew M. Dai, and Quoc V. Le. Hypernetworks. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenRe- view.net, 2017. URL https://openreview.net/forum?id=rkpACe1lx. Karen Hambardzumyan, Hrant Khachatrian, and Jonathan May. WARP: Word-level Adversarial ReProgram- ming. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 4921– 4933, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.381. URL https://aclanthology.org/2021.acl-long.381. John B. Hampshire and Alex Waibel. The meta-pi network: Building distributed knowledge representations for robust multisource pattern recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 14(7):751–769, 1992. doi: 10.1109/34.142911. URL https://doi.org/10.1109/34.142911. Song Han, Jeff Pool, John Tran, and William J. Dally. Learning both weights and connections In Advances in Neural Information Processing Systems 28: An- for efficient neural network. nual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 1135–1143, 2015. URL https://proceedings.neurips.cc/paper/2015/hash/ ae0eb3eed39d2bcef4622b2499a05fe6-Abstract.html. Song Han, Jeff Pool, Sharan Narang, Huizi Mao, Enhao Gong, Shijian Tang, Erich Elsen, Peter Vajda, Manohar Paluri, John Tran, Bryan Catanzaro, and William J. Dally. DSD: dense-sparse-dense training for deep neural 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=HyoST_9xl. Wenjuan Han, Bo Pang, and Ying Nian Wu. Robust transfer learning with pretrained language models through adapters. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pp. 854– 861, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-short.108. URL https://aclanthology.org/2021.acl-short.108. Hussein Hazimeh, Zhe Zhao, Aakanksha Chowdhery, Maheswaran Sathiamoorthy, Yihua Chen, Rahul Mazumder, Lichan Hong, and Ed H. Chi. Dselect-k: Differentiable selection in the mixture of ex- perts with applications to multi-task learning. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6- 14, 2021, virtual, pp. 29335–29347, 2021. URL https://proceedings.neurips.cc/paper/2021/hash/ f5ac21cd0ef1b88e9848571aeb53551a-Abstract.html. Junxian He, Chunting Zhou, Xuezhe Ma, Taylor Berg-Kirkpatrick, and Graham Neubig. Towards a unified view of parameter-efficient transfer learning. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net, 2022a. URL https: //openreview.net/forum?id=0RDcd5Axok. 50 Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In Computer Vision - ECCV 2016 - 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part IV, volume 9908 of Lecture Notes in Computer Science, pp. 630–645. Springer, 2016. doi: 10.1007/978-3-319-46493-0\_38. URL https://doi.org/10.1007/978-3-319-46493-0_38. Ruidan He, Linlin Liu, Hai Ye, Qingyu Tan, Bosheng Ding, Liying Cheng, Jiawei Low, Lidong Bing, and Luo Si. On the effectiveness of adapter-based tuning for pretrained language model adaptation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 2208–2222, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.172. URL https://aclanthology.org/2021.acl-long.172. Xuehai He, Chunyuan Li, Pengchuan Zhang, Jianwei Yang, and Xin Eric Wang. Parameter-efficient fine- tuning for vision transformers. CoRR, abs/2203.16329, 2022b. doi: 10.48550/arXiv.2203.16329. URL https://doi.org/10.48550/arXiv.2203.16329. Yun He, Huaixiu Steven Zheng, Yi Tay, Jai Prakash Gupta, Yu Du, Vamsi Aribandi, Zhe Zhao, YaGuang Li, Zhao Chen, Donald Metzler, Heng-Tze Cheng, and Ed H. Chi. Hyperprompt: Prompt-based task- conditioning of transformers. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 8678–8690. PMLR, 2022c. URL https://proceedings.mlr.press/v162/he22f.html. Nicolas Heess, Gregory Wayne, Yuval Tassa, Timothy P. Lillicrap, Martin A. Riedmiller, and David Silver. Learning and transfer of modulated locomotor controllers. CoRR, abs/1610.05182, 2016. URL http: //arxiv.org/abs/1610.05182. Wenxin Hou, Han Zhu, Yidong Wang, Jindong Wang, Tao Qin, Renjun Xu, and Takahiro Shinozaki. Exploiting adapters for cross-lingual low-resource speech recognition. IEEE ACM Transactions on Audio Speech Language Processing, 30:317–329, 2022. doi: 10.1109/TASLP.2021.3138674. URL https://doi.org/ 10.1109/TASLP.2021.3138674. Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for NLP. In Proceedings 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. 2790–2799. PMLR, 2019. URL http://proceedings.mlr.press/v97/houlsby19a.html. Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 328–339, Melbourne, Australia, 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-1031. URL https://aclanthology.org/P18-1031. Cheng-Ping Hsieh, Subhankar Ghosh, and Boris Ginsburg. Adapter-based extension of multi-speaker text- to-speech model for new speakers. CoRR, abs/2211.00585, 2022. doi: 10.48550/arXiv.2211.00585. URL https://doi.org/10.48550/arXiv.2211.00585. Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net, 2022. URL https://openreview.net/forum?id=nZeVKeeFYf9. Junjie Hu, Sebastian Ruder, Aditya Siddhant, Graham Neubig, Orhan Firat, and Melvin Johnson. XTREME: A massively multilingual multi-task benchmark for evaluating cross-lingual generalisation. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, pp. 4411–4421, 2020. URL http://proceedings.mlr.press/v119/hu20b.html. Ronghang Hu, Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Kate Saenko. Learning to reason: End-to-end module networks for visual question answering. In IEEE International Conference on Computer 51 Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pp. 804–813. IEEE Computer Society, 2017. doi: 10.1109/ICCV.2017.93. URL https://doi.org/10.1109/ICCV.2017.93. Wenlong Huang, Pieter Abbeel, Deepak Pathak, and Igor Mordatch. Language models as zero-shot planners: Extracting actionable knowledge for embodied agents. In Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pp. 9118–9147. PMLR, 17–23 Jul 2022. URL https://proceedings.mlr.press/v162/huang22a.html. Dieuwke Hupkes, Verna Dankers, Mathijs Mul, and Elia Bruni. Compositionality decomposed: How do neural networks generalise? Journal of Artificial Intelligence Research, 67:757–795, 2020. doi: 10.1613/jair.1.11674. URL https://doi.org/10.1613/jair.1.11674. Gabriel Ilharco, Marco Túlio Ribeiro, Mitchell Wortsman, Suchin Gururangan, Ludwig Schmidt, Hannaneh Hajishirzi, and Ali Farhadi. Editing models with task arithmetic. CoRR, abs/2212.04089, 2022. doi: 10.48550/arXiv.2212.04089. URL https://doi.org/10.48550/arXiv.2212.04089. Robert A. Jacobs, Michael I. Jordan, and Andrew G. Barto. Task decomposition through competition in a modular connectionist architecture: The what and where vision tasks. Cognitive Science, 15(2):219–250, 1991a. doi: 10.1207/s15516709cog1502\_2. URL https://doi.org/10.1207/s15516709cog1502_2. Robert A. Jacobs, Michael I. Jordan, Steven J. Nowlan, and Geoffrey E. Hinton. Adaptive mixtures of local experts. Neural Computation, 3(1):79–87, 1991b. doi: 10.1162/neco.1991.3.1.79. URL https: //doi.org/10.1162/neco.1991.3.1.79. Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. In 5th Interna- tional Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum?id=rkE3y85ee. Adrián Javaloy and Isabel Valera. Rotograd: Gradient homogenization in multitask learning. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net, 2022. URL https://openreview.net/forum?id=T8wHz4rnuGL. Yiding Jiang, Shixiang Gu, Kevin Murphy, and Chelsea Finn. Language as an abstraction for hierarchi- cal deep reinforcement learning. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Van- couver, BC, Canada, pp. 9414–9426, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/ 0af787945872196b42c9f73ead2565c8-Abstract.html. Michael I. Jordan and Robert A. Jacobs. Hierarchical mixtures of experts and the EM algorithm. Neural Computation, 6(2):181–214, 1994. doi: 10.1162/neco.1994.6.2.181. URL https://doi.org/10.1162/neco. 1994.6.2.181. Anjuli Kannan, Arindrima Datta, Tara N. Sainath, Eugene Weinstein, Bhuvana Ramabhadran, Yonghui Wu, Ankur Bapna, Zhifeng Chen, and Seungji Lee. Large-scale multilingual speech recognition with a streaming In Proceedings of Interspeech 2019, 20th Annual Conference of the International end-to-end model. Speech Communication Association, Graz, Austria, 15-19 September 2019, pp. 2130–2134, 2019. doi: 10.21437/Interspeech.2019-2858. URL https://doi.org/10.21437/Interspeech.2019-2858. Rabeeh Karimi Mahabadi, Sebastian Ruder, Mostafa Dehghani, and James Henderson. Parameter-efficient multi-task fine-tuning for transformers via shared hypernetworks. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 565–576, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.47. URL https://aclanthology.org/2021. acl-long.47. Nadav Kashtan and Uri Alon. Spontaneous evolution of modularity and network motifs. Proceedings of the National Academy of Sciences (PNAS), 102(39):13773–13778, 2005. doi: https://doi.org/10.1073/pnas. 0503610102. URL https://doi.org/10.1073/pnas.0503610102. 52 Nan Rosemary Ke, Olexa Bilaniuk, Anirudh Goyal, Stefan Bauer, Hugo Larochelle, Chris Pal, and Yoshua Bengio. Learning neural causal models from unknown interventions. CoRR, abs/1910.01075, 2019. URL http://arxiv.org/abs/1910.01075. Nan Rosemary Ke, Aniket Didolkar, Sarthak Mittal, Anirudh Goyal, Guillaume Lajoie, Stefan System- Bauer, Danilo Jimenez Rezende, Michael Mozer, Yoshua Bengio, and Chris Pal. In Joaquin atic evaluation of causal discovery in visual model based reinforcement learning. Vanschoren and Sai-Kit Yeung (eds.), Proceedings of the Neural Information Processing Sys- tems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, December 2021, virtual, 2021a. URL https://datasets-benchmarks-proceedings.neurips.cc/paper/2021/hash/ 8f121ce07d74717e0b1f21d122e04521-Abstract-round2.html. Zixuan Ke, Hu Xu, and Bing Liu. Adapting BERT for continual learning of a sequence of aspect sen- timent classification tasks. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 4746–4755, Online, June 2021b. Association for Computational Linguistics. doi: 10.18653/v1/2021.naacl-main.378. URL https://aclanthology.org/2021.naacl-main.378. Simran Khanuja, Melvin Johnson, and Partha Talukdar. MergeDistill: Merging language models using pre-trained distillation. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pp. 2874–2887, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021. findings-acl.254. URL https://aclanthology.org/2021.findings-acl.254. Young-Bum Kim, Karl Stratos, and Dongchan Kim. Adversarial adaptation of synthetic or stale data. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1297–1307, Vancouver, Canada, July 2017. Association for Computational Linguistics. doi: 10.18653/v1/P17-1119. URL https://aclanthology.org/P17-1119. Scott Kirkpatrick, C. Daniel Gelatt Jr, and Mario P. Vecchi. Optimization by simulated annealing. Science, 220(4598):671–680, 1983. doi: https://doi.org/10.1126/science.220.4598.671. URL https://doi.org/10. 1126/science.220.4598.671. Louis Kirsch, Julius Kunze, and David Barber. Modular networks: Learning to decompose neu- ral computation. In Advances in Neural Information Processing Systems 31: Annual Confer- ence on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Mon- tréal, Canada, pp. 2414–2423, 2018. URL https://proceedings.neurips.cc/paper/2018/hash/ 310ce61c90f3a46e340ee8257bc70e93-Abstract.html. Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey E. Hinton. Similarity of neural network representations revisited. In Proceedings 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. 3519–3529. PMLR, 2019. URL http://proceedings.mlr.press/v97/kornblith19a.html. Sneha Kudugunta, Yanping Huang, Ankur Bapna, Maxim Krikun, Dmitry Lepikhin, Minh-Thang Luong, and Orhan Firat. Beyond distillation: Task-level mixture-of-experts for efficient inference. In Findings of the Association for Computational Linguistics: EMNLP 2021, pp. 3577–3599, 2021. URL https: //aclanthology.org/2021.findings-emnlp.304. Tejas D. Kulkarni, Karthik Narasimhan, Ardavan Saeedi, and Josh Tenenbaum. Hierarchical deep rein- forcement learning: Integrating temporal abstraction and intrinsic motivation. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 3675–3683, 2016. URL https://proceedings.neurips.cc/ paper/2016/hash/f442d33fa06832082290ad8544a8da27-Abstract.html. Ken'ichi Kumatani, Robert Gmyr, Felipe Cruz Salinas, Linquan Liu, Wei Zuo, Devang Patel, Eric Sun, and Yu Shi. Building a great multi-lingual teacher with sparsely-gated mixture of experts for speech recognition. CoRR, abs/2112.05820, 2021. URL https://arxiv.org/abs/2112.05820. 53 Brenden M. Lake and Marco Baroni. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pp. 2879–2888. PMLR, 2018. URL http://proceedings.mlr.press/v80/ lake18a.html. Adrian Lancucki. Fastpitch: Parallel text-to-speech with pitch prediction. In IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2021, Toronto, ON, Canada, June 6-11, 2021, pp. 6588–6592. IEEE, 2021. doi: 10.1109/ICASSP39728.2021.9413889. URL https://doi.org/10.1109/ ICASSP39728.2021.9413889. Richard D. Lange, David S. Rolnick, and Konrad P. Kording. Clustering units in neural networks: upstream vs downstream information. CoRR, abs/2203.11815, 2022. doi: 10.48550/arXiv.2203.11815. URL https: //doi.org/10.48550/arXiv.2203.11815. Anne Lauscher, Olga Majewska, Leonardo F. R. Ribeiro, Iryna Gurevych, Nikolai Rozanov, and Goran Glavaš. Common sense or world knowledge? investigating adapter-based knowledge injection into pretrained transformers. In Proceedings of Deep Learning Inside Out (DeeLIO): The First Workshop on Knowledge Extraction and Integration for Deep Learning Architectures, pp. 43–49, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.deelio-1.5. URL https://aclanthology.org/2020. deelio-1.5. Anne Lauscher, Tobias Lueken, and Goran Glavaš. Sustainable modular debiasing of language models. In Findings of the Association for Computational Linguistics: EMNLP 2021, pp. 4782–4797, Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021. findings-emnlp.411. URL https://aclanthology.org/2021.findings-emnlp.411. Hang Le, Juan Pino, Changhan Wang, Jiatao Gu, Didier Schwab, and Laurent Besacier. Lightweight adapter tuning for multilingual speech translation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pp. 817–824, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-short.103. URL https://aclanthology.org/2021.acl-short.103. Quoc Viet Le, Tamás Sarlós, and Alexander Johannes Smola. Fastfood: Approximate kernel expansions in loglinear time. CoRR, abs/1408.3060, 2014. URL http://arxiv.org/abs/1408.3060. Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=qrwe7XHTmYb. Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 3045–3059, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.243. URL https://aclanthology.org/2021.emnlp-main.243. Mike Lewis, Shruti Bhosale, Tim Dettmers, Naman Goyal, and Luke Zettlemoyer. BASE layers: Simplifying training of large, sparse models. In Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 6265–6274. PMLR, 2021. URL http://proceedings.mlr.press/v139/lewis21a.html. Belinda Li, Jane Yu, Madian Khabsa, Luke Zettlemoyer, Alon Halevy, and Jacob Andreas. Quantifying adaptability in pre-trained language models with 500 tasks. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 4696–4715, Seattle, United States, July 2022a. Association for Computational Linguistics. doi: 10.18653/v1/2022.naacl-main.346. URL https://aclanthology.org/2022.naacl-main.346. 54 Chunyuan Li, Heerad Farkhoor, Rosanne Liu, and Jason Yosinski. Measuring the intrinsic dimension of objective landscapes. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview.net/forum?id=ryup8-WCW. Junnan Li, Ramprasaath R. Selvaraju, Akhilesh Gotmare, Shafiq R. Joty, Caiming Xiong, and Steven Chu- Hong Hoi. Align before fuse: Vision and language representation learning with momentum distillation. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 9694–9705, 2021. URL https: //proceedings.neurips.cc/paper/2021/hash/505259756244493872b7709a8a01b536-Abstract.html. Margaret Li, Suchin Gururangan, Tim Dettmers, Mike Lewis, Tim Althoff, Noah A. Smith, and Luke Zettlemoyer. Branch-train-merge: Embarrassingly parallel training of expert language models. CoRR, abs/2208.03306, 2022b. doi: 10.48550/arXiv.2208.03306. URL https://doi.org/10.48550/arXiv.2208. 03306. Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 4582–4597, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.353. URL https://aclanthology.org/2021.acl-long.353. Jianze Liang, Chengqi Zhao, Mingxuan Wang, Xipeng Qiu, and Lei Li. Finding sparse structures for domain specific neural machine translation. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pp. 13333–13342. AAAI Press, 2021. URL https://ojs.aaai.org/index.php/AAAI/article/view/ 17574. Zehui Lin, Liwei Wu, Mingxuan Wang, and Lei Li. Learning language specific sub-network for multilingual machine translation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 293–305, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/ 2021.acl-long.25. URL https://aclanthology.org/2021.acl-long.25. Robert Litschko, Ivan Vulić, and Goran Glavaš. Parameter-efficient neural reranking for cross-lingual and multilingual retrieval. In Proceedings of the 29th International Conference on Computational Linguistics, pp. 1071–1082, Gyeongju, Republic of Korea, October 2022. International Committee on Computational Linguistics. URL https://aclanthology.org/2022.coling-1.90. Chen Liu, Jonas Pfeiffer, Anna Korhonen, Ivan Vulić, and Iryna Gurevych. Delving deeper into cross-lingual visual question answering. CoRR, abs/2202.07630, 2022a. URL https://arxiv.org/abs/2202.07630. Fangyu Liu, Emanuele Bugliarello, Edoardo Maria Ponti, Siva Reddy, Nigel Collier, and Desmond Elliott. Visually grounded reasoning across languages and cultures. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 10467–10485, Online and Punta Cana, Dominican Republic, November 2021a. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main. 818. URL https://aclanthology.org/2021.emnlp-main.818. Haokun Liu, Derek Tam, Mohammed Muqeeth, Jay Mohta, Tenghao Huang, Mohit Bansal, and Colin Raffel. Few-shot parameter-efficient fine-tuning is better and cheaper than in-context learning. CoRR, abs/2205.05638, 2022b. doi: 10.48550/arXiv.2205.05638. URL https://doi.org/10.48550/arXiv.2205. 05638. 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. ACM Computing Surveys, 55(9):195:1–195:35, 2023. doi: 10.1145/3560815. URL https://doi.org/10.1145/ 3560815. 55 Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. GPT understands, too. CoRR, abs/2103.10385, 2021b. URL https://arxiv.org/abs/2103.10385. Xiao Liu, Kaixuan Ji, Yicheng Fu, Weng Tam, Zhengxiao Du, Zhilin Yang, and Jie Tang. P-tuning: Prompt In Proceedings of the 60th Annual tuning can be comparable to fine-tuning across scales and tasks. Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 61–68, Dublin, Ireland, May 2022c. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-short.8. URL https://aclanthology.org/2022.acl-short.8. Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jianfeng Gao. Multi-task deep neural networks for natural language understanding. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4487–4496, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1441. URL https://aclanthology.org/P19-1441. Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, and Luke Zettlemoyer. Multilingual denoising pre-training for neural machine translation. Transactions of the Association for Computational Linguistics, 8:726–742, 2020. doi: 10.1162/tacl_a_00343. URL https://aclanthology.org/2020.tacl-1.47. Francesco Locatello, Dirk Weissenborn, Thomas Unterthiner, Aravindh Mahendran, Georg Heigold, Jakob Uszkoreit, Alexey Dosovitskiy, and Thomas Kipf. Object-centric learning with slot attention. In 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/8511df98c02ab60aea1b2356c013bc0f-Abstract.html. Qiuhao Lu, Dejing Dou, and Thien Huu Nguyen. Parameter-efficient domain knowledge integration from multiple sources for biomedical pre-trained language models. In Findings of the Association for Com- putational Linguistics: EMNLP 2021, pp. 3855–3865, Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.findings-emnlp.325. URL https://aclanthology.org/2021.findings-emnlp.325. Yao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel, and Pontus Stenetorp. Fantastically ordered prompts and where to find them: Overcoming few-shot prompt order sensitivity. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 8086–8098, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.556. URL https://aclanthology.org/2022.acl-long.556. Yongxi Lu, Abhishek Kumar, Shuangfei Zhai, Yu Cheng, Tara Javidi, and Rogério Schmidt Feris. Fully- adaptive feature sharing in multi-task networks with applications in person attribute classification. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, pp. 1131–1140. IEEE Computer Society, 2017. doi: 10.1109/CVPR.2017.126. URL https://doi.org/10.1109/CVPR.2017.126. Jiaqi Ma, Zhe Zhao, Xinyang Yi, Jilin Chen, Lichan Hong, and Ed H. Chi. Modeling task relationships in multi- task learning with multi-gate mixture-of-experts. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2018, London, UK, August 19-23, 2018, pp. 1930–1939. ACM, 2018. doi: 10.1145/3219819.3220007. URL https://doi.org/10.1145/3219819.3220007. Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. 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=S1jE5L5gl. Rabeeh Karimi Mahabadi, James Henderson, and Sebastian Ruder. Compacter: Efficient low- rank hypercomplex adapter layers. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6- 14, 2021, virtual, pp. 1022–1035, 2021. URL https://proceedings.neurips.cc/paper/2021/hash/ 081be9fdff07f3bc808f935906ef70c0-Abstract.html. 56 Adyasha Maharana, Darryl Hannan, and Mohit Bansal. Storydall-e: Adapting pretrained text-to-image transformers for story continuation. In Computer Vision - ECCV 2022 - 17th European Conference, Tel Aviv, Israel, October 23-27, 2022, Proceedings, Part XXXVII, volume 13697 of Lecture Notes in Computer Science, pp. 70–87. Springer, 2022. doi: 10.1007/978-3-031-19836-6\_5. URL https://doi.org/10.1007/ 978-3-031-19836-6_5. Olga Majewska, Ivan Vulić, Goran Glavaš, Edoardo Maria Ponti, and Anna Korhonen. Verb knowledge injection for multilingual event processing. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 6952–6969, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.541. URL https://aclanthology.org/2021.acl-long.541. Arun Mallya and Svetlana Lazebnik. Packnet: Adding multiple tasks to a single network by iterative pruning. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pp. 7765–7773. Computer Vision Foundation / IEEE Computer Society, 2018. doi: 10.1109/CVPR.2018.00810. URL http://openaccess.thecvf.com/content_cvpr_2018/html/Mallya_ PackNet_Adding_Multiple_CVPR_2018_paper.html. Arun Mallya, Dillon Davis, and Svetlana Lazebnik. Piggyback: Adapting a single network to multiple tasks by learning to mask weights. In Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part IV, volume 11208 of Lecture Notes in Computer Science, pp. 72–88. Springer, 2018. doi: 10.1007/978-3-030-01225-0\_5. URL https://doi.org/10.1007/ 978-3-030-01225-0_5. Michael Matena and Colin Raffel. Merging models with fisher-weighted averaging. CoRR, abs/2111.09832, 2021. URL https://arxiv.org/abs/2111.09832. Michael McCloskey and Neal J. Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of Learning and Motivation, volume 24, pp. 109–165. Elsevier, 1989. doi: https://doi.org/10.1016/S0079-7421(08)60536-8. URL https://doi.org/10.1016/S0079-7421(08) 60536-8. Rahul Mehta. Sparse transfer learning via winning lottery tickets. CoRR, abs/1905.07785, 2019. URL http://arxiv.org/abs/1905.07785. Elliot Meyerson and Risto Miikkulainen. Beyond Shared Hierarchies: Deep Multitask Learning through Soft Layer Ordering. In Proceedings of ICLR 2018, 2018. Richard Meyes, Constantin Waubert de Puiseau, Andres Posada-Moreno, and Tobias Meisen. Under the hood of neural networks: Characterizing learned representations by functional neuron populations and network ablations. CoRR, abs/2004.01254, 2020. URL https://arxiv.org/abs/2004.01254. Paul Michel, Omer Levy, and Graham Neubig. Are sixteen heads really better than one? In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 14014–14024, 2019. URL https: //proceedings.neurips.cc/paper/2019/hash/2c601ad9d2ff9bc8b282670cdd54f69f-Abstract.html. Tomás Mikolov, Ilya Sutskever, Kai Chen, Gregory S. Corrado, and Jeffrey Dean. Distributed representations of words and phrases and their compositionality. In Advances in Neural Information Processing Systems 26: 27th Annual Conference on Neural Information Processing Systems 2013. Proceedings of a meeting held December 5-8, 2013, Lake Tahoe, Nevada, United States, pp. 3111–3119, 2013. URL https://proceedings. neurips.cc/paper/2013/hash/9aa42b31882ec039965f3c4923ce901b-Abstract.html. Swaroop Mishra, Daniel Khashabi, Chitta Baral, and Hannaneh Hajishirzi. Cross-task generalization via natural language crowdsourcing instructions. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3470–3487, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.244. URL https: //aclanthology.org/2022.acl-long.244. 57 Ishan Misra, Abhinav Shrivastava, Abhinav Gupta, and Martial Hebert. Cross-stitch networks for multi-task learning. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 3994–4003. IEEE Computer Society, 2016. doi: 10.1109/CVPR.2016.433. URL https://doi.org/10.1109/CVPR.2016.433. Sarthak Mittal, Alex Lamb, Anirudh Goyal, Vikram Voleti, Murray Shanahan, Guillaume Lajoie, Michael Mozer, and Yoshua Bengio. Learning to combine top-down and bottom-up signals in recurrent neural networks with attention over modules. In Hal Daumé III and Aarti Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 6972–6986. PMLR, 13–18 Jul 2020. URL https://proceedings.mlr.press/v119/mittal20a.html. Sarthak Mittal, Yoshua Bengio, and Guillaume Lajoie. CoRR, abs/2206.02713, 2022. doi: 10.48550/arXiv.2206.02713. URL https://doi.org/10.48550/arXiv.2206. 02713. Is a modular architecture enough? Pavlo Molchanov, Stephen Tyree, Tero Karras, Timo Aila, and Jan Kautz. Pruning convolutional neural networks for resource efficient inference. 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=SJGCiw5gl. Nobuyuki Morioka, Heiga Zen, Nanxin Chen, Yu Zhang, and Yifan Ding. Residual adapters for few-shot text-to-speech speaker adaptation. CoRR, abs/2210.15868, 2022. URL https://doi.org/10.48550/arXiv. 2210.15868. Mohammed Muqeeth, Haokun Liu, and Colin Raffel. Models with Conditional Computation Learn Suboptimal Solutions. arXiv preprint, 2022. URL https://colinraffel.com/publications/icbinb2022models.pdf. Ofir Nachum, Shixiang Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical rein- forcement learning. In Advances in Neural Information Processing Systems 31: Annual Con- ference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp. 3307–3317, 2018. URL https://proceedings.neurips.cc/paper/2018/hash/ e6384711491713d29bc63fc5eeb5ba4f-Abstract.html. Vaishnavh Nagarajan and J. Zico Kolter. Uniform convergence may be unable to explain generaliza- tion in deep learning. In Advances in Neural Information Processing Systems 32: Annual Confer- ence on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancou- ver, BC, Canada, pp. 11611–11622, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/ 05e97c207235d63ceb1db43c60db7bbb-Abstract.html. Nihal V Nayak, Peilin Yu, and Stephen H Bach. Learning to compose soft prompts for compositional zero-shot learning. arXiv preprint arXiv:2204.03574, 2022. URL https://arxiv.org/pdf/2204.03574.pdf. Renato Negrinho, Matthew Gormley, Geoffrey J Gordon, Darshan Patil, Nghia Le, and Daniel Ferreira. Towards modular and programmable architecture search. Advances in neural information processing systems, 32, 2019. Alejandro Newell, Lu Jiang, Chong Wang, Li-Jia Li, and Jia Deng. Feature partitioning for efficient multi-task architectures. CoRR, abs/1908.04339, 2019. URL http://arxiv.org/abs/1908.04339. Behnam Neyshabur, Hanie Sedghi, and Chiyuan Zhang. What is being transferred in transfer learning? In 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/0607f4c705595b911a4f3e7a127b44e0-Abstract.html. Oleksiy Ostapenko, Pau Rodríguez, Massimo Caccia, and Laurent Charlin. learning via local module composition. In Advances in Neural Information Processing Systems 34: An- nual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 30298–30312, 2021. URL https://proceedings.neurips.cc/paper/2021/hash/ fe5e7cb609bdbe6d62449d61849c38b0-Abstract.html. Continual 58 Junting Pan, Ziyi Lin, Xiatian Zhu, Jing Shao, and Hongsheng Li. ST-Adapter: Parameter-efficient image-to-video transfer learning for action recognition. CoRR, abs/2206.13559, 2022. URL https: //doi.org/10.48550/arXiv.2206.13559. Pinelopi Papalampidi and Mirella Lapata. Hierarchical3d adapters for long video-to-text summarization. CoRR, abs/2210.04829, 2022. doi: 10.48550/arXiv.2210.04829. URL https://doi.org/10.48550/arXiv. 2210.04829. Giambattista Parascandolo, Niki Kilbertus, Mateo Rojas-Carulla, and Bernhard Schölkopf. Learning indepen- dent causal mechanisms. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learn- ing Research, pp. 4033–4041. PMLR, 2018. URL http://proceedings.mlr.press/v80/parascandolo18a. html. Marinela Parović, Goran Glavaš, Ivan Vulić, and Anna Korhonen. BAD-X: Bilingual adapters improve zero-shot cross-lingual transfer. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 1791–1799, Seattle, United States, July 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.naacl-main.130. URL https://aclanthology.org/2022.naacl-main.130. Judea Pearl. Causality. Cambridge University Press, 2009. URL https://www.cambridge.org/core/books/ causality/B0046844FAE10CBF274D4ACBDAEB5F5B. Ethan Perez, Florian Strub, Harm de Vries, Vincent Dumoulin, and Aaron C. Courville. Film: Visual reasoning with a general conditioning layer. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), the 30th Innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pp. 3942–3951. AAAI Press, 2018. URL https://www.aaai.org/ocs/ index.php/AAAI/AAAI18/paper/view/16528. Jonas Pfeiffer, Andreas Rücklé, Clifton Poth, Aishwarya Kamath, Ivan Vulić, Sebastian Ruder, Kyunghyun Cho, and Iryna Gurevych. AdapterHub: A framework for adapting transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 46–54, Online, October 2020a. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-demos.7. URL https://www.aclweb.org/anthology/2020.emnlp-demos.7. Jonas Pfeiffer, Ivan Vulić, Iryna Gurevych, and Sebastian Ruder. MAD-X: An Adapter-Based Framework for Multi-Task Cross-Lingual Transfer. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 7654–7673, Online, November 2020b. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.617. URL https://aclanthology.org/2020.emnlp-main. 617. Jonas Pfeiffer, Aishwarya Kamath, Andreas Rücklé, Kyunghyun Cho, and Iryna Gurevych. AdapterFusion: Non-destructive task composition for transfer learning. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pp. 487–503, Online, April 2021a. Association for Computational Linguistics. doi: 10.18653/v1/2021.eacl-main.39. URL https://aclanthology.org/2021.eacl-main.39. Jonas Pfeiffer, Ivan Vulić, Iryna Gurevych, and Sebastian Ruder. UNKs everywhere: Adapting multilingual language models to new scripts. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 10186–10203, Online and Punta Cana, Dominican Republic, November 2021b. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.800. URL https:// aclanthology.org/2021.emnlp-main.800. Jonas Pfeiffer, Gregor Geigle, Aishwarya Kamath, Jan-Martin Steitz, Stefan Roth, Ivan Vulić, and Iryna Gurevych. xGQA: Cross-lingual visual question answering. In Findings of the Association for Computational Linguistics: ACL 2022, pp. 2497–2511, Dublin, Ireland, May 2022a. Association for Computational Linguistics. doi: 10.18653/v1/2022.findings-acl.196. URL https://aclanthology.org/2022.findings-acl. 196. 59 Jonas Pfeiffer, Naman Goyal, Xi Lin, Xian Li, James Cross, Sebastian Riedel, and Mikel Artetxe. Lifting the curse of multilinguality by pre-training modular transformers. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 3479–3495, Seattle, United States, July 2022b. Association for Computational Linguistics. doi: 10.18653/v1/2022.naacl-main.255. URL https://aclanthology.org/2022.naacl-main.255. MinhQuang Pham, Josep Maria Crego, and François Yvon. Revisiting multi-domain machine translation. Transactions of the Association for Computational Linguistics, 9:17–35, 2021. doi: 10.1162/tacl_a_00351. URL https://aclanthology.org/2021.tacl-1.2. Jerin Philip, Alexandre Berard, Matthias Gallé, and Laurent Besacier. Monolingual adapters for zero-shot neural machine translation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 4465–4470, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.361. URL https://aclanthology.org/2020.emnlp-main.361. Thomas Pierrot, Guillaume Ligner, Scott E. Reed, Olivier Sigaud, Nicolas Perrin, Alexandre Laterre, David Kas, Karim Beguir, and Nando de Freitas. Learning compositional neural programs with re- cursive tree search and planning. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Van- couver, BC, Canada, pp. 14646–14656, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/ 95b431e51fc53692913da5263c214162-Abstract.html. Jonathan Pilault, Amine Elhattami, and Christopher J. Pal. Conditionally adaptive multi-task learning: Improving transfer learning in NLP using fewer parameters & less data. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=de11dbHzAMF. Emmanouil Antonios Platanios, Mrinmaya Sachan, Graham Neubig, and Tom Mitchell. Contextual parameter generation for universal neural machine translation. In Proceedings of the 2018 Confer- ence on Empirical Methods in Natural Language Processing, pp. 425–435, Brussels, Belgium, October- November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1039. URL https: //aclanthology.org/D18-1039. Edoardo M. Ponti. Inductive Bias and Modular Design for Sample-Efficient Neural Language Learning. PhD thesis, University of Cambridge, 2021. URL https://doi.org/10.17863/CAM.66424. Edoardo M. Ponti, Ivan Vulić, Ryan Cotterell, Marinela Parovic, Roi Reichart, and Anna Korhonen. Parameter space factorization for zero-shot learning across tasks and languages. Transactions of the Association for Computational Linguistics, 9:410–428, 2021. doi: 10.1162/tacl_a_00374. URL https: //aclanthology.org/2021.tacl-1.25. Edoardo M. Ponti, Alessandro Sordoni, and Siva Reddy. Combining modular skills in multitask learning. CoRR, abs/2202.13914, 2022. URL https://arxiv.org/abs/2202.13914. Edoardo Maria Ponti, Goran Glavaš, Olga Majewska, Qianchu Liu, Ivan Vulić, and Anna Korhonen. XCOPA: A multilingual dataset for causal commonsense reasoning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 2362–2376, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.185. URL https: //aclanthology.org/2020.emnlp-main.185. Sai Prasanna, Anna Rogers, and Anna Rumshisky. When BERT Plays the Lottery, All Tickets Are Winning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 3208–3229, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.259. URL https://aclanthology.org/2020.emnlp-main.259. Doina Precup. Temporal Abstraction in Reinforcement Learning. PhD thesis, University of Massachusetts Amherst, 2000. URL https://scholarworks.umass.edu/dissertations/AAI9978540. 60 Nasim Rahaman, Muhammad Waleed Gondal, Shruti Joshi, Peter V. Gehler, Yoshua Bengio, Francesco Locatello, and Bernhard Schölkopf. Dynamic inference with neural interpreters. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 10985–10998, 2021. URL https://proceedings.neurips. cc/paper/2021/hash/5b4e9aa703d0bfa11041debaa2d1b633-Abstract.html. Samyam Rajbhandari, Conglong Li, Zhewei Yao, Minjia Zhang, Reza Yazdani Aminabadi, Ammar Ahmad Awan, Jeff Rasley, and Yuxiong He. Deepspeed-moe: Advancing mixture-of-experts inference and training to power next-generation AI scale. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 18332–18346. PMLR, 2022. URL https://proceedings.mlr.press/v162/rajbhandari22a.html. Janarthanan Rajendran, Aravind S. Lakshminarayanan, Mitesh M. Khapra, P. Prasanna, and Balaraman Ravindran. Attend, adapt and transfer: Attentive deep architecture for adaptive transfer from multiple sources in the same domain. 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=Sy6iJDqlx. Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Informa- tion Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 506–516, 2017. URL https: //proceedings.neurips.cc/paper/2017/hash/e7b24b112a44fdd9ee93bdf998c6ca0e-Abstract.html. Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Efficient parametrization of multi-domain deep neural networks. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pp. 8119–8127. Computer Vision Foundation / IEEE Computer Society, 2018. doi: 10.1109/CVPR.2018.00847. URL http://openaccess.thecvf.com/content_cvpr_2018/ html/Rebuffi_Efficient_Parametrization_of_CVPR_2018_paper.html. Scott E. Reed and Nando de Freitas. Neural programmer-interpreters. In 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016. URL http://arxiv.org/abs/1511.06279. Scott E. Reed, Konrad Zolna, Emilio Parisotto, Sergio Gomez Colmenarejo, Alexander Novikov, Gabriel Barth-Maron, Mai Gimenez, Yury Sulsky, Jackie Kay, Jost Tobias Springenberg, Tom Eccles, Jake Bruce, Ali Razavi, Ashley Edwards, Nicolas Heess, Yutian Chen, Raia Hadsell, Oriol Vinyals, Mahyar Bordbar, and Nando de Freitas. A generalist agent. CoRR, abs/2205.06175, 2022. doi: 10.48550/arXiv.2205.06175. URL https://doi.org/10.48550/arXiv.2205.06175. Carlos Riquelme, Joan Puigcerver, Basil Mustafa, Maxim Neumann, Rodolphe Jenatton, André Susano Pinto, Daniel Keysers, and Neil Houlsby. Scaling vision with sparse mixture of experts. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 8583–8595, 2021. URL https://proceedings.neurips. cc/paper/2021/hash/48237d9f2dea8c74c2a72126cf63d933-Abstract.html. Stephen Roller, Sainbayar Sukhbaatar, Arthur Szlam, and Jason Weston. Hash layers for large sparse models. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 17555–17566, 2021. URL https: //proceedings.neurips.cc/paper/2021/hash/92bf5e6240737e0326ea59846a83e076-Abstract.html. Clemens Rosenbaum, Tim Klinger, and Matthew Riemer. Routing networks: Adaptive selection of non-linear functions for multi-task learning. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview.net/forum?id=ry8dvM-R-. Clemens Rosenbaum, Ignacio Cases, Matthew Riemer, and Tim Klinger. Routing networks and the challenges of modular and compositional computation. CoRR, abs/1904.12774, 2019. URL http://arxiv.org/abs/ 1904.12774. 61 Andreas Rücklé, Gregor Geigle, Max Glockner, Tilman Beck, Jonas Pfeiffer, Nils Reimers, and Iryna Gurevych. AdapterDrop: On the efficiency of adapters in transformers. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 7930–7946, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main. 626. URL https://aclanthology.org/2021.emnlp-main.626. Sebastian Ruder. An overview of multi-task learning in deep neural networks. CoRR, abs/1706.05098, 2017. URL http://arxiv.org/abs/1706.05098. Sebastian Ruder, Joachim Bingel, Isabelle Augenstein, and Anders Søgaard. Latent multi-task architecture learning. In Proceedings of the AAAI Conference on Artificial Intelligence, pp. 4822–4829, 2019a. URL https://ojs.aaai.org/index.php/AAAI/article/view/4410/4288. Sebastian Ruder, Matthew E. Peters, Swabha Swayamdipta, and Thomas Wolf. Transfer learning in natural language processing. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Tutorials, pp. 15–18, Minneapolis, Minnesota, June 2019b. Association for Computational Linguistics. doi: 10.18653/v1/N19-5004. URL https://aclanthology.org/N19-5004. Sebastian Ruder, Noah Constant, Jan Botha, Aditya Siddhant, Orhan Firat, Jinlan Fu, Pengfei Liu, Junjie Hu, Dan Garrette, Graham Neubig, and Melvin Johnson. XTREME-R: Towards more challenging and nuanced multilingual evaluation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 10215–10245, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.802. URL https: //aclanthology.org/2021.emnlp-main.802. Andrei A. Rusu, Neil C. Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. CoRR, abs/1606.04671, 2016. URL http://arxiv.org/abs/1606.04671. Victor Sanh, Thomas Wolf, and Sebastian Ruder. A hierarchical multi-task approach for learning embeddings from semantic tasks. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019, pp. 6949–6956. AAAI Press, 2019. doi: 10.1609/aaai.v33i01.33016949. URL https://doi.org/10.1609/aaai.v33i01.33016949. Victor Sanh, Thomas Wolf, and Alexander M. Rush. Movement pruning: Adaptive sparsity by fine-tuning. In 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/eae15aabaa768ae4a5993a8a4f4fa6e4-Abstract.html. Victor Sanh, Albert Webson, Colin Raffel, Stephen H. Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Teven Le Scao, Arun Raja, Manan Dey, M. Saiful Bari, Canwen Xu, Urmish Thakker, Shanya Sharma, Eliza Szczechla, Taewoon Kim, Gunjan Chhablani, Nihal V. Nayak, Debajyoti Datta, Jonathan Chang, Mike Tian-Jian Jiang, Han Wang, Matteo Manica, Sheng Shen, Zheng Xin Yong, Harshit Pandey, Rachel Bawden, Thomas Wang, Trishala Neeraj, Jos Rozen, Abheesht Sharma, Andrea Santilli, Thibault Févry, Jason Alan Fries, Ryan Teehan, Stella Biderman, Leo Gao, Tali Bers, Thomas Wolf, and Alexander M. Rush. Multitask prompted training enables zero-shot task generalization. In The Tenth International Conference on Learning Representations, 2022. URL https://arxiv.org/pdf/2110. 08207.pdf. Kanthashree Mysore Sathyendra, Thejaswi Muniyappa, Feng-Ju Chang, Jing Liu, Jinru Su, Grant P. Strimel, Athanasios Mouchtaris, and Siegfried Kunzmann. Contextual adapters for personalized speech recognition in neural transducers. In IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2022, Virtual and Singapore, 23-27 May 2022, pp. 8537–8541, 2022. URL https: //doi.org/10.1109/ICASSP43922.2022.9746126. 62 Danielle Saunders. Domain adaptation and multi-domain adaptation for neural machine translation: A survey. Journal of Artificial Intelligence Research, 75:351–424, 2022. doi: 10.1613/jair.1.13566. URL https://doi.org/10.1613/jair.1.13566. Timo Schick and Hinrich Schütze. Exploiting cloze-questions for few-shot text classification and natural language inference. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pp. 255–269, Online, April 2021a. Association for Computational Linguistics. doi: 10.18653/v1/2021.eacl-main.20. URL https://aclanthology.org/2021.eacl-main.20. Timo Schick and Hinrich Schütze. It's not just size that matters: Small language models are also few-shot learners. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 2339–2352, Online, June 2021b. Association for Computational Linguistics. doi: 10.18653/v1/2021.naacl-main.185. URL https://aclanthology.org/ 2021.naacl-main.185. Timo Schick, Sahana Udupa, and Hinrich Schütze. Self-diagnosis and self-debiasing: A proposal for reducing corpus-based bias in NLP. Trans. Assoc. Comput. Linguistics, 9:1408–1424, 2021. doi: 10.1162/tacl\_a\ _00434. URL https://doi.org/10.1162/tacl_a_00434. Bernhard Schölkopf, Dominik Janzing, Jonas Peters, Eleni Sgouritsa, Kun Zhang, and Joris M. Mooij. On causal and anticausal learning. In Proceedings of the 29th International Conference on Machine Learning, ICML 2012, Edinburgh, Scotland, UK, June 26 - July 1, 2012. icml.cc / Omnipress, 2012. URL http://icml.cc/2012/papers/625.pdf. Bernhard Schölkopf, Francesco Locatello, Stefan Bauer, Nan Rosemary Ke, Nal Kalchbrenner, Anirudh Goyal, and Yoshua Bengio. Toward causal representation learning. Proceedings of the IEEE, 109(5):612–634, 2021. doi: 10.1109/JPROC.2021.3058954. URL https://doi.org/10.1109/JPROC.2021.3058954. Karin Kipper Schuler. VerbNet: A broad-coverage, comprehensive verb lexicon. PhD thesis, University of Pennsylvania, 2005. URL https://repository.upenn.edu/dissertations/AAI3179808. Roy Schwartz, Jesse Dodge, Noah A. Smith, and Oren Etzioni. Green AI. Communications of the ACM, 63 (12):54–63, 2020. URL https://doi.org/10.1145/3381831. Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc V. Le, Geoffrey E. Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. 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=B1ckMDqlg. Hava T. Siegelmann and Eduardo D. Sontag. On the computational power of neural nets. Journal of Computer and System Sciences, 50(1):132–150, 1995. doi: 10.1006/jcss.1995.1013. URL https://doi.org/ 10.1006/jcss.1995.1013. Anders Søgaard and Yoav Goldberg. Deep multi-task learning with low level tasks supervised at lower layers. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 231–235, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-2038. URL https://aclanthology.org/P16-2038. Robyn Speer, Joshua Chin, and Catherine Havasi. Conceptnet 5.5: An open multilingual graph of general knowledge. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pp. 4444–4451, 2017. URL http://aaai.org/ocs/index.php/AAAI/ AAAI17/paper/view/14972. Karolina Stanczak, Edoardo Ponti, Lucas Torroba Hennigen, Ryan Cotterell, and Isabelle Augenstein. Same neurons, different languages: Probing morphosyntax in multilingual pre-trained models. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 1589–1598, Seattle, United States, July 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.naacl-main.114. URL https://aclanthology.org/2022.naacl-main. 114. 63 Asa Cooper Stickland and Iain Murray. BERT and PALs: Projected attention layers for efficient adaptation in multi-task learning. In Proceedings 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. 5986–5995. PMLR, 2019. URL http://proceedings.mlr.press/v97/stickland19a.html. Asa Cooper Stickland, Alexandre Berard, and Vassilina Nikoulina. Multilingual domain adaptation for NMT: decoupling language and domain information with adapters. In Loïc Barrault, Ondrej Bojar, Fethi Bougares, Rajen Chatterjee, Marta R. Costa-jussà, Christian Federmann, Mark Fishel, Alexander Fraser, Markus Freitag, Yvette Graham, Roman Grundkiewicz, Paco Guzman, Barry Haddow, Matthias Huck, Antonio Jimeno-Yepes, Philipp Koehn, Tom Kocmi, André Martins, Makoto Morishita, and Christof Monz (eds.), Proceedings of the Sixth Conference on Machine Translation, WMT@EMNLP 2021, Online Event, November 10-11, 2021, pp. 578–598. Association for Computational Linguistics, 2021. URL https://aclanthology.org/2021.wmt-1.64. Gjorgji Strezoski, Nanne van Noord, and Marcel Worring. Many task learning with task routing. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pp. 1375–1384. IEEE, 2019. doi: 10.1109/ICCV.2019.00146. URL https://doi.org/10.1109/ICCV.2019.00146. Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in NLP. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 3645– 3650, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1355. URL https://aclanthology.org/P19-1355. Tianxiang Sun, Yunfan Shao, Xiaonan Li, Pengfei Liu, Hang Yan, Xipeng Qiu, and Xuanjing Huang. Learning sparse sharing architectures for multiple tasks. 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, pp. 8936–8943. AAAI Press, 2020a. URL https://ojs.aaai.org/index.php/AAAI/article/view/6424. Tianxiang Sun, Zhengfu He, Hong Qian, Xuanjing Huang, and Xipeng Qiu. BBTv2: pure black-box optimization can be comparable to gradient descent for few-shot learning. CoRR, abs/2205.11200, 2022. URL https://doi.org/10.48550/arXiv.2205.11200. Ximeng Sun, Rameswar Panda, Rogério Feris, and Kate Saenko. AdaShare: Learning what to share for efficient deep multi-task learning. In Advances in Neural Information Processing Sys- tems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020b. URL https://proceedings.neurips.cc/paper/2020/hash/ 634841a6831464b64c072c8510c7f35c-Abstract.html. Yi-Lin Sung, Varun Nair, and Colin Raffel. Training neural networks with fixed sparse masks. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 24193–24205, 2021. URL https://proceedings. neurips.cc/paper/2021/hash/cb2653f548f8709598e8b5156738cc51-Abstract.html. Yi-Lin Sung, Jaemin Cho, and Mohit Bansal. VL-ADAPTER: parameter-efficient transfer learning for vision- and-language tasks. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2022, New Orleans, LA, USA, June 18-24, 2022, pp. 5217–5227. IEEE, 2022. doi: 10.1109/CVPR52688.2022.00516. URL https://doi.org/10.1109/CVPR52688.2022.00516. Richard S. Sutton. Two problems with back propagation and other steepest descent learning procedures for networks. In Proceedings of the Eighth Annual Conference of the Cognitive Science Society, 1986, pp. 823–832, 1986. URL https://cir.nii.ac.jp/crid/1572824499995923584. Richard S. Sutton, Doina Precup, and Satinder Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial Intelligence, 112(1-2):181–211, 1999. doi: 10.1016/S0004-3702(99)00052-1. URL https://doi.org/10.1016/S0004-3702(99)00052-1. 64 Pawel Swietojanski, Jinyu Li, and Steve Renals. Learning hidden unit contributions for unsupervised acoustic model adaptation. IEEE ACM Transactions on Audio, Speech, and Language Processing, 24(8):1450–1463, 2016. doi: 10.1109/TASLP.2016.2560534. URL https://doi.org/10.1109/TASLP.2016.2560534. Bethan Thomas, Samuel Kessler, and Salah Karout. Efficient adapter transfer of self-supervised speech models for automatic speech recognition. In IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2022, Virtual and Singapore, 23-27 May 2022, pp. 7102–7106. IEEE, 2022. URL https://doi.org/10.1109/ICASSP43922.2022.9746223. Brian Thompson, Huda Khayrallah, Antonios Anastasopoulos, Arya D. McCarthy, Kevin Duh, Rebecca Marvin, Paul McNamee, Jeremy Gwinnup, Tim Anderson, and Philipp Koehn. Freezing subnetworks to analyze domain adaptation in neural machine translation. In Proceedings of the Third Conference on Machine Translation: Research Papers, pp. 124–132, Brussels, Belgium, October 2018. Association for Computational Linguistics. doi: 10.18653/v1/W18-6313. URL https://aclanthology.org/W18-6313. Katrin Tomanek, Vicky Zayats, Dirk Padfield, Kara Vaillancourt, and Fadi Biadsy. Residual adapters for parameter-efficient ASR adaptation to atypical and accented speech. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 6751–6760, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. URL https: //aclanthology.org/2021.emnlp-main.541. Karl Ulrich. The role of product architecture in the manufacturing firm. Research Policy, 24(3):419–440, 1995. doi: https://doi.org/10.1016/0048-7333(94)00775-3. URL https://doi.org/10.1016/0048-7333(94) 00775-3. Ahmet Üstün, Arianna Bisazza, Gosse Bouma, and Gertjan van Noord. UDapter: Language adaptation for truly Universal Dependency parsing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 2302–2315, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.180. URL https://aclanthology.org/2020.emnlp-main. 180. Ahmet Üstün, Alexandre Berard, Laurent Besacier, and Matthias Gallé. Multilingual unsupervised neural machine translation with denoising adapters. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 6650–6662, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.533. URL https: //aclanthology.org/2021.emnlp-main.533. Ahmet Üstün, Arianna Bisazza, Gosse Bouma, Gertjan van Noord, and Sebastian Ruder. Hyper-X: A unified hypernetwork for multi-task multilingual transfer. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 7934–7949, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https://aclanthology.org/2022.emnlp-main.541. Gido M. van de Ven and Andreas S. Tolias. Three scenarios for continual learning. CoRR, abs/1904.07734, 2019. URL http://arxiv.org/abs/1904.07734. Simon Vandenhende, Stamatios Georgoulis, Luc Van Gool, and Bert De Brabandere. Branched multi-task networks: Deciding what layers to share. In 31st British Machine Vision Conference 2020, BMVC 2020, Virtual Event, UK, September 7-10, 2020. BMVA Press, 2020. URL https://www.bmvc2020-conference. com/assets/papers/0213.pdf. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 5998–6008, 2017. URL https://proceedings.neurips.cc/paper/2017/hash/ 3f5ee243547dee91fbd053c1c4a845aa-Abstract.html. Petar Veličković and Charles Blundell. Neural algorithmic reasoning. Patterns, 2(7):100273, 2021. 65 David Vilar. Learning hidden unit contribution for adapting neural machine translation models. 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. 500–505, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-2080. URL https://aclanthology.org/ N18-2080. Elena Voita, David Talbot, Fedor Moiseev, Rico Sennrich, and Ivan Titov. Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 5797–5808, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1580. URL https://aclanthology.org/P19-1580. John von Neumann. First draft of a report on the EDVAC. Technical report, 1945. URL https://doi.org/ 10.1109/85.238389. Johannes von Oswald, Christian Henning, João Sacramento, and Benjamin F. Grewe. Continual learning with hypernetworks. 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=SJgwNerKvB. Tu Vu, Aditya Barua, Brian Lester, Daniel Cer, Mohit Iyyer, and Noah Constant. Overcoming catastrophic forgetting in zero-shot cross-lingual generation. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 9279–9300, Abu Dhabi, United Arab Emirates, December 2022a. Association for Computational Linguistics. URL https://aclanthology.org/2022.emnlp-main.630. Tu Vu, Aditya Barua, Brian Lester, Daniel Cer, Mohit Iyyer, and Noah Constant. Overcoming catastrophic forgetting in zero-shot cross-lingual generation. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 9279–9300, Abu Dhabi, United Arab Emirates, December 2022b. Association for Computational Linguistics. URL https://aclanthology.org/2022.emnlp-main.630. Tu Vu, Brian Lester, Noah Constant, Rami Al-Rfou', and Daniel Cer. SPoT: Better frozen model adaptation through soft prompt transfer. In Proceedings of the 60th Annual Meeting of the As- sociation for Computational Linguistics (Volume 1: Long Papers), pp. 5039–5059, Dublin, Ireland, May 2022c. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.346. URL https://aclanthology.org/2022.acl-long.346. Günter P. Wagner, Jason Mezey, and Raffaele Calabretta. Natural selection and the origin of modules. In Werner Callebaut and Diego Rasskin-Gutman (eds.), Modularity: Understanding the Development and Evolution of Complex Natural Systems, pp. 33. MIT Press, 2005. doi: https://doi.org/10.7551/mitpress/ 4734.001.0001. URL https://doi.org/10.7551/mitpress/4734.001.0001. Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. Superglue: A stickier benchmark for general-purpose language un- derstanding systems. In Advances in Neural Information Processing Systems 32: Annual Confer- ence on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Van- couver, BC, Canada, pp. 3261–3275, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/ 4496bf24afe7fab6f046bf4923da8de6-Abstract.html. Pu Wang and Hugo Van hamme. Bottleneck low-rank transformers for low-resource spoken language understanding. In Proceedings of Interspeech 2022, 23rd Annual Conference of the International Speech Communication Association, Incheon, Korea, 18-22 September 2022, pp. 1248–1252, 2022. doi: 10.21437/ Interspeech.2022-10801. URL https://doi.org/10.21437/Interspeech.2022-10801. Ruize Wang, Duyu Tang, Nan Duan, Zhongyu Wei, Xuanjing Huang, Jianshu Ji, Guihong Cao, Daxin Jiang, and Ming Zhou. K-Adapter: Infusing Knowledge into Pre-Trained Models with Adapters. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pp. 1405–1418, Online, August 2021a. Association for Computational Linguistics. doi: 10.18653/v1/2021.findings-acl.121. URL https://aclanthology.org/2021.findings-acl.121. 66 Yaqing Wang, Sahaj Agarwal, Subhabrata Mukherjee, Xiaodong Liu, Jing Gao, Ahmed Hassan Awadallah, and Jianfeng Gao. AdaMix: Mixture-of-adaptations for parameter-efficient model tuning. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 5744–5760, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https: //aclanthology.org/2022.emnlp-main.388. Zirui Wang, Zachary C. Lipton, and Yulia Tsvetkov. On negative interference in multilingual models: Findings and a meta-learning treatment. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 4438–4450, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.359. URL https://aclanthology.org/2020.emnlp-main. 359. Zirui Wang, Yulia Tsvetkov, Orhan Firat, and Yuan Cao. Gradient vaccine: Investigating and improving multi-task optimization in massively multilingual models. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021b. URL https://openreview.net/forum?id=F1vEjWK-lH_. Chihiro Watanabe. Interpreting layered neural networks via hierarchical modular representation. In Neural Information Processing - 26th International Conference, ICONIP 2019, Sydney, NSW, Australia, December 12-15, 2019, Proceedings, Part V, volume 1143 of Communications in Computer and Information Science, pp. 376–388. Springer, 2019. doi: 10.1007/978-3-030-36802-9\_40. URL https://doi.org/10.1007/ 978-3-030-36802-9_40. Albert Webson and Ellie Pavlick. Do prompt-based models really understand the meaning of their prompts? In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 2300–2344, Seattle, United States, July 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.naacl-main.167. URL https://aclanthology.org/ 2022.naacl-main.167. Jason Wei, Maarten Bosma, Vincent Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M. Dai, and Quoc V Le. Finetuned language models are zero-shot learners. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=gEZrGCozdqR. Ronald J. Williams. Toward a theory of reinforcement-learning connectionist systems. Technical Report NU-CCS-88-3, Northeastern University, 1988. Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3):229–256, 1992. doi: 10.1007/BF00992696. URL https://doi.org/10.1007/ BF00992696. Genta Indra Winata, Samuel Cahyawijaya, Zhaojiang Lin, Zihan Liu, and Pascale Fung. Lightweight and efficient end-to-end speech recognition using low-rank transformer. In 2020 IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2020, Barcelona, Spain, May 4-8, 2020, pp. 6144–6148, 2020. URL https://doi.org/10.1109/ICASSP40776.2020.9053878. Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander Rush. 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, Online, October 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-demos.6. URL https://aclanthology.org/2020.emnlp-demos.6. Mitchell Wortsman, Vivek Ramanujan, Rosanne Liu, Aniruddha Kembhavi, Mohammad Rastegari, Ja- son Yosinski, and Ali Farhadi. Supermasks in superposition. In 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/ ad1f8bb9b51f023cdc80cf94bb615aa9-Abstract.html. 67 Mitchell Wortsman, Gabriel Ilharco, Samir Ya Gadre, Rebecca Roelofs, Raphael Gontijo Lopes, Ari S. Morcos, Hongseok Namkoong, Ali Farhadi, Yair Carmon, Simon Kornblith, and Ludwig Schmidt. Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time. In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvári, Gang Niu, and Sivan Sabato (eds.), International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 23965–23998. PMLR, 2022. URL https://proceedings.mlr.press/v162/wortsman22a.html. Teng Xi, Yifan Sun, Deli Yu, Bi Li, Nan Peng, Gang Zhang, Xinyu Zhang, Zhigang Wang, Jinwen Chen, Jian Wang, Lufei Liu, Haocheng Feng, Junyu Han, Jingtuo Liu, Errui Ding, and Jingdong Wang. UFO: unified feature optimization. In Shai Avidan, Gabriel J. Brostow, Moustapha Cissé, Giovanni Maria Farinella, and Tal Hassner (eds.), Computer Vision - ECCV 2022 - 17th European Conference, Tel Aviv, Israel, October 23-27, 2022, Proceedings, Part XXVI, volume 13686 of Lecture Notes in Computer Science, pp. 472–488. Springer, 2022. doi: 10.1007/978-3-031-19809-0\_27. URL https://doi.org/10.1007/ 978-3-031-19809-0_27. An Yang, Junyang Lin, Rui Men, Chang Zhou, Le Jiang, Xianyan Jia, Ang Wang, Jie Zhang, Jiamang Wang, Yong Li, Di Zhang, Wei Lin, Lin Qu, Jingren Zhou, and Hongxia Yang. Exploring sparse expert models and beyond. CoRR, abs/2105.15082, 2021. URL https://arxiv.org/abs/2105.15082. Guangyu Robert Yang, Madhura R. Joglekar, H. Francis Song, William T. Newsome, and Xiao-Jing Wang. Task representations in neural networks trained to perform many cognitive tasks. Nature Neuroscience, 22(2):297–306, 2019. doi: https://doi.org/10.1038/s41593-018-0310-2. URL https://doi.org/10.1038/ s41593-018-0310-2. Yongxin Yang and Timothy M. Hospedales. Deep multi-task representation learning: A tensor factorisation approach. 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=SkhU2fcll. Qinyuan Ye, Bill Yuchen Lin, and Xiang Ren. CrossFit: A few-shot learning challenge for cross-task generalization in NLP. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 7163–7189, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.572. URL https://aclanthology.org/ 2021.emnlp-main.572. Zhao You, Shulin Feng, Dan Su, and Dong Yu. Speechmoe2: Mixture-of-experts model with improved routing. In IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2022, Virtual and Singapore, 23-27 May 2022, pp. 7217–7221. IEEE, 2022. doi: 10.1109/ICASSP43922.2022.9747065. URL https://doi.org/10.1109/ICASSP43922.2022.9747065. Haonan Yu, Sergey Edunov, Yuandong Tian, and Ari S. Morcos. Playing the lottery with rewards and multiple languages: lottery tickets in RL and NLP. 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=S1xnXRVFwH. Fan Zhang, Duyu Tang, Yong Dai, Cong Zhou, Shuangzhi Wu, and Shuming Shi. SkillNet-NLU: A Sparsely Activated Model for General-Purpose Natural Language Understanding. CoRR, abs/2203.03312, 2022a. doi: 10.48550/arxiv.2203.03312. URL https://arxiv.org/abs/2203.03312. Rongsheng Zhang, Yinhe Zheng, Xiaoxi Mao, and Minlie Huang. Unsupervised domain adaptation with adapter. CoRR, abs/2111.00667, 2021. URL https://arxiv.org/abs/2111.00667. Zhanpeng Zhang, Ping Luo, Chen Change Loy, and Xiaoou Tang. Facial landmark detection by deep multi-task learning. In Computer Vision - ECCV 2014 - 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part VI, volume 8694 of Lecture Notes in Computer Science, pp. 94–108. Springer, 2014. doi: 10.1007/978-3-319-10599-4\_7. URL https://doi.org/10.1007/978-3-319-10599-4_7. 68 Zhengyan Zhang, Zhiyuan Zeng, Yankai Lin, Chaojun Xiao, Xu Han, Zhiyuan Liu, Maosong Sun, and Jie Zhou. Emergent modularity in pre-trained transformers, 2022b. URL https://openreview.net/forum? id=XHuQacT6sa6. Mengjie Zhao, Tao Lin, Fei Mi, Martin Jaggi, and Hinrich Schütze. Masking as an efficient alternative to finetuning for pretrained language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 2226–2241, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.174. URL https://aclanthology.org/ 2020.emnlp-main.174. Zihao Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. Calibrate before use: Improving few-shot performance of language models. In Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 12697–12706. PMLR, 2021. URL http://proceedings.mlr.press/v139/zhao21c.html. Tao Zhong, Zhixiang Chi, Li Gu, Yang Wang, Yuanhao Yu, and Jin Tang. Meta-dmoe: Adapting to domain shift by meta-distillation from mixture-of-experts. CoRR, abs/2210.03885, 2022. URL https: //doi.org/10.48550/arXiv.2210.03885. Zexuan Zhong, Dan Friedman, and Danqi Chen. Factual probing is [MASK]: Learning vs. learning to recall. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 5017–5033, Online, June 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.naacl-main.398. URL https://aclanthology.org/ 2021.naacl-main.398. Han Zhou, Xingchen Wan, Ivan Vulić, and Anna Korhonen. AutoPEFT: automatic configuration search for parameter-efficient fine-tuning. CoRR, abs/2301.12132, 2023. doi: 10.48550/arXiv.2301.12132. URL https://doi.org/10.48550/arXiv.2301.12132. Hattie Zhou, Janice Lan, Rosanne Liu, and Jason Yosinski. Deconstructing lottery tickets: Zeros, signs, and the supermask. In Advances in Neural Information Processing Systems 32: Annual Con- ference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Van- couver, BC, Canada, pp. 3592–3602, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/ 1113d7a76ffceca1bb350bfe145467c6-Abstract.html. Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Conditional prompt learning for vision- language models. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2022, New Orleans, LA, USA, June 18-24, 2022, pp. 16795–16804, 2022a. URL https://doi.org/10.1109/ CVPR52688.2022.01631. Yanqi Zhou, Tao Lei, Hanxiao Liu, Nan Du, Yanping Huang, Vincent Y. Zhao, Andrew M. Dai, Zhifeng Chen, Quoc Le, and James Laudon. Mixture-of-experts with expert choice routing. CoRR, abs/2202.09368, 2022b. URL https://arxiv.org/abs/2202.09368. Yunzheng Zhu, Ruchao Fan, and Abeer Alwan. Towards better meta-initialization with task augmentation for kindergarten-aged speech recognition. In IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2022, Virtual and Singapore, 23-27 May 2022, pp. 8582–8586, 2022. URL https://doi.org/10.1109/ICASSP43922.2022.9747599. Barret Zoph, Irwan Bello, Sameer Kumar, Nan Du, Yanping Huang, Jeff Dean, Noam Shazeer, and William Fedus. ST-MoE: designing stable and transferable sparse expert models. CoRR, abs/2202.08906, 2022. doi: 10.48550/ARXIV.2202.08906. URL https://arxiv.org/abs/2202.08906. Simiao Zuo, Xiaodong Liu, Jian Jiao, Young Jin Kim, Hany Hassan, Ruofei Zhang, Jianfeng Gao, and Tuo Zhao. Taming sparsely activated transformer with stochastic experts. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net, 2022. URL https://openreview.net/forum?id=B72HXs80q4. 69
http://arxiv.org/abs/2302.11526v1
2023-02-22T18:04:02
2023-02-22T18:04:02
Precoding-oriented Massive MIMO CSI Feedback Design
Downlink massive multiple-input multiple-output (MIMO) precoding algorithms in frequency division duplexing (FDD) systems rely on accurate channel state information (CSI) feedback from users. In this paper, we analyze the tradeoff between the CSI feedback overhead and the performance achieved by the users in systems in terms of achievable rate. The final goal of the proposed system is to determine the beamforming information (i.e., precoding) from channel realizations. We employ a deep learning-based approach to design the end-to-end precoding-oriented feedback architecture, that includes learned pilots, users' compressors, and base station processing. We propose a loss function that maximizes the sum of achievable rates with minimal feedback overhead. Simulation results show that our approach outperforms previous precoding-oriented methods, and provides more efficient solutions with respect to conventional methods that separate the CSI compression blocks from the precoding processing.
[ "Fabrizio Carpi", "Sivarama Venkatesan", "Jinfeng Du", "Harish Viswanathan", "Siddharth Garg", "Elza Erkip" ]
10.1109/ICC45041.2023.10278955
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1109/ICC45041.2023.10278955", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.11526v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11526v1", "@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" ]
Precoding-oriented Massive MIMO CSI Feedback Design Fabrizio Carpi∗, Sivarama Venkatesan†, Jinfeng Du†, Harish Viswanathan†, Siddharth Garg∗, Elza Erkip∗ ∗Department of Electrical and Computer Engineering, New York University, Brooklyn, NY †Nokia Bell Labs, Murray Hill, NJ 3 2 0 2 b e F 2 2 ] T I . s c [ 1 v 6 2 5 1 1 . 2 0 3 2 : v i X r a Abstract-Downlink massive multiple-input multiple-output (MIMO) precoding algorithms in frequency division duplexing (FDD) systems rely on accurate channel state information (CSI) feedback from users. In this paper, we analyze the tradeoff be- tween the CSI feedback overhead and the performance achieved by the users in systems in terms of achievable rate. The final goal of the proposed system is to determine the beamforming informa- tion (i.e., precoding) from channel realizations. We employ a deep learning-based approach to design the end-to-end precoding- oriented feedback architecture, includes learned pilots, users' compressors, and base station processing. We propose a loss function that maximizes the sum of achievable rates with minimal feedback overhead. Simulation results show that our approach outperforms previous precoding-oriented methods, and provides more efficient solutions with respect to conventional methods that separate the CSI compression blocks from the precoding processing. that Index Terms-channel state information (CSI) feedback, precoding-oriented, task-oriented, semantic communications I. INTRODUCTION Massive multiple-input multiple-output (MIMO) technology became one of the pillars of 5G wireless systems and beyond, and accurate channel state information (CSI) is a key enabler to unlock its full potential [1]. Driving into 6G wireless systems, with even larger antenna arrays and bandwidths, effective CSI becomes a crucial requirement to achieve the desired performance. When adopting time division duplexing (TDD), the base station (BS) exploits channel reciprocity to obtain CSI through uplink transmissions. On the other hand, channel reciprocity does not hold when considering frequency division duplexing (FDD). In FDD, the BS needs an accurate CSI in order to serve users with high spectral efficiency. In FDD systems, the users estimate the downlink channel realizations and feed back the estimated CSI on the uplink. The transmission of the downlink CSI on the uplink constitutes a communication overhead. As the system dimension increases (e.g., more antennas, more users), the communication cost of the feedback overhead becomes prohibitive. Classical CSI compression techniques make use of vector quantization [2] and compressed sensing [3]: in the first case, the overhead is still impractical for large systems, while the latter technique assumes channel sparsity in some domains. Overall, three fundamental metrics can be considered for the CSI feedback problem: overhead, that is the number of This work was done in part while F. Carpi was an intern at Nokia Bell Labs. The work of F. Carpi, S. Garg, and E. Erkip was supported in part by the NYU WIRELESS Industrial Affiliates Program, by the NSF–Intel grant #2003182, and by the NSF grant #1925079. Please send correspondence to [email protected]. bits sent on the feedback link; performance, that is the total achievable rate at the users; distortion, that is the loss (e.g., mean squared error) incurred when trying to reconstruct the channel realizations at the BS. Generally speaking, it is known that the optimal rate is achieved with nonlinear precoding methods [4], [5] based on dirty paper coding [6]. In this work, we focus on the sum of achievable rates under the assumption that transmit beamforming is implemented with linear precoding [7]. Recently, deep learning-based solutions have been proposed for the CSI feedback problem in massive MIMO FDD systems, see [8] and references therein for an overview. In general, these data-driven solutions rely on fewer assumptions and outperform classical CSI feedback methods. The capability of the autoencoder [9] structure for the CSI compression problem was first shown by [10]. Several follow-up works have improved the distortion metric [8] with increasing di- mensionality reduction on the feedback link. Similarly to image processing applications [11], [12], a mechanism for the feedback overhead optimization has been introduced in [13]. The authors [13] consider the rate-distortion objective, where the goal is to reconstruct channel realizations with minimal overhead at the BS side. Their results [13] show that the feedback overhead can be further reduced with respect to previous work, but there is no focus on the final task that is performed at the BS (e.g., beamforming). On the other hand, [14], [15] consider objectives related to the final task to be performed at the BS, i.e., beamforming with linear precoding. A single-user system is analyzed in [15], where precoding information is computed and compressed at the user side, and decoded at the base station: the proposed solution shows overhead savings compared with 3GPP standards methods. Instead, [14] proposes a multi-user precoder-oriented archi- tecture that learns pilots, user processing, and BS processing from training data. The system output is the collection of linear precoders and the objective function is the sum of achievable rates experienced by the users. Their best results [14, Fig. 9] are obtained by modeling each feedback tap as a binary value, using a smooth approximation during training to allow backpropagation. Hence, the feedback overhead is determined by the choice of the feedback dimension (fixed), without the possibility to obtain further compression. In this paper, we analyze the tradeoff between the CSI feedback overhead and the system performance in terms of the sum of achievable rates experienced by the users. In general, the CSI is compressed and sent over a rate-limited link by the users, and the BS has to process the CSI feedback in order to determine the beamforming information. We assume that linear precoding is adopted, and we focus on a task-oriented approach: the final task for the BS is to determine precoding vectors for each user, and the system's goal is to maximize the sum of achievable rates. We adopt a multi-user precoding- oriented end-to-end architecture similar to [14], where the users observe a sequence of noisy pilots as an input, and produce precoding-oriented feedback messages for the BS. The BS processes the received feedback and determines the precoder vectors for each user. The pilots, feedback schemes, and BS processing are modeled with neural networks. Differ- ently from [14], we include a feedback overhead optimization mechanism that estimates the feedback distribution during training and uses entropy coding to generate the bits streams at test time [11], [12]. The entropy of the feedback values is used to estimate the feedback overhead (feedback rate). The same feedback optimization method [11], [12] was used in [13], but in the context of CSI feedback for channel reconstruction without including pilots design. In order to train the end-to- end architecture with gradient descent, we propose a tunable loss function that captures the tradeoff between feedback over- head and system performance. We show that the precoding- oriented system trained over the overhead-performance loss function outperforms conventional methods based on channel reconstruction followed by traditional precoding techniques. In our precoding-oriented approach, the user network is able to learn how to efficiently transfer precoding-oriented quantized information over the feedback link. We illustrate the system model in Section II, while the precoding-oriented CSI feedback approach is discussed in Section III. Numerical results are shown in Section IV, while conclusions are drawn in Section V. II. SYSTEM MODEL We consider a massive MIMO system where a BS with Nt transmit antennas serves K single-antenna users. We assume that linear precoding is used at the BS, hence the downlink transmitted signal is K x = vksk = Vs k=1 X (1) where vk ∈ CNt is the precoding vector and sk ∈ C is the symbol to be sent by the k-th user. The precoding matrix V ∈ CNt×K satisfies the total power constraint Tr(VVH ) ≤ P , and the symbols s ∈ CK are normalized to E[ssH] = I. The received signal at the k-th user is yk = hH k vksk + hH k vj sj + zk (2) j6=k X where hk ∈ CNt is the vector of downlink channel gains for the k-th user and zk ∼ CN (0, σ2) is the additive white Gaussian noise. The matrix containing the channel gains for all the users is denoted by H ∈ CNt×K. Given the received signal model in (2), the achievable rate for the k-th user is Rk = log2 1 + |hH j6=k |hH k vk|2 k vj|2 + σ2 . ! (3) Considering the multi-terminal communication problem with K users, the performance can be expressed as the sum of achievable rates, i.e., P K R = Rk. (4) k=1 X Accurate CSI is crucial to design a precoding matrix V that maximizes the sum rate in (4). We assume that both the BS and the users do not have a-priori knowledge about the channel realizations. Hence, the BS has to learn the downlink precoding matrix V based on the feedback received from the users on the uplink. Therefore, we assume that the BS sends reference signals (pilots) during the downlink training phase. The pilots, of length L, are denoted by ̃X ∈ CNt×L. The received noisy pilots ̃yk ∈ CL at k-th user are ̃yk = hH k ̃X + zk, (5) where zk ∼ CN (0, σ2I) is the additive white Gaussian noise transmission satisfies the at the k-th user. The l-th pilot instantaneous power constraint k ̃xlk2 2 ≤ P , where ̃xl is the l-th column of ̃X. In general, the CSI feedback overhead is proportional to the dimensions of the system (e.g., number of users, antennas), and becomes very large in case of massive MIMO systems with many users. Hence, the users are required to extract relevant CSI from the received pilots, then feed back the compressed CSI, or other relevant information needed for the downlink precoding, to the BS over a rate-limited link. The feedback bk for the k-th user is denoted by bk = F ( ̃yk), (6) where F represents the feedback scheme adopted by the users. We focus on the regime where the feedback overhead required to transmit bk is much smaller than sending the channel realizations explicitly. The BS collects the received feedback from all the K users, denoted by (b1, . . . , bK), and outputs both the precoding matrix V and the reconstructed channel matrix ˆH: (V, ˆH) = G(b1, . . . , bK), (7) where G denotes the BS processing. Note that in (7) both the precoders V and the channel reconstructions ˆH are potentially provided by the BS. However, in this paper we focus on the precoding-oriented approach, i.e., only V is provided at the output of the BS, as the ultimate task of maximizing sum rate in (4) only depends on V. We use the reconstructions ˆH to compare our method with traditional techniques based on the separation between CSI feedback for channel reconstruc- tion [8], [10], [13] and conventional precoding techniques. Our focus in this paper is a precoding-oriented architecture, where the tradeoff between the feedback overhead and the users' performance is considered. Our system seeks to max- imize the sum of achievable rates (4), while the amount of bits required to transmit (b1, . . . , bK) over the feedback link is bounded. We use neural networks to design the pilots ̃X, the feedback scheme F , and the BS processing G. The overall system model is shown in Fig. 1. More details about each processing block are provided in Section III. III. PRECODING-ORIENTED CSI FEEDBACK WITH OVERHEAD-PERFORMANCE TRADEOFF Consider the block diagram in Fig. 1. Similarly to [14], we use neural networks in place of conventional methods for the pilots ̃X, the feedback scheme F , and the BS scheme G. We also adopt a mechanism, proposed in [11], [12], that optimizes the compression and quantization of the feedback. A similar approach was also used in [13] in the context of CSI feedback; however, the goal in that case was to reconstruct the channel coefficients, while we focus on the design of the precoder vectors. We propose a precoding-oriented loss function, where the overhead-performance tradeoff is directly embedded in the objective function. In this way, the feedback scheme F can learn an efficient precoding-oriented representation of the channel realization, and the BS processing G is able to directly output the precoding matrix V. More details about each processing block are provided in the next sections. A. Downlink Pilots The downlink received (noisy) pilots for the k-th user are expressed in (5). As in [14], we model the pilots ̃X as a fully- connected neural network layer with linear activation and zero bias. The power constraint P is guaranteed during training by setting k ̃xlk2 2 = P . Gaussian noise zk is added to the sequence of L received pilots to model the receiver noise according to (5). B. Feedback Scheme As depicted in Fig. 1, the feedback scheme for each user is denoted by F . We assume that F is the same scheme for all the K users, while each terminal observes different channel realizations h1, . . . , hK. As observed in [13], [14], using a unique F works well also in the multi-user scenario if the channel realizations have the same statistics according to the channel model. The feedback scheme is composed of three components: a deep neural network (DNN) fθ, a quantizer q, and an entropy coder cψ. More details about the latter two are also provided in the next sections. The DNN fθ, where θ represents the set of trainable param- eters, is used to extract features from the received pilots ̃yk. The output of the DNN is denoted as tk = fθ( ̃yk), tk ∈ RNb. Similarly to [14], we consider a fully-connected DNN. More details about the DNN architecture are provided in Section IV. The quantizer q performs uniform scalar quantization to the closest integer. The quantized vector for the k-th user is denoted as tk = q(tk). During training, the quantization is replaced by adding independent identically distributed (iid) uniform noise uk, where the width of the uniform distribution is equal to the quantization bin width, i.e., u1 k ∼ U[−0.5, +0.5] [11]. We denote the pseudo-quantized vector as ̃tk = tk + uk and it substitutes tk during training to allow gradient backpropagation. k, . . . , uNb The entropy coder cψ, where ψ represents the set of trainable parameters, converts the quantized vector tk into bit streams in a lossless fashion. As in [12], ̃tk is modeled using a parametric, fully factorized density function. Each element of ̃tk is modeled as a zero-mean Gaussian distribution with standard deviation learned during training. These learned parameters are then used by cψ to encode tk at test time. C. Feedback Overhead Optimization Similarly to previous works in image processing [11], [12] and CSI feedback [13], we consider the feedback rate as part of our optimization objective. Since both the quantizer and the entropy coder are not differentiable functions, they are substituted by iid uniform noise during training [11], as described above. The iid noise uk simulates the quantization noise. The compression performed by the entropy coder is lossless and at a rate close to the entropy of tk; so, at the BS side we have c−1 ψ (bk) = tk. In fact, during training, the entropy of ̃tk is estimated in terms of the model parameters ψ. Note that the probability density of ̃tk is a continuous relaxation of the probability mass function of tk [11], hence the differential entropy of ̃tk approximates the entropy of tk; the estimated entropy represents the average bit rate at the quantizer output and will be used in our loss function to measure the feedback overhead [11]. During testing, the noise uk is not injected, but the output of fθ goes through the quantizer q and entropy coder cψ. Note that our approach is different from [14], where tk contains binary values, and the dimension of tk determines the feedback overhead. However, we argue that further compres- sion of this feedback is possible and can provide significant gains. The authors in [14] also propose an alternative method where tk contains real values that are quantized (using Lloyd's algorithm [16]) according to a given overhead budget, and only the BS DNN is further fine-tuned on the quantized inputs. On the other hand, in our work, the optimization method [12] described above seeks to minimize the feedback entropy (rate) without explicit dependency on the feedback dimensionality. Moreover, our approach allows for end-to- end joint training between pilots, users, and BS processing, including the feedback overhead optimization. D. BS Processing During test time, the entropy decoder losslessly reconstructs the received feedback per user, i.e., c−1 ψ (bk) = tk. During training, the entropy decoder is skipped, and the feedback vectors bk = ̃tk are directly fed into the BS DNN gφ, where φ represent the set of trainable parameters. The output of the BS, as defined in (7), formally consists in both the precoding matrix V and the reconstructed channel gains ˆH. However, Channel Pilots Noise Users Feedback Base Station ̃X × . . . ̃X × h1 . . . hK z1 + . . . zK + ̃y1 t1 fθ ̃yK tK fθ q F . . . q F t1 cψ b1 t1 c−1 ψ . . . gφ tK cψ bK c−1 ψ tK G Precoders/ reconstructions v1 ˆh1 . . . vK ˆhK Fig. 1: System model. The pilots (marked in blue) are learned during the end-to-end learning. The green boxes correspond to the users' feedback scheme F , which is composed of the DNN fθ, the quantizer q and the entropy coder cψ. The BS processing is denoted with G, which is composed by the entropy decoder c−1 ψ and the DNN gφ. The output of the BS processing are the precoders vk or the channel reconstructions ˆhk depending on whether the precoding-oriented approach is adopted or not. in our work we focus on the precoding-oriented output V = gφ( ̃t1, . . . , ̃tK), and ignore ˆH. The output of the BS has to satisfy the power constraint by setting Tr(VVH ) = P . E. Loss Function As discussed in Section I, three metrics can be considered in the CSI feedback problem: feedback overhead, system perfor- mance, and channel distortion. In order to train the end-to-end system with deep learning techniques, we need a differentiable loss function that emulates the required properties for the system described in Section II and depicted in Fig. 1. We consider a loss function (to be minimized during training) that combines the three metrics as L(θ, φ, ψ) = O − λR + γD, (8) where O represents the feedback overhead, R represents the system performance, and D represents the distortion loss; λ and γ determine the tradeoff between the three components. We assume that the tradeoff coefficients are non-negative, i.e., λ, γ ≥ 0. For example, traditional overhead-distortion (or rate- distortion) settings correspond to λ = 0, while precoding- oriented systems correspond to γ = 0. In our work, we will consider γ = 0 and will sweep values of λ for different feed- back overhead. Systems that provide both precoding vectors and channel reconstructions can be also considered by having non-zero values for both (λ, γ), but they are not the focus of this work. More details about the metrics are provided below. 1) Overhead: The feedback overhead accounts for the amount of bits that is required to transmit bk's on the uplink. As discussed previously, we use the empirical entropy of ̃tk as a measure for the feedback overhead [12], [13]. Hence, we can express the overhead metric for the k-th user as Ok(θ, ψ) = Ehk,uk,zk − log2 p ̃t( ̃tk; ψ) , (9) (cid:2) (cid:3) where p ̃t(*; ψ) represents the approximated density of ̃t pa- rameterized by ψ. This loss term can be seen as an estimate for the number of bits required to represent each feedback vector bk. The sum of the feedback overhead for the K users can be expressed as K O(θ, ψ) = Ok(θ, ψ). (10) k=1 X 2) Performance: The system performance can be evaluated in terms of the achievable rate experienced by the users, as explained in Section II. According to (3) and (4), we recall that the performance metric is K R(θ, ψ, φ) = Rk(θ, ψ, φ), (11) k=1 X where Rk(θ, ψ, φ) = Ehk,U,Z log2 1 + |hH j6=k |hH k vk|2 k vj |2 + σ2 ! . (12) and V = [v1, . . . , vK ] = gφ( ̃t1, . . . , ̃tK). P 3) Distortion: In order to compare the precoding-oriented approach with conventional methods, we also consider mean squared error (MSE) as a distortion metric. The distortion component can be expressed as D(θ, ψ, φ) = EH,U,Z (13) 2 (cid:13) (cid:13) where ˆH = [ˆh1, . . . , ˆhK] = gφ( ̃t1, . . . , ̃tK) when considering (cid:13) the channel reconstructions at the BS output. 2 , H − ˆH (cid:13) (cid:13) (cid:13) IV. SIMULATION RESULTS While our framework is applicable to any channel model, in order to provide a comparison with the relevant literature [14], we consider the following multipath channel model for our simulations. We assume that the BS is equipped with a uniform linear array, with transmit array response at(β) = 2πfc d c sin(β), . . . , ej 2πfc d c (Nt−1) sin(β) , (14) where β denotes the angle of departure (AoD), d denotes the antenna spacing, fc denotes the carrier frequency and c denotes the speed of light. The channel gains at the k-th user are the summation of Lp propagation paths as i 1, ej h hk = 1 Lp Lp αl,kat(βl,k), (15) l=1 X where αl,k is the complex gain of the l-th path between the BS and the k-th user. p We focus on the overhead-performance tradeoff in the following analysis. The system performance is evaluated as the sum achievable rate (11), while the feedback overhead (per user) is estimated according to (9). For the numerical results presented in this paper, in order to compare with [14], we assume that there are K = 2 users, the channel has Lp = 2 paths, the pilots' length is L = 8, the BS is equipped with Nt = 64 antennas, the transmitted power constraint is P = 1, and the signal-to-noise ratio (SNR) P/σ2 on the received pilots is 10 dB. The feedback bk is assumed to be noiseless. The main goal of our work is to investigate the precoding-oriented approach, trained for overhead-performance tradeoff, and com- pare it with conventional channel reconstruction followed by traditional precoding. The neural networks hyperparameters are chosen as fol- lows. The user network fθ consists of four fully-connected layers with [1024, 2048, 256, Nb] neurons, where Nb = 16, while the BS network gφ has five fully-connected layers with [1024, 512, 512, 256, K * Nt] neurons. Each hidden layer is preceded by batch normalization, and followed by a rectified linear unit (ReLU) activation. Real and imaginary parts of signals are processed on separate layers when appropriate. The last layers of both fθ and gφ have linear activation, For the overhead mechanism [12], we use the entropy bottleneck class from [17], which provides a PyTorch implementation of [18]. The end-to-end architecture is trained with ADAM optimizer, learning rate 10−3, over at least 106 batches of size 1024. The final numerical results are obtained on a test set containing 104 channel realizations for the two users. A. Baseline algorithms with CSIT The best case scenario is when the perfect CSI H is available at the BS. This case is referred to as CSI at the transmitter (CSIT). Maximal-ratio transmission (MRT) and zero-forcing (ZF) are two traditional precoding schemes [7], [19]. In MRT, the per-user received power is maximized, while ZF attempts to minimize the inter-user interference. Note that in the high (low) SNR asymptotic regime, the optimal linear precoding strategy converges to the ZF (MRT) solution [7]. The precoding matrices for MRT and ZF are VMRT = αMRTHH VZF = αZFHH (HHH )−1 (16) (17) where αMRT and αZF are determined to ensure that the power constraints Tr(VMRTVH ZF) ≤ P are satisfied. MRT) ≤ P and Tr(VZFVH B. Precoding-oriented System Trained on the Overhead- performance Tradeoff As described in this paper, our approach optimizes the overhead-performance tradeoff. The end-to-end system of Fig. 1 is trained with γ = 0 in (8), where V is the only output at the BS. We do not consider channel reconstructions ˆH, since the end goal is to optimize performance. We obtain different working points by changing the value of λ: large (small) λ leads to good (poor) precoding performance with a little (big) feedback overhead. C. Methods From the Literature Conventional methods separate the source coding blocks (compressor and decompressor) from the task block (compute precoding). Note that previous works [8], [10], [13] showed that deep learning-based approaches outperform traditional techniques (e.g., compressed sensing) for the CSI feedback reconstruction problem. In particular, [13] showed that a deep learning-based CSI feedback architecture can be successfully trained to optimize the overhead-distortion tradeoff, when using a feedback optimization similar to the one described in Section III-C; so we will consider the following deep learning- based approach as a surrogate for all conventional methods. To simulate this reconstruction-oriented approach, according to Fig. 1, we set λ = 0 in our loss function (8) and consider ˆH as the output of the BS. Then, MRT and ZF precoders are computed using the channel estimates ˆH according to (16) and (17). The resulting precoding matrices are denoted as ˆVMRT and ˆVZF. The reconstruction ˆH and the precoding matrices ˆVMRT and ˆVZF are used to estimate the performance according to (11). We train the model for different values of γ to obtain neural networks with different overhead-distortion tradeoffs. For example, large (small) γ corresponds to a good (poor) reconstruction with a little (big) feedback overhead. We also compare our approach with [14]. We consider the best results in [14, Fig. 4 and 9], where the feedback is modeled as a vector of binary values. Each feedback overhead budget determines the dimension of the feedback in the architecture and the end-to-end system is trained to maximize the sum rate (11). D. Comparisons of Results We compare our precoding-oriented approach with: MRT/ZF with CSIT; deep learning-based channel reconstruc- tion (reconstruction-oriented system with λ = 0, as discussed above) followed by MRT/ZF applied to the channel estimates ˆH; the results for the precoding-oriented system from [14]. ] e s u . h c / s t i b [ e t a r e l b a v e i h c a m u S 16 15 14 13 12 11 10 9 8 7 6 5 10 15 Our precoding-oriented ZF with CSIT Reconstruction-oriented similar to [13] + ZF Precoding-oriented from [14] MRT with CSIT Reconstruction-oriented similar to [13] + MRT 20 40 45 50 55 25 30 35 60 Overhead (feedback rate) per-user [bits/ch. use] Fig. 2: Analysis of the tradeoff between the feedback overhead and the system performance for Nt = 64 antennas, K = 2 users, and L = 8 pilots. Each marker corresponds to a different end-to-end architecture trained for different values of λ and γ in the loss function (8). Fig. 2 shows the overhead-performance tradeoff for the above-mentioned methods. Our precoding-oriented system trained on the overhead-performance tradeoff is shown in green, and it outperforms the other methods for the small feedback overhead regime. In the large feedback overhead regime, the reconstruction-oriented system (similar to [13]) followed by ZF provides results comparable to our approach, making the two methodologies equivalent when considering the overhead-performance tradeoff. Our methods also provide a significant gain in performance compared to [14] (black line). This gain may be explained by the adaptability of our end-to-end solution, which includes a learning mechanism that directly accounts for the feedback overhead in the loss function, as explained in Section III. Note that with our method the user's DNN is able to adapt to the overhead budget; i.e., the user is able to learn the efficient precoding-oriented feedback scheme. As expected, in the large feedback overhead regime, reconstruction followed by MRT/ZF approaches the perfor- mance of the CSIT case. In fact, as the overhead increases, the BS is able to reconstruct the channel with decreasing distortion; hence, the traditional precoding algorithms can rely on more reliable channel estimates. V. CONCLUSION In this paper, we have analyzed the tradeoff between feedback overhead, performance, and distortion in the CSI feedback problem for multi-user massive MIMO in FDD. We showed that the proposed deep learning-based precoding- oriented CSI feedback mechanism provides a higher sum achievable rate than conventional methods for the small overhead regime. Conventional methods based on channel reconstruction provide equivalent performance to our approach when the system allows for a large overhead. This work shows the potential of the precoding-oriented CSI feedback mechanism: for a limited overhead budget, the precoding- oriented feedback representation of the channel allows the BS to design better linear precoders to serve the users. This would potentially allow large massive MIMO arrays to realize their full potential in 6G, in terms of spectral efficiency. REFERENCES [1] E. Bj ̈ornson, E. G. Larsson, and T. L. Marzetta, "Massive MIMO: Ten myths and one critical question," IEEE Communications Magazine, vol. 54, no. 2, pp. 114–123, 2016. [2] D. J. Love, R. W. Heath, V. K. N. Lau, D. Gesbert, B. D. Rao, and M. Andrews, "An overview of limited feedback in wireless communi- cation systems," IEEE Journal on Selected Areas in Communications, vol. 26, no. 8, pp. 1341–1365, 2008. [3] X. Rao and V. K. N. Lau, "Distributed compressive CSIT estimation and feedback for FDD multi-user massive MIMO systems," IEEE Transactions on Signal Processing, vol. 62, no. 12, pp. 3261–3271, 2014. [4] G. Caire and S. Shamai, "On the achievable throughput of a multiantenna gaussian broadcast channel," IEEE Transactions on Information Theory, vol. 49, no. 7, pp. 1691–1706, 2003. [5] C. Windpassinger, R. Fischer, T. Vencel, and J. Huber, "Precoding in multiantenna and multiuser communications," IEEE Transactions on Wireless Communications, vol. 3, no. 4, pp. 1305–1316, 2004. [6] M. Costa, "Writing on dirty paper (corresp.)," IEEE Transactions on Information Theory, vol. 29, no. 3, pp. 439–441, 1983. [7] E. Bj ̈ornson, M. Bengtsson, and B. Ottersten, "Optimal multiuser trans- mit beamforming: A difficult problem with a simple solution structure [lecture notes]," IEEE Signal Processing Magazine, vol. 31, no. 4, pp. 142–148, 2014. [8] J. Guo, C.-K. Wen, S. Jin, and G. Y. Li, "Overview of deep learning- based CSI feedback in massive MIMO systems," IEEE Transactions on Communications (Early Access), 2022. [9] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning. MIT Press, 2016, http://www.deeplearningbook.org. [10] C.-K. Wen, W.-T. Shih, and S. Jin, "Deep learning for massive MIMO CSI feedback," IEEE Wireless Communications Letters, vol. 7, no. 5, pp. 748–751, 2018. [11] J. Ball ́e, V. Laparra, and E. P. Simoncelli, "End-to-end optimized image compression," in International Conference on Learning Representations, 2017. [12] J. Ball ́e, D. Minnen, S. Singh, S. J. Hwang, and N. Johnston, "Variational image compression with a scale hyperprior," in International Conference on Learning Representations, 2018. [13] M. B. Mashhadi, Q. Yang, and D. G ̈und ̈uz, "Distributed deep convo- lutional compression for massive MIMO CSI feedback," IEEE Trans- actions on Wireless Communications, vol. 20, no. 4, pp. 2621–2633, 2021. [14] F. Sohrabi, K. M. Attiah, and W. Yu, "Deep learning for distributed channel feedback and multiuser precoding in FDD massive MIMO," IEEE Transactions on Wireless Communications, vol. 20, no. 7, pp. 4044–4057, 2021. [15] M. Chen, J. Guo, C.-K. Wen, S. Jin, G. Y. Li, and A. Yang, "Deep learning-based implicit CSI feedback in massive MIMO," IEEE Trans- actions on Communications, vol. 70, no. 2, pp. 935–950, 2022. [16] S. Lloyd, "Least squares quantization in PCM," IEEE Transactions on Information Theory, vol. 28, no. 2, pp. 129–137, 1982. [17] J. B ́egaint, F. Racap ́e, S. Feltman, and A. Pushparaja, "CompressAI: A pytorch library and evaluation platform for end-to-end compression research," arXiv preprint arXiv:2011.03029, 2020. J. Hwang, "TensorFlow and Compression: Learned data compression," 2022. [Online]. Available: http://github.com/tensorflow/compression E. Agustsson, [18] J. Ball ́e, S. [19] R. W. Heath Jr. and A. Lozano, Foundations of MIMO Communication. Cambridge University Press, 2018.
http://arxiv.org/abs/2302.12011v1
2023-02-22T17:56:54
2023-02-22T17:56:54
A Generalized Weighted Loss for SVC and MLP
Usually standard algorithms employ a loss where each error is the mere absolute difference between the true value and the prediction, in case of a regression task. In the present, we introduce several error weighting schemes that are a generalization of the consolidated routine. We study both a binary classification model for Support Vector Classification and a regression net for Multi-layer Perceptron. Results proves that the error is never worse than the standard procedure and several times it is better.
[ "Filippo Portera" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12011v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12011v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
A Generalized Weighted Loss for SVC and MLP Filippo Portera 3 2 0 2 b e F 2 2 ] G L . s c [ 1 v 1 1 0 2 1 . 2 0 3 2 : v i X r a Abstract-Usually standard algorithms employ a loss where each error is the mere absolute difference between the true value and the extrapolation, in case of a regression task. In the present, we introduce several error weighting schemes that are a generalization of the consolidated routine. We study both a binary classification model for Support Vector Classification and a regression net for Multy- layer Perceptron. Results proves that the error is never worse than the standard procedure and several times it is better. Keywords-Machine Learning, Binary Classification, SVC, Re- gression, MLP. This implies a quadratic problem that is different from traditional SVC: The Lagrangian would be: L = 1 ~v 2 || || 2 + C l X i=1 ξiwi l − X i=1 l αi(yi(~v′ ~xi + b) 1 + ξi) (7) − I. INTRODUCTION subject to: We would like to show that a standard loss generalization for binary classification (in our case we have chosen SVC and MLP) could produce results not worse w.r.t. the consolidated loss. In fact, the possibility that a given data-set presents non- IID samples can be exploited by these generalized losses. The loss studied to generalize SVC and the full optimization problem are: P = 1 ~v 2 || || 2 + C l X i=1 ξiwi suject to: and: yi(~v′ ~xi + b) ξi 1 − ≥ 1, .., l i ∈ ξi 0 ≥ 1, .., l i ∈ (1) (2) (3) where ~v represents the linear weights of the extraploator function, l is the number of training examples, C is a trade- off hyper-parameter, ξi is the error on sample i, and wi are some scalar weights that are a function of a distribution si of the samples: si = l X j=1 (e−γS||~xi−~xj|| 2 ) (4) Other distribution can be adopted (e.g., 1 + the RBF norm instead of the RBF dot product). And let: syi = yiyj l X j=1 (e−γS ||~xi−~xj || 2 ) (5) with γS additional hyper-parameter. Here lies the complex- ity of the algorithm since this calculation is O(l2). Perhaps it can be overtaken with pattern sampling or, in the case of MLP with a sort of weights learning. ηiξi − X i=1 αi ≥ ηi ≥ 0 0 1, .., l 1, .., l i i ∈ ∈ (8) (9) (10) Applying the KKT condition for optimaility: ∂L ∂~v 1 = ~v − X i=1 αiyi ~xi = 0 ~v = ⇒ 1 X i=1 αiyi ~xi (11) ∂L ∂~ξ = ~α + ~η C ~w = 0 ~α ≤ ⇒ C ~w − ∂L ∂b = l X i=1 αiyi = 0 (12) (13) Thus, the dual becomes: D = l X i=1 αi − 1 2 l l X i=1 X j=1 subject to: αiyiαjyjK( ~xi, ~xj) (14) αi 0 ≤ ≤ Cwi 1, .., l i ∈ l X i=1 αiyi = 0 (15) (16) This is very similar to standard SVC dual [4], apart the constraints on the lagrangian multipliers. We wrote an ad-hoc quadratic optimizer for this problem1, with a SMO-like method ([2]). We iteratively select 2 distinct multipliers and we modify them with an attempt to improve the dual objective function: αt+1 i = αt i + νyi αt+1 j = αt j − νyj (17) (18) wi = f (si) (6) 1The code of this work is available at OSF GWL Project The motivation is the enforcement of the second dual constraint on the P l i=1 αiyi = 0. The ν in the optimal direction is obtained deriving D by ν as it has been done in section 5.1 of ([5]). This direction is: yj yi − ν = − P l p=1 αpypK( ~xj , ~xp) + P l p=1 αpypK( ~xi, ~xp) K( ~xi, ~xi) 2K( ~xi, ~xj) + K( ~xj, ~xj) − (19) Once the candidate ν has been determined, it has to be clipped in order to satisfy the constraints on both the multi- pliers. At each iteration we compute b with the suport vectors that lie in the margin (for which 0 < αi < Cwi) as it has been reported in How to calculate b. The kernel used to compute K(~x, ~y) is RBF with hyper- parameter γK. The whole procedure is iterated 50l2 times for each training problem. II. RELATED WORKS In ([1]) they learn the loss weights directly from the training and validation sets. They assert that there is a substantial improvement in the generalization error and they also provide theoretical bounds. III. METHOD We use the acronym GWL for Generalized Weighted Loss. the Python 3 package We tried 4 distinct algorithms: sklearn.svm.SVC, GWL SVC with wi = 1, GWL (here we mean the generalized loss with wi's built as described), and GWL with random weights. We would like to know if, in the general case, the optimal solutions use wi not equal to 1. We have selected at least 8 cases of study, to determine the weight wi of a sample i. Therefore, some evaluated weighting functions are: 1) 2) 3) 4) 5) 6) 7) 8) wi = √si wi = si wi = s2 i wi = 1 √si wi = wi = 1 si 1 s2 i wi = syi wi = 1 + rand[0, 1] (20) (21) (22) (23) (24) (25) (26) (27) Algorithm sklearn.svm.SVC GWL SVC GWL(1) GWL(2) GWL(3) GWL(4) GWL(5) GWL(6) GWL(8) GWL(8) GWL(8) GWL(8) Data-set Ionosphere Ionosphere Ionosphere Ionosphere Ionosphere Ionosphere Ionosphere Ionosphere Ionosphere Ionosphere Ionosphere Ionosphere Mean F1 0.968638 0.970651 0.977172 0.977172 0.977172 0.977172 0.977359 0.977538 0.977292 0.977292 0.974767 0.975011 Time 0m3,130s 62m34,796s 175m44,060s 175m41,022s 187m1,032s 187m59,323s 3h:07m:41s 2h:58m:42s 3h:24m:32s 3h:08m:31s 3h:07m:36s 3h:05m:40 TABLE I SVC AND GWL WITH IONOSPHERE DATA-SET Algorithm sklearn.svm.SVC GWL SVC GWL(1) GWL(2) GWL(3) GWL(4) GWL(5) GWL(6) GWL(7) GWL(8) Data-set Mean F1 0.886610 Sonar 0.904489 Sonar 0.909337 Sonar 0.916513 Sonar 0.908717 Sonar 0.913580 Sonar 0.916303 Sonar 0.916671 Sonar 0.911098 Sonar 0.907057 Sonar Time 0m2,396s 16m19,019s 28m8,391s 31m58,852s 36m26,726s 40m51,567s 45m46,03s 41m:17,92s TABLE II SVC AND GWL WITH SONAR DATA-SET The case 8 is useful to show that a weighting scheme based on the training distribution is more convenient w.r.t. a random weighting scheme. IV. RESULTS We explored a 2 dimensional hyper-parameters grid for sklearn.svm.svc, involving γK and C. While we used the additional hyper-parameter γS to generete the loss weights. That is the reason why the experiments with loss weights take more time to terminate. Obviously, the second grid is an extension of (it covers) the first one. Those are the results for the 5-fold cross-validation with data-sets extracted from the UCI website, and opportunely treated (double or inconsistent samples removed, shuffling): We also have tried 2 MLP nets with PyTorch on a regression task with wi = si and results are interesting (but the random initialization of the net weights should be considered in this case: Wine data-set: 3961 samples, 11 features; MLP: 100, 50, 20, 1, and Wine data-set, different MLP 100, 80, 40, 1 nodes Algorithm sklearn.svm.SVC GWL SVC GWL(1) GWL(2) GWL(3) GWL(4) GWL(5) GWL(6) GWL(8) Data-set Mean F1 0.959825 Breast 0.958628 Breast 0.963625 Breast 0.963896 Breast 0.967909 Breast 0.966109 Breast 0.964666 Breast 0.964666 Breast 0.961837 Breast Time 0m3,387s 174m47,138s 432m3,673s 448m14,994s 443m59,346s 401m18,642s 6h:48m:01s 6h:34m:13s 8h:02m:57s TABLE III SVC AND GWL WITH BREAST DATA-SET scheme should be tested. The next step would be to leverage this method in order to learn the weights. Perhaps this gen- eralization could be employed in other contests such as SVR, multi-class classification, and other MLPs. REFERENCES [1] "Zhao Sen et al.", Metric-Optimized Example Weights, 2019. [2] Aiolli F, Sperduti A., An efficient SMO-like algorithm for multiclass SVM, Proceedings of the 12th IEEE Workshop on Neural Networks for Signal Processing, pp, 297–306, 2002/9/6 [3] Book: Deep Learning, MIT Press, 2016 [4] Book: Statistical Learning Theory WILEY, 1998 [5] Portera F., A generalized quadratic loss for SVM and Deep Neural Networks LOD 2020 Conference work Algorithm sklearn.svm.SVC GWL SVC GWL(1) GWL(2) GWL(3) GWL(4) GWL(5) GWL(6) GWL(8) Data-set Mean F1 0.610351 Statlog 0.644108 Statlog 0.651278 Statlog 0.651278 Statlog 0.644329 Statlog 0.649529 Statlog 0.651947 Statlog 0.652786 Statlog 0.646312 Statlog Time 0m38,297s 1725m29,269s 5370m49,360s 5499m18,497s 5638m2,544s 5692m55,211s 5351m40,975s 5546m26,466s 83h:50m:08s TABLE IV SVC AND GWL WITH STATLOG DATA-SET Standard MLP MAE 0.5871212 0.5694444 0.5568182 0.5580808 0.54924244 0.510101 gamma Best 10 10 1 0.01 0.1 100 Best Loss MLP MAE 0.57575756 (1) 0.5530303 (2) 0.53661615 (3) 0.540404 (4) 0.54671717 (5) 0.510101 (6) TABLE V FIRST MLP WITH WINE DATA-SET per layer. The theory underneath deep neural architectures can be foun in [3]. In this scenario it would be useful to determine the dif- ference between eah couple of values, to understand which is the strategy that, in the most of the cases, performs best with the test set. An idea is to learn weights, starting to run in parallel n nets with different random weight vectors and selecting at each parallel one the best vector in terms of MAE and perturbing it and re-run the procedure for a given amount of iterations. GWL has been written in C. The regression code for the wine data-set has been written in Python 3.10 and torch. Hardware employed: a notebook with 8 cores Intel(R) i5- 10210U CPU @ 1.60GHz and 16GB of RAM, and a PC with 16 cores 11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz and 32 GB of RAM. Baseline SVC algorithms have been measured on the note- book, while GWL times have been determined with the PC. V. CONCLUSION Results confirm the theory, they're not worse than the particular case. In particular, it looks like that the preferred generalization scheme is the one that gives more importance to patterns that are isolated, on 3 data-sets from 4 for the SVC case. Nevertheless it should be considered the fact concerning the unique geometry of each data-set, so each generalization Standard MLP MAE 0.5694444 0.53661615 0.5378788 0.5770202 0.54924244 0.56565654 gamma Best 10 1 100 10 0.01 1 Best Loss MLP MAE 0.5580808 (1) 0.5290404 (2) 0.5378788 (3) 0.5580808 (4) 0.5252525 (5) 0.5555556 (6) TABLE VI SECOND MLP WITH WINE DATA-SET
http://arxiv.org/abs/2302.11517v1
2023-02-22T17:39:00
2023-02-22T17:39:00
A Global and Patch-wise Contrastive Loss for Accurate Automated Exudate Detection
Diabetic retinopathy (DR) is a leading cause of blindness worldwide. Early diagnosis is essential in the treatment of diabetes and can assist in preventing vision impairment. Since manual annotation of medical images is time-consuming, costly, and prone to subjectivity that leads to inconsistent diagnoses, several deep learning segmentation approaches have been proposed to address these challenges. However, these networks often rely on simple loss functions, such as binary cross entropy (BCE), which may not be sophisticated enough to effectively segment lesions such as those present in DR. In this paper, we propose a loss function that incorporates a global segmentation loss, a patch-wise density loss, and a patch-wise edge-aware loss to improve the performance of these networks on the detection and segmentation of hard exudates. Comparing our proposed loss function against the BCE loss on several state-of-the-art networks, our experimental results reveal substantial improvement in network performance achieved by incorporating the patch-wise contrastive loss.
[ "Wei Tang", "Yinxiao Wang", "Kangning Cui", "Raymond H. Chan" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11517v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11517v1", "@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 b e F 2 2 ] V I . s s e e [ 1 v 7 1 5 1 1 . 2 0 3 2 : v i X r a A Global and Patch-wise Contrastive Loss for Accurate Automated Exudate Detection Wei Tang1,2, Yinxiao Wang1,3, Kangning Cui∗1,2, and Raymond H. Chan1,2 1 Hong Kong Centre for Cerebro-Cardiovascular Health Engineering 2 Department of Mathematics, City University of Hong Kong 3 Department of Computer Science, City University of Hong Kong Abstract Diabetic retinopathy (DR) is a leading cause of blindness worldwide. Early diagnosis is essential in the treatment of diabetes and can assist in preventing vision impairment. Since manual annotation of medical images is time-consuming, costly, and prone to subjectivity that leads to inconsistent diagnoses, several deep learning segmentation approaches have been proposed to address these challenges. However, these networks often rely on simple loss functions, such as binary cross entropy (BCE), which may not be sophisticated enough to effectively segment lesions such as those present in DR. In this paper, we propose a loss function that incorporates a global segmentation loss, a patch-wise density loss, and a patch-wise edge-aware loss to improve the performance of these networks on the detection and segmentation of hard exudates. Comparing our proposed loss function against the BCE loss on several state-of-the-art networks, our experimental results reveal substantial improvement in network performance achieved by incorporating the patch-wise contrastive loss. Index Terms: Patch-wise Contrastive Loss, Hard Exudates, Diabetic Retinopathy, Medical Image, Deep Learning. 1 Introduction Fundus images are medical images of the interior surface of the eye, including the retina, optic disc, blood vessels, and other textures, which are typically captured using a specialized camera called a fundus camera [1]. One of the most significant tasks using fundus images is the detection of diabetic retinopathy (DR), which is a complication of diabetes that affects the eyes. The failure to detect DR can result in loss of vision or even blindness. Early detection of DR is therefore essential in the treatment of diabetes and can assist in preventing vision impairment [2]. Besides, DR can increase the risk of cardiovascular diseases (CVDs) as well [3], [4]. Computer-assisted diagnosis (CAD), which uses algorithms implemented in computers to analyze medical images and aid in the diagnosis, is increasingly being used in the segmentation of DR lesions [5]. The manual labeling of DR lesions can be both time-consuming and costly, as well as prone to subjectivity, resulting in inconsistent diagnoses. Hence, deep learning-based CAD methods are preferred as they have the capability to precisely identify and segment DR lesions, making them a useful tool for assisting in the diagnostic process with consistency [6], [7]. However, many of the aforementioned networks use relatively simple loss functions, such as the dice loss or the binary cross entropy (BCE) loss, which may not be sufficiently advanced to accurately segment the lesions commonly found in fundus images [8], [9]. This work introduces a loss function that incorporates a global segmentation loss (the BCE loss), a patch-wise density loss that contrasts lesion-dense and lesion- sparse patches, and a patch-wise edge-aware loss that contrasts lesion boundaries and backgrounds. Since ∗Corresponding Author. 1 Figure 1: Hard exudates in a fundus image. The red pixels in the right figures show the locations of hard exudates. the density and spatial distribution of lesions in medical images is non-uniform and the lesion boundaries are often blurred, the incorporation of patch-wise contrastive losses enhances the network performances on automated exudate segmentation substantially. This article is organized as follows. Section 2 gives the related works on automated detection of exu- dates, deep learning in medical image segmentation, and contrastive learning. The proposed loss function is introduced in Section 3. Experimental results on a benchmark DR lesion dataset are presented in Section 4. The conclusion and future works are discussed in Section 5. 2 Related Works 2.1 Segmentation of Diabetic Retinopathy Image segmentation refers to the process of dividing an image into distinct segments, each of which corre- sponds to a different object or portion of the image. One of the primary tasks for DR is the segmentation of hard exudates (see Figure 1), which are irregular white or yellowish-white accumulations caused by the leakage of plasma that manifest in the retina as dots, patches, or circles [2]. Automated exudate detection is a challenging task due to the uneven illumination, poor contrast, and color variation present in retinal images, but it is of significant practical importance as early detection can prevent potential blindness [7], [10]. 2.2 Deep Learning in Medical Image Segmentation Numerous deep neural networks have been developed for the purpose of segmenting medical images [8], [9], [11], [12]. In [8], a segmentation network called U-Net is proposed to segment medical images by integrating a contracting path that captures image context and a symmetric expansive path that ensures the end-to-end structure. Several variants of the U-Net architecture have been proposed in the literature owing to its high efficacy and robustness in medical image segmentation. UNet++ introduces nested U-Net blocks and deep supervi- sion to capture features at multiple scales and thus enable more accurate segmentation [9]. Deep Residual U-Net (ResUnet) improves upon the U-Net architecture by incorporating residual connections between the encoding and decoding pathways that facilitate information flow and save computations [13]. While U-Net can achieve satisfying segmentation results for medical images, it heavily relies on skip connections, which can dilute spatial information as the network deepens and it may struggle to capture fine-grained details due to its small receptive field [8], [11]. Context encoder network (CE-Net) uses dense 2 atrous convolution block and residual multi-kernel pooling, enabling it to preserve spatial information and capture fine-grained details [11]. 2.3 Contrastive Learning Contrastive learning is designed as a self-supervised technique that learns a representation of data by con- trasting similar (positive) and dissimilar (negative) pairs of samples. The contrastive learning models learn feature spaces in which similar samples are mapped closely together while dissimilar samples are mapped far apart [14]. Unsupervised contrastive learning has demonstrated considerable efficacy in various applications, however, the learned feature representation may not be optimized for the specific task due to the lack of labels [15], [16]. Supervised contrastive learning addresses the limitations of unsupervised contrastive learning by incor- porating labels into the learning process. Unlike unsupervised contrastive learning, which generates positive and negative pairs using data augmentation without labels, supervised contrastive learning defines positive and negative pairs as samples with the same and different labels, respectively [15]. The supervised contrastive learning loss function is then optimized to maximize the similarity between positive pairs while minimiz- ing the similarity between negative pairs. By doing so, supervised contrastive learning can learn a more discriminative feature representation that is well-suited for downstream tasks such as exudate detection. There has emerged a group of approaches that utilize multi-level features to conduct contrastive learning for semi-supervised semantic segmentation [17], [18]. It has been demonstrated that applying contrastive learning in both local and global feature spaces is promising in refining the model performance. However, there is still a lack of exploration of supervised cross-level contrastive learning in medical image analysis. In the next section, we introduce the proposed loss function that takes both global and local features into account. 3 Methodology Given a medical image dataset containing N samples D = {(xi, yi), i = 1, ..., N }, where each pair of the data record is composed of an input RGB image xi and the corresponding binary ground truth (GT) mask yi. The objective is to learn a model that produces a pixel-wise segmentation map ˆyi for each xi while minimizing the difference between ˆyi and yi. In this work, we propose a supervised loss function that incorporates a global segmentation loss that is the BCE loss, and the patch-wise density and edge-aware loss motivated by supervised contrastive learning: Ltotal = Lsup + αLpd + βLpe. (1) The α and β are hyper-parameters adopted to balance the three terms in the loss function. 3.1 Patch-wise Density Loss One of the principal challenges in medical image segmentation is the treatment of highly heterogeneous and sophisticated anatomical structures. Namely, the non-uniform density and spatial distribution of foreground pixels within the source image is one of the typical difficulties of enhancing deep learning models' reliability. To tackle this issue, we design a patch-wise density loss based on lesion pixel proportions of patches to sufficiently contrast the localized representations of similar patches against dissimilar patches in a supervised way. Concretely, for each input pair (xi, yi), we divide the raw image and the label into n×n patches denoted by xp i and yp i , where p = 1, ..., n×n. For example, retinal images commonly exhibit dispersed patterns of DR lesions, such as hard exudates, resulting in a diverse portion of pixels belonging to the target segmentation class in each patch [2], [7]. Hence, we divide all the xp i 's into two sets depending on the proportion of lesion pixels: lesion-sparse patch (proportion ≤ 0.5) and lesion-dense patch (proportion > 0.5). Patches that differ in label distributions, i.e., in lesion-sparse and lesion-dense patches, should have distinct representations in the desired feature space, thus automatically forming a negative pair. Inspired by [19], we regularize the 3 feature map for each patch into a one-dimensional vector by: f p i = (cid:80) i ◦ yp i h,w Fp (cid:80) h,w yp i , (2) i represents the activation map of patch yp where Fp multiplication operation. After obtaining the feature vectors, the contrastive loss for a particular f p patch-wise density loss Lpd for the entire mini-batch is formulated as: i in the penultimate layer, and ◦ refers to the element-wise i and the Lpd = 1 |M| (cid:88) f p i ∈M L(f p i , P(p), N (p)), with L(f p i , P(p), N (p)) = −1 |P(p)| (cid:88) log f q i ∈P(p) exp(sim(f q (cid:80) i , f p exp(sim(f k i )/τ ) i , f p i )/τ ) f k i ∈P(p)∪N (p) (3) (4) , where | * | counts the cardinality of a set, P(p) denotes the set of positives that excludes f p i , N (p) is the corresponding negative set, and M represents the set of stored features in every mini-batch. The cosine similarity function sim(*, *) is applied here to measure the similarity between two feature vectors, and τ stands for the temperature. Considering the constrained computing resources, we perform a random sampling of all positive and negative patches and maintain a memory bank M to store the features in every mini-batch. 3.2 Patch-wise Edge-aware Loss To enable efficient detection of lesion locations, it is essential to accurately identify the boundaries of the In order to improve the model's region of interest and distinguish it from the surrounding structures. sensitivity in recognizing boundaries between the foreground and background, we implement a patch-wise edge-aware loss to dynamically analyze the pixels around the lesion boundaries. i , yp Given the patches (xp i ), morphological operations are exploited to extract the inner and outer contour masks of each patch's binary GT mask yp i . To derive the inner contour which only contains lesion pixels that lie inside the edge, the eroded label map is subtracted from the original binary mask yp i , whereas the outer contour is acquired by subtracting yp from the dilated one. Specifically, for lesion-dense patches, i the iterations for dilation and erosion are set as two. In contrast, since lesion-sparse patches often involve scattered and tiny pathological spots together with a wide area of background, the iterations for dilation and erosion are set as five and one, respectively, to gain extra information about the background. We compose the patches together to form the final inner and outer contour masks after the morphological operations, demonstrated in Figure 2. Similar to (2), the normalized edge-related features f e i are obtained from the activation map with masked average pooling over inner and outer contour masks. Finally, the patch-wise edge-aware loss Lpe is defined as: i and background-related features f b Lpe = 1 2|B| (cid:88) L(f t, P(t), N (t)). f t∈{f e i ,f b i } (5) Here, B denotes the images in each batch. If f t is an edge-related feature, then P(t) is the set of other edge- related features and N (t) designates all the background-related features in a mini-batch, and vice versa. The model is expected to develop the necessary ability to distinguish pixels around the border regions of pathological areas, especially for those fine-grained lesions that are strenuous to detect by adopting the patch-wise edge-aware loss Lpe. 4 (a) GT (b) Inner contour (c) Outer contour Figure 2: The derived inner and outer contours by the GT mask. 4 Numerical Results 4.1 Dataset To validate the efficacy of our proposed method, we leverage the Indian diabetic retinopathy image dataset (IDRiD) [20] dataset for experiments. For our specific segmentation task, we utilize the subset which contains annotations for hard exudates. This subset consists of 81 color fundus JPEG images with a resolution of 4288×2848, of which 54 are for training. Due to the limited size of the dataset, we take advantage of several data augmentation techniques, including random horizontal flipping, rotation, and brightness and contrast adjustment to prevent overfitting. In practice, the rotation degree is randomly selected from -180◦ to +180◦, and the scales of brightness and contrast variation are both from 50% to 150%. All images are resized and cropped into 256×256 pixels in size as network inputs. 4.2 Experimental Setup The following state-of-the-art image segmentation models are employed as backbones: U-Net [8], UNet++ [9], ResUnet [13], and CE-Net [11]. Each model is optimized using Adam optimizer with a batch size of 8. The initial learning rate is set as 10−3 and decays by 0.1 after every 80 epochs. For the hyper-parameters, every image is partitioned into 16 × 16 patches, and the temperature parameter τ is set as 0.05. The α and β in the total loss function Ltotal are set to be 0.02 and 0.1, respectively. In the training process, all models will be trained for 240 epochs to ensure convergence. The experiments are conducted based on the PyTorch library using an NVIDIA GeForce RTX 3090 GPU [21]. 4.3 Results and Discussion The quantitative results of the proposed loss function utilizing different backbones are shown in Table 1, measured in four metrics: precision, recall, F1 score, and IoU. Experiments show that the proposed loss significantly outperforms the BCE loss of the compared networks in most cases. Although the BCE loss achieves better precision in U-Net and CE-Net, the superior performance of the proposed loss yields in terms of F1 score and IOU indicates a better alignment with the ground truth. The qualitative results of two instances from the testing set are visualized in Figure 3. Notably, our proposed loss demonstrates the ability to effectively recognize small lesion spots and unclear boundaries while avoiding misclassification of the optic disc. 5 Figure 3: Comparison of segmentation results of several networks without and with the patch-wise density and edge-aware loss (denoted by w/o CL and w/ CL). The first row shows two pairs of input images and corresponding GT masks. The second to the last rows show the segmentation results of four networks, with every two columns showing the predicted masks w/o CL and w/ CL. Yellow boxes emphasize the segmentation of regions of the optic disc and small lesion spots. U-Net UNet++ IoU Model Method Precision Recall F1 score 57.14% 81.54% 49.95% 64.67% 59.16% 66.02% 50.99% 80.72% 76.85% 53.25% 67.64% 64.52% 77.94% 65.14% 68.54% 54.29% 80.49% 50.44% 83.01% 58.87% 66.58% 51.61% 45.49% 84.03% 40.96% 54.93% 54.91% 60.29% 45.12% 74.46% BCE Proposed BCE Proposed BCE Proposed BCE Proposed ResUnet CE-Net 65.69% 58.32% Table 1: Performances of four deep networks using the proposed loss comparing against the BCE loss on the hard exudates of IDRiD dataset. Bold values indicate the loss with better performance in terms of each metric. 6 5 Conclusions The study demonstrates that integrating patch-wise lesion density and edge information through the su- pervised contrastive loss significantly enhances the performances of deep neural networks on the automated detection of hard exudates. In the future, we plan to extend the application of the proposed loss to accurately detect and segment other DR lesions. Additionally, applying deep learning approaches with the proposed loss to cardiac segmentation is promising and warrants further investigation as well [22]. 6 Acknowledgement This work was partially supported by HKRGC Grants No. CUHK14301718, CityU11301120, CityU Grant 9380101, CityU Grant 11309922, N CityU214/19, C1013-21GF. We thank COCHE (https://www.hkcoche.org/) for the support of this study. References [1] M. D. Abr`amoff, M. K. Garvin, and M. Sonka, "Retinal imaging and image analysis," IEEE Rev. Biomed. Eng., vol. 3, pp. 169–208, 2010. [2] W. L. Alyoubi, W. M. Shalash, and M. F. Abulkhair, "Diabetic retinopathy detection through deep learning techniques: A review," Inform. Med. Unlocked, vol. 20, p. 100 377, 2020. [3] R. Kawasaki et al., "Is diabetic retinopathy related to subclinical cardiovascular disease?" Ophthal- mology, vol. 118, no. 5, pp. 860–865, 2011. [4] N. Cheung and T. Y. Wong, "Diabetic retinopathy and systemic vascular complications," Prog. Retin. Eye Res., vol. 27, no. 2, pp. 161–176, 2008. [5] M. R. K. Mookiah et al., "Computer-aided diagnosis of diabetic retinopathy: A review," Comput. Biol. Med, vol. 43, no. 12, pp. 2136–2155, 2013. [6] N. Asiri, M. Hussain, F. Al Adel, and N. Alzaidi, "Deep learning based computer-aided diagnosis systems for diabetic retinopathy: A survey," Artif. Intell. Med., vol. 99, p. 101 701, 2019. [7] Z. Si, D. Fu, Y. Liu, and Z. Huang, "Hard exudate segmentation in retinal image with attention mechanism," IET Image Process., vol. 15, no. 3, pp. 587–597, 2021. [8] O. Ronneberger, P. Fischer, and T. Brox, "U-net: Convolutional networks for biomedical image seg- mentation," in Proc MICCAI, Springer, 2015, pp. 234–241. [9] Z. Zhou, M. M. Rahman Siddiquee, N. Tajbakhsh, and J. Liang, "Unet++: A nested u-net architecture for medical image segmentation," in Proc. Deep Learn. Med. Image Anal. Multimodal Learn. Clin. Decis. Support., Springer, 2018, pp. 3–11. [10] C. I. S ́anchez, M. Garc ́ıa, A. Mayo, M. I. L ́opez, and R. Hornero, "Retinal image analysis based on mixture models to detect hard exudates," Med. Image Anal., vol. 13, no. 4, pp. 650–658, 2009. [11] Z. Gu et al., "Ce-net: Context encoder network for 2d medical image segmentation," IEEE Trans. Med. Imaging, vol. 38, no. 10, pp. 2281–2292, 2019. [12] F. Pan et al., "Dual-view selective instance segmentation network for unstained live adherent cells in differential interference contrast images," arXiv preprint arXiv:2301.11499, 2023. [13] Z. Zhang, Q. Liu, and Y. Wang, "Road extraction by deep residual u-net," IEEE Geosci. Remote. Sens. Lett., vol. 15, no. 5, pp. 749–753, 2018. [14] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, "A simple framework for contrastive learning of visual representations," in Proc. ICML, PMLR, 2020, pp. 1597–1607. [15] P. Khosla et al., "Supervised contrastive learning," Adv. Neural Inf. Process. Syst., vol. 33, pp. 18 661– 18 673, 2020. [16] S. Camalan et al., "Detecting change due to alluvial gold mining in peruvian rainforest using recursive convolutional neural networks and contrastive learning," in Fall Meeting, AGU, 2022. 7 [17] H. Wu, Z. Wang, Y. Song, L. Yang, and J. Qin, "Cross-patch dense contrastive learning for semi- supervised segmentation of cellular nuclei in histopathologic images," in Proc. CVPR, 2022, pp. 11 666– 11 675. [18] X. Zhao et al., "Cross-level contrastive learning and consistency constraint for semi-supervised medical image segmentation," in Proc. IEEE Int. Symp. Biomed. Imaging, IEEE, 2022, pp. 1–5. [19] Q. Liu, C. Chen, J. Qin, Q. Dou, and P. Heng, "Feddg: Federated domain generalization on medi- cal image segmentation via episodic learning in continuous frequency space," in Proc. CVPR, 2021, pp. 1013–1023. [20] P. Porwal et al., "Indian diabetic retinopathy image dataset (idrid): A database for diabetic retinopathy screening research," Data, vol. 3, no. 3, p. 25, 2018. [21] A. Paszke et al., "Pytorch: An imperative style, high-performance deep learning library," Adv. Neural Inf. Process. Syst., vol. 32, 2019. [22] C. Chen et al., "Deep learning for cardiac image segmentation: A review," Front. Cardiovasc. Med., vol. 7, p. 25, 2020. 8
http://arxiv.org/abs/2302.11510v4
2023-03-30T15:00:52
2023-02-22T17:27:03
Selective experience replay compression using coresets for lifelong deep reinforcement learning in medical imaging
Selective experience replay is a popular strategy for integrating lifelong learning with deep reinforcement learning. Selective experience replay aims to recount selected experiences from previous tasks to avoid catastrophic forgetting. Furthermore, selective experience replay based techniques are model agnostic and allow experiences to be shared across different models. However, storing experiences from all previous tasks make lifelong learning using selective experience replay computationally very expensive and impractical as the number of tasks increase. To that end, we propose a reward distribution-preserving coreset compression technique for compressing experience replay buffers stored for selective experience replay. We evaluated the coreset compression technique on the brain tumor segmentation (BRATS) dataset for the task of ventricle localization and on the whole-body MRI for localization of left knee cap, left kidney, right trochanter, left lung, and spleen. The coreset lifelong learning models trained on a sequence of 10 different brain MR imaging environments demonstrated excellent performance localizing the ventricle with a mean pixel error distance of 12.93 for the compression ratio of 10x. In comparison, the conventional lifelong learning model localized the ventricle with a mean pixel distance of 10.87. Similarly, the coreset lifelong learning models trained on whole-body MRI demonstrated no significant difference (p=0.28) between the 10x compressed coreset lifelong learning models and conventional lifelong learning models for all the landmarks. The mean pixel distance for the 10x compressed models across all the landmarks was 25.30, compared to 19.24 for the conventional lifelong learning models. Our results demonstrate that the potential of the coreset-based ERB compression method for compressing experiences without a significant drop in performance.
[ "Guangyao Zheng", "Samson Zhou", "Vladimir Braverman", "Michael A. Jacobs", "Vishwa S. Parekh" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11510v4", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11510v4", "@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" ]
Selective experience replay compression using coresets for lifelong deep reinforcement learning in medical imaging Guangyao Zheng∗ Samson Zhou† Vladimir Braverman‡ Michael A. Jacobs§ Vishwa S. Parekh(cid:79) 3 2 0 2 r a M 0 3 ] G L . s c [ 4 v 0 1 5 1 1 . 2 0 3 2 : v i X r a March 31, 2023 Abstract Selective experience replay is a popular strategy for integrating lifelong learning with deep reinforcement learning. Selective experience replay aims to recount selected experiences from previous tasks to avoid catastrophic forgetting. Furthermore, selective experience replay based techniques are model agnostic and allow experiences to be shared across different models. However, storing experiences from all previous tasks make lifelong learning using selective experience replay computationally very expensive and impractical as the number of tasks increase. To that end, we propose a reward distribution-preserving coreset compression technique for compressing experience replay buffers stored for selective experience replay. We evaluated the coreset lifelong deep reinforcement learning technique on the brain tumor segmentation (BRATS) dataset for the task of ventricle localization and on the whole-body MRI for localization of left knee cap, left kidney, right trochanter, left lung, and spleen. The coreset lifelong learning models trained on a sequence of 10 different brain MR imaging environments demonstrated excellent performance localizing the ventricle with a mean pixel error distance of 12.93, 13.46, 17.75, and 18.55 for the compression ratios of 10x, 20x, 30x, and 40x, respectively. In comparison, the conventional lifelong learning model localized the ventricle with a mean pixel distance of 10.87. Similarly, the coreset lifelong learning models trained on whole-body MRI demonstrated no significant difference (p=0.28) between the 10x compressed coreset lifelong learning models and conventional lifelong learning models for all the landmarks. The mean pixel distance for the 10x compressed models across all the landmarks was 25.30, compared to 19.24 for the conventional lifelong learning models. Our results demonstrate that the potential of the coreset-based ERB compression method for compressing experiences without a significant drop in performance. Keywords: Deep reinforcement learning, lifelong learning, continual learning, medical imaging, coresets, clustering ∗Department of Computer Science, Rice University. E-mail: [email protected] †UC Berkeley and Rice University. E-mail: [email protected] ‡Department of Computer Science, Rice University. E-mail: [email protected] §Department Of Diagnostic And Interventional Imaging, McGovern Medical School, UTHealth Houston, Houston, TX, USA and The Russell H. Morgan Department of Radiology and Radiological Science, The Johns Hopkins University School of Medicine, Baltimore, MD 21205 E-mail: [email protected] (cid:79)University of Maryland Medical Intelligent Imaging (UM2ii) Center, Department of Diagnostic Radiology and Nuclear Medicine, University of Maryland School of Medicine, Baltimore, MD 21201. E-mail: [email protected]. edu 1 1 Introduction The field of radiology is moving towards implementation of artificial intelligence (AI) methods for radiologists to use in advanced reading rooms. Deep reinforcement learning (DRL) is an evolving area of research within the field of AI that deals with the development of AI systems that can learn from experience (mimicking the human learning process). DRL has produced excellent results across diverse domains [Mnih et al., 2013, Li et al., 2016, Silver et al., 2017, Sallab et al., 2017]. The property of learning from experience makes DRL al- gorithms ideal for deployment into radiological decision support systems, where the DRL models can learn how to map the intra- and inter-structural relationships within different radiological im- ages. The use of DRL in radio- logical applications is an emerg- ing area of active research with new techniques being developed for anatomical landmark localiza- tion, image segmentation, regis- tration, treatment planning, and assessment [Ghesu et al., 2017, Tseng et al., 2017, Maicas et al., 2017, Ma et al., 2017, Alansary et al., 2018, Ali et al., 2018, Alansary et al., 2019, Vlontzos et al., 2019, Allioui et al., 2022, Zhang et al., 2021, Joseph Nathaniel Stember, 2022]. Fig. 1: Illustration of catastrophic forgetting in dynamically evolving medical imaging environments. In medical imaging applica- tions, the same task might be present within different radiolog- ical imaging environments. For example, brain imaging will in- volve different imaging orienta- tions (axial, sagittal, or coronal), different imaging sequences (ie, MRI: T1, T2, FLAIR, PWI), and modalities (PET, CT) or different pathologies (low-grade or high-grade gliomas), poten- tially resulting in large environ- ments, depending on the applica- tion. Furthermore, the imaging environments for medical imaging tasks are constantly evolving, i.e., newer environments might be present at future time points due to change in image acquisition parameters or the introduction of newer imaging sequences. As a result, a model trained in an old environment may fail when evaluated in a new unseen environment. The model could then be fine-tuned using different learning methods to work in the new environment, However, these methods could potentially result in catastrophic forgetting, where the model is no longer capable of operating in the original environment. Such an example is shown in Figure 1. Fig. 2: A schematic of the coreset-compressed lifelong deep rein- forcement learning setup for training deep reinforcement learning models. ERB=Experience Replay Buffer 2 The challenges of catastrophic forgetting could be addressed using lifelong deep reinforcement learning. Elastic weight consolidation (EWC) [Kirkpatrick et al., 2017] and selective experience replay [Rolnick et al., 2019] are two commonly used techniques for integrating lifelong learning with reinforcement learning. Elastic weight consolidation aims to preserve the network parameters learned in the previous tasks while learning a new task. On the other hand, selective experience replay aims to recount selected experiences from previous tasks to avoid catastrophic forgetting. Furthermore, selective experience replay based techniques are model agnostic and allow experiences to be shared across different models. However, storing experiences from all previous tasks make lifelong learning using selective experience replay computationally very expensive and impractical as the number of tasks increase. To that end, we develop a reward distribution-preserving coreset compression technique based on weighted sampling to compress experience replay buffers (ERBs) stored for lifelong learning without sacrificing the performance, as shown in Figure 2. We evaluated the proposed coreset based ERB compression technique for the task of ventricle localization in brain MRI across a sequence twenty-four different imaging environments consisting of a combination of different MRI sequences, diagnostic pathologies, and imaging orientations. 2 Related Work Compression and Sampling experience replays has been an active area of research in the field continual reinforcement learning [Schaul et al., 2015, Pan et al., 2022, Ramicic et al., 2022, Hessel et al., 2018, Tiwari et al., 2021, Lazic et al., 2021]. The majority of the previous work on experience replay sampling is built on top of the work by Schaul et. al. [Schaul et al., 2015], in which the authors proposed a method to use temporal difference (TD) error to prioritize the more valuable experiences. Further work explored the idea of prioritized experience replay and developed new methods that improved the results [Pan et al., 2022, Ramicic et al., 2022, Hessel et al., 2018]. However, they all need an extra calculation for absolute TD error, which is constantly updated during the network's training session, since the TD error requires the Q function, and the Q function updates after every training iteration. In contrast, recent work from Tiwari et al. [Tiwari et al., 2021] used gradient coreset based experience replay sampling with excellent results. However, a major limitation of the proposed approach was the required access to the training model for compression. Alternatively, Lazic et. al. [Lazic et al., 2021] utilized q-functions for sampling a coreset from ERBs, which could potentially be a major limitation. To that end, the goal of this work was to develop a coreset based ERB sampling technique that does not require additional information from the training session nor does it require the model parameters from the training session, thereby addressing the shortcomings of the current techniques. Furthermore, the proposed technique only requires the experience replay buffer for compression. This is an asynchronous process and can be used to learn from reinforcement learning models that just use an experience replay buffer, but do not have any additional implementation. 3 Methods 3.1 Lifelong deep reinforcement learning We implemented a deep learning framework based on the deep Q-network (DQN) algorithm, as illustrated in Figure 2. The 3D DQN model implemented in this work was adapted from [Mnih 3 et al., 2013, Alansary et al., 2018, Vlontzos et al., 2019, Parekh et al., 2020]. The environment was represented by the 3D imaging volume and the agent, by a 3D bounding box with six possible actions, a ∈ {x++, x--, y++, y--, z++, z--}. The state is defined by the current location (or a sequence of locations), where each location is represented by a 3D bounding box. The reward is defined by the difference in the distance between the agent's location and the target landmark before and after the agent's action. The state-action-reward-resulting state [s, a, r, s(cid:48)] tuples resulting from the DRL agent's interaction with the environment over many episodes were used to populate the experience replay buffer (ERB). To perform lifelong learning, we implemented a selective experience replay buffer to collect a trajectory of experience samples across the model's training history. The model attempts to learn a generalized representation of its current and previous tasks by sampling a batch of experience from both its current task's experience replay buffer (ERB) as well as from its history of previous tasks' experience replays during training. Fig. 3: Reward distribution of original ERB (left) vs. compressed and unpacked ERB with a compression ratio of 10x (right) 3.2 Weighted sampling-based reward distribution preserving coreset ERB com- pression We proposed and introduce a new method to compress the ERB based on coresets for lower storage cost, less communication cost, and preservation of information: given an ERB of size N and compression rate of R, we use k-means++ clustering to partition the points in the ERB to N/R clusters based on their rewards. We use k-means++ clustering because we want to manually pick the number of clusters to be N/R as it reflects the compression ratio. Moreover, since the reward distribution for ERBs is known, does not have outliers, and is only 1-dimensional, k-means++ clustering can guarantee convergence on a good label assignment very fast and accurately. We pick the closest point to the center of these clusters to be in the compressed ERB. Additionally, we give these points in the compressed ERB a weight parameter that is equal to the number of points in the clusters they are in. When the compressed ERB is received by an agent, the agent will unpack it by repeating the points in the compressed ERB multiple times according to their weight parameter. 4 For example, if a point [s, a, r, s(cid:48)] has a weight of 2 in the compressed ERB, then it will be repeated twice in the unpacked ERB. This method guarantees an approximate reward distribution similar to the original reward distribution, as illustrated in Figure 3. 4 Experiment and Data 4.1 Experiment 1: Brain MRI 4.1.1 Clinical Data We used the brain tumor segmen- tation (BRATS) dataset for evaluat- ing the coreset compression method [Menze et al., 2014]. The dataset consisted of 285 patients with T1- weighted pre- and post-contrast en- hanced, T2-weighted, and Fluid Atten- uated Inversion Recovery (FLAIR) se- quences. All the images were acquired in the axial orientation. In this work, we selected a random subset of 100 patients from the BRATS dataset for the development, training, and evalu- ation of different DRL models. This subset consisted of 60 patients with high-grade glioma (HGG) and 40 pa- tients with low-grade glioma (LGG). Of the 100 patients, 80 were used for training and 20 were used for evalua- tion. The training dataset consisted of 48 patients with HGG and 32 patients with LGG tumors. The test dataset consisted of 12 patients with HGG and 8 patients with LGG tumors. We synthetically resliced the axial images into coronal and sagittal views and reconstructed each dataset in all three imaging orientations, resulting in a total of twenty-four imaging environments (2pathologies × 4sequences × 3orientations = 24). We used the top left ventricle as the task for this experiment, resulting in a total of 24 task-environment pairs, as shown in Figure 4. Fig. 4: Illustration of a subset of task-environment pairs in the BRATS dataset and the performance of no com- pression and the proposed coreset-compression method at different compression rates. The red and yellow bounding boxes represent the ground truth and the agent's prediction, respectively. 4.1.2 Training Protocol We trained 5 lifelong deep reinforcement learning models (no-compression, 10x compression, 20x compression, 30x compression, and 40x compression) to test the performance of our coreset compres- sion algorithm. The models are trained for the localization of the top left ventricle in a randomly sampled 10 task-environment pairs out of the 24 task-environment pairs. The models were trained for four epochs with a batch size of 48. The agent's state was represented as a bounding box of 5 size 45x45x11 with a frame history length of four. The models were iteratively trained for the localization of the top left ventricle in one imaging environment at a time, resulting in 10 rounds of training. The no-compression model used complete ERBs generated by previous training rounds for the next training round. The 10x, 20x, 30x, and 40x compression models used 10x, 20x, 30x, and 40x compressed ERBs, respectively, and unpacked based on weights in the ERBs from all previous rounds for the next training round. 4.2 Experiment 2: Whole Body MRI 4.2.1 Clinical Data The WB multiparametric MRI data set consisted of thirty subjects ac- quired using the imaging protocol that scanned from the shoulders to the lower mid calf and described in [Leung et al., 2020]. We evaluated the pro- posed coreset ERB compression tech- nique for training lifelong reinforce- ment learning models to localize five landmarks (left lung, left kidney, right trochanter, spleen, and the left knee cap) across two imaging environments (DIXON Fat and DIXON water im- ages) in this study, as shown in Figure 5 4.2.2 Training Protocol Fig. 5: Illustration of the performance of no-compression and coreset compression lifelong learning models on the two imaging environments and five tasks for whole body MRI. We trained two lifelong deep reinforce- ment learning models (no-compression and 10x compression) to test the per- formance of our coreset compression algorithm. The dataset comprising of 30 subjects was randomly divided into three groups - ten for training, ten for lifelong learning, and the remaining ten for testing. Furthermore, the first group comprised of only the DIXON water and the second group of only the DIXON fat imaging sequences. The models were iteratively trained (using the same hyperparameters as the first experiment) for the localization of each of the five landmars in one imaging environment at a time, resulting in two rounds of training. 4.3 Performance Evaluation The performance metric was set as the terminal Euclidean distance between the agent's prediction and the target landmark. We performed paired t-tests to compare the performance of the no- compression model with the compression models at different compression rates. The p-value for statistical significance was set to p ≤ 0.05. 6 5 Results For the first experiment on the BRATS dataset, we sequentially trained each selective experience replay based lifelong reinforcement model (no compression, 10x compression, 20x compression, 30x compression, and 40x compression) on 10 distinct task-environment pairs, one pair each round. After every round of training, the models were evaluated across all 24 task-environment pairs in the test set. Figure 4 illustrates the performance of all five models across a subset of four task-environment pairs after 10 rounds of training. As shown in Figure 4, both the compressed and uncompressed models demonstrated excellent continual learning performance across all task-environment pairs. The average Euclidean distance errors for no compression, 10x compression, 20x compression, 30x compression, and 40x compression were 10.87, 12.93 (p = 0.01), 13.46 (p = 0.0001), 17.75 (p ≤ 0.0001), and 18.55 (p ≤ 0.0001) respectively. Figure 6 (left) compares the performance at different compression levels across different rounds. The performance after 10 rounds of training across different compression levels has been illustrated as a box plot in Figure 6 (right). The original sizes of the ERBs tested were 90MB. The 10x, 20x, 30x and 40x coreset compression resulted in ERBs of size 9MB, 4.5MB, 3MB, and 2MB, respectively. Fig. 6: Left: Average Euclidean distance error on testing images (24 task-environment pairs) after every training round. Right: Box plot of the Euclidean distance error on testing images (24 task-environment pairs) after ten rounds of training. For the second experiment on the whole-body MRI dataset, we sequentially trained each selective experience replay based lifelong reinforcement model (no compression and 10x compression) on two distinct environments (one each round) across all five landmarks. After every round of training, the models were evaluated across both the environments pairs in the test set. Figure 5 compares the performance the baseline (trained only on the DIXON water images), no-compression, and 10x compression models across all five landmarks for an example patient. Table 1 summarizes the pixel distances demonstrating no significant difference between no compression and 10x compression models. The coreset technique here compressed the ERBs from 750MB to 75MB. 7 Table 1: Comparison between conventional Lifelong Learning and Coreset Lifelong Learning for the localization of five landmarks across two imaging environments in whole body MRI Baseline (trained on just DIXON water) No compression Coreset 10x compression Paired TTEST (coreset vs. conventional LL) knee 73.44 6.34 15.74 0.27 trochanter 45.05 30.95 19.93 0.65 kidney 100.33 25.50 36.97 0.15 lung 40.25 21.71 35.92 0.06 spleen Average 55.94 20.63 19.24 11.69 25.30 17.92 0.28 0.13 6 Discussion In conclusion, we propose a coreset-based ERB compression technique for increased computational efficiency and scalability of selective experience replay based deep lifelong reinforcement learning with excellent performance. In particular, our weighted sampling-based reward distribution-preserving coreset ERB compression showed excellent performance for shrinking the size of saved experiences from previous tasks for lifelong deep reinforcement learning in medical imaging. Our results demonstrated that experience replay buffers can be compressed up to 10x without any significant drop in performance. Experience replay has been one of the major methods for lifelong reinforcement learning because it is model agnostic and because different experiences can be shared between models for collaborative lifelong learning. However, the computational complexity of storing multiple experiences from previous tasks makes experience replay less attractive as the number of tasks increases. Many techniques have been developed in the literature for sampling experience replay [Schaul et al., 2015, Pan et al., 2022, Ramicic et al., 2022, Hessel et al., 2018]. However, they required additional calculations that constantly update during the network's training and require the Q function. In contrast, our proposed coreset-based compression techniques asynchronously compress the ERB, without the need for extra information from the training session where the ERB is produced or the model parameters that came from the training session. This provides more flexibility to the training and is less computationally intensive compared to other methods. There are certain limitations to our study. This work approximates the joint distribution of state-action-reward-next state using the reward distribution alone, resulting in a potential loss of information. For example, two state-action-reward-next state tuples with the same reward may have different states, and our method would only pick one of the state-action-reward-next state tuple. We plan to address this limitation by incorporating state and action into the distribution preserving coreset compression method in the future. The second limitation of this study is the limited focus on single-agent deep reinforcement learning models. In the future, we plan to evaluate the coreset-based ERB compression technique in a multi-agent setup where the size of the ERB linearly increases with the number of agents and across a diverse set of applications. Acknowledgements This work was supported by the DARPA grant: DARPA-PA-20-02-11-HR00112190130 and 5P30CA006973 (Imaging Response Assessment Team-IRAT), U01CA140204 8 References Amir Alansary, Loic Le Folgoc, Ghislain Vaillant, Ozan Oktay, Yuanwei Li, Wenjia Bai, Jonathan Passerat-Palmbach, Ricardo Guerrero, Konstantinos Kamnitsas, Benjamin Hou, et al. Automatic view planning with multi-scale deep reinforcement learning agents. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 277–285. Springer, 2018. 2, 4 Amir Alansary, Ozan Oktay, Yuanwei Li, Loic Le Folgoc, Benjamin Hou, Ghislain Vaillant, Kon- stantinos Kamnitsas, Athanasios Vlontzos, Ben Glocker, Bernhard Kainz, and Daniel Rueckert. Evaluating Reinforcement Learning Agents for Anatomical Landmark Detection. Medical Image Analysis, 2019. 2 Issa Ali, Gregory R Hart, Gowthaman Gunabushanam, Ying Liang, Wazir Muhammad, Bradley Nartowt, Michael Kane, Xiaomei Ma, and Jun Deng. Lung nodule detection via deep reinforcement learning. Frontiers in oncology, 8:108, 2018. 2 Hanane Allioui, Mazin Abed Mohammed, Narjes Benameur, Belal Al-Khateeb, Karrar Hameed Abdulkareem, Begonya Garcia-Zapirain, Robertas Damaˇseviˇcius, and Rytis Maskeliunas. A multi- agent deep reinforcement learning approach for enhancement of covid-19 ct image segmentation. Journal of Personalized Medicine, 12:1–23, 2022. 2 Olivier Bachem, Mario Lucic, and Andreas Krause. Practical coreset constructions for machine learning, 2017. 11 Dan Feldman. Core-sets: An updated survey. WIREs Data Mining Knowl. Discov., 10(1), 2020. 11 Dan Feldman, Melanie Schmidt, and Christian Sohler. Turning big data into tiny data: Constant-size coresets for k-means, pca, and projective clustering. SIAM J. Comput., 49(3):601–657, 2020. 12 Florin-Cristian Ghesu, Bogdan Georgescu, Yefeng Zheng, Sasa Grbic, Andreas Maier, Joachim Hornegger, and Dorin Comaniciu. Multi-scale deep reinforcement learning for real-time 3d- landmark detection in ct scans. IEEE transactions on pattern analysis and machine intelligence, 41(1):176–189, 2017. 2 Matteo Hessel, Joseph Modayil, Hado van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Dan Horgan, Bilal Piot, Mohammad Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence and Thirtieth Innovative Applications of Artificial Intelligence Conference and Eighth AAAI Symposium on Educational Advances in Artificial Intelligence, AAAI'18/IAAI'18/EAAI'18. AAAI Press, 2018. ISBN 978-1-57735-800-8. 3, 8 Hrithwik Shalu Joseph Nathaniel Stember. Deep reinforcement learning with automated label extraction from clinical reports accurately classifies 3d mri brain volumes. Journal of Digital Imaging, pages 1–11, 2022. 2 James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114 (13):3521–3526, 2017. 3 9 Nevena Lazic, Dong Yin, Yasin Abbasi-Yadkori, and Csaba Szepesvari. Improved regret bound and experience replay in regularized policy iteration. In Marina Meila and Tong Zhang, ed- itors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 6032–6042. PMLR, 18–24 Jul 2021. URL https://proceedings.mlr.press/v139/lazic21a.html. 3 Doris G Leung, Alex E Bocchieri, Shivani Ahlawat, Michael A Jacobs, Vishwa S Parekh, Vladimir Braverman, Katherine Summerton, Jennifer Mansour, Genila Bibat, Carl Morris, et al. Longitu- dinal functional and imaging outcome measures in fkrp limb-girdle muscular dystrophy. BMC Neurology, 20:1–12, 2020. 6 Jiwei Li, Will Monroe, Alan Ritter, Michel Galley, Jianfeng Gao, and Dan Jurafsky. Deep reinforce- ment learning for dialogue generation. arXiv preprint arXiv:1606.01541, 2016. 2 Kai Ma, Jiangping Wang, Vivek Singh, Birgi Tamersoy, Yao-Jen Chang, Andreas Wimmer, and Terrence Chen. Multimodal image registration with deep context reinforcement learning. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 240–248. Springer, 2017. 2 Gabriel Maicas, Gustavo Carneiro, Andrew P Bradley, Jacinto C Nascimento, and Ian Reid. Deep reinforcement learning for active breast lesion detection from dce-mri. In International conference on medical image computing and computer-assisted intervention, pages 665–673. Springer, 2017. 2 Bjoern H Menze, Andras Jakab, Stefan Bauer, Jayashree Kalpathy-Cramer, Keyvan Farahani, Justin Kirby, Yuliya Burren, Nicole Porz, Johannes Slotboom, Roland Wiest, et al. The multimodal brain tumor image segmentation benchmark (brats). IEEE transactions on medical imaging, 34 (10):1993–2024, 2014. 5 Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. 2, 3 Yangchen Pan, Jincheng Mei, Amir massoud Farahmand, Martha White, Hengshuai Yao, Mohsen Rohani, and Jun Luo. Understanding and mitigating the limitations of prioritized experience replay. In The 38th Conference on Uncertainty in Artificial Intelligence, 2022. URL https: //openreview.net/forum?id=HBlNGvIicg9. 3, 8 Vishwa S Parekh, Vladimir Braverman, Michael A Jacobs, et al. Multitask radiological modality invariant landmark localization using deep reinforcement learning. In Medical Imaging with Deep Learning, pages 588–600. PMLR, 2020. 4 Mirza Ramicic, Vaclav Smidl, and Andrea Bonarini. Informed sampling of prioritized experience replay. In 2022 IEEE International Conference on Development and Learning (ICDL), pages 215–222, 2022. doi: 10.1109/ICDL53763.2022.9962235. 3, 8 David Rolnick, Arun Ahuja, Jonathan Schwarz, Timothy Lillicrap, and Gregory Wayne. Experience replay for continual learning. Advances in Neural Information Processing Systems, 32, 2019. 3 Ahmad EL Sallab, Mohammed Abdou, Etienne Perot, and Senthil Yogamani. Deep reinforcement learning framework for autonomous driving. Electronic Imaging, 2017(19):70–76, 2017. 2 10 Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. CoRR, abs/1511.05952, 2015. 3, 8 David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. Nature, 550(7676):354–359, 2017. 2 Rishabh Tiwari, Krishnateja Killamsetty, Rishabh Iyer, and Pradeep Shenoy. Gcr: Gradient coreset based replay buffer selection for continual learning, 2021. URL https://arxiv.org/abs/2111. 11210. 3 Huan-Hsin Tseng, Yi Luo, Sunan Cui, Jen-Tzung Chien, Randall K Ten Haken, and Issam El Naqa. Deep reinforcement learning for automated radiation adaptation in lung cancer. Medical physics, 44(12):6690–6705, 2017. 2 Athanasios Vlontzos, Amir Alansary, Konstantinos Kamnitsas, Daniel Rueckert, and Bernhard Kainz. Multiple landmark detection using multi-agent reinforcement learning. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 262–270. Springer, 2019. 2, 4 Quan Zhang, Qian Du, and Guohua Liu. A whole-process interpretable and multi-modal deep reinforcement learning for diagnosis and analysis of alzheimer's disease. Journal of Neural Engineering, 18:1–19, 2021. 2 A Background on Coresets Coresets are an important concept in data science because they present a technique for representing datasets with a large number of observations as weighted datasets with a smaller number of observations. Coresets are frequently used as a pre-processing technique for dimensionality reduction to significantly improve the runtime or memory cost of downstreams tasks, such as clustering, regression, or low-rank approximation. See the surveys [Feldman, 2020, Bachem et al., 2017] for a more comprehensive introduction and discussion on coresets, their applications, and the state-of-the-art techniques. More formally, we are given a dataset X = x1, . . . , xn such that xi ∈ Rd for all i ∈ [n]. In other words, the dataset X consists of n observations, each with d features. The goal is to minimize the function f (X, q, u) across all possible values q in some query space Q. Here we use u to denote the function that assigns unit weight to all of the n points in X. For example, if the task was to do k-means clustering, then Q would be the set consisting of all sets of k points from Rd, i.e., the set of all possible sets of centers for the clustering problem. A coreset construction produces a weighted subset Y consisting of m observations from the original dataset X. Let w be the function that assigns weights to points in Y . Given an approximation parameter (cid:15) > 0, the coreset with multiplicative error (1 + (cid:15)) satisfies (1 − (cid:15))f (Y, q, w) ≤ f (X, q, u) ≤ (1 + (cid:15))f (Y, q, w), for all q ∈ Q. Similarly, a coreset with additive error E > 0 satisfies |f (Y, q, w) − f (X, q, u)| ≤ E. 11 Since the coreset is defined with respect to f , then it naturally follows that there may be drastically different coreset constructions depending on the task at hand, i.e., the function f to be minimized. The definition can then be naturally generalized to the setting where X is a set of weighted points. Formally, we have the following: Definition A.1 (Coreset). Given a set X with weight function u and an accuracy parameter (cid:15) > 0, we say a set Y with weight function w is an (1 + (cid:15))-multiplicative coreset for a function f , if for all queries q in a query space Q, we have (1 − (cid:15))f (Y, q, w) ≤ f (X, q, u) ≤ (1 + (cid:15))f (Y, q, w). A standard approach in coreset constructions is to first assign a sensitivity s(xi) to each point xi with i ∈ [n]. The sensitivity is intuitively a value that quantifies the "importance" of the point xi. The coreset construction then samples a fixed number m of points from X, with probabilities proportional to their sensitivity. That is, for each of the m sampled points p, we have that Pr[p = xi] ∝ si. In fact, the following statement shows this procedure can generate a coreset even if we only have approximations to the sensitivities of each point for the task of k-means clustering: Theorem A.2 (Theorem 35 in [Feldman et al., 2020]). Let C > 1 be a universal constant and for each i ∈ [n], let q(xi) be a C-approximation to the sensitivity s(xi) for any point xi. Let T = (cid:80)n i=1 q(xi). (cid:15)2 log2 k(cid:1) points with replacement, i.e., choosing each of the m Then sensitivity sampling m = O (cid:0) T k points to be xi with probability proportional to q(xi) and then rescaling by the sampling probability, outputs a (1 + (cid:15))-coreset for k-means clustering with probability 2 3 . However, it turns out that even approximating the sensitivities of each point may be time- consuming. Thus for real-world datasets, it is often more practical to follow procedures that capture the main intuition behind sensitivity sampling without actually performing sensitivity sampling. Uniform sampling. One reason to assign different sensitivities to each observation is the following. Suppose there exist n − 1 similar observations and a single drastically different observation. It may be possible the drastically different observation is an outlier that should be ignored, but it may also be possible that the different observation is a crucial but rare counterexample that behaves differently from the rest of the population, in which case the counterexample needs to be sampled into the coreset in order to maintain representation. Thus in this case, the sensitivity of the different observation should be much larger than the sensitivities of the remaining points. However, if the dataset is roughly uniform, then no particular example stands out, and so intuitively, the sensitivities of the points are also roughly uniform. In this case, the intuition behind sensitivity sampling is also achieved through uniform sampling, i.e., selecting a number of observations uniformly at random. Group sampling. A frequent phenomenon is that the observations in the dataset can be clustered or partitioned into a number of groups, so that the behavior of the observations is similar within a group but drastically different across groups. In this case, the sensitivities within each group are similar, but the sensitivities across different groups can also vary greatly. Hence, sensitivity sampling would sample roughly an equal number of observations from each group. If a natural partition of the observations into the groups is known a priori, then sensitivity sampling can be reasonably simulated by first partitioning the observations into these groups. We 12 can then sample a fixed number of points from each group, uniformly at random. Specifically, if the coreset construction for sensitivity sampling intended to store m points and k groups were formed from the natural partition of the observations, then we can sample m k points from each of the k groups. That is, for each of the k groups, m k points are selected uniformly at random from this group and then weighted proportional to the number of points in the group. B Comparison between the proposed clustering based coresets with uniform and inverse CDF sampling methods Fig. 7: Comparison between the proposed clustering technique with the uniform and inverse cdf sampling techniques for 10x coreset compression for the BRATS experiment Clustering gives us an intuition on how important the samples are by the number of samples within each cluster. Uniform sampling or inverse cdf sampling do indeed preserve the distribution, but do not provide information about the importance, resulting in just a subsample of the original data. With our method incorporating importance or "weight", we can generate the same amount of distribution preserving subsample of the original data with much smaller size. Furthermore, we do not have explicit access to the reward distribution and so naively performing inverse CDF sampling does not seem immediately possible. However, given a sufficiently large number of samples, it does seem possible to construct a rough estimate of the reward distribution, though this is already one possible source of error. In addition, uniform sampling or inverse CDF sampling will provide a good representation of 13 the original data when the original data is roughly uniformly distributed. Indeed, when the data is roughly uniformly, our clustering approach will also perform well. However, in cases where there is a small fraction of the data that performs exceptionally well or exceptionally poorly, these inputs will not be captured by uniform sampling, but may be captured by clustering. Appendix Figure 7 demonstrates an experimental comparison between uniform sampling, cdf sampling, and the proposed clustering technique. As shown in the figure, the clustering based 10x compression achieves an average pixel distance error of 12.93, signficantly lower than uniform sampling (20.95, p ≤ 0.0001) and inverse cdf sampling (21.91, p ≤ 0.0001) 14
http://arxiv.org/abs/2302.11509v2
2023-10-11T10:20:58
2023-02-22T17:26:03
Construction of Knowledge Graphs: State and Challenges
With knowledge graphs (KGs) at the center of numerous applications such as recommender systems and question answering, the need for generalized pipelines to construct and continuously update such KGs is increasing. While the individual steps that are necessary to create KGs from unstructured (e.g. text) and structured data sources (e.g. databases) are mostly well-researched for their one-shot execution, their adoption for incremental KG updates and the interplay of the individual steps have hardly been investigated in a systematic manner so far. In this work, we first discuss the main graph models for KGs and introduce the major requirement for future KG construction pipelines. Next, we provide an overview of the necessary steps to build high-quality KGs, including cross-cutting topics such as metadata management, ontology development, and quality assurance. We then evaluate the state of the art of KG construction w.r.t the introduced requirements for specific popular KGs as well as some recent tools and strategies for KG construction. Finally, we identify areas in need of further research and improvement.
[ "Marvin Hofer", "Daniel Obraczka", "Alieh Saeedi", "Hanna Köpcke", "Erhard Rahm" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11509v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11509v2", "@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.DB", "cs.LG" ]
1 Construction of Knowledge Graphs: State and Challenges Marvin Hofer b,*, Daniel Obraczka b, Alieh Saeedi a,b, Hanna Köpcke c and Erhard Rahm a,b a Dept. of Computer Science, Leipzig University, Germany b Center for Scalable Data Analytics and Artificial Intelligence (ScaDS.AI) Dresden/Leipzig, Germany c Faculty Applied Computer Sciences and Biosciences, Mittweida University of Applied Sciences, Germany Abstract. With knowledge graphs (KGs) at the center of numerous applications such as recommender systems and question answering, the need for generalized pipelines to construct and continuously update such KGs is increasing. While the individual steps that are necessary to create KGs from unstructured (e.g. text) and structured data sources (e.g. databases) are mostly well- researched for their one-shot execution, their adoption for incremental KG updates and the interplay of the individual steps have hardly been investigated in a systematic manner so far. In this work, we first discuss the main graph models for KGs and introduce the major requirements for future KG construction pipelines. Next, we provide an overview of the necessary steps to build high- quality KGs, including cross-cutting topics such as metadata management, ontology development, and quality assurance. We then evaluate the state of the art of KG construction w.r.t the introduced requirements for specific popular KGs as well as some recent tools and strategies for KG construction. Finally, we identify areas in need of further research and improvement. Keywords: 1. Introduction Aggregated machine-readable information in the form of knowledge graphs (KG) serves as the backbone of nu- merous data science applications nowadays, ranging from question-answering [1] over recommendation systems [2] to predicting drug-target interactions [3]. The ever-changing nature of information necessitates the design of KG construction pipelines that are able to incorporate new information continuously. In the development of such a sys- tem, knowledge engineering teams have to deal with a variety of challenges from tackling scalability and hetero- geneous data sources to tracking the provenance of data. Given the usually large volume of data that needs to be integrated, such pipelines have to be automatized as much as possible while aiming at a high degree of data quality. Knowledge graphs generally integrate heterogeneous data from a variety of sources with unstructured and semi- structured data of different modalities (e.g., pictures, audio, text) as well as structured data such as databases or other KGs in a semantically rich way. The construction of a KG therefore encompasses a multi-disciplinary effort requiring expertise from research areas such as natural language processing (NLP), data integration, knowledge representation, and knowledge management. Knowledge graphs are at the center of numerous use-cases for data analysis and decision support. In the clinical setting, enriching patient data with medical background knowledge enables improved clinical decision support [4]. Sonntag et. al. [5] argue that properly aligning the semantic labels attached to the patient data with medical ontologies is crucial in creating meaningful access to the heterogeneous patient data. Knowledge graphs are also used to organize the relevant information for fast emerging global topics, *Corresponding author. E-mail: [email protected]. 3 2 0 2 t c O 1 1 ] I A . s c [ 2 v 9 0 5 1 1 . 2 0 3 2 : v i X r a 2 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges such as pandemics (e.g., Covid-19) or natural disasters [6]. Machine learning also benefits from KGs as a source of labeled training data or other input data [7, 8] thereby supporting the development of knowledge- and data-driven AI approaches [9]. KGs can further be combined with Large Language Models (LLMs) to improve factual correctness and explanations in question-answering, e.g. with ChatGPT, thereby promoting quality and interpretability of AI decision-making [10, 11]. Improving the pipelines that build such knowledge graphs and enabling them to efficiently keep current and se- mantically meaningful aggregated knowledge is therefore an effort that benefits a wide range of application areas. However, KGs are currently created often in a batch-like manner so that the respective pipelines are unfit to incorpo- rate new incoming facts into a KG without full re-computation of the individual tasks. Furthermore, different steps of the pipelines often require manual intervention, thereby limiting scalability to large data volumes and increasing the time for updating a KG. There is a growing number of surveys about knowledge graphs, especially on their general characteristics and usage forms [7–9]. An excellent tutorial-style overview about the construction and curation of KGs is provided in [12] with a focus on integrating data from textual and semi-structured data sources such as Wikipedia. Other sur- veys focus on KG construction with specific technologies [13, 14] or only a single domain such as for geographical data [15]. We discuss related surveys on KG construction in Section 6 and contrast them with our approach. This survey article provides a concise yet comprehensive entry into the current state of the art in KG construction for readers new to the topic, as well as contributing valuable guidance for researchers, engineers, and experts by highlighting existing solution approaches, tools, and identifying open gaps in the areas. We first outline the main requirements for the construction and continuous maintenance of KGs distilled from the literature as well as our experience and reasoning. Next, we give an overview of the concrete subtasks of KG construction and current solution approaches. Furthermore, we select 23 KG-specific construction approaches as well as generic toolsets based on the criteria discussed in Section 4.1 and evaluate and compare them w.r.t. the requirements introduced in Section 2.3. Finally, we identify open challenges and current limitations and thus areas for further research. Our survey builds on previous studies for KG construction but differs in essential aspects as will be explained in detail in Section 6. In contrast with most other surveys, we explicitly specify the main requirements for KG construction and use these as a guideline for evaluating current solutions and identifying open challenges. We are also more comprehensive in several important aspects as we cover different graph data models (RDF and property graphs) and deal with incremental KG construction and data integration including incremental entity resolution in much more detail. We also provide a comparison between many carefully selected KG-specific construction approaches and toolsets and identify open challenges that go beyond those discussed in previous surveys. The further structure of this survey is as follows: – After a definition of KGs and a comparative discussion of graph data models for KGs we introduce and cate- gorize the general requirements for incremental KG construction in Section 2. – In Section 3 we provide an overview of the main tasks in incremental KG construction pipelines and proposed solution approaches for them. – We then investigate and compare existing construction efforts for selected KGs as well as within recent tools for KG construction w.r.t. the requirements introduced earlier. This also allows us to identify tasks that are not yet supported well. – Section 5 discusses open challenges for KG construction. – Section 6 contains a more in-depth comparison with the related work. – Finally, we offer concluding remarks and a summary. 2. KG background and requirements for KG construction We first outline the notion of knowledge graph (KG) used in this paper which is based on the integration of information from multiple sources. We then briefly introduce and compare the two most popular graph data models for KGs, namely RDF and property graphs. Finally, we outline the main requirements or desiderata for largely automatic construction and maintenance of KGs. M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 3 2.1. Knowledge Graph KGs typically realize physical data integration, where the information from different sources is combined in a new graph-like representation1. KGs are schema-flexible and can thus easily accommodate and interlink heteroge- neously structured entities. This is in contrast to the use of data warehouses as a popular approach for physical data integration. Data warehouses focus on integrating data within a structured (relational) database with a relatively static schema optimized for certain multi-dimensional data analysis. Schema evolution is a manual and tedious pro- cess making it difficult to add new data sources or new kinds of information not conforming to the schema. KGs are less restricted and can better deal with heterogeneous information derived from semi- and unstructured data from potentially many sources. Although the term knowledge graph goes back as far as 1973 [18], it gained popularity through the 2012 blog post2 about the Google KG. Afterward, several related definitions of knowledge graphs were proposed, either in research papers [8, 12, 19–21] or by companies using or supporting KGs (OpenLink, Ontotext, Neo4J, TopQuadrant, Amazon, Diffbot3, Google). Ehrlinger et al. [20] give a comprehensive overview of KG definitions and provide their own: "A knowledge graph acquires and integrates information into an ontology and applies a reasoner to derive new knowledge." Hogan et al. [22] argue that this definition is very specific and excludes various industrial KGs which helped to popularize the concept. We therefore define KGs more inclusively as a graph of data consisting of semantically described entities and relations of different types that are integrated from different sources. Entities have unique identifier. KG entities and relations can be semantically described by an ontology [23]. A KG's ontology defines the concepts, relationships, and rules governing the semantic structure within a KG of one or several domains that also include the types and properties of entities and their relationships. To structure data in a KG, common ontology relationships euch as is-a and has-a are used to represent taxonomic hierarchies and possessive relations between entities. Furthermore, an ontology can enable the inference of new implicit knowledge from the explicitly represented information in the KG [21]. Figure 1 visualizes a simplified KG example with integrated information from several domains where ontological information such as types or is-a relations are dashed. There are ten entities of the following eight types: Country (Ireland), City (Limerick), Artist (Aphex Twin), Album (Selected Ambient Works 85-9), Record Label (R & S), Genre (Techno, Ambient Techno), Song (Xtal, Ageispolis) and Year (1992). Ontological is-a (sub-class) relations interrelate City and Country with Place, Artist with Person, Album with Music Release Type, and Record Label with Organ- isation. The domain is further described by the named relationships: country, birthPlace, artist, label, writtenBy, yearReleased, founded, broader, genre, yearProduced, partOf. Based on the given relationships and typing, further information is inferable, e.g., Aphex Twin's broader birthplace is Ireland, the song Xtal is also of genre Techno, Aphex Twin being of the type Artist means this instance is also of the type Person (for readability, not all possible inferences are denoted). 2.2. Graph Models To represent and use KGs as informally defined above, a powerful graph data model is needed that supports entities and relations of different types as well as their ontological description and organization [24]. Moreover, the graph data model should provide a comprehensive query language and possibly more advanced graph analysis or mining capabilities, e.g., for clustering of similar entities or determining graph embeddings for machine learning tasks. Support for integrity constraints is also desirable to automatically control the consistency and therefore, quality of graph data to some extent. Furthermore, it should be possible to represent annotating metadata of KG entities, e.g., about their origin and transformation during KG construction. It is also desirable to reflect the development of the KG over time so that a temporal KG analysis is supported. This can be achieved by a temporal graph data 1While we will focus on the predominant physical data integration of KGs, there are also some virtual data integration approaches, e.g., to keep data source more autonomous [16, 17]. 2https://blog.google/products/search/introducing-knowledge-graph-things-not/ 3https://blog.diffbot.com/knowledge-graph-glossary/ 4 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges Fig. 1. Simplified Knowledge Graph (KG) example demonstrating integrated information from five domains, showcasing ten entities of eight types connected by twelve relationships (two distinct is-a relations). Dashed lines indicate semantic structures (ontology or graph schema) such as entity types. Inferences can be made based on the relationships and typing, revealing additional information such as the broader birthplace of Aphex Twin being Ireland and Xtal belonging to the Techno genre (Not all possible inferences are shown for clarity). Table 1 Comparison of RDF and property graphs. base constructs entity identity node classification ontology support integrity constraints query language exchange format meta information Resource Description Framework (RDF) triples <subject, predicate, object> IRI-based rdf:type triples RDFS, OWL2 vocabularies SHACL, SHEX SPARQL(-Star) N-Triples, N-Quads, (RDF/XML, JSONLD) reification, singleton-property, (RDF-Star) Property Graph Model (PGM) labeled vertices and edges and their properties local (implementation-specific) type labels limited, e.g., schema graph PG-Keys, PG-Schema Cypher, Gremlin, G-Core, PGQL application specific e.g., PGEF, GDL dedicated properties model with time metadata for every entity and relation and temporal query possibilities, e.g., to determine previous states of the KG or to find out what has been changed in a certain time interval. The temporal development of a KG might alternatively be reflected with a versioning concept where new KG versions are periodically released. Finally, the graph data model should facilitate the KG construction process and its different tasks for acquiring, transforming and integrating heterogeneous data from different sources. This can be supported by suitable formats to seamlessly exchange data of the chosen graph model between different steps and processing nodes of a KG construction pipeline. The most common graph models used for KGs are the Resource Description Framework and the Property Graph Model. In the following, we briefly describe both and discuss how they meet the introduced desiderata. Table 2.2 summarizes some of the key differences of both models. At the end, we also contrast the different terminology of the models and specify the terms used in the rest of this paper. is-a (subClassOf) ArtistSonglabelis-a (subClassOf) Albumis-a (type)SelectedAmbientWorks85-92 is-a (type)AphexTwinwrittenBypartOfXtalGenrePlacebroaderAmbientTechnocountryTechnobirthPlaceis-a (subClassOf) RecordLabelis-a (type)R & SCountryIrelandPersonCityLimerickYear1992Person DataMusic DataShop DataOrganisationMusic Release TypeGeo Datagenregenreis-a (subClassOf) is-a (type)artistKnowledge Graph = Data + Relations + Semantic Structure InferenceDomainOther DatayearReleasedAgeispolispartOfyearProduced M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 5 Resource Description Framework (RDF) is a framework or data model to present data in a graph-like fashion, and was initially developed to describe metadata of web-resources (namely the Semantic Web) [25]. Today, the W3C proposes many technologies around RDF that help build and use knowledge graphs either as part of the Linked Data Cloud or in an encapsulated environment. KGs are represented by a set of <subject, predicate, object> triples that uniformly represent named relations (predicates) of entities (subjects) to either attribute values (literals) or other entities (objects). Entities are usually assigned an IRI (Internationalized Resource Identifier) that can refer to either a global or local namespace. In addition to IRIs, entities can identify by a blank node identifier that is only unique inside an RDF dataset. Sets of triples may also be grouped within named graphs to aggregate more information by extending the triple structure to quads of the form <subject, predicate, object, named-graph>. Standard RDF does not support edge properties, although the RDF-Star extension4 includes a similar feature, where single triples are usable in the subject or object part of another triple. The RDF standard also defines vocabularies such as RDF Schema (RDFS) to further express semantic structure by allowing the definition of classes, properties and their hierarchies. An RDF resource's type (or entity class) is assigned by using the standard RDF vocabulary5 to define triples of the form <s rdf:type o> where o is the class (type) of the resource. In addition to RDFS, a widely used approach for defining ontologies is the Web Ontology Language (OWL), more specifically, the current version OWL 2, which adds semantics to the data using a variety of axioms. Besides syntax validation (triples/quads, URIs, datatypes) RDF triple stores do not provide a standard method to define and validate graph data integrity or shape constraints (similar to relation database schemata). Therefore overlaid solutions such as SHACL (Shape Constraint Language [26]) or ShEx (Shape Expressions [27]) are de- veloped that can be used to validate the semantic correctness of the graphs structure, node or property constraints, cardinalities, and other constructs. While some RDF stores or triple stores are built from scratch to optimize the management of RDF triples, others might use existing SQL or NoSQL systems in the underlying database processing layer. The primary query language for RDF (moreover, the Semantic Web) is the standardized language SPARQL6, with an extended version for RDF- Star called SPARQL-Star. Standard exchange formats for RDF are N-Triples, N-Quads, Turtle, or adapted syntax formats like RDF/XML and JSON-LD. There are different possibilities to assign metadata to entities, relations and properties like using RDF-Star or named graphs as explained and evaluated in [28, 29]. The usage of support constructs for metadata management generally increases the complexity of the graph structure and queries and can possibly increase processing time. There is some work around the representation, querying storage and other aspects of temporal information in RDF [30]. The investigated methods focus on different temporal granularity and dimensions, including approaches that target to query single snapshots, time windows or to inspect the evolution of temporal graphs. As many knowledge graphs are in RDF, several frameworks have been developed to perform graph analytics, algorithms, or mining tasks using RDF as input [31]. Property Graph Model (PGM) [32]. The property graph data model, also called Labeled Property Graph (LPG), supports the flexible definition of graph structures with heterogeneous nodes (vertices) and directed edges to repre- sent entities of different kinds, and the relationships between them. Both nodes and edges can have multiple (type- )labels expressing their role in the modeled domain, e.g., User as a node label and follows as edge label. Addi- tionally, properties (in the form of key-value pairs) can be assigned to both nodes and edges. Further, in the most common implementations, vertices and edges are specified by a unique identifier. While label and property names represent some schema-like information, there is intentionally no predefined schema to allow flexible incorporation of heterogeneous entities and relations of different kinds (although a schema graph can be inferred from the type in- formation [33]). There is no built-in support for ontologies, e.g., to provide is-a relations between entity categories. Embedded metadata can be relatively easy maintained for entities and relationships by using dedicated properties, e.g. for provenance or time annotations. 4https://www.w3.org/2022/08/rdf-star-wg-charter/ 5http://www.w3.org/1999/02/22-rdf-syntax-ns# 6https://www.w3.org/TR/sparql11-overview/ 6 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges In contrast to RDF, the PGM with its vertices, edges and properties is more related to graph models in graph theory thereby contributing to their good understandability. As there is not yet a global (defacto) standard for PGM, its capabilities highly depend on its implementation. The PGM is increasingly popular in research and practice and supported by several graph database systems, such as Neo4j [34], JanusGraph [35] or TigerGraph [36], and processing frameworks, such as Oracle Labs PGX [37] or Gradoop [38]. It is further the base data model for several graph query languages [39], such as G-Core [40], Gremlin [41], PGQL [42], Cypher [43], as well as SQL/PGQ and GQL [44], the upcoming ISO standard language for property graph querying. Efforts on a standardized PGM serialization format, are the JSON-based Property Graph Exchange Format (PGEF) [45], YARS-PG [46] or the Graph Definition Language (GDL)7. Similar to RDF stores, data integrity of PGM databases is generally limited to syntax or basic value constraints. A first effort about the aspects of property graph key constraints is proposed by Angles et al. [47] by identifying four natural key types: identifier, exclusive mandatory, exclusive singleton, or exclusive. Additionally, PG-Schemas offer a robust formalism for specifying property graph schemas [48]. There are several extensions to the PGM for supporting temporally evolving graph data [38, 49] and graph streams [50], often with advanced analysis capabilities for graph mining. Discussion. As outlined above there are pros and cons for both RDF and PGM. The intensive use of RDF in the Semantic Web and Linked Open Data communities has lead to its wide-spread application for KGs; in fact most KGs we will consider in Section 4 are using RDF. The triple-based graph representation of RDF is quite flexible and allows a uniform representation for entities and relationships. But it is also hard to understand without additional processing or inference as the information of an entity is distributed over many triples. While RDF-Star greatly improves the formal meta expressiveness of RDF, specific cases are still not presentable as in PGM without utilizing support constructs. In the PGM, we can have two relations with the same name that can be addressed independently. Each relation has its own distinct properties. However, in RDF-Star, relations (triples) are identified based on their associated elements <<s1,p1,o1>,p2,o2>, and it is not possible to attach different sets of information to equally named relations (triples) without causing incorrect connections or relying on support constructs (e.g. singleton properties) [51]. While RDF is older and has gone through extensive standardization during the last 25 years, the PGM has become increasingly popular for advanced database and network applications, such as graph traversal and network analysis [52]. Besides RDF (direct graphs) or property graphs, in some cases, custom models or special high arity representation could be used to cover specific features, such as access-levels, temporal information, or multihop relations in one record (node-edge-edge-node) [53]. However, the usage of such custom models will lower interoperability with existing tools (requiring transformation), and complicate its own reusability by others. The decision between the use of RDF and PGM (or a custom data model) depends on the targeted application or use case of the final knowledge graph. Lassila et al [51] conclude that both formats are qualified to meet their chal- lenges and none of the two is perfect for every use case. They thus recommend increasing interoperability between both models to reuse existing techniques of both approaches. Various efforts to address this problem have been made in recent years. The Amazon Neptune8 database service allows users to operate PGM and RDF interchangeably. Hartig et al. [54] and Abuoda et al. [55] discuss transformation strategies between RDF and PGM to lower usage boundaries. GraphQL9 provides a unified approach to query both RDF and the PGM, although with fewer features compared to query languages dedicated to these graph formats. GraphQL-LD [56] aims at simplifying querying Linked Data via GraphQL. Terminology. Due to the different communities around PGM and RDF there are many similar but differently named terms in use. Table 2.2 lists some of the terms that we will use as synonymous in this paper with the under- lined ones used preferably. Furthermore, we refer to the smallest unit of information as statement or fact. For RDF this would describe a triple, 7https://github.com/dbs-leipzig/gdl 8https://aws.amazon.com/en/blogs/aws/amazon-neptune-a-fully-managed-graph-database-service/ 9https://graphql.org/ M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 7 Table 2 Synonymously used KG terms in RDF and PGM. Terms entity, instance, subject & object & resource (RDF), individual relation, property (RDF) type, class, label, concept property (PGM), attribute (RDF) property value, literal, attribute value Description KG nodes that represent a specific real-world or abstract thing a relationship (edge, link) between two KG entities. Identifier that represents the same kind or group of entities or relations. an entity feature identifier pointing to a value any value that is not referable to as an entity. for PGM this can be assigning a property(-value), adding a type label to an entity or adding a relation between two nodes. 2.3. Requirements of KG construction The development and maintenance of KGs encompass several steps to integrate relevant input data from different sources. While the specific steps depend on the input data to be integrated and the intended usage forms of the KG, it is generally desirable that the steps are executed within pipelines with only a minimum of manual interaction and curation. However, a completely automatic KG construction is not yet in reach since several steps (e.g., identification of relevant sources, development of the KG ontology), as we will see, typically require human input, either by individuals, expert groups or entire communities [57]. The KG construction process should result in a high-quality KG based on an expressive KG data model as dis- cussed above. The quality of a KG (and data sources) can be measured along several dimensions such as correctness, freshness, comprehensiveness and succinctness [58, 59]. The correctness aspect is crucial to the validity of infor- mation (accuracy) and implies that each entity, concept, relation, and property is canonicalized by having a unique identifier and being included exactly once (consistency) [12]. The freshness (timeliness) aspect requires continu- ously updating the instances and ontological information in a KG to incorporate all relevant data source changes. The comprehensiveness requirement asks for good coverage of all relevant data (completeness) and that comple- menting data from different sources is combined [59]. Finally, the succinctness criterion asks for a high focus of the data (e.g., on a single domain) [8] and the exclusion of unnecessary information, which also improves resource consumption and scalability of the system (availability). A knowledge graph that meets high standards in these areas can be considered a confident and reliable resource (trustworthiness) [60]. In the following, we discuss requirements for KG construction and maintenance in more detail as they should guide the realization of suitable implementation approaches. We group these requirements into four aspects related to 1) input consumption, 2) incremental data processing capabilities, 3) tooling/pipelining, and 4) quality assurance, whereas some essential prerequisites can affect multiple parts of the workflow (e.g., supportive metadata). Please note, that we outline the desired functionality for defining arbitrary KG pipelines and that only a subset of it is typically needed for a specific KG project. – Input Data requirements. It should be possible to integrate a large number of data sources as well as a high amount of data (data scalability). There should also be support for heterogeneous and potentially low-quality input data of different kinds such as structured, semi-structured and multimodal unstructured data (textual doc- uments, web data, images, videos, etc.). As a result, KG construction requires scalable methods for the acquisi- tion, transformation, and integration of these diverse kinds of input data. The processing of semi-structured and unstructured data introduces the need for knowledge extraction methods to determine structured entities and their relations as well as their transformation into the KG graph data model. Data integration and canonical- ization involve methods to determine corresponding or matching entities (entity linking, entity resolution) and their combination into a single representation (entity fusion) as well as matching and merging ontology con- cepts and properties. For incremental KG construction, the input is not limited to the new data to be added but also includes the current version of the KG and reusable data artifacts such as previously determined mappings specifying how to transform input data into the format of the KG graph model. – Support for incremental KG updates. It should be possible to process the input data both in a batch-like mode where all (new) input data is processed at the same time or in a streaming manner where new data items 8 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges can continuously be ingested. The initial version of the KG is typically created in a batch-like manner, e.g., by transforming a single data source or by integrating several data sources into an initial KG. After the initial KG version has been established, it is necessary that the KG can be updated to incorporate additional sources and information. A simple approach would perform these updates by a complete recomputation of the KG with the changed input data similar than for the creation of the initial KG. However, such an approach would result in an enormous amount of redundant computation to repeatedly extract and transform the same (unchanged) data and to perform data integration and removal of inconsistencies again, possibly with repeated manual interac- tions. These problems increase with the number and size of input sources and thus limit or prevent scalability. Hence we require support for incremental KG updates that can either periodically be performed in a batch-like manner or in a more dynamic, streaming-like fashion. The batch approach would not require completely re- building the KG, but focus on adding the new information without reprocessing previously integrated data. A given KG can also be continuously updated with new data in a streaming manner to always provide the most current information for high data freshness. Batch and stream-oriented updates may also be applied in combi- nation [53]. As a result, several pipelines may be needed for the creation of the initial KG, the integration of sources with heterogeneous structures, and different forms of incremental KG maintenance. While incremental KG maintenance is important in general, specific KG use cases such as research projects may only need a one-time or batch creation of a KG. Hence, the posed requirement would not apply in such cases. – Pipeline and Tool Requirements. It should be easy to define and run powerful, efficient, and scalable pipelines for creating and incrementally updating a KG. This requires a set of suitable methods or tools for the different steps (discussed in the next section) that should have good interoperability, and a good degree of automation, but still support high customizability, and adapt to new domain requirements. While the usage of a uniform KG data model (or serialization) can lower debugging complexity of the workflow, reusing existing toolsets might require transformation/mapping between data formats and the processing steps. Moreover, a pipeline tool should be provided that can integrate the different tools and manages intermediate results and common meta- data, e.g., about provenance. The pipeline tool should further provide administration functionality to design and execute pipelines, to support error handling, performance monitoring and tuning etc. Pipeline processes should scale horizontally as new input data is ingested and the KG size increases over time. Modular processing workflows with transparent interfaces can increase the reusability of alternative tools (implementations). – Quality Assurance. Quality assurance is a cross-cutting topic playing an important role throughout the whole KG construction process. Quality problems in the KG can be multi-faceted relating to the ontological consis- tency, the data quality of entities and relations (comprehensiveness), or domain coverage. The coverage as- pect may focus on the inclusion of relevant data and the exclusion of unnecessary data. In some scenarios, the timeliness of data can play a critical role in real-time-oriented use cases. If not handled, quality problems might aggravate over time due to the continuous integration of additional data. Therefore methods are needed to evaluate the quality of each step of the construction pipeline as well as of the resulting KG. A specific quality aspect is to validate the KG's data integrity concerning its underlying semantic structure (ontology). Another relevant criterion could be to optimize data freshness to guarantee up-to-date results in upstream applications. Debugging capabilities based on sufficient metadata are helpful to locate the exact points in the construction pipeline where quality problems arise. Methods are then required for fixing or mitigating the detected quality issues by refining and repairing the KG. 3. Construction Tasks We give an overview of the main tasks for Knowledge Graph Construction with a focus on (semi-)automatic and incremental solutions. In particular, we cover the following tasks that often involve several subtasks: – Data Acquisition & Preprocessing: Selection of relevant sources, acquisition and transformation of relevant source data, initial data cleaning. – Metadata Management: Acquisition and management of different kinds of metadata, e.g., about the provenance of entities, structural metadata, temporal information, quality reports or process logs. M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 9 Fig. 2. Incremental Knowledge Graph Construction Pipeline – Ontology Management: Creation and incremental evolution of a KG ontology. – Knowledge Extraction (KE): Derivation of structured information and knowledge from unstructured or semi- structured data. using techniques for named entity recognition, entity linking and relation extraction. If neces- sary this also entails canonicalization of entity and relation identifiers. – Entity Resolution (ER) and Fusion: Identification of matching entities and their fusion within the KG. – Quality Assurance (QA): Possible quality aspects, their identification, and repair strategies of data quality problems in the KG. – Knowledge Completion: Extending a given KG, e.g., by learning missing type information, predicting new relations, and enhancing domain-specific data (polishing). Figure 2 illustrates a generic pipeline to incrementally incorporate updates from several sources into a KG that may result in a sequence of distinct KG versions. It is important to note, that a construction pipeline does not necessarily follow a fixed execution order for the individual tasks and that not all steps may be required depending on the KG use case. This is also because the required tasks depend on the type of source input. Knowledge extraction is commonly applied on unstructured data inputs like text and may not be needed for structured data, e.g. from databases or other knowledge graphs. Furthermore, the entity linking part of knowledge extraction can make an additional entity resolution step unnecessary. As a result, there may be different KG construction pipelines for different use cases and data sources. The steps of Quality Assurance and KG completion to improve the current version of the KG are not needed for every KG update but may be executed asynchronously, e.g., within separate pipelines (although QA actions such as data cleaning also apply to individual tasks). Furthermore, data and metadata management play a special role compared to the other tasks, since they are necessary throughout the entire pipeline therefore representing a cross-cutting task, as indicated by the central position of metadata management in Figure 2. 3.1. Data Acquisition & Preprocessing 3.1.1. Source Selection & Filtering In order to integrate data into a KG, relevant sources must first be identified. Furthermore, relevant subsets of a data source have to be determined as it is generally unnecessary to integrate all information of a source for a given KG project. For example, for a pandemic-specific KG only health-related parts of existing KGs such as DBpedia may be needed. If the system is not supposed to integrate data sources in their entirety, it can determine a relevant Lorem ipsumdolor sit amet, consectetur adipisicing elitMetaDataRepositoryConfigurations(Schemas, Mappings)DataVersionsDataProvenanceDataAcquisition &PreprocessingOntologyManagementKnowledgeExtractionEntityResolution& FusionKnowledgeCompletionS_nS_1KG_1KG_nQualityAssurance......Un-, Semi- or Structured InputSources (+ KG and Configs)Task PipelineIntegrated Knowledge Graph VersionsMetadata Management(Cleaning, Mapping)KG_n-1Configs 10 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges subset by the quality or trustworthiness of a source [61] as well as the importance of single entities [53]. Formulating the quantification [62] of all these criteria alongside computing the cost of integrating a source leads to saving a considerable amount of unnecessary effort while producing a high-quality KG. Selecting relevant data sources and their subsets are typically manual steps but can be supported by data catalogs providing describing metadata about sources and their contents. Common approaches to determine such metadata are to employ techniques for data profiling, topic modeling, keyword tagging, and categorization [63, 64]. In [12] it is recommended to start KG construction with large curated ("premium") data sources such as Wikipedia and other KGs such as DBpedia. Then further data sources should be identified and integrated to cover additional entities and their relations, especially rather special entities in the "long tail" (e.g., less prominent persons). Given that sources can differ enormously in size and quality, the order in which sources (and their updates) are integrated can have a strong influence on the final quality [65–67]. Especially for creating the initial KG, these choices are often crucial. To limit these effects it is advisable to first integrate the sources of the highest quality [65] such as the mentioned premium sources. Nevertheless, ideally integration order should not matter in a high-quality pipeline. 3.1.2. Data Acquisition The data sources of a KG may come in many different data formats such as CSV, XML, JSON, or RDF to meet the requirement of different originating environments and applications. Furthermore, there are different technologies to exchange or acquire data artifacts by providing downloadable files, deploying databases, or individual application program interfaces (APIs). Hence, KG construction has to deal with these heterogeneous data formats and access technologies to acquire the data to be integrated. A common access approach is the use of an adapter component for each source dataset. Such an adapter approach is typical for data integration and there are also supporting tools for use in KG management [68–70]. In addition, KG construction has to deal with continuously changing sources, which necessitates the recognition of such changes and possibly maintaining snapshots of already acquired versions of source data. Possible solutions for change detection include manual user notifications over email, accessing a change API using publish-subscribe protocols [71], or computing diffs by repeatedly crawling external data and comparing it with a previously obtained snapshot. For RDF stores several strategies for maintaining versions of extracted data have been proposed. With full ma- terialization, complete versions (snapshots) of source data are maintained [72]. With the delta-based strategy only one full version of the dataset needs to be stored and for each new version only the set of changes or deltas has to be kept [73–76]. The annotated triples strategy is based on the idea of augmenting each triple with its temporal validity [77]. Hybrid strategies have also been considered [78, 79]. Another approach to synchronize changes in a data source are Linked Data Event Streams (LDES) [80]. Van Assche et. al. [81] use LDES to continuously update a KG with changes from the underlying data sources. Other KGs are important sources for data acquisition. However, only a limited number of KGs provide a queryable interface and such interfaces can be expensive to host at high availability [82–84]. To address this problem, recent proposals suggest decentralization, either of the data itself or of the query processing tasks. Decentralization (dis- tribition) of the data across multiple sources [85–87] can increase its availability but tends to provide less efficient query processing compared to centralized servers or approaches that provide full data dumps to powerful clients for local processing. Alternatively, recent studies [82, 88–91] have focused on decentralizing the query processing tasks by dividing the processing workload between servers and clients. WiseKG is a system to dynamically distribute the load between servers and clients based on a cost model [92] . 3.1.3. Transformation & Mapping A KG construction pipeline has to transform the input data into the final KG data format, such as RDF or a property graph format. Furthermore, the different pipeline steps may consume and produce different formats, so additional data format transformations or conversions may become necessary. For example, knowledge extraction methods typically process document data such as HTML or Unicode-encoded text, while an entity resolution task may require input data in CSV or JSON format. Data transformations have especially been addressed for (semi-)structured data and many tools exist for this pur- pose [93]. Depending on the required input format, the transformation can be done automatically using generic ap- proaches or requires the manual specification of mappings. Mapping languages allow the specification of complex M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 11 and reusable mappings, for example, to transform relational databases (RDB) into an equivalent RDF representa- tion, e.g. using the R2RML language [94]. RML [95] (RDF Mapping Language) extends R2RML and allows defin- ing mappings not only from RDB but also from other semi-structured data formats such as XML, TSV/CSV, and JSON. Systems implementing such mapping languages include SDM-RDFizer [96] for RML, and Karma [97] for an R2RML alternative called K2RML. Relatively little work has so far investigated the transformation of structured data into property graphs [98, 99] although the conversion between RDF and property graphs has received some attention [54, 55, 100]. In case of an existing RDF-based KG as input, a simple solution for RDF to RDF mappings is to use SPARQL-CONSTRUCT10 queries, which return a single RDF graph by substituting variables of a given graph pattern with the results of the SPARQL query. As an extension of SPARQL, SPARQL-Generate supports the transformation of streaming and binary data sources [101]. The graph query language GQL will support a similar feature for the PGM [44]. An extensive survey on state-of-the-art RDF mapping languages for schema transforma- tion, data transformation, and systems was done by Van Assche et al [17]. A major issue the authors point out is the lack of tools supporting the (semi-)automatic definition of mappings. In their survey, only 3 out of 30 analyzed systems support the semi-automatic definition of mappings (including human-in-the-loop methods) [102–104]. 3.1.4. Data Cleaning Data cleaning deals with detecting and removing errors and inconsistencies from data in order to improve the quality of data. Whenever possible, data quality problems within the input sources should be handled already during the import process to avoid that wrong or low-quality data is added to the KG. Data cleaning has received a large amount of interest, especially for structured data, in both industry and research and there are numerous surveys and books about the topic, e.g. [105–108]. Various types of data errors and quality problems need to be handled ranging from structural to semantic data problems. Dealing with structural problems asks for consolidating different data structures and formats and ensuring consistent naming conventions for entities and attributes. For instance, if "USA," "United States," and "U.S." are all used to represent the same country, they should be standardized to a single form. Semantic data cleaning focuses on addressing issues related to the meaning and relationships within the data. One example is handling conflicting or contradictory information present in the dataset. For instance, if one source indicates that a person was born in 1980, while another source suggests 1985, this inconsistency needs to be resolved. Another example is handling entities either in one source or different sources that represent the same real-world object, e.g., a certain customer or product. Data cleaning typically involves several subtasks to address these problems. These include data profiling to iden- tify quality issues [109], data repair to correct identified problems, data transformation to standardize data repre- sentations, and data deduplication to eliminate duplicate entities. Outlier detection is an important aspect of data profiling, aiming to identify data errors based on the assumption of specific "normal" data values. For instance, it is highly unlikely that an individual born in the mid-19th century would still be alive in the year 2020. Rule-based methods are classic techniques used for data cleaning. These methods handle errors that violate integrity constraint rules, such as functional dependencies (FDs) [110–114], conditional functional dependencies (CFDs) [112, 115–117], and denial constraints (DCs) [112, 117–121]. While rule-based methods can handle data that violates predefined rules, their effectiveness is limited by the challenge of obtaining sufficient and correct rules. Statistical cleaning methods repair errors based on probabilistic distributions within the data [114, 119, 121–124]. User interaction cleaning methods involve human knowledge to enhance the quality of cleaning results while minimizing the effort required [122, 123, 125–130]. The use of machine learning for data cleaning has gained prominence in recent years, as it simplifies the configuration of various subtasks. For example, HoloClean [121] employs observed data to build a probabilistic model for predicting unknown data values. Other applications of machine learning for data cleaning are covered in [107, 131]. If there is already a KG version to be extended, the KG information can be leveraged to identify and handle data errors. For instance, KATARA [126] employs crowdsourcing to verify whether values that don't match the KG are correct or not. Hao et al. [132] introduce detective rules (DRs) that can make actionable decisions on relational data, 10https://www.w3.org/TR/rdf-sparql-query/#construct 12 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges by building connections between a relation and a KG. KGClean [133] is an initial attempt at a KG-driven cleaning framework utilizing knowledge graph embeddings. Techniques for ensuring KG quality are discussed in Section 3.6. Approaches for identifying duplicates across data sources (entity matching) are outlined in Section 3.5. It is advantageous to remove duplicates within a source early on to simplify the deduplication process across sources. 3.2. Metadata Management Metadata describes data artifacts and is important for the findability, accessibility, interoperability and (re-)usability of these artifacts [15, 134, 135]. There are many kinds of metadata in KGs such as descriptive metadata (content in- formation for discovery), structural metadata (e.g. schemas and ontologies), and administrative metadata concerning technical and process aspects (e.g., provenance information, mapping specifications) [136–138]. It is thus important that KG construction supports the comprehensive representation, management and usability of the different kinds of metadata. From the perspective of KG construction pipelines, this includes metadata for each data source (schema, access specifications), each processing step in the pipeline (inputs including configuration, outputs including log files and reports), about intermediate results and of course the KG and its versions. Moreover, for each fact (entity, relation, property) in the KG there can be metadata such as about provenance, i.e., information about the origin of data artifacts. Such fact-level provenance is sometimes called deep or statement-level provenance. Examples of deep provenance include information about the creation date, confidence score (of the extraction method) or the original text paragraph the fact was derived from. Such provenance can help to make fact-level changes in the KG without re-computing each step or to identify how and from where wrong values were introduced into the KG [135]. Metadata can be created either manually by human users (e.g., to specify a license for data usage or a configuration of a pipeline step) or by a computer program based on a heuristic or an algorithm [137]. In the latter case the results may be exact or only approximate. For example, data profiling computes accurate statistical information (e.g., about the distribution of values) while the use of machine learning (e.g., for type recognition) usually does not provide perfect accuracy. To use metadata effectively for KG construction, it is beneficial to maintain a metadata repository (MDR) to store and organize the different kinds of metadata in a uniform and consistent way [134]. The MDR can either be separate from the sources and the KG with references to data artifacts or there can be combined solutions for both the data and their metadata. While there may be several metadata repositories for the different sources and processing steps, a central solution can simplify access to all KG-relevant metadata. In contrast, using multiple metadata solutions might allow more flexibility in selecting specialized solutions that suit specific needs or types of metadata. This approach can also introduce complexity or inconsistencies and hinder the process of discovery and exploration due to information being scattered across various repositories. Specific implementations of MDRs are CKAN11, Samply [139], or the DBpedia Databus [140], all using specific vocabularies, standard query languages, and databases to implement their relevant features. Concerning metadata exchange, the Open Archives Protocol for Metadata Harvesting12 framework also allows acquisition of structured metadata. Fact-level metadata (or annotations) in the KG can be stored either together with the data items (embedded metadata) or in parallel to the data and referenced using unique IDs (associated metadata) [138]. For example, fact-level metadata can support the selection of values and sub-graphs [141], or the compliance to used licenses in target applications. Such annotations are also useful for other kinds of metadata. Temporal KGs can be realized by temporal annotations to record the validity time interval (period during which a fact was valid) and transaction time (time when a fact was added or changed) [38, 49]. The possible implementations for fact-level annotations depend on the used graph data model (see Section 2.2). From another perspective, provenance metadata can also capture the steps of the applied schema and data transformations in the pipeline [142, 143]. 11https://ckan.org/ 12https://www.openarchives.org/OAI/openarchivesprotocol.html M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 13 3.3. Ontology Management Ontology development is the incremental process of creating or extending an ontological knowledge base [144]. KG construction requires to develop an ontology for the initial KG and to incrementally update the ontology to incorporate new kinds of information. As of today, ontology development and curation is still done broadly manual or crowdsourced although some semi-automatic approaches are also proposed. Semi-automatic ontology develop- ment tasks share a great overlap with methods from knowledge extraction, entity resolution, quality assurance and knowledge completion. Creating the initial ontology can be derived from a single source that ideally provides al- ready some useful ontology to build on. Public web wikis, catalogs, APIs, or crowdsourced databases are valuable starting sources as they may already contain a large amount of (semi-)structured data on general or domain-specific topics. However, cleaning and enrichment processes are required to ensure sufficient domain coverage and quality to build an initial knowledge graph structure from this existing data. For example, if Wikipedia is used as a primary source its category system can be good start to derive the most relevant classes for the KG by some NLP-based "category cleaning" [12]. Semi-automatic approaches mostly focus on learning an ontology from single sources, i.e. transforming a source into an ontology or KG. These individual ontologies or KGs can then be integrated into a pre- vious version of the overall KG. A key prerequisite for this kind of ontology integration is the step of ontology and schema matching to determine respective ontology and schema elements (classes, properties). After a discussion of semi-automatic approaches for ontology learning we therefore discuss ontology/schema matching and close with approaches for ontology integration. 3.3.1. Ontology Learning There are two main subfields of ontology learning; the first focuses on learning from text sources (unstructured data); the second from relational databases (structured data). Although the authors in [145–147] discuss that auto- matic ontology construction is not likely to be possible, a significant amount of research has been done to support the semi-automatic construction for single sources. Al-Aswadi et. al. [145] give a state-of-the-art overview of ontology learning from unstructured text where the goal is to identify the main concepts and their relations for the entities in a document collection. The ap- proaches [145–147] can be grouped into linguistic approaches (using NLP techniques such as part-of-speech tag- ging, sentence parsing, syntactic structure analysis, and dependency analysis methods) and machine learning ap- proaches. The latter include statistic-based methods (e.g., utilizing co-occurrence analysis, association rules, and clustering) and logic-based approaches using either inductive logic programming or logical inference. Al-Aswadi et. al. [145] argue that there is a need to move from shallow to deep learning approaches for deeper sentence analysis and improved learning of concepts and relations. Ma et al. [148] give a survey of methods for learning ontologies from relational databases with a focus of meth- ods for reverse engineering or the use of mappings to transform a relational database (schema) into an ontology or knowledge graph. Reverse-engineering allows one to derive an Entity-Relationship diagram or conceptual model from the relational schema. Here additional considerations are needed to deal with trigger and constraint defini- tions to avoid a semantic loss in the transformation. For the mapping techniques to transform RDBs to KGs, the authors differentiate between template-based, pattern-based, assertion-based, graph-based mapping, and rule-based mapping approaches. The resulting mappings should be executable on instance data in order to generate a graph structure from a relational database [149, 150]. 3.3.2. Ontology/schema matching Consolidating and integrating information from multiple heterogeneous sources requires harmonizing the on- tologies and/or schemas of the sources. A main step for such a data integration is ontology and schema matching which is the task of identifying corresponding ontology and schema elements, i.e. matching ontology concepts and matching properties of concepts and entities. For example, to integrate a new source into a KG it is necessary to perform a matching of the source ontology/schema with the KG ontology to identify which source elements are already existing in the KG ontology and which ones should be added. Property matching is also important for entity resolution and entity fusion in order to determine matching entities based on the similarity of equivalent properties and to combine equivalent properties to avoid redundant information. In some cases known entity matches can be 14 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges used to aid in the ontology matching step [151]. Some tools also perform entity resolution and ontology matching in combination [152]. There is a huge amount of previous research on schema and ontology matching, although mostly outside the context of knowledge graphs, and there are numerous surveys and books about the topic [153–157]. The match approaches typically rely on determining the similarity of elements using different strategies, such as the similarity of concept/property names or the similarity of instance values. Structural information can also be beneficial in the matching process, e.g. by looking at the concepts in the graph neighborhood. Matching systems commonly rely on a combination of different match strategies in order to achieve high-level match-quality [158]. While string similarity can be a strong signal for a match decision, often semantically similar words are used, which are dissimilar on character level. Dictionaries or pre-trained word embeddings are therefore helpful to capture this semantic similarity. Zhang et. al. [159] investigate how word embeddings (using Word2Vec [160]) can be used for the task of ontology matching. They found a hybrid approach to perform the best, which takes the maximum of either edit-distance-based or word embedding similarity for each entity pair. Another approach, which relies on word embeddings but also on meta-information about property's names and their values as input for a dense neural network is LEAPME [161]. This system trains a classifier based on already labeled property pairs. This trained model can then decide whether unlabeled property pairs and their similarity scores constitute a match. Graph embeddings have also seen some attention in ontology matching as they can capture structural information of an ontology. For example Portisch et. al. [162] use a variation of RDF2Vec [163], which is a walk-based embedding technique similar to Word2Vec, to encode both ontologies and then use a rotation matrix to align the embeddings. There are some tailored ontology matching approaches for KGs such as for mapping categories derived from Wikipedia to the Wordnet taxonomy with the goal to achieve an enriched KG ontology [12]. Other specific ap- proaches have been developed to address the integration of RDBs with ontologies, that go beyond the mapping languages described in Section 3.1.3. KARMA [97] provides a semi-automatic approach to link a structured source such as a RDB with an existing ontology. The process consists of assigning semantic types to each column, con- structing a graph of all possible mappings between the source and the ontology, refining the model based on user input and finally generating a formal specification of the source model. 3.3.3. Ontology Integration Fig. 3. Ontology and Entity Merging Strategies. Merging new ontology or schema data into the existing KG ontology is a subtask of ontology or schema integra- tion. This topic has achieved some attention where recent approaches utilize the mapping result of a match (align- ments) to combine multiple ontologies/schemas [164–166]. If the match mapping is automatically determined, it must first be manually validated and possibly corrected to provide a valid basis for the merge step. Osman et al. [166] give a comprehensive and recent summary of ontology integration techniques, which can handle the merging of ontology and entity data using respective alignments. The authors distinguish the following merging strategies: xxE2C1is-aE3C2zis-azE5E6yE4C1is-aE1is-aE1E6zis-ais-aE3 ∪ E5xyxE2 ∪ E4C1is-aE1is-azE3xxE2Ontology Alignments =E6C2C1C2E2E4E3E5equivalentClasssameAsequivalentPropertysameAsTarget DataSource Dataa) Simpleb) Fullc) Asymmetricxy,,Entity Matches = equivalentClass M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 15 – Simple Merge. Imports all input ontologies into a new ontology and adds bridging constructs between equiv- alent entities, like defining OWL equivalentClass or equivalentProperty relations. – Full Merge. Imports all source ontologies into a new ontology and merges each cluster of equivalent entities into a new unique entity with a union of all their relations and leaving equivalent classes untouched. – Asymmetric Merge. These approaches import source ontologies into a preferred target ontology, preserving all its concepts, relations, and rules by merging matching entities into existing target entities or else by creating new ones. Figure 3 visualizes each of the three strategies, where a) also shows the source and target data that are merged. From the three merging strategies, the authors favor the last and mention it as a good solution for incremental ontology integration. The reason for this preference is that the asymmetric merge strategy preserves the target ontology during the integration, and only adds new elements from a source ontology if necessary. This can also be seen, in Figure 3 c), where the target data is left unchanged, and only a new entity E6 is added, which is connected to E3 from the target data. An example approach for asymmetric ontology merging focusing on is-a relations is proposed in [165]. 3.4. Knowledge Extraction Knowledge extraction is a process to obtain structured, more computer-readable data from unstructured data such as texts or semi-structured data, like web pages and other markup formats. The extraction methods of semi- structured data often use a combination of data cleaning (Section 3.1.4) and rule-based mappings (Section 3.1.3) to transform the input data into the final KG, targeting already defined classes and relations of the existing ontology. Most of the work focuses on knowledge extraction from text, sometimes additionally considering images and figures within the text. Recently, there has been an increased interest in creating multi-modal knowledge graphs (i.e. KGs with not only text but also other modes of data such as images) necessitating appropriate methods of knowledge extraction. The detailed discussion of such methods lies outside the scope this paper, but we refer the interested reader to the following survey by Zhu et. al. [13]. The main steps of text-based knowledge representation are named- entity recognition, entity linking, and relation extraction. These steps are discussed in the following and allow the extraction of entities and relations from text for inclusion into a KG. An example of this process is shown in Figure 4. 3.4.1. Named Entity Recognition Named-entity recognition (NER) refers to demarcating the locations of entity mentions in an input text. In the most widely used scenarios mentions of only a handful of types (e.g. persons, places, locations, etc.) are determined. However KGs usually contain hundreds or thousands of types. Furthermore, off-the-shelf NER tools do not provide canonicalized identifiers for the extracted mentions. A second step is therefore necessary to link entity mentions either to existing entities in a KG or with new identifiers. Fig. 4. Knowledge Extraction steps for an example sentence linking entities and relations to the DBpedia KG. Richard David Jamesreturned in 2014 with thealbum Syro.NamedEntityRecognition Richard David Jamesreturned in 2014 with thealbum Syro.dbr:Richard_David_Jamesdbr:Richard_D._James_(scientist)...DisambiguationRelationExtraction & Linking dbr:Richard_David_James dbo:wikiPageRedirects dbr:Aphex_Twin . dbr:Syro dbp:artist dbr:Aphex_Twin .dbr:Syro rdf:type dbo:Album . 16 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges A relatively reliable and simple way to detect entity mentions in a text is the use of a dictionary (also referred to as lexicon or gazetter), which maps labels of desired entities to identifiers in the KG. In addition to it's sim- plicity such an approach already provides recognized entities in a text with the right link to the KG (i.e. solving the tasks of named-entity recognition and entity linking in one step). However these dictionaries are usually in- complete. A simple way to increase the coverage of such dictionaries is to utilize disambiguated aliases in high- quality sources [12]. Wikipedia redirects or DBpedia's dbo:alias property would be a simple way to enhance an entity dictionary. For example https://en.wikipedia.org/wiki/Richard_D_James from the example redirects to https://en.wikipedia.org/wiki/Aphex_Twin. To make dictionary lookups efficient different data structures have been proposed. For example prefix tries or inverted indexing have shown to be a scalable solution for large Web search engines and are used in the NER approaches AGDISTIS [167], TagME [168] and WAT[169]. Machine learning methods have become increasingly popular to tackle NER. This is especially useful to find "emerging entities", i.e. entities that are unknown to the knowledge base. The machine learning models for entity recognition generally fall into the task of sequence labeling. A widely successful method for this task is known as Conditional Random Fields (CRF), which uses an undirected graph connecting input and output variables and models the conditional probability of output given the input. Generally these graphs form a linear chain (e.g in the Stanford CoreNLP package [170]), which means for a prediction only the immediate neighbors are relevant in a sequence. While CRFs require extensive feature engineering Deep Neural Networks have become highly popular in recent years for the task of NER, since they do not necessitate this amount of human interaction. For example LSTM networks ("long short term memory"), which are a specific case of recurrent neural networks (RNN), have become a prevalent choice for NER tasks [171]. The memory cells contained in this architecture are able to deal with long-term dependencies, which was previously a major painpoint for RNNs. Deep learning-based approaches for NER are surveyed in [172]. As multi-modal data become increasingly popular, e.g. on social media platforms, several recent studies focus on multi-modal NER (MNER) [173, 174], where the goal is to leverage the associated images to better identify the named entities contained in the text. Furthermore, there are first approaches [175–177] that address MNER for KGs. They aim to correlate visual content with textual facts. One typical solution parses images and texts to structured representations first and grounds events/entities across modalities. However, intra-modal relation extraction and cross-modal entity linking still are largely unresolved problems. 3.4.2. Linking If named entities are recognized in a text they need to be linked to the knowledge base or KG. This is called entity linking (EL) or named entity disambiguation (NED). Given a set of candidates from the knowledge base an EL algorithm needs to decide which entity a mention belongs to. In Figure 4 this can be seen, where Richard David James is linked to the DBpedia entity dbr:Richard_David_James. EL algorithms can rely on a variety of features. Based on the mention itself the confidence of the used NER tool can be used, how similar the mention and the entity are or how much overlap exists across mentions [178]. The context of the extracted mentions can be valuable. Keyword-based similarity can be used by relying on TF-IDF scores, where rare keywords used in the mention's context, which connect to a candidate entity, can give hints for linkage [179, 180]. Words that occur frequently in the same context can also help in the disambiguation process. Here pre-trained word embeddings can prove especially useful, since they encode semantic similarity in a latent space. Furthermore, already disambiguated mentions can be used to aid in the linking of entities that occur in the same paragraph. Holistic entity linking [178, 181] approaches leverage background information in the decision process, that ex- ceeds merely using the similarity between mention and entity. Popularly, the graph-structure of Wikipedia links can be used to determine commonness and relatedness. Commonness refers to the probability that an entity mention links to the respective Wikipedia article of the given candidate entity. Relatedness measures how many articles in Wikipedia link to articles of both candidates. Using such background knowledge unambiguous mentions can aid in the correct linkage of ambiguous mentions [182]. Entity linking approaches furthermore need to address specific challenges such as coreference resolution, where entities are not consistently referred to by their names, but with indirect references such as pronouns [178] and how to deal with emerging entities, i.e. entities that are recognized, but not yet existing in the target KG. For example M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 17 Hoffart et. al [183] keep a contextual profile of emerging entities and when this profile contains enough information to infer the semantic type of the mention it can be added to the KG with its type. Generally entity linking and the later discussed entity resolution (Section 3.5) share similarities in aiming to con- nect the same entities in and across data sources. entity linking and entity resolution are sometimes jointly discussed under the term entity canonicalization [12]. While entity resolution typically deals with at least semi-structured data sources, there have been some efforts to address cases with unstructured sources, where deep learning-based approaches are advantageous [184]. However, there are some key differences not only in the characteristic modal- ity of the data sources, but also in the signals that lead to a linking decision. For example, in the entity linking scenario, if one has already linked the mention "Richard James" to the entity dbr:Richard_David_James, seeing the mention "James" in close context makes it likely that it also refers to the same entity. By contrast, in the entity resolution scenario, if one already confidently matched two entities, it is unlikely that a similar unmatched entity from one data source will also be matched with the already matched entity from the other data source. This is because matching can often focus on 1 − 1 correspondence between two data sources under the assumption of deduplicated or clean data sources. However, investigating how well entity resolution approaches for dirty sources (where multiple entities may match with the same KG entity) can be utilized for entity linking and vice versa could be worthwhile. 3.4.3. Relation Extraction Given the identified entities in a text, relation extraction aims to determine the relationship among those entities. In Figure 4 we see this for example, when the text snippet album Syro becomes the triple dbr:Syro rdf:type dbo:Album, i.e. the type relation for entity dbr:Syro is determined. The first techniques use rule-based approaches to extract relations, e.g. by relying on Hearst Patterns to find hy- ponym (is-a) relations [185] or involving regex expressions [186, 187]. In order to improve coverage different ways to enhance such patterns were devised. The human involvement in these techniques however is a limiting factor. To address these shortcomings, statistical relation extraction models were devised. Feature-based methods rely on lexical, syntactic, and semantic features to use as input for relation classifiers. Similarly, kernel-based methods [188] rely on specifically designed kernel functions for SVMs to measure the similarity between relation candidates and text fragments. Graph-based methods further integrate known relations between entities and text in order to correctly identify relations [12]. While such methods can be incredibly useful to obtain relatively simple relations with high accuracy they are lim- ited in terms of their recall or at least require a high degree of additional human involvement for feature engineering, designing of kernel functions or the discovery of relational patterns [189, 190]. Neural relation extraction methods aim to close this gap. The input text is transformed via (pre-trained) word embeddings and position embeddings into a format that is suitable for the neural networks that are trained for relation extraction. Instead of devising hand- crafted features the focus in this area lies on investigating various neural network architectures such as recurrent neural networks, convolutional neural networks and LSTMs. The bottleneck for these approaches lies in the avail- ability of training data. A common approach to address this is via distant supervision. Statements from a given data source (for example Wikipedia) are used to train the given model. Especially the use of pre-trained language models has pushed the state-of-the-art to new heights [191, 192]. Han et. al [193] provide a more in-depth overview over these methods and identify the main challenges in the ability to utilize more data, creating more efficient learning schemes, handling more complex contexts (e.g. relational information across sentences) and detecting undefined relations in new domains. A special case of relation extraction aims to extract relations freely without a pre-defined set of relations. This is known as Open Information Extraction (OpenIE). While this can be a good way to increase the variety of information contained in the KG, a secondary step is necessary to canonicalize the extracted relations in order to deduplicate and possibly even link them to already contained synonymous relations in the KG [194]. Several tools exist for the entire process of Knowledge Extraction, with some tools focusing on specific aspects. For example DBpedia Spotlight [195] mainly aims at performing named entity extraction and links those mentions to the DBpedia KG. The dstlr [196] tool extracts mentions and relations from text, links those to Wikidata and fur- thermore populates the resulting KG with more facts from Wikidata. OpenNRE [197] provides an extensible frame- 18 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges work for neural relation extraction, with trainable models, however this approach would necessitate an independent linking step afterwards. Analogously to NER there are also efforts to use images as information sources for relation extraction. These can range from rule-based approaches [198], which for example verbalize detected spatial relations of recognized entities in an image, to learning-based techniques, which encode visual features of detected objects as well as textual features into distributed vectors used to predict relations between given objects. For example MEGA [199] aligns information contained in the syntax tree and word embeddings of the textual data and the scene graph obtained from the image. A scene graph connects detected objects in an image via their visual relations. After the alignment process the respective representations are concatenated and sent to a Multilayer Perceptron (which is a fully-connected feed-forward neural network) to predict the relation. 3.5. Entity Resolution and Fusion Entity resolution (ER), also called entity matching, deduplication or link discovery, is a key step in data integra- tion and for good data quality. It refers to the task of identifying entities either in one source or different sources that represent the same real-word object, e.g., a certain customer or product. An enormous amount of research has dealt with the topic as evidenced by numerous surveys and books [200–205]. In addition to several research proto- types there are also many commercial solutions such as IBM's InfoSphere Identity Insight13 or SAP's Master Data Governance Platform14. Most known approaches tackle static or batch-like entity resolution where matches are de- termined within or between datasets of a fixed size. The more recent of these approaches deal with multi-source big data entity resolution [206, 207], rely on Deep Learning [184, 208] or KG embeddings [209, 210], with the neural methods having seen more scrutiny recently after an era of relative hype [211]. For KG construction, however, we need incremental approaches that build on previous match decisions and determine for new entities if they are already represented in the KG or whether they should be added as new entities. Furthermore, for streaming-like data ingestion into a KG a dynamic (real-time) matching of new entities with the existing KG entities should be supported. Entity resolution results are fed to the step of entity fusion which fuses together matching entities to combine and thus to enrich the information about an entity in an uniform way. In the following we first discuss proposed approaches for incremental ER and then for entity fusion. 3.5.1. Incremental Entity Resolution Entity resolution is challenging due to the often limited quality and high heterogeneity of different entity descrip- tions. It is also computationally expensive because the number of comparisons between entities typically grows quadratically with the total number of entities. The standard approach for entity resolution uses a pipeline of three succeeding phases called blocking, linking/matching and clustering [66, 212]. The main step is to determine the similarity between pairs of entities to determine candidates for matching. This matching step often results in a sim- ilarity graph where nodes represent entities and edges link similar pairs of entities. The preceding blocking phase aims at drastically reducing the number of entity pairs to evaluate, e.g. based on some partitioning so that only enti- ties of the same partition need to be compared with each other (e.g., persons with the same birth year or products of the same manufacturer). After the match phase there is an optional clustering phase that uses the similarity graph to group together all matches. This phase can typically improve the quality of entity resolution, by relying on a more holistic perspective on entity similarities, when compared to the myopic pairwise matching. The clustering step also assists the succeeding step of entity fusion to fuse the matching entities into one representative entity for the KG. For incremental ER the task is to match sets of new entities from one or several sources with the current version of the KG which is typically very large and contains entities of different types. It is thus beneficial to know the type of new entities from previous steps in the KG construction pipeline so that only KG entities of the same or related types need to be considered. Figure 5 illustrates a high level workflow for incremental ER. The input is the current version of the KG with the already integrated entities (previous clusters in Figure 5) as well as the set of new entities to be integrated. This requires the development of incremental versions for blocking, matching and clustering phases 13https://www.ibm.com/products/infosphere-identity-insight 14https://www.sap.com/products/technology-platform/master-data-governance.html M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 19 Fig. 5. Incremental entity resolution workflow. that focus on the new entities. To allow better match decisions for incremental ER it is generally advantageous to retain the entities of the previously determined clusters (and their match similarities) and not only the fused cluster representatives. Some incremental clustering schemes can also use this to identify previous match mistakes and to repair existing clusters for new entities [66, 213]. Some approaches [214] and tools [215] also support to execute incremental ER in parallel on multiple machines to improve execution times and scalability to deal with large KGs. Blocking for incremental or streaming ER requires to identify for the new entities all other entities in the KG that need to be considered for matching. Given the typically high and growing size of the KG it is important to limit the matching to as few candidates as possible and determining the candidates should also be fast. As mentioned, blocking and entity resolution should be limited to entities of the same (or most similar) entity type and one can apply the same blocking approach for the new entities as for the previously integrated entities, e.g. by using some attribute-based blocking key such as birth year for persons or manufacturer for products. Several works [204, 205] have proposed further improvements over such a base approach for specific cases and blocking approaches. One approach [216–218] is to keep the blocking keys in a data structure with efficient data access to make compar- isons among entities faster. Another method to speed up the computation is the use of so-called summarization techniques [218]. One such approach summarizes (divides) larger blocks into multiple sub-blocks with a repre- sentative and directing a new record (query) to the sub-block with the most similar representative. This enables a constant number of comparisons for each new record which is valuable for both incremental and streaming ER. While most blocking approaches rely on domain or schema knowledge, there are also so-called schema-agnostic blocking schemes for highly heterogeneous data where entities of a certain type can have different sets of attributes. Hence, schema-agnostic approaches consider most or all attribute values and their components (e.g. words or to- kens), regardless of the associated attribute names. While there are many schema-agnostic blocking approaches for non-incremental ER [204, 205] schema-agnostic blocking approaches for incremental or streaming ER have only recently been proposed [214, 219, 220]. The matching step of incremental ER is limited to the new entities and involves a pair-wise comparison with the existing KG entities determined by the preceding incremental blocking step. The main goal is to determine all similar entities as potential match candidates as input for the final clustering step, where it is decided whether the new entity is added to an existing cluster or whether it should form a new cluster. Pairwise matching can be done as for batch-like ER and is based on the combined similarity between two entities derived from property values or related entities. The match approach can be configured manually, e.g., together with some similarity threshold that should be exceeded for match candidates, or by applying a supervised machine learning model [204]. If the pairwise match relationships between previously integrated KG entities are maintained in a similarity graph spawning the previous clusters, this graph can be extended by the new entities and links to the newly determined mach candidates as an input for incremental clustering [215]. While there are many approaches for batch-like entity clustering [221, 222], the incremental maintenance of entity clusters for new entities has received comparatively little attention. A straight-forward approach is to simply add a new entity either to the most similar existing cluster or to create a new cluster if there is no previous cluster with FusionNew Entities0.91.00.50.80.6BlockingMatchingClusteringPrevious Clusters 20 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges a high enough similarity exceeding some predefined similarity threshold [223]. However, this approach typically suffers from a strong dependency on the order in which new entities are added. In particular, wrong cluster decisions, e.g., due to data quality problems, will not be corrected and can lead to further errors when new entities are added. A more sophisticated incremental approach based on correlation clustering is proposed in [213] that maintains previous clusters within a similarity graph. The updated similarity graph is not only used to determine the clusters for new entities but to also repair previous clusters, e.g. by splitting and merging clusters or by moving entities among clusters. The incremental approaches in [65, 66] support optimized clustering decisions for duplicate-free (sometimes called clean) data sources from which at most one entity can participate per cluster of matching entities. In this case, an effective clustering strategy is the so-called "max-both" approach where an entity s from a set of new entities is only then added to the most similar cluster c when there is no other new entity that is more similar to c than s. The approach of [66] also supports a light-weight cluster repair called n-depth reclustering where only entities close to new entities in the updated similarity graph are considered for changing clusters. 3.5.2. Entity Fusion Merging multiple records of the same real-world entity into a single, consistent, and clean representation is referred to as data fusion [224]. This is a main step in data integration as it combines information from several entities into one enriched entity. Data fusion still entails resolving inconsistencies in the data. First the records may disagree on the names of matching attributes so that one preferred name has to be chosen that should be the consistent with the attribute names of other entities of the same type to facilitate querying. Furthermore, the matching records can disagree on the values of an attribute. There are three main strategies to handle such attribute-level inconsistencies or conflicts [224]: – Conflict Ignorance: The conflict is not handled but the different attribute values may be retained or the problem can be delegated to the user application. – Conflict Avoidance: It applies a unique strategy for all data. For example, it prioritizes data from trusted sources over others. – Conflict Resolution: It considers all data and metadata before applying a decision to apply a specified strategy, such as taking the most frequent, most recent or a randomly selected value. Such techniques were first applied for relational data but also found use for Linked Data fusion [225]. A valuable strategy is to combine multiple value scoring functions. Mendes et al. [226] combine two methods named TrustY- ourFriends (prioritizing data from the trusted source) and KeepUpToDate (using the latest value) for conflict avoid- ance and resolution. Moreover, they apply input quality assessment metrics to filter out the values below a threshold or keep the values with the highest quality assessment. Other techniques such as computing average, minimum, and maximum or taking the most frequent values are provided by their data integration framework. Dong et al. [227] combine TrustYourFriends with a Weighted Voting (most frequent or similar values) approach, whereas the former source ranking score is calculated based on an statistical approach. Similarly, Frey et al. [141] apply a median- based approach for Linked Data fusion. They distinguish functional properties15 and assign a single value to them. Non-functional properties can be assigned multiple different values. 3.6. Quality Assurance The quality of a KG is crucial for its credibility and therefore its usability in applications [228]. Quality assurance is the task of maintaining a high KG quality despite the continuous evolution of the KG. It comprises quality evaluation to assess the quality and detect quality issues as well as quality improvement to fix or mitigate quality issues by refining, repairing, and completing the KG. We discuss knowledge completion in the next subsection 3.7, due to its unique nature of adding data to the KG rather than improving or removing existing information. Quality assurance is important not only for the resulting KG as an outcome of the KG construction process but also within the different construction tasks, such as selecting good-quality sources (Section 3.1.2), data cleaning for acquired data, knowledge extraction, ontology evolution or entity fusion. The data cleaning approaches mentioned 15A functional property is specified to have a maximum cardinality of one. e.g., a person entity should only have one value for date of birth. M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 21 in Section 3.1.4 can also be applied to the KG, e.g., to identify outliers or contradicting information. Metadata such as provenance information is also important for quality assurance, for example, to explain and maintain KG data concerning the context and validity of conflicting values [12]. Assessing the quality of a KG is extremely challenging since there are many valid ways to structure and populate [229, 230]. In KGs and even subproblems such as evaluating the quality of a KG ontology are already difficult general, evaluating the quality depends on the scope of a KG and should be easier for domain-specific KGs than for very large KGs covering many domains for which completeness may not be possible. Moreover, the intended KG use cases influence the quality needs of the KG and should thus be considered for KG construction and KG evaluation. For example, e-commerce KGs such as the Amazon Product Graph [231] should provide up-to-date and reliable product information asking for the enforcement of quality criteria such as accuracy and timeliness. Applications such as financial risk analysis also need accurate and trustworthy information from KGs such as the Bloomberg Knowledge Graph [232]. On the other hand, there may also be use cases for which approximate answers - and thus reduced KG quality - may be sufficient, e.g., for obtaining recommendations (similar products, related literature) or to receive aggregated information (e.g., about the relative average income in different countries). We begin our overview of quality assurance by identifying and describing important quality dimensions. Then, we explore various evaluation methods to measure these dimensions. Next, we investigate correction methods to improve and rectify quality issues. Finally, we present quality evaluation frameworks and benchmark datasets that facilitate quality assessment. 3.6.1. Quality Dimensions KG evaluation typically involves analyzing various dimensions of quality and the relevance of the dimensions typically depends on the intended kinds of KG usage. Quality dimensions can be correlated and possibly impact each other positively or negatively, e.g., completeness can negatively affect accuracy. Wang et al. identified and surveyed in [60] six main quality dimensions (accuracy, consistency, timeliness, completeness, trustworthiness, availability) for use in KG evaluation: – Accuracy indicates the correctness of facts in a KG, including type, value, and relation correctness. It can be separated into syntactic accuracy, assessing wrong value datatype/format, or semantic accuracy, assessing wrong information. – Consistency ensures coherency and uniformity of the data within the graph. A consistent KG follows logical rules, avoids contradictions, and maintains coherence among entities, relationships, and attributes. Inconsisten- cies arise from conflicting information, duplicates, or rule violations. – Timeliness in the context of KGs refers to the currency and freshness of the information present in the graph. KG timeliness can be influenced by the chosen integration approach which may involve batch processing at specific intervals or real-time updates. – Completeness captures and reflects knowledge coverage within a specific domain. Completeness is also a goal for KG completion as it involves generating new values or data to augment the current KG. – Trustworthiness indicates confidence and reliability of the KG and depends on source selection and the applied construction methods. It is strongly related to the quality dimensions of completeness, accuracy, and timeliness. – Availability is the extent to which knowledge is convenient to use. In other words, it refers to how easily and quickly the knowledge of KGs can be retrieved concerning query complexity and data representation. 3.6.2. Evaluation Methods A common approach involves crowdsourcing techniques or expert knowledge in the evaluation process of knowl- edge graphs. During the validation phase, curators can spot errors or verify facts. Using an iterative human-in-the- loop process allows for continuous improvement and refinement, enhancing the overall reliability and trustwor- thiness of the graph's data. One conventional approach is to evaluate the accuracy of the KG against a manually labeled subset of entities and relations [19]. However, this is costly, so those manually labeled gold standards are usually small. Other approaches use statistical methods such as distance-based, deviations-based, and distribution- based methods [233]. Acosta et al. [234] leverages the wisdom of the crowds in two ways. They launched a contest targeting an expert crowd in order to find and classify erroneous RDF triples and then published the outcome of this contest as paid microtasks on Amazon Mechanical Turk (MTurk) in order to verify the issues spotted by the 22 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges experts. Their empirical evaluation on DBpedia shows that the two styles of crowdsourcing are complementary and that crowdsourcing-enabled quality assessment is a promising and affordable way to enhance data quality. Paulheim et al. [19] define retrospective evaluation as a method in which the human judges the correctness of the KG. The reported quality metric is accuracy or precision. Since KGs are often voluminous, the retrospective approach is typically restricted to a KG sample. Another method to evaluate quality is statistical analysis, identifying outliers, inconsistencies, or abnormal data distributions based on patterns and the data structure, including clustering, correlation analysis, or anomaly detection techniques [235]. Further, semantic reasoning and inference allow for the validation of the KG's consistency based on the given ontology or individual structural constraints. One method is to calculate disjoint axioms by identifying wrong type statements based on existing relations (e.g., domain and range check) [236]. Data profiling and cleaning techniques can be applied to find erroneous values based on their distribution. Dupli- cate detection, schema matching, or entity resolution can be used to identify and resolve inconsistencies, redundan- cies, or errors (format errors). Another way of quality evaluation relies on aligning and comparing the entities of the KG with external knowl- edge and reference sources. Li et al. [237] investigate the correctness of a fact by searching for pieces of evidence in other knowledge bases, web data, and searching logs. Similarly, [238] suggests individual checking of a single fact in different datasets in order to detect inaccurate facts. This is also useful for yielding larger-scale gold standards but has two sources of errors: errors in the target knowledge graph and errors in the linkage between the two. Finally, a rule-based analysis is a common solution to detect quality issues based on manually generated con- straints, e.g., value restriction or allowed/wanted properties for a specifically typed entity [26, 48]. 3.6.3. Quality Improvement Quality improvement aims at optimizing the KG, making it more reliable, useful, and valuable for its intended purpose and domain. Quality improvement activities include and combine several task areas discussed in the for- mer sections. Data cleaning (Section 3.1.4) addresses errors, inconsistencies, and redundancies in the graph. Error correction techniques eliminate incorrect or outdated information and adjust inconsistent data entries. Outlier detec- tion identifies and handles data points deviating significantly from the norm. Entity resolution (Section 3.5) meth- ods merge or link entities referring to the same real-world entity. Data fusion(Section 3.5.2) integrates information from multiple sources to enhance overall data quality. Continuous ontology development (Section 3.3) refines and expands the graph's underlying ontology to accommodate new knowledge and evolving requirements. Instead of filling in missing data, it may be preferable to remove irrelevant entities that do not pertain to the intended domain. This will prevent the KG from being unnecessarily bloated. Applying automatic approaches can cause extraction of irrelevant information and requires techniques either of manual nature or by leveraging known information from external already structured databases. In KG, quality assurance, versioning, and rollback mechanisms are crucial for managing errors and maintaining data integrity. By implementing version control mechanisms, changes in the KG can be tracked, allowing for easy rollback in the event of errors or quality issues. This ensures that previous versions of the KG can be restored, pro- viding a safety net for data consistency. Furthermore, maintaining an audit trail of changes and ensuring traceability supports data governance and reproducibility. Section 3.2 discusses various approaches to versioning that can be applied in this context. 3.6.4. Frameworks and Benchmarks The importance and complexity of KG quality assessment and improvement asks for powerful frameworks and tools to support these tasks. A quality evaluation framework incorporates metrics and processes to evaluate quality dimensions, ensuring a clear understanding of the graph's quality aligned with specific applications or use cases. Further, such a framework can already support mechanisms and techniques for quality improvement, either requiring a human-in-the-loop approach or applying automatic error correction. Chen et al. [239] give an overview of the requirements of KG evaluation frameworks, focusing on specific do- mains. A special requirement is the scalability of such a framework to be applicable to a huge amount of data. Con- sidering the degree of automation, using human-in-the-loop approaches might require KG sampling to only evaluate sub-graphs of the entire KG. M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 23 There exist already several frameworks and tools for KG quality evaluation and benchmarking. TripleCheck- Mate [240] is a crowdsourcing tool that allows users to evaluate single resources in a RDF KG, by annotating found errors with one of 17 error classes. Another human-in-the-loop approach was proposed by NELL where learned extraction patterns were validated by a user after a certain number of iterations [241]. RDFUnit [242] is an eval- uation tool for validating and testing RDF graphs against predefined quality constraints and patterns. It can assess the quality and compliance of RDF datasets concerning schema definitions, vocabulary usage, and data integrity (supporting SHACL). The tool enables the automatic generation of tests by analyzing the structure of schemata, like ontologies or vocabularies, and generating test cases based on defined rules or patterns. Additionally, the tool allows users to define custom validation rules or include existing vocabularies and ontologies for validation purposes. Hobbit [243] (Holistic Benchmarking of Big Linked Data) is a platform that facilitates benchmarking of linked data systems and components. It provides a standardized framework for evaluating and comparing algorithms and approaches used in processing linked datasets. Key features include configuring benchmarking workflows, evaluat- ing performance metrics, visualizing results, and supporting reproducibility and sharing of benchmarks. Benchmark datasets exist for specific subtasks of KG construction, such as entity resolution (e.g. Gollum [244]) and knowledge completion (e.g. CoDEx [245]). While there are several benchmark datasets available that focus on specific subtasks of the construction process, there is a lack of widely used end-to-end benchmark datasets, and researchers often create custom datasets or use subsets of existing datasets to evaluate their construction pipeline. 3.7. Knowledge Completion Knowledge Graph completion is the task of adding new entries (nodes, relations, properties) to the graph using existing relations. Paulheim [19] surveys KG completion approaches as well as evaluation methods. He also distin- guishes internal from external methods, especially for determining missing entity type information and relations. Internal approaches solely rely on the KG as input, whereas external methods incorporate additional data like text corpora, and in a broader context, human knowledge sources like crowdsourcing. The survey concludes that current approaches for KG completion typically limit themselves to a single task such as determining missing type informa- tion, or missing relations (link prediction) or missing attribute values (literals). Holistic solutions to simultaneously improve the quality of KGs in several areas are thus currently missing. 3.7.1. Type completion Type completion refers to the task of assigning types to nodes without type information. In the case of PGM it is in most cases not allowed to have nodes without type information [32]. Since there is limited standardization in the realm of PGM [246], and the possibility to label nodes with unknown type with a dummy label, type completion can still be seen as a relevant KG completion task. In this case node classification approaches can be used to predict classes of unlabeled nodes. For example Neo4j provides a specific node classification pipeline16, although the resulting predictions are added as node properties necessitating a post-processing step to redefine the label. The traditional way of determining missing type information in RDF datasets involves the use of logical reason- ing. However this approach is limited since it relies on already consistent facts and existing rdf:type information in the knowledge base [247]. To address this shortcoming statistical approaches use the distribution of relations between entities to predict missing type information. For example SDType [248] uses a weighted voting approach based on the statistical distribution of the subject and object types of properties. Similarly StaTIX [249] relies on weighted statistics of multiple properties of entities as input for their clustering approach. Recently, there has been some attention on leveraging KG embeddings to infer type information. For example ConnectE [250] incorporates two mechanisms with one relying on local typing knowledge and the other on global triple knowledge. The first relies on the fact that entities close in the embedding probably share the same type. Relying on relationship information the second mechanism learns entity type embeddings by replacing the subject and object entity in a triple for their corresponding type. Finally, for entity type prediction a composite score of the two mechanisms is used. 16https://neo4j.com/docs/graph-data-science/current/machine-learning/node-property-prediction/nodeclassification-pipelines/ node-classification/ 24 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 3.7.2. Link Prediction The task of link prediction aims at finding missing relations in a KG. In the example presented in Figure 1 we see that while there is a writtenBy relation between the song Xtal and the artist Aphex Twin, there is no relation between the song Ageispolis and Aphex Twin. Predicting this missing writtenBy relation would be a goal of link prediction. Based on [19], a common method for the prediction of a relation between two entities is distant supervision [251– 254] using external resources. This method starts with linking entities of the Knowledge Graph to the text corpus using NLP approaches and then tries finding patterns in the text between entities. Another approach [255] uses the same methodology, but considers the whole Web as the corpus. Lange et al. [256] learn patterns on Wikipedia abstracts using Conditional Random Fields [257]. Blevins et al. [258] propose a similar approach, but on entire Wikipedia articles. Another line of research uses semi-structured data such as tables [259, 260] or list pages [261] in Wikidata for predicting missing relations. In the last years considerable research attention was devoted to investigating KG embeddings for the task of link prediction. These methods encode entities and relations of a KG as low-dimensional vectors in an embedding space. The existing triples in a Knowledge Graph can be used to train such models, evaluating their performance on a held-out set of triples. For example TransE [262] encodes relations as translations from subject to object entity of a triple (sub ject, predicate, ob ject).17 This is done by minimizing the distance between s + p and o, where s, p and o are the embeddings of sub ject, predicate and ob ject respectively. A variety of approaches have been devised to address the problems of TransE to model 1 − n or n − n relations, by e.g. encoding relations in a separate hyperplane [263] or operating in the hyperbolic space [264]. For a more broad overview and benchmark study we refer to this paper [265]. The described embedding-based link prediction methods rely on shallow embeddings, which means all embed- dings are stored in a entity/relation-matrix and obtaining the respective embedding for an entity or relation is done by using a lookup-table. These approaches are unable to deal with unseen entities. The study of inductive link pre- diction aims to address this shortcoming. GraIL [266] relies on Graph Neural Networks (GNN) to achieve this. This approach samples the subgraph enclosing the link to be predicted, then labels the nodes in this subgraph based on the distance to the target nodes (i.e. the nodes which the link would connect). The labeled subgraph is then used in a GNN to score the likelihood of a triple. NodePiece [267] can perform inductive link prediction via a compositional representation for entities. Relations around a node are sampled in order to create a node hash, which is passed through an encoder to obtain the final entity embedding. Being able to create entity representation for unseen enti- ties, but known relations permits NodePiece to then use any scoring function (e.g. TransE) for the link prediction task. A special type of link prediction aims to discover identity links (e.g. owl:sameAs relations) [8], which connect nodes, that refer to the same entity. This task serves the same goal as entity resolution (discussed in Section 3.5). 3.7.3. Data Enrichment Concerning aspects of domain coverage and succinctness, additional processes are applicable that increase the final quality of the KG. In addition to type and relation prediction, domain knowledge could possibly be extended by loading completing entity information from external (open accessible) knowledge bases. This approach is dif- ferent to the process of integrating an entire external data collection but only focuses on loading necessary domain information that relates to the already integrated entities. For enhancing KG data with additional relevant domain entities information external knowledge bases can be requested based on extracted (global) persistent identifiers (PID). For example extracted ISBN numbers, DOIs, or ORCIDs allow to request additional external information from Wikidata; or Gene and Protein data is accessible based on their symbols in public biochemical databases, like the National Library of Medicine18. Paulheim surveys approaches that exploit links to other KGs in order to not only verify information but also to find additional information to fill existing gaps [19]. 17In link prediction literature triples are usually signified as (head, relation, tail). In favor of a consistent nomenclature we use the triple signifiers commonly used for RDF. 18https://www.ncbi.nlm.nih.gov/ M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 25 4. Overview of Knowledge Graph Construction Pipelines and Toolsets Table 3 Overview of selected KGs. '*' in the first column indicates manually curated (crowd-sourced) KGs. '?' means unknown/undisclosed values. The statistics include the KG's year of announcement, targeted domain, processed number of data sources, KG data model, graph size, number of versions, and year of last update. Used domain abbreviations: Cross = cross domain, MLang = multi-lingual data. Year Domain Srcs. Model Entities Relations Types R-Types Vers. Update Closed KG Google KG [268] Diffbot.com Amazon PG [231] Open Access KG *Freebase [269] DBpedia [270] YAGO [271, 272] NELL [241] *Wikidata [273] DBpedia-EN Live [274] Artist-KG [275] *ORKG [276] AI-KG [277] CovidGraph [278] DRKG [279] VisualSem [280] WorldKG [281] 2012 Cross,MLang >>>1 Custom,RDF 2019 2020 Cross Products RDF Custom >>>1 >1 Cross Cross Cross >>1 140 2-3 ⩾1 RDF 2007 RDF 2007 Cross,MLang RDF(-Star) 2007 2010 Custom,RDF 2012 Cross,MLang >>>1 Custom,RDF 2012 2016 2019 Cross Artists Research RDF Custom RDF AI Science 2020 2020 COVID-19 2020 BioMedicine 2020 Cross,MLang Geographic 2021 RDF PGM CSV Custom RDF 1 4 >>1 3 17 >7 2 1 1B 5.9B 30M 22M 50M 67M 2M 100M 7.6M 161K 130K 820K 36M 97K 90k 113M >100B >1T 1B 3.2B 21B 2B 2.8M 14B 1.1B 15M 870K 1.2M 59M 5.8M 1.5M 829M ? ? 19K 53K 1.3K 10K 1.2K 300K 800 >1 1.3K 5 128 17 (49K) 1176 ? ? 1K 70K 55K 157 834 10.3K 1.3K 18 6.3K 27 171 107 13 1820 ? ? ? >1 >20 5 >1100 >100 >>>1 1 >1 2 >1 1 2 1 ? ? ? 2016 2023 2020 2018 2023 2023 2016 2023 2020 2020 2020 2020 2021 We now investigate and compare construction pipelines for existing KGs and for KG construction toolsets with respect to the KG requirements and construction steps introduced in the previous sections. The KG-specific ap- proaches focus on integrating data from a rather fixed set of data sources for a single KG while the toolsets (or strategies) are more generic and can be applied for different sources and KGs. Overall we consider 16 KG-specific approaches (with a focus on ten semi-automatic and open implementations) and seven toolsets. In the first subsection we give an overview of the different approaches including data statistics for the respective KGs and characteristics about the data sources and their construction pipelines. This overview aims already at providing a good assessment of the current state of the art. Section 4.2 gives a detailed comparison of the approaches w.r.t our requirements. In the two further subsections we give additional details about the KG-specific approaches and the toolsets. In Section 5 we will discuss remaining challenges and thus areas for future work. 4.1. Overview Our overview is divided into two parts. We first summarize general information and statistics for the selected KGs using Table 3 and then investigate KG construction criteria for KG-specific pipelines and KG toolsets using Table 4. Given the enormous and growing number of KGs, we had to restrict ourselves to a small number of efforts. In our selection we try to cover popular KGs such as DBpedia and Yago as well as more current approaches for either a single domain or several domains (cross domain). Most importantly, we focus on KG projects described in peer-reviewed articles and discuss closed KGs only briefly as their data is not publicly accessible and the used tech- niques are not verifiable. Such closed KGs are typically developed and used in companies such as company-specific Enterprise KGs [284] and the KGs of big web and IT companies such as Google [268], Amazon [231], Facebook, Microsoft [285], Tencent, or IBM. However, open and easy to use KG toolsets are still in their infancy. Here we tried to include recently described approaches that have already been applied to create several KGs including those 26 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges Table 4 Comparison of KG construction approaches w.r.t.Consumed Data, generated Metadata, and Performed Construction Tasks. The construction tasks are rated as simple/manual . '?' indicates mentioned but unclear implementation. Each criterion can cover multiple solutions. or sophisticated/semi-automatic (cid:32) (cid:35) Consumed Data (Meta)Data Performed Construction Tasks n o i t a r g e t n I l a t n e m e r c n I (cid:35) (cid:32) ? (cid:35) (cid:35) ? ? r a e Y / n o i s r e V m e t s y S n o i t a t n e m e l p m I n e p O 2019 ✓ 2020 ✓ 2012 ✓ 2018 2016 ✓ 2020 2020 ✓ 2020 ✓ 2020 ✓ 2021 ✓ Name of System Dataset Specific DBpedia YAGO4 DBpedia-Live NELL Artist-KG AI-KG CovidGraph DRKG VisualSem WorldKG Toolset/Strategy FlexiFusion [141] dstlr [196] XI [57] AutoKnow [231] HKGB [282] SLOGERT [283] SAGA [53] 2019 2019 ✓ 2020 2020 2020 2021 ✓ 2022 a t a D d e r u t c u r t S - i m e S a t a D d e r u t c u r t s n U a t a D m a e r t S ) - t n e v E ( t u p n I y r a t n e m e l p p u S a t a D d e r u t c u r t S e c n a n e v o r P p e e D a t a D l a r o p m e T a t a d a t e M l a n o i t i d d A ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ? ✓ ✓ ✓ ? ✓ ? ? ✓ ✓ n o i t a z i l a i t i n I G K (cid:35) (cid:35) (cid:35) (cid:35) (cid:35) (cid:35) ? (cid:35) (cid:35) (cid:32) (cid:35) (cid:35) (cid:35) (cid:35) (cid:32) ? (cid:35) t n e m e g a n a M y g o l o t n O (cid:35) (cid:32) (cid:35) (cid:32) (cid:32) ? (cid:32) n o i t c a r t x E e g d e l w o n K (cid:35) (cid:35) (cid:32) (cid:32) (cid:32) (cid:35) (cid:35) (cid:35) n o i t u l o s e R y t i t n E (cid:32) (cid:35) g n i n a e l C t u p n I (cid:32) (cid:35) (cid:32) (cid:35) (cid:32) (cid:32) (cid:35) n o i s u F e u l a V / y t i t n E (cid:35) (cid:32) e c n a r u s s A y t i l a u Q (cid:32) (cid:32) (cid:35) (cid:35) (cid:35) ? (cid:35) n o i t e l p m o C e g d e l w o n K (cid:35) (cid:32) (cid:35) (cid:32) (cid:32) (cid:32) (cid:32) (cid:32) (cid:32) ✓ ✓ ✓ ✓ ✓ ? ? (cid:35) (cid:32) (cid:32) (cid:32) (cid:32) ✓ ✓ ✓ ✓ ✓ (cid:32) (cid:32) (cid:35) (cid:32) for a specific domain or a single data type. In order to obtain a representative sample over the state-of-the-art we employed a keyword-based search in academic search engines (e.g. SemanticScholar) and Github to gather all pa- pers and approaches (systems and toolsets) that might fit our criteria. We also relied on existing surveys to gather potentially missed approaches. After a manual selection process via the paper titles and abstracts and comparison with our requirements we created a list of 64 candidate sytems. This methodology is in line with other surveys [17]. After closer inspection w.r.t. the coverage of our requirements and filtering the approaches by age and availability of documentation or publication we were left with the 23 works that are described in detail here. We expect that our criteria for comparison and methodology are also useful to evaluate KG-specific and more generic construction approaches not covered in this paper. (cid:32) (cid:35) (cid:32) (cid:35) (cid:32) (cid:32) Table 3 summarizes general characteristics of the selected KGs which are grouped into closed and open access KGs and in each group ordered by their year of announcement or first publication. The table also displays the KG's targeted domain, processed number of data sources, underlying data model, graph size (number of entities, relations, entity types and relation types), number of versions and year of last update. Table 3 excludes the toolset projects as these are not restricted to a single KG. The values in this table were obtained from the most recent available version, either from the publication or directly from the dataset. The date of this version is denoted in the "Update" column in the table. The table includes three manually curated projects based on crowdsourcing, namely the well-known Freebase and Wikidata approaches as well as the newer Open Research Knowledge Graph (ORKG). Freebase [269, 286] was one of the first collaboratively built and versioned KGs and, after its shutdown in 2016, became a popular source for building several other KGs, like Wikidata [273]. Wikidata supports entity annotation with key-value pairs, includ- ing validity time, provenance, and other metadata, such as references [287]. It facilitates semi-automatic curation involving both bots and human curators. As a project of the Wikimedia Foundation, full data dump snapshots are released twice a month. The ORKG [276] focuses on publications where manually uploaded papers are automat- M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 27 ically enriched with metadata. The platform provides tools to extract information such as tables and figures from publications and to help find and compare similar publications of interest. Most of the considered KGs are based on RDF while some use a property graph or custom graph data model (fifth column in Table 3). Regarding the covered domains, the selected KGs either integrate sources from different domains (cross-domain) or focus on a single domain such as research, biomedicine or Covid-19. A possible limita- tion of cross-domain KGs, especially for smaller-sized ones, is that they can miss domain-specific details or expert knowledge. Some of the KGs contain and connect multilingual information (MLang) by providing descriptive entity values in different languages. These translations are mostly taken directly from one of the sources (e.g., Wikipedia or BableNet), instead of generating own translation during the construction process. There are large differences among the KGs regarding the number of integrated source datasets (from 1 to 140) and the size of the KGs in terms of number of entity and relation types and number of entities and relations. With the highest number of sources, DB- pedia independently extracts 140 sources (Wikipedias), with equivalent entities being interlinked by the extracted sameAs connections contained in the page articles. The closed KGs are by far the largest with up to almost 6 billion entities and more than a trillion relations (Diffbot.com). Wikidata is the largest open-source KG with about 100 million entities of 300K entity types and 14 billion relations of 300K relation types. The smallest KGs have less than 1 million entities or relations. In general, the open KGs are rather limited in the number and diversity of the data sources while closed approaches such as Google KG aim at integrating information at web scale. Only a few of the KG projects continuously release updated versions of their KG while most projects only released data once or irregularly every few years. This underlines that continuous maintenance of KGs is not yet commonplace. With over 1100 dumps19 NELL features the highest number of continuously and incrementally generated KG versions. 4.2. Comparison We now turn to a closer inspection of the KG construction processes of the individual KGs and toolsets. Table 4 summarizes the corresponding information for the ten open access KGs with semi-automatic construction as well as for seven toolsets / strategies for KG construction. We derived the concrete set of comparison criteria from our previously specified KG requirements in Sec. 2.3 such as support for incremental updates and different input data. Other criteria relate to the individual construction tasks from Sec. 3 necessary to meet the requirements, e.g. to support certain kinds of input data (e.g., knowledge extraction or entity resolution tasks) or to meet the requirement of quality assurance (tasks of input cleaning, quality assurance, and knowledge completion). In Table 4 we weighted the criteria with regards to their fulfilment/presence in a specific solution by indicating strong approaches (consider- ing automation, quality and flexibility) with a full circle and weaker approaches open circle symbol, compared to the others approaches. We will give a detailed explanation on each of the criteria decisions for each of the approaches in Section 4.3 and 4.4. We also provide information on the year of the considered version (publication) and indicate whether the approach offers an open implementation. We see that the pipeline/toolset implementations for two of the open access KGs (NELL, AI-KG) and even five of the seven toolsets are closed-source including the approaches from Amazon (AutoKnow) and Apple (SAGA). The third column in Table 4 indicates to what degree incremental KG updates are supported, i.e., that changes in the data sources or new sources can be integrated without a full recomputation of the KG. We see that most approaches have either no or unknown support for incremental updates. DBpedia and Yago are limited to batch updates with a full recomputation of the KG while others such as DRKG and WorldKG represent one-time efforts without KG updates at all. Other approaches provide simple incremental capabilities. Artist-KG and CovidGraph are able to integrate new sources incrementally, but do not specify ways to ingest changes in the underlying data sources. DBpedia-Live tracks changes automatically in the underlying data sources and integrates them directly whilst skipping expensive quality assurance steps. Two approaches provide sophisticated incremental capabilities. NELL grows a KG via a semi-supervised approach enabling human interaction to avoid accumulation of errors. SAGA is one of the most sophisticated approaches w.r.t incremental integration. It has the ability to ingest changes into a stable KG, which is updated in batches, and also serves a live KG which forgoes some quality assurance steps 19http://rtw.ml.cmu.edu/rtw/resources 28 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges in lieu of data freshness. For some approaches their incremental integration capabilities are unclear. AI-KG describe such capabilities as future work and dstlr mention the ability to track document changes via Apache solr, but do not mention any ways to deal with such changes. In the case of the XI pipeline, this feature's support was considered in the final implementations. In the following, we describe and discuss the further criteria considered that fall into three groups regarding the consumed input data, generated metadata and the performed construction tasks. Consumed Input. For the input data we differentiate the supported kind of data (unstructured, semi-structured, structured) and consider support for stream input data and supplementary input data for further processing steps (e.g., metadata, mappings, but excluding tool configurations). As Table 4 shows, populating KGs from semi-structured data is most common while only about half of the con- sidered solutions or toolset support the import from unstructured or structure data. Several popular KGs (DBpedia, YAGO, NELL) integrate information from Wikipedia and use it as a premium source for a high amount of valuable knowledge. Open accessible databases such as WordNet, ImageNet, or BabelNet are also frequent starting points for KG construction. Only two of the projects support the continuous consumption of event streams (DBpedia Live and SAGA). NELL continuously crawls the web for new data but updates the KG in a batch-like manner. Most approaches integrate supplementary data, especially mapping rules, training data, or quality constraints (SHACL shapes). Collected Metadata. We consider whether deep or fact-level provenance, temporal information (e.g, validity time) and additional metadata such as aggregated statistics, process reports, or descriptive and administrative infor- mation are collected and added to the KG or a separate repository. The acquisition of provenance data is the most common kind of metadata support and ranges from simple source identifiers and confidence scores up to the inclusion of the original values. Several systems maintain temporal meta- data while further metadata is hardly supported or at least not described. In the case of the toolsets, the generation of additional metadata is possible in XI but depends on the use case and resulting pipeline. In general, support for metadata is thus limited and has room for improvement. Construction Tasks. In this group we consider to what degree the eight construction tasks introduced in the previous section are supported. – KG Initialization - Here a common strategy is to manually create the initial KG either by development from scratch or reusing existing KGs. There may also be a complex pipeline to construct the initial KG by processing semi-structured data from catalogs, wikis, or category systems. All projects start with building or using some initial KG data. WorldKG and HKGB semi-automatically build an initial ontology and are therefore more advanced compared to a manual ontology construction. – Input Cleaning (Filtering, Correction) - support for filtering, normalization, or correction of noisy input data. We exclude here NLP/text pre-processing as this is normally part of knowledge extraction. This functionality is not always provided (or documented) and often based on manually defined rules and filter definitions, e.g., to select properties and relationships for certain entity types. Some solutions also apply normalization steps, e.g., to unify date or number representations. – Ontology Management - most approaches have at least some basic (manual) support to evolve the KG ontol- ogy and schema data for newly structured input data. In DBpedia, the KG ontology (and data mappings) can be changed manually and needs to be loaded before running a new batch update. The more freshness-oriented approach of DBpedia Live continuously watches ontology changes and immediately schedules affected entities for re-extraction. More advanced approaches rely on a semi-automatic ontology evolution or enrichment. In particular, some systems can identify new entity and relation types in the input data for addition to the ontology after manual confirmation (NELL, HKGB). While for example WorldKG relies on an unsupervised ML approach for ontology alignment, most approaches still perform alignment and merging of ontologies manually. – Knowledge Extraction - many solutions use rule-based mappings to extract entities and relations from semi- structured sources (DBpedia, Yago, DRKG, VisualSem, WorldKG). Some tools use machine learning ap- proaches for extraction (AI-KG, CovidGraph, dstlr, SLOGERT, NELL). For entity linking different approaches are used such as dictionary-based approaches relying on gathered synonyms (e.g. AI-KG), use of human in- M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 29 teraction (XI), or applying entity resolution (e.g. HKGB). Given the focus on semi-structured data sources, the techniques for knowledge extraction are generally relatively advanced compared to other steps in KG con- struction. This has also been made possible by the frequent use of existing knowledge extraction tools such as Stanford CoreNLP, as will see in the discussion of the approaches in the next subsections. – Entity Resolution - this task is supported in only by few approaches and the pipelines that do employ ER tend to use sophisticated methods like blocking to address scalability issues (ArtistKG, SAGA), and machine- learning-based matchers (SAGA). HKGB's description of their ER solution is too vague to make a definite statement and for SLOGERT it is mentioned, that in some cases ER might be necessary, but should be done with an external tool. For textual data, identification and matching of entities to KG elements is already covered by entity linking in the knowledge extraction step (Sec. 3.4). – Entity Fusion - this is the least supported task in the considered solutions. None of the dataset specific KGs performs classical (sophisticated) entity fusion in the manner of consolidating possible value candidates and se- lecting final entity ids or values. Instead, the final KG often contains a union of all extracted values, either with or without provenance, leaving final consolidation/selection to the targeted applications. The DRKG project uses a simple form of entity fusion to normalize entity identifiers. Even for the discussed toolsets the coverage of this task is relatively low. The FlexiFusion allows to apply specific fusion functions, leverages provenance information and performs a stable id assignment for entity and property clusters. SAGA refers to the usage of several truth discovery and source reliability-based fusion methods. – Quality Assurance - human-in-the-loop strategies have been applied to varying degrees, with some solutions, such as HKGB, relying heavily on user interaction. In contrast, others require only final user approval of the correctness of extracted values or patterns, like NELL. The World KG approach manually verifies all matches to the external ontologies. Further, SAGA tries to detect potential errors or vandalism automatically. It quarantines them for human curation, where changes are treated directly in the live graph and later applied to the stable graph. Only DBpedia and YAGO perform an automatic consistency check. Additionally, YAGO guarantees ontolog- ical consistency by applying a logical reasoner, and DBpedia checks for dataset completeness and measures quality against the former last version. In our study, only dstlr offers support for validating extracted facts against an external knowledge base. – Knowledge Completion - the integrated KG data is enriched with locally inferred (relations, types) or exter- nal knowledge. DBpedia attaches additional entity type information based on current ontology and relation data. Three approaches (DRKG,HKGB,SAGA) presented ML-based link prediction on graph embeddings to find further knowledge. In the case of the DRKG and HKGB approach it is unclear if the newly predicted information flows back into the KG or is stored separately. Regarding enrichment with external knowledge: While dstlr links entities to Wikidata, it also fetches stored properties from this external source. However, SLOGERT only adds links to external information based on previously extracted identifiers (PIDs). Overall, we see that the KG-specific approaches have a number of limitations regarding scalability to many sources, support for incremental updates and in several steps regarding metadata, ontology management, entity resolution / fusion, and quality assurance. The toolsets are generally better in terms of their functionality but they are mostly closed-source and thus not usable for new KG projects or research investigations. 4.3. KG Specific Solutions DBpedia [288] is one of the most popular KGs, establishing a central access point for the Semantic Web. It extracts structured data from Wikipedia article dumps utilizing the DBpedia Extraction Framework (DIEF), which was forked by several other wiki-based KG projects [289]. The DIEF executes numerous extractors, each extracting a specific aspect of the article page, like type information based on the used info-box template or the pages abstract paragraph. One specific extractor, maps semi-structured information from Wikipedia infoboxes20 to the DBpedia 20An infobox is a fixed-format table (usually in the top right-hand corner) to consistently present some unifying aspect that articles share. 30 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges ontology. The DBpedia community manually curates DBpedia's ontology and infobox mappings through a publicly accessible mappings mediawiki21. The DIEF fetches the latest version of the ontology and mappings from this API endpoint for each extraction run. In the post-processing phase, a type consistency step checks whether an extracted entity and its relations are violating the is-a or has-a definitions of the DBpedia ontology (e.g., a person entity should not have mechanical doors and hence be a car simultaneously). And a completion phase materializes transitive type (is-a) relations for each entity. Since 2020, the current extraction cycle [270] is built around the Databus [140] (meta)data platform, which allows managing data releases, including descriptions, versioning, data quality reports, and automatic metadata generation. The monthly performed batch extraction consumes data from up to 140 wikis, including several language-specific Wikipedia versions, Wikidata and Wikimedia Commons. Each release is checked for dataset completeness and validated concerning quality. In the final data, equal entities of the different wikis are connected by sameAs links derived from the interwiki links contained in the data sources. A testing library helps debugging data problems based on SHACL and other integrity tests. Deep provenance is supported by linking each extracted value with the revision id of the originating article and the applied extractor. In addition to DBpedia's dump extraction, DBpedia Live [290] is a service that provides a real-time KG by performing continuous extraction of changed Wikipedia contents. Changed articles are fetched and reprocessed to extract all relevant values and override (or add/delete) them in the KG. The live extraction also monitors ontology (mapping wiki) changes and schedules all affected pages for re-extraction [274]. For improved performance, the live extraction is not applying the mentioned DBpedia post-processing or quality assurance that are thus only performed when the data is completely reprocessed. YAGO [271]. The Yet Another Great Ontology project initially extracted information about entities of Wikipedia and combined them with an ontology derived from the hierarchically structured WordNet [291]. In version 2, the KG was extended by temporal information (Wikipedia edit timestamps) and spatial knowledge from GeoNames22. YAGO 3 extends multilingual knowledge by utilizing Wikipedias inter-language links to cover additional values in many other languages. The latest version YAGO 4 [272] no longer uses data from Wikipedia (in combination with Wordnet and GeoNames), but collects data from Wikidata [273] and forces it into a taxonomy based on schema.org23 and Bioschemas [292]. SHACL constraints are used for classes to enforce a strict consistency. Manually defined mappings are applied from Wikidata to an initial set of 235 schema.org classes and 116 relations. The process iter- ates over each Wikidata item, filters low-coverage entities, and accepts entities and their types that are transitively connected to one of the initial classes via sub-class relations resulting in the final taxonomy of 10k classes (taxon- omy enrichment). YAGO maintains fact provenance by using Wikidata's annotations for validity time or external references. NELL [241]. The Never-Ending Language Learner is a system to incrementally construct a KG from text corpora and web pages. Per incremental execution (called iteration), it uses NLP-based knowledge extraction to determine entities, their types and relations between entities with the help of patterns. The central part of learning is the Cou- pled Pattern Learner (CPL), which memorizes patterns of the form "X plays for Y". In each iteration, the system learns new patterns and simultaneously applies its previously learned patterns. Additionally, NELL generates meta- data with newly learned patterns and rules. A user manually validates such newly learned patterns regularly (not necessarily for every iteration) before the pipeline uses them as future supplementary input data. While NELL gen- erates neither RDF nor PGM data, the Nell2RDF [293] extension transforms its data to RDF and annotates extracted relations with provenance information about the used Wikipedia articles. Artist-KG [275]. Gawriljuk et al. create a KG of artists from four different sources that are incrementally added one after the other. Per iteration (source), they first filter out artist entities and apply schema mapping with the Karma approach [97] to map entity properties. Then they perform entity resolution using artist name and birthdate similarities and utilize MinHash/LSH blocking to make this process scalable. They only apply the union of matching entities and leave entity fusion (value consolidation) to consuming applications. The final KG is in a custom graph format, serialized as JSON with with nested representations of artist entities. 21http://mappings.dbpedia.org/api.php 22https://www.geonames.org/ 23https://schema.org/ M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 31 AI-KG [277]. The Artificial Intelligence KG contains over 820K entities derived from over 333k research pub- lications integrating and enriching data from the Microsoft Academic Graph [285], the Computer Science Ontol- ogy [294], and Wikidata. Its internal ontology builds on SKOS24, PROV-O25, and OWL. Fact provenance is sup- ported by keeping identifiers to the original papers and information about the applied extraction tool. The RDF data of the KG is available via a publicly accessible Virtuoso triple store26. The pipeline has four components: 1) extractors, 2) entities handler, 3) relations handler, and 4) triple selector. The extractors use the NLP tools DyGIE++ [295], the CSO Classifier [296], and Stanford CoreNLP [170] to extract entities and relations from text for predefined entity types and relations. To determine possible entities and rela- tions, the system operates an overlapping strategy between the CoreNLP tools like Open Information Extraction, its POS-Tagger, and the topics detected by the CSO Classifier. Semantically similar entities are clustered (via word embeddings and hierarchical clustering) and manually revised. The Triple Selector categorizes facts into valid and non-valid triples. For relations extracted based on patterns between entities derived by the POS-Tagger, an occur- rence frequency threshold is used to determine the validity. By contrast, triples extracted by DyGie++ are trusted as this tool has achieved high precision in previous benchmarks. While the authors planned periodic KG updates, the update process has not been described. The AI-KG was subsequently replaced by the CS-KG [297]. CovidGraph [278]. The open domain-specific CovidGraph integrates over 17 Covid-related sources on publica- tions, authors, genes, proteins, and diseases from publication archives, databases, or open accessible APIs. The KG is managed as a Neo4J database. For each data source, KG construction uses a modular process where the integra- tion of every source dataset is handled by a separate Docker container dealing with source-specific data cleaning and mapping tasks. The final orchestration and order of integration is managed by a separate container27. Part of the data is extracted from biomedical paper abstracts via the biomedical language representation model BioBert [298]. The applied matching techniques use string similarities or usable global identifiers like symbols and ids, or for ex- ample the Reference Sequence Database [299] for genes. The KG contains provenance information about the origi- nating paper, and nodes have modification timestamps. The project provides a schema graph image for exploration purposes but it remains unclear how the underlying ontology (schema) is maintained. Due to the global impact of the Covid disease, similar projects emerged like the COVID literature KG [300] which uses other integration methods. DRKG [279]. The Drug Repurposing KG integrates several biomedical sources (mostly open-access databases) with information about genes, proteins, diseases, and drugs. Its use cases are centered around drug redesign and re-purposing, e.g., utilizing newly discovered relations in the KG. Each data source is mapped to a triple structure using crowd-sourced tools like Bio2RDF28 and rule-based mapping languages. Bio2RDF converts data to a crowd- sourced ontology, thereby providing some initial types and relationships. To resolve entities from different sources, the DRKG subsequently tries to map entities of the same type to a common ID space, e.g., the MESH-ID space for diseases. The final entity IDs contain the originating source thereby supporting backtracking the origin of facts in the KG. The DRKG project also applies link prediction by utilizing graph embeddings with the TransE model [262]. This was used to predict relations between drugs, genes and the three diseases SARS, MERS, and SARS-COV2 (COVID-19). VisualSem [280] is a multilingual and multi-modal KG that interlinks images, their descriptions (glosses) and other attributes from Wikipedia articles, WordNet concepts, and ImageNet [301] images. The approach applies a combination of data retrieval, sampling, and cleaning from the ImageNet dataset. First an initial set of nodes is retrieved from ImageNet29 for 1000 classes from the "ImageNet Large Scale Visual Recognition Challenge". Then, in an iterative process additional nodes are collected in the following way: 1) collect neighboring nodes of the current node pool 2) filter images (removing ones not meeting certain quality criteria 3) filter nodes (keep nodes 24https://www.w3.org/2004/02/skos/ 25https://www.w3.org/TR/prov-o/ 26http://scholkg.kmi.open.ac.uk/ 27https://git.connect.dzd-ev.de/dzdtools/motherlode 28https://github.com/bio2rdf/bio2rdf-scripts 29ImageNet is an image database organized according to the WordNet hierarchy. 32 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges with at least one image and two relation types) 4) update the node pool (accepting only top-k nodes). In more detail, during the first step relations from the ImageNet graph are mapped to 13 relationship names in the final graph via manually defined mappings. In the image cleaning step four filters where applied. The system checks for valid image files, removes duplicated images via SHA1 hashing, uses a ResNET-based binary classifier [302] to remove non-photographic images, and leverages OpenAI's CLIP to remove image that do not minimally match any of the node glosses. The iteration holds after reaching a node pool size of 90k. The project is accessible in a public git repository30 and also contains pretrained models for vision and language research. WorldKG [281] integrates the semi-structured data of OpenStreetMap (OSM)31 into a geographic KG. The construction of WorldKG consists of two parts. The WorldKG ontology (initial KG) is constructed in the first part based on OSM's "Map" system and OSM wiki data. The Map system allows users to tag nodes, ways, or relations with geographic attributes encoded as key-value pairs, and the OSM wiki data describes these tags. In a scraping step, all tags that encode geographic class information are fetched from the site, then the obtained key-value pairs are used to infer a class hierarchy. For example, school=building resolves to schoolBuilding as a sub type of building. All classes from the initial ontology are then aligned (ontology matching) with Wikidata and DBpedia classes using a unsupervised machine learning approach [303]. The resulting class alignments are manually verified and cleaned. In the second part, the construction processes maps OSM data to the final KG structure performing three steps: 1) filter nodes with at least one tag, 2) filter keys and values based on the initial ontology, and 3) create RDF triples. 4.4. KG Frameworks & Strategies DBpedia FlexiFusion [141] provides a workflow based on the DBpedia Databus platform to fuse Linked Open Data (LOD) datasets into a provenance-rich and uniform knowledge graph. Users have to register the individual datasets (downloadable dumps) as well as entity matches (link sets) across these datasets, either utilizing sets of sameAs relations of the LOD or by first generating such match links by a suitable entity resolution tool. Moreover, Non-RDF data has to be transformed to RDF by users. FlexiFusion generates a so-called PreFusion dump per dataset and uses the linked entities to form a cluster using the connected components algorithm. Matching entities of a cluster are then fused into a single entity for which the property values are selected, e.g. by taking the values from preferred sources. The fusion process distinguishes properties to have exactly one or multiple values depending on the property cardinality in the originating sources. Two public KGs have been generated with FlexiFusion: 1) Global DBpedia, which integrates and fuses over 175 sources, including the 140 language-specific DBpedia extractions as well as more than 25 other LOD datasets. 2) an effort to create a Dutch National KG32 integrating eight sources. For both projects, DBpedia (and its ontology) served as the initial KG and the existing links from the other datasets to DBpedia were used for the clustering and fusion steps. dstlr [196] is a framework for scalable KG construction, relying on Apache Solr33 as document store, an extrac- tion and completion layer build on Apache Spark34 and Neo4j as graph database for the resulting KG. The approach utilizes Stanford CoreNLP for all their knowledge extraction steps: Named-entity extraction, relation extraction and linking the extracted mentions to Wikidata. The framework keeps the provenance of those mentions w.r.t to the source documents. The resulting KG is enriched with facts from an external KG by manually defining mappings between CoreNLP relations and Wikidata properties and extracting corresponding facts from this external resource. The authors mention the possibility of utilizing Cypher queries to verify information in the KG against Wikidata information. While the authors note, that using Apache Solr as document store enables the ingestion of new batches of documents it is unclear how well the pipeline is capable of handling scenarios that can occur in an incremental paradigm, e.g., the deletion or updating of entities. 30https://github.com/iacercalixto/visualsem 31https://www.openstreetmap.org 32https://github.com/dbpedia/dnkg-pilot 33https://solr.apache.org/ 34https://spark.apache.org/index.html M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 33 XI Pipeline [57]. This approach focuses on semi-automatically constructing KGs from unstructured or semi- structured documents such as publications and social network content. In the initial step, the system applies named- entity recognition on textual input data. Probabilistic models and microtask crowdsourcing are combined to ac- complish entity linking with a quality outperforming models without a human-in-the-loop paradigm [304]. A type ranking step is performed to achieve fine-grained type associations of entities by leveraging the textual surrounding of entities as well as the current KG type hierarchy [305]. Relation Extraction utilizes distant supervision and an aggregated piecewise convolution network which is trained on existing relations of the KG. XI is used for several KG projects. ScienceWise [306] annotates papers with a human-in-the-loop approach to build a research KG. ArmaTweet [307] enables the detection of events, such as natural disasters or terrorist activity, based on anomalies in extracted Twitter tweets. Guider [308] extracts a dependency graph from logs for dependency- driven analytics. The foundation of the KG is a manually developed ontology. Guiders metadata tracks multi-level granular provenance over facts, events, sources (posts, users, locations). In some use cases, the XI functionality has been extended, e.g. for metadata support in Guider. AutoKnow [231] is a closed-source approach for creating a product KG in the domain of retail products at Amazon. The system processes existing product catalogs and consumer shopping behavior logs leveraging several machine learning approaches and distant supervision for training. Its architecture consists of a so-called ontology suite and a data suite. The ontology suite performs taxonomy enrichment (extraction, attachment) as well as relation discovery. In the taxonomy enrichment step, new types are extracted from the input product catalogs and customer queries [309]. A GNN approach is applied to place new types into the existing ontology. Relations are extracted using classification models for attribute applicability and a regression model for attribute importance on product profiles and the user's search, review, or Q&A data. The data suite performs data imputation (knowledge extraction), data cleaning, and synonym finding. Data im- putation extracts attribute-value pairs from the product data using a taxonomy-aware tagging approach. It leverages CRF combined with multi-task learning with a shared BiLSTM to simultaneously train sequence tagging and prod- uct type categorization. The data cleaning phase checks extracted attribute-value pairs for correctness based on a transformer-based neural net model. Synonym finding is based on a supervised approach using a combination of collaborative filtering and a simple logistic regression model. Most of the training and validation data are derived from the product catalog or customer behavior logs applying distant supervision and, in some cases, utilizing crowdsourcing with Amazon MTurk. In an experimental execution, AutoKnow backed the construction of a product graph at Amazon with more than 30 million entities and 1 billion relations assigned to 19K entity types and 1K relation types. HKGB [282]. The Health Knowledge Graph Builder is a platform to semi-automatically construct clinical KGs with heavy human-in-the-loop (HL) involvement. As input, the system consumes Electronic Medical Records (EMR) consisting of structured and unstructured parts. It semi-automatically processes the data in combination with the clinicians' inputs and produces graph data in OWL and RDF. The human interaction involves: 1) new concep- t/relation inspection (approving recommended concepts or relations), 2) adding medical synonym entities based on instances, 3) the annotation of unstructured data based on instances and relations of the current KG, and 4) the definition of mapping rules from EMR to RDF and the extraction of concepts, entities, and relations. The HL in- spection mainly contributes to the ontology construction and all other steps to every aspect of the KG (instances and ontology). Annotations are accepted if there is high agreement across annotators above some confidence threshold (0.81). Disease-specific information ingestion divides into two phases: 1) building the Concept KG (ontology), and 2) building the Instance KG. The authors describe an incremental process to add other diseases afterward using a similar strategy (similar to the initial construction). In addition to the construction tools, the HKGB platform provides three graph tools for data discovery, extraction, and link prediction to support domain-related applications. The HKGB was utilized to develop the HuadingKG, which consists of about 85 million entities and 265 million relations, initially built with information about cardiovascular diseases and later enriched with information from the Knee Osteoarthritis domain. SLOGERT [283]. Semantic LOG ExtRaction Templating is a framework for automated KG construction from log data. The resulting KGs are utilized in security-related applications to detect upcoming threats and vulnera- bilities. It heavily uses known tools, e.g., LOGPAI for log file pattern parsing, Stanford NLP for entity recogni- tion, and the OTTR Engine (LUTRA) with Apache Jena to manage RDF data. As the KGs foundation, the internal 34 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges ontology extends a previous vocabulary [310] with mappings to the Common Event Expression35 taxonomy. The implementation is publicly available in a git repository36 and the log ontology is shared online37. The workflow runs in two phases. The first phase extracts data and parameters from log files and generates RDF templates conforming to the KG ontology. For named entities determined by Stanford CoreNLP type and properties are defined from a log vocabulary. In the second phase, the extracted template information is used to convert each log file to a graph, and then the log file graphs are integrated into the final KG. This is done by utilizing appropriate identifiers to connect local context information (e.g., network architecture or organizational structures) to key concepts and identifiers of the computer log domain (IP, MAC, URL) and external sources such as vulnerability databases or service inventories. If external knowledge does not align, an entity resolution step is required; the authors mention the SILK framework [311] for this task. SAGA [53]. This closed-source toolset supports multi-source data integration for both batch-like incremental KG construction and continuous KG updates. The internal data model extends standard RDF to capture one-hop rela- tionships among entities, provenance (source), and trustworthiness of values. The system supports source change detection and delta computation using their last snapshots. Based on detected changes, SAGA executes parallel batch jobs to integrate an updated or new source into its target graph. SAGA's ingestion component requires map- pings from new data to the internal KG ontology. This step only requires predicate mappings, as the subject and object fields can remain in their original namespace and are linked later in the process. The required mappings are mostly manually defined and stored as supplementary configuration files. Additionally, data can be reprocessed with the HoloClean tool [121] for data repair. SAGA is able to detect and disambiguate entities from text and (semi-)structured sources. To make the deduplication step scalable it groups entities by type and performs sim- ple blocking to further partition the data into smaller buckets. A matching model computes similarity scores and machine-learning- or rule-based methods are applicable to determine likely matches. Correlation clustering [312] is then utilized to determine matching entities. The system tracks same-as links to original source entities to support debugging. For entity fusion, (conflicting) entity attribute values are harmonized based on truth discovery methods and source reliability to create consistent entities. In addition to the stable KG (updated in batches), the system can maintain a Live Graph, which continuously integrates streaming data and whose entities reference the stable entities of the batch-based KG. For scalability and near-real-time query performance, the live graph uses an inverted index and a key-value store. SAGA supports live graph curation by using a human-in-the-loop approach. The authors mention that SAGA powers question answering, entity summarization, and text annotation (NER) services. 5. Discussion & Open Challenges Our study of existing solutions for KG construction showed that there are many different approaches not only for building specific KGs but also in the current toolsets. This underlines the inherent complexity of the problem and the dependency on different criteria such as the major kinds of input data and the intended use cases. The requirements we posed in Section 2.3 are also not yet met to a larger degree indicating the need for more research and development efforts. This is also because there are inherent tradeoffs between the goals of high data quality, scalability and automation [12] that ask for compromise solutions. So while it is possible to have a large degree of automation for individual construction tasks, human interaction generally tends to improve the quality significantly. On the other hand, such human interaction can become a limiting factor towards scalability to many sources and high data volume. In the following, we discuss open challenges and areas for future work on KG construction that we see. The focus here is on broader issues rather than specific limitations in individual steps. Incremental KG Construction We observed that most construction pipelines for specific KGs and in toolsets do not yet support incremental KG updates but are limited to a batch-like re-creation of the entire KG. As already 35https://cee.mitre.org/language/ 36https://github.com/sepses/slogert 37https://w3id.org/sepses/ns/log M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 35 discussed in the requirement section 2.3 this approach has significant limitations and prevents scalability to many data sources and high data volume. We therefore need better support for incremental KG updates, especially in toolsets. Such a capability has to provide solutions to a variety of issues. As already discussed in Sec. 3.1.2, it has to be detected if there are changes in the input data and if so to determine what has changed. The changes to be dealt with are not limited to the addition of new information but deletions and updates in the sources have to be propagated to the KG as well. Changes that impact the underlying ontology or the pipeline's configuration also have to be managed and may require manual interaction/confirmation. Support for a streaming-like propagation of source changes should also increase so that KGs can provide the most recent information. Lack of open tools As we have seen in Table 4 most KG construction toolsets, especially the more advanced ones, are closed source and can thus not be used by others for creating a KG or for evaluating their functionality. Hence there is a strong need for more open-source toolsets to help improve the development of KGs and to advance the state-of-the-art in KG construction. Researchers and developers providing such an implementation and associated publications could achieve a high impact [313]. Improved Extensibility & Modularisation, Ease of Use. A toolset for KG construction should be able to define and execute different pipelines depending on the data sources to be integrated and specific requirements, e.g., for incremental updates. Hence, an extensible and modular KG construction approach should be provided with alternate implementations for the different KG construction tasks to choose from. This can be facilitated by making use of existing implementations as has been done already for NLP tasks (e.g., Stanford CoreNLP) but not yet for other tasks such as entity resolution. From the projects compared in Section 4 only a few addressed this problem so that more solutions are needed. The definition of a KG construction pipeline should be relatively easy, supported by a user-friendly GUI and with a low effort for configuring the pipeline and its individual tasks. The configuration can be simplified by providing default settings for most parameters or even automatic approaches based on machine learning [314]. On the other hand, a manual configuration should also be possible to achieve customizability and support for special cases (e.g., a new entity type or input format). Extensibility and modularisation of a tool should not lead to a higher configuration effort for users. Data and metadata management. Good data and metadata management is vital in an open and incremental KG process. Only a few solutions even mention an underlying management architecture supporting the construction processes. Having uniform access or interfaces to data and relevant metadata can drastically improve the quality of the former [134] and increases the workflow's replicability and possibilities for debugging. A dedicated metadata repository can store used mappings, schemata, and quality reports, improving the transparency of the entire pipeline process. Metadata support is limited in current solutions and only some pipeline approaches acknowledge the importance of provenance tracking and debugging possibilities. We found that the term provenance is rather vaguely used, mostly in the meaning of tracking the source of facts and the processes involved in their generation. Only few ap- proaches such as SAGA [53] also try to maintain the trustworthiness of facts. Metadata such as fact-level prove- nance should be used more to support construction tasks, such as for data fusion to determine final entity values. In general there is a need for maintaining more metadata, especially temporal information, that is also essential for studying the evolution of KG information. Support for developing temporal KGs maintaining historical and current data, compared to the common sequences of static KG snapshot versions, is also a promising direction. Data Quality One of the main goals of KG construction is to achieve and maintain a high quality KG. The diffi- culty of this task grows with rising number and heterogeneity of data sources, especially if one relies on automatic data acquisition and data integration. High-quality sources can provide a clean type hierarchy and can serve as train- ing data to alleviate some data-quality issues, that would be more difficult to address by treating low-quality sources in isolation [12]. Lower quality data sources often contain a high degree of long tail entities (which is the reason these data source are valuable). Nevertheless, corroborating the information from these sources with evidence from higher-quality sources remains difficult and can reduce data quality. For example, the automatic fusion of conflicting entity values can easily introduce wrong information into a KG and even a restricted degree of human intervention is problematic on a large scale [166, 315]. To achieve the best possible data quality, data cleaning should be part of all major steps in the construction pipeline so that the degree of dirty or wrong information that is entering the KG is limited. Moreover, the identification and 36 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges repair of errors should be a continuous task, especially in large KG projects [316]. To better address these problems, more comprehensive data quality measures and repair strategies are needed that minimize human intervention to retain high scalability for KG construction. Evaluation The evaluation of complete KG construction pipelines is an open but important problem to measure the performance and quality of current approaches and to improve on them. So far there are benchmarks for individ- ual tasks such as knowledge extraction [317–319], ontology matching [320], entity resolution [209, 210, 244, 321] and KG completion [322–324]. While these benchmarks in some cases still leave gaps, e.g, regarding scalabil- ity [204] or domain diversity [325], they are already quite complex and indicate the high difficulty of defining a benchmark for the entire KG construction pipelines. A benchmark could be based on similar settings than for the creation of specific KGs discussed in Section 4 aiming at the initial construction and incremental update of either a domain-specific or cross-domain KG from a defined set of data sources of different kinds. The KG ontology and the KG data model (RDF or property graph) could be predefined to facilitate the evaluation of the resulting KG. The size of the resulting KG should be relatively high and the construction should be challenging with the need of knowledge extraction, entity linking/resolution and entity fusion. Determining the quality of the constructed KG is difficult as it would ideally be based on a near- perfect result (gold standard) for the initial KG and for its updated version(s). For all entity and relation types in the given KG ontology, it has then to be determined to what degree they could correctly be populated compared to the gold standard which requires an extension to known metrics such as precision and recall. Further evaluation criteria include the runtimes for the initial KG construction and for the incremental updates and perhaps the manual effort to set up the construction pipelines. Ideally, an evaluation platform could be established - similar to other areas [243] - for a comparative evaluation of different pipelines with different implementations of the individual construction steps. The whole is more than the sum of it's parts. While the individual parts of KG construction pipelines are well-established research problems with sometimes decades of previous research, the complex interaction of the pipeline tasks is not well researched yet. For example, the disambiguation strategies of the knowledge extraction task, especially entity linking, are very similar to entity resolution. The use of background knowledge and various inter-dependencies between different information is commonly summarized as holistic entity linking. This approach has seen some research attention and a survey with future research directions was published by Oliveira et. al. in a 2021 paper [326]. While such approaches go in the right direction, our pipeline scenario would invite an even more holistic case, where named-entity linking and entity resolution approaches aid each other to boost their performance. Furthermore, data cleaning can independently be done in several tasks but it would be beneficial to have a coordinated approach to avoid duplicate efforts. 6. Related Work The construction of KGs uses technologies from different areas and we have discussed the tasks and surveys in these areas already in Section 3. Here we therefore focus on related surveys on the construction of KGs in general. On almost 300 pages, Weikum et. al. [12] give an extensive tour on the automatic creation and curation of RDF- based knowledge bases or KGs, specifically from semi- and unstructured sources. Their discussion of requirements is also concerned on the KG itself, whereas our requirements are more focused on the KG construction process. We also cover structured input data for KG construction, e.g., in the requirements on Input Data and tasks such as entity resolution. Their article provides overviews about the open knowledge graphs YAGO, DBpedia, NELL, and Wikidata, which are also discussed in our work, as well as on industrial knowledge graphs, which we only mention briefly due to the limited amount of publicly available information. By contrast, we systematically compare many further approaches w.r.t our derived requirements including general KG construction toolsets. Furthermore, we have identified several new challenges for future work, e.g., regarding incremental approaches, open toolsets and benchmarks. Hogan et. al.[8] give a comprehensive introduction to KGs. Similar to us, their discussion includes multiple graph data models, and they present methods to deal with unstructured, semi- and structured data. Serving as an introductory text to KGs in general, they provide a broad view on KGs including tasks like learning on KGs or M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 37 publishing them. We are more focused on KG construction and cover many additional aspects such as requirements for KG construction and maintenance, a more detailed discussion of construction tasks, a systematic comparison of state-of-the-art approaches as well as open challenges for KG construction. Ryen et. al [14] provide a systematic literature review on KG creation approaches based on Semantic Web tech- nologies. They survey and compare 36 approaches w.r.t their identified construction steps: ontology development, data preprocessing, data integration, quality and refinement, and data publication. One of their findings was that data quality appears to be a major blind spot. We more comprehensively investigate the requirements, approaches and open challenges of KG construction and maintenance and also include other KG data models such as the PGM. Tamašauskait ̇e et. al. [327] propose a KG development life-cycle consisting of six main steps with several possible subtasks. Our work covers their construction tasks and feasible solutions in more detail and complements them with other relevant main tasks such as metadata management and the discussion of temporal aspects and versioning. Furthermore, our survey and evaluation of KG construction approaches are based on a set of requirements that led to the tasks not covered in their approach. We also provide a comparison of many construction approaches and toolsets and identify open challenges not covered in their work. There are several papers that discuss the construction of KGs for specific cases. Zhu et al. [13] focus on the creation of multi-modal KGs, specifically combining the symbolic knowledge in a KG with corresponding images. They comprehensively present the two directions in which this task can be performed: visual knowledge extraction in order to label images with information from the KG and discovering images that describe entities and relations from the KG. In our work, we aim to more broadly discuss the KG construction process in a complementary manner and only briefly discuss multi-modal (image-related) techniques. Xiaogang Ma reviews applications and construction approaches for KGs in the geoscience domain [15]. The discussed KG creation methods range from mostly manual approaches to processes relying on data mining of crowdsourced data. Furthermore, they discuss how KGs are used in geoscience data analysis, e.g., to enhance information extraction for public health hazards. ̧Sim ̧sek et. al [328] give a high-level overview of the KG construction process in the general context of a KG's lifecycle. Their discussion of these general steps is alongside an in-use case study, where they provide the challenges they encountered. While they give valuable insights into KG construction in the real world they do not include a systematic comparison of the state-of-the-art approaches w.r.t the requirements of KG construction. In summary, our work focuses more on KG construction than previous KG surveys and provides additional information in several areas related to KG construction. We are not limiting ourselves to RDF-based KGs but also consider alternate graph data models such as the PGM, we consider not only the acquisition and integration of unstructured and semistructured data but also of structured data, and we not only consider the one-time construction of KGs but also their incremental maintenance. In contrast to most previous surveys, we explicitly specify the main requirements for KG construction and use these as a guideline for evaluating and comparing many KG-specific construction approaches and toolsets and identifying new open challenges. 7. Conclusion This work presented the current state of knowledge graph construction, giving an overview of the requirements and defining this area's central concepts and tasks. We gave a synopsis of techniques used to address individual steps of such a pipeline with a perspective on how well the state-of-the-art solutions for these specific tasks can be integrated into an incremental KG construction approach. We comparatively analyzed a selection of current KG- specific pipelines and toolsets for KG construction, based on a list of criteria derived from our initial requirements set. We found vast differences across these pipelines concerning the number and structure of the input data, applied construction methods, ontology management, the ability to continuously integrate new information and the tracking of provenance throughout the pipeline. The open KG-specific approaches are currently rather limited in their scala- bility to many sources, support for incremental updates and in several steps regarding metadata, ontology manage- ment, entity resolution/fusion, and quality assurance. The considered toolsets are generally better in terms of their functionality but they are mostly closed-source and thus not usable for new KG projects or research investigations. We identified various challenges that need to be addressed for improved incremental KG construction. These problems range from engineering questions like the need for a flexible software architecture, over numerous task- 38 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges specific problems and the support for incremental construction, to hurdles that must be addressed collectively by the research community, like the development of open-source and modular toolsets for KG construction and on bench- marking and evaluation processes. Concerning the exploitation of new data sources, integrating more multimodal data is of great potential but also requires more research to achieve effective solutions. Addressing the derived challenges promises significant advances for future KG construction pipelines and much reduced effort for creating and maintaining high-quality KGs. Acknowledgements. The authors acknowledge the financial support by the Federal Ministry of Education and Re- search of Germany and by the Sächsische Staatsministerium für Wissenschaft Kultur und Tourismus in the pro- gram Center of Excellence for AI-research "Center for Scalable Data Analytics and Artificial Intelligence Dres- den/Leipzig", project identification number: ScaDS.AI References [1] X. Huang, J. Zhang, D. Li and P. Li, Knowledge Graph Embedding Based Question Answering, in: Proceedings of the Twelfth ACM In- ternational Conference on Web Search and Data Mining, WSDM 2019, Melbourne, VIC, Australia, February 11-15, 2019, J.S. Culpepper, A. Moffat, P.N. Bennett and K. Lerman, eds, ACM, 2019, pp. 105–113. doi:10.1145/3289600.3290956. [2] X. Wang, X. He, Y. Cao, M. Liu and T. Chua, KGAT: Knowledge Graph Attention Network for Recommendation, in: Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, A. Teredesai, V. Kumar, Y. Li, R. Rosales, E. Terzi and G. Karypis, eds, ACM, 2019, pp. 950–958. doi:10.1145/3292500.3330989. [3] S.K. Mohamed, V. Nováˇcek and A. Nounu, Discovering protein drug targets using knowledge graph embeddings, Bioinformatics 36(2) (2019), 603–610. doi:10.1093/bioinformatics/btz600. [4] H. Oberkampf, S. Zillner and B. Bauer, Interpreting Patient Data using Medical Background Knowledge, in: Proceedings of the 3rd Inter- national Conference on Biomedical Ontology (ICBO 2012), KR-MED Series, Graz, Austria, July 21-25, 2012, R. Cornet and R. Stevens, eds, CEUR Workshop Proceedings, Vol. 897, CEUR-WS.org, 2012. http://ceur-ws.org/Vol-897/session2-paper06.pdf. [5] D. Sonntag, V. Tresp, S. Zillner, A. Cavallaro, M. Hammon, A. Reis, P.A. Fasching, M. Sedlmayr, T. Ganslandt, H. Prokosch, K. Budde, D. Schmidt, C. Hinrichs, T. Wittenberg, P. Daumke and P.G. Oppelt, The Clinical Data Intelligence Project - A smart data initiative, Inform. Spektrum 39(4) (2016), 290–300. doi:10.1007/s00287-015-0913-x. [6] R. Fan, L. Wang, J. Yan, W. Song, Y. Zhu and X. Chen, Deep Learning-Based Named Entity Recognition and Knowledge Graph Construction for Geological Hazards, ISPRS International Journal of Geo-Information 9(1) (2020). doi:10.3390/ijgi9010015. https: //www.mdpi.com/2220-9964/9/1/15. [7] M. Nickel, K. Murphy, V. Tresp and E. Gabrilovich, A review of relational machine learning for knowledge graphs, Proceedings of the IEEE 104(1) (2015), 11–33. [8] A. Hogan, E. Blomqvist, M. Cochez, C. d'Amato, G. de Melo, C. Gutiérrez, S. Kirrane, J.E. Labra Gayo, R. Navigli, S. Neumaier, A.- C. Ngonga Ngomo, A. Polleres, S.M. Rashid, A. Rula, L. Schmelzeisen, J.F. Sequeda, S. Staab and A. Zimmermann, Knowledge Graphs (2021). ISBN 9781636392363. doi:10.2200/S01125ED1V01Y202109DSK022. https://kgbook.org/. [9] S. Ji, S. Pan, E. Cambria, P. Marttinen and S.Y. Philip, A survey on knowledge graphs: Representation, acquisition, and applications, IEEE Transactions on Neural Networks and Learning Systems 33(2) (2021), 494–514. [10] S. Pan, L. Luo, Y. Wang, C. Chen, J. Wang and X. Wu, Unifying Large Language Models and Knowledge Graphs: A Roadmap, ArXiv abs/2306.08302 (2023). [11] L. Yang, H. Chen, Z. Li, X. Ding and X. Wu, ChatGPT is not Enough: Enhancing Large Language Models with Knowledge Graphs for Fact-aware Language Modeling, ArXiv abs/2306.11489 (2023). [12] G. Weikum, L. Dong, S. Razniewski and F.M. Suchanek, Machine Knowledge: Creation and Curation of Comprehensive Knowledge Bases, Found. Trends Databases 10 (2021), 108–490. [13] X. Zhu, Z. Li, X. Wang, X. Jiang, P. Sun, X. Wang, Y. Xiao and N.J. Yuan, Multi-Modal Knowledge Graph Construction and Application: A Survey, ArXiv abs/2202.05786 (2022). [14] V. Ryen, A. Soylu and D. Roman, Building Semantic Knowledge Graphs from (Semi-) Structured Data: A Review, Future Internet 14(5) (2022), 129. [15] X. Ma, Knowledge graph construction and application in geosciences: A review, Comput. Geosci. 161 (2021), 105082. [16] G. Xiao, L. Ding, B. Cogrel and D. Calvanese, Virtual Knowledge Graphs: An Overview of Systems and Use Cases, Data Intelligence 1 (2019), 201–223. [17] D.V. Assche, T. Delva, G. Haesendonck, P. Heyvaert, B.D. Meester and A. Dimou, Declarative RDF graph generation from heterogeneous (semi-)structured data: A systematic literature review, J. Web Semant. 75 (2023), 100753. doi:10.1016/j.websem.2022.100753. [18] E.W. Schneider, Course Modularization Applied: The Interface System and Its Implications For Sequence Control and Data Analysis. (1973). M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 39 [19] H. Paulheim, Knowledge graph refinement: A survey of approaches and evaluation methods, Semantic web 8(3) (2017), 489–508. [20] L. Ehrlinger and W. Wöss, Towards a Definition of Knowledge Graphs., in: SEMANTiCS (Posters, Demos, SuCCESS), 2016. [21] M. Lissandrini, D. Mottin, K. Hose and T.B. Pedersen, Knowledge Graph Exploration Systems: are we lost?, in: 12th Conference on Innovative Data Systems Research, CIDR 2022, Chaminade, CA, USA, January 9-12, 2022, www.cidrdb.org, 2022. https://www.cidrdb. org/cidr2022/papers/p40-lissandrini.pdf. [22] A. Hogan, D. Brickley, C. Gutierrez, A. Polleres and A. Zimmerman, (Re)Defining Knowledge Graphs, in: Knowledge Graphs: New Directions for Knowledge Representation on the Semantic Web (Dagstuhl Seminar 18371), Vol. 8, 2018, pp. 74–79. doi:10.4230/DagRep.8.9.29. [23] C. Feilmayr and W. Wöss, An analysis of ontologies and their success factors for application to business, Data & Knowledge Engineering 101 (2016), 1–23. [24] S. Sakr, A. Bonifati, H. Voigt, A. Iosup, K. Ammar, R. Angles, W.G. Aref, M. Arenas, M. Besta, P.A. Boncz, K. Daudjee, E.D. Valle, S. Dumbrava, O. Hartig, B. Haslhofer, T. Hegeman, J. Hidders, K. Hose, A. Iamnitchi, V. Kalavri, H. Kapp, W. Martens, M.T. Özsu, E. Peukert, S. Plantikow, M. Ragab, M. Ripeanu, S. Salihoglu, C. Schulz, P. Selmer, J.F. Sequeda, J. Shinavier, G. Szárnyas, R. Tommasini, A. Tumeo, A. Uta, A.L. Varbanescu, H. Wu, N. Yakovets, D. Yan and E. Yoneki, The future is big graphs: a community view on graph processing systems, Commun. ACM 64(9) (2021), 62–71. doi:10.1145/3434642. [25] O. Lassila, Resource description framework (RDF) model and syntax specification, W3C recommendation, http://www. w3. org/TR/PR- rdf-syntax (1999). [26] H. Knublauch and D. Kontokostas, Shapes constraint language (SHACL), W3C Candidate Recommendation 11(8) (2017). [27] E. Prud'hommeaux, J.E.L. Gayo and H.R. Solbrig, Shape expressions: an RDF validation and transformation language, in: Joint Confer- ence on Lexical and Computational Semantics, 2014. [28] J. Frey, K. Müller, S. Hellmann, E. Rahm and M.-E. Vidal, Evaluation of metadata representations in RDF stores, Semantic Web 10(2) (2019), 205–229. [29] L.F. Sikos and D. Philp, Provenance-aware knowledge representation: A survey of data models and contextualized knowledge graphs, Data Science and Engineering 5(3) (2020), 293–316. [30] F. Zhang, Z. Li, D. Peng and J. Cheng, RDF for temporal data management – a survey, Earth Science Informatics 14 (2021), 563–599. [31] J. Lehmann, G. Sejdiu, L. Bühmann, P. Westphal, C. Stadler, I. Ermilov, S. Bin, N. Chakraborty, M. Saleem, A.-C.N. Ngomo and H. Jabeen, Distributed Semantic Analytics Using the SANSA Stack, in: International Workshop on the Semantic Web, 2017. [32] R. Angles, The Property Graph Database Model, in: AMW, 2018. [33] H. Lbath, A. Bonifati and R. Harmer, Schema inference for property graphs, in: EDBT 2021-24th International Conference on Extending Database Technology, 2021, pp. 499–504. [34] N. Inc., Neo4j Graph Database, 2022. https://neo4j.com/. [35] T.L. Foundation, JanusGraph: an open source, distributed graph database, 2022. https://janusgraph.org. [36] I. TigerGraph, TigerGraph graph database, 2022. https://www.tigergraph.com. [37] S. Hong, S. Depner, T. Manhardt, J. Van Der Lugt, M. Verstraaten and H. Chafi, PGX.D: A Fast Distributed Graph Processing Engine, in: Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, SC '15, Association for Computing Machinery, New York, NY, USA, 2015. ISBN 9781450337236. doi:10.1145/2807591.2807620. [38] C. Rost, K. Gómez, M. Täschner, P. Fritzsche, L. Schons, L. Christ, T. Adameit, M. Junghanns and E. Rahm, Distributed temporal graph analytics with GRADOOP, VLDB J. 31(2) (2022), 375–401. doi:10.1007/s00778-021-00667-4. [39] P.T. Wood, Query languages for graph databases, SIGMOD Rec. 41(1) (2012), 50–60. doi:10.1145/2206869.2206879. [40] R. Angles, M. Arenas, P. Barceló, P.A. Boncz, G.H.L. Fletcher, C. Gutierrez, T. Lindaaker, M. Paradies, S. Plantikow, J.F. Sequeda, O. van Rest and H. Voigt, G-CORE: A Core for Future Graph Query Languages, in: Proceedings of the 2018 International Conference on Management of Data, SIGMOD Conference 2018, Houston, TX, USA, June 10-15, 2018, G. Das, C.M. Jermaine and P.A. Bernstein, eds, ACM, 2018, pp. 1421–1432. doi:10.1145/3183713.3190654. [41] M.A. Rodriguez, The Gremlin graph traversal machine and language (invited talk), in: Proceedings of the 15th Symposium on Database Programming Languages, ACM, 2015. doi:10.1145/2815072.2815073. https://doi.org/10.1145%2F2815072.2815073. [42] O. van Rest, S. Hong, J. Kim, X. Meng and H. Chafi, PGQL: a property graph query language, in: Proceedings of the Fourth Interna- tional Workshop on Graph Data Management Experiences and Systems, Redwood Shores, CA, USA, June 24 - 24, 2016, P.A. Boncz and J. Larriba-Pey, eds, ACM, 2016, p. 7. doi:10.1145/2960414.2960421. [43] N. Francis, A. Green, P. Guagliardo, L. Libkin, T. Lindaaker, V. Marsault, S. Plantikow, M. Rydberg, P. Selmer and A. Taylor, Cypher: An Evolving Query Language for Property Graphs, in: Proceedings of the 2018 International Conference on Management of Data, SIGMOD Conference 2018, Houston, TX, USA, June 10-15, 2018, G. Das, C.M. Jermaine and P.A. Bernstein, eds, ACM, 2018, pp. 1433–1445. doi:10.1145/3183713.3190657. [44] A. Deutsch, N. Francis, A. Green, K. Hare, B. Li, L. Libkin, T. Lindaaker, V. Marsault, W. Martens, J. Michels, F. Murlak, S. Plantikow, P. Selmer, O. van Rest, H. Voigt, D. Vrgoc, M. Wu and F. Zemke, Graph Pattern Matching in GQL and SQL/PGQ, in: SIGMOD '22: International Conference on Management of Data, Philadelphia, PA, USA, June 12 - 17, 2022, Z. Ives, A. Bonifati and A.E. Abbadi, eds, ACM, 2022, pp. 2246–2258. doi:10.1145/3514221.3526057. [45] H. Chiba, R. Yamanaka and S. Matsumoto, Property Graph Exchange Format, ArXiv preprint abs/1907.03936 (2019). https://arxiv.org/ abs/1907.03936. 40 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges [46] D. Tomaszuk, R. Angles, L. Szeremeta, K. Litman and D. Cisterna, Serialization for Property Graphs, in: Beyond Databases, Architectures and Structures. Paving the Road to Smart Data Processing and Analysis - 15th International Conference, BDAS 2019, Ustro ́n, Poland, May 28-31, 2019, Proceedings, S. Kozielski, D. Mrozek, P. Kasprowski, B. Malysiak-Mrozek and D. Kostrzewa, eds, Communications in Computer and Information Science, Vol. 1018, Springer, 2019, pp. 57–69. doi:10.1007/978-3-030-19093-4_5. [47] R. Angles, A. Bonifati, S. Dumbrava, G. Fletcher, K. Hare, J. Hidders, V.E. Lee, B. Li, L. Libkin, W. Martens, F. Murlak, J. Perryman, O. Savkovic, M. Schmidt, J. Sequeda and D. Tomaszuk, PG-Keys: Keys for Property Graphs, Proceedings of the 2021 International Conference on Management of Data (2021). [48] A. Bonifati, S. Dumbrava, G. Fletcher, J. Hidders, B. Li, L. Libkin, W. Martens, F. Murlak, S. Plantikow, O. Savkovi'c, J. Sequeda, S. Staworko, D. Tomaszuk, H. Voigt, D. Vrgovc and M. Wu, PG-Schema: Schemas for Property Graphs, Proceedings of the ACM on Management of Data 1 (2022), 1–25. [49] C. Rost, P. Fritzsche, L. Schons, M. Zimmer, D. Gawlick and E. Rahm, Bitemporal Property Graphs to Organize Evolving Systems, arXiv preprint arXiv:2111.13499 (2021). [50] M. Besta, M. Fischer, V. Kalavri, M. Kapralov and T. Hoefler, Practice of Streaming and Dynamic Graphs: Concepts, Models, Systems, and Parallelism, CoRR abs/1912.12740 (2019). http://arxiv.org/abs/1912.12740. [51] O. Lassila, M. Schmidt, O. Hartig, B. Bebee, D. Bechberger and W. Broekema, The OneGraph Vision: Challenges of Breaking the Graph Model Lock-In, Semantic Web (2022). [52] Y. Tian, The World of Graph Databases from An Industry Perspective, SIGMOD Rec. 51(4) (2022), 60–67. doi:10.1145/3582302.3582320. [53] I.F. Ilyas, T. Rekatsinas, V. Konda, J. Pound, X. Qi and M. Soliman, Saga: A Platform for Continuous Construction and Serving of Knowledge At Scale, ArXiv preprint abs/2204.07309 (2022). https://arxiv.org/abs/2204.07309. [54] O. Hartig, Reconciliation of RDF* and Property Graphs, CoRR abs/1409.3288 (2014). http://arxiv.org/abs/1409.3288. [55] G. Abuoda, D. Dell'Aglio, A.K. Keen and K. Hose, Transforming RDF-star to Property Graphs: A Preliminary Analysis of Transformation Approaches - extended version, ArXiv abs/2210.05781 (2022). [56] R. Taelman, M.V. Sande and R. Verborgh, GraphQL-LD: Linked Data Querying with GraphQL, in: Proceedings of the ISWC 2018 Posters & Demonstrations, Industry and Blue Sky Ideas Tracks co-located with 17th International Semantic Web Conference (ISWC 2018), Monterey, USA, October 8th - to - 12th, 2018, M. van Erp, M. Atre, V. López, K. Srinivas and C. Fortuna, eds, CEUR Workshop Proceedings, Vol. 2180, CEUR-WS.org, 2018. https://ceur-ws.org/Vol-2180/paper-65.pdf. [57] P. Cudré-Mauroux, Leveraging knowledge graphs for big data integration: the XI pipeline, Semantic Web 11(1) (2020), 13–17. [58] S.E. Madnick, R.Y. Wang, Y.W. Lee and H. Zhu, Overview and Framework for Data and Information Quality Research, ACM J. Data Inf. Qual. 1(1) (2009), 2:1–2:22. doi:10.1145/1515693.1516680. [59] A. Zaveri, A. Rula, A. Maurino, R. Pietrobon, J. Lehmann and S. Auer, Quality assessment for linked data: A survey, Semantic Web 7(1) (2016), 63–93. [60] X. Wang, L. Chen, T. Ban, M. Usman, Y. Guan, S. Liu, T. Wu and H. Chen, Knowledge Graph Quality Control: A Survey, Fundamental Research (2021). [61] X.L. Dong, E. Gabrilovich, K. Murphy, V. Dang, W. Horn, C. Lugaresi, S. Sun and W. Zhang, Knowledge-based trust: Estimating the trustworthiness of web sources, ArXiv preprint abs/1502.03519 (2015). https://arxiv.org/abs/1502.03519. [62] Y. Amsterdamer and M. Cohen, Automated Selection of Multiple Datasets for Extension by Integration, in: Proceedings of the 30th ACM International Conference on Information & Knowledge Management, 2021, pp. 27–36. [63] B. Fetahu, S. Dietze, B. Pereira Nunes, M. Antonio Casanova, D. Taibi and W. Nejdl, A scalable approach for efficiently generating structured dataset topic profiles, in: European Semantic Web Conference, Springer, 2014, pp. 519–534. [64] D.M. Blei and J.D. Lafferty, A correlated topic model of science, The annals of applied statistics 1(1) (2007), 17–35. [65] M. Nentwig and E. Rahm, Incremental clustering on linked data, in: 2018 IEEE International Conference on Data Mining Workshops (ICDMW), IEEE, 2018, pp. 531–538. [66] A. Saeedi, E. Peukert and E. Rahm, Incremental Multi-source Entity Resolution for Knowledge Graph Completion, in: European Semantic Web Conference, Springer, 2020, pp. 393–408. [67] S. Hertling and H. Paulheim, Order Matters: Matching Multiple Knowledge Graphs, ArXiv preprint abs/2111.02239 (2021). https://arxiv. org/abs/2111.02239. [68] M. Giese, A. Soylu, G. Vega-Gorgojo, A. Waaler, P. Haase, E. Jiménez-Ruiz, D. Lanti, M. Rezk, G. Xiao, Ö.L. Özçep and R. Rosati, Optique: Zooming in on Big Data, Computer 48(3) (2015), 60–67. doi:10.1109/MC.2015.82. [69] C. Civili, M. Console, G.D. Giacomo, D. Lembo, M. Lenzerini, L. Lepore, R. Mancini, A. Poggi, R. Rosati, M. Ruzzi, V. Santarelli and D.F. Savo, MASTRO STUDIO: Managing Ontology-Based Data Access applications, Proc. VLDB Endow. 6(12) (2013), 1314–1317. doi:10.14778/2536274.2536304. http://www.vldb.org/pvldb/vol6/p1314-poggi.pdf. [70] M.N. Mami, D. Graux, S. Scerri, H. Jabeen, S. Auer and J. Lehmann, Squerall: Virtual Ontology-Based Access to Heterogeneous and Large Data Sources, in: The Semantic Web - ISWC 2019 - 18th International Semantic Web Conference, Auckland, New Zealand, October 26-30, 2019, Proceedings, Part II, C. Ghidini, O. Hartig, M. Maleshkova, V. Svátek, I.F. Cruz, A. Hogan, J. Song, M. Lefrançois and F. Gandon, eds, Lecture Notes in Computer Science, Vol. 11779, Springer, 2019, pp. 229–245. doi:10.1007/978-3-030-30796-7_15. [71] G. Banavar, T. Chandra, B. Mukherjee, J. Nagarajarao, R.E. Strom and D.C. Sturman, An efficient multicast protocol for content- based publish-subscribe systems, in: Proceedings. 19th IEEE International Conference on Distributed Computing Systems (Cat. No. 99CB37003), IEEE, 1999, pp. 262–272. [72] M. Völkel and T. Groza, SemVersion: An RDF-based Ontology Versioning System, in: Proceedings of IADIS International Conference on WWW/Internet, IADIS, Murcia, Spain, 2006, IADIS. http://www.xam.de/2006/10-SemVersion-ICIW2006.pdf. M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 41 [73] D.-H. Im, S.-W. Lee and H.-J. Kim, A Version Management Framework for RDF Triple Stores., International Journal of Software Engi- neering and Knowledge Engineering 22(1) (2012), 85–106. http://dblp.uni-trier.de/db/journals/ijseke/ijseke22.html#ImLK12. [74] M. Graube, S. Hensel and L. Urbas, R43ples: Revisions for Triples - An Approach for Version Control in the Semantic Web, in: LDQ@SEMANTiCS, CEUR Workshop Proceedings, Vol. 1215, CEUR-WS.org, 2014. [75] M.V. Sande, P. Colpaert, R. Verborgh, S. Coppens, E. Mannens and R.V. de Walle, R&Wbase: git for triples, in: LDOW, CEUR Workshop Proceedings, Vol. 996, CEUR-WS.org, 2013. [76] D. Im, S. Lee and H. Kim, A Version Management Framework for RDF Triple Stores, Int. J. Softw. Eng. Knowl. Eng. 22(1) (2012), 85–106. [77] T. Neumann and G. Weikum, X-RDF-3X: Fast Querying, High Update Rates, and Consistency for RDF Databases, Proc. VLDB Endow. 3(1–2) (2010), 256–263–. doi:10.14778/1920841.1920877. [78] K. Stefanidis, I. Chrysakis and G. Flouris, On Designing Archiving Policies for Evolving RDF Datasets on the Web, in: ER, Lecture Notes in Computer Science, Vol. 8824, Springer, 2014, pp. 43–56. [79] R. Taelman, P. Colpaert, E. Mannens and R. Verborgh, Generating public transport data based on population distributions for RDF benchmarking, Semantic Web 10(2) (2019), 305–328. doi:10.3233/SW-180319. [80] D.V. Lancker, P. Colpaert, H. Delva, B.V. de Vyvere, J.A.R. Meléndez, R. Dedecker, P. Michiels, R. Buyle, A.D. Craene and R. Verborgh, Publishing Base Registries as Linked Data Event Streams, in: Web Engineering - 21st International Conference, ICWE 2021, Biarritz, France, May 18-21, 2021, Proceedings, M. Brambilla, R. Chbeir, F. Frasincar and I. Manolescu, eds, Lecture Notes in Computer Science, Vol. 12706, Springer, 2021, pp. 28–36. doi:10.1007/978-3-030-74296-6_3. [81] D.V. Assche, S.M. Oo, J.A. Rojas and P. Colpaert, Continuous generation of versioned collections' members with RML and LDES, in: Proceedings of the 3rd International Workshop on Knowledge Graph Construction (KGCW 2022) co-located with 19th Extended Semantic Web Conference (ESWC 2022), Hersonissos, Greek, May 30, 2022, D. Chaves-Fraga, A. Dimou, P. Heyvaert, F. Priyatna and J. Sequeda, eds, CEUR Workshop Proceedings, Vol. 3141, CEUR-WS.org, 2022. https://ceur-ws.org/Vol-3141/paper3.pdf. [82] C. Aebeloe, I. Keles, G. Montoya and K. Hose, Star Pattern Fragments: Accessing Knowledge Graphs through Star Patterns, CoRR abs/2002.09172 (2020). https://arxiv.org/abs/2002.09172. [83] A. Polleres, M.R. Kamdar, J.D. Fernández, T. Tudorache and M.A. Musen, A More Decentralized Vision for Linked Data, in: Proceed- ings of the 2nd Workshop on Decentralizing the Semantic Web co-located with the 17th International Semantic Web Conference, De- SemWeb@ISWC 2018, Monterey, California, USA, October 8, 2018, R. Verborgh, T. Kuhn and T. Berners-Lee, eds, CEUR Workshop Proceedings, Vol. 2165, CEUR-WS.org, 2018. https://ceur-ws.org/Vol-2165/paper1.pdf. [84] R. Verborgh, M.V. Sande, O. Hartig, J.V. Herwegen, L.D. Vocht, B.D. Meester, G. Haesendonck and P. Colpaert, Triple Pattern Fragments: A low-cost knowledge graph interface for the Web, J. Web Semant. 37-38 (2016), 184–206. doi:10.1016/j.websem.2016.03.003. [85] C. Aebeloe, G. Montoya and K. Hose, A Decentralized Architecture for Sharing and Querying Semantic Data, in: The Semantic Web - 16th International Conference, ESWC 2019, Portorož, Slovenia, June 2-6, 2019, Proceedings, P. Hitzler, M. Fernández, K. Janowicz, A. Zaveri, A.J.G. Gray, V. López, A. Haller and K. Hammar, eds, Lecture Notes in Computer Science, Vol. 11503, Springer, 2019, pp. 3–18. doi:10.1007/978-3-030-21348-0_1. [86] C. Aebeloe, G. Montoya and K. Hose, Decentralized Indexing over a Network of RDF Peers, in: The Semantic Web - ISWC 2019 - 18th International Semantic Web Conference, Auckland, New Zealand, October 26-30, 2019, Proceedings, Part I, C. Ghidini, O. Har- tig, M. Maleshkova, V. Svátek, I.F. Cruz, A. Hogan, J. Song, M. Lefrançois and F. Gandon, eds, Lecture Notes in Computer Science, Vol. 11778, Springer, 2019, pp. 3–20. doi:10.1007/978-3-030-30793-6_1. [87] M. Cai and M.R. Frank, RDFPeers: a scalable distributed RDF repository based on a structured peer-to-peer network, in: Proceedings of the 13th international conference on World Wide Web, WWW 2004, New York, NY, USA, May 17-20, 2004, S.I. Feldman, M. Uretsky, M. Najork and C.E. Wills, eds, ACM, 2004, pp. 650–657. doi:10.1145/988672.988760. [88] A. Azzam, J.D. Fernández, M. Acosta, M. Beno and A. Polleres, SMART-KG: Hybrid Shipping for SPARQL Querying on the Web, in: WWW '20: The Web Conference 2020, Taipei, Taiwan, April 20-24, 2020, Y. Huang, I. King, T. Liu and M. van Steen, eds, ACM / IW3C2, 2020, pp. 984–994. doi:10.1145/3366423.3380177. [89] O. Hartig and C.B. Aranda, Bindings-Restricted Triple Pattern Fragments, in: On the Move to Meaningful Internet Systems: OTM 2016 Conferences - Confederated International Conferences: CoopIS, C&TC, and ODBASE 2016, Rhodes, Greece, October 24-28, 2016, Proceedings, C. Debruyne, H. Panetto, R. Meersman, T.S. Dillon, E. Kühn, D. O'Sullivan and C.A. Ardagna, eds, Lecture Notes in Computer Science, Vol. 10033, 2016, pp. 762–779. doi:10.1007/978-3-319-48472-3_48. [90] T. Minier, H. Skaf-Molli and P. Molli, SaGe : préemption Web pour les services publics d'évaluation de requêtes SPARQL, in: IC 2019: 30es Journées francophones d'Ingénierie des Connaissances (Proceedings of the 30th French Knowledge Engineering Conference), Toulouse, France, July 2-4, 2019, N. Hernandez, ed., 2019, p. 141. https://hal.archives-ouvertes.fr/IC_2019/hal-02329807v1. [91] G. Montoya, C. Aebeloe and K. Hose, Towards Efficient Query Processing over Heterogeneous RDF Interfaces, in: Emerging Topics in Semantic Technologies - ISWC 2018 Satellite Events [best papers from 13 of the workshops co-located with the ISWC 2018 conference], E. Demidova, A. Zaveri and E. Simperl, eds, Studies on the Semantic Web, Vol. 36, IOS Press, 2018, pp. 39–53. doi:10.3233/978-1- 61499-894-5-39. [92] A. Azzam, C. Aebeloe, G. Montoya, I. Keles, A. Polleres and K. Hose, WiseKG: Balanced Access to Web Knowledge Graphs, in: WWW '21: The Web Conference 2021, Virtual Event / Ljubljana, Slovenia, April 19-23, 2021, J. Leskovec, M. Grobelnik, M. Najork, J. Tang and L. Zia, eds, ACM / IW3C2, 2021, pp. 1422–1434. doi:10.1145/3442381.3449911. [93] A.C. Junior, C. Debruyne, R. Brennan and D. O'Sullivan, FunUL: a method to incorporate functions into uplift mapping languages, Proceedings of the 18th International Conference on Information Integration and Web-based Applications and Services (2016). 42 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges [94] A. Dimou, R2RML and RML Comparison for RDF Generation, their Rules Validation and Inconsistency Resolution, arXiv preprint arXiv:2005.06293 (2020). [95] A. Dimou, M. Vander Sande, P. Colpaert, R. Verborgh, E. Mannens and R. Van de Walle, Rdf mapping language (rml), Specification proposal draft (2014). [96] E. Iglesias, S. Jozashoori, D. Chaves-Fraga, D. Collarana and M.-E. Vidal, SDM-RDFizer: An RML Interpreter for the Efficient Creation of RDF Knowledge Graphs, Proceedings of the 29th ACM International Conference on Information & Knowledge Management (2020). [97] C.A. Knoblock, P.A. Szekely, J.L. Ambite, A. Goel, S. Gupta, K. Lerman, M. Muslea, M. Taheriyan and P. Mallick, Semi-automatically Mapping Structured Sources into the Semantic Web, in: The Semantic Web: Research and Applications - 9th Extended Semantic Web Conference, ESWC 2012, Heraklion, Crete, Greece, May 27-31, 2012. Proceedings, E. Simperl, P. Cimiano, A. Polleres, Ó. Corcho and V. Presutti, eds, Lecture Notes in Computer Science, Vol. 7295, Springer, 2012, pp. 375–390. doi:10.1007/978-3-642-30284-8_32. [98] N. Jain, G. Liao and T.L. Willke, Graphbuilder: scalable graph ETL framework, in: First Int. Workshop on Graph data management experiences and systems, 2013. [99] M. Kricke, E. Peukert and E. Rahm, Graph data transformations in Gradoop, BTW 2019 (2019). [100] R. Angles, H. Thakkar and D. Tomaszuk, Mapping RDF databases to property graph databases, IEEE Access 8 (2020), 86091–86110. [101] M. Lefrançois, A. Zimmermann and N. Bakerally, A SPARQL Extension for Generating RDF from Heterogeneous Formats, in: Extended Semantic Web Conference, 2017. [102] L.F. de Medeiros, F. Priyatna and Ó. Corcho, MIRROR: Automatic R2RML Mapping Generation from Relational Databases, in: Interna- tional Conference on Web Engineering, 2015. [103] Á. Sicilia and G. Nemirovski, AutoMap4OBDA: Automated Generation of R2RML Mappings for OBDA, in: International Conference Knowledge Engineering and Knowledge Management, 2016. [104] E. Jiménez-Ruiz, E. Kharlamov, D. Zheleznyakov, I. Horrocks, C. Pinkel, M.G. Skjaeveland, E. Thorstensen and J. Mora, BootOX: Practical Mapping of RDBs to OWL 2, in: International Workshop on the Semantic Web, 2015. [105] E. Rahm and H.H. Do, Data cleaning: Problems and current approaches, IEEE Data Eng. Bull. 23(4) (2000), 3–13. [106] Z. Abedjan, X. Chu, D. Deng, R.C. Fernandez, I.F. Ilyas, M. Ouzzani, P. Papotti, M. Stonebraker and N. Tang, Detecting Data Errors: Where are we and what needs to be done?, Proc. VLDB Endow. 9(12) (2016), 993–1004. doi:10.14778/2994509.2994518. http://www. vldb.org/pvldb/vol9/p993-abedjan.pdf. [107] I.F. Ilyas and X. Chu, Data cleaning, Morgan & Claypool, 2019. [108] M. Fiorelli and A. Stellato, Lifting Tabular Data to RDF: A Survey, in: Metadata and Semantic Research, E. Garoufallou and M.-A. Ovalle- Perandones, eds, Springer International Publishing, Cham, 2021, pp. 85–96. ISBN 978-3-030-71903-6. [109] Z. Abedjan, L. Golab, F. Naumann and T. Papenbrock, Data profiling, Synthesis Lectures on Data Management 10(4) (2018), 1–154. [110] G. Beskales, I.F. Ilyas and L. Golab, Sampling the Repairs of Functional Dependency Violations under Hard Constraints, Proc. VLDB Endow. 3(1) (2010), 197–207. doi:10.14778/1920841.1920870. http://www.vldb.org/pvldb/vldb2010/pvldb_vol3/R17.pdf. [111] G. Beskales, I.F. Ilyas, L. Golab and A. Galiullin, On the relative trust between inconsistent data and inaccurate constraints, in: 29th IEEE International Conference on Data Engineering, ICDE 2013, Brisbane, Australia, April 8-12, 2013, C.S. Jensen, C.M. Jermaine and X. Zhou, eds, IEEE Computer Society, 2013, pp. 541–552. doi:10.1109/ICDE.2013.6544854. [112] Z. Khayyat, I.F. Ilyas, A. Jindal, S. Madden, M. Ouzzani, P. Papotti, J. Quiané-Ruiz, N. Tang and S. Yin, BigDansing: A System for Big Data Cleansing, in: Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data, Melbourne, Victoria, Aus- tralia, May 31 - June 4, 2015, T.K. Sellis, S.B. Davidson and Z.G. Ives, eds, ACM, 2015, pp. 1215–1230. doi:10.1145/2723372.2747646. [113] S. Kolahi and L.V.S. Lakshmanan, On approximating optimum repairs for functional dependency violations, in: Database Theory - ICDT 2009, 12th International Conference, St. Petersburg, Russia, March 23-25, 2009, Proceedings, R. Fagin, ed., ACM International Conference Proceeding Series, Vol. 361, ACM, 2009, pp. 53–62. doi:10.1145/1514894.1514901. [114] P. Wang and Y. He, Uni-Detect: A Unified Approach to Automated Error Detection in Tables, in: Proceedings of the 2019 International Conference on Management of Data, SIGMOD Conference 2019, Amsterdam, The Netherlands, June 30 - July 5, 2019, P.A. Boncz, S. Manegold, A. Ailamaki, A. Deshpande and T. Kraska, eds, ACM, 2019, pp. 811–828. doi:10.1145/3299869.3319855. [115] P. Bohannon, W. Fan, F. Geerts, X. Jia and A. Kementsietsidis, Conditional Functional Dependencies for Data Cleaning, in: Proceed- ings of the 23rd International Conference on Data Engineering, ICDE 2007, The Marmara Hotel, Istanbul, Turkey, April 15-20, 2007, R. Chirkova, A. Dogac, M.T. Özsu and T.K. Sellis, eds, IEEE Computer Society, 2007, pp. 746–755. doi:10.1109/ICDE.2007.367920. [116] W. Fan, F. Geerts, X. Jia and A. Kementsietsidis, Conditional functional dependencies for capturing data inconsistencies, ACM Trans. Database Syst. 33(2) (2008), 6:1–6:48. doi:10.1145/1366102.1366103. [117] F. Geerts, G. Mecca, P. Papotti and D. Santoro, The LLUNATIC Data-Cleaning Framework, Proc. VLDB Endow. 6(9) (2013), 625–636. doi:10.14778/2536360.2536363. http://www.vldb.org/pvldb/vol6/p625-mecca.pdf. [118] X. Chu, I.F. Ilyas and P. Papotti, Holistic data cleaning: Putting violations into context, in: 29th IEEE International Conference on Data Engineering, ICDE 2013, Brisbane, Australia, April 8-12, 2013, C.S. Jensen, C.M. Jermaine and X. Zhou, eds, IEEE Computer Society, 2013, pp. 458–469. doi:10.1109/ICDE.2013.6544847. [119] A. Heidari, J. McGrath, I.F. Ilyas and T. Rekatsinas, HoloDetect: Few-Shot Learning for Error Detection, in: Proceedings of the 2019 International Conference on Management of Data, SIGMOD Conference 2019, Amsterdam, The Netherlands, June 30 - July 5, 2019, P.A. Boncz, S. Manegold, A. Ailamaki, A. Deshpande and T. Kraska, eds, ACM, 2019, pp. 829–846. doi:10.1145/3299869.3319888. [120] A. Lopatenko and L. Bravo, Efficient Approximation Algorithms for Repairing Inconsistent Databases, in: Proceedings of the 23rd Inter- national Conference on Data Engineering, ICDE 2007, The Marmara Hotel, Istanbul, Turkey, April 15-20, 2007, R. Chirkova, A. Dogac, M.T. Özsu and T.K. Sellis, eds, IEEE Computer Society, 2007, pp. 216–225. doi:10.1109/ICDE.2007.367867. M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 43 [121] T. Rekatsinas, X. Chu, I.F. Ilyas and C. Ré, HoloClean: Holistic Data Repairs with Probabilistic Inference, Proc. VLDB Endow. 10(11) (2017), 1190–1201. doi:10.14778/3137628.3137631. http://www.vldb.org/pvldb/vol10/p1190-rekatsinas.pdf. [122] S. Krishnan, J. Wang, E. Wu, M.J. Franklin and K. Goldberg, ActiveClean: Interactive Data Cleaning For Statistical Modeling, Proc. VLDB Endow. 9(12) (2016), 948–959. doi:10.14778/2994509.2994514. http://www.vldb.org/pvldb/vol9/p948-krishnan.pdf. [123] M. Mahdavi, Z. Abedjan, R.C. Fernandez, S. Madden, M. Ouzzani, M. Stonebraker and N. Tang, Raha: A Configuration-Free Error Detection System, in: Proceedings of the 2019 International Conference on Management of Data, SIGMOD Conference 2019, Amsterdam, The Netherlands, June 30 - July 5, 2019, P.A. Boncz, S. Manegold, A. Ailamaki, A. Deshpande and T. Kraska, eds, ACM, 2019, pp. 865– 882. doi:10.1145/3299869.3324956. [124] M. Milani, Z. Zheng and F. Chiang, CurrentClean: Spatio-Temporal Cleaning of Stale Data, in: 35th IEEE International Conference on Data Engineering, ICDE 2019, Macao, China, April 8-11, 2019, IEEE, 2019, pp. 172–183. doi:10.1109/ICDE.2019.00024. [125] A. Assadi, T. Milo and S. Novgorodov, DANCE: Data Cleaning with Constraints and Experts, in: 33rd IEEE International Confer- ence on Data Engineering, ICDE 2017, San Diego, CA, USA, April 19-22, 2017, IEEE Computer Society, 2017, pp. 1409–1410. doi:10.1109/ICDE.2017.199. [126] X. Chu, M. Ouzzani, J. Morcos, I.F. Ilyas, P. Papotti, N. Tang and Y. Ye, KATARA: Reliable Data Cleaning with Knowledge Bases and Crowdsourcing, Proc. VLDB Endow. 8(12) (2015), 1952–1955. doi:10.14778/2824032.2824109. http://www.vldb.org/pvldb/vol8/ p1952-chu.pdf. [127] J. He, E. Veltri, D. Santoro, G. Li, G. Mecca, P. Papotti and N. Tang, Interactive and Deterministic Data Cleaning, in: Proceedings of the 2016 International Conference on Management of Data, SIGMOD Conference 2016, San Francisco, CA, USA, June 26 - July 01, 2016, F. Özcan, G. Koutrika and S. Madden, eds, ACM, 2016, pp. 893–907. doi:10.1145/2882903.2915242. [128] S. Thirumuruganathan, L. Berti-Équille, M. Ouzzani, J. Quiané-Ruiz and N. Tang, UGuide: User-Guided Discovery of FD-Detectable Errors, in: Proceedings of the 2017 ACM International Conference on Management of Data, SIGMOD Conference 2017, Chicago, IL, USA, May 14-19, 2017, S. Salihoglu, W. Zhou, R. Chirkova, J. Yang and D. Suciu, eds, ACM, 2017, pp. 1385–1397. doi:10.1145/3035918.3064024. [129] Y. Tong, C.C. Cao, C.J. Zhang, Y. Li and L. Chen, CrowdCleaner: Data cleaning for multi-version data on the web via crowdsourcing, in: IEEE 30th International Conference on Data Engineering, Chicago, ICDE 2014, IL, USA, March 31 - April 4, 2014, I.F. Cruz, E. Ferrari, Y. Tao, E. Bertino and G. Trajcevski, eds, IEEE Computer Society, 2014, pp. 1182–1185. doi:10.1109/ICDE.2014.6816736. [130] M. Yakout, A.K. Elmagarmid, J. Neville, M. Ouzzani and I.F. Ilyas, Guided data repair, Proc. VLDB Endow. 4(5) (2011), 279–289. doi:10.14778/1952376.1952378. [131] F. Neutatz, B. Chen, Z. Abedjan and E. Wu, From Cleaning before ML to Cleaning for ML., IEEE Data Eng. Bull. 44(1) (2021), 24–41. [132] S. Hao, N. Tang, G. Li, J. Li and J. Feng, Distilling relations using knowledge bases, VLDB J. 27(4) (2018), 497–519. doi:10.1007/s00778- 018-0506-9. [133] C. Ge, Y. Gao, H. Weng, C. Zhang, X. Miao and B. Zheng, KGClean: An Embedding Powered Knowledge Graph Cleaning Framework, CoRR abs/2004.14478 (2020). https://arxiv.org/abs/2004.14478. [134] M.D. Wilkinson, M. Dumontier, I.J. Aalbersberg, G. Appleton, M. Axton, A. Baak, N. Blomberg, J.-W. Boiten, L.B. da Silva Santos, P.E. Bourne et al., The FAIR Guiding Principles for scientific data management and stewardship, Scientific data 3(1) (2016), 1–9. [135] M. Kricke, M. Grimmer and M. Schmeisser, Preserving Recomputability of Results from Big Data Transformation Workflows, Datenbank- Spektrum 17(3) (2017), 245–253. [136] J. Greenberg, Understanding metadata and metadata schemes, Cataloging & classification quarterly 40(3–4) (2005), 17–36. [137] C.B. Neto, D. Kontokostas, A. Kirschenbaum, G.C. Publio, D. Esteves and S. Hellmann, IDOL: Comprehensive & complete LOD insights, in: Proceedings of the 13th International Conference on Semantic Systems, 2017, pp. 49–56. [138] E. Duval, W. Hodgins, S. Sutton and S.L. Weibel, Metadata principles and practicalities, D-lib Magazine 8(4) (2002), 1–10. [139] D. Kadioglu, B. Breil, C. Knell, M. Lablans, S. Mate, D. Schlue, H. Serve, H. Storf, F. Ückert, T.O. Wagner et al., Samply. MDR-A Metadata Repository and Its Application in Various Research Networks., in: GMDS, 2018, pp. 50–54. [140] J. Frey, F. Götz, M. Hofer and S. Hellmann, Managing and Compiling Data Dependencies for Semantic Applications Using Databus Client, in: Research Conference on Metadata and Semantics Research, Springer, 2022, pp. 114–125. [141] J. Frey, M. Hofer, D. Obraczka, J. Lehmann and S. Hellmann, DBpedia FlexiFusion the best of Wikipedia> Wikidata> your data, in: International Semantic Web Conference, Springer, 2019, pp. 96–112. [142] B.D. Meester, A. Dimou, R. Verborgh and E. Mannens, Detailed Provenance Capture of Data Processing, in: SemSci@ISWC, 2017. [143] B.D. Meester, T. Seymoens, A. Dimou and R. Verborgh, Implementation-independent function reuse, Future Gener. Comput. Syst. 110 (2020), 946–959. [144] N.F. Noy, D.L. McGuinness et al., Ontology development 101: A guide to creating your first ontology, Stanford knowledge systems laboratory technical report KSL-01-05 and . . . , 2001. [145] F.N. Al-Aswadi, H.Y. Chan and K.H. Gan, Automatic ontology construction from text: a review from shallow to deep learning trend, Artificial Intelligence Review 53(6) (2020), 3901–3928. [146] A. Browarnik and O. Maimon, Ontology learning from text: why the ontology learning layer cake is not viable, International Journal of Signs and Semiotic Systems (IJSSS) 4(2) (2015), 1–14. [147] W. Wong, W. Liu and M. Bennamoun, Ontology learning from text: A look back and into the future, ACM Computing Surveys (CSUR) 44(4) (2012), 1–36. [148] C. Ma and B. Molnár, Ontology learning from relational database: Opportunities for semantic information integration, Vietnam Journal of Computer Science 9(01) (2022), 31–57. [149] R. De Virgilio, A. Maccioni and R. Torlone, R2G: a Tool for Migrating Relations to Graphs., in: EDBT, Vol. 2014, 2014, pp. 640–643. 44 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges [150] A. Petermann, M. Junghanns, R. Müller and E. Rahm, BIIIG: enabling business intelligence with integrated instance graphs, in: 2014 IEEE 30th International Conference on Data Engineering Workshops, IEEE, 2014, pp. 4–11. [151] D. Obraczka, A. Saeedi and E. Rahm, Knowledge Graph Completion with FAMER (DI2KG Challenge Winner), in: Proceedings of the 1st International Workshop on Challenges and Experiences from Data Integration to Knowledge Graphs co-located with the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD 2019), Anchorage, Alaska, August 5, 2019, D. Firmani, V. Crescenzi, A.D. Angelis, X.L. Dong, M. Mazzei, P. Merialdo and D. Srivastava, eds, CEUR Workshop Proceedings, Vol. 2512, CEUR- WS.org, 2019. http://ceur-ws.org/Vol-2512/paper1.pdf. [152] F.M. Suchanek, S. Abiteboul and P. Senellart, PARIS: Probabilistic Alignment of Relations, Instances, and Schema, Proc. VLDB Endow. 5(3) (2011), 157–168. doi:10.14778/2078331.2078332. http://www.vldb.org/pvldb/vol5/p157_fabianmsuchanek_vldb2012.pdf. [153] E. Rahm and P.A. Bernstein, A survey of approaches to automatic schema matching, the VLDB Journal 10(4) (2001), 334–350. [154] J. Euzenat, P. Shvaiko et al., Ontology matching, Vol. 18, Springer, 2007. [155] Z. Bellahsene, A. Bonifati and E. Rahm, Schema matching and mapping, Springer, 2011. [156] E. Rahm, Towards Large-Scale Schema and Ontology Matching, Schema Matching and Mapping (2011), 3–27. doi:10.1007/978-3-642- 16518-4_1. [157] L. Otero-Cerdeira, F.J. Rodríguez-Martínez and A. Gómez-Rodríguez, Ontology matching: A literature review, Expert Systems with Applications 42(2) (2015). doi:10.1016/j.eswa.2014.08.032. [158] H.-H. Do and E. Rahm, COMA-a system for flexible combination of schema matching approaches, in: VLDB'02: Proceedings of the 28th International Conference on Very Large Databases, Elsevier, 2002, pp. 610–621. [159] Y. Zhang, X. Wang, S. Lai, S. He, K. Liu, J. Zhao and X. Lv, Ontology Matching with Word Embeddings, in: Chinese Computational Linguistics and Natural Language Processing Based on Naturally Annotated Big Data - 13th China National Conference, CCL 2014, and Second International Symposium, NLP-NABD 2014, Wuhan, China, October 18-19, 2014. Proceedings, M. Sun, Y. Liu and J. Zhao, eds, Lecture Notes in Computer Science, Vol. 8801, Springer, 2014, pp. 34–45. doi:10.1007/978-3-319-12277-9_4. [160] T. Mikolov, I. Sutskever, K. Chen, G.S. Corrado and J. Dean, Distributed Representations of Words and Phrases and their Com- positionality, in: Advances in Neural Information Processing Systems 26: 27th Annual Conference on Neural Information Pro- cessing Systems 2013. Proceedings of a meeting held December 5-8, 2013, Lake Tahoe, Nevada, United States, C.J.C. Burges, L. Bottou, Z. Ghahramani and K.Q. Weinberger, eds, 2013, pp. 3111–3119. https://proceedings.neurips.cc/paper/2013/hash/ 9aa42b31882ec039965f3c4923ce901b-Abstract.html. [161] D. Ayala, I. Hernández, D. Ruiz and E. Rahm, LEAPME: Learning-based Property Matching with Embeddings, Data & Knowl- edge Engineering 137 (2022), 101943. doi:https://doi.org/10.1016/j.datak.2021.101943. https://www.sciencedirect.com/science/article/ pii/S0169023X21000707. [162] J. Portisch, G. Costa, K. Stefani, K. Kreplin, M. Hladik and H. Paulheim, Ontology Matching Through Absolute Orientation of Embedding Spaces, in: The Semantic Web: ESWC 2022 Satellite Events - Hersonissos, Crete, Greece, May 29 - June 2, 2022, Proceedings, P. Groth, A. Rula, J. Schneider, I. Tiddi, E. Simperl, P. Alexopoulos, R. Hoekstra, M. Alam, A. Dimou and M. Tamper, eds, Lecture Notes in Computer Science, Vol. 13384, Springer, 2022, pp. 153–157. doi:10.1007/978-3-031-11609-4_29. [163] J. Portisch, M. Hladik and H. Paulheim, RDF2Vec Light - A Lightweight Approach for Knowledge Graph Embeddings, CoRR abs/2009.07659 (2020). https://arxiv.org/abs/2009.07659. [164] R.A. Pottinger and P.A. Bernstein, Merging models based on given correspondences, in: Proceedings 2003 VLDB Conference, Elsevier, 2003, pp. 862–873. [165] S. Raunich and E. Rahm, Target-driven merging of taxonomies with ATOM, Information Systems 42 (2014), 1–14. [166] I. Osman, S.B. Yahia and G. Diallo, Ontology integration: approaches and challenging issues, Information Fusion 71 (2021), 38–63. [167] R. Usbeck, A.-C. Ngonga Ngomo, S. Auer, D. Gerber and A. Both, AGDISTIS - Graph-Based Disambiguation of Named Entities using Linked Data, in: 13th International Semantic Web Conference, 2014. http://svn.aksw.org/papers/2014/ISWC_AGDISTIS/public.pdf. [168] P. Ferragina and U. Scaiella, TAGME: on-the-fly annotation of short text fragments (by wikipedia entities), in: Proceedings of the 19th ACM Conference on Information and Knowledge Management, CIKM 2010, Toronto, Ontario, Canada, October 26-30, 2010, J. Huang, N. Koudas, G.J.F. Jones, X. Wu, K. Collins-Thompson and A. An, eds, ACM, 2010, pp. 1625–1628. doi:10.1145/1871437.1871689. [169] F. Piccinno and P. Ferragina, From TagME to WAT: A New Entity Annotator, in: Proceedings of the First International Workshop on Entity Recognition & Disambiguation, ERD '14, Association for Computing Machinery, New York, NY, USA, 2014, pp. 55–62–. ISBN 9781450330237. doi:10.1145/2633211.2634350. [170] C. Manning, M. Surdeanu, J. Bauer, J. Finkel, S. Bethard and D. McClosky, The Stanford CoreNLP Natural Language Processing Toolkit, in: Proceedings of 52nd Annual Meeting of the Association for Computational Linguistics: System Demonstrations, Association for Com- putational Linguistics, Baltimore, Maryland, 2014, pp. 55–60. doi:10.3115/v1/P14-5010. https://aclanthology.org/P14-5010. [171] Y. Goldberg, Neural Network Methods for Natural Language Processing, Synthesis Lectures on Human Language Technologies, Morgan & Claypool Publishers, 2017. doi:10.2200/S00762ED1V01Y201703HLT037. [172] J. Li, A. Sun, J. Han and C. Li, A Survey on Deep Learning for Named Entity Recognition, IEEE Trans. Knowl. Data Eng. 34(1) (2022), 50–70. doi:10.1109/TKDE.2020.2981314. [173] S. Moon, L. Neves and V. Carvalho, Multimodal Named Entity Recognition for Short Social Media Posts, 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, 2018, pp. 852–860. doi:10.18653/v1/N18-1078. https://aclanthology.org/N18-1078. M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 45 [174] J. Yu, J. Jiang, L. Yang and R. Xia, Improving Multimodal Named Entity Recognition via Entity Span Detection with Unified Multimodal Transformer, in: Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Association for Computational Linguistics, Online, 2020, pp. 3342–3352. doi:10.18653/v1/2020.acl-main.306. https://aclanthology.org/2020.acl-main.306. [175] P. Pezeshkpour, L. Chen and S. Singh, Embedding Multimodal Relational Data for Knowledge Base Completion, in: Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Association for Computational Linguistics, Brussels, Belgium, 2018, pp. 3208–3218. doi:10.18653/v1/D18-1359. https://aclanthology.org/D18-1359. [176] M. Li, A. Zareian, Y. Lin, X. Pan, S. Whitehead, B. Chen, B. Wu, H. Ji, S.-F. Chang, C. Voss, D. Napierski and M. Freedman, GAIA: A Fine-grained Multimedia Knowledge Extraction System, in: Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, Association for Computational Linguistics, Online, 2020, pp. 77–86. doi:10.18653/v1/2020.acl- demos.11. https://aclanthology.org/2020.acl-demos.11. [177] Y. Ding, J. Yu, B. Liu, Y. Hu, M. Cui and Q. Wu, MuKEA: Multimodal Knowledge Extraction and Accumulation for Knowledge-based Visual Question Answering, CoRR abs/2203.09138 (2022). [178] J.L. Martinez-Rodriguez, A. Hogan and I. Lopez-Arevalo, Information extraction meets the Semantic Web: A survey, Semantic Web 11(2) (2020), 255–335. doi:10.3233/sw-180333. https://doi.org/10.3233%2Fsw-180333. [179] S. Kulkarni, A. Singh, G. Ramakrishnan and S. Chakrabarti, Collective annotation of Wikipedia entities in web text, in: Proceed- ings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining - KDD '09, ACM Press, 2009. doi:10.1145/1557019.1557073. https://doi.org/10.1145%2F1557019.1557073. [180] D. Milne and I.H. Witten, Learning to link with wikipedia, in: Proceeding of the 17th ACM conference on Information and knowledge mining - CIKM '08, ACM Press, 2008. doi:10.1145/1458082.1458150. https://doi.org/10.1145%2F1458082.1458150. [181] X. Han, L. Sun and J. Zhao, Collective entity linking in web text: a graph-based method, in: Proceeding of the 34th International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR 2011, Beijing, China, July 25-29, 2011, W. Ma, J. Nie, R. Baeza-Yates, T. Chua and W.B. Croft, eds, ACM, 2011, pp. 765–774. doi:10.1145/2009916.2010019. [182] O. Medelyan, I.H. Witten and D. Milne, Topic Indexing with Wikipedia, in: In Proc. of the first AAAI Workshop on Wikipedia and Artificial Intelligence (WIKIAI'08, 2008. [183] J. Hoffart, D. Milchevski, G. Weikum, A. Anand and J. Singh, The Knowledge Awakens: Keeping Knowledge Bases Fresh with Emerging Entities, in: Proceedings of the 25th International Conference on World Wide Web, WWW 2016, Montreal, Canada, April 11-15, 2016, Companion Volume, J. Bourdeau, J. Hendler, R. Nkambou, I. Horrocks and B.Y. Zhao, eds, ACM, 2016, pp. 203–206. doi:10.1145/2872518.2890537. [184] S. Mudgal, H. Li, T. Rekatsinas, A. Doan, Y. Park, G. Krishnan, R. Deep, E. Arcaute and V. Raghavendra, Deep Learning for En- tity Matching: A Design Space Exploration, in: Proceedings of the 2018 International Conference on Management of Data, SIGMOD Conference 2018, Houston, TX, USA, June 10-15, 2018, G. Das, C.M. Jermaine and P.A. Bernstein, eds, ACM, 2018, pp. 19–34. doi:10.1145/3183713.3196926. [185] M.A. Hearst, Automatic Acquisition of Hyponyms from Large Text Corpora, in: 14th International Conference on Computational Lin- guistics, COLING 1992, Nantes, France, August 23-28, 1992, 1992, pp. 539–545. https://aclanthology.org/C92-2082/. [186] E. Agichtein and L. Gravano, Snowball: extracting relations from large plain-text collections, in: Proceedings of the Fifth ACM Conference on Digital Libraries, June 2-7, 2000, San Antonio, TX, USA, ACM, 2000, pp. 85–94. doi:10.1145/336597.336644. [187] S. Brin, Extracting Patterns and Relations from the World Wide Web, in: The World Wide Web and Databases, International Workshop WebDB'98, Valencia, Spain, March 27-28, 1998, Selected Papers, P. Atzeni, A.O. Mendelzon and G. Mecca, eds, Lecture Notes in Computer Science, Vol. 1590, Springer, 1998, pp. 172–183. doi:10.1007/10704656_11. [188] G. Zhou, M. Zhang, D.H. Ji and Q. Zhu, Tree Kernel-Based Relation Extraction with Context-Sensitive Structured Parse Tree Infor- mation, in: Proceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Computational Nat- ural Language Learning (EMNLP-CoNLL), Association for Computational Linguistics, Prague, Czech Republic, 2007, pp. 728–736. https://aclanthology.org/D07-1076. [189] T.H. Nguyen and R. Grishman, Relation Extraction: Perspective from Convolutional Neural Networks, in: Proceedings of the 1st Workshop on Vector Space Modeling for Natural Language Processing, VS@NAACL-HLT 2015, June 5, 2015, Denver, Colorado, USA, P. Blunsom, S.B. Cohen, P.S. Dhillon and P. Liang, eds, The Association for Computational Linguistics, 2015, pp. 39–48. doi:10.3115/v1/w15-1506. [190] D. Zeng, K. Liu, Y. Chen and J. Zhao, Distant Supervision for Relation Extraction via Piecewise Convolutional Neural Networks, in: Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, EMNLP 2015, Lisbon, Portugal, September 17-21, 2015, L. Màrquez, C. Callison-Burch, J. Su, D. Pighin and Y. Marton, eds, The Association for Computational Linguistics, 2015, pp. 1753–1762. doi:10.18653/v1/d15-1203. [191] L. Baldini Soares, N. FitzGerald, J. Ling and T. Kwiatkowski, Matching the Blanks: Distributional Similarity for Relation Learning, in: Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Association for Computational Linguistics, Florence, Italy, 2019, pp. 2895–2905. doi:10.18653/v1/P19-1279. https://aclanthology.org/P19-1279. [192] S. Wu and Y. He, Enriching Pre-trained Language Model with Entity Information for Relation Classification, in: Proceedings of the 28th ACM International Conference on Information and Knowledge Management, CIKM 2019, Beijing, China, November 3-7, 2019, W. Zhu, D. Tao, X. Cheng, P. Cui, E.A. Rundensteiner, D. Carmel, Q. He and J.X. Yu, eds, ACM, 2019, pp. 2361–2364. doi:10.1145/3357384.3358119. [193] X. Han, T. Gao, Y. Lin, H. Peng, Y. Yang, C. Xiao, Z. Liu, P. Li, J. Zhou and M. Sun, More Data, More Relations, More Context and More Openness: A Review and Outlook for Relation Extraction, in: Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing, Association for Computational Linguistics, Suzhou, China, 2020, pp. 745–758. https://aclanthology.org/2020.aacl-main.75. 46 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges [194] S. Vashishth, P. Jain and P.P. Talukdar, CESI: Canonicalizing Open Knowledge Bases using Embeddings and Side Information, in: Pro- ceedings of the 2018 World Wide Web Conference on World Wide Web, WWW 2018, Lyon, France, April 23-27, 2018, P. Champin, F.L. Gandon, M. Lalmas and P.G. Ipeirotis, eds, ACM, 2018, pp. 1317–1327. doi:10.1145/3178876.3186030. [195] J. Daiber, M. Jakob, C. Hokamp and P.N. Mendes, Improving Efficiency and Accuracy in Multilingual Entity Extraction, in: Proceedings of the 9th International Conference on Semantic Systems (I-Semantics), 2013. [196] R. Clancy, I.F. Ilyas and J. Lin, Scalable Knowledge Graph Construction from Text Collections, in: Proceedings of the Second Work- shop on Fact Extraction and VERification (FEVER), Association for Computational Linguistics, Hong Kong, China, 2019, pp. 39–46. doi:10.18653/v1/D19-6607. https://aclanthology.org/D19-6607. [197] X. Han, T. Gao, Y. Yao, D. Ye, Z. Liu and M. Sun, OpenNRE: An Open and Extensible Toolkit for Neural Relation Extraction, 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): System Demonstrations, Association for Computational Linguistics, Hong Kong, China, 2019, pp. 169–174. doi:10.18653/v1/D19-3029. https://aclanthology.org/D19-3029. [198] D. Elliott and F. Keller, Image Description using Visual Dependency Representations, in: Proceedings of the 2013 Conference on Empir- ical Methods in Natural Language Processing, Association for Computational Linguistics, Seattle, Washington, USA, 2013, pp. 1292– 1302. https://aclanthology.org/D13-1128. [199] C. Zheng, J. Feng, Z. Fu, Y. Cai, Q. Li and T. Wang, Multimodal Relation Extraction with Efficient Graph Alignment, in: Proceedings of the 29th ACM International Conference on Multimedia, MM '21, Association for Computing Machinery, New York, NY, USA, 2021, pp. 5298–5306–. ISBN 9781450386517. doi:10.1145/3474085.3476968. [200] H. Köpcke and E. Rahm, Frameworks for entity matching: A comparison, Data & Knowledge Engineering 69(2) (2010), 197–210. [201] P. Christen, The data matching process, in: Data matching, Springer, 2012, pp. 23–35. [202] N. M., H. M., N.N. A. and R. E., A survey of current link discovery frameworks, Semantic Web 8(3) (2017). [203] N. Barlaug and J.A. Gulla, Neural networks for entity matching: A survey, ACM Transactions on Knowledge Discovery from Data (TKDD) 15(3) (2021), 1–37. [204] V. Christophides, V. Efthymiou, T. Palpanas, G. Papadakis and K. Stefanidis, An Overview of End-to-End Entity Resolution for Big Data, ACM Computing Surveys (2020). [205] G. Papadakis, D. Skoutas, E. Thanos and T. Palpanas, Blocking and filtering techniques for entity resolution: A survey, ACM Computing Surveys (CSUR) 53(2) (2020), 1–42. [206] A. Saeedi, E. Peukert and E. Rahm, Using link features for entity clustering in knowledge graphs, in: European Semantic Web Conference, Springer, 2018, pp. 576–592. [207] G. Papadakis, L. Tsekouras, E. Thanos, N. Pittaras, G. Simonini, D. Skoutas, P. Isaris, G. Giannakopoulos, T. Palpanas and M. Koubarakis, JedAI3: beyond batch, blocking-based Entity Resolution., in: EDBT, 2020, pp. 603–606. [208] M. Ebraheem, S. Thirumuruganathan, S.R. Joty, M. Ouzzani and N. Tang, DeepER - Deep Entity Resolution, ArXiv preprint abs/1710.00597 (2017). https://arxiv.org/abs/1710.00597. [209] Z. Sun, Q. Zhang, W. Hu, C. Wang, M. Chen, F. Akrami and C. Li, A Benchmarking Study of Embedding-based Entity Alignment for Knowledge Graphs, Proc. VLDB Endow. 13(11) (2020), 2326–2340. http://www.vldb.org/pvldb/vol13/p2326-sun.pdf. [210] D. Obraczka, J. Schuchart and E. Rahm, Embedding-Assisted Entity Resolution for Knowledge Graphs, in: Proceedings of the 2nd International Workshop on Knowledge Graph Construction co-located with 18th Extended Semantic Web Conference (ESWC 2021), Online, June 6, 2021, D. Chaves-Fraga, A. Dimou, P. Heyvaert, F. Priyatna and J.F. Sequeda, eds, CEUR Workshop Proceedings, Vol. 2873, CEUR-WS.org, 2021. http://ceur-ws.org/Vol-2873/paper8.pdf. [211] M. Leone, S. Huber, A. Arora, A. García-Durán and R. West, A Critical Re-evaluation of Neural Methods for Entity Alignment, Proc. VLDB Endow. 15(8) (2022), 1712–1725. https://www.vldb.org/pvldb/vol15/p1712-arora.pdf. [212] G. Papadakis, E. Ioannou, E. Thanos and T. Palpanas, The Four Generations of Entity Resolution, Synthesis Lectures on Data Management, Morgan & Claypool Publishers, 2021. doi:10.2200/S01067ED1V01Y202012DTM064. [213] A. Gruenheid, X.L. Dong and D. Srivastava, Incremental record linkage, Proceedings of the VLDB Endowment 7(9) (2014), 697–708. [214] L. Gazzarri and M. Herschel, End-to-end Task Based Parallelization for Entity Resolution on Dynamic Data, in: 2021 IEEE 37th Interna- tional Conference on Data Engineering (ICDE), IEEE, 2021, pp. 1248–1259. [215] A. Saeedi, M. Nentwig, E. Peukert and E. Rahm, Scalable matching and clustering of entities with FAMER, Complex Systems Informatics and Modeling Quarterly 16 (2018), 61–83. [216] B. Ramadan and P. Christen, Forest-Based Dynamic Sorted Neighborhood Indexing for Real-Time Entity Resolution, in: Proceedings of the 23rd ACM International Conference on Conference on Information and Knowledge Management, CIKM '14, Association for Computing Machinery, New York, NY, USA, 2014, pp. 1787–1790–. ISBN 9781450325981. doi:10.1145/2661829.2661869. [217] B. Ramadan, P. Christen, H. Liang and R.W. Gayler, Dynamic Sorted Neighborhood Indexing for Real-Time Entity Resolution, J. Data and Information Quality 6(4) (2015). doi:10.1145/2816821. [218] D. Karapiperis, A. Gkoulalas-Divanis and V.S. Verykios, Summarization Algorithms for Record Linkage., in: EDBT, 2018, pp. 73–84. [219] T. Brasileiro Araújo, K. Stefanidis, C.E. Santos Pires, J. Nummenmaa and T. Pereira da Nóbrega, Incremental blocking for entity resolution over web streaming data, in: IEEE/WIC/ACM International Conference on Web Intelligence, 2019, pp. 332–336. [220] T.B. Araújo, K. Stefanidis, C.E. Santos Pires, J. Nummenmaa and T.P. Da Nóbrega, Schema-agnostic blocking for streaming data, in: Proceedings of the 35th Annual ACM Symposium on Applied Computing, 2020, pp. 412–419. [221] O. Hassanzadeh, F. Chiang, H.C. Lee and R.J. Miller, Framework for evaluating clustering algorithms in duplicate detection, Proc. of the VLDB Endowment 2(1) (2009), 1282–1293. M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 47 [222] A. Saeedi, E. Peukert and E. Rahm, Comparative evaluation of distributed clustering schemes for multi-source entity resolution, in: European Conference on Advances in Databases and Information Systems, Springer, 2017, pp. 278–293. [223] W. M., S. A. and D. C., Fast and accurate incremental entity resolution relative to an entity knowledge base, in: CIKM, 2012. [224] J. Bleiholder and F. Naumann, Data fusion, ACM computing surveys (CSUR) 41(1) (2009), 1–41. [225] C. Bizer, C. Becker, P.N. Mendes, R. Isele, A. Matteini and A. Schultz, Ldif-a framework for large-scale linked data integration (2012). [226] P.N. Mendes, H. Mühleisen and C. Bizer, Sieve: linked data quality assessment and fusion, in: Proceedings of the 2012 joint EDBT/ICDT workshops, 2012, pp. 116–123. [227] X. Dong, L. Berti-Équille and D. Srivastava, Data Fusion: Resolving Conflicts from Multiple Sources, in: Interational Conference on Web-Age Information Management, 2013. [228] R.Y. Wang and D.M. Strong, Beyond Accuracy: What Data Quality Means to Data Consumers, J. Manage. Inf. Syst. 12(4) (1996), 5–33–. doi:10.1080/07421222.1996.11518099. [229] S. Tartir, I.B. Arpinar, M. Moore, A.P. Sheth and B. Aleman-Meza, OntoQA: Metric-based ontology quality analysis, in: IEEE ICDM Workshop on Knowledge Acquisition from Distributed, Autonomous, Semantically Heterogeneous Data and Knowledge Sources, 2005. [230] M. McDaniel and V.C. Storey, Evaluating domain ontologies: clarification, classification, and challenges, ACM Computing Surveys (CSUR) 52(4) (2019), 1–44. [231] X. Dong, X. He, A. Kan, X. Li, Y. Liang, J. Ma, Y. Xu, C. Zhang, T. Zhao, G.B. Saldana, S. Deshpande, A.M. Manduca, J. Ren, S.P. Singh, F. Xiao, H.-S. Chang, G. Karamanolakis, Y. Mao, Y. Wang, C. Faloutsos, A. McCallum and J. Han, AutoKnow: Self-Driving Knowledge Collection for Products of Thousands of Types, Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (2020). [232] R. Reinanda, Financial Knowledge Graph at Bloomberg: Applications and Challenges, Zenodo, 2021. doi:10.5281/zenodo.4903274. [233] C. Bizer and R. Cyganiak, Quality-driven information filtering using the WIQA policy framework, Journal of Web Semantics 7(1) (2009), 1–10. [234] M. Acosta, A. Zaveri, E. Simperl, D. Kontokostas, S. Auer and J. Lehmann, Crowdsourcing linked data quality assessment, in: Interna- tional semantic web conference, Springer, 2013, pp. 260–276. [235] A. Senaratne, P.G. Omran and G.J. Williams, Unsupervised Anomaly Detection in Knowledge Graphs, Proceedings of the 10th Interna- tional Joint Conference on Knowledge Graphs (2021). [236] Y. Ma, H. Gao, T. Wu and G. Qi, Learning Disjointness Axioms With Association Rule Mining and Its Application to Inconsistency Detection of Linked Data, in: China Semantic Web Symposium, 2014. [237] F. Li, X.L. Dong, A. Langen and Y. Li, Knowledge verification for long-tail verticals, Proceedings of the VLDB Endowment 10(11) (2017), 1370–1381. [238] J. Lehmann, D. Gerber, M. Morsey and A.-C. Ngonga Ngomo, Defacto-deep fact validation, in: International semantic web conference, Springer, 2012, pp. 312–327. [239] H. Chen, G. Cao, J. Chen and J. Ding, A Practical Framework for Evaluating the Quality of Knowledge Graph, in: China Conference on Knowledge Graph and Semantic Computing, 2019. [240] D. Kontokostas, A. Zaveri, S. Auer and J. Lehmann, TripleCheckMate: A Tool for Crowdsourcing the Quality Assessment of Linked Data, in: International Conference on Knowledge Engineering and the Semantic Web, 2013. [241] A. Carlson, J. Betteridge, B. Kisiel, B. Settles, E.R.H. Jr. and T.M. Mitchell, Toward an Architecture for Never-Ending Language Learning, in: Proceedings of the Twenty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2010, Atlanta, Georgia, USA, July 11-15, 2010, M. Fox and D. Poole, eds, AAAI Press, 2010. http://www.aaai.org/ocs/index.php/AAAI/AAAI10/paper/view/1879. [242] D. Kontokostas, P. Westphal, S. Auer, S. Hellmann, J. Lehmann, R. Cornelissen and A. Zaveri, Test-driven evaluation of linked data quality, Proceedings of the 23rd international conference on World wide web (2014). [243] M. Röder, D. Kuchelev and A.N. Ngomo, HOBBIT: A platform for benchmarking Big Linked Data, Data Sci. 3(1) (2020), 15–35. doi:10.3233/ds-190021. [244] S. Hertling and H. Paulheim, Gollum: A Gold Standard for Large Scale Multi Source Knowledge Graph Matching, arXiv preprint arXiv:2209.07479 (2022). [245] T. Safavi and D. Koutra, CoDEx: A Comprehensive Knowledge Graph Completion Benchmark, in: Conference on Empirical Methods in Natural Language Processing, 2020. [246] R. Angles, H. Thakkar and D. Tomaszuk, RDF and Property Graphs Interoperability: Status and Issues, in: Proceedings of the 13th Alberto Mendelzon International Workshop on Foundations of Data Management, Asunción, Paraguay, June 3-7, 2019, A. Hogan and T. Milo, eds, CEUR Workshop Proceedings, Vol. 2369, CEUR-WS.org, 2019. https://ceur-ws.org/Vol-2369/paper01.pdf. [247] H. Paulheim and C. Bizer, Type Inference on Noisy RDF Data, in: The Semantic Web - ISWC 2013 - 12th International Semantic Web Conference, Sydney, NSW, Australia, October 21-25, 2013, Proceedings, Part I, H. Alani, L. Kagal, A. Fokoue, P. Groth, C. Biemann, J.X. Parreira, L. Aroyo, N.F. Noy, C. Welty and K. Janowicz, eds, Lecture Notes in Computer Science, Vol. 8218, Springer, 2013, pp. 510– 525. doi:10.1007/978-3-642-41335-3_32. [248] H. Paulheim and C. Bizer, Improving the Quality of Linked Data Using Statistical Distributions, Int. J. Semantic Web Inf. Syst. 10(2) (2014), 63–86. doi:10.4018/ijswis.2014040104. [249] A. Lutov, S. Roshankish, M. Khayati and P. Cudré-Mauroux, StaTIX - Statistical Type Inference on Linked Data, in: IEEE International Conference on Big Data, Big Data 2018, Seattle, WA, USA, December 10-13, 2018, N. Abe, H. Liu, C. Pu, X. Hu, N.K. Ahmed, M. Qiao, Y. Song, D. Kossmann, B. Liu, K. Lee, J. Tang, J. He and J.S. Saltz, eds, IEEE, 2018, pp. 2253–2262. doi:10.1109/BigData.2018.8622285. 48 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges [250] Y. Zhao, A. Zhang, R. Xie, K. Liu and X. Wang, Connecting Embeddings for Knowledge Graph Entity Typing, in: Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Association for Computational Linguistics, Online, 2020, pp. 6419– 6428. doi:10.18653/v1/2020.acl-main.572. https://aclanthology.org/2020.acl-main.572. [251] A.P. Aprosio, C. Giuliano and A. Lavelli, Extending the Coverage of DBpedia Properties using Distant Supervision over Wikipedia., in: NLP-DBPEDIA@ ISWC, Citeseer, 2013. [252] D. Gerber, S. Hellmann, L. Bühmann, T. Soru, R. Usbeck and A.-C. Ngonga Ngomo, Real-time RDF extraction from unstructured data streams, in: International semantic web conference, Springer, 2013, pp. 135–150. [253] D. Gerber and A.-C.N. Ngomo, Bootstrapping the linked data web, in: 1st Workshop on Web Scale Knowledge Extraction@ ISWC, Vol. 2011, 2011, p. 61. [254] M. Mintz, S. Bills, R. Snow and D. Jurafsky, Distant supervision for relation extraction without labeled data, in: Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP, Association for Computational Linguistics, Suntec, Singapore, 2009, pp. 1003–1011. https://aclanthology.org/P09-1113. [255] R. West, E. Gabrilovich, K. Murphy, S. Sun, R. Gupta and D. Lin, Knowledge base completion via search-based question answering, in: 23rd International World Wide Web Conference, WWW '14, Seoul, Republic of Korea, April 7-11, 2014, C. Chung, A.Z. Broder, K. Shim and T. Suel, eds, ACM, 2014, pp. 515–526. doi:10.1145/2566486.2568032. [256] D. Lange, C. Böhm and F. Naumann, Extracting structured information from Wikipedia articles to populate infoboxes, in: Pro- ceedings of the 19th ACM Conference on Information and Knowledge Management, CIKM 2010, Toronto, Ontario, Canada, Octo- ber 26-30, 2010, J. Huang, N. Koudas, G.J.F. Jones, X. Wu, K. Collins-Thompson and A. An, eds, ACM, 2010, pp. 1661–1664. doi:10.1145/1871437.1871698. [257] C.R. Fields, Probabilistic models for segmenting and labeling sequence data, in: ICML 2001, 2001. [258] T. Blevins and L. Zettlemoyer, Moving Down the Long Tail of Word Sense Disambiguation with Gloss Informed Bi-encoders, in: Pro- ceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Association for Computational Linguistics, Online, 2020, pp. 1006–1017. doi:10.18653/v1/2020.acl-main.95. https://aclanthology.org/2020.acl-main.95. [259] E. Munoz, A. Hogan and A. Mileo, Triplifying wikipedia's tables, LD4IE@ ISWC (2013). [260] D. Ritze, O. Lehmberg and C. Bizer, Matching html tables to dbpedia, in: Proceedings of the 5th International Conference on Web Intelligence, Mining and Semantics, 2015, pp. 1–6. [261] H. Paulheim and S.P. Ponzetto, Extending DBpedia with Wikipedia List Pages., NLP-DBPEDIA@ ISWC 13 (2013). [262] A. Bordes, N. Usunier, A. García-Durán, J. Weston and O. Yakhnenko, Translating Embeddings for Modeling Multi-relational in: Advances in Neural Information Processing Systems 26: 27th Annual Conference on Neural Information Process- Data, ing Systems 2013. Proceedings of a meeting held December 5-8, 2013, Lake Tahoe, Nevada, United States, C.J.C. Burges, L. Bottou, Z. Ghahramani and K.Q. Weinberger, eds, 2013, pp. 2787–2795. https://proceedings.neurips.cc/paper/2013/hash/ 1cecc7a77928ca8133fa24680a88d2f9-Abstract.html. [263] Z. Wang, J. Zhang, J. Feng and Z. Chen, Knowledge Graph Embedding by Translating on Hyperplanes, in: Proceedings of the Twenty- Eighth AAAI Conference on Artificial Intelligence, July 27 -31, 2014, Québec City, Québec, Canada, C.E. Brodley and P. Stone, eds, AAAI Press, 2014, pp. 1112–1119. http://www.aaai.org/ocs/index.php/AAAI/AAAI14/paper/view/8531. [264] P. Kolyvakis, A. Kalousis and D. Kiritsis, HyperKG: Hyperbolic Knowledge Graph Embeddings for Knowledge Base Completion, ArXiv preprint abs/1908.04895 (2019). https://arxiv.org/abs/1908.04895. [265] M. Ali, M. Berrendorf, C.T. Hoyt, L. Vermue, M. Galkin, S. Sharifzadeh, A. Fischer, V. Tresp and J. Lehmann, Bringing Light Into the Dark: A Large-scale Evaluation of Knowledge Graph Embedding Models under a Unified Framework, IEEE Transactions on Pattern Analysis and Machine Intelligence (2021), 1–1. doi:10.1109/TPAMI.2021.3124805. [266] K.K. Teru, E.G. Denis and W.L. Hamilton, Inductive Relation Prediction by Subgraph Reasoning, in: Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, Proceedings of Machine Learning Research, Vol. 119, PMLR, 2020, pp. 9448–9457. http://proceedings.mlr.press/v119/teru20a.html. [267] M. Galkin, E. Denis, J. Wu and W.L. Hamilton, NodePiece: Compositional and Parameter-Efficient Representations of Large Knowledge Graphs, in: International Conference on Learning Representations, 2022. https://openreview.net/forum?id=xMJWUKJnFSw. [268] N. Noy, Y. Gao, A. Jain, A. Narayanan, A. Patterson and J. Taylor, Industry-scale Knowledge Graphs: Lessons and Challenges: Five diverse technology companies show how it's done, Queue 17(2) (2019), 48–75. [269] K. Bollacker, R. Cook and P. Tufts, Freebase: A shared database of structured general human knowledge, in: AAAI, Vol. 7, 2007, pp. 1962– 1963. [270] M. Hofer, S. Hellmann, M. Dojchinovski and J. Frey, The new dbpedia release cycle: Increasing agility and efficiency in knowledge extraction workflows, in: International Conference on Semantic Systems, Springer, Cham, 2020, pp. 1–18. [271] F.M. Suchanek, G. Kasneci and G. Weikum, Yago: a core of semantic knowledge, in: The Web Conference, 2007. [272] T. Pellissier Tanon, G. Weikum and F. Suchanek, Yago 4: A reason-able knowledge base, in: European Semantic Web Conference, Springer, 2020, pp. 583–596. [273] D. Vrandeˇci ́c and M. Krötzsch, Wikidata: a free collaborative knowledgebase, Communications of the ACM 57(10) (2014), 78–85. [274] M. Morsey, J. Lehmann, S. Auer, C. Stadler and S. Hellmann, Dbpedia and the live extraction of structured data from wikipedia, Program (2012). [275] G. Gawriljuk, A. Harth, C.A. Knoblock and P. Szekely, A scalable approach to incrementally building knowledge graphs, in: International Conference on Theory and Practice of Digital Libraries, Springer, 2016, pp. 188–199. [276] S. Auer, A. Oelen, M. Haris, M. Stocker, J. D'Souza, K.E. Farfar, L. Vogt, M. Prinz, V. Wiens and M.Y. Jaradeh, Improving access to scientific literature with knowledge graphs, Bibliothek Forschung und Praxis 44(3) (2020), 516–529. M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 49 [277] D. Dessì, F. Osborne, D. Reforgiato Recupero, D. Buscaldi, E. Motta and H. Sack, Ai-kg: an automatically generated knowledge graph of artificial intelligence, in: International Semantic Web Conference, Springer, 2020, pp. 127–143. [278] M. Preusse, A. Jarasch, T. Bleimehl, S. Muller, J. Munro, L. Gutebier, R. Henkel and D. Waltemath, COVIDGraph: Connecting Biomedical COVID-19 Resources and Computational Biology Models, in: Proceedings of the 2nd Workshop on Search, Exploration, and Analysis in Heterogeneous Datastores (SEA-Data 2021) co-located with 47th International Conference on Very Large Data Bases (VLDB 2021), Copenhagen, Denmark, August 20, 2021, D. Mottin, M. Lissandrini, S.B. Roy and Y. Velegrakis, eds, CEUR Workshop Proceedings, Vol. 2929, CEUR-WS.org, 2021, pp. 34–37. http://ceur-ws.org/Vol-2929/paper6.pdf. [279] V.N. Ioannidis, X. Song, S. Manchanda, M. Li, X. Pan, D. Zheng, X. Ning, X. Zeng and G. Karypis, DRKG - Drug Repurposing Knowl- edge Graph for Covid-19, 2020. [280] H. Alberts, T. Huang, Y. Deshpande, Y. Liu, K. Cho, C. Vania and I. Calixto, VisualSem: a high-quality knowledge graph for vision and language, ArXiv abs/2008.09150 (2020). [281] A. Dsouza, N. Tempelmeier, R. Yu, S. Gottschalk and E. Demidova, WorldKG: A World-Scale Geographic Knowledge Graph, Proceed- ings of the 30th ACM International Conference on Information & Knowledge Management (2021). [282] Y. Zhang, M. Sheng, R. Zhou, Y. Wang, G. Han, H. Zhang, C. Xing and J. Dong, HKGB: An Inclusive, Extensible, Intelligent, Semi- auto-constructed Knowledge Graph Framework for Healthcare with Clinicians' Expertise Incorporated, Inf. Process. Manag. 57 (2020), 102324. [283] A. Ekelhart, F.J. Ekaputra and E. Kiesling, The SLOGERT Framework for Automated Log Knowledge Graph Construction, in: ESWC, 2021. [284] M. Galkin, S. Auer, M.-E. Vidal and S. Scerri, Enterprise Knowledge Graphs: A Semantic Approach for Knowledge Management in the Next Generation of Enterprise Information Systems, in: Proceedings of the 19th International Conference on Enterprise Information Systems - Volume 2: ICEIS,, SciTePress, 2017, pp. 88–98, INSTICC. ISBN 978-989-758-248-6. doi:10.5220/0006325200880098. [285] M. Färber, The Microsoft Academic Knowledge Graph: A Linked Data Source with 8 Billion Triples of Scholarly Data, in: The Semantic Web - ISWC 2019 - 18th International Semantic Web Conference, Auckland, New Zealand, October 26-30, 2019, Proceedings, Part II, C. Ghidini, O. Hartig, M. Maleshkova, V. Svátek, I.F. Cruz, A. Hogan, J. Song, M. Lefrançois and F. Gandon, eds, Lecture Notes in Computer Science, Vol. 11779, Springer, 2019, pp. 113–129. doi:10.1007/978-3-030-30796-7_8. [286] T. Pellissier Tanon, D. Vrandeˇci ́c, S. Schaffert, T. Steiner and L. Pintscher, From freebase to wikidata: The great migration, in: Proceedings of the 25th international conference on world wide web, 2016, pp. 1419–1428. [287] A. Piscopo, L.-A. Kaffee, C. Phethean and E. Simperl, Provenance information in a collaborative knowledge graph: an evaluation of Wikidata external references, in: International semantic web conference, Springer, 2017, pp. 542–558. [288] S. Auer, C. Bizer, G. Kobilarov, J. Lehmann, R. Cyganiak and Z.G. Ives, DBpedia: A Nucleus for a Web of Open Data, in: ISWC/ASWC, 2007. [289] A. Hofmann, S. Perchani, J. Portisch, S. Hertling and H. Paulheim, DBkWik: Towards Knowledge Graph Creation from Thousands of Wikis., in: ISWC (Posters, Demos & Industry Tracks), 2017. [290] S. Hellmann, C. Stadler, J. Lehmann and S. Auer, DBpedia Live Extraction, in: OTM Conferences, 2009. [291] C. Fellbaum (ed.), WordNet An Electronic Lexical Database, The MIT Press, Cambridge, MA ; London, 1998. ISBN 978-0-262-06197-1. http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=8106. [292] A.J.G. Gray, C.A. Goble and R. Jimenez, Bioschemas: From Potato Salad to Protein Annotation, in: Proceedings of the ISWC 2017 Posters & Demonstrations and Industry Tracks co-located with 16th International Semantic Web Conference (ISWC 2017), Vienna, Austria, October 23rd - to - 25th, 2017, N. Nikitina, D. Song, A. Fokoue and P. Haase, eds, CEUR Workshop Proceedings, Vol. 1963, CEUR- WS.org, 2017. http://ceur-ws.org/Vol-1963/paper579.pdf. [293] J.M. Giménez-García, M.C. Duarte, A. Zimmermann, C. Gravier, E.R. Hruschka and P. Maret, NELL2RDF: Reading the Web, Tracking the Provenance, and Publishing it as Linked Data, in: CKGSemStats@ISWC, 2018. [294] A.A. Salatino, T. Thanapalasingam, A. Mannocci, F. Osborne and E. Motta, The Computer Science Ontology: A Large-Scale Taxonomy of Research Areas, in: The Semantic Web - ISWC 2018 - 17th International Semantic Web Conference, Monterey, CA, USA, October 8-12, 2018, Proceedings, Part II, D. Vrandecic, K. Bontcheva, M.C. Suárez-Figueroa, V. Presutti, I. Celino, M. Sabou, L. Kaffee and E. Simperl, eds, Lecture Notes in Computer Science, Vol. 11137, Springer, 2018, pp. 187–205. doi:10.1007/978-3-030-00668-6_12. [295] D. Wadden, U. Wennberg, Y. Luan and H. Hajishirzi, Entity, Relation, and Event Extraction with Contextualized Span Representations, 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 2019, Hong Kong, China, November 3-7, 2019, K. Inui, J. Jiang, V. Ng and X. Wan, eds, Association for Computational Linguistics, 2019, pp. 5783–5788. doi:10.18653/v1/D19-1585. [296] A.A. Salatino, F. Osborne, T. Thanapalasingam and E. Motta, The CSO Classifier: Ontology-Driven Detection of Research Topics in Scholarly Articles, in: Digital Libraries for Open Knowledge - 23rd International Conference on Theory and Practice of Digital Libraries, TPDL 2019, Oslo, Norway, September 9-12, 2019, Proceedings, A. Doucet, A. Isaac, K. Golub, T. Aalberg and A. Jatowt, eds, Lecture Notes in Computer Science, Vol. 11799, Springer, 2019, pp. 296–311. doi:10.1007/978-3-030-30760-8_26. [297] D. Dessì, F. Osborne, D.R. Recupero, D. Buscaldi and E. Motta, CS-KG: A Large-Scale Knowledge Graph of Research Entities and Claims in Computer Science, in: The Semantic Web - ISWC 2022 - 21st International Semantic Web Conference, Virtual Event, October 23-27, 2022, Proceedings, U. Sattler, A. Hogan, C.M. Keet, V. Presutti, J.P.A. Almeida, H. Takeda, P. Monnin, G. Pirrò and C. d'Amato, eds, Lecture Notes in Computer Science, Vol. 13489, Springer, 2022, pp. 678–696. doi:10.1007/978-3-031-19433-7_39. [298] J. Lee, W. Yoon, S. Kim, D. Kim, S. Kim, C.H. So and J. Kang, BioBERT: a pre-trained biomedical language representation model for biomedical text mining, Bioinformatics 36 (2019), 1234–1240. 50 M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges [299] K.D. Pruitt, T.A. Tatusova and D.R. Maglott, NCBI reference sequences (RefSeq): a curated non-redundant sequence database of genomes, transcripts and proteins, Nucleic Acids Res. 35(Database–Issue) (2007), 61–65. doi:10.1093/nar/gkl842. [300] B. Steenwinckel, G. Vandewiele, I. Rausch, P. Heyvaert, P. Colpaert, P. Simoens, A. Dimou, F.D. Turkc and F. Ongenae, Facilitating COVID-19 Meta-analysis Through a Literature Knowledge Graph, in: Accepted in Proc. of 19th International Semantic Web Conference (ISWC), 2020. [301] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A.C. Berg and L. Fei- Fei, ImageNet Large Scale Visual Recognition Challenge, International Journal of Computer Vision (IJCV) 115(3) (2015), 211–252. doi:10.1007/s11263-015-0816-y. [302] H. Alberts and I. Calixto, ImagiFilter: A resource to enable the semi-automatic mining of images at scale, ArXiv abs/2008.09152 (2020). [303] A. Dsouza, N. Tempelmeier and E. Demidova, Towards Neural Schema Alignment for OpenStreetMap and Knowledge Graphs, in: SEMWEB, 2021. [304] G. Demartini, D.E. Difallah and P. Cudré-Mauroux, ZenCrowd: leveraging probabilistic reasoning and crowdsourcing techniques for large-scale entity linking, in: Proceedings of the 21st World Wide Web Conference 2012, WWW 2012, Lyon, France, April 16-20, 2012, A. Mille, F. Gandon, J. Misselis, M. Rabinovich and S. Staab, eds, ACM, 2012, pp. 469–478. doi:10.1145/2187836.2187900. [305] A. Tonon, M. Catasta, R. Prokofyev, G. Demartini, K. Aberer and P. Cudré-Mauroux, Contextualized ranking of entity types based on knowledge graphs, Journal of Web Semantics 37 (2016), 170–183. [306] K. Aberer, A. Boyarsky, P. Cudré-Mauroux, G. Demartini and O. Ruchayskiy, Sciencewise: A web-based interactive semantic platform for scientific collaboration, in: 10th International Semantic Web Conference (ISWC 2011-Demo), Bonn, Germany, 2011. [307] A. Tonon, P. Cudré-Mauroux, A. Blarer, V. Lenders and B. Motik, ArmaTweet: detecting events by semantic tweet analysis, in: European Semantic Web Conference, Springer, 2017, pp. 138–153. [308] R. Mavlyutov, C. Curino, B. Asipov and P. Cudré-Mauroux, Dependency-Driven Analytics: A Compass for Uncharted Data Oceans, in: CIDR 2017, 8th Biennial Conference on Innovative Data Systems Research, Chaminade, CA, USA, January 8-11, 2017, Online Proceed- ings, www.cidrdb.org, 2017. http://cidrdb.org/cidr2017/papers/p59-mavlyutov-cidr17.pdf. [309] G. Zheng, S. Mukherjee, X. Dong and F. Li, OpenTag: Open Attribute Value Extraction from Product Profiles, Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (2018). [310] K. Kurniawan, A. Ekelhart, E. Kiesling, A. Froschl and F.J. Ekaputra, Semantic Integration and Monitoring of File System Ac- tivity, in: Proceedings of the Posters and Demo Track of the 15th International Conference on Semantic Systems co-located with 15th International Conference on Semantic Systems (SEMANTiCS 2019), Karlsruhe, Germany, September 9th - to - 12th, 2019, M. Alam, R. Usbeck, T. Pellegrini, H. Sack and Y. Sure-Vetter, eds, CEUR Workshop Proceedings, Vol. 2451, CEUR-WS.org, 2019. http://ceur-ws.org/Vol-2451/paper-17.pdf. [311] J. Volz, C. Bizer, M. Gaedke and G. Kobilarov, Silk - A Link Discovery Framework for the Web of Data, in: Proceedings of the WWW2009 Workshop on Linked Data on the Web, LDOW 2009, Madrid, Spain, April 20, 2009, C. Bizer, T. Heath, T. Berners-Lee and K. Idehen, eds, CEUR Workshop Proceedings, Vol. 538, CEUR-WS.org, 2009. http://ceur-ws.org/Vol-538/ldow2009_paper13.pdf. [312] X. Pan, D.S. Papailiopoulos, S. Oymak, B. Recht, K. Ramchandran and M.I. Jordan, Parallel Correlation Clustering on Big Graphs, in: Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, C. Cortes, N.D. Lawrence, D.D. Lee, M. Sugiyama and R. Garnett, eds, 2015, pp. 82–90. https: //proceedings.neurips.cc/paper/2015/hash/b53b3a3d6ab90ce0268229151c9bde11-Abstract.html. [313] P. Bhattarai, M. Ghassemi and T. Alhanai, Open-Source Code Repository Attributes Predict Impact of Computer Science Research, in: Proceedings of the 22nd ACM/IEEE Joint Conference on Digital Libraries, JCDL '22, Association for Computing Machinery, New York, NY, USA, 2022. ISBN 9781450393454. doi:10.1145/3529372.3530927. [314] M. Mahdavi, F. Neutatz, L. Visengeriyeva and Z. Abedjan, Towards automated data cleaning workflows, Machine Learning 15 (2019), 16. [315] X. Zhao, Y. Jia, A. Li, R. Jiang and Y. Song, Multi-source knowledge fusion: a survey, World Wide Web 23(4) (2020), 2567–2592. doi:10.1007/s11280-020-00811-0. [316] K. Shenoy, F. Ilievski, D. Garijo, D. Schwabe and P.A. Szekely, A study of the quality of Wikidata, J. Web Semant. 72 (2022), 100679. doi:10.1016/j.websem.2021.100679. [317] A.G. Nuzzolese, A.L. Gentile, V. Presutti, A. Gangemi, D. Garigliotti and R. Navigli, Open Knowledge Extraction Challenge, in: SemWe- bEval@ESWC, 2015. [318] J.M. Rodríguez, H.D. Merlino, P. Pesado and R. García-Martínez, Performance Evaluation of Knowledge Extraction Methods, in: Inter- national Conference on Industrial, Engineering and Other Applications of Applied Intelligent Systems, 2016. [319] Y. Zhang, V. Zhong, D. Chen, G. Angeli and C.D. Manning, Position-aware Attention and Supervised Data Improve Slot Filling, in: Conference on Empirical Methods in Natural Language Processing, 2017. [320] J. Euzenat, C. Meilicke, H. Stuckenschmidt, P. Shvaiko and C.T. dos Santos, Ontology Alignment Evaluation Initiative: Six Years of Experience, J. Data Semant. 15 (2011), 158–192. [321] H. Köpcke, A. Thor and E. Rahm, Evaluation of entity resolution approaches on real-world match problems, Proc. VLDB Endow. 3(1) (2010), 484–493. doi:10.14778/1920841.1920904. http://www.vldb.org/pvldb/vldb2010/pvldb_vol3/E04.pdf. [322] M. Galkin, M. Berrendorf and C.T. Hoyt, An Open Challenge for Inductive Link Prediction on Knowledge Graphs, CoRR abs/2203.01520 (2022). doi:10.48550/arXiv.2203.01520. [323] T. Safavi and D. Koutra, CoDEx: A Comprehensive Knowledge Graph Completion Benchmark, in: Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, B. Webber, T. Cohn, Y. He and Y. Liu, eds, Association for Computational Linguistics, 2020, pp. 8328–8350. doi:10.18653/v1/2020.emnlp-main.669. M. Hofer et al. / Construction of Knowledge Graphs: State and Challenges 51 [324] W. Hu, M. Fey, H. Ren, M. Nakata, Y. Dong and J. Leskovec, OGB-LSC: A Large-Scale Challenge for Machine Learning on Graphs, in: Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, December 2021, virtual, J. Vanschoren and S. Yeung, eds, 2021. https://datasets-benchmarks-proceedings.neurips.cc/paper/2021/ hash/db8e1af0cb3aca1ae2d0018624204529-Abstract-round2.html. [325] J. Portisch, M. Hladik and H. Paulheim, Background knowledge in ontology matching: A survey, Semantic Web (2022). [326] I.L. Oliveira, R. Fileto, R. Speck, L.P.F. Garcia, D. Moussallem and J. Lehmann, Towards holistic Entity Linking: Survey and directions, Information Systems 95 (2021), 101624. doi:https://doi.org/10.1016/j.is.2020.101624. https://www.sciencedirect.com/science/article/pii/ S0306437920300958. [327] G. Tamašauskait ̇e and P. Groth, Defining a Knowledge Graph Development Process Through a Systematic Review, ACM Transactions on Software Engineering and Methodology (2022). [328] U. Simsek, K. Angele, E. Kärle, J. Opdenplatz, D. Sommer, J. Umbrich and D. Fensel, Knowledge Graph Lifecycle: Building and maintaining Knowledge Graphs, in: Second International Workshop on Knowledge Graph Construction, 2021. https://openreview.net/ forum?id=GumxKk-3fV-.
http://arxiv.org/abs/2302.11508v1
2023-02-22T17:26:01
2023-02-22T17:26:01
nSimplex Zen: A Novel Dimensionality Reduction for Euclidean and Hilbert Spaces
Dimensionality reduction techniques map values from a high dimensional space to one with a lower dimension. The result is a space which requires less physical memory and has a faster distance calculation. These techniques are widely used where required properties of the reduced-dimension space give an acceptable accuracy with respect to the original space. Many such transforms have been described. They have been classified in two main groups: linear and topological. Linear methods such as Principal Component Analysis (PCA) and Random Projection (RP) define matrix-based transforms into a lower dimension of Euclidean space. Topological methods such as Multidimensional Scaling (MDS) attempt to preserve higher-level aspects such as the nearest-neighbour relation, and some may be applied to non-Euclidean spaces. Here, we introduce nSimplex Zen, a novel topological method of reducing dimensionality. Like MDS, it relies only upon pairwise distances measured in the original space. The use of distances, rather than coordinates, allows the technique to be applied to both Euclidean and other Hilbert spaces, including those governed by Cosine, Jensen-Shannon and Quadratic Form distances. We show that in almost all cases, due to geometric properties of high-dimensional spaces, our new technique gives better properties than others, especially with reduction to very low dimensions.
[ "Richard Connor", "Lucia Vadicamo" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11508v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11508v1", "@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.LG" ]
nSimplex Zen: A NOVEL DIMENSIONALITY REDUCTION FOR EUCLIDEAN AND HILBERT SPACES 3 2 0 2 b e F 2 2 ] R I . s c [ 1 v 8 0 5 1 1 . 2 0 3 2 : v i X r a Richard Connor University of St Andrews North Haugh, St Andrews, Fife, Scotland, UK [email protected] Lucia Vadicamo ISTI-CNR Via G. Moruzzi 1, Pisa, Italy [email protected] February 23, 2023 ABSTRACT Dimensionality reduction techniques map values from a high dimensional space to one with a lower dimension. The result is a space which requires less physical memory and has a faster distance calculation. These techniques are widely used where required properties of the reduced-dimension space give an acceptable accuracy with respect to the original space. Many such transforms have been described. They have been classified in two main groups: linear and topological. Linear methods such as Principal Component Analysis (PCA) and Random Projec- tion (RP) define matrix-based transforms into a lower dimension of Euclidean space. Topological methods such as Multidimensional Scaling (MDS) attempt to preserve higher-level aspects such as the nearest-neighbour relation, and some may be applied to non-Euclidean spaces. Here, we introduce nSimplex Zen, a novel topological method of reducing dimensionality. Like MDS, it relies only upon pairwise distances measured in the original space. The use of distances, rather than coordinates, allows the technique to be applied to both Euclidean and other Hilbert spaces, including those governed by Cosine, Jensen-Shannon and Quadratic Form distances. We show that in almost all cases, due to geometric properties of high-dimensional spaces, our new technique gives better properties than others, especially with reduction to very low dimensions. Keywords Dimensionality Reduction * Metric Spaces * Euclidean Space * Hilbert space * Metric Embedding * n-point property * Information retrieval 1 Introduction The requirement to work with large, high-dimensional metric spaces is a long-standing and increasingly important requirement across many domains of computation. Typically, each element of such a space represents some real- world artefact, and the distance between elements gives a proxy (dis-)similarity function over the real-world domain. As technology progresses, both the dimension of spaces and the size of collections tend to increase. These factors increasingly imply that apparently simple calculations, for example to find a few of the most similar elements within a large set, may become intractable. While sub-linear search times may in some cases be achieved using metric indexing techniques [43, 10], these also become ineffective in high dimensions and it has been shown that even approximate search complexity often degrades to linear as dimensionality increases [36]. In the domain of image search for example, a collection of a million images would no longer be considered large, and using modern techniques the dimension of the space used to represent them is likely to be several thousand. In this case an exhaustive search to find the image in the collection which is most similar to another will require upward of 109 numeric comparisons, with 10GBytes of data passing through main memory. If we consider that the YFCC benchmark image set [39] contains 1010 images, and the size of a representation derived from GoogleNet [38] has around 200, 000 dimensions, clearly any such computation is well beyond the scope of most computational contexts. A PREPRINT - FEBRUARY 23, 2023 The purpose of dimensionality reduction is to reduce the dimension of the space, maintaining as far as possible the relative distances. This not only implies that less space is required in memory for the dataset, but also gives a faster distance computation. There are a number of well-known approaches to dimensionality reduction. The Johnson-Lindenstrauss lemma shows a surprisingly small lower bound on the degree of distortion which is necessarily introduced when reducing a high- dimensional Euclidean space to a lower dimension. This bound may be achievable by using a random projection (RP) into the lower dimension, and if the domain is perfectly uniformly distributed then this may be the best technique that is achievable. However much data is implicitly non-uniform, for example data deriving from a Convolutional Neural Network (CNN) typically lies on some complex manifold within the representational space [7]. In these cases non-random transforms, which take advantage of non-uniformities within the data, can achieve better results. Dimensionality reduction mechanisms are often classified in two main groups. Linear transforms, such as Principal Component Analysis (PCA), apply only to Euclidean spaces and perform a matrix-based transform derived from properties of the whole space, with the primary goal of preserving pairwise distances as far as possible. Topological transforms, such as Multidimensional Scaling (MDS), use the individual pairwise distances of the original space in an attempt to preserve higher-level relationships, such as the pairwise ordering of distances or the nearest-neighbour relation. Topological methods may be applicable to non-vector spaces, or even non-metric spaces with an appropriate dissimilarity function. In this article we introduce a new mechanism, which has interestingly different properties, and which can be applied to Euclidean and, more generally, to any space that is isometrically embeddable in Hilbert space. It is primarily a distance-preservation mechanism, and uses properties of high-dimensional Euclidean geometry which have not been previously applied in this domain to preserve distances in the reduced-dimension space. 1.1 Outline of some Dimensionality Reduction mechanisms We refer to the novel Dimensionality Reduction (DR) transform introduced here as nSimplex Zen. In this section, by way of motivation, we briefly contrast it with the three other best-known DR transform techniques. More detail of the other transforms is given in Section 3, and a full definition of nSimplex Zen in Section 4. In all cases we consider transforming a given space of n elements, with a dimensionality1 of m, into a Euclidean space with n elements and k dimensions, where k < m. Random Projection (RP) is applicable only to an m-dimensional Euclidean space, where m > k. A randomised, or- thonormal matrix of m×k dimensions is generated, and the n×m matrix representing the data is transformed by matrix multiplication to an n × k matrix representing the reduced dimensional space. Principal Component Analysis (PCA) is also applicable only to an m-dimensional Euclidean space. A matrix of m × m dimensions representing the principal components is generated from the original space, and the n × m matrix representing the data is transformed by matrix multiplication with the most significant k columns of this matrix to yield the reduced dimensional space. Multidimensional Scaling (MDS) is applicable to any metric or semi-metric space, and considers only the distances among the n elements of the input space. An n × n (upper triangular) matrix of pairwise distances is taken as input, and the output is an n × k matrix, representing a Euclidean space which preserves pairwise distances as far as possible. MDS does not scale well, but an adaptation can be applied to large Euclidean spaces. A variant of MDS, Landmark MDS, can be applied to general metric spaces. nSimplex Zen is applicable to any metric space which is isometrically embeddable in Hilbert space2. It takes as input a reference set R comprising k elements of the input space. A simplex in (k − 1) Euclidean dimensions is constructed using the pairwise distances measured within this set. With reference to this structure, each further element of the input space is then mapped to a k-dimensional Cartesian coordinate according to its distances from each element of R. nSimplex in its simplest form is a mapping from (U, d) to (Rk, (cid:96)2), where k is the size of the reference set R. This can be used in its own right as a DR technique. There are however two further functions which can be applied to the Rk space resulting from the mapping: Zen and Upb, which are defined in Section 4. There are thus three different spaces 1the term dimensionality can be usefully applied to Hilbert spaces, see note in Section 3 2This includes any Euclidean space, and also metric spaces governed by appropriate variants of Cosine, Jensen-Shannon, Quadratic Form, and Triangular distances (see [11] and Appendix A for details.) 2 A PREPRINT - FEBRUARY 23, 2023 which may be formed as a result of the projection. nSimplex Zen refers to the mapping from (U, d) to (Rk, Zen) and is the main object of our attention. In contrast with the other techniques, calculation of the nSimplex transform does not require any operations over matrices. Instead, it relies upon higher-level geometric properties of the original metric space, which are reflected within the generated k-dimensional space. 1.2 Relation to previous work The ideas underlying nSimplex Zen have emerged after several years of research in the intersection between similarity search and distance geometry, in particular with respect to work done in the early 20th Century by, among others, Blumenthal, Hilbert, Menger, and Wilson, which we summarise in Section 2.1. In [11] we showed how the four-point property possessed by some metric spaces3 could be used to improve many metric search techniques, and in [13, 12] it was shown that this observation could be applied in practice to a number of state-of-the-art metric indexing techniques. We extended this work in [14] after making the observation that the major four-point spaces we had identified (Jensen-Shannon, Quadratic Form, Cosine, Triangular) also possessed the n-point property, and that the distance lower-bound we had identified for four-point spaces in the 2D projection applied more generally in higher dimensions. During this work we also identified the algorithm for constructing the simplex as given here in Appendix B, and the proof given in Appendix C that the Lwb function given in Section 4 is a lower bound of the distance in the domain of the nSimplex transform4. In [17] we noted the application of the Zen function introduced in Section 4 is a better estimator of true distance than the Lwb function described in [14] in the domain of string similarity functions. Moreover, in [40] the Zen function has been exploited on other domains (image features and word embeddings) to effectively refine candidate results obtained using a permutation-based k-NN search without accessing the original data. We subsequently observed the very non-uniform pattern of angles measured within the simplexes thus formed from high-dimensional spaces. This angular distribution was separately examined and published in [18]. The main contribution of this article is the full exposition and analysis of the Zen function of the nSimplex construction as a general dimensionality reduction technique for Euclidean and other Hilbert spaces, all of which content is entirely novel. The rest of the article is structured as follows. Section 2 gives an overview of the necessary mathematical background required to understand the mechanism and motivation of the nSimplex Zen transform. Section 3 gives background on dimensionality reduction, and outlines the four mechanisms with which we compare nSimplex Zen . Section 4 gives a detailed account of the nSimplex transform, and its three related functions: Zen, Lwb and Upb . Section 5 gives experimental results comparing the quality of the reductions given by nSimplex Zen with the transforms introduced in Section 3, and Section 6 compares the run-time performance of the various mechanisms. Finally, Section 7 gives a discussion of the nSimplex Zen mechanism and its results, and concludes with some possible future work. Table 1 summarises notations used throughout this work. 2 Background: metric spaces and their properties The novel nSimplex mechanism is described fully in Section 4. Before it can be understood in detail a significant amount of mathematical background is required, and provided in this section. Section 2.1 gives some mathematical preliminaries, and Section 2.2 gives some more specific background in high-dimensional geometry. Section 3 gives a general background to dimensionality reduction. 2.1 Metric spaces, embeddings and simplexes Our work relies on the ability to construct a simplex in a k-dimensional Euclidean space, whose edge lengths cor- respond to the distances among any (k + 1) objects selected from any metric space which is (k + 1)-isometrically embeddable in a Hilbert space. These underlying concepts are briefly explained in this subsection. 3see Section 2.1.2 for a description of this and the n-point property 4In fact these were not included in the published version due to space limitations, but were given in an adjunct arXiv publication [19] 3 A PREPRINT - FEBRUARY 23, 2023 Table 1: Table of notations used The cardinality of both domain and range of a DR transform The dimension of a Euclidean space which is the domain of a DR transform The dimension of a Euclidean space which is the co-domain of a DR transform A metric space with domain U and distance function d A (typically large) finite subspace of U, S ⊂ U A (typically small) set of reference objects drawn from S Individual objects drawn from U Individual objects drawn from S Individual reference objects drawn from R A DR transform mapping some (U, d) to (U (cid:48), ζ) An nSimplex transform based on k reference objects, σ : U → Rk The Euclidean distance function Notation Meaning n m k (U, d) (S, d) R u, ui s, si r, ri τ σ (cid:96)2, (cid:96)m 2 (Rm, (cid:96)2) A Euclidean space of m dimensions δij ζij The distance d(i, j) where i, j ∈ (S, d) The corresponding distance ζ(i, j) for corresponding i, j ∈ (S (cid:48), ζ), where S (cid:48) = τ (S) 2.1.1 Metric and Semimetric Spaces Let (U, d) be a pair comprising a domain of objects U and a numeric dissimilarity function d : U × U → R. In general the more similar the objects x, y ∈ U, the smaller the value of d(x, y). For a space to be semimetric, it requires d to be positive or zero, with d(x, y) = 0 if and only if x = y, and symmetric, i.e. d(x, y) = d(y, x). A (proper) metric space, governed by a (proper) distance function, also possesses the triangle inequality property, i.e. d(x, z) ≤ d(x, y) + d(y, z). For the rest of this article, we use the terms distance and metric space to refer to functions and spaces with these properties. 2.1.2 Metric Spaces and Isometric Embeddings For metric spaces (U, d) and (U (cid:48), ζ) we say that U is isometrically embeddable in U (cid:48) if there exists a function f : U → U (cid:48) such that ζ(f (x), f (y)) = d(x, y) for all x, y ∈ U. A finite isometric embedding is defined when such a function exists for a finite subset of U. A finite isometric embedding may be generalised to any fixed size of subset; for example, we state that (U, d) is finitely n-embeddable in (U (cid:48), ζ) where such a function exists for any subset of n values selected from U. These concepts give rise to an alternative definition of a metric space. Normally, a metric space is defined as a semi- metric space which has the triangle inequality property. Alternatively, a metric space may be defined as a semimetric space which is finitely 3-embeddable in 2D Euclidean space, this being an equivalent property. Finite isometric embeddings are summarised by Blumenthal [6]. He defines the four-point property to refer to any space that is finitely 4-embeddable in 3-dimensional Euclidean space. Wilson [42] shows various properties of such spaces, and Blumenthal points out that results given by Wilson, when combined with work by Menger [32], generalise to show that some spaces with the four-point property also have the n-point property: that is, for any n, they are finitely n-embeddable in (n − 1)-dimensional Euclidean space. In a later work, Blumenthal [5] shows that any space which is isometrically embeddable in a Hilbert space has the n-point property. This is a generalisation of the better-known result that any n points from a Euclidean space of any dimension may be isometrically embedded in (n − 1)-dimensional Euclidean space, and is the main abstract result we rely upon here. 2.1.3 Hilbert Spaces A Hilbert space is a real or complex inner product space that is also a complete metric space with respect to the distance function induced by the inner product. Hilbert spaces possess inner product and distance functions with properties analogous to, but not necessarily the same as, the dot product and distance functions of a Euclidean space. A Hilbert space is a generalisation of a Euclidean space, allowing the study of vector spaces which do not necessarily have finite coordinate systems. Hilbert spaces have always been important in the study of abstract geometry. All Euclidean vector spaces are Hilbert spaces; in more recent years however, many further useful spaces have been identified as being isometrically embeddable in Hilbert space. These include spaces governed by the Jensen-Shannon, 4 A PREPRINT - FEBRUARY 23, 2023 Quadratic Form, Triangular, and Cosine5 distances. These spaces do not have Euclidean coordinates, and so cannot be manipulated via matrix arithmetic, but can be used as the domain of the transform we propose here as they inherit the n-point property of a Hilbert space. 2.1.4 Construction of a simplex A simplex is the generalisation of a triangle or a tetrahedron in arbitrary dimensions of Euclidean space. In one dimension, a simplex is a line segment. In two dimensions it is a triangle, while in three dimensions it is a tetrahedron. In general, a point v1 forms a 0-simplex, and the n-simplex of vertices v1, . . . , vn+1 is given by the union of the simplex formed from v1, . . . , vn with the line segments joining vn+1 to all vertices of that simplex. The property that a Hilbert space (U, d) is finitely (n + 1)-embeddable in n-dimensional Euclidean space directly implies that, for any (n + 1) objects in U, it is possible to construct a simplex with (n + 1) vertices in Rn, where each vertex corresponds to an object in U, and the edges joining all pairs of adjacent vertices correspond with the distances between the corresponding objects in U. In Appendix B we show an algorithm for determining Cartesian coordinates for the vertices of a simplex, given only the distances between all pairs of points. The algorithm is inductive, at each stage allowing the apex of an n-dimensional simplex to be determined given the coordinates of an (n − 1)-dimensional simplex, and the distances from the new apex to each vertex in the existing simplex. The outcome of this algorithm represents a simplex in n-dimensional space as a lower triangular n + 1 by n matrix representing the Cartesian coordinates of each vertex. For example, the rows of the following matrix represent the coordinates vi,j of four vertices v1, . . . , v4 of a tetrahedron in 3D space:    0 v2,1 v3,1 v4,1 0 0 v3,2 v4,2    0 0 0 v4,3 (1) This matrix is derived from four objects o1, . . . , o4 in the Hilbert space, and the distances d(oi, oj) are the same as the distances (cid:96)2(vi, vj) where vi and vj are vectors given by the i-th and j-th rows of the matrix, respectively. For all such sets of objects, the invariant that vi,j = 0 whenever j ≥ i can be maintained without loss of generality. For any simplex constructed, this can be achieved by rotation and translation within the Euclidean space while maintaining the distances among all the vertices. Furthermore, if we restrict vi,j ≥ 0 whenever j = i − 1 then in each row this component represents the altitude of the point vi with respect to a base simplex formed by {v1, . . . , vi−1}, which is represented by the matrix derived by selecting elements above and to the left of the entry vi,j. Finally, we note that as long as the entry vi,j is non-zero, i.e. represents a non-zero altitude above the base simplex defined by rows 1 to i − 1, then the set of vectors defined by the rows forms a basis for the n-dimensional space in which it is constructed. In this way, the process of forming the simplex gives an interesting comparison to the Gram-Schmidt method for forming a basis in a Euclidean space, but the simplex formation method does not require access to a coordinate space defining the original metric space, and can thus be applied to any metric space which is isometrically embeddable in a Hilbert space. 2.2 Angles in High-Dimensional Metric Spaces In Section 4.3 we rely upon a property on the distribution of angles in high-dimensional Euclidean space that is described in this section. While the property itself is relatively straightforward, its derivation from high-dimensional Euclidean geometry is less so, and we therefore give a short justification. In the context of a uniformly distributed Euclidean space of n dimensions, we are interested in the distribution of angles formed by a hyperplane H and a object c on a hypersphere6 centred on a point b ∈ H. Without loss of generality this distribution can be measured as the angle between three points a, b, and c, where objects a and b are fixed in H, and c is sampled within a fixed radius r from b. The considered situation can be easily depicted in 2D (i.e., considering the plane through these three points) in Figure 1a. Given this arrangement, we wish to understand the distribution of the angle θ ∈ [0, π], that is the angle formed by the three points. 5in one particular form, see Appendix A for details of this and other metrics. 6A hyperspheres in Rn is a n − 1-sphere. Note the possibly confusing conventions in the naming of n-spheres and n-balls: in general, the surface of an n-ball is denoted as an (n − 1)-sphere. For example, the volume contained by a sphere in 3D space is a 3-ball, whereas its surface is a 2-sphere. 5 A PREPRINT - FEBRUARY 23, 2023 r θ b c (a) a −r c θ θ b a r t (b) (c) Figure 1: In n dimensions, for fixed a and b within a given plane, c is sampled from within the same plane at a fixed radius r from b. As the dimensionality of the space increases, the probability of θ being close to π/2 increases rapidly: the right-hand plot shows probability density functions for various dimensions as t = r cos θ varies between −r and r. In a high-dimensional vector space it is generally known that two randomly selected vectors are very likely to be close to orthogonal [4], and it is therefore no surprise that the value of θ is likely to be close to π/2. In fact this is the only result required for the understanding of Section 4.3, however further explanation is reasonably required. In [18] we quantified the distribution of this angle and we observed that as the dimension of the space n increases so too does the probability of θ being close to π/2. In particular we observed that • the total volume Vn of a n-ball with radius r is Vn = rnUn−1 unit (n-1)-ball; (cid:82) π 0 sinn ψdψ, where Un−1 is the volume of a • the volume Vn(θ) of the portion of the n-ball delimited by the hyperplane through c and orthogonal to the portion delimited by θ and denoted by the green-shaded area in Figure 1b) is proportional to H (i.e. rn (cid:82) θ 0 sinn ψdψ. Actually, here we are interested in the "surface" of the portion of the n-ball delimited by θ, rather than its volume. However such regions are strongly related geometrically; in fact in general the surface of an n-ball, i.e. an (n − 1)- sphere, has a volume in (n − 1) dimensions. The angular distribution of volume in an n-sphere is identical to that in an (n − 1)-ball [41], therefore the PDF for the distribution of points on an (n − 1)-sphere is given by a normalisation of the same formula. While the formula to computes the volume is difficult to quantify, requiring the integration of high powers of the sine function, it has also been observed that for high values of n the function is numerically almost indistinguishable from the normal distribution function given by setting μ = π/2 and σ = 1/(cid:112)(n) [9, 1], for which integral values are highly accessible. Figure 1c quantifies this volume as PDFs for various dimensions n. It can be observed that as n increases the distribution of t concentrates around the mean value 0, so the distribution of the angle θ concentrates around π/2. This theoretical model can be verified by experiment in unbounded Euclidean spaces. As usual, there are various factors in real-world spaces (in particular boundedness and non-uniformity) which affect the observed distribution of angles, but the theoretical effect is still highly visible; a deeper analysis is given in [18]. In Section 5 we analyse Euclidean spaces drawn from examples in 100 to 4,096 dimensions, in which the effect is very evident. 3 Related work: dimensionality reduction In simple terms, dimensionality reduction refers to the transformation of a set of values in dimension m to a set of values in dimension k, where k < m. Associated with such a transformation is a controlled loss of information within the reduced-dimension space. The notion of dimensionality in general metric spaces is itself complex, and indeed the establishment of a generally agreed definition of intrinsic dimensionality is an ongoing research issue. In Euclidean spaces dimensionality can be 6 A PREPRINT - FEBRUARY 23, 2023 understood as the minimum value of m for which an isometric embedding in an (Rm, (cid:96)2) space can be defined. For example, a set of points on a plane can be defined in a 3-dimensional space, but the intrinsic dimensionality of this set is 2. Mechanisms such as PCA and MDS can be used to detect the value of intrinsic dimensionality in a Euclidean space. In general, metric spaces cannot be isometrically embedded in Euclidean space and so this definition cannot be used. The concept of dimensionality is important in non-vector spaces, and can be defined upon properties such as the distribution of distances among objects of the space, as shown for example in [10]. In this article we refer to "dimensionality reduction" transforms which map from metric spaces to Euclidean spaces of a lower dimensionality, in these cases we implicitly rely upon such definitions of dimensionality. Dimensionality reduction techniques are usually classified into two groups: linear and topological. Linear mechanisms are concerned with preserving the accuracy of simple distances, while topological mechanisms are concerned with the preservation of higher-level properties, for example relative rather than absolute distances. In all cases, the main purpose is to reduce the cost of distance comparisons, by reducing both the size of the data and the cost of the distance measurement. In most contexts, we are interested in applying such transforms to a finite metric space (S, d) which is a (typically very large) subset of an infinite space (U, d). For example in metric search, the task is to find, from the subset S, values which are similar to a query value q ∈ S, where typically q /∈ S. This causes us to reconsider the general notion of dimensionality reduction. Rather than a transform which maps some finite space (S, d) to another space (S (cid:48), ζ), where (S, d) is a finite subset of some infinite space (U, d), we require a more general transform τ : (U, d) → (U (cid:48), ζ) which can map individual elements of U to U (cid:48). This is important for two reasons. First, any analytic technique that analyses the entire finite domain S in order to map to a new one will be intractable for very large finite domains. Second, such a technique would not allow the mapping of a query value q where q ∈ U but q /∈ S. We make this distinction as classical definitions of techniques such as MDS assume analysis of the entire finite domain. In this section, as well as giving outline descriptions of these techniques, we also show how they can be applied in this more general context. There are many dimensionality reduction techniques, many of which have been developed for specific contexts. Here we introduce three general mechanisms most relevant to our context, which we believe are the mechanisms in most common use. 3.1 Random Projection According to the Johnson-Lindenstrauss Flattening Lemma (see e.g. [31, page 358]), a random projection can be used to transform a finite set of n Euclidean vectors into a k-dimensional Euclidean space (k < n) with a "small" distortion. Specifically the Lemma asserts that for any n points of the space (Rm, (cid:96)2), and for every 0 < (cid:15) < 1, there is a mapping into (Rk, (cid:96)2) that preserves all the pairwise distances within a factor of 1 + (cid:15), where k = O((cid:15)−2 log n). Note that this lemma depends on the size, and not the dimensionality, of the domain. The low dimensional projection anticipated by the Johnson-Lindenstrauss lemma is particularly simple to implement. Specifically, for a Euclidean space represented by an n × m matrix, a suitable transform into k dimensions can be achieved through a randomly generated m × k orthonormal matrix. Practically, there are even better ways of achieving the projection. Achlioptas [2] shows that equally good results can usually be achieved with a much cheaper transform, by creating a m × k pseudo-orthogonal matrix with, for example, the randomised strategy: Ri,j = √ 3 ×    +1 0 −1 with probability 1/6 with probability 2/3 with probability 1/6 (2) This greatly improves the efficiency of the projection, as it introduces many zeros into the projection matrix, and allows integer arithmetic to be used instead of floating point. Further, the strategy has been shown to give better outcomes in some circumstances than a truly orthonormal matrix. We use this strategy in our comparative experiments in Section 5. It is self-evident that, for Euclidean data which is uniformly distributed, a random projection is no worse than any other linear technique. However, much real-world data is not uniformly distributed, often in ways that are difficult to predict or analyse, in which case other techniques typically perform better. 3.2 Principal Component Analysis PCA is probably the best known and most widely used unsupervised dimensionality reduction technique, and has been used also for feature extraction and data visualisation. The main idea is to find a linear transformation of m- dimensional vectors to k-dimensional vectors (k < m) that best preserves the variance of the input data. Specifically, 7 A PREPRINT - FEBRUARY 23, 2023 PCA determines the principal components of the data, which are those directions within the vector space showing maximum variance. The first such direction is found, and represented by a unit vector; then, the second direction is found within the (m − 1)-dimensional subspace orthogonal to this unit vector, and so on until a set of m orthonormal vectors is established. These vectors are represented in an m-dimensional square matrix whose columns correspond to the unit vectors established by this process (i.e., the so-called principal components). If the intrinsic dimensionality of the data is less than m, then the last steps of the process will discover a variance of 0 in all directions and the unit vectors derived become arbitrary. The principal components can be computed by solving a maximisation problem. However, it has been shown that the principal components are the eigenvectors of the covariance matrix of the centred input data. Thus typically they are computed by using spectral analysis via Singular Value Decomposition of the data rather then solving the optimisation problem, which is more expensive. The eigenvalues λ1, . . . , λm give the variances of their respective principal components. Moreover, the ratio i=1 λi j=1 λj represents the proportion of the total variance in the original data set accounted for by the first k principal components. (3) (cid:80)k (cid:80)m The dimensionality reduction transform itself is achieved by multiplication of the matrix representing the domain by the first k columns of the principal component matrix. If the value given by Equation 3 is large, then the loss of accuracy in distances measured in the projected space will be correspondingly small. While PCA is defined as the orthogonal projection of the data onto a lower dimensional linear subspace, such that the variance of the projected data is maximised, there also exists an equivalent definition of PCA that gives rise to the same algorithm. In the latter, the PCA is defined as the linear projection that minimises the average projection cost, defined as the mean squared distance between the data points and their projections [22]. This property implies that PCA is the best strategy for dimensionality reduction in a Euclidean space, where the goal is to minimise the introduced inaccuracy of arbitrary distance measurements. For a very large data set, the cost of calculating the principal components using the entire set is likely to be intractable. However this cost may be avoided by using a representative sample of the data to generate the principal components. As the projection to construct the reduced-dimension set comprises multiplication of the n × m data matrix by the m×k principal component matrix, principal components derived from a representative subset can be used to transform the remainder of the data. 3.3 Multidimensional Scaling MDS [20] is a technique which analyses the pairwise distances within a finite semimetric space (S, d) and, given a target dimension k, generates a k-dimensional Euclidean space which preserves topological features of these distances as far as possible. There are two main variants of MDS, so-called "classic" (metric) and non-metric. Here we consider the "non-metric" version as this may be applied to spaces not governed by teh Euclidean distance and can thus be compared with the nSimplex technique. MDS iteratively constructs Euclidean vectors, using a gradient descent technique, in order to minimise a stress formula. In the non-metric variant, this is typically Kruskal's (see Section E.1) stress1 definition: (cid:115) (cid:80) SK = i<j(ζij − d∗ i<j ζ 2 ij ij)2 (cid:80) In this formula, i and j are indices over the data objects in S, ζij = ζ(τ (si), τ (sj) is the Euclidean distance measured in the reduced space, and d∗ ij = d∗(si, sj) is a function generated by an isotonic regression over the true distances d(si, sj) as a function of the reduced distances ζij. Stress is therefore affected not by the absolute difference between distances in the two spaces, but instead according to the relative ordering of distances between them: if this is preserved, then the measured stress will be lower. MDS is an expensive (O(n4)) algorithm to compute, significantly limiting the size of data to which it can be applied. It has the further disadvantage that as the analysis is over a given finite set of distances among objects, it cannot therefore produce a transform which may be applied to other non-manifest elements of the same domain. This would imply that a representative sample cannot be used to construct a transform which can subsequently be applied to a very large domain, and also that a query from the same universal domain cannot be subsequently transformed into the generated k-dimensional space. (4) 8 A PREPRINT - FEBRUARY 23, 2023 In fact it may be possible to generate such a transform when MDS is applied to an m-dimensional Euclidean space, using Procrustes analysis and a pseudo-inverse matrix operator, as follows. First, a representative set of l objects is selected from the n objects of the domain, and the l × l distance matrix is generated. MDS takes this as input and an l × k matrix is produced to represent the k-dimensional space representing those objects. Procrustes analysis can then be used to produce a transform from this space back to a best fit within the original m-dimensional space. Although in general this transform is represented by a non-square matrix, and therefore is not guaranteed to have an inverse, a pseudo-inverse technique can be used to successfully construct the inverse transform. This can therefore be subsequently applied to other samples from the same original space. We use this technique in Section 5 to compare MDS as a dimensionality reduction technique for large Euclidean spaces. 3.4 Landmark Multidimensional Scaling Landmark MDS (LMDS) [37] is a technique which allows MDS to be used for the generation of a general transform over metric spaces, using a triangulation technique. A representative set of landmark values L is selected from the domain U, and classical MDS is applied in order to transform the (typically) non-Euclidean space L to a k-dimensional Euclidean space, minimising the stress as above. As already noted, classical MDS does not generate a transform function which can be applied to data not included in the manifest space whose distances are used to construct this transform. Instead, LDMS allows the addition of further elements of the domain to the transformed space using only the distances calculated to each element of L. A triangulation approach is then used to place each subsequent element into the reduced-dimension space with minimal stress on this set of distances. In this manner, LMDS extends classical MDS in such a way that it can be extended for use over very large data sets and non-manifest queries in non-Euclidean spaces. We use this technique in Section 5.6.1 to compare LMDS with our nSimplex Zen transform over spaces not governed by the Euclidean distance. 4 The nSimplex Projection The nSimplex transform can be applied to Hilbert spaces in general, and relies on the Hilbert property that any k + 1 values can be isometrically embedded in an k-dimensional Euclidean space. In outline, the transform from a Hilbert space U to Rk is defined as follows: 1. k values r1, r2, . . . rk are first selected from U to form a reference set R. (Typically, R will be selected from a large finite subset S of U.) 2. All pairwise distances among the values in R are calculated, and used to construct a base simplex Σ in a Euclidean space of k − 1 dimensions, where each vertex vi in Σ corresponds to one value ri in R with (cid:96)2(vi, vj) = d(ri, rj) for all i, j = 1, . . . , k. 3. For any further value u ∈ U, the distances between u and all values in R are calculated. 4. These distances are used to construct a point vu in k-dimensional Euclidean space, where vu is the apex of a simplex formed by its addition to the base simplex Σ, such that (cid:96)2(vu, vi) = d(u, ri) for all i = 1, . . . , k These apex points form the target of the transform. The process therefore gives a mapping σ from the general Hilbert space U to a k-dimensional Euclidean space, where σ(u) = vu, ∀ u ∈ U. As a simple example, Figure 2 shows a projection from a 3D Euclidean space S to a 2D space. In this case the reference set R comprises two values r1 and r2 selected randomly from S, and the base simplex formed is a line segment. This is arbitrarily embedded in the 2D target space with vertex coordinates v1 = [0, 0] and v2 = [d(r1, r2), 0]. Every other value u from S is then placed into the 2D projection according to its distances from these two reference values, therefore forming for each point an apex of a triangle whose base is the line (1D simplex) formed from v1 and v2. In fact, not quite any set of values can be used for R. The distances within the set must be able to form a set of linearly independent points in the projected space; in most spaces this is rarely an issue for a random selection. In fact the choice made for R affects various aspects of the projection, and will be discussed in detail later. It may also be noted that, in Step (4), there are two possible apex points that might be formed, one on either side of the hyperplane containing the base simplex. In our example, we have aligned the base (1-dimensional) simplex with the X axis, and selected apexes with a positive Y coordinate. This choice can in fact be generalised over any number of dimensions, as the base simplex can always be formed with only zero values in the kth dimension, i.e., it is constructed so that it lies in the hyperplane {[x1, . . . , xk] ∈ Rk|xk = 0}. We include in Appendix B an algorithm to construct a simplex with these properties in arbitrary dimensions. 9 A PREPRINT - FEBRUARY 23, 2023 (a) Original data in 3D (b) nSimplex projection into 2 dimentions Figure 2: Example projection from 3D to 2D using nSimplex. The left figure shows some generated points roughly in a 3D spiral pattern. Two of these points (depicted with red triangles) have been randomly selected to form the reference set R. The right figure shows the 2D projection, formed over a 1D simplex derived from the distance between these points, whose vertices are shown in red. Each other point from the 3D set has been plotted at the apex of the triangle formed from its distances to these two points. In this example, the 2D projection could be formed for any metric space, as the triangle inequality property means that it is always possible to construct the apex points of the triangles, i.e. determine a point vu such that (cid:96)2(vu, v1) = d(u, r1) and (cid:96)2(vu, v2) = d(u, r2)7. However as we will show the properties of the derived space are stronger if the domain of the transform has the Hilbert properties. In due course we will define three functions over this k-dimensional coordinate space. First, however, we will introduce its important properties. 4.1 Properties For a Hilbert space U governed by a distance function d, we refer to σR : U → Rk as an nSimplex transform defined by some appropriate set R of k reference points selected from U. For the sake of simplicity we henceforth use the notation σ in place of σR. The most important properties of the nSimplex transform are the following: • σ is a contraction mapping, i.e. ∀ui, uj ∈ U, (cid:96)2(σ(ui), σ(uj)) ≤ d(ui, uj) • Over the same coordinate space, there exists a function Upb which is an expansion mapping, i.e. ∀ui, uj ∈ U, d(ui, uj) ≤ Upb(σ(ui), σ(uj)) • Finally, there exists a further function Zen which gives a value between these two, i.e. ∀ui, uj ∈ U, (cid:96)2(σ(ui), σ(uj)) ≤ Zen(σ(ui), σ(uj)) ≤ Upb(σ(ui), σ(uj)) It can be seen from these inequalities that the Zen function is a better estimator of the true distance than either (cid:96)2 or Upb. In fact, as we will show, the Zen function acts as an excellent estimator of true distance particularly when the original space is high dimensional, allowing good estimates to be made even when these are projected onto relatively low dimensions. To give better consistency of naming, we will henceforth refer to the (cid:96)2 function as Lwb when it is used in this context. We first give definitions of the three functions, and will give a geometric explanation in the following section. Let Rk be a space in the co-domain of some nSimplex transform σ. Let the Euclidean coordinates of x, y ∈ Rk be given by 7The apex is in the intersection of a hypersphere centred in v1 with radius d(u, r1) and a hypersphere centred in v2 with radius d(u, r2). The intersection exists because d(r1, r2) ≤ d(u, r1) + d(u, r2). 10 A PREPRINT - FEBRUARY 23, 2023 [x1, x2, . . . , xk] and [y1, y2, . . . , yk] respectively. Then base_dist(x, y) = k−1 (cid:88) (xi − yi)2 i=1 Lwb(x, y) = (cid:112)base_dist(x, y) + (xk − yk)2 Upb(x, y) = (cid:112)base_dist(x, y) + (xk + yk)2 Zen(x, y) = (cid:113) base_dist(x, y) + x2 k + y2 k (5) (6) (7) (8) Of the three functions, only Lwb is a proper metric. The others are not even semimetric, as for example they do not have the identity property: i.e. Zen(x, x) (cid:54)= 0 if the last vector component is non-zero. They do, however, all possess the triangle inequality property, and so are suitable for use with metric search techniques. In fact the lack of the identity property from the Zen function is actually a requirement for it to produce very good estimates when used in low dimensions. Furthermore, it can be seen that the three functions can, if required, be evaluated efficiently as a triple, by observing that lwb2(x, y) + 2xkyk = zen2(x, y) = upb2(x, y) − 2xkyk 4.2 Geometry of the Simplex The easiest introduction to the intuition of the Lwb and Upb functions is to consider first a projection into two dimen- sions. Although this is not the primary intended use, it is useful to illustrate principles that apply also more generally in higher dimensions with the simpler case. (a) A 2D nSimplex projection of a space (U, d). The projection σ is constructed ac- cording to the reference objects r1, r2 ∈ (U, d). The distances d(u, r1) and d(u, r2) give a unique position in the 2D plane for any element u ∈ U . (b) From the Hilbert properties, any four objects from (U, d) can be isometrically embedded in a 3D space. It can be seen that the distance (cid:96)2(σ(u1), σ(u2)) is a lower bound of the true distance d(u1, u2). Figure 3: Two-dimensional projection of two values based on two reference objects (3a), and the two possible planar tetrahedra formed by all four objects (3b). Figure 3a shows two objects u1 and u2 from a (potentially high-dimensional) Hilbert space (U, d) projected into two dimensions, using two reference objects r1 and r2. The reference objects are used to form the one-dimensional simplex 11 A PREPRINT - FEBRUARY 23, 2023 comprising the line segment [(0, 0), (d(r1, r2), 0)] and the objects u1 and u2 are projected into the 2D space, each as a separate apex of the base simplex formed by this line, according to their respective distances from r1 and r2. The points in the 2D space are thus the projections σ(u1) and σ(u2) of the nSimplex transform, where σ is a mapping σ : U → R2 defined by the two reference points r1 and r2. Due to the Hilbert properties of the projection domain, any 4 values can be isometrically embedded in an 3-dimensional Euclidean space therefore there must exist a tetrahedron in 3-dimensional Euclidean space whose vertices correspond to the four objects {r1, r2, u1, u2}, and whose edge lengths correspond to the distances between each corresponding pair. Two of the faces of this tetrahedron are congruent with the two triangles illustrated in Figure 3a. Considering only the 2D projection, 5 of the 6 inter-vertex distances have been calculated and are directly available from the projection (i.e., d(r1, r2) and d(ri, uj), i, j = 1, 2). The distance d(u1, u2) is not available. Without loss of generality the vertices of the tetrahedron are {σ(r1), σ(r2), σ(u1), vu2}, where the vertex vu2 ∈ R3 can be calculated only by explicitly computing d(u1, u2). However, it is possible to put upper and lower bounds on this distance from the tetrahedral geometry which is guaranteed to exist in a 3D projection. Figure 3b shows a third dimension added to this diagram, which can accommodate the fourth unknown vertex vu2 of the tetrahedron. Note that this is a hypothetical space, in that it is not explicitly constructed by the 2D nSimplex projection, but only used to reason about properties of the 2D projection. We introduce the term σθ(u) to refer to the mapping of an object u ∈ U into this (R3, (cid:96)2) space so that (cid:96)2(σθ(u), σ(ri)) = d(u, ri), i = 1, 2, while still considering the 2D projection σ. The angle θ is the angle formed by the point σθ(u) and the hyperplane in R3 containing the other three vertex of the tetrahedron. The two adjacent faces of the tetrahedron share the line segment [σ(r1), σ(r2)] as their common edge. Given that the tetrahedron must exist, it can be fully defined by the five available edge lengths in combination with the true angle θ∗ between these faces, which must be somewhere in the interval [0, π] radians. Without loss of generality, we fix the point σ(u1) in the XY plane. The locus of the point σθ(u2) in the higher dimension is thus restricted to the circle defined by the rotation of apex point σ(u2) around the X axis, and its exact location within the 3D space could be determined with knowledge of the distance d(u1, u2), or equivalently from the knowledge of the exact angle θ∗. It is clear that the lower and upper bounds of the distance d(u1, u2) in the original space occur with the planar tetrahedra formed when the angle θ is 0 and π radians respectively. These planar tetrahedra are contained within the 2D space of the original projection σ, and the 3-dimensional model does not need to be explicitly formed in order to establish their geometry. The tetrahedron defined by the angle θ = 0 has vertices exactly as already projected. Due to the manner in which the projection is constructed, with the final coordinate of the projection representing the altitude of the apex point above the hyperplane containing the base simplex (see Appendix B for full details), the tetrahedron defined by the angle θ = π can be created simply by taking the negative value of the Y coordinate of point σ(u2). These observations lead directly to the derivation of the Lwb and Upb functions as defined in Equations 6 and 7 respectively. It should be noted that these bounds apply only to projections made from general Hilbert spaces. As noted above, any metric space can be projected into two dimensions, as the ability to perform this mapping is guaranteed by the triangle inequality property. However, the lower and upper bound properties do not hold for the 2D projection unless a stronger condition, the ability to isometrically embed any four objects into 3D Euclidean space8, also holds in the domain of the projection. While the intuitive argument given is valid only for the two-dimensional projection, it carries through a projection into any number of dimensions, as the Hilbert properties give the ability to isometrically embed any k objects into (k − 1) Euclidean dimensions. It is possible, for example when k = 3, to rotate the apex of a tetrahedron through a fourth dimension, around the plane containing its triangular base, whilst preserving the edge lengths, but this is not so clear in terms of intuition. The general result as stated above, that the Lwb and Upb functions given in Section 4.1 are lower and upper bounds respectively of the true distance, is independent of the dimension of the projection when applied to any Hilbert space. We enclose a proof of correctness of this result in Appendix C. 4.3 The Zen function Figure 4a is an illustration of the same 2D projection as in Figure 3, but shows the triangle ∆σ(r1)σ(r2)σθ(u2) with a different orientation in the hypothetical 3D space, while Figure 4b shows the case where this triangle is set at the angle π/2 with respect to the hyperplane H containing σ(r1), σ(r2), σ(u1). The Zen (zenith) function is named after this last orientation, and gives the (cid:96)2 distance between the points σ(u1) and σθ(u2) when σθ(u2) is at the zenith of this 8This is the so-called four-point property; it is slightly more general than Hilbert properties, and some useful non-Hilbert metric spaces possess this. We have previously defined such spaces as supermetric [13], and shown how general metric search techniques can be improved through its use. 12 circle, i.e. the point with the highest altitude above the hyperplane H. This distance can be simply calculated using only the information in the projection, as given in Equation 8. In this section, we explain why this function provides the best estimator for the true distance d(u1, u2) in an original high-dimensional space. A PREPRINT - FEBRUARY 23, 2023 (a) Four objects r1, r2, u1 and u2 are projected into two dimen- sions. σθ(u2) is a hypothetical position in 3D space. (b) Adding b, the centre of the locus of σθ(u2), and setting the angle θ = ∠σ(u2)bσθ(u2) to π/2. Figure 4: The Zen function is defined when the angle between the two triangles is set at π/2 in the hypotheti- cal further dimension. There is no requirement to calculate a projection in this dimension: Zen(σ(u1), σ(u2)) = (cid:96)2(σ(u1), σθ(u2)). Considering Figure 4 again, and all of the possible tetrahedra that could be formed from the five known and the one unknown distances, it might be supposed that there is no constraint on the particular position in which the point σθ(u2) is most likely to lie on the circle depicted. This assumption however typifies the danger of basing intuition on low-dimensional spaces. In fact there is no absolute constraint, but there is a very significant probabilistic constraint, assuming the domain is evenly distributed, and this gets tighter as the dimensionality of the domain increases. 4.3.1 Considering higher dimensions If the projection is onto a k-dimensional space, then the hypothetical space being considered is in k + 1 dimensions. In that case, k reference objects and any two data points u1 and u2 are projected in Rk using the nSimplex projection σ. The vertex σθ(u2) ∈ Rk+1 is obtained by rotating σ(u2) around the k − 2 dimensional space containing the the base simplex formed by {σ(r1), . . . , σ(rk)}; the angle θ is the angle formed by σθ(u2) and the hyperplane H = {[x1, . . . , xk+1] ∈ Rk+1 | xk+1 = 0} containing both σ(u1) and the simplex base. In other words, σθ(u2) lies in the intersection of k hyperspheres Bi = {v ∈ Rk+1|(cid:96)2(v, σ(ri)) = d(u2, ri)} for i = 1, . . . , k, that forms a circle on a plane orthogonal to the hyperplane containing the base simplex of vertices σ(r1), . . . , σ(rk) and the projected point σ(u1). The exact angle θ∗ that would give (cid:96)2(σ(u1), σθ∗ (u2)) = d(u1, u2) it is not known without explicitly calculating d(u1, u2). However, as shown in Section 2.2, in high dimensional space the most likely value for this angle is π/2, and furthermore, as the dimension of the space increases, the variance rapidly decreases. This variance is a factor of the dimensionality of the domain, rather than the range, of the projection. With this angle set to π/2, the distance (cid:96)2(σ(u1), σθ(u2)) in the hypothetical further dimension can be simply calculated given the projection values σ(u1) and σ(u2) in the k-dimensional space of the projection. This finally gives the explanation of the Zen formula (Equation 8) which gives this distance in the context of the projection from m to k dimensions. In Appendix C we give a formal derivation of this intuitive argument in arbitrary Hilbert spaces. In particular, we show that if σ : U → Rk is the nSimplex transform defined by a set of k reference points then for any u1, u2 ∈ U given the transformed points x = σ(u1) and y = σ(u2) it holds d(u1, u2) = (cid:118) (cid:117) (cid:117) (cid:116) k−1 (cid:88) i=1 (xi − yi)2 + x2 k + y2 k − 2xkyk cos θ (9) where θ corresponds to the angle ∠σ(u2)bσθ(u2) in Figure 4b. It is clear from this form that as the probability of θ being close to π/2 increases (as happens when the dimensionality of domain U increases) the Zen function applied to the σ projection gives an increasingly accurate estimate of the true distance d(u1, u2). 13 A PREPRINT - FEBRUARY 23, 2023 The implications of this are quite extraordinary, in fact: it should be possible to compress a space of perhaps thousands of dimensions into a very low-dimensional projection of only a few dimensions, where pairwise distances are well- preserved. We demonstrate that this is in fact the case in Section 5. 5 Experimental Analysis Experimental analysis is presented in four main sections, each of which tests dimension reduction over a different class of metric space. Section 5.3 tests the different transforms against uniformly generated Euclidean spaces, and Section 5.4 uses two high-dimensional Euclidean spaces deriving from real-world applications. Section 5.5 tests two spaces governed by the Cosine metric, and Section 5.6.1 tests two spaces governed by the Jensen-Shannon metric. For the first three of these sections, the mechanisms tested are: nSimplex Zen, PCA, MDS and RP. For Jensen-Shannon distance, where there is no coordinate space, the mechanisms tested are nSimplex Zen and LMDS. First, in Sections 5.1 and 5.2 respectively the quality measures and data sets used are introduced. All of the code used to generate our experimental results is available from https://github.com/richardconnor/ dr-matlab-code. 5.1 Quality Measurement Dimensionality reduction is a very generic concept, defining any mechanism whose purpose is to transform a set of values into a lower-dimensional space whilst maintaining, as far as possible, the most important aspects of the geometry of the original space. This rather general definition leaves much room for the interpretation of quality, depending on the context of use. A comprehensive survey of quality measurement techniques is given in [24]; based on this, we have picked the following measures as the most representative for the general context. For a space (S, d) which has been reduced to a lower-dimensional space (S (cid:48), ζ) using a DR transform τ , we adopt the following notation and measures δij = d(si, sj) i, s(cid:48) ζij = ζ(s(cid:48) j) si, sj ∈ (S, d) i, s(cid:48) s(cid:48) j ∈ (S (cid:48), ζ) where s(cid:48) i = τ (si) ∀i Shepard Plots A scatter plot of sampled distances δij from the domain, plotted against distances ζij, which gives a simple visual impression of quality. Plots are typically overlaid with the monotonic function implied by the Kruskal Stress measurement. Krukal Stress The Kruskal stress1 criterion, which gives a measure of the monotonicity of the transform. This is a topological measure; stress will be zero if the DR transform is purely monotonic, independent of the actual values of δij and ζij. Sammon Stress Deriving from Sammon mapping, the Sammon stress formula is affected by the absolute differences between δij and ζij, as well as their topological relationship. Quadratic Loss A purely distance-based measure, which particularly punishes the existence of outliers in δij − ζij. Spearman Rho A topological measure of order preservation of distances distances within sampled pairs of objects from the domain, essentially a measure of the likelihood that δij < δik implies ζij < ζik. kNN Query Recall Here the results of kNN searches in the reduced space are tested for quality against the same search performed in the original space. This aspect is not measured in [24], and we are not aware of any commonly accepted measure for testing it. Nonetheless it seems that nearest-neighbour search over the reduced space is an important use of these techniques. It is not captured by any of the quality metrics listed above, as behaviour over very small distances may differ from randomly sampled distances. We have therefore devised our own measure of recall, described in Appendix E, where discounted cumulative gain is measured over a relevance function based on rank. Appendix E gives fuller background on all of these measurements. 5.2 Test data and methodology In all cases we have used data sets that are widely available, or can be recreated using widely available software, and have at least one million elements to allow reasonable recall experiments. The data sets used and their main features are given in Table 2. Details are given in Appendix D. 14 A PREPRINT - FEBRUARY 23, 2023 Table 2: Data sets used in experiments and their outline properties. Cosine distance refers to the (cid:96)2 metric applied over L2−normalised data, and for Jensen-Shannon distance the data is L1-normalised as required. Data Set 100-dimensional generated 500-dimensional generated Twitter GloVe MirFlickr fc6 ANN SIFT MirFlickr fc6 RELU 100-dimensional generated MirFlickr GIST Representational Dimension 100 500 200 4096 128 4096 100 480 Metric Euclidean Euclidean Euclidean Euclidean Cosine Cosine Jensen-Shannon Jensen-Shannon Dimension of 80% variance 80 400 120 109 28 1111 n/a n/a In all experiments, a randomly selected subset of objects from the domain is used as a witness9 set with which to create the transforms. The witness set should be sufficiently large for the initial analysis of any manifold within which the actual data set is embedded, depending on the technique being considered, to allow the general (U → Rk) transform to be created. The RP transform is created without reference to the domain, and the nSimplex transform is created from a set of k objects randomly selected from the witness set. For the majority of quality tests a further (non-intersecting) subset of objects is used as the domain of the transform. For Shepard plots, a subset of just 50 objects is used to avoid overcrowding the plot. A set of 104 objects is used to calculate the Kruskal stress used to annotate the plot, and the other quality measures other than recall. For recall experiments, a set of 106 elements is used, against which the ground truth of 1,000 nearest neighbours is calculated for 100 elements of this subset. All experiments have been multiply repeated with different random selections to ensure the results shown are representative and repeatable. 5.3 Generated Euclidean spaces Uniformly distributed Euclidean spaces10 were generated in 100 and 500 dimensions. Reduced-dimension versions were produced using RP, PCA, MDS, and nSimplex, and tested using the quality measures outlined in Section 5.1. In the case of generated data, the witness set contains no useful information about the data, as there is no lower- dimensional manifold contained within the representational space. Both PCA and MDS therefore effectively apply a random projection to the experimental data. The PCA transform is guaranteed to be orthonormal, and while the MDS transform is not, it is always close to this given a uniform distribution of the witness data. The RP technique used in these experiments is much further from orthonormal, especially with lower dimensionalities. It is generally perceived that there is no value in applying non-random dimensionality reduction to uniformly dis- tributed data, but these experiments demonstrate that the Zen function preserves distances better than the other meth- ods, due to the geometric model described in Section 4.3, even in the absence of a lower-dimensional manifold. 5.3.1 100 dimensional generated space Figure 5 shows Shepard plots for the 100-dimensional data reduced to 80 dimensions using various reduction trans- forms. The reduction to 80 dimensions has been chosen as it represents the number of dimensions that explain 80% of the variance using PCA analysis. As can be seen, nSimplex Zen is the best transform according to the Kruskal stress criterion, giving a significantly better outcome than either PCA or MDS. In this example, PCA gives a slightly better outcome than MDS, but this is not significant. It is however significant than nSimplex Zen gives a better outcome: this function relies upon properties of the domain geometry which are not available to a linear transform. RP, as expected, performs the worst of the four transforms. Figure 6 shows the outcomes of the various quality measures, as the reduction dimension is reduced from the dimension of the original data down to 2 dimensions. Each quality measure has been normalised into the range [0, 1], where 1 9or training set; we prefer the term witness in this context to denote a relatively small representative subset. 10The experiments have been repeated for generated data with a Gaussian distribution, the results are not significantly different from those shown here. 15 A PREPRINT - FEBRUARY 23, 2023 (a) nSimplex Zen (b) PCA (c) MDS (d) RP Figure 5: Shepard plots for the reduction transforms, each having reduced 100-dimensional generated data to 80 dimensions. For 50 randomly selected values, all pairwise distances are plotted in both original and transformed spaces. The Y-axis represents true distance, and the X-axis is the distance measured in the reduced space. The solid black line shows the fitted least-squares monotonic regression function from which the Kruskal stress (SK) is measured. It can be seen that nSimplex Zen and RP point clouds are centred around the true distance function (y = x, the dashed line), whereas PCA is a contraction mapping. While MDS gives the appearance of a contraction mapping, in fact this is not a guarantee. implies a perfect outcome and 0 implies that the transform has no effective value. The expectation is that, for each measure, the outcome will start high and monotonically reduce as the dimension of the reduction decreases. It is clear that for this data set the nSimplex Zen transform consistently performs better than any of the other techniques for all measures and for all reduction dimensions. It is also particularly evident that the Kruskal quality of nSimplex Zen does not appear to significantly degrade as the reduction dimension is reduced to surprisingly low dimensions. Ex- traordinarily, the Kruskal stress of nSimplex Zen in the 2-dimensional reduction is less than that of the other techniques at 80 dimensions. This aspect will again be discussed further in Section 7. The poor Quadratic Loss and Sammon Stress outcomes for PCA are due to the mechanism being a contraction trans- form, which therefore introduces a consistent error across all measurements. These quality measures punish any absolute, rather than relative, error. The nSimplex Zen transform gives much better results in these tests, as the un- derlying geometry holds the transformed distances close to those measured in the original space as seen in Figure 5. 5.3.2 500-dimensional generated space We repeat the above analysis for a higher dimension space. Figure 7 gives Shepard plots for nSimplex Zen, PCA and RP reduced to 400 dimensions. Even although the reduction is again to 80% of the original dimensions, it can be seen that the higher dimensions give relatively better outcomes, as predicted by Johnson-Lindenstrass. This is particularly evident in the quality charts shown in Figure 8, where it can be further seen that, as dimensions are reduced, RP starts to give equal performance to both PCA and MDS in all quality measures, and is better for Sammon stress and Quadratic Loss. However, from our perspective, the key result is substantially better performance of the nSimplex Zen transform for all quality measures across all dimensions. 16 A PREPRINT - FEBRUARY 23, 2023 (a) Kruskal stress (b) Spearman Rho (c) 1- Sammon stress (d) Quadratic loss (e) kNN Recall Figure 6: Five measures of quality as the reduction dimension decreases. The X-axis in each plot is the dimension of the reduction used, in this case starting from 100 on the left and ending at 2 on the right. The Y-axis shows the measure of quality, for each transform, at each dimension. All quality measures are normalised into [0, 1] to make the comparisons clearer, as recommended in [24]. For all measures, a value of 1 implies a perfect representation of the original space, a value of 0 means the transform has no effective value. (a) Zen (b) PCA (c) RP Figure 7: Shepard plots for the DR mechanisms applied to 500-dimensional space, reduced to 400 dimensions. MDS, as before, gives very similar results to PCA, and from now on we omit that figure from this analysis. 5.4 Euclidean spaces from other applications In this section we examine the reduction of some high-dimensional Euclidean data sets produced in the application of representational techniques to real-world data. These spaces are known to lie within complex manifolds of the Euclidean space in which they are embedded, and are therefore better subjects for dimensionality reduction than the uniform spaces of the previous section. 5.4.1 Twitter GloVe 200 GloVe [35] is an unsupervised learning algorithm for obtaining vector representations for words, with the intent that the distance between vectors is semantically significant. Twitter GloVe is the outcome of this algorithm applied to 2 × 109 individual short texts from Twitter, from which 106 individual tokens are assigned vector values. The achieved 17 A PREPRINT - FEBRUARY 23, 2023 (a) Kruskal stress (b) Spearman Rho (c) Sammon stress Figure 8: Quality metrics for 500 dimensional Euclidean spaces reduced to between 500 and 2 dimensions. (d) Quadratic loss (e) kNN Recall semantic similarity is quite striking, for example the closest vectors to the term frog are, in order: frogs, toad, litoria and leptodactylidae. Linear substructures are also preserved, for example the relative difference between the word pair (man, king) is similar to that between the pair (woman, queen). The authors have considered both Euclidean and Cosine distances over the records and have found no significant advantage to either metric. Pre-trained word vectors with 25, 50, 100 and 200 dimensions are available online11, here we have used the 200 dimension version. The same experiments as above were performed on the Twitter GloVe data set. Before creating the Shepard plots, PCA was used to find the number of dimensions necessary to explain 80% of the variance. This value is 120, significantly less than the 160 dimensions that would be required for uniform data. This was selected as the reduction dimension to illustrate using Shepherd plots in in Figure 9. As can be seen, in this context the nSimplex Zen transform performs by far the best of those tested, the Kruskal stress now being less than half of that obtained using PCA or MDS. Figure 9: nSimplex Zen, PCA and RP transforms mapping GloVe from 200 to 120 dimensions. MDS gives, as before, very similar results to PCA and is omitted from the Figure. The plots of transform quality with reducing dimensions are shown in Figure 10. Some of these results are quite startling: the nSimplex Zen transform is almost always best, for all quality measures, and in some cases maintains high quality values down to tiny reduction dimensions compared to the other techniques. 11https://nlp.stanford.edu/projects/glove/ 18 A PREPRINT - FEBRUARY 23, 2023 (a) Kruskal stress (b) Spearman Rho (c) Sammon stress (d) Quadratic loss (e) kNN Recall Figure 10: Quality metrics for Twitter GloVe reduced to between 200 and 2 dimensions. The reason for this relative increase in performance is, we believe, due to the nature of the manifold in which the data lie. PCA, MDS and RP all produce linear transforms of this manifold, whereas nSimplex Zen's transform is non- linear, allowing it to respect the geometry of the original manifold with respect to each object mapped into the lower dimension. The nSimplex Zen transform shown in Figure 9 is produced with reference to only 120 reference objects, as opposed to the 1, 000 objects used for PCA , and in Figure 10 the transform at each dimension is produced using only that number of reference points to represent the manifold in which the domain lies. Even for example with a random selection of only 20 reference objects, mapping to 20 dimensions, it is clear that nSimplex Zen performs far better than the linear transforms which use many more reference objects, even when mapped to many more dimensions. 5.4.2 MirFlickr 1M / Alexnet This data derives from the AlexNet convolutional neural network [27] applied to the set of one million images available from the MirFlickr project [25]. While this network is starting to be considered a little dated, as its categorisation performance is less good than some more modern networks, the combination gives a highly available network applied to a highly available large image collection: the purpose here is just to provide a realistic set of data, with meaningful semantics, in high dimensions. The data is taken from the first fully-connected (DeCAF, fc6) layer of the network, after the initial convolutional layers and before the remaining fully-connected layers of the network. Euclidean distance over this representation has been shown to give an excellent proxy to image similarity even for categories of image that are not included in the original classification [21, 33]. In this experiment we apply Euclidean distance to the data as extracted, and in Section 5.5.2 we use the same data with Cosine distance applied to the post-RELU filtered version. The data used for this section therefore comprises 4,096 Euclidean dimensions, including both positive and negative values, and lies within a complex manifold where the PCA eigenvalues determine that only 109 dimensions are re- quired to explain 80% of its variance. As before we compare RP, PCA and nSimplex Zen at this reduction dimension, the results of which are shown in Figure 11. Again MDS and PCA give almost indistinguishable outcomes for this test. Again, it is visually evident that the Zen function gives a much tighter fit to the true distances than either RP or PCA, borne out by the lower value of Kruskal stress, and is generally much closer than either to the true distance. For the first time, we show a result where the nSimplex Zen transform is less good than either PCA or MDS across the range of reduced dimensions: while nSimplex Zen remains the highest-scoring mechanism for almost all the quality measures across all reduction dimensions, Figure 12 shows that the recall test for nSimplex Zen is worse for recall than 19 A PREPRINT - FEBRUARY 23, 2023 Figure 11: MirFlickr fc6 representations, reduced from 4,096 dimensions to 109. either PCA or MDS when the reduction dimension is less than around 300. This is initially surprising, as the Spearman Rho measure, which tests the preservation of ordering among distances, shows a better performance for nSimplex Zen. The phenomenon being displayed is that Zen's performance in this test is less good over very small distances, which we examine in more detail in Section 7.1. (a) Kruskal stress (b) Spearman Rho (c) Sammon stress (d) Quadratic loss (e) kNN Recall Figure 12: Quality metrics for Mirflickr fc6. For most plots, the X-axis (dimensionality of the reduction) goes between 200 and 2, as there is very little loss of quality for any of the measurements above 200 dimensions. The recall experiment is run from 1,000 dimensions down to 2. 5.5 Other Hilbert spaces - Cosine Distance Cosine similarity is frequently applied over large high-dimensional spaces in the context of Information Retrieval [30]. As noted in Appendix A, the most common interpretation of Cosine distance, the complement of the normal cosine similarity (the cosine of the angle between vectors) is not a proper metric. The angle itself does give a proper metric, and can be used as a proxy which gives the same ordering within a space. To avoid the potentially expensive arccos function, Euclidean distance measured over the end-points of (cid:96)2-normalised vectors is another proper metric, with the same ordering, and which also has the Hilbert properties. While the Euclidean metric is used, such spaces are however very different from general Euclidean spaces in terms of the distribution of distances. 20 A PREPRINT - FEBRUARY 23, 2023 5.5.1 ANN SIFT The ANN_SIFT1M [26] dataset comprises vectors of Angular Quantisation-based Binary Codes (AQBC) [23] deriving from the SIFT [28] feature analysis of one million images. The similarity of such representations is intended to be assessed using Cosine similarity. SIFT is no longer state-of-the-art in image similarity, but the benchmark is still widely used and provides a valuable set of data for this purpose. In these experiments the 128-dimensional data is (cid:96)2-normalised and Euclidean distance is used to provide a semantic proxy for Cosine distance. As before, PCA is used to determine the number of dimensions required to explain 80% of the variance in distances, which turns out to be only 28 dimensions. Figure 13 shows the Shepard plots of this data for nSimplex Zen, PCA and RP.In this case there is little visual difference between the plots for PCA and nSimplex Zen, although the Kruskal score for nSimplex Zen is significantly better. Figure 13: ANN-SIFT (cid:96)2-normed representations, reduced from 128 dimensions to 28. (a) Kruskal stress (b) Spearman Rho (c) Sammon stress (d) Quadratic loss (e) kNN Recall Figure 14: Quality metrics for ANN SIFT reduced from 128 to between 100 and 2 dimensions. Figure 14 shows the quality measures for the data, for dimensions reducing from 100 down to 2 as, with the exception of RP, there is almost no quality loss at above 100 dimensions. As can be seen, in these tests nSimplex Zen performs best for Kruskal stress, Sammon stress and quadratic loss, but is marginally less good than either PCA or MDS at lower dimensions for Spearman Rho, and is strikingly less good than either for recall at all dimensions. We do not have a categorical reason for these observations, but believe that there are two main reasons for this differ- ence in performance: first, the data set to start with has a relatively low intrinsic dimensionality, and second, the data 21 A PREPRINT - FEBRUARY 23, 2023 lies on a relatively regular linear manifold within the representational space. These observations are certainly consis- tent with the relatively small number of dimensions shown by PCA to capture the majority of the distance variance. The relatively poor performance of RP is also explained by these observations. 5.5.2 MirFlickr 1m / Alexnet In this section we use the same raw data as that of Section 5.4.2, but with the data converted to give a proxy for the classic "cosine" distance after the RELU filter has been applied. RELU is applied by zeroing out the negative values, then the resulting points are (cid:96)2-normalised by dividing each vector component by the magnitude of the resulting vector. After this transformation, the Euclidean distance between the values, which now represent the end-points of unit vectors, gives the same rank ordering as Cosine distance over the post-RELU space. The value of this metric is that it is that used for training the original network, with this transform being applied at each fully-connected layer of the categorisation section of the CNN architecture. It might therefore be expected to give an improved performance in terms of semantic similarity over the simpler DeCAF measure, although testing this in practice for a large data set is challenging. However, as before, our purpose for this data is to give a convincingly realistic large set of values which derive from some application and which require the use of the Cosine metric, which is thus achieved. As previously mentioned, the characteristics of the metric space produced in this way are quite different to those for the same raw data under simple Euclidean distance. For this data the PCA eigenvalues show that 1, 111 dimensions are required to explain 80% of the variance in distance, a surprising departure from the 109 dimensions required for the non-RELU (cid:96)2 metric version. Figure 15 shows Shepard plots at this dimension. For the first time we see that RP outperforms PCA and MDS, implying that no useful information about the manifold containing this data is gleaned from either of these analyses. In fact both can in fact be seen to be harmful, as the randomly generated RP transform, which is approximately orthonormal at this higher dimension, outperforms both. In this case the relatively small stress caused by the reduction transform can only be attributed to the effect highlighted by the Johnson-Lindenstrauss lemma, and this effect is somehow being lessened by linear analysis of the original manifold. Figure 15: fc6 RELU cos (cid:96)2-normed representations, reduced from 4096 dimensions to 1111. Again, however, our main purpose is to compare the nSimplex Zen transform, which in this case significantly out- performs any of the other three mechanisms. As can be seen, the Kruskal stress in this case is almost an order of magnitude less than for PCA. In fact, the high quality of the nSimplex Zen transform is maintained down to much lower dimensions. Figure 16 shows the first four quality measures applied to reductions of between 200 and 2 dimensions; the starting point of 200 is used as, with the exception of recall, there is almost no loss of quality with nSimplex Zen at any of these dimensions. In all cases it can be seen that nSimplex Zen is the best mechanism, along with the observation that RP is better than either PCA or MDS again across the whole range of reduction dimensions. For Kruskal stress and Spearman Rho measures, nSimplex Zen is much better than RP. The only exception to this is the recall measure, where it can be seen that nSimplex Zen starts to perform less well than either PCA or MDS when the reduction dimensions is less than around 300. While nSimplex Zen is better than RP across the whole range, the advantage is only relatively small; again, RP gives a surprisingly good outcome for this test. 22 A PREPRINT - FEBRUARY 23, 2023 (a) Kruskal stress (b) Spearman Rho (c) Sammon stress (d) Quadratic loss (e) kNN Recall Figure 16: Quality metrics for fc6 RELU Cosine distance over MirFlickr fc6 data. Apart from recall, all charts plot reductions from the original 4096 to between 200 and 2 dimensions, as nSimplex Zen gives almost perfect results at 200 dimensions. Recall is plotted from between 1000 and 2 dimensions. 1111 dimensions capture 80% of the variance when using PCA. 5.6 Other Hilbert spaces - Jensen-Shannon Distance In the final experimental section, we apply nSimplex Zen to Hilbert spaces where there is no available coordinate system. As explained in Section 4, the underlying nSimplex transform can be applied to any metric space which is isometrically embeddable in a Hilbert space. As the n-dimensional simplexes are constructed in Euclidean space using only the pairwise distances measured in the original space, then any metric space which allows a finite n-embedding into (n−1) Euclidean dimensions can be used as the domain, and all metric spaces which are isometrically embeddable in Hilbert space have this property. One of the most interesting classes in this category is that of metric spaces governed by the Jensen-Shannon distance, an information-theoretic distance metric which has some interesting properties, and can reasonably be regarded as a distance which should always be preferred to the semantics-free Cosine distance [15]. One possible reason for its relatively low uptake may be that its calculation requires many log calculations, and can be two orders of magnitude slower than Cosine distance over the same dimensions. It is therefore intriguing that a dimensionality reduction transform exists which not only reduces the size of the representations, but also converts the distance metric from an expensive calculation to a much cheaper one. The absence of a coordinate system means that neither PCA nor RP can be applied. While MDS can be applied to a small space, it is not possible to use the extended version described in Section 3.3 which is necessary to allow its application to a large space. However in [37] it is shown that LMDS, a different extension of the MDS principles, can be applied to any metric space, including those without a coordinate system. In this section we therefore compare nSimplex Zen and LMDS in use against two spaces governed by the Jensen-Shannon metric. 5.6.1 100-dimensional generated space The first experiment uses a 100 dimensional generated space. 100-dimensional vectors are generated using a uniform random generator with each dimension, bounded in [0, 1], and each vector is (cid:96)1-normed in order to simulate a proba- bility distribution over 100 independent variables, thus giving an appropriate domain for Jensen-Shannon distance. Figure 17 shows Shepard plots for nSimplex Zen and LDMS at 80 dimensions (now an arbitrary figure as PCA is not possible over the data), from which it can be seen that nSimplex Zen gives less Kruskal stress than LMDS. 23 A PREPRINT - FEBRUARY 23, 2023 Figure 17: 100-dimensional generated probability space with Jensen-Shannon metric, reduced to 80 dimensions using nSimplex Zen and LMDS. (a) Kruskal stress (b) Spearman Rho (c) Sammon stress (d) Quadratic loss (e) kNN Recall Figure 18: Quality metrics 100-dimensional generated probability space with Jensen-Shannon Distance. Figure 18 shows the usual quality charts across the range of 100 down to 2 dimensions. Again, nSimplex Zen is generally the better of the mechanisms. It is interesting to note that nSimplex Zen does not give perfect results even at 100 dimensions, and that the only cases where LMDS outperforms nSimplex Zen are at 100 dimensions for the Spearman Rho test, and at about 80 dimensions for recall. While one property of a Hilbert space is a finite n- embeddability in (n − 1) Euclidean dimensions, this does not of course imply that an n-dimensional Jensen-Shannon space should in general be isometrically embeddable in an n-dimensional Euclidean space. Thus there is no reason to expect perfect performance when any space with Hilbert properties is "reduced" to a Euclidean space with the same physical dimensions. 5.6.2 GIST Our final experiment is with Jensen-Shannon distance applied to GIST image descriptors. GIST [34] is a representation of the image based on a set of perceptual dimensions that represent the dominant spatial structure of a scene. Although again GIST is no longer the state of the art in image similarity, it has been shown that GIST representations used in conjunction with Jensen-Shannon distance gives an excellent technique for finding near-duplicate images for forensic purposes [16], a specialist application quite different from more general image similarity. 24 A PREPRINT - FEBRUARY 23, 2023 The MirFlickr 1M image set was again used, and GIST representations were obtained. Each representation is a 480- dimensional vector, again (cid:96)1-normalisation is applied to achieve a set of one million values suitable as a domain for the Jensen-Shannon distance metric. After initial analysis it was found that these representations are quite amenable to dimensionality reduction using both nSimplex Zen and LMDS, so Shepard diagrams were produced at the 100-dimensional reduction. As shown in Figure 19, both techniques give a relatively low Kruskal stress even at around one-fifth or their initial size, and again the nSimplex Zen transform gives a significantly lower stress than LMDS. Figure 19: MirFlickr GIST with Jensen-Shannon metric, reduced to 400 dimensions using nSimplex Zen and Landmark MDS. Figure 20 repeats the usual quality analysis over these descriptors. Most charts are from 100 down to 2 dimensions again as there is little quality loss at higher dimensions; recall is measured between 200 and 2 dimensional reductions. For this space, nSimplex Zen is better across all dimensionalities for all tests other than for recall, where it is not as good as LMDS. It is noteworthy that both techniques, relying on distances alone, perform much better for the "real" data than for the uniformly generated data. The reason for this is presumably that the data is contained within a manifold contained within the representational space whose characteristics are being usefully captured by the distance-based analysis. 6 Run-time Costs It is difficult to make fundamental comparisons on computational cost: mechanisms such as PCA have had many years of study as to their optimisation, and specialist mathematical programming systems provide extremely fast versions, whereas the LMDS and nSimplex Zen transforms reported here are (possibly naively) coded by ourselves following the high-level definitions. However measurements of the systems as used may be pragmatically useful, although these caveats should be taken into account. As a further caveat, the experimental results reported here are performed using MatLab12, and some of the tests performed in Java implementations give quite different outcomes. The MatLab system is highly optimised for array manipulation, and provides optimised implementations of PCA and MDS. There are two key aspects to the performance of the mechanisms: the cost of producing the transform, and the cost of applying it to a data item, or a data set. For PCA, MDS and RP, the transform function comprises a matrix which is multiplied by the data in order to produce the reduced-dimensional form. So in all cases, when an m-dimensional Euclidean space is to be reduced to k dimen- sions, the transform takes the shape of an m × k matrix. The data to be reduced is an n × m matrix, comprising n rows of m−dimensional data. The outcome of multiplying the data by the transform is then an n × k matrix representing the reduced-dimension data. Although the cost of producing the transform matrix varies widely with the technique, the application to the data is thus largely constant for a given m and k. In theory, this cost with the RP mechanism we have used throughout could be much lower, as the transform matrix is deliberately constructed to contain many zero values and thus reduce the potential cost of matrix multiplication. We have not observed this in our tests, using standard matrix multiplication as provided by MatLab, but the potential exists. 12R2022a update 4, 64-bit (Mac i64) 25 A PREPRINT - FEBRUARY 23, 2023 (a) Kruskal stress (b) Spearman Rho (c) Sammon stress (d) Quadratic loss (e) kNN Recall Figure 20: Quality metrics for GIST/JSD. The data is 480 dimensions, however there is very little quality loss when reduced to 100 dimensions, therefore most charts are plotted from 100 down to 2 dimensions; kNN recall is plotted from 200 dimensions downwards. Figure 21: Log-scaled costs of the creation and execution of the different DR transforms over a synthetic Euclidean space of 1000 dimensions. For nSimplex Zen and LMDS, the execution of the transform in both cases depends on distances measured between each element of the data and a set of reference objects. For LMDS this is a typically large fixed set of reference objects, whereas for nSimplex Zen the magnitude of the set of reference objects is the same as the reduction dimension. Figure 21 shows a set of experimental results for the creation and execution of the different reduction transforms. The context is a generated Euclidean space of 1000 dimensions, and each transform is used to reduce this to between 2 and 500 dimensions. The charts show the cost in each case of creating the transform, and the per-object cost of applying it to the data once the transform is created. As can be seen, the cost of the transform creation varies widely, and this we believe to show fundamental differences in each approach. However in most cases the cost of transform creation is relatively unimportant compared to the cost of its execution. 26 A PREPRINT - FEBRUARY 23, 2023 The execution times show the cost of transformation per object. Two major effects are visible here; first, the mecha- nisms using matrix multiplication are approximately an order of magnitude faster than the mechanisms using object distances. In terms of the number of individual arithmetic operations performed, there is no such order of magnitude difference: in fact both nSimplex Zen and LMDS require fewer individual arithmetic operations for these examples, and the difference seen is due to the optimisation of array multiplication. Secondly, two execution times are shown for each of PCA, MDS and RP. The greater of these apply the matrix multi- plication inside an iterative loop, to give a fair comparison with nSimplex Zen and LMDS where this is necessary. The faster outcomes, again approximately an order of magnitude better, apply the transform via a single matrix multiplica- tion over the entire data set as would normally be possible. In summary, the application of any of PCA, MDS or RP is around two orders of magnitude faster than nSimplex Zen or LMDS, when our naive implementations are compared against a professional matrix-optimised programming system. It is possible that nSimplex Zen could be optimised to reach an equivalent performance, but whether this is the case or not, and indeed how to achieve it, are open questions. Meantime, our provided version of nSimplex Zen can perform reduction at a typical rate of between 10−4s and 10−3s per object, which may be fast enough for many useful purposes. 7 Discussion In almost all quality measures, the nSimplex Zen transform outperforms all of the other well-known general techniques for Euclidean spaces. As its application requires only the measurement of pairwise distances, rather than inspection of a coordinate space, it can also be applied to any metric space which is isometrically embeddable in a Hilbert space, where the necessary Euclidean properties also exist. In this context, it again outperforms LMDS in almost all measures. There are two main reasons why the technique can perform better than other linear methods. First, it uses a well-known feature of high-dimensional spaces, namely the high probability of two sampled vectors being nearly orthogonal, to build a more accurate geometric model. Secondly, for a data set within a complex manifold, the use of a small number of sampled reference points, as opposed to a much larger number required to produce a linear transform, seems to give a better reference model for the transform. It is noteworthy that, for example, the two-dimensional reductions shown in the the example are derived from a set of 1000 reference points for the PCA transform, but only two randomly-selected reference points for the nSimplex Zen transform; it seems scarcely credible that the latter almost always give much better outcomes. One drawback of the technique is that the range of the nSimplex Zen transform is not a Euclidean space, and therefore cannot be used for low-dimensional visualisations of data. However, small projected sets can be re-modelled using MDS to produce such a visualisation if desired. The nSimplex Zen function does possess the triangle inequality property, and the reduced space can therefore be used with metric indexing techniques. 7.1 Very small distances The nSimplex Zen function has been seen in some spaces to be less good at preserving ordering over very small distances than other techniques, in particular when applied to relatively low-dimensional spaces, or spaces which lie within a relatively uniform low-dimensional manifold. This is a significant drawback as it means the technique may not be the best for performing similarity search over a large reduced-dimension space. The reason for this is understood: there is an absolute lower-bound on any distance measured within the reduced space based on the altitude of the last derived component of the representative simplex. As the simplest case, the nSimplex Zen distance between any object and itself, i.e. d(u, u), projected into any dimen- sion, is calculated as (cid:112)2x2 k, where xk is the value of the final-dimension coordinate in the transformed space. This nSimplex Zen distance may well be greater than to another object y where the other components are similar and yk is coincidentally smaller than xk. In high-dimensional spaces very small distances are very rare, and this problem seems to be more evident in the lower- dimensional spaces we have tested. The probability of it occurring however is currently beyond our understanding; in some of our experiments it presents a problem, in others it does not. We would be reasonably optimistic that the effect could be at least partly overcome with some more research into its cause, and one factor that we know does make a difference is the choice of reference objects. 27 A PREPRINT - FEBRUARY 23, 2023 7.2 Choice of Reference Objects As would be expected, the choice of reference objects used to construct the simplex has a significant effect on the quality of the reduction transforms. In particular, it is possible for a pathological choice to result in the formation of a simplex which can be embedded in less than the required number of Euclidean dimensions. This does not lead to an incorrect situation, but one where the vectors comprising the individual vertex points do not form a basis for the desired projection space, therefore leading to a loss of information potential. In a high-dimensional space the probability of this happening by chance is in fact vanishingly small, and it is easy to check during simplex construction at which point a different choice of reference object can be made. The problem is only likely to occur in practice if the space is contained in a manifold whose intrinsic dimensionality is close to the dimensionality of the projection. In all other cases, the quality of the transform can still be greatly affected by the choice of objects. We have spent some effort in seeking an optimal strategy, and have so far failed to improve, in general, on a random selection, other than when the projection is to very low dimensions. We used the random strategy in all of the reported experimental results, and consider this point as further work. In outline, other than for a very small selection of reference objects, a random choice is highly likely to reflect the properties of the manifold in which the data is contained, and thus form a natural basis for the projection of the rest of that manifold. 8 Conclusions We have presented a novel dimensionality reduction technique based on a geometric model of high-dimensional metric spaces. In an extensive range of tests, it outperforms any of the other well-known general techniques for Euclidean spaces. It gives particularly good relative performance when reductions from high to low dimensions are performed. Furthermore, it can be applied to a wide range of Hilbert spaces. While there are still many unanswered questions as to its improvement, and the optimisation of its performance, we are convinced that the nSimplex Zen transform provides an exciting new tool to the dimensionality reduction toolbox. Acknowledgements This work was partially funded by AI4Media - A European Excellence Centre for Media, Society and Democracy (EC, H2020 n. 951911), and National Centre for HPC, Big Data and Quantum Computing (CUP B93C22000620006). References [1] Large powers of sine appear gaussian - why?, Accessed: 2023-01-19. [2] Dimitris Achlioptas. Database-friendly random projections. In Proceedings of the Twentieth ACM SIGMOD- SIGACT-SIGART Symposium on Principles of Database Systems, PODS '01, page 274–281, New York, NY, USA, 2001. Association for Computing Machinery. [3] Christian Beecks, Merih Seran Uysal, and Thomas Seidl. Signature quadratic form distances for content-based similarity. In Proceedings of the 17th ACM International Conference on Multimedia, MM '09, page 697–700, New York, NY, USA, 2009. Association for Computing Machinery. [4] Avrim Blum, John Hopcroft, and Ravindran Kannan. High-Dimensional Space, page 4–28. Cambridge Univer- sity Press, 2020. [5] L. M. Blumenthal. Theory and applications of distance geometry. Clarendon Press, 1953. [6] Leonard M Blumenthal. A note on the four-point property. Bulletin of the American Mathematical Society, 39(6):423–426, 1933. [7] Michael M. Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: Going beyond euclidean data. IEEE Signal Processing Magazine, 34(4):18–42, 2017. [8] Chris Burges, Tal Shaked, Erin Renshaw, Ari Lazier, Matt Deeds, Nicole Hamilton, and Greg Hullender. Learn- ing to rank using gradient descent. In Proceedings of the 22nd International Conference on Machine Learning, ICML '05, page 89–96, New York, NY, USA, 2005. Association for Computing Machinery. [9] T Tony Cai, Jianqing Fan, and Tiefeng Jiang. Distributions of angles in random packing on spheres. Journal of Machine Learning Research, 14:1837, 2013. 28 A PREPRINT - FEBRUARY 23, 2023 [10] Edgar Chávez, Gonzalo Navarro, Ricardo Baeza-Yates, and José Luis Marroquín. Searching in metric spaces. ACM Comput. Surv., 33(3):273–321, September 2001. [11] R. Connor, F. A. Cardillo, L. Vadicamo, and F. Rabitti. Hilbert Exclusion: Improved metric search through finite isometric embeddings. ACM Transactions on Information Systems (TOIS), 35(3):17:1–17:27, December 2016. [12] R. Connor, L. Vadicamo, F. A. Cardillo, and F. Rabitti. Supermetric search with the four-point property. In Proceedings of 9th International Conference on Similarity Search and Applications (SISAP 2016), Lecture Notes in Computer Science, pages 51–64. Springer International Publishing, 2016. [13] R. Connor, L. Vadicamo, F. A. Cardillo, and F. Rabitti. Supermetric search. Information Systems, 80:108–123, 2019. [14] R. Connor, L. Vadicamo, and F. Rabitti. High-dimensional simplexes for supermetric search. In Proceedings of 10th International Conference on Similarity Search and Applications (SISAP 2017), Lecture Notes in Computer Science, pages 96–109. Springer International Publishing, 2017. [15] Richard Connor. A tale of four metrics. In Laurent Amsaleg, Michael E. Houle, and Erich Schubert, editors, Similarity Search and Applications, pages 210–217, Cham, 2016. Springer International Publishing. [16] Richard Connor and Franco Alberto Cardillo. Quantifying the specificity of near-duplicate image classification functions. In VISAPP 2016, 2016. [17] Richard Connor, Al Dearle, and Lucia Vadicamo. Modelling string structure in vector spaces. In Proceedings of the 27th Italian Symposium on Advanced Database Systems (SEBD 2019). CEUR-WS.org, 2019. [18] Richard Connor and Alan Dearle. Sampled angles in high-dimensional spaces. In International Conference on Similarity Search and Applications, pages 233–247. Springer, 2020. [19] Richard Connor, Lucia Vadicamo, and Fausto Rabitti. High-dimensional simplexes for supermetric search. CoRR, abs/1707.08370, 2017. [20] Michael AA Cox and Trevor F Cox. Multidimensional scaling. In Handbook of data visualization, pages 315– 347. Springer, 2008. [21] Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. pages 647–655, 10 2013. [22] Karl Pearson F.R.S. Liii. on lines and planes of closest fit to systems of points in space. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 2(11):559–572, 1901. [23] Yunchao Gong, Sanjiv Kumar, Vishal Verma, and Svetlana Lazebnik. Angular quantization-based binary codes for fast similarity search. 2, 01 2012. [24] Antonio Gracia, Santiago González, Victor Robles, and Ernestina Menasalvas. A methodology to compare dimensionality reduction algorithms in terms of loss of quality. Information Sciences, 270:1–27, 2014. [25] Mark J. Huiskes and Michael S. Lew. The mir flickr retrieval evaluation. In MIR '08: Proceedings of the 2008 ACM International Conference on Multimedia Information Retrieval, New York, NY, USA, 2008. ACM. [26] Herve Jégou, Matthijs Douze, and Cordelia Schmid. Product quantization for nearest neighbor search. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(1):117–128, 2011. [27] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural In Proceedings of the 25th International Conference on Neural Information Processing Systems - networks. Volume 1, NIPS'12, page 1097–1105, Red Hook, NY, USA, 2012. Curran Associates Inc. [28] D.G. Lowe. Object recognition from local scale-invariant features. In Proceedings of the Seventh IEEE Interna- tional Conference on Computer Vision, volume 2, pages 1150–1157 vol.2, 1999. [29] Prasanta Chandra Mahalanobis. On the generalized distance in statistics. Proceedings of the National Institute of Sciences (Calcutta), 2:49–55, 1936. [30] Christopher D. Manning, Prabhakar Raghavan, and Hinrich Schütze. Introduction to Information Retrieval. Cambridge University Press, 2008. [31] Jiri Matousek. Lectures on discrete geometry, volume 212. Springer Science & Business Media, 2013. [32] K. Menger. Untersuchungen ber allgemeine metrik. Mathematische Annalen, 100:75–163, 1928. [33] David Novak, Jan Cech, and Pavel Zezula. Efficient image search with neural net features. In Proceedings of the 8th International Conference on Similarity Search and Applications - Volume 9371, SISAP 2015, page 237–243, Berlin, Heidelberg, 2015. Springer-Verlag. 29 A PREPRINT - FEBRUARY 23, 2023 [34] Aude Oliva and Antonio Torralba. Modeling the shape of the scene: A holistic representation of the spatial envelope. International Journal of Computer Vision, 42:145–175, 2004. [35] Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In Empirical Methods in Natural Language Processing (EMNLP), pages 1532–1543, 2014. [36] Aviad Rubinstein. Hardness of approximate nearest neighbor search. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2018, page 1260–1268, New York, NY, USA, 2018. Asso- ciation for Computing Machinery. [37] Vin Silva and Joshua Tenenbaum. Sparse multidimensional scaling using landmark points. Technology, 01 2004. [38] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, In Proceedings of the IEEE Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. Conference on Computer Vision and Pattern Recognition (CVPR), June 2015. [39] B. Thomee, B. Elizalde, D. .A Shamma, K. Ni, G. Friedland, D. Poland, D. Borth, and L-J Li. YFCC100M: The new data in multimedia research. Communications of the ACM, 59(2):64–73, 2016. [40] Lucia Vadicamo, Claudio Gennaro, Fabrizio Falchi, Edgar Chávez, Richard Connor, and Giuseppe Amato. Re- ranking via local embeddings: A use case with permutation-based indexing and the nsimplex projection. Infor- mation Systems, 95:101506, 2021. [41] Aaron R. Voelker, Jan Gosmann, and Terrence C. Stewart. Efficiently sampling vectors and coordinates from the n-sphere and n-ball. Technical report, Centre for Theoretical Neuroscience, Waterloo, ON, 01 2017. [42] Wallace A Wilson. A relation between metric and euclidean spaces. American Journal of Mathematics, 54(3):505–517, 1932. [43] Pavel Zezula, Giuseppe Amato, Vlastislav Dohnal, and Michal Batko. Similarity search: the metric space approach, volume 32 of Advances in Database Systems. Springer, 2006. Appendices A Hilbert-embeddable Distance Metrics Distance metrics are usually referred to by name, but these names are often subject to details of context and may mean subtly different things to different readers. The following gives unambiguous definitions of metrics to which we refer in the text, all of which are isometrically embeddable in Hilbert space. In all cases we refer to a domain of vectors v, w ∈ Rn indexed as vi, wi, 1 ≤ i ≤ n. A.1 Euclidean Distance A.2 Cosine Distance (cid:96)2(v, w) = (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) i=1 (vi − wi)2 (10) This term is particularly problematic; in some contexts it refers to simply the complement of the cosine of the angle between vectors, which is not a proper metric; in some it refers to the angle between vectors, which is a proper metric, and in some cases it means the Euclidean distance between the (cid:96)2-normalised vectors, which is a proper, Hilbert- embeddable metric. Note that all three forms give the same rank ordering. We use the last form: Dcos(v, w) = (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) i=1 (cid:18) vi (cid:107)v(cid:107) (cid:19)2 − wi (cid:107)w(cid:107) (11) which is generally efficient to evaluate as it is equivalent to Euclidean distance over (cid:96)2-normalised data. Note however that the general properties of such spaces are generally very different to Euclidean spaces due to this tight constraint over the data distribution. 30 A.3 Jensen-Shannon Distance A PREPRINT - FEBRUARY 23, 2023 This distance is applicable only to (cid:96)1-normalised positive vectors, as it derives from a metric over probability distribu- tions. It is defined as Djsd(v, w) = (cid:112)K(v, w) where K(v, w) = 1 − 1 2 n (cid:88) i=1 (h(vi) + h(wi) − h(vi + wi)) h(x) = −x log2 x (12) (13) (14) In sparse spaces the term 0 log 0 may occur; this is taken as 0, rather than undefined. This is a reasonable interpretation as this is the limit of the term e log e as e tends to 0 from above. A.4 Triangular Distance This distance is applicable only to (cid:96)1-normalised positive vectors. Its main value is as a (much cheaper and very accurate in high dimensions) estimator for Jensen-Shannon distance [15]. Dtri(v, w) = (cid:118) (cid:117) (cid:117) (cid:116) 1 2 n (cid:88) i=1 (vi − wi)2 vi + wi In sparse spaces the term 0/0 may occur; this is taken as 0, rather than undefined. A.5 Quadratic Form Distance The Quadratic Form Distance associated to a symmetric semi-definite positive matrix M ∈ Rn×n is defined as DM(v, w) = (cid:113) (v − w)T M (v − w) (15) (16) When the matrix M is diagonal the corresponding distance is a weighted Euclidean distance. Notable examples include Mahalanobis distance [29], and the Signature Quadratic Form distance [3]. B Simplex Construction This section gives an inductive algorithm (Algorithm 1) to construct a simplex in n dimensions based only on the distances measured among n + 1 points. For the base case of a one-dimensional simplex (i.e. two points with a single distance δ) the construction is simply Σ = (cid:21) (cid:20)0 δ (17) For an n-dimensional simplex, where n ≥ 2, the distances among n + 1 points are given. In this case, an (n − 1)- dimensional simplex is first constructed using the first n points. This simplex is used as a simplex base to which a new apex, the (n + 1)th point, is added by the following ApexAddition algorithm (Algorithm 2). For an arbitrary set of objects si ∈ U, the apex σ(si) can be pre-calculated. When a query is performed, only n distances in the metric space require to be calculated to discover the new apex σ(q) in (cid:96)n 2 . In essence, the ApexAddition algorithm is derived from exactly the same intuition as the lower-bound property ex- plained earlier. Proofs of correctness for both the construction and the lower-bound property are included hereafter for the interested reader. 31 A PREPRINT - FEBRUARY 23, 2023 Algorithm 1: nSimplexBuild Input: n + 1 reference points r1, . . . , rn+1 ∈ (U, d) Output: n-dimensional simplex in (cid:96)n 2 represented by the matrix Σ ∈ R(n+1)×n 1 Σ = 0 ∈ R(n+1)×n; 2 if n = 1 then 3 δ = d(r1, r2); (cid:21) (cid:20)0 ; δ Σ = 4 return Σ; 5 6 end 7 ΣBase = nSimplexBuild(r1, . . . , rn); 8 Distances = 0 ∈ Rn; 9 for 1 ≤ i ≤ n set Distances[i] = d(ri, rn+1); 10 newApex = ApexAddition(ΣBase, Distances); 11 for 1 ≤ i ≤ n and 1 ≤ j ≤ i − 1 set Σ[i][j] to ΣBase[i][j]; 12 for 1 ≤ j ≤ n set Σ[n + 1][j] to newApex[j]; 13 return Σ; Algorithm 2: ApexAddition Input: A (n − 1)-dimensional base simplex and the distances between a new (unknown) apex point and the vertices of the base simplex:  0 ΣBase = v2,1 v3,1 0 v3,2        : vn,1         0 0 vn,n−1 . . . . . . * * * ∈ Rn×n−1 Output: The cartesian coordinates of the new apex point Distances = [δ1 * * * δn] ∈ Rn 1 Output = [δ1 0 2 for i = 2 to n do 3 * * * 0] ∈ Rn; 4 5 6 7 l = (cid:96)2(ΣBase[i], Output); δ = Distances[i]; x = ΣBase[i][i − 1]; y = Output[i − 1]; Output[i − 1] = y − (δ2 − l2)/2x; Output[i] = +(cid:112)y2 − (Output[i − 1])2; 8 9 end 10 return Output 32 C Proof of correctess, ApexAddition and nSimplex lwb A PREPRINT - FEBRUARY 23, 2023 Lemma C.1 (Correctness of the ApexAddition algorithm). Let ΣBase ∈ Rn×n−1 representing a (n − 1)-dimensional simplex of vertices ΣBase[i] ∈ (cid:96)n−1 , with ΣBase[i][j] = 0 for all j ≥ i and ΣBase[n][n−1] ≥ 0. Let vi the corresponding vertices in (cid:96)n 2 (obtained from ΣBase[i] by adding a zero to the end of the vector) and let δi the distance between an unknown apex point and the vertex vi. Let o = [o1 on] the output of the ApexAddition Algorithm. Then o is a feasible apex, i.e. it is a point in Rn satisfying (cid:96)2(o, vi) = δi for all 1 ≤ i ≤ n. The last component on is non-negative and represents the altitude of o with respect to a base face ΣBase. . . . 2 Proof. It is sufficient to prove that the output o = [o1 vi, i.e. satisfies the following equations . . . on] of the Algorithm 2 has distance δi from the vertex    o2 1 + * * * + o2 n = δ2 1 : (cid:80)i−1 j=1(vi,j − oj)2 + (cid:80)n j=i o2 j = δ2 i : (cid:80)n−1 j=1 (vn,j − oj)2 + o2 n = δ2 n (18.1) (18.i) (18.n) (18) Note that the i-th component of the output o is updated only at the iteration i and i + 1 of the ApexAddition Algorithm. So, if we denote with o(i) the output at the end of iteration i we have: o(1) = [δ1 oi = o(h) , i 0 . . . 0] o(i) on = o(n) n , h = 0 i − (cid:80)i−2 j=1(vi,j − oj)2 − (vi,i−1 − o(i−1) δ2 i−1 )2 oi−1 = o(i−1) i−1 − 2vi,i−1 (oi−1)2 = (o(i−1) i−1 )2 − (o(i) i )2 1 ≤ i < h ≤ n 2 ≤ i ≤ n 1 ≤ i ≤ n − 1 (19) (20) (21) (22) By combining Eq. (20) and (22) we obtain (cid:80)n (case i = 1). Moreover, it follows that o satisfies Eq. (18.i) for all i = 2, . . . , n: j = (o(i) j=i o2 i )2 for all 1 ≤ i ≤ n − 2, and so Eq. (18.1) clearly holds i−1 (cid:88) (vi,j − oj)2 + j=1 n (cid:88) j=i j = v2 o2 i,i−1 − 2vi,i−1 oi−1 + i−2 (cid:88) j=1 (vi,i−1 − oj)2 + (o(i−1) i−1 )2 (21)= δ2 i Lemma C.2 (n-Simplex Distance Constraint). Let (U, d) a space (n + 2)-embeddable in (cid:96)n+1 . Let r1, . . . , rn ∈ U and, for any m ≤ n, let σm the (m − 1)-dimensional simplex generated from r1, . . . , rm by using the nSimplexBuild Algorithm. For any x ∈ U, let x(m) ∈ (cid:96)m 2 the apex point with distance d(x, r1), . . . , d(x, rm) from the vertices of σm, computed using the ApexAddition Algorithm. Then for all q, s ∈ U, 2 1. (cid:96)m−1 2 (s(m−1), q(m−1)) ≤ (cid:96)m 2 (s(m), q(m)) for 2 ≤ m ≤ n 2. g(s(m−1), q(m−1)) ≥ g(s(m), q(m)) for 2 ≤ m ≤ n 3. (cid:96)n 2 (s(n), q(n)) ≤ d(s, q) ≤ g(s(n), q(n)) where, for any k ∈ N, g : (cid:96)k 2 → (cid:96)k 2 is defined as g(x, y) = Proof. By construction, for any m ≤ n we have i i = x(m−1) x(m) x(i) i ≥ 0 (x(m) m−1)2 + (x(m) m )2 = (x(m−1) m−1 )2 (cid:113)(cid:80)k−1 i=1 (xi − yi)2 + (xk + yk)2. i = 1, . . . , m − 2 i = 1, . . . , m (23) (24) (25) 33 Condition 1 directly follows from Eq. (23)-(25): A PREPRINT - FEBRUARY 23, 2023 2 (s(m), q(m))2 = (cid:96)m−1 (cid:96)m 2 = (cid:96)m−1 2 (s(m−1), q(m−1))2 − (s(m−1) m−1 − q(m−1) m−1 )2 + m (cid:88) (s(m) i − q(m) i )2 (s(m−1), q(m−1))2 + 2 (cid:113) (cid:104) − s(m) m−1q(m) i=m−1 m q(m) m−1 − s(m) m (cid:113) + (s(m) m−1)2 + (s(m) m )2 (q(m) m−1)2 + (q(m) m )2 where the last passage follows from the Cauchy–Schwarz inequality13. ≥ (cid:96)m−1 2 (s(m−1), q(m−1))2 Similarly, Condition 2 also holds: g(s(m), q(m))2 = g(s(m−1), q(m−1))2 + 2 (cid:104) m−1q(m) m−1 + s(m) − s(m) (cid:113) m q(m) m (cid:113) − (s(m) m−1)2 + (s(m) m )2 (q(m) m−1)2 + (q(m) m )2 (cid:105) (cid:105) ≤ g(s(m−1), q(m−1))2. Now we prove that (cid:96)n 2 (s(n), q(n)) and g(s(n), q(n)) are, respectively, a lower bound and an upper bound for the actual distance d(s, q). The main idea is using the simplex σn spanned by r1, . . . , rn as a base face to build the simplex σn+1 spanned by r1, . . . , rn, s and then use the latter as base face to build the simplex σn+2 spanned by r1, . . . , rn, s, q. In this way, we have an isometric embedding of r1, . . . , rn, s, q into (cid:96)n+1 that is the function that maps r1, . . . , rn, s, q into the vertices of σn+2. So, given the base simplex σn (represented by the matrix Σn), and the apex s(n), q(n) ∈ (cid:96)n 2 we have that the simplex σn+2 is represented by 2 Σn+2 =       Σn * * * * * * s(n) 1 q(n) 1 0 s(n) n−1 q(n) n−1 s(n) n q(n+1) n 0 q(n+1) n+1       ∈ Rn+2×n+1 (26) where, by construction, (q(n+1) between the two last rows of Σn+2. n+1 )2 = (q(n) n )2 − (q(n+1) n )2, s(n) n , q(n+1) n+1 ≥ 0, and d(q, s) equals the Euclidean distance It follows that d(q, s)2 = n−1 (cid:88) i=1 |, we have and, since q(n) n ≥ |q(n+1) n (s(n) i − q(n) i )2 + (s(n) n )2 + (q(n) n )2 − 2s(n) n q(n+1) n ; (27) d(q, s)2 = (cid:96)n 2 (s(n), q(n))2 + 2s(n) n (q(n) n − q(n+1) n ) ≥ (cid:96)n 2 (s(n), q(n))2, and d(q, s)2 = g(s(n), q(n))2 − 2s(n) n (q(n) n + q(n+1) n ) ≤ g(s(n), q(n))2 Finally, we observe that since (q(n+1) θ ∈ [0, π] such that n+1 )2 + (q(n+1) n )2 = (q(n) n )2, q(n+1) n+1 ≥ 0, and q(n) n ≥ 0, there exists an angle (cid:40) q(n+1) n q(n+1) n+1 = q(n) = q(n) n cos θ n sin θ (28) 13Cauchy–Schwarz inequality in two dimension is: (a1b1 + a2b2)2 ≤ (a2 1 + a2 2)(b2 1 + b2 2) ∀a1, b1, a2, b2 ∈ R, which implies (a1b1 + a2b2) ≤ (cid:113) (a2 1 + a2 2) (cid:113) (b2 1 + b2 2) ∀a1, b1, a2, b2 ∈ R 34 A PREPRINT - FEBRUARY 23, 2023 Therefore, Eq. 27 can be rewritten as d(q, s)2 = n−1 (cid:88) i=1 (s(n) i − q(n) i )2 + (s(n) n )2 + (q(n) n )2 − 2s(n) n q(n) n cos θ; In other words, if σ : D → Rn is the nSimplex transform defined by a set of n reference points then for any s, q ∈ D given the transformed points x = σ(s) an y = σ(q) it holds (cid:118) (cid:117) (cid:117) (cid:116) n−1 (cid:88) (xi − yi)2 + x2 n + y2 n − 2xnyn cos θ d(q, s) = (29) i=1 D Data sets used in experiments While all the software used in experiments described is available from https://github.com/richardconnor/ dr-matlab-code, the data sets are typically too large to provide conveniently and we therefore provide brief descrip- tions of their provenance. Generated uniform data All generated data is created using the MatLab rand function from the Statistics and Ma- chine Learning toolbox. For example a set of one thousand objects of one hundred dimensions is created by the single line data = rand(1000,100); Twitter GloVe The GloVe data used derives from https://nlp.stanford.edu/projects/glove/ where the data and instructions for downloading it can be found. We used the 200-dimensional vectors. MF1M The images from which this data derives are available from https://press.liacs.nl/mirflickr/ mirdownload.html. We use the one million image set. For input to AlexNet, whole images were reduced to 227 x 227 using ImageMagick. The 4096-dimensional vectors were obtained by applying the MatLab release of AlexNet, which is also available from other domains in other languages. In MatLab, the fc6 layer used is simply extracted by code such as fc6 = activations(net,thisImage,"fc6","OutputAs","rows"); ANN SIFT The ANN SIFT data, along with code to extract it, is available from http://corpus-texmex.irisa. fr/. GIST Again the Mir Flickr one million image collection was used to produce the GIST data. Although not fully documented, GIST representations of the images are also available from https://press.liacs. nl/mirflickr/mirflickr1m.v3b/; alternatively MatLab code to create GIST descriptors is available at https://people.csail.mit.edu/torralba/code/spatialenvelope/ E Measuring the quality of dimensionality reduction E.1 Global Structure Shepard Diagrams give a visual overview of the quality of a transform. For a given set of data all distances δij are plotted against the reduced dimensional distances ζij. In most general terms, the closer the plot lies to the y = x diagonal, the better the reduction. Kruskal Stress To quantify the visual effect, Shepard diagrams are usually overlaid with an isotonic regression func- tion calculated from the original and reduced spaces, as used to calculate Kruskal's stress function. The stress function is given by: (cid:115) (cid:80) SK = i<j(ζij − d∗ i<j ζ 2 ij (cid:80) ij)2 (30) where d∗ is the value given by a function implied from the least-squares isotonic regression calculated from the finite data presented in the chart. 35 A PREPRINT - FEBRUARY 23, 2023 The point of fitting an isotonic regression is that the stress function assigns a value according to the mono- tonicity of the reduction transform, rather than the absolute values produced. PCA, for example, is a reduction mapping: in all cases, ζij ≤ δij. However if the function τ : δij → ζij is perfectly monotonic, the stress will be zero despite the reduction in individual values, even if this is non-linear. E.2 Distance Preservation Sammon Stress derives from Sammon Mapping, a non-linear dimensionality reduction technique similar to MDS which minimises the stress function: SS = (cid:80) 1 i<j δij (cid:88) i<j (δij − ζij)2 δij (31) Unlike Kruskal's stress function, Sammon stress is affected by the absolute differences between ζij and δij rather than their isotonic relationship, and so gives a further useful perspective on the quality of a reduction transform. Quadratic Loss is a purely distance-based technique, the quadratic function used to punish the production of outliers: SQ = (cid:88) i<j (δij − ζij)2 (32) In fact we view this function as somewhat of a blunt instrument, as it punishes even regular deviations from original distances. For example, PCA is a contraction function, while RP is not; RP often performs better for quadratic loss even when the quality of the reduction is clearly, overall, lower. Even if the absolute deviation from original distance is important, it may often be possible to apply a scaling function to the reduced space in order to minimise this. As discussed in Appendix E.4, we require all quality measures to be bounded in [0, 1] to allow visual com- parisons over different reduction dimensions. There is no natural upper-bound on this measure, so we simply convert an outcome of q to qmax−q to produce the desired range, where qmax is the greatest value obtained in qmax the context of the visualisation. E.3 Topology Preservation Spearman Rho measures the preservation of rank ordering among pairwise distances measured between correspond- ing objects in the domain and range of the reduction transform. This is a useful measure for many applica- tions, such as nearest-neighbour analysis, where the absolute distances among values are of no interest other than for the ordering which they induce over other elements of the set. (cid:1) of Pairwise distances from a sample set of n objects are used to construct an ordering z of size T = (cid:0)n pairs δij. A ranking z(cid:48) is then created according to the relative distances of the same pairs of objects after the transform is applied. The Spearman Rho function is then given as 2 SR = 1 − 6 (cid:80)T i=1(z(i) − ˆz(i))2 T 3 − T (33) where the adjusting factors combine to give an output in the range [−1, 1] where 1 implies a perfect preser- vation of distance ordering and −1 implies the inverse correlation. There are other forms of this formula, but we choose this one to faithfully follow the exact methodology of [24]. Although all of our other quality measures are normalised into [0, 1], the fact that the outcome of zero implies an effectively random ordering suits our purpose in this respect. kNN Query Recall When the purpose of dimension reduction is to speed up similarity search, the most important outcome is the nearest-neighbour topology. To an extent this is tested by both Kruskal stress and Spearman Rho quality measures, but with the crucial difference that in the context of query recall it is only the smallest distances, relative to a query, that are relevant. Thus, a transform which preserves very small distances well, but is less good over larger distances, will be preferable to one which preserves distances overall, although the latter may score better in these quality measures. To measure this quality, it is necessary to construct a nearest-neighbour ground truth over a representative sample of queries for a large data set, and then compare the nearest neighbours of those queries in the reduced- dimension space. One problem is that the pattern of nearest neighbours depends on specific details of the space being considered, as well as more general properties of the reduction. The larger the space, the smaller 36 A PREPRINT - FEBRUARY 23, 2023 the nearest-neighbour distances will be, and the higher the probability of having very close matches which are not representative of the general space. To overcome some of these issues we measure recall using the following assumptions: 1. only a small percentage of the true nearest neighbours are of any significance 2. the nearer true neighbours are considerably more significant than the further neighbours 3. preservation of order in the results is also important Our recall measurement therefore uses a discounted cumulative gain (DCG) function over a relevance func- tion based on nearest-neighbour rank. The ranking function is constructed to give significantly higher importance to the closer neighbours by using the logistic function to give an inverse sigmoid function over rank. In our experiments we have collected 1,000 nearest neighbours from a collection of one million data, and rank the relevance of each true nearest neighbour as Ri = 1 − 1 (cid:16) 1 + e− i−500 100 (cid:17) (34) for the ith true nearest neighbour. We then compare the 1,000 nearest neighbours returned by the DR function using the DCG variant defined in [8]: DCGDR = 1000 (cid:88) 2DRi − 1 log2 i + 1 (35) i where DRi is Ri applied to the position in the true nearest neighbours of the object found in the ith position of the nearest neighbours according to the DR transform. Finally, this function produces an arbitrary maximum value of 66.0435 when lists of length 1,000 are in perfect correlation, and so the outcome is divided by this factor to give a normalised value in the range [0, 1], where 0 means there is no overlap between the lists and 1 means they are in perfect correlation. E.4 Quality profiles As discussed in [24], it is instructive to consider the quality of transforms as a profile over different reduction di- mensions. This may be shown as a plot where one or more of the numeric quality functions is plotted against the dimension of the reduction, typically as this is reduced from the original dimensionality of the original domain down to 2. For most mechanisms and useful quality measures, this will result in a monotonic decreasing plot, and will allow the selection of the most useful compromise in terms of quality loss for a given reduction dimension. To allow presentation of all quality measures within the same bounds, Kruskal and Sammon and stress measurements are subtracted from 1 to give a quality rather than a stress measure, and the results in the range [0, 1] are given. A negative value can arise from either Spearman Rho (which is bounded in [−1, 1] or Sammon stress (which has no formal upper bound) but in reality a value of less than 0 for Spearman Rho, or greater than 1 for Sammon stress, effectively means that the transform has no practical value and a zero quality rating is reasonable. For quadratic loss there are no natural bounds, and this is handled as explained in Appendix E.2. 37
http://arxiv.org/abs/2302.11485v1
2023-02-22T16:32:44
2023-02-22T16:32:44
Efficient Training of Large-scale Industrial Fault Diagnostic Models through Federated Opportunistic Block Dropout
Artificial intelligence (AI)-empowered industrial fault diagnostics is important in ensuring the safe operation of industrial applications. Since complex industrial systems often involve multiple industrial plants (possibly belonging to different companies or subsidiaries) with sensitive data collected and stored in a distributed manner, collaborative fault diagnostic model training often needs to leverage federated learning (FL). As the scale of the industrial fault diagnostic models are often large and communication channels in such systems are often not exclusively used for FL model training, existing deployed FL model training frameworks cannot train such models efficiently across multiple institutions. In this paper, we report our experience developing and deploying the Federated Opportunistic Block Dropout (FEDOBD) approach for industrial fault diagnostic model training. By decomposing large-scale models into semantic blocks and enabling FL participants to opportunistically upload selected important blocks in a quantized manner, it significantly reduces the communication overhead while maintaining model performance. Since its deployment in ENN Group in February 2022, FEDOBD has served two coal chemical plants across two cities in China to build industrial fault prediction models. It helped the company reduce the training communication overhead by over 70% compared to its previous AI Engine, while maintaining model performance at over 85% test F1 score. To our knowledge, it is the first successfully deployed dropout-based FL approach.
[ "Yuanyuan Chen", "Zichen Chen", "Sheng Guo", "Yansong Zhao", "Zelei Liu", "Pengcheng Wu", "Chengyi Yang", "Zengxiang Li", "Han Yu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11485v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11485v1", "@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 2 2 ] G L . s c [ 1 v 5 8 4 1 1 . 2 0 3 2 : v i X r a Efficient Training of Large-scale Industrial Fault Diagnostic Models through Federated Opportunistic Block Dropout Yuanyuan Chen1*, Zichen Chen1,2*, Sheng Guo3*, Yansong Zhao1, Zelei Liu1, Pengcheng Wu1, Chengyi Yang3, Zengxiang Li3†, Han Yu1† 1 School of Computer Science and Engineering, Nanyang Technological University, Singapore 2 University of California, Santa Barbara, CA, USA 3 Digital Research Institute, ENN Group, Beijing, China †Corresponding authors: [email protected], [email protected] Abstract Artificial intelligence (AI)-empowered industrial fault diag- nostics is important in ensuring the safe operation of indus- trial applications. Since complex industrial systems often in- volve multiple industrial plants (possibly belonging to differ- ent companies or subsidiaries) with sensitive data collected and stored in a distributed manner, collaborative fault diag- nostic model training often needs to leverage federated learn- ing (FL). As the scale of the industrial fault diagnostic mod- els are often large and communication channels in such sys- tems are often not exclusively used for FL model training, existing deployed FL model training frameworks cannot train such models efficiently across multiple institutions. In this paper, we report our experience developing and deploying the Federated Opportunistic Block Dropout (FEDOBD) ap- proach for industrial fault diagnostic model training. By de- composing large-scale models into semantic blocks and en- abling FL participants to opportunistically upload selected important blocks in a quantized manner, it significantly re- duces the communication overhead while maintaining model performance. Since its deployment in ENN Group in Febru- ary 2022, FEDOBD has served two coal chemical plants across two cities in China to build industrial fault prediction models. It helped the company reduce the training commu- nication overhead by over 70% compared to its previous AI Engine, while maintaining model performance at over 85% test F1 score. To our knowledge, it is the first successfully deployed dropout-based FL approach. Introduction In modern industries, machinery is becoming increasingly sophisticated and facing highly demanding operational con- ditions. For example, rotating machinery (e.g., turbines, fans and pumps) are key components that are widely used in power generation and chemical plants. Slight performance deterioration, if not addressed early, could lead to sud- den breakdowns or even serious accidents involving signif- icant financial losses and/or human casualty. As industries modernize towards the vision of Industry 4.0 (Ghobakhloo 2020), a wide variety of sensing devices are starting to be deployed in industrial settings to help monitor important *These authors contributed equally. Copyright © 2023, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. equipment. The data collected by such devices make it pos- sible to train intelligent fault diagnostic models for system maintenance decision support. Artificial intelligence (AI) technologies have increasingly been applied in industrial fault diagnostic model training. The performance of such machine learning-based solutions depends on having access to large amounts of high quality data. However, data from a single factory might not be ad- equate to train such models effectively. As data are often collected and owned by different organizations in a given field, collaborative model training (Warnat-Herresthal et al. 2021) has been recognized as a useful technique to improve the quality of AI solutions in such situations. As societies become increasingly aware of data privacy protection issues (e.g., following the introduction of data privacy regulations such as the General Data Protection Regulation (GDPR) (GDPR 2018)), federated learning (FL) (Yang et al. 2019; Kairouz, McMahan et al. 2021) - a privacy-preserving collaborative machine learning paradigm - has emerged. It has been rapidly gaining traction and has been applied in wide-ranging applications including safety management (Liu et al. 2020), banking (Long et al. 2020) and smart healthcare (Liu et al. 2022b). In recent years, industrial fault detection applications powered by FL are starting to emerge (Ma, Wen, and Wen 2021; Zhang et al. 2021; Geng et al. 2022; Wang et al. 2022). These applications generally build on top of the pop- ular Federated Averaging (FedAvg) FL model aggregation approach (McMahan et al. 2017). Although they are useful for supporting privacy-preserving collaborative model train- ing, they are not optimized for training large-scale deep neu- ral network (DNN) models which are commonly required to build effective industrial fault diagnostic models (Liu et al. 2022a). This is exacerbated by constraints on bandwidth us- age for FL model training imposed by industries as the com- munication channel is often shared by multiple applications, some of which are safety critical. To address the aforementioned challenges facing FL- based industrial fault diagnostics solutions, we propose the Federated Opportunistic Block Dropout (FEDOBD) ap- proach (Chen et al. 2022). Its advantages are as follows: 1. Training Large-scale DNNs Efficiently: FEDOBD di- vides a DNN into semantic blocks. Based on evaluat- ing the importance of the blocks (instead of determin- ing individual parameter importance like in the cases of (Bouacida et al. 2021; Gunesli et al. 2021)), it oppor- tunistically discards unimportant blocks in order to dras- tically reduce the size of the resulting model. Combined with parameter quantization, FEDOBD can significantly reduce the communication overhead incurred during FL model training. 2. Preserving Model Performance: As blocks that are most important to the performance of the FL model are retained, FEDOBD can preserve model performance. 3. Supporting Incentive Distribution: By storing the his- torical records of the important blocks contributed to FL model training by each data owner, FEDOBD can pro- vide useful information for contribution-based incentive allocation (Cong et al. 2020; Yu et al. 2020). Compared to existing efficient FL model training frame- works, FEDOBD offers new capabilities which can support more sophisticated use cases. The FEDOBD approach has been deployed through a collaboration between ENN Group1 and the Trustworthy Federated Ubiquitous Learning (TrustFUL) Lab2, Nanyang Technological University (NTU), Singapore since February 2022. It is used to replace the FedAvg model aggregation approach in the ENN FL model training platform to sup- port FL model training under server-based horizontal FL set- tings (Yang et al. 2019). In such scenarios, FL participants' datasets have large overlaps in the feature space, but little overlap in the sample space. It has helped ENN Group train intelligent industrial fault diagnostic models involving two factories from two cities in China. Throughout the deploy- ment period, FEDOBD has helped ENN Group reduce the training communication overhead by over 70% compared to its previous implementation, while maintaining model per- formance at over 85% test F1 score. To the best of our knowledge, it is the first dropout-based federated learning method successfully deployed in industrial settings. With the help of FEDOBD, the ENN Group federated learning subsystem has avoided the problems of long de- lays of training/updating industrial fault prediction models through FL, while maintaining comparable model perfor- mance. This capability allows it to provide more rapid up- date of such models to its enterprise customers and sub- sidiaries, thereby improving safe operation. Application Description Founded in 1989, ENN Group's business encompasses a di- verse range of segments within the natural gas and green energy industry including distribution, trade, transportation and storage, production, and intelligent engineering, with the aim of creating modern energy systems that improve people's quality of life. Leveraging its diverse industrial ecosystem, ENN has been building up an industrial dig- ital intelligence platform in order to empower the stake- holders involved (including more than 25 million house- 1https://www.enn.cn/ 2https://trustful.federated-learning.org/ Figure 1: An overview of the ENN intelligent industrial fault diagnostics platform. hold customers and over 200,000 enterprise customers in 20 provinces across China). In this section, we provide detailed descriptions of the ENN FL model training platform, which is part of its industrial digital intelligence platform. The overall flow of this platform is shown in Figure 1. En- terprise customers under the ENN Group (e.g., coal chem- ical plants) deploy sensing devices within their factories to monitor equipment operation and collect data. These data are stored locally within the data silo. Standard data prepro- cessing (e.g., Fourier transform, wavelet transform) is car- ried out locally to prepare the data for analysis and model training. Nevertheless, as equipment faults do not occur fre- quently, such data tend to be sparse and biased within each data silo. The ENN Group offers its enterprise customers and subsidiaries from the same industry sectors the option to join FL to collaboratively train fault diagnostic models. Our focus is on its FL model training subsystem with a client- server architecture. It consists of two components (Figure 2): 1) the ENN FL Server, and 2) the ENN FL Client. ENN FL Server The ENN FL Server hosts the FL model aggregation server and a set of utility modules supporting the operations which system administrators need to perform. It allows the system administrators to select from a range of FL model train- ing and aggregation approaches (e.g., FedAvg (McMahan et al. 2017), FEDOBD) incorporated into the system, select the base model to be trained via FL, and configure the FL model training process. These operations can be carried out through a dedicated set of user interfaces. Once the config- uration steps are completed, the information is sent to the FL model aggregation server for execution via a local area network (LAN). As the LAN is a dedicated communication channel for FL related operations, it does not place any re- strictions on bandwidth usage. The FL model aggregation server is implemented follow- ing a modular design to enable it to host alternative FL model aggregation approaches. It takes local model updates Data PreprocessingFederated LearningFault Diagnostic ModelFourier TransformWavelet Transform Time and Frequency Domain IndexEquipment Data CollectionShaft Trajectory... Figure 2: An overview of the ENN FL model training platform - Client-Server FL Subsystem. Figure 3: An example user interface of the ENN Client- Server FL Subsystem (configuring FL training). Figure 5: An example user interface of the ENN Client- Server FL Subsystem (model performance summary). cated to just FL model training. Transmissions for other op- erational and business purposes also go through the ENN WAN. Thus, this channel places a limit of up to 2 MB/sec to be used for FL model training purposes, which severely restricts the speed of training large-scale models through FL. Figure 3 to Figure 5 illustrate the user interfaces (UIs) through which the ENN FL model training platform visual- izes the FL training process for the system administrators. As it is designed for Chinese speaking users, we have an- notated regions in the UIs to highlight key design features. Figure 3 shows the screen for the administrator to configure the FL training process for a particular model by specifying important parameters (e.g., mode of federated learning, the selected model training and aggregation approach). Once FL training commences, the training activities are visualized in Figure 4 for the administrators to monitor. In the example in Figure 4, one FL server and two FL clients are involved. Activities performed by the server and each client are listed in the corresponding box, making it easy to scroll back and forth for an overview, and drill down into each record for more detailed information. The overall training progress is illustrated in the FL training flowchat on the left hand side panel. After training is concluded, a summary of the perfor- mance of the resulting FL model as shown in Figure 5 is presented to the administrators. Detailed FL model training activities and performance evaluation results are stored by the platform to support review and auditing in the future. Figure 4: An example user interface of the ENN Client- Server FL Subsystem (FL training process visualization). from FL clients as inputs, and produces a global FL model as the output, while making decisions on whether additional rounds of FL training are required. Communication with the clients is managed by the Communication Management module, which can accommodate special requirements (e.g., the need for compressing the transmission via stochastic quantization (Alistarh et al. 2017)). This is because com- munications between the ENN FL Server and the ENN FL Clients (which are deployed in different factories) take place over the ENN wide area network (WAN), which is not dedi- ENN FL ServerDocker Image ManagementFL Training Approach BaseModel BaseFL Model Training ConfigurationUser InterfacesCommunication ManagementFL Model Aggregation ServerGlobal Model AggregationLocal Dock Image HarborDocker CE on LinuxENN FL ClientLocal Database ServerENN Industrial Fault Diagnostic SystemData & Signal ProcessingEquipment Fault Diagnostic LogsDNN-based Fault DiagnosisCommunication & Storage ManagementSensing and Data Collection EquipmentCommunication ManagementLocal Model TrainingLocal Dock Image HarborDocker CE on LinuxDataModel DeploymentLANENN WAN (2MB/sec allowed for FL model training)FL Client Agent ENN FL Client Typically, each ENN FL Client is deployed in an indus- trial facility (e.g., factory, power plant, coal chemical plant). In the application of our focus, industrial fault diagnostics, each facility deploys a set of sensors to monitor the indus- trial equipment and collect the necessary data. The Com- munication & Storage Management module aggregates the data and stores them into the Local Database Server in the correct format. On top of this infrastructure, the ENN Indus- trial Fault Diagnostic System carries out data and signal pro- cessing, and performs fault prediction using a DNN-based model. In order to leverage industrial fault data collected by different facilities, this DNN-based fault prediction model is to be trained through FL. Each ENN FL Client is incorporated with an FL Client Agent module. Similar to the ENN FL Server, it is also im- plemented following the modular design approach to enable it to host alternative FL model training and updating ap- proaches. The dedicated Communication Management mod- ule is also included to accommodate special transmission requirements and to comply with the 2 MB/sec transmis- sion bandwidth usage limit placed on the ENN WAN for FL model training. Use of AI Technology In this section, we describe the AI Engine of the ENN FL model training subsystem, which is based on FEDOBD. The workflow of the AI Engine is illustrated in Figure 6. FE- DOBD (Chen et al. 2022) enables the FL server and each FL client to determine the most important subset of parameters of a large-scale deep neural network (DNN) model (which are organized into semantic blocks) to be sent back and forth during FL model training, thereby reducing the communica- tion overhead incurred. Currently, it only supports horizon- tal federated learning (HFL) in which data owners have large overlaps in the feature space, but little overlap in the sample space (Yang et al. 2019). In a client-server HFL system, there are in general n clients who can participate in FL model training. Each client i has a local dataset Di = (cid:8)(cid:0)xj, yj . xj denotes the j-th local training sample. yj denotes the corresponding ground truth label of xj. Mi denotes the total number of data samples in Di. The aim of HFL is to solve the follow- ing optimization problem under the aforementioned setting: (cid:1)(cid:9)Mi j=1 min w∈W n (cid:88) i=1 Mi M Li(w; Di). (1) Here, W denotes the parameter space determined by a given neural network. M := Σn i=1Mi denotes the total number of samples. Li(w; Di) := 1 j=1 (cid:96)(w; xj, yj) denotes the Mi local loss of a given client i. (cid:80)Mi Opportunistic Block Dropout (OBD) A DNN can be divided into semantic blocks consisting of consecutive layers. Under the FEDOBD FL model training approach, important semantic blocks in a DNN are identi- fied at the end of any given round of FL client local train- ing or FL server aggregation. Once this is done, semantic blocks are selected in descending order of their importance until a dropout rate pre-specified by the system administra- tors has been reached. Then, only these selected blocks of the DNN, instead of the entire model, are transmitted to fa- cilitate FL model training. This design of FEDOBD is dif- ferent from existing dropout-based FL training approaches including FedDropoutAvg approach (Gunesli et al. 2021) and Adaptive Federated Dropout (AFD) approach (Bouacida et al. 2021). Both of which randomly select individual model parameters to be dropped out without organizing the model into semantic blocks first, making the resulting model diffi- cult to compress during transmission. sequences FEDOBD can support popular NN architectures when decomposing the models. Layer such as (cid:104)Convolution, Pooling, Normalization, Activation(cid:105) are com- monly found in convolutional neural networks (CNNs). En- coder layers are commonly found in Transformer based models. Other NNs can include basic building blocks which can be used to divide a given model into blocks. Other layers which cannot be grouped into commonly found functional block patterns can be treated as singleton blocks. FEDOBD uses the Mean Block Difference (MBD) metric to measure block importance. It can be computed as follows: MBD(br−1, br,i) := (cid:107)vector(br−1) − vector(br,i)(cid:107)2 NumberOfParameters(br−1) . (2) br−1 denotes the blocks of a previous model (e.g., the re- ceived global FL model). br,i denotes the corresponding blocks in an updated model (e.g., the local model trained by a client i in the current round). vector is an operator that concatenates parameters from different layers of a block (if there are multiple layers involved) into a single vector. The larger the MBD value of a block, the more important the newer version of this block is. The Opportunistic Block Dropout (OBD) algorithm of FEDOBD is shown in Algorithm 1. Before a model is sent out either by the FL server or client, each block is assigned an importance score. To achieve this goal, the sending entity stores wr−1 which can be used to compare with the current model wr,i in a block by block fashion by following Eq. (2). Once the MBD values for all the blocks have been com- puted, FEDOBD determines which blocks to retain and which to be dropped (Lines 5-15) by ranking in descend- ing order of their MBD values (with the MaxHeap data structure), and putting the blocks into the retained blocks list one by one until the size of the revised model reaches (1−λ)|vector(wr,i)|. λ ∈ [0, 1] is the dropout rate (where 1 indicates the entire model is dropped out, and 0 indi- cates no dropout). The retained blocks are then quantized in preparation for transmission. Each retained block is stored in the form of the differences between the corresponding pa- rameter values in block br and block br−1. Figure 6: The workflow of the FEDOBD approach. Algorithm 1: OBD Input : global model wr−1, local model wr,i in client i, the set of identified block structures B, dropout rate λ ∈ [0, 1]. Output: retained blocks. important blocks[MBD(br−1, br,i)] ← br,i; 1 important blocks ← MaxHeap(); 2 foreach b ∈ B do 3 4 end 5 revised model size ← 0; 6 retained blocks ← List(); 7 while important blocks do 8 br,i ← important blocks.pop(); new size ← revised model size + |vector(br,i)|; if new size > (1 − λ)|vector(wr,i)| then 9 10 11 12 13 continue; end revised model size ← new size; retained blocks.append(br,i); 14 15 end 16 return retained blocks; Overall Workflow of FEDOBD The overall workflow of the FEDOBD approach is illus- trated in Figure 6. 1. Model Distribution: If it is the first time the initialized global FL model is distributed to the FL clients, the entire model is sent out by the FL server. Otherwise, the server performs OBD to determine the list of important blocks of the model to be retained based on the given dropout rate, and only sends out the quantized version of these retained blocks to the clients. 2. Reconstruction of the Global Model: When the re- tained blocks from the server in round r is received by a client, it combines them with unchanged (i.e., not trans- mitted) blocks from the global model wr−1 which it has received in the previous round to reconstruct wr. Local training is then carried out based on this reconstructed global model. 3. 2-Stage Local Model Training: FEDOBD is imple- mented as a two-stage training process. In the first stage, small local epochs are used. OBD selects important blocks to be transmitted, and these blocks are further compressed via quantization. In this way, FEDOBD en- courages frequent aggregation to prevent overfitting in a communication efficient manner. As the global FL model approaches convergence, FEDOBD transits into the sec- ond stage in which FL model training is switched to the training-aggregation mode. It consists of a single round of training with more local epochs with FL model aggre- gation being executed at the end of each epoch. In this way, the global FL model is fine-tuned through more fre- Reconstruct Global Model Divide Global Model into BlocksServer1Global ModelWeight BlocksClientSend to ClientsGlobal ModelClient's Model2After LocalTraining3Block DropoutCalculate ImportanceT O P 2T O P 1T O P 3T O P 2T O P 1T O P 3T O P 2T O P 1DropoutSend to Server......4a. Reconstruct Client Models......After AggregationClient ModelsGlobal ModelNew Global Modelb. Distribute the Global Model to ClientsPrevious Global ModelServer Figure 7: Deployment of FEDOBD into the ENN Client-Server FL Subsystem. quent aggregations in order to improve its performance. 4. Model Aggregation: When the retained blocks from a client i in round r is received, the FL server combines them with unchanged (i.e., not transmitted) blocks from the previous global model wr−1 to reconstruct wr,i. The reconstructed local model updates for all clients are then aggregated into a new global FL model wr following Fe- dAvg (McMahan et al. 2017). Steps 1 to 4 are repeated until model convergence. For more details about FEDOBD, please refer to (Chen et al. 2022). Application Development and Deployment The FEDOBD framework has been developed based on the PyTorch (Paszke et al. 2017) framework by teams from the Trustworthy Federated Ubiquitous Learning (TrustFUL) Lab, Nanyang Technological University (NTU), Singapore, and the Digital Research Institute, ENN Group, Beijing, China. Before deploying the AI Engine, we have evaluated it against the classic FedAvg and four state-of-the-art efficient FL model training approaches. They are: 1. FedAvg (McMahan et al. 2017): It is a classic FL approach which does not involve any compression or dropout operation. 2. SignSGD (Bernstein et al. 2018): It is a distributed gradi- ent compression approach which only requires the signs of the gradients of client model updates to be sent to the FL server. The server aggregates the gradients by major- ity voting. 3. FedPAQ (Reisizadeh et al. 2020): It is a stochastic quantization-based FL approach designed to reduce com- munication overhead. 4. Adaptive Federated Dropout (AFD) (Bouacida et al. 2021): It is an FL approach that optimizes server-client communications and computation costs jointly. Each client trains a selected subset of the global model pa- rameters. We adopt the Single-Model Adaptive Feder- ated Dropout (SMAFD) variant for comparison. 5. FedDropoutAvg (Gunesli et al. 2021): It is an FL ap- proach that randomly drops out a subset of model param- eters as well as randomly drops out some clients before performing FedAvg. To compare the efficiency and performance of these ap- proaches under different FL settings, we designed FL sce- narios involving 10 clients to perform image classification on the CIFAR-10 datasets (Krizhevsky, Hinton et al. 2009) and sentiment classification on the IMDB dataset (Maas et al. 2011). The original test data are split uniformly to form separate validation and test datasets. The local training and validation dataset of each client are sampled following an i.i.d. setting. The FL server holds the test dataset. For the image classification tasks under CIFAR-10, we use FL to train a DenseNet-40 (Huang et al. 2017) base model which contains around 190,000 model parameters. For the senti- ment classification task under IMDB, we use FL to train a Transformer based classification model consisting of 2 en- coder layers followed by a linear layer with around 17 mil- lion model parameters. The results are summarized in Table 1. Communication overhead is computed as the product between the average fraction of model size (in MBs) transmitted per FL train- ing step and the total number of FL training steps required. It can be observed that FEDOBD significantly outperforms all existing approaches in terms of reducing communication overhead. In terms of test accuracy of the resulting model, FEDOBD significantly outperforms existing compression or dropout-based efficient FL training approaches, achieving comparable performance to FedAvg which does not engage in any model compression or dropout. The results helped the design team make the decision to adopt FEDOBD as the FL approach for training large-scale industrial fault diagnostic models in the ENN platform. FEDOBD is deployed into the ENN Client-Server FL Subsystem as an alternative FL training approach the sys- CIFAR-10 IMDB FedAvg SignSGD FedPAQ SMAFD FedDropoutAvg FEDOBD Test Test Communication Communication Overhead (MB) Accuracy Overhead (MB) Accuracy 84.68% 50.21% 82.94% 63.94% 84.17% 84.98% 131,494.20 327,100.00 41,541.05 63,365.16 43,992.33 12,899.03 1,467.30 7,208.75 463.54 522.23 512.20 101.59 89.36% 60.18% 89.22% 17.38% 87.53% 90.17% Table 1: Pre-deployment experiment results. ENN FL ServerDocker Image ManagementFL Training Approach BaseModel BaseFL Model Training ConfigurationUser InterfacesCommunication ManagementFL Model Aggregation ServerFedOBDModel Recons-tructionGlobal FL Model Aggrega-tionFedOBDModel Distribu-tionIntermediate Model LogsLocal Dock Image HarborDocker CE on LinuxENN FL ClientLocal Database ServerENN Industrial Fault Diagnostic SystemData & Signal ProcessingEquipment Fault Diagnostic LogsDNN-based Fault DiagnosisCommunication & Storage ManagementSensing and Data Collection EquipmentCommunication ManagementFedOBDModel Recons-tructionFedOBD2-Stage Model TrainingFedOBDLocal Model UpdatingIntermediate Model LogsLocal Dock Image HarborDocker CE on LinuxDataModel DeploymentLANENN WAN (2MB/sec allowed for FL model training)FL Client AgentAB Figure 8: The architecture of the fault prediction deep neural network model. tem administrators can choose to use. It is added into the user interface as a new option that can be selected during FL training configuration (Figure 3). Once FEDOBD is se- lected as the FL training approach from the user interface, the model reconstruction method, the global model aggre- gation method and the the block dropout and model dis- tribution method under FEDOBD are loaded into the FL server. The intermediate model logs module is also included in the FL server to store the global model from the previous round to facilitate the evaluation of block importance by FE- DOBD, as illustrated in Figure 7 (within the dashed rectan- gle A). At the same time, the model reconstruction method, the 2-stage model training method and the the block dropout and model uploading method under FEDOBD are loaded into the FL Client Agent. Similarly, the intermediate model logs module is included in the FL Client Agent to store the global model from the previous round to facilitate the eval- uation of block importance by FEDOBD, as illustrated in Figure 7 (within the dashed rectangle B). In this way, FE- DOBD is incorporated into the ENN FL platform. Application Use and Payoff FEDOBD has been deployed in ENN Group since Febru- ary 2022 as part of its intelligent industrial fault diagnostics platform. Since its deployment, the company has switched from the original FedAvg based FL model training and ag- gregation approach to FEDOBD for part of its enterprise customers. So far, FEDOBD has been used to help two well-established coal chemical plants located in two cities in China to train AI models for industrial fault prediction.3 Figure 8 illustrates the architecture of the DNN adopted by the ENN Group for fault prediction in the current de- ployment cycle. The model consists of a variety of vibration signal analysis methods to preprocess the original vibration signals to improve the interpretability of the model. Among them, the spectrum and the axis trajectory can show the fre- quency doubling component related to the rotating speed in the signal, which is helpful for diagnosing shaft faults. En- velope, continuous wavelet transform (CWT) and wavelet packet transform (WPT) can extract high-frequency impact components from the signal, which is helpful for diagnos- ing bearing and gearbox related faults. The attention block is used to adjust the importance of the features from differ- ent input blocks. At the end, two ResNet blocks are used to diagnose the two major types of faults, respectively. The model contains 29 million model parameters. FEDOBD is configured with the same hyperparameters as the previous FedAvg FL model training approach in the system. Specifically, a local learning rate of 10−5 is used in the ENN FL Clients. A quantization weight of 0.01 is used for quantizing uploaded and distributed models. Only a single local epoch is used in FedAvg and the first stage of FEDOBD. For the second training stage of FEDOBD, two local epochs are used. Table 2 shows the average communication overhead of training the fault prediction model until convergence for each round of model update, as well as the average test 3At the request of our industry partners, the identities of these factories are withheld. Attention BlockSpectrumInput x3ResNetBlockEnvelopInput x3ResNetBlockCWTInput x3ResNetBlockWPTInput x3ResNetBlockOriginal SignalInput x3ResNetBlockAxis TrajectoryInput x3ResNetBlockResNetBlockResNetBlockResNetBlockShaft FaultBearing Fault ENN FL Training Approach Previous AI Engine FEDOBD AI Engine Communication Overhead (MB) 368, 407.60 104, 188.50 Test F1 Score 85.52 ± 0.83% 85.02 ± 0.23% Table 2: Deployment results. F1 score of the resulting models thus far into the deploy- ment period under FEDOBD. The results under the Previ- ous AI Engine reflects the same items but were collected during system operations in 2021 prior to switching to FE- DOBD. It can be observed that FEDOBD saves commu- nication overhead by 71.72%, while achieving comparable model performance. Due to the 2 MB/sec bandwidth usage limit placed on FL model training related communications by ENN Group, under the previous AI Engine, it took more than 2 days (around 52 hours) to train an updated version of the fault prediction model involving the two factories. Under the FEDOBD AI Engine, this time is reduced to about half a day (around 14.5 hours). As new data generated by the equipment monitoring sens- ing devices are continually accumulated over time from and new equipment can be deployed in the factories from time to time, it is necessary to frequently retrain the fault predic- tion model via FL to keep it update to date. The deployment of FEDOBD has cut down the model training time by more than half while maintaining model performance, thereby en- abling timely retraining of the model for enhanced safety and efficiency of operation. Maintenance The AI Engine follows a modular design approach to achieve separation of concerns. Thus far into the deploy- ment period, although there have been changes in person- nel access rights and operating parameters in the system as well as frequent retraining of the fault prediction model via FEDOBD, such changes have not necessitated any AI main- tenance task for the AI Engine. Lessons Learned During Deployment During the process of deploying the FEDOBD approach, there are several lessons worth sharing. Firstly, the quality of training data is important to training effective industrial fault prediction models. The data clean- ing and preprocessing steps by each participating data owner play an important role in model training. As data prepro- cessing is still mainly performed based on human experi- ence, it can be expensive and prone to human errors. Since not all industry data owners have an in-house data science team, it could be a challenge to obtain preprocessed local data with consistently high quality. Thus, it could be useful to adopt privacy-preserving data selection approaches such as (Li et al. 2021) to automate this process. Secondly, as industrial fault prediction is an important application with high impact on operation safety and con- tinuity, industry partners prefer some degrees of model interpretability. Although there exist parameter dropout- based FL approaches that can improve training efficiency (Bouacida et al. 2021; Gunesli et al. 2021), their lack of in- terpretability on parameter dropout decisions hinders indus- try adoption. The block importance values produced during the intermediate steps of FEDOBD are helpful in providing the decision-makers with much needed transparency to alle- viate such concerns. Last but not least, as time goes by, new monitoring data from the participating factories will continue to be gener- ated. Previously unencountered fault types may emerge. In addition, the data distribution might also change, resulting in concept drift (Lu et al. 2018). These factors can be espe- cially pronounced when new machines are incorporated into the factories. Thus, the performance of previously trained FL models can deteriorate in the face of these factors. There- fore, appropriate incremental training and updating strate- gies of the FL model need to be put in place to ensure suc- cessful deployment. Conclusions and Future Work In this paper, we reported on our experience using a dropout- based technique to enhance efficient collaborative training of large-scale deep models through federated learning for industrial fault diagnostic models involving multiple facto- ries. We developed the FEDOBD FL model training and aggregation approach, which leverages a novel opportunis- tic importance-based semantic block dropout method in combination with quantization-based FL model parameter compression to drastically reduce communication overhead while preserving model performance. Since its deployment in February 2022 in ENN Group, FEDOBD has helped two well-established coal chemical plants in two cities in China to train machine learning models for fault diagnostics in or- der to support predictive maintenance, and has made signif- icant positive impact on ENN Group's operations. In future, we will enhance the robustness of FEDOBD against malicious FL participants (Lyu et al. 2020). We will also explore how to link block importance evaluation with FL client contribution evaluation to enhance fairness (Shi, Yu, and Leung 2021), as well as personalizing the resulting models (Tan et al. 2022) to FL participants. Eventually, we aim to incorporate FEDOBD into an opensource FL frame- work such as Federated AI Technology Enabler (FATE) (Liu et al. 2021) and make it available to more developers, re- searchers and practitioners. Acknowledgements This research is supported, in part, by the National Research Foundation, Singapore under its AI Singapore Programme (AISG Award No: AISG2-RP-2020-019); the RIE 2020 Ad- vanced Manufacturing and Engineering (AME) Program- matic Fund (No. A20G8b0102), Singapore; Nanyang Assis- tant Professorship (NAP); and Future Communications Re- search & Development Programme (FCP-NTU-RG-2021- 014). Any opinions, findings and conclusions or recommen- dations expressed in this material are those of the author(s) and do not reflect the views of National Research Founda- tion, Singapore. References Alistarh, D.; Grubic, D.; Li, J.; Tomioka, R.; and Vojnovic, M. 2017. QSGD: Communication-efficient SGD via gradi- ent quantization and encoding. NeurIPS, 30: 1709–1720. Bernstein, J.; Wang, Y.-X.; Azizzadenesheli, K.; and Anand- kumar, A. 2018. SignSGD: Compressed optimisation for non-convex problems. In ICML, 560–569. Bouacida, N.; Hou, J.; Zang, H.; and Liu, X. 2021. Adaptive Federated Dropout: Improving Communication Efficiency and Generalization for Federated Learning. In INFOCOM Workshops, 1–6. Chen, Y.; Chen, Z.; Wu, P.; and Yu, H. 2022. FedOBD: Opportunistic Block Dropout for Efficiently Training Large- scale Neural Networks through Federated Learning. arXiv preprint arXiv:2208.05174. Cong, M.; Yu, H.; Weng, X.; Qu, J.; Liu, Y.; and Yiu, S. M. 2020. A VCG-based Fair Incentive Mechanism for Feder- ated Learning. arXiv preprint arXiv:2008.06680. GDPR. 2018. General data protection regulation. https:// gdpr-info.eu/. Accessed: 2021-12-08. Geng, D.; He, H.; Lan, X.; and Liu, C. 2022. Bearing fault diagnosis based on improved federated learning algorithm. Computing, 104: 1–19. Ghobakhloo, M. 2020. Industry 4.0, digitization, and oppor- tunities for sustainability. Journal of Cleaner Production, 252: doi:10.1016/j.jclepro.2019.119869. Gunesli, G. N.; Bilal, M.; Raza, S. E. A.; and Rajpoot, N. M. 2021. FedDropoutAvg: Generalizable federated learn- ing for histopathology image classification. arXiv preprint arXiv:2111.13230. Huang, G.; Liu, Z.; Maaten, L. V. D.; and Weinberger, K. Q. 2017. Densely connected convolutional networks. In CVPR, 4700–4708. Kairouz, P.; McMahan, H. B.; et al. 2021. Advances and open problems in federated learning. Foundations and Trends in Machine Learning, 14(1-2): 1–210. Krizhevsky, A.; Hinton, G.; et al. 2009. Learning multiple layers of features from tiny images. Li, A.; Zhang, L.; Wang, J.; Tan, J.; Han, F.; Qin, Y.; Freris, N. M.; and Li, X.-Y. 2021. Efficient Federated-Learning Model Debugging. In ICDE, 372–383. Liu, C.; Cichon, A.; Kr ́olczyk, G.; and Li, Z. 2022a. Tech- nology development and commercial applications of indus- trial fault diagnosis system: a review. International Journal of Advanced Manufacturing Technology, 118: 3497–3529. Liu, Y.; Fan, T.; Chen, T.; Xu, Q.; and Yang, Q. 2021. FATE: An Industrial Grade Platform for Collaborative Learning With Data Protection. Journal of Machine Learning Re- search, 22(226): 1–6. Liu, Y.; Huang, A.; Luo, Y.; Huang, H.; Liu, Y.; Chen, Y.; Feng, L.; Chen, T.; Yu, H.; and Yang, Q. 2020. FedVision: An Online Visual Object Detection Platform Powered by Federated Learning. In IAAI, 13172–13179. Liu, Z.; Chen, Y.; Zhao, Y.; Yu, H.; Liu, Y.; Bao, R.; Jiang, J.; Nie, Z.; Xu, Q.; and Yang, Q. 2022b. Contribution-Aware Federated Learning for Smart Healthcare. In IAAI, 12396– 12404. Long, G.; Tan, Y.; Jiang, J.; and Zhang, C. 2020. Federated Learning for Open Banking. In Yang, Q.; Fan, L.; and Yu, H., eds., Federated Learning: Privacy and Incentive, 240– 254. Springer. Lu, J.; Liu, A.; Dong, F.; Gu, F.; Gama, J.; and Zhang, G. IEEE 2018. Learning under Concept Drift: A Review. Transactions on Knowledge and Data Engineering, 31(12): 2346–2363. Lyu, L.; Yu, H.; Ma, X.; Sun, L.; Zhao, J.; Yang, Q.; and Yu, P. S. 2020. Privacy and Robustness in Federated Learning: Attacks and Defenses. arXiv preprint arXiv:2012.06337. Ma, X.; Wen, C.; and Wen, T. 2021. An Asynchronous and Real-Time Update Paradigm of Federated Learning for Fault IEEE Transactions on Industrial Informatics, Diagnosis. 17(12): 8531–8540. Maas, A. L.; Daly, R. E.; Pham, P. T.; Huang, D.; Ng, A. Y.; and Potts, C. 2011. Learning Word Vectors for Sentiment Analysis. In ACL, 142–150. McMahan, B.; Moore, E.; Ramage, D.; Hampson, S.; and y Arcas, B. A. 2017. Communication-Efficient Learning In AISTATS, of Deep Networks from Decentralized Data. 1273–1282. Paszke, A.; Gross, S.; Chintala, S.; Chanan, G.; Yang, E.; DeVito, Z.; Lin, Z.; Desmaison, A.; Antiga, L.; and Lerer, A. 2017. Automatic differentiation in PyTorch. In NIPS-W. Reisizadeh, A.; Mokhtari, A.; Hassani, H.; Jadbabaie, A.; and Pedarsani, R. 2020. FedPAQ: A communication- efficient federated learning method with periodic averaging and quantization. In AISTATS, 2021–2031. Shi, Y.; Yu, H.; and Leung, C. 2021. Fairness-Aware Federated Learning. arXiv:2111.01872. Tan, A. Z.; Yu, H.; Cui, L.; and Yang, Q. 2022. To- IEEE Trans- wards personalized federated learning. actions on Neural Networks and Learning Systems, doi:10.1109/TNNLS.2022.3160699. Wang, X.; Garg, S.; Lin, H.; Hu, J.; Kaddoum, G.; and Pi- ran, M. J. 2022. Toward Accurate Anomaly Detection in Industrial Internet of Things Using Hierarchical Federated IEEE Internet of Things Journal, 9(10): 7110– Learning. 7119. Warnat-Herresthal, S.; Schultze, H.; Shastry, K. L.; and et al. 2021. Swarm Learning for decentralized and confidential clinical machine learning. Nature, 594: 265–270. Yang, Q.; Liu, Y.; Cheng, Y.; Kang, Y.; Chen, T.; and Yu, H. 2019. Federated Learning. Morgan & Claypool Publishers. Yu, H.; Liu, Z.; Liu, Y.; Chen, T.; Cong, M.; Weng, X.; Niy- ato, D.; and Yang, Q. 2020. A Fairness-aware Incentive Scheme for Federated Learning. In AIES, 393–399. Zhang, W.; Li, X.; Ma, H.; Luo, Z.; and Lie, X. 2021. Fed- erated learning for machinery fault diagnosis with dynamic validation and self-supervision. Knowledge-Based Systems, 213: doi:10.1016/j.knosys.2020.106679. Towards arXiv preprint
http://arxiv.org/abs/2302.11479v1
2023-02-22T16:28:08
2023-02-22T16:28:08
Drop Edges and Adapt: a Fairness Enforcing Fine-tuning for Graph Neural Networks
The rise of graph representation learning as the primary solution for many different network science tasks led to a surge of interest in the fairness of this family of methods. Link prediction, in particular, has a substantial social impact. However, link prediction algorithms tend to increase the segregation in social networks by disfavoring the links between individuals in specific demographic groups. This paper proposes a novel way to enforce fairness on graph neural networks with a fine-tuning strategy. We Drop the unfair Edges and, simultaneously, we Adapt the model's parameters to those modifications, DEA in short. We introduce two covariance-based constraints designed explicitly for the link prediction task. We use these constraints to guide the optimization process responsible for learning the new "fair" adjacency matrix. One novelty of DEA is that we can use a discrete yet learnable adjacency matrix in our fine-tuning. We demonstrate the effectiveness of our approach on five real-world datasets and show that we can improve both the accuracy and the fairness of the link prediction tasks. In addition, we present an in-depth ablation study demonstrating that our training algorithm for the adjacency matrix can be used to improve link prediction performances during training. Finally, we compute the relevance of each component of our framework to show that the combination of both the constraints and the training of the adjacency matrix leads to optimal performances.
[ "Indro Spinelli", "Riccardo Bianchini", "Simone Scardapane" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11479v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11479v1", "@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 2 2 ] G L . s c [ 1 v 9 7 4 1 1 . 2 0 3 2 : v i X r a Drop Edges and Adapt: a Fairness Enforcing Fine-tuning for Graph Neural Networks Indro Spinellia, Riccardo Bianchini, Simone Scardapanea,∗ aDepartment of Information Engineering, Electronics and Telecommunications (DIET), Sapienza University of Rome, Via Eudossiana 18, 00184 Rome, Italy Abstract The rise of graph representation learning as the primary solution for many different network science tasks led to a surge of interest in the fairness of this family of methods. Link prediction, in particular, has a substantial social im- pact. However, link prediction algorithms tend to increase the segregation in social networks by disfavoring the links between individuals in specific demo- graphic groups. This paper proposes a novel way to enforce fairness on graph neural networks with a fine-tuning strategy. We Drop the unfair Edges and, simultaneously, we Adapt the model's parameters to those modifications, DEA in short. We introduce two covariance-based constraints designed ex- plicitly for the link prediction task. We use these constraints to guide the optimization process responsible for learning the new 'fair' adjacency matrix. One novelty of DEA is that we can use a discrete yet learnable adjacency ma- trix in our fine-tuning. We demonstrate the effectiveness of our approach on five real-world datasets and show that we can improve both the accuracy and the fairness of the link prediction tasks. In addition, we present an in-depth ablation study demonstrating that our training algorithm for the adjacency matrix can be used to improve link prediction performances during training. Finally, we compute the relevance of each component of our framework to show that the combination of both the constraints and the training of the adjacency matrix leads to optimal performances. Keywords: Graph Neural Network; Fairness; Link Prediction ∗Corresponding author. Phone: +39 06 44585495, Fax: +39 06 4873300. Email address: [email protected] (Simone Scardapane) Preprint submitted to Neural Networks February 23, 2023 1. Introduction The fairness of graph representation learning algorithms is quickly be- coming a crucial area of research. Of particular interest is the fairness issue associated with the link prediction task. This task is heavily applied in two of the most influential AI-powered domains of our digital life, social net- works and products recommendation. Social network topologies define the stream of information we will receive, often influencing our opinion McPher- son et al. (2001); Halberstam and Knight (2016); Lee et al. (2019); Abbass (2018). Nevertheless, malicious users can modify topologies to spread false in- formation Roy and Chahar (2021). Similarly, recommender systems suggest products tailored to our characteristics and history of purchases. However, pursuing the highest accuracy led to the discrimination of minorities in the past Corbett-Davies et al. (2017); Obermeyer et al. (2019), despite the law prohibiting unfair treatment based on sensitive traits such as race, religion, and gender. The unfairness arises even if the sensitive attributes are not used explicitly in the learning model. For example, most social networks are homophily-dominant. Nodes in the local neighbourhood belong to the same sensitive class with minimal connections across nodes of differing sensitive attributes. Therefore communities isolate themselves polarizing the opinions expressed within the communities. This effect is also known as the filter bubble problem. The same issue affects the bipartite graphs of users and items used in product recommendations. In Nguyen et al. (2014), the au- thors concluded that recommender systems reduce the exposition of the user to a subset of the items available over time. For example, streaming services may recommend movies from a particular genre to users from a specific gen- der. Thus, link prediction algorithms have a substantial social impact and can worsen existing biases in the data. However, enforcing the prediction of new links to be fair can mitigate the issue. Graph neural networks (GNNs) Bronstein et al. (2017); Bacciu et al. (2020); Spinelli et al. (2021) provide state-of-the-art link prediction results with an end-to-end learning paradigm. A common approach to improve the fairness of these algorithms requires the introduction of fairness enforcing constraints during a model's training Bose and Hamilton (2019). Another strategy involves the modification of the graph's topology for post-processing the model's prediction Spinelli et al. (2022); Dai and Wang (2020); Loveland et al. (2022). Along this, the community is studying how to measure the actual fairness introduced in the system by these methods. Link predic- 2 tion requires a dyadic fairness measure that considers the influence of both sensitive attributes associated with the connection Masrour et al. (2020). However, most works on fairness measures focus on independent and iden- tically distributed (i.i.d.) data. A common solution consists in determining new groups defined for the edges. Then, it is possible to measure the level of equity of a new edge added to the graph by applying the known fairness metrics to these new groups. Since training is the most expensive phase in the modern machine learn- ing pipeline (excluding data harvesting and labelling), we designed a fine- tuning strategy named DEA, where we learn to modify the graph's topology and adapt the parameters of the network to those modifications. A novel covariance-based constraint designed for the link prediction task guides the fine-tuning. We introduce a novel parametrization that allows the new ad- jacency's optimization in its discrete form. We apply a variation of the Gumbel-max trick Jang et al. (2017) paired with a small multilayer percep- tron that allows us to sample the edges from the original adjacency matrix. 2. Related Works In this section, we focus on the recent contributions to the fair graph representation learning field. Although the extensive and interdisciplinary literature Chiappa (2019); Chiappa et al. (2020) on algorithmic bias, the study of fairness in graph representation learning is recent. The surge of in- terest is due to the state-of-the-art results of graph neural networks (GNNs) in many graph-based tasks. Some works focused on the node embeddings task to create fair embeddings to use as the input of a downstream link prediction task. Compositional fairness constraints Bose and Hamilton (2019) learn a set of adversarial filters that remove information about particular sensitive attributes. GUIDE Song et al. (2022) maximize overall individual fairness minimizing at the same time group disparity of individual fairness across dif- ferent groups. FairWalk Rahman et al. (2019) is an adaptation of Node2Vec Grover and Leskovec (2016) that aims to increase the fairness of the resulting embeddings. It modifies the transition probability of the random walks at each step, by weighing the neighbourhood of each node, according to their sensitive attributes. The recent work of Li et al. (2021) learns a fair ad- jacency matrix during an end-to-end link prediction task. FairAdj uses a graph variational autoencoder Kipf and Welling (2016) as base architecture and introduces two different optimization processes. One for learning a fair 3 version of the adjacency matrix and one for the link prediction. Similarly, FairDrop Spinelli et al. (2022) modifies the adjacency during training using biased edge dropout targeting the homophily with respect to the sensitive attribute. However, the biased procedure is non-trainable. FairMod Current et al. (2022), and FairEdit Loveland et al. (2022) considers debiasing the input graph during training with the addition of artificial nodes and edges and not just the deletion. Except for FairDrop and FairAdj, the other so- lutions target the task of computing node embeddings or node classification explicitly. To our knowledge, we are the first to propose a model agnostic fine-tuning strategy to solve the link prediction end-to-end, optimizing both model's utility and fairness protection. Our contribution contains two novel- ties. From one side, we introduce two covariance-based constraints explicitly to enforce the fairness of the link prediction classification. Secondly, we pro- pose a novel way to parametrize a discrete yet trainable adjacency matrix. The latter aspect is of particular interest to the community to improve the quality of the messages sent across the graph Gasteiger et al. (2019); Kazi et al. (2022). DropEdge Rong et al. (2020) is a dropout mechanism which randomly removes a certain number of edges from an input graph at each training epoch to sparsify the connectivity. In Sparsified Graph Convolu- tional Network (SGCN) Li et al. (2022), the authors first pre-train a GCN to solve a node classification task. Then, a neural network sparsifies the graph by pruning some edges. Finally, they improve the classification perfor- mances by training a new GCN on the sparsified graph. Rather than sparsify the topology, another approach consists in rewiring the connections. Graph- Sage Hamilton et al. (2017) performs a neighbourhood sampling intending to be able to scale to larger graphs. The solution proposed in Gasteiger et al. (2019) alleviates the problem of noisy and often edges in real graphs by combining spectral and spatial techniques. DGM Kazi et al. (2022) and IDGL Chen et al. (2020) jointly learn the graph structure and graph embed- ding for a specific task. Finally, taking distance from the message passing framework and using tools from differential geometry, the authors of Topping et al. (2022) present a new curvature-based method for graph rewiring. Our solution is closely related to the first approaches sparsifying the topology. However, in future works, we plan to rewire the graphs' topology with the same underlying objective. 4 3. Preliminaries 3.1. Graph representation learning In this work we will consider an undirected and unweighted graph G = (V, E), where V = {1, . . . , n} is the set of node indexes, and E = {(i, j) | i, j ∈ V} is the set of arcs (edges) connecting pairs of nodes. The meaning of a single node or edge depends on the application. For some tasks, a node i is endowed with a vector xi ∈ Rd of features. Each node is also associated with a cate- gorical sensitive attribute si ∈ S (e.g., political preference, ethnicity, gender), which may or may not be part of its features. Connectivity in the graph can be summarized by the adjacency matrix A ∈ {0, 1}n×n. This matrix is used to build different types of operators that define the communication protocols across the graph. The vanilla operator is the symmetrically normalized graph Laplacian Kipf and Welling (2017). A Graph Neural Network GNN(X, A) can combine node features with the structural information of the graph by solving an end-to-end optimization problem. We will focus on the link pre- diction task, where the objective is to predict whether two nodes in a network are likely to have a link Liben-Nowell and Kleinberg (2007). The output of the GNN consists of a matrix of node embeddings H. Therefore we com- pute a new n × n matrix containing a probability score for each possible link in the graph ˆY = sigmoid(HHT ). The optimization objective is a binary cross-entropy loss over a subset of positive training edges and negative ones (sampled once). 3.2. Dyadic group fairness metrics Fairness in decision-making is broadly defined as the absence of any ad- vantage or discrimination towards an individual or a group based on their traits Saxena et al. (2019). Due to the broadness of the definition, there are several different fairness metrics, each focused on another type of discrimi- nation Mehrabi et al. (2019). We focus on group fairness metrics measuring if the model's predictions disproportionately benefit or damage people of different groups defined by their sensitive attributes. These measures are usually expressed in the context of a binary classifi- cation problem. In the notation of the previous section, denote by Y ∈ [0, 1] a binary target variable defined for each node of the graph, and by ˆY = f (x) a predictor that does not exploit the graph structure. As before, we associate to each x a categorical sensitive attribute S. For simplicity's sake, we assume 5 S to be binary, but the following definitions extend easily to the multi-class case. Two widely used criteria belonging to this group are: • Demographic Parity (DP ) Dwork et al. (2012): a classifier satisfies DP if the likelihood of a positive outcome is the same regardless of the value of the sensitive attribute S. P ( ˆY |S = 1) = P ( ˆY |S = 0) (1) • Equalized Odds (EO) Hardt et al. (2016): a classifier satisfies EO if it has equal rates for true positives and false positives between the two groups defined by the protected attribute S. P ( ˆY = 1|S = 1, Y = y) = P ( ˆY = 1|S = 0, Y = y) (2) These definitions trivially extend to cases where the categorical sensitive at- tribute can have more than two values |S| > 2. For the rest of the paper, we will consider this scenario. The link prediction task's predictive relation- ship between two nodes should be independent of both sensitive attributes. Therefore, In Masrour et al. (2020) and Spinelli et al. (2022), the authors in- troduced three dyadic criteria to map the sensitive attributes from the nodes to the edges. The original groups defined by S generate different dyadic sub- groups associated with the edges D. The dyadic groups can be summarized as follows: • Mixed dyadic (|D| = 2): the original groups generate two dyadic groups independently from the cardinality of the sensitive attribute. An edge will be in the intra-group if it connects a pair of nodes with the same sensitive attribute. Otherwise, it will be part of the inter- group. • Group dyadic (|D| = |S|): creates a one-to-one mapping between the dyadic and node-level groups. Each edge is counted twice, once for every sensitive attribute involved. This dyadic definition ensures that the nodes participate in the links' creation regardless of the value of their sensitive attribute. (cid:16) : enumerates all the possible combinations of sensitive attributes. The fairness criteria protect the balance between all the possible inter-group and intra-group combina- tions. • Sub-group dyadic |D| = (|S|+2−1)! 2!(|S|−1)! (cid:17) 6 Figure 1: DEA schematics. The pre-trained GNN extracts the node embeddings H. The Sampler takes them as input and returns a new, fairness enforcing, discrete adjacency matrix (cid:99)M. The new matrix is used as input for a new feedforward step of the GNN. Finally, we update the Sampler and the GNN with a combination of the binary cross- entropy loss and our covariance-based fairness constraint. 4. Drop Edges and Adapt In this work, we aim to improve the fairness of a trained GNN. In our fine- tuning strategy, we optimize at the same time the model and the adjacency matrix to solve the main task subject to a fairness constraint. To optimize the adjacency matrix, we learn a latent variable for each edge in the original graph with a neural network. The number of the introduced parameters is negligible concerning the size of the input graph, which makes our approach applicable to large-scale datasets. We focus our evaluation on the task of end-to-end link prediction. Therefore we design the constraint accordingly. We show the general framework of our method in Figure 1. We aim to fine-tune a trained model with an additional regularization term enforcing fairness by changing the adjacency matrix and adapting the network weights to these modifications. To do so, we introduce a different architecture called Sampler, containing an MLP. The Sampler takes as input the node embed- dings produced by the GNN and builds representation for the edges in the graph. Then it outputs a new adjacency which will be used by the GNN to make its predictions. The fine-tuning loss comprises the cross-entropy loss and a fairness constraint that updates the Sampler and the GNN. Below, we introduce each element in a separate section. 4.1. Sampler The Sampler is one of the two key contributions of our proposed approach. We want to sample the edges from the original adjacency matrix to help the GNN produce fairer predictions. At the same time, it has to preserve the dis- crete nature of the graph during the training process. The Sampler contains an MLP taking as input an edge embedding, defined as the concatenation 7 of two-node embeddings produced by the last layer of the GNN. The out- put of the MLP is an unnormalized probability vector z where each element is associated with an edge of the graph. To sample the edges, we use the Gumbel-max trick Jang et al. (2017). It is a method to draw a sample from a categorical distribution, given by its unnormalized (log-)probabilities. The community proposed several extensions of this trick, including a Gumbel- sigmoid Geng et al. (2020). We apply this function to the vector z: (cid:101)m(i,j) = sigmoid (cid:19) (cid:18) z(i,j) + G(cid:48) τ (3) where G(cid:48) is an independent Gumbel noise and τ ∈ (0, ∞) is a temperature parameter. As τ diminishes to zero, a sample from the Gumbel-Sigmoid distribution becomes cold and resembles the one-hot samples. The procedure generates a new vector of soft-noisy weights (cid:101)m(i,j) ∀(i, j) ∈ E. Finally, we build the new adjacency matrix (cid:99)M where each element is defined as follows: (cid:98)m(i,j) = (cid:40) 1 0 if (cid:101)m(i,j) (cid:62) 0.5 and (i, j) ∈ E otherwise , (4) The flowing of the gradient is guaranteed thanks to the use of a straight- through estimator Hinton et al. (2012). 4.2. Constraints In Zafar et al. (2019), the authors introduce a constraint to design convex boundary-based classifiers free of disparate impact. They use the covariance between the sensitive attribute s and the signed distance from the feature vectors to the decision boundary. Even if this measure is just a proxy for the disparate impact, it led to good empirical results. Neural networks, however, are not convex boundary-based classifiers. We cannot apply the constraint in its original formulation. To this end, we propose to exploit the prediction margin instead of the distance from the decision boundary. We recall that the prediction margin for a model parametrized by θ is defined as follows: βθ(i, j) = ˆy(i,j) − δ (5) where ˆy(i,j) is the predicted probability for the edge between node i and node j. δ is the threshold to assign the edge to the positive class if ˆy(i,j) (cid:62) δ or otherwise to the negative class. 8 In our definition of the constraint, we consider the dyadic nature of the link prediction task. The first and most effortless approach consists in build- ing a constraint replicating the mixed dyadic definition. We create a new vector in which we assign to each edge a single value. We let e = 1 if the nodes at the ends of the edges have the same sensitive attribute and e = 0 otherwise. The covariance mixed dyadic constraint can be written as: CovM = (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 |E| (cid:12) (cid:12) (cid:12) (e(i,j) − ̄e)βθ(i, j) (cid:12) (cid:12) (cid:12) (cid:88) (i,j)∈E (cid:54) c (6) where ̄e is the mean of the e vector. We then propose a second version of the constraint mimicking the group dyadic definition to create a more expressive constraint. We create as many vectors as the sensitive attribute S cardinality. The first vector e1 will be associated with the first possible value of the sensitive attribute S, denoted (i,j) = 1 if at least i or j has sk as sensitive as s1 and so on. We then let ek attribute. We end up with |S| different e vectors and the same number of covariance constraints. We can minimize the constraint independently by assigning a different threshold c to each one of them or by averaging them together. We can express the latter approach as: CovG = (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 |E||S| (cid:88) (cid:88) (i,j)∈E k∈|S| (ek (cid:12) (cid:12) (cid:12) (i,j) − ̄ek)βθ(i, j) (cid:12) (cid:12) (cid:12) (cid:54) c (7) In our evaluation, we opted for the second solution leaving the first ap- proach for future work. In the end, this last approach can be viewed as a one-vs-all fairness constraint where we try to maximize the fairness of all groups at once. 4.3. Fine-tuning Fine-tuning a model has several advantages over training from scratch when one is trying to impose some constraints. First, it is easy to assess the fairness of the prediction of the original model and fine-tuned one. Secondly, it is possible to create a fairer model and obtain a more equitable prediction of the new adjacency without retraining the model. Ideally, we want to optimize the adjacency matrix. However, as it is possible to see in the ablation section, the model suffers drastic changes in its inputs. We found that adapting the 9 Table 1: Dataset statistics. Dataset Citeseer Cora-ML PubMed DBLP FB S paper class paper class paper class continent gender |S| 6 7 3 5 2 Features Nodes 2110 2810 19717 3980 4039 3703 2879 500 None None Edges 3668 7981 44324 6965 88234 model's parameters while learning the adjacency stabilizes the predictive performances meanwhile improving their fairness.We start with a trained model parameterized by θ and a threshold value δ used to assign an edge to the positive or negative class. Next, we sample a negative set of edges for the link prediction loss. For each epoch, we compute the node embeddings. The Sampler takes them as input to output (cid:99)M. The network combines this discrete and trainable adjacency with the negative samples for the final feedforward step. Next, we compute the standard cross-entropy for the link prediction task and our covariance-based fairness enforcing constraint. The constraint is balanced with an additional hyperparameter λ. Finally, we update the GNN and the MLP inside the Sampler. 5. Experimental section We focus our experiments on measuring the impact of our fine-tuning strategy for enhancing fairness on the link prediction task. We use six fair- ness metrics (i.e. two for each dyadic group) together with the AUC and accuracy on the main task. In addition, we report the average and standard deviations of ten runs with random data splits. We monitor the Demographic Parity difference (∆DP ) and the Equality of Odds difference (∆EO). The first measures the difference between the largest and the lowest group-level selection rate: ∆DP = max d E[ ˆY|D = d] − min d E[ ˆY|D = d] (8) The latter report the maximum discrepancy between the true positive rate (TPR) difference and the false positive rate (FPR) difference between the groups: ∆T P R = max E[ ˆY = 1|D = d, Y = 1] (9) d − min d E[ ˆY = 1|D = d, Y = 1] , 10 ∆F P R = max E[ ˆY = 1|D = d, Y = 0] d − min d E[ ˆY = 1|D = d, Y = 0] , ∆EO = max(∆T P R, ∆F P R) . (10) (11) Our evaluation comprises five datasets. We report their statistics in Ta- ble 1. DBLP is a co-authorship network built-in Buyl and De Bie (2020) from the original dataset introduced in Tang et al. (2008). Nodes repre- sent authors and are connected if they have collaborated at least once. The sensitive attribute is the continent of the author institution without Africa and Antarctica because of their under-representation in the data. Facebook (FB) Leskovec and Mcauley (2012) is a combination of ego-networks intro- duced in Spinelli et al. (2022) obtained from a social network. The graph encodes users as nodes with gender as a sensitive attribute and friendships as links. These two datasets do not have feature vectors associated with the nodes. Therefore we used the eigenvectors of the Laplacian matrix as input features. We included three benchmark citation networks Citeseer, Cora- ML, and PubMed. In these graphs, nodes are articles and have associated a bag-of-words representation of the abstract. Links represent a citation re- gardless of the direction. We used the category of the article as a sensitive attribute. We would like to recall that the value of the sensitive attribute arises naturally from the graph topology but is never used directly in the learning pipeline. We tested our fine-tuning strategy on a GCN Kipf and Welling (2017) and a GAT Veliˇckovi ́c et al. (2018). We used an embedding size of 128 for the GCN. The GAT uses an embedding size of 16 with eight attention heads which are concatenated. We used two layers for the citation datasets and four for the two more complex datasets. We chose the threshold for computing the accuracy and the corresponding fairness with a grid search in the interval [0.4, 0.7] for each algorithm. In our covariance constraints, we set c = 0 and choose λ to balance the regularization term with grid search. The temperature τ of the Gumbel-sigmoid followed a linear decay from 5 to 1 for each dataset. The MLP in the Sampler has two layers of 128 ele- ments across all experiments. We trained the models using Adam optimizer Kingma and Ba (2014) for 100 epochs on every dataset except FB, which required 200 epochs. Our fine-tuning required additional 100 epochs. We compare against competitors designed to enforce the fairness of link predic- tion tasks. We build upon the experimental evaluation proposed in Spinelli et al. (2022). Therefore we include DropEdge and Fairdrop as plain and 11 biased sparsification techniques and FairAdj as a more complex approach. We used two configurations suggested in the original implementation for the latter method. The one with the hyperparameter T2 = 20 provides a more robust regularization towards fairness with respect to the model trained with T2 = 5 at the cost of lowering the model's utility. 5.1. Results Method GCN GAT Accuracy ↑ Table 2: Link prediction on Citeseer ∆DPg ↓ ∆EOm ↓ ∆DPm ↓ AUC ↑ ∆EOg ↓ ∆DPs ↓ ∆EOs ↓ 76.7 ± 1.3 76.3 ± 1.4 86.7 ± 1.3 85.6 ± 1.9 42.6 ± 3.7 42.4 ± 2.8 27.9 ± 4.7 26.4 ± 4.1 20.6 ± 4.1 21.1 ± 3.8 22.2 ± 4.6 25.4 ± 5.6 68.1 ± 3.7 71.3 ± 5.7 71.4 ± 9.1 73.4 ± 9.9 GCN+DropEdge GAT+DropEdge 78.9 ± 1.3 76.3 ± 0.9 88.0 ± 1.3 85.6 ± 1.0 44.9 ± 2.5 42.6 ± 2.5 27.5 ± 4.1 28.4 ± 5.0 20.1 ± 2.9 22.2 ± 5.1 21.6 ± 5.0 27.6 ± 6.3 71.0 ± 3.4 76.7 ± 3.0 73.2 ± 9.5 77.5 ± 8.8 FairAdjT 2=5 FairAdjT 2=20 78.5 ± 2.2 74.4 ± 2.5 86.7 ± 2.2 82.5 ± 2.7 39.2 ± 3.2 31.0 ± 3.1 19.0 ± 3.9 15.6 ± 3.0 17.3 ± 4.4 8.8 ± 3.2 18.2 ± 5.8 19.7 ± 6.9 62.6 ± 4.1 56.1 ± 3.8 47.6 ± 8.8 43.1 ± 7.4 GCN+FairDrop GAT+FairDrop 79.2 ± 1.4 78.2 ± 1.1 88.4 ± 1.4 87.1 ± 1.1 42.6 ± 2.5 42.9 ± 2.2 26.5 ± 4.2 28.3 ± 4.3 18.7 ± 4.0 22.5 ± 3.4 17.6 ± 5.5 25.9 ± 5.2 67.7 ± 3.5 75.3 ± 3.2 64.3 ± 9.5 73.4 ± 9.1 GCN+DEA+CovM GCN+DEA+CovG GAT+DEA+CovM GAT+DEA+CovG 79.0 ± 1.1 78.8 ± 1.1 78.2 ± 0.4 77.7 ± 0.4 88.2 ± 1.1 88.1 ± 0.4 87.9 ± 0.6 87.5 ± 0.4 25.3 ± 0.5 26.9 ± 0.9 37.6 ± 2.8 38.1 ± 1.6 13.3 ± 0.5 13.4 ± 2.5 23.9 ± 4.1 9.6 ± 5.1 11.1 ± 2.3 9.6 ± 1.1 11.6 ± 3.3 14.3 ± 3.8 11.3 ± 3.1 9.8 ± 1.3 12.7 ± 4.5 6.2 ± 4.4 46.7 ± 3.7 43.6 ± 3.3 57.7 ± 2.3 58.8 ± 2.5 48.7 ± 6.1 48.9 ± 5.2 68.4 ± 7.7 57.1 ± 7.6 Method GCN GAT Accuracy ↑ Table 3: Link prediction on Cora ∆DPg ↓ ∆EOm ↓ ∆DPm ↓ AUC ↑ ∆EOg ↓ ∆DPs ↓ ∆EOs ↓ 81.0 ± 1.1 80.2 ± 1.4 88.0 ± 1.0 88.3 ± 1.1 53.5 ± 2.4 54.9 ± 2.9 34.8 ± 5.0 39.6 ± 4.1 13.6 ± 3.2 12.2 ± 2.5 17.7 ± 4.1 16.5 ± 3.4 88.3 ± 3.3 90.9 ± 3.5 100.0 ± 0.0 100.0 ± 0.0 GCN+DropEdge GAT+DropEdge 82.4 ± 0.9 80.5 ± 1.2 90.1 ± 0.7 88.3 ± 0.8 56.4 ± 2.4 53.7 ± 2.5 36.5 ± 4.3 37.1 ± 3.2 12.3 ± 2.6 18.8 ± 3.6 15.4 ± 3.3 22.5 ± 4.2 90.2 ± 2.7 93.6 ± 2.9 100.0 ± 0.0 100.0 ± 0.0 GCN+FairAdjT 2=5 GAT+FairAdjT 2=20 75.9 ± 1.6 71.8 ± 1.6 83.0 ± 2.2 79.0 ± 1.9 40.7 ± 4.1 32.3 ± 2.8 20.9 ± 4.3 15.8 ± 4.3 18.4 ± 2.8 23.0 ± 4.2 31.9 ± 7.0 41.4 ± 5.9 83.8 ± 4.9 78.3 ± 6.8 98.3 ± 7.2 98.3 ± 7.2 GCN+FairDrop GAT+FairDrop 82.4 ± 0.9 79.2 ± 1.2 90.1 ± 0.7 87.8 ± 1.0 52.9 ± 2.5 48.9 ± 2.8 31.0 ± 4.9 31.9 ± 4.3 11.8 ± 3.2 15.3 ± 3.2 14.9 ± 3.7 18.1 ± 3.5 89.4 ± 3.4 94.5 ± 2.0 100.0 ± 0.0 100.0 ± 0.0 GCN+DEA+CovM GCN+DEA+CovG GAT+DEA+CovM GAT+DEA+CovG 81.5 ± 0.9 82.4 ± 0.7 81.0 ± 1.5 81.6 ± 1.7 89.4 ± 1.0 89.6 ± 0.6 89.1 ± 1.4 89.4 ± 1.2 35.0 ± 1.4 34.4 ± 2.4 48.1 ± 2.4 49.8 ± 0.9 16.5 ± 4.5 15.8 ± 2.4 29.5 ± 2.6 32.2 ± 2.3 7.8 ± 1.6 8.9 ± 2.4 10.2 ± 1.1 7.8 ± 2.9 11.9 ± 3.3 12.9 ± 1.7 13.3 ± 2.9 12.6 ± 3.0 67.6 ± 3.9 65.2 ± 3.8 85.7 ± 5.2 85.6 ± 3.6 100.0 ± 0.0 100.0 ± 0.0 100.0 ± 0.0 100.0 ± 0.0 We present the results in Tables 2, 3, 4, 5 and 6. DEA with CovM and CovG improves the accuracy on larger datasets and provides state-of-the-art protection against unfairness. CovM shows better fairness metrics in the mixed dyadic group. CovG has a slight advantage on the group dyadic defi- nition. Since the constraint definition closely resembles the group definitions, this is not surprising. CovG has a slight general advantage, probably due to the additional expressiveness of the constraint. On smaller datasets, Tables 12 Method GCN GAT Accuracy ↑ Table 4: Link prediction on PubMed ∆DPg ↓ ∆EOm ↓ ∆DPm ↓ AUC ↑ ∆EOg ↓ ∆DPs ↓ ∆EOs ↓ 88.0 ± 0.4 86.0 ± 0.4 94.5 ± 0.2 93.2 ± 0.3 43.9 ± 1.2 45.2 ± 0.3 13.2 ± 1.4 18.8 ± 0.5 5.0 ± 1.7 4.8 ± 1.8 4.9 ± 1.7 3.5 ± 0.9 57.3 ± 2.0 57.4 ± 3.1 26.2 ± 3.6 33.3 ± 5.1 GCN+DropEdge GAT+DropEdge 88.0 ± 0.5 80.0 ± 1.3 94.6 ± 0.3 88.4 ± 1.2 43.7 ± 1.0 40.7 ± 2.7 12.8 ± 0.8 21.2 ± 2.3 6.3 ± 0.7 4.1 ± 2.6 6.0 ± 1.1 7.9 ± 2.8 57.5 ± 1.4 60.8 ± 3.9 26.3 ± 2.3 50.6 ± 4.8 FairAdjT 2=5 FairAdjT 2=20 75.5 ± 2.5 73.8 ± 2.4 84.1 ± 2.2 82.1 ± 2.0 32.3 ± 4.7 28.9 ± 4.2 15.9 ± 4.7 14.0 ± 4.0 7.3 ± 3.0 7.8 ± 4.0 13.8 ± 6.2 16.5 ± 6.7 53.4 ± 9.9 52.5 ± 9.7 43.2 ± 9.5 43.5 ± 9.8 GCN+FairDrop GAT+FairDrop 88.4 ± 0.4 81.0 ± 0.6 94.8 ± 0.2 89.2 ± 0.6 42.5 ± 0.5 41.7 ± 1.2 12.2 ± 0.7 22.0 ± 1.1 5.6 ± 1.8 3.0 ± 0.3 5.1 ± 0.9 5.5 ± 1.6 55.7 ± 1.5 60.7 ± 2.2 26.6 ± 2.6 49.6 ± 3.7 GCN+DEA+CovM GCN+DEA+CovG GAT+DEA+CovM GAT+DEA+CovG 88.9 ± 0.3 89.0 ± 0.2 86.1 ± 0.4 86.2 ± 0.2 95.6 ± 0.2 95.0 ± 0.2 93.2 ± 0.2 93.4 ± 0.1 45.0 ± 0.8 44.4 ± 1.0 44.9 ± 0.9 45.2 ± 0.6 12.2 ± 0.7 12.3 ± 0.7 18.2 ± 0.8 19.1 ± 0.7 6.0 ± 0.8 5.0 ± 0.5 4.9 ± 0.6 4.3 ± 0.7 4.5 ± 0.8 3.5 ± 0.6 3.3 ± 1.1 2.9 ± 0.7 56.2 ± 1.8 56.6 ± 1.1 56.5 ± 2.5 57.3 ± 1.8 23.8 ± 3.9 24.0 ± 1.2 30.9 ± 2.9 33.2 ± 2.9 Table 5: Link prediction on DBLP Method GCN GAT Accuracy ↑ AUC ↑ ∆DPm ↓ ∆EOm ↓ ∆DPg ↓ ∆EOg ↓ ∆DPs ↓ ∆EOs ↓ 82.4 ± 0.7 82.8 ± 1.0 86.3 ± 1.8 86.4 ± 1.4 38.2 ± 1.0 37.8 ± 1.3 8.3 ± 3.8 7.5 ± 3.6 27.7 ± 11.1 27.5 ± 9.8 30.7 ± 15.7 32.9 ± 14.3 82.3 ± 9.0 76.9 ± 2.2 96.5 ± 6.9 100.0 ± 0.0 GCN+DropEdge GAT+DropEdge 75.6 ± 2.2 77.2 ± 1.3 80.5 ± 1.1 83.8 ± 0.7 30.1 ± 2.0 32.6 ± 2.6 9.8 ± 3.4 7.0 ± 4.2 22.3 ± 4.8 27.4 ± 7.9 25.5 ± 5.1 40.7 ± 19.1 74.7 ± 2.0 74.5 ± 8.5 93.8 ± 8.1 92.6 ± 9.1 FairAdjT 2=5 FairAdjT 2=20 57.9 ± 1.0 58.5 ± 0.6 57.0 ± 1.0 57.5 ± 1.5 11.0 ± 1.4 11.5 ± 0.8 8.8 ± 1.1 8.5 ± 1.6 18.9 ± 2.6 18.4 ± 1.6 33.2 ± 4.2 33.2 ± 3.4 34.2 ± 2.2 34.3 ± 1.2 56.1 ± 22.4 55.9 ± 22.5 GCN+FairDrop GAT+FairDrop 74.0 ± 2.0 76.0 ± 0.6 80.8 ± 1.6 83.3 ± 0.8 27.7 ± 2.3 30.4 ± 1.9 7.1 ± 3.4 5.4 ± 1.8 24.3 ± 9.9 30.1 ± 7.7 29.3 ± 10.2 41.5 ± 14.7 72.0 ± 5.4 71.1 ± 15.0 93.8 ± 8.1 100.0 ± 0.0 GCN+DEA+CovM GCN+DEA+CovG GAT+DEA+CovM GAT+DEA+CovG 81.4 ± 1.0 82.4 ± 1.3 83.6 ± 1.0 83.6 ± 1.2 86.1 ± 1.5 85.9 ± 1.9 86.4 ± 1.3 86.8 ± 1.5 23.7 ± 1.5 31.8 ± 2.8 22.5 ± 1.0 21.6 ± 1.9 6.9 ± 2.7 8.0 ± 3.0 6.8 ± 2.7 6.7 ± 2.3 20.9 ± 6.6 18.3 ± 5.1 20.7 ± 6.6 20.8 ± 6.5 23.6 ± 5.5 21.1 ± 4.3 22.8 ± 6.1 21.7 ± 5.4 69.2 ± 9.2 73.3 ± 5.2 56.5 ± 8.2 76.2 ± 8.2 96.4 ± 7.2 96.9 ± 6.2 96.5 ± 7.1 97.8 ± 4.4 2, 3 and 4, DEA provides slightly better protection than FairAdj. However, the latter loses in accuracy and AUC with severe losses in Table 4 where the drop in accuracy provided by FairAdj is about 15% of accuracy and 10% of AUC. FairAdj fails to solve the link prediction task on complex datasets like DBLP (Tab. 5) and FB (Tab. 6). In the end, DEA removes around 10% of the edges, considerably less than DropEdge and FairDrop. In Figure 2, we show the intermediate steps resulting in the final version of the fair adjacency matrix (cid:99)M. There is little difference between the actual edge distribution Z and its noisy version after the Gumbel-sigmoid trick (cid:102)M. Also, it is possible to see that CovM is more peaked at the extreme values. Finally, Figure 2(c) shows the number of edges removed from the original adjacency matrix (cid:99)M to obtain a fairer link prediction. 5.2. Ablation In this section, we perform an in-depth ablation study to shed more light on the effect of these additional epochs and each component of the frame- 13 (a) z (b) (cid:101)m (c) (cid:99)M Figure 2: Edge distribution at different stages of our pipeline. In blue, we depict the results obtained using CovM constraint; in orange, the ones with CovG. Figure (a) shows the distribution z learnt by the MLP inside our Sampler. Figure (b) shows the approximation after the Gumbel sigmoid trick (cid:101)m. Finally, Figure (c) shows the number of edges removed and kept in the new fairness-enforcing adjacency matrix (cid:99)M thresholding the values in (cid:101)m at 0.5. 14 0.00.10.20.30.40.50.60.70.80.91.0EdgeProbability01020304050607080EdgesinGraph(%)CovMCovG0.00.10.20.30.40.50.60.70.80.91.0EdgeProbability01020304050607080EdgesinGraph(%)CovMCovGRemovedKeptEdge0102030405060708090EdgesinGraph(%)CovMCovG Table 6: Link prediction on FB Method GCN GAT Accuracy ↑ AUC ↑ ∆DPm ↓ ∆EOm ↓ ∆DPg ↓ ∆EOg ↓ ∆DPs ↓ ∆EOs ↓ 82.3 ± 1.4 80.2 ± 2.7 90.8 ± 1.1 86.3 ± 2.4 0.7 ± 0.5 0.8 ± 0.6 2.8 ± 0.7 1.8 ± 0.9 3.5 ± 0.7 3.3 ± 1.3 3.4 ± 1.2 2.5 ± 1.5 7.5 ± 1.2 7.2 ± 2.5 5.6 ± 2.0 4.3 ± 2.5 GCN+DropEdge GAT+DropEdge 77.9 ± 1.5 71.7 ± 4.6 87.7 ± 0.9 83.9 ± 1.5 0.9 ± 0.1 1.1 ± 0.2 4.9 ± 0.4 1.4 ± 1.4 5.5 ± 0.5 2.3 ± 1.3 6.9 ± 0.8 2.4 ± 2.6 11.0 ± 1.0 5.3 ± 2.0 11.7 ± 1.5 4.4 ± 4.5 GCN+FairDrop GAT+FairDrop 77.4 ± 1.9 75.1 ± 2.1 87.7 ± 1.0 83.7 ± 1.2 0.6 ± 0.3 1.3 ± 0.7 4.3 ± 0.2 1.8 ± 1.5 4.9 ± 0.2 2.3 ± 1.4 5.9 ± 0.7 2.5 ± 2.4 10.0 ± 0.5 5.6 ± 2.4 10.1 ± 1.2 4.7 ± 4.0 GCN+DEA+CovM 82.9 ± 1.2 82.9 ± 1.2 GCN+DEA+CovG 82.8 ± 2.3 GAT+DEA+CovM 82.2 ± 2.1 GAT+DEA+CovG 93.5 ± 0.6 93.2 ± 0.9 90.9 ± 2.0 89.5 ± 2.1 1.6 ± 0.3 1.9 ± 0.3 1.1 ± 0.6 1.3 ± 0.4 1.9 ± 0.7 1.6 ± 0.3 1.5 ± 0.9 1.0 ± 0.5 2.6 ± 0.3 2.1 ± 0.4 2.9 ± 0.6 2.5 ± 0.8 1.6 ± 0.6 1.4 ± 0.3 1.4 ± 0.8 1.0 ± 0.6 6.1 ± 0.7 5.5 ± 0.6 6.4 ± 1.2 5.8 ± 1.8 2.9 ± 0.9 2.5 ± 0.4 2.7 ± 1.2 2.2 ± 1.0 Table 7: Results obtained training a GCN on Citeseer with and without the Sampler optimizing the adjacency matrix. Method Acc Sampler AUC Sampler Acc w/o AUC w/o Citeseer 78.3 ± 0.5 88.6 ± 0.3 76.7 ± 1.3 86.7 ± 1.3 Cora 82.1 ± 1.1 89.8 ± 1.0 81.0 ± 1.1 88.0 ± 1.0 Pubmed 88.8 ± 0.5 95.0 ± 0.3 88.0 ± 0.4 94.5 ± 0.2 DBLP 83.2 ± 1.0 86.9 ± 0.9 82.4 ± 0.7 86.3 ± 1.8 FB 82.6 ± 0.9 90.7 ± 0.6 82.3 ± 1.4 90.8 ± 1.1 work. In the first experiment, we train for the same number of epochs as a standard GCN and one paired with the Sampler, learning a new adjacency matrix with the sole objective of maximizing accuracy. Then, we optimize the adjacency matrix and the model's parameters to solve the main task without additional fairness constraints. Finally, in Table 7, we show that those mod- ifications to the adjacency matrix improve the link prediction performances. In the second, we focus on the various components of our architecture on the Citeseer dataset. Results are visible in Table 8. We disable each time a different component of our framework. We train everything from scratch instead of fine-tuning a model in the second and third rows. In "Training w X", we feed to the Sampler the concatenation of the feature vectors as- sociated with the nodes instead of the node embeddings generated by the GNN. We then proceed to fine-tune the model by disabling some compo- nents. In "w/o Sampler", we keep the covariance constraint but remove the learning of the adjacency matrix. In "w/o CovM", we do the opposite. Fi- nally, we fine-tune the model without any modification. The latter solution has comparable performances in terms of accuracy, but it has significantly worst fairness metrics. Training from scratch has similar results. Fine-tuning with the covariance constraint or the Sampler improves the fairness, but we obtain the best results when both are active. 15 Method Accuracy ↑ AUC ↑ ∆DPm ↓ ∆EOm ↓ ∆DPg ↓ ∆EOg ↓ ∆DPs ↓ ∆EOs ↓ GCN+CovM 79.0 ± 1.1 88.4 ± 1.1 25.3 ± 0.5 13.3 ± 0.5 11.1 ± 2.3 11.3 ± 3.1 46.7 ± 3.7 48.7 ± 6.1 Table 8: Ablation study on Citeseer with CovM Training 78.8 ± 1.0 88.2 ± 0.9 45.5 ± 2.9 28.9 ± 7.2 21.2 ± 4.4 23.8 ± 5.3 73.0 ± 4.0 59.3 ± 9.4 Training w X 78.4 ± 1.5 88.1 ± 1.2 44.3 ± 3.6 28.0 ± 6.9 21.4 ± 5.1 25.1 ± 6.8 73.1 ± 1.7 59.3 ± 6.5 w/o Sampler 78.8 ± 0.7 87.8 ± 0.5 30.9 ± 1.9 14.9 ± 4.1 13.4 ± 2.4 14.2 ± 2.4 48.5 ± 2.5 58.9 ± 8.6 w/o CovM 78.4 ± 0.6 88.0 ± 0.5 29.3 ± 0.6 18.1 ± 4.6 11.9 ± 1.9 13.3 ± 2.6 51.0 ± 3.9 63.8 ± 9.8 w/o Sampler & CovM 78.9 ± 0.9 88.6 ± 0.8 45.2 ± 2.1 29.1 ± 4.1 20.5 ± 3.7 23.3 ± 7.4 73.6 ± 4.2 61.8 ± 6.6 6. Conclusions We introduced DEA, a novel approach to improve the fairness of a GNN solving a link prediction task. In our fine-tuning strategy, we learn to modify the graph's topology and adapt the parameters of the network to those mod- ifications. A module called Sampler learns to drop edges from the original adjacency matrix. We exploit a Gumbel-sigmoid to sample a new discrete and fair adjacency. At the same time, the GNN uses this new matrix for fine-tuning. We guide both optimization processes with an additional reg- ularization term shaped as a covariance-based constraint. We provided two different formulations, the first acting on the inter and intra connections be- tween the groups defined by the sensitive attribute. In the second modelling, each value of the sensitive attribute is in the one-vs-the-rest paradigm. We performed an extensive experimental evaluation where we demonstrated that our fine-tuning strategy provides state-of-the-art protection against unfair- ness meanwhile improving the model's utility on the original task. Finally, we performed an ablation study on the contribution of each component of our pipeline. In future, we would like to learn to add new connections instead of just dropping them from the original adjacency matrix. References Abbass, H. (2018). Social integration of artificial intelligence: Functions, automation allocation logic and human-autonomy trust. Cognitive Com- putation, 11:159–171. Bacciu, D., Errica, F., Micheli, A., and Podda, M. (2020). A gentle intro- duction to deep learning for graphs. Neural Networks. Bose, A. and Hamilton, W. (2019). Compositional fairness constraints for In Chaudhuri, K. and Salakhutdinov, R., editors, graph embeddings. 16 Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 715–724. PMLR. Bronstein, M. M., Bruna, J., LeCun, Y., Szlam, A., and Vandergheynst, P. IEEE (2017). Geometric deep learning: going beyond Euclidean data. Signal Process. Magazine, 34(4):18–42. Buyl, M. and De Bie, T. (2020). DeBayes: a Bayesian method for debiasing network embeddings. In III, H. D. and Singh, A., editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 1220–1229. PMLR. Chen, Y., Wu, L., and Zaki, M. (2020). Iterative deep graph learning for graph neural networks: Better and robust node embeddings. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., and Lin, H., editors, Advances in Neural Information Processing Systems, volume 33, pages 19314–19326. Curran Associates, Inc. Chiappa, S. (2019). Path-specific counterfactual fairness. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 7801– 7808. Chiappa, S., Jiang, R., Stepleton, T., Pacchiano, A., Jiang, H., and Aslanides, J. (2020). A general approach to fairness with optimal trans- port. In AAAI, pages 3633–3640. Corbett-Davies, S., Pierson, E., Feller, A., Goel, S., and Huq, A. (2017). Algorithmic decision making and the cost of fairness. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '17, page 797–806, New York, NY, USA. Associ- ation for Computing Machinery. Current, S., He, Y., Gurukar, S., and Parthasarathy, S. (2022). Fairmod: Fair link prediction and recommendation via graph modification. CoRR, abs/2201.11596. Dai, E. and Wang, S. (2020). Fairgnn: Eliminating the discrimination in graph neural networks with limited sensitive attribute information. CoRR, abs/2009.01454. 17 Dwork, C., Hardt, M., Pitassi, T., Reingold, O., and Zemel, R. (2012). Fair- ness through awareness. In Proceedings of the 3rd Innovations in Theo- retical Computer Science Conference, ITCS '12, page 214–226, New York, NY, USA. Association for Computing Machinery. Gasteiger, J., Weissenberger, S., and G ̈unnemann, S. (2019). Diffusion Im- proves Graph Learning, pages 1197–1210. Curran Associates Inc. Geng, X., Wang, L., Wang, X., Qin, B., Liu, T., and Tu, Z. (2020). How does selective mechanism improve self-attention networks? CoRR, abs/2005.00979. Grover, A. and Leskovec, J. (2016). Node2vec: Scalable feature learning In Proceedings of the 22nd ACM SIGKDD International for networks. Conference on Knowledge Discovery and Data Mining, KDD '16, page 855–864, New York, NY, USA. Association for Computing Machinery. Halberstam, Y. and Knight, B. (2016). Homophily, group size, and the diffusion of political information in social networks: Evidence from twitter. Journal of Public Economics, 143:73–88. Hamilton, W. L., Ying, R., and Leskovec, J. (2017). Inductive representation learning on large graphs. In Proceedings of the 31st International Confer- ence on Neural Information Processing Systems, NIPS'17, page 1025–1035, Red Hook, NY, USA. Curran Associates Inc. Hardt, M., Price, E., Price, E., and Srebro, N. (2016). Equality of opportu- nity in supervised learning. In Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc. Hinton, G., Deng, L., Yu, D., Dahl, G. E., Mohamed, A.-r., Jaitly, N., Senior, A., Vanhoucke, V., Nguyen, P., Sainath, T. N., and Kingsbury, B. (2012). Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. IEEE Signal Processing Magazine, 29(6):82–97. Jang, E., Gu, S., and Poole, B. (2017). Categorical reparameterization with gumbel-softmax. In 5th International Conference on Learning Represen- tations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net. 18 Kazi, A., Cosmo, L., Ahmadi, S.-A., Navab, N., and Bronstein, M. (2022). Differentiable graph module (dgm) for graph convolutional networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, pages 1–1. Kingma, D. and Ba, J. (2014). Adam: A method for stochastic optimization. International Conference on Learning Representations. 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 classification with graph convolutional networks. In International Conference on Learning Repre- sentations (ICLR). Lee, E., Karimi, F., Wagner, C., Jo, H.-H., Strohmaier, M., and Galesic, M. (2019). Homophily and minority-group size explain perception biases in social networks. Nature Human Behaviour, 3. Leskovec, J. and Mcauley, J. (2012). Learning to discover social circles in ego networks. In Pereira, F., Burges, C. J. C., Bottou, L., and Weinberger, K. Q., editors, Advances in Neural Information Processing Systems, vol- ume 25. Curran Associates, Inc. Li, J., Zhang, T., Tian, H., Jin, S., Fardad, M., and Zafarani, R. (2022). International Graph sparsification with graph convolutional networks. Journal of Data Science and Analytics, pages 33–46. Li, P., Wang, Y., Zhao, H., Hong, P., and Liu, H. (2021). On dyadic fair- ness: Exploring and mitigating bias in graph connections. In International Conference on Learning Representations. Liben-Nowell, D. and Kleinberg, J. (2007). The link-prediction problem for social networks. Journal of the American Society for Information Science and Technology, 58(7):1019–1031. Loveland, D., Pan, J., Bhathena, A. F., and Lu, Y. (2022). Fairedit: Pre- serving fairness in graph neural networks through greedy graph editing. CoRR, abs/2201.03681. Masrour, F., Wilson, T., Yan, H., Tan, P.-N., and Esfahanian, A. (2020). Bursting the filter bubble: Fairness-aware network link prediction. Pro- ceedings of the AAAI Conference on Artificial Intelligence, 34(01):841–848. 19 McPherson, M., Smith-Lovin, L., and Cook, J. M. (2001). Birds of a feather: Homophily in social networks. Annual Review of Sociology, 27(1):415–444. Mehrabi, N., Morstatter, F., Saxena, N., Lerman, K., and Galstyan, A. (2019). A survey on bias and fairness in machine learning. ArXiv, abs/1908.09635. Nguyen, T. T., Hui, P.-M., Harper, F. M., Terveen, L., and Konstan, J. A. (2014). Exploring the filter bubble: The effect of using recommender sys- tems on content diversity. In Proceedings of the 23rd International Con- ference on World Wide Web, WWW '14, page 677–686, New York, NY, USA. Association for Computing Machinery. Obermeyer, Z., Powers, B., Vogeli, C., and Mullainathan, S. (2019). Dissect- ing racial bias in an algorithm used to manage the health of populations. Science, 366(6464):447–453. Rahman, T., Surma, B., Backes, M., and Zhang, Y. (2019). Fairwalk: To- wards fair graph embedding. In Proceedings of the Twenty-Eighth Interna- tional Joint Conference on Artificial Intelligence, IJCAI-19, pages 3289– 3295. International Joint Conferences on Artificial Intelligence Organiza- tion. Rong, Y., Huang, W., Xu, T., and Huang, J. (2020). Dropedge: Towards deep graph convolutional networks on node classification. In International Conference on Learning Representations. Roy, P. K. and Chahar, S. (2021). Fake profile detection on social network- ing websites: A comprehensive review. IEEE Transactions on Artificial Intelligence, pages 1–1. Saxena, N. A., Huang, K., DeFilippis, E., Radanovic, G., Parkes, D. C., and Liu, Y. (2019). How do fairness definitions fare? examining public attitudes towards algorithmic definitions of fairness. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society, AIES '19, page 99–106, New York, NY, USA. Association for Computing Machinery. Song, W., Dong, Y., Liu, N., and Li, J. (2022). Guide: Group equality informed individual fairness in graph neural networks. KDD '22, page 1625–1634, New York, NY, USA. Association for Computing Machinery. 20 Spinelli, I., Scardapane, S., Hussain, A., and Uncini, A. (2022). Fairdrop: Bi- ased edge dropout for enhancing fairness in graph representation learning. IEEE Transactions on Artificial Intelligence, 3(3):344–354. Spinelli, I., Scardapane, S., and Uncini, A. (2021). Adaptive propagation graph convolutional network. IEEE Transactions on Neural Networks and Learning Systems, 32(10):4755–4760. Tang, J., Zhang, J., Yao, L., Li, J., Zhang, L., and Su, Z. (2008). Arnet- miner: Extraction and mining of academic social networks. In Proceedings of the 14th ACM SIGKDD International Conference on Knowledge Dis- covery and Data Mining, KDD '08, page 990–998, New York, NY, USA. Association for Computing Machinery. Topping, J., Giovanni, F. D., Chamberlain, B. P., Dong, X., and Bronstein, M. M. (2022). Understanding over-squashing and bottlenecks on graphs via curvature. In International Conference on Learning Representations. Veliˇckovi ́c, P., Cucurull, G., Casanova, A., Romero, A., Li`o, P., and Ben- gio, Y. (2018). Graph Attention Networks. International Conference on Learning Representations. accepted as poster. Zafar, M. B., Valera, I., Gomez-Rodriguez, M., and Gummadi, K. P. (2019). Fairness constraints: A flexible approach for fair classification. Journal of Machine Learning Research, 20(75):1–42. 21
http://arxiv.org/abs/2302.11477v1
2023-02-22T16:26:38
2023-02-22T16:26:38
An Interpretable Determinantal Choice Model for Subset Selection
Understanding how subsets of items are chosen from offered sets is critical to assortment planning, wireless network planning, and many other applications. There are two seemingly unrelated subset choice models that capture dependencies between items: intuitive and interpretable random utility models; and tractable determinantal point processes (DPPs). This paper connects the two. First, all DPPs are shown to be random utility models. Next, a determinantal choice model that enjoys the best of both worlds is specified; the model is shown to subsume logistic regression when dependence is minimal, and MNL when dependence is maximally negative. This makes the model interpretable, while retaining the tractability of DPPs. A simulation study verifies that the model can learn a continuum of negative dependencies from data, and an applied study using original experimental data produces novel insights on wireless interference in LoRa networks.
[ "Sander Aarts", "David B. Shmoys", "Alex Coy" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11477v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11477v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
AN INTERPRETABLE DETERMINANTAL CHOICE MODEL FOR SUBSET SELECTION 3 2 0 2 b e F 2 2 ] G L . s c [ 1 v 7 7 4 1 1 . 2 0 3 2 : v i X r a Sander Aarts ∗ David B. Shmoys ∗ Alex Coy † ABSTRACT Understanding how subsets of items are chosen from offered sets is critical to assortment planning, wireless network planning, and many other applications. There are two seemingly unrelated subset choice models that capture dependencies between items: intuitive and interpretable random utility models; and tractable determinantal point processes (DPPs). This paper connects the two. First, all DPPs are shown to be random utility models. Next, a determinantal choice model that enjoys the best of both worlds is specified; the model is shown to subsume logistic regression when dependence is minimal, and MNL when dependence is maximally negative. This makes the model interpretable, while retaining the tractability of DPPs. A simulation study verifies that the model can learn a continuum of negative dependencies from data, and an applied study using original experimental data produces novel insights on wireless interference in LoRa networks. Keywords Subset choice * Discrete choice * Determinantal processes * Interpretable machine learning * LoRaWAN 1 Introduction Assortment planning is one of many applications in which it is critical to understand how subsets of items are selected out of a potentially varying set of offered items. In assortment planning a retailer offers a personalized assortment for each customer to browse and make purchases from. Effective planning requires understanding how likely a customer is to purchase a subset of an assortment as a function of the assortment. Another application is predicting returns of online orders; given an order, what subset of items will likely be returned? Finally, in wireless network planning – given a set of wireless transmissions within a time-interval – it is critical to predict what subset of transmissions are successfully received and what subset is lost. Understanding the underlying mechanism is critical for network design. In fact, this last setting originally motivated our work, and has provided the test bed for many of our experiments. Common to these applications is the need for a subset choice model. In addition, the model should be interpretable in order for planners understand the underlying mechanisms of subset selection. Naturally, it should also be learnable from data. Traditional discrete choice models assume that at most a single item is selected. A celebrated example is the multinomial logit model (MNL) [McFadden, 1973]. The model admits efficient learning algorithms for its parameters, and is both intuitive and interpretable. This is in part due to the model being founded on random utility maximization (RUM); each item is equipped with a utility function that maps an item's features to a utility value that quantifies its relative desirability. The most desirable alternative is chosen. The parameters of the utility function are interpretable as marginal utilities. Furthermore, the model is parsimonious; given a set of parameters, the model can generate predictions over assortments of varying sizes [Gallego and Topaloglu, 2019]. The restriction to single-item selections, however, limits the applicability of MNL to subset choice. Clearly, subset choice provides a more general model. Generalizing discrete choice to subset choice is challenging due to item interactions within subsets. Items are said to interact whenever the utility of a subset differs from the sum of utilities of the items it contains. For example, the set {toothbrush, toothpaste} might generate more utility than the sum of utilities of singletons {toothbrush} and {toothpaste}. This is a positive interaction. Meanwhile, unrelated items such as {toothpaste, pencil} may not interact. Finally, a set such as {electric toothbrush, toothbrush} likely produces less utility than the sum of its parts; this is a negative interaction. These are particularly common when items are substitutes. Note that item ∗School of Operations Research and Information Engineering, Cornell University. Correspondence: [email protected]. †School of Electrical and Computer Engineering, Cornell University An Interpretable Determinantal Choice Model for Subset Selection interactions are not limited to subsets of size two; sets of arbitrary size can interact. Capturing arbitrary interactions in a model, however, is not generally tractable. Subset choice models strike a balance between tractability and the generality of the interactions they can capture. An early example is the additive model [Fishburn, 1992]. This model considers no interactions, and models the utility of a set as the sum of utilities of the individual items it contains. Most subset choice models are "additive with corrections" – the utility of a subset is additive in individual utilities, with some subsets receiving some form of "correction". Examples include giving each set pairwise corrections [Fishburn and LaValle, 1996], or giving a limited number of sets arbitrary corrections [Benson et al., 2018]. The former model is not used in learning contexts; the latter is. Moreover, some subset choice models are not founded on RUM at all. Determinantal point processes (DPPs) are a family of subset selection models used heavily in machine learning contexts. While not founded on random utility maximization, DPPs are remarkably tractable for learning and inference tasks in which items exhibit repulsion; they were originally used to model repulsion between fermions [Macchi, 1975]. DPPs admit efficient learning algorithms, and support inference tasks such as sampling and conditioning (see, e.g., Kulesza et al. [2012]). DPPs are successfully employed in learning tasks such as document summarization [Kulesza and Taskar, 2011], basket completion [Gartrell et al., 2016], and wireless interference [Saha and Dhillon, 2019]. However, unlike RUM-based models, DPPs are less interpretable, and do not enjoy the same intuitive appeal as their utility-based counterparts. This paper shows that determinantal processes are in fact subset choice models founded on random utility maximization, and specifies a sub-family of DPPs that enjoys strong connections to well-known discrete choice models. These connections make DPPs more intuitive, interpretable, and accessible to practitioners with backgrounds in discrete choice modeling. Our contributions are the following: (1) We prove that any determinantal processes is equivalent to an MNL model over subsets, with a particular utility function; (2) We prove that this utility function is "additive with corrections" where each set receives a corrective penalty for containing similar items; (3) We specify a determinantal choice model and connect it to discrete choice, in particular; (4) We show that our model subsumes logistic regression when there are no item interactions, and; (5) that the model subsumes MNL when the interactions are maximally negative. Moreover, we showcase the determinantal choice model in practice: (6) We use synthetic data to verify that the determinantal choice model, when learned from data, subsumes logistic regression and MNL as expected; (7) Finally, we use original LoRaWAN wireless data to learn a wireless interference model. Our results show that the model both captures the negative dependence in the data, and learns interpretable parameters. Indeed, we use these parameters to draw new insights on LoRaWAN transmission loss due to interference. 2 Setting and Related Work This section introduces the setting for subset choice under variable assortments, and reviews discrete choice, random utility maximization, subset choice models, and DPPs. Problem setting. This work adopts a feature-based parametrization and learning approach to subset choice. Consider an arbitrary universe of items U in which each item i ∈ U has an associated feature vector xi ∈ Rd. An assortment is a finite set of items, A ⊆ U. The feature vectors of assortment, A, are collected in the |A| × d matrix XA. A subset choice model is a function that takes any assortment A with features XA and returns a probability distribution over the collection of subsets 2A. We consider a supervised learning setting, in which access to a sequence, k = 1, . . . , K, of assortments Ak, choices Ck ⊆ Ak, and features Xk = XAk , is assumed. Note that the assortments can differ in size, and may contain entirely different items from one another3. Prediction involves inferring a likely choice set Ck ⊆ Ak, given the assortment Ak, and collection of associated item features Xk. Discrete choice and MNL. Discrete choice models allow at most one item to be selected from an assortment. Many of the most common discrete choice models are founded on random utility maximization (see, e.g., Train [2009]). In this setting every item i in an assortment A is equipped with a real-valued utility u(i), and the utility-maximizing choice is selected. Randomness in the utilities generates randomness in the selection. The MNL model is a prominent example [McFadden, 1973]. In an MNL model, the utility of item i has a linear feature-based parametric form u(i) = βT xi + (cid:15)i, ∀i ∈ U, where β is a coefficient vector of the same dimension as xi, and the (cid:15)i are iid standard Gumbel random variables. Given assortment A, the probability of selecting item i ∈ A is equivalent to the probability that u(i) > u(j) for all 3The features can also encode assortment-level features. The values of such features are the same across all items in the assortment. This can capture, e.g., features about the choice-maker, or the time and place at which the assortment was offered. 2 An Interpretable Determinantal Choice Model for Subset Selection j ∈ A : j (cid:54)= i, which under the Gumbel errors is proportional to the exponentiated non-random utility components. Pr[choose item i ∈ A] = exp{βT xi} j∈A exp{βT xj} 1 + (cid:80) (1) The "no item" option is treated as an item with expected utility 0. Consequently the probability of opting out without an item is 1/(1 + (cid:80) j∈A exp{βT xj}). An important special case of the MNL model is when the assortment is a single item {i}. This reduces the alternatives to "take it" or "leave it". The probability of taking the item i is then Pr[choose item i ∈ A] = exp{βT xi} 1 + exp{βT xi} . (2) This model is also known as the logit model, or logistic regression, in learning contexts. Subset choice models. Subset choice models generalize discrete choice models by equipping each subset of items with a random utility. The utility is composed of a non-random and random component, U (C) = V (C) + (cid:15)(C). The subset of maximum utility is selected. Even modestly sized assortments have prohibitively many subsets; most models trade off generality with tractability by modeling the non-random utility components as "additive with corrections", V (C) = (cid:88) i∈C v(i) + W (C), ∀C ⊆ A, (3) where W (C) is the correction to subset C. A well-know example is the pairwise interaction model with correction W (C) = (cid:80) i,j∈C:i(cid:54)=j γ(i, j) [Fishburn and LaValle, 1996]. A more recent example is a learnable model that allows arbitrary corrections W (C), however restricted to fixed number of subsets [Benson et al., 2018]. The latter model is best suited to settings in which a relatively small number of assortments are observed repeatedly. Determinantal point processes. A determinantal point process (DPP) is a probability distribution over subsets that favors diverse subsets. A DPP over a fixed assortment A is characterized by its kernel matrix L Borodin [2009]. This is an |A| × |A| symmetric p.s.d. matrix4. The likelihood of observing subset C ⊆ A is proportional to the log-determinant of the submatrix LC of the kernel L corresponding to the rows and columns in C: Pr[Choose C] = det(LC) det(I + L) . (4) The determinant of L∅ is taken to be 1. The denominator is a closed-form expression for the normalizing constant, satisfying (cid:80) B⊆A det(LB) = det(I + L), where throughout I denotes an identity matrix of the same size as L. DPPs support methods for supervised learning via both Bayesian inference and MLE [Kulesza and Taskar, 2011, Affandi et al., 2014]. Moreover, there are efficient sampling algorithms for DPPs [Hough et al., 2006]. We refer to Kulesza et al. [2012] for more details on, and properties of DPPs. The DPP likelihood favors diversity in the selected subset. This is demonstrated using a two-item example [Kulesza et al., 2012]. The likelihood of selecting singleton {i} is proportional to the ith diagonal entry of the kernel matrix. Pr[Choose {i}] ∝ det(L{i}) = Lii On the other hand, the unnormalized likelihood of selecting two items {i, j} is moderated by the off-diagonal term Lij. Pr[Choose {i, j}] ∝ det (cid:18)(cid:20)Lii Lij Lji Ljj (cid:21)(cid:19) The non-positive term −L2 terms Lij capture a notion of similarity between i and j. = LiiLjj − L2 ij ij can be viewed as a penalty for subsets containing similar items, where the off-diagonal Decomposing the DPP kernel into similarity and quality components adds clarity to the model. Kulesza and Taskar [2010] show that any DPP kernel L can be decomposed s.t. Lij = qiSijqj, where qi is the quality of item i, and Sij thesimilarity between items i and j. The quality is viewed as the relative attractiveness of item i; the similarity quantifies the degree of similarity between the two items. Similarity terms are collected in a matrix, S, satisfying 0 (cid:22) S (cid:22) I5. Under this decomposition, the DPP likelihood factors: (cid:33) (cid:32) Pr[Choose C] ∝ q2 i det(SC). (5) (cid:89) 4The abbreviation p.s.d. stands positive semi-definite. An n × n matrix K is p.s.d. if for all z ∈ Rn, it holds that zT Kz ≥ 0. 5Here K (cid:22) K(cid:48) denotes that K(cid:48) − K is p.s.d. i∈C 3 An Interpretable Determinantal Choice Model for Subset Selection The above formulation shows that the likelihood of a subset C containing item i is proportional to the squared quality of item i. A bias for diversity stems from the determinant of the similarity submatrix; the determinant takes values between 0 and 1. We leverage this decomposition to bridge the gap between DPPs and random utility subset choice models. 3 Determinantal Processes & Random Utility This section connects determinantal processes and random-utility-maximization-based subset choice models. In particular, we show that all discrete determinantal point processes can be viewed as random-utility maximizing choices under a particular family of utility functions. Furthermore, studying this family of utility functions yields novel insights on the behavioral assumptions underlying DPPs, as well as connections between DPPs and existing subset choice models. This section takes a step back from the feature-based parametric view and considers discrete DPPs in their full generality; we return to features and parameters in Section 4. Our first result shows that samples from a DPP are random utility maximizing choices. The result is an affirmative answer to the questions "is there a random utility function over subsets such that the utility-maximizing choice has the same distribution as a DPP"? The answer may seem obvious; the main idea is to ask the question. Theorem 3.1. Let A be a set of n items and L an n-by-n p.s.d. symmetric matrix. The following distributions over 2A are equivalent: 1. A DPP over A with kernel L. 2. The utility-maximizing subset where each subset C of A has a log-determinant random utility with (cid:15)(C) iid standard Gumbel errors. U (C) = log det(LC) + (cid:15)(C) The proof of this and all subsequent results are deferred to Appendix A. This theorem shows that a DPP is equivalent MNL over subsets, with a log-determinant utility. We call this the utility implied by a DPP. Simplification of the implied utility helps connect DPPs to existing subset choice models. Let V (C) denote the non-random component of the implied utility of subset C. For a singleton, C = {i}, the non-random utility is equal to the log of the squared quality v(i) := V ({i}) = log(q2 i ). Decomposing the kernel matrix into quality and similarity terms as in Equation (5) yields the following theorem. Theorem 3.2. Let L be an n-by-n DPP kernel. Then the non-random part of the induced utility of subset C ⊆ A is V (C) = (cid:88) i∈C v(i) + log det(SC) In other words, one can view the implied utility as "additive with corrections". The correction in this case is a similarity- dependent penalty term log det(SC). This term is non-positive because S (cid:22) I. Moreover, the DPP log-likelihood is submodular (Kulesza et al. [2012], pp. 22). Viewing a DPP as a subset choice model helps to connect DPPs to discrete choice and utility maximization. The fact that a DPP is an MNL model over subsets immediately implies that DPPs obey the independence of irrelevant alternatives (IIA) property on a subset-level [Train, 2009]; the relative probability of choosing subset C over C (cid:48) does not depend on the presence of some third subset C (cid:48)(cid:48) in the assortment. This is a fundamental axiom of underlying many choice models. The utility function is also informative. Submodularity of the implied utility means that DPP choice exhibits diminishing marginal returns; the additional utility of adding an item to a selection is non-increasing in the size of the selection. Decreasing marginal utilities have long history in utility theory. Our second result shows that the utility implied by a DPP is "additive with corrections". This helps highlight in what way DPPs differ from existing subset choice models. Indeed, DPPs enjoy novel properties from a subset choice perspective. To contrast with, e.g., the pairwise interaction model, the utility implied by a DPP is able to capture global dependencies, unrestricted by the size of the sets. Similarly, unlike the model of Benson et al. [2018], the DPP model does not restrict the number of sets that receive a correction. Instead, a DPP restricts the sign of the interactions it can capture; the corrections are all non-positive. This is a new approach in subset choice modeling, making DPPs a valuable addition to the subset choice modeling repertoire. 4 An Interpretable Determinantal Choice Model for Subset Selection 4 A Determinantal Choice Model This section defines a feature-based parametric DPP we call a determinantal choice model. The main results of this section establish strong connections between this model, logistic regression, and MNL, in a way that lends the determinantal model components – in particular the parameters – intuitive and familiar interpretations. The approach is to show that the determinantal model family occupies a continuum of models, which subsumes logistic regression on the one extreme, and MNL on the other. The determinantal choice model is defined first. We take inspiration from conditional DPPs of Affandi et al. [2014], and determinantally thinned point processes of Błaszczyszyn and Keeler [2019]. Instead of a fixed kernel, we specify a kernel function that takes any assortment data XA and generates a DPP kernel L(XA). We do this by specifying parametric quality and similarity models separately. Let β be a d-dimensional coefficient vector. The quality model is an exponentiated linear model [Kulesza and Taskar, 2010]: q(β, xi) = exp (cid:27) . βT xi (cid:26) 1 2 (6) Under this quality model, the DPP likelihood is log-concave in the parameters β for any p.s.d. similarity model Kulesza and Taskar [2010]. In this paper the similarity model is specified as an anisotropic RBF kernel with lengthscales (cid:96) ∈ Rd: (cid:40) S((cid:96), xi, xj) = exp − 1 2 d (cid:88) k=1 |xi,k − xj,k|2 (cid:96)2 k (cid:41) . (7) While we prefer the RBF for its interpretability, the results in this section are valid for any p.s.d. kernel function with Sij ∈ [0, 1]. This completes the determinantal choice model; the remainder of this section shows how the model relates to logistic regression and MNL, and discusses intuition for and interpretations of the parameters of this model. The key insight of this section is to view subset choice as binary classification with dependent labels. The binary labels indicate selection; either an item is selected, i ∈ C, or it is not, i /∈ C. Thus, predicting a selected subset is equivalent to predicting binary labels for each item. The labels can be dependent. For example, in the case of negative dependence, conditioning on one item being selected may diminish the likelihood of other items being selected. Under this view, if the determinantal model has no similarity between distinct items, it should reduce to a conventional binary classification model that assumes independence between labels. Similarly, if all items are maximally negatively dependent – that is mutually exclusive – the determinantal model should resemble a classification model that selects at most one item. Our first result formalizes this intuition in the case of totally dissimilar items. Under this similarity structure, the model is equivalent to a logistic regression. Theorem 4.1. Fix a finite assortment A and data XA. If S(XA) = I, then the determinantal likelihood of C ∈ A is eβT xi 1 + eβT xi 1 1 + eβT xj Pr[Choose C] = (cid:89) (cid:89) (cid:32) (cid:33) (cid:19) (cid:18) . i∈C j∈A\C This is the likelihood of a logistic regression of Equation (2), treating the items in A as independent observations. As a consequence of this result, one can interpret the coefficients β as logistic regression coefficients in this setting. In the extreme of maximally negatively dependent labels, items are mutually exclusive. In this setting the determinantal model is equivalent to MNL over items. Theorem 4.2. Fix a finite assortment A and data XA. If S(XA) = J (the all 1s matrix) then the determinantal likelihood of {i} for i ∈ C is With Pr[Choose ∅] ∝ 1, and 0 for all other sets. Pr[Choose {i}] = exp{βT xi} j∈C exp{βT xj} 1 + (cid:80) The likelihood is precisely that of an MNL model over the assortment A in Equation (1). Analogously, whenever items are highly similar, the determinantal choice model parameters can be interpreted as MNL coefficients. Between the extremes, the interpretation still holds. One can always view the non-random utility, βT xi, the way one would under a logistic regression model by qualifying "provided no other similar items be present". When competing items are present, the marginal probability of choosing item i is moderated by (a) the degree of negative dependence between i and the competing items, and (b) the utility of the competing items. The exact probability, and marginal effects on it, can be evaluated by taking derivatives and evaluating assortments and other items at, e.g., mean values, as is common when interpreting MNL parameters. 5 An Interpretable Determinantal Choice Model for Subset Selection 5 A comparison of models The previous section shows that the determinantal choice model subsumes logistic regression and MNL whenever the similarity matrix takes on its extreme values. However, whether the model does this in practice is contingent on learning the "correct" parameters. This section uses synthetic data to examine how a trained determinantal choice compares with logistic regression and MNL as the degree of negative dependence in the training data is varied. Our experiment shows that the model behaves consistently with the theory; it indeed closely matches the performance of the classification models at the two extremes of negative dependence. Moreover, we find that determinantal choice model outperforms the two reference models when the degree of negative dependence lies between the two extremes. Experimental design. The experiment estimates each model's out-of-sample predictive performance as a function of the degree of negative dependence in the selected subsets. This requires generating a sequence of datasets with varying degrees of negative dependence. This is accomplished using a data generating process in which the negative dependence is parametrized by a scalar, r > 0. Each of the three models is parametrized over the same features, and trained over the same sequence of datasets. Evaluation data is withheld from each dataset during training. Finally, each model is evaluated on the same sequence of evaluation datasets. Figure 1: Illustration of one observation with 15 items and radius r = 0.5. Points in light grey are independently assigned 0-labels in the first thinning phase. Light blue points are discarded during Matérn thinning; dark blue points retain their 1-labels. Data generation. The synthetic data is generated in three steps. Each observation – an assortment-selection pair – is generated independently. We describe the process for only one observation. First, the items and their features are sampled. Items are encoded as points in a [−2, 2]2 square and are sampled uniformly at random. Each assortment has 15 items. Features Xi of the ith point are its x and y coordinates and the distance di from the point to the origin. Associated with each trial is a binary label vector y indicating which items are in the selection; yi = 1 denotes that i is selected. The labels are initially set to 1 for each item. The second sampling step sets the label of item i to zero independently at random with probability Pr[yi = 0] = 1 − min {1, exp{γ0 + γ1di}} , where (γ0, γ1) = (−5, 2.5). The third and final step applies Matérn (1986) Type III thinning to the remaining 1-labeled points. This step takes as input a radius, r > 0. This is the source of negative dependence. Given a radius, r > 0, the remaining items with 1-labels are sorted by their y-coordinates in decreasing order. The 1-labeled item with the largest 6 2.01.51.00.50.00.51.01.52.02.01.51.00.50.00.51.01.52.0Poisson thinnedMatérn thinnedRetained An Interpretable Determinantal Choice Model for Subset Selection y-coordinate retains its 1-label. Any neighboring items that are within 2r of this item have their labels set to 0. The next largest item that still has a 1 retains its 1-label and its neighbors are given 0-labels, and the process repeats until all items are processed. An example outcome is illustrated in Figure 1. When the radius r is small, labels are nearly independent; when it is large, the items become mutually exclusive. Repeating the process over a range of radii yields a sequence of datasets with varying negative dependence. Model and learning. Learning takes a standard Bayesian approach. An independent Gaussian prior is assumed over the quality coefficients β. The same prior is used for the all three models. The similarity kernel function of the determinantal choice model takes only the distance between points as input, and its lengthscale (cid:96) is equipped with a log-normal prior. The log-likelihood is derived from Equation (5) and implemented in TensorFlow [Abadi et al., 2015]. Posterior samples are generated using MCMC with an adaptive kernel [Andrieu and Thoms, 2008, Dillon et al., 2017]. For each model-radius pair a total of 25 parallel MCMC chains are run. Predictions ˆy are formed by sampling parameters from the posterior distribution, and conditioning on these, sampling predictions from the DPP model using the DPPy implementation by Gautier et al. [2019]. The quality of a sampled prediction ˆy relative to true label vector y is quantified using the Matthews correlation coefficient MCC(y, ˆy); this essentially measures correlation between binary vectors, and is known to be robust against label imbalance [Chicco and Jurman, 2020]. Figure 2: Mean Matthews correlation coefficients over varying radii r for the logistic (light green – dashed), MNL (dark green – dotted), and determinantal choice model (dark blue – solid), respectively. The shaded areas indicate 95% confidence intervals. Results. Figure 2 shows the Matthews correlation coefficient between predicted labels and true outcomes for each model, as a function of the radius. The results are averaged over posterior samples and assortments; the shaded regions denote 95% CIs. On the left, the radius is small and item selections are nearly independent, the logistic and determinantal model predictions are strongly correlated with the true labels. The MNL predictions are less aligned with the true labels. This is due to the model predicting selections of size at most 1 while the true selections contain multiple items on average. On the right, where the radii are large and items are nearly mutually exclusive, the MNL predictions attain a relatively high MCC. So does the determinantal model. At this extreme the logistic regression predictions are less correlated with the true labels since the model often predicts selections of multiple items while the true positive labels are nearly mutually exclusive. Note that throughout the range of experiments, the determinantal model's average performance is no worse than that of the two reference models. Discussion. Our experiment shows that the determinantal choice model, when learned from data, can capture a range of negative dependence in the chosen subsets. This is in agreement with our theoretical results; the model behavior is consistent with logistic regression when there is little to no dependence in the data, and is consistent with MNL when dependence is maximally negative. Moreover, between the two extremes, when there is moderate negative dependence in subset selections, the model produces no worse predictions than the better of the two reference models. This suggests that the determinantal choice model indeed can learn a continuum of negative dependence structures. 7 0.10.30.50.70.91.11.31.51.71.92.12.32.52.7radius (r)0.10.20.30.40.50.6Matthew's correlation coefficientlogitMNLdetit An Interpretable Determinantal Choice Model for Subset Selection 6 Wireless interference as subset choice Application. In this section the determinantal choice model is employed to learn and validate a model of wireless interference in LoRaWANs using original experimental data. LoRaWAN or Long-Range Wide-Area Network is a wireless communication protocol used in the Internet of Things. There are 185 registered LoRaWAN operators and more than 225 million devices globally [LoRa Alliance®, 2023a,b]. The main use-case for LoRaWAN is to enable small battery-driven end-devices, such as air-quality senors, to wirelessly transmit small packets of data to a receiver over distances up to a few kilometers [Semtech, 2019]. The communication protocol is spartan; it is designed to maximize the battery life of the end-devices. Consequently, devices do not coordinate transmissions, which creates potential for packet collisions – the situation when two or more packets arrive at a receiver concurrently using the same radio parameters. Collisions may result in lost data. This can limit the scalability of LoRaWANs. However, by understanding the severity of packet collisions, network planners can improve scalability via informed receiver placement and dimensioning. Understanding the mechanism of interference is key. Related work. Many studies on LoRaWAN interference and scalability have been conducted Bor et al. [2016], Adelantado et al. [2017], Georgiou and Raza [2017], Sundaram et al. [2020]. However, experimenting with physical networks at scale is infeasible; doing so would require thousands of end-devices and would disrupt regular LoRaWAN users. Instead, the research focus is on building models for loss due to interference based on small-scale experiments and simulation. This has proven to be challenging. Most studies use only one or two devices – if any – to generate data. Furthermore, the models employed tend to be limited in their ability to capture interactions between colliding transmissions. Finally, few attempts are made to formally validate model performance on out-of-sample data. This study treats LoRaWAN packet reception as subset choice, and learns an interference model from original experimental data. Our key insight is to view a set of incoming transmissions at a receiver in a given time-window as an assortment of items. Some subset of these transmissions are received ("chosen") and others are lost. The transmissions are expected to exhibit negative interactions; if two transmission overlap in time and use the same radio parameters, is unlikely that all are successfully received. This is a consequence of limited receiver capacity; the receiver is said to "lock on" to the first incoming transmission, and to treat subsequent overlapping transmissions as noise [Semtech, 2019]. Experiments and data. Original data is generated using the following physical experiment. Up to nine end-devices transmit packets at randomly selected times, with randomly selected radio parameters. Each transmission is treated as an item, and its radio parameters as the features. Transmissions are grouped into time-disjoint sets; these are independent assortments. A LoRaWAN receiver is monitored to record the subset of transmissions, C ⊂ A, that successfully received for each assortment. An example assortment is shown in Figure 3. This setup is used to generate labeled subset choice data. Appendix B contains more detailed descriptions of the devices and the experimental setup. A total of N = 1, 030 assortment-selection pairs are generated, of which 145, all with at least one collision, are retained for evaluation. There are a number of interesting features associated with each transmission. These are briefly described based on Semtech's (2019) technical summary. First, the CHANNEL is a categorical variable taking integer values from 9 to 16. Transmissions on different channels are said to be orthogonal; a receiver should be able to receive transmissions on different channels concurrently, and transmissions on different channels should not interfere. The SPREADING FACTOR is another categorical variable ranging from 8 to 11. This determines the speed of a transmission; high spreading factors make signals more robust to noise at the cost of a longer time to transmit. Spreading factors are also considered orthogonal, even when on the same channel. Next, the POWER (dBm) defines the strength of a transmission. The DELAY (ms) describes the arrival time of a transmission, relative to an origin at 0. Finally, the AIRTIME (ms) describes how long a transmission is on-air. Note that the spreading factor (SF) is the main determinant of the airtime in our setting; packets with similar SFs have similar airtimes. Model. We specify a determinantal choice model using the above features and some closely associated variables. The quality model is given standardized versions of POWER and DELAY, as well as two dummy variables. The first dummy indicates the presence of a same-channel concurrent transmission; the second indicates the presence of a concurrent same-channel-same-SF transmission. Note that the latter implies the former. The similarity model takes a collection of dummy variables indicating the CHANNEL, and a derived collection of continuous variables called RELATIVE DELAY. The relative delay is the delay measured in packet airtimes rather than ms. Because airtime depends on the spreading factor, there are 4 dimensions to relative delay. If an item is on SF1, the relative delays corresponding to SF 2, 3, and 4 are set to zero, and so on. A large constant is further added to the non-zero entry. Thus, packets of different SFs are treated as dissimilar. While this approach is somewhat ad hoc, this allows for improved modeling of the effect of time-overlap on mutual exclusivity6. 6The perhaps most natural measure of packet similarity due to time-overlap is [tstart, tend] interval-overlap. This however does not generally produce a p.s.d. kernel function. The RBF with relative delays can be viewed as a "smoothened" version of this approach. 8 An Interpretable Determinantal Choice Model for Subset Selection Figure 3: An example LoRaWAN trial. The bars represent transmissions. Their width and x-axis position indicates time-on-air. Ch stands for the channel, and SF for the spreading factor. Green transmission are received; grey ones are lost. Table 1: Posterior means, standard deviations, and effective sample sizes (ESS) of parameters. Similarity parameters are on log-scale. VARIABLE POSTERIOR MEAN ESS MODEL CONSTANT CH-OVERLAP CH-SF-OVERLAP POWER DELAY RELATIVE DELAY CHANNEL 1.14±0.06 -0.97±0.05 -0.84±0.04 0.51±0.05 1.07±0.02 -0.62±0.01 -1.24±1.06 19K 20K 19K 19K 18K 19K 456 QUAL QUAL QUAL QUAL QUAL SIMI SIMI Bayesian inference. Standard MCMC is used for Bayesian inference, as in Section 5. Results are summarized in Table 1. The table columns contain, respectively, the variable name, posterior mean with standard errors, the effective sample size from MCMC, and the model component the variables belong to. The MCMC algorithm showed nominal convergence for all parameters, except the log-lengthscale of the channel dummies. The former parameters all show large effective sample sizes and ˆR-values near 1 [Vehtari et al., 2021]. Figure 4(a) summarizes the CHANNEL log- lengthscale posterior, and Figure 4(b) the autocorrelation of one of its MCMC chains. The less than ideal convergence may be driven by autocorrelation over long lags. This means that the log-lengthscale samples may stem from a different distribution that the posterior that MCMC aims to approximate. This leaves room for potential improvement. Nevertheless, the other parameters are likely to stem distributions that approximate the true posterior well. Results. Both the predictive performance and parameters are of interest. Overall, the Matthews correlation coefficient between sampled predictions and the true outcomes in the evaluation data – averaged over the posterior – is 0.25 ±0.03. The posterior means of the parameters are summarized in Table 1. The parameters β of the quality model are all significantly different from 0. The CONSTANT is large and positive. Both coefficients of the POWER and DELAY are positive; the parameters of the dummy variables for concurrent same-channel overlaps are negative. The mean log-lengthscales of the similarity model are negative, although caution is to be used in interpreting the CHANNEL lengthscale, due to the small number of effective samples. Interpretation. Both the quality and similarity model parameters yield new insight into LoRaWAN interference. First, the coefficient of CH-SF-OVERLAP is particularly interesting. The parameter is significantly negative. This indicates that the likelihood of a successful reception decreases if a same-channel concurrent transmission is present, 9 2004006008001000time (ms)Ch10SF10Ch11SF8Ch12SF10Ch12SF10Ch13SF10Ch14SF10Ch15SF8Ch15SF8Ch15SF10Successful transmissionLost transmission An Interpretable Determinantal Choice Model for Subset Selection (a) Posterior histogram (b) Autocorrelation Figure 4: Posterior histogram (a), and autocorrelation of a single MCMC chain (b) of the log-lengthscale of the CHANNEL dummies. The latter plot is generated with ArviZ [Kumar et al., 2019]. despite being on a different spreading factor. This finding is in stark contrast with the claim that spreading factors are orthogonal, as this would imply a parameter value near zero. Secondly, the parameter associated with DELAY is also surprising. It implies that arriving later improves the likelihood of success. However, under the view what a receiver "locks on" to the first signal it receives and treats subsequent signals as noise, arriving late should decrease the likelihood of a success. Finally, the log-lengthscales of the similarity models confirm our understanding of negative dependence in LoRaWAN. The lengthscale of the CHANNEL seems reasonable; a negative log-lengthscale means that being on different channels renders packets dissimilar. This supports the view that channels are orthogonal, although the experiment is somewhat inconclusive with respect to this parameter. Finally, the negative log-lengthscale of the RELATIVE DELAY implies that the similarity of two packets decays relatively fast as they become separated in time. At the posterior mean, two otherwise equal packets with 0.1 airtime overlap have an similarity of roughly 0.25. This implies the presence of a so-called capture effect [Rahmadhani and Kuipers, 2018]; the the receiver seems able to receive two or more overlapping packets, provided they do not overlap too much. However, this finding may be partially driven by the imposed smoothness of the RBF kernel. Summary. This study showcases the utility of our feature-based parameteric determinantal choice model on a learning task on original LoRaWAN interference data. The feature-based approach is essential as each observed assortment is unique. The model captures the observed negative dependence, and learns meaningful parameters. The parameters are indeed interpretable; contrary to a previous understanding of LoRaWAN, we find spreading factors to be non-orthogonal, and that arriving later to a collision is associated with a higher, rather than lower, likelihood of reception. 7 Conclusion This paper shows new connections between determinantal point processes, and subset and discrete choice models. First, we show that all discrete DPPs are subset choice models with intuitive "additive with corrections" utility functions. In addition we specify a determinantal choice model as a feature-based parametric determinantal process. This model is shown to capture a continuum of negative dependence between item labels. At the extreme of no dependence, we show that the model subsumes logistic regression; when dependence is maximal, the model reduces to MNL. Our simulation study shows that these connections hold even when the model is learned from data. Finally, we use our model to study wireless interference in LoRaWANs using original experiments, and draw new insights on LoRaWAN interference by interpreting the model parameters. We believe the determinantal choice model can be of use in many interesting applications. Acknowledgments This material is based upon work supported by the National Science Foundation under Grant CNS-1952063. 10 6420log-lengthscale (log)0.00.10.20.30.40.50.6density020406080100lag1.000.750.500.250.000.250.500.751.00autocorrelation An Interpretable Determinantal Choice Model for Subset Selection References D. McFadden. Conditional logit analysis of qualitative choice behaviour. In P. Zarembka, editor, Frontiers in Econometrics, pages 105–142. Academic Press New York, New York, NY, USA, 1973. Guillermo Gallego and Huseyin Topaloglu. Revenue Management and Pricing Analytics. International Series in Operations Research and Management Science. Springer, December 2019. Peter C. Fishburn. Utility as an Additive Set Function. Mathematics of Operations Research, 17(4):910–920, 1992. Peter C Fishburn and Irving H LaValle. Binary interactions and subset choice. European Journal of Operational Research, 92(1):182–192, 1996. Austin R. Benson, Ravi Kumar, and Andrew Tomkins. A Discrete Choice Model for Subset Selection. In Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, WSDM '18, page 37–45, New York, NY, USA, 2018. Association for Computing Machinery. Odile Macchi. The Coincidence Approach to Stochastic Point Processes. Advances in Applied Probability, 7(1):83–122, 1975. Alex Kulesza, Ben Taskar, et al. Determinantal Point Processes for Machine Learning. Foundations and Trends® in Machine Learning, 5(2–3):123–286, 2012. Alex Kulesza and Ben Taskar. Learning Determinantal Point Processes. In Proceedings of the Twenty-Seventh Conference on Uncertainty in Artificial Intelligence, UAI'11, page 419–427, Arlington, Virginia, USA, 2011. AUAI Press. Mike Gartrell, Ulrich Paquet, and Noam Koenigstein. Bayesian Low-Rank Determinantal Point Processes. In Proceedings of the 10th ACM Conference on Recommender Systems, pages 349–356, 2016. Chiranjib Saha and Harpreet S Dhillon. Interference Characterization in Wireless Networks: A Determinantal Learning Approach. In 2019 IEEE 29th International Workshop on Machine Learning for Signal Processing (MLSP), pages 1–6. IEEE, 2019. Kenneth E Train. Discrete Choice Methods with Simulation. Cambridge university press, 2009. Alexei Borodin. Determinantal point processes. arXiv preprint arXiv:0911.1153, 2009. Raja Hafiz Affandi, Emily Fox, Ryan Adams, and Ben Taskar. Learning the Parameters of Determinantal Point Process Kernels. In International Conference on Machine Learning, pages 1224–1232. PMLR, 2014. J. Ben Hough, Manjunath Krishnapur, Yuval Peres, and Bálint Virág. Determinantal Processes and Independence. Probability Surveys, 3:206 – 229, 2006. Alex Kulesza and Ben Taskar. Structured Determinantal Point Processes. Advances in Neural Information Processing Systems, 23, 2010. Bartłomiej Błaszczyszyn and Holger Paul Keeler. Determinantal thinning of point processes with network learning applications. In 2019 IEEE Wireless Communications and Networking Conference (WCNC), pages 1–8. IEEE, 2019. Bertil Matérn. Spatial Variation. Springer-Verlag, New York, 2 edition, 1986. Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems, 2015. Software available from tensorflow.org. C Andrieu and J Thoms. A tutorial on adaptive MCMC. Statistics and Computing, 18, issue 4:343 – 373, December 2008. Publisher: Springer Netherlands. Joshua V. Dillon, Ian Langmore, Dustin Tran, Eugene Brevdo, Srinivas Vasudevan, Dave Moore, Brian Patton, Alex Alemi, Matt Hoffman, and Rif A. Saurous. TensorFlow Distributions, 2017. Guillaume Gautier, Guillermo Polito, Rémi Bardenet, and Michal Valko. DPPy: DPP Sampling with Python. J. Mach. Learn. Res., 20:180–1, 2019. Davide Chicco and Giuseppe Jurman. The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation. BMC genomics, 21:1–13, 2020. LoRa Alliance®. LoRaWAN Coverage. https://lora-alliance.org/lorawan-coverage/, 2023a. Accessed January 24, 2023. 11 An Interpretable Determinantal Choice Model for Subset Selection LoRa Alliance®. LoRaWAN® Deployments Achieve Market Leadership; Deliver Strong ROI for IoT Across https://lora-alliance.org/lora-alliance- Wide Spectrum of Industries Across France and Spain. press-release/lorawan-deployments-achieve-market-leadership-deliver-strong-roi-for-iot- across-wide-spectrum-of-industries-across-france-and-spain-2/, 2023b. Accessed January 24, 2023. Semtech. https://lora-developers.semtech.com/ LoRa® and LoRaWAN®: A technical overview. documentation/tech-papers-and-guides/lora-and-lorawan/, 2019. Martin C Bor, Utz Roedig, Thiemo Voigt, and Juan M Alonso. Do LoRa Low-Power Wide-Area Networks Scale? In Proceedings of the 19th ACM International Conference on Modeling, Analysis and Simulation of Wireless and Mobile Systems, pages 59–67, 2016. F. Adelantado, X. Vilajosana, P. Tuset-Peiro, B. Martinez, J. Melia-Segui, and T. Watteyne. Understanding the Limits of LoRaWAN. IEEE Communications Magazine, 55(9):34–40, 2017. Orestis Georgiou and Usman Raza. Low Power Wide Area Network Analysis: Can LoRa Scale? IEEE Wireless Communications Letters, 6(2):162–165, 2017. Jothi Prasanna Shanmuga Sundaram, Wan Du, and Zhiwei Zhao. A Survey on LoRa Networking: Research Problems, Current Solutions, and Open issues. IEEE Communications Surveys & Tutorials, 22(1):371–388, 2020. Ravin Kumar, Colin Carroll, Ari Hartikainen, and Osvaldo Martin. ArviZ a unified library for exploratory analysis of Bayesian models in Python. Journal of Open Source Software, 4(33):1143, 2019. Aki Vehtari, Andrew Gelman, Daniel Simpson, Bob Carpenter, and Paul-Christian Bürkner. Rank-Normalization, Folding, and Localization: An Improved ˆR for Assessing Convergence of MCMC (with Discussion). Bayesian Analysis, 16(2), jun 2021. Andri Rahmadhani and Fernando Kuipers. When LoRaWAN Frames Collide. In Proceedings of the 12th Interna- tional Workshop on Wireless Network Testbeds, Experimental Evaluation &amp; Characterization, WiNTECH '18, page 89–97, New York, NY, USA, 2018. Association for Computing Machinery. ISBN 9781450359306. doi:10.1145/3267204.3267212. URL https://doi.org/10.1145/3267204.3267212. 12 An Interpretable Determinantal Choice Model for Subset Selection A Proofs of theorems This section contains proofs for the theorems in the paper. A.1 Proof of Theorem 3.1 Proof of Theorem 3.1. Fix a finite assortment A and a p.s.d. symmetric kernel matrix L of size |A| × |A|. Our goal is to prove that the following two distributions over 2A are equivalent: 1. A DPP over A with kernel L; and 2. The random-utility maximizing choice where the utility of each subset C ⊆ A is given by with (cid:15)(C) iid standard Gumbel random errors. U (C) = log det(LC) + (cid:15)(C), It suffices to show that the likelihoods (pmf s) are equivalent. First, recall that the likelihood of observing a subset C ⊆ A under the DPP model is given by the DPP likelihood, Equation (4): [C] = Pr DPP det(LC) det(I + L) . For the random-utility maximizing choice we exploit the iid standard Gumbel errors to derive the softmax function, analogous to a standard random-utility derivation of MNL [McFadden, 1973]. The probability that a fixed subset C ⊆ A has the maximum utility is [C] = Pr[U (C) > U (B) for all B ⊆ A : B (cid:54)= C] = Pr RUM exp{log det(LC)} B⊆A exp{log det(LC)} (cid:80) . The above expression simplifies by cancelling the exp{log(*)} functions and recalling that the normalizing constant of a DPP satisfies the equality: (cid:88) det(LB) = det(I + L). (See, e.g., Thm 2.1 in Kulesza et al. [2012], pp. 8). These two observations yield the the final two equalities below: B⊆A [C] = Pr RUM exp{log det(LC)} B⊆A exp{log det(LC)} (cid:80) = det(LC) B⊆A det(LB) (cid:80) = det(LC) det(I + L) . This proves that the two distributions over 2A are equivalent. (cid:3) A.2 Proof of Theorem 3.2 Proof of Theorem 3.2. Fix a finite assortment A and corresponding DPP kernel L. We need to prove that for any subset of the assortment, C ⊆ A, the implied utility is equal to V (C) = log det(LC) = (cid:88) i∈C v(i) + log det(SC), where S is the similarity matrix satisfying Lij = qiSijqj for all i, j ∈ A, and v(i) := log det(Lii) = 2 log(qi). The proof is nearly immediate after applying the DPP likelihood decomposition Equation (5) to the proof above. First, the proof for Theorem 3.1 establishes that the non-random component of the utility of a subset C ⊆ A is log det(LC). This is equal to the logarithm of the unnormalized DPP likelihood. Decomposing this likelihood inside the logarithm using Equation (5) yields V (C) = log det(LC) = log (cid:32)(cid:32) (cid:33) (cid:89) q2 i i∈C (cid:33) det(SC) = (cid:88) i∈C 2 log(qi) + log det(SC). Finally, recognizing that v(i) ≡ 2 log(qi) completes the proof. (cid:3) 13 An Interpretable Determinantal Choice Model for Subset Selection A.3 Proof of Theorem 4.1 Proof of Theorem 4.1. Fix an assortment A with data XA, and a parameter vector β. We need to prove that if S = I, then the determinantal choice model is equivalent to a logistic regression model on XA, in which the binary labels indicate an item i's inclusion in the selection C ⊆ A. We prove the equivalence of the two models by showing that their likelihood functions are equivalent at all values of (C, XA, β), where C ⊆ A. The likelihood of selecting items C ⊆ A under a logistic regression model with data XA and parameters β is given by the product of the probability of selecting the items in C, and the product of not selecting the items in A\C: (cid:96)(C, XA, β) = (cid:32) eβT xi 1 + eβT xi (cid:89) i∈C (cid:33) (cid:18) (cid:89) j∈A\C 1 1 + eβT xj (cid:19) . The products are a consequence of the assumed independence between selections. To finish the proof, it suffices to show that the likelihood of the determinantal choice model, when S = I, is equal to this likelihood. To this end, we make use the assumption that S = I. Under this assumption both the DPP kernel L and the the matrix L + I are diagonal. This considerably simplifies the DPP likelihood expression. Pr[Choose C] = det(LC) det(L + I) = (cid:81) (cid:81) i∈C (cid:0)q2(xi, β)(cid:1) j∈A (q2(xj, β) + 1) = (cid:89) (cid:18) q2(xi, β) (cid:19) (cid:89) (cid:18) q2(xi, β) + 1 i∈C j∈A\C (cid:19) 1 q2(xj, β) + 1 The proof now follows from our particular choice of quality-model. Under this model the squared quality of item i is exactly eβT xi. q2(xi, β) = (cid:18) exp (cid:26) 1 2 βT xi (cid:27)(cid:19)2 = exp{βT xi} (cid:3) A.4 Proof of Theorem 4.2 Proof of Theorem 4.2. Fix an assortment A with data XA, and a parameter vector β. We need to prove that if S = J (the all 1s matrix), then the determinantal choice model is equivalent to a MNL model in which the only outcomes with positive probability are the choice of a single item, i ∈ A, or opting out without choosing and item. It again suffices to prove that the likelihoods are equal, for an arbitrary selection C ⊆ A. The likelihood function under an MNL model with feature matrix XA and parameters β is [Choose C] = Pr MNL    1 + (cid:80) 1 + (cid:80) 0 exp βT xi j∈C exp{βT xj} 1 j∈C exp{βT xj} if C = {i} with i ∈ A, if C = ∅, otherwise. Now, consider the determinantal choice model likelihood of a singleton set {i} with i ∈ C. As before the (unnormalized) likelihood of a singleton is the squared quality of that item. [Choose {i}] ∝ q2(xi, β) = exp{βT xi} Pr DPP Similarly, the unnormalized likelihood of choosing no item 1. Finally, note that the likelihood of any subset B ⊆ A of size two or larger is 0, because the similarity matrix SB is all 1s, and thus perfectly linearly dependent, so its determinant is zero. It follows that the normalizing constant when S = J is exactly the sum of the squared qualities plus 1 for the empty set. (cid:88) B⊆A det(LB) = 1 + exp{βT xi} (cid:88) i∈C This proves that the determinantal choice model likelihood, when S = I, is equivalent to that of MNL. (cid:3) 14 An Interpretable Determinantal Choice Model for Subset Selection B LoRaWAN Experimental Setup This section describes the laboratory LoRaWAN test bench and the process used to generate the interference data used in Section 6. The main goal of the experiments conducted is to generate training data from which our determinantal choice model can learn the mechanisms underlying LoRaWAN interference, and evaluation data for judging the success of our approach. The test bench itself is also validated by replicating know LoRaWAN interference phenomena. This section proceeds with describing the equipment used, the test bench software, the validation experiments, and finally the generation of training and evaluation data. B.1 Equipment Used The test bench includes nine devices: eight Adafruit Feather M0+ LoRa boards with HopeRF RFM95 modules; and one Sparkfun LoRa Thing Plus which includes a Semtech SX1262 LoRa radio. Antennas are a mix of commercially-available 2dBi whip antennas and untuned wire whip antennas. The 2dBi antennas are not attached to a large ground-plane. An open-loop UART controls bus allows for simple hookup and synchronization of the LoRa nodes. A Raspberry Pi 3B+ handled the interface with the SX1301 LoRa concentrator. B.2 Test Bench Software All LoRa nodes are programmed with Arduino tools. The RFM95 devices use the radio driver packaged with MCCI's version of LMIC, while the SX1262 uses the RadioLib driver. A Python 3 serial interface allowed for control and logging of an experiment's transmitted packets, and libloragw's C interface allowed for logging of packets received on the SX1301. B.3 Validation Experiments Initial experiments are conducted to verify general functionality of the test bench. They characterized the SX1301's ability to receive eight 125kHz bandwidth LoRa packets over different channels and spreading factors, despite transmission periods overlapping. Power sweep experiments characterized the magnitude transfer function between the RFM95 and SX1301. There is a nearly linear relationship between transmitted power and received power in the test bed; this makes the transmitted power an effective estimate for received power. While received power – the power at which a packet arrives a the receiver – is of main interest, it is difficult to infer the received power of lost transmissions, as this is only registered upon successful reception. Transmitted power is a reasonable proxy in this setting. Overall, the experiments verify that the behavior of the test bench is broadly consistent with the expected behavior of LoRaWAN transmissions. B.4 Data generation The training and evaluation data is generated by specifying, and sampling from, a distribution over collections of LoRaWAN wireless transmissions. More specifically, a distribution over transmission parameters and transmission times is specified, sampled from, and then transmitted through the test bench. The parameter distribution is additionally manipulated to generate richer variability in the data, particularly by encouraging more collisions. The data generating process is the following. There are K > 0 active devices. Each active device makes one transmission per observation. The transmission start time is sampled independently uniformly over [0, Dmax], rounded to the nearest integer. The value Dmax > 0 is a maximum delay in ms, set to 2000 ms. Independently of the start time, each transmissions is assigned an integer-valued transmission power uniformly at random between between −4 and 23 dBm. The channel and spreading factor are also chosen uniformly at random from a given set of 8 and 4 categorical values, respectively. To increase the occurrence of packet collisions, the parameters are varied across some trials. In particular, for some trials Dmax is set to 600 ms, and the number of channels and spreading factors is restricted to 2 or 4. The subsets of channels and spreading factors used are varied uniformly over observations whenever they are smaller than the full set of possibilities. Finally, the number of devices is K is varied between 7 and 9. This method was used to generate over 1, 000 observations. Because the focus of this work is on wireless interference in the presence of collisions, some observations (though not all) in which no collisions take place are removed ex post. 15
http://arxiv.org/abs/2302.11472v1
2023-02-22T16:18:38
2023-02-22T16:18:38
Distilling Calibrated Student from an Uncalibrated Teacher
Knowledge distillation is a common technique for improving the performance of a shallow student network by transferring information from a teacher network, which in general, is comparatively large and deep. These teacher networks are pre-trained and often uncalibrated, as no calibration technique is applied to the teacher model while training. Calibration of a network measures the probability of correctness for any of its predictions, which is critical in high-risk domains. In this paper, we study how to obtain a calibrated student from an uncalibrated teacher. Our approach relies on the fusion of the data-augmentation techniques, including but not limited to cutout, mixup, and CutMix, with knowledge distillation. We extend our approach beyond traditional knowledge distillation and find it suitable for Relational Knowledge Distillation and Contrastive Representation Distillation as well. The novelty of the work is that it provides a framework to distill a calibrated student from an uncalibrated teacher model without compromising the accuracy of the distilled student. We perform extensive experiments to validate our approach on various datasets, including CIFAR-10, CIFAR-100, CINIC-10 and TinyImageNet, and obtained calibrated student models. We also observe robust performance of our approach while evaluating it on corrupted CIFAR-100C data.
[ "Ishan Mishra", "Sethu Vamsi Krishna", "Deepak Mishra" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11472v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11472v1", "@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 2 2 ] V C . s c [ 1 v 2 7 4 1 1 . 2 0 3 2 : v i X r a Distilling Calibrated Student from an Uncalibrated Teacher Ishan Mishra Indian Institute of Technology, Jodhpur Jodhpur, Rajasthan, India [email protected] Sethu Vamsi Krishna Indian Institute of Technology, Jodhpur Jodhpur, Rajasthan, India [email protected] Deepak Mishra Indian Institute of Technology, Jodhpur Jodhpur, Rajasthan, India [email protected] Abstract Knowledge distillation is a common technique for im- proving the performance of a shallow student network by transferring information from a teacher network, which in general, is comparatively large and deep. These teacher networks are pre-trained and often uncalibrated, as no cal- ibration technique is applied to the teacher model while training. Calibration of a network measures the probability of correctness for any of its predictions, which is critical in high-risk domains. In this paper, we study how to obtain a calibrated student from an uncalibrated teacher. Our ap- proach relies on the fusion of the data-augmentation tech- niques, including but not limited to cutout, mixup, and Cut- Mix, with knowledge distillation. We extend our approach beyond traditional knowledge distillation and find it suit- able for Relational Knowledge Distillation and Contrastive Representation Distillation as well. The novelty of the work is that it provides a framework to distill a calibrated student from an uncalibrated teacher model without compromising the accuracy of the distilled student. We perform extensive experiments to validate our approach on various datasets, including CIFAR-10, CIFAR-100, CINIC-10 and TinyIma- geNet, and obtained calibrated student models. We also ob- serve robust performance of our approach while evaluating it on corrupted CIFAR-100C data. 1. Introduction Recent advances in deep learning have made deep neu- ral networks (DNNs) [9, 11, 25] achieve human-like perfor- mance in terms of accuracy. However, these models are [7, 16] and deploying them in high- often overconfident risk domains like medical, astronomical, autonomous ve- hicles, etc., becomes unsafe. Thus, the calibration of DNNs becomes critical for trustworthy AI, which helps in align- ing the model's confidence with its accuracy. Various techniques like vector scaling [7, 20], matrix scaling [7], temperature scaling [6, 12, 20], label smoothing [4, 19], mixup [26, 38], CutMix [34] etc. help in calibrating the DNNs. Moreover, techniques like cutout, mixup, and Cut- Mix, categorised under data-augmentation techniques, have also shown to make the DNN robust. However, training deep architectures with these techniques incurs overhead, while shallow architectures cannot match the accuracy of their deeper counterparts, even with augmentation. Thus, a method to transfer the knowledge from deep architectures to a shallow architecture while also improving its calibration is desirable. Knowledge distillation (KD) [10] is a technique that en- hances the performance of a student network by incorpo- rating the knowledge from a teacher network. Generally, the student network is shallow, and the teacher network is a deeper network pre-trained on a large-scale dataset like ImageNet. KD is used extensively in real-life scenarios where computational complexity is a critical factor. The teacher model being a deep architecture is often expen- sive to deploy on a local machine, while a shallow stu- dent architecture, trained from scratch, does not deliver the same performance. Thus, KD helps in increasing the ac- curacy of the shallow student network. Various modifi- cations over traditional KD are reported in past to boost the performance of the student network, for example, Re- lational KD (RKD) [21], Contrastive Representation Distil- lation (CRD) [27], etc. However, improving the accuracy of the student without paying attention to its confidence makes it uncalibrated. Stanton et al. [24] analyzed the accuracy and fidelity of the student in the view of KD. Fig. 1 shows the poor calibration of the student distilled using conven- tional KD. Some works [5, 18] show the distillation of a well- calibrated student from an already-calibrated teacher. How- ever, large models with millions of parameters, quite com- mon these days, are often unclibrated and calibrating such pre-trained model is expensive due to the involvement of huge datasets. We, therefore, ask a question - can a cali- brated student be distilled from an uncalibrated teacher?, and try to find its answer through our approach. Following are the main contributions and findings of our paper: • We develop a simple approach to distilled a well- calibrated student network from an uncalibrated teacher. We use scaled version of KL-divergence loss with the augmentation loss to improve the calibration of the student. • We propose a generalised framework that can easily be integrated with a variety of distillation and augmenta- tion techniques. We perform experiments using three different augmentation techniques namely mixup, Cut- Mix, cutout and with different distillation techniques like RKD and CRD. • We perform experiments on various datasets, includ- ing CIFAR-10, CIFAR-100, CINIC-10, and TinyIma- geNet and obtain a student which is even better than teacher in terms of calibration. • We perform experiments on corrupted (CIFAR-100C) to demonstrate the robustness of the distilled student network using our approach. 2. Related Work (a) Teacher (b) Student (c) KD Figure 1. (a), (b) and (c) show the scatter plots of accuracy vs confidence for teacher, student and student distilled using conven- tional KD on CIFAR-100 dataset respectively. A well calibrated model will have most of its density along the x = y line. We observe that (i) the teacher is not calibrated but accurate, (ii) the student model trained from scratch is poorly calibrated and less accurate than the teacher, (iii) by performing distillation, we get a student that is still not well calibrated. new losses, distance-wise and angle-wise loss, to minimize the structural difference in relations. Beyer et al. [2] in- troduced the concept of function matching to improve the transfer of knowledge from teacher to student by making both see the consistent input and training the students us- ing a long training schedule. Shen et al. [23] used the re- labelling technique of Yun et al. [35] along with data aug- mentation to boost the performance of the student network in an efficient manner. Li et al. [13] and Yang et al. [32] dis- tilled the student using self-knowledge fused with mixup at the feature level, i.e. the feature maps were mixed using the mixup technique. Malinin et al. [15] proposed an ensemble approach to improve the calibration of the model by using the prior networks [14] in the distillation framework. There has been a lot of research in KD [2, 37, 43] to improve the accuracy of the student in different distillation modes. 2.1. Knowledge Distillation 2.2. Knowledge distillation with data augmentation The first instance of knowledge transfer was reported by Bucilua et al. [3], where a single student is distilled from an ensemble of networks. Ba and Caruana [1] used the knowledge of a deep neural network to increase the accu- racy of a shallow network. The term "Knowledge Distilla- tion" was coined by Hinton et al. [10] with the idea of mini- mizing the KL loss between the softened probabilities from the last layer of the teacher and student model. Broadly, KD is classified into offline, online [8, 29, 42], and self dis- tillation [17, 30, 41] based on the pre-trained teacher. Re- searchers [22, 36] have also explored minimizing the loss between the intermediate layers rather than the last layer, which finds the similarity between the feature representa- tion of the teacher and student. Yim et al. [33] proposed a method of distilling relational knowledge from the teacher by using Gram matrix between the feature maps of first and last layers of the teacher model. Park et al. [21] pro- posed RKD aiming to transfer knowledge by finding the relation between different instances. They introduced two Wang et al. [28] demonstrated the role of data augmen- tation in KD. They passed both the original and the aug- mented data through the teacher network while training the student network. Zhao et al. [44] proposed similarity trans- fer for KD. They use mixup technique to generate virtual samples forming a new dataset, which distills knowledge from the teacher to the student. Zhang et al. [39] pro- posed an augmentation-based distillation technique that fo- cuses on improving the accuracy of the student network. They perform cross-distillation using mixup and CutMix augmentation techniques. Xu et al. [31] proposed a compu- tationally efficient KD by combining uncertainty and mixup with KD. It was discussed in [45] that a better teacher does not necessarily make a better student and there may also be a degradation in the accuracy of the distilled student. Muhammad et al. [18] proposed mixup-based robustness transfer via distillation of activated channel maps (Mix- ACM) that makes the student robust by distilling knowledge from the adversarially trained robust teacher using mixup Ltask = N (cid:88) i=1 −yi log fs(xi) (2) where N is the total number of samples in the dataset. KL loss is the Kullback-Leibler Divergence score which de- scribes the difference between the probability distribution of soft labels of teacher T and student S. In conventional KD [10], the KL-divergence loss and the task-specific loss are linearly combined as follows: LHKD = α ∗ Ldiv + (1 − α) ∗ Ltask (3) where α is a balancing factor. Generally, the value of α is kept high to ensure high knowledge transfer from the teacher to the student, however, doing so makes the student network highly uncalibrated as shown in Fig. 1. Therefore, we scale the KL-divergence loss by taking mean across the dimension of the logits (i.e. dividing it by the logit size, which is same as number of classes). Using this scaled KL- divergence loss we observe a improvement in the calibration and a drop in accuracy, as shown in Fig. 2. We encounter a trade-off between accuracy and calibration error in the framework of KD1. Our approach leverages the distillation framework to take care of the accuracy while improving the calibration with the help of data augmentation techniques. 3.2. Distillation with Augmentation: Framework for Calibration Integrated In this section, we discuss a generic framework that makes our approach work on any distillation technique with any augmentation technique. Let AKD be a distillation scheme having its loss as lA and Gaug be an augmentation scheme that generates xG samples using the original data samples x and having its own loss as lG. We replace the task-specific loss with the loss corresponding to the aug- mentation scheme. If the augmentation scheme does not have its own loss, we use the standard cross entropy loss as a task-specific loss. In our framework, we pass the original samples through both the teacher and student networks and obtain the logits/features corresponding to the original data as, LKD = lA(ft(x), fs(x)) (4) We compute the distillation loss LKD between the outputs of teacher and student using the distillation-specific loss function lA as shown in Eq. (4). Our framework is inde- pendent of the nature of this loss, i.e., whether it is applied at the feature level or logit level. Simultaneously, we pass the augmented samples through the student network (only) and apply the augmentation-specific loss. LAug = lG(y, zaug s ) (5) (a) KD (b) Scaled KD Figure 2. (a) and (b) show the calibration plots for vanilla KD and scaled KD with α = 0.5. Scaled KD has a better calibration than vanilla KD but with decreased accuracy. augmentation. The advantage of using data augmentation and KD in an integrated framework for calibrating the student network is an open problem. Researchers have mainly focused on improving the accuracy of the student model while over- looking the calibration aspect. Our approach addresses this gap by keeping its prime focus on improving the calibration of the student network without using a robust teacher. To the best of our knowledge, none of the previous works ad- dresses the problem of distilling a calibrated student from an uncalibrated teacher in the image domain. In cases where an improvement in calibration of the student has been re- ported, the teacher for such approaches was either adver- sarially trained or a certain technique was used to make the teacher robust. Subsequently, a calibrated teacher resulted in a calibrated student with standard KD. This differs from our approach as we do not make teachers calibrated or ro- bust and use it the way it is. 3. Proposed Method In this section, we first revisit the concept of distillation followed by data augmentation techniques and then present the generalised framework of our approach. Notation: Let S be the student model and T be the teacher model. This teacher model is pre-trained on the data D. Let ft and fs represent the output (logits) of the teacher and student net- work respectively. Let X represent the original data and y represent its corresponding label. 3.1. Knowledge distillation The primary goal of KD is to distill the dark knowledge from the teacher network into the student network by com- paring the temperature-scaled softmax logits of the teacher and student. The loss term generally consists of two losses, KL divergence loss (Ldiv) and a task-specific loss (Ltask). Ldiv = (cid:88) xi∈X KL[fs(xi)||(ft(xi)] (1) 1For detailed experiments on KD (without scaling) and without using ground truth, please refer to the supplementary material. Calibrated distillation using mixup Mixup is a data-augmentation technique developed by [38]. It is a linear interpolation of the images and labels to gen- erate the new augmented data. Thulasidasan et al. [26] ac- knowledged the calibration and generalization property of mixup. Zhang et al. [40] theoretically proved the improve- ment in calibration metrics when the model is trained us- ing mixup. In addition, mixup is also shown to reduce the overconfidence error of the model. Consider two random samples from the dataset, (xi, yi) and (xj, yj). Mixup gen- erates a new data point in the vicinity of the original data distribution by using these two data points controlled by hyperparameter "λ". Mathematically, mixup is defined as follows: xmix = λ ∗ xi + (1 − λ) ∗ xj ymix = λ ∗ yj + (1 − λ) ∗ yj (7) (8) The empirical Dirac delta distribution centered at (xi, yi) Pδ(x, y) = 1 n n (cid:88) i δ(x = xi, y = yi) (9) is replaced with the empirical vicinal distribution Pv(xmix, ymix) = 1 n n (cid:88) i ν(xmix, ymix|xi, yi) (10) where (xmix, ymix) is the mixup generated data point, and ν is the vicinal distribution that gives the probability of the new sample in the vicinity of the original data distribution. This vicinity distribution gives the probability Pv of finding an augmented sample. Usually λ is sampled from a beta distribution β(a, a) where a ∈ (0, ∞). We will not use soft label ymix in future operations; therefore, we skip this computation, instead we use hard labels. The mixup loss is defined as follows: LCE = −[λ∗yi∗log(fs(xmix))+(1−λ)∗yj∗log(fs(xmix))] (11) where yi and yj are the true labels corresponding to the im- age xi and xj. Since mixup uses two images to generate an augmented image, we modify the distillation loss as fol- lows: 1 nc LKD = (KL[ft(xi)||fs(xi)] + KL[ft(xj)||fs(xj)]) (12) where nc is the number of classes. The distillation objective function takes the following form: L = αLKD + (1 − α)LCE (13) The hyper-parameter α signifies the amount of knowledge to be gained by the student from the teacher and by itself Figure 3. Illustration of our proposed framework. The original image is passed through the teacher ft and the student fs network to compute the KL divergence or distillation loss LKD between the soft logits of teacher and student. Since the teacher is uncal- ibrated, the augmented image xaug is passed through the student network only. The augmentation-based loss Laug is then applied to the logits zaug and true labels. s Here lG is the augmentation-specific loss function, y is the true label corresponding to the augmented sample xG and zaug s = fs(xG) is the logit vector corresponding to the aug- mented input xG. As the teacher is uncalibrated, there is no benefit of passing the augmented input through it. The overall loss is represented as follows: L = αA ∗ LKD + (1 − αA) ∗ LAug (6) The balancing factor αA is a hyper-parameter correspond- ing to the AKD distillation scheme. This hyper-parameter regulates the trade-off between the calibration and accuracy of the student model. 3.3. Improving calibration w/o accuracy degrada- tion Calibration implies that the model is generalized and does not give overconfident predictions. Various data- augmentation schemes like mixup and CutMix are theoret- ically proven or empirically shown in the literature to im- prove the calibration and accuracy of the standalone net- works. In our framework, the student learns the knowl- edge from two sources: distillation and augmentation. Dis- tillation loss targets accuracy, while augmentation-specific loss targets the calibration of the student model. In con- ventional KD, higher weightage is given to the distillation loss, however, to improve the calibration of the student, the augmentation-specific loss needs more weightage. As the teacher is uncalibrated, improvement in calibration is more likely to come from the augmentation. via training using augmented data. Our integrated approach using mixup is shown in Fig. 3. Similar to mixup, we apply our technique to calibrate student models using cutout and CutMix2. 4. Experiments We present our experiments on the calibration of the dis- tilled classifiers. We take mean of the KL-divergence loss by dividing it by the size of the logit vector and refer to this scaled version as conventional KD unless stated otherwise. We conduct several experiments to observe the student net- work calibration using the popular data augmentation tech- niques such as cutout, mixup, and CutMix. We use datasets such as CIFAR-10/100, CINIC-10, and TinyImageNet for image classification experiments and report the calibration metrics (ECE and OE) corresponding to best validation ac- curacy. For understanding the robustness of our approach we use CIFAR-100C dataset3. 4.1. Calibration Metrics In the experiments, we use two calibration metrics namely ECE (expected calibration error) and OE (overcon- fidence error) defined as follows: ECE = B (cid:88) b=1 nb N |acc(b) − conf (b)| (14) OE = B (cid:88) b=1 nb N [conf (b)×max(conf (b)−acc(b), 0)] (15) where nb is the number of predictions in bin b, N is the number of testing samples, B is the total number of bins, acc(b) and conf (b) are the accuracy and average confi- dence corresponding to bin b. We follow Thulasidasan et al. [26] implementation of ECE and OE. 4.2. Setup For CIFAR-10/100 and CINIC-10 dataset experiments, we use SGD optimizer having momentum of 0.9, weight decay of 5 × 10−4 and initial learning rate of 0.1 (0.01 for MobileNet, ShuffleNet architectures). Similar to [27], we train networks for 240 epochs with batch size of 64 for CIFAR10/100 and 256 for CINIC-10 datasets. We use CosineAnnealingLR as a learning rate scheduler with Tmax =240. For TinyImageNet dataset experiments, we use the same optimizer except a weight decay of 10−4. We train the networks for 200 epochs with batch size of 128 and scheduled the learning rate using MutliStepLR having mile- stones at 150 and 180 epochs and decay factor of 0.1. For 2For details and implementation please refer to supplementary material 3We perform experiments on OOD data also and include our findings in the supplementary material. RKD and CRD experiments, we use author provided hyper- parameters for their respective loss functions. For all the ex- periments, conventional KD's Temperature, mixup β distri- bution parameter (a), and loss balancing factor (α) are fixed as 50, 0.4, and 0.5 respectively unless otherwise stated. For the experiments involving cutout augmentation technique, the number of holes is 1 and size of masked region is 16 × 16. We use the standard hyper-parameters for CutMix aug- mentation technique (number of holes =1, CutMix proba- bility=0.5). In all the experiments, standard augmentations like random crop, horizontal flip, and normalization are ap- plied to the images. 4.3. Image Classification CIFAR-100 The CIFAR-100 dataset consists of 60,000 RGB images of size 32 × 32. The dataset has 100 classes where each class consists of 500 train images and 100 test images. In our experiments , we use six (teacher, student) pairs as shown in Tab. 1. For CIFAR-100 experiments, the teacher and stu- dent networks have different architectures. We refer scaled KD as KD in all our experiments as scaling helps in cali- bration (refer Fig. 2). We use KD (scaled), RKD [21] and CRD [27] as baselines for comparison. Tab. 1 shows that the students distilled through our integrated framework are bet- ter calibrated with comparable accuracy and reduced over- confidence. Note that unlike the well-engineered and ad- vance distillation approaches, RKD and CRD, we use con- ventional KD while distilling a calibrated student through our approach. Later in Sec. 4.5, we show that RKD and CRD can also be improved through proposed framework. Out of the 3 augmentation techniques considered in our experiments, CutMix and mixup calibrates the student model better than cutout. CutMix, which takes the advan- tage of both cutout and mixup does better than mixup in most cases. Our approach has reduced the ECE of the stu- dent model up to 5 times when compared with that of the student trained from scratch. In all the teacher-student con- figurations, it is observed that the student model has an im- proved calibration (ECE) than the corresponding teacher network. Mixup [26] targets the overconfidence of the model, therefore KD + mixup drastically reduces the OE of the model which makes it suitable for high risk domains. The calibration plots for teacher-student pair: ResNet32x4 and ShuffleNetV1 are shown in Fig. 4. We observe that KD and KD + cutout slightly improves the calibration of the stu- dent network while KD + mixup and KD + CutMix shows significant improvement in the calibration by aligning the confidence of the model with the accuracy. (a) Teacher (b) Student (c) KD (d) KD + cutout (e) KD + mixup (f) KD + CutMix Figure 4. Calibration plot for CIFAR-100 dataset. (a), (b) and (c) are identical to Fig. 1a, 1b and 2b. They are included here only for completeness. (d), (e) and (f) are calibration plots for KD + cutout, KD + mixup and KD + CutMix respectively. The teacher is ResNet32x4 and the student is ShuffleNetV1. The graph shows a scatterplot of accuracy vs confidence. We observe that KD + mixup and KD + CutMix shows a considerable improvement in the calibration of the student. Teacher/ Student WRN-40-2/ ShuffleNetV1 ResNet32x4/ ShuffleNetV2 ResNet50/ MobileNetV2 ResNet50/ VGG8 ResNet32x4/ ShuffleNetV1 VGG13/ MobileNetV2 Metrics Teacher Student KD RKD CRD KD + KD + KD + cutout mixup CutMix Acc ECE OE Acc ECE OE Acc ECE OE Acc ECE OE Acc ECE OE Acc ECE OE 77.09 0.103 0.085 79.21 0.068 0.052 78.98 0.104 0.086 78.98 0.104 0.086 79.21 0.068 0.052 76.36 0.073 0.057 70.58 0.121 0.093 73.19 0.104 0.083 63.2 0.169 0.129 70.3 0.122 0.096 70.58 0.121 0.093 63.2 0.169 0.129 71.05 0.108 0.084 72.58 0.104 0.082 63.92 0.135 0.101 70.79 0.091 0.070 71.86 0.096 0.077 64.13 0.130 0.097 73.41 0.126 0.100 73.68 0.122 0.098 63.81 0.167 0.128 71.4 0.103 0.077 71.96 0.130 0.103 63.44 0.167 0.127 75.28 0.106 0.087 75.14 0.105 0.087 67.53 0.134 0.103 73.27 0.101 0.080 73.98 0.110 0.089 67.35 0.114 0.086 72.46 0.090 0.067 74.05 0.087 0.066 64.03 0.097 0.068 71.47 0.087 0.063 73.23 0.087 0.065 64.03 0.103 0.071 74.65 0.049 0.002 75.25 0.042 0.003 65.94 0.051 0.001 71.94 0.050 0.002 74.68 0.051 0.001 66.48 0.047 0.002 74.94 0.046 0.031 76.64 0.061 0.044 67.32 0.037 0.019 72.3 0.031 0.011 74.63 0.036 0.023 66.44 0.037 0.022 Table 1. Experiment result on CIFAR-100 dataset. The table shows the result of our framework on six teacher-student pairs. We observe a significant improvement in the calibration of the student for all the teacher-student pairs considered for CIFAR-100 dataset. The best scores are highlighted in bold and second best are underlined. CIFAR-10 and CINIC-10 The CIFAR-10 consists of 60,000 RGB images of size 32 × 32. The dataset has 10 classes where each class consists of 5000 train images and 1000 test images. We perform ex- periments on various architectures to show the effectiveness of our approach in calibrating the student network. The re- sults of our experiments are shown in Table 2. Since the dataset is small, we observe a good ECE for teachers. In the (VGG13, MobileNetV2) combination, we observe im- provement in calibration when the teacher has higher ECE than student. In other combinations, the teacher network has lower ECE compared to the student. Our approach out- performs the conventional KD in terms of ECE and OE. The student network distilled using our approach is well- calibrated and even more accurate. Among the augmenta- tions considered, KD + CutMix approach results in com- paratively better calibration similar to the previous experi- ments. We observe that the KD + mixup, similar to previous experiments, decreases the overconfidence by a large factor, and KD + cutout approach also gives a better-calibrated stu- dent when compared with the student (trained from scratch) and KD. Teacher Student Metrics Teacher Student KD KD + cutout KD + mixup KD + CutMix VGG13 MobileNetV2 ResNet50 MobileNetV2 VGG13 VGG11 Accuracy ECE OE Accuracy ECE OE Accuracy ECE OE 93.92 95.01 95.19 96.25 95.83 96.3 0.039 0.031 0.034 0.025 0.021 0.019 0.034 0.027 0.031 0.022 0.013 0.014 95.51 95.01 95.26 96 95.75 96.22 0.027 0.031 0.035 0.021 0.023 0.021 0.024 0.027 0.031 0.018 0.012 0.018 93.92 92.4 92.84 93.38 93.35 93.64 0.039 0.047 0.050 0.040 0.028 0.022 0.034 0.041 0.044 0.035 0.015 0.016 Table 2. Experiments on CIFAR-10 dataset: Our approach improves the calibration error of the student network as compared to traditional KD. Among various augmentation techniques, CutMix augmentation integrated using our approach has distilled a calibrated as well as accurate student. Teacher Student Metrics Teacher Student KD KD + cutout KD + mixup KD + CutMix VGG13 MobileNetV2 ResNet50 MobileNetV2 VGG13 VGG11 Accuracy ECE OE Accuracy ECE OE Accuracy ECE OE 84.68 86.43 87.05 88.1 87.24 87.75 0.105 0.092 0.094 0.075 0.044 0.045 0.095 0.083 0.087 0.067 0.035 0.003 88.2 86.43 86.95 88.04 87.64 87.69 0.085 0.092 0.101 0.075 0.048 0.030 0.078 0.083 0.094 0.067 0.041 0.018 84.68 81.62 82.54 83.22 82.31 83.12 0.105 0.125 0.126 0.106 0.093 0.025 0.095 0.112 0.115 0.093 0.080 0.011 Table 3. Experiments on CINIC-10 dataset. Our approach outperforms the conventional KD in the calibration metrics by reducing the ECE to approximately half when compared with the student trained from scratch. Metrics Teacher Student KD KD + cutout KD + mixup KD + CutMix Accuracy ECE OE 57.28 55.76 56.22 58.6 58.11 60.99 0.140 0.146 0.103 0.102 0.074 0.049 0.100 0.103 0.072 0.070 0.004 0.026 Table 4. Experiments on TinyImageNet Dataset. We report the calibration metrics of the best validation accuracy of the model obtained through training. We extend our observation to CINIC-10 dataset which is downsampled from both CIFAR-10 and ImageNet. It con- sists of 270,000 colored images of size 32x32. The dataset contains training, validation and test set with each set hav- ing 90,000 images. The results for CINIC-10 are shown in Tab. 3. We observe a similar trend as in CIFAR-10 with improvement in the calibration of the student model trained using our framework. For CINIC-10, CutMix approach has performed comparatively better in terms of calibration. Metrics Accuracy ECE OE RKD-DA RKD-DA + cutout RKD-DA + mixup RKD-DA + CutMix CRD CRD + cutout CRD + mixup CRD + CutMix 72.81 73.7 75.87 74.81 75.03 75.84 76.56 76.41 0.113 0.102 0.041 0.046 0.083 0.080 0.065 0.046 0.089 0.080 0.002 0.001 0.064 0.063 0.002 0.015 Table 5. Experiment results of RKD and CRD distillation tech- niques on CIFAR-100. TinyImageNet TinyImageNet is a subset of the ImageNet dataset. It con- sists 200 class images of resolution 64x64x3 with a train- ing set consisting of 100,000 images and a validation set consisting of 10,000 images. In this experiment, we con- sider ResNet-34 and ResNet18 as teacher and student re- Frost Snow Gaussian Blur Motion Blur Metrics Teacher Student KD Acc ECE OE Acc ECE OE Acc ECE OE Acc ECE OE 51.77 0.177 0.132 57.33 0.128 0.095 54.51 0.176 0.132 0.140 0.105 51.36 0.200 0.146 53.53 0.185 0.134 50.09 0.224 0.163 51.17 0.212 0.155 51.03 0.188 0.139 53.56 0.166 0.121 51.33 0.183 0.132 52.99 0.175 0.128 57.9 44.91 0.204 0.141 51.33 0.166 0.115 47.88 0.198 0.135 51.17 0.181 0.128 KD + cutout 56.44 0.049 0.018 60.24 0.037 0.007 51.38 0.076 0.036 53.64 0.049 0.022 KD + mixup KD + CutMix 49.97 0.132 0.090 55.82 0.091 0.061 51.41 0.132 0.086 52.26 0.127 0.086 Table 6. Experiment results on CIFAR-100C. We evaluated our models trained on CIFAR-100 dataset on the corrupted data. We observe a better calibration for the corrupted dataset. spectively. The results on the validation set are reported in Tab. 4. The teacher and student have high ECE and OE, therefore are poorly calibrated. We observe an consider- able improvement in the calibration of the student network for all augmentations considered. KD + mixup approach has reduced the overconfidence error by a factor of 50 and KD + CutMix reduced the ECE by nearly one-third when compared with the student trained from scratch. The ac- curacy of models distilled using our mixup and cutmix ap- proach has surpassed the accuracy of the teacher which is an additional benefit. This shows the effectiveness of our framework even on a TinyImageNet which is considerably a large and complex dataset. 4.4. Testing Robustness CIFAR-100C CIFAR-100C is a corrupted dataset of CIFAR-100 with sev- eral noises. It consists of 15 different corruption schemes, with each corruption having 5 severity levels. Each cor- ruption set consists of 50,000 test images. In this exper- iment we consider four corruption schemes, namely frost, snow, gaussian blur and motion blur. We use ResNet32x4 as teacher and ShuffleNetV1 as student which are trained on original CIFAR-100 to evaluate the robustness of the proposed method. The results are averaged over all sever- ity levels and reported in Tab. 6. In this experiment, we measure the accuracy and calibration of the model when it is exposed to noisy inputs. We observe that in case of snow and frost noise, KD + mixup outperforms the per- formance of teacher, student and conventional distillation both in terms of accuracy and calibration. However, the cutout integration does not perform well as the important re- gions are blacked out i.e. information is lost when we apply cutout augmentation technique and the model finds it diffi- cult for high severity levels thereby decreasing the overall accuracy. KD + cutmix also shows am improvement in ac- curacy, ECE and OE when compared with conventional dis- tillation. This shows that our framework helps in the mak- ing the student robust for corrupted images. The choice of data-augmentation and distillation technique has an effect over the robustness of distilled student. In our experiments, we observe that KD + mixup surpasses the accuracy and ECE of conventional KD. 4.5. Extension to other KD techniques In this section, we explore the integration of other distillation techniques within our framework on CIFAR- 100 dataset. We extend our approach to RKD [21] and CRD [27]. The teacher-student pair for this framework is (WideResNet-40-2, ShuffleNetV1). The experiment results are reported in Tab. 5. We observe an improvement in the calibration metrics of these approaches along with better ac- curacy. For RKD and CRD, we replace the distillation loss LKD in equation by DA (distance-angle) and CRD loss re- spectively. We have not used any KL-divergence loss in this experiment. The experiments are performed on the hyper- parameters suggested by the respective authors except bal- ancing factor which is 0.5 in this experiment. We observe that mixup, CutMix and cutout integrated distillation shows a better calibration and accuracy. 5. Conclusions In this work, we successfully distilled a well-calibrated student from an uncalibrated teacher. Although augmenta- tion techniques have been utilized in past for accuracy im- provement while distillation but their benefit on calibration has remained unexplored. We bring forward this advantage and show it with the help of different distillation and differ- ent augmentation techniques. Our approach can be easily integrated to any existing or subsequently developed distil- lation techniques. We used different teacher-student combi- nations for different experiments to show the variability and generalizability of our proposed method. In future, we can explore a similar approach for data-free knowledge distilla- tion. References [1] Jimmy Ba and Rich Caruana. Do deep nets really need to be deep? Advances in neural information processing systems, 27, 2014. [2] Lucas Beyer, Xiaohua Zhai, Am ́elie Royer, Larisa Markeeva, Rohan Anil, and Alexander Kolesnikov. Knowledge distil- In Pro- lation: A good teacher is patient and consistent. ceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 10925–10934, June 2022. [3] Cristian Buciluˇa, Rich Caruana, and Alexandru Niculescu- Mizil. Model compression. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 535–541, 2006. [4] Blair Chen, Liu Ziyin, Zihao Wang, and Paul Pu Liang. An investigation of how label smoothing affects generalization. arXiv preprint arXiv:2010.12648, 2020. [5] Deepan Das, Haley Massa, Abhimanyu Kulkarni, and Theodoros Rekatsinas. An empirical analysis of the im- pact of data augmentation on knowledge distillation. arXiv preprint arXiv:2006.03810, 2020. [6] Zhipeng Ding, Xu Han, Peirong Liu, and Marc Nietham- mer. Local temperature scaling for probability calibration. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6889–6899, 2021. [7] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In International conference on machine learning, pages 1321–1330. PMLR, 2017. [8] Qiushan Guo, Xinjiang Wang, Yichao Wu, Zhipeng Yu, Ding Liang, Xiaolin Hu, and Ping Luo. Online knowl- edge distillation via collaborative learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pat- tern Recognition, pages 11020–11029, 2020. [9] 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. [10] Geoffrey Hinton, Oriol Vinyals, Jeff Dean, et al. Distill- arXiv preprint ing the knowledge in a neural network. arXiv:1503.02531, 2(7), 2015. [11] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kil- ian Q Weinberger. Densely connected convolutional net- works. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4700–4708, 2017. [12] Ananya Kumar, Percy S Liang, and Tengyu Ma. Verified un- certainty calibration. Advances in Neural Information Pro- cessing Systems, 32, 2019. [13] Xingjian Li, Haoyi Xiong, Chengzhong Xu, and Dejing Dou. Smile: Self-distilled mixup for efficient transfer learning. arXiv preprint arXiv:2103.13941, 2021. [14] Andrey Malinin and Mark Gales. Predictive uncertainty es- timation via prior networks. Advances in neural information processing systems, 31, 2018. [15] Andrey Malinin, Bruno Mlodozeniec, and Mark Gales. arXiv preprint Ensemble distribution distillation. arXiv:1905.00076, 2019. [16] Matthias Minderer, Josip Djolonga, Rob Romijnders, Frances Hubis, Xiaohua Zhai, Neil Houlsby, Dustin Tran, and Mario Lucic. Revisiting the calibration of modern neu- ral networks. Advances in Neural Information Processing Systems, 34:15682–15694, 2021. [17] Hossein Mobahi, Mehrdad Farajtabar, and Peter Bartlett. Self-distillation amplifies regularization in hilbert space. Ad- vances in Neural Information Processing Systems, 33:3351– 3361, 2020. [18] Awais Muhammad, Fengwei Zhou, Chuanlong Xie, Jiawei Li, Sung-Ho Bae, and Zhenguo Li. Mixacm: Mixup-based robustness transfer via distillation of activated channel maps. Advances in Neural Information Processing Systems, 34, 2021. [19] Rafael M ̈uller, Simon Kornblith, and Geoffrey E Hinton. When does label smoothing help? Advances in neural in- formation processing systems, 32, 2019. [20] Jeremy Nixon, Michael W Dusenberry, Linchuan Zhang, Ghassen Jerfel, and Dustin Tran. Measuring calibration in deep learning. In CVPR Workshops, volume 2, 2019. [21] Wonpyo Park, Dongju Kim, Yan Lu, and Minsu Cho. In Proceedings of the Relational knowledge distillation. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3967–3976, 2019. [22] Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. arXiv preprint arXiv:1412.6550, 2014. [23] Zhiqiang Shen and Eric Xing. A fast knowledge distil- arXiv preprint lation framework for visual recognition. arXiv:2112.01528, 2021. [24] Samuel Stanton, Pavel Izmailov, Polina Kirichenko, Alexan- der A Alemi, and Andrew G Wilson. Does knowledge dis- tillation really work? Advances in Neural Information Pro- cessing Systems, 34:6906–6919, 2021. [25] Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International conference on machine learning, pages 6105–6114. PMLR, 2019. [26] Sunil Thulasidasan, Gopinath Chennupati, Jeff A Bilmes, Tanmoy Bhattacharya, and Sarah Michalak. On mixup train- ing: Improved calibration and predictive uncertainty for deep neural networks. Advances in Neural Information Process- ing Systems, 32, 2019. [27] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Con- trastive representation distillation. In International Confer- ence on Learning Representations, 2020. [28] Huan Wang, Suhas Lohit, Michael Jeffrey Jones, and Yun Fu. What makes a "good" data augmentation in knowledge distillation - a statistical perspective. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, editors, Advances in Neural Information Processing Systems, 2022. [29] Guile Wu and Shaogang Gong. Peer collaborative learn- ing for online knowledge distillation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 10302–10310, 2021. [43] Borui Zhao, Quan Cui, Renjie Song, Yiyu Qiu, and Jiajun Liang. Decoupled knowledge distillation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11953–11962, 2022. [44] Haoran Zhao, Kun Gong, Xin Sun, Junyu Dong, and Hui Yu. Similarity transfer for knowledge distillation. arXiv preprint arXiv:2103.10047, 2021. [45] Yichen Zhu and Yi Wang. Student customized knowledge distillation: Bridging the gap between student and teacher. In 2021 IEEE/CVF International Conference on Computer Vision (ICCV), pages 5037–5046, 2021. [30] Guodong Xu, Ziwei Liu, Xiaoxiao Li, and Chen Change Loy. Knowledge distillation meets self-supervision. In European Conference on Computer Vision (ECCV), 2020. and Chen Change Loy. [31] Guodong Xu, Ziwei Liu, Computation-efficient via distillation uncertainty-aware mixup. arXiv preprint arXiv:2012.09413, 2020. knowledge [32] Chuanguang Yang, Zhulin An, Helong Zhou, Linhang Cai, Xiang Zhi, Jiwen Wu, Yongjun Xu, and Qian Zhang. Mixskd: Self-knowledge distillation from mixup for image recognition. arXiv preprint arXiv:2208.05768, 2022. [33] Junho Yim, Donggyu Joo, Jihoon Bae, and Junmo Kim. A gift from knowledge distillation: Fast optimization, network In Proceedings of the minimization and transfer learning. IEEE conference on computer vision and pattern recogni- tion, pages 4133–4141, 2017. [34] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regu- larization strategy to train strong classifiers with localizable features. In Proceedings of the IEEE/CVF international con- ference on computer vision, pages 6023–6032, 2019. [35] Sangdoo Yun, Seong Joon Oh, Byeongho Heo, Dongyoon Han, Junsuk Choe, and Sanghyuk Chun. Re-labeling im- agenet: from single to multi-labels, from global to local- In Proceedings of the IEEE/CVF Conference ized labels. on Computer Vision and Pattern Recognition, pages 2340– 2350, 2021. [36] Sergey Zagoruyko and Nikos Komodakis. Paying more at- tention to attention: Improving the performance of convolu- tional neural networks via attention transfer. arXiv preprint arXiv:1612.03928, 2016. [37] Hailin Zhang, Defang Chen, and Can Wang. Confidence- In ICASSP aware multi-teacher knowledge distillation. 2022-2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 4498–4502. IEEE, 2022. [38] Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimiza- tion. In International Conference on Learning Representa- tions, 2018. [39] Ke Zhang, Jin Fan, Shaoli Huang, Yongliang Qiao, Xiaofeng Yu, and Feiwei Qin. Cekd: Cross ensemble knowledge distil- lation for augmented fine-grained data. Applied Intelligence, pages 1–11, 2022. [40] Linjun Zhang, Zhun Deng, Kenji Kawaguchi, and James In In- Zou. When and how mixup improves calibration. ternational Conference on Machine Learning, pages 26135– 26160. PMLR, 2022. [41] Linfeng Zhang, Jiebo Song, Anni Gao, Jingwei Chen, Chen- glong Bao, and Kaisheng Ma. Be your own teacher: Improve the performance of convolutional neural networks via self distillation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3713–3722, 2019. [42] Ying Zhang, Tao Xiang, Timothy M Hospedales, and Huchuan Lu. Deep mutual learning. In Proceedings of the IEEE conference on computer vision and pattern recogni- tion, pages 4320–4328, 2018.
http://arxiv.org/abs/2302.11467v1
2023-02-22T16:06:00
2023-02-22T16:06:00
Power Constrained Autotuning using Graph Neural Networks
Recent advances in multi and many-core processors have led to significant improvements in the performance of scientific computing applications. However, the addition of a large number of complex cores have also increased the overall power consumption, and power has become a first-order design constraint in modern processors. While we can limit power consumption by simply applying software-based power constraints, applying them blindly will lead to non-trivial performance degradation. To address the challenge of improving the performance, power, and energy efficiency of scientific applications on modern multi-core processors, we propose a novel Graph Neural Network based auto-tuning approach that (i) optimizes runtime performance at pre-defined power constraints, and (ii) simultaneously optimizes for runtime performance and energy efficiency by minimizing the energy-delay product. The key idea behind this approach lies in modeling parallel code regions as flow-aware code graphs to capture both semantic and structural code features. We demonstrate the efficacy of our approach by conducting an extensive evaluation on $30$ benchmarks and proxy-/mini-applications with $68$ OpenMP code regions. Our approach identifies OpenMP configurations at different power constraints that yield a geometric mean performance improvement of more than $25\%$ and $13\%$ over the default OpenMP configuration on a 32-core Skylake and a $16$-core Haswell processor respectively. In addition, when we optimize for the energy-delay product, the OpenMP configurations selected by our auto-tuner demonstrate both performance improvement of $21\%$ and $11\%$ and energy reduction of $29\%$ and $18\%$ over the default OpenMP configuration at Thermal Design Power for the same Skylake and Haswell processors, respectively.
[ "Akash Dutta", "Jee Choi", "Ali Jannesari" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11467v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11467v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.DC", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.DC", "cs.LG", "cs.PF" ]
Power Constrained Autotuning using Graph Neural Networks Akash Dutta Iowa State University Iowa, USA [email protected] Jee Choi University of Oregon Oregon, USA [email protected] Ali Jannesari Iowa State University Iowa, USA [email protected] 3 2 0 2 b e F 2 2 ] C D . s c [ 1 v 7 6 4 1 1 . 2 0 3 2 : v i X r a Abstract-Recent advances in multi and many-core processors have led to significant improvements in the performance of scientific computing applications. However, the addition of a large number of complex cores have also increased the overall power consumption, and power has become a first-order design constraint in modern processors. While we can limit power consumption by simply applying power constraints, applying them blindly will lead to non-trivial performance degradation. To address the challenge of improving the performance, power, and energy efficiency of scientific applications on modern multi-core processors, we propose a novel Graph Neural Network based auto-tuning approach that (i) optimizes runtime performance at pre-defined power constraints, and (ii) simultaneously optimizes for runtime performance and energy efficiency by minimizing the energy-delay product. The key idea behind this approach lies in modeling parallel code regions as flow-aware code graphs to capture both semantic and structural code features. We demon- strate the efficacy of our approach by conducting an extensive evaluation on 30 benchmarks and proxy-/mini-applications with 68 OpenMP code regions. Our approach identifies OpenMP con- figurations at different power constraints that yield a geometric mean performance improvement of more than 25% and 13% over the default OpenMP configuration on a 32-core Skylake and a 16-core Haswell processors, respectively. In addition, when we optimize for the energy-delay product, our auto-tuner- selected OpenMP configurations demonstrate both performance improvement of 21% and 11% and energy reduction of 29% and 18% over the default OpenMP configuration at Thermal Design Power for the same Skylake and Haswell processors, respectively. Index Terms-Auto-tuning, OpenMP, GNN, Power constraint I. INTRODUCTION High-performance computing (HPC) systems have exploded in both capacity and complexity over the past decade, and this has led to substantial improvement in performance of various scientific applications. However, more complex larger systems consume more power, and in the absence of expensive cool- ing solutions, increased power consumption leads to higher temperature and inefficient resource utilization operational (via higher static power, shorter device lifespan, and more). As a result, power consumption has become a first-order hardware design constraint for modern multi- and many-core systems. Unfortunately, focusing on hardware advancements for reducing power consumption is insufficient, as inefficient usage of the underlying hardware due to poor parallel coding practices may negate any hardware improvements. Many software solutions currently exist for controlling power. At the processor level, vendor-provided tools can be used to artificially lower power consumption. For example, power consumption can be controlled in recent Intel processors using the Running Average Power Limit (RAPL) interface [1], which ensures that an application does not exceed a predefined power budget. However, a common drawback of a fixed power budget is that it slows down execution by lowering the processor clock, and this can have adverse effects on real- time or time-bound applications. At the data-center level, a common approach to reducing power consumption is through over-provisioning (i.e., have more hardware available than can be powered simultaneously at any time) and constraining the power limit for each node [2]. In such a setting, a static algorithm for distributing power across nodes may lead to degraded throughput, and a more sophisticated approach that adjusts the execution dynamically is required to harness the full potential of the underlying system. the One strategy to address both scenarios is to adjust execution of the application directly, such that they meet some user-specified (e.g., individuals or data-centers) performance and/or power constraints. This will allow users to tailor their application to domain-specific environments (e.g., edge or mobile computing) or design scheduling policies for data- center power management. OpenMP, as the de-facto parallel programming model for intra-node parallelism, provides a number of tunable parameters that highly influence code execution, which makes it highly suitable for this purpose. While there is already a large body of work targeting perfor- mance tuning, there are only a few studies that target power. In addition, due to the large configuration search space for OpenMP on modern multi- and many-core processors, most of these studies require multiple executions to determine the optimal configuration [3]–[8], which is both time consuming and resource intensive. As a motivating example, we consider the ApplyAcceler- ationBoundaryConditionsForNodes kernel from the LULESH [9] proxy application. On a 16-core dual-socket Haswell processor with a Thermal Design Power (TDP) of 85W, an ex- haustive search of the OpenMP configuration space yields the highest speedups of 7.54×, 2.11×, 1.80× and 1.67× over the typical (or default) OpenMP configuration at power constraints of 40W, 60W, 70W and 85W, respectively. However, none 1 of these OpenMP configurations lead to the highest energy efficiency. The most energy-efficient execution occurs at a power constraint of 60W using a OpenMP configuration that leads to a greenup (i.e., greenup = Energyold [10]) of 3.89×, Energynew but a speedup of 0.95× (i.e., a slowdown) over the typical OpenMP configuration at TDP (85W). This contradicts the commonly held belief of race-to-halt [11] (i.e., the idea that the lower energy consumption occurs at the highest speedup), and shows that optimizing for time and optimizing for energy may not yield the same OpenMP configuration. In addition, for applications where a slowdown is unacceptable, we can simultaneously optimize for time and energy by targeting the energy-delay product (EDP) metric [12]. Through an exhaustive search through the OpenMP configurations space, we observe that minimizing EDP yields a speedup of 1.64× and a greenup of 2.7×, at a yet another OpenMP configuration and power constraint. In summary, optimizing for performance, power, and energy consumption all require different strategies for identifying the optimal OpenMP configuration, and optimizing for one metric (e.g., performance) does not necessarily optimize for another (e.g., energy). To this end, we propose a graph neural network (GNN)-based technique that can be used to (i) identify OpenMP configurations at prescribed power constraints that maximizes performance and (ii) optimize for the energy-delay product to identify configurations for both energy-efficient and performant execution. In this study, OpenMP code regions are first transformed to a flow-aware graphical representation. These code graphs are then modeled by a GNN, and used for predicting the best configurations for the appropriate target. In contrast to prior studies, we use only these code graphs (i.e., static features) as inputs to our model, which does not require expensive code execution. The benefit of using a deep learning (DL)-based approach is that it automatically helps reduce the search space exploration by aggressively pruning non-beneficial points in the search space. The works in [7], [8] studied the impacts of power con- straints and OpenMP configurations on time and energy and are, to the best of our knowledge, most similar to the problem considered in this paper. To demonstrate the effectiveness of our static approach, we compare our results against a Bayesian Optimization based tuner BLISS [6], and a search-based tuner OpenTuner [4]. Through this study, we propose two separate approaches for tuning performance and energy/power. The first approach aims to identify the tuning configuration that can produce the fastest execution at a predefined power constraint. The second approach looks at both time and energy as target metrics and aims to optimize for both at the same time by identifying configurations that lead to the lowest energy-delay product. The key contributions of our work are as follows: • We build an RGCN network to model flow-aware OpenMP code region graphs that captures both semantic and struc- tural features of code regions, and is portable across different architectures. • We build an auto-tuning framework that identifies OpenMP configurations yielding near optimal execution times at different power constraints. We achieve a geometric mean speedup of 1.33× and 1.15× over default OpenMP config- urations at four power constraints across 30 applications on Skylake and Haswell systems. • Our DL-based framework also optimizes for both time and energy simultaneously by minimizing the EDP. We achieve geometric mean speedup of 1.27× and 1.12×, and greenup of 1.40× and 1.22× respectively on Skylake and Haswell, over default OpenMP configurations running at TDP (i.e., no power constraint). • We compare our framework against the state-of-the-art BLISS [6] tuner and OpenTuner [4] and demonstrate better performance without the need for executing code. II. BACKGROUND This section outlines concepts relevant to this work. A. Static Code Representations for DL DL is being increasingly used for code analysis and opti- mization tasks [13]. However, the use of DL necessitates the use of a strong code representation capable of capturing the inherent features in source code. A lot of prior studies have represented programs as a sequence of lexical tokens [14]. But, these fail to capture the structured nature of programs. To overcome this, representations capturing syntactic as well as semantic features have been proposed [13], [15] . These methods often do not take into account control, data, or call flows in the program. PROGRAML [14] is a tool that represents the semantic and structural features of code in a flow-aware multi-graph. These DL-friendly multi-graphs have a vertex for each instruction and control-flow edges between them. Data flow is represented by separate vertices for variables and constants and associated data-flow edges to instructions. Call flow is represented by edges between callee functions and caller instruction vertices. We use this tool to transform code region IRs to their corresponding graphs. B. Power Constraining and Energy Profiling Starting with the SandyBridge μarchitecture, Intel intro- duced the RAPL software tool that enables power/energy monitoring and power capping through a simple interface. The power to several subsytems of the processor, such as memory, DRAM, CPU, etc can be controlled via RAPL. We use the Variorum [16] tool, which in turn uses RAPL and device MSRs, to control the power constraint on the CPU. We also use PAPI (with the RAPL component enabled) [17] to measure performance counters and energy profiling data. C. Graph Neural Networks Recent advances in deep learning have now enabled the application of DL on data generated from non-Euclidean space [18]. The relations and dependencies between objects in such data can more readily be represented as a graph. GNNs were proposed as a means of modeling such data. Graph 2 Convolutional Networks (GCNs) are a form of GNNs aimed at generalizing the common sliding window convolution oper- ation on grid data in regular Convolutional Neural Networks to graphs [18]. A GCN network updates its node represen- tation by aggregating the features from the node's neighbors along with the node. Similar to CNNs, GCNs stack multiple convolutional layers to extract high-level node representation. We use Relational Graph Convolutional Network (RGCN), a variation of GCN, to model our program graphs. RGCNs were proposed to enable networks to better model large-scale relational data [19]. RGCNs differ from GCNs in that they work with relation specific transformations annotated by the type and direction of edges. RGCNs accumulate transformed feature vectors through a normalized sum. III. THE PNP AUTO-TUNER: A GNN BASED POWER AND PERFORMANCE TUNER In this section, we outline our two-pronged approach to tuning performance and power. We consider two scenarios with real-world implications: i) Because of cost and energy considerations, clusters and data-centers must usually work under strict power budgets. However, constraining power di- rectly impacts performance by limiting the power delivered to hardware components. Therefore, assuming no code changes or compiler optimizations, tuning available runtime parameters becomes essential for improving application performance. ii) It is of utmost importance in most HPC systems to reduce energy consumption. This has a direct monetary and environmental impact. However, as shown in Section I, simply optimizing for energy, can potentially lead to slower executions. Therefore, we must optimize for a metric that considers both energy and performance. To this end, we target the multi-obejctive metric energy-delay product (EDP). We use GNNs to build a model that will be used for the aforementioned tasks. The inputs to the GNNs are code flow graphs of OpenMP regions. Using such graphs allows us to model the semantics and structure of source code. These convey relevant information to the model about the code region being tuned. We refer to these input code graphs as static features, as these are obtained statically without any code executions. An overview of this pipeline is shown in Figure 1, and outlined in the following paragraphs. use the llvm-extract tool to extract the outlined parallel region. As shown in Figure 1, to represent the code regions in a form usable by DL models, we use PROGRAML [14] to obtain the corresponding graph embeddings. These code graphs encapsulate the semantic and structural characteristics of code, as well as the data flow, control flow, and call flow in source code, as described in Section II-A. B. Configuring the Search Space One of the primary motivations behind using a DL technique for this work was to develop a method that can work with large search spaces easily. Unlike most existing auto-tuners, which have to extensively execute programs to identify the best configurations, our DL-based framework will not need to execute programs. For the proposed DL approach to scale well to unseen code and inputs, it is necessary to feed the model with code graphs with enough variability. Along with variability in considered parallel code regions, it is essential to model the effect of various tuning parameters on these code regions. Different configurations impact code execution by affecting the load balancing and cache behavior, which in turn impacts performance. As our goal is to target performance optimization and energy efficiency, we must simultaneously consider the impact of power constraints and OpenMP parameters on code execu- tions. To this end, we have defined a search space (shown in Table I) with 504 valid configurations. In addition, the default OpenMP configurations for each of the four power limits have also been considered as valid configurations leading to a total of 508 configurations. The search space used in this study has been selected based on ideas presented by Bari et al. in [8]. TABLE I: Search space for performance and power tuning on Skylake and Haswell nodes. Search Space Power Limits Number of threads Scheduling Policy Chunk Sizes Parameter Values 75W, 100W, 120W, 150W (Skylake) 40W, 60W, 70W, 85W (Haswell) 1, 4, 8, 16, 32, 64 (Skylake) 1, 2, 4, 8, 16, 32 (Haswell) STATIC, DYNAMIC, GUIDED 1, 8, 32, 64, 128, 256, 512 A. Representing the Code C. Power Constraining and Dataset Creation In this study, we aim to optimize OpenMP code regions. These code regions are usually the primary computational bot- tlenecks in such applications. Instead of focusing on individual loops inside these parallel regions, we aim to optimize the par- allel region as a whole for larger performance improvements. Tuning sub-regions within an OpenMP code region adds additional overhead. Switching between configurations can im- prove the performance of each sub-region (loops for example), but can degrade the performance of each OpenMP region and the application as a whole. The benchmark applications are initially compiled to their intermediate representations (IR). Compiling OpenMP code to its corresponding IR automati- cally encloses the parallel region in an outlined function. We In this work, we used the Variorum [16] tool for constrain- ing power levels on each of the experimental systems. We used Variorum APIs to interface with RAPL and device MSRs to constrain power to the values described in Table I. To validate our hypothesis, we chose to work with multiple OpenMP applications with varied complexity. These OpenMP regions consists of parallel regions with simple do-all loops to regions with multiple loops with varying levels of nesting and diverse programmatic constructs. We have worked with 25 applications from the PolyBench suite [20], and mini and proxy applications XSBench [21], RSBench [22], miniFE [23], miniAMR [24], Quicksilver [25], and LULESH [9] with combined total of 68 OpenMP regions. 3 Fig. 1: PnP Tuner Pipeline: An overview of tasks in our GNN based power and performance tuner At each power level, parallel OpenMP regions in all consid- ered applications were executed for each runtime configuration in Table I and default OpenMP configurations (all threads, static scheduling, and compiler defined chunk sizes) on each system. The execution times obtained as such are then ana- lyzed to identify the best configuration for each code region. The best configurations are used as labels during training. D. Performance and Power Modeling This section outlines our GNN-based approach towards performance and power optimizations. We propose two tuning scenarios with different objectives: • In the first scenario, we aim to identify the OpenMP configuration that lead to the fastest executions at a given power constraint. • In the second scenario, we aim to identify both the OpenMP configuration and the power level that mini- mizes the EDP. By minimizing the EDP, we hope to improve the execution time and energy efficiency in comparison to default OpenMP configuration at TDP. 1) Code Graph Modeling using GNNs: For both scenarios, the code modeling technique is similar. Modeling code graphs allows us to model code semantics and structure. Analyzing code structure allows us to better capture the interdependence between code blocks. Simply looking at code as a sequence of text does not afford this information. The code graphs generated in Section III-A are initially passed through a GNN network for modeling the code graphs. Specifically, Relational Graph Convolutional Networks (RGCNs) are used as these allow modeling relation specific features. Each code graph consists of three types of edges denoting the type of flow (Section III-A). The type of edges are used as edge features during modeling. For each node in a graph, the node features are the type of node, and the associated IR code block. Before modeling, the code region IRs are used to generate an embedding. This embedding maps IR text to tensors. These tensors are then passed to the model as node features along with the type of the node. Based on these features, the GNN layers model these by passing "messages" between neighbor- ing nodes, aggregation, and subsequent weight updations [26]. The output tensors from the GNN layers then fed into fully connected neural network layers with the aim of identifying the best configurations. 2) Power Constraint Specific Auto-tuning: As noted in Section I, one way of meeting power consumption goals is to enforce a specific power constraint. Such power con- straints can help limit the power drawn by a node or its subsystems. However, simply using default OpenMP runtime configurations at different power constraints for code execution may lead to performance degradation, as well as increased energy usage from static power. Therefore, we aim to identify those configurations that lead to speedups at predefined power constraints. We propose a DL based technique for power- constrained auto-tuning. As outlined in Section III-D1, we use the flow-aware code graphs obtained from the parallel code region IRs as inputs to the RGCN layers of our network. As shown in Figure 1, the RGCN layers model each such graph and feeds the output into a fully connected (dense) network. The dense layers acts as a classifier and are trained as such with the target of predicting the best configuration for a given OpenMP code region. 3) Optimizing Energy and Time: For nodes and systems without any predefined power constraint, time and energy optimization are still of primary importance. However, simply optimizing for performance or energy neglects the other crite- ria. Thus, in this section, we propose using power constraints as a tuning parameter along with the available OpenMP runtime configurations for joint optimization of performance and power. Simply using execution time or energy savings for identifying such configurations is not enough. Thus, we use the energy-delay product (EDP) metric [12] as a more accurate measure of the impact of different configurations on code performance. In this work, we assign equal importance to time and energy and use the metric E ∗ T , where E represents the energy consumption, and T represents the execution time for a parallel code region. We again use the modeled code graphs from Section III-D1 as the static feature inputs to our model for this experiment and train our model with a target of optimizing the EDP. As in the previous subsection, a fully connected neural network serves as a classifier to identify the best configurations for tuning EDP. Using a DL-based approach for identifying the best one out of 508 possible configurations is especially beneficial, as such models are efficient at automatically pruning the under performing configurations. This is in stark contrast to brute- force approaches, where the tuning cost would explode with increasing search space complexity. IV. EXPERIMENTS To identify near optimum values of tuning parameters for both our experimental scenarios, we first explore every permu- tation of inputs and configurations considered in this study. We use this exhaustive exploration as an oracle to compare the results from our work. We also compare our work against BLISS [6] and OpenTuner [4]. All results presented in the following paragraphs represent speedups/greenups of each 4 Training ProgramsCode Outlining & IR ExtractionOutlined Code 1Outlined Code 2Outlined Code n...IR2IRn...IR1Code RepresentationFlow Graph GeneratorFG1FG2...FGnPnP Tuning ModelDataset Creation and Pre-processing Fig. 2: Power Constrained Tuning (Haswell): Each chart shows results for a specific power constraint. Each bar-group shows geometric mean speedup for all OpenMP regions in an application over default OpenMP settings wrt the corresponding tuning approach. Speedups are normalized by oracle(brute-force) speedups. Normalized oracle speedups are always 1.0×. The PnP tuner outperforms BLISS in 82.5% and OpenTuner in 78% cases across all power constraints(see Section IV-B for details). code region. For applications with multiple OpenMP regions, the geometric mean of speedups/greenups of all regions in an application are reported. We have also verified that there are sequences of serial code in between successive OpenMP regions. This allows us to look at each region as a self- contained unit, and makes them good candidates for tuning. We assume that the performance of these intervening serial sequences will not change and improving the performance of each OpenMP region would translate to improvement in application performance. A. Experimental Setup For our experiments, we use two systems; one with Intel(R) Xeon(R) Gold 6142 CPU with 32 cores, two hyper-threads per core, and two sockets (Skylake) with a minimum and TDP package power of 75W and 150W , and an Intel(R) Xeon(R) E5-2630 v3 CPU (Haswell), with 16 cores, two hyper-threads per core, and two sockets, and minimum and TDP package power of 40W and 85W . We use Clang tools for code compilation and transformation to IR, and PyTorch DL libraries for building our GNN models. B. Power Constrained Auto-tuning In this section, we evaluate the performance of our tuner in determining the optimal configuration for minimizing ex- ecution time given a specific power constraint (described in Section III-D2). To validate the effectiveness of our approach, we use leave-one-out cross-validation (LOOCV). For each fold, code regions from one benchmark application is selected and assigned to the validation set and the code regions from all other applications are assigned to the training set. We repeat this process for all applications in our approach. Such a process is essential to evaluate the performance of our model on previously unobserved code regions. The results for the Haswell system are shown in Figure 2. For each application, we calculate the geometric mean speedups for all OpenMP regions in each application achieved by each tuner across four power constraints (i.e., 40W, 60W, 70W, 85W). While training the model on the data from the Skylake system, we borrow ideas from transfer/inductive learning and perform an optimization step to speed up the training process. Because the code graphs are statically generated, the code 5 00.20.40.60.81RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmNorm. Speedups(40W)DefaultPnP Tuner (Static)PnP Tuner (Dynamic)BLISSOpenTuner00.20.40.60.81RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmNorm. Speedups(60W)00.20.40.60.81RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmNorm. Speedups(70W)00.20.40.60.81RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmNorm. Speedups(85W)Applications Fig. 3: Power Constrained Tuning (Skylake): Each chart shows results for a specific power constraint. Each bar-group shows geometric mean speedup for all OpenMP regions in an application over default OpenMP settings wrt the corresponding tuning approach. Speedups are normalized by oracle speedups. Normalized oracle speedups are always 1.0×. The PnP tuner outperforms BLISS in 85% and OpenTuner in 83% cases across all power constraints(see Section IV-B for more details). graphs obtained on different systems using the same compiler are identical. For this reason, we save the weights and model states of the GNN model obtained while training our model on the Haswell system. While training the model on the Skylake data, we load the saved weights and model and only re-train the dense layers. This leads to 4.18× faster training (or reduces training time by 76%). Results for each power constraint (75W, 100W, 120W, 150W) is shown in Figure 3 for the Skylake system. Each speedup is normalized by the speedup achieved by the ora- cle (i.e., exhaustive exploration). In 74% cases (across both systems and power constraints), our PnP tuner identifies con- figurations that lead to >= 0.95× of the oracle speedups (assuming oracle as 1.0×). These results are obtained without executing the code. In contrast, BLISS and OpenTuner needs to execute code multiple times and achieves >= 0.95× of the oracle speedups in 51% and 34% cases for BLISS and OpenTuner respectively. The PnP tuner produces better results than BLISS and OpenTuner in 83% and 78% cases. Overall, the configurations predicted by our model lead to geometric mean speedups of 1.19×, 1.12×, 1.13×, and 1.14× for power limits 40W , 60W , 70W , and 85W on the Haswell system. In contrast, BLISS leads to speedups of 1.11×, 1.09×, 1.09×, and 1.11× across these power constraints respectively. OpenTuner produces corresponding speedups of 1.06×, 1.0×, 1.04×, and 1.02×. On Skylake, our approach achieves geometric mean speedups of 1.5×, 1.25×, 1.26×, and 1.34× across power constraints 75W , 100W , 120W , and 150W respectively, compared to speedups of 1.29×, 1.2×, 1.18×, and 1.17× produced by BLISS, and speedups of 1.27×, 1.13×, 1.07×, and 1.1× produced by OpenTuner. Can performance counters further improve results? Although our approach leads to >= 0.95× of the oracle speedups in most cases, in approximately 8% of cases, our approach produces results which are < 0.8× of the oracle speedups. Previous works such as [27], [28] have used performance counters for tuning tasks. We borrow from these ideas to see if the results from our approach can be improved by using these as features (dynamic features). For this experiment, we update our model definition. We make no changes to the GNN layers. We repurpose the fully connected layers to accept as inputs five performance counters along with the ouputs from the GNN layers. We use PAPI [17] to collect counters related to L1, L2, L3 cache misses, number of instructions, and the number of 6 00.20.40.60.81RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmNorm. Speedups(75W)DefaultPnP Tuner (Static)PnP Tuner (Dynamic)BLISSOpenTuner00.20.40.60.81RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmNorm. Speedups (100W)00.20.40.60.81RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmNorm. Speedups(120W)00.20.40.60.81RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmNorm. Speedups(150W)Applications mispredicted branches for each OpenMP region. These were selected as these have direct impact on code execution and performance. We perform the same experiments as outlined in the pre- vious paragraphs. However, we only validate on those appli- cations whose speedups are < 0.95× on the oracle speedups. We see that by including performance counters, this approach identifies configurations that lead to >= 0.95× in 87.5% cases (up from 74%). We show these results and comparisons in Figures 2 and 3. Therefore, a case can definitely be made for including performance counters for DL-based performance tuning. However, this comes at the additional cost of profiling. Profiling is necessary for generating the dataset to train the model. However, during inference, this approach (using both static and dynamic features) only needs to execute applications twice (to collect counters which serve as inputs to the model), which is less than other execution based tuners. To conclude, although this produces better results, it adds a profiling over- head. But during inference, in spite of this overhead it only needs two executions. Can we extend this approach to unknown power constraints? There might be scenarios where adding/removing new nodes to/from clusters, or other factors, might necessitate changing power constraints on nodes. Thus, our approach should also be generalizable to power constraints that our model has not been trained on, since data center policy changes may result in different power constraints being applied. To evaluate this scenario, we conduct four tests - two tests for each system - one test each for the lowest and highest power constraints considered in this paper. For each test, we first exclude all mea- surements for the target power constraint (e.g., for the 150W test on Skylake, for training, we use measurements from 75W, 100W, and 120W only). We then train and validate our model using leave-one-out cross-validation as before. This allows us to generalize for both unseen applications and unseen power constraints. However, unlike the initial experiments which uses a static-only approach, we use performance counters as part of the feature set in this experiment. This is to account for the variation in runtime behavior of parallel regions under varying power constraints. Static features cannot encapsulate such divergence in behavior. The input features and model is similar to the one described in Section IV-B. In addition to these features, we also input as feature the normalized power constraints for each feature set. This helps to associate runtime behavior (performance counters) with power limits. Figures 4 and 5 shows that our model performs well in such scenarios for both the Skylake and Haswell systems, predicting configurations that are within 5% (i.e., ≥ 0.95 normalized speedup) of the best possible speedup in 64% cases and within 20% of the best possible speedups in 85% cases across both systems and four power constraints. On the Skylake systems, these tuning efforts lead to geometric mean speedups of 1.29× and 1.36× versus oracle speedups of 1.44× and 1.59× for power constraints of 150W and 75W respectively. On the Haswell system, these experiments produce speedups of 1.13× and 1.17× compared to oracle speedups of 1.16× and 1.27× Fig. 4: Power Constrained Tuning on unseen power constraints (Skylake): Geometric mean speedup over default OpenMP settings. Results normalized by the oracle speedup. Fig. 5: Power Constrained Tuning on unseen power constraints (Haswell): Geometric mean speedup over default OpenMP settings. Results normalized by the oracle speedup. for power constraints of 85W and 40W respectively. TABLE II: Deep Learning Model Hyperparameters. Hyperparameter Layers Activ. func. Optimizer Learning Rate Batch Size Loss function Hyperparameter Values RGCN (4), FCNN (3) Leaky ReLU, ReLU AdamW (amsgrad) (Sec IV-B), Adam (Sec IV-C) 0.001 16 Cross Entropy Loss The hyperparameters of the models used in these exper- iments are shown in Table II. Other parameter values may have minor differences between experiments. C. Power and Performance Tuning With increasing financial and environmental impacts of high energy usage, energy efficiency is now as important as performance in the current HPC landscape. However, simply optimizing for energy consumption, as shown in Section I, may lead to lower performance. Thus, in this section, we outline the second scenario men- tioned at the beginning of this section. To this end, we build a GNN-based tuner that uses only static features, with the aim of identifying a combination of power constraints and OpenMP runtime configurations that can lead to performance improvement while reducing energy consumption. As in the previous experiments, we model our flow-aware code graphs using an RGCN network. The outputs from the GNN layers are fed into the dense layers. These layers are trained with 7 00.10.20.30.40.50.60.70.80.91RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmNormalized SpeedupsApplicationsDefault (150W)PnP Tuner (150W)Default (75W)PnP Tuner (75W)00.10.20.30.40.50.60.70.80.91RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmNormalized SpeedupsApplicationsDefault (85W)PnP Tuner (85W)Default (40W)PnP Tuner (40W) (a) Skylake (b) Haswell Fig. 6: Improvement improvements normalized in terms of best achievable EDP improvement. in EDP over default OpenMP configurations for each application for the Haswell system. EDP the target of finding configurations that produce the best energy-delay product (EDP). Again, we use leave-one-out cross validation to validate our model, and the process of assigning benchmark applications to the training and validation set is similar to that described in Section IV-B. The configurations predicted in these experiments lead to within 5% of the oracle EDP improvements in 45% cases, and within 20% of the oracle improvements in 69% cases across the two systems. In comparison, BLISS reaches these numbers in 35% and 45% cases (Figure 6). OpenTuner reaches these numbers in 22% and 40% cases. Overall, the configurations predicted by our static-only approach leads to geometric mean improvements of 1.37× and 1.85× on the Haswell and Skylake systems compared to 1.31× and 1.69× respectively achieved by BLISS and 1.21× and 1.49× achieved by OpenTuner. We have also analyzed the impact on execution time perfor- mance and energy consumption individually. Figure 7 shows the impact of tuning for EDP on execution time for both the Skylake and Haswell systems. Tuning for EDP leads to performance (time) improvement in 84% cases, and leads to slower execution than default settings in around 16% cases across both systems. On Skylake, all slowdowns are within 20% of the corresponding execution with all threads, while the geometric mean of all slowdows are within 14% of the default executions. On the Haswell system, there are fewer slow- downs, but the slowdowns are more significant with the largest slowdown within 30% of the default all-threaded execution, with the geometric mean within 23% of the default settings. Overall, excluding the cases that lead to slowdowns, tuning for EDP leads to 1.16× and 1.3× speedups on the Haswell and Skylake. In comparison, BLISS and OpenTuner leads to slowdowns in 28% and 46% cases respectively, with the largest slowdowns within 17% and 15% for BLISS and within 30% and 22% for OpenTuner on Haswell and Skylake. We also show in Figure 7 the impact of tuning for EDP on energy. Across both systems, our approach predicts configu- rations that lead to reduction in energy consumption in 94% cases. In the remaining 6% cases, it predicts configurations that consume more energy than the default setting. However, the increase is minimal. On the Haswell, there is a 3% geometric mean increase in energy usage for those predictions. On the Skylake, the corresponding number is 1%. For the predictions that do lead to reduction in energy usage, there is a geometric mean greenup of 1.25× and 1.42× on the Haswell and Skylake respectively. In comparison, 2% of the predictions made by BLISS lead to increase in energy consumption. But, the overall greenups are slightly worse than the PnP Tuner (1.24× on the Haswell and 1.39× on the Skylake). The predictions made by OpenTuner lead to increase in energy consumption in 20% cases with overall greenups at 1.25× and 1.29× on the Haswell and Skylake respectively. Similar to the experiment in Section IV-B, we also evaluate the effect of performance counters on EDP. As shown in Figure 6, adding performance counters to the feature set leads to improved results (predictions where the EDP is within 5% of the oracle moves up to 57% from 45% across both systems). Using performance counters leads to 77% cases where there is improvement in execution speed (down from 84%). This dichotomous behavior is the result of using a fused metric; because it is a product of both time and energy, the PnP tuner aims to tune for the best EDP. It might lead to scenarios where the reduction in energy might compensate for the increase in time. In this experiment, using performance counters leads to 95% cases where there are improvements in energy consumption. Overall, by using performance counters, the EDP predictions improve from 1.37× to 1.52× on the Haswell system, and from 1.85× to 2.31× on the Skylake. This lead to overall speedups of 1.13× and 1.39× on the Haswell and Skylake and greenups of 1.35× and 1.60× on the Haswell and Skylake systems. V. RELATED WORK This paper proposes a GNN based technique towards perfor- mance, power, and energy optimizations. Modifying runtime and environmental parameters has a large impact on parallel code execution. Several search-based tuners such as [3], [4] have been proposed for these tasks. These tuners have pro- posed and used several search techniques such Nelder-Mead, Torczon hillclimbers, AUC Bandit for pruning and optimizing the search space. An alternative to search-based auto-tuning is to use machine learning (ML) based approaches. Several works such as [5], [27]–[33] have proposed machine/deep learning based auto-tuners or tuning approaches for various parameter 8 00.10.20.30.40.50.60.70.80.91RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmNormalized EDP ImprovementsApplicationsDefaultPnP Tuner(Static)PnP Tuner (Dynamic)BLISSOpenTuner00.10.20.30.40.50.60.70.80.91RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmNormalized EDP ImprovementApplicationsDefaultPnP Tuner (Static)PnP Tuner (Dynamic)BLISSOpenTuner Fig. 7: Speedups/Greenups over default OpenMP configurations at TDP. Configurations are predicted to optimize for EDP. tuning tasks. Recently, Bayesian optimization (BO) has been used in several works (such as [6], [29]) for faster sampling of search spaces. BO has gained popularity as it can be used as a black-box optimizer for an unknwown objective function. A drawback of most of these aforementioned techniques is their need for multiple sampling executions. Although faster than brute-force tuning, it is still a big overhead. Our proposed static approach aims to overcome this overhead by using a static-only approach, that does not need to execute code for tuning a fixed set of parameters. Most of the works mentioned above do not consider power constraints in their work. A number of papers have focused on dynamic voltage frequency scaling (DVFS) and dynamic concurrency throttling (DCT) techniques for improving energy efficiency [34]–[36]. Wang et al. in [37] proposed using CPU clock modulation and concurrency throttling for improving the energy efficiency of OpenMP loops. In [38], Nandamuri et al. analyzed the performance and energy conumption of OpenMP programs under various conditions using OpenMP Runtime API. The work in [39] presented the performance and energy impact of CPU parameters on runtime systems on dense linear algebra OpenMP kernels. In contrast to these works, our approach focuses on reducing energy consumption and performance improvement through power constraints. Rountree et al. in [40] provided a first insight into the impacts of power capping or constraints on power and per- formance. Patki et al. in [41] outlined how overprovision- ing hardware and hardware enforced power bounds leads to improved performance. To the best of our knowledge, the works in [7], [8] are the closest to this work. Bari et al. in [7] propose ARCS with the goal of automatically selecting best runtime configurations for OpenMP parallel regions at specified power constraints and in [8] analyzed the impact of power constraints on performance and energy consumption on five NAS benchmarks. In contrast to [7], [8], our approach uses an AI-assisted technique based on GNNs to identify OpenMP runtime configurations and power constraints. VI. DISCUSSION Through this study, we have outlined a unique approach to two important problems in the HPC community. We have proposed a mechanism of tuning OpenMP configurations on power constrained systems. This is beneficial to data centers and systems working under strict power budgets. As shown in previous sections, it is possible to considerably improve perfor- mance in such scenarios using our approach. Additionally, we also describe a method of identifying OpenMP configurations and power constraints that can lead to reduction in energy consumption with limited to no impact on execution time . To the best of our knowledge, this is the first work that aims to use GNN based techniques for these purposes. As with all DL techniques, training is an overhead. Re- training a model for several target systems might be burden- some. However, by using transfer learning techniques, we have reduced the training time on other systems by around 76% on a dataset of similar size (explained in Section IV-B. These optimizations can enable faster and easier deployment of such approaches on multiple systems. Additionally, being a static approach, our tuner requires no sampling executions. This is in contrast to other tuners that need several sampling runs. Limiting the number of sampling runs, or setting a time-bound on the sampling phase to a small value leads to less than optimal results. Moreover, our approach was able to successfully identify most edge cases. 9 00.511.522.53RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmSpeedupsPnP Tuner (Static): HaswellPnP Tuner (Dynamic): HaswellBLISS: HaswellOpenTuner (Haswell)PnP Tuner (Static): SkylakePnP Tuner (Dynamic): SkylakeBLISS: SkylakeOpenTuner (Skylake)0123456RSBenchXSBenchminiFEQuicksilverminiAMRLULESHseidel-2dadijacobi-2dbicgataxgramschmidtcorrelationdoitgencovariancegemmsyrkcholeskygemvermvtdurbintrisolvsyr2klusymmfdtd-2dfdtd-apml2mmgesummvtrmmGreenupsApplications For example, the OpenMP region in trisolv has the fastest execution with 1 thread in all cases. This is an outlier. Our approach could identify near optimal configurations in these cases as well with no executions. Due to installation issues, we were not able to directly use the APEX framework described in [7]. To overcome this, we used OpenTuner, another search-based tuner as a replacement. To contrast our work with other tuners, we present the following example. To tune an OpenMP region, BLISS needs 20 sampling runs for each code region. In case of OpenTuner, the "stop-after" flag must be manipulated to allow the tuner to sample code executions. The time bound must be increased for more complex applications, and in most cases in this paper was set to 180 seconds and above. A trained PnP tuner, on the other hand, needs no code executions. VII. CONCLUSION In this work, we have outlined a twofold approach towards tuning OpenMP configurations in power constrained systems, as well tuning both OpenMP configurations and power con- straints for execution time and energy consumption gains. We have used GNNs to model flow-aware code graphs to model the semantic and structural features of code regions. Our experiments show that the PnP Tuner can identify configura- tions that lead to improvements in execution time and energy consumption. In future, we aim to analyze the scalability of our approach to heterogeneous platforms and handheld devices. VIII. ACKNOWLEDGEMENTS This research was supported by the National Science Foun- dation under Grant number 2211982. We would also like to thank the ResearchIT team (https://researchit.las.iastate.edu) at Iowa State University for their constant support. REFERENCES [1] H. David, E. Gorbatov, U. R. Hanebutte, R. Khanna, and C. Le, "Rapl: Memory power estimation and capping," in 2010 ACM/IEEE Interna- tional Symposium on Low-Power Electronics and Design (ISLPED). IEEE, 2010, pp. 189–194. "Exploring [2] T. Patki, D. K. Lowenthal, B. Rountree, M. Schulz, and B. R. power- de Supinski, hardware constrained, high performance computing," in Proceedings of the 27th International ACM Conference on International Conference on Supercomputing, ser. ICS '13. New York, NY, USA: Association for Computing Machinery, 2013, p. 173–182. [Online]. Available: https://doi.org/10.1145/2464996.2465009 overprovisioning in [3] C. Tapus, I.-H. Chung, and J. K. Hollingsworth, "Active harmony: Towards automated performance tuning," in Proceedings of the 2002 ACM/IEEE Conference on Supercomputing. IEEE, 2002, pp. 44–44. [4] J. Ansel, S. Kamil, K. Veeramachaneni, J. Ragan-Kelley, J. Bosboom, U.-M. O'Reilly, and S. Amarasinghe, "Opentuner: An extensible frame- work for program autotuning," in Proceedings of the 23rd international conference on Parallel architectures and compilation, 2014, pp. 303– 316. [5] J. J. Thiagarajan, N. Jain, R. Anirudh, A. Gimenez, R. Sridhar, A. Marathe, T. Wang, M. Emani, A. Bhatele, and T. Gamblin, "Boot- strapping parameter space exploration for fast tuning," in Proceedings of the 2018 international conference on supercomputing, 2018, pp. 385– 395. [6] R. B. Roy, T. Patel, V. Gadepally, and D. Tiwari, "Bliss: auto-tuning learning complex applications using a pool of diverse lightweight models," in Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation, 2021, pp. 1280–1295. 10 [7] M. A. S. Bari, N. Chaimov, A. M. Malik, K. A. Huck, B. Chapman, A. D. Malony, and O. Sarood, "Arcs: Adaptive runtime configuration selection for power-constrained openmp applications," in 2016 IEEE international conference on cluster computing (CLUSTER). IEEE, 2016. [8] M. A. S. Bari, A. M. Malik, A. Qawasmeh, and B. Chapman, "Perfor- mance and energy impact of openmp runtime configurations on power constrained systems," Sustainable Computing: Informatics and Systems, vol. 23, pp. 1–12, 2019. [9] I. Karlin, J. Keasler, and J. R. Neely, "Lulesh 2.0 updates and changes," Lawrence Livermore National Lab.(LLNL), Livermore, CA (United States), Tech. Rep., 2013. [10] J. W. Choi, D. Bedard, R. Fowler, and R. Vuduc, "A roofline model of energy," in 2013 IEEE 27th International Symposium on Parallel and Distributed Processing. IEEE, 2013, pp. 661–672. [11] M. A. Awan and S. M. Petters, "Race-to-halt energy saving strategies," Journal of Systems Architecture, vol. 60, no. 10, pp. 796–815, 2014. [Online]. Available: https://www.sciencedirect.com/science/article/pii/ S1383762114001295 [12] J. H. Laros III, K. Pedretti, S. M. Kelly, W. Shu, K. Ferreira, J. Vandyke, and C. Vaughan, "Energy delay product," in Energy-Efficient High Performance Computing. Springer, 2013, pp. 51–55. [13] M. Allamanis, E. T. Barr, P. Devanbu, and C. Sutton, "A survey of machine learning for big code and naturalness," ACM Computing Surveys (CSUR), vol. 51, no. 4, pp. 1–37, 2018. [14] C. Cummins, Z. V. Fisches, T. Ben-Nun, T. Hoefler, M. F. O'Boyle, and H. Leather, "Programl: A graph-based program representation for data flow analysis and compiler optimizations," in International Conference on Machine Learning. PMLR, 2021, pp. 2244–2253. [15] A. Brauckmann, A. Goens, S. Ertel, and J. Castrillon, "Compiler-based graph representations for deep learning models of code," in Proceedings of the 29th International Conference on Compiler Construction, 2020. [16] S. Brink, A. Marathe, T. Patki, and B. Rountree, "variorum," https:// github.com/LLNL/variorum, 2022. [17] P. J. Mucci, S. Browne, C. Deane, and G. Ho, "Papi: A portable interface to hardware performance counters," in Proceedings of the department of defense HPCMP users group conference, vol. 710. Citeseer, 1999. [18] Z. Wu, S. Pan, F. Chen, G. Long, C. Zhang, and S. Y. Philip, "A comprehensive survey on graph neural networks," IEEE transactions on neural networks and learning systems, vol. 32, no. 1, pp. 4–24, 2020. [19] M. Schlichtkrull, T. N. Kipf, P. Bloem, R. Van Den Berg, I. Titov, and M. Welling, "Modeling relational data with graph convolutional networks," in European semantic web conference. Springer, 2018, pp. 593–607. [20] L.-N. Pouchet et al., "Polybench: The polyhedral benchmark suite," URL: http://www. cs. ucla. edu/pouchet/software/polybench, vol. 437, pp. 1–1, 2012. [21] J. R. Tramm, A. R. Siegel, T. Islam, and M. Schulz, "Xsbench-the de- velopment and verification of a performance abstraction for monte carlo reactor analysis," The Role of Reactor Physics toward a Sustainable Future (PHYSOR), 2014. [22] J. R. Tramm, A. R. Siegel, B. Forget, and C. Josey, "Performance analysis of a reduced data movement algorithm for neutron cross section data in monte carlo simulations," in International Conference on Exascale Applications and Software. Springer, 2014, pp. 39–56. [23] S. Hammond, C. Trott, and N. Evans, "minife," GitHub repository, 2022. [24] A. Sasidharan and M. Snir, "Miniamr-a miniapp for adaptive mesh refinement," 2016. [25] L. L. N. Lab, "Quicksilver," https://github.com/LLNL/Quicksilver, 2022. [26] J. Zhou, G. Cui, S. Hu, Z. Zhang, C. Yang, Z. Liu, L. Wang, C. Li, and M. Sun, "Graph neural networks: A review of methods and applications," AI Open, vol. 1, pp. 57–81, 2020. [27] J. Alcaraz, A. TehraniJamsaz, A. Dutta, A. Sikora, A. Jannesari, J. Sorribes, and E. Cesar, "Predicting number of threads using balanced datasets for openmp regions," Computing, pp. 1–19, 2022. [28] I. S ́anchez Barrera, D. Black-Schaffer, M. Casas, M. Moret ́o, A. Stup- nikova, and M. Popov, "Modeling and optimizing numa effects and prefetching with machine learning," in Proceedings of the 34th ACM International Conference on Supercomputing, 2020, pp. 1–13. [29] V. Sreenivasan, R. Javali, M. Hall, P. Balaprakash, T. R. Scogland, and B. R. de Supinski, "A framework for enabling openmp autotuning," in International Workshop on OpenMP. Springer, 2019, pp. 50–60. [30] C. Wood, G. Georgakoudis, D. Beckingsale, D. Poliakoff, A. Gimenez, K. Huck, A. Malony, and T. Gamblin, "Artemis: Automatic runtime tuning of parallel execution parameters using machine learning," in International Conference on High Performance Computing. Springer, 2021, pp. 453–472. [31] A. Tehranijamsaz, M. Popov, A. Dutta, E. Saillard, and A. Jannesari, "Learning intermediate representations using graph neural networks for numa and prefetchers optimization," in IPDPS 2022-36th IEEE International Parallel & Distributed Processing Symposium, 2022. [32] A. Dutta, J. Alcaraz, A. TehraniJamsaz, A. Sikora, E. Cesar, and A. Jan- nesari, "Pattern-based autotuning of openmp loops using graph neural networks," in 2022 IEEE/ACM International Workshop on Artificial Intelligence and Machine Learning for Scientific Applications (AI4S). IEEE, 2022, pp. 26–31. [33] R. Mammadli, A. Jannesari, and F. Wolf, "Static neural compiler optimization via deep reinforcement learning," in 2020 IEEE/ACM 6th Workshop on the LLVM Compiler Infrastructure in HPC (LLVM-HPC) and Workshop on Hierarchical Parallelism for Exascale Computing (HiPar). IEEE, 2020, pp. 1–11. [34] M. Curtis-Maury, A. Shah, F. Blagojevic, D. S. Nikolopoulos, B. R. De Supinski, and M. Schulz, "Prediction models for multi-dimensional power-performance optimization on many cores," in Proceedings of the 17th international conference on Parallel architectures and compilation techniques, 2008, pp. 250–259. [35] D. Li, B. R. de Supinski, M. Schulz, K. Cameron, and D. S. Nikolopou- los, "Hybrid mpi/openmp power-aware computing," in 2010 IEEE International Symposium on Parallel & Distributed Processing (IPDPS). IEEE, 2010, pp. 1–12. [36] C. C. De Oliveira, A. F. Lorenzon, and A. C. S. Beck, "Automatic tuning tlp and dvfs for edp with a non-intrusive genetic algorithm framework," in 2018 VIII Brazilian Symposium on Computing Systems Engineering (SBESC). IEEE, 2018, pp. 146–153. [37] W. Wang, A. Porterfield, J. Cavazos, and S. Bhalachandra, "Using per- loop cpu clock modulation for energy efficiency in openmp applica- tions," in 2015 44th International Conference on Parallel Processing. IEEE, 2015, pp. 629–638. [38] A. Nandamuri, A. M. Malik, A. Qawasmeh, and B. M. Chapman, "Power and energy footprint of openmp programs using openmp runtime api," in Energy Efficient Supercomputing Workshop. IEEE, 2014, pp. 79–88. [39] J. V. Ferreira Lima, I. Ra ̈ıs, L. Lefevre, and T. Gautier, "Performance and energy analysis of openmp runtime systems with dense linear algebra algorithms," The International Journal of High Performance Computing Applications, vol. 33, no. 3, pp. 431–443, 2019. [40] B. Rountree, D. H. Ahn, B. R. De Supinski, D. K. Lowenthal, and M. Schulz, "Beyond dvfs: A first look at performance under a hardware- enforced power bound," in 2012 IEEE 26th International Parallel and Distributed Processing Symposium Workshops & PhD Forum. IEEE, 2012, pp. 947–953. [41] T. Patki, D. K. Lowenthal, B. Rountree, M. Schulz, and B. R. De Supin- ski, "Exploring hardware overprovisioning in power-constrained, high performance computing," in Proceedings of the 27th international ACM conference on International conference on supercomputing, 2013. 11
http://arxiv.org/abs/2302.11446v1
2023-02-22T15:30:08
2023-02-22T15:30:08
Singular value decomposition based matrix surgery
This paper aims to develop a simple procedure to reduce and control the condition number of random matrices, and investigate the effect on the persistent homology (PH) of point clouds of well- and ill-conditioned matrices. For a square matrix generated randomly using Gaussian/Uniform distribution, the SVD-Surgery procedure works by: (1) computing its singular value decomposition (SVD), (2) replacing the diagonal factor by changing a list of the smaller singular values by a convex linear combination of the entries in the list, and (3) compute the new matrix by reversing the SVD. Applying SVD-Surgery on a matrix often results in having different diagonal factor to those of the input matrix. The spatial distribution of random square matrices are known to be correlated to the distribution of their condition numbers. The persistent homology (PH) investigations, therefore, are focused on comparing the effect of SVD-Surgery on point clouds of large datasets of randomly generated well-conditioned and ill-conditioned matrices, as well as that of the point clouds formed by their inverses. This work is motivated by the desire to stabilise the impact of Deep Learning (DL) training on medical images in terms of the condition numbers of their sets of convolution filters as a mean of reducing overfitting and improving robustness against tolerable amounts of image noise. When applied to convolution filters during training, the SVD-Surgery acts as a spectral regularisation of the DL model without the need for learning extra parameters. We shall demonstrate that for several point clouds of sufficiently large convolution filters our simple strategy preserve filters norm and reduces the norm of its inverse depending on the chosen linear combination parameters. Moreover, our approach showed significant improvements towards the well-conditioning of matrices and stable topological behaviour.
[ "Jehan Ghafuri", "Sabah Jassim" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11446v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11446v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "math.AT", "@scheme": "http://arxiv.org/schemas/atom" }
[ "math.AT", "cs.CV", "cs.LG" ]
3 2 0 2 b e F 2 2 ] T A . h t a m [ 1 v 6 4 4 1 1 . 2 0 3 2 : v i X r a SINGULAR VALUE DECOMPOSITION BASED MATRIX SURGERY Jehan Ghafuri and Sabah Jassim School of Computing The University of Buckingham Buckingham, UK, MK18 1EG {1901699, sabah.jassim}@buckingham.ac.uk ABSTRACT This paper aims to develop a simple procedure to reduce and control the condition number of random matrices, and investigate the effect on the persistent homology (PH) of point clouds of well- and ill-conditioned matrices. For a square matrix generated randomly using Gaussian/Uniform distribution, the SVD-Surgery procedure works by: (1) computing its singular value decomposition (SVD), (2) replacing the diagonal factor by changing a list of the smaller singular values by a convex linear combination of the entries in the list, and (3) compute the new matrix by reversing the SVD. Applying SVD-Surgery on a matrix often results in having different diagonal factor to those of the input matrix. The spatial distribution of random square matrices are known to be correlated to the distribution of their condition numbers. The persistent homology (PH) investigations, therefore, are focused on comparing the effect of SVD-Surgery on point clouds of large datasets of randomly generated well-conditioned and ill-conditioned matrices, as well as that of the point clouds formed by their inverses. This work is motivated by the desire to stabilise the impact of Deep Learning (DL) training on medical images in terms of the condition numbers of their sets of convolution filters as a mean of reducing overfitting and improving robustness against tolerable amounts of image noise. When applied to convolution filters during training, the SVD-Surgery acts as a spectral regularisation of the DL model without the need for learning extra parameters. We shall demonstrate that for several point clouds of sufficiently large convolution filters our simple strategy preserve filters norm and reduces the norm of its inverse depending on the chosen linear combination parameters. Moreover, our approach showed significant improvements towards the well-conditioning of matrices and stable topological behaviour. Keywords Ill-conditioning * Regularisation * Condition Number * Singular Value Decomposition * Topological Data Analysis * Algebraic Topology * Persistent Homology * Random Gaussian Distribution 1 Introduction Despite the remarkable success and advancements of deep learning (DL) models in computer vision tasks, serious obstacles to deployment of AI in different domains relates to the challenge of developing deep neural networks that are both robust and generalise well beyond the training data [1]. Accurate and stable numerical algorithms play a significant role to computing a robust and reliable computational models [2]. The source of numerical instability in DL models are partially due to the use of a large number of parameters/hyperparameters, and data that suffer from floating-point errors and inaccurate results. In the case of convolutional neural networks (CNN), an obvious contributor to the instability of their large volume of weights is the repeated action of backpropagation algorithm in controlling the growth of gradient descent to fit the model's performance to the different patches of training samples. This paper is concerned with empirical estimation of CNN training-caused fluctuation in condition numbers of various weight matrices as a potential source of instability at convolutional layers and the overall model performance. We shall propose a spectral based approach to reduce and control the undesirable fluctuation. The condition number κ(A) of a square n × n matrix A, considered as a linear transformation Rn×n −→ R, measures the sensitivity of computing its action to perturbations to input data and round-off errors, defined as sup(cid:107)Ax(cid:107)/(cid:107)x(cid:107) over the set of nonzero x. It depends on how much the calculation of its inverse suffer from underflow (i.e. how much det(A) is significantly different from 0). Stable action of A means that small changes in the input data are expected to lead to small changes in the output data and these changes are bound by reciprocal of condition number. Hence, the higher the condition number of A is the more unstable its action is to small data perturbation and such matrices are said to be ill-conditioned. Indeed, the distribution of condition numbers of a random matrix simply describes the loss in precision, in terms of the number of digits, as well as the speed of convergence due to ill-conditioning when solving linear systems of equations iteratively, [3]. Originally, the condition number of a matrix was first introduced by A. Turing in [4]. Afterwards, the condition number of matrices and numerical problems was comprehensively investigated in [5–7]. The most common efficient and stable way of computing κ(A), is by computing the SVD of A and calculating the ratio of A's largest singular value to its smallest non-zero one, [8]. J. W. Demmel, in [6], investigated the upper and lower bounds of the probability distribution of condition numbers of random matrices and showed that the sets of ill-posed problems including matrix inversion, eigenproblems, and polynomial zero finding all have a common algebraic and geometric structure. In particular, Demmel showed that in the case of matrix inversion, the further away a matrix is from the set of noninvertible matrices, the smaller is its condition number. Accordingly, the spatial distribution of random matrices, in their domains, are indicators of the distribution of their condition numbers. These results provide a clear evidence of the viability of our approach to exploit the tools of topological data analysis (TDA) to investigate the condition number stability of point clouds of random matrices. In general, TDA can be used to capture information about complex topological and geometric structures of point clouds in metric spaces with or without prior knowledge about the data (see [9] for more detail). Since the early 2000s, applied topology has entered a new era exploiting the persistent homology (PH) tool to investigate the global and local shape of high dimensional datasets. Various vectorisation of persistence diagrams (PD), generated by the PH tool, encode information about both local geometry and global topology of cloud of convolution filters of CNN models, [10]. Here we shall attempt to determine the impact of SVD-Surgery procedure on PD's of point clouds of CNN well- and ill-conditioned convolution filters. Contribution: We introduce a singular value decomposition based matrix surgery (SVD-Surgery) technique to modify matrix condition numbers that is suitable for stabilising the actions of ill-conditioned convolution filters on point clouds of image datasets. It decomposes square matrices by SVD factorisation, replaces the smaller singular values, and then reconstruct the original matrix with the resulting singular value diagonal matrix. SVD-Surgery preserves the norm of the input matrix while reducing the norm of its inverse. This means that SVD-Surgery make changes to the PH of the inverse matrices point clouds. We expect that PH analysis of point clouds of matrices (and those of their inverses) can provide an informative understanding of stability behaviour of DL models of image analysis. 2 Background to the Motivating Challenge The ultimate motivation for this paper is related to specific requirements that arose in our challenging investigations of how to "train an efficient slim convolutional neural network models capable of learning dis- criminating features of Ultrasound (or any radiological) images for supporting clinical diagnostic decisions". In particular, the developed model's predictions are required to be robust against tolerable data perturbation and less prone to overfitting effects when tested on unseen data. In machine learning and deep learning, vanishing or exploding gradient and poor convergence is generally due to an ill-conditioning problem. The most common approaches to overcome ill-conditioning are regu- larisation, data normalisation, re-parameterisation, standardisation, and random dropouts. When training a Deep CNN with extremely large datasets of "natural" images, the convolution filter weights/entries are randomly initialised the entries of which are changed through an extensive training procedure using many image batches over a number of epochs at the end of each of which the back-propagation procedure updates the filter entries for improved performance. The frequent updates of filters' entries result in non-negligible to significant of fluctuation and instability of their condition numbers causing sensitivity of the trained CNN models, [11, 12]. CNN models sensitivity are manifested by overfitting, reduced robustness against noise and vulnerability to adversarial attacks, [13]. Transfer Learning is common approach in developing CNN models for analysis of US (or other radiology) image datasets whereby the pretrained filters and other model weights of an existing CNN model (trained on natural images) are used as an initialising parameters for retraining. Unfortunately, condition number instabilities increase in transfer learning mode when used for small datasets of non-natural images resulting in suboptimal performance and a model suffer from overfitting. 2 3 Related work Deep Learning CNN models involve a variety of parameters, the complexity of which are dominated by the entries of sets of convolution filters at various convolution layers as well as those of the fully connected neural network layers. The norm and/or variance of these parameters are the main factors considered in designing initialisation strategies to speedup training optimisation and improve model performance in machine and deep learning tasks. Currently, most popular CNN architectures initialise these weights using zero-mean Gaussian distributions with controlled layer dependent/independent variances. Krizhevsky et al., [14], uses a constant standard deviation of 0.01 to initialise weights in each layer. Due to exponentially vanishing/growing gradient and for compatibility with activation functions, Glorot [15], or He [16], weights are initialised with controllable variances per layer. For Glorot, the initialised variances depend on the number of in/out neurons, while He initialisation of the variances are closely linked to their proposed parameterised rectified activation unit (PReLU) designed to improve model fitting with little overfitting risk. In all these initialisation strategies, no explicit consideration is given to filter's condition numbers or their stability during training. In these cases, our investigations found that post training almost all convolution filters are highly ill-conditioned and hence adversely affect their use in transfer learning for non-natural images. More recent attempts to control the norm of the network layer were proposed in GradInit [17] and MetaInit [18]. These methods can accelerate the convergence while improving model performance and stability. However, both approaches require extra trainable parameters and controlling the condition number during training is not guaranteed. Recently, many research works investigated issues closely related to our objectives, by imposing orthogonality conditions on trainable DL model weights. These include orthonormal and orthogonal weight initialisation techniques, [19–21], orthogonal convolution [22], orthogonal regularizer [23], orthogonal deep neural networks [24], and orthogonal weight normalisation [25]. Recalling that orthogonal/orthonormal matrices are optimally well conditioned, these publications indirectly support our hypothesis on the link between DL overfitting and condition numbers of learnt convolution filters. Although, instability of weight matrices' condition numbers are not discussed explicitly, these related work fit into the emerging paradigm of spectral regularisation of NN layers weight matrices. For example, J. Wang et al, [22], assert that imposing orthogonality on convolutional filters is ideal for overcoming training instability of DCNN models and improved performance. Furthermore, A. Sinha [23], point out that ill-conditioned learnt weight matrix contributes to neural network's susceptibility to adversarial attacks. In fact, their orthogonal regularisation aims to keeping the learnt weight matrix's condition number sufficiently low, and demonstrate its increased adversarial accuracy when tested on the natural image datasets of MNIST and F-MNIST. S. Li et al, in [24], note that existing spectral regularisation schemes, are mostly motivated to improve training for empirical applications, conduct a theoretical analysis of such methods using bounds the concept of Generalisation Error (GE) measures that is defined in terms of the training algorithms and the isometry of the application feature space. They conclude that optimal bound on GE is attained when each weight matrix of a DNN has a spectrum of equal singular values, and call such models OrthDNNs. To overcome the high computation requirements of strict OrthDNNs, they define approximate OrthDNNs by periodically applying their Singular Value Bounding (SVB) scheme of hard regularisation. In general, controlling weights' behaviour during training has proven to accelerate the training process and reduce the likelihood of overfitting the model to the training set e.g. weight standardisation in [26], weight normalisation/reparameterization [27], centred weight normalisation [28], and using Newton's iteration controllable orthogonalization [29]. Most of the above proposed techniques have been developed specifically to deal with trainable DL models for the analysis of natural images and one may assume that these techniques are used frequently during the training after each epoch/batch. However, none of the known state-of-the-arts DL models seem to implicitly incorporate these techniques. In fact, our investigations of these commonly used DL models revealed that the final convolution filters are highly ill-conditioned, [11]. Our literature review revealed that reconditioning and regularisation have long been used in analytical applications to reduce/control the ill-conditioning computations noted. In the late 1980's, E. Rothwell and B. Drachman, [30], proposed an iterative method to reduce the condition number in ill-conditioned matrix problem that is based on regularising the non-zero singular values of the matrix. At each iteration, each of diagonal entry in the SVD of matrix is appended with a ratio of a regularising parameter to the singular value. This algorithm is not efficient to be used for our motivating challenge. In addition, the change of the norm is dependent on the regularising parameter. In recent years, there has been a growing interest in using TDA to analyse point clouds of various types and complexity datasets. For example, significant advances and insight has been made in capturing local and global topological and geometric features in high dimensional datasets using PH tools, that includes 3 conventional methods, [31]. TDA has also been deployed to interpret deep learning and CNNs learning parameters at various layers [11, 32, 33], and integrating topology-based methods in deep learning [34–39]. We shall use TDA to assess the spatial distribution of point clouds of matrices/filters (and their inverses) before and after SVD-Surgery for well and ill-conditioned random matrices. 4 Topological data analysis In this section, we briefly introduce persistent homology preliminaries and describe the point cloud setting of randomly generated matrices to investigate their topological behaviours. Persistent homology of point clouds: Persistent homology is a computational tool of TDA that encapsulates the spatial distribution of point clouds of data records, sampled from metric spaces, by recording the topological features of a gradually triangulated shape by connecting pairs of data points according to an increasing distance/similarity sequence of thresholds. For a point cloud X and a list {αi}m 0 of increasing thresholds, the shape S(X) generated by this TDA process is a sequence {S(X)i}m 0 of simplicial complexes ordered by inclusion. Vietoris-Rips simplicial complex (VR), is the most commonly used approach to construct S(X) due to its simplicity and Ripser, [40] to construct VR. The sequence of distance thresholds is referred to as a filtration of S(X). The topological features of S(X) consists of the number of holes or voids of different dimensions, known as Bettie numbers, in each constituents of {S(X)i}m 0 . For j ≤ 0, the j-th Bettie number Bj(S(X)i), are obtained, respectively, by counting B0 = #(connected components), B1= #(empty loops of more than 3 edges), B2= #(3D cavities bounded by more than 4 faces), etc. Note that the Bj(Si(X)) is the set of generators of the j-th singular homology of the simplicial complex Si(X). The TDA analysis of X with respect to a filtration {αi}m 0 , is based on the persistency of each element of Bj(S(X)i) as i → m. Here, persistency of each element is defined as the difference between its birth (first appearance) and its death (disappearance). It is customary, to visibly represent the Bj(S(X)i), by a vertically stacked set of barcodes, one for each element by the horizontal straight line joining its birth to its death. For more detailed rigours descriptions (see [41–43]). For simplicity, the barcode set and the PD of the Bj(Si(X)) are referred to by Hj. Analysis of the resulting PH barcodes of point clouds, in any dimension, is provided by the Persistence Diagram (PD) formed by a multi-set of points in the first quadrants of the plane (x = birth, y = death) above or on the line y = x. Each marked point in the PD corresponds to a generator of the persistent homology group of the given dimension, and is represented by a pair of coordinates (birth, death). To illustrate these visual representations of PH information, we created a point cloud of 1500 points sampled randomly on the surface of the Torus: T = {(x, y, z) ∈ R3 : ( x2 + y2 − a)2 + z2 = b2} (cid:113) Figure 1, below displays this point cloud, together with the barcodes and PD representation of its PH in both dimensions. The two long 1 − dim persisting barcodes represent the two empty discs whose cartesian product generates the torus. The persistency lengths of these two holes depend on the radii (a − b, b) of the generating circles. In this case, a = 2b. The persistency lengths of the set of shorter barcodes, are inversely related to the point cloud size. Noisy sampling will only have an effect on the shorter barcodes. (a) Point cloud (b) d ≤ 0.1 & 0.2 (c) Persistence barcodes (d) Persistence diagram Figure 1: An illustration of a point cloud (a) points from torus, (b) connecting nearby points up to the distances d = 0.1 & 0.2, and their topological representation as persistence barcodes and diagram. 4 -0.52120100.50-1-1-2-2-0.52120100.50-1-1-2-2-0.52120100.50-1-1-2-2H000.10.20.30.40.50.60.70.80.9H100.10.20.30.40.50.60.70.80.9Birth00.10.20.30.40.50.60.70.80.9DeathH0H1 Our interest in linking PH investigation to our proposed matrix surgery, stems from the significant differences between the topological behaviour (visualised by PDs) of well and ill-conditioned point clouds of filters. Figure 2, demonstrates this for two randomly generated point clouds of 64 3x3 matrices, and their inverses, according to their lowest and highest condition numbers. (a) Well-conditioned X (b) Well-conditioned X −1 (c) Ill-conditioned X (d) Ill-conditioned X −1 Figure 2: Persistence diagram of point clouds of the various point clouds representing: (a) well-conditioned matrices, (b) inverse of matrices from (a), (c) ill-conditioned matrices, (d) inverse of matrices from (c). We note, in both dimensions, the differences between the PDs of the well-conditioned matrices and the ill conditioned ones, as well as between the PD's of their respective inverses. However, when we examine PDs of the original matrices and their inverse point clouds we find that in dim 0 there is little change in the spatial distributions for the well-conditioned ones compared to that for the ill-conditioned ones. Our proposed matrix surgery will aims to control the differences between the PD's of the output matrices and that of their inverse point clouds. 5 Matrix surgery In this section, we describe the research framework to perform matrix surgery that aim to reduce and control the condition number of matrices. Suppose matrix A ∈ Rm×n is non-singular and based on random Gaussian or Uniform distribution. The condition number of A is defined as: σ1 σn κ(A) = (cid:107)A(cid:107)(cid:107)A−1(cid:107) = Where (cid:107).(cid:107) is the norm of the matrix and we focus on Euclidean norm (L2-norm); σ1 and σn are the largest and smallest singular values of A, respectively. A matrix is said to be ill-conditioned if any small change in the input results in big changes in the output, and it is said to be well-conditioned if any small change in the input results in a relatively small change in the output. Alternatively, a matrix with a low condition number (close to one) is said to be well-conditioned, while a matrix with a high condition number is said to be ill-conditioned and the ideal condition number of an orthogonal matrix is one. Next , we describe our simple approach of modifying singular value matrix based SVD since the condition number is defined by the largest and smallest singular values. We recall that the Singular Value decomposition of a square matrix A ∈ Rn×n is defined by: A = UΣVT Where U ∈ Rm×m and V ∈ Rn×n are left and right orthogonal singular vectors (unitary matrices); diagonal matrix Σ = diag(σ1, ..., σn) ∈ Rn×n are singular values where Σ = σ1 ≥ σ2 ≥ ... ≥ σn ≥ 0. The SVD-Surgery, described below, is equally applicable to rectangular matrices. 5.1 SVD based Surgery In the wide context, SVD-Surgery refers to the process of transforming matrices to improve their conditioning numbers. In particular, it is targeting matrices that are far from having orthogonality/orthonormality characteristics to replace them with matrices of improved well-conditioned matrix by deploying their left and right orthogonal singular vectors along with the new singular value diagonal matrix. SVD-Surgery can be realised in a variety of ways according to the expected properties of the output matrices to fit the use case. Given any matrix A, an SVD-Surgery on A outputs a new matrix of the same size as follows: 5 00.511.522.5Birth00.511.522.5DeathH0H100.511.522.5Birth00.511.522.5DeathH0H100.511.522.5Birth00.511.522.5DeathH0H100.511.522.5Birth00.511.522.5DeathH0H1 1. Compute its SVD decomposition, 2. From the diagonal matrix factor Σ construct another diagonal matrix ̃Σ by replacing the small singular value(s) while keeping their descendant order ̃Σ =     σ1 0 ... 0 0 ̃σ2 ... 0 ... ... . . . ...     0 0 ... ̃σn where the updated singular value ̃σi's are selected to maintain low condition number while the new diagonal entries remain monotonically decreasing, and 3. Reconstruct the output matrix ̃A as follows: ̃A = U ̃ΣVT Changes to the singular values amount to rescaling the effect of the matrix action along the left and right orthogonal vectors of U and V, and the monotonicity requirement ensures a reasonable control on the various rescaling. While the orthogonal regularisation scheme of [22] and the SVB scheme of [24] do reduce condition numbers when applied for improved control of overfitting of DL models trained on natural images, the monotonicity property is not satisfied by these schemes. Moreover, their success cannot be guaranteed for application of DL training of US image datasets. The SVB is much stricter than the SVD-surgery for controlling the condition numbers but no analysis is conducted on the norm of these matrices or their inverses. Our intended SVD-Surgery is designed specifically for use in the motivating application and is aimed to reduce extremely high condition number values and preserve the norm of original matrices. Replacing all singular values with the largest singular value will result in producing an orthogonal matrix with a condition number to be equal to one, but this amounts to ignoring/reducing the effect of significant variations in the training data along some of the singular vectors (i.e. less effective learning). Here, we follow a less drastic strategy in changing singular values: Select a diagonal position j, 1 < j < n, let ̃σ be a convex linear combination: ̃σk = n−1 ∑ k=j−1 αkσk, where αi ≥ 0, ∑ αi = 1 and set ̃σk for each j ≤ k ≤ n. The choice of j, and the linear combination parameters can be made application-dependent and possibly determined empirically. In the extreme, this strategy include the possibility of setting ̃σ = σj. This strategy is rather timid in comparison to the orthogonal regularisation strategies, in that it preserves monotonicity of the singular values. In relation to our motivating application, the parameter choices would be layer dependent, but the linear combination parameters should not result in making significant rescaling of training dataset features along the singular vectors. SVD surgery can be applied to inverse matrices, however, the same replacement strategy and reconstruction may not lead to significant reduction in condition number. Example Suppose B is a square matrix with n = 3 drawn from the normal distribution with mean μ = 0 and standard deviation σ = 0.01 as follow: B = (cid:34)−0.0196 −0.0020 −0.0121 (cid:35) 0.0291 −0.0106 0.0083 −0.0047 0.0138 −0.0027 B can be expressed and decomposed in terms of SVD: 6 (cid:35) U = Σ = (cid:34)0.0419 0.0000 0.0000 (cid:34)−0.8745 −0.1286 −0.4676 −0.2124 −0.7652 0.6077 −0.4359 0.6419 0.6308 0.0000 0.0050 0.0000 U and V are right and left orthogonal singular vectors. Singular values of B are Σ = diag(σ1, σ2, σ3) and it is possible to modify and reconstruct ̃B1, ̃B2, and ̃B3 by replacing one and/or two singular values s.t. ̃Σ 3 = diag(σ1, σ1, σ1), respectively. New singular values in ̃Σ 1 = diag(σ1, σ2, σ2), ̃Σ 2 are convex linear combinations s.t. ̃σ2 = 2σ1/3 + σ2/3 and ̃σ3 = ̃σ2 . (cid:35) (cid:34) 0.5452 −0.7156 −0.7926 −0.2703 0.6441 0.2731 2 = diag(σ1, ̃σ2, ̃σ3) and ̃Σ 0.4367 0.5466 0.7145 0.0000 0.0000 0.0005 V = (cid:35) (cid:35) (cid:35) (cid:35) ̃B1 = (cid:34)−0.0205 0.0279 −0.0121 0.0098 −0.0027 −0.0008 −0.0108 0.0154 −0.0007 ̃B2 = (cid:34)−0.0237 0.0219 −0.0156 0.0218 −0.0237 0.0248 −0.0044 0.0235 0.0204 ̃B3 = (cid:34)−0.0247 0.0292 −0.0171 0.0220 −0.0275 0.0296 −0.0049 0.0312 0.0220 After reconstruction, the condition number of ̃B1, ̃B2, and ̃B3 are significantly lower compared to the original matrix as shown in table 1, by using Euclidean norm. Table 1: Euclidean norm and condition number of before and after matrix surgery. (cid:107)A−1(cid:107) (cid:107)A(cid:107) κ(A) B ̃B1 ̃B2 ̃B3 0.041883482 0.041883482 0.041883482 0.041883482 2034.368572 199.5721482 30.36464182 23.87576058 85.20644044 8.358776572 1.271776943 1 5.2 Effects of SVD-Surgery on large datasets of convolution filters and their inverses To illustrate the effect of SVD-Surgery on point clouds of convolutions, we generate 104 of 3 × 3 matrices drawn from the normal distribution N (0, 0.01). We use the norm of the original matrix, the norm of the inverse, and the condition number to evaluate the change and observe the distribution of these parameters per set. Figure 3 shows a clear difference between the condition number of original versus modified matrices. The reduction in condition number is a result of reducing norms of the inverse of matrices (see figure 4). The minimum and maximum condition numbers for the original set are approximately 1.2 and 10256, respectively. After only replacing the smallest singular value σ3 with σ2 then after reconstructing new minimum and maximum values are 1.006 and 17.14. (a) Pre-Surgery (cid:107)A(cid:107) (b) Pre-Surgery (cid:107)A−1(cid:107) (c) Pre-Surgery κ(A) (d) Post-Surgery (cid:107) ̃A(cid:107) (e) Post-Surgery (cid:107) ̃A−1(cid:107) (f) Post-Surgery κ( ̃A) Figure 3: Distribution of a set of 3 × 3 matrices pre and post-surgery: (a) and (d) norm of original matrices, (b) and (e) norm of their inverse, (c) and (f) condition number of matrices 7 -5-4.5-4-3.5-302040608010012014016018020045678910111213050100150200250300123456789050100150200250-5-4.5-4-3.5-30204060801001201401601802003.544.555.566.5050100150200250-0.500.511.522.5020406080100120140160180200 Figure 3 shows a significant change in the distribution of the norm of the inverse of 3 × 3 matrices post- surgery and consequently in the distribution of condition numbers. The linear combination is allowing to keep the range of condition number below a certain threshold depending on the distribution of singular values. For instance, 3D illustrations in figure 4 show a significant reduction in condition number by keeping the ranges below 3 in (b) and 2 in (c), where σ2 and σ3 are replaced with σ1/3 + 2σ2/3 and (σ1 + σ2)/2, respectively. The new minimum and maximum condition number values for both sets after matrix surgery are [1.004, 2.687] and [1.003, 1.88]. (a) ̃σ3 = σ2 (b) ̃σ2 = ̃σ3 = σ1/3 + 2σ2/3 Figure 4: An illustration of a set of 3 × 3 random Gaussian matrices pre- and post-matrix surgery. Shows norm, norm of inverse and condition number (log), where in (a) the smallest singular value σ3 is replaced with σ2, (b) and (b) σ2 and σ3 are replaced with new linear combination of σ1 and σ2. (c) ̃σ2 = ̃σ3 = (σ1 + σ2)/2 5.3 Effects of SVD-Surgery on PD's of convolutional filters point clouds One way to control the condition number of CNN filters during training is by controlling their singular values. The implementation of SVD-Surgery can be integrated into customised CNN models for the analysis of natural as well as US image datasets. as a filter regulariser. It can be applied at the filter initialisation when training from scratch, on pretrained filters when training in the transfer learning, as well as on filters modified during training by back-propagation post every batch/epoch. In this section, we investigate the topological behaviour of a set of matrices as a point cloud by using the persistent homology tools, as discussed in section 4. For any size n × n filters, we generate first a set of random Gaussian n × n matrices and by normalising their entries flattening we get a point cloud in Sn×n−1 residing on its (n × n − 1) − sphere. We construct a second point cloud in Sn×n−1 by computing the inverse matrices, normalising their entries and flattening. Here, we only illustrate this process for a specific point cloud of 3 × 3 matrices for two different linear combinations of the 2 lower singular values. The general case of larger size filters will be discussed in the first author's PhD thesis under preparation. Figure 5, below, shows the H0 and H1, persistence diagrams for point clouds (originals and inverses) plus those for post-matrix surgery with respect to the linear combinations: (1) replacing both σ2 and σ3 with σ1 (i.e κ(A) = 1), and (2) replacing σ3 with σ1. The first row, corresponds to the effect of SVD on the PD of the original point cloud, while the second row corresponds to the inverse point cloud. ̃A2 and ̃A−1 It is clear that PDs of 2 are equivalent as a reflection of the fact that this surgery produces optimally well-conditioning matrices that are orthogonal. Note that in this case, the inverse matrices are simply the transpose of the original ones. Point clouds ̃A1 and ̃A−1 1 where the smallest singular value σ3 is replaced with σ2 and the range of condition number from [1.2, 10256] to [1.006, 17.14]. It is customary, to determine differences and similarities of PDs using distance measures such as bottleneck distance. 1 are consist of a set of matrices ̃A1 and ̃A−1 Our ongoing investigations reveal noticeable improvements in CNN model performance regarding ro- bustness to tolerable data perturbations, and generalisation to unseen data when using SVD-Surgery for convolutional layer filters at (1) initialisation from scratch, (2) pretrained filters, (3) during training batches and/or epochs, and particularly (4) when all combined. Furthermore, controlling condition numbers during training stabilises topological behaviour of filters per convolutional layer. Future publications, will be dealing with these applications of matrix surgery and topological data analysis in CNNs. 8 01524-3log(5(A))610-3.5log(||A-1||)8log(||A||)-410-4.55-5Pre-surgeryPost-surgery01524-3log(5(A))610-3.5log(||A-1||)8log(||A||)-410-4.55-5Pre-surgeryPost-surgery01524-3log(5(A))610-3.5log(||A-1||)8log(||A||)-410-4.55-5Pre-surgeryPost-surgery (a) Pre-surgery A (b) Post-surgery ̃A1 (c) Post-surgery ̃A2 (d) Pre-surgery A−1 Figure 5: Persistence diagram of point clouds A and A−1 before and after SVD based surgery. (f) Post-surgery ̃A−1 2 (e) Post-surgery ̃A−1 1 6 Conclusion We introduced a simple strategy for matrix surgery to reduce and control the condition number of n × n matrices, by replacing all the singular values of the input matrix starting with a selected diagonal entry downward with a convex linear combination of the list, and reconstructing the matrix with a much lower condition number. We demonstrated that this strategy applied on several point clouds of sufficiently large convolution filters preserve filters' norm and reduces the norm of its inverse depending on the chosen linear combination parameters. Our approach showed significant improvements in condition number and persistent homology. In terms of our motivating challenge, our SVD-Surgery approach is ideally efficient in controlling condition numbers of convolutional layer filters during training (from scratch or in transfer learning mode) without increasing model complexity or learning extra hyper-parameters. It preserves monotonicity of the singular values and the linear combination parameters can be made layer dependent determined to avoid making significant rescaling of training dataset features along the singular vectors. Acknowledgement This research is sponsored by Ten-D AI Medical Technologies Ltd. References [1] M. J. Colbrook, V. Antun, and A. C. Hansen, "The difficulty of computing stable and accurate neural networks: On the barriers of deep learning and smale's 18th problem," Proceedings of the National Academy of Sciences, vol. 119, no. 12, p. e2107151119, 2022. [2] N. J. Higham, Accuracy and stability of numerical algorithms. SIAM, 2002. [3] A. Edelman, Eigenvalues and Condition numbers. PhD thesis, MIT, 1989. [4] A. M. Turing, "Rounding-off errors in matrix processes," The Quarterly Journal of Mechanics and Applied Mathematics, vol. 1, no. 1, pp. 287–308, 1948. [5] J. R. Rice, "A theory of condition," SIAM Journal on Numerical Analysis, vol. 3, no. 2, pp. 287–310, 1966. [6] J. W. Demmel, "The geometry of iii-conditioning," Journal of Complexity, vol. 3, no. 2, pp. 201–229, 1987. 9 00.20.40.60.811.21.4Birth00.511.5DeathH0H100.20.40.60.811.21.4Birth00.511.5DeathH0H100.511.522.5Birth00.511.522.5DeathH0H10.20.40.60.80.20.40.60.800.20.40.60.811.21.4Birth00.511.5DeathH0H100.20.40.60.811.21.4Birth00.511.5DeathH0H100.511.522.5Birth00.511.522.5DeathH0H10.20.40.60.80.20.40.60.8 [7] D. J. Higham, "Condition numbers and their condition numbers," Linear Algebra and its Applications, vol. 214, pp. 193–213, 1995. [8] V. Klema and A. Laub, "The singular value decomposition: Its computation and some applications," IEEE Transactions on automatic control, vol. 25, no. 2, pp. 164–176, 1980. [9] F. Chazal and B. Michel, "An introduction to Topological Data Analysis: fundamental and practical aspects for data scientists," Frontiers in Artificial Intelligence, vol. 4, 10 2017. [10] H. Adams and M. Moy, "Topology applied to machine learning: from global to local," Frontiers in Artificial Intelligence, p. 54, 2021. [11] J. Ghafuri, H. Du, and S. Jassim, "Topological aspects of CNN convolution layers for medical image analysis," in Mobile Multimedia/Image Processing, Security, and Applications 2020, vol. 11399, pp. 229–240, SPIE, 2020. [12] J. Ghafuri, H. Du, and S. Jassim, "Sensitivity and stability of pretrained CNN filters," in Multimodal Image Exploitation and Learning 2021, vol. 11734, pp. 79–89, SPIE, 2021. [13] I. J. Goodfellow, J. Shlens, and C. Szegedy, "Explaining and harnessing adversarial examples," arXiv preprint arXiv:1412.6572, 2014. [14] A. Krizhevsky, I. Sutskever, and G. E. Hinton, "Imagenet classification with deep convolutional neural networks," Communications of the ACM, vol. 60, no. 6, pp. 84–90, 2017. [15] X. Glorot and Y. Bengio, "Understanding the difficulty of training deep feedforward neural networks," in Proceedings of the thirteenth international conference on artificial intelligence and statistics, vol. 9, pp. 249–256, 2010. [16] K. He, X. Zhang, S. Ren, and J. Sun, "Delving deep into rectifiers: Surpassing human-level performance on imagenet classification," in Proceedings of the IEEE international conference on computer vision, vol. 2015 Inter, pp. 1026–1034, 2 2015. [17] C. Zhu, R. Ni, Z. Xu, K. Kong, W. R. Huang, and T. Goldstein, "GradInit: Learning to Initialize Neural Networks for Stable and Efficient Training," Advances in Neural Information Processing Systems, vol. 20, pp. 16410–16422, 2 2021. [18] Y. N. Dauphin and S. Schoenholz, "Metainit: Initializing learning by learning to initialize," Advances in Neural Information Processing Systems, vol. 32, 2019. [19] D. Xie, J. Xiong, and S. Pu, "All you need is beyond a good init: Exploring better solution for training extremely deep convolutional neural networks with orthonormality and modulation," in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6176–6185, 3 2017. [20] D. Mishkin and J. Matas, "All you need is a good init," arXiv preprint arXiv:1511.06422, 11 2015. [21] A. M. Saxe, J. L. McClelland, and S. Ganguli, "Exact solutions to the nonlinear dynamics of learning in deep linear neural networks," arXiv preprint arXiv:1312.6120, 12 2013. [22] J. Wang, Y. Chen, R. Chakraborty, and S. X. Yu, "Orthogonal Convolutional Neural Networks," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 6 2020. [23] A. Sinha, M. Singh, B. Krishnamurthy, A. Sinha, B. Krishnamurthy, M. Singh, and B. Krishnamurthy, "Neural networks in an adversarial setting and ill-conditioned weight space," in Joint European Conference on Machine Learning and Knowledge Discovery in Databases, vol. 11329 LNAI, pp. 177–190, Springer, Springer, 2018. [24] K. Jia, S. Li, Y. Wen, T. Liu, D. Tao, K. Jia, Y. Wen, T. Liu, and D. Tao, "Orthogonal Deep Neural Networks," IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 43, pp. 1352–1368, 4 2021. [25] L. Huang, X. Liu, B. Lang, A. Yu, Y. Wang, and B. Li, "Orthogonal weight normalization: Solution to optimization over multiple dependent stiefel manifolds in deep neural networks," in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 32, 2018. [26] S. Qiao, H. Wang, C. Liu, W. Shen, and A. Yuille, "Micro-batch training with batch-channel normalization and weight standardization," arXiv preprint arXiv:1903.10520, 2019. [27] T. Salimans, D. P. Kingma, T. S. Openai, and D. P. K. Openai, "Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks," Advances in Neural Information Processing Systems, vol. 29, pp. 901–909, 2 2016. 10 [28] L. Huang, X. Liu, Y. Liu, B. Lang, and D. Tao, "Centered weight normalization in accelerating training of deep neural networks," in Proceedings of the IEEE International Conference on Computer Vision, pp. 2803– 2811, 2017. [29] L. Huang, L. Liu, F. Zhu, D. Wan, Z. Yuan, B. Li, and L. Shao, "Controllable Orthogonalization in Training DNNs," Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, pp. 6428–6437, 4 2020. [30] E. Rothwell and B. Drachman, "A unified approach to solving ill-conditioned matrix problems," Inter- national Journal for Numerical Methods in Engineering, vol. 2, pp. 609–620, 3 1989. [31] R. Turkeš, G. Montúfar, and N. Otter, "On the effectiveness of persistent homology," arXiv preprint arXiv:2206.10551, 2022. [32] R. B. Gabrielsson, G. Carlsson, R. Bruel Gabrielsson, G. Carlsson, R. B. Gabrielsson, and G. Carlsson, "Exposition and interpretation of the topology of neural networks," in 2019 18th IEEE International Conference On Machine Learning And Applications (ICMLA), pp. 1069–1076, IEEE, 2019. [33] G. Magai and A. Ayzenberg, "Topology and geometry of data manifold in deep learning," arXiv preprint arXiv:2204.08624, 2022. [34] C. Hofer, R. Kwitt, M. Niethammer, and A. Uhl, "Deep learning with topological signatures," Advances in neural information processing systems, vol. 30, 2017. [35] B. Rieck, M. Togninalli, C. Bock, M. Moor, M. Horn, T. Gumbsch, and K. Borgwardt, "Neural per- sistence: A complexity measure for deep neural networks using algebraic topology," arXiv preprint arXiv:1812.09764, 2018. [36] S. Ebli, M. Defferrard, and G. Spreemann, "Simplicial neural networks," arXiv preprint arXiv:2010.03633, 2020. [37] M. Hajij and K. Istvan, "A topological framework for deep learning," arXiv preprint arXiv:2008.13697, 2020. [38] C. S. Hu, A. Lawson, J. S. Chen, Y. M. Chung, C. Smyth, and S. M. Yang, "TopoResNet: A Hybrid Deep Learning Architecture and Its Application to Skin Lesion Classification," Mathematics 2021, Vol. 9, Page 2924, vol. 9, p. 2924, 11 2021. [39] R. Gonzalez-Diaz, M. A. Gutiérrez-Naranjo, and E. Paluzo-Hidalgo, "Topology-based representative datasets to reduce neural network training resources," Neural Computing and Applications, pp. 1–17, 2022. [40] U. Bauer, "Ripser: efficient computation of Vietoris–Rips persistence barcodes," Journal of Applied and Computational Topology, vol. 5, pp. 391–423, 9 2021. [41] H. Edelsbrunner, D. Letscher, and A. Zomorodian, "Topological persistence and simplification," in Proceedings 41st annual symposium on foundations of computer science, pp. 454–463, IEEE, 2000. [42] R. Ghrist, "Barcodes: the persistent topology of data," Bulletin of the American Mathematical Society, vol. 45, no. 1, pp. 61–75, 2008. [43] N. Otter, M. A. Porter, U. Tillmann, P. Grindrod, and H. A. Harrington, "A roadmap for the computation of persistent homology," EPJ Data Science, vol. 6, pp. 1–38, 2017. 11
http://arxiv.org/abs/2302.11431v1
2023-02-22T15:13:45
2023-02-22T15:13:45
A Note on "Towards Efficient Data Valuation Based on the Shapley Value''
The Shapley value (SV) has emerged as a promising method for data valuation. However, computing or estimating the SV is often computationally expensive. To overcome this challenge, Jia et al. (2019) propose an advanced SV estimation algorithm called ``Group Testing-based SV estimator'' which achieves favorable asymptotic sample complexity. In this technical note, we present several improvements in the analysis and design choices of this SV estimator. Moreover, we point out that the Group Testing-based SV estimator does not fully reuse the collected samples. Our analysis and insights contribute to a better understanding of the challenges in developing efficient SV estimation algorithms for data valuation.
[ "Jiachen T. Wang", "Ruoxi Jia" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11431v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11431v1", "@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" ]
3 2 0 2 b e F 2 2 ] L M . t a t s [ 1 v 1 3 4 1 1 . 2 0 3 2 : v i X r a A Note on "Towards Efficient Data Valuation Based on the Shapley Value" Jiachen T. Wang1 and Ruoxi Jia2 1Princeton University 2Virginia Tech [email protected], [email protected] Abstract The Shapley value (SV) has emerged as a promising method for data valuation. However, computing or estimating the SV is often computationally expensive. To overcome this challenge, Jia et al. [2019] propose an advanced SV estimation algorithm called "Group Testing-based SV estimator" which achieves favorable asymptotic sample complexity. In this technical note, we present several improvements in the analysis and design choices of this SV estimator. Moreover, we point out that the Group Testing-based SV estimator does not fully reuse the collected samples. Our analysis and insights contribute to a better understanding of the challenges in developing efficient SV estimation algorithms for data valuation. 1 Introduction Data valuation, i.e., measuring the contribution of a data source to the ML training process, is an important problem in the field of machine learning (ML). For example, assessing the value of data helps to identify and remove low-quality data [Ghorbani and Zou, 2019, Kwon and Zou, 2021], and also provides insights into a model's test-time behavior [Koh and Liang, 2017]. Additionally, data valuation plays a critical role in incentivizing data sharing and shaping policies for data market [Zhu et al., 2019, Tian et al., 2022]. Cooperative game theory and economic principles have inspired the use of the Shapley value (SV) as a principled approach for data valuation [Ghorbani and Zou, 2019, Jia et al., 2019]. The SV is the unique notion that satisfies natural fairness requirements in the ML context. The SV has shown superior performance on many ML tasks such as identifying mislabeled data or outliers. Despite these advantages, the SV is known to be computationally expensive. The number of utility function evaluations required by the exact SV calculation grows exponentially in the number of players (i.e., data points for the ML context). Even worse, for ML tasks, evaluating the utility function itself (e.g., computing the testing accuracy of the ML model trained on a given dataset) is already computationally expensive, as it requires training a model. For a target precision, the classic permutation sampling SV estimator [Castro et al., 2009] requires evaluating the utility functions for Ω(N 2 log N ) times for estimating the SV for N data points. Jia et al. [2019] propose an advanced estimation algorithm termed as "Group Testing-based SV estimator", which reduces the sample complexity to Ω(N (log N )2). This algorithm achieves greater asymptotic efficiency by increasing sample reuse, allowing each evaluation of utility to be used in the estimation of the SV for all N data points. 1 In this note, we present several improvements for the analysis and algorithm design of the Group Testing-based SV estimator. Specifically, we give a more fine-grained and simpler sample complex- ity analysis for the Group Testing-based SV estimator in Jia et al. [2019]. Moreover, we propose two modifications for the estimation algorithm. Both the new analysis and the new algorithm de- sign save constant factors for the sample complexity of SV estimators. Such an improvement is significant when the non-asymptotic sample bound is used for providing confidence intervals for the estimation. Additionally, we point out that while the Group Testing-based SV estimator seems to maximize sample reuse, a large portion of samples do not effectively contribute to the estimation of each data point's SV. Our analysis and insights could aid the development of future cooperative game theory-based data valuation techniques. 2 Background In this section, we formalize the data valuation problem for ML and review the concept of the Shapley value. I := N Data Valuation for Machine Learning. We denote a dataset D := zi} i=1 containing N data { points. The objective of data valuation is to assign a score to each training data point in a way as the index set. To that reflects their contribution to model training. Denote 1, . . . , N { R, which maps any subset analyze a point's "contribution", we define a utility function U : 2N of the training set to a score indicating the usefulness of the subset. 2N represents the power set of N , i.e., the collection of all subsets of N , including the empty set and N itself. For classification tasks, a common choice for U is the validation accuracy of a model trained on the input subset. Formally, for any subset S is a learning algorithm S )), where ⊆ I ∈ S as input and returns a model. acc is a metric function that evaluates zi}i that takes a dataset { ∈ the performance of a given model, e.g., the accuracy of a model on a hold-out test set. We consider utility functions with a bounded range, which aligns with the commonly used metric functions such as test classification accuracy. Without loss of generality, we assume throughout this note that ), the utility of the entire U (S) dataset, to the individual data point i where each φi(U ) represents the payoff for the owner of the data point i. [0, 1]. The goal of data valuation is to partition Utot := U ( I . That is, we want to find a score vector (φi(U ))i , we have U (S) := acc( zi}i ( { ∈ I → A A ∈I ∈ } The Shapley Value. The SV [Shapley, 1953] is a classic concept in cooperative game theory to attribute the total gains generated by the coalition of all players. At a high level, it appraises each point based on the (weighted) average utility change caused by adding the point into different ), the Shapley value of a data point i is defined as subsets. Given a utility function U ( * φi (U ) := 1 N N Xk=1 (cid:18) N k 1 − 1 1 (cid:19) − − S , i XS | } ⊆I\{ | =k 1 − [U (S ) i } ∪ { − U (S)] (1) The popularity of the Shapley value is attributable to the fact that it is the unique data value notion satisfying the following four axioms [Shapley, 1953]: • Dummy player: if U (S i) = U (S) + c for all S • Symmetry: if U (S ∪ ∪ i) = U (S i and some c ∈ R, then φi (U ) = c. ⊆ I \ i, j ⊆ I \ { , then φi(U ) = φj(U ). } j) for all S ∪ 2 • Linearity: For any of two utility functions U1, U2 and any α1, α2 ∈ α1φi (U1) + α2φi (U2). R, φi (α1U1 + α2U2) = • Efficiency: for every U , φi(U ) = U ( I ). i ∈I i) U (S) is often termed the marginal contribution of data point i to subset The difference U (S i. We refer the readers to [Ghorbani and Zou, 2019, Jia et al., 2019] and the references S therein for a detailed discussion about the interpretation and necessity of the four axioms in the ML context. ⊆ I \ P − ∪ 3 Improved Analysis for the Group Testing-based SV Estimator from Jia et al. [2019] The main obstacle to using the SV is its computational expense. To compute the exact SV as given in Equation (1), it is necessary to calculate the marginal contribution of each data point i to every 1 coalitions. To make matters worse, for many possible coalition S ML tasks, each time of evaluating the utility function can already be computationally expensive as it involves training an ML model. i, which is a total of 2N ⊆ I \ − To meet this challenge, Jia et al. [2019] propose a Group Testing-based SV estimator which achieves superior asymptotic sample complexity. In this section, we review the estimation algorithm from Jia et al. [2019], and we provide an improved sample complexity analysis for it. We start by defining the performance metric of a Monte Carlo-based SV estimator. Definition 1. We say an SV estimator (in l2-norm) if and only if φ = (φi)i ∈I ∈ φ b RN is an (ε, δ)-approximation to the true Shapley value where the randomness is taken over the coin flip of the estimator φ. Pr φ b h(cid:13) (cid:13) (cid:13) φ φ − 1 δ − ≥ ≤ ε i (cid:13) (cid:13) b (cid:13) The first and so far simplest estimation algorithm for SV is called permutation sampling [Castro et al., 2009], which samples marginal contributions for each data point i based on randomly drawn permuta- tions of the dataset. Hoeffding's inequality shows that to achieve (ε, δ)-approximation, permutation N 2 ε2 log( N In the algorithm of δ ) sampling estimator requires Ω permutation sampling, each sampled U (S) is only being used for the Shapley value estimation for (cid:17) at most 2 data points, which results in an extra factor of N in its sample complexity. ). evaluations for the utility U ( * (cid:16) b N In contrast, the Group Testing-based SV estimator developed in Jia et al. [2019] requires only ε2 ).1 The principle behind such an improvement is that the Group Testing-based evaluations of U ( (cid:1) * SV estimator increases the sample reuse, where each sampled U (S) is used for the SV estimation for all of N data points. The pseudo-code is summarized in Algorithm 1. At a high level, Group Testing-based estimation algorithm first estimates the difference of the Shapley value between every pair of data points φi − By the definition of the Shapley value, one can write the difference φi − φj, and then recovers each φi from the value differences. φj as follows: Ω e (cid:0) 1 We use eΩ to hide the logarithmic factors in Ω. 3 Algorithm 1: Group Testing-Based SV Estimation from Jia et al. [2019]. N input : Training set D = i=1, utility function U ( ), evaluation budget T . (xi, yi) * } { RN . output : The estimated SV for each training point φ ∈ b − 1. N 1 − k=1 , N * * * × 1 k . k + 1 N k ) for k = 1, RT 0 2 1 Z ← Z ( 1 1 2 qk ← P 3 Initialize matrix B 4 for t = 1 to T do Draw k 5 − Uniformly sample a size-k subset S from Bti ← S. ut ← 1 for all i U (S). 1, . . . , N 1 } ∼ { N . ← − ∈ ∈ 8 7 6 according to distribution qk. = 1, { I * * * , N . } 9 end 10 ∆i,j ← 11 Find b Z T T t=1 ut(Bt,i − Bt,j) for every pair of (i, j) s.t. i, j and j > i. ∈ I φ by solving the feasibility problem P b φi − ( b (cid:12) (cid:12) (cid:12) φi = U ( I ), ε/(2√N ), ≤ N i=1 ∆i,j b (cid:12) (cid:12) (cid:12) b φj) P − b i, j ∀ ∈ I , j > i. (3) Lemma 2. For any i, j ∈ I , the difference in the Shapley value between i and j is ∆i,j := φi − φj = 1 N 1 − XS ⊆I\{ i,j } (cid:18) N 2 − S | (cid:19) | 1 − [U (S i) ∪ − U (S ∪ j)] (2) We now provide a more fine-grained analysis for the original Group Testing-based algorithm. The original estimator from Jia et al. [2019] first derives accurate estimated SV differences ∆i,j for all N (N δ). The correctness of the above algorithm then follows from the lemma here. 1)/2 pairs of data points (i, j) with high probability ( − ≥ − b 1 ≤ ∆i,j ε 2√N for all pairs of (i, j) s.t. i, j Lemma 3 (Modified from Lemma 2 in Jia et al. [2019]). If the estimated SV differences ∆i,j − (cid:12) (cid:12) problem in (3) satisfies (cid:12) (cid:12) (cid:12) b (cid:12) The following theorem provides an improved lower bound on the number of utility evaluations T needed to achieve an (ε, δ)-approximation. ∆i,j satisfies φ for the feasibility and j > i, then any solution , which further implies (cid:13) (cid:13) (cid:13) b (cid:13) (cid:13) (cid:13) b ε √N 2 ≤ ∈ I (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) − ≤ − ε. φ φ φ φ ∞ b b Theorem 4 (Improved version of Theorem 3 in Jia et al. [2019]). Algorithm 1 returns an (ε, δ)- approximation to the Shapley value if the number of tests T satisfies k , qk := 1 where Z := 2 and h(u) := (1 + u) log(1 + u) P 1 N − k=1 1 Z ( 1 − (cid:16) k + 1 u. N − log(N (N 1)/δ) T ≥ (1 − qtot) h * − ε 2Z√N (1 = Θ N ε2 log(N ) log N δ (cid:18) (cid:18) (cid:19)(cid:19) (4) qtot) (cid:17) − k ) for k = 1, , N − * * * 1, qtot := N 2 N q1+ − N 1 k=2 qk − P 4 1 + 2k(k N (N (cid:16) N ) 1) − − , (cid:17) Algorithm 2: Improved Group Testing-Based SV Estimation. N input : Training set D = i=1, utility function U ( ), evaluation budget T . (xi, yi) * } { RN . output : The estimated SV for each training point φ ∈ b 0 N k=1 RT , N . 1 k . k + 1 N +1 k ) for k = 1, × 2 1 Z ← 1 Z ( 1 2 qk ← P − 3 Initialize matrix B 4 for t = 1 to T do Draw k 5 } Uniformly sample a size-k subset S from Bti ← S. ut ← 1 for all i U ′(S). * * * (N +1). 1, . . . , N ∼ { ← ∈ ∈ 8 6 7 according to distribution qk. = 1, { I * * * . , N, N + 1 } 10 11 ∗ T 1, . . . , N 1, . . . , N Z T ∆i, Bt,N +1) for all i t=1 ut(Bt,i − for all i P ∈ { 9 end ∆i, ∗ ← φi ← b b Compared with the non-asymptotic sample lower bound in Jia et al. [2019], the non-asymptotic lower bound in (4) saves a factor of 8 and improves q2 tot to qtot. Such an improvement is significant when the non-asymptotic bound is used for providing a confidence interval for the estimated SV. The proof (deferred to the Appendix) is also arguably simpler. ∈ { . } . } b 4 Improved Algorithm Design for Group Testing-based SV Estima- tor ∆i,j to be within In Jia et al. [2019], the Group Testing-based SV estimation algorithm requires that with high prob- ability, the estimated error with respect of the true value ∆i,j for every pair of data points i, j. There are N (N 1)/2 such pairs in a dataset of size N , which leads to a factor 1)/δ) in the number of required samples. Moreover, there might be multiple solutions of log(N (N i=1 will depend on the for the feasibility problem in (3), which means that the outputted actual solver, which poses difficulties for fine-grained analysis for such an estimator. ε 2√N φ = ( φi)N − − b − b 1 pair of differences. b Recovering the Shapley values from N In fact, we do not need to estimate the Shapley value differences ∆i,j for every pair of data points i, j. If we already know the Shapley value of a "pivot" data point , and compute φ , we can simply estimate φi − ∗ ∗ .2 That is, only N b 1 pairs of Shapley difference need to be estimated. However, φi = φ ∗ . in this case, we also need to directly estimate φ ∗ ∗ b This requires us to attribute a certain amount of computational budget solely used for estimating φ , which introduces an additional step in the estimation algorithm. Moreover, the samples for ∗ estimating φ ∗ cannot be reused for estimating φi − , the Shapley value of the "pivot" data point for every i φ ∗ ∈ I ∆i, + − b ∗ . Dummy Player technique. Recall that the dummy player axiom of the Shapley value says i, then φi = 0. Given a training dataset that for a player i, if U (S . For any utility . Thus, we i) = U (S) for all S , we augment it by adding a dummy player called } I function U , we augment it by setting U ′(S) = U (S) and U ′(S 1, . . . , N { ⊆ I \ = ∪ I ′ = , i.e., I ∪ {∗} ∗ ) = U (S) for all S ∪ ∗ ⊆ I 2 This technique first appears in Ruoxi Jia's Ph.D. thesis [Jia, 2018]. 5 (U ′) = 0. We show that the augmentation from U to U ′ does not change the Shapley value have φ ∗ of any original data points i . ∈ I Theorem 5. φi(U ′) = φi(U ) for all i . ∈ I Proof. φi(U ′) = 1 N + 1 = 1 N + 1 = 1 N + 1 = 1 N + 1 1 − N k (cid:19) S i, XS ⊆I ′\ | | =k U ′(S i) ∪ − U ′(S) N Xk=0 (cid:18) N 1 − 1 − N k (cid:19) [U ′(S i) ∪ − U ′(S)] Xk=0 XS , i, ⊆I ′\{ ∗} | S | =k "(cid:18) + N k + 1 (cid:19) (cid:18) 1 − + (cid:19) (cid:18) 1 − [U ′(S i, ∪ { ) ∗} − U ′(S ∪ ∗ )] # 1 − N k + 1 (cid:19) ! [U (S i) ∪ − U (S)] N + 1 N N − k (cid:18) 1 1 − (cid:19) [U (S i) ∪ − U (S)] N 1 − Xk=0 XS S i, | ⊆I\ N − 1 | N k =k (cid:18) Xk=0 XS S i, | ⊆I\ | =k N 1 − = 1 N Xk=0 XS S i, | ⊆I\ | =k (cid:18) N − k 1 1 − (cid:19) [U (S i) ∪ − U (S)] = φi(U ) Theorem 6. The improved Group Testing-based SV estimator (Algorithm 2) returns an (ε, δ)- approximation to the Shapley value if the number of tests T satisfies T ≥ (1 − log(N/δ) qtot) h * ε Z√N +1(1 (cid:16) k + 1 u. N +1 − − (cid:17) k ) for k = 1, * * * k , qk := 1 where Z := 2 and h(u) := (1 + u) log(1 + u) P N k=1 1 Z ( 1 = O N ε2 log(N ) log N δ (cid:18) (cid:18) (cid:19)(cid:19) qtot) (5) , N , qtot := N 1 N +1 q1+ − N k=2 qk N 1) − − N (N +1) 1 + 2k(k (cid:16) , (cid:17) P O(N ) asymptotically, While the sample complexity of the modified group testing estimator is still it improves the non-asymptotic sample bound by a factor of 2 since we only need to estimate N pairs instead of N (N 1)/2 pairs of Shapley differences. − e − Remark. Algorithm 2 actually uses an alternative expression for the Shapley value N 1 − φi = Z qk+1 N +1 k+1 = ZE Xk=0 k ∼ , i XS | } ⊆I\{ ), I∪{∗} | S | S | (cid:0) qk,S (cid:1) Unif( ∼ [U (S i) ∪ =k =k [U (S)1[i U (S)] − S, / ∈ ∗ ∈ S] − U (S)1[i / ∈ S, ∗ ∈ S]] 6 5 Sample Reuse in Group Testing-based SV estimator As mentioned earlier, the Group Testing-based SV estimator saves a factor of N in sample complex- ity compared with the permutation sampling estimator by increasing the sample reuse, i.e., each sampled utility U (S) is used in the estimation of all ∆i,j's, and hence the estimation of all φi's. However, this gives a false sense that all information is being utilized. Algorithm 1 or 2 constructs the sampling distribution of S such that ∆i,j = ES [Z(1[i S])U (S)]. This means that among all of the sampled S, those who include or exclude both i, j have zero contributions to the estimation of ∆i,j. Moreover, it can be shown that the probability of sampling such ineffective S is 1[j S] − ∈ ∈ qtot := Pr[i, j S or i, j / ∈ ∈ S] = 1 2 Z − (see the detailed derivation in the Appendix). A simple bound for the sum of harmonic series tells us that Z = Θ(log N ). Hence, we know that the "effective" amount of samples that can be used to estimate ∆i,j is only Θ(1/ log N ) out of all collected samples. Therefore, the Group Testing-based estimator does not achieve the maximal possible sample reuse where all of the sampled U (S) is being used to estimate all φi's. Is it possible to construct a Monte-Carlo-based SV estimator that achieves maximal sample reuse? It has been shown in Wang and Jia [2023] that it is impossible to construct a distribution such that φi (U ) = E . Hence, an SV estimator that achieves maximal sample reuse cannot simply decide how to use the sampled U (S) only based on over S the membership of a data point i. That is, it is impossible to find a single distribution such that i [U (S)] for all i φ is in the form of i [U (S)] ∼D|D6∋ ∼D|D∋ ∈ I − D D E S S b 1 φi = i| XS i.i.d. drawn from |S∋ ∈S∋ b U (S) − i 1 |S6∋ i| XS ∈S6∋ : i U (S) i (6) = where S1, . . . , Sm} { = S S { i. The Group Testing-based SV estimator in Jia et al. [2019] makes use of the membership S \ S∋ of other data points in S and improves the extent of sample reuse, which can serve as an excellent starting point for future research. : i / ∈ S { and ∈ S ∈ S i = i = S∋ S6∋ D ∈ S S } } , Remark. While the Group Testing-based SV estimator achieves more favorable asymptotic sample complexity compared with the permutation sampling estimator, it has been reported in several subse- quent data valuation studies that the actual performance of the Group Testing-based estimator does not observably outperform permutation sampling technique [Wang et al., 2020, Yan and Procaccia, 2020, Wang et al., 2021, Wang and Jia, 2023]. In particular, Wang and Jia [2023] also performed the empirical evaluation for the improved Group Testing-based estimator proposed in this note, and still do not observe significant advantages in SV estimation accuracy. This is because, despite the low sample reuse, the permutation sampling estimator directly samples the marginal contribution, which significantly reduces the estimation variance when N is small. 6 Conclusion In this technical note, we presented several improvements to the analysis and algorithm design of the Group Testing-based Shapley value estimator. Our work contributes to a better understanding of the challenges associated with developing Monte Carlo-based SV estimators. We hope our insights can inspire future research on data valuation techniques. 7 References Javier Castro, Daniel Gómez, and Juan Tejada. Polynomial calculation of the shapley value based on sampling. Computers & Operations Research, 36(5):1726–1730, 2009. Amirata Ghorbani and James Zou. Data shapley: Equitable valuation of data for machine learning. In International Conference on Machine Learning, pages 2242–2251. PMLR, 2019. Ruoxi Jia. Accountable Data Fusion and Privacy Preservation Techniques in Cyber-Physical Systems. University of California, Berkeley, 2018. Ruoxi Jia, David Dao, Boxin Wang, Frances Ann Hubis, Nick Hynes, Nezihe Merve Gürel, Bo Li, Ce Zhang, Dawn Song, and Costas J Spanos. Towards efficient data valuation based on the In The 22nd International Conference on Artificial Intelligence and Statistics, shapley value. pages 1167–1176. PMLR, 2019. Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In International Conference on Machine Learning, pages 1885–1894. PMLR, 2017. Yongchan Kwon and James Zou. Beta shapley: a unified and noise-reduced data valuation framework for machine learning. arXiv preprint arXiv:2110.14049, 2021. Lloyd S Shapley. A value for n-person games. Contributions to the Theory of Games, 2(28):307–317, 1953. Yingjie Tian, Yurong Ding, Saiji Fu, and Dalian Liu. Data boundary and data pricing based on the shapley value. IEEE Access, 10:14288–14300, 2022. Jiachen T. Wang and Ruoxi Jia. Data banzhaf: A robust data valuation framework for machine learning. International Conference on Artificial Intelligence and Statistics, 2023. Tianhao Wang, Johannes Rausch, Ce Zhang, Ruoxi Jia, and Dawn Song. A principled approach to data valuation for federated learning. In Federated Learning, pages 153–167. Springer, 2020. Tianhao Wang, Yu Yang, and Ruoxi Jia. Improving cooperative game theory-based data valuation via data utility learning. arXiv preprint arXiv:2107.06336, 2021. Tom Yan and Ariel D Procaccia. If you like shapley then you'll love the core, 2020. Liehuang Zhu, Hui Dong, Meng Shen, and Keke Gai. An incentive mechanism using shapley value for blockchain-based medical data sharing. In 2019 IEEE 5th Intl Conference on Big Data Security on Cloud (BigDataSecurity), IEEE Intl Conference on High Performance and Smart Comput- ing,(HPSC) and IEEE Intl Conference on Intelligent Data and Security (IDS), pages 113–118. IEEE, 2019. 8 A Proofs A.1 Proof for Lemma 3 Theorem 3. If the estimated SV differences s.t. i, j and j > i, then any solution ∈ I which further implies φ φ − ε. 2 ≤ b (cid:13) (cid:13) (cid:13)b (cid:13) (cid:13) (cid:13) ∆i,j satisfies ∆i,j − (cid:12) φ for the feasibility problem (3) satisfies (cid:12) (cid:12) b ∆i,j ≤ (cid:12) (cid:12) (cid:12) b ε 2√N for all pairs of (i, j) ε √N , ≤ ∞ − φ (cid:13) (cid:13) (cid:13)b φ (cid:13) (cid:13) (cid:13) Proof. Suppose, for contradiction, that there exists i ε′ := ε/(2√N ). By assumption, for arbitrary j ∈ I = i, we have such that φi − (cid:12) (cid:12) (cid:12)b φi > ε √N . Denote (cid:12) (cid:12) (cid:12) ∆i,j = ∆i,j − (cid:12) (cid:12) (cid:12) b ∆i,j (φi − (cid:12) (cid:12) (cid:12) φj) − ∆i,j b ε′ ≤ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ε′ implies that The constraint ≤ (cid:12) (cid:12) (cid:12) − φj) φi − ( (cid:12) (cid:12) b b b φi − ( φj − ( (cid:12) | − b b φi = cε′. We have φi) Denote φi − b φi The assumption of φj − b φi − (cid:12) (cid:12) = i. Then, φj > 0 for any j (cid:12) (cid:12) (cid:12) b (cid:12) N > ε √N φj) | ≤ | φi − b φj − b ∆i,j| b + φi − | φj − 2ε′ ∆i,j| ≤ b (c − 2)ε′ ≤ φj ≤ (c + 2)ε′ φj − b = 2ε′ either implies c > 2 or c < 2. If c > 2, we have − φj) = φj − ( Xj=1 b φj − ( b =i Xj φj) + ( φi − b φi) > 0 By efficiency axiom, the sum of the Shapley value ), which does not satisfy all of the constraints in (3). A similar contradiction can be made for the case of c < 2. Hence, for all i ), it follows that φj > U ( I , we have P b . N j=1 φj = U ( I N j=1 φi − ∈ I P ≤ ε √N φi − (cid:12) (cid:12) (cid:12) b (cid:12) (cid:12) (cid:12) 9 6 6 6 A.2 Proof for Theorem 4 To prove Theorem 4, we use Bennett's inequality. Lemma 7 (Bennett's inequality). Let X1, . . . , Xn be independent real-valued random variables with E[X 2 i ]. b for some b > 0 almost surely for all 1 finite variance such that Xi ≤ For any t > 0, we have n. Let ν n i=1 ≥ ≤ ≤ i P Pr n " Xi=1 E[Xi] Xi − t ≥ # ≤ exp ν b2 h bt ν (cid:18) − (cid:18) (cid:19)(cid:19) (7) where h(x) = (1 + x) log(1 + x) x for x > 0. − Theorem 4. Algorithm 1 returns an (ε, δ)-approximation to the Shapley value if the number of tests T satisfies T ≥ (1 log(N (N qtot) h * − (cid:16) 1)/δ) − ε 2Z√N (1 − = O n ε2 (cid:18) n δ log (cid:16) 2 (cid:19) (cid:17) qtot) (8) (cid:17) , N − 1, qtot := N 2 N q1+ − N 1 k=2 qk − P 1 + 2k(k N (N (cid:16) N ) 1) − − , (cid:17) k , qk := 1 where Z := 2 and h(u) := (1 + u) log(1 + u) P N 1 − k=1 1 Z ( 1 k + 1 u. N − − k ) for k = 1, * * * Proof. For a subset S βi := 1[i ⊆ I ∈ S]. In Algorithm 1, the subset S are sampled as follows: , we use β = (β1, . . . , βN ) to denote its binary representation where 1. Sample subset size k 1, 2, ∈ { , N − * * * 2. Uniformly sample a size-k subset S 1 } . ⊆ I according to the discrete distribution (q1, . . . , qk 1). − Consider any two data points i, j based on samples from the distribution of ζ := Z(βi − is unbiased. Obviously, only βi 6 ∈ I . In Algorithm 1, the Shapley value difference ∆i,j is estimated βj)U (S). We first verify that such an estimate = βj has non-zero contributions to its expectation. E[ζ] = E[Z(βi − βj)U (S)] = Z N 2 − Xk=0 qk+1 N k+1 (cid:0) (cid:1) , i,j XS } ⊆I\{ | S | =k [U (S i) ∪ − U (S ∪ j)] (9) 1 (cid:19) 1 N k+1 (k + 1)!(N (cid:1) N ! (cid:0) − − 1) 1)! k − Note that Z qk+1 N k+1 = (cid:18) 1 k + 1 + N (cid:0) (cid:1) = = = which leads to 1 k − k 2)! − N (k + 1)(N − k k!(N − 1)! (N − − 1 (N − 1) N 2 − k (cid:0) (cid:1) 10 E[ζ] = 1 N 2 − N − = φi − Xk=0 1 φj 1 N − k 2 (cid:0) (cid:1) [U (S i) ∪ − U (S j)] ∪ , i,j XS } ⊆I\{ | S | =k Now, we analyze the variance of ζ, in order to apply Bennett's inequality to bound the sample 1, 1]. Recall that complexity for estimating ∆i,j. Note that U ζ = 0 when βi = βj. The probability of such event is [0, 1], which means that ζ [ − ∈ ∈ qtot := Pr[ζ = 0] = Pr[βi = βj] = Pr[βi = 1, βj = 1] + Pr[βi = 0, βj = 0] N 1 − Xk=2 N = = qk N k N k 2 2 − − N − 1 (cid:18) (cid:0) 2 − N (cid:1) q1 + (cid:19) qk N k N 1 − + qk N k 2 N − k (cid:18) Xk=1 (cid:1) (cid:0) 2 N − 2 k − 2k(k N (N (cid:18)(cid:18) 1 + + (cid:19) (cid:18) N ) 1) − − (cid:19) Xk=2 1 N − Xk=2 (cid:0) qk (cid:1) (cid:18) (cid:19) N − k 2 (cid:19)(cid:19) N = − N 2 q1 + Hence, E[ζ 2] can be bounded as follows: E[ζ 2] = Pr[ζ 1 − ≤ = 0]E[ζ 2 qtot = 0] ζ | Given T i.i.d. samples (ζt)T t=1, by Bennett's inequality, we have Pr ∆i,j − h(cid:12) (cid:12) (cid:12) b Hence, ε = Pr i ∆i,j ≥ (cid:12) (cid:12) (cid:12) "(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 T T Xt=1 ζt − ∆i,j (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ε # ≤ ≥ 2 exp − (cid:18) T (1 − qtot)h Z(1 (cid:18) ε − qtot) (cid:19)(cid:19) i, j s.t. i > j, ∀ Pr (cid:20) = 1 − ∃ (cid:20) N (N 1 − ≥ Pr i, j s.t. i > j, 1) exp − − (cid:18) ∆i,j − (cid:12) (cid:12) (cid:12) b ∆i,j (cid:12) (cid:12) (cid:12) ∆i,j − (cid:12) (cid:12) (cid:12) b T (1 − ≤ ε 2√N (cid:21) ∆i,j ≥ qtot)h (cid:12) (cid:12) (cid:12) (cid:18) ε 2√N (cid:21) ε Z(1 qtot) (cid:19)(cid:19) − δ, we have that when T ≤ ≥ (1 − log(N (N h(cid:16) 1)/δ) − ε 2Z√N(1 qtot) * qtot ) (cid:17) − , with proba- By setting the failure probability bility 1 − ≥ δ we have for all pair of i, j s.t. i > j. By Lemma 3, any solutions this event has ε, which leads to the conclusion. b − ≤ φ φ (cid:13) (cid:13) (cid:13) b (cid:13) (cid:13) (cid:13) ∆i,j ε 2√N ≤ ∆i,j − (cid:12) (cid:12) (cid:12) b (cid:12) (cid:12) (cid:12) 11 φ for the feasibility problem in (3) under 6 6 (10) (11) (12) Asymptotic Analysis. It can be shown that qtot = 1 2 Z , and − Z(1 − qtot) = 2 Therefore, as N , → ∞ − The first-order Taylor expansion of h(u) at 0 is u2 2 . Thus, we have ε Z√N (1 0 qtot) → log(N (N 1)/δ) (1 qtot) h * − − ε 2Z√N (1 = O(N Z log N ) qtot) (cid:16) − (cid:17) 1) + 1), we have O(N Z log N ) = O(N (log N )2). Since Z 2(log(N ≤ − 12
http://arxiv.org/abs/2302.11419v2
2023-06-21T09:09:05
2023-02-22T14:55:57
Aligned Diffusion Schrödinger Bridges
Diffusion Schr\"odinger bridges (DSB) have recently emerged as a powerful framework for recovering stochastic dynamics via their marginal observations at different time points. Despite numerous successful applications, existing algorithms for solving DSBs have so far failed to utilize the structure of aligned data, which naturally arises in many biological phenomena. In this paper, we propose a novel algorithmic framework that, for the first time, solves DSBs while respecting the data alignment. Our approach hinges on a combination of two decades-old ideas: The classical Schr\"odinger bridge theory and Doob's $h$-transform. Compared to prior methods, our approach leads to a simpler training procedure with lower variance, which we further augment with principled regularization schemes. This ultimately leads to sizeable improvements across experiments on synthetic and real data, including the tasks of rigid protein docking and temporal evolution of cellular differentiation processes.
[ "Vignesh Ram Somnath", "Matteo Pariset", "Ya-Ping Hsieh", "Maria Rodriguez Martinez", "Andreas Krause", "Charlotte Bunne" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11419v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11419v2", "@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-bio.QM" ]
3 2 0 2 n u J 1 2 ] G L . s c [ 2 v 9 1 4 1 1 . 2 0 3 2 : v i X r a Aligned Diffusion Schrödinger Bridges Vignesh Ram Somnath∗1,2 Maria Rodriguez Martinez2 Matteo Pariset∗1,3 Andreas Krause1 Ya-Ping Hsieh1 Charlotte Bunne1 1Department of Computer Science, ETH Zürich 2IBM Research Zürich 3Department of Computer Science, EPFL Abstract Diffusion Schrödinger bridges (DSB) have re- cently emerged as a powerful framework for recov- ering stochastic dynamics via their marginal ob- servations at different time points. Despite numer- ous successful applications, existing algorithms for solving DSBs have so far failed to utilize the structure of aligned data, which naturally arises in many biological phenomena. In this paper, we propose a novel algorithmic framework that, for the first time, solves DSBs while respecting the data alignment. Our approach hinges on a com- bination of two decades-old ideas: The classical Schrödinger bridge theory and Doob's h-transform. Compared to prior methods, our approach leads to a simpler training procedure with lower variance, which we further augment with principled regular- ization schemes. This ultimately leads to sizeable improvements across experiments on synthetic and real data, including the tasks of predicting confor- mational changes in proteins and temporal evolu- tion of cellular differentiation processes. 1 INTRODUCTION The task of transforming a given distribution into another the heart of many modern machine learning lies at applications such as single-cell genomics (Tong et al., 2020; Schiebinger et al., 2019; Bunne et al., 2022a), meteorology (Fisher et al., 2009), and robotics (Chen et al., 2021a). To this end, diffusion Schrödinger bridges (De Bortoli et al., 2021; Chen et al., 2022a; Vargas et al., 2021; Liu et al., 2022b) have recently emerged as a powerful paradigm due to their ability to generalize prior deep diffusion-based mod- els, notably score matching with Langevin dynamics (Song and Ermon, 2019; Song et al., 2021) and denoising diffusion probabilistic models (Ho et al., 2020), which have achieved the state-of-the-art on many generative modeling problems. *Equal contribution. Figure 1: Overview of SBALIGN: In biological tasks such as protein docking, one is naturally provided with aligned data in the form of unbound and bound structures of participating proteins. Our goal is to therefore recover a stochastic tra- jectory from the unbound (x0) to the bound (x1) structure. To achieve this, we connect the characterization of an SDE conditioned on x0 and x1 (utilizing the Doob's h-transform) with that of a Brownian bridge between x0 and x1 (classical Schrödinger bridge theory). We show that this leads to a simpler training procedure with lower variance and strong empirical results. Despite the wide success of DSBs solvers, a significant limitation of existing frameworks is that they fail to cap- ture the alignment of data: If ˆP0, ˆP1 are two (empirical) distributions between which we wish to interpolate, then a tacit assumption in the literature is that the dependence of ˆP0 and ˆP1 is unknown and somehow has to be recovered. Such an assumption, however, ignores important scenar- ios where the data is aligned, meaning that the samples from ˆP0 and ˆP1 naturally come in pairs (xi i , which is common in many biological phenomena. Proteins, for instance, undergo conformational changes upon interactions with other biomolecules (protein docking, see Fig. 1). The goal is to model conformational changes by recovering a (stochastic) trajectory xt based on the positions observed at two-time points (x0, x1). Failing to incorporate this align- ment would mean that we completely ignore information on the correspondence between the initial and final points of 0, xi 1)N Accepted for the 39th Conference on Uncertainty in Artificial Intelligence (UAI 2023). <latexit sha1_base64="DdaWJy59CKUFSHv/F+jR5J+BhWw=">AAACdXicdVFNa9wwEJWdpE23abtNL4VSULNJ2RDY2iFpeykEcukxhW52Ye2YkVa2RWTZSOPAYja/oL+ut/6NXnqt1ruEfLQDQk/vvWFGM6xS0mIQ/PL8tfWNR483n3Sebj17/qL7cvvclrXhYshLVZoxAyuU1GKIEpUYV0ZAwZQYscvThT66EsbKUn/HWSXiAjItU8kBHZV0f0QFYG6KZjqn4wS/ZAleHEZKpDhhFxHmAiHB9t13cmRkluP+QaSBKaCRKjOa/9e2vGJ6qwQeuAI3xLVjWsxYM5onmHR7wSBogz4E4Qr0yCrOku7PaFryuhAauQJrJ2FQYdyAQcmVmHei2ooK+CVkYuKghkLYuGmnNqd7jpnStDTuaKQtezujgcLaWcGcc9Gjva8tyH9pkxrTz3EjdVWj0HxZKK0VxZIuVkCn0giOauYAcCNdr5TnYICjW1THDSG8/+WH4PxwEH4cHH876p30V+PYJG/IDumTkHwiJ+QrOSNDwslv77X3ztvx/vhv/V3//dLqe6ucV+RO+B/+AqZ8wJg=</latexit><latexit sha1_base64="YpfmbF3X8aBDTOsEF6k75AvqTJk=">AAAB83icbVDLSsNAFL2pr1pfVZduBovQVUnE17LgxmUF+4AmlMl00g6dTMI8xBL6G25cKOLWn3Hn3zhps9DWAwOHc+7lnjlhypnSrvvtlNbWNza3ytuVnd29/YPq4VFHJUYS2iYJT2QvxIpyJmhbM81pL5UUxyGn3XBym/vdRyoVS8SDnqY0iPFIsIgRrK3k+zHW4zDKnmYDb1CtuQ13DrRKvILUoEBrUP3yhwkxMRWacKxU33NTHWRYakY4nVV8o2iKyQSPaN9SgWOqgmyeeYbOrDJEUSLtExrN1d8bGY6VmsahncwzqmUvF//z+kZHN0HGRGo0FWRxKDIc6QTlBaAhk5RoPrUEE8lsVkTGWGKibU0VW4K3/OVV0jlveFeNy/uLWrNe1FGGEziFOnhwDU24gxa0gUAKz/AKb45xXpx352MxWnKKnWP4A+fzByXOkbA=</latexit>x<latexit sha1_base64="Z2837n1hHCfkeAc4nzHrdEnWg/U=">AAAB83icbVDLSsNAFL2pr1pfVZduBovQVUnE17LgxmUF+4AmlMl00g6dTMI8xBL6G25cKOLWn3Hn3zhps9DWAwOHc+7lnjlhypnSrvvtlNbWNza3ytuVnd29/YPq4VFHJUYS2iYJT2QvxIpyJmhbM81pL5UUxyGn3XBym/vdRyoVS8SDnqY0iPFIsIgRrK3k+zHW4zDKnmYDd1CtuQ13DrRKvILUoEBrUP3yhwkxMRWacKxU33NTHWRYakY4nVV8o2iKyQSPaN9SgWOqgmyeeYbOrDJEUSLtExrN1d8bGY6VmsahncwzqmUvF//z+kZHN0HGRGo0FWRxKDIc6QTlBaAhk5RoPrUEE8lsVkTGWGKibU0VW4K3/OVV0jlveFeNy/uLWrNe1FGGEziFOnhwDU24gxa0gUAKz/AKb45xXpx352MxWnKKnWP4A+fzByRKka8=</latexit>x<latexit sha1_base64="NSkESCA/maxFjF+BKtlPOskhk3I=">AAACUXicbVFJSwMxGP067nWrevQSLIIglpnidhEELx4VrC106pBJM20ws5B8I5Yw/kQPevJ/ePGgmC6C2wchL+99L8tLmEmh0XVfSs7U9Mzs3PxCeXFpeWW1srZ+rdNcMd5gqUxVK6SaS5HwBgqUvJUpTuNQ8mZ4ezbUm3dcaZEmVzjIeCemvUREglG0VFDp+zHFvopNtyCtAE96Ad7UiR8pysxICiNzXwTenhUL44ccqV2MZyzIl/vB2nHXmn8w4w1C0ywCDCpVt+aOivwF3gRUYVIXQeXJ76Ysj3mCTFKt256bYcdQhYJJXpT9XPOMslva420LExpz3TGjRAqybZkuiVJlR4JkxH53GBprPYhD2zm8o/6tDcn/tHaO0XHHiCTLkSdsfFCUS4IpGcZLukJxhnJgAWVK2LsS1qc2TbSfULYheL+f/Bdc12veYe3gcr96ujOJYx42YQt2wIMjOIVzuIAGMHiEV3iHj9Jz6c0Bxxm3OqWJZwN+lLP4CQ9HtbI=</latexit><latexit sha1_base64="hQtYQvfAHZgGcRO0QL3kuTuLZGo=">AAAB7XicbVDLTgJBEOzFF+IL9ehlIjHhRHaNryOJF4+YyCOBDZkdemFkdmedmSUhhH/w4kFjvPo/3vwbB9iDgpV0UqnqTndXkAiujet+O7m19Y3Nrfx2YWd3b/+geHjU0DJVDOtMCqlaAdUoeIx1w43AVqKQRoHAZjC8nfnNESrNZfxgxgn6Ee3HPOSMGis1OviU8lG3WHIr7hxklXgZKUGGWrf41elJlkYYGyao1m3PTYw/ocpwJnBa6KQaE8qGtI9tS2MaofYn82un5MwqPRJKZSs2ZK7+npjQSOtxFNjOiJqBXvZm4n9eOzXhjT/hcZIajNliUZgKYiSZvU56XCEzYmwJZYrbWwkbUEWZsQEVbAje8surpHFe8a4ql/cXpWo5iyMPJ3AKZfDgGqpwBzWoA4NHeIZXeHOk8+K8Ox+L1pyTzRzDHzifP72pjyw=</latexit>≡<latexit sha1_base64="+b1YTwNn9fAZs+R6bGCklmbpVJo=">AAAB8HicbVDLSgNBEOz1GeMr6tHLYBA8SNgVX8eAF48RzEOyMcxOZpMhM7vLTK8QlnyFFw+KePVzvPk3TpI9aGJBQ1HVTXdXkEhh0HW/naXlldW19cJGcXNre2e3tLffMHGqGa+zWMa6FVDDpYh4HQVK3ko0pyqQvBkMbyZ+84lrI+LoHkcJ7yjaj0QoGEUrPfiJePQNUt0tld2KOwVZJF5OypCj1i19+b2YpYpHyCQ1pu25CXYyqlEwycdFPzU8oWxI+7xtaUQVN51sevCYHFulR8JY24qQTNXfExlVxoxUYDsVxYGZ9ybif147xfC6k4koSZFHbLYoTCXBmEy+Jz2hOUM5soQyLeythA2opgxtRkUbgjf/8iJpnFW8y8rF3Xm5eprHUYBDOIIT8OAKqnALNagDAwXP8ApvjnZenHfnY9a65OQzB/AHzucP7x+QcQ==</latexit>?o<latexit sha1_base64="0gFJlNIvw8V2s0Y1XmyaTE/kb3s=">AAAB6HicbVDLSgNBEJz1GeMr6tHLYBA8SNgVX8eAF48JmAckS5id9CZjZmeXmV4hLPkCLx4U8eonefNvnCR70MSChqKqm+6uIJHCoOt+Oyura+sbm4Wt4vbO7t5+6eCwaeJUc2jwWMa6HTADUihooEAJ7UQDiwIJrWB0N/VbT6CNiNUDjhPwIzZQIhScoZXq2CuV3Yo7A10mXk7KJEetV/rq9mOeRqCQS2ZMx3MT9DOmUXAJk2I3NZAwPmID6FiqWATGz2aHTuipVfo0jLUthXSm/p7IWGTMOApsZ8RwaBa9qfif10kxvPUzoZIUQfH5ojCVFGM6/Zr2hQaOcmwJ41rYWykfMs042myKNgRv8eVl0ryoeNeVq/pluXqex1Egx+SEnBGP3JAquSc10iCcAHkmr+TNeXRenHfnY9664uQzR+QPnM8f3MuM7A==</latexit>t<latexit sha1_base64="TiFC/aLIif/46SWVn+wBSHZagqQ=">AAAB6nicbVDLSgNBEOz1GeMr6tHLYBAEJeyKr2PAi8eI5gHJEmYns8mQ2dllplcISz7BiwdFvPpF3vwbJ8keNLGgoajqprsrSKQw6LrfztLyyuraemGjuLm1vbNb2ttvmDjVjNdZLGPdCqjhUiheR4GStxLNaRRI3gyGtxO/+cS1EbF6xFHC/Yj2lQgFo2ilBzz1uqWyW3GnIIvEy0kZctS6pa9OL2ZpxBUySY1pe26CfkY1Cib5uNhJDU8oG9I+b1uqaMSNn01PHZNjq/RIGGtbCslU/T2R0ciYURTYzojiwMx7E/E/r51ieONnQiUpcsVmi8JUEozJ5G/SE5ozlCNLKNPC3krYgGrK0KZTtCF48y8vksZ5xbuqXN5flKtneRwFOIQjOAEPrqEKd1CDOjDowzO8wpsjnRfn3fmYtS45+cwB/IHz+QOzJ41c</latexit><latexit sha1_base64="ut6IZKJrEflIDCfYbuj6at9z7QU=">AAAB+XicdVDJSgNBEO1xjXEb9eilMQg5DTMx6y3oxWNEs0ASQk+nkzTp6Rm6a4JhyJ948aCIV//Em39jZxFU9EHB470qqur5keAaXPfDWlvf2NzaTu2kd/f2Dw7to+OGDmNFWZ2GIlQtn2gmuGR14CBYK1KMBL5gTX98NfebE6Y0D+UdTCPWDchQ8gGnBIzUs+0OsHvQNLm9JIIP5axnZ1ynkiu6hQp2ndyFWyx5c1IulvIl7DnuAhm0Qq1nv3f6IY0DJoEKonXbcyPoJkQBp4LN0p1Ys4jQMRmytqGSBEx3k8XlM3xulD4ehMqUBLxQv08kJNB6GvimMyAw0r+9ufiX145hUO4mXEYxMEmXiwaxwBDieQy4zxWjIKaGEKq4uRXTEVGEggkrbUL4+hT/Txo5xys6hZt8pppdxZFCp+gMZZGHSqiKrlEN1RFFE/SAntCzlViP1ov1umxds1YzJ+gHrLdPadeUHg==</latexit>Mumtaz<latexit sha1_base64="YpfmbF3X8aBDTOsEF6k75AvqTJk=">AAAB83icbVDLSsNAFL2pr1pfVZduBovQVUnE17LgxmUF+4AmlMl00g6dTMI8xBL6G25cKOLWn3Hn3zhps9DWAwOHc+7lnjlhypnSrvvtlNbWNza3ytuVnd29/YPq4VFHJUYS2iYJT2QvxIpyJmhbM81pL5UUxyGn3XBym/vdRyoVS8SDnqY0iPFIsIgRrK3k+zHW4zDKnmYDb1CtuQ13DrRKvILUoEBrUP3yhwkxMRWacKxU33NTHWRYakY4nVV8o2iKyQSPaN9SgWOqgmyeeYbOrDJEUSLtExrN1d8bGY6VmsahncwzqmUvF//z+kZHN0HGRGo0FWRxKDIc6QTlBaAhk5RoPrUEE8lsVkTGWGKibU0VW4K3/OVV0jlveFeNy/uLWrNe1FGGEziFOnhwDU24gxa0gUAKz/AKb45xXpx352MxWnKKnWP4A+fzByXOkbA=</latexit>x1boundreceptorligand<latexit sha1_base64="Z2837n1hHCfkeAc4nzHrdEnWg/U=">AAAB83icbVDLSsNAFL2pr1pfVZduBovQVUnE17LgxmUF+4AmlMl00g6dTMI8xBL6G25cKOLWn3Hn3zhps9DWAwOHc+7lnjlhypnSrvvtlNbWNza3ytuVnd29/YPq4VFHJUYS2iYJT2QvxIpyJmhbM81pL5UUxyGn3XBym/vdRyoVS8SDnqY0iPFIsIgRrK3k+zHW4zDKnmYDd1CtuQ13DrRKvILUoEBrUP3yhwkxMRWacKxU33NTHWRYakY4nVV8o2iKyQSPaN9SgWOqgmyeeYbOrDJEUSLtExrN1d8bGY6VmsahncwzqmUvF//z+kZHN0HGRGo0FWRxKDIc6QTlBaAhk5RoPrUEE8lsVkTGWGKibU0VW4K3/OVV0jlveFeNy/uLWrNe1FGGEziFOnhwDU24gxa0gUAKz/AKb45xXpx352MxWnKKnWP4A+fzByRKka8=</latexit>x0unboundligandreceptor<latexit sha1_base64="hQtYQvfAHZgGcRO0QL3kuTuLZGo=">AAAB7XicbVDLTgJBEOzFF+IL9ehlIjHhRHaNryOJF4+YyCOBDZkdemFkdmedmSUhhH/w4kFjvPo/3vwbB9iDgpV0UqnqTndXkAiujet+O7m19Y3Nrfx2YWd3b/+geHjU0DJVDOtMCqlaAdUoeIx1w43AVqKQRoHAZjC8nfnNESrNZfxgxgn6Ee3HPOSMGis1OviU8lG3WHIr7hxklXgZKUGGWrf41elJlkYYGyao1m3PTYw/ocpwJnBa6KQaE8qGtI9tS2MaofYn82un5MwqPRJKZSs2ZK7+npjQSOtxFNjOiJqBXvZm4n9eOzXhjT/hcZIajNliUZgKYiSZvU56XCEzYmwJZYrbWwkbUEWZsQEVbAje8surpHFe8a4ql/cXpWo5iyMPJ3AKZfDgGqpwBzWoA4NHeIZXeHOk8+K8Ox+L1pyTzRzDHzifP72pjyw=</latexit>≡Brownian bridge<latexit sha1_base64="DdaWJy59CKUFSHv/F+jR5J+BhWw=">AAACdXicdVFNa9wwEJWdpE23abtNL4VSULNJ2RDY2iFpeykEcukxhW52Ye2YkVa2RWTZSOPAYja/oL+ut/6NXnqt1ruEfLQDQk/vvWFGM6xS0mIQ/PL8tfWNR483n3Sebj17/qL7cvvclrXhYshLVZoxAyuU1GKIEpUYV0ZAwZQYscvThT66EsbKUn/HWSXiAjItU8kBHZV0f0QFYG6KZjqn4wS/ZAleHEZKpDhhFxHmAiHB9t13cmRkluP+QaSBKaCRKjOa/9e2vGJ6qwQeuAI3xLVjWsxYM5onmHR7wSBogz4E4Qr0yCrOku7PaFryuhAauQJrJ2FQYdyAQcmVmHei2ooK+CVkYuKghkLYuGmnNqd7jpnStDTuaKQtezujgcLaWcGcc9Gjva8tyH9pkxrTz3EjdVWj0HxZKK0VxZIuVkCn0giOauYAcCNdr5TnYICjW1THDSG8/+WH4PxwEH4cHH876p30V+PYJG/IDumTkHwiJ+QrOSNDwslv77X3ztvx/vhv/V3//dLqe6ucV+RO+B/+AqZ8wJg=</latexit>dXt=g2t⇥bθt(Xt)+rloghθt(Xt)⇤dt+gtdWtïÏÏÏïiIÏÏÏÏiïIIa<latexit sha1_base64="ut6IZKJrEflIDCfYbuj6at9z7QU=">AAAB+XicdVDJSgNBEO1xjXEb9eilMQg5DTMx6y3oxWNEs0ASQk+nkzTp6Rm6a4JhyJ948aCIV//Em39jZxFU9EHB470qqur5keAaXPfDWlvf2NzaTu2kd/f2Dw7to+OGDmNFWZ2GIlQtn2gmuGR14CBYK1KMBL5gTX98NfebE6Y0D+UdTCPWDchQ8gGnBIzUs+0OsHvQNLm9JIIP5axnZ1ynkiu6hQp2ndyFWyx5c1IulvIl7DnuAhm0Qq1nv3f6IY0DJoEKonXbcyPoJkQBp4LN0p1Ys4jQMRmytqGSBEx3k8XlM3xulD4ehMqUBLxQv08kJNB6GvimMyAw0r+9ufiX145hUO4mXEYxMEmXiwaxwBDieQy4zxWjIKaGEKq4uRXTEVGEggkrbUL4+hT/Txo5xys6hZt8pppdxZFCp+gMZZGHSqiKrlEN1RFFE/SAntCzlViP1ov1umxds1YzJ+gHrLdPadeUHg==</latexit>SBalignlàokïÏÏÏïiIÏÏÏÏiIIïÏÏÏïalignment<latexit sha1_base64="+b1YTwNn9fAZs+R6bGCklmbpVJo=">AAAB8HicbVDLSgNBEOz1GeMr6tHLYBA8SNgVX8eAF48RzEOyMcxOZpMhM7vLTK8QlnyFFw+KePVzvPk3TpI9aGJBQ1HVTXdXkEhh0HW/naXlldW19cJGcXNre2e3tLffMHGqGa+zWMa6FVDDpYh4HQVK3ko0pyqQvBkMbyZ+84lrI+LoHkcJ7yjaj0QoGEUrPfiJePQNUt0tld2KOwVZJF5OypCj1i19+b2YpYpHyCQ1pu25CXYyqlEwycdFPzU8oWxI+7xtaUQVN51sevCYHFulR8JY24qQTNXfExlVxoxUYDsVxYGZ9ybif147xfC6k4koSZFHbLYoTCXBmEy+Jz2hOUM5soQyLeythA2opgxtRkUbgjf/8iJpnFW8y8rF3Xm5eprHUYBDOIIT8OAKqnALNagDAwXP8ApvjnZenHfnY9a65OQzB/AHzucP7x+QcQ==</latexit>π?<latexit sha1_base64="NSkESCA/maxFjF+BKtlPOskhk3I=">AAACUXicbVFJSwMxGP067nWrevQSLIIglpnidhEELx4VrC106pBJM20ws5B8I5Yw/kQPevJ/ePGgmC6C2wchL+99L8tLmEmh0XVfSs7U9Mzs3PxCeXFpeWW1srZ+rdNcMd5gqUxVK6SaS5HwBgqUvJUpTuNQ8mZ4ezbUm3dcaZEmVzjIeCemvUREglG0VFDp+zHFvopNtyCtAE96Ad7UiR8pysxICiNzXwTenhUL44ccqV2MZyzIl/vB2nHXmn8w4w1C0ywCDCpVt+aOivwF3gRUYVIXQeXJ76Ysj3mCTFKt256bYcdQhYJJXpT9XPOMslva420LExpz3TGjRAqybZkuiVJlR4JkxH53GBprPYhD2zm8o/6tDcn/tHaO0XHHiCTLkSdsfFCUS4IpGcZLukJxhnJgAWVK2LsS1qc2TbSfULYheL+f/Bdc12veYe3gcr96ujOJYx42YQt2wIMjOIVzuIAGMHiEV3iHj9Jz6c0Bxxm3OqWJZwN+lLP4CQ9HtbI=</latexit>dXt=g2tx1−Xtβ1−βtdt+gtdWtprotein the molecules, resulting in a much harder problem than nec- essary. Beyond, the recent use of SBs has been motivated by an important task in molecular biology: Cells change their molecular profile throughout developmental processes (Schiebinger et al., 2019; Bunne et al., 2022b) or in response to perturbations such as cancer drugs (Lotfollahi et al., 2019; Bunne et al., 2021). As most measurement technologies are destructive assays, i.e., the same cell cannot be observed twice nor fully profiled over time, these methods aim at re- constructing cell dynamics from unpaired snapshots. Recent developments in molecular biology, however, aim at over- coming this technological limitation. For example, Chen et al. (2022b) propose a transcriptome profiling approach that preserves cell viability. Weinreb et al. (2020) capture cell differentiation processes by clonally connecting cells and their progenitors through barcodes (see illustrative Fig- ure in Supplement). Motivated by these observations, the goal of this paper is to propose a novel algorithmic framework for solving DSBs with (partially) aligned data. Our approach is in stark contrast to existing works which, due to the lack of data alignment, all rely on some variants of iterative proportional fitting (IPF) (Fortet, 1940; Kullback, 1968) and are thus prone to numerical instability. On the other hand, via a combination of the original theory of Schrödinger bridges (Schrödinger, 1931; Léonard, 2013) and the key notion of Doob's h-transform (Doob, 1984; Rogers and Williams, 2000), we design a novel loss function that completely bypasses the IPF procedure and can be trained with much lower variance. To summarize, we make the following contributions: • To our best knowledge, we consider, for the first time, the problem of interpolation with aligned data. We rig- orously formulate the problem in the DSB framework. • Based on the theory of Schrödinger bridges and h- transform, we derive a new loss function that, unlike prior work on DSBs, does not require an IPF-like pro- cedure to train. We also propose principled regulariza- tion schemes to further stabilize training. • We describe how interpolating aligned data can pro- vide better reference processes for use in classical DSBs, paving the way to hybrid aligned/non-aligned Schrödinger bridges (SBs). • We evaluate our proposed framework on both synthetic and real data. For experiments utilizing real data, we consider two tasks where such aligned data is naturally available. The first is the task of developmental processes in single-cell biology, and the second involves protein docking. For the protein docking task, a comprehensive treatment is elusive, owing to lack of appropriate datasets. Instead, we consider two associated subproblems - (i) modelling conformational changes between unbound and bound states of a protein, and (ii) rigid protein docking for identifying the best relative orientation. Our method demonstrates a considerable improvement over prior methods across various metrics, thereby substantiating the importance of taking the data alignment into account. Related work. Solving DSBs is a subject of significant interest in recent years and has flourished in a number of different algorithms (De Bortoli et al., 2021; Chen et al., 2022a; Vargas et al., 2021; Bunne et al., 2023; Liu et al., 2022a). However, all these previous approaches focus on unaligned data, and therefore the methodologies all rely on IPF and are hence drastically different from ours. In the experiments, we will demonstrate the importance of taking the alignment of data into consideration by comparing our method to these baselines. An important ingredient in our theory is Doob's h-transform, which has recently also been utilized by Liu et al. (2023) to solve the problem of constrained diffusion. However, their fundamental motivation is different from ours. Liu et al. (2023) focus on learning the drift of the diffusion model and the h-transform together, whereas ours is to read off the drift from the h-transform with the help of aligned data. Consequently, there is no overlap between the two algorithms and their intended applications. To the best of our knowledge, the concurrent work of Tong et al. (2023) is the only existing framework that can tackle aligned data, which, however, is not their original motiva- tion. In the context of solving DSBs, their algorithm can be seen as learning a vector field that generates the correct marginal probability (cf. Tong et al., 2023, Proposition 4.3). Importantly, this is different from our aim of finding the pathwise optimal solution of DSBs: If (xi i=1 is a test data set for which we wish to predict their destinations, then the framework of Tong et al. (2023) can only ensure that the marginal distribution (xi i=1 is correct, whereas ours is capable of predicting that xi 1,test is precisely the destination of xi 0,test for each i. This latter property is highly desirable in tasks like ML-accelerated protein docking. 0,test)m 1,test)m To solve aligned SB problems, we rely on mixtures of diffu- sion processes. Like in Peluchetti (2023), we construct them from pairings and define an associated training objective inspired by score-based modeling. However, we represent the learned drift as a sum of the solution to an SB problem (b) and a pairing-related term ( log h). We parametrize the second part of the drift with neural networks, unlike Schauer et al. (2017) which use an auxiliary (simpler) process. ∇ 2 BACKGROUND Problem formulation. Suppose that we are given access to i.i.d. aligned data (xi 1)N i=1, where the marginal distri- 1's is ˆP1. Typically, we view 0's is ˆP0 and of xi bution of xi ˆP0 as the empirical marginal distribution of a stochastic pro- 0, xi 1)N 0, xi cess observed at time t = 0, and likewise ˆP1 the empirical marginal observed at t = 1. The goal is to reconstruct the stochastic process Pt based on (xi i=1, i.e., to interpo- late between ˆP0 and ˆP1. Such a task is ubiquitous in biological applications. For instance, understanding how proteins dock to other biomolecules is of significant interest in biology and has become a topic of intense study in recent years (Ganea et al., 2022; Tsaban et al., 2022; Corso et al., 2023). In the pro- tein docking task, xi 0 represents the 3D structures of the unbound proteins, while xi 1 represents the 3D structure of the bound complex. Reconstructing a stochastic process that diffuses xi 1's is tantamount to recovering the energy landscape governing the docking process. Similarly, in molecular dynamics simulations, we have access to tra- jectories 1 represent the initial and final positions of the i-th molecule respectively. Any learning algorithm using these simulations should be able to respect the provided alignment. , where xi 0's to xi 0 and xi t∈[0,1] xi t (cid:0) (cid:1) Diffusion Schrödinger bridges. To solve the interpola- tion problem, in Section 3, we will invoke the framework of DSBs, which are designed to solve interpolation problems with unaligned data. More specifically, given two marginals ˆP0 and ˆP1, the DSB framework proceeds by first choosing a reference process Qt using prior knowledge, for instance a simple Brownian motion, and then solve the entropy- minimization problem over all stochastic processes Pt: min P0=ˆP0, P1=ˆP1 DKL(Pt∥ Qt). (SB) 0, xi Despite the fact that many methods exist for solving (SB) (De Bortoli et al., 2021; Chen et al., 2022a; Vargas et al., 2021; Bunne et al., 2023), none of these approaches are capable of incorporating alignment of the data. This can be seen by inspecting the objective (SB), in which the coupling information (xi 1) is completely lost as only its individual marginals ˆP0, ˆP1 play a role therein. Unfortunately, it is well- known that tackling the marginals separately necessitates a forward-backward learning process known as the iterative proportional fitting (IPF) procedure (Fortet, 1940; Kullback, 1968), which constitutes the primary reason of high variance training, thereby confronting DSBs with numerical and scal- ability issues. Our major contribution, detailed in the next section, is therefore to devise the first algorithmic frame- work that solves the interpolation problem with aligned data without resorting to IPF. 3 ALIGNED DIFFUSION SCHRÖDINGER BRIDGES In this section, we derive a novel loss function for DSBs with aligned data by combining two classical notions: The theory of Schrödinger bridges (Schrödinger, 1931; Léonard, 2013; Chen et al., 2021b) and Doob's h-transform (Doob, 1984; Rogers and Williams, 2000). We then describe how solutions to DSBs with aligned data can be leveraged in the context of classical DSBs. 3.1 LEARNING ALIGNED DIFFUSION SCHRÖDINGER BRIDGES Static SB and aligned data. Our starting point is the simple and classical observation that (SB) is the continuous- time analogue of the entropic optimal transport, also known as the static Schrödinger bridge problem (Léonard, 2013; Chen et al., 2021b; Peyré and Cuturi, 2019): π⋆ := argmin P0=ˆP0, P1=ˆP1 DKL(P0,1∥ Q0,1) (1) where the minimization is over all couplings of ˆP0 and ˆP1, and Q0,1 is simply the joint distribution of Qt at t = 0, 1. In other words, if we denote by P⋆ t the stochastic process that minimizes (SB), then the joint distribution P⋆ 0,1 necessarily coincides with the π⋆ in (1). Moreover, since in DSBs, the data is always assumed to arise from P⋆ t , we see that: The aligned data (xi of π⋆. 0, xi 1)N i=1 constitutes samples This simple but crucial observation lies at the heart of all derivations to come. Our central idea is to represent P⋆ t via two different, but equivalent, characterizations, both of which involve π⋆: That of a mixture of reference processes with pinned end points, and that of conditional stochastic differential equa- tions (SDEs). P⋆ t from π⋆: Qt with pinned end points. For illustration purposes, from now on, we will assume that the reference process Qt is a Brownian motion with diffusion coefficient gt:* dQt = gt dWt. In this case, it is well-known that Qt conditioned to start at x0 and end at x1 can be written in another SDE (Mansuy and Yor, 2008; Liu et al., 2023): (2) dXt = g2 t x1 − β1 − Xt βt dt + gt dWt where X0 = x0 and t g2 s ds. βt := 0 (cid:90) (3) (4) *Extension to more involved reference processes is con- ceptually straightforward but notationally clumsy. Furthermore, reference processes of the form (2) are dominant in practical applications (Song et al., 2021; Bunne et al., 2023), so we omit the general case. 1. We call the processes in (3) the scaled Brownian bridges as they generalize the classical Brownian bridge, which corresponds to the case of gt ≡ The first characterization of P⋆ t is then an immediate conse- quence the following classical result in Schrödinger bridge π⋆ and connect them via theory: Draw a sample (x0, x1) (3). The resulting path is a sample from P⋆ t (Léonard, 2013; Chen et al., 2021b). In other words, P⋆ t is a mixture of scaled Brownian bridges, with the mixing weight given by π⋆. t from π⋆: SDE representation. Another characteriza- P⋆ tion of P⋆ t is that it is itself given by an SDE of the form (Léonard, 2013; Chen et al., 2021b) ∼ dXt = g2 t bt(Xt) dt + gt dWt. (5) Here, bt : Rd → we wish to learn. Rd is a time-dependent drift function that Now, by Doob's h-transform, we know that the SDE (5) conditioned to start at x0 and end at x1 is given by another SDE (Doob, 1984; Rogers and Williams, 2000): dXt = g2 t [bt(Xt) + ∇ log ht(Xt)] dt + gt dWt (6) Xt = x) is the Doob's h where ht(x) := P(X1 = x1| function. Notice that we have suppressed the dependence of ht on x0 and x1 for notational simplicity. Loss function. Since both (3) and (6) represent P⋆ t , the solution of the DSBs, the two SDEs must coincide. In other words, suppose we parametrize bt as bθ t , then, by matching terms in (3) and (6), we can learn the optimal parameter θ⋆ via optimization of the loss function L(θ) := E 1 x1 − β1 − 0 (cid:13) (cid:13) (cid:13) t depends on bθ (cid:13) (cid:34)(cid:90) 2 (cid:13) (cid:13) (cid:13) (cid:13) where hθ t as well as the drawn samples (x0, x1). This is the case since ht is defined as an expec- tation using trajectories sampled under bθ t with given end- points. Therefore, assuming that, for each θ, we can compute t based only on bθ hθ t , we can then backprop through (7) and optimize it using any off-the-shelf algorithm. A slightly modified (7). Even with infinite data and a neural network with sufficient capacity, the loss function defined in (7) does not converge to 0. For the purpose of numerical stability, we instead propose to modify (7) to: L(θ) := E 1 x1 − β1 − Xt βt − bθ t + log hθ t (Xt) ∇ 2 dt (cid:34)(cid:90) 0 (cid:13) (cid:13) (cid:13) (cid:13) (cid:35) (cid:0) (8) which is clearly equivalent to (7) at the true solution of bt. Notice that (8) bears a similar form as the popular score- matching objective employed in previous works (Song and Ermon, 2019; Song et al., 2021): (cid:13) (cid:13) (cid:13) (cid:13) (cid:1) 0, xi 1)N i=1, learning rates γθ, γφ, Algorithm 1 SBALIGN Input: Aligned data (xi number of iterations K Initialize θ θ0, φ for k = 1 to K do ← φ0. ← Draw a mini-batch of samples from (xi Compute empirical average of (12) with mini-batch. Update φ L(θ, φ) Update θ L(θ, φ) 0, xi 1)N φ θ i=1 γφ∇ γθ∇ − − ← ← end for where the term x1−Xt β1−βt log hθ bθ t + t (Xt) is akin to log p(xt| corresponds to sθ(Xt, t). ∇ ∇ (cid:0) (cid:1) Computing hθ t . Inspecting ht in (6), we see that, given (x0, x1), it can be written as the conditional expectation of an indicator function: x0), while (10) Xt = x 1{x1} | (cid:2) Xt = x) = E ht(x) = P(X1 = x1| where the expectation is over (5). Functions of the form (10) lend itself well to computation since it solves simulating the unconditioned paths. Furthermore, in order to avoid overfitting on the given samples, it is customary to replace the "hard" constraint 1{x1} by its smoothed version (Zhang and Chen, 2022; Holdijk et al., 2022): (cid:3) ht,τ (x) := E (cid:20) exp − (cid:18) 1 2τ ∥ 2 X1 − x1∥ Xt = x | . (cid:21) (cid:19) (11) Although the computation of (11) can be done via a stan- dard application of the Feynman–Kac formula (Rogers and Williams, 2000), an altogether easier approach is to parametrize ht,τ by a second neural network mφ and per- t and mφ. This form alternating minimization steps on bθ choice reduces the variance in training, since it avoids the sampling of unconditional paths described by (5) (see §A.1 for a detailed explanation). ∇ → Regularization. Since it is well-known that log ht typi- cally explodes when t 1 (Liu et al., 2023), it is important to regularize the behavior of mφ for numerical stability, especially when t 1. Moreover, in practice, it is desir- → able to learn a drift bθ t that respects the data alignment in expectation: If (x0, x1) is an input pair, then multiple runs of the SDE (5) starting from x0 should, on average, produce samples that are in the proximity of x1. This observation im- plies that we should search for drifts whose corresponding h-transforms are diminishing. Xt βt − ∇ log hθ t (Xt) (7) dt (cid:35) Here, τ is a regularization parameter that controls how much we "soften" the constraint, and we have limτ →0 ht,τ = ht. 1 L(θ) := E 0 (cid:20)(cid:90) log p(xt| x0) ∇ − sθ(Xt, t) 2 (cid:13) (cid:13) (cid:13) (cid:13) (9) dt , (cid:21) A simple way to simultaneously achieve the above two requirements is to add an l2-regularization term, resulting Figure 2: Experimental results on the Moon dataset (a-c) and T-dataset (d-f). The top row shows the trajectory sampled using the learned drift, and the bottom row shows the matching based on the learnt drift. Compared to other baselines, SBALIGN is able to learn an appropriate drift respecting the true alignment. (f) further showcases the utility of SBALIGN's learnt drift as a suitable reference process to improve other training methods. in the loss function: 1 L(θ, φ) := E (cid:34) (cid:90) 0 (cid:13) (cid:13) (cid:13) (cid:13) x1 − β1 − Xt βt − 2 t + mφ(Xt) bθ (12) (cid:0) + λt∥ mφ(xt) ∥ (cid:13) (cid:13) (cid:1) (cid:13) (cid:13) 2 dt (cid:35) where λt can either be constant or vary with time. The overall algorithm is depicted in Algorithm 1. 3.2 PAIRED SCHRÖDINGER BRIDGES AS PRIOR PROCESSES Our algorithm finds solutions to SBs on aligned data by rely- ing on samples drawn from the (optimal) coupling π⋆. This is what differentiates it from classical SBs –which instead only consider samples from ˆP0 and ˆP1– and plays a critical role in avoiding IPF-like iterates. However, SBALIGN re- liance on samples from π⋆ may become a limitation, when the available information on alignments is insufficient. If the number of pairings is limited, it is unrealistic to hope for an accurate solution to the aligned SB problem. However, the interpolation between ˆP0 and ˆP1 learned by SBALIGN can potentially be leveraged as a starting point to obtain a better reference process, which can then be used when solv- ing a classical SB on the same marginals. In other words, the drift baligned (Xt) learned through SBALIGN can be used as t is to construct a data-informed alternative ̃Q to the standard Brownian motion, defined by paths: marginals learned by SBALIGN ( ̃Q01) is, in general, closer to the truth than Q01. Improving reference processes through pre-training or data- dependent initialization has been previously considered in the literature. For instance, both De Bortoli et al. (2021) and Chen et al. (2022a) use a pre-trained reference process for challenging image interpolation tasks. This approach, however, relies on DSBs trained using the classical score- based generative modeling objective between a Gaussian and the data distribution. It, therefore, pre-trains the ref- erence process on a related –but different– process, i.e., the one mapping Gaussian noise to data rather than ˆP0 to ˆP1. An alternative, proposed by Bunne et al. (2023) draws on the closed-form solution of SBs between two Gaussian distributions, which are chosen to approximate ˆP0 and ˆP1, respectively. Unlike our method, these alternatives construct prior drifts by falling back to simpler and related tasks, or approximations of the original problem. We instead propose to shape a coarse-grained description of the drift based on alignments sampled directly from π⋆ 01. 4 EXPERIMENTS In this section, we evaluate SBALIGN in different settings involving 2-dimensional synthetic datasets, the task of re- constructing cellular differentiation processes, as well as predicting the conformation of a protein structure and its ligand formalized as rigid protein docking problem. ̃Xt = baligned t ( ̃Xt)dt + gtdWt 4.1 SYNTHETIC EXPERIMENTS Intuitively, solving a standard SB problem with ̃Q as ref- erence is beneficial because the (imperfect) coupling of We run our algorithm on two synthetic datasets (Figures in § B), and compare the results with classic diffusion Figure 3: Cell differentiation trajectories based on (a) the ground truth and (b-d) learned drifts. SBALIGN is able to learn an appropriate drift underlying the true differentiation process while respecting the alignment. (d) Using the learned drift from SBALIGN as a reference process helps improve the drift learned by other training methods. Schrödinger bridge models, i.e., the forward-backward SB formulation proposed by Chen et al. (2022a), herein referred to as FBSB. We equip the baseline with prior knowledge, as elaborated below, to further challenge SBALIGN. Moon dataset. The first synthetic dataset (Fig. 2a-c) con- sists of two distributions, each supported on two semi-circles (ˆP0 drawn in blue and ˆP1 in red). ˆP1 was obtained from ˆP0 by applying a clockwise rotation around the center, i.e., by making points in the upper blue arm correspond to those in the right red one. This transformation is clearly not the most likely one under the assumption of Brownian motion of particles and should therefore not be found as the solution of a classical SB problem. This is confirmed by FBSB tra- jectories (Fig. 2a), which tend to map points to their closest neighbor in ˆP1 (e.g., some points in the upper arm of ˆP0 are brought towards the left rather than towards the right). While being a minimizer of (SB), such a solution completely disregards our prior knowledge on the alignment of parti- cles, which is instead reliably reproduced by the dynamics learned by SBALIGN (Fig. 2c). One way of encoding this additional information on the nature of the process is to modify Qt by introducing a clock- wise radial drift, which describes the prior tangential veloc- ity of particles moving circularly around the center. Solving the classical SB with this updated reference process indeed generates trajectories that respect most alignments (Fig. 2b), but requires a hand-crafted expression of the drift that is only possible in very simple cases. T dataset. In most real-world applications, it is very dif- ficult to define an appropriate reference process Qt, which respects the known alignment without excessively distorting the trajectories from a solution to (SB). This is already visi- ble in simple examples like (Fig. 2d-f), in which the value of good candidate prior drifts at a specific location needs to vary wildly in time. In this dataset, ˆP0 and ˆP1 are both bi-modal distributions, each supported on two of the four extremes of an imaginary T-shaped area. We target align- ments that connect the two arms of the T as well as the top cloud with the bottom one. We succeed in learning them with SBALIGN (Fig. 2e) but unsurprisingly fail when using the baseline FBSB (Fig. 2d) with a Brownian motion prior. take into account In this case, however, attempts at designing a better the reference drift for FBSB must additional constraint that the horizontal and vertical particle trajectories intersect (see Fig. 2e), i.e., they cross the same area at times th and tv (with th > tv). This implies that the drift bt, which initially points downwards (when t < tv), should swiftly turn rightwards (for t > th). Setting imprecise values for one of th and tv when defining custom reference drifts for classical SBs would hence not lead to the desired result and, worse, would actively disturb the flow of the other particle group. As described in § 3.2, in presence of hard-to-capture require- ments on the reference drift, the use of SBALIGN offers a remarkably easy and efficient way of learning a parameter- ization of it. For instance, when using the drift obtained by SBALIGN as reference drift for the computation of the SB baseline (FBSB), we find the desired alignments (Fig. 2f). Figure 4: Cell type prediction on the differentiation dataset. All distributions are plotted on the first two principal components. a-b: Ground truth cell types on day 2 and day 4 respectively. c-d: FBSB and SBALIGN cell type predictions on day 4. SBALIGN is able to better model the underlying differentiation processes and capture the diversity in cell types. 4.2 CELL DIFFERENTIATION Biological processes are determined through heterogeneous responses of single cells to external stimuli, i.e., develop- mental factors or drugs. Understanding and predicting the dynamics of single cells subject to a stimulus is thus crucial to enhance our understanding of health and disease and the focus of this task. Most single-cell high-throughput technologies are destructive assays -i.e., they destroy cells upon measurement- allowing us to only measure unaligned snapshots of the evolving cell population. Recent methods address this limitation by proposing (lower-throughput) technologies that keep cells alive after transcriptome profil- ing (Chen et al., 2022b) or that genetically tag cells to obtain a clonal trace upon cell division (Weinreb et al., 2020). Dataset. To showcase SBALIGN's ability to make use of such (partial) alignments when inferring cell differentiation processes, we take advantage of the genetic barcoding sys- tem developed by Weinreb et al. (2020). With a focus on fate determination in hematopoiesis, Weinreb et al. (2020) use expressed DNA barcodes to clonally trace single-cell transcriptomes over time. The dataset consists of two snap- shots: the first, recorded on day 2, when most cells are still undifferentiated (see Fig. 4a), and a second, on day 4, comprising many different mature cell types (see Fig. 4b). Using SBALIGN as well as the baseline FSSB, we attempt to reconstruct cell evolution between day 2 and day 4, all while capturing the heterogeneity of emerging cell types. For details on the dataset, see § B. Baselines. We benchmark SBALIGN against previous DSBs such as (Chen et al., 2022a, FBSB). Beyond, we compare SBALIGN in the setting of learning a prior reference process. Naturally, cell division processes and subsequently the propagation of the barcodes are very noisy. While this genetic annotation provides some form of assignment, it does not capture the full developmental process. We thus test SBALIGN in a setting where it learns a prior from such partial alignments and, plugged into FBSB, is fine-tuned on the full dataset. Table 1: Cell differentiation prediction results. Means and standard deviations (in parentheses) of distributional met- rics (maximum-mean-discrepancy (MMD), Wε), alignment- based metrics (l2, RMSD), and cell type classification accu- racy. Methods FBSB MMD ↓ 1.55e-2 (0.03e-2) FBSB with SBALIGN 5.31e-3 (0.25e-3) SBALIGN 1.07e-2 (0.01e-2) Cell Differentiation Wε ↓ 12.50 (0.04) 10.54 (0.08) 11.11 (0.02) l2(PS) ↓ 4.08 (0.04) 0.99 (0.12) 1.24 (0.02) RMSD ↓ 9.64e-1 (0.02e-1) 9.85e-1 (0.07e-1) 9.21e-1 (0.01e-1) Class. Acc. ↑ 56.2% (0.7%) 47.0% (1.5%) 56.3% (0.7%) Evaluation metrics. To assess the performance of SBALIGN and the baselines, we monitor several metrics, which include distributional distances, i.e., MMD (Gret- ton et al., 2012) and Wε (Cuturi, 2013), as well as average (perturbation scores), i.e., l2(PS) (Bunne et al., 2022a) and RMSD. Moreover, we also train a simple neural network- based classifier to annotate the cell type on day 4 and we report the accuracy of the predicted vs. actual cell type for all the models. See § C.1 for further details. Results. SBALIGN finds matching between cell states on days 2 and 4 (Fig. 3c, bottom) which resemble the observed ones (Fig. 3a) but also reconstructs the entire evolution path of transcriptomic profiles (Fig. 3c, top). It outperforms the baseline FBSB (Table 1) in all metrics: Remarkably, our method exceeds the performances of the baseline also on distributional metrics and not uniquely on alignment-based ones. We also leverage SBALIGN predictions to recover the type of cells at the end of the differentiation process (Fig. 4d). We do that by training a classifier on differenti- ated cells observed on day 4, and subsequently classify our predictions. While capturing the overall differentiation trend, SBALIGN (as well as FBSB) struggles to isolate rare cell types. Lastly, we employ SBALIGN to learn a prior process from noisy alignments based on genetic barcode annotations. When using this reference process within FBSB, we learn an SB which compensates for inaccuracies stemming from the stochastic nature of cell division and barcode redistribution and which achieves better scores on distributional metrics (see Tab. 1). Further results can be found in § A. Table 2: Conformational changes results. RMSD between predicted and true structures in the bound state. The first term in the parentheses refers to the number of poses sam- pled, and the second term refers to the simulation steps for the trajectory. 4.3 PROTEIN DOCKING Proteins are dynamic, flexible biomolecules that form com- plexes upon interaction with other biomolecules. This is a central step in many biological processes, namely sig- nal transduction, DNA replication, and repair. The forma- tion of complexes is guided by appropriate energetics, best orienting the participating proteins relative to each other, along with a dynamic alteration in structure (conformational changes) to form a stable complex. Understanding the mechanistic principles governing this process is thus a central problem in biology, with the goal of engineering protein interactions to achieve a desired func- tional or therapeutic response. In (computational) protein docking, the goal is to predict the 3D structure of the bound (docked) state of a protein pair, given the unbound states of the corresponding proteins. These proteins are denoted (arbitrarily) as the ligand and receptor respectively. A comprehensive treatment of the protein docking prob- lem is still elusive, owing to the lack of high-quality large datasets comprising 3D structures of participating proteins in the unbound and bound states. We tackle, instead, two related subproblems: (i) the prediction of conformational changes between unbound and bound states of proteins and (ii) the identification of the best orientation between inter- acting proteins, modelled as rigid bodies. This separation into related subproblems was also adopted in (Dominguez et al., 2003), one of the earliest works for the full protein docking problem. 4.3.1 Conformational Changes in Proteins This task involves modeling the conformational changes between the unbound and bound states of proteins. More formally, given the 3D structure of an unbound protein, we predict its 3D structure in the bound state. While it is possible to frame this problem as a (conditional) point cloud translation, an approach using Schrödinger bridges is more natural since it leverages the dynamic and flexible nature of proteins and accounts for the underlying stochasticity in the conformational change process. Dataset. The task of modeling conformational changes starting from a given protein structure is largely unexplored, mainly due to the lack of high-quality large datasets. Here we utilize the recently proposed D3PM dataset (Peng et al., 2022) that provides protein structures before (apo) and after (holo) binding, covering various types of protein motions. The dataset was generated by filtering examples from the D3PM Test Set RMSD (Å) % RMSD (Å) < τ Methods Median Mean Std τ = 2 τ = 5 τ = 10 EGNN SBALIGN (10, 10) SBALIGN (10, 100) 19.99 3.80 3.81 21.37 4.98 5.02 8.21 3.95 3.96 1% 0% 0% 1% 69% 70% 3% 93% 93% Protein Data Bank (PDB) corresponding to the same protein but bound to different biomolecules, with additional quality control criteria. For the scope of this work, we only focus on protein pairs where the provided Root Mean Square De- viation (RMSD) of the Cα carbon atoms between unbound and bound 3D structures is > 3.0Å, which amounts to 2370 examples in the D3PM dataset. For each pair of structures, we first identify common residues, and compute the RMSD between Cα carbon atoms of the common residues after superimposing them using the Kabsch (Kabsch, 1976) algorithm, and only accept the struc- ture if the computed Cα RMSD is within a certain margin of the provided Cα RMSD. The rationale behind this step is to only retain examples where we can reconstruct the RMSD values provided with the dataset. The above preprocessing steps give us a dataset with 1591 examples, which is then di- vided into a train/valid/test split of 1291/150/150 examples respectively. More details in § B.3.1. Baselines. Since the goal of the task is to predict 3D struc- tures, our model must satisfy the relevant SE(3) symme- tries of rotation and translations. To this end, we evaluate SBALIGN against the EGNN model (Satorras et al., 2021), which satisfies the SE(3) symmetries and is a popular ar- chitecture used in many point-cloud transformation tasks (Satorras et al., 2021; Hoogeboom et al., 2022). In particular, we consider the variant of the EGNN model proposed in Xu et al. (2022), owing to its strong performance on the molecule conformer generation task. Results. To evaluate our model, we report (Table 2) sum- mary statistics of the RMSD between the Cα carbon atoms of the predicted structure and the ground truth, and the frac- tion of predictions with RMSD values < 2.0, 5.0 and 10.0Å. SBALIGN outperforms EGNN by a large margin and is able to predict almost 70% examples with an RMSD< 5Å. One of the drawbacks attributed to diffusion models is their slow sampling speed, owing to multiple function calls to a neural network. Remarkably, our model is able to achieve impressive performance with just 10 steps of simulation. We leave it to future work to explore the tradeoff between sampling speed and quality (as measured by RMSD) of the predicted conformations. Figure 5: Ground truth and predicted bound structures for the complex with PDB ID: 1QA9. SBALIGN is able to find the true binding interface compared to EQUIDOCK. 4.3.2 Rigid Protein Docking Experimental setup. Our setup follows a similar conven- tion as EQUIDOCK (Ganea et al., 2022). To summarize, the unbound structure of the ligand is derived by applying a random rotation and translation to the corresponding bound structure, while the receptor is held fixed w.l.o.g. Apply- ing a different rotation and translation to each ligand can however result in a different Brownian bridge for each com- plex, resulting in limited meaningful signal for learning bθ t . To avoid this, we sample a rotation and translation at the start of training and apply the same rotation and transla- tion to all complexes across training, validation, and testing. Additional details regarding this setup can be found in § B. Dataset. For our empirical evaluation, we use the DB5.5 dataset (Vreven et al., 2015) which is a standard choice for protein-protein docking but contains only 253 complexes. We utilize the same splits as EquiDock (Ganea et al., 2022), with 203 complexes in the training set, 25 complexes in the validation set, and 25 complexes in the test set. For the evaluation in Table 3, we use the full DB5.5 test set. For lig- ands in the test set, we generate the corresponding unbound versions by applying the rotation and translation sampled during training. We compare our method to the GNN-based model EQUIDOCK as well as traditional docking software, see § A.2 for details. Evaluation metrics. We report two metrics, complex root mean square deviation (Complex RMSD), and interface root mean square deviation (Interface RMSD). Following (Ganea et al., 2022), the ground truth and predicted complex structures are first superimposed using the Kabsch algorithm (Kabsch, 1976), and the Complex RMSD is then computed between the superimposed versions. A similar procedure is used for computing Interface RMSD, but only using the residues from the two proteins that are within 8 Å of each other. More details in § C.1. Results. SBALIGN considerably outperforms EQUIDOCK across all metrics (Table 3). Our method also achieves com- parable or better performance than traditional docking soft- ware without relying on extensive candidate sampling and re-ranking or learning surface templates from parts of the Table 3: Rigid docking results. Complex and interface RMSD between predicted and true bound structures (after Kabsch alignment). Comparison with values reported in (Ganea et al., 2022) can be found in § A.2. DB5.5 Test Set Complex RMSD Interface RMSD Methods Median Mean Std Median Mean Std EQUIDOCK SBALIGN 14.12 6.59 14.73 6.69 5.31 2.04 11.97 7.69 13.23 8.11 4.93 2.39 current test set. An example of docked structures, in direct comparison with EQUIDOCK is displayed Fig. 5. Further visualizations and results can be found in § A. Future outlook. In this section, we presented a proof of concept application of SBALIGN for the subproblems asso- ciated with the protein docking task. While SBALIGN pro- vides a principled method to model conformational changes between unbound and bound states of a protein, our setup for rigid protein docking is limited by utilizing the same rotation and translation across training and testing. A com- bination of SBALIGN for conformational change modeling, with more recent methods for rigid-protein docking (Ketata et al., 2023) can provide a complete solution for the protein docking task, which we leave to future work. 5 CONCLUSION In this paper, we propose a new framework to tackle the in- terpolation task with aligned data via diffusion Schrödinger bridges. Our central contribution is a novel algorithmic framework derived from the Schrödinger bridge theory and Doob's h-transform. Via a combination of the two notions, we derive novel loss functions which, unlike all prior meth- ods for solving diffusion Schrödinger bridges, do not rely on the iterative proportional fitting procedure and are hence numerically stable. We verify our proposed algorithm on var- ious synthetic and real-world tasks and demonstrate notice- able improvement over the previous state-of-the-art, thereby substantiating the claim that data alignment is a highly rele- vant feature that warrants further research. a.b.c.Ours<latexit sha1_base64="ncqBZX3RvHF0BLtPQM8+HugCJjg=">AAAB+XicbVBNS8NAEN3Ur1q/oh69BIvgqSTi17HoxWNF+wFtKJvtpF262YTdSbGE/hMvHhTx6j/x5r9x2+agrQ8GHu/NMDMvSATX6LrfVmFldW19o7hZ2tre2d2z9w8aOk4VgzqLRaxaAdUguIQ6chTQShTQKBDQDIa3U785AqV5LB9xnIAf0b7kIWcUjdS17Q7CE2qWPdxQwfty0rXLbsWdwVkmXk7KJEeta391ejFLI5DIBNW67bkJ+hlVyJmASamTakgoG9I+tA2VNALtZ7PLJ86JUXpOGCtTEp2Z+nsio5HW4ygwnRHFgV70puJ/XjvF8NrPuExSBMnmi8JUOBg70xicHlfAUIwNoUxxc6vDBlRRhiaskgnBW3x5mTTOKt5l5eL+vFx18ziK5Igck1PikStSJXekRuqEkRF5Jq/kzcqsF+vd+pi3Fqx85pD8gfX5A/LIk9I=</latexit>SBalign<latexit sha1_base64="Kx43XlhmoZrtBiPKmTwo6QauJ1E=">AAAB+nicbVDLSsNAFJ3UV62vVJduBovgqiTia1l8gMsK9gFtKJPppB06mcSZG7XEfoobF4q49Uvc+TdO2yy09cCFwzn3cu89fiy4Bsf5tnILi0vLK/nVwtr6xuaWXdyu6yhRlNVoJCLV9IlmgktWAw6CNWPFSOgL1vAHF2O/cc+U5pG8hWHMvJD0JA84JWCkjl1sA3sETdOru4RfRnQw6tglp+xMgOeJm5ESylDt2F/tbkSTkEmggmjdcp0YvJQo4FSwUaGdaBYTOiA91jJUkpBpL52cPsL7RuniIFKmJOCJ+nsiJaHWw9A3nSGBvp71xuJ/XiuB4MxLuYwTYJJOFwWJwBDhcQ64yxWjIIaGEKq4uRXTPlGEgkmrYEJwZ1+eJ/XDsntSPr45KlXOszjyaBftoQPkolNUQdeoimqIogf0jF7Rm/VkvVjv1se0NWdlMzvoD6zPH9XjlGM=</latexit>EquiDockGaneaet al., (2022)Ground Truth1QA9 ACKNOWLEDGEMENTS This publication was supported by the NCCR Catalysis (grant number 180544), a National Centre of Competence in Research funded by the Swiss National Science Foundation as well as the European Union's Horizon 2020 research and innovation programme 826121. We thank Caroline Uhler for introducing us to the dataset by Weinreb et al. (2020), which was instrumental in this research. References Frostig, James Bradbury, Roy 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. Charlotte Bunne, Stefan G Stark, Gabriele Gut, Jacobo Sara- bia del Castillo, Kjong-Van Lehmann, Lucas Pelkmans, Andreas Krause, and Gunnar Ratsch. Learning Single- Cell Perturbation Responses using Neural Optimal Trans- port. bioRxiv, 2021. Charlotte Bunne, Andreas Krause, and Marco Cuturi. Super- vised Training of Conditional Monge Maps. In Advances in Neural Information Processing Systems (NeurIPS), 2022a. Charlotte Bunne, Laetitia Meng-Papaxanthos, Andreas Krause, and Marco Cuturi. Proximal Optimal Transport Modeling of Population Dynamics. In International Con- ference on Artificial Intelligence and Statistics (AISTATS), volume 25, 2022b. Charlotte Bunne, Ya-Ping Hsieh, Marci Cuturi, and Andreas Krause. The Schrödinger Bridge between Gaussian Mea- sures has a Closed Form. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2023. Tianrong Chen, Guan-Horng Liu, and Evangelos A Theodorou. Likelihood Training of Schrödinger Bridge using Forward-Backward SDEs Theory. In International Conference on Learning Representations (ICLR), 2022a. Wanze Chen, Orane Guillaume-Gentil, Pernille Yde Rainer, Christoph G Gäbelein, Wouter Saelens, Vincent Gardeux, Amanda Klaeger, Riccardo Dainese, Magda Zachara, Tomaso Zambelli, et al. Live-seq enables temporal tran- scriptomic recording of single cells. Nature, 608, 2022b. Yongxin Chen, Tryphon T Georgiou, and Michele Pavon. Optimal Transport in Systems and Control. Annual Re- view of Control, Robotics, and Autonomous Systems, 4, 2021a. Yongxin Chen, Tryphon T Georgiou, and Michele Pavon. Stochastic Control Liaisons: Richard Sinkhorn Meets Gaspard Monge on a Schrödinger Bridge. SIAM Review, 63(2), 2021b. Gabriele Corso, Hannes Stärk, Bowen Jing, Regina Barzilay, and Tommi Jaakkola. Diffusion Steps, Twists, and Turns for Molecular Docking. In International Conference on Learning Representations (ICLR), 2023. Marco Cuturi. Sinkhorn Distances: Lightspeed Computation of Optimal Transport. In Advances in Neural Information Processing Systems (NeurIPS), volume 26, 2013. Marco Cuturi, Laetitia Meng-Papaxanthos, Yingtao Tian, Charlotte Bunne, Geoff Davis, and Olivier Teboul. Opti- mal Transport Tools (OTT): A JAX Toolbox for all things Wasserstein. arXiv Preprint arXiv:2201.12324, 2022. Valentin De Bortoli, James Thornton, Jeremy Heng, and Ar- naud Doucet. Diffusion Schrödinger Bridge with Applica- tions to Score-Based Generative Modeling. In Advances in Neural Information Processing Systems (NeurIPS), vol- ume 35, 2021. Sjoerd J de Vries, Christina EM Schindler, Isaure Chauvot de Beauchêne, and Martin Zacharias. A Web Interface for Easy Flexible Protein-Protein Docking with ATTRACT. Biophysical Journal, 108(3), 2015. Israel T Desta, Kathryn A Porter, Bing Xia, Dima Kozakov, and Sandor Vajda. Performance and Its Limits in Rigid Body Protein-Protein Docking. Structure, 28(9), 2020. Cyril Dominguez, Rolf Boelens, and Alexandre MJJ Bonvin. Haddock: a protein- protein docking approach based on biochemical or biophysical information. Journal of the American Chemical Society, 125(7):1731–1737, 2003. Joseph Doob. Classical Potential Theory and Its Probabilis- tic Counterpart, volume 549. Springer, 1984. Mike Fisher, Jorge Nocedal, Yannick Trémolet, and Stephen J Wright. Data assimilation in weather fore- casting: a case study in PDE-constrained optimization. Optimization and Engineering, 10(3), 2009. Robert Fortet. Résolution d'un systeme d'équations de M. Schrödinger. J. Math. Pure Appl. IX, 1, 1940. Octavian-Eugen Ganea, Xinyuan Huang, Charlotte Bunne, Yatao Bian, Regina Barzilay, Tommi S. Jaakkola, and Andreas Krause. Independent SE(3)-Equivariant Models for End-to-End Rigid Protein Docking. In International Conference on Learning Representations (ICLR), 2022. Mario Geiger and Tess Smidt. e3nn: Euclidean neural net- works. arXiv preprint arXiv:2207.09453, 2022. Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bern- hard Schölkopf, and Alexander Smola. A Kernel Two- Sample Test. Journal of Machine Learning Research, 13, 2012. Xingchao Liu, Lemeng Wu, Mao Ye, and qiang Liu. Learn- ing Diffusion Bridges on Constrained Domains. Interna- tional Conference on Learning Representations (ICLR), 2023. Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising Diffusion Probabilistic Models. In Advances in Neural Information Processing Systems (NeurIPS), 2020. Mohammad Lotfollahi, F Alexander Wolf, and Fabian J Theis. scGen predicts single-cell perturbation responses. Nature Methods, 16(8), 2019. Lars Holdijk, Yuanqi Du, Ferry Hooft, Priyank Jaini, Bernd Ensing, and Max Welling. Path Integral Stochastic Opti- mal Control for Sampling Transition Paths. arXiv preprint arXiv:2207.02149, 2022. Emiel Hoogeboom, Vıctor Garcia Satorras, Clément Vignac, and Max Welling. Equivariant diffusion for molecule generation in 3d. In International Conference on Machine Learning, pages 8867–8887. PMLR, 2022. Wolfgang Kabsch. A solution for the best rotation to relate two sets of vectors. Acta Crystallographica Section A: Crystal Physics, Diffraction, Theoretical and General Crystallography, 32(5), 1976. Mohamed Amine Ketata, Cedrik Laue, Ruslan Mammadov, Hannes Stärk, Menghua Wu, Gabriele Corso, Céline Mar- quet, Regina Barzilay, and Tommi S Jaakkola. Diffdock- pp: Rigid protein-protein docking with diffusion models. arXiv preprint arXiv:2304.03889, 2023. Dima Kozakov, David R Hall, Bing Xia, Kathryn A Porter, Dzmitry Padhorny, Christine Yueh, Dmitri Beglov, and Sandor Vajda. The ClusPro web server for protein– protein docking. Nature Protocols, 12(2), 2017. Solomon Kullback. Probability densities with given marginals. The Annals of Mathematical Statistics, 39 (4):1236–1243, 1968. Christian Léonard. A survey of the Schrödinger problem and some of its connections with optimal transport. arXiv preprint arXiv:1308.0215, 2013. Richard Liaw, Eric Liang, Robert Nishihara, Philipp Moritz, Joseph E Gonzalez, and Ion Stoica. Tune: A Research Platform for Distributed Model Selection and Training. arXiv preprint arXiv:1807.05118, 2018. Guan-Horng Liu, Tianrong Chen, Oswin So, and Evange- los Theodorou. Deep Generalized Schrödinger Bridge. In Advances in Neural Information Processing Systems (NeurIPS), 2022a. Guan-Horng Liu, Tianrong Chen, Oswin So, and Evange- los A Theodorou. Deep Generalized Schrödinger Bridge. In Advances in Neural Information Processing Systems (NeurIPS), 2022b. Roger Mansuy and Marc Yor. Aspects of Brownian motion. Springer Science & Business Media, 2008. Efrat Mashiach, Dina Schneidman-Duhovny, Aviyah Peri, Yoli Shavit, Ruth Nussinov, and Haim J Wolfson. An integrated suite of fast docking algorithms. Proteins: Structure, Function, and Bioinformatics, 78(15), 2010. Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zem- ing Lin, Natalia Gimelshein, Luca Antiga, Alban Des- maison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chin- tala. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In Advances in Neural Informa- tion Processing Systems (NeurIPS), 2019. Stefano Peluchetti. Diffusion bridge mixture transports, schrödinger bridge problems and generative modeling, 2023. Cheng Peng, Xinben Zhang, Zhijian Xu, Zhaoqiang Chen, Yanqing Yang, Tingting Cai, and Weiliang Zhu. D3pm: a comprehensive database for protein motions ranging from residue to domain. BMC bioinformatics, 23(1):1–11, 2022. Gabriel Peyré and Marco Cuturi. Computational Optimal Transport. Foundations and Trends in Machine Learning, 11(5-6), 2019. L Chris G Rogers and David Williams. Diffusions, Markov Processes and Martingales: Volume 2, Itô Calculus, vol- ume 2. Cambridge University Press, 2000. Victor Garcia Satorras, Emiel Hoogeboom, and Max Welling. E(n)-equivariant graph neural networks. arXiv preprint arXiv:2102.09844, 2021. Moritz Schauer, Frank van der Meulen, and Harry van Zan- ten. Guided proposals for simulating multi-dimensional diffusion bridges. Bernoulli, 23(4A), 2017. Geoffrey Schiebinger, Jian Shu, Marcin Tabaka, Brian Cleary, Vidya Subramanian, Aryeh Solomon, Joshua Gould, Siyan Liu, Stacie Lin, Peter Berube, et al. Optimal- Transport Analysis of Single-Cell Gene Expression Identi- fies Developmental Trajectories in Reprogramming. Cell, 176(4), 2019. Thom Vreven, Iain H Moal, Anna Vangone, Brian G Pierce, Panagiotis L Kastritis, Mieczyslaw Torchala, Raphael Chaleil, Brian Jiménez-García, Paul A Bates, Juan Fernandez-Recio, et al. Updates to the integrated protein–protein interaction benchmarks: docking bench- mark version 5 and affinity benchmark version 2. Journal of Molecular Biology, 427(19), 2015. Caleb Weinreb, Alejo Rodriguez-Fraticelli, Fernando D Ca- margo, and Allon M Klein. Lineage tracing on transcrip- tional landscapes links state to fate during differentiation. Science, 367, 2020. F Alexander Wolf, Philipp Angerer, and Fabian J Theis. SCANPY: large-scale single-cell gene expression data analysis. Genome Biology, 19(1), 2018. Minkai Xu, Lantao Yu, Yang Song, Chence Shi, Stefano Ermon, and Jian Tang. Geodiff: A geometric diffusion model for molecular conformation generation. In Inter- national Conference on Learning Representations, 2022. Yumeng Yan, Huanyu Tao, Jiahua He, and Sheng-You Huang. The HDOCK server for integrated protein– protein docking. Nature Protocols, 15(5), 2020. Qinsheng Zhang and Yongxin Chen. Path Integral Sampler: A Stochastic Control Approach For Sampling. In Interna- tional Conference on Learning Representations (ICLR), 2022. Christina EM Schindler, Isaure Chauvot de Beauchêne, Sjo- erd J de Vries, and Martin Zacharias. Protein-protein and peptide-protein docking and refinement using AT- TRACT in CAPRI. Proteins: Structure, Function, and Bioinformatics, 85(3):391–398, 2017. Dina Schneidman-Duhovny, Yuval Inbar, Ruth Nussinov, and Haim J Wolfson. PatchDock and SymmDock: servers for rigid and symmetric docking. Nucleic Acids Research, 33, 2005. Erwin Schrödinger. Über die Umkehrung der Naturgesetze. Verlag der Akademie der Wissenschaften in Kommission bei Walter De Gruyter u. Company, 1931. Yang Song and Stefano Ermon. Generative Modeling by Es- timating Gradients of the Data Distribution. In Advances in Neural Information Processing Systems (NeurIPS), 2019. Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Ab- hishek Kumar, Stefano Ermon, and Ben Poole. Score- Based Generative Modeling through Stochastic Differen- tial Equations. In International Conference on Learning Representations (ICLR), volume 9, 2021. Vasileios Stathias, Anna M Jermakowicz, Marie E Mal- oof, Michele Forlin, Winston Walters, Robert K Suter, Michael A Durante, Sion L Williams, J William Harbour, Claude-Henry Volmar, et al. Drug and disease signature integration identifies synergistic combinations in glioblas- toma. Nature Communications, 9(1), 2018. Nathaniel Thomas, Tess Smidt, Steven Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley. Ten- sor field networks: Rotation-and translation-equivariant neural networks for 3d point clouds. arXiv preprint arXiv:1802.08219, 2018. Alexander Tong, Jessie Huang, Guy Wolf, David Van Dijk, and Smita Krishnaswamy. TrajectoryNet: A Dynamic Op- timal Transport Network for Modeling Cellular Dynam- ics. In International Conference on Machine Learning (ICML), 2020. Alexander Tong, Nikolay Malkin, Guillaume Huguet, Yan- lei Zhang, Jarrid Rector-Brooks, Kilian Fatras, Guy Wolf, and Yoshua Bengio. Conditional Flow Match- ing: Simulation-Free Dynamic Optimal Transport. arXiv preprint arXiv:2302.00482, 2023. Tomer Tsaban, Julia K Varga, Orly Avraham, Ziv Ben- Aharon, Alisa Khramushin, and Ora Schueler-Furman. Harnessing protein folding neural networks for peptide- protein docking. Nature Communications, 13(1):176, 2022. Francisco Vargas, Pierre Thodoroff, Neil D Lawrence, and Austen Lamacraft. Solving Schrödinger Bridges via Max- imum Likelihood. Entropy, 23(9), 2021. Aligned Diffusion Schrödinger Bridges (Supplementary Material) Vignesh Ram Somnath∗1,2 Maria Rodriguez Martinez2 Matteo Pariset∗1,3 Andreas Krause1 Ya-Ping Hsieh1 Charlotte Bunne1 1Department of Computer Science, ETH Zürich 2IBM Research Zürich 3Department of Computer Science, EPFL A ADDITIONAL RESULTS A.1 VARIANCE REDUCTION In this paragraph, we elaborate on the need to parametrize also Doob's ht function, along with the drift bt. Introducing mφ removes the need to evaluate (11) which is difficult to approximate in practice on high-dimensional spaces. This equation Xt = x) along amounts, in fact, to a Gaussian Kernel Density Estimation of the conditional probability P(X1 = x1| (unconditional) paths obtained from (5). Faithful approximations of (11) would, therefore, require: • good-quality paths, which are scarce at the beginning of training when the drift bθ • exponentially many trajectories (in the dimension of the state space); t has not yet been learned; • that points x1 (obtained from conditional trajectories, Eq. 6) be reasonably close to x1 (obtained from unconditional trajectories, Eq. 5); Xt = x) would still be challenging to Even if all the above conditions were satisfied, the quantity ht(x) = P(X1 = x1| directly manipulate. It is, in fact, much smaller at earlier times t (see Table 4), since knowledge of the far past has a weaker influence on the location X1 of particles at time t = 1. Precision errors at t 0 would then be amplified when computing log ht) –which appears in the loss (8)– and accumulate over timesteps, eventually leading trajectories the score of ht (i.e, astray. By directly parameterizing the score, we instead sidestep this problem. The magnitude of mφ log ht can, in fact, be more easily controlled and regularized. t ≈ ∇ ∇ ≈ 0 0.15 0.30 Time t 0.45 0.60 0.75 0.90 Mean ht,τ value 2.92e-14 4.03e-13 2.54e-11 1.72e-09 1.47e-07 2.66e-05 8.53e-3 Table 4: Average ht,τ values along paths, at different timesteps. P(X1 = x1| across the time interval and is smallest when t 0. ≈ Xt = x) ranges over 11 orders of magnitude A.2 RIGID PROTEIN DOCKING Baselines. We compare our method to EQUIDOCK as well as traditional docking software including ATTRACT (Schindler et al., 2017; de Vries et al., 2015), HDOCK (Yan et al., 2020), CLUSPRO (Desta et al., 2020; Kozakov et al., 2017), and PATCHDOCK (Mashiach et al., 2010; Schneidman-Duhovny et al., 2005). As mentioned in the paragraph above, for ligands in the test set, we generate the corresponding unbound versions by applying the rotation and translation sampled *Equal contribution. Accepted for the 39th Conference on Uncertainty in Artificial Intelligence (UAI 2023). Table 5: Rigid docking results. Complex and interface RMSD between predicted and true bound structures (after Kabsch alignment). ∗ denotes methods for which we use values directly from (Ganea et al., 2022). All other results show the performance on our test set. DB5.5 Test Set Complex RMSD Interface RMSD Methods ATTRACT∗ HDOCK∗ CLUSPRO∗ PATCHDOCK∗ EQUIDOCK∗ EQUIDOCK SBALIGN Median Mean Std Median Mean Std 9.55 0.30 3.38 18.26 14.13 14.12 6.59 10.09 5.34 8.25 18.00 14.72 14.73 6.69 9.88 12.04 7.92 10.12 5.31 5.31 2.04 7.48 0.24 2.31 18.88 11.97 11.97 7.69 10.69 4.76 8.71 18.75 13.23 13.23 8.11 10.90 10.83 9.89 10.06 4.93 4.93 2.39 during training. We evaluate the trained model from EQUIDOCK and SBALIGN on these unbound structures and report corresponding evaluation metrics. For the remaining baselines, we include the numbers from (Ganea et al., 2022). These baselines typically sample several candidate complexes by considering small increments of rotation angles. We expect this makes them somewhat invariant to arbitrary initialization, and the corresponding docking scores to not be severely impacted. Figure 6: Ground truth and predicted bound structures for the complex with PDB ID: 1NW9. SBALIGN is able to identify the true binding pocket. Results. The model performance is summarized in Table 5. Our method SBALIGN considerably outperforms EQUIDOCK across all metrics. SBALIGN also achieves comparable or better performance than traditional docking software without relying on extensive candidate sampling and re-ranking or learning surface templates from parts of the current test set. An example of docked structures, in direct comparison with EQUIDOCK is displayed Fig. 5. Beyond the results in Table 5, we display the ground truth and docked complexes in Figs. 5, 6, and 7. Figure 7: Ground truth and predicted bound structures for the complex with PDB ID: 1JIW. SBALIGN is able to find the true binding interface compared to EQUIDOCK. a.b.c.Ours<latexit sha1_base64="ncqBZX3RvHF0BLtPQM8+HugCJjg=">AAAB+XicbVBNS8NAEN3Ur1q/oh69BIvgqSTi17HoxWNF+wFtKJvtpF262YTdSbGE/hMvHhTx6j/x5r9x2+agrQ8GHu/NMDMvSATX6LrfVmFldW19o7hZ2tre2d2z9w8aOk4VgzqLRaxaAdUguIQ6chTQShTQKBDQDIa3U785AqV5LB9xnIAf0b7kIWcUjdS17Q7CE2qWPdxQwfty0rXLbsWdwVkmXk7KJEeta391ejFLI5DIBNW67bkJ+hlVyJmASamTakgoG9I+tA2VNALtZ7PLJ86JUXpOGCtTEp2Z+nsio5HW4ygwnRHFgV70puJ/XjvF8NrPuExSBMnmi8JUOBg70xicHlfAUIwNoUxxc6vDBlRRhiaskgnBW3x5mTTOKt5l5eL+vFx18ziK5Igck1PikStSJXekRuqEkRF5Jq/kzcqsF+vd+pi3Fqx85pD8gfX5A/LIk9I=</latexit>SBalign<latexit sha1_base64="Kx43XlhmoZrtBiPKmTwo6QauJ1E=">AAAB+nicbVDLSsNAFJ3UV62vVJduBovgqiTia1l8gMsK9gFtKJPppB06mcSZG7XEfoobF4q49Uvc+TdO2yy09cCFwzn3cu89fiy4Bsf5tnILi0vLK/nVwtr6xuaWXdyu6yhRlNVoJCLV9IlmgktWAw6CNWPFSOgL1vAHF2O/cc+U5pG8hWHMvJD0JA84JWCkjl1sA3sETdOru4RfRnQw6tglp+xMgOeJm5ESylDt2F/tbkSTkEmggmjdcp0YvJQo4FSwUaGdaBYTOiA91jJUkpBpL52cPsL7RuniIFKmJOCJ+nsiJaHWw9A3nSGBvp71xuJ/XiuB4MxLuYwTYJJOFwWJwBDhcQ64yxWjIIaGEKq4uRXTPlGEgkmrYEJwZ1+eJ/XDsntSPr45KlXOszjyaBftoQPkolNUQdeoimqIogf0jF7Rm/VkvVjv1se0NWdlMzvoD6zPH9XjlGM=</latexit>EquiDockGaneaet al., (2022)Ground Truth1NW9a.b.c.Ours<latexit sha1_base64="ncqBZX3RvHF0BLtPQM8+HugCJjg=">AAAB+XicbVBNS8NAEN3Ur1q/oh69BIvgqSTi17HoxWNF+wFtKJvtpF262YTdSbGE/hMvHhTx6j/x5r9x2+agrQ8GHu/NMDMvSATX6LrfVmFldW19o7hZ2tre2d2z9w8aOk4VgzqLRaxaAdUguIQ6chTQShTQKBDQDIa3U785AqV5LB9xnIAf0b7kIWcUjdS17Q7CE2qWPdxQwfty0rXLbsWdwVkmXk7KJEeta391ejFLI5DIBNW67bkJ+hlVyJmASamTakgoG9I+tA2VNALtZ7PLJ86JUXpOGCtTEp2Z+nsio5HW4ygwnRHFgV70puJ/XjvF8NrPuExSBMnmi8JUOBg70xicHlfAUIwNoUxxc6vDBlRRhiaskgnBW3x5mTTOKt5l5eL+vFx18ziK5Igck1PikStSJXekRuqEkRF5Jq/kzcqsF+vd+pi3Fqx85pD8gfX5A/LIk9I=</latexit>SBalign<latexit sha1_base64="Kx43XlhmoZrtBiPKmTwo6QauJ1E=">AAAB+nicbVDLSsNAFJ3UV62vVJduBovgqiTia1l8gMsK9gFtKJPppB06mcSZG7XEfoobF4q49Uvc+TdO2yy09cCFwzn3cu89fiy4Bsf5tnILi0vLK/nVwtr6xuaWXdyu6yhRlNVoJCLV9IlmgktWAw6CNWPFSOgL1vAHF2O/cc+U5pG8hWHMvJD0JA84JWCkjl1sA3sETdOru4RfRnQw6tglp+xMgOeJm5ESylDt2F/tbkSTkEmggmjdcp0YvJQo4FSwUaGdaBYTOiA91jJUkpBpL52cPsL7RuniIFKmJOCJ+nsiJaHWw9A3nSGBvp71xuJ/XiuB4MxLuYwTYJJOFwWJwBDhcQ64yxWjIIaGEKq4uRXTPlGEgkmrYEJwZ1+eJ/XDsntSPr45KlXOszjyaBftoQPkolNUQdeoimqIogf0jF7Rm/VkvVjv1se0NWdlMzvoD6zPH9XjlGM=</latexit>EquiDockGaneaet al., (2022)Ground Truth1JIW B DATASETS B.1 SYNTHETIC DATASETS In the following, we provide further insights and experimental results in order to access the performance of SBALIGN in comparison with different baselines and across tasks of various nature. For each dataset, we describe in detail its origin as well as preprocessing and featurization steps. Figure 8: Initial (blue) and final (red) marginals for the two toy datasets (a) moon and (b) T, together with arrows indicating a few alignments Moon dataset. The moon toy dataset (Fig. 8a) is generated by first sampling ˆP1 and then applying a clockwise rotation of 233◦ around the origin to obtain ˆP0. The points on the two semi-circumferences supporting ˆP1 are initially placed equally-spaced along each semi-circumference and then moved by applying additive Gaussian noise to both coordinates. While classic generative models will choose the shortest path and connect ends of both moons closest in Euclidean distance, only methods equipped with additional knowledge or insight on the intended alignment will be able to solve this task. T dataset. This toy dataset (Fig. 8b) is generated by placing an equal amount of samples at each of the four extremes of a T-shaped area having ratio between x and y dimensions equal to 51/55. If run with a Brownian prior, classical SBs also fail on this dataset because they produce swapped pairings: i.e., they match the left (resp. top) point cloud with the bottom (resp. right) one. At the same time, though, this dataset prevents reference drifts with simple analytical forms (such as spatially-symmetric or time-constant functions) from fixing classical SBs runs. It therefore illustrates the need for general, plug-and-play methods capable of generating approximate reference drifts to use in the computation of classical SBs. B.2 CELL DIFFERENTIATION DATASETS Figure 9: Overview of SBALIGN in the setting of cell differentiation with the goal of learning the evolutionary process that morphs a population from its stat at t to t + 1. Through genetic tagging (i.e., barcodes) we are able to trace progenitor cells at time point t into their descendants t + 1. This provides us with an alignment between populations at consecutive time steps. Our goal is then to recover a stochastic trajectory from x0 to x1. To achieve this, we connect the characterization of a SDE conditioned on x0 and x1 (utilizing the Doob's h-transform) with that of a Brownian bridge between x0 and x1 (classical Schrödinger bridge theory), leading to a simpler training procedure with lower variance and strong empirical results. Source Target a.SpiralDatasetb.T Dataset<latexit sha1_base64="DdaWJy59CKUFSHv/F+jR5J+BhWw=">AAACdXicdVFNa9wwEJWdpE23abtNL4VSULNJ2RDY2iFpeykEcukxhW52Ye2YkVa2RWTZSOPAYja/oL+ut/6NXnqt1ruEfLQDQk/vvWFGM6xS0mIQ/PL8tfWNR483n3Sebj17/qL7cvvclrXhYshLVZoxAyuU1GKIEpUYV0ZAwZQYscvThT66EsbKUn/HWSXiAjItU8kBHZV0f0QFYG6KZjqn4wS/ZAleHEZKpDhhFxHmAiHB9t13cmRkluP+QaSBKaCRKjOa/9e2vGJ6qwQeuAI3xLVjWsxYM5onmHR7wSBogz4E4Qr0yCrOku7PaFryuhAauQJrJ2FQYdyAQcmVmHei2ooK+CVkYuKghkLYuGmnNqd7jpnStDTuaKQtezujgcLaWcGcc9Gjva8tyH9pkxrTz3EjdVWj0HxZKK0VxZIuVkCn0giOauYAcCNdr5TnYICjW1THDSG8/+WH4PxwEH4cHH876p30V+PYJG/IDumTkHwiJ+QrOSNDwslv77X3ztvx/vhv/V3//dLqe6ucV+RO+B/+AqZ8wJg=</latexit>dXt=g2t⇥bθt(Xt)+rloghθt(Xt)⇤dt+gtdWt<latexit sha1_base64="YpfmbF3X8aBDTOsEF6k75AvqTJk=">AAAB83icbVDLSsNAFL2pr1pfVZduBovQVUnE17LgxmUF+4AmlMl00g6dTMI8xBL6G25cKOLWn3Hn3zhps9DWAwOHc+7lnjlhypnSrvvtlNbWNza3ytuVnd29/YPq4VFHJUYS2iYJT2QvxIpyJmhbM81pL5UUxyGn3XBym/vdRyoVS8SDnqY0iPFIsIgRrK3k+zHW4zDKnmYDb1CtuQ13DrRKvILUoEBrUP3yhwkxMRWacKxU33NTHWRYakY4nVV8o2iKyQSPaN9SgWOqgmyeeYbOrDJEUSLtExrN1d8bGY6VmsahncwzqmUvF//z+kZHN0HGRGo0FWRxKDIc6QTlBaAhk5RoPrUEE8lsVkTGWGKibU0VW4K3/OVV0jlveFeNy/uLWrNe1FGGEziFOnhwDU24gxa0gUAKz/AKb45xXpx352MxWnKKnWP4A+fzByXOkbA=</latexit>x1<latexit sha1_base64="Z2837n1hHCfkeAc4nzHrdEnWg/U=">AAAB83icbVDLSsNAFL2pr1pfVZduBovQVUnE17LgxmUF+4AmlMl00g6dTMI8xBL6G25cKOLWn3Hn3zhps9DWAwOHc+7lnjlhypnSrvvtlNbWNza3ytuVnd29/YPq4VFHJUYS2iYJT2QvxIpyJmhbM81pL5UUxyGn3XBym/vdRyoVS8SDnqY0iPFIsIgRrK3k+zHW4zDKnmYDd1CtuQ13DrRKvILUoEBrUP3yhwkxMRWacKxU33NTHWRYakY4nVV8o2iKyQSPaN9SgWOqgmyeeYbOrDJEUSLtExrN1d8bGY6VmsahncwzqmUvF//z+kZHN0HGRGo0FWRxKDIc6QTlBaAhk5RoPrUEE8lsVkTGWGKibU0VW4K3/OVV0jlveFeNy/uLWrNe1FGGEziFOnhwDU24gxa0gUAKz/AKb45xXpx352MxWnKKnWP4A+fzByRKka8=</latexit>x0cell population<latexit sha1_base64="NSkESCA/maxFjF+BKtlPOskhk3I=">AAACUXicbVFJSwMxGP067nWrevQSLIIglpnidhEELx4VrC106pBJM20ws5B8I5Yw/kQPevJ/ePGgmC6C2wchL+99L8tLmEmh0XVfSs7U9Mzs3PxCeXFpeWW1srZ+rdNcMd5gqUxVK6SaS5HwBgqUvJUpTuNQ8mZ4ezbUm3dcaZEmVzjIeCemvUREglG0VFDp+zHFvopNtyCtAE96Ad7UiR8pysxICiNzXwTenhUL44ccqV2MZyzIl/vB2nHXmn8w4w1C0ywCDCpVt+aOivwF3gRUYVIXQeXJ76Ysj3mCTFKt256bYcdQhYJJXpT9XPOMslva420LExpz3TGjRAqybZkuiVJlR4JkxH53GBprPYhD2zm8o/6tDcn/tHaO0XHHiCTLkSdsfFCUS4IpGcZLukJxhnJgAWVK2LsS1qc2TbSfULYheL+f/Bdc12veYe3gcr96ujOJYx42YQt2wIMjOIVzuIAGMHiEV3iHj9Jz6c0Bxxm3OqWJZwN+lLP4CQ9HtbI=</latexit>dXt=g2tx1−Xtβ1−βtdt+gtdWt<latexit sha1_base64="hQtYQvfAHZgGcRO0QL3kuTuLZGo=">AAAB7XicbVDLTgJBEOzFF+IL9ehlIjHhRHaNryOJF4+YyCOBDZkdemFkdmedmSUhhH/w4kFjvPo/3vwbB9iDgpV0UqnqTndXkAiujet+O7m19Y3Nrfx2YWd3b/+geHjU0DJVDOtMCqlaAdUoeIx1w43AVqKQRoHAZjC8nfnNESrNZfxgxgn6Ee3HPOSMGis1OviU8lG3WHIr7hxklXgZKUGGWrf41elJlkYYGyao1m3PTYw/ocpwJnBa6KQaE8qGtI9tS2MaofYn82un5MwqPRJKZSs2ZK7+npjQSOtxFNjOiJqBXvZm4n9eOzXhjT/hcZIajNliUZgKYiSZvU56XCEzYmwJZYrbWwkbUEWZsQEVbAje8surpHFe8a4ql/cXpWo5iyMPJ3AKZfDgGqpwBzWoA4NHeIZXeHOk8+K8Ox+L1pyTzRzDHzifP72pjyw=</latexit>≡Brownian bridgealignment<latexit sha1_base64="+b1YTwNn9fAZs+R6bGCklmbpVJo=">AAAB8HicbVDLSgNBEOz1GeMr6tHLYBA8SNgVX8eAF48RzEOyMcxOZpMhM7vLTK8QlnyFFw+KePVzvPk3TpI9aGJBQ1HVTXdXkEhh0HW/naXlldW19cJGcXNre2e3tLffMHGqGa+zWMa6FVDDpYh4HQVK3ko0pyqQvBkMbyZ+84lrI+LoHkcJ7yjaj0QoGEUrPfiJePQNUt0tld2KOwVZJF5OypCj1i19+b2YpYpHyCQ1pu25CXYyqlEwycdFPzU8oWxI+7xtaUQVN51sevCYHFulR8JY24qQTNXfExlVxoxUYDsVxYGZ9ybif147xfC6k4koSZFHbLYoTCXBmEy+Jz2hOUM5soQyLeythA2opgxtRkUbgjf/8iJpnFW8y8rF3Xm5eprHUYBDOIIT8OAKqnALNagDAwXP8ApvjnZenHfnY9a65OQzB/AHzucP7x+QcQ==</latexit>π?ooffËËoo<latexit sha1_base64="0gFJlNIvw8V2s0Y1XmyaTE/kb3s=">AAAB6HicbVDLSgNBEJz1GeMr6tHLYBA8SNgVX8eAF48JmAckS5id9CZjZmeXmV4hLPkCLx4U8eonefNvnCR70MSChqKqm+6uIJHCoOt+Oyura+sbm4Wt4vbO7t5+6eCwaeJUc2jwWMa6HTADUihooEAJ7UQDiwIJrWB0N/VbT6CNiNUDjhPwIzZQIhScoZXq2CuV3Yo7A10mXk7KJEetV/rq9mOeRqCQS2ZMx3MT9DOmUXAJk2I3NZAwPmID6FiqWATGz2aHTuipVfo0jLUthXSm/p7IWGTMOApsZ8RwaBa9qfif10kxvPUzoZIUQfH5ojCVFGM6/Zr2hQaOcmwJ41rYWykfMs042myKNgRv8eVl0ryoeNeVq/pluXqex1Egx+SEnBGP3JAquSc10iCcAHkmr+TNeXRenHfnY9664uQzR+QPnM8f3MuM7A==</latexit>t<latexit sha1_base64="TiFC/aLIif/46SWVn+wBSHZagqQ=">AAAB6nicbVDLSgNBEOz1GeMr6tHLYBAEJeyKr2PAi8eI5gHJEmYns8mQ2dllplcISz7BiwdFvPpF3vwbJ8keNLGgoajqprsrSKQw6LrfztLyyuraemGjuLm1vbNb2ttvmDjVjNdZLGPdCqjhUiheR4GStxLNaRRI3gyGtxO/+cS1EbF6xFHC/Yj2lQgFo2ilBzz1uqWyW3GnIIvEy0kZctS6pa9OL2ZpxBUySY1pe26CfkY1Cib5uNhJDU8oG9I+b1uqaMSNn01PHZNjq/RIGGtbCslU/T2R0ciYURTYzojiwMx7E/E/r51ieONnQiUpcsVmi8JUEozJ5G/SE5ozlCNLKNPC3krYgGrK0KZTtCF48y8vksZ5xbuqXN5flKtneRwFOIQjOAEPrqEKd1CDOjDowzO8wpsjnRfn3fmYtS45+cwB/IHz+QOzJ41c</latexit>t+1barcode<latexit sha1_base64="ut6IZKJrEflIDCfYbuj6at9z7QU=">AAAB+XicdVDJSgNBEO1xjXEb9eilMQg5DTMx6y3oxWNEs0ASQk+nkzTp6Rm6a4JhyJ948aCIV//Em39jZxFU9EHB470qqur5keAaXPfDWlvf2NzaTu2kd/f2Dw7to+OGDmNFWZ2GIlQtn2gmuGR14CBYK1KMBL5gTX98NfebE6Y0D+UdTCPWDchQ8gGnBIzUs+0OsHvQNLm9JIIP5axnZ1ynkiu6hQp2ndyFWyx5c1IulvIl7DnuAhm0Qq1nv3f6IY0DJoEKonXbcyPoJkQBp4LN0p1Ys4jQMRmytqGSBEx3k8XlM3xulD4ehMqUBLxQv08kJNB6GvimMyAw0r+9ufiX145hUO4mXEYxMEmXiwaxwBDieQy4zxWjIKaGEKq4uRXTEVGEggkrbUL4+hT/Txo5xys6hZt8pppdxZFCp+gMZZGHSqiKrlEN1RFFE/SAntCzlViP1ov1umxds1YzJ+gHrLdPadeUHg==</latexit>SBalign<latexit sha1_base64="YpfmbF3X8aBDTOsEF6k75AvqTJk=">AAAB83icbVDLSsNAFL2pr1pfVZduBovQVUnE17LgxmUF+4AmlMl00g6dTMI8xBL6G25cKOLWn3Hn3zhps9DWAwOHc+7lnjlhypnSrvvtlNbWNza3ytuVnd29/YPq4VFHJUYS2iYJT2QvxIpyJmhbM81pL5UUxyGn3XBym/vdRyoVS8SDnqY0iPFIsIgRrK3k+zHW4zDKnmYDb1CtuQ13DrRKvILUoEBrUP3yhwkxMRWacKxU33NTHWRYakY4nVV8o2iKyQSPaN9SgWOqgmyeeYbOrDJEUSLtExrN1d8bGY6VmsahncwzqmUvF//z+kZHN0HGRGo0FWRxKDIc6QTlBaAhk5RoPrUEE8lsVkTGWGKibU0VW4K3/OVV0jlveFeNy/uLWrNe1FGGEziFOnhwDU24gxa0gUAKz/AKb45xXpx352MxWnKKnWP4A+fzByXOkbA=</latexit><latexit sha1_base64="Z2837n1hHCfkeAc4nzHrdEnWg/U=">AAAB83icbVDLSsNAFL2pr1pfVZduBovQVUnE17LgxmUF+4AmlMl00g6dTMI8xBL6G25cKOLWn3Hn3zhps9DWAwOHc+7lnjlhypnSrvvtlNbWNza3ytuVnd29/YPq4VFHJUYS2iYJT2QvxIpyJmhbM81pL5UUxyGn3XBym/vdRyoVS8SDnqY0iPFIsIgRrK3k+zHW4zDKnmYDd1CtuQ13DrRKvILUoEBrUP3yhwkxMRWacKxU33NTHWRYakY4nVV8o2iKyQSPaN9SgWOqgmyeeYbOrDJEUSLtExrN1d8bGY6VmsahncwzqmUvF//z+kZHN0HGRGo0FWRxKDIc6QTlBaAhk5RoPrUEE8lsVkTGWGKibU0VW4K3/OVV0jlveFeNy/uLWrNe1FGGEziFOnhwDU24gxa0gUAKz/AKb45xXpx352MxWnKKnWP4A+fzByRKka8=</latexit><latexit sha1_base64="hQtYQvfAHZgGcRO0QL3kuTuLZGo=">AAAB7XicbVDLTgJBEOzFF+IL9ehlIjHhRHaNryOJF4+YyCOBDZkdemFkdmedmSUhhH/w4kFjvPo/3vwbB9iDgpV0UqnqTndXkAiujet+O7m19Y3Nrfx2YWd3b/+geHjU0DJVDOtMCqlaAdUoeIx1w43AVqKQRoHAZjC8nfnNESrNZfxgxgn6Ee3HPOSMGis1OviU8lG3WHIr7hxklXgZKUGGWrf41elJlkYYGyao1m3PTYw/ocpwJnBa6KQaE8qGtI9tS2MaofYn82un5MwqPRJKZSs2ZK7+npjQSOtxFNjOiJqBXvZm4n9eOzXhjT/hcZIajNliUZgKYiSZvU56XCEzYmwJZYrbWwkbUEWZsQEVbAje8surpHFe8a4ql/cXpWo5iyMPJ3AKZfDgGqpwBzWoA4NHeIZXeHOk8+K8Ox+L1pyTzRzDHzifP72pjyw=</latexit><latexit sha1_base64="DdaWJy59CKUFSHv/F+jR5J+BhWw=">AAACdXicdVFNa9wwEJWdpE23abtNL4VSULNJ2RDY2iFpeykEcukxhW52Ye2YkVa2RWTZSOPAYja/oL+ut/6NXnqt1ruEfLQDQk/vvWFGM6xS0mIQ/PL8tfWNR483n3Sebj17/qL7cvvclrXhYshLVZoxAyuU1GKIEpUYV0ZAwZQYscvThT66EsbKUn/HWSXiAjItU8kBHZV0f0QFYG6KZjqn4wS/ZAleHEZKpDhhFxHmAiHB9t13cmRkluP+QaSBKaCRKjOa/9e2vGJ6qwQeuAI3xLVjWsxYM5onmHR7wSBogz4E4Qr0yCrOku7PaFryuhAauQJrJ2FQYdyAQcmVmHei2ooK+CVkYuKghkLYuGmnNqd7jpnStDTuaKQtezujgcLaWcGcc9Gjva8tyH9pkxrTz3EjdVWj0HxZKK0VxZIuVkCn0giOauYAcCNdr5TnYICjW1THDSG8/+WH4PxwEH4cHH876p30V+PYJG/IDumTkHwiJ+QrOSNDwslv77X3ztvx/vhv/V3//dLqe6ucV+RO+B/+AqZ8wJg=</latexit><latexit sha1_base64="ut6IZKJrEflIDCfYbuj6at9z7QU=">AAAB+XicdVDJSgNBEO1xjXEb9eilMQg5DTMx6y3oxWNEs0ASQk+nkzTp6Rm6a4JhyJ948aCIV//Em39jZxFU9EHB470qqur5keAaXPfDWlvf2NzaTu2kd/f2Dw7to+OGDmNFWZ2GIlQtn2gmuGR14CBYK1KMBL5gTX98NfebE6Y0D+UdTCPWDchQ8gGnBIzUs+0OsHvQNLm9JIIP5axnZ1ynkiu6hQp2ndyFWyx5c1IulvIl7DnuAhm0Qq1nv3f6IY0DJoEKonXbcyPoJkQBp4LN0p1Ys4jQMRmytqGSBEx3k8XlM3xulD4ehMqUBLxQv08kJNB6GvimMyAw0r+9ufiX145hUO4mXEYxMEmXiwaxwBDieQy4zxWjIKaGEKq4uRXTEVGEggkrbUL4+hT/Txo5xys6hZt8pppdxZFCp+gMZZGHSqiKrlEN1RFFE/SAntCzlViP1ov1umxds1YzJ+gHrLdPadeUHg==</latexit>iI<latexit sha1_base64="+b1YTwNn9fAZs+R6bGCklmbpVJo=">AAAB8HicbVDLSgNBEOz1GeMr6tHLYBA8SNgVX8eAF48RzEOyMcxOZpMhM7vLTK8QlnyFFw+KePVzvPk3TpI9aGJBQ1HVTXdXkEhh0HW/naXlldW19cJGcXNre2e3tLffMHGqGa+zWMa6FVDDpYh4HQVK3ko0pyqQvBkMbyZ+84lrI+LoHkcJ7yjaj0QoGEUrPfiJePQNUt0tld2KOwVZJF5OypCj1i19+b2YpYpHyCQ1pu25CXYyqlEwycdFPzU8oWxI+7xtaUQVN51sevCYHFulR8JY24qQTNXfExlVxoxUYDsVxYGZ9ybif147xfC6k4koSZFHbLYoTCXBmEy+Jz2hOUM5soQyLeythA2opgxtRkUbgjf/8iJpnFW8y8rF3Xm5eprHUYBDOIIT8OAKqnALNagDAwXP8ApvjnZenHfnY9a65OQzB/AHzucP7x+QcQ==</latexit><latexit sha1_base64="NSkESCA/maxFjF+BKtlPOskhk3I=">AAACUXicbVFJSwMxGP067nWrevQSLIIglpnidhEELx4VrC106pBJM20ws5B8I5Yw/kQPevJ/ePGgmC6C2wchL+99L8tLmEmh0XVfSs7U9Mzs3PxCeXFpeWW1srZ+rdNcMd5gqUxVK6SaS5HwBgqUvJUpTuNQ8mZ4ezbUm3dcaZEmVzjIeCemvUREglG0VFDp+zHFvopNtyCtAE96Ad7UiR8pysxICiNzXwTenhUL44ccqV2MZyzIl/vB2nHXmn8w4w1C0ywCDCpVt+aOivwF3gRUYVIXQeXJ76Ysj3mCTFKt256bYcdQhYJJXpT9XPOMslva420LExpz3TGjRAqybZkuiVJlR4JkxH53GBprPYhD2zm8o/6tDcn/tHaO0XHHiCTLkSdsfFCUS4IpGcZLukJxhnJgAWVK2LsS1qc2TbSfULYheL+f/Bdc12veYe3gcr96ujOJYx42YQt2wIMjOIVzuIAGMHiEV3iHj9Jz6c0Bxxm3OqWJZwN+lLP4CQ9HtbI=</latexit> Dataset description. We obtain the datapoints used in our cell differentiation task from the dataset generated by Weinreb et al. (2020), which contains 130861 observations/cells. We follow the preprocessing steps in Bunne et al. (2021) and use the Python package scanpy (Wolf et al., 2018). After processing, each observation records the level of expression of 1622 different highly-variable genes as well as the following meta information per cell: • a timestamp, expressed in days and taking values in {2, 4, 6}; • a barcode, which is a short DNA sequence that allows tracing the identity of cells and their lineage by means of single-cell sequencing readouts; • an additional annotation, which describes the current differentiation fate of the cell. Figure 10: Distribution of the cell population (i.e., marginals) at time t = t0 and t = t1 for (a) the ground truth, and (b) SBALIGN, after projection along their first two principal components. Dataset preparation. We only retain cells with barcodes that appear both on days 2 and 4, taking care of excluding cells that are already differentiated on day 2. We construct matchings by pairing cells measured at two different times but which share the barcode. Additionally, we filter cells to make sure that no one appears in more than one pair. To reduce the very high dimensionality of these datapoints, we perform a PCA projection down to 50 components. We end up with a total of 4702 pairs of cells, which we partition into train, validation, and test sets according to the split 80%/10%/10%. B.3 PROTEIN DOCKING B.3.1 Conformational Changes Dataset description. For the task of predicting protein conformational changes, we utilize the D3PM dataset. The dataset consists of both unbound and bound structures for 4330 proteins, under different types of protein motions. The PDB IDs were downloaded from https://www.d3pharma.com/D3PM/. For the PDB IDs making up the dataset, we download the corresponding (.cif) files from the Protein Data Bank. Dataset preparation. For the scope of this work, we only focus on protein structure pairs, where the provided RMSD between the Cα carbon atoms is > 3Å, amounting to 2370 examples in the D3PM dataset. For each pair of structures, we first identify common residues, and compute the RMSD between Cα carbon atoms of the common residues after superimposing them using the Kabsch (Kabsch, 1976) algorithm, and only accept the structure if the computed Cα RMSD is within a certain margin of the provided Cα RMSD. The rationale behind this step was to only retain examples where we could reconstruct the RMSD values provided with the dataset. Common residues are identified through a combination of residue position and name. This step is however prone to experimental errors, and we leave it to future steps to improve the common residue identification step (using potentially, a combination of common subsequences and/or residue positions). After applying the above preprocessing steps, we obtain a dataset with 1591 examples, which is then split into a train/valid/test split of 1291/150/150 examples respectively. The structures used in training and inference are the Kabsch superimposed versions, therefore ensuring that the Brownian bridges are sampled between the unbound and bound states of the proteins, and no artifacts are introduced by 3D rotations and translations, which do not contribute to conformational changes. PCA 1PCA 2a.<latexit sha1_base64="ncqBZX3RvHF0BLtPQM8+HugCJjg=">AAAB+XicbVBNS8NAEN3Ur1q/oh69BIvgqSTi17HoxWNF+wFtKJvtpF262YTdSbGE/hMvHhTx6j/x5r9x2+agrQ8GHu/NMDMvSATX6LrfVmFldW19o7hZ2tre2d2z9w8aOk4VgzqLRaxaAdUguIQ6chTQShTQKBDQDIa3U785AqV5LB9xnIAf0b7kIWcUjdS17Q7CE2qWPdxQwfty0rXLbsWdwVkmXk7KJEeta391ejFLI5DIBNW67bkJ+hlVyJmASamTakgoG9I+tA2VNALtZ7PLJ86JUXpOGCtTEp2Z+nsio5HW4ygwnRHFgV70puJ/XjvF8NrPuExSBMnmi8JUOBg70xicHlfAUIwNoUxxc6vDBlRRhiaskgnBW3x5mTTOKt5l5eL+vFx18ziK5Igck1PikStSJXekRuqEkRF5Jq/kzcqsF+vd+pi3Fqx85pD8gfX5A/LIk9I=</latexit>SBalignOursGround Truthb. Featurization. Following standard practice and for memory and computational efficiency, we only use the Cα coordinates of the residues to represent our protein structures instead of the full-atom structures. For each amino acid residue, we compute the following features: a one hot encoding of the amino acid identity fe of size 23, hydrophobicity fh ∈ 4.5, 4.5], , and whether the amino acid residue is a , polarity fp ∈ { volume fv ∈ 1, 0, 1 } . The hydropathy and volume features are expanded into a radial hydrogen bond donor fd ∈ { 0, 1 } basis with interval sizes 0.1 and 10 respectively. To equip the model with a notion of time, we use a sinusoidal embedding of time φ(t) of embedding dimensionality 32. These are concatenated to the amino acid features to form our input features for the amino acid residues. The edge features consist of a radial basis expansion of the distances between the residues. We also compute the spherical harmonics of the edge vectors between the residues, which is used in the tensor product message passing layers. [60.1, 227.8], the charge fc ∈ {− 0, 1 } or acceptor fa ∈ { 0, 1 } [ − Position at t. For any time t, we sample the positions of the Cα atoms using the Brownian Bridge - given the co- ordinates x0 at t = 0 and the coordinates x1 at t = 1 with a Brownian bridge between x0 and x1, we know that xt ∼ N t)x0 + tx1, t(1 (xt; (1 t)). − − B.3.2 Rigid Protein Docking Dataset description. We use the DB5.5 dataset (Vreven et al., 2015) for our empirical evaluation. The DB5.5 dataset is a standard dataset used in protein-protein docking, however, it only has 253 complexes. The dataset was downloaded from https://zlab.umassmed.edu/benchmark/. The dataset consists of both unbound and bound structures, but the structures are largely rigid, with an average complex RMSD of 0.96 between the bound and unbound structures. We utilize the same splits as EquiDock (Ganea et al., 2022), with 203 complexes in the training set, 25 complexes in the validation set, and 25 complexes in the test set. For the evaluation in Table 5, we use the full DB5.5 test set. For ligands in the test set, we generate the corresponding unbound versions by applying the rotation and translation sampled during training. Dataset preparation. Following similar convention as EQUIDOCK (Ganea et al., 2022), we treat the receptor as fixed. For each ligand, the final 3D structure corresponds to its bound version, and the unbound version is generated by applying a random rotation R and translation b to the bound version. However, applying a different rotation and translation to each ligand would result in a different Brownian bridge, thus providing limited learning signal for the drift bθ t . To avoid this, we 45◦ along each axis, and a translation b create a rotation matrix R during training by sampling a random angle between 30 − with a maximum magnitude between 5.0 10.0. The same R and b are also applied to the validation and test sets. We leave it to future work to extend the algorithm to work for arbitrary rotations and translations. − Featurization. Following standard practice and for memory and computational efficiency, we only use the Cα coordinates of the residues to represent our protein structures instead of the full-atom structures. For each amino acid residue, we 4.5, 4.5], compute the following features: a one hot encoding of the amino acid identity fe of size 23, hydrophobicity fh ∈ , and whether the amino acid residue is a , polarity fp ∈ { volume fv ∈ 1, 0, 1 } . The hydropathy and volume features are expanded into a radial hydrogen bond donor fd ∈ { 0, 1 } basis with interval size 0.1 and 10 respectively. To equip the model with a notion of time, we use a sinusoidal embedding of time φ(t) of embedding dimensionality 32. These are concatenated to the amino acid features to form our input features for the amino acid residues. [60.1, 227.8], the charge fc ∈ {− 0, 1 } or acceptor fa ∈ { 0, 1 } [ − Position at t. For any time t, we sample the positions of the Cα atoms using the Brownian Bridge - given the co- ordinates x0 at t = 0 and the coordinates x1 at t = 1 with a Brownian bridge between x0 and x1, we know that xt ∼ N t)x0 + tx1, t(1 (xt; (1 t)). − − C EXPERIMENTAL DETAILS In the following, we provide further experimental details on the chosen evaluation metrics, network architectures, and hyperparameters. C.1 EVALUATION METRICS C.1.1 Cell Differentiation For fairness of comparison between our method and the baseline (FBSB) -which only works at the level of distribution of cells- we also consider three evaluation metrics (i.e., Wε, MMD and l2) that capture the similarity between the end marginal ˆP1 and our prediction π⋆ In what follows, we denote with ˆν the predicted end marginal π⋆ the distribution of observed transcriptomes. 1, irrespective of matchings. 1 -i.e., the predicted status of cells at day 4- and with ν Wasserstein-2 distance. We measure accuracy of the predicted target population ˆν to the observed target population ν using the entropy-regularized Wasserstein distance (Cuturi, 2013) provided in the OTT library (Bradbury et al., 2018; Cuturi et al., 2022) defined as (C.1) − ij Pij(log Pij − 1) and the polytope U (ˆν, ν) is the set of n where H(P) := ˆν, P⊤1n = ν . } Maximum mean discrepancy. Kernel maximum mean discrepancy (Gretton et al., 2012) is another metric to measure distances between distributions, i.e., in our case between predicted population ˆν and observed one ν. Given two random variables x and y with distributions ˆν and ν, and a kernel function ω, Gretton et al. (2012) define the squared MMD as: m matrices , P1m = (cid:80) P × R ∈ { n×m + MMD(ˆν, ν; ω) = Ex,x′[ω(x, x′)] + Ey,y′[ω(y, y′)] 2Ex,y[ω(x, y)]. − We report an unbiased estimate of MMD(ˆν, ν), in which the expectations are evaluated by averages over the population particles in each set. We utilize the RBF kernel, and as is usually done, report the MMD as an average over the length scales: 2, 1, 0.5, 0.1, 0.01, 0.005. Perturbation signature l2. A common method to quantify the effect of a perturbation on a population is to compute its perturbation signature (Stathias et al., 2018, (PS)), computed via the difference in means between the distribution of perturbed states and control states of each feature, e.g., here individual genes. l2(PS) then refers to the l2-distance between the perturbation signatures computed on the observed and predicted distributions, ν and ˆν. The l2(PS) is defined as PS(ν, μ) = 1 m yi − 1 n xi, yi∈ν (cid:88) where n is the size of the unperturbed and m of the perturbed population. We report the l2 distance between the observed signature PS(ν, μ) and the predicted signature PS(ˆν, μ), which is equivalent to simply computing the difference in the means between the observed and predicted distributions. xi∈μ (cid:88) RMSD. To measure the quality of matchings sampled from SBALIGN (ˆxi we compute: 0, ˆxi 1) -compared to the observed ones (xi 0, xi 1)- RMSD( n, xi 1} { { n) = ˆxi 1} 1 n n xi 1 − ∥ i=1 (cid:88) 2 ˆxi 1∥ (C.2) (cid:118) (cid:117) (cid:117) (cid:116) which, when squared, represents the mean of the square norm of the differences between predicted and observed statuses of the cells on day 4. Cell type classification accuracy. We assess the quality of SBALIGN trajectories by trying to predict the differentiation fate of cells, starting from (our compressed representation of) their transcriptome. For this, we train a simple MLP-based classifier on observed cells and use it on the last time-frame of trajectories sampled from SBALIGN to infer the differentiation of cells on day 4. We use the classifier MLPClassifier offered by the library scikit-learn with the following parameters: • 2 hidden layers, each with a hidden dimension of 50, • the logistic function as non-linearity • l2 norm, regularization with coefficient 0.1. We report the subset accuracy of the predictions on the test set, measured as the number of labels (i.e., cell types) coinciding with the ground truth. C.1.2 Rigid Protein Docking We report two metrics, Complex Root Mean Square Deviation (Complex RMSD), and Interface Root Mean Square Deviation (Interface RMSD). Following (Ganea et al., 2022), the ground truth and predicted complex structures are first superimposed using the Kabsch algorithm (Kabsch, 1976), and the Complex RMSD is then computed between the superimposed versions. A similar procedure is used for computing Interface RMSD, but only using the residues from the two proteins that are within 8 Å of each other. Given a ligand with m residues and a receptor with n residues, we denote the predicted bound structures with Z′ R(n+m). We first superimpose the predicted and ground ∥F . truth bound structures using the Kabsch algorithm and then compute the Complex RMSD as Crmsd = Z The Interface RMSD Irmsd is computed similarly, but only using the residues from the two proteins that are within 8Å of each other. R(n+m) and the ground truth bound structure with Z∗ 1 n+m ∥ Z′ (cid:113) − ∈ ∈ C.2 NETWORK ARCHITECTURES C.2.1 Cell Differentiation and Synthetic Datasets We parameterize both bθ(t, Xt) and mφ(t, bt, Xt) using a model composed of: 1. x_enc: 3-layer MLP performing the expansion of spatial coordinates (or drift) into hidden states (of dimension 64 to 256); 2. t_enc: sinusoidal embedding of time (on 64 to 256 dimensions), followed by a two layer MLP; 3. mlp: 3-layer MLP which maps the concatenation of embedded spatial and temporal information (output of modules 1 and 2 above) to drift magnitude values along each dimension. After every linear layer (except the last one), we apply a non-linearity and dropout (level 0.1). In all the experiments, we set the diffusivity function g(t) in (5) to a constant g, which is optimized (see § C.3). C.2.2 Protein Conformational Changes As our architecture bθ t (Xt) suitable for approximating the true drift bt, we construct a graph neural networks with tensor- product message passing layers using e3nn (Thomas et al., 2018; Geiger and Smidt, 2022). To build the graph, we consider a maximum of 40 neighbors –located within a radius of 40Å for each residue. The model is SE(3) equivariant and receives node and edge features capturing relevant residue properties, and distance embeddings. C.2.3 Rigid Protein Docking t and mφ. As inputs, both bθ t and mφ receive input node features and the Cα For the scope of this paper, we use a MLP as bθ coordinates at time t, as described in Section C.3.4, with mφ receiving the prediction bθ t as additional input. Both models have 3 hidden layers, each with a dimension of 64 and an output dimension of 3, with around 50K parameters in total. Our current architectures are not equivariant to global rotations and translations, which is a desirable property in protein docking as the structures of the proteins themselves are invariant to the choice of reference coordinates frames. We leave a thorough exploration of other architectures, such as equivariant GNN architectures similar to those adopted in (Ganea et al., 2022) to future work. C.3 HYPERPARAMETERS In the following, we will provide an overview of the selected hyperparameters as well as chosen training procedures. C.3.1 Synthetic Tasks We perform hyper-parameter optimization using the Python package ray.tune (Liaw et al., 2018) on: • activation, chosen among leaky_relu, relu, selu and silu as implemented in the Python library PyTorch (Paszke et al., 2019). We find selu to achieve marginally better performance on toy datasets. • g, the value of the diffusivity constant, chosen among 1, 2, 5, 10 . We find g = 1 to yield optimal results. } { C.3.2 Cell Differentiation We perform hyper-parameter optimization using the Python package ray.tune (Liaw et al., 2018) on: • activation, chosen among leaky_relu, relu, selu, and silu as implemented in the Python library PyTorch (Paszke et al., 2019). We observe that silu brings noticeable performance improvements on the cell differentiation dataset. • g, the value of the diffusivity constant, chosen among results. 0.01, 0.1, 0.8, 1, 1.2, 2, 5 { . We find g = 1 to yield optimal } C.3.3 Protein Conformational Changes We use AdamW as our optimizer with a initial learning rate of 0.001, and training batch size of 2. For each protein pair, we sample 10 timepoints in every epoch, so the model sees realizations from different timepoints of the corresponding Brownian Bridge. This was done to improve the training speed. We use a regularization strength of 1.0 for mφ for all t. Inference on the validation set using training is carried out using the exponential moving average of parameters, and the moving average is updated every optimization step with a decay rate of 0.9. The model training is set to a maximum of 1000 epochs but training is typically stopped after 200 epochs beyond which no improvements in the validation metrics are observed. Our model has 0.54M parameters and is trained for 200 epochs. After every epoch, we simulate trajectories on the validation set using our model and compute the mean RMSD. The best model selected using this procedure is used for inference on the test set. The baseline EGNN model has 0.76M parameters and is trained for 1000 epochs. C.3.4 Rigid Protein Docking We use ADAM as our optimizer with a learning rate of 0.001, and training batch size of 2. For each ligand, we sample 5 timepoints during every training epoch so that the model is exposed to different timepoints from the corresponding Brownian Bridge for each ligand. This number was chosen as a tradeoff between CUDA memory and coverage of timepoints between 0 and 1. We use a regularization strength of 1.0 for mφ for all t. Inference on the validation set using training is carried out using the exponential moving average of parameters, and the moving average is updated every optimization step with a decay rate of 0.999. The model training is set to a maximum of 1000 epochs but training is typically stopped after 100 epochs beyond which no improvements in the validation metrics are observed. D REPRODUCIBILITY Code utilized in this publication can be found at https://github.com/vsomnath/aligned_diffusion_bridges, with a mirror at https://github.com/IBM/aligned_diffusion_bridges.
http://arxiv.org/abs/2302.11414v1
2023-02-22T14:50:24
2023-02-22T14:50:24
Delving into Identify-Emphasize Paradigm for Combating Unknown Bias
Dataset biases are notoriously detrimental to model robustness and generalization. The identify-emphasize paradigm appears to be effective in dealing with unknown biases. However, we discover that it is still plagued by two challenges: A, the quality of the identified bias-conflicting samples is far from satisfactory; B, the emphasizing strategies only produce suboptimal performance. In this paper, for challenge A, we propose an effective bias-conflicting scoring method (ECS) to boost the identification accuracy, along with two practical strategies -- peer-picking and epoch-ensemble. For challenge B, we point out that the gradient contribution statistics can be a reliable indicator to inspect whether the optimization is dominated by bias-aligned samples. Then, we propose gradient alignment (GA), which employs gradient statistics to balance the contributions of the mined bias-aligned and bias-conflicting samples dynamically throughout the learning process, forcing models to leverage intrinsic features to make fair decisions. Furthermore, we incorporate self-supervised (SS) pretext tasks into training, which enable models to exploit richer features rather than the simple shortcuts, resulting in more robust models. Experiments are conducted on multiple datasets in various settings, demonstrating that the proposed solution can mitigate the impact of unknown biases and achieve state-of-the-art performance.
[ "Bowen Zhao", "Chen Chen", "Qian-Wei Wang", "Anfeng He", "Shu-Tao Xia" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11414v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11414v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Delving into Identify-Emphasize Paradigm for Combating Unknown Bias Bowen Zhao1, Chen Chen2, Qian-Wei Wang1,3, Anfeng He2 and Shu-Tao Xia1,3 1Tsinghua Shenzhen International Graduate School, Tsinghua University, China. 2TEG AI, Tencent, China. 3Research Center of Artificial Intelligence, Peng Cheng Laboratory, China. Contributing authors: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Abstract Dataset biases are notoriously detrimental to model robustness and generalization. The identify- emphasize paradigm appears to be effective in dealing with unknown biases. However, we discover that it is still plagued by two challenges: A, the quality of the identified bias-conflicting samples is far from satisfactory; B, the emphasizing strategies only produce suboptimal performance. In this paper, for challenge A, we propose an effective bias-conflicting scoring method (ECS) to boost the identification accuracy, along with two practical strategies - peer-picking and epoch-ensemble. For challenge B, we point out that the gradient contribution statistics can be a reliable indicator to inspect whether the optimization is dominated by bias-aligned samples. Then, we propose gradient alignment (GA), which employs gradient statistics to balance the contributions of the mined bias-aligned and bias-conflicting samples dynamically throughout the learning process, forcing models to leverage intrinsic features to make fair decisions. Furthermore, we incorporate self-supervised (SS) pretext tasks into training, which enable models to exploit richer features rather than the simple shortcuts, resulting in more robust models. Experiments are conducted on multiple datasets in various settings, demonstrating that the proposed solution can mitigate the impact of unknown biases and achieve state-of-the-art performance. Keywords: Unknown Bias, Identify-Emphasize, Bias-Conflicting Scoring, Gradient Alignment, Self-Supervision 3 2 0 2 b e F 2 2 ] G L . s c [ 1 v 4 1 4 1 1 . 2 0 3 2 : v i X r a 1 Introduction Deep Neural Networks (DNNs) have made signif- icant advances in a variety of visual tasks. DNNs tend to learn intended decision rules to accom- plish target tasks commonly. However, they may follow unintended decision rules based on the easy-to-learn shortcuts to "achieve" target goals in some scenarios (Bahng et al., 2020). For instance, when training a model to classify digits on Colored MNIST (Kim et al., 2019a), where the images of each class are primarily dyed by one pre-defined color respectively (e.g., most '0' are red, '1' are yellow, see examples in Figure 6), the intended decision rules classify images based on the shape of digits, whereas the unintended decision rules utilize color information instead. Following Nam et al. (2020), sample x that can be "correctly" classified by unintended decision rules is denoted as a bias-aligned sample x (e.g., red '0' in Col- ored MNIST) and vice versa a bias-conflicting sample x (e.g., green '0'). 1 Fig. 1: (a) Effective bias-Conflicting Scoring (ECS) helps identify real bias-conflicting samples in stage I. (b) Gradient Alignment (GA) balances contributions from the mined bias-aligned and bias-conflicting samples throughout training, enforcing models to focus on intrinsic features in stage II. (c) Self-Supervised (SS) pretext tasks further assist models in capturing more general and robust representations from diverse valuable cues in stage II. There are many similar scenarios in the real world. For example, an animal-centric image set may be biased by the habitats in the background, and a human-centric set may be biased by gender or racial information. Models blinded by biased datasets usually perform poorly in mismatched distributions (e.g., a red '8' may be incorrectly classified as '0' by the model trained on Colored MNIST). Worse, models with racial or gender bias, etc. can cause severe negative social impacts. Furthermore, in most real-world problems, the bias information (both bias type and precise labels of bias attribute) is unknown, making debiasing more challenging. Therefore, combating unknown biases is urgently demanded when deploying AI systems in realistic applications. One major issue that leads to biased mod- els is that the training objective (e.g., vanilla empirical risk minimization) can be accomplished through only unintended decision rules (Sagawa et al., 2020b). Accordingly, some studies (Nam et al., 2020; Kim et al., 2021b) attempt to iden- tify and emphasize the bias-conflicting samples. Nevertheless, we find that the debiasing effect is hampered by the low identification accuracy and the suboptimal emphasizing strategies. In this work, we build an enhanced two-stage debias- ing scheme to combat unknown dataset biases. We present an Effective bias-Conflicting Scoring (ECS) function to mine bias-conflicting samples in stage I. On top of the off-the-shelf method, we propose a peer-picking mechanism to con- sciously pursue seriously biased auxiliary mod- els and employ epoch-ensemble to obtain more accurate and stable scores. In stage II, we pro- pose Gradient Alignment (GA), which balances 2 the gradient contributions across the mined bias- aligned and bias-conflicting samples to prevent models from being biased. In order to achieve dynamic balance throughout optimization, the gradient information is served as an indicator to down-weight (up-weight) the mined bias-aligned (bias-conflicting) samples. Furthermore, to avoid the models relying solely on simple shortcuts to accomplish the learning objective, we introduce Self-Supervised (SS) pretext tasks in stage II, encouraging richer features to be considered when making decisions. Figure 1 depicts the effects of ECS, GA, and SS. In comparison to other debiasing techniques, the proposed solution (i) does not rely on compre- hensive bias annotations (Tartaglione et al., 2021; Zhu et al., 2021; Li and Vasconcelos, 2019; Sagawa et al., 2020a; Goel et al., 2021; Kim et al., 2019a) or a pre-defined bias type (Bahng et al., 2020; Clark et al., 2019; Utama et al., 2020b; Geirhos et al., 2018; Wang et al., 2019); (ii) does not require disentangled representations (Tartaglione et al., 2021; Kim et al., 2021b,a; Bahng et al., 2020), which may fail in complex scenarios where disentangled features are hard to extract; (iii) does not introduce heavy data augmentations (Geirhos et al., 2018; Kim et al., 2021a,b; Goel et al., 2021), avoiding additional training complexity such as in generative models; (iv) does not involve modifi- cation of model backbones (Kim et al., 2021b), making it easy to be applied to other networks. (v) significantly improves the debiasing perfor- mance. The main contributions of this work are summarized as follows: (1) To combat unknown dataset biases, we present an enhanced two-stage approach bias-conflictingsamplestrainingprocessVanillaPreviousGA(Ours)contributionseesawbias-conflictinglikelihoodECS(Ours)PreviousStageIStageII(a)(b)01trainingprocessstartendbias-alignedsamples(c)woSSwSS(Ours)(valuable)cuesbeingused (illustrated in Figure 2) in which an effective bias-conflicting scoring algorithm equipped with peer-picking and epoch-ensemble in stage I (in Section 3.1), and gradient alignment in stage II (in Section 3.2) are proposed. (3) Broad (2) In stage II (in Section 3.3), we introduce self- supervised pretext tasks to demonstrate the ability of the unsupervised learning paradigm to alleviate bias in supervised learning. commonly used datasets are conducted to compare several debiasing methods in a fair manner (overall, we train more than 700 models), among which the proposed method achieves state-of-the-art performance (in Section 4). experiments on (4) We undertake comprehensive analysis (in Section 5), including the efficacy of each com- ponent, the solution's effectiveness in vari- ous scenarios, the sensitivity of the hyper- parameters, and so on. A preliminary version of this work has been accepted by a conference (Zhao et al., 2023), but we extend this work with the following addi- tions: (i) we further introduce self-supervised pretext tasks to help the models leverage abun- dant features and investigate their effectiveness with extended experiments (in Section 3.3 and Section 4.5); (ii) a more detailed description and analysis of the datasets and the compared meth- ods are provided (in Section 4.1 and Section 4.2); (iii) we present and analyze the results measured on the bias-aligned and bias-conflicting test sam- ples separately (in Section 4.5); (iv) we include more detailed results, such as the performance of the last epoch (in Table 2), the precision-recall curves of different bias-conflicting scoring strate- gies (in Figure 8), the precision and recall of our mined bias-conflicting samples (in Table 7), the final debiasing results of GA with different bias- conflicting scoring methods (in Table 6); (v) the analysis and discussion are extended, such as the number of auxiliary biased models (in Section 5.3), when there are only a few bias-conflicting samples (in Section 5.5), when the training data is unbi- ased (in Section 5.6), the connection to curriculum learning (in Section 5.7); (vi) the limitation and future work are further discussed (in Section 6). 3 2 Related work approaches Combating biases with known types and labels. Many debiasing require explicit bias types and bias labels for each training sample. A large group of strategies aims at dis- entangling spurious and intrinsic features (Moyer et al., 2018). For example, EnD (Tartaglione et al., 2021) designs regularizers to disentangle represen- tations with the same bias label and entangle fea- tures with the same target label; BiasCon (Hong and Yang, 2021) pulls samples with the same tar- get label but different bias labels closer in the feature space based on contrastive learning; and some other studies learn disentangled represen- tation by mutual information minimization (Zhu et al., 2021; Kim et al., 2019a; Ragonesi et al., 2021). Another classic approach is to reweigh/re- sample training samples based on sample number or loss of different explicit groups (Li et al., 2018; Sagawa et al., 2020b; Li and Vasconcelos, 2019), or even to synthesize samples (Agarwal et al., 2020). Besides, Sagawa et al. (2020a) and Goel et al. (2021) intend to improve the worst- group performance through group distributionally robust optimization (Goh and Sim, 2010) and Cycle-GAN (Zhu et al., 2017) based data augmen- tation, respectively. Furthermore, IRM (Arjovsky et al., 2019) is designed to learn a representation that performs well in all environments; domain- independent classifiers are introduced by Wang et al. (2020) to accomplish target tasks in each known bias situation. Combating biases with known types. To alleviate expensive bias annotation costs, some bias-tailored methods relax the demands by requiring only the bias types (Geirhos et al., 2018). Bahng et al. (2020) elaborately design specific net- works based on the bias types to obtain biased representations on purpose (e.g., using 2D CNNs to extract static bias in action recognition). Then, the debiased representation is learned by encour- aging it to be independent of the biased one. Wang et al. (2019) try to project the model's rep- resentation onto the subspace orthogonal to the texture-biased representation. SoftCon (Hong and Yang, 2021) serves as an extension of BiasCon to handle cases where only the bias type is available. In addition, the ensemble approach that consists of a bias-type customized biased model and a debiased model is employed in natural language Fig. 2: Our debiasing scheme. Stage I: training auxiliary biased models ̇f , ̈f with peer-picking and epoch-ensemble to score the likelihood that a sample is bias-conflicting (in Section 3.1). Stage II: learn- ing debiased model f with gradient alignment (in Section 3.2) and self-supervised pretext tasks (in Section 3.3). A dashed arrow starting from a sample cluster indicates that the model is updated with gradients from these samples. processing as well (He et al., 2019; Clark et al., 2019; Cadene et al., 2019; Utama et al., 2020b; Clark et al., 2020). Combating unknown biases. Despite the the methodologies described effectiveness of above, the assumptions limit their applications, as manually discovering bias types heavily relies on experts' knowledge and labeling bias attributes for each training sample is even more labori- ous. As a result, recent studies (Le Bras et al., 2020; Kim et al., 2019b; Hashimoto et al., 2018) try to obtain debiased models with unknown biases, which are more realistic. Nam et al. (2020) mine bias-conflicting samples with generalized cross entropy (GCE) loss (Zhang and Sabuncu, 2018) and emphasize them by using a designed weight assignment function. Kim et al. (2021b) further synthesize diverse bias-conflicting samples via feature-level data augmentation, whereas Kim et al. (2021a) directly generate them with Swa- pAE (Park et al., 2020). RNF (Du et al., 2021) uses the neutralized representations from sam- ples with the same target label but different bias labels (generated by GCE-based biased models, the version that accesses real bias labels is called RNF-GT) to train the classification head alone. Besides GCE loss, feature clustering (Sohoni et al., 4 2020), early-stopping (Liu et al., 2021), forget- table examples (Yaghoobzadeh et al., 2021) and limited network capacity (Sanh et al., 2020; Utama et al., 2020a) are involved to identify bias- conflicting samples. Furthermore, Creager et al. (2021) and Lahoti et al. (2020) alternatively infer dataset partitions and enhance domain- invariant feature learning by min-max adversarial training. In addition to the identify-emphasize paradigm, Pezeshki et al. (2020) introduces a novel regularization method for decoupling fea- ture learning dynamics in order to improve model robustness. Self-supervised learning. In recent years, self-supervised learning has achieved significant success in vision tasks. For applications, self- supervised learning has been employed in object recognition/detection/segmentation (He et al., 2020), video tasks (Tong et al., 2022), few- shot learning (Gidaris et al., 2019), manipula- tion detection (Zeng et al., 2022), etc. For pre- text tasks in self-supervised training, position prediction (Doersch et al., 2015), Jigsaw puz- zles (Noroozi and Favaro, 2016), rotation predic- tion (Gidaris et al., 2018), clustering (Van Gans- beke et al., 2020; Caron et al., 2020), contrastive learning (Chen et al., 2020; He et al., 2020), mask and reconstruct (He et al., 2022), etc. are adopted to extract transferable representations from the EffectiveBias-ConflictingScoringdebiasedmodelxxbiased trainingdata0.80.90.10.1...s%0.10.20.9̇fO#̈fepoch-ensemblepeer-pickingηηp(yj|̇f(xj))pyj̈fxjO$O%O&011GradientAlignmentbackwardwithgradient ascentbackwardwithgradient descentdiscardgfcontributionratiorauxiliarybiasedmodelsforwardgsharedbackboneA'(⋯)A#(⋯)...differentviewsSelf-SupervisedPretextTaskpretext-taskhead 3 4 5 6 7 8 9 10 11 12 13 14 15 i=1; initial models ̇f 0, ̈f 0 and b-c scores {si ← 0}N i=1; loss function (cid:96); threshold η. Algorithm 1 Effective bias-Conflicting Scoring (ECS) Input: D={(xi, yi)}N 1 for t = 0 to T − 1 do 2 j=1 ← FetchBatch(D) // batch size B B = {(xj, yj)}B {p(yj| ̇f t(xj))}, {p(yj| ̈f t(xj))} ← Forward(B, ̇f t, ̈f t) ̈lt ← 0; // initialize loss ̇lt ← 0; for j = 1 to B do if p(yj| ̇f (xj)) > η and p(yj| ̈f (xj)) > η then ̈lt += (cid:96)( ̈f t(xj), yj) ̇lt += (cid:96)( ̇f t(xj), yj); else if p(yj| ̇f (xj)) > η and p(yj| ̈f (xj)) ≤ η then ̇lt −= (cid:96)( ̇f t(xj), yj) else if p(yj| ̇f (xj)) ≤ η and p(yj| ̈f (xj)) > η then ̈lt −= (cid:96)( ̈f t(xj), yj) ̇f t+1 ← Backward&Update( ̇f t, ̇lt if (t + 1)%T (cid:48) = 0 then for i = 1 to N do si += T (cid:48) T [1 − p(yi| ̇f t+1(xi))+p(yi| ̈f t+1(xi)) 2 ] Output: the estimated b-c scores {si}N i=1. B ) ; ̈f t+1 ← Backward&Update( ̈f t, ̈lt B ) unlabeled data. For the training data, besides learning on unlabeled data, self-supervised learn- ing has also been utilized to pursue more general features with labeled (Khosla et al., 2020), partial labeled (Wang et al., 2022) or mixed data (Zhai et al., 2019). 3 Methodology The whole debiasing solution is illustrated in Figure 2. We present peer-picking, epoch-ensemble for stage I (in Section 3.1), gradient alignment and self-supervised pretext tasks for stage II (in Section 3.2 and Section 3.3, respectively). 3.1 Effective bias-conflicting scoring Due to the explicit bias information is not avail- able, we try to describe how likely input x is a bias- conflicting sample via the bias-conflicting (b-c) score: s(x, y) ∈ [0,1], where y ∈ {1, 2, * * * , C} stands for the target label. A larger s(x, y) indi- cates that x is harder to be recognized via unin- tended decision rules. As models are prone to fitting shortcuts, previous studies (Kim et al., 2021a; Liu et al., 2021) resort model's output probability on target class to define s(x, y) as ̇f 1 − p(y| ̇f (x)), where p(c| ̇f (x)) = is an auxiliary biased model and ̇f (x)[c] denotes c(cid:48)=1 e ̇f (x)[c(cid:48) ] , ̇f (x)[c] (cid:80)C e 5 ̇f (x). Despite this, over- the cth index of logits parameterized networks tend to "memorize" all samples, resulting in low scores for the real bias- conflicting samples as well. To avoid it, we propose the following two strategies. The whole scoring framework is summarized in Algorithm 1 (noting that the "for" loop is used for better clarification, which can be avoided in practice). Training auxiliary biased models with peer-picking. Deliberately amplifying the aux- iliary model's bias seems to be a promising strategy for better scoring (Nam et al., 2020), as heavily biased models can assign high b-c scores to bias-conflicting samples. We achieve this by confident-picking - only picking samples with confident predictions (which are more like bias-aligned samples) to update auxiliary mod- els. Nonetheless, a few bias-conflicting samples can still be overfitted and the memorization will be strengthened with continuous training. Thus, with the assist of peer model, we propose peer- picking, a co-training-like (Han et al., 2018) paradigm, to train auxiliary biased models. Our method maintains two auxiliary biased models ̇f and ̈f simultaneously (identical struc- ture here). Considering a training set D = {(xi, yi)}N i=1 with B samples in each batch, with a threshold η ∈ (0, 1), each model divides sam- ples into confident and unconfident groups relying on the output probabilities on target classes. Con- sequently, four clusters are formed as shown in Figure 2. For the red cluster (O1), since two models are confident on them, it is reasonable to believe that they are indeed bias-aligned sam- ples, therefore we pick up them to update model via gradient descent as usual (Line 7,12 of Algo- rithm 1). While the gray cluster (O2), on which both two models are unconfident, will be dis- carded outright as they might be bias-conflicting samples. The remaining purple clusters (O3 and O4) indicate that some samples may be bias- conflicting, but they are memorized by one of auxiliary models. Inspired by the work for han- dling noisy labels (Han et al., 2020), we endeavor to force the corresponding model to forget the memorized suspicious samples via gradient ascent (Line 9,11,12). We average the output results of the two heavily biased models ̇f and ̈f to obtain b-c scores (Line 15). Collecting results with epoch-ensemble. During the early stage of training, b-c scores {si} (si:=s(xi, yi)) of real bias-conflicting samples are usually higher than those of bias-aligned ones, while the scores may be indistinguishable at the end of training due to overfitting. Unfortunately, selecting an optimal moment for scoring is strenu- ous. To avoid tedious hyper-parameter tuning, we collect results every T (cid:48) iterations (typically every epoch in practice, i.e., T (cid:48) = (cid:98) N B (cid:99)) and adopt the ensemble averages of multiple results as the final b-c scores (Line 15). We find that the ensemble can alleviate the randomness of a specific check- point and achieve superior results without using tricks like early-stopping. 3.2 Gradients alignment Then, we attempt to train the debiased model f . We focus on an important precondition of the presence of biased models: the training objec- tive can be achieved through unintended decision rules. To avoid it, one should develop a new learn- ing objective that cannot be accomplished by these rules. The most straightforward inspiration is the use of plain reweighting (Rew) to intention- ally rebalance sample contributions from different domains (Sagawa et al., 2020b): LRew = N (cid:88) i=1 N γ * N * (cid:96)(f (xi), yi) + N (cid:88) j=1 (cid:96)(f (xj ), yj ), (1) 6 where N and N are the number of bias-conflicting and bias-aligned samples respectively, γ ∈ (0, ∞) is a reserved hyper-parameter to conveniently adjust the tendency: when γ → 0, models intend to exploit bias-aligned samples more and when γ → ∞, the behavior is reversed. As depicted in Figure 3, assisted with Rew, unbiased accuracy skyrockets in the beginning, indicating that the model tends to learn intrinsic features in the first few epochs, while declines gradually, manifesting that the model is biased progressively (adjusting γ can not reverse the tendency). The above results show that the static ratio between N and N is not a good indicator to show how balanced the training is, as the influence of samples can fluctuate during training. Accord- ingly, we are inspired to directly choose gradient statistics as a metric to indicate whether the train- ing is overwhelmed by bias-aligned samples. Let us revisit the commonly used cross-entropy loss: (cid:96)(f (x), y) = − C (cid:88) c=1 Ic=y log p(c|f (x)). (2) For a sample (x, y), the gradient on logits f (x) is given by ∇f (x)(cid:96)(f (x), y) = ∂(cid:96)(f (x), y) ∂f (x)[1] , [ ∂(cid:96)(f (x), y) ∂f (x)[2] , * * * , ∂(cid:96)(f (x), y) ∂f (x)[C] ]T. (3) We define the current gradient contribution of sample (x, y) as g(x, y|f ) =(cid:107) ∇f (x)(cid:96)(f (x), y) (cid:107)1 = C (cid:88) c=1 | ∂(cid:96)(f (x), y) ∂f (x)[c] | (4) = 2| ∂(cid:96)(f (x), y) ∂f (x)[y] | = 2 − 2p(y|f (x)). Assuming within the tth iteration (t ∈ [0, T − 1]), t the batch is composed of Bt bias-aligned and B bias-conflicting samples (B in total, Bt (cid:29) B under our concerned circumstance). The accumu- lated gradient contributions generated by bias- aligned samples are denoted as t Fig. 3: Unbiased accuracy on Colored MNIST. gt = Bt (cid:88) i=1 g(xi, yi|f t), (5) similarly for the contributions of bias-conflicting samples: gt. We present the statistics of {gt}T −1 and t=0 {gt}T −1 t=0 when learning with the standard ERM learning objective (Vanilla) and Equation (1) (Rew) respectively in Figure 4. For vanilla train- ing, we find the gradient contributions of bias- aligned samples overwhelm that of bias-conflicting samples at the beginning, thus the model becomes biased towards spurious correlations rapidly. Even though at the late stage, the gap in gradient con- tributions shrinks, it is hard to rectify the already biased model. For Rew, we find the contribu- tions of bias-conflicting and bias-aligned samples are relatively close at the beginning (compared to those under Vanilla), thus both of them can be well learned. Nonetheless, the bias-conflicting samples are memorized soon due to their small quantity, and the gradient contributions from the bias-conflicting samples become smaller than that of the bias-aligned samples gradually, leading to biased models step by step. The above phenomena are well consistent with the accuracy curves in Figure 3, indicating that the gradient statistics can be a useful "barome- ter" to reflect the optimization process. Therefore, the core idea of gradient alignment is to rebalance bias-aligned and bias-conflicting samples accord- ing to their currently produced gradient contri- butions. Within the tth iteration, We define the contribution ratio rt as: rt = gt γ * gt = (cid:80)Bt j=1[1 − p(yj|f t(xj))] i=1[1 − p(yi|f t(xi))] γ * (cid:80)Bt , (6) where γ plays a similar role as in Rew. Then, with rt, we rescale the gradient contributions derived from bias-aligned samples to achieve alignment 7 Fig. 4: Statistics of {gt}T −1 t=0 . Vanilla (top), Rew (middle), GA (bottom). Results in the late stage are enlarged and shown in each figure. t=0 and {gt}T −1 with that from bias-conflicting ones, which can be simply implemented by reweighting the learning objective for the tth iteration: Lt GA = Bt (cid:88) i=1 rt *(cid:96)(f t(xi), yi)+ Bt (cid:88) j=1 (cid:96)(f t(xj), yj), (7) i.e., the modulation weight is adaptively cali- brated in each iteration. As shown in Equation (6) and (7), GA only needs negligible computational extra cost (1× forward and backward as usual, only increases the cost of computing rt). As shown in Figure 4, GA can dynamically balance the con- tributions throughout the whole training process. Correspondingly, it obtains optimal and stable predictions as demonstrated in Figure 3 and multi- ple other challenging datasets in Section 4. Noting that as bias-conflicting samples are exceedingly scarce, it is unrealistic to ensure that every class can be sampled in one batch, thus all classes share the same ratio in our design. To handle unknown biases, we simply utilize the estimated b-c score {si}N i=1 and a threshold τ to assign input x as bias-conflicting (s(x, y) ≥ τ ) or bias-aligned (s(x, y) <τ ) here. For clarity, GA with the pseudo annotations (bias-conflicting or bias-aligned) produced by ECS will be denoted as 'ECS+GA' (similarly, 'ECS+(cid:52)' represents com- bining ECS with method (cid:52)). 050100150200epoch5060708090Unbiased AccuracyVanillaRew (=0.5)Rew (=1.0)Rew (=1.5)Rew (=2.0)GA (=1.5)050001000015000200002500030000iteration0.00.51.01.5bias-conflictingbias-aligned345003500035500360003650037000051e5050001000015000200002500030000iteration0.000.250.500.751.003450035000355003600036500370000.000.01050001000015000200002500030000iteration0.000.250.500.751.00345003500035500360003650037000051e6 Fig. 5: The illustrations of contrastive learning (left) and dense contrastive learning (right). 3.3 Self-supervised pretext tasks contrastive learning loss is formed as: The skewed feature representation is an important factor for the biased model. So, if we can help the model learn richer representation, the bias can be alleviated to some extent. Self-supervised learning has received a lot of attention and made signifi- cant progress in recent years, allowing the model to learn transferable feature representations based on various image regions. Inspired by the desider- ata of debiasing and the ability of self-supervised learning, in this work, we investigate the effi- cacy of self-supervised learning on labeled data for debiasing. Specifically, we further exploit self- supervision as an auxiliary task in the debiased training scheme to pursue unbiased representa- tions. The workflow is illustrated in Figure 2. As examples, in this work, we employ the dense contrastive learning (Wang et al., 2021) and the rotation prediction task (Gidaris et al., 2018) as the pretext tasks. We detail the two tasks below. Other advanced self-supervision techniques can be incorporated into the pipeline similarly. Dense contrastive learning. Contrastive learning has achieved considerable success in self- supervised learning, which encourages the features of the positive pair to be close while pushing the representations of the negative pair away. The positive pair is typically formed by the two aug- mentation views (A0 and A1, Aa stands for the augmentations, here random crop and horizontal flip are employed) of the same image. Following MoCo (He et al., 2020), contrastive learning can be considered as training an encoder for a dic- tionary look-up task as shown in Figure 5 (left). For an encoded query q (derived from A0(x)) and its positive key kp (derived from A1(x)), negative keys {kn1 , kn2, * * * } (maintained in the queue), the 8 (cid:96)cl = − log eq*kp eq*kp + (cid:80) i eq*kni . (8) We omit the temperature here for brevity. Com- monly, the query and keys are encoded at the level of global feature. To compel the model to use richer features, we adopt a "dense" version (Wang et al., 2021) here which considers a dense pair- wise contrastive learning task (at the level of local feature) instead of the global image classification. By replacing the global projection head with the dense projection head as depicted in Figure 5 (right), we can obtain a Z × Z dense feature map. The zth query out of Z 2 encoded queries is denoted as qz, its positive key is denoted as kz p and a negative key is denoted as kz , then the dense ni contrastive learning loss is formed as: (cid:96)dcl = 1 Z 2 Z2 (cid:88) z=1 − log p eqz*kz p + (cid:80) eqz*kz i eqz*kz ni . (9) The pair construction of dense contrastive learning follows Wang et al. (2021) and He et al. (2020). The negative keys are the encoded local features stored in the queue. For the positive key, considering the two views' extracted feature maps before the projection head, by downsam- pling (average pooling) the pre-project features to also have the shape of Z × Z, a similarity matrix with dimension Z 2 × Z 2 can be calculated. Assuming the jth pre-project feature vector from A1(x) is most similar to the ith pre-project feature vector from A0(x). Then for the features after the projection head, we can treat the corresponding jth post-project feature vector from A1(x) as the A'(x)A#(x)A'(x)A#(x)backboneqk(⋯queuek)!contrastivelossq*k(*⋯queuek)!*densecontrastivelossbackbonedenseprojectionheadglobalprojectionhead(a)(b) (a) Colored MNIST (b) Corrupted CIFAR101 (c) Biased Waterbirds (d) Biased CelebA (e) Multi-Color MNIST Fig. 6: Training examples. The height of the cylinder reflects the number of samples, i.e., most training samples are bias-aligned. positive key for the ith post-project feature vector from A0(x). Rotation prediction. The main idea of image rotation prediction is to predict the rotation degree of the deliberately rotated input images, resulting a 4-class classification problem. The loss function for each sample is formulated by: (cid:96)rot = 1 4 3 (cid:88) a=0 (cid:96)(frot(Aa(x)), a), (10) here {A0, A1, A2, A3} is the set of transformations with 4 rotation degrees {0◦, 90◦, 180◦, 270◦}, (cid:96) is the cross-entropy loss. 4 Experiments 4.1 Datasets We mainly conduct experiments on five bench- mark datasets. Some examples from the used datasets are exhibited in Figure 6. For Colored MNIST (C-MNIST), the task is to recognize digits (0 - 9), in which the images of each target class are dyed by the corresponding color with probability ρ ∈ {95%, 98%, 99%, 99.5%} and by other colors with probability 1 − ρ (a higher ρ indicates more severe biases). Similarly, for Corrupted CIFAR10, each object class in it holds a spurious correla- tion with a corruption type. Two sets of corrup- tion protocols are utilized, leading to two biased datasets (Nam et al., 2020): Corrupted CIFAR101 9 and CIFAR102 (C-CIFAR101, C-CIFAR102) with ρ ∈ {95%, 98%, 99%, 99.5%}. Following previous work (Nam et al., 2020), Corrupted CIFAR101 is constructed with corruption types {Snow, Frost, Fog, Brightness, Contrast, Spatter, Elastic, JPEG, Pixelate, Saturate}; Corrupted CIFAR102 is con- structed with corruption types {GaussianNoise, ShotNoise, ImpulseNoise, SpeckleNoise, Gaus- sianBlur, DefocusBlur, GlassBlur, MotionBlur, ZoomBlur, Original }. In Biased Waterbirds (B- Birds)1 which is a composite dataset that superim- poses foreground bird images from CUB (Welinder et al., 2010) onto background environment images from Places (Zhou et al., 2017), "waterbirds" and "landbirds" are highly correlated with "wet" and "dry" habitats (95% bias-aligned samples, i.e., ρ = 95%). Consequently, the task aiming to distinguish images as "waterbird" or "land- bird" can be influenced by background. In Biased CelebA (B-CelebA) which is established for face recognition where each image contains multiple attributes (Liu et al., 2015)2, blond hair is pre- dominantly found in women, whereas non-blond hair mostly appears in men (ρ = 99%). When the goal is to classify the hair color as "blond" or "non-blond", the information of gender ("male" or "female" in this dataset) can be served as a 1The data is available at https://nlp.stanford.edu/data/ dro/waterbird complete95 forest2water2.tar.gz. 2The data is available at http://mmlab.ie.cuhk.edu.hk/ projects/CelebA.html. xxy0123456789xxairplaneautomobilebirdcatdeerdogfroghorseshiptruckxxLandbirdWaterbirdBlondHairNon-BlondHairxxxxLandbirdWaterbirdBlondHairNon-BlondHairxxbias-conflictingw.r.t.rightcolorbias-conflictingw.r.t.leftcolorbias-alignedw.r.t.leftcolorbias-alignedw.r.t.rightcolor shortcut (Nam et al., 2020). To focus on the debi- asing problem, we balance the number of images per target class in B-Birds and B-CelebA. 4.2 Compared methods We choose various methods for comparison: stan- dard ERM (Vanilla), Focal loss (Lin et al., 2017), plain reweighting (Sagawa et al., 2020b) (Rew and ECS+Rew), REBIAS (Bahng et al., 2020), BiasCon (Hong and Yang, 2021), RNF-GT (Du et al., 2021), GEORGE (Sohoni et al., 2020), LfF (Nam et al., 2020), DFA (Kim et al., 2021b), SD (Pezeshki et al., 2020), ERew (Clark et al., 2019) and PoE (Clark et al., 2019) (ECS+ERew and ECS+PoE)3. Among them, REBIAS requires bias types; Rew, BiasCon, RNF-GT, and GA are performed with real bias-conflicting or bias- aligned annotations4. We present a brief analysis of these debiasing approaches as follows based on technique categories. Reweighting-based strategies. Rew is a straightforward static reweighting strategy based on the number of samples per group. Both LfF and ERew reassign sample weights assisted with a biased model but differ in weight assignment functions. ERew is also a static reweighting approach that employs output scores of a pre- trained biased model as the weight indicator. LfF applies dynamic weight adjustments during train- ing. LfF and ERew just reweight a sample with the information from itself, whereas Rew uses global information within one minibatch to obtain sample weight5. Feature disentanglement. REBIAS designs specific networks according to the bias type for obtaining biased representations intentionally (for our experiments, we employ CNNs with smaller receptive fields for capturing texture bias accord- ing to the original paper). Then the debiased representation is learned by encouraging it to be independent of the biased one, during which 3As the auxiliary biased models used in ERew and PoE are designed for NLP tasks, here, we combine our ECS with them. 4As stated in the original papers, BiasCon and RNF-GT have variations that do not require real annotations assist with various auxiliary biased models. We only provide the upper bound of these strategies when combating unknown biases, as we found that the auxiliary models have a significant impact on the outcomes. 5LfF is implemented at https://github.com/alinlab/LfF and ERew is implemented at https://github.com/UKPLab/ emnlp2020-debiasing-unknown. 10 Hilbert-Schmidt Independence Criterion (HSIC) is employed to measure the degree of independence between the two representations. Building on LfF, DFA further introduces disentangled representa- tions to augment bias-conflicting samples at the feature level. The methods try to explicitly extract disentangled feature representations, which is dif- ficult to be achieved in complex datasets and tasks. BiasCon directly uses contrastive learning to pull the same target class but different bias class sample pairs closer than the other pairs6. robust Distributionally optimization (DRO). Many previous studies resort to DRO to achieve model fairness. GEORGE performs clus- tering based on the feature representations of the auxiliary biased models first and then expects to obtain fair models by using DRO with the pseudo groups. However, due to overfitting, we find that clustering with features generated from vanilla biased models is not robust and accurate, result- ing in substantially inferior performance when performing DRO using the imprecise clusters7. Ensemble approaches. Product-of-Experts (PoE) is widely adopted in NLP-related debiasing tasks, which tries to train a debiased model in an ensemble manner with an auxiliary biased model, by combining the softmax outputs produced from the biased and debiased models8. Regularization methods. In addition, SD directly replaces the common l2 regularization with an l2 penalty on the model's logits. The opti- mal strength of the regularization term can be hard to search, which may be very different for various datasets and tasks9. 4.3 Evaluation metrics Following Nam et al. (2020), we mainly report the overall unbiased accuracy, alongside the accuracy of bias-aligned and bias-conflicting test samples individually. For experiments on Colored MNIST, is at implemented implemented 6REBIAS is implemented at https://github.com/clovaai/ https://github.com/ Bias- https://github.com/grayhong/ rebias. DFA is kakaoenterprise/Learning-Debiased-Disentangled. Con bias-contrastive-learning. adopt in GEORGE referring to https://github.com/HazyResearch/ hidden-stratification. 8The method is implemented at https://github.com/ clustering methods utilized 7We the at UKPLab/emnlp2020-debiasing-unknown. 9It is implemented at https://github.com/mohammadpz/ Gradient Starvation. Corrupted CIFAR101 and CIFAR102, we evaluate models on the unbiased test sets in which the bias attributes are independent of the target labels. For Biased Waterbirds and CelebA, to evaluate unbi- ased accuracy with the official test sets which are biased and imbalanced, the accuracies of each (tar- get, bias) group are calculated separately and then averaged to generate the overall accuracy (Nam et al., 2020). We also show the fairness performance in terms of DP and EqOdd (Reddy et al., 2021). For the definitions of DP and EqOdd, following Reddy et al. (2021), let x, y, b, y(cid:48) denote the input, target label, the bias label, and the model's prediction respectively, Demographic Parity (DP) is defined as 1 − |p(y(cid:48) = 1|b = 1) − p(y(cid:48) = 1|b = 0)|; Equality of Opportunity w.r.t y = 1 (EqOpp1) is defined as 1 − |p(y(cid:48) = 1|y = 1, b = 0) − p(y(cid:48) = 1|y = 1, b = 1)| and Equality of Opportunity w.r.t y = 0 (EqOpp0) is defined as 1 − |p(y(cid:48) = 1|y = 0, b = 0) − p(y(cid:48) = 1|y = 0, b = 1)|, Equality of Odds (EqOdd) is defined as 0.5×(EqOpp0 + EqOpp1). 4.4 Implementation The studies for the previous debiasing approaches are usually conducted with varying network archi- tectures and training schedules. We run the rep- resentative methods with identical configurations to make fair comparisons. We use an MLP with three hidden layers (each hidden layer comprises 100 hidden units) for C-MNIST, except for the biased models in REBIAS (using CNN). ResNet- 20 (He et al., 2016) is employed for C-CIFAR101 and C-CIFAR102. ResNet-18 is utilized for B- Birds and B-CelebA. We implement all methods with PyTorch (Paszke et al., 2019) and run them on a Tesla V100 GPU. For experiments on Colored MNIST, we use Adam optimizer to train mod- els for 200 epochs with learning rate 0.001, batch size 256, without any data augmentation tech- niques. For Corrupted CIFAR101 and CIFAR102, models are trained for 200 epochs with Adam learning rate 0.001, batch size 256, optimizer, image augmentation including only random crop and horizontal flip. For Biased Waterbirds and CelebA, models are trained from imagenet pre- trained weights (Pytorch torchvision version) for 100 epochs with Adam optimizer, learning rate 0.0001, batch size 256, and horizontal flip aug- mentation technique. Dense contrastive learning 11 is utilized on B-Birds and rotation prediction is employed on C-CIFAR101 and C-CIFAR102 (as we find dense prediction is not suitable for images with very small resolution). The code and README are provided in the supplementary material. 4.5 Main results We present the main experimental results in this section. Due to the self-supervised pretext tasks will increase the training cost (but no infer- ence latency), we split the comparison into two parts: without the self-supervised pretext tasks (in Section 4.5.1) and with them (in Section 4.5.2). 4.5.1 Without self-supervision The proposed method achieves better per- formance than others. The overall unbiased accuracy is reported in Table 1. Vanilla models commonly fail to produce acceptable results on unbiased test sets, and the phenomenon is aggra- vated as ρ goes larger. Different debiasing methods moderate bias propagation with varying degrees of capability. When compared to other SOTA methods, the proposed approach achieves com- petitive results on C-CIFAR101 and noticeable improvements on other datasets across most val- ues of ρ. For instance, the vanilla model trained on C-CIFAR102 (ρ = 99%) only achieves 20.6% unbi- ased accuracy, indicating that the model is heavily biased. While, ECS+GA leads to 50.0% accuracy, and exceeds other prevailing debiasing methods by 3% - 30%. When applied to the real-world dataset B-CelebA, the proposed scheme also shows supe- rior results, demonstrating that it can effectively deal with subtle actual biases. Though the main purpose of this work is to combat unknown biases, we find GA also achieves better performance com- pared to the corresponding competitors when the prior information is available. We provide the accuracy measured on the bias-aligned and bias-conflicting test samples sep- arately in Figure 7. We find ECS+GA can achieve high bias-conflicting accuracy as well as bias- aligned accuracy mostly, leading to superior over- all unbiased performance. Note that, too high bias-aligned accuracy is not always good. Though the vanilla model can obtain a very high illusory bias-aligned accuracy assisted with biases, it does not learn intrinsic features as shown in Figure 11, A b e l e C B - s d r i B B - 2 0 1 R A F I C d e t p u r r o C 1 0 1 R A F I C d e t p u r r o C T S I N M d e r o l o C % 9 9 % 5 9 % 5 . 9 9 % 9 9 % 8 9 % 5 9 % 5 . 9 9 % 9 9 % 8 9 % 5 9 % 5 . 9 9 % 9 9 % 8 9 % 5 9 ρ † . d l o b n i n w o h s e r a s e s a i b n w o n k n u h t i w s t l u s e r t s e B . s n u r e e r h t r e v o n o i t a i v e d d r a d n a t s d n a ) % ( y c a r u c c a d e s a i b n u l l a r e v O : 1 e l b a T . s a i b i g n d r a g e r e g d e l w o n k r o i r p s e r i u q e r d o h t e m e h t t a h t s e t a c i d n i 6 . 1 ± 4 . 7 7 0 . 1 ± 1 . 8 7 9 . 0 ± 2 . 8 7 5 . 1 ± 4 . 4 8 6 . 0 ± 3 . 4 8 1 . 1 ± 8 . 7 7 4 . 0 ± 3 . 8 8 6 . 0 ± 5 . 0 8 1 . 0 ± 1 . 1 8 5 . 1 ± 1 . 7 7 7 . 0 ± 6 . 8 7 9 . 0 ± 3 . 9 7 1 . 1 ± 4 . 0 8 7 . 0 ± 5 . 9 7 3 . 1 ± 8 . 6 7 7 . 0 ± 7 . 2 8 9 . 0 ± 9 . 4 8 6 . 0 ± 8 . 5 8 5 . 0 ± 5 . 9 8 5 . 0 ± 1 . 6 8 2 . 1 ± 1 . 8 7 4 . 0 ± 7 . 0 9 7 . 2 ± 1 . 5 8 2 . 1 ± 4 . 0 9 2 . 0 ± 3 . 2 9 6 . 0 ± 5 . 7 7 4 . 0 ± 0 . 6 8 3 . 1 ± 2 . 1 8 6 . 0 ± 1 . 4 8 5 . 0 ± 9 . 7 8 8 . 0 ± 4 . 7 1 2 . 0 ± 0 . 7 1 3 . 0 ± 7 . 7 1 2 . 1 ± 4 . 3 3 9 . 1 ± 2 . 5 3 3 . 0 ± 5 . 7 1 6 . 0 ± 3 . 0 4 6 . 1 ± 9 . 5 2 3 . 2 ± 4 . 2 4 8 . 0 ± 8 . 1 4 3 . 0 ± 9 . 7 1 6 . 0 ± 2 . 1 4 4 . 0 ± 8 . 9 1 8 . 0 ± 4 . 7 3 8 . 0 ± 6 . 3 4 5 . 0 ± 6 . 0 2 6 . 0 ± 0 . 1 2 2 . 1 ± 7 . 0 2 1 . 1 ± 2 . 2 4 2 . 2 ± 5 . 1 4 2 . 0 ± 0 . 0 2 2 . 1 ± 4 . 7 4 9 . 0 ± 4 . 1 4 5 . 2 ± 8 . 6 3 6 . 0 ± 2 . 7 2 5 . 0 ± 9 . 6 2 6 . 1 ± 3 . 7 2 4 . 0 ± 0 . 9 4 6 . 0 ± 7 . 8 4 8 . 0 ± 0 . 7 2 3 . 0 ± 2 . 3 5 2 . 0 ± 1 . 1 5 3 . 1 ± 3 . 0 4 9 . 0 ± 7 . 2 4 5 . 0 ± 9 . 1 4 9 . 1 ± 2 . 4 4 8 . 0 ± 5 . 8 5 2 . 0 ± 6 . 8 5 3 . 0 ± 4 . 1 4 7 . 0 ± 4 . 1 6 5 . 0 ± 2 . 2 6 8 . 0 ± 9 . 7 4 5 . 1 ± 0 . 0 5 6 . 0 ± 0 . 7 5 3 . 0 ± 1 . 4 6 6 . 0 ± 6 . 0 2 1 . 1 ± 9 . 6 4 6 . 0 ± 9 . 7 2 4 . 0 ± 0 . 3 4 3 . 0 ± 1 . 1 5 6 . 0 ± 0 . 7 2 8 . 0 ± 1 . 3 5 5 . 0 ± 9 . 4 3 3 . 0 ± 9 . 9 4 2 . 0 ± 9 . 6 5 0 . 1 ± 5 . 1 4 2 . 0 ± 1 . 1 6 0 . 1 ± 3 . 0 5 3 . 0 ± 0 . 0 6 2 . 0 ± 5 . 4 6 9 . 0 ± 9 . 7 1 5 . 0 ± 8 . 7 1 6 . 0 ± 9 . 7 1 3 . 2 ± 6 . 4 3 6 . 4 ± 6 . 5 3 6 . 0 ± 7 . 7 1 2 . 1 ± 4 . 3 3 3 . 1 ± 2 . 0 3 8 . 0 ± 4 . 2 2 1 . 1 ± 9 . 2 2 3 . 0 ± 8 . 1 2 8 . 2 ± 9 . 2 4 7 . 4 ± 8 . 1 4 9 . 0 ± 6 . 1 2 1 . 1 ± 6 . 8 3 2 . 0 ± 5 . 8 3 8 . 0 ± 7 . 2 4 5 . 0 ± 0 . 5 3 3 . 1 ± 6 . 5 4 7 . 0 ± 6 . 2 4 3 . 0 ± 7 . 7 1 4 . 1 ± 4 . 3 3 4 . 0 ± 2 . 2 2 3 . 0 ± 4 . 2 3 8 . 0 ± 9 . 3 3 1 . 1 ± 4 . 2 2 4 . 0 ± 4 . 0 4 3 . 1 ± 6 . 0 3 4 . 0 ± 0 . 9 3 6 . 1 ± 5 . 3 4 0 . 1 ± 4 . 0 3 1 . 1 ± 7 . 0 3 0 . 1 ± 5 . 9 2 5 . 0 ± 4 . 0 5 3 . 2 ± 0 . 0 5 5 . 1 ± 6 . 8 2 6 . 0 ± 5 . 7 4 0 . 1 ± 9 . 7 4 3 . 1 ± 7 . 8 4 0 . 1 ± 9 . 4 4 0 . 1 ± 5 . 5 4 0 . 1 ± 6 . 4 4 8 . 0 ± 6 . 9 5 8 . 1 ± 2 . 8 5 5 . 0 ± 1 . 3 4 0 . 0 ± 5 . 8 5 5 . 0 ± 8 . 9 5 2 . 0 ± 4 . 4 5 8 . 0 ± 4 . 5 4 9 . 0 ± 9 . 5 4 2 . 0 ± 4 . 6 4 9 . 0 ± 2 . 3 7 8 . 0 ± 1 . 4 7 1 . 1 ± 4 . 2 4 9 . 0 ± 9 . 8 7 2 . 2 ± 3 . 1 7 0 . 3 ± 0 . 0 5 6 . 0 ± 7 . 0 6 3 . 0 ± 4 . 2 6 6 . 0 ± 4 . 2 6 2 . 1 ± 3 . 0 8 1 . 1 ± 8 . 1 8 5 . 0 ± 7 . 9 5 3 . 0 ± 2 . 4 8 9 . 0 ± 4 . 1 8 7 . 2 ± 4 . 4 6 5 . 0 ± 6 . 3 7 6 . 0 ± 8 . 5 7 9 . 0 ± 2 . 6 7 6 . 0 ± 7 . 6 8 4 . 0 ± 9 . 6 8 2 . 0 ± 9 . 3 7 7 . 0 ± 6 . 8 8 2 . 0 ± 5 . 7 8 4 . 1 ± 4 . 5 7 1 . 0 ± 7 . 5 8 2 . 0 ± 7 . 6 8 5 . 0 ± 0 . 7 8 9 . 0 ± 2 . 8 8 2 . 0 ± 8 . 9 8 3 . 0 ± 7 . 6 8 2 . 0 ± 8 . 1 9 2 . 0 ± 0 . 1 9 5 . 1 ± 2 . 0 8 5 . 0 ± 7 . 1 5 1 . 0 ± 0 . 1 6 8 . 0 ± 9 . 9 7 5 . 0 ± 4 . 6 8 4 . 0 ± 5 . 9 8 1 . 0 ± 1 . 2 9 7 . 0 ± 9 . 9 2 8 . 0 ± 9 . 8 4 2 . 1 ± 1 . 9 3 6 . 0 ± 6 . 8 4 3 . 0 ± 9 . 2 5 3 . 0 ± 8 . 4 4 2 . 0 ± 1 . 9 5 7 . 0 ± 1 . 2 5 6 . 0 ± 0 . 9 5 8 . 0 ± 5 . 1 6 4 . 0 ± 5 . 4 4 7 . 0 ± 6 . 7 7 7 . 5 ± 1 . 9 5 5 . 1 ± 0 . 9 7 5 . 0 ± 4 . 0 8 8 . 0 ± 1 . 1 6 6 . 0 ± 8 . 3 8 2 . 8 ± 3 . 6 6 0 . 0 ± 0 . 3 8 4 . 0 ± 7 . 5 8 7 . 0 ± 0 . 4 7 4 . 0 ± 9 . 7 8 6 . 3 ± 9 . 5 7 1 . 0 ± 7 . 6 8 2 . 0 ± 1 . 9 8 6 . 0 ± 5 . 5 8 0 . 0 ± 5 . 1 9 1 . 4 ± 3 . 4 8 1 . 0 ± 9 . 0 9 3 . 0 ± 4 . 2 9 E G R O E G a l l i n a V l a c o F A F D F L f D S w e R E + S C E w e R + S C E E o P + S C E A G + S C E S A I B E R w e R T G - F N R † † † n o C s a i B † A G † 12 A b e l e C B - s d r i B B - 2 0 1 R A F I C d e t p u r r o C 1 0 1 R A F I C d e t p u r r o C T S I N M d e r o l o C % 9 9 % 5 9 % 5 . 9 9 % 9 9 % 8 9 % 5 9 % 5 . 9 9 % 9 9 % 8 9 % 5 9 % 5 . 9 9 % 9 9 % 8 9 % 5 9 ρ . d l o b n i e r a s e s a i b n w o n k n u h t i w s t l u s e r t s e B . ) % ( s n u r 3 r e v o h c o p e t s a l e h t f o n o i t a i v e d d r a d n a t s d n a y c a r u c c a d e s a i b n u l l a r e v O : 2 e l b a T . s e s a i b i g n d r a g e r e g d e l w o n k r o i r p e r i u q e r y e h t t a h t s e t a c i d n i † 0 . 1 ± 0 . 1 7 8 . 0 ± 8 . 1 7 4 . 0 ± 5 . 0 7 2 . 1 ± 0 . 1 6 7 . 3 ± 2 . 3 7 4 . 0 ± 6 . 0 7 9 . 5 ± 5 . 0 8 4 . 0 ± 9 . 4 7 1 . 0 ± 5 . 4 7 8 . 0 ± 7 . 5 7 3 . 0 ± 4 . 6 7 3 . 0 ± 3 . 6 7 0 . 2 ± 9 . 6 7 1 . 1 ± 5 . 4 7 9 . 0 ± 0 . 6 7 6 . 0 ± 2 . 7 7 0 . 2 ± 8 . 0 8 2 . 2 ± 2 . 3 8 3 . 0 ± 2 . 4 1 2 . 0 ± 5 . 4 1 9 . 0 ± 8 . 4 1 0 . 1 ± 3 . 1 3 6 . 2 ± 5 . 3 3 1 . 0 ± 5 . 4 1 4 . 1 ± 1 . 1 3 7 . 0 ± 8 . 0 2 8 . 1 ± 6 . 9 3 5 . 0 ± 5 . 8 1 1 . 0 ± 2 . 8 1 6 . 1 ± 5 . 8 1 4 . 1 ± 5 . 0 4 7 . 2 ± 1 . 9 3 9 . 0 ± 8 . 7 1 8 . 2 ± 5 . 9 3 6 . 2 ± 2 . 5 3 6 . 1 ± 7 . 5 3 3 . 1 ± 3 . 5 2 4 . 1 ± 3 . 5 2 4 . 2 ± 4 . 5 2 2 . 0 ± 3 . 7 4 2 . 1 ± 0 . 6 4 2 . 0 ± 3 . 3 2 1 . 1 ± 8 . 8 4 0 . 1 ± 6 . 5 4 3 . 0 ± 9 . 7 3 6 . 0 ± 3 . 9 3 0 . 1 ± 2 . 9 3 1 . 1 ± 4 . 1 4 8 . 0 ± 8 . 7 5 9 . 0 ± 5 . 6 5 5 . 0 ± 5 . 8 3 4 . 0 ± 6 . 6 5 6 . 0 ± 7 . 9 5 5 . 1 ± 7 . 6 4 8 . 1 ± 4 . 7 8 9 . 0 ± 5 . 5 8 5 . 0 ± 5 . 0 4 2 . 1 ± 3 . 9 4 6 . 2 ± 4 . 5 5 6 . 0 ± 2 . 2 6 3 . 0 ± 4 . 0 7 1 . 5 ± 8 . 2 8 9 . 2 ± 6 . 4 7 2 . 1 ± 2 . 5 7 4 . 0 ± 8 . 1 9 4 . 0 ± 5 . 5 7 5 . 0 ± 8 . 8 7 2 . 1 ± 0 . 9 7 1 . 1 ± 5 . 8 7 5 . 0 ± 7 . 7 8 3 . 0 ± 3 . 4 1 1 . 2 ± 7 . 2 3 6 . 0 ± 4 . 9 1 2 . 0 ± 3 . 8 2 9 . 0 ± 6 . 2 4 0 . 1 ± 3 . 8 1 6 . 0 ± 3 . 0 4 7 . 0 ± 4 . 5 2 1 . 1 ± 4 . 3 3 8 . 0 ± 1 . 0 5 1 . 1 ± 8 . 3 2 8 . 1 ± 5 . 7 4 0 . 1 ± 8 . 2 3 1 . 1 ± 0 . 2 4 3 . 0 ± 8 . 5 5 0 . 1 ± 9 . 8 3 0 . 1 ± 6 . 6 5 8 . 0 ± 5 . 7 4 8 . 0 ± 3 . 6 5 0 . 1 ± 8 . 2 6 8 . 0 ± 6 . 5 1 7 . 0 ± 8 . 4 1 0 . 1 ± 7 . 4 1 0 . 2 ± 1 . 2 3 0 . 4 ± 4 . 3 3 2 . 0 ± 9 . 4 1 8 . 1 ± 4 . 9 2 6 . 0 ± 0 . 4 2 9 . 0 ± 4 . 9 3 4 . 0 ± 3 . 4 3 3 . 1 ± 9 . 4 1 9 . 1 ± 5 . 8 2 5 . 0 ± 9 . 1 2 6 . 0 ± 1 . 7 2 0 . 1 ± 8 . 2 3 0 . 1 ± 8 . 9 1 9 . 0 ± 9 . 0 2 1 . 0 ± 1 . 9 1 9 . 1 ± 8 . 9 3 1 . 5 ± 5 . 9 3 2 . 1 ± 3 . 9 1 5 . 0 ± 2 . 4 3 2 . 1 ± 6 . 4 3 0 . 1 ± 4 . 0 4 0 . 1 ± 7 . 7 2 0 . 2 ± 6 . 7 2 3 . 0 ± 3 . 7 2 7 . 0 ± 4 . 9 4 8 . 1 ± 9 . 7 4 3 . 0 ± 0 . 5 2 1 . 1 ± 6 . 2 4 3 . 0 ± 1 . 4 4 2 . 2 ± 3 . 5 4 4 . 0 ± 6 . 2 4 4 . 1 ± 6 . 3 4 7 . 1 ± 3 . 1 4 1 . 2 ± 7 . 6 5 5 . 0 ± 8 . 4 5 7 . 0 ± 5 . 0 4 4 . 0 ± 0 . 6 5 2 . 1 ± 2 . 7 5 6 . 0 ± 8 . 2 5 0 . 1 ± 2 . 3 4 7 . 0 ± 2 . 4 4 2 . 1 ± 8 . 3 4 5 . 1 ± 8 . 7 6 8 . 0 ± 7 . 5 6 9 . 0 ± 9 . 9 3 0 . 6 ± 3 . 8 5 5 . 1 ± 4 . 1 5 3 . 2 ± 1 . 9 4 6 . 0 ± 5 . 9 5 8 . 0 ± 7 . 1 6 9 . 0 ± 1 . 0 6 1 . 3 ± 8 . 8 6 2 . 3 ± 0 . 6 7 2 . 0 ± 4 . 8 5 7 . 0 ± 4 . 7 6 6 . 3 ± 5 . 8 6 5 . 2 ± 1 . 4 6 6 . 0 ± 5 . 3 7 4 . 0 ± 2 . 5 7 8 . 0 ± 3 . 4 7 3 . 0 ± 1 . 5 7 9 . 1 ± 2 . 1 8 3 . 0 ± 6 . 3 7 2 . 0 ± 6 . 9 7 6 . 2 ± 7 . 1 8 5 . 1 ± 0 . 5 7 2 . 0 ± 3 . 5 8 2 . 0 ± 7 . 6 8 2 . 0 ± 7 . 6 8 8 . 1 ± 0 . 8 7 9 . 0 ± 6 . 3 8 3 . 0 ± 3 . 6 8 2 . 0 ± 7 . 7 8 2 . 0 ± 8 . 8 8 5 . 1 ± 1 . 0 8 3 . 0 ± 9 . 0 4 0 . 1 ± 8 . 0 5 5 . 0 ± 6 . 9 5 5 . 0 ± 7 . 8 7 7 . 0 ± 6 . 4 8 1 . 1 ± 9 . 8 8 2 . 0 ± 8 . 1 9 6 . 0 ± 2 . 0 2 5 . 0 ± 7 . 4 3 8 . 1 ± 6 . 7 2 8 . 0 ± 6 . 1 3 2 . 2 ± 8 . 1 4 0 . 1 ± 5 . 8 2 8 . 1 ± 3 . 5 4 0 . 1 ± 1 . 6 3 3 . 0 ± 9 . 0 4 6 . 1 ± 9 . 9 4 1 . 1 ± 8 . 2 4 3 . 0 ± 9 . 5 5 7 . 0 ± 7 . 0 5 8 . 0 ± 2 . 6 5 3 . 1 ± 1 . 9 5 5 . 0 ± 8 . 2 4 2 . 1 ± 8 . 1 5 7 . 1 ± 8 . 8 4 9 . 0 ± 3 . 6 5 3 . 1 ± 7 . 7 7 9 . 0 ± 8 . 0 6 9 . 0 ± 5 . 5 6 4 . 1 ± 8 . 3 6 9 . 0 ± 9 . 0 7 4 . 0 ± 4 . 4 8 3 . 0 ± 4 . 3 7 2 . 0 ± 2 . 9 7 3 . 3 ± 8 . 3 7 7 . 0 ± 4 . 9 7 3 . 0 ± 6 . 8 8 5 . 0 ± 3 . 5 8 4 . 0 ± 1 . 8 8 8 . 3 ± 0 . 3 8 7 . 0 ± 0 . 8 8 4 . 0 ± 1 . 2 9 E G R O E G a l l i n a V l a c o F A F D F L f D S w e R E + S C E w e R + S C E E o P + S C E A G + S C E S A I B E R w e R T G - F N R † † † n o C s a i B † A G † (a) Colored MNIST with ρ = 95%, 98%, 99%, 99.5% from left to right. (b) Biased Water- birds (c) Corrupted CIFAR101 with ρ = 95%, 98%, 99%, 99.5% from left to right. (d) Biased CelebA (e) Corrupted CIFAR102 with ρ = 95%, 98%, 99%, 99.5% from left to right. Fig. 7: Bias-aligned accuracy (horizontal-axis) and bias-conflicting accuracy (vertical-axis). leading to extremely pool out-of-distribution gen- eralization. As an instance, although the vanilla model trained on Corrupted CIFAR102 (ρ = 99%) achieves high bias-aligned accuracy (99.6%), the value (99.6%) actually reflects the model's ability to discriminate bias attribute rather than target attribute. In fact, when training on an unbiased training set (ρ = 10%), the corresponding accu- racy is only 79.5%, reflecting that the real target task is harder to learn than the spurious one. Plain reweighting is an important base- line. We find Rew (and ECS+Rew) can achieve surprising results compared with recent state-of- the-art methods, while it is overlooked by some studies. The results also indicate that explic- itly balancing the bias-aligned and bias-conflicting samples is extremely important and effective. Early-stopping is not necessary for GA to select models. Plain reweighting requires strong regularizations such as early-stopping to produce satisfactory results (Byrd and Lipton, 2019; Sagawa et al., 2020a), implying that the Table 3: Performance in terms of DP and EqOdd on Biased Waterbirds (left) and Biased CelebA (right). DP ↑ EqOdd ↑ DP ↑ EqOdd ↑ 0.57±0.01 0.43±0.02 0.43±0.01 0.57±0.01 Vanilla 0.61±0.03 0.80±0.06 0.76±0.07 0.63±0.03 LfF 0.76±0.06 0.69±0.01 0.55±0.02 0.55±0.01 DFA ECS+Rew 0.61±0.02 0.68±0.18 0.59±0.01 0.60±0.01 ECS+GA 0.99±0.01 0.99±0.01 0.73±0.02 0.91±0.02 results are not stable. Due to the nature of com- bating unknown biases, the unbiased validation set is not available, thus recent studies choose to report the best results among epochs (Nam et al., 2020; Kim et al., 2021b) for convenient compari- son. We follow this evaluation protocol in Table 1. However, in the absence of prior knowledge, decid- ing when to stop can be troublesome, thus some results in Table 1 are excessively optimistic. We claim that if the network can attain dynamic balance throughout the training phase, such early- stopping may not be necessary. We further provide 13 204673100bias-aligned accuracy (%)65748392bias-conflicting accuracy (%)VanillaECS+RewFocalREBIASGEORGELfFDFASDECS+ERewECS+PoEECS+GA204673100bias-aligned accuracy (%)60708089bias-conflicting accuracy (%)204673100bias-aligned accuracy (%)43577185bias-conflicting accuracy (%)204673100bias-aligned accuracy (%)23416078bias-conflicting accuracy (%)20467399bias-aligned accuracy (%)41577287bias-conflicting accuracy (%)204673100bias-aligned accuracy (%)24354758bias-conflicting accuracy (%)204673100bias-aligned accuracy (%)6213550bias-conflicting accuracy (%)204673100bias-aligned accuracy (%)0132639bias-conflicting accuracy (%)204673100bias-aligned accuracy (%)582236bias-conflicting accuracy (%)204673100bias-aligned accuracy (%)31496785bias-conflicting accuracy (%)204673100bias-aligned accuracy (%)21354862bias-conflicting accuracy (%)204673100bias-aligned accuracy (%)4213855bias-conflicting accuracy (%)204673100bias-aligned accuracy (%)2153249bias-conflicting accuracy (%)204673100bias-aligned accuracy (%)692540bias-conflicting accuracy (%) Table 4: The effectiveness of self-supervision. The overall unbiased accuracy and standard deviation of the last epoch over 3 runs (%) are reported. Best results with unknown biases are in bold. † indicates that they require prior knowledge regarding biases. ρ 95% 98% 99% 99.5% 95% 98% 99% 99.5% Corrupted CIFAR101 Corrupted CIFAR102 Vanilla +SS 42.6±0.4 51.8±0.8 ECS+GA 59.6±0.5 63.5±0.6 59.1±1.3 63.6±0.6 †GA +SS +SS 27.7±1.0 38.5±1.2 50.8±1.0 55.7±2.2 49.9±1.6 57.0±0.5 19.8±1.0 29.8±0.9 40.9±0.3 50.1±0.6 41.8±2.2 52.2±1.2 15.6±0.8 23.7±0.5 34.3±0.4 44.5±0.4 32.8±1.0 45.6±1.1 39.3±0.6 47.9±1.4 62.2±0.6 65.1±1.9 62.8±1.0 64.7±0.9 25.3±1.3 34.5±1.0 55.4±2.6 59.0±1.2 55.8±0.3 59.9±0.5 18.5±0.5 26.4±0.5 49.3±1.2 55.0±1.1 50.1±0.8 56.5±0.4 14.2±0.3 20.2±0.2 40.5±0.5 48.6±0.8 42.6±0.9 50.6±0.7 B-Birds 95% 75.7±0.8 80.8±0.6 85.5±0.9 86.9±0.3 87.7±0.5 89.5±0.0 the last epoch results in Table 2 to validate it. We find that some methods suffer from serious perfor- mance degradation. On the contrary, GA achieves steady results (with the same and fair training configurations). In other words, our method shows superiority under two model selection strategies simultaneously. The proposed method has strong perfor- mance on fairness metrics as well. As shown in Table 3, the proposed method also obtains sig- nificant improvement in terms of DP and EqOdd. These results further demonstrate that the pro- posed method is capable of balancing bias-aligned and bias-conflicting samples, as well as producing superior and impartial results. 4.5.2 With self-supervision Self-supervision improves vanilla training. As shown in Table 4, the self-supervised pretext tasks achieve obvious improvement over vanilla training, demonstrating the effectiveness of self- supervision in the context of debiasing. Self-supervision also promotes advanced debiasing methods. As shown in Table 4, the self-supervised pretext tasks also lead to signif- icant gains on the basis of different debiasing methods and on a variety of datasets. When the training is heavily biased, the improvement is very significant, e.g., 10.2% and 8.1% gains on C-CIFAR101 and C-CIFAR102 (ρ = 99.5%) beyond our method ECS+GA, respectively. Due to the low diversity of the bias-conflicting samples within the severely biased training data, the gain of ECS+GA may be limited, but self-supervision helps the model discover more general character- istics from the adequate bias-aligned examples. 14 5 Further analysis 5.1 ECS shows superior ability to mine bias-conflicting samples We separately verify the effectiveness of each component of ECS on C-MNIST (ρ = 98%) and B-CelebA. A good bias-conflicting scoring method should prompt superior precision-recall curves for the mined bias-conflicting samples, i.e., give real bias-conflicting (aligned) samples high (low) scores. Therefore, we provide the average precision (AP) in Table 5 (P-R curves are illus- trated in Figure 8). When comparing #0, #4, #5, and #6, we observe that epoch-ensemble, confident-picking and peer model all can improve the scoring method. In addition, as shown in Table 1, ECS+GA achieves results similar to GA with the help of ECS; ERew, PoE, and Rew com- bined with ECS also successfully alleviate biases to some extent, demonstrating that the proposed ECS is feasible, robust, and can be adopted in a variety of debiasing approaches. We further compare the methods: #1 collect- ing results with early-stopping (ES) in JTT (Liu et al., 2021), #2 training auxiliary biased model with GCE loss in LfF (and #3 collecting results with epoch-ensemble on top of it). When com- paring #1 and #4, both early-stopping and epoch-ensemble can reduce the overfitting to bias- conflicting samples when training biased models, yielding more accurate scoring results. However, early-stopping is laborious to tune (Liu et al., 2021), whereas epoch-ensemble is more straight- forward and robust. From #2 and #3, we see that epoch-ensemble can also enhance other strategies. Comparing #3 and #5, GCE loss is helpful, while confident-picking gains better results. Noting that Table 5: Average precision (%) of the mined bias-conflicting samples. VM: scoring with vanilla model. Epoch-Ensemble Confident-Picking Peer Model C-MNIST B-CelebA #0 VM #1 ES (in JTT) #2 GCE (in LfF) #3 GCE + EE #4 ECS (Ours) #5 ECS (Ours) #6 ECS (Ours) (cid:88) (cid:88) (cid:88) (cid:88) 27.0 45.6 37.0 89.3 53.8 95.0 98.8 13.3 47.9 27.8 52.1 46.5 61.5 67.6 (cid:88) (cid:88) (cid:88) Table 6: Results (precision, recall, and unbi- ased accuracy) of GA combined with different bias-conflicting scoring methods. Colored MNIST (ρ = 98%) P (%) R (%) Acc (%) Biased CelebA P (%) R (%) Acc (%) #0+GA 90.9 #1+GA 96.4 #2+GA 98.6 #3+GA 98.9 #4+GA 98.5 #5+GA 99.8 #6+GA 99.9 Vanilla - 0.8 2.2 23.4 45.7 5.5 67.9 84.8 - 49.2 58.9 76.6 86.3 62.7 88.9 89.5 73.6 77.8 79.2 79.6 79.3 79.8 79.2 79.1 - 1.5 20.6 16.9 27.3 16.2 39.6 50.0 - 78.9 86.2 84.2 86.2 82.8 87.9 89.1 77.4 Table 6 (for fairness, all methods are compared under a similar precision), which show all the pro- posed components contribute to a more robust model in stage II. Finally, we provide the precision and recall of our mined bias-conflicting samples with the help of ECS and the typical value of τ (0.8) in Table 7. 5.2 Differences between GA and its counterparts Focal loss, LfF, DFA, and ERew just reweight a sample with the information from itself (individ- ual information), different from them, GA, as well as Rew, use global information within one batch to obtain modulation weight. Correspondingly, the methods based on individual sample informa- tion can not maintain the contribution balance between bias-aligned and bias-conflicting samples, which is crucial for this problem as presented in Section 4.5. Different from the static rebalance method Rew, we propose a dynamic rebalance training strategy with aligned gradient contri- butions throughout the learning process, which enforces models to dive into intrinsic features instead of spurious correlations. Learning with Fig. 8: Precision-recall curves of different bias- conflicting scoring methods on Colored MNIST (ρ = 98%, left) and Biased CelebA (right). Fig. 9: Visualizations of the predictions of peer models (during training). though co-training with peer model raises some costs, it is not computationally complex and can yield significant benefits (#6), and even without peer model, #5 still outperform previous ways. Peer models are expected to better prevent bias- conflicting samples from affecting the training, so we can get better auxiliary biased models. Though the only difference between peer models is initial- ization in our experiments, as DNNs are highly nonconvex, different initializations can lead to dif- ferent local optimal (Han et al., 2018). We provide the visualizations of the predictions of peer models (during training) in Figure 9. We also provide the results of GA combined with the above bias-conflicting scoring variants in 15 0.00.51.0Recall0.00.20.40.60.81.0Precision#0 AP=27.0#1 AP=45.6#2 AP=37.0#3 AP=89.3#4 AP=53.8#5 AP=95.0#6 AP=98.80.00.51.0Recall0.00.20.40.60.81.0Precision#0 AP=13.3#1 AP=47.9#2 AP=27.8#3 AP=52.1#4 AP=46.5#5 AP=61.5#6 AP=67.60.000.250.500.751.00p(yj|f(xj))0.00.20.40.60.81.0p(yj|f(xj))(real) bias-aligned(real) bias-conflicting0.000.250.500.751.00p(yj|f(xj))0.00.20.40.60.81.0p(yj|f(xj))(real) bias-aligned(real) bias-conflicting Fig. 10: Ablation on thresholds η, τ and balance ratio γ. Table 7: Precision and recall (%) of the mined bias-conflicting samples with ECS. Table 8: Average precision of the mined bias- conflicting samples on Colored MNIST (ρ = 98%). ρ Precision Recall #auxiliary biased models 1 2 4 Colored MNIST Corrupted CIFAR101 Corrupted CIFAR102 95% 98% 99% 99.5% 95% 98% 99% 99.5% 95% 98% 99% 99.5% B-Birds 95% B-CelebA 99% 99.5 99.9 99.8 99.6 96.3 92.3 87.6 76.0 99.2 98.3 97.3 93.3 77.7 79.1 70.0 84.8 89.3 92.7 92.4 94.2 93.2 94.8 94.2 94.9 95.0 94.8 65.2 50.0 GA, as demonstrated in Figure 3 and Table 2, pro- duces improved results with no degradation. The impact of GA on the learning trajectory presented in Figure 4 also shows that GA can schedule the optimization processes and take full advantage of the potential of different samples. Besides, unlike the methods for class imbalance (Cui et al., 2019; Tan et al., 2021; Zhao et al., 2020), we try to rebal- ance the contributions of implicit groups rather than explicit categories. 5.3 The sensitivity of the introduced hyper-parameters Though the hyper-parameters are critical for methods aimed at combating unknown biases, recent studies (Nam et al., 2020; Kim et al., 2021b) did not include an analysis for them. Here, we present the ablation studies on C-MNIST (ρ = 98%) for the hyper-parameters (η, τ , γ) in our method as shown in Figure 10. We find that 16 AP (%) 95.0 98.8 99.0 the method performs well under a wide range of hyper-parameters. Specifically, for the confidence threshold η in ECS, when η → 0, most samples will be used to train the auxiliary biased models, including the bias-conflicting ones, resulting in low b-c scores for bias-conflicting samples (i.e., low recall of the mined bias-conflicting samples); when η → 1, most samples will be discarded, including the relative hard but bias-aligned ones, leading to high b-c scores for bias-aligned samples (i.e., low precision). The determination of η is related to the number of categories and the difficulty of tasks, e.g., 0.5 for C-MNIST, 0.1 for C-CIFAR101 and C-CIFAR102 (10-class classification tasks), 0.9 for B-Birds and B-CelebA (2-class) here. As depicted in Figure 10, ECS achieves consistent strong min- ing performance around the empirical value of η. We also investigate ECS+GA with varying τ . High precision of the mined bias-conflicting samples guarantees that GA can work in stage II, and high recall further increases the diversity of the empha- sized samples. Thus, to ensure the precision first, τ is typically set to 0.8 for all experiments. From Figure 10, ECS+GA is insensitive to τ around the empirical value, however, a too high or too low value can cause low recall or low precision, result- ing in inferior performance finally. For the balance ratio γ, though the results are reported with γ = 1.6 for all settings on C-MNIST, C-CIFAR101 and C-CIFAR102, 1.0 for B-Birds and B-CelebA, the proposed method is not sensitive to γ ∈ [1.0, 2.0], which is reasonable as γ in such region makes the contributions from bias-conflicting samples close to that from bias-aligned samples. 0.00.20.40.6020406080100Average Precision (%)ECS (Ours)VM0.000.250.500.751.00707580859095Unbiased Accuracy (%)ECS+GA (Ours)Vanilla1.001.251.501.752.005060708090100Unbiased Accuracy (%)ECS+GA (Ours)Vanilla Table 9: Accuracies (%) on four test groups of Multi-Color MNIST. '∞' states the reported results from DebiAN. The first line of the header w.r.t. left color bias, the second one w.r.t. right color bias. aligned aligned conflicting aligned conflicting conflicting conflicting aligned Avg. LfF∞ 99.6 PGI∞ 98.6 EIIL∞ 100.0 DebiAN∞ 100.0 4.7 82.6 97.2 95.6 ECS+GA 100.0 89.7 98.6 26.6 70.8 76.5 96.1 5.1 9.5 10.9 16.0 52.0 54.3 69.7 72.0 24.3 77.5 Table 10: Unbiased Accuracy (%) on Colored MNIST with few bias-conflicting samples. ρ #bias-conflicting samples 99.7% 99.9% 99.95% 60 180 30 Vanilla Rew GA 32.8 56.0 68.0 18.3 27.3 60.0 14.1 22.9 53.9 We further add an ablation on the number of auxiliary models in Table 8, showing more auxil- iary biased models (> 2) can get slightly better results. However, more auxiliary models will raise costs simultaneously, so we choose to use two auxiliary models in our design. 5.4 When there are multiple biases Most debiasing studies (Nam et al., 2020; Kim et al., 2021b) only discussed single bias. However, there may be multiple biases, which are more dif- ficult to analyze. To study the multiple biases, we further adopt the Multi-Color MNIST dataset following Li et al. (2022) which holds two bias attributes: left color (ρ = 99%) and right color (ρ = 95%), see examples in Figure 6. In such training sets, though it seems more intricate to group a sample as bias-aligned or bias-conflicting (as a sample can be aligned or conflicting w.r.t. left color bias or right color bias separately), we still simply train debiased models with GA based on the b-c scores obtained via ECS. We evalu- ate ECS+GA on four test groups separately and present them in Table 9. We find the proposed method also can manage the multi-bias situation. 17 Table 11: Accuracy (%) on the unbiased training data (Colored MNIST, ρ = 10%). Vanilla LfF ECS+GA 97.8 95.1 96.8 Table 12: Performing GA with ordered learn- ing on Colored MNIST (ρ = 98%). Here, "Easy" or "Hard" means only using bias-aligned or bias- conflicting training samples to update model. 1-100 epochs 101-200 epochs Unbiased Accuracy (%) Vanilla Easy Hard GA Vanilla GA GA GA 73.6 80.9 87.5 89.1 5.5 When there are only a few bias-conflicting samples If the collected training set is completely biased (i.e., ρ = 100%), GA is not applicable. So, we want to know how GA performs when there are only a few bias-conflicting samples (i.e., ρ → 100%). The results are provided in Table 10, from which we find GA can achieve noticeable improvement even with few bias-conflicting samples. 5.6 When training data is unbiased It is important that the debiasing method is safe, i.e., can achieve comparable results to Vanilla when the training data is unbiased. We conduct experiments on Colored MNIST with ρ = 10% (i.e., an unbiased training set) and the results are shown in Table 11. From which, our method degrades slightly and still surpasses the debiasing method LfF. Actually, under an unbiased training set, our method tends to regard hard samples as bias-conflicting in stage I, and emphasize them in stage II. 5.7 Connection to curriculum learning Curriculum learning claims that using easy sam- ples first can be superior, on the contrary, anti- curriculum learning argues that employing hard samples first is useful in some situations. We inves- tigate the strategies of ordered learning in the context of debiasing. As presented in Table 12, Fig. 11: Visualized activate maps of different models (last epoch) on Biased Waterbirds. both learning easy and hard samples first lead to inferior results than performing GA throughout the training process, showing that it is important to achieve a balance between bias-conflicting and bias-aligned samples in the whole learning stage. 5.8 Visualization results We visualize the activation maps via CAM (Zhou et al., 2016) in Figure 11. Vanilla models usually activate regions related to biases when making predictions, e.g., the background in B-Birds. LfF and ECS+PoE can focus attention on key areas in some situations, but there are still some devi- ations. Meanwhile, the proposed ECS+GA and ECS+GA+SS mostly utilizes compact essential features to make decisions. 6 Limitation and future work Despite the achieved promising results, the debi- asing method can be further improved in some aspects. First, our method and many previous approaches (such as LfF, DFA, BiasCon, RNF- GT etc.) are based on the assumption that there exist bias-conflicting samples in the training set. Although the assumption is in line with most actual situations, it should be noted that there are some cases where the collected training sets are completely biased (i.e., ρ = 100%), in which these methods are not applicable. For these cases, we should pay attention to methods that aim to directly prevent models from only pursuing easier features, such as SD. Second, though the proposed ECS achieves significant improvement when compared with pre- vious designs, we find that the bias-conflicting sample mining is not trivial, especially in complex 18 InputVanillaLfFECS+PoEECS+GAECS+GA+SSVanilla+SS datasets. The precision and recall achieved by our method on Biased Waterbirds and CelebA are still significantly lower than that on simple datasets like Colored MNIST and Corrupted CIFAR10 as shown in Table 7. For extreme cases, if the bias- conflicting scoring system fails, then the effect of GA can be influenced. Therefore, a better bias- conflicting scoring method is helpful and worth continuing to explore. 7 Conclusions Biased models can cause poor out-of-distribution performance and even negative social impacts. In this paper, we focus on combating unknown biases which is urgently required in realistic applica- tions, and propose an enhanced two-stage debi- asing method. In the first stage, an effective bias-conflicting scoring approach containing peer- picking and epoch-ensemble is proposed. Then we derive a new learning objective with the idea of gradient alignment in the second stage, which dynamically balances the gradient contributions from the mined bias-conflicting and bias-aligned samples throughout the learning process. We also incorporate self-supervision into the second stage, assisting in the extraction of features. Extensive experiments on synthetic and real-world datasets reveal that the proposed solution outperforms previous methods. Acknowledgments. This work is supported in part by the National Natural Science Foun- dation of China under Grant 62171248, the R&D Program of Shenzhen under Grant the PCNL KEY JCYJ20220818101012025, project (PCL2021A07), and Shenzhen Science and Technology Innovation Commission (Research Center (Shenzhen) Ministry of Education). for Computer Network 19 References V. Agarwal, R. Shetty, and M. Fritz. Towards causal vqa: Revealing and reducing spurious correlations by invariant and covariant seman- tic editing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9690–9698, 2020. M. Arjovsky, L. Bottou, D. Lopez-Paz. arXiv preprint arXiv:1907.02893, 2019. I. Gulrajani, and Invariant risk minimization. H. Bahng, S. Chun, S. Yun, J. Choo, and S. J. Oh. Learning de-biased representations with biased representations. In International Con- ference on Machine Learning, pages 528–539. PMLR, 2020. J. Byrd and Z. Lipton. What is the effect of importance weighting in deep learning? In International Conference on Machine Learning, pages 872–881. PMLR, 2019. R. Cadene, C. Dancette, M. Cord, D. Parikh, et al. Rubi: Reducing unimodal biases for visual ques- tion answering. Advances in neural information processing systems, 32:841–852, 2019. M. Caron, I. Misra, J. Mairal, P. Goyal, P. Bojanowski, and A. Joulin. Unsupervised learning of visual features by contrasting cluster assignments. Advances in Neural Information Processing Systems, 33:9912–9924, 2020. T. Chen, S. Kornblith, M. Norouzi, and G. Hinton. A simple framework for contrastive learning of In International con- visual representations. ference on machine learning, pages 1597–1607. PMLR, 2020. C. Clark, M. Yatskar, and L. Zettlemoyer. Don't take the easy way out: Ensemble based methods for avoiding known dataset biases. In Pro- ceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Nat- ural Language Processing (EMNLP-IJCNLP), pages 4069–4082, 2019. C. Clark, M. Yatskar, and L. Zettlemoyer. Learn- ing to model and ignore dataset bias with mixed capacity ensembles. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, pages 3031–3045, 2020. E. Creager, J.-H. Jacobsen, and R. Zemel. Envi- ronment inference for invariant learning. In International Conference on Machine Learning, pages 2189–2200. PMLR, 2021. Y. Cui, M. Jia, T.-Y. Lin, Y. Song, and S. Belongie. Class-balanced loss based on effec- tive number of samples. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 9268–9277, 2019. C. Doersch, A. Gupta, and A. A. Efros. Unsuper- vised visual representation learning by context prediction. In Proceedings of the IEEE inter- national conference on computer vision, pages 1422–1430, 2015. M. Du, S. Mukherjee, G. Wang, R. Tang, A. Awadallah, and X. Hu. Fairness via rep- resentation neutralization. Advances in Neural Information Processing Systems, 34, 2021. R. Geirhos, P. Rubisch, C. Michaelis, M. Bethge, F. A. Wichmann, and W. Brendel. Imagenet- trained cnns are biased towards texture; increas- ing shape bias improves accuracy and robust- ness. In International Conference on Learning Representations, 2018. S. Gidaris, P. Singh, and N. Komodakis. Unsupervised representation learning by pre- dicting image arXiv preprint arXiv:1803.07728, 2018. rotations. S. Gidaris, A. Bursuc, N. Komodakis, P. P ́erez, and M. Cord. Boosting few-shot visual learn- ing with self-supervision. In Proceedings of the IEEE/CVF international conference on com- puter vision, pages 8059–8068, 2019. K. Goel, A. Gu, Y. Li, and C. Re. Model patch- ing: Closing the subgroup performance gap with data augmentation. In International Conference on Learning Representations, 2021. URL https: //openreview.net/forum?id=9YlaeLfuhJF. J. Goh and M. Sim. Distributionally robust optimization and its tractable approxima- tions. Operations research, 58(4-part-1):902– 917, 2010. B. Han, Q. Yao, X. Yu, G. Niu, M. Xu, W. Hu, I. W. Tsang, and M. Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In NeurIPS, 2018. B. Han, G. Niu, X. Yu, Q. Yao, M. Xu, I. Tsang, and M. Sugiyama. SIGUA: Forgetting may make learning with noisy labels more robust. In H. D. III and A. Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 4006–4016. PMLR, 20 13–18 Jul 2020. URL https://proceedings.mlr. press/v119/han20c.html. T. Hashimoto, M. Srivastava, H. Namkoong, and P. Liang. Fairness without demographics in repeated loss minimization. In International Conference on Machine Learning, pages 1929– 1938. PMLR, 2018. H. He, S. Zha, and H. Wang. Unlearn dataset bias in natural language inference by fitting the residual. In Proceedings of the 2nd Workshop on Deep Learning Approaches for Low-Resource NLP (DeepLo 2019), pages 132–142, 2019. K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. K. He, H. Fan, Y. Wu, S. Xie, and R. Gir- shick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 9729–9738, 2020. K. He, X. Chen, S. Xie, Y. Li, P. Doll ́ar, and R. Girshick. Masked autoencoders are scal- able vision learners. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 16000–16009, 2022. Y. Hong and E. Yang. Unbiased classifica- tion through bias-contrastive and bias-balanced learning. Advances in Neural Information Pro- cessing Systems, 34, 2021. P. Khosla, P. Teterwak, C. Wang, A. Sarna, Y. Tian, P. Isola, A. Maschinot, C. Liu, and D. Krishnan. Supervised contrastive learn- ing. Advances in Neural Information Processing Systems, 33:18661–18673, 2020. B. Kim, H. Kim, K. Kim, S. Kim, and J. Kim. Learning not to learn: Training deep neural networks with biased data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9012– 9020, 2019a. E. Kim, J. Lee, and J. Choo. Biaswap: Removing dataset bias with bias-tailored swapping aug- mentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 14992–15001, 2021a. E. Kim, J. Lee, J. Lee, J. Lee, and J. Choo. Learning debiased representation via disentan- gled feature augmentation. arXiv preprint arXiv:2107.01372, 2021b. M. P. Kim, A. Ghorbani, and J. Zou. Multiac- curacy: Black-box post-processing for fairness in classification. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society, pages 247–254, 2019b. P. Lahoti, A. Beutel, J. Chen, K. Lee, F. Prost, N. Thain, X. Wang, and E. H. Chi. Fair- ness without demographics through adversar- ially reweighted learning. arXiv preprint arXiv:2006.13114, 2020. R. Le Bras, S. Swayamdipta, C. Bhagavatula, R. Zellers, M. Peters, A. Sabharwal, and Y. Choi. Adversarial filters of dataset biases. In International Conference on Machine Learning, pages 1078–1088. PMLR, 2020. Y. Li and N. Vasconcelos. Repair: Remov- ing representation bias by dataset resampling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9572–9581, 2019. Y. Li, Y. Li, and N. Vasconcelos. Resound: Towards action recognition without represen- In Proceedings of the European tation bias. Conference on Computer Vision (ECCV), pages 513–528, 2018. Z. Li, A. Hoogs, and C. Xu. Discover and Miti- gate Unknown Biases with Debiasing Alternate Networks. In The European Conference on Computer Vision (ECCV), 2022. 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 con- ference on computer vision, pages 2980–2988, 2017. E. Z. Liu, B. Haghgoo, A. S. Chen, A. Raghu- nathan, P. W. Koh, S. Sagawa, P. Liang, and C. Finn. Just train twice: Improving group robustness without training group information. In International Conference on Machine Learn- ing, pages 6781–6792. PMLR, 2021. Z. Liu, P. Luo, X. Wang, and X. Tang. Deep learn- ing face attributes in the wild. In Proceedings of the IEEE international conference on computer vision, pages 3730–3738, 2015. D. Moyer, S. Gao, R. Brekelmans, A. Galstyan, and G. Ver Steeg. Invariant representations without adversarial training. Advances in Neu- ral Information Processing Systems, 31:9084– 9093, 2018. 21 J. Nam, H. Cha, S. Ahn, J. Lee, and J. Shin. Learning from failure: Training debiased classi- fier from biased classifier. In Advances in Neural Information Processing Systems, 2020. M. Noroozi and P. Favaro. Unsupervised learn- ing of visual representations by solving jigsaw puzzles. In European conference on computer vision, pages 69–84. Springer, 2016. T. Park, J.-Y. Zhu, O. Wang, J. Lu, E. Shechtman, A. A. Efros, and R. Zhang. Swapping autoen- arXiv coder for deep image manipulation. preprint arXiv:2007.00653, 2020. A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, et al. Pytorch: An imperative style, high-performance deep learn- ing library. Advances in neural information processing systems, 32:8026–8037, 2019. M. Pezeshki, S.-O. Kaba, Y. Bengio, A. Courville, D. Precup, and G. Lajoie. Gradient starvation: A learning proclivity in neural networks. arXiv preprint arXiv:2011.09468, 2020. R. Ragonesi, R. Volpi, J. Cavazza, and V. Murino. Learning unbiased representations via mutual information backpropagation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2729– 2738, 2021. C. Reddy, D. Sharma, S. Mehri, A. Romero- Soriano, S. Shabanian, and S. Honari. Bench- marking bias mitigation algorithms in repre- sentation learning through fairness metrics. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 1), 2021. S. Sagawa, P. W. Koh, T. B. Hashimoto, and P. Liang. Distributionally robust neural net- works. In International Conference on Learn- ing Representations, 2020a. URL https:// openreview.net/forum?id=ryxGuJrFvS. S. Sagawa, A. Raghunathan, P. W. Koh, and P. Liang. An investigation of why overparame- terization exacerbates spurious correlations. In International Conference on Machine Learning, pages 8346–8356. PMLR, 2020b. V. Sanh, T. Wolf, Y. Belinkov, and A. M. Rush. Learning from others' mistakes: Avoid- ing dataset biases without modeling them. In International Conference on Learning Repre- sentations, 2020. N. Sohoni, J. Dunnmon, G. Angus, A. Gu, and C. R ́e. No subclass left behind: Fine-grained robustness in coarse-grained classification prob- lems. Advances in Neural Information Process- ing Systems, 33, 2020. J. Tan, X. Lu, G. Zhang, C. Yin, and Q. Li. Equalization loss v2: A new gradient bal- ance approach for long-tailed object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1685–1694, 2021. E. Tartaglione, C. A. Barbano, and M. Grangetto. End: Entangling and disentangling deep repre- sentations for bias correction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13508– 13517, 2021. Z. Tong, Y. Song, J. Wang, and L. Wang. Video- mae: Masked autoencoders are data-efficient learners for self-supervised video pre-training. arXiv preprint arXiv:2203.12602, 2022. P. A. Utama, N. S. Moosavi, and I. Gurevych. Towards debiasing nlu models from unknown biases. In EMNLP, 2020a. P. A. Utama, N. S. Moosavi, and I. Gurevych. Mind the trade-off: Debiasing nlu models without degrading the in-distribution perfor- mance. In Proceedings of the 58th Conference of the Association for Computational Linguis- tics. Association for Computational Linguistics, July 2020b. W. Van Gansbeke, S. Vandenhende, S. Georgoulis, M. Proesmans, and L. Van Gool. Scan: Learning to classify images without labels. In European conference on computer vision, pages 268–285. Springer, 2020. H. Wang, Z. He, Z. L. Lipton, and E. P. Xing. Learning robust representations by pro- jecting superficial statistics out. In Interna- tional Conference on Learning Representations, 2019. URL https://openreview.net/forum?id= rJEjjoR9K7. Q.-W. Wang, B. Zhao, M. Zhu, T. Li, Z. Liu, and S.-T. Xia. Towards mitigating the prob- lem of insufficient and ambiguous supervision in online crowdsourcing annotation. arXiv preprint arXiv:2210.11194, 2022. X. Wang, R. Zhang, C. Shen, T. Kong, and L. Li. Dense contrastive learning for self- In Proceedings supervised visual pre-training. 22 of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3024– 3033, 2021. Z. Wang, K. Qinami, I. C. Karakozis, K. Genova, P. Nair, K. Hata, and O. Russakovsky. Towards fairness in visual recognition: Effective strate- gies for bias mitigation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 8919–8928, 2020. P. Welinder, S. Branson, T. Mita, C. Wah, F. Schroff, S. Belongie, and P. Perona. Caltech- ucsd birds 200. 2010. Y. Yaghoobzadeh, S. Mehri, R. T. des Combes, T. J. Hazen, and A. Sordoni. Increasing robust- ness to spurious correlations using forgettable examples. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 3319–3332, 2021. Y. Zeng, B. Zhao, S. Qiu, T. Dai, and S.-T. Xia. Towards effective image manipulation detec- tion with proposal contrastive learning. arXiv preprint arXiv:2210.08529, 2022. X. Zhai, A. Oliver, A. Kolesnikov, and L. Beyer. S4l: Self-supervised semi-supervised learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1476– 1485, 2019. Z. Zhang and M. R. Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In 32nd Conference on Neu- ral Information Processing Systems (NeurIPS), 2018. B. Zhao, X. Xiao, G. Gan, B. Zhang, and S.-T. Xia. Maintaining discrimination and fairness in class incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13208–13217, 2020. B. Zhao, C. Chen, Q.-W. Wang, A. He, and S.- T. Xia. Combating unknown bias with effective bias-conflicting scoring and gradient alignment. In Proceedings of the AAAI Conference on Arti- ficial Intelligence, 2023. URL https://arxiv.org/ abs/2111.13108. B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba. Learning deep features for In Proceedings of discriminative localization. the IEEE conference on computer vision and pattern recognition, pages 2921–2929, 2016. B. Zhou, A. Lapedriza, A. Khosla, A. Oliva, and A. Torralba. Places: A 10 million image database for scene recognition. IEEE transac- tions on pattern analysis and machine intelli- gence, 40(6):1452–1464, 2017. J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international con- ference on computer vision, pages 2223–2232, 2017. W. Zhu, H. Zheng, H. Liao, W. Li, and J. Luo. Learning bias-invariant representation by cross- sample mutual information minimization. In the IEEE/CVF International Proceedings of Conference on Computer Vision, pages 15002– 15012, 2021. 23
http://arxiv.org/abs/2302.11412v1
2023-02-22T14:47:15
2023-02-22T14:47:15
Data Augmentation for Neural NLP
Data scarcity is a problem that occurs in languages and tasks where we do not have large amounts of labeled data but want to use state-of-the-art models. Such models are often deep learning models that require a significant amount of data to train. Acquiring data for various machine learning problems is accompanied by high labeling costs. Data augmentation is a low-cost approach for tackling data scarcity. This paper gives an overview of current state-of-the-art data augmentation methods used for natural language processing, with an emphasis on methods for neural and transformer-based models. Furthermore, it discusses the practical challenges of data augmentation, possible mitigations, and directions for future research.
[ "Domagoj Pluščec", "Jan Šnajder" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11412v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11412v1", "@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.LG" ]
Data Augmentation for Neural NLP Domagoj Pluˇsˇcec Jan ˇSnajder University of Zagreb, Faculty of Electrical Engineering and Computing Text Analysis and Knowledge Engineering Lab Unska 3, 10000 Zagreb, Croatia {domagoj.pluscec;jan.snajder}@fer.hr 3 2 0 2 b e F 2 2 ] L C . s c [ 1 v 2 1 4 1 1 . 2 0 3 2 : v i X r a Abstract-Data scarcity is a problem that occurs in languages and tasks where we do not have large amounts of labeled data but want to use state-of-the-art models. Such models are often deep learning models that require a significant amount of data to train. Acquiring data for various machine learning problems is accompanied by high labeling costs. Data augmentation is a low-cost approach for tackling data scarcity. This paper gives an overview of current state-of-the-art data augmentation methods used for natural language processing, with an emphasis on meth- ods for neural and transformer-based models. Furthermore, it discusses the practical challenges of data augmentation, possible mitigations, and directions for future research. Index Terms-data augmentation, natural language processing, deep learning, low data regimes I. INTRODUCTION Deep learning and transformer-based models have demon- strated excellent performance across many tasks in the field of natural language processing (NLP), such as machine trans- lation [1], question answering [2], text classification [3], and language inference [2]. However, many of these models are trained using supervised learning, which requires a large amount of labeled data. Data labeling may be expensive and time-consuming. This problem is even more pronounced when such models are applied to tasks in low-resource languages [4]. One approach to mitigating data scarcity is data augmenta- tion. Data augmentation is defined by [5], [6], and [7] as a set of strategies for generating new data based on available data. Augmentation strategies can range from simple paraphrasing techniques that use linguistic resources, such as synonym replacement, to more complex sampling methods that try to generate new data based on the distribution of the original data. Data augmentation strategies can help us solve several problems if applied correctly. Firstly, they can help improve the model's performance. Generated data can alleviate data scarcity in low-data regimes [8], add data diversity by in- jecting prior knowledge without changing the model [9], and balance an imbalanced dataset by adding examples with not frequently occurring classes [7]. Some studies have found that data augmentation is a preferred regularization method [10] as it improves generalization without degrading the model's representational capacity or retuning other hyperparameters. Secondly, data augmentation strategies can help make the model more robust by securing it against adversarial exam- ples [11] and simulating potential distribution shifts [12]. Transformer-based models tend to suffer from out-of-domain problem [4], which can be alleviated by simulating domain shifts with data augmentation. Furthermore, data augmentation can help mitigate model bias [13], [14] and substitute real- world data to remove personally identifiable information and protect peoples' privacy. While data augmentation methods can be model agnostic, we will focus on the ones that work well with neural NLP models, with an emphasis on transformer-based models. Neu- ral NLP models typically work on sequences of linguistic units that are represented as vectors. Compared to the more traditional models, neural NLP models do not require hand- crafted features and need large amounts of data to train. Some methods that were used traditionally in NLP, such as Easy Data Augmentation (EDA) [15] and An Easier Data Augmentation (AEDA) [16], showed poor performance when applied with transformer-based models. One possible explanation for the poor performance is that such pre-trained models saw a huge variety of data while pre-training [16]. Therefore, using data augmentation to add rarely occurring words and synonyms does not tend to improve model performance [16]. Longpre et al. [17] demonstrate that some data augmentation methods cannot achieve gains when using large pre-trained language models as they are already invariant to various transformations, such as synonym replacement. The authors also state that large language models map data to a latent space with representa- tions nearly invariant to some transformations. As some of the traditional data augmentation methods do not work for neural models, it makes sense to investigate data augmentation for neural NLP specifically. The remainder of the paper is structured as follows. Section II explains the challenges of label preservation in data augmen- tation. Section III provides an overview of data augmentation methods with a focus on strategies suitable for deep learning models. Section IV addresses the practical challenges of applying data augmentation methods. II. LABEL PRESERVATION In order for augmented data to be useful, it needs to be labeled correctly. We usually want to change a sample to add some diversity while also preserving the original labels. Alternatively, if augmentation changes the labels, we need to know how exactly the labels were changed. It is easy to define label-preserving transformations for some data modalities. For instance, we can apply image rotation [18] in computer vision or change the speed of sound [19] in speech processing. However, changing data meaningfully is very challenging in NLP as text is discrete. Changing one word in a sentence could lead to changing the meaning of the entire sentence [20]. Many transformations come with no guarantees to preserve the correct label, but there is a high probability that the label will not change. This probability is referred to as the safety of the data augmentation method [9]. Safer data augmentation methods do not necessarily achieve better performance. For example, random swap and random deletion, which are not label preserving, improve the model performance more than synonym replacement and insertion, which tend to be label preserving [7]. A number of methods have been proposed to mitigate the risk of changing the sample's label. One approach is to select samples using a heuristic. For example, Alzantot et al. [21] use a model that is trained on the original dataset to determine the confidence of the augmented sample. Only the samples that maximize the model's confidence are selected. While this approach does not improve the model performance because only the augmented samples that the original model predicts with maximum confidence are selected, it makes the model more robust against adversarial attacks. Models that generate data can be conditioned to generate a sample for a particular label or determine the correct label for a newly generated sample. The c-BERT model [22] uses BERT [2] segment embeddings to encode label information. When fine-tuned, the c-BERT model can be used to substitute a word from the original sample so that the resulting sample matches the sentence label. DataBoost [23] is an example of applying reinforcement learning to generative models with the aim of generating a sentence that matches the selected class. III. DATA AUGMENTATION METHODS Previous surveys proposed various categorizations of data augmentation methods. In this section, we will explore the different categorization. Firstly, we will discuss the catego- rization of data augmentation methods based on supervision (Section III-A. Secondly, we will discuss the categorization based on how the data augmentation is applied to the data (Section IV-D). Finally, we will focus on taxonomy from [6]. The chosen taxonomy is based on the diversity of augmented samples and divides data augmentation methods into para- phrasing (Section III-C), noising (Section III-D), and sampling (Section III-E). Table I shows examples of transformed data by using data augmentation methods described in this section. A. Supervision of data augmentation methods A recent survey [20] divides data augmentation methods into supervised, semi-supervised, and unsupervised data aug- mentation. Supervised data augmentation is based on existing labeled data. Data can be transformed using techniques such as synonym replacement [15], contraction expansions [24], or back-translation, to name a few. It is also possible to combine multiple data samples to generate one augmented data instance using methods such as mixup [34]. Semi-supervised data augmentation combines unlabeled and labeled data. Chen et al. [35] present a semi-supervised data augmentation, termed MixText, which is based on the MixMatch algorithm [36]. MixText uses a set of unlabeled documents, which are then augmented with back-translation. Back-translation is used to produce multiple augmented docu- ments for each unlabeled document from the original dataset. An original document and the augmented documents are fed to the model that was trained on a labeled dataset. The final label for the unlabeled original document is obtained by averaging predictions produced by the model. Another approach to semi- supervised data augmentation is self-training. Thakur et al. [37] use a model trained on a labeled part of the dataset to label unlabeled sentences. Such augmented sentences are combined with golden annotated sentences to train the SBERT model. task adaptation. The framework's goal Unsupervised data augmentation uses the distribution of the data to generate new data. Bari et al. [38] propose an unsupervised data augmentation framework for zero-resource cross-lingual is to adapt a task from a source language distribution to unknown target language distribution without labeled data in the target language. The authors tested the framework on cross-lingual named entity recognition (XNER) and cross-lingual natural language inference (XNLI). While this method surpasses zero- resource baselines, supervised approaches still show better performance. B. Transformation space Surveys [4] and [7] divide data augmentation methods based on how the transformations are applied on feature and data space transformations. Feature space transformations transform data in the embedding space, while data space transformations transform the raw text data. Data space trans- formations can further be divided into character level, token level, phrase level, and document level transformations. Character level augmentations have mostly been used as part of adversarial training to make the model more robust. Karpukhin et al. [27] experiment with character level transfor- mations: deletion, insertion, substitution, and swap. They show that character level noise improves the performance on the test data with naturally occurring noise in the form of spelling mistakes. The output of such augmentations, if applied with small probability rates, mostly preserves the original label. The generated examples are mostly out-of-vocabulary words that are close to the original words. Such methods should be used with data representations that can model out-of-vocabulary words, such as sub-words used in BERT. Token level augmentations perform addition, substitution, or deletion of certain tokens using different strategies. Strategies include the replacement of words with their synonyms by using resources such as WordNet [39], PPDB [40], or using language models to suggest substitute tokens. Another token- level strategy is noise induction by inserting random words that do not add any label-related information [41]. TABLE I EXAMPLES OF TRANSFORMED DATA BY USING DATA AUGMENTATION. BOLD TYPEFACE INDICATES WORDS THAT WERE TRANSFORMED BY DATA AUGMENTATION. Method Generating adversarial examples for sentiment analysis task [21] Generating adversarial examples for textual entailment task [21] Back-translation [7] Contraction expansion [24] HotFlip – character level [25] HotFlip – word level [25] BAE (word replacement) [26] BAE (Word insertion) [26] AEDA [16] Character deletion [27] Character insertion [27] Character substitution [27] Character swap [27] DataBoost [23] Inversion (original premise) [28] Inversion (transformed hypothesis) [28] Passivization (transformed hypoth- esis) [28] Sentence cropping [29] Sub2 [30] Synonym replacement with word embeddings [31] AddSentDiverse [32] EDA – Synonym replacement [15] EDA – Random word insertion [15] EDA – Random word swap [15] EDA – Random word deletion [15] cBERT [22] GPT3Mix [33] Original data This movie had terrible acting, terrible plot, and ter- rible choice of actors. (Leslie Nielsen ...come on!!!) the one part I considered slightly funny was the bat- tling FBI/CIA agents, but because the audience was mainly kids they didn't understand that theme. (Neg- ative, 78.0%) Premise: A runner wearing purple strives for the finish line. Hypothesis: A runner wants to head for the finish line. (Entailment, 86.0%) Previously, tea had been used primarily for Buddhist monks to stay awake during mediation. I'm South Africa's historic Soweto township marks its 100th birthday on Tuesday in a mood of optimism. (57% World) One hour photo is an intriguing snapshot of one man and his delusions it's just too bad it doesn't have more flashes of insight. The government made a quick decision. The government made a quick decision. a sad , superior human comedy played out on the back roads of life . whale whale whale whale So Cute! The baby is very lovely! There are 16 El Grecos in this small collection. → This small collection contains 16 El Grecos There are 16 El Grecos in this small collection. → This small collection contains 16 El Grecos There are 16 El Grecos in this small collection. → This small collection contains 16 El Grecos Her father wrote her a letter. (My cat likes milk., I read books.) Being late is terrible. "The Earth receives 174,000 terawatts (TW) of incoming solar radiation (insolation) at the upper atmosphere. Approximately 30% is reflected back to space while the rest is absorbed by clouds, oceans and land masses. ... Most people around the world live in areas with insolation levels of 150 to 300 watts per square meter or 3.5 to 7.0 kWh/m2 per day." How many terawatts of solar radiation does the Earth receive? A sad, superior human comedy played out on the back roads of life. A sad, superior human comedy played out on the back roads of life. A sad, superior human comedy played out on the back roads of life. A sad, superior human comedy played out on the back roads of life. The actor is [good]. (positive) It's just not very smart. (negative), It's quite an achieve- ment to set and shoot a movie at the Cannes Film Festival and yet fail to capture its visual appeal or its atmosphere. (negative) Augmented data This movie had horrific acting, horrific plot, and hor- rifying choice of actors. (Leslie Nielsen ...come on!!!) the one part I regarded slightly funny was the battling FBI/CIA agents, but because the audience was mainly youngsters they didn't understand that theme. (Positive, 59.8%) Premise: A runner wearing purple strives for the finish line. Hypothesis: A racer wants to head for the finish line. (Contradiction, 43.0%) In the past, tea was used mostly for Buddhist monks to stay awake during the meditation. I am South Africa's historic Soweto township marks its 100th birthday on Tuesday in a moop of optimism. (95% Sci/Tech) One hour photo is an interesting snapshot of one man and his delusions it's just too bad it doesn't have more flashes of insight The (judge, doctor, captain) made a quick decision. The government (officials, then, immediately) made a quick decision. a , sad . , superior human ; comedy . played . out on the back roads of life . whle wyhale whalz wahle Look at this adorable baby! He is so cute! There are 16 El Grecos in this small collection. 6→ 16 El Grecos contain this small collection. This small collection contains 16 El Grecos. 6→ 16 El Grecos contain this small collection. his small collection contains 16 El Grecos. 6→ This small collection is contained by 16 El Grecos. Her father wrote a letter. (My cat likes books., I read milk.) Be behind are bad. "The Earth receives 174,000 terawatts (TW) of incoming solar radiation (insolation) at the upper atmosphere. Approximately 30% is reflected back to space while the rest is absorbed by clouds, oceans and land masses. ... The Mars receives 674000 terawatts of solar radia- tion. Most people around the world live in areas with insolation levels of 150 to 300 watts per square meter or 3.5 to 7.0 kWh/m2 per day." A lamentable, superior human comedy played out on the backward road of life. A sad, superior human comedy played out on funniness the back roads of life. A sad, superior human comedy played out on roads back the of life. A sad, superior human out on the roads of life. The actor is funny. Excessively talky, occasionally absurd and much too long, Munich is a fascinating mess. (negative: 79%) Phrase-level transformations use sentence structure to add diversity to the sentence form while preserving the semantic meaning. For example, Sahin and Steedman [29] use sentence cropping to focus on subjects and objects in the sentence. Another technique the authors proposed is rotation, where parts of the sentence are moved. Authors also note that this type of augmentation is dependent on grammatical sentence structure in different languages. While some languages may permit such a change, for others the change may be invalid, merely adding noise to the model. Document-level data augmentation tackles the problem of augmenting text consisting of multiple sentences. Yan et al. [42] propose a document-level method for augmenting legal documents for a text classification task. The method randomly selects sentences from legal documents with the same label and inserts them into the current document. While data space transformations change raw text to gener- ate augmented instances, feature space transformations change values in the vector representation of the text. Zhang et al. [43] propose a feature space augmentation, termed SeqMix, which combines existing samples in feature space and label space to generate new samples. The problem with feature space transformations is that they require direct access to the neural architecture because they modify the samples' embedding representation. This prevents their use in combination with a black-box model. Another issue is that in NLP, there does not necessarily exist a direct mapping between feature space and data space values. It means that values are hard to interpret because generated samples cannot be directly mapped back to text. C. Paraphrasing Paraphrases are sentences or phrases that convey approxi- mately the same meaning using different wording [44]. Data augmentation methods belonging to this category generate paraphrases of the original data which bring limited semantic change. The most widespread methods for generating para- phrases are replacing words with synonyms, back-translation, introducing structure changes by changing the word order, and generation of paraphrases using language models. The simplest method is the replacement of a random word with its synonym. There are several ways to obtain synonyms for a chosen word. Typical approaches use synonym dictio- naries [15], words that are close in the embedding space [31], and contextually similar words based on language models [22]. Some authors select words with low TF-IDF scores and replace them with other uninformative words in the dictionary to mitigate the risk of changing the instance's class [41]. Rizos et al. [45] argue that replacing words with similar words in embedding space encourages the downstream task to place a lower emphasis on associating single words with a particular label and instead place a higher emphasis on capturing similar sequential patterns. Back-translation or round-trip translation produces para- phrases with the help of translation models [7]. The text is first translated from the source language to the target language and then back to the language of origin. A problem with this is that the error is propagated, as there can be an error when translating from the source to the target language and again when translating back to the source language. This is especially problematic for low-resource languages with poorly performing translation models [4]. Language models can be used in different scenarios. One option is to use them to filter contextually unfitting synonym words based on language model output probabilities. Another possibility is to use them as the main augmentation method, where they not only substitute words with similar meaning but with words that fit the context. However, using language models for generating replacement words increases the risk for label distortion [7]. The risk can be mitigated by using label conditional language models [22]. Some authors train label-conditioned language models from scratch, but that can be expensive and not realistic for low-data regimes. Others have proposed to reuse existing language models and combine them with reinforcement learning agent or discriminator to either condition the language model or filter out unfitting augmentations. Wu et al. [22] present a pre-trained conditional language model, termed c-BERT. The authors use a pre-trained BERT model [2], which is trained on a text classification task where segment embeddings are repurposed to encode label information. Paraphrases can be generated by changing the structure of a sentence while preserving its label. Some of the structure- based transformations are cropping, shortening the sentence by putting the focus on the subjects and objects, or rotation, where flexible fragments of the text are moved. Shi et al. [30] present structure-based augmentation, referred to as SUB2, which gen- erates new samples by substituting sentence substructures with other substructures that have the same label. The authors test the method on part-of-speech tagging, dependency parsing, constituency parsing, and text classification tasks and achieve competitive or better performance in the few-shot setting. D. Noising Noising-based data augmentation methods add noise to the original data and involve more semantic changes compared to paraphrasing methods. The main goal of such methods is to improve the robustness of the model to natural or synthetic noise. This is similar to how humans reduce the impact of noise on the understanding of the text, even if it contains some mistakes like typos or incorrect grammatical order. Li et al. [6] survey nosing methods, such as random word swap, random word deletion, random word insertion, and random word substitution. Chen et al. [35] and Goyal et al. [46] survey adversarial data augmentation that can be looked at as adding noise, such as adversarial perturbation, to the original data either in data or feature space. Furthermore, Shorten et al. [12] explore feature space augmentations that include adding noise to the original data which are not included in adversarial data augmentation. Adversarial examples are examples that contain small changes in the input data, which are almost unrecognizable to humans, but which may mislead the algorithms into making wrong predictions. Automatic adversarial example generators can be used as data augmentation methods in order for deep learning models to be less susceptible to such alternations. On the other hand, adversarial training can disturb the true label space in the training data. For example, adversarial example generators often rely on the belief that input points that are close to each other tend to have the same label. The aim of the adversarial examples is to target misclassification and to make the model more robust to such changes. Methods that use direct access to model architecture and parameters to create adversarial examples by using gradients are typically referred to as white-box methods. An example of a character-level white-box method is Hot- Flip [25]. The method estimates how much loss changes upon changing a single character. Change of a character includes the operation of substitution, insertion, and deletion. An operation that is estimated to increase the loss the most is selected. Another example is presented by Cheng et al. [47], who construct adversarial examples to make the neural machine translation model more robust. To construct an adversarial example, the authors propose the use of greedy search to find a substitute word that would be semantically similar to the original word in the source language but would distort the current prediction. The authors show that their approach improved translation performance and robustness on Chinese- English and English-German translation tasks. In cases when it is not possible to directly access the model architecture and training procedure, one can resort to a black- box search for adversarial attacks. Black-box search enables adversarial example construction that is agnostic to the model architecture's internals by using grid search, random search, Bayesian optimization, and evolutionary search. Garg and Ramakrishnan [26] propose a black-box method for text classification by replacing or inserting a new token into a sentence, chosen using a pre-trained BERT model. The authors try to retain high semantic similarity with the original text by filtering the top predicted tokens by using the BERT model. The filtering is done based on a sentence similarity score computed via the Universal Sentence Encoder [48]. Wang and Bansal [32] improve the robustness of a model on question-answering task by inserting a distracting sentence in the document. The sentence is distracting because it is generated as an answer to the same type of the original question but with unrelated entities. One of the considerations when selecting adversarial data augmentation is how quickly we can construct adversarial ex- amples, as some of the methods rely on iterative optimization, which can be a significant bottleneck for training deep learning models [12]. Instead directly to the input, noise can be added to examples in the features pace. MODALS [11] adds Gaussian noise with zero mean and standard deviation computed across all examples in the same class. The added noise is additionally scaled with a scaling factor. E. Sampling Sampling-based data augmentation methods use the distri- bution of the original data to generate new data. New data can be generated by rule-based methods, label-conditioned data generation, self-training, and interpolation methods, such as mixup [6]. Rule-based methods use predefined heuristics to generate new data. In contrast to paraphrasing techniques, generated data does not have to be semantically similar to original data. Min et al. [28] present a rule-based data augmentation method, which is used with transformer-based model and evaluated on a natural language inference (NLI) task. Their method swaps the subject and object of the original sentence and changes the verb to a passive form. The results showed that swapping subject and object reduced the model's sensitivity to word order, but passivization made a much smaller impact on the model's performance. Conditional data augmentation uses label information when generating new data. Two common approaches to generating conditional data are deep generative models and pre-trained language models. Liu et al. [20] find that deep generative models are less useful in practice as data augmentation is usually needed in low-data regimens and generative models require a lot of high-quality training data. Liu et al. [23] propose a text augmentation framework, termed Data Boost, that uses an off-the-shelf GPT-2 language model [49] to generate augmented samples. Samples are con- ditioned to a particular class by using reinforcement learning policy when decoding model output for the next word. This approach enables the use of a language model generator for a particular task without retraining the model from scratch. The framework enabled performance increases on Offense Detection, Sentiment Analysis, and Irony Classification tasks even when trained with just 10% of the original datasets. Self-training is the approach in which a model is trained iteratively by assigning pseudo-labels to the set of unlabeled training samples with prediction greater than the defined threshold [50]. As mentioned in Section III-A, MixText [35] and SBERT [37] methods are two types of the self-training approach. One of the earlier interpolation methods that were trying to tackle the problem of an unbalanced dataset is Synthetic Minority Over-sampling Technique (SMOTE) [51], which works by adding interpolated samples from the minority class. Zhang et al. [34] proposed the mixup method for data augmentation by linearly interpolating pairs of examples and their labels. Examples are interpolated as raw input vectors and labels are interpolated by using their one-hot label encoding. improvement in computer The method showed significant vision tasks by interpolating images at the pixel level. Guo and Zhang [52] use mixup for sentence classification. They demonstrate how the mixup technique can be used on the word or sentence embeddings while using CNN and LSTM models. Both word and sentence-level mixup showed an increase in performance, but comparisons between the two were incon- clusive as to which type yields better performance. Sun et al. [53] incorporated the mixup technique in the transformer- based model referred to as Mixup-transformer. Unlike [34] and [52], the authors made mixup representation and activa- tion dynamic, where they trained mixup representation and used mixup for just part of the epoch. Mixup-transformer is evaluated on the GLUE benchmark and achieves an average improvement of around 1%. The model is also tested in the low-resource regime, where the mixup-transformer con- sistently outperformed BERT-large. The low-resource regime is also a more realistic scenario as practitioners will need more help from data augmentation methods when there is not enough labeled data. Zhang et al. [43] use mixup on sequence labeling task in combination with active learning. In each iteration, their method selects unlabeled samples to annotate by using an active learning strategy. The selected samples are then augmented using their SeqMix method. The SeqMix method consists of two stages. In the first stage, eligible sequences are selected and mixed both in feature and label space. In the second stage, a discriminator is used to judge if the generated sequences are plausible or not based on their perplexity scores. Only the sequences with low perplexity are regarded as plausible ones. Annotated and augmented samples are added to the training set, which is used to train the final model. Park and Caragea [54] go further by selecting training samples for mixup by using a strategy based on Training Dynamics. Their TDMixUp model combines easy- to-learn and ambiguous samples in the feature space. The the approach on Natural Language Inference, authors test Paraphrase Detection, and Commonsense Reasoning tasks and achieve competitive performance using a smaller subset of the training data compared with strong baselines and other data augmentation methods, such as back-translation and regular mixup. Similar to the mixup approach, authors of the MODALS framework [11] use interpolation of samples but also extrap- olation and difference transformation. Sample extrapolation is achieved by creating a new sample that lies on the line that connects the selected sample and the class centroid. Difference transformation is carried out by translating the selected sample by the difference between two random samples from the same class. The authors demonstrated improvements on multiple datasets for text, tabular, time-series, and image datasets. Yoo et al. [33] leverage the GPT-3 [55] model to mix samples from the dataset to generate new samples. The authors generate a prompt containing task description, labels, and randomly selected samples from the dataset. The output of the model are a new sample and its label. IV. PRACTICAL CHALLENGES Above, we described data augmentation methods. However, there are several points that one needs to keep in mind when selecting data augmentation methods and how to apply them to a language, task, and dataset at hand. This section reviews the practical challenges in applying data augmentation methods. Firstly, we will discuss at which part of the learning process to apply data augmentation (Section IV-A), with which magnitude (Section IV-B), and how to combine multiple aug- mentation methods (Section IV-C). Secondly, we will discuss how data representation (Section IV-D), task (Section IV-E) and language (IV-F) influence selection of data augmenta- tion method. Finally, we will discuss the lack of systematic comparison of performance and computational aspects of data augmentation strategies (Section IV-G) and what open-source libraries for augmentation are available (Section IV-H). A. Offline vs online augmentation Data augmentation strategies can be divided into offline and online augmentation based on their role in the learning process. Data augmentation is online if embedded into the learning process so that the augmented instances are stochas- tically included by the learning algorithm [12], [5]. In contrast, offline data augmentation is applied to the original data independently from model training. Offline data augmentation reduces computational costs while training the model, as the augmentation is done once for all model variants. On the other hand, Shorten et al. [12] argue that data augmentation methods that are integrated into the model's learning process can better leverage the stochasticity of learning. For example, Jungiewicz and Pohl [56] replace words with synonyms only if the replacement with the chosen synonym maximizes the loss of the current state of the classifier model. Wei et al. [57] explore curriculum data augmentation by gradually introducing augmented examples with original ex- amples in training for text classification. In their setup, the authors firstly trained the model on the original data and then gradually trained it on augmented data. This approach showed improved performance compared to offline data augmentation. The results of Kucnik and Smith [58] show that it can be more efficient to subsample a portion of the dataset to be augmented rather than augmenting the entire dataset while keeping the performance gain as if the whole dataset was augmented. B. Strength of data augmentation The strength of data augmentation determines the num- ber of changes performed on an instance [12]. Wei et al. [59] define the strength of data augmentation as the ratio between the number of performed changes and the length of the sequence. The coefficient will be higher if we change two words with their synonyms instead of one and if we apply multiple transformations, such as back-translation and synonym replacement. The strength of data augmentation needs to be optimized for a particular application as it depends on model and dataset size [60]. Methods that learn strength of data augmentation through training were a large part of the success of data augmentation in computer vision, as noted by Shorten et al. [12]. Successful approaches such as AutoAugmenter [61], Population-Based Augmentation [62], RandAugment [60] and others [63] are being adapted for use in NLP but have not seen large-scale adoption [12]. Niu and Basal [64] adapt AutoAugmenter for the dialogue task. The authors define a set of semantic- preserving perturbations. The perturbations are then combined by a model that learns the policy based on the reward it gets from the model trained on the augmented data and validated on the validation set. Another example is presented by Ren et al. [65], who propose TextAutoAugment framework for learning augmentation policy by combining simpler operations for the text classification task. C. Data augmentation methods stacking Research [6], [7] shows that combining multiple data aug- mentation transformations can further improve the model's performance when compared to individual transformations. Combining multiple data augmentation methods adds multiple sources of diversity, which can improve models' general- ization. As there are many augmentation methods it might be infeasible to try every combination of data augmentation methods for every NLP task. A promising direction is the automatic combination of data augmentation methods, such as TextAutoAugment [65]. In practical applications, it might be beneficial to pair up the data augmentation method with other methods to tackle the problem of data scarcity, such as active learning. Li et al. [66] propose a framework that combines active learning and data augmentation on the Chinese NER task. When adding an example through active learning, the method generates additional instances by using data augmentation. This ap- proach helps the model learn faster the decision space around the most informative samples. The paper evaluated multiple active learning strategies combined with entity replacement augmentation and token replacement augmentation while using CNN-BiLSM-CRF and Lexicon-lstm as NER models. In the best combination of model, data augmentation method, and active learning strategy the method achieved 99% of the best deep model trained on full data using 22% of the dataset, which is also 63% less data compared to the active learning approach. Zhang et al. [43] used data augmentation to multiply samples obtained by active learning strategy on the sequence labeling task. D. Data representation Data augmentation methods' performance may vary based on text representation. Some data augmentation methods, such as random character insertion, may cause the generation of out-of-vocabulary words [4]. The performance of the NLP system in that scenario would depend on how the system mitigates the issue of out-of-vocabulary words. On the other hand, recent deep learning models, such as BERT [2], use text representations that can represent words with misspellings without having a separate word in the vocabulary. Sahin [4], in his comparative study on text augmentation techniques for low-resource NLP, experiments with distinct models that use various subword units: character-level [67], byte-pair encoding [68], and WordPiece embeddings [69]. The authors show that across a number of tasks, token-level augmentation provides significant improvements for byte-pair encoding input, while character-level augmentation gives higher scores for character- level encoding and WordPiece encoding. E. Task specificity Some data augmentation methods cannot be effectively applied to every task out of the box as some transformations can remove necessary information for the task. We will explore a subset of NLP tasks and show why some of the methods are not applicable for them. Named entity recognition task aims to identify named entities such as person, location, organization, time, etc. [70]. The identification may fail if we remove a part of a named entity by applying random word substitution or deletion on a part of the entity. Sequence labeling task aims at assigning a label to each part of the sequence [71]. Zhang et al. [43] note that it is infeasible to apply context-based substitution, synonym replacement, random insertion, swap and deletion, paraphrasing, or back- translation on sequence labeling. These methods may change the labels, and determining new labels is difficult on a such granular scale without adding too much noise. On the other hand, methods such as SeqMix or models that are conditioned on the label may be able to tackle such granularity of labels without additional prior knowledge. Similarly, text classification task is aimed at assigning a label to larger units of text such as sentences, paragraphs, or documents [7]. One example of text classification task is sentiment analysis, which aims to determine whether a docu- ment expresses positive, neutral or negative opinion. Removing random word from a document can change the meaning of the sentence and, therefore, the class. For example, removing negation "not" from the sentence "I do not like apples." would change its sentiment. F. Language specificity Data augmentation methods that work for English may not work for other languages, especially if the languages differ in their typology. In terms of morphological typology, English is an analytic language, while most low-resource languages are synthetic, as shown by [4]. Genuinely low-resource languages lack resources that are required by a broad range of data augmentation methods, while the existing resources may be of low quality, which may cause data augmentation methods to decrease performance because of added noise. Bari et al. [38] note that one of the most used data augmentation methods, back-translation, may not be applicable to low- resource languages. If a good-quality translation model is not available, obtaining parallel data to train an effective machine translation model for back-translation can be more expensive for low-resource languages than annotating the target language data. In such low-data or low-resource regimes, resource-free methods may be used. Sahin et al. [4] test character-level, token-level, and structure-based transformations on part-of- speech tagging, dependency parsing, and semantic role la- beling tasks for multiple low-resource languages. Character- level transformations, such as insertion, swap, substitution, and deletion, proved to obtain the most consistent improve- ments. On the other hand, token-level transformations were less consistent. Synonym replacement usually lowered the performance of the model. Random word deletion and random word swap were only used on a part-of-speech tagging task, but showed positive gain on model results. Structure-based transformations, such as cropping and rotation, were most inconsistent in improving models' results. Another approach to tackle low-resource regimes is to use semi-supervised and unsupervised methods discussed in Section III-A. G. Lack of benchmarks Automated learning of data augmentation policy for NLP is in its early stages [12]. While there is progress in automatic data augmentation without hand-picking initial transforma- tions in computer vision [72], most of the automated methods in NLP rely on practitioners to choose augmentation methods based on their prior knowledge of the task. When choosing augmentation methods, practitioners face a challenge as it is difficult to compare different research papers because of the lack of performance benchmarks. As Bayer et al. [7] discuss, there is a need to compare different augmentation methods in a standard way across multiple tasks based on their evaluation metrics. Currently, comparing the methods is difficult and requires adaptation as many authors omit the information on how they applied the augmentation, sampled examples from the dataset, and how many examples their method creates per each original example. While performance benchmarks can provide insights into which data augmentation method works better, they fall short of capturing the computational aspect of applying data aug- mentation. Computing is cheaper than human annotation, but there are applications such as crisis intervention for which one needs to train a classifier in a very limited time and where time-consuming data augmentation methods may not be applicable [7]. H. Data augmentation libraries Recent advances in data augmentation for natural language processing have led to the development of a number of open-source libraries. Using such libraries can help accelerate the usage of different data augmentation methods in product development. AugLy library [73], OpenAttack toolkit [74], and TextAttack framework [75] are focused on data augmentations based on adversarial attacks for making the models more robust. While TextAttack and OpenAttack are focused on text data, AugLy supports other data modalities such as audio, image, and video. NLPaug [76] offers simple-to-use transformations for text and audio data. NL-Augmenter [77] provides a wide range of text transformations with a focus on task specificity. As discussed in Section IV-E, library authors argue that some transforma- tions may be irrelevant or degrade performance if they are not task-specific. TextFlint [78] is a library for multilingual robustness evaluation, which also offers a wide range of text transformations. Similarly to libraries based on adversarial attacks, Authors of NL-Augmenter and TextFlint libraries suggest using data augmentation methods on validation and test sets to determine the robustness of the model. V. CONCLUSION Data augmentation is a set of strategies for generating new data based on available data. This paper presented an overview of data augmentation methods and their practical challenges. Data augmentation proved to be a low-cost solution to the data scarcity problem and a way to make the model more robust. While effective in many use cases, it is still not easy to determine which data augmentation will be successful and how it should be applied to the particular use case. Future directions might include an analysis of how to apply data augmentation more effectively by selecting appropriate data instances and stacking data augmentation methods. REFERENCES [1] Z. Tan, S. Wang et al., "Neural machine translation: A review of methods, resources, and tools," AI Open, vol. 1, pp. 5–21, 1 2020. [2] J. Devlin, M.-W. Chang et al., "BERT: Pre-training of deep bidirectional transformers for language understanding," in Proceedings of the 2019 the Association for Conference of Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers). Minneapolis, Minnesota: Association for Computational Linguistics, Jun. 2019, pp. 4171–4186. [Online]. Available: https://aclanthology.org/N19-1423 the North American Chapter of [3] S. Minaee, N. Kalchbrenner et al., "Deep learning–based text classification," ACM Computing Surveys (CSUR), vol. 54, 4 2021. [Online]. Available: https://dl.acm.org/doi/10.1145/3439726 [4] G. G. S ̧ ahin, "To augment or not study on text augmentation techniques Computational Linguistics, vol. 48, pp. 5–42, 4 2022. Available: https://aclanthology.org/2022.cl-1.2 for to augment? a comparative low-resource NLP," [Online]. [5] S. Y. Feng, V. Gangal et al., "A survey of data augmentation approaches for NLP," Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pp. 968–988, 2021. [Online]. Available: https://aclanthology.org/2021.findings-acl.84 [6] B. Li, Y. Hou, and W. Che, "Data augmentation approaches in natural language processing: A survey," AI Open, 2022. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S2666651022000080 [7] B. Markus, K. Marc-Andr ́e, and R. Christian, "A survey on data augmentation for text classification," ACM Computing Surveys, 7 2021. [Online]. Available: https://dl.acm.org/doi/10.1145/3544558 the 2021 Conference of [8] M. A. Hedderich, L. Lange et al., "A survey on recent approaches in language processing in low-resource the North American the Association for Computational Linguistics: Human Online: Association for Computational [Online]. Available: pp. for natural Proceedings of Chapter of Language Technologies. Linguistics, https://aclanthology.org/2021.naacl-main.201 and T. M. Khoshgoftaar, [9] C. Shorten 2545–2568. scenarios," 2021, Jun. augmentation vol. data Data, https://journalofbigdata.springeropen.com/articles/10.1186/s40537-019-0197-0 learning," 2019. 1–48, deep pp. for 12 6, on "A survey Journal image Big [Online]. Available: of [10] A. Hern ́andez-Garc ́ıa and P. K ̈onig, "Data augmentation instead of explicit regularization," arXiv:1806.03852, 6 2018. [Online]. Available: https://arxiv.org/abs/1806.03852v5 [11] T.-H. Cheung and D.-Y. Yeung, "{MODALS}: Modality-agnostic automated data augmentation in the latent space," in International Conference on Learning Representations, 2021. [Online]. Available: https://openreview.net/forum?id=XjYgR6gbCEc [12] C. T. M. Khoshgoftaar, Shorten, augmentation 8:1, learning," data 2021 7 https://journalofbigdata.springeropen.com/articles/10.1186/s40537-021-00492-0 for deep pp. 2021. 1–34, vol. 8, and B. Journal Furht, "Text of Big Data [Online]. Available: [13] S. Sharma, Y. Zhang et al., "Data augmentation for discrimination prevention and bias disambiguation," in Proceedings of the AAAI/ACM Conference on AI, Ethics, and Society, ser. AIES '20. New York, NY, USA: Association for Computing Machinery, 2020, p. 358–364. [Online]. Available: https://doi.org/10.1145/3375627.3375865 [14] J. H. Park, J. Shin, and P. Fung, "Reducing gender bias in abusive language detection," in Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. Brussels, Belgium: Association for Computational Linguistics, Oct.-Nov. 2018, pp. 2799–2804. [Online]. Available: https://aclanthology.org/D18-1302 [15] J. Wei and K. Zou, "Eda: Easy data augmentation techniques for boosting performance on text classification tasks," EMNLP-IJCNLP 2019 - 2019 Conference on Empirical Methods in Natural Language Processing and 9th International Joint Conference on Natural Language Processing, Proceedings of the Conference, pp. 6382–6388, 2019. [Online]. Available: https://aclanthology.org/D19-1670 [16] A. Karimi, and A. L. Rossi, augmentation easier classification," Findings the Association for Computational Linguistics, Findings of [Online]. Available: data of ACL: EMNLP 2021, pp. 2748–2754, 2021. https://aclanthology.org/2021.findings-emnlp.234 "Aeda: An technique Prati, text for [17] S. Longpre, Y. Wang, and C. DuBois, "How effective is task- agnostic data augmentation for pretrained transformers?" Findings the Association for Computational Linguistics Findings of of ACL: EMNLP 2020, pp. 4401–4411, 2020. [Online]. Available: https://aclanthology.org/2020.findings-emnlp.394 [18] P. Y. Simard, D. Steinkraus, and J. C. Platt, "Best practices for convolu- tional neural networks applied to visual document analysis," Proceedings of the International Conference on Document Analysis and Recognition, ICDAR, vol. 2003-January, pp. 958–963, 2003. [19] T. Ko, V. Peddinti et al., "Audio augmentation for speech recognition," Proceedings of the International Speech Communication Association, INTERSPEECH, vol. 2015-January, pp. 3586–3589, 2015. the Annual Conference of [20] P. Liu, X. Wang et al., "A survey of text data augmentation," Proceedings - 2020 International Conference on Computer Communication and Network Security, CCNS 2020, pp. 191–195, 8 2020. [21] M. Alzantot, Y. Sharma et al., "Generating natural language adversarial examples," Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, EMNLP 2018, pp. 2890–2896, 2018. [Online]. Available: https://aclanthology.org/D18-1316 [22] X. Wu, S. Lv et al., "Conditional bert contextual augmentation," Lecture Notes in Computer Science (including subseries Lecture Notes in Bioinformatics), in Artificial vol. [Online]. Available: 11539 https://link.springer.com/chapter/10.1007/978-3-030-22747-0 7 Intelligence and Lecture Notes LNCS, 84–95, 2019. pp. [23] R. Liu, G. Xu et al., "Data boost: Text data augmentation through reinforcement learning guided conditional generation," EMNLP 2020 - 2020 Conference on Empirical Methods in Natural Language Processing, Proceedings of the Conference, pp. 9031–9041, 2020. [Online]. Available: https://aclanthology.org/2020.emnlp-main.726 [24] C. Coulombe, "Text data augmentation made simple by leveraging nlp cloud apis," arXiv:1812.04718, 2018. [25] J. Ebrahimi, A. Rao et al., "HotFlip: White-box adversarial examples for text classification," in Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers). Melbourne, Australia: Association for Computational Linguistics, Jul. 2018, pp. 31–36. [Online]. Available: https://aclanthology.org/P18-2006 [26] S. Garg and G. Ramakrishnan, "BAE: BERT-based adversarial examples for text classification," in Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP). Online: Association for Computational Linguistics, Nov. 2020, pp. 6174–6181. [Online]. Available: https://aclanthology.org/2020.emnlp-main.498 [27] V. Karpukhin, O. Levy et al., "Training on synthetic noise improves robustness to natural noise in machine translation," in Proceedings of the 5th Workshop on Noisy User-generated Text (W-NUT 2019). Hong Kong, China: Association for Computational Linguistics, Nov. 2019, pp. 42–47. [Online]. Available: https://aclanthology.org/D19-5506 [28] J. Min, R. T. McCoy et al., "Syntactic data augmentation increases robustness to inference heuristics," in Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics. Online: Association for Computational Linguistics, Jul. 2020, pp. 2339–2352. [Online]. Available: https://aclanthology.org/2020.acl-main.212 [29] G. G. S ̧ ahin and M. Steedman, "Data augmentation via dependency the tree morphing for low-resource languages," in Proceedings of in Natural Language 2018 Conference on Empirical Methods Processing. for Computational Brussels, Belgium: Association Linguistics, Oct.-Nov. 2018, pp. 5004–5009. [Online]. Available: https://aclanthology.org/D18-1545 [30] H. Shi, K. Livescu, and K. Gimpel, "Substructure substitution: Structured data augmentation for NLP," in Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021. Online: Association for Computational Linguistics, Aug. 2021, pp. 3494–3508. [Online]. Available: https://aclanthology.org/2021.findings-acl.307 [31] W. Y. Wang and D. Yang, "That's so annoying!!!: A lexical and frame-semantic embedding based data augmentation approach to automatic categorization of annoying behaviors using #petpeeve tweets," in Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing. Lisbon, Portugal: Association for Computational Linguistics, Sep. 2015, pp. 2557–2563. [Online]. Available: https://aclanthology.org/D15-1306 [32] Y. Wang and M. Bansal, "Robust machine comprehension models via adversarial training," CoRR, vol. abs/1804.06473, 2018. [Online]. Available: http://arxiv.org/abs/1804.06473 [33] K. M. Yoo, D. Park et large- in Findings of scale language models for the Association for Computational Linguistics: EMNLP 2021. Punta Cana, Dominican Republic: Association for Computational [Online]. Available: 2021, Linguistics, Nov. https://aclanthology.org/2021.findings-emnlp.192 al., text augmentation," "GPT3Mix: Leveraging 2225–2239. pp. [34] H. Zhang, M. Cisse et al., "mixup: Beyond empirical risk minimization," 6th International Conference on Learning Representations, ICLR 2018 - Conference Track Proceedings, 10 2017. [Online]. Available: https://arxiv.org/abs/1710.09412v2 [35] J. Chen, Z. Yang, and D. Yang, "MixText: Linguistically- semi-supervised text informed interpolation of hidden space for the 58th Annual Meeting of classification," the Association for Computational Linguistics. Online: Association for Computational Linguistics, Jul. 2020, pp. 2147–2157. [Online]. Available: https://aclanthology.org/2020.acl-main.194 in Proceedings of [36] D. Berthelot, N. Carlini et al., MixMatch: A Holistic Approach to Semi- Supervised Learning. Red Hook, NY, USA: Curran Associates Inc., 2019. [37] N. Thakur, N. Reimers et al., "Augmented SBERT: Data augmentation method for improving bi-encoders for pairwise sentence scoring tasks," in Proceedings of the the 2021 Conference of North American Chapter of the Association for Computational Linguistics: Human Language Technologies. Online: Association for Computational Linguistics, Jun. 2021, pp. 296–310. [Online]. Available: https://aclanthology.org/2021.naacl-main.28 [38] M. S. Bari, T. Mohiuddin, and S. Joty, "UXLA: A robust unsupervised data augmentation framework for zero-resource cross-lingual NLP," in Proceedings of the Association for the 59th Annual Meeting of Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers). Online: Association for Computational Linguistics, Aug. 2021, pp. 1978–1992. [Online]. Available: https://aclanthology.org/2021.acl-long.154 [39] G. A. Miller, "Wordnet: A lexical database for english," Commun. [Online]. Available: ACM, vol. 38, no. 11, p. 39–41, nov 1995. https://doi.org/10.1145/219717.219748 [40] E. Pavlick, P. Rastogi et al., "PPDB 2.0: Better paraphrase ranking, fine- grained entailment relations, word embeddings, and style classification," in Proceedings of the Association for the 53rd Annual Meeting of Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 2: Short Papers). Beijing, China: Association for Computational Linguistics, Jul. 2015, pp. 425–430. [Online]. Available: https://aclanthology.org/P15-2070 [41] Q. Xie, Z. Dai et al., "Unsupervised data augmentation for consistency training," in Proceedings of the 34th International Conference on Neural Information Processing Systems, ser. NIPS'20. Red Hook, NY, USA: Curran Associates Inc., 2020. [42] G. Yan, Y. Li et al., "Data augmentation for deep learning of judgment documents," in Intelligence Science and Big Data Engineering. Big Data and Machine Learning, Z. Cui, J. Pan et al., Eds. Cham: Springer International Publishing, 2019, pp. 232–242. [43] R. Zhang, Y. Yu, and C. Zhang, "SeqMix: Augmenting active sequence labeling via sequence mixup," in Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP). Online: Association for Computational Linguistics, Nov. 2020, pp. 8566–8579. [Online]. Available: https://aclanthology.org/2020.emnlp-main.691 [44] R. Bhagat and E. Hovy, "What Is a Paraphrase?" Computational Linguistics, vol. 39, no. 3, pp. 463–472, 09 2013. [Online]. Available: https://doi.org/10.1162/COLI a 00166 [45] G. Rizos, K. Hemker, and B. Schuller, "Augment to prevent: Short-text data augmentation in deep learning for hate-speech classification," in Proceedings of the 28th ACM International Conference on Information and Knowledge Management, ser. CIKM '19. New York, NY, USA: Association for Computing Machinery, 2019, p. 991–1000. [Online]. Available: https://doi.org/10.1145/3357384.3358040 for Computational Linguistics, Nov. 2019, pp. 1317–1323. [Online]. Available: https://aclanthology.org/D19-1132 [46] S. Goyal, S. Doddapaneni et al., "A survey in adversarial defences and robustness in NLP," ArXiv, vol. abs/2203.06414, 2022. [47] Y. Cheng, L. Jiang, and W. Macherey, "Robust neural machine the translation with doubly adversarial 57th Annual Meeting of the Association for Computational Linguistics. Florence, Italy: Association for Computational Linguistics, Jul. 2019, pp. 4324–4333. [Online]. Available: https://aclanthology.org/P19-1425 al., abs/1803.11175, 2018. en- sentence [Online]. Available: inputs," in Proceedings of "Universal [48] D. Yang Cer, Y. et coder," CoRR, vol. http://arxiv.org/abs/1803.11175 [49] I. Solaiman, M. Brundage et al., "Release strategies and the social language models," CoRR, vol. abs/1908.09203, 2019. impacts of [Online]. Available: http://arxiv.org/abs/1908.09203 [50] M.-R. Amini, V. Feofanov et al., "Self-training: A survey," ArXiv, vol. abs/2202.12040, 2022. [51] N. V. Chawla, K. W. Bowyer et al., "Smote: Synthetic minority over- sampling technique," J. Artif. Int. Res., vol. 16, no. 1, p. 321–357, jun 2002. [52] H. Guo, Y. Mao, and R. Zhang, "Augmenting data with mixup for sentence classification: An empirical study," ArXiv, 5 2019. [Online]. Available: https://arxiv.org/abs/1905.08941v1 [53] L. Sun, C. Xia et al., "Mixup-transformer: Dynamic data augmentation for NLP tasks," in Proceedings of the 28th International Conference on Computational Linguistics. Barcelona, Spain (Online): International Committee on Computational Linguistics, Dec. 2020, pp. 3436–3440. [Online]. Available: https://aclanthology.org/2020.coling-main.305 [54] S. Y. Park and C. Caragea, "A data cartography based MixUp for pre-trained language models," in Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. Seattle, United States: Association for Computational Linguistics, Jul. 2022, pp. 4244–4250. [Online]. Available: https://aclanthology.org/2022.naacl-main.314 [55] T. B. Brown, B. Mann et al., "Language models are few-shot [Online]. Available: learners," CoRR, vol. abs/2005.14165, 2020. https://arxiv.org/abs/2005.14165 [56] M. Jungiewicz and A. Smywinski-Pohl, textual data augmentation for neural networks: synonyms and maximum loss," Computer Science, vol. 20, no. 1, Mar. 2019. [Online]. Available: https://journals.agh.edu.pl/csci/article/view/3023 "Towards [57] J. Wei, C. Huang et al., text "Few-shot the 2021 Conference of classification with triplet networks, data augmentation, and curriculum learning," in Proceedings of the North American the Association for Computational Linguistics: Human Chapter of Language Technologies. Online: Association for Computational Linguistics, [Online]. Available: pp. https://aclanthology.org/2021.naacl-main.434 "Efficient augmentation via data subsampling," CoRR, vol. abs/1810.05222, 2018. [Online]. Available: http://arxiv.org/abs/1810.05222 5493–5500. 2021, Jun. [58] M. Kuchnik and V. Smith, [59] J. Wei, C. Huang et al., "Text augmentation in a multi-task view," in Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume. Online: Association for Computational Linguistics, Apr. 2021, pp. 2888–2894. [Online]. Available: https://aclanthology.org/2021.eacl-main.252 [60] E. D. Cubuk, B. Zoph et al., "Randaugment: Practical data augmentation with no separate search," CoRR, vol. abs/1909.13719, 2019. [Online]. Available: http://arxiv.org/abs/1909.13719 [61] --, "Autoaugment: Learning augmentation policies the from data," in Proceedings on Computer Vision and Pattern Recognition (CVPR), 2019. [Online]. Available: https://arxiv.org/pdf/1805.09501.pdf IEEE/CVF Conference of [62] D. Ho, E. Liang et al., "Population based augmentation: Efficient learning of augmentation policy schedules," CoRR, vol. abs/1905.05393, 2019. [Online]. Available: http://arxiv.org/abs/1905.05393 [63] Z. Yang, R. O. Sinnott et al., "A survey of automated data augmentation algorithms for deep learning-based image classication tasks," arXiv preprint arXiv:2206.06544, 2022. [64] T. Niu and M. Bansal, "Automatically learning data augmentation policies for dialogue tasks," in Proceedings of the 2019 Conference on Empirical Methods and the 9th International on Natural Language Processing (EMNLP-IJCNLP). Hong Kong, China: Association in Natural Language Processing Joint Conference [65] S. Ren, J. Zhang et al., "Text AutoAugment: Learning compositional in Proceedings of augmentation policy for the 2021 Conference on Empirical Methods in Natural Language Processing. Online and Punta Cana, Dominican Republic: Association for Computational Linguistics, Nov. 2021, pp. 9029–9043. [Online]. Available: https://aclanthology.org/2021.emnlp-main.711 classification," text [66] Q. Li, Z. Huang et al., "A framework of data augmentation while active learning for chinese named entity recognition," in Knowledge Science, Engineering and Management: 14th International Conference, KSEM 2021, Tokyo, Japan, August 14–16, 2021, Proceedings, Part II. Berlin, Heidelberg: Springer-Verlag, 2021, p. 88–100. [Online]. Available: https://doi.org/10.1007/978-3-030-82147-0 8 [67] W. Ling, C. Dyer et al., "Finding function in form: Compositional in in Lisbon, Portugal: Association for [Online]. character models Proceedings of Natural Language Processing. Computational Linguistics, Sep. 2015, pp. 1520–1530. Available: https://aclanthology.org/D15-1176 for open vocabulary word representation," the 2015 Conference on Empirical Methods [68] R. Sennrich, B. Haddow, and A. Birch, "Neural machine translation the 54th rare words with subword units," in Proceedings of the Association for Computational Linguistics Berlin, Germany: Association for [Online]. of Annual Meeting of (Volume 1: Long Papers). Computational Linguistics, Aug. 2016, pp. 1715–1725. Available: https://aclanthology.org/P16-1162 [69] Y. Wu, M. Schuster et al., "Google's neural machine translation system: Bridging the gap between human and machine translation," ArXiv, vol. abs/1609.08144, 2016. [70] V. Yadav and S. Bethard, "A survey on recent advances in named entity recognition from deep learning models," in Proceedings of the 27th International Conference on Computational Linguistics. Santa Fe, New Mexico, USA: Association for Computational Linguistics, Aug. 2018, pp. 2145–2158. [Online]. Available: https://aclanthology.org/C18-1182 [71] Z. He, Z. Wang et al., "A survey on recent advances in sequence labeling from deep learning models," CoRR, vol. abs/2011.06727, 2020. [Online]. Available: https://arxiv.org/abs/2011.06727 [72] Y. Zheng, Z. Zhang et al., "Deep autoaugment," in International Conference on Learning Representations, 2022. [Online]. Available: https://openreview.net/forum?id=St-53J9ZARf [73] Z. Papakipos, J. Bitton, and M. Ai, "Augly: Data augmentations [Online]. Available: robustness," arXiv:2201.06494v1, 1 2022. for https://arxiv.org/abs/2201.06494v1 attack toolkit," [74] G. Zeng, F. Qi et al., "OpenAttack: An open-source textual the 59th Annual adversarial the Association for Computational Linguistics and Meeting of Joint Conference on Natural Language the 11th International Processing: for Computational Linguistics, Aug. 2021, pp. 363–371. [Online]. Available: https://aclanthology.org/2021.acl-demo.43 System Demonstrations. Online: Association in Proceedings of [75] J. X. Morris, E. Lifland et al., "Textattack: A framework for adversarial attacks, data augmentation, and adversarial training in NLP," arXiv:2005.05909v4, pp. 119–126, 4 2020. [Online]. Available: https://arxiv.org/abs/2005.05909v4 [76] E. Ma, "NLP augmentation," https://github.com/makcedward/nlpaug, 2019. [77] K. D. Dhole, V. Gangal et al., "Nl-augmenter: A framework for task- sensitive natural language augmentation," Nivranshu Pasricha, vol. 20, p. 75, 12 2021. [Online]. Available: https://arxiv.org/abs/2112.02721v1 [78] X. Wang, Q. Liu et al., "TextFlint: Unified multilingual robustness language processing," in Proceedings evaluation toolkit for natural of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing: System Demonstrations. Online: Association [Online]. for Computational Linguistics, Aug. 2021, pp. 347–355. Available: https://aclanthology.org/2021.acl-demo.41 the 59th Annual Meeting of
http://arxiv.org/abs/2302.11408v2
2023-08-06T17:24:21
2023-02-22T14:43:33
ASSET: Robust Backdoor Data Detection Across a Multiplicity of Deep Learning Paradigms
Backdoor data detection is traditionally studied in an end-to-end supervised learning (SL) setting. However, recent years have seen the proliferating adoption of self-supervised learning (SSL) and transfer learning (TL), due to their lesser need for labeled data. Successful backdoor attacks have also been demonstrated in these new settings. However, we lack a thorough understanding of the applicability of existing detection methods across a variety of learning settings. By evaluating 56 attack settings, we show that the performance of most existing detection methods varies significantly across different attacks and poison ratios, and all fail on the state-of-the-art clean-label attack. In addition, they either become inapplicable or suffer large performance losses when applied to SSL and TL. We propose a new detection method called Active Separation via Offset (ASSET), which actively induces different model behaviors between the backdoor and clean samples to promote their separation. We also provide procedures to adaptively select the number of suspicious points to remove. In the end-to-end SL setting, ASSET is superior to existing methods in terms of consistency of defensive performance across different attacks and robustness to changes in poison ratios; in particular, it is the only method that can detect the state-of-the-art clean-label attack. Moreover, ASSET's average detection rates are higher than the best existing methods in SSL and TL, respectively, by 69.3% and 33.2%, thus providing the first practical backdoor defense for these new DL settings. We open-source the project to drive further development and encourage engagement: https://github.com/ruoxi-jia-group/ASSET.
[ "Minzhou Pan", "Yi Zeng", "Lingjuan Lyu", "Xue Lin", "Ruoxi Jia" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11408v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11408v2", "@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", "cs.CV" ]
3 2 0 2 g u A 6 ] G L . s c [ 2 v 8 0 4 1 1 . 2 0 3 2 : v i X r a ASSET: Robust Backdoor Data Detection Across a Multiplicity of Deep Learning Paradigms Minzhou Pan∗*1, Yi Zeng*1, Lingjuan Lyu2, Xue Lin3 and Ruoxi Jia1 1Virginia Tech, Blacksburg, VA 24061, USA 2Sony AI, Tokyo, 108-0075, Japan 3Northeastern University, Boston, MA 02115, USA Abstract Backdoor data detection is traditionally studied in an end- to-end supervised learning (SL) setting. However, recent years have seen the proliferating adoption of self-supervised learn- ing (SSL) and transfer learning (TL), due to their lesser need for labeled data. Successful backdoor attacks have also been demonstrated in these new settings. However, we lack a thor- ough understanding of the applicability of existing detection methods across a variety of learning settings. By evaluating 56 attack settings, we show that the performance of most existing detection methods varies significantly across different attacks and poison ratios, and all fail on the state-of-the-art clean-label backdoor attack which only manipulates a few training data's features with imperceptible noise without changing labels. In addition, existing methods either become inapplicable or suf- fer large performance losses when applied to SSL and TL. We propose a new detection method called Active Separation via Offset (ASSET), which actively induces different model be- haviors between the backdoor and clean samples to promote their separation. We also provide procedures to adaptively select the number of suspicious points to remove. In the end- to-end SL setting, ASSET is superior to existing methods in terms of consistency of defensive performance across dif- ferent attacks and robustness to changes in poison ratios; in particular, it is the only method that can detect the state-of-the- art clean-label attack. Moreover, ASSET's average detection rates are higher than the best existing methods in SSL and TL, respectively, by 69.3% and 33.2%, thus providing the first practical backdoor defense for these emerging DL settings. 1 Introduction Deployment of deep learning (DL) in critical services and infrastructures calls for special emphasis on security, given its susceptibility to erroneous predictions in the presence of attacks [1–3]. Specifically, data-poisoning-based backdoor attacks - where attackers manipulate the training data to force certain outputs during testing - pose a significant threat. Suc- cessful attacks have been demonstrated on various computer Figure 1: Illustration of popular DL paradigms and corre- sponding threat models. Case-0: traditional end-to-end SL, where one trains a model from scratch. Case-1: SSL adap- tation, where one first pre-trains a model via SSL using un- labeled pre-training data and then linearly adapts to a small amount of labeled data to obtain the final model. Case-2: TL, where one starts with an existing pre-trained model and fine- tunes it. Existing work has demonstrated successful attacks in all three cases under the threat models where datasets marked with red circle indicates poisons. Yet, none of the existing backdoor detection methods is evaluated in all three cases. vision tasks and beyond [4]. This paper focuses on the prob- lem of detecting the poisoned samples within a training set. An effective detection strategy allows one to mitigate the risk of backdoors by removing suspicious samples from training. Poisoned samples can be regarded as outliers in a train- ing set. However, unlike arbitrary outliers considered in the classical outlier detection and robust statistics literature, poi- soned samples are special outliers that induce specific model behaviors, e.g., misleading the model to predict some target class(es). Hence, recent works on backdoor detection primar- ily leverage the model trained on the poisoned dataset (back- doored model hereinafter ) or information cached during train- ing to help discover poisoned samples [5–11]. For instance, most of the prior work starts by extracting the backdoored model's output [6], intermediate activation patterns [7–10], gradient [11] for each sample, and then separate poisons from clean samples based on the extracted information. ∗Y. Zeng and M. Pan contributed equally. Correspond Y. Zeng or R. Jia. While taking advantage of the information collected from the downstream learning process provides a clear path to en- hancing backdoor detection performance, it also raises the question: Can these detection methods maintain their per- formance across different DL settings? Particularly, existing detection methods are exclusively evaluated in only one learn- ing setting-end-to-end supervised learning (SL), where a labeled poisoned dataset is used to train a model from scratch. On the other hand, new learning paradigms are increasingly adopted and have demonstrated state-of-the-art prediction per- formance with reduced annotation costs and computational burden [12–15]. The two most representative and popular paradigms are self-supervised learning (SSL) adaptation and transfer learning (TL), as illustrated in Figure 1. In SSL adaptation, one pre-trains a model on large un- labeled data (e.g., through contrastive learning [16–18] or masked autoencoder (MAE) [13]) and then fine-tunes only the last layer using labeled data from a specific downstream task. Recent work [19–21] has shown that an attacker can poison the unlabeled dataset to implant backdoors without any control over downstream fine-tuning processes. Thus, it is natural to ask: Can we detect the poisoned samples within an unlabeled dataset using existing methods? In TL, one starts with an existing pre-trained model and fine-tunes all layers of the model or just the last layer with labeled data. Despite the importance of TL in practice [22], we lack an understanding of backdoor detection in this setting: Can we detect the poi- soned samples when they are used for fine-tuning an existing model instead of training it from scratch? Our first contribution is a comprehensive evaluation of existing detection methods across different DL paradigms. The key findings are summarized as follows. • (Case-0) End-to-end SL: Despite the efficiency demon- strated by prior detection efforts in specific settings, the consistency of efficacy varies a lot across different at- tacks or poison ratios. In particular, all fail to detect the state-of-the-art clean-label backdoor attack1 [2] and un- derperform in the very low or very high poison ratio setting (e.g., 0.05% or 20%). • (Case-1) SSL adaptation: There are no existing meth- ods dedicated to detecting unlabeled poisoned samples in the SSL setting. Yet, some of the existing methods can be adapted to the SSL. For instance, those methods attempting to separate the poisoned samples from clean in the embedding space can employ an embedder learned from unlabeled data to generate the embedding for each sample 2. However, the performance of these methods after adaptation is limited (e.g., their average detection rate over different attacks all falls below 26%). • Case-2 TL: While prior literature omitted TL in their evaluation, the detection methods can all be applied to it. However, the methods based on embeddings suffer a 1Clean-label attacks refer to those where the poisoned samples appear to be correctly labeled to a human inspector. 2We will elaborate on the adaptation techniques in Section 5.1. Spectral Spectre Beatrix Applicable to Labeled Data Applicable to Unlabeled Data Robust to Diff. Triggers Robust to Diff. Poison Ratios [7] ✓ ⃝ × × [8] ✓ ⃝ × × [9] ✓ ⃝ × × AC [10] ABL [11] ✓ ⃝ × × ✓ ⃝ × × Strip [6] ✓ ⃝ × × CT [23] ✓ × × × Ours ✓ ✓ ✓ ✓ Table 1: A summary and comparison of representative works in the detection of backdoored samples. ⃝ denotes partially satisfactory (i.e., requiring additional adaptation). significant performance loss compared to the end-to-end SL setting because the poisoned samples are less distin- guishable from clean ones in a fine-tuned embedding space than a trained-from-scratch one. The limitations of existing methods per our evaluation are summarized in Table 1. Overall, there still lacks a detection method that is effective across different learning paradigms. Our second contribution is the development of a robust, generic approach to backdoor detection that applies to the three representative learning paradigms discussed above. Like most existing literature [6, 8, 9], our approach also as- sumes that the defender has an extra set of clean samples (referred to as a base set hereinafter) with a size much smaller compared to the training set. In practice, these clean sam- ples can be obtained through manual inspection or automatic screening [24]. However, unlike the previous works, we do not require the base set to be labeled. The key idea of our approach is to induce different model behaviors between poisoned samples and clean ones. To achieve this, we design a two-step optimization process: we first minimize some loss on the clean base set; then, we at- tempt to offset the effect of the first minimization on the clean distribution by maximizing the same loss on the entire training set including both clean and poisoned samples. The outcome of this two-step process is a model which returns high loss for poisoned samples and low loss for clean ones. Hence, we can decide whether a sample is poisoned or clean based on the corresponding loss value. We found that the two-step optimization-based offset idea achieves strong detection performance except in settings where the poison ratio is low, or the learning of the poisoned samples happens slowly-at roughly the same speed as learn- ing of clean samples. As we will explicate later in the paper, in these cases, the effect of the second maximization signif- icantly outweighs that of the first minimization; as a result, both poisoned and clean samples achieve large losses and become inseparable. To tackle the challenge, we propose a strengthened tech- nique that involves two nested offset procedures, and the inner offset reinforces the outer one. Specifically, we use the inner offset procedure to identify the points most likely to be poi- soned and mark them as suspicious; the outer offset procedure still minimizes some loss on the clean base set, but the maxi- mization will now be performed on the points marked to be suspicious by the inner offset, instead of the entire poisoned dataset. As the proportion of clean samples within the suspi- cious set is much smaller than that within the entire poisoned set, the small loss of clean samples obtained from the first minimization would be impacted much less by the second maximization. This nested design effectively improves the separability between clean and poisoned samples. Our third contribution is the provision of techniques that can adaptively set the loss threshold to discern poi- soned samples. Some of the prior works [7, 8] assume the knowledge of poison ratio and mark a fixed number of samples as poisoned ones based on their respective criteria. Moreover, the poisoned and clean samples often do not have a clear sep- aration based on their criteria (see examples in Figure 5); as a result, their detection performance is very sensitive to the esti- mated poison ratio. We argue that in practice, it is challenging to have an accurate estimate of the poison ratio. Hence, it is preferable to adapt detection to the data characteristics rather than relying on a fixed estimate. Herein, we design two adap- tive thresholding techniques tailored to specific requirements imposed by inner and outer offset procedures (i.e., prioritizing precision vs. prioritizing true positive rate). We conduct extensive experiments in comparison with seven representative or state-of-art backdoor data detection methods over 56 different attack settings across various DL paradigms and show that our proposed method, ASSET, is the only one that can provide reliable detection consistently across all the evaluated settings. This work is also the first practical backdoor detection for the SSL and the TL settings3. 2 Background & Related Work End-to-end supervised learning & transfer learning. The objective of end-to-end SL is to train a classifier f (*|θ) : X → [k], which predicts the label y ∈ [k] of an input x ∈ X . θ denotes the parameters of the classifier f (*|θ). The standard end-to- end SL (Case-0) consists of two stages: training and testing. In the training stage, a learning algorithm is provided with a set of training data, D = {(xi, yi)}N i=1, consisting of examples from k classes. Then, the learning algorithm seeks the model parameters, θ, that minimize the empirical risk: (1) L ( f (xi|θ) , yi) . θ∗ = arg min θ N ∑ i=1 When f (*|θ) is a deep neural network, the corresponding empirical risk is a non-convex function of θ, and finding a global minimum is generally impossible. Hence, the standard practice is to look for a local minimum. Algorithmically, the model is initialized with random parameters and updated itera- tively via stochastic gradient descent [25]. In the test stage, the trained model f (*|θ∗) takes input test examples and serves up predictions. TL (Case-2) shares the same optimization goal as the end-to-end SL. However, TL initializes the optimization with a pre-trained backbone model instead of random param- eters. Within the scope of this paper, we consider two of the 3Open-source: https://github.com/ruoxi-jia-group/ASSET Figure 2: Illustration of representative SSL methods: Sim- CLR [12], MoCo V3 [12], BYOL [18], and the Masked Auto- Encoder [13]. The solid gray arrow indicates forward propa- gation, and the dashed black arrow indicates backpropagation. most popular TL schemes: (1) FT-all: the entire pre-trained model gets updated during training (e.g., [13, 14, 26]); (2) FT-last (or linear adaptation): only the last fully-connected layer is updated (e.g., [15, 16, 27]). In the context of TL, we will refer to solving the optimization (1) as fine-tuning and D as the fine-tuning data. Self-supervised learning. SSL usually consists of two phases: pretext training and fine-tuning. Pretext training aims to train an encoder f (*|θ) : X → Z that can map the input x ∈ X into the embedding z ∈ Z. θ denotes the parameters of the encoder f (*|θ). This paper focuses primarily on two of the most recent SSL schemes: contrastive learning and masked auto-encoder (MAE). Their training processes are illustrated in Figure 2, where M is a multi-layer perceptron (MLP) used to reduce the dimension of features, and P is a predictor. The fundamental idea of contrastive learning, e.g., SimCLR [12], MoCo V3 [17], and BYOL [18], is to learn an encoder by bringing the embeddings corresponding to the augmentations of the same image (a.k.a. positive pairs) closer and distanc- ing its embeddings from other images (a.k.a. negative pairs). All three methods pre-train f (*|θ), M and P (if applicable) on large amounts of unlabeled data, and differ in how they generate positive and negative pairs and in the loss functions they use for training. We refer interested readers to [28] for more details. By contrast, the recently proposed SSL method, MAE [13], trains the encoder f (*|θ) by masking a portion of pixels in an image x (the masked image is denoted by x′) and then using f (x′|θ) with a decoder d(*) to restore x. For all the aforementioned SSL methods, after the pretext train- ing, the acquired encoder parameters θ∗ will be adapted to a downstream task similarly to TL using the fine-tuning data. Backdoor attacks. Backdoor attacks have been extensively studied in the end-to-end SL setting and can be categorized into dirty-label and clean-label attacks. Dirty-label backdoor attacks manipulate both label and feature of a sample. These attacks have developed from using a sample-independent vis- ible pattern as the trigger [1, 29–31] to more stealthy and powerful attacks with sample-specific [32] or visually imper- ceptible triggers [33–38]. Clean-label backdoor attacks ensure that the manipulated features are semantically consistent with corresponding labels. Existing attacks in this category range from inserting arbitrary triggers [39–41] to optimized trig- gers [2]. Most of the above backdoor attacks can be easily adapted to TL settings without modifications. There are also backdoor attacks specifically designed for TL settings, e.g., the hidden trigger backdoor attack [40]. With the thriving development of SSL, especially con- trastive learning (e.g., SimCLR [12, 16], MoCo [17, 42, 43], BYOL [18]) and the MAE [13], backdoor attacks targeting SSL have also been explored. Recent work mainly applies existing dirty-label backdoor triggers studied in SL to the targeted category of samples [19, 20]. However, attacks' effi- cacy are limited (ASR below 10% on CIFAR-10 even with an in-class poison ratio set to 50%, as shown in our experiment, Section 5.3). A recent attack [21] exploits the "representation invariance" property of contrastive learning and instantiate a symmetric trigger via manipulation in the frequency domain, achieving much higher ASR with a lower poison ratio (e.g., in-class poison ratio of 10%). Backdoor sample detection. Note that no existing back- doored sample detection methods have been considered nor evaluated over cases other than Case-0. In particular, there is no practical defense under the SSL, and the study in TL is overlooked. Many of the existing works identify poisoned samples by examining their difference from clean ones in the embedding space, such as using singular value decomposition (SVD) [7, 8], Gram matrix [9], K-Nearest-Neighbors [44], and feature decomposition [5]. In addition to embeddings, intermediate neural activation [10, 45] and gradients [46, 47] extracted from samples can also be adopted for backdoored sample detection. Past work has also examined other differ- entiating properties of backdoor samples, such as trigger's resistance to augmentations [6], high-frequency artifacts [36], low contribution to the training task [48,49], or backdoor sam- ples may achieve lower loss at the early stage of training [11]. A recent work [23] proposed a confusion training proce- dure, which trains a model on a weighted combination of the randomly-labeled clean base set and the poisoned set. Intro- ducing a randomly-labeled clean set into training prevents the model from fitting to the clean portion of the poisoned data, thereby allowing the identification of poisoned samples whose labels are consistent throughout the training process. Our experiment found that the effectiveness of [23] highly relies on the hyperparameter tuning of the weighted combined- training process and the performance varies significantly with poison ratios. Additionally, the fundamental assumption is that decoupling the benign correlations between semantic fea- tures and semantic labels does not influence the learnability of the correlations between backdoor triggers and target la- bels. However, some advanced clean-label backdoor attack trigger [2] strongly entangles with the semantic features of the target class; therefore, [23] falls short of detecting the trigger. At a high level, confusion training shares a similar idea to ours in the sense that we both leverage a clean base set to induce different detector behaviors between clean and poi- soned samples. However, there are several key differences in the method design: our approach induces different behaviors by optimizing opposite optimization objectives on the base set and the poisoned set, whereas confusion training relies on random labeling to disrupt the learning of the clean samples. Importantly, we design a nested procedure that can effectively deal with the failure cases of [23]. Moreover, our method dis- tinguishes itself from [23] by providing additional important advantages: (1) our approach does not require the poisoned set to be labeled, thereby enabling applications in SSL set- tings; and (2) our approach is robust to different poison ratios without ratio-specific tuning and can effectively detect attacks generating triggers entangled with semantic features. 3 Attacker & Defender Models This section discusses standard threat models and assump- tions about defender knowledge for different DL paradigms. Case-0 End-to-end SL: In this setting, the attacker performs the backdoor attack by injecting a set of poisoned samples into the training dataset. The defender has access to the poisoned training dataset and the downstream learning algorithm. The defender's goal is to identify the poisoned samples within the training set and further remove the identified samples to prevent backdoor attacks from taking effect. Case-1 SSL Adaptation: Under this setting, the attacker performs the backdoor attack by poisoning the unlabeled dataset [20, 21]. Following prior attack literature, we assume that the attacker does not have access to the fine-tuning task- the dataset or algorithm. Thus, the dataset used for fine-tuning is clean, and the attack only affects the unlabeled dataset. The defender has access to the complete training data, including both the data for SSL as well as the data for fine-tuning. In addition, the defender knows the algorithm for SSL and fine- tuning. The goal of the defender is to identify and remove the poisoned samples from the unlabeled dataset. Other at- tack settings target multi-modal contrastive learning, such as attacking the CLIP [19], is not considered in this case, as training CLIP requires additional text input supervision [50]. Case-2 Transfer Learning: The attacker performs the back- door attack by poisoning a labeled dataset used for fine-tuning an existing pre-trained model. The defender knows the pre- trained model, the entire fine-tuning dataset (whose size often cannot support training a model from scratch), as well as the fine-tuning algorithm. The goal of the defender is to detect the poisoned samples within the fine-tuning dataset. In all three cases, we assume the attacker can poison no more than half of the training dataset. We also assume that the defender has a small set of clean, unlabeled samples (the base set) to help with detection. These clean samples can be manually or automatically screened [24]. Compared with most recent detection methods [23], which require a labeled clean base set of at least 2000 samples, our method relaxes the requirement on the label information. 4 Proposed Method 4.1 Key Idea Figure 3: Illustration of (a) single off- set procedure and (b) how the power of differentiating between clean and poison improves when the single off- set is replaced by a nested loop. Our goal is to en- force distinguishable model behaviors on poisoned and clean samples actively. The key idea is to de- sign two optimiza- tions that induce op- posite model behav- iors on the poisoned dataset (including its clean and poisoned portion) and the clean base set. Specifically, the two optimizations are performed simultaneously, where the first one minimizes a certain loss function on the clean base set and the second one maximizes the same loss on the entire poisoned training dataset. Note that the clean portion of the poisoned dataset and the clean base set are both drawn from the same clean distribution. Hence, the effect of the second optimization on the clean samples will be offset by the first optimization, and the loss on clean samples after the two optimizations is closer to the loss before. By contrast, the poisoned samples only go through the second optimization; therefore, the loss on the poisoned samples is maximized. Overall, as a result of the two optimizations, poi- soned and clean samples will produce different loss values, thus becoming separable. The single offset's effect on clean samples and poisoned samples is illustrated in Figure 3 (a). Intuition on the distinguishability of poisons. Poisoning, whether through additive triggers [1], generative models [32], affine transformations [35], or even adaptive perturbation tech- niques [36], introduces a distributional shift from clean data. The resulting poisoning distribution and the original clean distribution have disjoint support, and thus the total variation (TV) distance between the two distributions is one. The Le Cam's lower bound, a classic result in statistical learning (refer to Chapter 15 in [51]), states that the minimum error over all detectors that classify the samples from two distributions, P1 and P2, is equal to 1/2(1 − ∥P1 − P2∥TV). Hence, there exists a detector achieving zero error probability for distinguishing between poisons and non-poisons. Le Cam's bound guaran- tees the existence of a good detector as long as poisons do not naturally appear in the clean distribution, and our method to be introduced is an effort to find such a detector based on the information of a clean base set. 4.2 Detection via Offset Now, we formalize the offset idea for poisoned sample detection. Let Db denote the clean base set and Dpoi denote the poisoned training set. Formally, we can characterize the process of inducing distinguishable behaviors on poisoned and clean samples as a multi-objective optimization: θ∗ ∈ arg min θ Lmin ( f (xb|θ)) 1 |Db| ∑ xb∈Db 1 (cid:12) (cid:12)Dpoi − (cid:12) (cid:12) ∑ xpoi∈Dpoi Lmax (cid:0) f (xpoi|θ)(cid:1) . (2) When discussing the high-level idea of our method, we assume that the minimization and maximization employ the same objective, i.e., Lmin = Lmax. However, these two functions can also be different; as long as minimizing Lmin and maximizing Lmax induce different model behaviors, one optimization will mitigate the effect of the other on the clean distribution. In the implementation, we do not directly solve the opti- mization with two optimizations at the same time due to the instability of the corresponding optimization path; instead, we loop between two objectives: 1. We first minimize Lmin by taking a gradient descent step on a mini-batch drawn from the base set; 2. Then, we utilize the resulting model as the initializer for maximizing Lmax and perform a gradient ascent step on a mini-batch drawn from the poisoned set; 3. Repeat the above two steps. We empirically observe the alternating procedure is stable. As the focus of the paper is to develop practical detection meth- ods, we will defer the theoretical analysis of this procedure- an interesting open problem-for future work. Next, we will discuss which loss function we shall use to in- stantiate Lmin and Lmax. With the goal of detecting unlabeled poisoned data in mind, we propose a loss function, which cal- culates the variance of the logits. Let f (x|θ) denote the output logit of a model that is parameterized by θ and takes x as input. For a model that performs k-class classification, f (x|θ) ∈ Rk and the i-th class logit is denoted by f (x|θ)i. Furthermore, let f (x|θ) denote the average of the output logits of all classes. Then, our proposed loss function can be expressed as Lvar( f (x|θ)) = (cid:18) 1 k k ∑ i=0 f (x|θ)i − f (x|θ) . (3) (cid:19)2 When the detection is performed on the unlabeled data, we can instantiate both Lmin and Lmax to be Lvar defined above, because calculating Lvar does not require label information. As the result of minimizing Lmin, the clean samples are forced to have a flat logit pattern. Then, the maximization optimiza- tion maximizes the same loss on the poisoned dataset, which induces high-variance logits for poisoned samples. For clean samples, the effects of maximization and minimization are roughly canceled out. Therefore, clean samples are expected to produce lower-variance logits than poisoned samples. When the detection is performed on a labeled poisoned dataset, we find that instantiating Lmax with the cross-entropy- based prediction loss Lce achieves a good detection perfor- mance faster than Lvar: Lce( f (x|θ), y) = − k ∑ i=1 where σ(x)i denotes the i-th output of the softmax and y rep- resents the one-hot encoding of x's label. yi log σ( f (x|θ))i, (4) It is worth mentioning that we fix the minimization loss to be Lvar regardless of whether the base set is labeled or unlabeled. We found that even when the label information is available, this choice still leads to better detection perfor- mance than using Lce as the minimization goal. This is be- cause learning through minimizing Lvar will make the model extract class-independent features. A mini-batch of the base set may be class-imbalanced or sometimes contain only par- tial classes due to random sampling. Hence, Lvar can be more steadily minimized than Lce via mini-batch gradients. 4.3 Strengthened Detection via Nested Offset Weakness of a single offset. Despite the neatness of the offset idea, directly solving the two optimizations with the proposed loss functions is limited in tackling attacks with low poison ratio and the settings where poisoned samples take effect slowly during training (i.e., attacks need many epochs of training to obtain a high enough success rate; examples of such attacks include [2,21]). The reasons are as follows. In the low poison ratio setting, mini-batches naturally contain very small amounts of poisoned samples; on the other hand, each gradient ascent step takes a step towards reducing the average loss over a mini-batch and tends to overlook the minorities. Hence, the loss of poisoned samples would be increased by less with a lower poison ratio. To explain the second limitation, note that θ is an over-parameterized model (e.g., ResNet-18 and Vision Transformer). If an attack takes many epochs to take effect, then we need to train θ for long enough. The model after long training will end up "memorizing" all the samples from the base set and the poisoned set, i.e., all the samples from the base set achieve a low value of Lmin and all the samples from the poisoned set (including both clean and poisoned samples) to achieve a high value of Lmax. In that case, the poisoned portion and the clean one are inseparable. How to mitigate these failure cases? To illustrate our idea, let us think about a hypothetical design, assuming one can perfectly pinpoint a set of poisoned samples. In this design, we keep the first step minimizing on the clean base set, but the second maximization is performed on purely poisoned samples instead of the poisoned training set, which generally contains a large portion of clean samples and only a small portion of poisoned samples. This hypothetical design would be able to solve the two failure cases above. For the first case, since mini-batches for maximization contain solely poisoned samples, the poisoned samples would still have their loss increased and thus is distinguishable from the clean ones. For the second case, while long training can lead to memorization but with the hypothetical design, it is just the poisoned samples that get memorized and are assigned with high loss; therefore, the poisoned samples and the clean ones are still separable. While having access to a set of purely poisoned samples is not realistic, this thought experiment inspires an idea to im- prove an offset-based detection approach, which is to replace the poisoned training set (dominated by clean samples) with a set dominated by poisoned samples in the second maximiza- tion. To form such a poison-dominated set, we can leverage a new offset loop (referred to as the inner offset loop) to mark a set of the most suspicious samples. Then, we use those samples to perform maximization of the original offset loop (referred to as the outer offset loop). How to design the inner offset loop that provides a poison- condensed set? First, it is not ideal to reuse the design of the outer loop for this inner one, because in that case the inner would suffer the same "memorization" issue. Instead, we aim to avoid "overparameterized" models and perform the inner loop with a simple model. On the other hand, a simple model could be incapable of extracting complex features to support the detection of poisoned samples. Our solution is to use the poisoned model (i.e., the downstream model trained on the poisoned dataset) to extract features from the poisoned set and the base set and then optimize a simple model to detect the poisoned samples in the feature space. Note that the embedding space of a poisoned model has been shown to be informative to detect many but not all back- door attacks (detailed in Section 5). Although the poisoned and clean samples are not perfectly separable based on the embeddings-as illustrated in Figure 6-the reason why these methods underperform in many cases, the poisoned model still provides a well-trained embedding space and some imperfect signals for selecting a poison-condensed set. Detailed design of the inner offset loop. The inner offset loop is executed inside the previous offset loop (Eqn. 2). It condenses the poison in a mini-batch sampled by the maxi- mization step of the outer offset loop. Specifically, the inner offset loop will return a set of samples marked as poison. We will use this poison-condensed subset of the original mini- batch to perform the outer maximization. When the inner loop is relatively precise in gathering a poison-condensed subset, the outer loop will maximize the outer loss of poisoned sam- ples without introducing much offset effect on clean samples. As a result, the poisoned and clean samples become more distinguishable in terms of the outer loss compared to a sin- gle offset loop via Eqn. 2. An intuitive explanation of the improvement is illustrated by Figure 3 (b). Let f (x|θ∗ poi) denote the poisoned model, and its parameters are given by θ∗ poi. Let M(*|w) be a mapping from the logits to a real value in the range [0, 1], and w denotes its parameters. The inner offset can be characterized by 1 |Bb| ∑ (cid:124) w∗ = arg min w (cid:0)M( f (xb|θ∗ poi)|w), 0(cid:1) LBCE xb∈Bb (cid:125) (cid:123)(cid:122) L1 (cid:0)M( f (xpoi|θ∗ poi)|w), 1(cid:1) , (5) + 1 (cid:12) (cid:12)Bpoi (cid:124) (cid:12) (cid:12) ∑ xpoi∈Bpoi LBCE (cid:123)(cid:122) L2 where LBCE(p, q) = −p log q + (1 − p) log(1 − q), represent- ing the binary cross entropy loss and Bb and Bpoi stand for a mini-batch drawn from the clean base set and the poisoned training set, respectively. (cid:125) The first minimization objective will encourage learning a mapping M such that the mini-batch from the clean base set is labeled as "0"; the second objective will further promote M to label the mini-batch from the poisoned set as "1". By minimizing the two objectives simultaneously, the effect on the clean data gets canceled. As a result, the clean samples will be predicted as "1" with low confidence, yet the poisoned ones will be predicted as "1" with high confidence. Then, we can mark the samples with the highest confidence or the lowest BCE loss for predicting "1" as the suspicious poisoned samples. In practice, M is implemented as a two-layer, full- connected network with 128 hidden neurons. Again, to avoid stability issues, in the implementation, we first take a gradient descent step to minimize L1 and then take a gradient ascent step to minimize L2, and alternate between the two steps. The pseudo-code for the inner offset loop is provided in Algorithm 1, termed Poison Concentration. Algorithm 1: Poison Concentration Input: θ∗ poi (Poisoned feature extractor); Bpoi (Poisoned training mini-batch); Bb (Base set mini-batch); Output: Bpc (Poison concentrated mini-batch); Parameters: N (Total inner loop iteration number); γ > 0 (Step size); λ (Threshold); /* 1.Dynamic training of M */ 1 for each iteration j in (0,N − 1) do 2 3 M′ j ← M j − γ 1 |Bb| ∑xb∈Bb M j+1 ← M′ j − γ 1 |Bpoi| ∑xpoi∈Bpoi ∂LBCE(M( f (xb|θ∗ poi)),0) ∂M ; poi)),1) ∂LBCE(M′( f (xpoi|θ∗ ∂M′ ; /* 2.Get output values */ f (Bpoi|θ∗ (cid:17) poi) ; 4 V ← MN (cid:16) /* 3.Using AO to determine outliers */ 5 Bpc ← Bpoi[AO (V ) ≥ λ]; 6 return Bpc Adaptive thresholding for the inner offset. The last step of Poison Concentration is to select the subset marked as poison based on the confidence score output by M. We will elaborate on how to adaptively choose the size of this subset. First, di- rectly adopting a fixed threshold to identify the most likely poisoned samples is impractical, as different mini-batches may contain different amounts of poisons. To tackle this prob- lem, we adopt Adjusted Outlyingness (AO) [52] to adaptively determine the number of most suspicious samples within each mini-batch. AO maps the BCE losses into a scale such that a fixed threshold can effectively identify the most suspicious samples. Note that AO does not aim to filter out as many poi- soned samples as possible within the mini-batch; instead, it is adopted to achieve high precision, i.e., identifying a subset of the mini-batch that is dominated by poisoned samples. In the evaluation, we threshold the output of AO with 2. By the na- ture of AO, we are essentially adopting an adaptive threshold despite using a fixed output value (see Figure 8). 4.4 Overall Workflow The overall algorithm of ASSET with two offset loops is presented in Algorithm 2. Functionally speaking, the inner loop condenses the poison within each mini-batch drawn from the poisoned dataset, the outer loop induces different model behaviors on clean samples and poisoned samples. At each iteration of the outer, we minimize Lvar by taking mini-batch gradient descent with samples from the clean base set; then, we perform the poison concentration step: the inner returns subset of samples most likely to be poisoned; then proceed to the maximization step of the outer Lmax by doing gradient ascent with the suspicious points returned by the inner. In the end, we can obtain a detector model f (*|θI ) with parameters θI obtained after I outer iterations and this model induces different values of Lmax between clean and poisoned samples. Algorithm 2: ASSET Backdoor Detection Input: θ0 (Initialized detector); θ∗ poi (Poisoned feature extractor); Dpoi (Poisoned training set); Db (Base set); Output: Spoi (Indexes of the detected poisoned samples); Parameters: I (Total outer loop iteration number); α > 0 (Step size); 1 for each iteration i in (0,I − 1) do 2 3 4 5 6 b∈Bi b b|θi)) ∂Lvar( f (xi ∂θi poi ∈ Dpoi; b ∈ Db; /* 1. Obtaining mini-batches */ poi ← Bi Bi Bi b ← Bi /* 2. Minimization */ θ′ =← θi − α 1 b| ∑xi |Bi /* 3. Poison Concentration */ Bi /* 4. Maximization */ i + α 1 θi+1 ← θ′ pc| ∑xi |Bi /* 5.Get output loss values */ (cid:0) f (Dpoi|θI )(cid:1); pc ← Poison Concentration ∂Lmax( f (xi ∂θ′ poi, Bi Bi pc∈Bi pc (cid:16) ; 7 V ← Lmax (cid:17) ; b, θ∗ poi pc|θ′)) ; /* 6.Detection result via adaptive GMM */ 8 Spoi ← adaptive GMM (V ); 9 return Spoi Adaptive thresholding for the outer loop. With the trained detector model, θI , we now discuss how to identify the poi- soned samples. Similar to the inner, we propose an adaptive thresholding method for the outer as well. Note that the thresh- old of the inner and outer loop has distinct goals. The inner loop aims to identify a subset with a high density of poisons, while the outer loop aims to adaptively conduct a split be- tween the clean and poisoned loss distribution that helps the detector to remove as many poisons as possible while main- taining a low false positive, i.e., high precision is prioritized for the inner yet high recall is prioritized for the latter. As will be shown later, after the overall optimization, f (*|θI ) will output distinct loss distribution for the clean and poisoned samples. One might be tempted to directly fit a Gaus- Figure 4: Illustration of (a) the problem of GMM over long- tailed cases where the attacks are of low poison ratio and (b) how the proposed adaptive GMM can help. sian Mixture Model (GMM) with two components. However, doing so is problematic, as depicted in Figure 4. Since there are usually much fewer poisoned samples than clean ones, the GMM tends to split the multiple-modal clean distribution into two Gaussian distributions instead of fitting two Gaussians respectively to the clean and poison distributions. To tackle this problem, we propose a simple twist of GMM, termed adaptive GMM. We first abandon half of the samples achieving the highest values of Lmax, which will remove all the poisoned samples (we assume the attacker can poison no more than half of the training dataset, Section 3). Then, we fit a Gaussian to the remaining points. Since the optimized detector model largely centers the clean samples' loss close to Lvar = 0 or Lce = − log( 1 k ), the Gaussian fitted on the remaining samples remains similar to the Gaussian fitted on all the non- poisons (see Figure 4 (b)). Lastly, we set a small threshold on the Gaussian density, β, to cut off the samples that are unlikely to be generated from the fitted Gaussian. In practice, we set the cut-off threshold as β = 10−6, which equivalently keeps the lowest-loss samples with a probability higher than > 99.99% being generated from the fitted Gaussian (for any Gaussian distribution with a variance smaller than 10). 5 Evaluation Our evaluation aims to answer the following questions. • Case-0 (Section 5.2): How does ASSET compare with other methods in end-to-end SL setting? Is detection effective when multiple attacks exist simultaneously? How does the detection performance vary over different attacks and poison ratios? • Case-1 (Section 5.3): Can ASSET robustly detect at- tacks in SSL settings? How does the knowledge about downstream tasks affect the defense's effect? • Case-2 (Section 5.4): Can ASSET provide reliable back- door sample detection in TL settings? What are the limi- tations of other defenses in this setting? • Adaptive Attack (Section 5.5): Is it possible to adap- tively evade ASSET's detection? • Ablation Study (Appendix 6.4): How do different de- sign choices affect the final performance of ASSET? 5.1 Settings Evaluation metrics. There are two key aspects throughout our evaluation: (1) How accurately can the poisoned samples be detected (upstream evaluation)? (2) After the suspicious points are removed, how would a downstream model learn from the remaining data perform (downstream evaluation)? For upstream evaluation, we utilize two metrics, namely, True Positive Rate (TPR), T PR = T P/(T P + FN), and False Positive Rate (FPR), FPR = FP/(FP + T N), where T P, FP, T N, and FN denote the number of true positives, false posi- tives, true negatives, and false negatives, respectively4. TPR depicts how well a specific backdoor detection method filters out the backdoored samples. A higher TPR (closer to 100%) denotes a stronger filtering ability. FPR depicts how precise the filtering is: when a specific method achieves TPR that is high enough, FPR helps us to understand the trade-off, i.e., how many clean samples are wasted and wrongly flagged as backdoored during the detection. A lower FPR shows that fewer clean samples are wasted, and more clean data shall be kept and available for downstream usage. One thing worth noting is that no detection method can reliably remove all the poisoned samples. However, the re- mained backdoor samples that go unnoticed by a successful defense should be small enough to deactivate attacks. Thus, we evaluate the backdoor attacks' Attack Success Rate (ASR) on the downstream model trained using the filtered dataset to study whether the detection is good enough to stop attacks. ASR measures the proportion of backdoored test samples be- ing classified into target classes. Additionally, we evaluate the downstream model's Clean Accuracy (ACC). A high ACC means that the detection method is able to maintain a large enough clean set to support the model performance. Dataset & models. We incorporate three standard computer vision benchmark datasets into our evaluation: CIFAR-10 [53] (main text), STL-10 [54] (Appendix 6.3), and ImageNet [55] (a randomly selected 100-class subset, Appendix 6.3). To ensure the effectiveness of the baselines and fair comparison, we set the base set size as 1000 for all the settings. We will later show that our method is robust to different choices of the base set size in the ablation study, Appendix 6.4. We obtain a 1000-size clean base set for each dataset by randomly selecting the samples from the test set and removing their label information. All the upstream evaluation metrics (i.e., TPR and FPR) are evaluated on the respective training sets, i.e., the training set of Case-0, the fine-tuning set of Case-2, and the unlabeled pre-training set for Case-1. For Case-0, we adopt all the remaining data from the test set for evaluation of the downstream metrics (i.e., ACC and ASR). For Case-1 and Case-2, we split the remaining test set into half being fine- tuning set and half being the downstream metric evaluation set. ResNet-18 [56] is adopted on the CIFAR-10. ViT-Small/16 [14] is adopted on STL-10 and ImageNet (Appendix 6.3). For Case-1, we incorporate four state-of-the-art SSL training methods, i.e., SimCLR [12], MoCo V3 [17], BYOL [18], and the MAE [13], for evaluation. For Case-2, we consider the two most popular transfer learning cases, namely, FT-all and FT- last (detailed in Section 2). The pre-trained model parameters for fine-tuning are loaded from the timm library5. 4Note that poison is considered positive and clean is considered negative. 5https://timm.fast.ai/ Dirty-Label Backdoor Attacks Clean-Label Backdoor Attacks BadNets (5%) Blended (5%) WaNet (10%) ISSBA (1%) LC (1%) SAA (1%) Narci. (0.05%) Average Worst-Case (a) Upstream Evaluation TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ 95.6 96.9 93.8 90.5 85.4 25.4 99.0 99.5 2.86 0.28 1.81 40.1 3.40 11.5 3.72 0.55 99.8 99.8 67.9 65.4 93.4 17.3 98.1 100 2.64 2.64 3.04 44.9 2.98 12.1 4.53 0.00 0.64 1.00 82.2 8.30 28.1 5.08 95.8 90.7 16.6 16.6 0.53 41.5 13.5 10.0 2.64 8.09 0.00 80.2 73.4 11.0 55.2 68.8 96.6 95.6 1.52 0.71 1.31 41.1 0.96 9.34 4.37 0.36 80.2 99.8 91.2 91.2 87.2 100 100 96.2 0.71 0.51 0.29 0.41 0.63 0.85 9.01 0.75 87.6 99.4 69.8 75.6 73.4 63.4 95.2 96.6 0.63 0.51 1.58 21.5 0.77 1.22 5.44 0.39 0.00 0.00 12.0 0.00 0.00 0.00 0.00 92.0 0.08 0.07 1.97 34.3 0.07 0.05 5.54 0.34 51.9 68.2 70.4 48.9 60.4 40.0 83.5 95.8 3.58 3.05 1.50 32.0 3.19 6.44 5.03 1.49 0.00 0.00 12.0 0.00 0.00 0.00 0.00 90.7 16.6 16.6 3.04 44.9 13.5 10.0 9.01 8.09 (b) Downstream Evaluation ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ 96.5 48.4 34.8 55.6 81.3 88.6 76.9 3.42 2.68 93.4 94.5 94.5 93.8 76.9 92.5 85.3 93.1 94.9 94.9 10.7 6.57 94.9 93.3 94.2 93.8 31.3 0.44 93.5 94.1 94.1 93.8 82.1 88.7 87.1 91.2 95.2 99.4 98.9 100 2.13 99.7 90.2 98.6 0.53 1.89 93.5 90.0 89.6 94.1 83.1 93.1 91.7 92.5 93.1 92.6 93.0 14.0 17.0 83.5 30.6 25.5 1.12 1.55 94.1 94.1 94.3 94.2 81.3 94.2 91.0 93.2 94.8 100 10.6 100 4.12 4.31 6.32 0.38 0.44 1.16 94.7 94.8 94.7 94.8 94.8 94.7 94.8 91.1 94.9 76.7 3.11 0.86 8.64 7.63 7.63 9.63 2.16 1.14 94.4 94.2 94.4 94.3 87.7 94.4 94.4 93.2 94.4 99.7 99.7 99.8 90.4 100 99.3 99.8 100 9.68 94.9 94.8 94.9 94.5 90.7 94.9 94.9 94.1 94.9 94.3 52.1 50.9 39.0 67.1 59.6 57.8 19.9 2.65 94.1 93.8 93.8 94.2 85.0 93.2 91.3 92.6 94.6 100 99.7 100 94.9 100 99.3 99.8 100 9.68 93.4 90.0 89.6 93.8 76.9 88.7 81.3 91.1 93.1 Spectral Spectre Beatrix AC ABL Strip CT Ours No Def. Spectral Spectre Beatrix AC ABL Strip CT Ours Table 2: (a) Upstream and (b) Downstream evaluation and comparison results under Case-0, CIFAR-10. We list the poison ratio of each attack at the top of each column, which follows the original work that proposed these attacks. We highlight the ASR below 20% in blue as a success defense, the ASR above 20% in red as a failed defense case. Baseline defenses. Referring to Table 1, we incorporate a wide range of existing backdoor detection for comparison, including both standard baselines used in prior work as well as state-of-the-art ones. In particular, we consider Spectral [7], Spectre [8], and the Beatrix [9]; we include AC [10] as a representative work that utilizes intermediate neural activa- tion; ABL [11], which was originally a robust training de- fense and repurposed as a detection method based on output losses; Strip [6] as a representative detection approach based on model outputs; and CT [23], the most recent work reported achieving state-of-the-art performance on end-to-end SL set- tings based on confusion training. All the implementations and hyperparameters follow the original papers. For methods that rely on or can be boosted by an additional base set, e.g., Spectre, Beatrix, Strip, CT, we use the same 1000-size base set as ours. We note that this comparison setting might not be fair, as compared to these baselines, our method relaxes the requirement on label information; in addition, AC and ABL cannot be adapted to use the base set. We want to show that even without label information, our method can still achieve comparable or much better results with stronger robustness than the other baselines. Detailed explanations of the defense settings and how we adapted them to Case-1 and Case-2 are provided in Appendix 6.1. Backdoor attack settings. For Case-0 we incorporate seven standard or state-of-the-art attacks, including four dirty-label and clean-label ones. For dirty-label backdoor attacks, we incorporate localized backdoor attack BadNets [1], global- wised blended trigger Blended [29], wrapping-based invis- ible backdoor attack WaNet [35], and the state-of-the-art sample-specific invisible backdoor attack, ISSBA [32]. For clean-label attacks, we include the standard Label Consistent (LC) attack [39], the state-of-the-art feature-collision-based hidden trigger backdoor, Sleeper Agent Attack (SAA) [41], and the state-of-the-art optimization-based Narcissus attack (Narci.) [2]. For Case-1, only limited existing work has ex- plored the attack over SSL's unlabeled training set. We in- corporate the Checkerboard trigger (C-brd) used in [19], the Colored Square trigger (C-squ) used in [20], and the state- of-the-art YCbCr frequency-based invisible trigger used in CTRL [21]. In particular, CTRL has been shown to achieve a magnitude higher attacking efficacy than [20]. For Case-2, directly implementing some of the attacks from end-to-end SL may not lead to effective attacks, e.g., the Blended attack cannot achieve high ASR under the FT-all settings. Thus, we consider attacks that can maintain effectiveness for each TL setting. BadNets and the SAA are adopted for evaluation un- der the FT-all case. Blended and the hidden trigger backdoor attack (HTBA) [40] are adopted for the evaluation under the FT-last case. All the incorporated attacks' settings, such as trigger design and trigger strength, all follow their original papers. Appendix 6.2 details the specifics of these attacks' setups under each learning paradigm and visual examples of the poisoned samples we intend to detect. 5.2 Case-0: End-to-end SL Detection performance against different attacks in SL. Ta- ble 2 presents the upstream and downstream evaluation results under the end-to-end SL setting on the CIFAR-10 dataset with the ResNet-18 model trained from scratch for 200 epochs. For each different attack, we adopt the poison ratio following each original paper, which is listed at the top of each column. We have included the row of "No Defense" in Table 2 (b) Spectral Spectre Beatrix Poison Ratio% 0.05%\25 1%\500 5%\2500 20%\10000 [7] 25 37 109 817 50%\25000 7963 0.05%\25 1%\500 5%\2500 20%\10000 50%\25000 25 86 6 226 9568 s t e N d a B d e d n e l B [8] 23 23 109 170 158 25 44 5 27 [9] 13 13 155 113 264 22 53 803 31 AC [10] 22 416 238 1086 774 25 49 866 306 ABL Strip [9] 7 32 365 4590 1944 19 41 1023 4965 [6] 19 446 1866 330 1001 23 413 2068 1669 1023 2386 1514 13959 10736 CT [9] 1 0 20 16 25000 2 16 33 3659 25000 Ours 0 17 13 7 4 4 2 0 13 8 Table 3: # poisons remained in the filtered training set af- ter defense (Case-0, CIFAR-10). Bolded results denote the smallest value. red to highlight failed defenses where more than 30 poisoned samples remain as we find this amount of poisons still enables ASRs greater than 30%. to show the attack effects without any backdoor detection defense in place. Existing methods are able to achieve decent detection effects on some specific attacks, but they experience large performance variations when defending different attacks. These methods either solely rely on the embedding space of a poisoned model that may change with different trigger de- signs or rely on some detection rule that may not apply to specific backdoor designs. For example, ABL assumes that backdoor samples achieve the lowest loss at the early stage of training. However, the Narci. clean-label poisoned samples' losses do not meet the assumption; thus, ABL is not effective on the Narci. The recently proposed CT achieves the highest detection rate and the most consistent performance among all baselines, but it still fails to detect the state-of-the-art clean- label attack, Narci. Notably, no existing detection method obtains satisfying results as Narci. introduces optimized fea- tures as robust as the semantic features of the target class [2]. Regarding the upstream evaluation in Table 2 (a), our method reliably achieves a TPR above 90% for all the evaluated set- tings and significantly improves the state-of-the-art in terms of the average and worse-case defensive performance over dif- ferent attacks. Regarding the downstream evaluation in Table 2 (b), we find that ASSET is the only defense that gives rise to robust models over all the evaluated poisoned datasets, i.e., all ASRs drop below random guessing rate, i.e., 10%. In particu- lar, our method is the only effective method to mitigate Narci. Moreover, the downstream models trained over ASSET fil- tered datasets achieve the highest average ACC. Notably, the average ACC of our method is slightly higher than using the original poisoned dataset (which contains more clean sam- ples). Results for multiple attacks introduced simultaneously are provided in Appendix 6.3, with similar observations. Unlike ASSET, the existing methods do not have an ac- tive process to induce differentiating behaviors between clean samples and poisoned ones. Thus clean and poisoned samples often have overlapping behaviors and cannot be easily sepa- rated. We illustrate the separation between clean and poisoned samples using different detection methods and their thresh- old in Figure 5, emphasizing the importance of the proposed active offset process. Figure 5: Detection results with different defenses in distri- bution histograms (CIFAR-10, Blended attack, 5%, Case-0). We emphasize the effects and the necessity of adaptive thresh- olding and the process of actively pushing the distribution of clean and poison away from each other. Impact of poison ratios. In Table 3, we study the effects of poison ratio on different detection methods against two stan- dard attacks, namely, BadNets, and the Blended attack. Most existing detection works better for small poison ratios but fails as the ratio increases. One reason is that many works, such as Spectral, Spectre, and AC, are based on the feature distribu- tion of the poison dataset. However, an increased poisoning rate will cause the clean feature distribution to be closer to the poisoned one, making them less separable. CT is the most robust baseline in the previous evaluation, but it also fails for very large ratios like 20% (10000 poisons) or 50% (25000 poisons). The reason could be that their detector uses fixed hyperparameters that are fine-tuned on small poison ratios. Our defense is robust to poison ratio changes, even for ex- treme cases where half of the samples in the training set are poisoned or only 25 (0.05%) samples are poisoned. 5.3 Case-1: SSL Adaptation C-brd (0.5%) C-Squ (0.5%) CTRL (1%) Average Worst-Case TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ Spectral Spectre Beatrix AC ABL Ours 0.08 0.64 0.88 6.72 5.76 91.5 7.89 7.86 7.85 28.6 7.59 0.67 0.44 2.36 2.76 9.88 6.24 96.0 7.87 7.77 7.75 28.4 7.57 0.25 1.20 0.40 73.4 36.8 20.2 97.4 1.50 1.51 2.79 21.3 1.31 0.69 0.57 0.64 25.7 17.8 10.7 95.0 5.75 5.71 6.13 26.1 5.49 0.54 0.08 0.40 0.88 6.72 5.76 91.5 7.89 7.86 7.85 28.6 7.59 0.69 Table 4: Upstream evaluation and comparison results under Case-1 with SimCLR. The bolded results denote the best defense results among the evaluated defenses. Detection performance against different attacks in SSL. Now we study the efficacy in detecting unlabeled poisons under the SSL adaptation cases. Table 4 and Table 5 list out the upstream and downstream evaluation results, respectively, on CIFAR-10 using ResNet-18 trained via SimCLR-based SSL for 600 epochs with linear adaptation for 100 epochs. We find that the ASRs of C-brd and C-Squ are below 20% so these attacks cannot lead to a successful attack on average. We still keep their results but show the number of successfully attacked samples (denoted with ASR∗) as done in [20]. Even though these attacks do not result in as high ASR as the attacks in SL or as the CTRL attack, they can still result in an increase of samples with triggers being classified as the target class. C-brd (0.5%) C-Squ (0.5%) CTRL (1%) ASR* ↓ ACC ↑ ASR* ↓ ACC ↑ ASR ↓ ACC ↑ No Def. Spectral Spectre Beatrix AC ABL Ours 404 405 405 402 513 380 100 85.2 84.1 84.1 84.2 73.26 84.6 85.1 435 478 445 444 376 399 87.0 84.6 84.2 84.2 84.2 73.2 84.4 84.9 81.4 81.3 81.4 16.8 36.5 46.6 2.47 85.3 85.2 85.3 85.0 78.6 85.3 85.9 Table 5: Downstream evaluation and comparison results under Case-1 with SimCLR. We highlight the ASR below 20% in blue as a success defense, the ASR above 20% in red as a failed defense case. ASR∗ is the number of successfully attacked samples. We use ASR∗ instead for the C-brd and the C-Squ attack, referring to the original work [20], as their ASRs are naturally low to SSL paradigms. As shown in Table 4, among all the evaluated attacks, our method obtains the highest TRP while remaining the lowest FPR among all detection methods. Noting the absence of CT under the SSL. Recall that in the SL setting, CT can achieve compatible results as our method on most attack settings; yet, it is inapplicable to SSL as its core technique-confusion training-relies on label information [23]. In particular, as C- brd and C-Squ do not result in a high ASR as shown in Table 5, the model's response to clean and backdoor samples is not sufficiently different, thereby making detection very difficult. In fact, none of the baselines provides reliable detection of these two attacks. For the CTRL attack, which achieves an ASR of over 80%, we start to see that some of the baseline defenses take effect, e.g., the Beatrix. But still, our method achieves the best upstream detection performance (Table 4) and gives rise to the highest ACC and lowest ASR downstream (Table 5). Further evaluation with more SSL training algorithms. We further evaluate our defense under other popular SSL training algorithms and different model structures and datasets, e.g., ResNet-18 and ViT-Small/16 trained using SimCLR, MoCO V3, BYOL, MAE over CIFAR-10 or the ImageNet (Appendix 6.3). The upstream and downstream evaluation results on the CIFAR-10 are shown in TBALE 6 and Table 7, respectively. Across all the evaluated settings, our method provides reli- able upstream detection results with TPRs over 90% for all the cases and low FPRs. Thanks to the upstream efficacy, our detection method can give rise to the downstream model with a low ASR and an ACC close to or better than the set- tings without removing any training point. Overall, our results demonstrate that our method can reliably sift out the poisoned samples across different settings of SSL adaptation. Impact of # logits w.r.t. SSL downstream task. Note that for SSL evaluation, the pre-trained model requires a fixed number of logits, each corresponding to a different output category. In our evaluation, we use the actual classes contained (e.g., 10 for the CIFAR-10 and 100 for the ImageNet 100-subset). Such a setting is applicable when the defender knows the exact downstream classification task. Now we consider a much C-brd (0.5%) C-Squ (0.5%) CTRL (1%) TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ SimCLR MoCo V3 BYOL MAE 91.5 91.3 95.9 97.2 0.67 0.49 0.22 0.67 96.0 96.9 95.8 98.2 0.25 0.20 0.35 0.50 97.4 98.2 94.6 97.2 0.69 0.32 0.57 0.73 Table 6: Further upstream evaluation of ASSET under Case-1 with four SSL training algorithms, CIFAR-10. more strict case where one tries to conduct detection over unlabeled datasets without any prior knowledge about the number of categories in downstream tasks. As shown in Table 8, we find our method is robust to the change in the number of logits and can maintain a TPR higher than 90%. 5.4 Case-2: Transfer Learning Detection performance against different attacks in TL. We consider two of the most popular TL schemes for evaluation: FT-all and FT-last with models pre-trained on the ImageNet. All the existing backdoor defenses can be easily generalized to TL. However, none of them has empirically evaluated the backdoor detection efficacy under the TL settings in the prior literature, which leaves a gap to fill. The upstream and downstream results are listed in Table 9. Existing methods' detection results on FT-all seem more consistent than the results on FT-last. This observation might be due to that FT-all is a setting much closer to the end-to-end SL. While many defenses can achieve satisfying results on some specific attacks in SL, none can achieve a TPR above 90% for all attack settings in TL, except CT on BadNets. We now take a closer look at the reason why existing detection methods fall short in TL. We depict the feature space t-SNE re- sults comparing the attacks in Case-0 and Case-2 in Figure 6. Since in TL, the model parameters have been initialized with additional knowledge obtained from pre-training, clean and poisoned samples are harder to be separated in the embedding space, thus resulting in a worse detection result compared to SL. As shown in Figure 6, for both BadNets and the Blended attack, the clean and poisoned samples have a larger over- lapping in the TL case than in SL. These results emphasize the importance of introducing active measures to increase separability. Figure 6: In-class features space t-SNE results with the model trained with CIFAR-10 using end-to-end SL or TL: (a) Bad- Nets 20%, (b) Blended 20%. On the other hand, for all the evaluated settings on the two datasets (CIFAR-10 and STL-10, Appendix 6.3), our method consistently achieves the best TPR, FPR, ASR, and ACC. No Attack C-brd (5%) C-Squ (5%) CTRL (1%) ASR ↓ ASR* ↓ ACC ↑ SimCLR MoCo V3 BYOL MAE 1.78 1.88 1.13 1.58 79 83 50 70 85.4 87.2 85.6 89.2 ASR*0 ASR* ↓ ACC0 ACC ↑ ASR*0 ASR* ↓ ACC0 ACC ↑ ASR0 ASR ↓ ACC0 ACC ↑ 85.9 85.3 84.7 84.6 85.0 61.4 2.47 84.8 100 403 434 87 411 455 83 95 79 74 87.0 85.5 88.4 87.1 85.3 88.4 374 446 104 83 56 70 87.2 85.2 87.13 85.4 88.65 88.93 56.3 39.7 15.9 3.70 4.36 3.42 86.5 85.5 87.2 87.9 85.5 89.9 Table 7: Downstream evaluation results of our method under Case-1, CIFAR-10. ASR∗ is the number of successfully attacked samples. ASR*0 and ACC0 with subscripts are the results without defense (i.e., the "No Defense" baseline in other tables). We use ASR∗ instead of ASR for the C-brd and the C-Squ attack, referring to the original work [20], as their ASRs are naturally low. 5 10 100 1000 TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ CTRL (1%) 93.2 0.02 97.4 0.07 95.2 0.34 92.6 2.81 Table 8: # logits used and the detection effects over unlabeled CTRL poisons (Case-1, CIFAR-10, SimCLR, ResNet-18). Remarkably, the averaging performance on both upstream and downstream of ASSET is of magnitude better than the seven baselines. The results highlight that actively introducing different model behaviors can help a detection method to be of better robustness to the DL paradigm shift. FT-all FT-last Average Worst-Case BadNets (20%) SAA (5%) Blended (20%) HTBA (5%) (a) Upstream Evaluation TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ TPR ↑ FPR ↓ Spectral 82.3 16.9 39.2 5.83 11.6 34.6 53.6 5.07 46.7 15.6 11.6 34.6 Spectre 85.1 16.2 53.6 4.54 68.5 20.4 74.4 3.98 70.4 11.3 53.6 20.4 Beatrix 64.4 19.1 66.8 3.96 13.1 31.4 89.6 3.50 58.5 14.5 13.1 31.4 AC ABL 21.6 46.3 57.2 32.5 0.60 46.9 41.6 34.4 30.3 40.0 0.60 46.9 59.8 22.6 48.4 5.35 49.3 25.2 61.2 4.67 54.7 14.5 48.4 25.2 STRIP 92.3 10.6 25.6 8.23 67.1 16.8 35.6 8.70 55.2 11.1 35.6 16.8 CT 94.6 10.4 78.0 7.24 0.00 0.00 82.4 3.49 63.8 5.33 0.00 10.4 Ours 98.7 1.03 95.2 0.51 99.2 0.10 95.6 0.34 97.2 0.50 95.2 1.03 (b) Downstream Evaluation ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ No Def. 97.5 91.3 98.7 92.3 93.9 71.4 56.4 72.8 86.6 82.0 98.7 71.4 Spectral 97.4 91.5 80.2 91.8 91.4 68.7 16.9 72.1 71.5 81.0 97.4 68.7 Spectre 95.8 91.8 75.9 91.9 92.5 69.8 10.9 72.3 68.8 81.5 95.8 69.8 Beatrix 96.0 91.7 68.9 92.0 92.7 67.6 5.50 72.6 65.8 81.0 96.0 67.6 AC 97.4 86.7 73.2 88.7 93.3 65.4 21.4 66.1 71.3 76.7 97.4 65.4 ABL Strip 96.4 91.7 80.1 92.0 93.7 68.3 14.2 72.2 71.1 81.1 96.4 68.3 94.4 91.8 87.0 91.9 92.9 70.8 24.3 71.3 74.7 81.5 94.4 70.8 CT 93.2 91.8 18.6 91.9 93.9 71.4 8.60 72.5 53.6 81.9 93.9 71.4 Ours 10.2 92.9 8.40 92.3 16.2 74.8 3.40 72.8 9.55 83.2 16.2 72.8 Table 9: (a) Upstream and (b) Downstream Evaluation and comparison results under Case-2 with CIFAR-10: The first row denotes the TL strategy. The bolded results denote the best defense results among all defenses. We highlight the ASR below 20% in blue as a success defense, the ASR above 20% in red as a failed defense case. 5.5 Adaptive Attack Analysis From the above, we find ASSET is the most reliable detec- tion method across different attacks, datasets, poison ratios, and training paradigms. Now we study adaptive attacks, where we want to understand how an attacker's knowledge about defense implementation impacts defense performance. Attacker goal & settings. The attacker aims to craft poisoned samples resulting in a low TPR while maintaining a low FPR for upstream detection , and resulting in a high ASR while maintaining a high ACC for the downstream poisoned model. A successful adaptive attack should achieve satisfying re- sults based on these metrics simultaneously. We consider two models of attack knowledge: White-box attack and Gray-box attack. (1) White-box Settings. The attacker has full access to the details of ASSET, namely, the workflow of ASSET; the architecture of the detector model, and the architecture of the feature extractor; the architecture of the weighting network will be used for poison concentration; the original poisoned dataset, Dpoi; and the clean base set Db. Although such disclo- sure of the defense details is rare in practice, an investigation of this setting gives insights into the worst-case performance of ASSET. (2) Gray-box Settings. We also consider a more realistic attack scenario where the attacker is aware of the ASSET pipeline and the respective datasets but not aware of the specific model architectures used by the defender for conducting the detection and performing downstream tasks. In both White-box attack and Gray-box, the attacker updates the original poisoned samples in Dpoi and then supplies the updated dataset to the defender. Attack design. For both White-box and Gray-box attack, we investigate optimization-based techniques to design poisoned samples to evade ASSET. The attacker can use Dpoi and Db to obtain trained detector parameters, θI and then resolve the following optimization to obtain an additive noise for each poisoned sample xpoi in Dpoi to evade the detection δ∗ = arg min δ Lmax (cid:0) f (xpoi + δ|θI)(cid:1) , (6) where Lmax is inherited from Eqn. (2). Recall that ASSET optimizes θ so that poisoned samples are assigned with large loss values while clean samples are assigned with small loss values. The above formulation manipulates one poisoned sam- ple, xpoi, such that the trained detector will assign low loss values to xpoi + δ∗, which helps disguise the poison. To re- solve the proposed adaptive attack formulation in Eqn (6), we conduct gradient descent 100 steps for each example. Visual examples of the adaptive attack manipulated poisons for the attacks considered in Case-0 are depicted in Figure 7, Ap- pendix 6.3. After the update of Dpoi, we obtain new model parameters (i.e., feature extractor ̃θ∗ poi, detector ̃θI, and weight- ing network ̃M) on the updated Dpoi and evaluate the attack BadNets (5%) Blended (5%) WaNet (10%) ISSBA (1%) Dirty-Label Backdoor Attacks (a) Upstream Evaluation LC (1%) Clean-Label Backdoor Attacks SAA (1%) Narci. (0.05%) White-box Gray-box TPR ↑ 60.6 99.7 FPR ↓ 1.47 0.22 TPR ↑ 98.1 99.6 FPR ↓ 0.49 0.18 TPR ↑ 65.3 83.4 FPR ↓ 5.41 4.18 TPR ↑ 80.6 90.6 FPR ↓ 0.03 0.08 TPR ↑ 41.4 98.6 FPR ↓ 37.3 0.57 TPR ↑ 85.4 96.4 FPR ↓ 0.14 47.1 TPR ↑ 36.0 100 FPR ↓ 17.6 0.03 (b) Downstream Evaluation ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ No Defense Ours Ours + Unlearn No Defense Ours 93.1 58.3 3.21 91.3 6.23 93.5 94.5 89.4 90.5 90.9 83.7 8.41 0.46 88.5 4.35 93.9 94.1 91.2 91.5 90.6 White-box Adaptive Attack 41.2 11.4 2.45 92.9 93.3 88.7 84.1 22.5 0.87 93.8 94.4 93.6 Gray-box Adaptive Attack 83.6 8.64 89.8 89.0 26.2 1.23 90.3 90.3 95.6 20.3 0.53 64.6 8.57 94.2 93.9 71.2 91.0 91.1 34.2 2.35 0.63 15.2 1.06 93.7 94.4 92.3 91.1 91.1 25.3 5.49 1.21 22.4 1.34 94.7 94.9 92.0 91.1 91.1 Table 10: (a) Upstream and (b) Downstream evaluation results for the adaptive attacks. We consider the same attacks from Case-0, CIFAR-10, and implement the white-box adaptive attack to disguise the original poisoned samples. performance following the aforementioned attack settings. For the White-box attack setting, we evaluate the downstream with the same model structures as used by the attacker for syn- thesizing δ∗. For the Gray-box attack setting, we use different model structures. Results and insights. The results of ASSET against the adaptive attacks are summarized in Table 10. From the up- stream evaluation, for White-box attack, we find the adaptive attack's effect varies from trigger to trigger. The performance of the White-box attack on disguising Blended triggers is lim- ited, while on BadNets, LC, and Narci., the TPR is largely decreased. Interestingly, the model mismatch introduced in the Gray-box largely impacts the attack efficacy and ASSET is able to maintain high defense performance across all the Gray-box attacks. While moving on to the downstream evalu- ation, we find both White-box and Gray-box adaptive attack introduced additional noise that impedes some of the backdoor triggers from taking effect, i.e., lower ASR at the end, even without any additional defensive measure. For White-box at- tack, we find only the adaptive BadNets attack can achieve an ASR greater than 50% after the model converges over the subset removing the detected samples using ASSET. By following the standard procedure in many detection-based de- fenses [11,23], we use the detected samples to provide revered gradients for the downstream model (e.g., minimize negative CE loss) or known as Unlearning, denoted by "Ours+Unlearn". We find this simple adaptation of ASSET can successfully diminish the effect of all the evaluated White-box adaptive attacks. On the other hand, the ASSET on the Gray-box adaptive attacks with detector model mismatch (attacker uses ResNet-18 to obtain θI, defender uses VGG-16 to obtain ̃θI) are almost the same on the vanilla attacks without adaptation. To conclude, the above study shows that ASSET is robust to the evaluated White-box attack with the standard unlearning procedure using the detected samples and robust to the eval- uated Gray-box attack. The results highlight that disclosing the knowledge of our defense workflow and models can ex- pose ASSET to the risk of adaptive attacks. Not releasing the model architecture can mitigate the risk of adaptive attacks to a large extent. Also, using the detected samples for unlearning can be a simple yet effective post-processing method that can be used in tandem with our detection to safeguard ML applica- tions against adaptive attacks to our defense. One thing worth highlighting is that the unlearning process requires the detec- tion method to obtain a better precision upstream. Otherwise, if the FPR of the upstream is high (more clean samples are wrongly flagged), the downstream unlearning would result in an unfavorable impact on the ACC (e.g. the results on the White-box LC results). 6 Conclusion This work is motivated by the glaring gap between the focused evaluation of the end-to-end SL settings in prior back- door detection literature and the fast adaption of other more data- and computation-efficient learning paradigms, including SSL adaptation and TL. We find that existing detection meth- ods cannot be applied or suffer limited performance for SSL and TL; even for the widely studied end-to-end SL setting, there is still large room to improve detection in terms of their robustness to variations in poison ratio. This work proposes a novel idea for actively enforcing different model behaviors on clean and poisoned samples through a two-level nested offset loop. Our approach provides the first backdoor defense that operates across different learning paradigms, different attack techniques, and poison ratios. Our work opens up many directions for future work. (1) Theoretical Understanding of Offset: Despite the empirical success, an in-depth understanding of convergence behaviors and sample complexity of ASSET is still lacking. In addition, we have shown multiple offset objectives, but how to explain why a loss design is better than the other is still an open ques- tion. (2) Alternative Offset Goal Designs: Our work provides a general algorithmic framework for active backdoor data detection by optimizing opposite goals. Are there other opti- mization objectives beyond what we proposed in this paper that can lead to better detection performance? (3) Extension to Broader Data Types: Evaluating ASSET on domains beyond images and texts is of practical importance. Acknowledgement RJ and the ReDS lab appreciate the support of the Amazon - Virginia Tech Initiative for Efficient and Robust Machine Learning and the Cisco Award. YZ is supported by the Ama- zon Fellowship. XL gratefully acknowledges the support of National Science Foundation Award No. CNS-1929300. References [1] T. Gu, K. Liu, B. Dolan-Gavitt, and S. Garg, "Bad- nets: Evaluating backdooring attacks on deep neural net- works," IEEE Access, vol. 7, pp. 47 230–47 244, 2019. [2] Y. Zeng, M. Pan, H. A. Just, L. Lyu, M. Qiu, and R. Jia, "Narcissus: A practical clean-label backdoor attack with limited information," ACM CCS, 2023. [3] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Er- han, I. Goodfellow, and R. Fergus, "Intriguing properties of neural networks," in ICLR, 2014. [4] Y. Li, B. Wu, Y. Jiang, Z. Li, and S.-T. Xia, "Backdoor learning: A survey," arXiv:2007.08745, 2020. [5] D. Tang, X. Wang, H. Tang, and K. Zhang, "Demon in the variant: Statistical analysis of {DNNs} for robust backdoor contamination detection," in USENIX Security, 2021, pp. 1541–1558. [6] Y. Gao, C. Xu, D. Wang, S. Chen, D. C. Ranasinghe, and S. Nepal, "Strip: A defence against trojan attacks on deep neural networks," in ACM ACSAC, 2019. [7] B. Tran, J. Li, and A. Madry, "Spectral signatures in backdoor attacks," in NeurIPS, 2018, pp. 8000–8010. [8] J. Hayase, W. Kong, R. Somani, and S. Oh, "Spectre: de- fending against backdoor attacks using robust statistics," in ICML, 2021. [9] W. Ma, D. Wang, R. Sun, M. Xue, S. Wen, and Y. Xiang, "The" beatrix"resurrections: Robust backdoor detection via gram matrices," in NDSS Symposium, 2022. [10] B. Chen, W. Carvalho, N. Baracaldo, H. Ludwig, B. Ed- wards, T. Lee, I. Molloy, and B. Srivastava, "Detecting backdoor attacks on deep neural networks by activation clustering," arXiv:1811.03728, 2018. [11] Y. Li, X. Lyu, N. Koren, L. Lyu, B. Li, and X. Ma, "Anti- backdoor learning: Training clean models on poisoned data," in NeurIPS, vol. 34, 2021. [12] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, "A simple framework for contrastive learning of visual rep- resentations," in ICML, 2020, pp. 1597–1607. [13] K. He, X. Chen, S. Xie, Y. Li, P. Dollár, and R. Girshick, "Masked autoencoders are scalable vision learners," in CVPR, 2022, pp. 16 000–16 009. [14] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weis- senborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Min- derer, G. Heigold, S. Gelly, J. Uszkoreit, and N. Houlsby, "An image is worth 16x16 words: Transformers for im- age recognition at scale," in ICLR, 2021. [15] J. Z. HaoChen, C. Wei, A. Kumar, and T. Ma, "Be- yond separability: Analyzing the linear transferability of contrastive representations to related subpopulations," arXiv:2204.02683, 2022. [16] T. Chen, S. Kornblith, K. Swersky, M. Norouzi, and G. E. Hinton, "Big self-supervised models are strong semi-supervised learners," in NeruIPS, 2020. [17] X. Chen, S. Xie, and K. He, "An empirical study of training self-supervised vision transformers," in CVPR, 2021. [18] J.-B. Grill, F. Strub, F. Altché, C. Tallec, P. Richemond, E. Buchatskaya, C. Doersch, B. Avila Pires, Z. Guo, M. Gheshlaghi Azar et al., "Bootstrap your own latent-a new approach to self-supervised learning," in NeurIPS, vol. 33, 2020, pp. 21 271–21 284. [19] N. Carlini and A. Terzis, "Poisoning and backdooring contrastive learning," in ICLR, 2022. [20] A. Saha, A. Tejankar, S. A. Koohpayegani, and H. Pirsi- avash, "Backdoor attacks on self-supervised learning," in CVPR, 2022, pp. 13 337–13 346. [21] C. Li, R. Pang, Z. Xi, T. Du, S. Ji, Y. Yao, and T. Wang, "Demystifying self-supervised trojan attacks," arXiv:2210.07346, 2022. [22] C. Raffel, N. Shazeer, A. Roberts, K. Lee, S. Narang, M. Matena, Y. Zhou, W. Li, P. J. Liu et al., "Exploring the limits of transfer learning with a unified text-to-text transformer." J. Mach. Learn. Res., 2020. [23] X. Qi, T. Xie, J. T. Wang, T. Wu, S. Mahloujifar, and P. Mittal, "Towards a proactive ml approach for detecting backdoor poison samples," 2023. [24] Y. Zeng, M. Pan, H. Jahagirdar, M. Jin, L. Lyu, and R. Jia, "Meta-sift: How to sift out a clean subset in the presence of data poisoning?" 2023. [25] L. Bottou, "Stochastic gradient descent tricks," in Neural networks: Tricks of the trade. Springer, 2012. [26] M. Tan and Q. Le, "Efficientnet: Rethinking model scal- ing for convolutional neural networks," in ICML, 2019. [27] Z. Xie, Y. Lin, Z. Yao, Z. Zhang, Q. Dai, Y. Cao, and H. Hu, "Self-supervised learning with swin transform- ers," arXiv:2105.04553, 2021. [42] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick, "Mo- mentum contrast for unsupervised visual representation learning," in CVPR, 2020, pp. 9729–9738. [28] J. Gui, T. Chen, Q. Cao, Z. Sun, H. Luo, and D. Tao, "A survey of self-supervised learning from multiple per- spectives: Algorithms, theory, applications and future trends," arXiv preprint arXiv:2301.05712, 2023. [29] X. Chen, C. Liu, B. Li, K. Lu, and D. Song, "Targeted backdoor attacks on deep learning systems using data poisoning," in arXiv:1712.05526, 2017. [43] X. Chen, H. Fan, R. Girshick, and K. He, "Im- proved baselines with momentum contrastive learning," arXiv:2003.04297, 2020. [44] N. Peri, N. Gupta, W. R. Huang, L. Fowl, C. Zhu, S. Feizi, T. Goldstein, and J. P. Dickerson, "Deep k-nn defense against clean-label data poisoning attacks," in ECCV, 2020. [30] Y. Liu, S. Ma, Y. Aafer, W.-C. Lee, J. Zhai, W. Wang, and X. Zhang, "Trojaning attack on neural networks," in NDSS, 2018. [45] E. Soremekun, S. Udeshi, and S. Chattopadhyay, "Ex- posing backdoors in robust machine learning models," arXiv:2003.00865, 2020. [31] E. Bagdasaryan and V. Shmatikov, "Blind backdoors in deep learning models," in USENIX Security, 2021, pp. 1505–1521. [46] A. Chan and Y.-S. Ong, "Poison as a cure: Detecting & neutralizing variable-sized backdoor attacks in deep neural networks," arXiv:1911.08040, 2019. [32] Y. Li, Y. Li, B. Wu, L. Li, R. He, and S. Lyu, "Invisible backdoor attack with sample-specific triggers," in ICCV, 2021. [33] S. Li, M. Xue, B. Zhao, H. Zhu, and X. Zhang, "Invisible backdoor attacks on deep neural networks via steganog- raphy and regularization," IEEE TDSC, 2020. [34] Y. Liu, X. Ma, J. Bailey, and F. Lu, "Reflection backdoor: A natural backdoor attack on deep neural networks," in ECCV, 2020. Springer, 2020, pp. 182–199. [35] T. A. Nguyen and A. T. Tran, "Wanet-imperceptible warping-based backdoor attack," in ICLR, 2020. [36] Y. Zeng, W. Park, Z. M. Mao, and R. Jia, "Rethinking the backdoor attacks' triggers: A frequency perspective," in ICCV, 2021. [37] H. A. A. K. Hammoud and B. Ghanem, "Check your other door! establishing backdoor attacks in the fre- quency domain," arXiv:2109.05507, 2021. [38] T. Wang, Y. Yao, F. Xu, S. An, H. Tong, and T. Wang, "An invisible black-box backdoor attack through frequency domain," in ECCV, 2022. [47] E. Chou, F. Tramer, and G. Pellegrino, "Sentinet: De- tecting localized universal attacks against deep learning systems," in 2020 IEEE Security and Privacy Workshops (SPW). IEEE, 2020, pp. 48–54. [48] T. Wang, Y. Zeng, M. Jin, and R. Jia, "A unified framework for task-driven data quality management," arXiv:2106.05484, 2021. [49] P. W. Koh and P. Liang, "Understanding black-box pre- dictions via influence functions," in ICML, 2017. [50] 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 ICML, 2021. [51] M. J. Wainwright, High-Dimensional Statistics: A Non- Asymptotic Viewpoint, ser. Cambridge Series in Statisti- cal and Probabilistic Mathematics, 2019. [52] G. Brys, M. Hubert, and P. Rousseeuw, "A robustifica- tion of independent component analysis," Journal of Chemometrics: A Journal of the Chemometrics Society, vol. 19, no. 5-7, pp. 364–375, 2005. [53] A. Krizhevsky, G. Hinton et al., "Learning multiple lay- [39] A. Turner, D. Tsipras, and A. Madry, "Label-consistent ers of features from tiny images," 2009. backdoor attacks," arXiv:1912.02771, 2019. [40] A. Saha, A. Subramanya, and H. Pirsiavash, "Hidden trigger backdoor attacks," in AAAI, 2020. [41] H. Souri, M. Goldblum, L. Fowl, R. Chellappa, and T. Goldstein, "Sleeper agent: Scalable hidden trigger backdoors for neural networks trained from scratch," arXiv:2106.08970, 2021. [54] A. Coates, A. Ng, and H. Lee, "An analysis of single- layer networks in unsupervised feature learning," in Pro- ceedings of the fourteenth international conference on artificial intelligence and statistics. JMLR, 2011. [55] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, "Imagenet: A large-scale hierarchical image database," in CVPR, 2009, pp. 248–255. [56] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in CVPR, 2016. [57] J. D. M.-W. C. Kenton and L. K. Toutanova, "Bert: Pre- training of deep bidirectional transformers for language understanding," in NAACL-HLT, 2019. [58] Y. Zeng, S. Chen, W. Park, Z. Mao, M. Jin, and R. Jia, "Adversarial unlearning of backdoors via implicit hyper- gradient," in ICLR, 2022. Appendix 6.1 Detailed Defense Settings In the evaluation section, we provide a thorough compari- son of existing backdoor detection techniques. These methods can be classified into several categories, including Spectral [7], Spectre [8], and Beatrix [9], which utilize analysis of activa- tion patterns; AC [10], which leverages clustering of feature information; ABL [11], which detects the lowest loss from poisoned datasets; Strip [6], which focuses on logits of sample outputs; and CT [23], which employs confusion training in end-to-end supervised learning settings. Note that the above baseline defenses were only evaluated under the settings of end-to-end SL (Case-0) in their original papers. They can also be directly generalized to Case-2. We will incorporate the above seven baseline defenses in Case-0 and Case-2 with the suggested hyperparameters proposed in these original works for comparison. As for Case-1, some of the methods are not applicable, whereas others can be adapted to operate without label information. In particular, Strip [6] and CT [23] are label-information-dependent methods, which are excluded from evaluation in Case-1. The vanilla design of Spectral [7] and Spectre [8] used a feature extractor trained with label information. In our Case-1 experiment, we replace the feature extractor trained with labels with one trained using the SSL paradigm. The original implementation processes samples class-wisely for the Beatrix [9] and AC [10]. How- ever, since there is no label information in Case-1, we pro- cess all training samples together. For ABL [11], we replace the original implementation's Cross-Entropy loss with the respective training loss function used in the respective SSL algorithm (e.g., the InfoNCE loss for the MoCo V3 [17]). 6.2 Detailed Attack Settings In this work, we examine several representative attacks for each category of attack design. For Case-0, which is the end-to-end supervised learning setting mentioned in Section 5.2, we thoroughly investigate existing Dirty-label attacks and Clean-label backdoor attacks. Dirty-label attacks create a backdoor by altering the label of the poisoned samples to the target class. We selected some representative attacks for experiments. For example, BadNets [1] and Blended [29] are used as triggers by simply superimposing special patterns; there are also affine transformations that are difficult to find on pictures, such as WaNet [35]; as well as training an en- coder to create distinct backdoor trigger for each sample like ISSBA [33]. On the other hand, Clean-label backdoor attacks maintain the original label of the poisoned samples. Examples include LCciteturner2019label, which makes models learn simple triggers by patching adversarial noise on the remain- ing part of sample; SAA [41], which produces effects through model feature collisions; and the state-of-the-art attack Nar- cissus [2], which obtains the backdoor trigger by optimizing the distribution within the class and the connection of the target label. For these three Clean-label backdoor attacks, we set l∞ = 16/255 to ensure the consistency of the attack. For Case-1, we consider the backdoor attack in the SSL setting (detailed in Section 5.3). Since the training does not require labels and always contains strong augmentations, traditional attacks against SSL are not effective. However, with the de- velopment of this training paradigm, attacks against it have started to emerge. There are attacks by superimposing spe- cific design patterns [19, 20] and attacks by adding specific frequency noise to the YCbCr color space [21]. The C-brd and C-Squ adopt a fixed in-class poison ratio w.r.t. only the sam- ples from the targeted category (50% in-class), following [20]. CTRL adopts a fixed poison ratio w.r.t. the whole dataset (1% of all the samples), following [21]. For Case-2, we investigate the attacks in the context of transfer learning, as described in section 5.4. Our evaluation revealed that adding backdoor attack samples to the fine-tuned dataset leads to a successful attack. Basic backdoor attacks, such as BadNets and Blended, can easily be generalized and result in an effective attack. Furthermore, attacks based on the collision of the model's feature space, such as SSA or HTBA [40] can also work in this scenario. All the attacks use the default settings in the original paper to ensure consistency with the original work. 6.3 Additional results In addition to the results presented in the main text, we also evaluate the performance of the baseline defenses in different attack settings and dataset settings. Additional Results with Multiple Attacks. For Case-0, we test the scenario where multiple backdoor attacks appear si- multaneously in a training set. We deploy 4 different dirty label attacks that have appeared in the main text into 4 differ- ent classes of the CIFAR-10 dataset, and the poison ratio is consistent with the main text. At the same time, the ASR of all attacks is above 90% to ensure the effectiveness of the attack. The results are listed in Table 14. When multiple attacks are present, all the baseline defense methods except CT can main- tain a reliable detection, as at least one set of poisoned samples ends up with a TPR lower than 50%. Our method achieves the highest average TPR among all defenses and demonstrates a better and more consistent detection performance with all the TPR above 85% under this setting. Additional Results with SSL. For Case-1, we evaluate the re- SimCLR MoCo V3 BYOL MAE C-brd (5%) No Attack ASR ↓ ASR* ↓ ACC ↑ 67.2 6 0.34 68.4 6 0.32 67.1 7 0.36 70.2 5 0.28 66.9 66.1 68.2 68.2 67.1 66.5 70.1 68.7 Table 11: Downstream evaluation results of our method under Case-1 in ImageNet-100. C-Squ (5%) ASR*0 ASR* ↓ ACC0 ACC ↑ ASR*0 ASR* ↓ ACC0 ACC ↑ ASR0 ASR ↓ ACC0 ACC ↑ 66.8 68.3 66.8 69.3 65.9 68.0 66.6 68.9 65.6 67.8 66.8 69.1 66.8 68.2 66.9 69.9 1.36 2.12 1.44 1.66 25.0 23.6 40.9 30.7 141 119 263 68 168 67 290 28 CTRL (1%) 12 12 19 8 8 8 11 6 Figure 7: Visual examples of the backdoor poisoned samples disguised by adaptive attacks (Case-0, CIFAR-10). sults on the ImageNet-100 dataset. ImageNet-100 is a subset of ImageNet-1K, consisting of 100 randomly selected classes (about 128,000 samples), which is currently the most popular benchmark dataset for self-supervised learning. All images are resized to 224x224 pixels to fit the model input. Here we use self-supervised learning methods consistent with those in Sec- tion 4.3, including the contrastive learning method SimCLR, MoCO V3, BYOL, and the masked-model training method MAE. Here all backbone models are ViT-Small/16 to obtain a satisfactory ACC. The upstream and downstream results can be found in Table 15, and Table 11, respectively. As the dataset becomes more complex compared to CIFAR-10, de- tection also becomes more difficult. Nevertheless, our method provides a TPR greater than 88% in all cases. All FPRs are below 0.5%, providing as clean samples as possible for subse- quent downstream tasks and minimizing the impact on ACC. In the downstream task, our method succeeded in reducing the ASR with no significant improvement over the baseline without poison, indicating that our method was successful in removing the poison. At the same time, thanks to the ex- tremely low FPR, the ACC of the model has seen a certain increase compared to the poisoned model. Additional Results with TL. Finally, in Case-2, we present the upstream and downstream results of STL-10 in Table 16, where all images were scaled to 224x224 pixels to align with the ImageNet-1K [55] pre-trained ViT-Tiny/16 [14] model. Our method consistently achieves a TPR of over 90%, while keeping the FPR below 0.6%. Compared to other defense methods, our method achieves the best average TPR and FPR. In the downstream tasks, which benefited from the high TPR and low FPR, our method successfully keeps all ASRs below 20%, ensuring attacks will not effectively occur. Our method obtains the highest average value for ACC as well as ASR. Visual Results of Adaptive Attacks. Figure 7 depicts the visual results of the adaptive attacks discussed in Section 5.5. Upstream Evaluation TPR ↑ 79.8 100 FPR ↓ 18.1 3.77 Downstream Evaluation ASR ↓ 68.4 10.3 ACC ↑ 90.3 91.6 AC Ours Table 12: Textual backdoor detection, BadNets, SST-2 dataset. Additional Results on Other Modality. We provide addi- tional results on exploring the applicability of the ASSET on detecting backdoor samples in the Natural Language Pro- cessing domain. We implemented the BadNets attack6 on the SST-2 dataset with BERT [57] as the target model. We set the poisoning rate to be 10%, with the trigger as "cf mn bb tq." We observe that ASSET can achieve good detection re- sults. Compared to the AC evaluated under the same settings, we find our method provides more effective detection results. One possible explanation for the AC's limited effectiveness is that the BERT model relies on pre-trained features, which limits the separability based on feature space clustering. Computation Overhead. Table 13 compares the computation overhead of ASSET and other baseline methods in Case-0. CIFAR-10 Spectral 1800+63 Spectre 1800+137 Beatrix 1800+782 AC 1800+123 ABL 847 Strip 1800+374 CT 6300 Ours 1800+1800 Table 13: Computational overhead (GTX 2080 Ti GPU sec- onds) under (Case-0). Defense methods rely on a pre-trained poisoned model incur additional 1800s for training. 6.4 Ablation Study Table 17 shows that solely adopting the outer offset loop will experience limitations in low poison ratio cases. In the case of a low poison ratio, since the poison samples account for a relatively small proportion in each mini-batch, the model will tend to optimize its output for clean samples, thus ignor- ing its output for poison samples, finally leading to limited performance. However, this limitation can be effectively over- come by embedding an inner loop to perform poison concen- tration. In a relatively high poison ratio setting (e.g., 20%) where the outer loop alone can already achieve good detection performance, inserting an inner loop is still useful and can further boost the detection efficacy. It can be seen that the design of the inner loop is the key to our successful defense in spite of the very low poison ratio in Table 3. We ablate on the size of the base set used in our detec- tion, and the result is provided in Table 18. We find that the detection performance slightly decreases as the base set size is smaller; nevertheless, ASSET can achieve strong per- formance even with 10 samples-one sample per class on CIFAR-10. Our experiment confirms our conclusion in Sec- tion 4.1 that the base set and the clean portion of the poisoned 6https://github.com/thunlp/OpenBackdoor BadNets (5%) Class 0 TPR 88.6 94.6 92.8 58.9 89.9 83.6 99.6 99.7 WaNet (10%) Class 4 TPR 0.00 0.16 50.9 79.2 0.64 6.82 96.5 86.8 ISSBA (1%) Class 6 TPR 98.4 84.2 42.6 4.60 0.00 45.4 81.8 94.2 Blended (5%) Class 9 TPR 92.6 98.9 75.9 53.3 6.72 51.7 96.8 100 FPR 27.2 26.5 2.61 42.4 33.7 11.2 1.22 0.36 Spectral Spectre Beatrix AC ABL Strip CT Ours Average Worst-Case TPR 69.9 69.5 65.5 49.0 24.3 46.9 93.7 95.2 TPR 0.00 0.16 42.6 4.60 0.00 6.82 81.8 86.8 Table 14: Defense results on multi-trigger-multi-target attack under Case-0, FPR refers to the overall FPR in the training dataset. The bolded results denote the best defense results among all the evaluated defenses w.r.t. each attack. C-Squ (0.5%) FPR ↓ TPR ↑ 0.20 92.9 0.23 90.3 0.18 88.6 94.2 0.27 Table 15: Further upstream evaluation of our method under Case-1 with four training algorithms under ImageNet. C-brd (0.5%) FPR ↓ TPR ↑ 0.17 95.7 0.21 92.5 0.15 90.5 0.17 97.8 CTRL (1%) FPR ↓ 0.34 0.10 0.21 0.17 SimCLR MoCo V3 BYOL MAE TPR ↑ 92.9 91.4 97.4 98.8 FT-all FT-last BadNets (20%) SAA (5%) Blended (20%) HTBA (5%) Average Worst-Case (b) Upstream Evaluation TPR ↑ 54.4 76.8 86.9 34.6 81.2 83.2 98.3 97.7 FPR ↓ 23.9 18.3 3.55 46.2 17.2 11.2 10.5 0.53 TPR ↑ 11.2 17.2 74.8 18.0 57.2 0.00 82.4 90.8 FPR ↓ 7.31 6.99 12.1 14.5 4.88 20.7 3.98 0.34 TPR ↑ 16.6 16.0 56.7 9.80 75.3 52.9 98.7 99.6 FPR ↓ 33.4 33.5 11.7 60.3 18.7 16.3 6.58 0.18 TPR ↑ 25.6 46.4 89.2 8.40 75.6 71.2 96.4 99.2 FPR ↓ 4.97 3.87 13.5 13.3 3.91 17.6 2.57 0.19 TPR ↑ 27.0 39.1 76.9 17.7 72.3 51.8 94.0 96.8 FPR ↓ 17.4 15.7 10.2 33.6 11.2 16.5 5.91 0.31 TPR ↑ 11.2 16.0 56.7 8.40 57.2 0.00 82.4 90.8 FPR ↓ 33.4 33.5 13.5 60.3 18.7 20.7 10.5 0.53 (b) Downstream Evaluation ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ ASR ↓ ACC ↑ 98.5 99.6 98.5 99.5 98.5 99.3 98.5 99.4 98.5 99.6 98.5 99.6 98.4 99.5 98.5 7.65 98.5 8.93 97.7 97.6 97.6 95.2 98.4 94.2 98.4 90.2 1.44 68.1 49.6 31.3 8.93 56.3 14.3 16.8 1.27 0.36 97.9 97.6 98.0 98.0 97.3 97.1 97.7 98.1 98.1 93.6 91.4 86.3 36.2 85.6 59.6 94.0 11.2 15.4 98.5 98.4 98.4 98.6 98.2 98.5 98.4 98.4 99.2 98.6 98.1 98.1 97.9 98.0 98.2 97.8 98.2 98.1 ASR ↓ ACC ↑ 98.4 89.8 98.2 84.5 98.3 78.6 98.3 59.9 98.0 85.0 98.1 66.9 98.1 77.2 98.3 27.6 98.5 6.53 ASR ↓ ACC ↑ 97.9 99.6 97.6 99.5 98.0 99.3 97.9 99.4 97.3 99.6 97.1 99.6 97.7 99.5 98.1 90.2 98.1 15.4 Spectral Spectre Beatrix AC ABL Strip CT Ours No Def. Spectral Spectre Beatrix AC ABL Strip CT Ours Table 16: Upstream and Downstream Evaluation and compar- ison results under Case-2 with STL-10. Outer loop only Outer + Inner BadNets (5%) BadNets (20%) TPR 39.0 99.5 TPR 96.6 99.9 FPR 37.3 5.24 FPR 0.83 0.03 Table 17: Detection effects w/ or w/o inner loop (Case-0). dataset share the same clean distribution, while the clean sam- ple and poison sample originate from distinct distributions. Figure 8 depicts AO's impact on mini-batches from the same poisoned training set. In particular, even though the two mini-batches are from the same distribution, the number of poisoned samples varies due to random sampling. With different sizes of poisoned samples resulting in different dis- tributions of the loss values, it becomes harder for the inner loop to use a fixed threshold or fixed ratio to determine the most likely poisoned samples to form Bpc. AO helps to map the distribution adaptively so that we find a fixed threshold to consistently obtain the poison-concentrated subset. 10 100 1000 5000 BadNets (5%) Blended (5%) TPR FPR TPR FPR TPR FPR TPR FPR 0.22 98.2 0.00 100 1.04 0.18 0.55 0.00 99.5 100 99.5 100 98.9 99.9 1.0 0.01 Table 18: Ablation study in the base set size (Case-0). 6.4.1 Impact of Base Set Quality on Detection Efficacy While ASSET exhibits robust performance across a range of attack settings, its effectiveness may fluctuate depending on the quality of the base set. Figure 8: The original BCE loss output (a) and the output processed after AO (b) (WaNet attack, CIFAR-10, ResNet-18, Case-0). In particular, AO maps the original outputs to a more separable range which is easier to concentrate the poisoned samples with a fixed threshold. CIFAR-10 TPR ↑ 99.5 FPR ↓ 0.55 CIFAR-100 TPR ↑ 98.6 FPR ↓ 0.81 STL-10 GTSRB TPR ↑ 87.3 FPR ↓ 3.21 TPR ↑ 0.00 FPR ↓ 100.0 BadNets (5%) Table 19: Use non-iid dataset as the base set (Case-0). The CIFAR-10 column represents the iid setting. Sampling quality of the base set. In this paper, the base set follows the widely accepted setting [23, 58] that it is drawn from the same distribution as the training set. However, it is worth noting that in practical, a distributional drifts may occur between the training and base sets. To test how ASSET fares in the face of such distributional drifts, we have outlined the detection results derived from utilizing samples taken from different datasets as base sets for poison detection on CIFAR- 10 (BadNets attack, Case-0) in Table 19. Our observations suggest that ASSET can consistently generate acceptable detection results if the distributional drift does not drastically alter the task context, as evidenced by the results from CIFAR- 100 and STL-10. However, the detection efficiency falters when an out-of-distribution dataset is used as the base set, as exemplified by the use of the traffic sign dataset, GTSRB. 0/1000 1/1000 5/1000 10/1000 TPR ↑ 99.5 FPR ↓ 0.55 TPR ↑ 85.4 FPR ↓ 1.27 TPR ↑ 78.7 FPR ↓ 0.00 TPR ↑ 9.16 FPR ↓ 3.39 BadNets (5%) Table 20: Number of poisoned samples in the base set (Case-0). The 0/1000 column represents the clean base set. Poisons in the base set. Stronger attack settings may enable attackers to tamper with the base set. Implementing this set- ting is challenging, and it has rarely been discussed in prior work due to the formidability of embedding the exact trigger into the carefully scrutinized base set without triggering any alerts. We evaluate the impact of different poison ratios in the base set in Table 20, and with 10 poisoned samples infiltrating the base set will cause the detection to be ineffective. Remark. The above results on the efficacy and the base set quality are unsurprising. The detection efficacy's sensitivity to the quality of the base set is not exclusive to ASSET. This sensitivity is likewise a noted drawback of numerous defen- sive methods that rely on a clean in-distribution base set, as observed and discussed in [24]. The experimental results high- light the importance of obtaining high-quality base sets with the care of drift and security inspections. How to effectively acquire a high-quality base set is out of the scope of this paper.
http://arxiv.org/abs/2302.11381v2
2023-05-30T14:30:52
2023-02-22T13:55:08
Optimal Convergence Rate for Exact Policy Mirror Descent in Discounted Markov Decision Processes
Policy Mirror Descent (PMD) is a general family of algorithms that covers a wide range of novel and fundamental methods in reinforcement learning. Motivated by the instability of policy iteration (PI) with inexact policy evaluation, unregularised PMD algorithmically regularises the policy improvement step of PI without regularising the objective function. With exact policy evaluation, PI is known to converge linearly with a rate given by the discount factor $\gamma$ of a Markov Decision Process. In this work, we bridge the gap between PI and PMD with exact policy evaluation and show that the dimension-free $\gamma$-rate of PI can be achieved by the general family of unregularised PMD algorithms under an adaptive step-size. We show that both the rate and step-size are unimprovable for PMD: we provide matching lower bounds that demonstrate that the $\gamma$-rate is optimal for PMD methods as well as PI and that the adaptive step-size is necessary to achieve it. Our work is the first to relate PMD to rate-optimality and step-size necessity. Our study of the convergence of PMD avoids the use of the performance difference lemma, which leads to a direct analysis of independent interest. We also extend the analysis to the inexact setting and establish the first dimension-optimal sample complexity for unregularised PMD under a generative model, improving upon the best-known result.
[ "Emmeran Johnson", "Ciara Pike-Burke", "Patrick Rebeschini" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11381v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11381v2", "@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", "math.ST", "stat.TH" ]
3 2 0 2 y a M 0 3 ] C O . h t a m [ 2 v 1 8 3 1 1 . 2 0 3 2 : v i X r a OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT Optimal Convergence Rate for Exact Policy Mirror Descent in Discounted Markov Decision Processes Emmeran Johnson Department of Mathematics, Imperial College London, United Kingdom [email protected] Ciara Pike-Burke Department of Mathematics, Imperial College London, United Kingdom [email protected] Patrick Rebeschini Department of Statistics, University of Oxford, United Kingdom [email protected] Abstract Policy Mirror Descent (PMD) is a general family of algorithms that covers a wide range of novel and fundamental methods in reinforcement learning. Motivated by the instability of policy iteration (PI) with inexact policy evaluation, unregularised PMD algorithmically regularises the policy im- provement step of PI without regularising the objective function. With exact policy evaluation, PI is known to converge linearly with a rate given by the discount factor γ of a Markov Decision Process. In this work, we bridge the gap between PI and PMD with exact policy evaluation and show that the dimension-free γ-rate of PI can be achieved by the general family of unregularised PMD algorithms under an adaptive step-size. We show that both the rate and step-size are unimprovable for PMD: we provide matching lower bounds that demonstrate that the γ-rate is optimal for PMD methods as well as PI and that the adaptive step-size is necessary to achieve it. Our work is the first to relate PMD to rate-optimality and step-size necessity. Our study of the convergence of PMD avoids the use of the performance difference lemma, which leads to a direct analysis of independent interest. We also extend the analysis to the inexact setting and establish the first dimension-optimal sam- ple complexity for unregularised PMD under a generative model, improving upon the best-known result. 1. Introduction The problem of finding an optimal policy in tabular discounted Markov Decision Processes (MDPs) was classically solved using dynamic programming approaches such as policy iteration (PI) and value iteration (VI) (Puterman, 1994; Sutton and Barto, 2018). These methods are well understood theoretically and are guaranteed to converge linearly to the optimal policy in the tabular setting with a rate equal to the discount factor γ of the MDP (Bellman, 1957). Recently, increased interest has been devoted to the study of policy-gradient (PG) approaches based on optimising a parameterised policy with respect to an objective (Sutton et al., 1999; Konda and Tsitsiklis, 1999; Kakade, 2001). Given their popularity, it is of interest to better understand PG methods and determine if their guarantees match those of classical algorithms in tabular MDPs. Among the recent works fo- cused on understanding these methods in the tabular setting, Xiao (2022) study a general family of algorithms known as Policy Mirror Descent (PMD). PMD algorithmically regularises the policy improvement step of PI and as such can be seen as a version of regularised PI, without actually regularising the objective of interest. It is also viewed as a policy-gradient method through its con- nection to mirror descent (Beck and Teboulle, 2003). Linear convergence of PMD was established by Xiao (2022), though their rate depends on an instance-dependent factor that can scale with the 1 JOHNSON PIKE-BURKE REBESCHINI dimension of the problem, such as the size of the state space. For a specific instance of PMD known as Natural Policy Gradient (NPG), Khodadadian et al. (2021) showed that an instance-independent γ-rate is achievable, although their results do not cover general PMD. In MDPs where the objective is regularised, the γ-rate has been established for PMD (Cen et al., 2021; Lan, 2021; Zhan et al., 2021). The classical approaches (PI and VI) achieve the γ-rate without regularisation, revealing that regularisation is, in general, not necessary for algorithms to reach the γ-rate. This motivates the following questions: Can the classical linear γ-rate be matched by unregularised policy-gradient algorithms? And what is the best rate that unregularised policy-gradient methods can achieve ? For PMD, our work answers the first question positively and answers the second by establishing that the γ-rate is in fact the best rate achievable for PMD as well as for a more general family of algorithms (see Section 4.1). PMD allows for a choice of a mirror map that specifies different algorithms. Among these, NPG and PI are two ubiquitous instances of PMD each corresponding to their own mirror map. However, PMD is much more general and other mirror maps will lead to alternative algorithms endowed with the guarantees of PMD that we establish in this paper. In particular, the correspondence of mirror maps with exponential families (Banerjee et al., 2005) allows us to specify a wealth of valid mirror maps. This illustrates that PMD is a general framework that encompasses a wide range of novel but also fundamental algorithms, and motivates the study of its convergence guarantees. In this work, we make the following contributions and summarise them in Table 1, • We recover the γ-rate for the general family of PMD algorithms under an adaptive size (see the third bullet point below). In particular, Theorem 1 establishes the following bound in l∞-norm for the value V πk of the policy πk after k iterations of PMD compared to the value V π⋆ of an optimal policy π⋆, ∥V π⋆ − V πk ∥∞ ≤ 2 1 − γ γk, providing guarantees for any starting-state distribution. This matches the rate of VI and PI as well as the best known rates for PMD on regularised MDPs. This is also the first fully dimension-independent linear convergence result for unregularised PMD, by which we mean that there is no dependence on the size of the state space or the action space. • We provide a matching lower-bound in Theorem 2, establishing the γ-rate as the optimal rate for PMD methods. This is a worst-case bound in the sense that for a fixed iteration budget, there exists an MDP for which PMD can do no better than the γ-rate. Our results show that a particular choice of learning rate allows PMD to reach this lower-bound exactly. • The γ-rate for PMD in Theorem 1 relies on an adaptive step-size, where the adaptivity comes from the fact that the step-size depends on the policy at the current iteration (see Section 4). In Theorem 3 we show that this adaptivity is necessary for PMD to achieve the γ-rate, establishing our step-size as both sufficient and necessary. • We establish a novel theoretical analysis that avoids the use of the performance difference lemma (Kakade and Langford, 2002). This leads to a simple analysis and avoids needing to 2 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT Linear General γ-Rate Mirror Map Bound l∞ Dimension Step-Size Independent Lower-Bound Necessity Matching Khodadadian et al. (2021) Xiao (2022) This work ✓ × ✓ × ✓ ✓ ✓ × ✓ ✓ × ✓ × × ✓ × × ✓ Table 1: Comparison of contributions with prior work that study PMD. Khodadadian et al. (2021) focus on NPG, an instance of PMD for a specific mirror map (see Section 3). Their analysis is fundamentally different to ours as it exploits the closed-form update of NPG. Their step- size is similar to ours, though has a dependence on a sub-optimality gap (see Section 4). The l∞-bound is satisfied if it holds for ∥V π⋆ − V πk ∥∞. Dimension independence is satisfied when there is no instance for which the bound can scale with the size of the state space or action space. We compare these works in more detail in Section 4. deal with visitation distribution mismatches that are the last remains of dimension dependence in prior work. • By extending our analysis to the inexact setting, with an approach similar to that of in Xiao (2022), we establish an instance-independent sample complexity of ̃O(|S||A|(1 − γ)−8ε−2) under a generative model, where the notation ̃O() hides poly-logarithmic factors, S is the state space of the MDP, A is the action space and ε is the required accuracy. This improves on the previous best known sample complexity for PMD by removing the dependence on a distribution mismatch coefficient that can scale with problem-dependent quantities such as the size of the state space. More generally, we highlight that the analysis we establish in the exact setting can easily be combined with any other scheme for estimating the Q functions (see Section 5), paving the way for further improvements in instance-independent sample complexity results should more efficient estimation procedures be developed. Our contributions are primarily on establishing the optimal rate for general (not just NPG) exact PMD where we assume access to the true action-values of policies (for which the upper and lower- bound are both novel) and the simplicity of the analysis. The sample complexity result in the inexact setting illustrates how our analysis can be easily extended to obtain improved results for inexact PMD. 2. Related work 2.1. Convergence rates for exact policy mirror descent We first consider the setting where exact policy evaluation is assumed. In this setting, several earlier works have sub-linear convergence results for PMD (Geist et al., 2019; Shani et al., 2020) and NPG specifically (Agarwal et al., 2021), though these have since been improved to linear convergence results as discussed below. A line of work has considered PG methods applied to regularised MDPs. In this setting, linear convergence has been established for NPG with entropy regularisation (Cen et al., 2021), PMD with strongly-convex regularisers (Lan, 2021) and PMD with convex non-smooth regularisers (Zhan 3 JOHNSON PIKE-BURKE REBESCHINI et al., 2021). The rates of convergence are either exactly γ or can be made arbitrarily close to γ by letting the step-size go to infinity. In the setting of unregularised MDPs, which is the focus of this paper, linear convergence of the special case of NPG was established (Bhandari and Russo, 2021; Khodadadian et al., 2021) under an adaptive step-size similar to ours that depends on the current policy at each step. The bound of Bhandari and Russo (2021) has an additive term that can be made arbitrarily small by making the step-size larger but to which the γ-rate does not apply, while Khodadadian et al. (2021) does not have this term so we focus on this work. Their analysis relies on a link between NPG and PI and consists of bounding the difference in value between iterates of both methods. Bhandari and Russo (2021) also establish linear convergence for a number of algorithms including PMD, although it is in the idealised setting of choosing the step size at each iteration that leads to the largest increase in value. This step-size choice will make PMD at least as good as PI since arbitrarily large step-sizes can be chosen and PMD with an infinite step-size converges to a PI update. Since PI converges linearly, so will PMD. This does not establish linear convergence of PMD for step-sizes with a closed-form expression. However, linear convergence for unregularised general PMD was recently established by Xiao (2022) under a geometrically increasing step-size. In general, their rate is instance-dependent and may scale with problem dependent quantities such as the size of the state space. For general starting-state distributions, this same instance-dependent rate was established by Li et al. (2022) for a variant of PMD which augments the update with an added regularisation term. We focus our comparison on the work of Xiao (2022) rather than this work as the guarantees are equivalent in both but Li et al. (2022) do not directly study PMD and have a more complicated algorithm. A summary of our results compared to those of Khodadadian et al. (2021) and Xiao (2022) is presented in Table 1 and discussed in more detail in Section 4. In terms of optimality, Khodadadian et al. (2021) provide a lower-bound for constant step-size NPG, though it only applies to MDPs with a single-state, which can be solved in a single iteration with exact policy evaluation as the step-size goes to infinity (for which the lower-bound goes to 0). We provide a lower-bound in Theorem 2 that applies to PMD with arbitrary step-size on an MDP with any finite state space. To the best of our knowledge, prior to this work no lower-bound has been established in this general setting. 2.2. Sample complexity of inexact policy mirror descent Sample complexity in the inexact policy evaluation setting refers to the number of samples needed to guarantee an ε-optimal policy is returned. We here give an outline of results, typically established in high-probability, under a generative model that we formally present in Section 5. The lower bound on the sample complexity in this setting was shown to be of ̃Ω by Azar et al. (2013). This lower-bound can be reached by model-based approches (Agarwal et al., 2020; Li et al., 2020) and model-free approaches (Sidford et al., 2018; Wainwright, 2019). (cid:16) |S||A| (1−γ)3ε2 (cid:17) The sample-complexity for PG methods has been recently studied in (Yuan et al., 2022). Under a generative model, some works have considered PMD or NPG under various types of regularisation (Cen et al., 2021; Lan, 2021; Zhan et al., 2021). We focus on unregularised methods, for which results for PMD or its instances on tabular MDPs under a generative model are limited. There are works that obtain sample complexities results for NPG (Agarwal et al., 2021; Liu et al., 2020) and for PMD (Shani et al., 2020) though they do not attain the optimal ε-dependence of O(ε−2). Lazaric et al. (2016) show that a variant of PI, a special case of PMD, achieves the optimal ε-dependence 4 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT of O(ε−2). More recently, Xiao (2022) show that the general family of PMD methods match the O(ε−2) sample complexity with a factor of (1 − γ)−8. Our result for the inexact setting shares the same dependence on ε and 1 − γ as Xiao (2022) but removes an instance-dependent quantity which can depend on the size of the state space. Further comparison to the result in (Xiao, 2022) is given in Section 5. Beyond tabular MDPs and generative models, Chen and Theja Maguluri (2022) study NPG under linear function approximation and off-policy sampling, though their results imply worse sample complexities when restricted to tabular MDPs under a generative model. 3. Preliminaries A Markov Decision Process (MDP) is a discrete-time stochastic process, comprised of a set of states S, a set of actions A, a discount factor γ ∈ [0, 1) and for each state-action pair (s, a) a next-state transition function p(*|s, a) ∈ ∆(S) and a (assumed here deterministic) reward function r(s, a) ∈ [0, 1]. ∆(X ) denotes the probability simplex over a set X . We consider both S and A to be finite, which is known as the tabular setting. In a state s, an agent chooses an action a, which gives them a reward r(s, a) and transitions them to a new state according to the transition function p(*|s, a). Once they are in a new state, the process continues. The actions chosen by an agent are formalised through policies. A policy π : S → ∆(A) is a mapping from a state to a distribution over actions. We will often write it as an element in Π = ∆(A)|S|. In each state s ∈ S, an agent following policy π chooses an action a ∈ A according to πs = π(*|s) ∈ ∆(A). In this work, the goal is to learn how to behave in a γ-discounted infinite-horizon MDP. We measure the performance of a policy with respect to the value function V π : S → R, V π(s) = E (cid:104) ∞ (cid:88) (cid:105) γtr(st, at)|π, s0 = s , t=0 where st, at are the state and action in time-step t and the expectation is with respect to both the randomness in the transitions and the choice of actions under policy π. This is a notion of long-term reward that describes the discounted rewards accumulated over future time-steps when following policy π and starting in state s. For a distribution over states ρ ∈ ∆(S), we write V π(ρ) = (cid:80) s∈S ρ(s)V π(s) for the expected value when starting in a state distributed according to ρ. It is also useful to work with the state-action value Qπ : S × A → R: Qπ(s, a) = E (cid:104) ∞ (cid:88) (cid:105) γtr(st, at)|π, s0 = s, a0 = a , t=0 which is similar to V π, with the additional constraint of taking action a in the first time-step. We will often write V π ∈ R|S| (resp. Qπ ∈ R|S|×|A|) to refer to the vector form, where each entry represents the value (resp. action-value) in that state (resp. state-action pair). Similarly, we write s ∈ R|A| for the vector of action-values in state s. The following expressions, which relate Qπ Qπ and V π in terms of each other and when combined give the Bellman equations (Bellman, 1957), follow from their definitions above, V π(s) = ⟨Qπ s , πs⟩, Qπ(s, a) = r(s, a) + γ p(s′|s, a)V π(s′). (cid:88) s′∈S 5 JOHNSON PIKE-BURKE REBESCHINI We now define the discounted visitation-distribution for starting state s′ and policy π, dπ s′(s) = (1 − γ) ∞ (cid:88) t=0 γtPπ(st = s|s0 = s′), (1) which plays an important part in the study of PG methods. Note that Pπ(st = s|s0 = s′) is the probability of being in state s at time t when starting in state s′ and following policy π. We also write dπ s′∈S ρ(s′)dπ s′(s). ρ (s) = (cid:80) One of the main aims of reinforcement learning is to find a policy π that maximises V π. It is known that there exists a deterministic policy that simultaneously maximises V π and Qπ for all states and actions (Bellman, 1957). We call such a policy an optimal policy and denote it by π⋆. We are interested in finding an ε-optimal policy, i.e a policy π such that ∥V π⋆ − V π∥∞ < ε. 3.1. Exact policy mirror descent We are interested in PG methods that are based on optimising a parameterised policy πθ with respect to V πθ (ρ) for some ρ ∈ ∆(S). In the tabular setting, we can use the direct parameterisation of a policy πθ, which associates a parameter to each state-action pair, i.e. we have πθ(a|s) = θs,a. We will drop the subscript θ for notational convenience. The gradient of the value function with respect to this parameterisation (Sutton et al., 1999) is given by the concatenation over all state-action pairs (s,a) of 1 1 − γ Mirror Descent (MD, Beck and Teboulle (2003)) carries out gradient descent in a geometry that is non-Euclidean. Using −V π(ρ) as the minimising objective, the proximal perspective of MD gives an update of the form ρ (s)Qπ(s, a). dπ ∂ ∂π(a|s) V π(ρ) = (2) πk+1 = argminp∈Π (cid:110) − ηk⟨∇V πk (ρ), p⟩ + Dh(p, πk) (cid:111) (3) where h : dom h → R is the mirror map (with Π ⊂ dom h) and Dh is the Bregman divergence generated by h. We require h to be of Legendre type (Rockafellar, 1970), i.e strictly convex and essentially smooth (differentiable and ∥∇h(xk)∥ → ∞ for any sequence xk converging to a point on the boundary of dom h) on the relative interior of dom h. The Bregman Divergence is defined as Dh(π, π′) = h(π) − h(π′) − ⟨∇h(π′), π − π′⟩ for π, π′ ∈ dom h. As the objective V π(ρ) is non-convex in general (Agarwal et al., 2021), usual techniques from convex theory (Bubeck, 2015) are not applicable. The presence of the visitation-distribution term dπ ρ (s) in the gradient of the objective in (2) can slow down learning because it can lead to vanishingly small gradients when states are infrequently visited under the current policy π (Agarwal et al., 2021). To circumvent this issue, Policy Mirror Descent (PMD) (Lan, 2021; Shani et al., 2020; Xiao, 2022) applies a variant of update (3) with a weighted Bregman divergence DPMD that matches the visitation distribution factors of the gradient s ) where the mirror map h is now defined on a subset of R|A|. ρ (s)Dh(ps, πk DPMD h The resulting update has for all states a factor of dπk ρ (s) in both terms. The minimisation can then be applied for each state individually to get the PMD update (p, πk) = (cid:80) s dπk h πk+1 s = argminp∈∆(A) (cid:110) − ηk⟨Qπk s , ps⟩ + Dh(ps, πk s ) (cid:111) (4) 6 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT for all states s. We will often add a superscript k to any quantity that is associated to πk. For example, V k(s) = V πk (s). Similarly for π⋆ and the superscript ⋆. Exact PMD iteratively applies update (4) for some sequence of step-sizes ηk > 0 and initial policy π0 ∈ rint Π. We call this algorithm exact because we assume access to the true state-action values Qk. PMD is a general family that covers many algorithms, specified by the choice of mirror map h. These will inherit the guarantees of PMD, which motivates the study of the convergence guarantees of PMD beyond specific instances. Taking h to be the negative entropy yields NPG, whose theoret- ical properties have attracted a lot of interest (Agarwal et al., 2021; Cen et al., 2021; Khodadadian et al., 2021). With a null Bregman Divergence, PMD recovers PI. PI is generated by a constant mir- ror map, which is not of Legendre type but the analysis still applies so all results on PMD remain valid for PI. In fact, PMD can be viewed as a form of regularised PI since the update (4) converges to a PI update as ηk → ∞, regardless of the mirror map. Beyond these, providing mirror maps that generate other Bregman Divergences will lead to different algorithms. In particular, every expo- nential family has a corresponding mirror map generating a unique Bregman Divergence (Banerjee et al., 2005), highlighting the generality of PMD. 4. Main results for exact policy mirror descent In this section, we present our main results on the convergence of exact PMD. We first introduce some relevant notation. Fix a state s ∈ S and an integer k ≥ 0. Let Ak s = {a ∈ A : Qk(s, a) = maxa′∈AQk(s, a′)} denote the set of optimal actions in state s under policy πk. Denote by (cid:101)Πk+1 s the set of greedy policies w.r.t Qk . We are now ready to state our main result in the setting of exact PMD, which is proved in Section 6. (cid:110) p ∈ ∆(A) : (cid:80) s in state s, i.e (cid:101)Πk+1 p(a) = 1 s = a∈Ak s (cid:111) Theorem 1 Let {ck}k∈Z≥0 be a sequence of positive reals. Consider applying iterative updates of (4) with π0 ∈ rint Π and step-sizes satisfying for all k ≥ 0, ηk ≥ (cid:110) 1 ck max s∈S min s ∈ (cid:101)Πk+1 (cid:101)πk+1 s Dh((cid:101)πk+1 s , πk s ) (cid:111) . Then we have for all k ≥ 0, ∥V ⋆ − V k∥∞ ≤ γk(cid:16) ∥V ⋆ − V 0∥∞ + γ−ici−1 (cid:17) . k (cid:88) i=1 (5) (6) Note that the step-size (5) is always finite. It may be unbounded when dom h is the policy space Π, but the iterates are then in the relative interior of Π and the step-size is well-defined. The sequence {ck}k∈Z≥0 plays an important role in both the step-size constraint (5) and the In particular, different choices will lead to different guarantees. We focus on ci = bound (6). γ2(i+1)c0 for some c0 > 0, giving a step-size with a geometrically increasing component. The resulting bound is ∥V ⋆ − V k∥∞ ≤ γk(cid:16) ∥V ⋆ − V 0∥∞ + c0 1 − γ (cid:17) , which converges linearly with the γ-rate, and matches the bounds of PI and VI as c0 goes to 0. PMD cannot do better as we will show in Theorem 2. We discuss other choices of {ck} in Appendix C. 7 JOHNSON PIKE-BURKE REBESCHINI Comparison to Xiao (2022): Linear convergence of unregularised PMD was first established by Xiao (2022) under a geometrically increasing step-size ηk = η0/γk. We discuss this step-size further and show the necessity of adaptivity to achieve the γ-rate in Section 4.2. Their rate of convergence is 1 − 1 θρ where θρ is an instance-dependent term defined as follows θρ = 1 1 − γ (cid:13) (cid:13) (cid:13) d⋆ ρ ρ (cid:13) (cid:13) (cid:13)∞ , where d⋆ ρ is the visitation distribution defined in (1) under an optimal policy and ρ is the starting-state distribution to which the bound applies, i.e the bound is on V ⋆(ρ)−V k(ρ). This θρ is at best γ when we use ρ to be the stationary distribution of the optimal policy. However, in this case, the guarantee only applies to states on the support of this stationary distribution and provides no guarantees for other states. In general, it is unclear how θρ may scale in a specific MDP. In particular, it is possible to construct an MDP where θρ scales linearly with the size of the state space |S| (Appendix G.1). Though this MDP is somewhat trivial, it nonetheless illustrates how θρ can easily be large leading to slow rates of convergence. It is also not straightforward to obtain convergence in individual states from the bound in Xiao (2022) due to the presence of ρ in the denominator of the mismatch coefficient in θρ. In contrast, we obtain the optimal γ-rate of convergence and our result holds in l∞-norm over all states so avoids having to deal with a starting-state distribution ρ altogether. This distribution mismatch coefficient commonly appears in convergence bounds in the litera- ture (Kakade and Langford, 2002; Scherrer, 2014; Bhandari and Russo, 2019; Shani et al., 2020; Agarwal et al., 2021), both under exact and inexact policy evaluation. For many of these papers mentioned, removing it would be of great interest though often does not appear possible. Our re- sults show that it is removable for the general family of PMD algorithms to obtain dimension-free linear convergence. The techniques we use may be of interest for removing this coefficient in other settings. Comparison to Khodadadian et al. (2021): The γ-rate was established by Khodadadian et al. (2021) for NPG, a specific instance of PMD for which the Bregman Divergence is the KL-divergence. The bound shown in their work is similar to the one implied by our result with ci = γ2(i+1)c0. Defin- ing ∆k(s) = maxa∈AQk(s, a) − maxa /∈Ak Qk(s, a), the minimal sub-optimality gap in state s under πk, then the step-size corresponding to their bound with the KL as Bregman Divergence is s ηk ≥ maxs,(cid:101)πk+1 s ∈ (cid:101)Πk+1 s (cid:110)(cid:16) Lk + log|A| + D((cid:101)πk+1 s , πk s ) (cid:17) 1 ∆k(s) (cid:17)(cid:111) , where Lk = Lk for some constant L > 0. This highlights the connection with our step-size condi- tion (5). In particular, they both have an adaptive component that depends linearly on the Bregman divergence between the current policy and the greedy policy and a non-adaptive component on which the bound depends. An important difference is that our step-size is independent of the sub- optimality gap ∆k(s), and will be robust to situations where this gap is small. We can construct a general family of MDPs for which we can make ∆k(s) arbitrarily small and the step-size of Kho- dadadian et al. (2021) will correspondingly become arbitrarily large (Appendix G.2). Despite the apparent similarities with our results, their analysis is significantly different to ours as it exploits the specific closed-form update of NPG to bound the difference in value with an update of PI. Our anal- ysis applies to PMD for a general mirror map (not just NPG) and as such does not utilize specific properties of the mirror map and does not require the analytic solution of the update to be known. Our analysis also easily extends to inexact PMD (see Section 5), which their's does not. 8 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT 4.1. Optimality of PMD We have established in Theorem 1 that PMD achieves a linear γ-rate. The following result shows that this rate is in fact optimal in a worst-case sense. The proof can be found in Appendix D. Theorem 2 Fix n > 0 and δ ∈ (0, (1 − γ)γn). There exists a class of MDPs parameterised by δ with state-space of size |S| = 2n + 1 and a policy π0 ∈ rint Π such that running iterative updates of (4) for any positive step-size regime, we have for k < n: ∥V ⋆ − V k∥∞ ≥ γk∥V ⋆ − V 0∥∞ − 2δ 1 − γ . (7) A key feature of this result is that the bound holds for k < n. For a fixed iteration budget, Theorem 2 implies that there exists an MDP on which PMD will not do better than the linear γ-rate for any step-size. The γ-rate for PMD that we prove in Theorem 1 is optimal in this sense. For MPDs with a fixed state-space size |S| = 2n + 1, it is not known what lower-bound holds when k ≥ n. However, PI is an instance of PMD (see Section 3.1) and thus a lower bound that scales with γk for all k > 0 cannot hold since PI converges exactly in finite-iterations (in fact with a number of iterations that scales linearly with the size of the state space (Scherrer, 2013)). To the best of our knowledge, this lower bound on the value convergence of PMD scaling with γk is new. We expect this result may have been known for the special case of PI, though we could not find a proof of it in the literature. The works that establish a lower bound for PI do so in the setting of exact convergence to the optimal policy (Hollanders et al., 2012), not ε-accurate convergence, and for undiscounted MDPs (Fearnley, 2010). There have been some results on the super-linear convergence of NPG in the literature, though these apply once you have a policy within some neighbourhood of the optimal policy or value. Cen et al. (2021) establish such a result for NPG in the regularised case, and Khodadadian et al. (2021) in the unregularised case under certain additional conditions. Theorem 2 does not contradict this latter result as for the MDP considered in the proof, the super-linear convergence would kick-in for iterations beyond the k < n considered here. Lower-bound for general PG methods: The lower bound of Theorem 2 in fact applies to any algorithm that at each iteration increases the probability of the current greedy action. The greedy action is the action with highest action-value for the current policy. This covers algorithms more general than PMD and in particular, includes the vanilla PG algorithm. 4.2. Adaptive step-size necessity We have established in Theorem 1 that PMD under an adaptive step-size achieves a linear γ-rate and in Theorem 2 that this rate is optimal for PMD. We now show the adaptivity is in fact necessary to achieve the γ-rate. This strengthens the notion of optimality from the previous section - both the rate and step-size are unimprovable. The proof can be found in Appendix E. Theorem 3 Fix n > 0 and γ > 0.2. There exists an MDP with state-space of size |S| = 2n + 1 and a policy π0 ∈ rint Π such that running iterative updates of NPG (PMD with h as the negative entropy) that satisfy ∥V ⋆ − V k∥∞ ≤ γk(∥V ⋆ − V 0∥∞ + 1−γ si )/2γki ηki ≥ KL( ̃πki+1 for i = 1, ..., n s.t k1 < k2 < ... < kn where {s1, ..., sn} are states of the considered MDP. 8 ) requires , πki (8) si 9 JOHNSON PIKE-BURKE REBESCHINI This theorem states that there are at least n iterations with n distinct states where the step-size has to be bigger than a quantity depending on the Bregman divergence between the current policy and it's greedy policy in the considered state in order to achieve a linear γ-rate. This is precisely the notion of adaptivity that appears in the step-size condition of Theorem 1 and Khodadadian et al. (2021). Theorem 3 shows we cannot improve on this in general and provides justification for using an adaptive step-size instead of the one from Xiao (2022). The step-size of Xiao (2022) also requires the initial policy to be uniform in order to control the multiplicative factors in the bound through η0. Our step-size has more flexibility on the initial policy, which can be any policy in rint Π. Beyond its necessity, the adaptivity of our step-size can be a strength: it is large when needed, small when not. 5. Sample complexity of inexact policy mirror descent under generative model In the previous sections, we have assumed access to the action values Qk update. In Inexact PMD (IPMD), we replace Qk s with an estimate (cid:98)Qk s giving the update s to carry out the PMD πk+1 s = argminp∈∆(A) (cid:110) − ηk⟨ (cid:98)Qk s , ps⟩ + Dh(ps, πk s ) (cid:111) . (9) Similarly to the exact case, IPMD iteratively applies update (9) for some sequence of ηk > 0 and initial policy π0 ∈ rint Π, this time only assuming access to an inexact estimator of Qk. We consider the setting of a generative model (Kearns and Singh, 1998), which is a sampling model where we can draw samples from the transition probabilities p(*|s, a) for any pair (s, a). We borrow an estimator common in the literature (see e.g. Xiao (2022), Lazaric et al. (2016)): for all state-actions pairs (s, a), draw Mk trajectories of length or horizon H, i.e samples of the H−1)(cid:1) form (cid:0)(s(i) t ), s(i) 0 ), (s(i) 0 , a(i) 1 , a(i) t+1 , a(i) is drawn from p(*|s(i) t ) = (s, a). Using these samples, we can do a truncated t Monte-Carlo estimate of the values as follows, 1 ), ..., (s(i) t ) and (s(0) is drawn from πk(*|s(i) H−1, a(i) , a(0) , where a(i) t i=1,...,Mk t (cid:98)Qk(s, a) = 1 Mk Mk(cid:88) i=1 (cid:98)Qk (i)(s, a), where (cid:98)Qk (i)(s, a) = H−1 (cid:88) t=0 γtr(s(i) t , a(i) t ). (10) We use these (cid:98)Qk(s, a) to replace Qk(s, a) in the PMD update step. Xiao (2022) present a bound on the accuracy of this estimator which is restated in Appendix F. Following the same ideas as Xiao (2022), we can extend Theorem 1 to the inexact setting. The following theorem establishes a sample complexity result, which is the sufficient number of calls to the generative model to obtain an ε-optimal policy. For simplicity, we focus on the step-size following from the choice ci = γ2(i+1). s and (cid:101)Πk+1 Theorem 4 Consider applying iterative updates of (9) using the Q-estimator in (10) given access to a generative model with π0 ∈ rint Π and step-sizes satisfying for all k ≥ 0 (with the definitions s instead of Qk of Ak s ), D((cid:101)πk+1 (cid:110) s γ2k+1 suitably adjusted with (cid:98)Qk ηk ≥ max s∈S , πk s ) (cid:111) . s min s ∈ (cid:101)Πk+1 (cid:101)πk+1 s Fix ε > 0. For any δ ∈ (0, 1), suppose the following are satisfied for all k ≥ 0, K > 1 1 − γ log 4 (1 − γ)ε , H ≥ 1 1 − γ log 16 (1 − γ)3ε and Mk = M ≥ γ−2H 2 log 2K|S||A| δ . 10 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT Then with probability at least 1 − δ, ∥V ⋆ − V k∥∞ ≤ γk(cid:16) (1−γ)3 γH < ε. Choosing K, H and M to be tight to their lower-bounds, the corresponding sample complexity is ̃O , where the notation ̃O() hides poly-logarithmic factors. ∥V ⋆ − V 0∥∞ + 1 1−γ + 8 (cid:17) (cid:17) (cid:16) |S||A| (1−γ)8ε2 The proof can be found in Appendix F.1. The sample complexity established by Xiao (2022) (Theorem 16) under a generative model and the same Q-estimator is ̃O (cid:16) |S||A| (1−γ)8ε2 (cid:13) (cid:13) (cid:13) d⋆ ρ ρ (cid:13) 3 (cid:13) (cid:13) ∞ (cid:17) . In their work, Xiao (2022) stresses the interest in reducing the dependence on 1/(1 − γ) and the distribution mismatch coefficient in order to scale PMD guarantees to more relevant settings such as function approximation. Theorem 4 partially resolves this matter by removing the dependence on the distribution mismatch coefficient, which may scale with the size of the state space (Appendix G.1). This makes the result fully dimension independent, which is crucial when scaling the results to large or infinite state or action spaces. The dependence on 1/(1 − γ) remains distant from the 1/(1 − γ)3 lower-bound of Azar et al. (2013) (see Section 2). Whether this can be reached by PMD methods remains open, though using a more suitable Q-estimator than (10) with our step size regime and analysis could bring the sample complexity closer to this. 6. Analysis In this section, we present the proof of Theorem 1. A key component in establishing the γ-rate is avoiding the performance difference lemma that we state in Appendix B. In prior works, the quantity that we are looking to bound V ⋆(ρ) − V k(ρ) arises through the performance difference lemma. In particular, Xiao (2022) use the lemma on Es∼d⋆ ⟩], which introduces a distribution mismatch coefficient in order to get a recursion. On the other hand, we extract the value sub-optimalities V ⋆(s) − V k(s) and ∥V ⋆ − V k+1∥∞ directly from ⟨Qk ⟩ in (12). This leads to an elegant analysis that may be of interest in the study of other methods, and ultimately allows us to remove distribution mismatch factors and obtain an exact γ-rate. Proof of Theorem 1: Fix s ∈ S and k ≥ 0. From Lemma 6, we have that ⟨Qk ⟨Qk+1 s of the ingredients that allows us to bypass the performance difference lemma. Using this, ⟩ ≤ ⟩ = V k+1(s). This decouples the dependencies on πk and πk+1 below and is one s − πk+1 s s − πk+1 s s , πk+1 s , πk+1 s ρ[⟨Qk s , π⋆ s , π⋆ ⟨Qk s , π⋆ s − πk+1 s ⟩ ≥ ⟨Qk s , π⋆ s ⟩ − V k+1(s) = ⟨Qk s − Q⋆ s, π⋆ s − Qk s ⟩ + ⟨Q⋆ s ⟩ − V k+1(s) s, π⋆ s ∥∞ + V ⋆(s) − V k+1(s), ≥ −∥Q⋆ (11) where the last step uses H ̈older's inequality. Now we use that the difference in state-action values of different policies for the same state-action pair propagates the error to the next time-step, which is discounted by a factor of γ. Formally, for any state-action pair (s, a) ∈ S × A, Q⋆(s, a) − Qk(s, a) = γ ≤ γ (cid:88) s′ (cid:88) s′ p(s′|s, a)(V ⋆(s′) − V k(s′)) p(s′|s, a)∥V ⋆ − V k∥∞ = γ∥V ⋆ − V k∥∞, which is the same phenomenon that is responsible for the contraction of the Bellman operator. This gives ∥Q⋆ s − Qk s ∥∞ ≤ γ∥V ⋆ − V k∥∞. Plugging into Equation (11), s , π⋆ V ⋆(s) − V k+1(s) − γ∥V ⋆ − V k∥∞ ≤ ⟨Qk s − πk+1 s ⟩. 11 JOHNSON PIKE-BURKE REBESCHINI The rest of the proof relies on making the right-hand side of the above arbitrarily small by taking a large enough step size. Choose any greedy policy with respect to Qk , ∈ (cid:101)Πk+1 s V ⋆(s) − V k+1(s) − γ∥V ⋆ − V k∥∞ ≤ ⟨Qk ≤ ⟨Qk ⟩ (12) (13) s s , (cid:101)πk+1 s − πk+1 ⟩ s s − πk+1 s , π⋆ s , (cid:101)πk+1 s where we use that (cid:101)πk+1 s is greedy with respect to Qk ⟨Qk s , (cid:101)πk+1 s − πk+1 s D((cid:101)πk+1 s ⟩ ≤ , πk s ) − D((cid:101)πk+1 ηk s s . We then apply Lemma 5 or (16) to p = (cid:101)πk+1 , πk+1 s ) − D(πk+1 , πk s ) s s , ≤ D((cid:101)πk+1 s , πk s )/ηk. Combining with (13) and noting that this holds for any (cid:101)πk+1 s ∈ (cid:101)Πk+1 s , we have V ⋆(s) − V k+1(s) − γ∥V ⋆ − V k∥∞ ≤ 1 ηk min s ∈ (cid:101)Πk+1 (cid:101)πk+1 s D((cid:101)πk+1 s , πk s ) ≤ ck from the step-size condition in the statement of the theorem. Rearranging and recalling that s and k were arbitrary, we can choose s where V ⋆(s) − V k+1(s) reaches its maximum value. We get ∥V ⋆ − V k+1∥∞ ≤ γ∥V ⋆ − V k∥∞ + ck, and unravelling this recursion completes the proof. ■ 7. Conclusion In this paper, we have shown that the general family of exact policy mirror descent algorithms in tabular MDPs under an adaptive step-size match the dimension-free linear γ-rate of convergence of classical algorithms such as policy iteration. We provide matching lower-bounds that establish this rate as optimal for PMD and the adaptive step-size as necessary. We exploit a new approach to study the convergence of PMD, for which avoiding the performance difference lemma is a key element. Though the focus of our work is on the exact policy evaluation setting, the analysis naturally extends to the inexact setting, given access to an estimator of the action-value of a policy. We provide a result for a simple estimator under a generative model that improves upon the best-known sample complexity, although it still does not match the lower bound. Our method is general and applies to any estimator, meaning our result could be improved by a better estimator. Exploiting further algorithmic properties of PMD in the inexact setting may be needed to bridge the gap to the optimal sample complexity, and determine if PMD can match the lower bound. 12 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT References Alekh Agarwal, Sham Kakade, and Lin F. Yang. Model-based reinforcement learning with a gener- ative model is minimax optimal. In Proceedings of Thirty Third Conference on Learning Theory, volume 125 of Proceedings of Machine Learning Research, pages 67–83. PMLR, 2020. Alekh Agarwal, Sham M. Kakade, Jason D. Lee, and Gaurav Mahajan. On the theory of policy gra- dient methods: Optimality, approximation, and distribution shift. Journal of Machine Learning Research, 22(98):1–76, 2021. Mohammad Gheshlaghi Azar, R ́emi Munos, and Hilbert Kappen. Minimax PAC bounds on the sample complexity of reinforcement learning with a generative model. Machine Learning, 91(3): 325–349, 2013. Arindam Banerjee, Srujana Merugu, Inderjit S. Dhillon, and Joydeep Ghosh. Clustering with breg- man divergences. Journal of Machine Learning Research, 6(58):1705–1749, 2005. Amir Beck and Marc Teboulle. Mirror descent and nonlinear projected subgradient methods for convex optimization. Operations Research Letters, 31(3):167–175, 2003. Richard Bellman. Dynamic Programming. Dover Publications, 1957. Jalaj Bhandari and Daniel Russo. Global optimality guarantees for policy gradient methods. 2019. Preprint, arXiv: 1906.01786. Jalaj Bhandari and Daniel Russo. On the linear convergence of policy gradient methods for fi- nite mdps. In Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pages 2386–2394. PMLR, 2021. S ́ebastien Bubeck. Convex optimization: Algorithms and complexity. Foundations and Trends in Machine Learning, 8(3-4), 2015. Shicong Cen, Chen Cheng, Yuxin Chen, Yuting Wei, and Yuejie Chi. Fast Global Convergence of Natural Policy Gradient Methods with Entropy Regularization. Operations Research, 70(4): 2563–2578, 2021. Gong Chen and Marc Teboulle. Convergence Analysis of a Proximal-Like Minimization Algorithm Using Bregman Functions. SIAM Journal on Optimization, 3(3):538–543, 1993. Zaiwei Chen and Siva Theja Maguluri. Sample complexity of policy-based methods under off- In Proceedings of The 25th International policy sampling and linear function approximation. Conference on Artificial Intelligence and Statistics, volume 151 of Proceedings of Machine Learning Research, pages 11195–11214. PMLR, 2022. John Fearnley. Exponential lower bounds for policy iteration. In Automata, Languages and Pro- gramming, pages 551–562, 2010. Matthieu Geist, Bruno Scherrer, and Olivier Pietquin. A theory of regularized Markov decision processes. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 2160–2169. PMLR, 2019. 13 JOHNSON PIKE-BURKE REBESCHINI Romain Hollanders, Jean-Charles Delvenne, and Rapha ̈el M. Jungers. The complexity of policy iteration is exponential for discounted markov decision processes. In 51st IEEE Conference on Decision and Control (CDC), pages 5997–6002, 2012. Sham Kakade and John Langford. Approximately Optimal Approximate Reinforcement Learning. In Proceedings of the 19th International Conference on Machine Learning, volume 2, pages 267– 274, 2002. Sham M Kakade. A natural policy gradient. In Advances in Neural Information Processing Systems, volume 14. MIT Press, 2001. Michael Kearns and Satinder Singh. Finite-sample convergence rates for q-learning and indirect In Advances in Neural Information Processing Systems, volume 11. MIT Press, algorithms. 1998. Sajad Khodadadian, Prakirt Raj Jhunjhunwala, Sushil Mahavir Varma, and Siva Theja Maguluri. In 60th IEEE Conference on On the linear convergence of natural policy gradient algorithm. Decision and Control (CDC), pages 3794–3799, 2021. Vijay Konda and John Tsitsiklis. Actor-critic algorithms. In Advances in Neural Information Pro- cessing Systems, volume 12. MIT Press, 1999. Guanghui Lan. Policy Mirror Descent for Reinforcement Learning: Linear Convergence, New Sampling Complexity, and Generalized Problem Classes. Mathematical Programming, 2021. Alessandro Lazaric, Mohammad Ghavamzadeh, and R ́emi Munos. Analysis of classification-based policy iteration algorithms. Journal of Machine Learning Research, 17(19):1–30, 2016. Gen Li, Yuting Wei, Yuejie Chi, Yuantao Gu, and Yuxin Chen. Breaking the sample size barrier in model-based reinforcement learning with a generative model. In Advances in Neural Information Processing Systems, volume 33, pages 12861–12872. Curran Associates, Inc., 2020. Yan Li, Guanghui Lan, and Tuo Zhao. Homotopic policy mirror descent: Policy convergence, implicit regularization, and improved sample complexity. 2022. Preprint, arXiv: 2201.09457. Yanli Liu, Kaiqing Zhang, Tamer Basar, and Wotao Yin. An improved analysis of (variance- reduced) policy gradient and natural policy gradient methods. In Advances in Neural Information Processing Systems, volume 33, pages 7624–7636. Curran Associates, Inc., 2020. Martin L. Puterman. Markov Decision Processes: Discrete Stochastic Dynamic Programming. Wiley Series in Probability and Statistics. Wiley, 1994. R. Tyrrell Rockafellar. Convex Analysis. Princeton Landmarks in Mathematics and Physics. Prince- ton University Press, 1970. Bruno Scherrer. Improved and generalized upper bounds on the complexity of policy iteration. In Advances in Neural Information Processing Systems, volume 26. Curran Associates, Inc., 2013. Bruno Scherrer. Approximate policy iteration schemes: A comparison. In Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pages 1314–1322. PMLR, 2014. 14 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT Lior Shani, Yonathan Efroni, and Shie Mannor. Adaptive trust region policy optimization: Global convergence and faster rates for regularized mdps. Proceedings of the AAAI Conference on Arti- ficial Intelligence, 34(04):5668–5675, 2020. Aaron Sidford, Mengdi Wang, Xian Wu, Lin Yang, and Yinyu Ye. Near-optimal time and sample In Advances in complexities for solving markov decision processes with a generative model. Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, second edition, 2018. Richard S Sutton, David McAllester, Satinder Singh, and Yishay Mansour. Policy gradient methods In Advances in Neural Information for reinforcement learning with function approximation. Processing Systems, volume 12. MIT Press, 1999. M. J. Wainwright. Variance-reduced Q-learning is minimax optimal. Technical report, UC Berkeley, 2019. Preprint, arxiv:1906.04697. Lin Xiao. On the convergence rates of policy gradient methods. Journal of Machine Learning Research, 23(282):1–36, 2022. Rui Yuan, Robert M. Gower, and Alessandro Lazaric. A general sample complexity analysis of vanilla policy gradient. In Proceedings of The 25th International Conference on Artificial Intel- ligence and Statistics, volume 151 of Proceedings of Machine Learning Research, pages 3332– 3380. PMLR, 2022. Wenhao Zhan, Shicong Cen, Baihe Huang, Yuxin Chen, Jason D Lee, and Yuejie Chi. Policy mirror descent for regularized reinforcement learning: A generalized framework with linear con- vergence. 2021. Preprint, arXiv: 2105.11066. 15 JOHNSON PIKE-BURKE REBESCHINI Appendix A. Properties of PMD We present lemmas relevant to the analysis of PMD. Key to the analysis is the Three-Point Descent Lemma, that relates the improvement of the proximal gradient update compared to an arbitrary point. It originally comes from Chen and Teboulle (1993) (Lemma 3.2) where a proof can be found, though we use a slightly modified version from Xiao (2022) (Lemma 6). Lemma 5 (Three-Point Descent Lemma, Lemma 6 in Xiao (2022)) Suppose that C ⊂ Rn is a closed convex set, φ : C → R is a proper, closed convex function, Dh(*, *) is the Bregman divergence generated by a function h of Legendre type and rint domh ∩ C ̸= ∅. For any x ∈ rint domh, let x+ = argminu∈C{φ(u) + Dh(u, x)}. Then x+ ∈ rint dom h ∩ C and ∀u ∈ C, φ(x+) + Dh(x+, x) ≤ φ(u) + Dh(u, x) − Dh(u, x+) (14) (15) The update (4) of PMD is an instance of the proximal minimisation (14) with C = ∆(A), s , x⟩. Plugging these into (15), Lemma 5 relates the decrease in the s and φ(x) = −ηk⟨Qk x = πk proximal objective of πk+1 s to any other policy, i.e. ∀p ∈ ∆(A), −ηk⟨Qk s , πk+1 s ⟩ + Dh(πk+1 s , πk s ) ≤ −ηk⟨Qk s , p⟩ + Dh(p, πk s ) − Dh(p, πk+1 s ). (16) This equation is key to the analysis in Section 6. In particular, it allows us to prove the following lemma regarding the monotonic improvement in action-value of PMD iterates. This is an extension of Lemma 7 in Xiao (2022). Lemma 6 Consider the policies produced by the iterative updates of PMD in (4). Then for any k ≥ 0, Qk+1(s, a) ≥ Qk(s, a), ∀(s, a) ∈ S × A. A.1. Proof of Lemma 6 We first present Lemma 7 from Xiao (2022), from which Lemma 6 almost immediately follows. Lemma 7 (Descent Property of PMD, Lemma 7 in Xiao (2022)) Consider the policies produced by the iterative updates of PMD in (4). Then for any k ≥ 0 ⟨Qk s , πk+1 s − πk s ⟩ ≥ 0, ∀s ∈ S, V k+1(ρ) ≥ V k(ρ), ∀ρ ∈ ∆(S). Proof From Xiao (2022). Recall that the Three-Point Descent Lemma states that ∀p ∈ ∆(A), −ηk⟨Qk s , πk+1 s ⟩ + Dh(πk+1 s Using this with p = πk s , , πk s ) ≤ −ηk⟨Qk s , p⟩ + Dh(p, πk s ) − Dh(p, πk+1 s ). Dh(πk s , πk+1 s ) + Dh(πk+1 s , πk s ) ≤ ηk⟨Qk s , πk+1 s − πk s ⟩ 16 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT and since the Bregman divergences are none-negative and ηk > 0, 0 ≤ ⟨Qk s , πk+1 s − πk s ⟩ and the result follows by an application of the performance difference lemma (Appendix B) V k+1(ρ) − V k(ρ) = 1 1 − γ (cid:104) E s∼dk+1 ρ ≥ 0. ⟨Qk (cid:105) s − πk s ⟩ s , πk+1 Note that we use the performance difference lemma here because it gives a simple concise proof, but we do not actually need to. To maintain our claim that we avoid the use of the performance difference lemma, we can get the same result without it. We sketch how to do this as follows. From the first part of the lemma, we have ⟨Qk s , πk+1 s ⟩ ≥ ⟨Qk s , πk s ⟩ = V k(s), in all states s. Now note that the left hand side above is ⟨Qk s , πk+1 s ⟩ = = (cid:88) a (cid:88) a πk+1(a|s)Qk(s, a) (cid:16) πk+1(a|s) r(s, a) + γ p(s′|s, a)V k(s′) (cid:17) (cid:88) s′ and we can then apply ⟨Qk s′, πk+1 s′ ⟩ ≥ V k(s′) at state s′: V k(s) ≤ ≤ πk+1(a|s) πk+1(a|s) (cid:16) (cid:16) (cid:88) a (cid:88) a r(s, a) + γ (cid:88) (cid:17) p(s′|s, a)V k(s′) r(s, a) + γ s′ (cid:88) s′ p(s′|s, a) (cid:88) a′ πk+1(a′|s′) (cid:16) r(s′, a′) + γ p(s′′|s′, a′)V k(s′′) (cid:17)(cid:17) (cid:88) s′′ and as proceed iteratively in the limit you get exactly V k+1(s). Since Lemma 7 holds for any ρ ∈ ∆(S), it guarantees that the value in each state is non- decreasing for an update of PMD, i.e for all s ∈ S, V k+1(s) − V k(s) ≥ 0. Using this, we get Qk+1(s, a) − Qk(s, a) = γ (cid:88) (cid:16) p(s′|s, a) V k+1(s′) − V k(s′) (cid:17) ≥ 0, which concludes the proof. s′∈S 17 ■ JOHNSON PIKE-BURKE REBESCHINI A.2. Extension of Lemma 6 to inexact setting: As in the exact case, we first present Lemma 12 from Xiao (2022) which is the extension of Lemma 7 to the inexact case. We note that in the inexact case, we lose the monotonic increase of values due to the inaccuracy in our estimate (cid:98)Qk of Qk s . Lemma 8 Consider the policies produced by the iterative updates of IPMD in (9). For any k ≥ 0, if ∥ (cid:98)Qk s ∥∞ ≤ τ , then s − Qk ⟨ (cid:98)Qk s , πk+1 s − πk V k+1(ρ) ≥ V k(ρ) − s ⟩ ≥ 0, 2τ 1 − γ ∀s ∈ S, , ∀ρ ∈ ∆(S). Proof From Xiao (2022). The Three-Point Descent Lemma applied to the IPMD update (9) gives ∀p ∈ ∆(A), −ηk⟨ (cid:98)Qk s , πk+1 s ⟩ + Dh(πk+1 s Using this with p = πk s , , πk s ) ≤ −ηk⟨ (cid:98)Qk s , p⟩ + Dh(p, πk s ) − Dh(p, πk+1 s ). Dh(πk s , πk+1 s ) + Dh(πk+1 s , πk s ) ≤ ηk⟨ (cid:98)Qk s , πk+1 s − πk s ⟩ and since the Bregman divergences are none-negative and ηk > 0, 0 ≤ ⟨ (cid:98)Qk s , πk+1 s − πk s ⟩, which proves the first inequality. Now we cannot use the above inequality directly with the perfor- mance difference lemma since (cid:98)Qk s is not the true action-value. Instead, we have V k+1(ρ) − V k(ρ) = = ≥ ≥ E E 1 1 − γ 1 1 − γ 1 1 − γ 1 1 − γ 2τ 1 − γ E E = − (cid:104) ⟨Qk s , πk+1 s − πk s ⟩ (cid:105) s∼dk+1 ρ (cid:104) ⟨Qk s∼dk+1 ρ s∼dk+1 ρ (cid:104) (cid:104) − ∥Qk s − (cid:98)Qk (cid:105) s∼dk+1 ρ − 2τ s − (cid:98)Qk s , πk+1 s − πk s ⟩ + ⟨ (cid:98)Qk s − πk s ⟩ (cid:105) s , πk+1 (cid:105) s ∥∞∥πk+1 s − πk s ∥1 which concludes the proof. Using the above lemma, we can state and prove the extension of Lemma 6 to the inexact setting. Lemma 9 Consider the policies produced by the iterative updates of IPMD in (9). For any k ≥ 0, if ∥ (cid:98)Qk s ∥∞ ≤ τ , then s − Qk (cid:98)Qk+1(s, a) ≥ (cid:98)Qk(s, a) − 2τ γ 1 − γ , ∀(s, a) ∈ S × A. 18 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT Proof As in the exact case, since Lemma 8 holds for any ρ ∈ ∆(S), it applies to each state, i.e for all s ∈ S, V k+1(s) − V k(s) ≥ − 2τ 1 − γ . Using this, we immediately have Qk+1(s, a) − Qk(s, a) = γ (cid:88) (cid:16) p(s′|s, a) V k+1(s′) − V k(s′) s′∈S (cid:17) ≥ −2τ γ 1 − γ , which concludes the proof. Appendix B. Performance difference lemma Lemma 10 (Performance Difference Lemma) For any π, π′ ∈ Π, we have V π(ρ) − V π′ (ρ) = 1 1 − γ (cid:104) Es∼dπ ρ ⟨Qπ′ s , πs − π′ s⟩ (cid:105) . The performance difference lemma (Kakade and Langford, 2002) is a property that relates the difference in values of policies to the policies themselves. The proof can be found in their paper under Lemma 6.1. Appendix C. Guarantees of Theorem 1 for various step-size choices We give here two more choices of {ck}k∈Z≥0 for the step-size 5 of PMD and their corresponding guarantees from Theorem 1: • ci = c0 for some c0 > 0 yields a step-size with a constant component. The resulting bound is ∥V ⋆ − V k∥∞ ≤ γk∥V ⋆ − V 0∥∞ + c0 1 − γ , which converges linearly up to some accuracy controlled by c0. • ci = γi+1c0 for some initial c0 > 0 will yield a step-size with a component that is geometri- cally increasing as in Xiao (2022), though at a slower rate than the one discussed in Section 4. The resulting bound is ∥V ⋆ − V k∥∞ ≤ γk(cid:16) ∥V ⋆ − V 0∥∞ + kc0 (cid:17) , which converges linearly with the sought-for γ-rate, though in early iterations the k factor may dominate. 19 JOHNSON PIKE-BURKE REBESCHINI Figure 1: Example MDP used in the proof of Theorem 2 Appendix D. Proof of Theorem 2 1, ..., sn, s′ Fix n > 0 and δ ∈ (0, (1 − γ)γn). Consider the MDP shown in Figure 1. The state space is S = {s0, s1, s′ n} and the action space is A = {a1, a2}. There is a chain of states of length n + 1 with the states indexed from 0 to n. The left-most state (s0) is absorbing with reward +1. In the other states in the chain (si for i = 1, ..., n), the agent can take action a1 and move left (to si−1) with reward of 0, or take action a2 and move to an additional absorbing state unique to the i) with reward ri = γi+1 + δ (that the agent also receives in that state for all state it is currently in (s′ future time-steps). Summarising, we have for 1 ≤ i ≤ n p(si−1|si, a1) = 1, p(s′ i|si, a2) = 1, i|s′ p(s′ i, a) = 1, r(si, a1) = 0, r(si, a2) = ri = γi+1 + δ, r(s′ i, a) = ri = γi+1 + δ ∀a ∈ A. The value of δ is carefully restricted so that the optimal action in all the states of the chain is a1. The proof will consist in showing that if the agent starts with an initial policy that places most probability mass on the sub-optimal action a2, then it has to learn that a1 is the optimal action in the state directly to the left before it can start switching from action a2 to a1 in the current state. And this can at best happen one iteration at a time starting starting from the left-most state. In particular, we consider π0 s.t π0(a1|s) = α, π0(a2|s) = 1 − α for all states and some α s.t 0 < α ≤ δ(1 − γ). We make the following claim from which the result will follow straightforwardly. Claim: Fix k < n. The policies produced by PMD satisfy πk(a1|si) ≤ α for k < i ≤ n. We prove this claim by induction. Base Case: We want to show that π1(a1|si) ≤ α for i > 1. We do this by showing that Q0(si, a1) ≤ Q0(si, a2) for i > 1 so that the probability of π1(a1|si) cannot increase w.r.t π0(a1|si), which is α 20 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT (this follows from ⟨Qk s , πk+1 s − πk s ⟩ ≥ 0 for all iterations of PMD). We have: Q0(si, a1) = γV 0(si−1) (cid:16) (cid:17) αQ0(si−1, a1) + (1 − α)Q0(si−1, a2) = γ (cid:16) α ≤ γ γi−1 1 − γ (cid:16) (a) ≤ γ δ(1 − γ) (cid:17) + ri−1 1 − γ γi−1 1 − γ + γi + δ 1 − γ δγ(1 + γi−1 − γi) 1 − γ (cid:17) = + γi+1 1 − γ γi+1 1 − γ = Q0(si, a2), (b) ≤ + δ 1 − γ where we used α ≤ δ(1 − γ) in (a) and γ(1 + γi−1 − γi) < 1 for γ ∈ [0, 1) in (b). This concludes the base case. Inductive Step: Now assume that the claim is true for k and we want to show that πk+1(a1|si) ≤ α for i > k + 1. We do this in the same way as the base case by showing that Qk(si, a1) ≤ Qk(si, a2) for i > k + 1 so that the probability of πk+1(a1|si) cannot increase w.r.t πk(a1|si), which is less than or equal to α by the inductive hypothesis. We have: Qk(si, a1) = γV k(si−1) (cid:16) (cid:17) πk(a1|si−1)Qk(si−1, a1) + πk(a2|si−1)Qk(si−1, a2) = γ (cid:16) (a) ≤ γ αQk(si−1, a1) + Qk(si−1, a2) (cid:17) (cid:16) α ≤ γ γi−1 1 − γ (cid:16) (b) ≤ γ δ(1 − γ) (cid:17) + ri−1 1 − γ γi−1 1 − γ (cid:17) + γi + δ 1 − γ δγ(1 + γi−1 − γi) 1 − γ + = γi+1 1 − γ γi+1 1 − γ = Qk(si, a2), (c) ≤ + δ 1 − γ where we used in (a) that πk(a1|si−1) ≤ α for i > k + 1, which is true by the inductive hypothesis since i − 1 > k, in (b) that α ≤ δ(1 − γ) and in (c) that γ(1 + γi−1 − γi) < 1 for γ ∈ [0, 1). This concludes the proof of the claim. 21 JOHNSON PIKE-BURKE REBESCHINI Now using the claim V k(sk+1) = πk(a1|sk+1)Qk(sk+1, a1) + πk(a2|sk+1)Qk(sk+1, a2) ≤ α = α γk+1 1 − γ γk+1 1 − γ + + rk+1 1 − γ γk+2 + δ 1 − γ , so V ⋆(sk+1) − V k(sk+1) ≥ = γk+1 1 − γ − α γk+1 1 − γ γk+1(1 − γ) 1 − γ − − γk+2 + δ 1 − γ αγk+1 + δ 1 − γ ≥ γk+1 − ≥ γk+1 − α + δ 1 − γ 2δ 1 − γ , (17) where we used that α ≤ δ. Now note that V 0(s1) = αQ0(s1, a1) + (1 − α)Q0(s1, a2) = α γ 1 − γ + (1 − α) γ2 + δ 1 − γ , so V ⋆(s1) − V 0(s1) = γ 1 − γ − α γ 1 − γ γ 1 − γ − (1 − α) γ2 + δ 1 − γ γ2 + δ 1 − γ = (1 − α) − (1 − α) = ≤ 1 − α 1 − γ 1 − α 1 − γ (cid:16) γ − γ2 − δ (cid:17) (cid:16) γ − γ2(cid:17) = γ (cid:16) 1 − α 1 − γ (cid:17) 1 − γ = γ(1 − α) ≤ γ and by induction we can show this is the case for all states (above is base case), the inductive step is as follows (assuming V ⋆(sk) − V 0(sk) ≤ γ), V ⋆(sk+1) − V 0(sk+1) = γk+1 1 − γ − (1 − α) γk+2 + δ 1 − γ − αγV 0(sk) (cid:105) (cid:104) + αγ V ⋆(sk) − V 0(sk) (cid:105) = (1 − α) (cid:104) γk+1 − γk+2 − δ 1 − γ ≤ (1 − α)γk+1 + αγ2 ≤ γ 22 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT and so which combining with (17) gives, ∥V ⋆ − V 0∥∞ ≤ γ, V ⋆(sk+1) − V k(sk+1) ≥ γk∥V ⋆ − V 0∥∞ − 2δ 1 − γ =⇒ ∥V ⋆ − V k∥∞ ≥ γk∥V ⋆ − V 0∥∞ − 2δ 1 − γ , which concludes the proof. ■ 23 JOHNSON PIKE-BURKE REBESCHINI Appendix E. Proof of Theorem 3 √ 8 and note that c < Consider the same MDP as in the proof of Theorem 2 in Appendix D (see Figure 1). Denote √ c = 1−γ γ √ Suppose you consider NPG updates with initial policy π0(a1|si) = α. Recall that NPG is the instance of PMD with relative entropy as the mirror map. It can be shown that NPG has the closed form update γ for γ > 0.2. since 1 1−γ 2 4 < γ √ 1+ 1+ γ πk+1(a|s) = πk(a|s)eηkQk(s,a) a′ πk(a′|s)eηkQk(s,a′) (cid:80) . We know from the proof of Theorem D that for any step-size regime, for i > k + 1 Qk(si, a1) ≤ Qk(si, a2). Now, ∥V ⋆ − V 0∥∞ = V ⋆(s1) − V 0(s1) ≤ γ − δ 1−γ (see Section E.1 below). The idea of the proof is to show that satisfying the bound given in the statement of the theorem will imply that a certain condition on the step-size. Fix a state sk and let k0 be the first iteration where Qk0(sk, a1) > Qk0(sk, a2). By the above, we must have k ≤ k0 + 1, or k0 ≥ k − 1. By the proof of Theorem D, we also have πk0(a1|sk) ≤ α (before iteration k0, Q(sk, *) favors a2, so πk0(a1|sk) has not increased compared to π0(a1|sk) = α). We want a γ-contraction at every iteration, i.e. we assume the following is satisfied: V ⋆(sk) − V k0+1(sk) ≤ γk0+1(∥V ⋆ − V 0∥∞ + c) ≤ γk0+1(γ − δ 1 − γ + c). Now, by direct computation, V ⋆(sk) − V k0+1(sk) = πk0+1(a1|sk)γ(V ⋆(sk−1) − V k0+1(sk−1)) + πk0+1(a2|s2) γk − rk 1 − γ ≥ πk0+1(a2|s2) γk − rk 1 − γ = πk0+1(a2|s2)(γk − δ 1 − γ ). Putting this together with the above (this is an implication as this is about the necessity rather than sufficiency), we must have: πk0+1(a2|s2)(γk − ) ≤ γk0+1(γ − δ 1 − γ + c) δ 1 − γ γk0+1(γ − δ (γk − δ 1−γ + c) 1−γ ) = β =⇒ πk0+1(a2|s2) ≤ If we choose δ < 1 2 (1 − γ)(1 − √ γ)γk then β < √ γ and require πk0+1(a2|s2) ≤ √ γ. 24 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT To see this, start from β ≤ √ γ, this is equivalent to √ γ ≤ √ γ since k0 + 1 ≥ k √ γ(γk − δ 1 − γ ) γk0+1(γ − δ (γk − δ 1−γ + c) 1−γ ) γk(γ − δ 1−γ + c) (γk − δ 1−γ ) δ 1 − γ ≤ + c) ≤ ⇐= ⇐⇒ γk(γ − ⇐= γk(γ + c) ≤ γ(γk − √ ⇐⇒ γk− 1 2 (γ + c) ≤ γk − ⇐⇒ ⇐= ⇐⇒ ⇐⇒ ⇐⇒ δ 1 − γ δ 1 − γ δ 1 − γ δ 1 − γ δ 1 − γ 1 2 ⇐⇒ δ ≤ ≤ γk− 1 2 ( √ γ − γ − c) ≤ γk− 1 2 ( √ γ − γ − ≤ γk− 1 2 ( √ γ − γ − ≤ γk− 1 2 ( √ γ − γ − ≤ γk− 1 2 ( √ γ 2 − γ 2 ) γk(1 − √ γ)(1 − γ), γ √ γ 1 − γ 2 √ (1 − γ)) + γ 2 ) 1 + √ γ 2 √ γ 2 δ 1 − γ δ 1 − γ ) √ ) since − c > − √ 1 + γ √ γ 1 − γ 2 which is the condition for δ we imposed initially. To achieve the above condition πk0+1(a2|s2) ≤ √ γ, recalling that πk0(a2|s2) ≥ 1 − α, ηk0 has to satisfy ηk0 ≥ 1 Qk0(sk, a1) − Qk0(sk, a2) (cid:104) log((1 − α)(1 − 25 √ γ)) + KL( ̃πk0+1 sk (cid:105) ) , πk0 sk JOHNSON PIKE-BURKE REBESCHINI To see this, again start from πk0+1(a2|s2) ≤ of notation) using the closed-form update of NPG: √ γ, this is equivalent to (use k0 = m for simplicity πm(a2|s2) exp(ηmQm(sk, a2)) ≤ √ γ(πm(a2|s2) exp(ηmQm(sk, a2)) + πm(a1|s2) exp(ηmQm(sk, a1))) 1 √ γ 1 − √ ≤ exp(ηm(Qm(sk, a1) − Qm(sk, a2))) exp(ηm(Qm(sk, a1) − Qm(sk, a2))) πm(a1|s2) πm(a2|s2) ≤ 1 + √ γ πm(a2|s2) πm(a1|s2) γ ⇐⇒ ⇐⇒ ⇐⇒ ηm(Qm(sk, a1) − Qm(sk, a2)) ≥ log (cid:16) 1 − √ (cid:16) 1 − √ log ⇐⇒ ηm ≥ =⇒ ηm ≥ =⇒ ηm ≥ 1 Qm(sk, a1) − Qm(sk, a2) 1 Qm(sk, a1) − Qm(sk, a2) 1 Qm(sk, a1) − Qm(sk, a2) (cid:104) (cid:104) (cid:104) (cid:16) (cid:16) log log √ γ γ √ γ γ (cid:17) πm(a2|s2) πm(a1|s2) (cid:17) πm(a2|s2) √ γ (cid:17) 1 − √ γ √ (cid:16) + log (cid:17)(cid:105) 1 πm(a1|s2) (cid:105) ) , πm sk (1 − α) + KL( ̃πm+1 sk (1 − α)(1 − (cid:17) γ) + KL( ̃πm+1 sk , πm sk (cid:105) ) . As we take α → 0, the KL term will dominate. In particular, note α < 1 − γ so 1 − α > γ and √ √ (1 − α)(1 − γ) > γ(1 − γ) and if we further impose the condition α < γ2(1 − √ γ)2 then (1 − α)(1 − √ γ) > √ α > (cid:113) πk0(a1|s2) and the step-size needs to satisfy the following condition: ηk0 ≥ = = 1 Qk0(sk, a1) − Qk0(sk, a2) 1 Qk0(sk, a1) − Qk0(sk, a2) (cid:104) (cid:104) (cid:113) log( πk0(a1|s2)) + KL( ̃πk0+1 sk (cid:105) ) , πk0 sk − 1 2 KL( ̃πk0+1 sk , πk0 sk ) + KL( ̃πk0+1 sk , πk0 sk (cid:105) ) 1 2(Qk0(sk, a1) − Qk0(sk, a2)) KL( ̃πk0+1 sk , πk0 sk ) (18) Distinct Iterations: Note that the iteration k0(sk) where Q(*, sk) starts becoming bigger at a1 that a2 is distinct for each sk. Fix any sk and k0 = k0(sk). We have Qk0(sk, a1) < Qk0(sk, a2) Qk0+1(sk, a2) ≤ Qk0+1(sk, a1) then πk0+1(a1|sk) ≤ πk0(a1|sk) ≤ α (since Qt points towards a2 in sk for all t ≤ k0). Then applying exactly the same steps as in the proof of Theorem 2, we have Qk0+1(sk+1, a1) < Qk0+1(sk+1, a2), 26 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT meaning that k0(sk) is disctinct to k0(sk+1). Upper Bounding Q-value difference: We want to upper-bound the Q-value difference appearing in the step-size condition above. We have, So, Qk0(sk, a2) = rk 1 − γ = γk+1 + δ 1 − γ Qk0(sk, a1) = γV k0(sk−1) ≤ γk 1 − γ . Qk0(sk, a1) − Qk0(sk, a2) ≤ γk 1 − γ − γk+1 + δ 1 − γ δ 1 − γ = γk − ≤ γk. Plugging this into the above bound (18), if the iterates of NPG are to satisfy the bound with the γ-rate in the statement of the theorem, the step-size must at least satisfy the following condition: ηk0 ≥ 1 2γk KL( ̃πk0+1 sk , πk0 sk ), which concludes the proof. ■ E.1. Largest sub-optimality gap at iteration 0 In this section, we prove the claim that ∥V ⋆ − V 0∥∞ = V ⋆(s1) − V 0(s1) ≤ γ − δ 1 − γ Proof: First of all, V ⋆(s1) − V 0(s1) = π0(a2|s1) γ−r1 first part, we proceed by induction. We will use throughout that 1−γ = (1 − α)(γ − δ 1−γ ) ≤ γ − δ 1−γ . For the γk − rk 1 − γ = γk − δ 1 − γ ≤ V ⋆(s1) − V 0(s1) = (1 − α)(γ − δ 1 − γ ). This is true if (when LHS is the largest) which holds when γ2 − δ 1 − γ ≤ (1 − α)(γ − δ 1 − γ ) α ≤ γ(1 − γ)2 γ(1 − γ) − δ ⇐= α ≤ 1 − γ 27 JOHNSON PIKE-BURKE REBESCHINI Base Case: V ⋆(s2) − V 0(s2) = αγ(V ⋆(s1) − V 0(s1)) + (1 − α) γ2 − r2 1 − γ ≤ αγ(V ⋆(s1) − V 0(s1)) + (1 − α)(V ⋆(s1) − V 0(s1)) ≤ V ⋆(s1) − V 0(s1) Inductive Step: Assume true for k. Then, V ⋆(sk+1) − V 0(sk+1) = αγ(V ⋆(sk) − V 0(sk)) + (1 − α) γk+1 − rk+1 1 − γ ≤ αγ(V ⋆(s1) − V 0(s1)) + (1 − α)(V ⋆(s1) − V 0(s1)) ≤ V ⋆(s1) − V 0(s1), which concludes the proof. ■ 28 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT Appendix F. Inexact policy mirror descent and the generative model The following Lemma from Xiao (2022) controls the accuracy of the estimator (cid:98)Qk of Section 5 with respect to H and Mk: s specified in (10) Lemma 11 (Lemma 15 in Xiao (2022)) Consider using (10) to estimate Qk pairs for K iterations of IPMD. Then for δ ∈ (0, 1), if for all k ≤ K, s for all state-action Mk ≥ γ−2H 2 log(cid:0) 2K|S||A| δ (cid:1). Then with probability at least 1 − δ, we have for all k ≤ K, ∥ (cid:98)Qk s − Qk s ∥∞ ≤ 2γH 1 − γ . The proof of this result can be found in Lemma 15 of Xiao (2022). F.1. Proof of Theorem 4 This proof is similar to that of Xiao (2022) (Theorem 14). It is also similar in structure to the proof of Theorem 1 in Section 6. Fix a state s ∈ S and an integer k ≥ 0. For now let's assume that our Q-estimates are τ -accurate (τ > 0), i.e. ∥Qk − (cid:98)Qk∥∞ ≤ τ for all k ≥ 0. With this assumption, we have from Lemma 9 in Appendix A.1, Qk+1(s, a) ≥ Qk(s, a) − 2γτ 1 − γ , ∀(s, a) ∈ S × A. Now proceeding in a similar way to Section 6, ⟨ (cid:98)Qk s , π⋆ s − πk+1 s ⟩ = ⟨Qk ≥ ⟨Qk ≥ ⟨Qk s , π⋆ s , π⋆ s , π⋆ s − πk+1 s s ⟩ − ⟨Qk s ⟩ − ⟨Qk+1 s ⟩ + ⟨ (cid:98)Qk s , πk+1 s s − Qk ⟩ − ∥ (cid:98)Qk s − πk+1 ⟩ s s − πk+1 s ∥∞∥π⋆ s ∥1 s , π⋆ s − Qk 2γτ 1 − γ , πk+1 s ⟩ − − 2τ ≥ ⟨Qk s , π⋆ s ⟩ − V k+1(s) − 4γτ 1 − γ s ⟩ + V ⋆(s) − V k+1(s) − = ⟨Qk s − Q⋆ s, π⋆ ≥ −∥Q⋆ s − Qk s ∥∞ + V ⋆(s) − V k+1(s) − ≥ −γ∥V ⋆ − V k∥∞ + V ⋆(s) − V k+1(s) − 4γτ 1 − γ 4γτ 1 − γ 4γτ 1 − γ . 29 JOHNSON PIKE-BURKE REBESCHINI Now again proceeding exactly as in Section 6 with this extra τ -term using the step-size condition (ck = γ2k+1), we end up with ∥V ⋆ − V k+1∥∞ ≤ γ∥V ⋆ − V k∥∞ + γ2k+1 + 4γτ 1 − γ . Unravelling this recursion yields ∥V ⋆ − V k∥∞ ≤ γk(cid:16) ∥V ⋆ − V 0∥∞ + ≤ γk(cid:16) ∥V ⋆ − V 0∥∞ + k (cid:88) γ−iγ2(i−1)+1(cid:17) + i=1 1 1 − γ (cid:17) + 4γτ (1 − γ)2 . 4γτ 1 − γ k−1 (cid:88) i=0 γi Now using the properties of the estimator (10) in Lemma 11, we have with probability 1 − δ for all 0 ≤ k ≤ K, giving τ = 2γH 1 − γ , ∥V ⋆ − V k∥∞ ≤ γk(cid:16) ∥V ⋆ − V 0∥∞ + (cid:17) 1 1 − γ + 8γH (1 − γ)3 ≤ 2 1 − γ γk + 8γH (1 − γ)3 . This establishes the first bound. Now K > H ≥ 1 1 − γ 1 1 − γ log log 4 (1 − γ)ε 16 (1 − γ)3ε =⇒ 2 1 − γ γk ≤ ε/2, =⇒ 8γH (1 − γ)3 ≤ ε/2 giving as required. In terms of M, we have ∥V ⋆ − V k∥∞ ≤ ε/2 + ε/2 = ε M ≥ ≥ = γ−2H 2 (cid:16) log 2K|S||A| δ (cid:17)2 1 2 16 (1 − γ)3ε 162 2(1 − γ)6ε2 log log 2K|S||A| δ 2K|S||A| δ and the corresponding number of calls to the sampling model, i.e. the sample complexity is (what we have shown above is actually a lower bound but can choose K, H, M so that it is of the following order), |S| * |A| * K * H * M = ̃O (cid:16) |S||A| (1 − γ)8ε2 (cid:17) , where the notation ̃O() hides poly-logarithmic factors. This completes the proof. ■ 30 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT Appendix G. MDP examples G.1. MDP on which distribution-mismatch coefficient scales with size of state space We construct an MDP on which θρ = 1 1 − γ (cid:13) (cid:13) (cid:13) d⋆ ρ ρ (cid:13) (cid:13) (cid:13)∞ , scales with |S|, and hence so does the iteration complexity of the bound of Xiao (2022) for exact PMD. Consider an MDP with state-space S = {s1, s2, ..., sn} of size n and arbitrary action space A. s1 is an absorbing state giving out rewards of 1 at each time-step, regardless of the action taken, i.e p(s1|s1, a) = 1, r(s1, a) = 1 ∀a ∈ A. All others states have an action, say a1, that gives out a reward of 1 and with probability 1 − δ brings the agent to state s1 for some δ > 0 and spreads the remaining δ probability arbitrarily amongst the other states. The other actions have arbitrary rewards strictly less than 1 associated to them, and arbitrary transition probabilities that place 0 mass on state s1, i.e p(s1|s, a1) = 1 − δ, p(s1|s, a) = 0, r(s, a1) = 1 ∀s ̸= s1, r(s, a) < 1 ∀s ̸= s1, ∀a ̸= a1. Denote rmax = maxs̸=s1,a̸=a1 r(s, a) < 1. The following condition ensures that a1 is the optimal action in all states, δ ≤ 1 − γ γ (1 − rmax) so that π⋆(s) = a1 for all states s. To see this, consider si ̸= s1, am ̸= a1 and an arbitrary policy π, Qπ(si, a1) = 1 + γ (cid:16) 1 − δ 1 − γ + n (cid:88) j=2 (cid:17) p(sj|si, a1)V π(sj) ≥ 1 + γ 1 − δ 1 − γ Qπ(si, am) = r(si, am) + γ n (cid:88) j=2 p(sj|si, a1)V π(sj) ≤ rmax + γ 1 1 − γ and solving will yield the condition above. rmax + γ 1 1 − γ ≤ 1 + γ 1 − δ 1 − γ 31 JOHNSON PIKE-BURKE REBESCHINI Then for t ≥ 1 (abusing notation, st denotes the state at time t), Pπ⋆ (st = s1|s0 = s) = (cid:88) Pπ⋆ (st = s1, st−1 = s′|s0 = s) s′ (cid:88) s′ (cid:88) = ≥ p(s1|s′, a1)Pπ⋆ (st−1 = s′|s0 = s) (1 − δ)Pπ⋆ (st−1 = s′|s0 = s) s′ = 1 − δ and Now d⋆ ρ(s1) = (1 − γ) ≥ (1 − γ) ≥ (1 − γ) (cid:88) s (cid:88) s (cid:88) ρ(s) ρ(s) ρ(s) s = γ(1 − δ). ∞ (cid:88) t=0 ∞ (cid:88) γtPπ⋆ (st = s1|s0 = s) γt(1 − δ) t=1 γ 1 − γ (1 − δ) (cid:13) (cid:13) (cid:13) d⋆ ρ ρ (cid:13) (cid:13) (cid:13)∞ ≥ d⋆ ρ(s1) ρ(s1) ≥ γ(1 − δ) ρ(s1) and depending on what ρ you consider, θρ can be arbitrarily large. In particular, the natural choice of the uniform starting-state distribution ρ(s) = 1/n leads to θρ ≥ n γ(1 − δ) (1 − γ) which gives an iteration complexity under the result of Xiao (2022) for an ε-optimal policy that is n γ(1 − δ) (1 − γ) log 2 (1 − γ)ε . Recall that n = |S|, so this iteration complexity scales linearly with the size of the state space. G.2. Family of MDPs on which sub-optimality gaps can be made arbitrarily small We present how to construct a family of MDPs on which ∆k(s) defined in Section 4 can be made arbitrarily small. Consider an arbitrary MDP M with state space S and action space A. For each state-action pair (s, a) ∈ S × A, create a duplicate action a′ s.t the transitions from that action in that state are the same as for the original pair, i.e p(s′|s, a) = p(s′|s, a′) ∀s′ ∈ S 32 OPTIMAL CONVERGENCE RATE FOR EXACT POLICY MIRROR DESCENT and the reward is shifted down by δ > 0 from the original reward, i.e r(s, a′) = r(s, a) − δ. This results in a new MDP M′ with an augmented action space A′, that is twice the size of the action space of the original MDP M. In terms of action-value of an arbitrary policy π, this results in Qπ M′(s, a) − Qπ M′(s, a′) = δ, where the notation Qπ this gives M′ refers to action-values in the MDP M′. In terms of sub-optimality gaps, ∆π(s) ≤ δ. Choosing δ small enough, we can make the step-size of Khodadadian et al. (2021) arbitrarily large, at least in early iterations. The step-size condition (5) of Theorem 1 will be less affected by this issue as it does not depend directly on ∆k(s), and not at all in the first iteration. Beyond its generality to PMD, this illustrates the benefit of our result restricted to NPG over the result of Khodadadian et al. (2021). 33
http://arxiv.org/abs/2302.11380v1
2023-02-22T13:53:20
2023-02-22T13:53:20
Stress and Adaptation: Applying Anna Karenina Principle in Deep Learning for Image Classification
Image classification with deep neural networks has reached state-of-art with high accuracy. This success is attributed to good internal representation features that bypasses the difficulties of the non-convex optimization problems. We have little understanding of these internal representations, let alone quantifying them. Recent research efforts have focused on alternative theories and explanations of the generalizability of these deep networks. We propose the alternative perturbation of deep models during their training induces changes that lead to transitions to different families. The result is an Anna Karenina Principle AKP for deep learning, in which less generalizable models unhappy families vary more in their representation than more generalizable models happy families paralleling Leo Tolstoy dictum that all happy families look alike, each unhappy family is unhappy in its own way. Anna Karenina principle has been found in systems in a wide range: from the surface of endangered corals exposed to harsh weather to the lungs of patients suffering from fatal diseases of AIDs. In our paper, we have generated artificial perturbations to our model by hot-swapping the activation and loss functions during the training. In this paper, we build a model to classify cancer cells from non-cancer ones. We give theoretical proof that the internal representations of generalizable happy models are similar in the asymptotic limit. Our experiments verify similar representations of generalizable models.
[ "Nesma Mahmoud", "Hanna Antson", "Jaesik Choi", "Osamu Shimmi", "Kallol Roy" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11380v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11380v1", "@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" ]
Stress and Adaptation: Applying Anna Karenina Principle in Deep Learning for Image Classification 3 2 0 2 b e F 2 2 ] G L . s c [ 1 v 0 8 3 1 1 . 2 0 3 2 : v i X r a Nesma Mahmoud1 Hanna Antson2 jaesik choi3 Osamu Shimmi2 Kallol Roy1 1 Institute of Computer Science, University of Tartu, Estonia 2 Institute of Molecular and Cell Biology, University of Tartu, Estonia 3 School of Artificial Intelligence, Korea Advanced Institute of Science and Technology, Korea Abstract Image classification with deep neural networks has reached state-of-art with high accuracy. This success is attributed to good internal representa- tion (features) that bypasses the difficulties of the non-convex optimization problems. We have little understanding of these internal representations, let alone quantifying them. Recent research efforts have focused on alternative theories and explana- tions of the generalizability of these deep networks. We propose the alternative: perturbation of deep models during their training induces changes that lead to transitions to different families. The re- sult is an 'Anna Karenina Principle (AKP)' for deep learning, in which less generalizable models (unhappy families) vary more in their representa- tion than more generalizable models (happy fam- ilies)-paralleling Leo Tolstoy's dictum that "all happy families look alike, each unhappy family is unhappy in its own way." Anna Karenina prin- ciple has been found in systems in a wide range: from the surface of endangered corals exposed to harsh weather to the lungs of patients suffering from fatal diseases of AIDs. In our paper, we have generated artificial perturbations to our model by hot-swapping the activation and loss functions dur- ing the training. In this paper, we build a model to classify cancer cells from non-cancer ones. We give theoretical proof that the internal representa- tions of generalizable (happy) models are similar in the asymptotic limit. Our experiments verify similar representations of generalizable models. 1 INTRODUCTION The spectacular success of deep learning in vision (lan- guage) is attributed to the essential features learned by them. These deep neural networks build intermediate representa- tions Rumelhart et al. [1986]. These deep neural networks are trained end-to-end to build their intermediate represen- tations for a richer representation Goh et al. [2021], Olah et al. [2017]. However, the formal characterization of these representations is extremely hard. Different training meth- ods for good training and evaluation accuracy are used to support the existence of good representations of the data inside the model. But we believe that not only the train- ing but architecture, objective function, and other factors contribute to developing good representations. So, highly ac- curate models have better intermediate representations than their low-accurate counterparts. Thus the better representa- tion comes from the evolutionary principle West-Eberhard and Press [2003], Diamond [1998]: a deep net model adapts by correspondingly building its optimal representation to survive (a.k.a have good accuracy). We observe through our experiments Anna Karenina Principle (AKP) all "good representations" are essentially similar and all "bad repre- sentations" are bad in their own way Bansal et al. [2021], Zaneveld et al., Ainsworth et al. [2022]. Recently some re- search groups have connected the notion of symmetry with models' internal representation Godfrey et al. [2022]. We do not have sufficient understanding and good metrics to measure the similarity between good representations. The high test accuracy is an efficient heuristic for building good intermediate representations for the Anna Karenina scenario. Deep learning-based vision model tasks will have internal representations that focus on the curves and sharp edges, while large language models focus on the distributional properties of the text. Thus the ubiquitous loss surface with exponentially many local optima separated by numerous barriers is not a good metric to infer the intermediate repre- sentations Li et al. [2018], Szegedy et al. [2015]. For AKP the following emerges Bansal et al. [2021], Gorban et al. [2010], Rybnikov et al. [2017]: • All successful models (high test accuracy) have similar internal representations. • Better internal representations are built with more data, bigger model sizes, and more computing. • Internal representations are built from evolutionary principles; irrelevant features are dropped on the way for the models to survive. The organization of the paper is as follows: In Section 2, background notions and related work are introduced. The theory is proven in Section 3, and the design of the exper- iments is presented in Section 4. Section 5 displays the dataset setup, and Section 6 offers an empirical evaluation. The paper concludes in Section VI. 2 ANNA KARENINA PRINCIPLE (AKP) According to the Wikipedia definition, Anna Karenina prin- ciple (AKP) states that "a deficiency in any one of several factors dooms an endeavor to failure" Wikipedia [2022]. This principle reveals the intrinsic mechanism of adapta- tion to crises, from human adaptation to harsh conditions to the dotcom bubble burst to shift animal microbiomes from a healthy to a dysbiotic stable state Diamond [1998], Zaneveld et al.. The principle derives its name from Leo Tol- stoy's famous novel Anna Karenina: "All happy families are alike; each unhappy family is unhappy in its own way". This translates in our domain to successful (a.k.a) generalizable) models share a common set of attributes (a.k.a features) that lead to success (high test accuracy). In contrast, a deficiency of various attributes (a.k.a features) can cause an unhappy (low test accuracy) family. This concept is valid in several research fields. With the mathematical framework of cor- relation and variance of multiple systems (agents) facing external stress, we can predict the symptoms of crisis by observing the increase of correlation among the agents Ryb- nikov et al. [2017]. We show a hypothetical ordination of Figure 1: Anna Karenina Principle alteration of neuron sample density because of the perturba- tion from swapping the activation and loss functions during the training shown in Figure 1 Zaneveld et al.. There are three colors to label the neurons (i) blues spheres samples 2 represent neurons under no stress (perturbations) or base- line neurons (ii) green spheres samples represent neurons under mild stress (iii) red spheres samples represent neu- rons under severe stress. The X-axis represents the increas- ing stress (perturbations) given to the model by swapping methods. These perturbations produce clusters of 'stressed' neuron samples (green and red spheres) from the initial (a.k.a unstressed) neuron samples (blue spheres). Figure 1.a) shows under a linear increase in stress, the neuronal sample changes deterministically, from blue (no stress) to green (mild stress) to red (severe stress). Figure 1.b) shows when the stress (perturbation) is non-linear through the change of swapping activation functions. This produces clusters of healthy (blue spheres) and severely stressed (red spheres) samples. This results in a change of neuron samples from no-stress neurons (blue spheres) to a mix of green and blue clusters (in mild stress) to a mix of red and green spheres (in severe stress). Similar is Figure 1.c) that shows non-linear perturbations through swapping of loss functions changes neuron sample density. The correlation coefficient between stress neuron samples (green and red spheres) and zero- stress neuron samples (blue spheres) is computed. 3 AKP IN IMAGE CLASSIFICATION Image classification with deep neural networks took off from ImageNet moment Krizhevsky et al. [2017]. Series of spectacular discoveries of Capsule-net, ResNet50, Mo- bileNet, and recently Image Transformer mark the golden moment of computer vision Sabour et al. [2017], He et al. [2016], Howard et al. [2017]. A significant part of computer vision research goes into medical research, particularly in image segmentation, classification, imaging etc. Das et al. used transfer learning from the ResNet50 feature extrac- tion model to detect Acute Lymphoblastic Leukemia (ALL) from a small medical dataset Das et al. [2021]. Choudhary et al. used transfer learning for breast cancer classification with three pre-trained CNNs models, ResNet34, VGG19, and ResNet50 Choudhary et al. [2021]. In a recent study of breast cancer intensity spread by cancer, Ghrabat et al. used a convolution neural network(CNN) from scratch and with data augmentation. Ghrabat et al. [2022]. The deep neural models perform well on the generalizability to out of distributions because of optimal feature selection from the image data. Deep neural models capture relevant features (attributes) from the image data, e.g., ridge crease, valley crease, boundary edge, marking curve, corner, convex cor- ner, concave corner, saddle corner, notch corner Damon et al. [2016], Hartley and Zisserman [2003]. 3.1 PROOF We employ a model (inception network) for binary classi- fication (cancer or no cancer). The model is trained on the dataset D, with the input x as the image (from microscopy), with training labels y ∈ {0, 1} distributed as p(y|x, D). It is trained with the stochastic gradient descent (SGD) and RMSprop using binary cross entropy loss function. The predicted labelled output is Murphy [2018]: ˆy = arg 2 max c=1 p(y = c|x, D, Wf ) (1) where Wf is the final trained weight after epoch E. The initial weight tensor is W0 (sampled from random and glorot initialization). We use perturbation training dynam- ics, where we discretize the epoch in discrete intervals E = {E0 ∪E2 * * * E2} where at different interval Ei we use a different activation function (e.g., Relu, Tanh) or loss func- tions. Online changing the activation functions is a pertur- bation given to the model as it resets (partially) the training. AKP Principle hypothesizes models (biological and non- biological agents) going through similar training dynamics (and environmental) have similar internal representations. This inspires researchers to experiment with model stitching where some layers of a model are stitched inside another model Lenc and Vedaldi [2014], Bansal et al. [2021]. This shows the reason why solving non-convex neural optimiza- tion network loss landscapes succeeds: the presence of a single basin after considering all possible permutation sym- metries of hidden layers Ainsworth et al. [2022]. In our paper, we propose a new theory for the Anna Karenina Principle (AKP) emergence. We draw the tools from evolu- tionary game theory and population dynamics to model Hof- bauer and Sigmund [1998], Börgers and Sarin [1997]. We model the artificial neuron population as a population of agents (similar to biological species, e,g animals and in- sects). The population frequencies of different groups of neu- rons in our model web complex interactions, from which the feature vectors emerge. The complex interactions between different groups of neurons (inter-species competition) or among the neurons within the same group (intra-species competition). Different groups of neurons were fighting for their survival and are modeled as the celebrated predator- prey equations of Lotka–Volterra equations. In addition to back-propagation, this predator-prey interaction dynamics updates the neuron weights. The online swapping of activa- tions and loss functions enhances the evolutionary pressure among the neurons. The features from the data extracted come from the evolutionary pressure of the survivability of the neurons. For simplicity, we model our neuron population of size two W1 and W2, where W1 is the prey and W2 is the predator, evolved through Lotka–Volterra equations: ̇W1 = W1(a − bW2) ̇W2 = W2(−c + dW1) ̇W2 = W2 (2) where ̇W1 = W1 dt and constants a, b, c, d ≥ 0. dt , Populations W1 and W1 learn the features (e.g., corners, bends, etc.) of the image. For example, the population W1 learns sharp corners, and population W2 learns more com- plex features. The mapping between neuron population and its learning features capacity is a complex problem and poorly understood. Though we propose such a map, T ex- ists, and it is differentiable. Again we take two image feature set F = {f1, f2} for simplicity. These features are depen- dent on the population of neurons as a linear combination of populations as: (cid:21) (cid:20)f1 f2 = (cid:20)T11 X12 T22 T21 (cid:21) (cid:20)W1 W2 (cid:21) (3) Solving time-independent Lotka–Volterra Equation2 we and plugging in Equation 4 we get: (cid:21) (cid:20)f1(t) f2(t) = (cid:20)T11 X12 T22 T21 (cid:21) (cid:20) W1(0)eat W2(0)e−ct (cid:21) (4) From Equation 4, we infer the feature vectors are functions of time that depend on the population of neurons W1, W2. So survivability of neuron populations is projected to the feature survivability. This we term as feature fight, and thus features are not extracted only through gradient descent but also from predator-prey equations of Lotka–Volterra equations. The features extracted by different models in which their respective neurons have gone through similar fights for survival are similar, echoing the Anna Karenina Principles. 4 DESIGN OF EXPERIMENTS We design the model's training from the evolutionary prin- ciple of genocopy phenocopy interchangeability West- Eberhard and Press [2003]. We study the learning dynamics of the models with stochastic perturbations Kaniovski and Young [1995]. The perturbations are induced through the swapping of activation and loss functions during training. This swapping of hyperparameters resets the training pro- cess and thus puts pressure evolutionary on the model to survive. In our experiment design, we have used Incep- tionv3, a convolutional neural network (CNN), for binary classification. The features are extracted hierarchically, with low-level features first and more complex features later with optimization. We use pre-trained ImageNet weights for our binary classification task and thus bypassing the require- ments for large sample complexity for training. We run our experiments separately with two different optimizers (i) Stochastic Gradient Descent (SGD) and (ii) Root Mean Square Propagation (RMS-Prop). We report three sets of experiments in our paper: 1. Group A: Training Inceptionv3 models for 30 epochs with a Fixed seed. 3 2. Group B: Training Inceptionv3 models for 30 epochs with a Random seed. 3. Group C: Training Inceptionv3 models for 100 epochs with different initializers. 4.1 HOT SWAPPING ACTIVATION FUNCTIONS Hot swapping activation functions is a dynamic technique in which the activation functions of the model are changed during training and monitoring the network's performance to search for the best activation function for each layer. In our model, we incorporated three dense layers, with the final layer having a softmax activation function for classifying the model's classes. While training our model, we experi- mented with switching the activation functions of the first two dense layers. We choose different activation functions - Tanh, Softplus, and ReLU. Our policy of changing (swap- ping) activation functions at epoch numbers: 3, 6, 9, 12, 15, 18, and 21. The softmax activation function at the last layer is not changed as the final classification task depends on it. 4.2 INTERCHANGEABILITY OF LOSS FUNCTIONS We swap (interchange) three different loss functions - Pois- son, Kullback-Leibler divergence (KLDivergence), and Sparse categorical cross-entropy during the training for a pe- riod of 30 epochs. Our policy of interchanging loss functions happens at epochs 3, 6, 9, 12, 15, 18, and 21. We kept track of both the training loss and validation loss over the course of 30 epochs to observe how changing the loss function impacted the model's performance. Those loss functions were interchangeably measuring the discrepancy between the model's predictions and the true labels to help guide the optimization process. (a) (b) (c) Figure 2: (a) Stacked Green channel (b) Stacked Magenta channel (c) The merged channels is comprised of three different color channels. The layers and color channels are combined into a single, stacked im- age to make it easier for a neural network to process these images. This is done by taking the z-axis values for each color channel and merging them into two separate 2D im- ages, one for the green channel and one for the magenta channel. These two images are then combined to form the final 3D image, which contains all the depth and color infor- mation of the wing tissue. So, to put it simply, microscopy images are complex 3D images of a specimen's internal structure, and they are processed into a single stacked image to simplify their use as input for a neural network. The first stacked channel has green color as in Figure 2 (a), and the second stacked channel has a magenta color as in Figure 2 (b), and we already have the black background common in both images. To have the entire wing image, the green and magenta stacked channels were merged as in Figure 2. (c) The dataset consists of stacked and combined microscopy images, each representing a snapshot of a Fruit fly wing at a specific time. The images are organized into 76 images of wings with tumors and 139 images without tumors. The tumor set includes images of different stages of cancer, in- cluding both early and late stages. However, some images in the no-tumor folder with a tiny tumor percentage will be suppressed in the coming days. 5 DATASET SETUP 1 The dataset 1 in this study consists of experimental studies carried out in the lab. The data is of two classes: images of flies that will develop tumors (cancer) and images of flies that will not develop tumors (cancer). The data set is imbalanced, and fewer images are with tumors than those without tumors. Our study's results will additionally help to improve our understanding of tumor development in flies and may have implications for cancer research in humans. Microscopy images are special kinds of 3D images that capture the internal structure of a specimen. Each image has three dimensions: width, height, and depth as shown in Figure 2. The width and height are represented by the x and y-axes, while the z-axis represents the depth. The depth information is particularly useful for capturing multiple lay- ers of the specimen, such as the tissue layers of a wing, which can have up to 13 layers. Additionally, each layer 6 RESULTS AND DISCUSSION In this paper, we perform experiments to verify and validate Anna Karenina Principle (AKP). We create different fami- lies of models by using the same Inceptionv3 architecture but with different initializers. All the Inceptionv3 model families are trained in similar environments, with perturba- tions through swapping. The perturbations (stress) divide the model class into two groups (i) happy families (models that have high accuracy) (i) unhappy families (models that have low accuracy). Models with high test accuracy have similar representations, and models with low test accuracy are dissimilar. We also compare our results with Inceptionv3 1The dataset: https://doi.org/10.5281/zenodo. 7648739 4 model families and with the same initializer. We use stochas- tic gradient descent (SGD) and RMSprop as optimizers. 6.1 FIXED SEED EXPERIMENTS 6.1.1 Hot Swapping of activation functions The activation functions are changed at epochs 3, 6, 9, 12, 15, 18, and 21. RMSprop optimizer training accuracy shows the signs of overfitting from the 5th epoch as shown in Fig- ure 3 (a) and (e). It is inferred that the hot swapping of activation functions resets the training process. The model loses parts of its training and tries hard to adapt its lost learning, causing overfitting. The similarity of the training curve across all the experiments validates our AKP princi- ple: Models going through similar training dynamics behave similarly. SGD optimizer training accuracy exhibited more fluctuations than its RMSprop counterparts, ranging from 45% to 65% as shown in 3 (c). The model accuracy increases from 40% accuracy reached up to 60%. After changing the activation function at epoch three from Tanh to Softplus, the model's accuracy dropped to 45% and then increased again. The stochastic fluctuations of the accuracy continue until epoch 21. We stopped the swapping at Epoch 21 by fixing with Relu until the end of the training so the model could cool down and stabilize. The validation accuracy of RMSProp is shown in Figure 3 (b). The validation accuracy started at 65% and remained relatively stable until epoch 10, after which the accuracy fluctuated more and reached 80% at the end of epoch 30. The influence of activation function swaps on the validation accuracy is minimal for SGD, as shown in Figure 3 (d). SGD here has fewer fluctuations than RMSprop. Some of the activation functions hot swapping using SGD show similar behavior starting with a valida- tion accuracy of 35% and gradually stabilizing from epoch 25 and settling down between the range of 60% and 65%. Though we discover most of the model families behave sim- ilarly (happy families), we discover an interesting effect in Figure 3 (d), where there is a bifurcation, and one model stays successful, and all others are not so successful. 6.1.2 Interchangeability of loss functions The training accuracy of RMSProp and SGD persisted in their behavior. RMSprop training accuracy stayed overfitting as shown in Figure 3 (e). The training accuracy fluctuates more with SGD as shown in Figure 3 (g) between 44% until 60% . RMSProp Validation Accuracy in Figure 3 (f), however, started stable at 65% until the 10th epoch, which exhibited fluctuations between 65% and 80%. In simpler terms, the model consistently struggled with overfitting dur- ing the training process, but despite this, it was still able to produce good results in terms of validation accuracy. SGD model achieved a stable validation accuracy of 65% after eight training epochs, as shown in Figure 3 (h). In summary, similarities and dissimilarities exist compared to the hot swapping of activation functions. The AKP is more pro- nounced with SGD optimizer for both perturbations, though it is better with the perturbations with interchangeability of loss functions. 6.2 RANDOM SEED EXPERIMENTS 6.2.1 Hot Swapping of activation functions The training accuracy with the RMSProp optimizer has fewer fluctuations, but the overfitting trend is shown in Fig- ure 4 (a). Evaluation accuracy for different families stayed together and started bifurcating from epoch 12 as shown in Figure 4 (b). The stress given to different models affects them differently. Some adapted well by picking the right features, and others could not. The training accuracy curve shows strong fluctuations with SGD optimizer ranging from 45% to 65% as shown in 4 (c). Validation accuracy with SGD shows bifurcations where most models are happy, and the lone model is unhappy, as shown in Figure 4 (d). The stress affects the model differently. One model could not enlist itself to the happy member. 6.2.2 Interchangeability of loss functions A similar trend as in hot swapping of the activation functions is shown here in Figure 4 (e),(f),(g), and (h). 6.3 CHANGING KERNEL INITIALIZERS EXPERIMENTS We conducted four experiments, each using a unique kernel initializer for the first dense layer of every model. The ini- tializers employed were zeros, GlorotNormal, HeUniform, and TruncatedNormal initializer. For the TruncatedNormal initializer, we utilized parameters with a mean of zero and a standard deviation of 0.5. 6.3.1 Hot Swapping of activation functions The training accuracy of RMSProp has small fluctuations but persists in the overfitting trend as shown in Figure 5 (a). In contrast, the SGD Training Accuracy for most experi- ments has fluctuations starting at 35% and ending around 73%. Except for experiment 1, using Zeros initializer stayed at 63%. The Validation Accuracy of RMSProp started at around 45% and converged around 90% as shown in Fig- ure 5 (b). 5 (a) (b) (c) (d) (e) (f) (g) (h) Figure 3: Results of the Experiments using a Fixed Seed over 30 epochs (a) Experiments Training Accuracy of activation functions Hot swapping using RMSProp optimizer (b) Experiments Validation Accuracy of activation functions Hot swapping using RMSProp optimizer (c) Experiments Training Accuracy of activation functions Hot swapping using SGD optimizer (d) Experiments Validation Accuracy of activation functions Hot swapping using SGD optimizer (e) Experiments Training Accuracy of loss functions Interchangeability using RMSProp optimizer (f) Experiments Validation Accuracy of loss functions Interchangeability using RMSProp optimizer (g) Experiments Training Accuracy of loss functions Interchangeability using SGD optimizer (h) Experiments Validation Accuracy of loss functions Interchangeability using SGD optimizer (a) (b) (c) (d) (e) (f) (g) (h) Figure 4: Results of the Experiments using a Random Seed over 30 epochs (a) Experiments Training Accuracy of activation functions Hot swapping using RMSProp optimizer (b) Experiments Validation Accuracy of activation functions Hot swapping using RMSProp optimizer (c) Experiments Training Accuracy of activation functions Hot swapping using SGD optimizer (d) Experiments Validation Accuracy of activation functions Hot swapping using SGD optimizer (e) Experiments Training Accuracy of loss functions Interchangeability using RMSProp optimizer (f) Experiments Validation Accuracy of loss functions Interchangeability using RMSProp optimizer (g) Experiments Training Accuracy of loss functions Interchangeability using SGD optimizer (h) Experiments Validation Accuracy of loss functions Interchangeability using SGD optimizer 6 (a) (b) (c) (d) (e) (f) (g) (h) Figure 5: Results of the Experiments using a Random Seed over 100 epochs (a) Experiments Training Accuracy of activation functions Hot swapping using RMSProp optimizer (b) Experiments Validation Accuracy of activation functions Hot swapping using RMSProp optimizer (c) Experiments Training Accuracy of activation functions Hot swapping using SGD optimizer (d) Experiments Validation Accuracy of activation functions Hot swapping using SGD optimizer (e) Experiments Training Accuracy of loss functions Interchangeability using RMSProp optimizer (f) Experiments Validation Accuracy of loss functions Interchangeability using RMSProp optimizer (g) Experiments Training Accuracy of loss functions Interchangeability using SGD optimizer (h) Experiments Validation Accuracy of loss functions Interchangeability using SGD optimizer 6.3.2 Interchangeability of loss functions Here the training accuracies of RMSProp also have small fluctuations and continue with the overfitting trend as shown in Figure 5 (e), except Experiment 1 using Zeros initializer, the RMSProp Optimizer was unable to improve the train- ing accuracy and stayed at 63%. Experiment 1 using SGD shown in Figure 5 (g) also had the same training accuracy over the 100 epochs of 63%. The validation Accuracy of SGD stayed at 65% for the first experiment along all 100 epochs, as shown in Figure 5 (h) 6.4 TEST CLASSIFICATIONS ACCURACY Table 1 presents the mean values of model predictions on the testing set. Each group of experiments underwent an average of five trials, except for Group C, where only four experiments were conducted. Analysis of the table shows that the SGD performs poorly in terms of precision, recall, and F-score for Class 1, which pertains to cancer images. 6.5 DISCUSSION # A Type Hot Swapping Activation Fn Optimizer RMSProp SGD Interchangeability of Loss Fn RMSProp SGD B Hot Swapping Activation Fn RMSProp SGD Interchangeability of Loss Fn RMSProp SGD C Hot Swapping Activation Fn RMSProp SGD Interchangeability of Loss Fn RMSProp SGD Class 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Precision 0.8 1 0.57 0.17 0.80 0.94 0.67 0.0 0.77 0.84 0.63 0.11 0.82 0.87 0.66 0.0 0.82 1 0.67 0.00 0.80 0.66 0.67 0.25 Recall 1 0.47 0.50 0.28 0.98 0.51 1 0.0 0.92 0.41 0.78 0.18 0.92 0.57 0.98 0.0 1 0.55 1 0.00 0.96 0.5 1 0.01 F1 0.88 0.64 0.52 0.21 0.88 0.65 0.81 0.0 0.83 0.47 0.66 0.12 0.86 0.64 0.79 0.0 0.90 0.71 0.81 0.00 0.88 0.56 0.81 0.03 Acc. 0.82 0.43 0.82 0.67 0.75 0.58 0.80 0.65 0.85 0.67 0.81 0.67 Table 1: Average Testing Accuracy of each group of exper- iments. Group A represents the Experiments with a Fixed seed over 30 epochs, Group B represents the Experiments with a Random Seed over 30 epochs, and Group C repre- sents the Experiments with Different Kernel Initializers over 100 epochs. The Table is reporting the Precision, Recall, F- score, and Testing Accuracy of the experiments, divided into class 0 [No Cancer], Class 1 [Cancer] Although the RMSProp optimizer exhibits a similar pattern of over-fitting in the training accuracy, the optimizer pro- duced better validation and test accuracy results compared to the SGD on our dataset. This suggests that while the RM- SProp optimizer still struggles with over-fitting, it is better at generalizing to new unseen data, resulting in improved 7 validation and test accuracy and the good performance of RMSProp due to its exponential averaging. The gradients of the perturbation noise decay with time, and this helps the model to adapt. Leo Tolstoy's famous dictum that "all happy families look alike, each unhappy family is unhappy in its own way" can be applied to the results obtained in our experiments on training deep learning models. The stress in the neuron populations induces predator-prey dynamics, through which the features have evolved. Our results suggest that the models using the RMSProp optimizer as its adaptation strategy tend to have more con- sistent performance caused by the online hot swapping of activation and loss functions. On the other hand, the mod- els using the SGD optimizer as its adaptation tools show poor performance compared to RMSprop. The fluctuations in the gradients get bigger because of no averaging in the stochastic gradient descent. These fluctuations indicate each model's capacity to adapt to stress induced in the training process. This translates to test accuracy. The models us- ing the RMSProp optimizer outperformed those using the SGD optimizer. We infer that even the overfitted models have good generalizable capacity. RMSProp optimization methods may not be immune to overfitting, but they are still better able to generalize to unseen data, resulting in higher accuracy. We believe the training method through back-propagation can be improved by intertwining with some modified versions of lotka-volterra equation. These results suggest that RMSProp might be a more suitable opti- mization algorithm for our specific dataset. However, it is important to note that the optimal optimization algorithm can vary depending on the task and the dataset used. 7 CONCLUSION In this paper, we propose novel phenomena of the Anna Karenina principle (AKP) as a causal mechanism for the generalizability of deep neural models, specifically large models. The generalizability of deep learning remains a mystery, and there is no causal mechanistic theory to ex- plain its generalizable bounds. Deep nets are even found to fit random labels Zhang et al. [2016]. The probabilistic foun- dations can only partially explain the learning mechanism of deep models with billions of parameters. We propose an al- ternate learning theory of deep models from the principle of evolutionary games and population dynamics. The neurons are modeled as populations, and they are under evolutionary pressure to survive. The features of model learning come from the evolutionary pressure of neuron population. We translate nature's evolutionary pressure as perturbations of Inceptionv3 model families during its training. The pressure act as a lever, and different models evolve differently. Some towards good generalizable models and others towards poor generalizable models. All good generalizable models are happy families, and they share similar attributes, and all bad generalizable models (unhappy families) are unhappy in their own way. This is Anna Karenina Principle and is om- nipresent from bacterial colonies to deep neural networks. References Samuel K. Ainsworth, Jonathan Hayase, and Siddhartha Srinivasa. Git re-basin: Merging models modulo permuta- tion symmetries, 2022. URL https://arxiv.org/ abs/2209.04836. Yamini Bansal, Preetum Nakkiran, and Boaz Barak. Re- visiting model stitching to compare neural representa- tions. CoRR, abs/2106.07682, 2021. URL https: //arxiv.org/abs/2106.07682. Tilman Börgers and Rajiv Sarin. reinforcement and replicator dynamics. of Economic Theory, 77(1):1–14, 1997. https://EconPapers.repec.org/RePEc: eee:jetheo:v:77:y:1997:i:1:p:1-14. Learning through Journal URL Tejalal Choudhary, Vipul Mishra, Anurag Goswami, and Jagannathan Sarangapani. A transfer learning with struc- tured filter pruning approach for improved breast cancer classification on point-of-care devices. Computers in Biology and Medicine, 134:104432, 2021. James Damon, Peter Giblin, and Gareth Haslinger. Lo- cal Features in Natural Images via Singularity Theory. Springer Publishing Company, Incorporated, 1st edition, 2016. ISBN 3319414704. Pradeep Kumar Das, Ayush Pradhan, and Sukadev Meher. Detection of acute lymphoblastic leukemia using machine learning techniques. In Machine learning, deep learning and computational intelligence for wireless communica- tion, pages 425–437. Springer, 2021. Jared M. Diamond. Guns, Germs, and Steel: the Fates of Human Societies. W. W. Norton & Co., New York, 1998. ISBN 0393038912 9780393038910 0393317552 9780393317558. Mudhafar Jalil Jassim Ghrabat, Zaid Alaa Hussien, Mustafa S Khalefa, Zaid Ameen Abduljabba, Vin- cent Omollo Nyangaresi, Mustafa A Al Sibahee, and Enas Wahab Abood. Fully automated model on breast cancer classification using deep learning classifiers. In- donesian Journal of Electrical Engineering and Com- puter Science, 28(1):183–191, 2022. Charles Godfrey, Davis Brown, Tegan Emerson, and Henry Kvinge. On the symmetries of deep learning models and their internal representations, 2022. URL https: //arxiv.org/abs/2205.14258. 8 Gabriel Goh, Nick Cammarata †, Chelsea Voss †, Shan Carter, Michael Petrov, Ludwig Schubert, Alec Radford, and Chris Olah. Multimodal neurons in artificial neu- ral networks. Distill, 2021. doi: 10.23915/distill.00030. https://distill.pub/2021/multimodal-neurons. Alexander N. Gorban, Elena V. Smirnova, and Tatiana A. Tyukina. Correlations, risk and crisis: From physiol- ogy to finance. Physica A: Statistical Mechanics and its Applications, 389(16):3193–3217, aug 2010. doi: 10.1016/j.physa.2010.03.035. URL https://doi. org/10.1016%2Fj.physa.2010.03.035. Richard Hartley and Andrew Zisserman. Multiple View Ge- ometry in Computer Vision. Cambridge University Press, New York, NY, USA, 2 edition, 2003. ISBN 0521540518. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recogni- In Proceedings of 2016 IEEE Conference on tion. Computer Vision and Pattern Recognition, CVPR '16, pages 770–778. IEEE, June 2016. doi: 10.1109/CVPR. 2016.90. URL http://ieeexplore.ieee.org/ document/7780459. Josef Hofbauer and Karl Sigmund. Evolutionary Games and Population Dynamics. Cambridge University Press, 1998. ISBN 978-1-13917317-9. 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 applica- tions, 2017. URL http://arxiv.org/abs/1704. 04861. cite arxiv:1704.04861. Yunxian Huang, Jinghua Gui, Satu-Marja Myllymäki, Kallol Roy, Tambet Tõnissoo, Marja Mikkola, and Osamu Shimmi. Scribble and α-catenin cooperatively regulate epithelial homeostasis and growth. Frontiers in Cell and Developmental Biology, page 1971, 2022. Yuri M. Kaniovski and H.Peyton Young. Learning dy- namics in games with stochastic perturbations. Games and Economic Behavior, 11(2):330–363, 1995. ISSN 0899-8256. doi: https://doi.org/10.1006/game.1995. 1054. URL https://www.sciencedirect.com/ science/article/pii/S0899825685710548. Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 60(6):84–90, 2017. Karel Lenc and Andrea Vedaldi. Understanding image rep- resentations by measuring their equivariance and equiv- alence, 2014. URL https://arxiv.org/abs/ 1411.5908. Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, Visualizing the loss land- and Tom Goldstein. scape of neural nets. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Pro- cessing Systems, volume 31. Curran Associates, URL https://proceedings. Inc., 2018. neurips.cc/paper/2018/file/ a41b3bb3e6b050b6c9067c67f663b915-Paper. pdf. Kevin P Murphy. Machine learning: A probabilistic perspec- tive (adaptive computation and machine learning series), 2018. Chris Olah, Alexander Mordvintsev, and Ludwig Schubert. Feature visualization. Distill, 2017. doi: 10.23915/distill. 00007. https://distill.pub/2017/feature-visualization. David E. Rumelhart, Geoffrey E. Hinton, and Ronald J. Williams. Learning internal representations by error prop- agation. In David E. Rumelhart and James L. Mcclelland, editors, Parallel Distributed Processing: Explorations in the Microstructure of Cognition, Volume 1: Foundations, pages 318–362. MIT Press, Cambridge, MA, 1986. Sviatoslav R. Rybnikov, Natalya A. Rybnikova, and Public fears in ukrainian soci- Boris A. Portnov. ety: Are crises predictable? Psychology and Devel- oping Societies, 29(1):98–123, 2017. doi: 10.1177/ 0971333616689398. URL https://doi.org/10. 1177/0971333616689398. Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. Dynamic routing between capsules. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vish- wanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran As- sociates, Inc., 2017. URL https://proceedings. neurips.cc/paper/2017/file/ 2cad8fa47bbef282badbb8de5374b894-Paper. pdf. Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the in- ception architecture for computer vision, 2015. URL http://arxiv.org/abs/1512.00567. cite arxiv:1512.00567. Berrak Ugur, Kuchuan Chen, and Hugo J Bellen. Drosophila tools and assays for the study of human diseases. Disease models & mechanisms, 9(3):235–244, 2016. Karl Weiss, Taghi M Khoshgoftaar, and DingDing Wang. A survey of transfer learning. Journal of Big data, 3(1): 1–40, 2016. M.J. West-Eberhard and Oxford University Press. Develop- mental Plasticity and Evolution. OUP USA, 2003. ISBN 9 could suppress the tumor, and cells could return to normal without tumor cells.Huang et al. [2022], With the advances in Computer vision and image processing using neural net- works, it is possible to understand the evolution of cancer through the process. After training the neural network over the wing images, The model can predict whether a fly in the early stage will be a tumor or not. The neural network can extract, learn and detect features from the images. It could find the most important features contributing the most to the decision of image classifica- tion. The neural network splits the image into small patches. The attention weights (priority) are given to these image patches. These attention weights represent the chance of cancer growth. The machine learns these attention weights (on its own) from the microscopy images by adjusting its parameter. This approach will allow us to build an accurate and transparent model, enabling healthcare providers to un- derstand better and trust the predictions made by the system. Due to the considerable gap between the massive amount of images the neural network requires to train over and the small number of images generated in the experiments, Re- searchers adapt transfer learning Weiss et al. [2016]. In this research, transfer learning is used by customizing already pre-trained models to the new research target. 9780195122350. URL https://books.google. ee/books?id=iBkQyA2PkxEC. Wikipedia. Anna karenina principle. en.wikipedia.org/wiki/Anna_Karenina_ principle, 2022. 2023]. [Online; accessed 10-February- https:// Jesse Zaneveld, Ryan McMinds, and Rebecca Vega Thurber. Stress and stability: applying the anna karenina principle to animal microbiomes. Nature microbiology. doi: 10. 1038/nmicrobiol.2017.121. URL https://par.nsf. gov/biblio/10218957. Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learn- ing requires rethinking generalization. 2016. URL http://arxiv.org/abs/1611.03530. cite arxiv:1611.03530Comment: Published in ICLR 2017. 8 SUPPLEMENTARY MATERIAL The high genetic similarity between humans and animals made it convenient to draw several research studies on an- imals and map the understanding to human genes to un- derstand the development of diseases. About 75% of the genes responsible for human diseases have similarities in flies Ugur et al. [2016]. Cancer deaths are increasing world- wide, and the community does not yet know how tumors grow and how to suppress them. There is a pressing need for experiments to understand the development of tumors in cells and how cells communicate with each other. There are extensive studies on the fruit fly, also known as drosophila, since genetics and tumor formation imaging are studied si- multaneously. Reading the gene sequences is not the only way to detect Tumor suppressors and predict human cancer. Another way to understand the evolution of the tumor is to monitor the fly and notice how the cells evolve if it losses some proteins and its reaction to the increase of copies from specific proteins. Based on studies, Some proteins could help suppress cancer, while the loss of other proteins con- tributes a lot to the rise in cancer risk. Each gene in the cell contributes to the decision on what sort of cell it will be, its size, shape, and control tissue growth. One of the mem- brane proteins in drosophila is the scribble that maintains the apical-basal cell polarity of the epithelial tissues. A Recent Study showed that the loss of Scribble Protein or its partners from the tissue leads to abnormal growth of cells. In contrast, the alpha-catenin protein expression in cells helps restore growth regulation and tumor suppressor activities. During the biological experiments over the drosophila wings, the researchers capture the evolution of the fly wing every day. In some of the experiments where the scribble was lost from some cells, it led to a tumor. In contrast, in others where the alpha-catenin protein was extensively expressed, the cell 10
http://arxiv.org/abs/2302.11365v2
2023-02-23T02:04:27
2023-02-22T13:33:21
Impact of Subword Pooling Strategy on Cross-lingual Event Detection
Pre-trained multilingual language models (e.g., mBERT, XLM-RoBERTa) have significantly advanced the state-of-the-art for zero-shot cross-lingual information extraction. These language models ubiquitously rely on word segmentation techniques that break a word into smaller constituent subwords. Therefore, all word labeling tasks (e.g. named entity recognition, event detection, etc.), necessitate a pooling strategy that takes the subword representations as input and outputs a representation for the entire word. Taking the task of cross-lingual event detection as a motivating example, we show that the choice of pooling strategy can have a significant impact on the target language performance. For example, the performance varies by up to 16 absolute $f_{1}$ points depending on the pooling strategy when training in English and testing in Arabic on the ACE task. We carry out our analysis with five different pooling strategies across nine languages in diverse multi-lingual datasets. Across configurations, we find that the canonical strategy of taking just the first subword to represent the entire word is usually sub-optimal. On the other hand, we show that attention pooling is robust to language and dataset variations by being either the best or close to the optimal strategy. For reproducibility, we make our code available at https://github.com/isi-boston/ed-pooling.
[ "Shantanu Agarwal", "Steven Fincke", "Chris Jenkins", "Scott Miller", "Elizabeth Boschee" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11365v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11365v2", "@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.LG" ]
Impact of Subword Pooling Strategy on Cross-lingual Event Detection Shantanu Agarwal*, Steven Fincke*, Chris Jenkins, Scott Miller, Elizabeth Boschee University of Southern California Information Sciences Institute {shantanu, sfincke, cjenkins, smiller, boschee}@isi.edu 3 2 0 2 b e F 3 2 ] L C . s c [ 2 v 5 6 3 1 1 . 2 0 3 2 : v i X r a Abstract Pre-trained multilingual language models (e.g., mBERT, XLM-RoBERTa) have significantly advanced the state-of- the-art for zero-shot cross-lingual information extraction. These language models ubiquitously rely on word segmen- tation techniques that break a word into smaller constituent subwords. Therefore, all word labeling tasks (e.g. named en- tity recognition, event detection, etc.), necessitate a pooling strategy that takes the subword representations as input and outputs a representation for the entire word. Taking the task of cross-lingual event detection as a motivating example, we show that the choice of pooling strategy can have a significant impact on the target language performance. For example, the performance varies by up to 16 absolute f1 points depending on the pooling strategy when training in English and testing in Arabic on the ACE task. We carry out our analysis with five different pooling strategies across nine languages in di- verse multi-lingual datasets. Across configurations, we find that the canonical strategy of taking just the first subword to represent the entire word is usually sub-optimal. On the other hand, we show that attention pooling is robust to language and dataset variations by being either the best or close to the optimal strategy. For reproducibility, we make our code avail- able at https://github.com/isi-boston/ed-pooling. Introduction The goal of event detection (ED) is to identify instances of real-world events in text. Each event consists of a phrase which evokes the event, along with a classification of the event into a pre-specified ontology of event types. For exam- ple, given a sentence Mathias Cormann took office last week, an event detection system for the ACE (Doddington et al. 2004) ontology needs to infer that the phrase took office is an event of type Start-Position. ED is a knowledge extrac- tion step that has been shown to be critical for many NLP applications such as question answering (Yang et al. 2003), information retrieval (Basile et al. 2014), argument extrac- tion (Cheng and Erk 2018), etc. Current ED systems rely on neural network architectures that require large amounts of data for training. Getting high- quality training data for a structured task like ED is chal- lenging and expensive. Because of this, most of the training datasets are available only in English. Bridging the ED per- formance gap between English and other non-English (likely *These authors contributed equally. 2016), (Wu et al. low-resource) languages is an active area of research (e.g. Xu et al. (2021), Fincke et al. (2022), Huang et al. (2022)). Most of the current cross-lingual ED systems leverage pre-trained multilingual language models such as mBERT (Devlin et al. 2019) or XLM-RoBERTa (Conneau et al. 2020). These models rely on data-driven word segmentation techniques such as BPE (Sennrich, Haddow, and Birch 2016), WordPiece SentencePiece (Kudo and Richardson 2018), etc. Working with seg- mented words (subwords) enables models to effectively encode rare words, thus mitigating out-of-vocabulary issues. However, using subwords can pose challenges, particu- larly for word labeling tasks such as event detection. Here, to form a representation for each original word, we must find a way to combine the representations produced by the lan- guage model for each subword. However, coming up with a pooling strategy is challenging. This is particularly true in a zero-shot cross-lingual context, where simple heuristics (e.g., just use the representation for the first subword) are less likely to be applicable for both the source and target languages. In English, for instance, that "first subword" heuristic may be quite reasonable for event detection, since the first sub- word typically carries the most information about the mean- ing of the entire word. As an example, XLM-RoBERTa tok- enizes the English word attacked to attack ed1, with the first subword attack likely being far more useful for classification than ed would be. However, in Arabic, the reverse is often true. The word whAjm2 (translated as "and (he) attacked') gets tokenized as w hAjm, with the subwords meaning "and" and "(he) attacked". Here, it is the last subword that car- ries the most useful meaning for classification and if an ED model were to consider only the representation for the first subword, it might very likely fail to correctly classify this word as an event. In this paper, we explore the impact of different subword- to-word pooling strategies on the zero-shot cross-lingual event detection task. Our main contributions are: • When using massively multilingual models such as XLM-RoBERTa, we show that the choice of the pooling strategy can have a significant impact on the performance 1The ' ' marker is removed for simplicity. 2Buckwalter transliteration is provided for Arabic. of cross-lingual event detection. • Across a diverse set of languages, we show that attention- pooling works best and that the canonical strategy of first-subword pooling can be sub-optimal. • When using bilingual models, i.e. models that only need to share vocabulary across the source (English) and one target language, the cross-lingual performance is less sensitive to the pooling strategy. Related work There is a growing body of work showing how statisti- cal word segmentation methods adversely affect the per- formance of pretrained language models when dealing with morphologically rich languages like Arabic, Hebrew, Turkish, etc. (Amrhein and Sennrich (2021), Keren et al. (2022)). Instead of being completely data-driven, these studies advocate for subword tokenization techniques to be linguistically motivated such that the subwords adhere to morpheme boundaries. Although appealing, coming up with bespoke language-dependent tokenization which scales to a multitude of languages (of the order of 100 as in mBERT/XLM-RoBERTa) is impractical and prohibitively laborious. 'edge-probing' tasks such as constituent Very few studies have looked into the impact of pool- ing strategies on word labeling tasks. Toshniwal et al. (2020) studied the impact of span representation of text for labeling, named entity labeling, semantic role labeling, and coref- erence arc prediction. However, their analysis solely fo- cused on English. Closest to our work is the analysis by ́Acs, K ́ad ́ar, and Kornai (2021). They studied the effect of subword pooling on three tasks: morphological probing, POS tagging and NER. Although their analysis covered lan- guages other than English, they solely focused on the mono- lingual setting. Our work differs in that we probe the effect of subword pooling not on monolingual scenarios but for zero-shot cross-lingual extraction. Datasets We probe the impact of subword pooling on the following diverse set of cross-lingual event detection datasets: BETTER Abstract: Better Extraction from Text Towards Enhanced Retrieval (BETTER) is an information extraction and information retrieval program3. One of the tasks in this program is Abstract event extraction. For this task, training (and validation) data is available only in English and test data is available in English, Arabic, Farsi and Korean. There are no event type distinctions in the Abstract event task4. BETTER Basic Phase-1: In contrast to the Abstract task, the events in the BETTER Basic task have event types asso- ciated with them. The Phase-1 ontology has 69 event types. The training (and validation) annotations are provided for English and test data is available for English and Arabic. 3https://ir.nist.gov/better 4Following the practice of the BETTER program, we drop the quad-class information from the Abstract dataset. BETTER Basic Phase-2: The Phase-2 BETTER Basic task expands the Phase-1 ontology to cover 92 event types. Training (and validation) annotations are provided for En- glish and test data is available for English and Farsi. ACE: The Automatic Content Extraction (ACE) dataset (Doddington et al. 2004) is extensively used in literature to benchmark monolingual and cross-lingual capabilities of information extraction systems. For this task, training, validation, and test data is available in English, Arabic and Chinese. Since Chinese is a non-white-space delim- ited language, we have excluded it from the present ef- fort. To be consistent with previous works (Xu et al. (2021), Fincke et al. (2022), Huang et al. (2022)), we use the same train/dev/test splits as used in (Huang et al. 2022). MINION: An dataset span- event ning eight different introduced by (2022). The MINION dataset Pouran Ben Veyseh et al. borrows its ontology from ACE and has 16 event types. We use the official train/dev/test splits to report our scores. We exclude Japanese from our analysis as it is a non-white-space delimited language. detection languages was Architecture and pooling strategies Suppose we are given a sentence S which, using some word- based tokenizer (spaCy, nltk, etc.), is tokenized to a se- quence of words [w0, w1, . . . , wn]. Then, each word is fur- ther passed through the language model specific tokenizer and gets broken into subwords, i.e. wi → [ti m]. The embedding for each of the subwords is passed to the transformer and we use the hidden state of the last trans- former layer, hi j, as the representation for ti j. A pooling func- tion f takes the hidden states of the subwords and outputs a fixed-dimensional representation, f (hi m), for the word wi. The pooled representation, f (hi m) is then passed through a single layer feed-forward network to clas- sify the word to be either the beginning (B), inside (I) or not (O) a part of an event span. 0, . . . , hi 0, . . . , hi 1, . . . , ti 0, ti The focus of this paper is on the choice of pooling func- tion f . Below we describe five different pooling functions which we explore as part of our event detection system. First subword pooling: We simply take the representa- tion of the first subword as a proxy to represent the whole word: f (hi m) = hi 0. 0, . . . , hi (1) This is the default trigger classification configuration which prior works on event detection typically use, e.g. Fincke et al. (2022). This is also the canonical approach used by Huggingface5, a widely used framework, for bench- marking sequence labeling tasks. Last subword pooling: Take the representation of the last subword as a proxy to represent the whole word: (2) Average pooling: The word representation is the mean of m. m) = hi 0, . . . , hi f (hi all the hidden representations: f (hi 0, . . . , hi m) = 1 m + 1 m X j=0 hi j. (3) 5https://github.com/huggingface Task Lang. First subword Last subword Average IDF Attention BETTER Abstract BETTER Phase-1 BETTER Phase-2 ACE MINION Avg. en ar fa ko en ar en fa en ar en es pt pl tr hi ko - 87.8 59.6 73.9 75.9 66.2 48.2 65.8 53.4 70.2 42.0 79.3 64.5 75.3 64.2 59.5 72.3 65.4 66.0 87.6 74.1 66.1 55.4 67.0 55.3 66.2 50.6 70.2 53.3 79.5 63.6 74.7 62.2 47.9 69.9 40.4 63.7 88.0 67.9 69.0 67.1 66.1 51.0 65.7 51.3 69.9 44.3 79.3 64.2 74.4 64.3 52.2 70.4 52.9 64.5 87.7 76.4 70.6 72.8 66.1 56.7 66.2 53.3 71.5 57.9 79.4 65.0 75.8 64.3 55.5 72.3 54.2 67.3 87.7 78.1 70.4 79.1 64.7 54.6 65.6 53.4 71.3 58.0 79.7 63.7 74.2 64.0 57.8 73.1 63.1 68.1 Table 1: Variation of zero-shot event detection performance across different subword pooling strategies. For a given task and language (i.e. for a particular row), we boldface the highest score and underline the lowest one. All experiments use XLM- RoBERTa large and are trained only on the English training split corresponding to the task. We report the mean f1 score calculated over 4 runs initialized with different random seeds. IDF pooling: A pooling strategy should ideally assign the most weight to the subwords which will best inform the clas- sifier in its decision making process. Because average pool- ing fails to do so and puts equal importance on each sub- word, we hypothesize that average pooling is a sub-optimal strategy. One way to estimate the meaningful information content of a subword is by the frequency at which one observes the subword in a corpus; less frequent subwords have more in- formation than subwords which occur frequently. We quan- tify this notion by assigning each subword, t, its inverse doc- ument frequency (IDF) score: idf (t) = log |W | |w : t ∈ w| , (4) where |W | is the total number of words in a corpus and |w : t ∈ w| is the number of words which contain t as a subword. For pooling, the weights assigned to the subwords are determined by normalizing these idf scores through a softmax: aj = softmax(idf )j m f (hi 0, . . . , hi m) = ajhi j. X j=0 (5) Attention pooling: There are a few drawbacks to the IDF pooling strategy: 1) information we want to extract from a word is task-dependent and IDF may or may not be a good quantitative measure to capture that, 2) the technique relies on calculating the IDF scores on a (large) corpus, thus cou- pling the system performance to the corpus statistics and 3) at test time, one can encounter subwords which are not seen when preparing IDF scores, thus requiring an additional hyper-parameter, i.e. the default IDF score for such unseen subwords. All these limitations can be mitigated through attention pooling where a learnt query vector, v, is used to determine the weight that needs to be assigned to each hidden repre- sentation: αj = v * hi j; aj = softmax(α)j f (hi 0, . . . , hi m) = m X j=0 ajhi j. (6) Results and Analysis In Table 1, we show the zero-shot event detection perfor- mance for all datasets and languages using different subword pooling strategies. For all configurations, we train our mod- els on the English data and use XLM-RoBERTa large as our pre-trained language model. We ensure that the same pool- ing strategy is used for training and testing. We make the following observations: Attention pooling is usually the best or close to the op- timal strategy: By picking a pooling strategy, we impose our prior beliefs about which subwords we think have the most information content. For example, when using First subword pooling, we are assuming that the first subword has the most information necessary for the model to classify whether the word is in an event span or not. Depending on the language of interest, this constraint may or may not be correct and can result in sub-optimal system performance, especially in the zero-shot cross-lingual scenario where the language structure of the source and target languages can be markedly different. In Table 1, we see that attention pooling is either the best or close to being optimal. This can be attributed to the fact that across all the pooling strategies, attention pooling has the least inductive bias; the process of finding which sub- word is important is learnt in an end-to-end manner and no a-priori constraints (either linguistic as in first/last subword or corpus driven as in IDF) are imposed. Variation across pooling strategies is higher for lan- guages with high shattering rate: When pre-training a massively multilingual model such as XLM-RoBERTa, not all languages are represented equally. This non-uniform lan- guage representation often leads to words from low-resource languages (such as Arabic) to split more often than words from high-resource languages (such as English). Shattering rate quantifies this by calculating the average number of sub- words a word is likely to split into. In Table 2, we show the shattering rate of the anchor words for each of the target lan- guages in our experiments along with how variable the tar- get language performance is across various pooling strate- gies. We quantify variation (∆) as the difference between the scores for the best and the worst pooling strategy. From Table 2, we see that high variability is observed with high shattering rates. Task Lang. Shattering rate BETTER Abstract BETTER Phase-1 BETTER Phase-2 ACE MINION en ar fa ko en ar en fa en ar en es pt pl tr hi ko 1.5 2.0 1.2 2.4 1.6 2.0 1.5 1.3 1.5 2.1 1.4 1.6 1.7 2.1 1.7 1.3 2.6 ∆ 0.4 18.5 7.8 23.7 2.3 8.5 0.6 2.8 1.6 16.0 0.4 1.4 1.6 2.1 11.6 3.2 25.0 Table 2: Shattering rate of anchor words in the target lan- guage dataset and sensitivity (∆) to pooling strategies. We further confirm this correlation by experimenting with a language model that rarely splits words in either the source or target language, specifically the bilingual GigaBERT6 6GigaBERT-v4-Arabic-and-English (Lan et al. 2020). GigaBERT is pre-trained only on En- glish and Arabic and has much smaller shattering rates of 1.1/1.3 for English/Arabic as compared to 1.5/2.0 for XLM- RoBERTa. We see from Table 3 that although GigaBERT is not as competitive as XLM-RoBERTa7, the variation (∆) across pooling strategies for GigaBERT is much smaller than for XLM-RoBERTa. Still, high shattering rates alone do not always indi- cate high sensitivity. We see the highest variation in lan- guages where shattering rate is high and individual sub- words frequently represent essentially independent elements of meaning. For instance, Arabic has many short, highly frequent subwords (e.g., conjunctions, prepositions, and the definite marker Al-) which are often attached to content- bearing words. Similarly, Turkish and Korean are languages whose affixes (commonly separated as subwords by XLM- RoBERTa) vary little according to any characteristics of the stem. For example, XLM-RoBERTa tokenizes Turkish yedim "I ate" to yedi m. The affix -m can be attached to a wide variety of words (including both nouns and verbs) but will always convey a sense of the first person singular sub- ject or possessor. We hypothesize that, even though the lan- guage model outputs are contextualized, the representation for these kind of "independent" subwords will tend to be largely independent of the stems to which they attach. If our pooling strategy considers only the output for a word like -m (or weights it too heavily), our task will suffer because we miss the most relevant semantic content. However, this is less likely to happen with languages where the morphological relationships between subwords are more entangled. Spanish, Portuguese and, especially, Polish exhibit rather modest sensitivity despite having ele- vated shattering rates. Affixes in these three languages gen- erally take forms conditioned by characteristics of the stem (e.g. the stem's conjugation class or grammatical gender). We hypothesize that this discourages the language model from entirely disassociating an affix from its stem, meaning that an affix is likely to bear much of the stem's meaning. This reduces sensitivity to pooling strategy, since all sub- words carry some of the meaning necessary to make classi- fication decisions. Monolingual performance is less sensitive to pooling strategies: From Table 1, we see that when we train and test in English, the event detection performance is not very sen- sitive to the pooling strategies (maximum variation is around a couple of f1 point). This can be attributed to two orthog- onal aspects: a) English is a high resource language with a low shattering rate (see Table 2) and b) the sensitivity to the pooling strategy is remarkably low in the monolingual set- ting (which we show next). To remove the confounding effect of low shattering rate and to explicitly elucidate that pooling strategy is less impor- tant in the monolingual scenario, we train and test our event detection system on two languages which have high shat- tering rates: Arabic and Korean. The performance variation across pooling strategies for the monolingual scenario and 7Most likely because GigaBERT is trained on much less En- glish data and has a smaller model capacity than XLM-RoBERTa. Model Shatt. (En/Ar) First subword Last subword Average IDF Attention ∆ XLM-RoBERTa GigaBERT 1.5/2.0 1.1/1.3 59.6 62.6 74.1 63.0 67.9 61.8 76.4 65.4 78.1 65.7 18.5 3.9 Table 3: BETTER Abstract event detection performance across pooling strategies. For all experiments, we train our models on English and evaluate on Arabic. The table provides a comparison between XLM-RoBERTa and GigaBERT. We report mean f1 scores averaged over four randomly initialized seeds. Highest scores are in bold and the lowest are underlined. The last column indicates the variation (∆) across the pooling strategies. The shattering rate for the source and target language (en and ar) for XLM-RoBERTa and GigaBERT is provided in the second column. Task ACE MINION Src./Tgt. Shatt. (Tgt.) First subword Last subword Average IDF Attention ∆ en/ar ar/ar en/ko ko/ko 2.1 2.1 2.6 2.6 42.0 60.5 65.4 74.7 53.3 63.0 40.4 74.5 44.3 61.1 52.9 77.2 57.9 62.4 54.2 77.8 58.0 62.5 63.1 77.1 16.0 2.5 20.0 3.3 Table 4: Event detection performance across pooling strategies. We compare zero-shot cross-lingual case (en/ar and en/ko) with the monolingual scenario (ar/ar and ko/ko). All experiments use XLM-RoBERTa large. We report mean f1 scores averaged over four randomly initialized seeds. Highest scores are in bold and the lowest are underlined. The last column indicates the variation (∆) across the pooling strategies. The shattering rate for the target language (ar for ACE and ko for MINION) is provided in the third column. Task Lang. First subword Last subword Average IDF Attention First stem BETTER Abstract BETTER Phase-1 ACE Avg. ar ar ar ar 59.6 48.2 42.0 49.9 74.1 55.3 53.3 61.6 67.9 51.0 44.3 54.4 76.4 56.7 57.9 63.7 78.1 54.6 58.0 63.6 76.9 56.4 54.4 62.6 Table 5: Event detection performance across pooling strategies, including first stem pooling. All experiments use XLM- RoBERTa large and is trained on English and is evaluated on Arabic. We report mean f1 scores averaged over four randomly initialized seeds. Highest scores are in bold and the lowest are underlined. a comparison of what we get in the zero-shot cross-lingual case (train in English and test in either Arabic or Korean) is shown in Table 4. From the table, we see that even though Arabic and Korean have very high shattering rates, the vari- ability in performance is markedly low in the monolingual scenario (2.5 for Arabic/Arabic and 3.3 in Korean/Korean) compared to the variability in the zero-shot cross-lingual case (16.0 for English/Arabic and 20.0 for English/Korean). Last subword is usually worse than first subword pool- ing: From Table 1, we see that Last subword pooling is clearly worse than First subword, and is usually the low- est scoring strategy. We hypothesize that this is because for most languages in our test set, the stem appears at the begin- ning of the word, meaning that the last subword will have less information content. Arabic, however, is an exception with First subword pro- viding the lowest scores for all three test sets (Better Ab- stract, Better Phase-1 and ACE). This is due to the fact that in Arabic, the beginning of a word commonly contains non- information bearing structures such as conjunctions, prepo- sitions, and the definite marker Al and the future tense prefix. Consistent with this, we find in our morphological analysis of Arabic (detailed in the next section) that the stem of an anchor word overlaps more frequently with the last subword (69%) than with the first subword (60%). Morphology-informed pooling: We now explicitly show that it is important for a pooling strategy to include represen- tations for subwords which have high semantic content. To do this, we identify which subwords best represent a word's morphological stem-the part of a word responsible for its lexical meaning. It is out of scope to develop tools to automatically perform such complex morphological analysis for hundreds of lan- guages of possible interest. However, there has been signifi- cant prior research in computational methods for such work in Arabic, which we leverage here as an illustrative exam- ple. Specifically, we use MADAMIRA (Pasha et al. 2014) to identify affixes or clitics at the beginning or end of an Ara- bic word and to delimit the central portion of the word that constitutes the stem. We then define a new pooling strategy (First stem pooling) in which a word's pooled representation is derived by taking the transformer's hidden representation corresponding to the first subword which overlaps with the stem. We preform our analysis on the Arabic test datasets. The First stem pooling is applied only during extraction; we chose to use the models trained on English with First sub- word pooling because for English, the stem is usually at the beginning. In Table 5, we see that First stem pooling is close to the optimal strategy, highlighting that it is important for a pooling strategy to consider linguistic structures which con- tain high information content. Conclusion This work examines the impact of subword pooling strategy on zero-shot cross-lingual information extraction, specifi- cally focusing on the representative task of event detection. We find that pooling can dramatically influence target lan- guage performance. The sensitivity to pooling is shown to be determined by linguistic differences between source and the target language and how often a target-language word splits. Because the source versus target language variations do not arise in the monolingual scenario, we show that pool- ing strategies do not impact monolingual cases nearly as much as they impact zero-shot cross-lingual transfer. Of all the pooling strategies we examined, attention pooling is ro- bust to language variations and thus adapts best to cross- lingual differences. Acknowledgements This research is based upon work supported in part by the Office of the Director of National Intelligence (ODNI), In- telligence Advanced Research Projects Activity (IARPA), via Contract No. 2019-19051600007. The views and conclu- sions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies, either expressed or implied, of ODNI, IARPA, or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for governmental purposes notwithstanding any copyright annotation therein. References ́Acs, J.; K ́ad ́ar, ́A.; and Kornai, A. 2021. Subword Pooling Makes a Difference. In Proceedings of the 16th Conference of the European Chapter of the Association for Computa- tional Linguistics: Main Volume, 2284–2295. Online: Asso- ciation for Computational Linguistics. Amrhein, C.; and Sennrich, R. 2021. How Suitable Are Subword Segmentation Strategies for Translating Non- Concatenative Morphology? In Findings of the Associa- tion for Computational Linguistics: EMNLP 2021, 689–705. Punta Cana, Dominican Republic: Association for Compu- tational Linguistics. Basile, P.; Caputo, A.; Semeraro, G.; and Siciliani, L. 2014. Extending an Information Retrieval System through Time Event Extraction. In DART@AI*IA. Cheng, P.; and Erk, K. 2018. Implicit Argument Prediction with Event Knowledge. In Proceedings of the 2018 Confer- ence of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), 831–840. New Orleans, Louisiana: Association for Computational Linguistics. Conneau, A.; Khandelwal, K.; Goyal, N.; Chaudhary, V.; Wenzek, G.; Guzm ́an, F.; Grave, E.; Ott, M.; Zettlemoyer, L.; and Stoyanov, V. 2020. Unsupervised Cross-lingual Rep- In Proceedings of the 58th resentation Learning at Scale. Annual Meeting of the Association for Computational Lin- guistics, 8440–8451. Online: Association for Computational Linguistics. Devlin, J.; Chang, M.-W.; Lee, K.; and Toutanova, K. 2019. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Con- ference of the North American Chapter of the Association for Computational Linguistics: Human Language Technolo- gies, Volume 1 (Long and Short Papers), 4171–4186. Min- neapolis, Minnesota: Association for Computational Lin- guistics. Doddington, G.; Mitchell, A.; Przybocki, M.; Ramshaw, L.; Strassel, S.; and Weischedel, R. 2004. The Automatic Con- tent Extraction (ACE) Program – Tasks, Data, and Evalu- In Proceedings of the Fourth International Confer- ation. ence on Language Resources and Evaluation (LREC'04). Lisbon, Portugal: European Language Resources Associa- tion (ELRA). Fincke, S.; Agarwal, S.; Miller, S.; and Boschee, E. 2022. Language Model Priming for Cross-Lingual Event Extrac- tion. In Proceedings of the AAAI Conference on Artificial Intelligence. Huang, K.-H.; Hsu, I.-H.; Natarajan, P.; Chang, K.-W.; and Peng, N. 2022. Multilingual Generative Language Models for Zero-Shot Cross-Lingual Event Argument Extraction. In Proceedings of the 60th Annual Meeting of the Associa- tion for Computational Linguistics (Volume 1: Long Papers), 4633–4646. Dublin, Ireland: Association for Computational Linguistics. Keren, O.; Avinari, T.; Tsarfaty, R.; and Levy, O. 2022. Breaking Character: Are Subwords Good Enough for MRLs After All? Kudo, T.; and Richardson, J. 2018. SentencePiece: A sim- ple and language independent subword tokenizer and deto- kenizer for Neural Text Processing. In Proceedings of the 2018 Conference on Empirical Methods in Natural Lan- guage Processing: System Demonstrations, 66–71. Brussels, Belgium: Association for Computational Linguistics. Lan, W.; Chen, Y.; Xu, W.; and Ritter, A. 2020. GigaBERT: Zero-shot Transfer Learning from English to Arabic. arXiv: Computation and Language. Loshchilov, I.; and Hutter, F. 2019. Decoupled Weight De- cay Regularization. arXiv:1711.05101. Pasha, A.; Al-Badrashiny, M.; Diab, M. T.; Kholy, A. E.; Eskander, R.; Habash, N.; Pooleery, M.; Rambow, O.; and Roth, R. 2014. MADAMIRA: A Fast, Comprehensive Tool for Morphological Analysis and Disambiguation of Arabic. In LREC. Pouran Ben Veyseh, A.; Nguyen, M. V.; Dernoncourt, F.; and Nguyen, T. 2022. MINION: a Large-Scale and Diverse Hyperparameters: We did not perform exhaustive sweeps over hyperparameters, and the values used in our experiments and generally defaulted to values motivated by earlier experiments on similar tasks (Fincke et al. 2022). All experiments were run with the following common hy- perparameters: • optimizer: Optimization was carried out using AdamW (Loshchilov and Hutter 2019). • warmup proportion: Warm-up was set to 0.0. • weight decay: Weight decay was set to 0.0. • gradient accumulation steps: Set to 1. • validation frequency: We perform validation on the vali- dation set after every training epoch. The model with the best validation score (micro-f1) is used to report results on the test set. • seeds: All scores are reported as a mean over runs ini- tialed by 4 different seeds. We used 42, 1234 1729, 7777 as the set of seeds for all our experiments. • training batch size: Set to 16. The hyperparameters which we did vary across tasks are shown below: Task lr epochs seq. length BETTER Abstract BETTER Phase-1 BETTER Phase-2 ACE MINION 5e-5 5e-5 5e-5 5e-6 5e-6 5 50 50 20 20 128 128 128 128 256 Table 7: Learning rate (lr), number of training epochs (train epochs) and maximum sequence length (seq. length) used depending on the task. In Proceedings Dataset for Multilingual Event Detection. of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Lan- guage Technologies, 2286–2299. Seattle, United States: As- sociation for Computational Linguistics. Sennrich, R.; Haddow, B.; and Birch, A. 2016. Neural Machine Translation of Rare Words with Subword Units. In Proceedings of the 54th Annual Meeting of the Associ- ation for Computational Linguistics (Volume 1: Long Pa- pers), 1715–1725. Berlin, Germany: Association for Com- putational Linguistics. Toshniwal, S.; Shi, H.; Shi, B.; Gao, L.; Livescu, K.; and Gimpel, K. 2020. A Cross-Task Analysis of Text Span Rep- resentations. In Proceedings of the 5th Workshop on Repre- sentation Learning for NLP, 166–176. Online: Association for Computational Linguistics. Wu, Y.; Schuster, M.; Chen, Z.; Le, Q. V.; Norouzi, M.; Macherey, W.; Krikun, M.; Cao, Y.; Gao, Q.; Macherey, K.; Klingner, J.; Shah, A.; Johnson, M.; Liu, X.; Kaiser, L.; Gouws, S.; Kato, Y.; Kudo, T.; Kazawa, H.; Stevens, K.; Kurian, G.; Patil, N.; Wang, W.; Young, C.; Smith, J.; Riesa, J.; Rudnick, A.; Vinyals, O.; Corrado, G.; Hughes, M.; and Dean, J. 2016. Google's Neural Machine Translation Sys- tem: Bridging the Gap between Human and Machine Trans- lation. CoRR, abs/1609.08144. Xu, H.; Ebner, S.; Yarmohammadi, M.; White, A. S.; Van Durme, B.; and Murray, K. 2021. Gradual Fine-Tuning for Low-Resource Domain Adaptation. Yang, H.; Chua, T.-S.; Wang, S.; and Koh, C.-K. 2003. Structured Use of External Knowledge for Event-Based Open Domain Question Answering. In Proceedings of the 26th Annual International ACM SIGIR Conference on Re- search and Development in Informaion Retrieval, SIGIR '03, 33–40. New York, NY, USA: Association for Comput- ing Machinery. ISBN 1581136463. Reproducibility Information Machine configuration and software libraries: All experi- ments were run on a single GPU, Quadro RTX 8000 (48GB). Software library versions are provided in Table 6. Module cudatoolkit nltk pip python pytorch pytorch-crf seqeval spacy tensorboard torchvision transformers Version 10.2.89 3.4.5 20.1.1 3.6.9 1.6.0 0.7.2 1.2.2 2.3.2 2.3.0 0.7.0 3.5.1 Table 6: Software library versions used for all experiments.
http://arxiv.org/abs/2302.11362v2
2023-05-03T05:06:51
2023-02-22T13:31:13
Gradient Remedy for Multi-Task Learning in End-to-End Noise-Robust Speech Recognition
Speech enhancement (SE) is proved effective in reducing noise from noisy speech signals for downstream automatic speech recognition (ASR), where multi-task learning strategy is employed to jointly optimize these two tasks. However, the enhanced speech learned by SE objective may not always yield good ASR results. From the optimization view, there sometimes exists interference between the gradients of SE and ASR tasks, which could hinder the multi-task learning and finally lead to sub-optimal ASR performance. In this paper, we propose a simple yet effective approach called gradient remedy (GR) to solve interference between task gradients in noise-robust speech recognition, from perspectives of both angle and magnitude. Specifically, we first project the SE task's gradient onto a dynamic surface that is at acute angle to ASR gradient, in order to remove the conflict between them and assist in ASR optimization. Furthermore, we adaptively rescale the magnitude of two gradients to prevent the dominant ASR task from being misled by SE gradient. Experimental results show that the proposed approach well resolves the gradient interference and achieves relative word error rate (WER) reductions of 9.3% and 11.1% over multi-task learning baseline, on RATS and CHiME-4 datasets, respectively. Our code is available at GitHub.
[ "Yuchen Hu", "Chen Chen", "Ruizhe Li", "Qiushi Zhu", "Eng Siong Chng" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11362v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11362v2", "@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" ]
GRADIENT REMEDY FOR MULTI-TASK LEARNING IN END-TO-END NOISE-ROBUST SPEECH RECOGNITION Yuchen Hu1, Chen Chen1, Ruizhe Li2, Qiushi Zhu3, Eng Siong Chng1 1Nanyang Technological University, Singapore 2University of Aberdeen, UK 3University of Science and Technology of China, China 3 2 0 2 y a M 3 ] S A . s s e e [ 2 v 2 6 3 1 1 . 2 0 3 2 : v i X r a ABSTRACT Speech enhancement (SE) is proved effective in reducing noise from noisy speech signals for downstream automatic speech recognition (ASR), where multi-task learning strategy is employed to jointly op- timize these two tasks. However, the enhanced speech learned by SE objective may not always yield good ASR results. From the opti- mization view, there sometimes exists interference between the gra- dients of SE and ASR tasks, which could hinder the multi-task learn- ing and finally lead to sub-optimal ASR performance. In this paper, we propose a simple yet effective approach called gradient remedy (GR) to solve interference between task gradients in noise-robust speech recognition, from perspectives of both angle and magnitude. Specifically, we first project the SE task's gradient onto a dynamic surface that is at acute angle to ASR gradient, in order to remove the conflict between them and assist in ASR optimization. Furthermore, we adaptively rescale the magnitude of two gradients to prevent the dominant ASR task from being misled by SE gradient. Experimen- tal results show that the proposed approach well resolves the gradient interference and achieves relative word error rate (WER) reductions of 9.3% and 11.1% over multi-task learning baseline, on RATS and CHiME-4 datasets, respectively. Our code is available at GitHub1. Index Terms- Gradient remedy, multi-task learning, speech enhancement, noise-robust speech recognition, gradient interference 1. INTRODUCTION Speech enhancement (SE) [1–4] is proved effective in reducing noise from the noisy speech signals to improve speech quality for down- stream tasks, e.g., automatic speech recognition (ASR) [5–9]. Prior work [10] proposed a cascaded SE and ASR system using final ASR training objective for optimization. Later studies [11, 12] believed that the SE training objective can direct the enhancement module to produce better enhanced speech for downstream ASR. Therefore, they proposed a multi-task learning strategy to jointly optimize the SE and ASR tasks, as shown in Figure 1(a). In this way, the front-end SE module is supervised by both tasks, where ASR is the dominant task we target at and SE serves as an auxiliary task to benefit ASR. However, recent work [13, 14] found that apart from noise, SE could also reduce some speech information important for ASR, so that the enhanced speech learned by SE objective may not always yield good ASR results. From the optimization view, we can observe some interference between the gradients of SE and ASR tasks, which could hinder the multi-task learning and finally degrade the ASR performance. Firstly, the angle between two gradients sometimes exceeds 90◦ (See Figure 1(b)), which means that they are conflicting. Therefore, the auxiliary SE task would hinder, instead of assist in, the optimization of dominant ASR task. Secondly, the magnitude of 1https://github.com/YUCHEN005/Gradient-Remedy Fig. 1. Block diagrams of (a) multi-task learning of SE and ASR, and our gradient remedy approach: (b) gradient projection, (c) gradient rescale. The G denotes gradient, and θ is a dynamic acute angle. SE gradient sometimes becomes much larger than ASR gradient (See solid arrows in Figure 1(c)), which we define as wrongly dominant since SE is only the auxiliary task. In this case, it would dominate the overall gradient and thus mislead the ASR task's optimization. Recent work [15, 16] proposed a projecting conflicting gradi- ents (PCGrad) method to avoid conflict in multi-task learning, which projects a task's gradient onto the normal plane of other conflicting task gradients, as shown in Figure 2(a). In this way, it could remove the conflict but may not solve the problem of wrongly dominant gra- dient. Some other works [17,18] proposed to learn dynamic weights to balance different training objectives in multi-task learning, from the perspective of loss optimization trends, which could be effective in alleviating the wrongly dominant SE gradient. However, they did not consider the priority of different tasks, so that this strategy may also weaken the dominant role of ASR in our system. In this paper, we propose a simple yet effective approach called gradient remedy (GR) to solve interference between task gradients in noise-robust speech recognition, from perspectives of both angle and magnitude. Specifically, we first project the conflicting SE gradient onto a dynamic surface that is at acute angle to ASR gradient, instead of the normal plane in PCGrad. In this way, we can not only remove the conflict between them, but also push SE gradient to help optimize the dominant ASR task. Furthermore, in case of wrongly dominant SE gradient, we adaptively rescale the magnitude of two gradients to prevent it from misleading the ASR task, highlighting the dominant role of ASR in our system. Experimental results show that our GR approach well resolves the gradient interference and improves the final ASR performance under different-level noisy conditions. To the best of our knowledge, this is the first work to harmonize gradients for multi-task learning in noise-robust speech recognition. noisyspeechSEASR(a)enhancedspeech(b)(c) Fig. 2. Comparison of (a) PCGrad method [15], and (b) our proposed gradient projection method. 2. PROPOSED METHOD 2.1. System Overview As illustrated in Figure 1(a), we follow the architecture of multi- task learning system. The noisy speech is first sent into speech en- hancement module to obtain the enhanced speech, so that we can calculate a SE loss LSE by comparing it with the ground-truth clean speech. Then, the enhanced speech is sent into the ASR module to generate recognized tokens, which are used to calculate the cross- entropy based ASR loss LASR by compared to the ground-truth tran- scriptions. According to the multi-task learning strategy, these two losses would be weight summed to form the final training objective: L = (1 − λASR) * LSE + λASR * LASR, where λASR is a weighting parameter to balance two objectives. From the back-propagation view, we denote the SE task gradi- ent as GSE = ∇v[(1 − λASR) * LSE], and the ASR task gradient as GASR = ∇v[λASR * LASR], where v stands for model parameters. As shown in Figure 1, GSE goes back through the SE module only (blue arrows), and GASR passes both ASR and SE modules (red arrows). Therefore, the SE module would be optimized by both gradients, thus its overall gradient can be expressed as: G = GSE + GASR, (1) However, there sometimes exists interference between the task gradients GSE and GASR, which could hinder the multi-task learning and finally lead to sub-optimal ASR performance. To this end, we propose a gradient remedy approach to solve the interference prob- lem, which generates two new task gradients that harmony with each other, i.e., Ggr SE and Ggr ASR. Then we obtain the final gradient Ggr as follows for SE module's optimization: Ggr = Ggr SE + Ggr ASR, (2) 2.2. Interfered Gradients During the multi-task learning process, we can observe some inter- ference between the gradients of SE and ASR tasks, indicating that the auxiliary SE task may not always benefit the dominant ASR task. Such interference can be classified into two categories, i.e., conflict- ing gradient and wrongly dominant gradient. Conflicting Gradient. We denote the angle between task gradients GSE and GASR as φ, and we define the gradients as conflicting when φ > 90◦. As shown in Figure 2, GSE and GASR are contradicting each other, which means the auxiliary SE task is hindering, instead of assisting in, the dominant ASR task. Wrongly Dominant Gradient. We define SE gradient as wrongly dominant when its magnitude is much larger than that of ASR gra- dient (See Figure 3), i.e., (cid:107)Ggp SE (cid:107)2 > K * (cid:107)GASR(cid:107)2, where K > 1 is a threshold hyper-parameter. In this case, the overall gradient that equals to their sum would be dominated by the SE gradient, which would mislead the optimization of dominant ASR task and finally degrade its performance. In particular, the larger angle between them (denoted as θ(cid:48) in Figure 3), the overall gradient will deviate more from ASR gradient, which results in more misleading. Fig. 3. Block diagram of our proposed gradient rescale strategy. 2.3. Gradient Remedy (GR) In this work, we propose a simple yet effective approach called gra- dient remedy to solve interference between SE and ASR gradients. Specifically, we first propose a gradient projection method to remove the conflicting component in SE gradient, as well as push it to as- sist in ASR optimization. Furthermore, we design a gradient rescale strategy to prevent the dominant ASR task from being misled by SE gradient, highlighting the dominant role of ASR in our system. In particular, we operate on the gradients of each layer in SE module, which are flatten to 1-dimensional long vectors in advance and reshaped back after remedy to form the final gradient. 2.3.1. Gradient Projection As shown in Figure 2(a), PCGrad projects GSE onto the normal plane of GASR, removing the conflicting component in SE gradient. Differ to PCGrad, we propose a novel method in Figure 2(b) to project GSE onto a dynamic surface that is at acute angle θ to GASR. In this way, we can not only remove the conflict, but also push SE gradient to help optimize the dominant ASR task. According to Figure 2(b), our gradient projection method can be mathematically formulated as: Ggp GSE, SE = (cid:26) GSE + (cid:107)GSE(cid:107)2 * (cid:0) sin φ tan θ − cos φ(cid:1) * GASR if φ > 90◦ otherwise. (3) where φ is the angle between GSE and GASR, and θ is a dynamic angle that we design as: (cid:107)GASR(cid:107)2 , θ = arctan (cid:107)GSE(cid:107)2 (cid:107)GASR(cid:107)2 , (4) where (cid:107)GSE(cid:107)2 ∈ (0, +∞), so that θ ∈ (0, 90◦). The idea behind (cid:107)GASR(cid:107)2 this design is to control steady projection. In particular, when the magnitude of SE gradient is small relative to ASR gradient, we set a small θ to push GSE more towards the GASR, i.e., large sin φ tan θ in Equation 3. On the contrary, if the magnitude of GSE is much larger than GASR, then we employ a relatively large θ to project GSE less towards the direction of GASR. Therefore, with such a dynamic θ, we can control the projected SE gradient Ggp SE to steadily assist in ASR optimization, which stabilizes the entire system training. According to Equation 3, the resulted angle between Ggp SE and GASR equals to either θ or φ, depending on whether φ exceeds 90◦. For simplicity, we denote it as θ(cid:48) in Figure 3 and following sections. 2.3.2. Gradient Rescale After gradient projection, the conflicting gradient can be avoided but the wrongly dominant SE gradient may still exist. To further solve this problem, we propose a gradient rescale strategy in Figure 3 to adaptively compress the SE gradient and stretch the ASR gradient, in case that (cid:107)Ggp SE (cid:107)2 > K * (cid:107)GASR(cid:107)2, where K is the threshold. Our strategy is mathematically formulated as: (Ggr SE , Ggr ASR) = (cid:26)(Ggp (Ggp SE * r, GASR /r) , if (cid:107)Ggp SE , GASR) , otherwise. SE (cid:107)2 > K * (cid:107)GASR(cid:107)2 we set an adaptive ratio r = cos θ(cid:48) to compress the Ggp behind it is that, in case θ(cid:48) is small, which means Ggp (5) SE . The idea SE aligns well (a)(b) with GASR, so that the overall gradient will not deviate much from GASR, resulting in less misleading. In this case, it is unnecessary to compress Ggp SE a lot, so that we set a relatively large ratio r = cos θ(cid:48). In contrast, when θ(cid:48) increases, the wrongly dominant Ggp SE would increasingly mislead the ASR optimization, thus we need a smaller r to perform more compression on Ggp SE . In this way, we can adaptively compress SE gradient to avoid misleading the dominant ASR task. Apart from compressing SE gradient, we also use 1/r as ratio to stretch the ASR gradient accordingly, in order to further highlight the dominant role of ASR in our system. 3. EXPERIMENTS AND RESULTS 3.1. Datasets We conduct experiments on two datasets, one is Robust Automatic Transcription of Speech (RATS) [19] which consists of extremely noisy radio communication speech, and the other is CHiME-4 [20] dataset that contains far-field speech under normal noisy conditions. The RATS dataset comprises eight parallel channels and in this work we use the Channel-A subset only, which consists of 44 hours of training data, 5 hours of valid data and 8 hours of test data. Since RATS dataset is chargeable by LDC, we release its fbank features and several listening samples on GitHub for reference2. The CHiME-4 dataset3 consists of three partitions: clean data, real noisy data and simulated noisy data. The clean data is based on WSJ0 [21] training set (si tr s). The real noisy data is recorded in four different noisy environments, i.e., bus, cafe, pedestrian area and street junction. The simulated noisy data is generated by mixing the clean data with background noise recorded in the above four envi- ronments. In this work, we utilize both the real and simulated noisy data of 1-channel track to evaluate our method. 3.2. Experimental Setup 3.2.1. Network Configurations The multi-task learning system consists of two modules: SE mod- ule and ASR module. The SE module follows prior work [12] to predict a mask for noisy speech feature's magnitude, using 3 lay- ers of 896-unit bidirectional long short-term memory (BLSTM) [22] and a 257-unit linear layer followed by ReLU activation function, which contain 43.7 millions of parameters. Then we leverage the state-of-the-art Conformer [23] for ASR module, where its encoder consists of 12 Conformer blocks, and the decoder contains 6 trans- former [24] blocks, with the embedding dimension/feed-forward di- mension/attention heads set to 256/2048/4. We employ 1000 byte- pair-encoding (BPE) [25] tokens to model the ASR output. The system is optimized by Adam algorithm [26], where the learning rate warms up linearly to 0.002 in first 25,000 steps and then decreases proportional to the inverse square root of training steps. We train 50 epochs for experiments on RATS dataset and 100 epochs for CHiME-4 dataset. The weighting parameter λASR is set to 0.7, the threshold K is set to 5, and batch size is set to 64. We also build a 2-layer 650-unit RNNLM on training text for rescoring during inference. All hyper-parameters are tuned on validation set. 3.2.2. Reference Baselines We build five competitive baselines to evaluate our proposed GR approach. For fair comparison, we adopt same architectures and configurations for all the SE modules and ASR modules included. Therefore, our approach requires no extra model parameters com- pared to the multi-task learning baseline. 2https://github.com/YUCHEN005/RATS-Channel-A-Speech-Data 3https://spandh.dcs.shef.ac.uk/chime_challenge/CHiME4 Table 1. WER% results of the proposed gradient remedy approach and competitive baselines on RATS Channel-A dataset. Method WER% E2E-ASR [23] Cascaded SE-ASR [10] Multi-Task Learning [12] Dynamic Weights [18] PCGrad [15] Gradient Remedy (ours) 54.3 53.1 51.8 50.9 50.5 47.0 Table 2. WER% results of the proposed gradient remedy approach and competitive baselines on CHiME-4 1-Channel Track dataset. "Dev" and "Test" denote the WER% results on development set and test set, respectively. "real" and "simu" denote real noisy subset and simulated noisy subset, respectively. Method E2E-ASR [23] Cascaded SE-ASR [10] Multi-Task Learning [12] Dynamic Weights [18] PCGrad [15] Gradient Remedy (ours) Dev Test real simu real simu 8.1 7.7 7.2 7.0 6.9 6.3 9.6 9.2 8.7 8.6 8.4 7.8 14.9 14.4 13.8 13.5 13.3 12.2 16.1 15.6 14.9 14.6 14.5 13.4 1. E2E ASR [23]: an end-to-end ASR system based on Con- former. It has achieved the state-of-the-art on ASR, but may not perform well for noise-robust speech recognition. 2. Cascaded SE-ASR [10]: a cascaded system consisting of a front-end SE module and a back-end ASR module. The sys- tem is optimized with ASR training objective only. 3. Multi-Task Learning [12]: a same structure as cascaded SE- ASR system, which adopts multi-task learning strategy to op- timize the SE and ASR tasks simultaneously. 4. Dynamic Weights [18]: based on multi-task learning system, learns dynamic weights to balance SE and ASR training ob- jectives, enabling their optimization with equal importance. 5. PCGrad [15]: based on multi-task learning system, employs PCGrad to avoid conflict between SE and ASR gradients. 3.3. Results We report experimental results in terms of word error rate (WER), as our target is ASR performance while SE is only auxiliary task. 3.3.1. Gradient Remedy vs. Other Competitive Methods Table 1 summarizes the comparison between our proposed gradient remedy approach and other competitive methods on RATS Channel- A dataset. Specifically, E2E ASR system yields 54.3% WER result, indicating the high difficulty of recognizing extremely noisy speech. Cascaded SE-ASR system slightly improves the performance with help of SE module. Multi-task learning method further lowers the WER result and achieves 2.5% absolute improvement over E2E ASR baseline, indicating that the SE training objective is overall beneficial to downstream ASR task. Dynamic weights and PCGrad strategies continue to improve by alleviating the gradient interference in multi- task learning, but they are quite limited. Finally, our gradient remedy approach obtains the best result with 9.3% relative WER reduction over multi-task learning baseline (51.8%→47.0%), as well as 3.5% absolute improvement over the best PCGrad baseline. Table 3. WER% results of gradient projection on RATS Channel-A dataset. To evaluate our designed dynamic θ in Equation 4, we build several baselines with fixed θ throughout the training process. Method Multi-Task Learning [12] + Gradient Projection θ◦ - 90 60 45 36 30 Dynamic (ours) WER% 51.8 50.5 50.0 49.6 49.5 49.8 48.8 Table 4. WER% results of gradient rescale on RATS Channel-A dataset. To evaluate our designed adaptive ratio r = cos θ(cid:48) for Equa- K as well as constants (i.e., 1/2, 1/3) for tion 5, we set r = 1/ comparison. Different threshold K are also used for ablation study. √ Method Gradient Projection + Gradient Rescale r K 1/2 1/3 √ 1/ K cos θ(cid:48) - 2 3 5 6 8 48.8 49.6 48.7 47.7 47.9 48.5 49.9 48.9 48.0 47.8 48.1 49.4 48.5 47.6 47.8 48.3 49.1 47.8 47.0 47.3 47.6 the effect of removing gradient conflict. Then, our proposed gradient projection with fixed acute angle θ achieves further improvements, where fixing θ to 36◦ performs the best (49.5% WER), suggesting that it is effective to push SE gradient to assist in ASR optimiza- tion. Finally, our designed dynamic θ in Equation 4 achieves the best performance with 3.0% absolute WER improvement over multi-task learning baseline (51.8%→48.8%), indicating the effectiveness of applying dynamic projection to steadily assist in ASR optimization. 3.3.4. Effect of Gradient Rescale √ We finally report the effect of gradient rescale strategy in Table 4. Firstly, our adaptive ratio r = cos θ(cid:48) consistently outperforms the K that simply rescales SE and ASR gradients to a similar mag- 1/ nitude, indicating the effectiveness of our adaptive rescale strategy. In addition, constant ratios (i.e., 1/2, 1/3) can also improve WER but less than the above two designs. Then for the choice of threshold K, we observe that small K (= 2) degrades the WER performance (48.8%→49.1%), as too loose threshold would lead to overmuch rescale. As K increases, we achieve some improvements and obtain the best result at K = 5, with 1.8% absolute WER reduction over gradient projection baseline (48.8%→47.0%). However, further in- creasing K weakens the improvement, as too strict threshold sig- nificantly reduces the chance that our rescale strategy get triggered. 4. CONCLUSION In this paper, we propose a gradient remedy approach to solve inter- ference between task gradients in noise-robust speech recognition. Specifically, we first project the SE gradient onto a dynamic surface that is at acute angle to ASR gradient, in order to remove their con- flict and assist in the ASR optimization. Furthermore, we adaptively rescale the magnitude of two gradients to prevent the dominant ASR task being misled by SE gradient. Experimental results on RATS Channel-A and CHiME-4 1-Channel Track datasets show that the proposed gradient remedy approach well resolves the gradient inter- ference and significantly outperforms the competitive baselines. Fig. 4. Percentage% of conflicting gradient in all layers of SE mod- ule during training on RATS Channel-A dataset. The percentage value of each epoch is obtained by averaging all the batches in it. Fig. 5. Percentage% of wrongly dominant gradient (K = 5) in all layers of SE module during training on RATS Channel-A dataset. Table 2 further compares our gradient remedy approach with the baselines on CHiME-4 1-Channel Track dataset. We observe that the proposed GR approach achieves average relative WER improvement of 11.1% over the multi-task learning baseline. As a result, our proposed gradient remedy approach shows its effectiveness on both extremely noisy radio-communication RATS data and the normally noisy far-field CHiME-4 data. 3.3.2. Effect of Gradient Remedy on Interfered Gradients To further show the effect of gradient remedy on interfered gradients, we present the percentage of conflicting and wrongly dominant gra- dients in all SE module layers in Figure 4 and 5. Firstly, we observe that the multi-task learning system suffers a lot from gradient con- flict, while the dynamic weights strategy cannot solve it. In compar- ison, our gradient remedy approach completely removes the conflict, same as the PCGrad method. Then in Figure 5, we observe that the multi-task learning system also suffers seriously from wrongly dom- inant gradient. PCGrad method slightly alleviates this problem as it reduces some of SE gradient's magnitude (See Figure 2(a)), while our gradient projection method makes it worse, since the designed acute angle θ in Figure 2(b) could lead to larger SE gradient magni- tude than original. Dynamic weights strategy further alleviates it by balancing different training objectives. Finally, our gradient remedy approach best solves this problem by adaptively rescaling gradient magnitudes, with only few wrongly dominant gradients remaining. 3.3.3. Effect of Gradient Projection We further report the effect of gradient projection method in Table 3. Based on the multi-task learning baseline, the PCGrad method with θ = 90◦ achieves some improvement (51.8%→50.5%), indicating 5. REFERENCES [1] Yuxuan Wang, Arun Narayanan, and DeLiang Wang, "On training targets for supervised speech separation," IEEE/ACM Transactions on Audio, Speech, and Language Processing, vol. 22, no. 12, pp. 1849–1858, 2014. [2] Santiago Pascual, Antonio Bonafonte, and Joan Serr`a, "Segan: Speech enhancement generative adversarial network," arXiv preprint arXiv:1703.09452, 2017. [3] Zhong-Qiu Wang, Peidong Wang, and DeLiang Wang, "Com- plex spectral mapping for single-and multi-channel speech en- hancement and robust asr," IEEE/ACM transactions on au- dio, speech, and language processing, vol. 28, pp. 1778–1787, 2020. [4] Chengyu Zheng, Xiulian Peng, Yuan Zhang, Sriram Srini- vasan, and Yan Lu, "Interactive speech and noise modeling for speech enhancement," in Proceedings of the AAAI Conference on Artificial Intelligence, 2021, vol. 35, pp. 14549–14557. [5] Chen Chen, Nana Hou, Yuchen Hu, Shashank Shirol, and Eng Siong Chng, "Noise-robust speech recognition with 10 minutes unparalleled in-domain data," in ICASSP 2022-2022 IEEE International Conference on Acoustics, Speech and Sig- nal Processing (ICASSP). IEEE, 2022, pp. 4298–4302. [6] Chen Chen, Yuchen Hu, Nana Hou, Xiaofeng Qi, Heqing Zou, and Eng Siong Chng, "Self-critical sequence training for auto- matic speech recognition," in ICASSP 2022-2022 IEEE Inter- national Conference on Acoustics, Speech and Signal Process- ing (ICASSP). IEEE, 2022, pp. 3688–3692. [7] Qiu-Shi Zhu, Jie Zhang, Zi-Qiang Zhang, Ming-Hui Wu, Xin Fang, and Li-Rong Dai, "A noise-robust self-supervised pre- training model based speech representation learning for auto- matic speech recognition," in ICASSP 2022-2022 IEEE Inter- national Conference on Acoustics, Speech and Signal Process- ing (ICASSP). IEEE, 2022, pp. 3174–3178. [8] Qiu-Shi Zhu, Jie Zhang, Zi-Qiang Zhang, and Li-Rong Dai, "Joint training of speech enhancement and self-supervised model for noise-robust asr," arXiv preprint arXiv:2205.13293, 2022. [9] Qiu-Shi Zhu, Long Zhou, Jie Zhang, Shu-Jie Liu, Yu-Chen Hu, and Li-Rong Dai, "Robust data2vec: Noise-robust speech representation learning for asr by combining regres- arXiv preprint sion and improved contrastive learning," arXiv:2210.15324, 2022. [10] Aswin Shanmugam Subramanian, Xiaofei Wang, Mu- rali Karthick Baskar, Shinji Watanabe, Toru Taniguchi, Dung Tran, and Yuya Fujita, "Speech enhancement using end-to- end speech recognition objectives," in 2019 IEEE Workshop on Applications of Signal Processing to Audio and Acoustics (WASPAA). IEEE, 2019, pp. 234–238. [11] Ashutosh Pandey, Chunxi Liu, Yun Wang, and Yatharth Saraf, "Dual application of speech enhancement for automatic speech in 2021 IEEE Spoken Language Technology recognition," Workshop (SLT). IEEE, 2021. [12] Duo Ma, Nana Hou, Haihua Xu, Eng Siong Chng, et al., "Multitask-based joint learning approach to robust asr for ra- dio communication speech," in 2021 Asia-Pacific Signal and Information Processing Association Annual Summit and Con- ference (APSIPA ASC). IEEE, 2021, pp. 497–502. [13] Yuchen Hu, Nana Hou, Chen Chen, and Eng Siong Chng, "Interactive feature fusion for end-to-end noise-robust speech recognition," in ICASSP 2022-2022 IEEE International Con- ference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2022, pp. 6292–6296. [14] Yuchen Hu, Nana Hou, Chen Chen, and Eng Siong Chng, "Dual-path style learning for end-to-end noise-robust speech recognition," arXiv preprint arXiv:2203.14838, 2022. [15] Tianhe Yu, Saurabh Kumar, Abhishek Gupta, Sergey Levine, "Gradient surgery for Karol Hausman, and Chelsea Finn, multi-task learning," Advances in Neural Information Process- ing Systems, vol. 33, pp. 5824–5836, 2020. [16] Beier Zhu, Yulei Niu, Yucheng Han, Yue Wu, and Hanwang Zhang, "Prompt-aligned gradient for prompt tuning," arXiv preprint arXiv:2205.14865, 2022. [17] Michelle Guo, Albert Haque, De-An Huang, Serena Yeung, and Li Fei-Fei, "Dynamic task prioritization for multitask learning," in Proceedings of the European conference on com- puter vision (ECCV), 2018, pp. 270–287. [18] Rick Groenendijk, Sezer Karaoglu, Theo Gevers, and Thomas Mensink, "Multi-loss weighting with coefficient of variations," in Proceedings of the IEEE/CVF winter conference on applica- tions of computer vision, 2021, pp. 1469–1478. [19] David Graff, Kevin Walker, Stephanie M. Strassel, Xiaoyi Ma, Karen Jones, and Ann Sawyer, "The rats collection: Support- ing hlt research with degraded audio data," in Proceedings of the Ninth International Conference on Language Resources and Evaluation. 2014, pp. 1970–1977, European Language Re- sources Association (ELRA). [20] Emmanuel Vincent, Shinji Watanabe, Jon Barker, and Ri- card Marxer, "The 4th chime speech separation and recognition challenge," URL: http://spandh. dcs. shef. ac. uk/chime challenge/(last accessed on 1 August, 2018), 2016. [21] Douglas B Paul and Janet Baker, "The design for the wall street journal-based csr corpus," in Speech and Natural Lan- guage: Proceedings of a Workshop Held at Harriman, New York, February 23-26, 1992, 1992. [22] Sepp Hochreiter and J ̈urgen Schmidhuber, "Long short-term memory," Neural Computation, vol. 9, no. 8, pp. 1735–1780, 1997. [23] Anmol Gulati, James Qin, Chiu Chung-Cheng, Niki Par- mar, Yu Zhang, Jiahui Yu, Wei Han, Shibo Wang, Zheng- dong Zhang, Yonghui Wu, and Ruoming Pang, "Conformer: Convolution-augmented transformer for speech recognition," in Interspeech, 2020, pp. 5036–5040. [24] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszko- reit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin, "Attention is all you need," in Advances in neural information processing systems, 2017, pp. 5998–6008. [25] Taku Kudo and John Richardson, "Sentencepiece: A simple and language independent subword tokenizer and detokenizer for neural text processing," in Proceedings of the 2018 Con- ference on Empirical Methods in Natural Language Process- ing: System Demonstrations. 2018, pp. 66–71, Association for Computational Linguistics. [26] Diederik P. Kingma and Jimmy Ba, "Adam: A method for arXiv preprint arXiv:1412.6980, stochastic optimization," 2014.
http://arxiv.org/abs/2302.11354v1
2023-02-22T12:59:38
2023-02-22T12:59:38
Learning Dynamic Graph Embeddings with Neural Controlled Differential Equations
This paper focuses on representation learning for dynamic graphs with temporal interactions. A fundamental issue is that both the graph structure and the nodes own their own dynamics, and their blending induces intractable complexity in the temporal evolution over graphs. Drawing inspiration from the recent process of physical dynamic models in deep neural networks, we propose Graph Neural Controlled Differential Equation (GN-CDE) model, a generic differential model for dynamic graphs that characterise the continuously dynamic evolution of node embedding trajectories with a neural network parameterised vector field and the derivatives of interactions w.r.t. time. Our framework exhibits several desirable characteristics, including the ability to express dynamics on evolving graphs without integration by segments, the capability to calibrate trajectories with subsequent data, and robustness to missing observations. Empirical evaluation on a range of dynamic graph representation learning tasks demonstrates the superiority of our proposed approach compared to the baselines.
[ "Tiexin Qin", "Benjamin Walker", "Terry Lyons", "Hong Yan", "Haoliang Li" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11354v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11354v1", "@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 2 2 ] G L . s c [ 1 v 4 5 3 1 1 . 2 0 3 2 : v i X r a Learning Dynamic Graph Embeddings with Neural Controlled Differential Equations Tiexin Qin City University of Hong Kong Benjamin Walker University of Oxford Terry Lyons University of Oxford Hong Yan City University of Hong Kong Haoliang Li City University of Hong Kong [email protected] [email protected] [email protected] [email protected] [email protected] Abstract This paper focuses on representation learning for dynamic graphs with temporal interactions. A fundamental issue is that both the graph structure and the nodes own their own dynamics, and their blending induces intractable complexity in the temporal evolution over graphs. Drawing inspiration from the recent process of physical dynamic models in deep neural networks, we propose Graph Neural Controlled Differential Equation (GN-CDE) model, a generic differential model for dynamic graphs that characterise the continuously dynamic evolution of node embedding trajectories with a neural network parameterised vector field and the derivatives of interactions w.r.t. time. Our framework exhibits several desirable characteristics, including the ability to express dynamics on evolving graphs without integration by segments, the capability to calibrate trajectories with subsequent data, and robustness to missing observations. Empirical evaluation on a range of dynamic graph representation learning tasks demonstrates the superiority of our proposed approach compared to the baselines. Keywords: Dynamic graph, embedding learning, controlled differential equation 1. Introduction Graph representation learning analyzes complex structured data by representing node attributes and relationships in a low-dimensional vector space. In recent years, it has attracted increasing attention owing to the prevalent presence of graph-structured data. The use of deep neural networks, particularly graph neural networks (GNNs), has further facilitated the ability of graph representation learning to represent nodes. For example, GNNs have been used to study social media (Fan et al. 2019; Sankar et al. 2021), protein interactions (Gainza et al. 2020), traffic flow forecasting (Lan et al. 2022), and neuroscience (Bessadok et al. 2022). Many applications of graph representation learning involve temporal interactions, yet most existing methods do not consider such dynamics. As Xu et al. (2020) pointed out, ignoring the temporal evolution in dynamic graphs can result in suboptimal performance. In certain scenarios, the dynamic structure holds key insights into the system. For example, when using a pandemic model to predict the spread of infection, the evolution of social relationships due to human events © T. Qin, B. Walker, T. Lyons, H. Yan & H. Li. GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION (e.g., immigration, travel, education) must be taken into account (Zhong 2021). In another example, malignant cells within tumors secrete proteins that influence neighboring stromal cells and create an environment conducive to their growth and metastasis (Podhajcer et al. 2008). For more examples, see Kazemi et al. (2020). In this article, we focus upon the realm of representation learning for dynamic graphs, where explicitly modeling both the time- and node-dependent interactions is generally required to better represent temporal evolution and the dynamic nature of the data. Despite the importance, it can be rather challenging to capture both of these dynamics effectively, mainly when the changes are continuous-time and nonlinear. While learning representations on dynamic graphs is a relatively new field, prior works are limited to discrete-time dynamic graphs, which are represented as a sequence of snapshots of the graph (Goyal et al. 2018; Kumar et al. 2019; Pareja et al. 2020; Chen et al. 2021). Recently, Ordinary Differential Equations (ODEs) have been incorporated into graph neural networks for continuous-time dynamic scenarios (Zang and Wang 2020; Yan et al. 2021; Choi et al. 2022). Nevertheless, these approaches still rely on a static graph structure or segments of static graphs for dynamic inference. To address these limitations, we propose a novel and unified framework for dynamic graph representation learning that can handle both the structural dynamics and the intrinsic dynamics of nodes simultaneously, wherein the node embeddings are considered to undergo a dynamic evolution over time, in a manner similar to the concept of Neural Controlled Differential Equations (Neural CDEs) (Kidger et al. 2020) built for time series tasks. Neural CDEs are a powerful concept that has desired calibration ability with subsequent data, robustness to missing values and a memory- efficient property based on adjoint-based backpropagation. We extend this concept to dynamic graphs, which we refer to as the Graph Neural Controlled Differential Equation (GN-CDE) model. The main difference is that GN-CDE creates a continuous path for temporal interactions among two nodes, allowing both structural dynamics and intrinsic dynamics to be naturally incorporated into the integration process. This makes GN-CDE not simply an extension of Neural CDEs, as it can handle the causal effects inherent in dynamic graph structures while the original Neural CDEs cannot. Excitingly, the capability of adjusting the predicted trajectories with incoming even partially observed data and training via adjoint backpropagation from Neural CDEs still hold for our model, making it a promising method for practical usage. It is worth noting that, GN-CDE is a flexible framework that we can leverage to tackle node attribute prediction, dynamic node classification and temporal link prediction tasks with minor modifications. Besides, it can easily be extended to more complex graph structures (such as directed graphs and knowledge graphs). To demonstrate the superiority of our method, we further experimentally evaluate it on node attribute prediction tasks with the underlying graph structure evolving and our method can achieve favorable results across different setups. The contributions of this work are summarized below. • We propose a generic model GN-CDE which expresses the graph structural dynamics via creating graph paths into our controlled differential equation for dynamic graphs, allowing modeling the continuously evolving process of node embeddings. • Two alternative approaches are presented, and their theoretical properties are analyzed for comparative purposes. • We further propose an approximation for the integration process that not only results in a more efficient implementation, but also allows for more flexibility in message passing between graphs. 2 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION • Experimental results verify that our proposed method can achieve better results than other methods across different graph tasks. 1.1. Related Works Graph Embedding Learning. Early works for graph representation learning include graph fac- torization approaches (Belkin and Niyogi 2001; Ahmed et al. 2013) and random walk-based meth- ods (Perozzi et al. 2014; Tang et al. 2015). With the success of deep learning, Graph Neural Networks which learn node representations by aggregating neighborhood features at each layer, achieve out- standing performance in various tasks (Welling and Kipf 2016; Hamilton et al. 2017; Veliˇckovi ́c et al. 2017). However, all the above methods are only limited to node representation learning with a static graph structure. In the real world, graphs are inherently dynamic rather than static. For example, the interactions of users can change from time to time for e-commerce and social platforms. Existing works for tackling such dynamics can be roughly categorized into three categories. The first type focuses on capturing temporal information along with local structure so as to enhance the expressive ability of the model (Yan et al. 2018; Pareja et al. 2020; Ma et al. 2020; Lan et al. 2022). Specifically, it can be achieved via learning new parameters for each snapshot and maintaining the shareable temporal information. The second type investigates the efficient update schemes when the graph structure changes (Kumar et al. 2019; Rossi et al. 2020; Chen et al. 2021), wherein the interaction events are classified in a fine-grained manner, and the nodes only update when affected by some events. Very recently, differential equations have been incorporated with graph neural networks for dynamic graphs (Zang and Wang 2020; Yan et al. 2021; Choi et al. 2022). These methods are capable of processing irregularly sampled observations and inferring the continuous dynamics of nodes. It is this last one that is of most interest to us here. Unlike these methods limited to a fixed graph structure only, we propose a graph neural controlled differential equations model to incorporate the graph structural dynamics when integrating over graphs. As a result, the requirement for a static graph can be eliminated naturally. Neural Differential Equations. Neural differential equations are an attractive option for modeling temporal dynamics on hidden representations via using a neural network to parameterize the vector field (Chen et al. 2018; Kidger et al. 2020). The majority of existing work aims to utilize such integration procedure to stimulate neural networks with infinite depth, thus the representation ability can be strengthened. For example, Neural ODEs are analog to a continuous version of ResNet (Chen et al. 2018). Neural CDEs correspond to Recurrent Neural Network (Kidger et al. 2020). Recently, some works devoted to using Neural ODEs combined with GNNs to characterise the continuous message-passing flow of node representations (Xhonneux et al. 2020; Poli et al. 2021). However, these methods are not built for dynamic graphs, nor can they tackle structural dynamics. 1.2. Paper organization and notations The rest of this paper is structured as follows. In Section 2, we briefly introduce the background knowledge. In Section 3, we describe our main model, compare it with the competitors, and declare an approximation for efficient computation. The application in several representative graph representation learning tasks is also presented. In Section 4, we illustrate the empirical performance of our model in node attribute prediction task. Finally, we conclude in Section 5. The complete proofs will follow thereafter in the appendix. 3 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Before continuing, we introduce several notations used throughout the paper. First of all, we use lower-case letters to denote scalars, bold lower-case letters to denote vectors, and bold upper- case letters to denote matrices. For a matrix X, we represent the i-th row of X as X(i), and the element at the i-th row and j-th column as X(i,j). We use (cid:12) to represent element-wise (Hadamard) multiplication. 2. Preliminary This section briefly reviews the basic definitions and common manners to learn graph embeddings, and then presents two typical neural differential equations. 2.1. Graph Embedding Learning Static graph. A static graph only contains a fixed topological structure. Let a static graph represented as G = {V, E} where V is the set of nodes, and E ⊆ V × V is the set of edges. Let vi ∈ V denote a node and eij ∈ E denote an edge between node vi and vj, i, j ∈ {1, ..., |V|}. Then the topology of the graph can be represented by an adjacency matrix A ∈ R|V|×|V| where A(i,j) = 1 if eij ∈ E otherwise 0. In most complex scenarios, the graph is equipped with a node attribute matrix F = {F(i)}|V| i,j=1, E(i,j) ∈ Rw. Graph embedding learning for static graphs is to create an embedding z(vi) for each node vi following a specified aggregation rule such that the specific local topology and node intrinsic information can be captured, formally i=1, F(i) ∈ Rm and edge feature matrix E = {E(i,j)}|V| z(vi) = (cid:88) h(msg(F(i), F(j), E(i,j)), F(i)), j, A(i,j)=1 where msg and h are predefined or learnable functions. Dynamic graphs. According to the interval of observations, dynamic graphs can be roughly catego- rized into discrete-time dynamic graphs and continuous-time dynamic graphs (Kazemi et al. 2020). A discrete-time dynamic graph comprises a chronological sequence of static graph snapshots regularly sampled according to a fixed time interval while a continuous-time dynamic graph consists of graph snapshots that are irregularly sampled. Dynamic graphs contain structural dynamics arising from edge addition or deletion, node addition or deletion events, and node intrinsic dynamics caused by node or edge feature transformations in different time stamps. As a result, the adjacency matrix At can vary at different time stamps t. In this work, we embark on representation learning for continuous-time dynamic graphs where the observations are irregularly sampled. We start with undirected graphs (At is symmetric) without time-varying node attributes and edge features, then we discuss the extensions to more subtle graph structures. It should be noted that our developed method can naturally deal with tasks on discrete-time dynamic graphs as well. 2.2. Neural Differential Equations Neural ordinary differential equations (Neural ODEs). Neural ordinary differential equations (Chen et al. 2018) are the continuous-depth analogue to residual neural networks. Let fθ : x → y be a function mapping with some learnable parameters θ, and ζθ and (cid:96)θ are two linear maps. Neural ODEs are defined as zt = z0 + fθ(zs)ds and z0 = ζθ(x), (1) (cid:90) t 0 4 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION here y ≈ (cid:96)θ(zT ) can be utilized to approximate the desired output. In this formula, the solution zt is determined by the initial condition on z0 when θ has been learned. There exists no direct way to modify the trajectory given subsequent observations, let alone tackle structural dynamics in the data generation procedure, making the plain Neural ODEs not suitable for dynamic graph setups. Neural controlled differential equations (Neural CDEs). Neural controlled differential equations (Kidger et al. 2020) are the continuous-time analogue to recurrent neural networks and provide a natural method for modeling temporal dynamics with neural networks. Provide an irregularly sampled time series x = ((t0, xt0), (t1, xt1), ..., (tN , xtN )), with each tk ∈ R the time stamp of the observation xtk ∈ Rv and t0 < * * * < tN . Let X : [t0, tN ] → Rv+1 be a continuous function of bounded variation with knots at t0, ..., tN such that Xtk = (tk, xtk ). Let fθ : Rw → Rw×(v+1) and ζθ : Rv+1 → Rw are neural networks depending on their own learnable parameters θ. Then Neural CDEs can be defined as zt = zt0 + (cid:90) t t0 fθ(zs)dXs for t ∈ (t0, tN ], (2) where zt0 = ζθ(t0, xt0) and zt are the solution of the CDE. A key difference from Neural ODEs is the interpolation of observations to form a continuous path Xs, thus the dependency upon the time-varying data can be naturally incorporated into the integration process and the trajectory of the system can adapt according to the subsequent observations. 3. Main Results In this section, we first present the embedding learning problem under evolving graphs. Then we introduce our proposed differential model. After that, we provide the applications to several representative graph-related tasks (e.g., node attributes prediction, dynamic node classification, temporal link prediction). 3.1. Problem Setup Consider a dynamic graph generated following an underlying continuous procedure that we only observe a sequence of irregularly sampled graph snapshots G = {(t0, Gt0), ..., (tN , GtN )}, with each tk ∈ R the time stamp of the observed graph Gtk and t0 < * * * < tN . Among these observations, a graph snapshot Gtk = {V, E} is comprised of nodes V = {v1, ..., v|V|} and edges E ⊆ V × V (we assume all snapshots share a common node set and edge set, and omit the subscript for simplicity). Commonly, we can represent the graph topological information for graph Gtk via a time-specified adjacency matrix Atk ∈ R|V|×|V| that each interaction eij ∈ E is valued in Atk where i, j ∈ {1, ..., |V|}. Our goal is to learn a non-linear dynamical system on the dynamic graph G based on the observations, formally the dynamics follow the form: Zt = Zt0 + (cid:90) t t0 f (Zs)dXs for t ∈ (t0, tN ], (3) where Zt = {zt(vi)}|V| i=1, Zt ∈ R|V|×d is output node embedding matrix, X is an input signal path defined on [t0, tN ] which comprises the evolving topology of G. The subscript notation here refers to function evaluation over time. When there exists an assigning function τ : Rd → Rc on G such that Yt = τ (Zt), Yt ∈ R|V|×c, this becomes by now an increasingly popular problem 5 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION with applications in several machine learning tasks such as node attribute prediction (Gao et al. 2016), dynamic node classification (Kumar et al. 2019), temporal link prediction (Nguyen et al. 2018) etc. Very recently, some works incorporate graph convolutional networks with ODEs for the continuous inference (Zang and Wang 2020; Yan et al. 2021; Choi et al. 2022), however, they degrade to an oversimplified setup where the neighborhood for nodes remains unchanged over time, making the proposed methods impractical for usage since the structural change could yield an unignorable effect on node embeddings. To make this problem solvable and the designed methods practical, we make the following assumption: Assumption 1 (Continuity) The evolving path z : [t0, tN ] → Rd of each node embedding is absolutely continuous. This continuity assumption is standard for enabling differential equations (Chen et al. 2018; Kidger et al. 2020) and widely used by current dynamic graph approaches (Zang and Wang 2020; Wang et al. 2020; Yan et al. 2021; Choi et al. 2022). 3.2. GN-CDE: Graph Neural Controlled Differential Equations Before introducing our differential equations, we need to prepare a continuously evolving path for graph structure first. Specifically, for a dynamic graph Gtk collected at time stamp tk endowed with adjacency matrix Atk , we augment each interaction eij in Atk by time stamp as ˆeij = (tk, eij) ∈ R2 where i, j ∈ {1, ..., |V|} such that all these processed interactions can be represented by a time augmented adjacency matrix as ˆAtk = (tk, Atk ) ∈ R|V|×|V|×2. After that, we interpolate each possible interaction among two nodes independently utilizing the discrete observations to form a continuous path, this can be represented as ˆA : [t0, tN ] → R|V|×|V|×2 such that ˆAtk = (tk, Atk ). In this paper, we assume ˆA to be piecewise twice continuously differentiable with bounded second derivative, thus many interpolation schemes can be employed (Morrill et al. 2022). Then, let ζθ : R|V|×|V|×2 → R|V|×d and fθ : R|V|×d × R|V|×|V| → R|V|×d × R|V|×|V|×2 be two graph neural networks. We can define our controlled differential equation for dynamic graphs as Zt = Zt0 + (cid:90) t t0 fθ(Zs, As)d ˆAs for t ∈ (t0, tN ], (4) where Zt0 = ζθ(t0, At0) is treated as the initial value to avoid translational invariance. One can utilize another linear function (cid:96)θ to acquire the final prediction as ̃Yt = (cid:96)θ(Zt), ̃Yt ∈ R|V|×c. The notation "fθ(Zs, As) d ˆAs" in Eq. 4 represents a matrix-matrix product. Our formula differs from the standard Neural CDE presented in Kidger et al. (2020) in that we highlight the causal effect of graph structural dynamics via the defined path ˆA, making it more suitable for the dynamic graphs scenarios, while Neural CDEs concentrate more on sequential relationships across observations rather than the graph structural dynamics. Based on this modification, As in fθ(Zs, As) can strengthen such causal effect for the vector field update, and the derivative d ˆAs can indicate the magnitudes and directions of the instantaneous change for the interactions. Given fθ implemented as a Graph Neural Network with the formula fθ(Zs, As) = σ(AsZ(l) s W(l)) where W(l) is parameters for l-th layer GCN and σ is a rectified linear unit (ReLU) with a Lipschitz constant 1. In practice, we can leverage a regularized adjacency matrix of As to stabilize the algo- rithm learning (Welling and Kipf 2016). Obviously, fθ is global Lipschitz continuous, and we have the following theorem 6 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Algorithm 1: Continuous inference of GN-CDE algorithm Input: Sequentially observed topological structures of a dynamic graph {(t0, At0), ..., (tN , AtN )}, initial function ζθ, vector field fθ and decoder (cid:96)θ Initializing ˆA: Interpolate the time-augmented adjacency matrix Zt0 ← ζθ(t0, At0); end Continuously inferring Zt ← ODESolve(Zt0, ˆA, t0, tN , fθ) following Eq. 5 ̃Yt ← (cid:96)θ(Zt) end return Zt, ̃Yt Theorem 2 The solution Zt in Eq. 4 exhibits global existence and uniqueness. The proof is straightforward by using Picard–Lindel ̈of theorem (Coddington and Levinson 1955). We provide some theoretical comparisons of different interpolation schemes for our Graph Neural CDE model in Appendix C. Evaluating. Provided ˆA as piecewise twice continuously differentiable with bounded second deriva- tive, Eq. 4 can be rewritten as Zt = Zt0 + (cid:90) t t0 fθ(Zs, As) d ˆAs ds ds for t ∈ (t0, tN ], (5) where Zt0 = ζθ(t0, At0). This equation can be interpreted and solved as an ordinary differential equation, and one can solve our proposed GN-CDE model using the same technique for Neural ODEs (Kidger et al. 2020). Algorithm 1 depicts the continuous inference procedure of GN-CDE using an ODE solver. 3.3. Properties Robustness to missing values. GN-CDE is capable of processing partially observed data. This is because each channel may independently be interpolated between observations to create ˆAs in exactly the same manner as before. Expressivity. Compared to representing the evolving graph structure via learnable parameters W within GCN layers (Yan et al. 2018) or introducing additional neural network layers (Choi et al. 2022), our method can maintain the representation capability of GCN layers without introducing additional computational cost. Calibration. Providing additional observations at intermediate time steps can help calibrate the inferred trajectory. This property is inherited from controlled differential equations (Kidger et al. 2020). Memory-efficient. Our model can continuously incorporate incoming data without interrupting the differential equation, as a result, memory-efficient adjoint backpropagation may be performed for model training. 7 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Discussion. The most similar work to this paper is STG-NCDE Choi et al. (2022) which employs Neural CDEs to learn the temporal and spatial dependencies for traffic forecasting tasks. Although this method is capable of tackling an unfixed graph structure via leveraging some learnable parameters to approximate the structure, it induces additional computational burden and cannot be extended to continuously evolving dynamic graphs. On the contrary, we define a generic framework that can incorporate the graph structural dynamics into the integration procedure naturally, thus no need to introduce additional parameters. Actually, STG-NCDE can be included in our framework presented for dynamic node classification task (See Section 3.6) by ignoring the dynamic structure and edge features. 3.4. Comparison to Alternative Models In this section, we compare and discuss our framework with two alternatives that also combine dynamic graph structure with differential equations. 1(cid:13) Neural ODE One choice for the alternative of Eq. 4 could be directly incorporating the graph structure into the vector field of Neural ODEs presented in Eq. 1 and define the graph neural ODE model as Zt = Zt0 + (cid:90) t t0 fθ(Zs, A(cid:98)s(cid:99))ds for t ∈ (t0, tN ], (6) where Zt0 = ζθ(t0, At0), A(cid:98)s(cid:99) = Atk if tk ≤ s < ti+1. Theorem 3 Any equation of the form Zt = Zt0 + (cid:82) t t0 by a Graph Neural Controlled Differential Equation of the form Zt = Zt0 + (cid:82) t t0 However, the converse statement is not true. fθ(Zs, A(cid:98)s(cid:99))ds may be represented exactly fθ(Zs, As)d ˆAs. Proof The main proof idea is to build an intermediate differential model to bridge these two formulas. From Theorem 4 we know that, given a differential equation in the form Zt = Zt0 +(cid:82) t fθ(Zs)d ˆAs, it t0 can be represented by Zt = Zt0 + (cid:82) t fθ(Zs, As)d ˆAs. After that, we only need to proof any equation t0 in the form Zt = Zt0 + (cid:82) t fθ(Zs)d ˆAs which t0 has been proofed by Kidger et al. (2020). See Appendix A.1 for more detailed proof. fθ(Zs, A(cid:98)s(cid:99))ds can be represented by Zt = Zt0 + (cid:82) t t0 According to Theorem 3, although the GN-ODE model can also take the dynamic graph structure into the vector field computational procedure, its representation ability is inferior to our proposed GN-CDE model. 2(cid:13) Neural CDE Another alternative of Eq. 4 could be implementing the vector field without As as input following the standard Neural CDEs presented in Eq. 2 which emphasizes the linear dependency on d ˆAs. We formulize this as fθ(Zs)d ˆAs for t ∈ (t0, tN ], (7) Zt = Zt0 + where Zt0 = ζθ(t0, At0). (cid:90) t t0 8 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Theorem 4 Any equation of the form Zt = Zt0 + (cid:82) t t0 Graph Neural Controlled Differential Equation of the form Zt = Zt0 + (cid:82) t t0 versa. fθ(Zs)d ˆAs can be represented exactly by a fθ(Zs, As)d ˆAs and vice Proof Here we sketch the proof idea. Since the vector field fθ in Zt = Zt0 + (cid:82) t t0 (cid:20)Zs As takes both the Zs and As as input, we can construct a stacked input βs = fθ(Zs, As)d ˆAs (cid:21) for alternative such that the newly built controlled differential equation on βs is equivalent to the Neural CDE formulation presented in Eq. 7. The full proof of Theorem 4 is detailed in Appendix A.2. Although the dynamic graph can be learned by these two forms of CDE according to Theorem 4, they own different preferences during model learning stage. In the experimental part, we find that GN-CDE with non-linear dependency (as shown in Eq.4) performs better compared to the linear dependency variant (Eq.7). We conjecture that this is due to the fact that explicitly incorporating dynamic graph structure into the vector field allows for more precise control of information flow among nodes over time. 3.5. Approximation of GN-CDE Directly implementing Eq. 5 by following Kidger et al. (2020) would result in an undesirable computational burden due to the high dimensional output of fθ. For ease of computation and to ensure scalability to large neural networks, we consider some approximations to simplify this procedure via leveraging the message passing mechanism among graphs and the universal approximation property of graph neural networks. Given the naive graph as homogeneous and isotropic, the derivative on time stamp s can be shared by all interactions, and this enables the alternative between d ˆAs and dAsds that the output dimension will be halved. Afterward, we fuse dAs with As in the vector field using a transformation matrix and produce a new adjacency matrix ̃As that indicates the instantaneous structural change of graph, this yields two advantages: 1) the representations diffusion procedure by learnable parameters can be approximated via an adjusted graph structure; 2) the dimension of output for fθ can be largely reduced, from R|V|×d × R|V|×|V|×2 to R|V|×d. Formularly, for a vector field parameterised by a L-layers graph neural network, the approximated equation that can be implemented much more efficiently as follows Zt = Zt0 + (cid:90) t t0 (cid:16) ̃AsZ(L) s W(L)(cid:17) σ ds for t ∈ (t0, tN ], (8) (cid:21) W(DR), W(DR) ∈ R2|V|×|V| is a transformation matrix for the fusion. Besides, where ̃As = (cid:20) As dAs ds can be acquired iteratively following the rule: Z(l) Z(L) s and σ is ReLU activation function. s = σ(cid:0) ̃AsZ(l−1) s W(l−1)(cid:1) for l ∈ {1, ..., L}, Theorem 5 Eq. 8 is a valid approximation of our Graph Neural Controlled Differential Equation model with the form Zt = Zt0 + (cid:82) t t0 fθ(Zs, As)d ˆAs. Proof The full derivation of Theorem 5 is deferred to Appendix B, here we present several key steps. Consider our GN-CDE model presented in Eq. 5, it can be implemented using a L-layers graph 9 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION neural network directly as Zt = Zt0 + (cid:90) t t0 σ(AsZ(L) s W(L))W(BR) dAs ds ds, (9) s = σ(AsZ(l−1) where Z(l) and W(BR) within σ(AsZ(L) σ(AsZ(L) s W(LBR) dAs s W(l−1)) for l ∈ {1, ..., L}. In Eq. 9, the parameter matrices W(L) ds can be combined and we obtain a new integrand s W(L))W(BR) dAs ds ). After that, we introduce a transformation matrix W(DR) such that (cid:16) (cid:20) As dAs ds s W(LBR) dAs ds s W(L)(cid:17) ≈ σ(AsZ(L) W(DR)Z(L) (cid:21) ) σ (10) Finally, we utilize the universal approximation theorem (Scarselli et al. 2008) to verify that this approximation is valid. Besides the theoretical analysis, we also provide an empirical comparison of this simplified version in Section 4 to assess its performance. 3.6. Applications Node attributes prediction. For the node attributes prediction task, we are equipped with a node attributes matrix Ftk ∈ R|V|×m containing m-dimensional attributes of the nodes for model training. When new edges and nodes emerge at time stamp tk, Atk and Ftk will evolve accordingly under the effects of graph structural dynamics and intrinsic dynamics of nodes. Our task is to predict the node attributes, i.e., to predict Ft at unseen time t based on the previous observations. To achieve this goal, we need to learn informative node representations Zt ∈ R|V|×d that can be used for the prediction of the nodes attributes Ft. The objective is to minimize the following expected loss Et[Loss(Ft, ̃Yt)] for t ∈ (t0, T ], min fθ,(cid:96)θ (11) where ̃Yt = (cid:96)θ(Zt) is the prediction based on Zt which is inferred by Eq. 4. We use the squared error to measure the mismatch between Ft and ̃Yt. Moreover, T can be T ≤ tN which corresponds to interpolation prediction or T > tN corresponds to extrapolation prediction. Dynamic node classification. The task of node classification is leveraging the collected information at time stamps {t0, ..., tN } to predict the label of nodes ̃Yt at time stamp t, t > tN . The objective can be represented as Et[Loss(Yt, ̃Yt)] min fθ,(cid:96)θ for t ∈ (tN , T ], (12) where ̃Yt = (cid:96)θ(Zt) is the prediction based on Zt and (cid:96)θ is implemented as a MLP with a softmax activation function to obtain the class probability. We can use the squared loss or cross-entropy to measure the prediction error. Commonly, this works on attributed graphs, which means the node attribute matrix Ftk and edge feature matrix E are provided in advance. Thus, the controlled differential equation can be written as Zt = Zt0 + (cid:16) fθ (cid:90) t t0 Zs, As, Fs, E (cid:17) d ˆAs for t ∈ (t0, tN ], (13) 10 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION where Zt0 = ζθ(t0, At0, Ft0, E). In this equation, we need to interpolate the time augmented adjacency matrix as before and the node attribute matrix Ftk to conduct the integral. In addition, when Ftk or E is not given, we can disable the corresponding terms in Eq. 13. Temporal link prediction. This task is to predict the existence of an edge eij at time t, t > tN . The node attribute matrix Ftk and edge feature matrix E are also provided, thus we can follow the same setup designed for dynamic node classification tasks. To acquire the link probability among two nodes, we apply a MLP over the concatenation of the corresponding nodes' embeddings. 4. Experimental Results In this section, we conduct a comprehensive set of experiments on node attribute prediction tasks to validate the effectiveness of our proposed Graph Neural CDE model. More details of dataset construction and experimental setup can be found in the supplementary material. Data. We consider two representative dynamic models: heat diffusion dynamics and gene regulatory dynamics. The underline networks own 400 nodes and are initialized as Grid network, Random network, Power-law network, Small world network, and Community network respectively, then some edges are randomly dropped or added occasionally to simulate the dynamic environments. After that, we irregularly sample 120 snapshots from the continuous-time dynamics to form the whole observations. The standard data splits presented in Zang and Wang (2020) are employed where 80 snapshots for training, 20 snapshots for testing the interpolation prediction task and 20 snapshots for testing the extrapolation prediction task. Setup. The methods for comparison include Neural ODE (presented in Eq. 6) and Neural CDE (presented in Eq. 7). We use the natural cubic spline method as the interpolation scheme for all CDE-based methods since the interpolated path is smooth enough as twice differentiable (Kidger et al. 2020). Moreover, for a fair comparison, we keep the neural network architecture of the vector field part to be the same for all baselines for different benchmarks. We implement the vector field as one GCN layer with the dimension of output node embeddings d = 20. Then, all models are trained using Adam optimizer for 2, 000 iterations, and the initial learning rate is set as 0.01. Finally, (cid:96)1 loss is used as the evaluation metric. We report the results as the average value of 10 runs with the standard deviation shown aside. Results. The test results of our method and competitive baselines throughout model optimization procedure for the node attribute prediction in heat diffusion and gene regulation dynamical systems are depicted in Fig. 1 and Fig. 2, respectively. We can observe that our GN-CDE model consistently outperforms other baselines, achieving a significantly lower test error across a variety of dynamic networks. In addition, compared to Neural ODE and Neural CDE, GN-CDE spends less time converging to stable results. These results demonstrate the capability and efficiency of our model in modeling the whole dynamics under evolving graph structures no matter for interpolation or for extrapolation tasks. It is worth noting that Neural ODE and Neural CDE exhibit comparable results in most scenarios, with the exception of heat diffusion prediction under grid and random structures, we conjecture the reason that Neural ODE primarily emphasizes on the structural dynamics in the vector field while Neural CDE primarily focuses on the dynamics in differential term, and only taking one aspect into account is insufficient for the representation learning on dynamic graphs. In Fig. 3, we present a visualization of the ground truth dynamics and the learned dynamics by different methods in a heat diffusion dynamical system evolving with changing grid networks in order to gain insight into the the diverse learning behaviors of these methods. In the first panel of Fig. 3, 11 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Figure 1: Heat Diffusion: The test errors of Neural ODE, Neural CDE and our GN-CDE models with respect to the optimization iteration count under five different graph structures: (a) grid, (b) Random, (c) power law, (d) small world and (e) community. We run each method 10 times and report the average (cid:96)1 loss value with standard deviation. Here, the sum of extrapolation and interpolation results is presented for evaluating the performance among the whole dynamic procedure. Figure 2: Gene Regulation: The test errors of Neural ODE, Neural CDE and our GN-CDE models with respect to the optimization iteration count under five different graph structures: (a) grid, (b) Random, (c) power law, (d) small world and (e) community. Here, the sum of extrapolation and interpolation (cid:96)1 errors averaged over 10 runs is presented for performance evaluation. Figure 3: Visualisation of learned dynamics for heat diffusion over dynamic graphs. Our GN-CDE model fits the dynamics for the whole progress accurately. 12 (a) Grid(b) Random(c) Power Law(d) Small World(e) CommunityNeural ODENeural CDEGN-CDE(a) Grid(b) Random(c) Power Law(d) Small World(e) CommunityNeural ODENeural CDEGN-CDERealNeural ODENeural CDEGN-CDETt GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION we can observe several irregularities existing in the node attribute surface of the ground truth, which are attributed to the instantaneous structural changes during energy diffusion to neighboring nodes. However, both Neural ODE and Neural CDE fail to precisely fit the surface, let alone accurately capturing these structural changes. On the contrary, our GN-CDE model demonstrates excellent fitting of the dynamics across the entire time span. 5. Conclusion In this paper, we propose a novel generic differential equations-based framework GN-CDE for representation learning on continuous-time dynamic graphs. GN-CDE creates graph paths into the controlled differential equation that the graph structural dynamics can be naturally incorporated when conduction integration. With this framework, we can apply it to solve different tasks on dynamic graphs with minor modifications. Experimental results on node attribute prediction tasks across different underlying graph structures demonstrate the superiority of our proposed method compared to other baselines. References Amr Ahmed, Nino Shervashidze, Shravan Narayanamurthy, Vanja Josifovski, and Alexander J Smola. Distributed large-scale natural graph factorization. In Proceedings of the 22nd international conference on World Wide Web, pages 37–48, 2013. Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps and spectral techniques for embedding and clustering. Advances in neural information processing systems, 14, 2001. Alaa Bessadok, Mohamed Ali Mahjoub, and Islem Rekik. Graph neural networks in network neuroscience. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022. Ricky TQ Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. Advances in neural information processing systems, 31, 2018. Xinshi Chen, Yan Zhu, Haowen Xu, Mengyang Liu, Liang Xiong, Muhan Zhang, and Le Song. Efficient dynamic graph representation learning at scale. arXiv preprint arXiv:2112.07768, 2021. Jeongwhan Choi, Hwangyong Choi, Jeehyun Hwang, and Noseong Park. Graph neural controlled differential equations for traffic forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 6367–6374, 2022. Earl A Coddington and Norman Levinson. Theory of Ordinary Differential Equations. Tata McGrawHill Education, 1955. John R Dormand and Peter J Prince. A family of embedded runge-kutta formulae. Journal of computational and applied mathematics, 6(1):19–26, 1980. Wenqi Fan, Yao Ma, Qing Li, Yuan He, Eric Zhao, Jiliang Tang, and Dawei Yin. Graph neural networks for social recommendation. In The world wide web conference, pages 417–426, 2019. 13 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Pablo Gainza, Freyr Sverrisson, Frederico Monti, Emanuele Rodola, D Boscaini, MM Bronstein, and BE Correia. Deciphering interaction fingerprints from protein molecular surfaces using geometric deep learning. Nature Methods, pages 184–192, 2020. Jianxi Gao, Baruch Barzel, and Albert-L ́aszl ́o Barab ́asi. Universal resilience patterns in complex networks. Nature, 530(7590):307–312, 2016. Palash Goyal, Nitin Kamra, Xinran He, and Yan Liu. Dyngem: Deep embedding method for dynamic graphs. arXiv preprint arXiv:1805.11273, 2018. Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. Advances in neural information processing systems, 30, 2017. Seyed Mehran Kazemi, Rishab Goel, Kshitij Jain, Ivan Kobyzev, Akshay Sethi, Peter Forsyth, and Pascal Poupart. Representation learning for dynamic graphs: A survey. J. Mach. Learn. Res., pages 1–73, 2020. Patrick Kidger, James Morrill, James Foster, and Terry Lyons. Neural controlled differential equations for irregular time series. Advances in Neural Information Processing Systems, pages 6696–6707, 2020. Srijan Kumar, Xikun Zhang, and Jure Leskovec. Predicting dynamic embedding trajectory in temporal interaction networks. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, pages 1269–1278, 2019. Shiyong Lan, Yitong Ma, Weikang Huang, Wenwu Wang, Hongyu Yang, and Pyang Li. Dstagnn: Dynamic spatial-temporal aware graph neural network for traffic flow forecasting. In International Conference on Machine Learning, pages 11906–11917, 2022. Yao Ma, Ziyi Guo, Zhaocun Ren, Jiliang Tang, and Dawei Yin. Streaming graph neural networks. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 719–728, 2020. Federico Monti, Karl Otness, and Michael M Bronstein. Motifnet: a motif-based graph convolutional network for directed graphs. In 2018 IEEE Data Science Workshop, pages 225–228, 2018. James Morrill, Patrick Kidger, Lingyi Yang, and Terry Lyons. On the choice of interpolation scheme for neural CDEs. Transactions of Machine Learning Research, 2022. Giang Hoang Nguyen, John Boaz Lee, Ryan A Rossi, Nesreen K Ahmed, Eunyee Koh, and Sungchul Kim. Continuous-time dynamic network embeddings. In Companion proceedings of the the web conference 2018, pages 969–976, 2018. Aldo Pareja, Giacomo Domeniconi, Jie Chen, Tengfei Ma, Toyotaro Suzumura, Hiroki Kanezashi, Tim Kaler, Tao Schardl, and Charles Leiserson. Evolvegcn: Evolving graph convolutional networks for dynamic graphs. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 5363–5370, 2020. Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representa- tions. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 701–710, 2014. 14 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Osvaldo L Podhajcer, Lorena Benedetti, Maria Romina Girotti, Federico Prada, Edgardo Salvatierra, and Andrea S Llera. The role of the matricellular protein sparc in the dynamic interaction between the tumor and the host. Cancer and Metastasis Reviews, pages 523–537, 2008. Michael Poli, Stefano Massaroli, Clayton M Rabideau, Junyoung Park, Atsushi Yamashita, Hajime Asama, and Jinkyoo Park. Continuous-depth neural models for dynamic graph prediction. arXiv preprint arXiv:2106.11581, 2021. Emanuele Rossi, Ben Chamberlain, Fabrizio Frasca, Davide Eynard, Federico Monti, and Michael Bronstein. Temporal graph networks for deep learning on dynamic graphs. arXiv preprint arXiv:2006.10637, 2020. Aravind Sankar, Yozen Liu, Jun Yu, and Neil Shah. Graph neural networks for friend ranking in large-scale social platforms. In Proceedings of the Web Conference 2021, pages 2535–2546, 2021. Stefania Sardellitti, Sergio Barbarossa, and Paolo Di Lorenzo. On the graph fourier transform for directed graphs. IEEE Journal of Selected Topics in Signal Processing, pages 796–811, 2017. Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. Computational capabilities of graph neural networks. IEEE Transactions on Neural Networks, pages 81–102, 2008. Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. Line: Large-scale information network embedding. In Proceedings of the 24th international conference on world wide web, pages 1067–1077, 2015. Zekun Tong, Yuxuan Liang, Changsheng Sun, David S Rosenblum, and Andrew Lim. Directed graph convolutional network. arXiv preprint arXiv:2004.13970, 2020. Petar Veliˇckovi ́c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017. Junshan Wang, Guojie Song, Yi Wu, and Liang Wang. Streaming graph neural networks via continual learning. In Proceedings of the 29th ACM international conference on information & knowledge management, pages 1515–1524, 2020. Max Welling and Thomas N Kipf. Semi-supervised classification with graph convolutional networks. In J. International Conference on Learning Representations, 2016. Louis-Pascal Xhonneux, Meng Qu, and Jian Tang. Continuous graph neural networks. In Interna- tional Conference on Machine Learning, pages 10432–10441, 2020. Da Xu, Chuanwei Ruan, Evren Korpeoglu, Sushant Kumar, and Kannan Achan. Inductive repre- sentation learning on temporal graphs. In International Conference on Learning Representations, 2020. Sijie Yan, Yuanjun Xiong, and Dahua Lin. Spatial temporal graph convolutional networks for skeleton-based action recognition. In Thirty-second AAAI conference on artificial intelligence, 2018. 15 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Xu Yan, Xiaoliang Fan, Peizhen Yang, Zonghan Wu, Shirui Pan, Longbiao Chen, Yu Zang, and Cheng Wang. Contig: Continuous representation learning on temporal interaction graphs. arXiv preprint arXiv:2110.06088, 2021. KChengxi Zang and Fei Wang. Neural dynamics on complex networks. In Proceedings of the 26th ACM SIGKDD international conference on knowledge discovery & data mining, pages 1269–1278, 2020. Xitong Zhang, Yixuan He, Nathan Brugnone, Michael Perlmutter, and Matthew Hirn. Magnet: A neural network for directed graphs. Advances in Neural Information Processing Systems, pages 27003–27015, 2021. Ling Zhong. A dynamic pandemic model evaluating reopening strategies amid covid-19. PloS one, page e0248302, 2021. Jie Zhou, Ganqu Cui, Shengding Hu, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. Graph neural networks: A review of methods and applications. AI Open, 1:57–81, 2020. 16 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Table of Contents Appendix A: Comparison to alternative CDE models Appendix B: Feasibility of Our Proposed GN-CDE Approximation Appendix C: Different Interpolation Schemes Appendix D: Other Types of Graph Appendix E: Further Empirical Results Appendix A. Comparison to alternative CDE models A.1. Proof of Theorem 3 From theorem 2, we know that any equation of the form Zt = Zt0 +(cid:82) t fθ(Zs)d ˆAs can be represented t0 exactly by a GN-CDE of the form Zt = Zt0 + (cid:82) t fθ(Zs, As)d ˆAs, thus we can prove this theorem t0 via showing that the equations of the form Zt = Zt0 + (cid:82) t fθ(Zs, A(cid:98)s(cid:99)) ds may be represented t0 exactly by a GN-CDE of the form Zt = Zt0 + (cid:82) t fθ(Zs)d ˆAs. This result follows directly from the t0 Theorem 3.3 presented in Kidger et al. (2020) when unfolding the graph path ˆAs for any time stamp s as a vector. A.2. Proof of Theorem 4 Provide a dynamic graph comprising of a sequence of graph snapshots G = {(t0, Gt0), ..., (tN , GtN )}, with each tk ∈ R the time stamp of the observed graph Gtk and t0 < * * * < tN . Besides, each graph Gtk is endowed with an adjacency matrix Atk representing the topological information for Gtk . Further, let ˆAs be some continuous interpolation of Atk such that ˆAtk = (tk, Atk ), then our GN-CDE model can be defined by Zt0 = ζθ(t0, At0), Zt = Zt0 + (cid:90) t t0 Let βs = (cid:20)Zs As (cid:21) , according to Eq. 14 we have fθ(Zs, As) d ˆAs for t ∈ (t0, tN ]. (14) βt = (cid:21) (cid:20)Zt At = (cid:21) (cid:20)Zt0 At0 + (cid:90) t t0 (cid:20)fθ(Zs, As) 1 (cid:21) d ˆAs for t ∈ (t0, tN ]. (15) Then we can let ̃fθ(βs) = (cid:21) (cid:20)fθ(Zs, As) 1 , the above equation can be rewrite as βt = βt0 + (cid:90) t t0 ̃fθ(βs) d ˆAs for t ∈ (t0, tN ]. (16) This formulation is equivalent to the original Neural CDE formulation presented in Kidger et al. (2020), then we accomplish the proof. 17 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Appendix B. Feasibility of Our Proposed GN-CDE Approximation In this part, we show the detailed approximation steps of our implementation provided in Section 3.5. Considering the evaluation of GN-CDE model presented in Section 3.2 that Zt = Zt0 + (cid:90) t t0 fθ(Zs, As) d ˆAs ds ds for t ∈ (t0, tN ]. (17) To enable the massaging passing of Zs over the graph structure, we can parameterize the vector field fθ for Zt using a L-layers graph neural network followed by a fully-connected layer for projection purpose to compute the equation, that is (cid:90) t Zt = Zt0 + σ(AsZ(L) s W(L))W(BR) dAs ds ds, t0 where Z(l) s = σ(AsZ(l−1) s W(l−1)) s W(L))W(BR) dAs for l ∈ {1, ..., L}. Considering the integrand σ(AsZ(L) function before multiplying matrix-vector multiplying with W(BR) dAs so we can rewrite this term as ds , rather than applying the final activation ds , this can be applied afterward, σ(AsZ(L) s W(L)W(BR) dAs ds ). (20) Since both W(L) and W(BR) are learnable weights, we can replace them with a new learnable matrix W(LBR) ∈ Rd×d×|V|×|V|, then we have s W(LBR) dAs ds In our implementation, we consider the following simplification to approximate the above formula σ(AsZ(L) (21) ). (cid:21) σ (cid:16) (cid:20) As dAs ds W(DR)Z(L) s W(L)(cid:17) (22) where W(DR) ∈ R2|V|×|V| is a transformation matrix for the fusion between As and dAs Z(L) s ds . Besides, (18) (19) (cid:21) W(DR)Z(l−1) s W(l−1)(cid:17) for l ∈ {1, ..., L}, (23) can be acquired iteratively by (cid:16) (cid:20) As dAs ds s = σ Z(l) here, W(l) ∈ R|V|×|V|. If we let ̃As = (cid:21) (cid:20) As dAs ds W(DR), then we can rewrite Eq. 22 and Eq. 23 as (cid:16) ̃AsZ(L) s W(L)(cid:17) σ where Z(l) s = σ (cid:16) ̃AsZ(l−1) s W(l−1)(cid:17) for l ∈ {1, ..., L}. Now, we need to provide the following approximation for our implementation (cid:16) ̃AsZ(L) s W(L)(cid:17) σ ≈ σ(AsZ(L) s W(LBR) dAs ds ). (24) (25) (26) We verify this by considering the universal approximation property of graph neural networks. 18 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Theorem 6 Scarselli et al. (2008). Let D be a graphical domain, for any measurable function τ ∈ F(D), any norm || * || on Rd, any probability measure P on D and any reals (cid:15), μ where (cid:15) > 0 and 0 < μ < 1, there exist a GNN function φ that under mild assumptions can approximate τ perfectly, that is P (||τ − φ|| ≥ (cid:15)) ≤ 1 − μ. For a graph G with the topological structure represented by As, if we let φ1 = σ(AsZ(L) it can still approximate any function τ perfectly since the employed Sigmoid function σ = 1 1+e−x keeps φ injective and continuous, and graph structure is well preserved. When we let φ2 = σ(cid:0) ̃AsZ(L) s W(L)(cid:1), we then use the sparsity of graph structural changes, which means only very few ds own values, and the combined adjacency matrix ̃As will largely keep the elements in As and dAs original structure of As, so φ2 can approximate most functions of τ . As a result, we can make the approximate φ1 ≈ φ2, that is σ s W(LBR) dAs s W(LBR) dAs s W(L)(cid:17) ≈ σ(AsZ(L) (cid:16) ̃AsZ(L) ds ), ds ). Appendix C. Different Interpolation Schemes Table 1: The comparison of different interpolation schemes. Interpolation Schemes Linear Rectilinear Natural Cubic Cubic Hermite Smoothness Dependency on Future Interpolation Complexity Integral Difficulty Properties (piecewise) (piecewise) (cid:88) (cid:88) One No All One Low Lowest Highest High High High Lowest Low We consider four different interpolation schemes for our GN-CDE model: 1) Linear control; 2) Rectilinear control; 3) Natural cubic splines; 4) Cubic Hermite splines with backward differences. As we have analyzed the continuity of vector field fθ(Zs, As) and the existence and uniqueness of solutions for our framework in Section. 3.2, in this part, we analyze the practical performance of them in the smoothness property, interpolation complexity and optimization difficulty when utilizing some ODE solvers ( e.g., Euler method, Dormand-Prince (DOPRI) method (Dormand and Prince 1980)) for the integral. We summarize the results in Table 1. Commonly, the ODE solvers calculate Eq. 5 use another form as dZt dt = fθ(Zt, At) d ˆAt dt . (27) We also utilize this formula to show different effects caused by the interpolation schemes for our GN-CDE model. Linear control. If we have two observations (t0, At0) and (t2, At2) collected at time stamps t0 and t2, respectively, and we want the get the value for time t1. Linear control is the interpolating along the straight line between these two observations. Formally, At1 can be evaluated by solving the equation At1 − At0 t1 − t0 = At2 − At1 t2 − t1 . 19 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION For our GN-ODE model, the vector field fθ(Zt, At) in Eq. 27 is implemented as GCN layers with the formula fθ(Zs, As) = σ(AsZ(l) s W (l)), it is Lipschitz continuous. While for the derivation d ˆAt dt , its value will be a constant when there exists a graph structural change otherwise zero. The multiplication of these two terms will exhibit some jumps due to the gradient discontinuities at the structural changing moment (tk, Atk ). Thus, this scheme owns moderate complexity for interpolation and high integral difficulty for the solvers to resolve the jumps. Rectilinear control. For the observations {(t0, At0), ..., (tN , AtN )}, rectilinear control updates the time and feature channels separately in lead-lag fashion as ˆAt : [0, 2n] → R|V|×|V|×2 such that ˆA2k = (tk, Atk ) and ˆA2k+1 = (tk+1, Atk ). When using rectilinear control as the interpolation scheme to build the path, the derivation d ˆAt dt for each possible interaction could appear with a large value when there exists a graph structural change. This leads to the derivation in Eq. 27 much more non-smooth than linear control. Besides, the length of the created path is twice as long as other schemes, thus it takes a longer time for our model to evaluate and train. The merit of this scheme is its low interpolation complexity since it only needs to pad the value for a time with the previous one. Natural cubic splines. The natural cubic spline is a spline that uses the third-degree polynomial which satisfies the given control points. This is also the recommended scheme by Kidger et al. (2020). With natural cubic splines, the created paths are twice differentiable. This means the ODE solvers do not need to resolve the jumps of dZt dt since the derivation is smooth enough. Thus, the integral difficulty for this scheme is the lowest among the four discussed schemes. However, this scheme can lead to unacceptable time costs for path creation, especially when the scale of the graph is large. Cubic Hermite splines with backward differences. For each interval [tk, tk+1) in among the whole observations {(t0, At0), ..., (tN , AtN )}, cubic Hermite spline keeps that ˆAtk = (tk, Atk ) and ˆAtk+1 = (tk+1, Atk+1), and that the gradient at each node matches the backward finite difference as d ˆAtk dt = ˆAtk − ˆAtk−1 and d ˆAtk+1 dt = ˆAtk+1 − ˆAtk . This scheme can smooth gradient discontinuities of linear control, thus its integration difficulty is lower than linear control. Besides, since it only needs to solve a single equation on each control point, its interpolation complexity is lower than natural cubic splines. However, the spurious delays in the spline will degrade the accuracy of our model. See Ma et al. (2020) for more descriptions of these schemes. Appendix D. Other Types of Graph Our proposed GN-CDE model is not only a generic framework for tackling different graph-related tasks, such as the prediction of node attributes, dynamic nodes classification and temporal link prediction but can also be easily extended to more complex graph structures. We discuss how our model can be applied to solve tasks on directed graphs, multigraph, knowledge graphs, and heterogeneous information networks. An illustration of these graph structures is presented in Fig. 4. Directed graph. Vertices in a directed graph are connected by directed edges (See Fig. 4(a)). In order to apply our GN-CDE model to tasks established upon directed dynamic graphs, it is necessary to modify our implementation of the vector field from graph convolutional layers defined for undirected 20 GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Figure 4: Illustration of other graph types. graphs to directed graphs. In addition to utilizing an asymmetric adjacency matrix directly, we can also represent the graph structure with spectral-based methods that leverage edge direction proximity (Tong et al. 2020), transforms (Sardellitti et al. 2017; Zhang et al. 2021) or local graph motifs (Monti et al. 2018). Multigraph. A graph in which there are multiple edges between two nodes (See Fig. 4(b)). The most common operations for performing graph convolution on a multigraph are graph fusion and separate subgraphs (Zhou et al. 2020). These techniques can cooperate with our GN-CDE model for representation learning on evolving multigraph. Knowledge graph. This graph is a collection of real-world entities and the relational facts between pairs of entities. The underlining graph structure of the knowledge graph is commonly a multi- digraph with labeled edges, where the labels indicate the types of relationships (See Fig. 4(c)). In order to learn the graph embeddings, we would first utilize the graph fusion or separate subgraphs technique proposed for processing multigraph to acquire a single graph, then we employ the GN-CDE model presented in Eq. 13 but without node attributes matrix for the continuous inference, that is Zt = Zt0 + (cid:16) fθ (cid:90) t t0 Zs, As, E (cid:17) d ˆAs for t ∈ (t0, tN ], (28) where Zt0 = ζθ(t0, At0, E). Heterogeneous information networks. This is a complex graph type that consists of multiple types of nodes or edges (See Fig. 4(d)). In order to deal with the dynamic node types and edge features of heterogeneous information networks, we can directly apply the GN-CDE model presented in Eq. 13. We recommend a comprehensive overview of graph neural networks (Zhou et al. 2020) for readers who are interested in exploring the extension of our GN-CDE model to various graph types. Appendix E. Further Empirical Results E.1. Data Heat Diffusion Dynamics: The dynamics are governed by Newton's law of cooling as follows, dxt(vi) dt = −k(i,j) n (cid:88) j=1 A(i,j) (x(vi) − x(vj)) , where xt(vi) represents the state of node vi at time t and A(i,j) is the heat capacity matrix represents the neighbors of each node vi. 21 (a) Directed graph(b) Multigraph(c) Knowledge graph(d) Heterogeneous information graph GRAPH NEURAL CONTROLLED DIFFERENTIAL EQUATION Table 2: Quantitative evaluation of prediction accuracy between GN-CDE and other baselines on node attribute prediction tasks. We run each method 10 times and report the average (cid:96)1 loss value with standard deviation. Here, the sum of extrapolation and interpolation results is presented for evaluating the performance among the whole dynamic procedure. Best results are printed in boldface. Model Heat Diffusion Gene Regulation Algorithms Neural ODE Neural CDE GN-CDE Neural ODE Neural CDE GN-CDE Grid 1.091 ± 0.344 0.962 ± 0.306 0.369 ± 0.134 Random 0.629 ± 0.116 1.601 ± 0.471 0.521 ± 0.202 Power Law 1.154 ± 0.189 1.642 ± 0.313 0.630 ± 0.135 Small World 1.093 ± 0.123 1.201 ± 0.179 0.484 ± 0.127 Community 1.408 ± 0.091 1.857 ± 0.312 0.457 ± 0.112 3.153 ± 0.562 2.967 ± 0.245 1.388 ± 0.262 3.732 ± 1.066 6.107 ± 3.202 2.193 ± 0.550 2.549 ± 0.226 2.764 ± 0.162 0.886 ± 0.072 2.252 ± 0.430 2.302 ± 0.591 1.331 ± 0.323 4.685 ± 0.759 5.325 ± 0.500 1.737 ± 0.260 Gene regulatory dynamics: The dynamics are governed by by Michaelis-Menten equation as follows, dxt(vi) dt = −bix(vi)f + n (cid:88) j=1 A(i,j) xh(vj) xh(vj) + 1 , where the first term degradation when f = 1 or dimerization when f = 2. E.2. Results The digital evaluation results for Fig. 1 and Fig. 2 are presented in Table 2. 22
http://arxiv.org/abs/2302.11329v2
2023-03-03T05:44:48
2023-02-22T12:25:07
HINormer: Representation Learning On Heterogeneous Information Networks with Graph Transformer
Recent studies have highlighted the limitations of message-passing based graph neural networks (GNNs), e.g., limited model expressiveness, over-smoothing, over-squashing, etc. To alleviate these issues, Graph Transformers (GTs) have been proposed which work in the paradigm that allows message passing to a larger coverage even across the whole graph. Hinging on the global range attention mechanism, GTs have shown a superpower for representation learning on homogeneous graphs. However, the investigation of GTs on heterogeneous information networks (HINs) is still under-exploited. In particular, on account of the existence of heterogeneity, HINs show distinct data characteristics and thus require different treatment. To bridge this gap, in this paper we investigate the representation learning on HINs with Graph Transformer, and propose a novel model named HINormer, which capitalizes on a larger-range aggregation mechanism for node representation learning. In particular, assisted by two major modules, i.e., a local structure encoder and a heterogeneous relation encoder, HINormer can capture both the structural and heterogeneous information of nodes on HINs for comprehensive node representations. We conduct extensive experiments on four HIN benchmark datasets, which demonstrate that our proposed model can outperform the state-of-the-art.
[ "Qiheng Mao", "Zemin Liu", "Chenghao Liu", "Jianling Sun" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11329v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11329v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
HINormer: Representation Learning On Heterogeneous Information Networks with Graph Transformer Qiheng Mao1,4, Zemin Liu2†, Chenghao Liu3†, Jianling Sun1,4 1Zhejiang University; 2National University of Singapore; 3Salesforce Research Asia; 4Alibaba-Zhejiang University Joint Institute of Frontier Technologies {maoqiheng, sunjl}@zju.edu.cn, [email protected], [email protected] 3 2 0 2 r a M 3 ] G L . s c [ 2 v 9 2 3 1 1 . 2 0 3 2 : v i X r a ABSTRACT Recent studies have highlighted the limitations of message-passing based graph neural networks (GNNs), e.g., limited model expres- siveness, over-smoothing, over-squashing, etc. To alleviate these issues, Graph Transformers (GTs) have been proposed which work in the paradigm that allows message passing to a larger coverage even across the whole graph. Hinging on the global range atten- tion mechanism, GTs have shown a superpower for representation learning on homogeneous graphs. However, the investigation of GTs on heterogeneous information networks (HINs) is still under- exploited. In particular, on account of the existence of heterogeneity, HINs show distinct data characteristics and thus require different treatment. To bridge this gap, in this paper we investigate the repre- sentation learning on HINs with Graph Transformer, and propose a novel model named HINormer, which capitalizes on a larger-range aggregation mechanism for node representation learning. In partic- ular, assisted by two major modules, i.e., a local structure encoder and a heterogeneous relation encoder, HINormer can capture both the structural and heterogeneous information of nodes on HINs for comprehensive node representations. We conduct extensive experiments on four HIN benchmark datasets, which demonstrate that our proposed model can outperform the state-of-the-art. CCS CONCEPTS • Computing methodologies → Learning latent representa- tions; • Information systems → Data mining. KEYWORDS Graph Transformer, heterogeneous information network, graph representation learning ACM Reference Format: Qiheng Mao1,4, Zemin Liu2†, Chenghao Liu3†, Jianling Sun1,4. 2023. HI- Normer: Representation Learning On Heterogeneous Information Networks with Graph Transformer. 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.3583493 †The corresponding authors. 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.3583493 1 INTRODUCTION Heterogeneous information networks (HINs) [37, 39, 40] are con- necting structures with multiple types of nodes and edges, implying complicated heterogeneous semantic relations between nodes. As many real-world networks such as Web data can be modeled as HINs, they have attracted a surge of investigation which can further benefit the downstream graph analysis tasks. In particular, heteroge- neous graph representation learning [52] arises as an effective tool to embed nodes into low-dimensional vectors by preserving both graph structures and heterogeneity, opening a great opportunity for HIN analysis. Recently, more attention has been shifted to heterogeneous graph neural networks (HGNNs) [28, 48, 61], which generalize the key operation of neighborhood aggregation in graph neural networks (GNNs) [50] onto HINs, with additionally modeling the graph het- erogeneity. The capability of encoding both graph structure and heterogeneity gives rise to the outstanding performance of HGNNs in various HIN tasks, e.g., node classification and link prediction. Similar to GNNs, HGNNs also follow a message-passing paradigm to generate node representations, by recursively aggregating messages from the neighboring nodes in a heterogeneity-aware manner. In terms of heterogeneity utilization, HGNNs can be divided into two categories, i.e., meta-path based HGNNs and meta-path free HGNNs. The former aggregates messages under the assistance of manually designed or automatically generated meta-paths [23, 40, 47], while the latter directly incorporates the heterogeneity information in representation learning without the help of meta-path [18, 27, 28]. With the prevalent applications and in-depth investigation of GNNs, the limitations of message-passing based frameworks are beginning to emerge. Firstly, the expressive power of GNNs is bounded by the Weisfeiler-Lehamn isomorphism which means it may fail to learn finer-grained graph structures [51]. Secondly, GNNs suffer from the over-smoothing problem, which limits the capacity of GNNs for building deeper architectures [6]. Thirdly, the neighborhood-based aggregation impairs the ability of GNNs to propagate messages to distant nodes, and only short-range signals can be captured due to the over-squashing problem [1]. Although there are some works that try to separately tackle these problems with GNN-backboned frameworks [33–35, 60], the limitation of message-passing architectures for message passing still remains. The success of Transformer architectures in fields like natural language processing [44] and computer vision [9, 15, 25], has at- tracted a surge of attention from graph area, which accordingly demonstrates the strong capability of learning interactions be- tween nodes with global attention mechanism. A flurry of Graph Transformer models [29, 49] have been proposed to replace the WWW '23, May 1–5, 2023, Austin, TX, USA Qiheng Mao, Zemin Liu, Chenghao Liu, Jianling Sun message-passing paradigm and they have achieved the state-of- the-art performance on a variety of graph tasks [31, 53]. Despite the success of Graph Transformers, there is still a significant lim- itation of applying Transformer architectures to graphs: global attention incurs quadratic complexity w.r.t. the number of nodes in a graph [31, 59], which results in the poor scalability toward large networks. Due to this issue, small-scale graph-level Trans- formers thrive while large-scale node-level Transformers do not. In particular, Transformer-based graph models for large-scale and heterogeneity-complex HINs are still under-exploited. Challenges and present work. To narrow this gap, in this pa- per we investigate the general application of graph Transformers on HINs for node representation learning, which is, however, a non-trivial problem. On the one hand, though graph Transformers have strong advantages in the extraction of high-order features and long-range dependencies, the large HIN sizes usually give rise to the infeasibility of learning discriminative node representations due to their large perceptual fields, marginalizing the local-view structures of nodes [7, 28, 31, 49]. So, how to design an efficient node-level Transformer encoder by virtue of the local-view structure information? On the other hand, HINs typically preserve various type information which usually reflects the semantic relations be- tween nodes. Therefore, a successful design of HIN Transformer should be capable of capturing the heterogeneity to express the diverse semantics. Thus, how to effectively capture the heterogeneous semantic relations between nodes with graph Transformer on HINs? To address these challenges, in this paper we propose a novel Heterogeneous Information Network Transformer, i.e., HINormer, to investigate the feasibility of replacing HGNNs with more pow- erful Transformer architectures, free from pre-designed semantic schema like meta-paths, to learn both structure and heterogeneity simultaneously in an end-to-end manner. In particular, HINormer employs a lightweight and effective node-level self-attention mech- anism, to capture the local structure information with context aggre- gation. Besides, it encodes the heterogeneous semantics on HINs with a novel relative relation encoder, by exploiting the seman- tic relations between nodes to benefit the expressiveness of HIN Transformer for heterogeneity preservation. Inspired by [14, 59], to enable the node representation learning on HINs with the Transformer architecture, we propose a D-hop node context sampling approach to derive the contextual sequence for each node. In addition, we replace the dot-product global at- tention mechanism with a more lightweight GATv2 [4] to save the learnable parameters in order to alleviate overfitting. Furthermore, Lv et al. [28] empirically observe that the lightweight homogeneous GNNs can meet the performance requirement for representation learning on HINs with even fewer parameters. Therefore, to ad- dress the first challenge, drawing inspiration from this, as well as the successful practice on homogeneous graph Transformers, we propose a novel local structure encoder to extract the contextual structures on HINs, which is lightweight in structure and capable of recursively aggregating contextual information for a target node on the HIN. The enhanced node features are further employed as the input of heterogeneous Transformer to complement the neces- sary local-view structure information for discriminative node-level representation learning. To address the second challenge, given a target node, we assign each contextual node with a relational encoding to express the semantic relations with the target one, which can further provide heterogeneous information for Transformer in the contextual ag- gregation process. To achieve this, we propose a novel heteroge- neous relation encoder to learn the relational encodings in order to express the semantic proximities between nodes. The hetero- geneous relation encoder takes both heterogeneous information and network structure as inputs, recognizes the importance of dif- ferent types, and updates relational encodings with the learned type-aware weights from the neighborhood. In particular, the re- lation encoder concentrates on the relative proximities between nodes on the HIN without taking into account node features, in contrast to the local structure encoder which focuses on the extrac- tion of local structures with the assistance of node features. The derived heterogeneous relational encodings can reflect the semantic proximities between nodes in the heterogeneity view, which is also necessary for Graph Transformer on HINs. HINormer will further employ this relative relational encoding in the global self-attention mechanism as the attention map bias [31] to enhance the awareness ability of heterogeneity. Contributions. To the best of our knowledge, this is the first work to investigate the application of global-attention based Transformer on heterogeneous information networks. In summary, our contri- butions are three-fold. (1) We design a new representation learning paradigm for HINs by innovatively applying Graph Transformer for node embeddings. (2) We propose a novel model HINormer, which consists of a local structure encoder and a heterogeneous relation encoder to capture both structure and heterogeneity on HINs to assist the Transformer for node representation learning. (3) Extensive experiments on four benchmark datasets demonstrate that HINormer can outperform the state-of-the-art baselines. 2 RELATED WORK Heterogeneous Network Embedding. The development of graph embedding approaches [13, 30, 42] opens great opportunities for graph analysis, which aim to map nodes or substructures into a low-dimensional space in which the connecting structures on the graph can be preserved. However, real-word networks are often composed of multi-modal and multi-typed nodes and relations [52], which brings significant research attention on heterogeneous net- work embeddings (HNEs) [37, 46]. Similar to graph embedding ap- proaches, there are two major categories of HNEs, i.e., random walk approaches [8, 11, 27] and first/second-order proximity methods [38, 41]. Meta-paths or type-aware network closeness constraints are used to exploit network heterogeneity for HNEs. All of these methods are considered as shallow network embedding methods and can not preserve attribute information of nodes. Heterogeneous Graph Neural Network. The success of GNNs on homogeneous, which preserve both the surrounding structure and content information simultaneously into node embeddings [5, 50], has led to a flurry of proposed heterogeneous graph neural networks in recent years [28, 48]. Similar to HNEs, the flexibility HINormer: Representation Learning On Heterogeneous Information Networks with Graph Transformer WWW '23, May 1–5, 2023, Austin, TX, USA of HGNNs model design mainly lies in the modeling of heteroge- neous information (Heterogeneity). The way of utilization of het- erogeneity divides HGNNs into two categories, i.e., meta-path based HGNNs [12, 47] and meta-path free HGNNs [18, 62]. Meta-path based HGNNs utilize meta-paths [19] to aggregate information from type-specific neighborhood, and is able to capture higher-order semantic information specified by the selected meta-paths. The selection of meta-paths needs expert knowledge of networks and plays a key role in model performance. Meta-path free HGNNs get rid of dependence on handcraft meta-paths, they employ message- passing mechanism directly on the original heterogeneous network with node/edge type-aware module, so that the model can cap- ture structural and semantic information simultaneously. The most relevant HGNN to us is HGT [18]. Extended from GAT, HGT calcu- lates heterogeneous attention scores for 1-hop neighboring nodes w.r.t. edge types, which still follows message-passing paradigm and suffers from the limitation of short-range view. Graph Transformers. Recently, a growing body of research has highlighted the limitations of Message-Passing-based GNN models such as expressiveness bounds, over-smoothing, over-squashing and so on [1, 6, 51]. Increasing attention from graph representation learning field has been paid to the design of Graph Transformers [10, 22, 49, 54]. The fully-connected global attention mechanism has shown its power in many different graph representation learn- ing tasks. The generalizations of Transformer to graph-structured data are mainly around integration of graph structural information into Transformer architectures. Some Graph Transformers resort to combination with GNNs to capture local structure information, like GraphTrans [49], GraphiT [29]. Some propose to use graph positional encoding and structural encoding to complement topo- logical information into Graph Transformer [10, 22] like positional encoding used in the original Transformer [44] and its variants in different fields [9]. And other graph structural information like the shortest path length, node degree and edge features [54] can also be used as position encodings to enhance the expressiveness of Graph Transformer in structural aspect. But most existing Graph Transformers directly use the whole graph as input, making them hard to handle large-scale real-world network like HINs because the global attention mechanism has square complexity w.r.t. number of nodes [59]. 3 PRELIMINARIES 3.1 Heterogeneous Information Network A heterogeneous information network (HIN) can be defined as G = {V , E, X, φ,ψ }, where V is the set of nodes, E is the set of edges, and X ∈ R |V |×dx is the feature matrix, with xv ∈ Rdx denoting the feature vector of node v ∈ V . Each node v ∈ V has a type φ (v) and each edge e ∈ E has a type ψ (e), where φ is node type mapping function and ψ is edge type mapping function, respectively. The sets of node types and edge types are denoted as Tv = {φ (v) : ∀v ∈ V } and Te = {ψ (e) : ∀e ∈ E}, respectively. When |Tv | = |Te | = 1, the graph degenerates into a homogeneous graph. 3.2 Graph Neural Networks GNNs [24, 26, 50] and HGNNs [50, 52] typically depend on the key operation of layer-wise neighborhood aggregation to recur- sively pass and transform messages from the neighboring nodes to form the representation of the target node. Formally, let φg (*; θg) denote a GNN architecture parameterized by θg. In the l-th layer, the representation of node v, i.e., hl l v = Aggr(h h v ∈ Rdl , can be calculated by l−1 , {h i : i ∈ Nv }; θl l−1 v g). (1) g, θ 2 where Nv is the neighbors set of node v (or type-specific neighbor- hood for HGNNs), and Aggr(*; θl g) is the neighborhood aggregation function parameterized by θl g in layer l. Given a total of l layers, θg = {θ 1 g, . . . , θ l g} denotes all the parameters set in the aggre- gation model. In addition, different GNN architectures may differ in the neighborhood aggregation function, e.g., mean-pooling ag- gregation in GCN [21], attention-based aggregation in GAT [45]. In particular, our local structure encoder is agnostic to the base GNN models, and we aim to make it flexible to most neighborhood aggregation based GNNs. 3.3 Transformer Architecture The standard Transformer layer is composed of two major compo- nents, a multi-head self-attention (MSA) module and a feed-forward network (FFN). In the following part, we will briefly introduce MSA without multi-head for simplicity. Given an input sequence H = [h1, h2, ..., hn]⊤ ∈ Rn×d , where d is the hidden dimension and hi ∈ Rd is the hidden representation at position i, the MSA firstly projects the input H to the query-, key-, value-spaces, denoted as Q, K, V, by resorting to three parameter matrices WQ ∈ Rd×dK , WK ∈ Rd×dK and WV ∈ Rd×dV , as Q = HWQ, K = HWK, V = HWV. Then, the scaled dot-product attention mechanism is applied to the corresponding < Q, K, V > as (2) MSA(H) = Softmax QK⊤ √︁dK V. (3) Thereafter, the output of MSA will be connected to the FFN with two layers of Layer Normalization (LN) [2] and the residual connection [16] to obtain the output of the l-th Transformer layer, denoted as Hl : l = LN(MSA(H (cid:101)H l = LN(FFN((cid:101)H H l−1) + H l ). l ) + (cid:101)H l−1), (4) By stacking with L layers, Transformers could learn the feature- based proximities between different positions for the input se- quences, then the final output HL ∈ Rn×d can be used as the representation of the input sequence for downstream tasks. 4 THE PROPOSED MODEL: HINORMER In this section, we present the concrete description of HINormer to explore the feasibility of applying more powerful Transformer architectures to node-level representation learning on HINs. We illustrate the overall framework of HINormer in Fig. 1. Given a heterogeneous graph G with full adjacency matrix A, we first adopt WWW '23, May 1–5, 2023, Austin, TX, USA Qiheng Mao, Zemin Liu, Chenghao Liu, Jianling Sun Figure 1: Overall framework of HINormer. local structure encoder in Fig. 1(c) and heterogeneous relation en- coder in Fig. 1(d) to capture the feature-based local structural in- formation and heterogeneity-based semantic proximities for each node, respectively. The outputs of these two encoders are employed as the node features and relative positional encoding of the main part of the heterogeneous Graph Transformer, respectively. After the D-hop context sampling process for each node in Fig. 1(b), HI- Normer is able to capture high-order semantic relations for the specific context with global self-attention mechanism and gener- ate discriminative node-level representations by the integration of features, structures, and heterogeneity (Fig. 1(e)). Finally, the node labels are predicted by the normalized node representations gen- erated by Transformer layers in Fig. 1(e) and the model is trained with a supervised classification loss. In the following part, we will illustrate the details for each part. 4.1 Node-level Heterogeneous Graph Transformer Architecture Current Graph Transformers directly utilize the entire graph to generate input sequences [22, 29, 49], making these approaches only applicable to small datasets (e.g., small graphs) due to expensive memory cost. In our setting of node representation learning on HINs, the given HIN usually has a large size (e.g., the number of nodes), so in general it is impossible to treat all nodes as one input sequence. In addition, the typical tasks on HINs are node-level, e.g., node classification and link prediction, where only one graph is in general involved. Consequently, existing Graph Transformer methods are not applicable for this kind of data settings and fail to learn expressive node-level representations [31, 59]. In order to realize the node representation learning on HINs with the Transformer architecture, inspired by [14, 59], we propose the D-hop node context sampling process to get the input sequences for each node. More precisely, given a target node, we add the neighbors of each hop to iteratively construct the input sequence with pre-defined maximum depth D. Besides, in order to unify the sequence length of different nodes, all input sequences will be trimmed to a fixed length S which is compatible with global attention mechanism. Employing global attention mechanism in the local context emphasizes more on local structural information which is crucial to the discrimination of node-level representations and alleviates the deterioration of noise from the too-long-range nodes. In addition, we also propose a local structure encoder to capture structural information from the context of each node, which we will detailedly illustrate in Sect. 4.2. v, hs v1 v = [hs Formally, the sampled sequence of a target node v is denoted as s (v) = {v, v1, ..., vS−1}, and the corresponding input for Transformer , ..., hs is denoted as Hs vS−1 ]⊤ ∈ RS×d , where d is the node embedding dimension and hs is the local-enhanced node features vi from local structure encoder. In total, the entire input of Graph Transformer is denoted by Hs = [Hs N ]⊤ ∈ RN ×S×d . After the encoding of the L-layer Transformer, we achieve the output HL = [HL N ]⊤ ∈ RN ×S×d , then we require an additional step to get the representation of the target node, which 2 , ..., HL 2, ...Hs 1 , HL 1, Hs Feature-based AttentionHetero-based AttentionLocal-Enhanced Node features+Add & NormHetero-relation EncodingAggregationTarget Node EmbeddingPrediction(cid:1838)(cid:2870)NormTask Loss(a)A Toy HIN(b)Node Context Sequence(d) Hetero-Relation Encoder(c)Local-Structure Encoder(e)HINormer Transformer ArchitectureHetero-relation Encoding(cid:1874)(cid:2869)(cid:1874)(cid:2870)(cid:1874)(cid:2871)(cid:1874)(cid:2872)(cid:1874)(cid:2873)(cid:1874)(cid:2874)(cid:1874)(cid:2875)(cid:1874)(cid:2876)(cid:1874)(cid:2877)Target Node(cid:1874)(cid:2869)(cid:1874)(cid:2870)(cid:1874)(cid:2872)(cid:1874)(cid:2873)(cid:1874)(cid:2871)(cid:1874)(cid:2869)(cid:1874)(cid:2875)(cid:1874)(cid:1874)(cid:2876)(cid:1874)(cid:2871)(cid:1874)(cid:2869)(cid:1874)(cid:2869)(cid:2868)(cid:1874)(cid:2869)(cid:2869)(cid:1874)(cid:2876)(cid:1874)(cid:2877)(cid:1874)(cid:2871)(cid:1874)(cid:2873)(cid:1874)(cid:1874)(cid:2872)(cid:1874)(cid:1874)(cid:2874)(cid:1874)(cid:1874)(cid:2869)(cid:1874)(cid:2870)(cid:2870)(cid:1874)(cid:2870)(cid:1874)(cid:2872)(cid:2872)(cid:1874)(cid:1874)(cid:2869)(cid:2870)(cid:1874)(cid:2873)(cid:1874)(cid:2869)(cid:2871)(cid:1874)(cid:2871)(cid:1874)(cid:2869)(cid:1874)(cid:2869)(cid:1874)(cid:2870)(cid:1874)(cid:2874)(cid:1874)(cid:1874)(cid:2875)(cid:1874)(cid:2871)(cid:1874)(cid:2873)(cid:1874)(cid:2872)(cid:1874)(cid:2876)(cid:1874)(cid:2874)(cid:1874)(cid:2877)(cid:1874)(cid:2877)2-hop1-hopLocal-Enhanced Node features(cid:1874)(cid:2869)Original featureType Embedding2-hop1-hopNode Context HINormer: Representation Learning On Heterogeneous Information Networks with Graph Transformer WWW '23, May 1–5, 2023, Austin, TX, USA can be achieved by a readout function as L hv = Readout(h s (v) [i ] |vi ∈ s (v)), (5) where s (v) [i] denotes the i-th node in s (v). In practice, we directly use the target node representation in the sequences as the output node embeddings, i.e., hv = hL , which we observe can exceed the performance of other graph readout functions [51, 55]. s (v) [0] The standard Transformer architecture usually contains much more learnable parameters than HGNNs, which raises difficulties for effective model training with limited supervision, and might give rise to the overfitting issue. To further improve the adaptabil- ity of Transformer to node-level representation learning on HINs, we propose two simple yet effective changes to Transformer ar- chitecture to prevent the risk of overfitting. First, instead of the original self-attention mechanism which involves more learnable parameters as illustrated in Sect. 3.3, we propose to utilize GATv2 [4] as the replacement. GATv2 is proven to be a universal approxi- mator attention function which is more powerful than dot-product self-attention in Transformer yet with fewer parameters [4]. We provide the differences between GAT [45] and GATv2 [4] as follows. GAT : α (hi, hj ) = LeakyReLU(a⊤ * [Whi ||Whj ]), (6) GATv2 : α (hi, hj ) = a⊤ * LeakyReLU(W * [hi ||hj ]). (7) Second, we delete the feed-forward network (FFN) in each Trans- former layer, which can greatly reduce the number of learnable parameters and have no significant negative impact on model per- formance. Note that, here the inexistence of FFN in heterogeneous Graph Transformer further demonstrates the effectiveness of the global attention mechanism. Overall, the calculation of a Transformer layer in HINormer is formulated as l = LN(H H l−1 + HeteroMSA(H where HeteroMSA(*) is the heterogeneity-enhanced multi-head self-attention and R represents the heterogeneous relational encod- ings, which we will introduce in detail in Sect. 4.3. l−1, R)), (8) where Wφ (v) ∈ Rd×dx is a learnable parameter matrix, and bφ (v) ∈ Rd is a learnable bias term. Then the features of different types can be aggregated with the same function, and the heterogeneity is also preserved in the shared feature space. Local structure encoder. Since Transformer can only capture the feature-based similarity between nodes, the structural similar- ity and more important local context information for node-level representation learning are out of reach for the global attention mechanism. With an effective local structure encoder, global atten- tion is able to consider the similarity between node pairs from more comprehensive views and thus can generate more representative embeddings. For a target node v, aggregation of neighborhood information with Ks times can collect both structures and features of the contex- tual Ks -hop ego-graph of the target node, and the output represents the Ks -subtree structure rooted at target node v. With an appropri- ate Ks (usually very small), the over-smoothing and over-squashing problem can be alleviated. We implement the local structure en- coder in the form of GNN-based neighborhood aggregation due to its effectiveness and computational efficiency, as follows. l v = Aggr(h h l−1 v l−1 , {h i : i ∈ Nv }; θl s ). (10) Note that, this local structure encoder is agnostic to most GNN or HGNN architectures [56, 61], and a simple GNN such as GCN [21] and GraphSAGE [14] can bring significant performance improve- ment. In practice, we also implement the local structure encoder in a non-parametric way for the consideration of higher efficiency, as follows. Ks v = ( ˆA Ks H) [v, :], h (11) where ˆA = D−1/2AD−1/2 is the normalized adjacency matrix which is used in GCN [21], and Z[i, :] denotes the i-th row in matrix Z. Then we directly use the output of the Ks -th layer, i.e, Hs = HKs , as the input of heterogeneous Graph Transformer. Please refer to Table 3 in Experiments for the empirical evaluation of different GNN-backboned local structure encoders. 4.2 Local Structure Encoder Existing representative studies of HGNNs, e.g., SimpleHGN [28], have proved the importance of structural information from a local view for heterogeneous graph representation learning, and the ho- mogeneous graph neural networks such as GCN [21] and GAT [45], can achieve competitive performance even without the modeling of heterogeneity on HINs. Aggregating features from the neigh- borhood is a direct way to involve local structural information on HINs [7, 31], and the heterogeneity can also be learned by the heterogeneous feature projection [28, 48]. Then the achieved local structure encoding will serve as the input of the heterogeneous Graph Transformer as a local sub-structure enhanced feature to benefit the global attention mechanism. Heterogeneous feature projection. As the features of different types of nodes on HINs usually exist in different feature spaces, the first priority is to map their features into a shared feature space. We employ a linear transformation with bias term as the heterogeneous feature projection function, as hv = Wφ (v) xv + bφ (v), (9) 4.3 Heterogeneous Relation Encoder HINs have abundant heterogeneity to reflect node semantic prox- imities in a heterogeneous view. To tackle the lack of heterogeneity modeling for heterogeneous Graph Transformer, we propose a novel heterogeneous relation encoder to learn the heterogeneous semantic proximities between nodes. To encode the heterogeneity of HINs, for a target node v, we use the one-hot type vector as the initialization of heterogeneous relational encoding r0 v = T[φ (v), :], where T ∈ R|Tv |×|Tv | is the one- hot type embedding. As |Tv | is usually a small value, the relation encoder is lightweight and fast to calculate. In particular, we implement heterogeneous relation encoder in the way of neighborhood aggregation to encode the local hetero- geneity and structures, and the number of layers is denoted as Kh. The aggregation function of relation encoder is model-agnostic, we can use a simple GNN aggregation function. In practice we employ GCN as the aggregation function due to its simplicity and effective- ness. And we introduce additional learnable type-aware weights to adjust the influence of different types in each aggregation step WWW '23, May 1–5, 2023, Austin, TX, USA Qiheng Mao, Zemin Liu, Chenghao Liu, Jianling Sun since different types may contribute differently. This simple hetero- geneous model further improves the ability of HINormer to capture heterogeneity, and the calculation of relational encoding of node v in iteration step t, i.e., rt v can be formalized as t v = r ∑︁ u ∈N (v) wt −1 φ (u) f (r t −1 u ; θt h), (12) Kh v where wφ (u) is the learnable aggregation weight of type φ (u), and h) is the transformation function parameterized by θt f (*; θt . With h Kh iterations, the output r represents the contextual heterogene- ity of node v, by comparing which we can derive the heterogeneity- aware proximities between two nodes. Then we can employ it as the heterogeneity-aware positional encoding of node v and feed into HeteroMSA(*), to adjust the self-attention mechanism to cap- ture the semantic proximities between nodes. Thus, the attention in HeteroMSA(*) can be further modified as follows, R R i = WQR ri, j = WKR rj , k q R R ˆαi,j = αi,j + β * q j , i k (13) where αi,j is the attention score calculated by feature-based atten- tion mechanism (corresponding to the Hl−1 in Eq. (8)), WQR , WKR ∈ R |Tv |×|Tv | are the learnable projection matrices, and β is the hyper- parameter to modulate the weight of heterogeneous proximities. The heterogeneous attention is also extended to multi-head and we leave out here for simplicity. Finally, ˆα is further utilized in the attentive aggregation, i.e., HeteroMSA(*). 4.4 Training objective Given the node-level representations on HINs, we feed them into the task loss for end-to-end training. We concentrate on node classi- fication and leave other downstream tasks as future work. Formally, give the node representation hv for node v, we further employ a lin- ear layer φLinear (*; θpre) parameterized by θpre to predict the class distribution as follows, ̃yv = φLinear (hv; θpre). (14) where ̃yv ∈ RC is the prediction and C is the number of classes. In addition, we further add an L2 normalization on ̃yv for stable optimization [28, 32]. Given the training nodes Vtr, for multi-class node classification, we employ cross-entropy as the overall loss, as L = (cid:205)v ∈Vtr CrossEnt( ̃yv, yv), (15) where CrossEnt(*) is the cross-entropy loss, and yv ∈ RC is the one-hot vector that encodes the label of node v. Note that, for multi- label node classification, we can employ binary cross-entropy to calculate the overall loss. 5 EXPERIMENTS In this section, we conduct extensive experiments on node classifi- cation to evaluate the performance of the proposed HINormer, and further give detailed model analysis from several aspects. Table 1: Summary of datasets. # Nodes # Node Types # Edges # Edges Types Target # Classes DBLP IMDB Freebase AMiner 26,128 21,420 43,854 55,783 4 239,566 86,642 4 4 15,1034 3 153,676 6 author 6 movie 6 movie paper 4 4 5 3 4 5.1 Experimental Setups Datasets. We employ four public HIN benchmark datasets, includ- 2 [43]), ing two academic citation datasets (DBLP 3), and a knowledge graph dataset a movie rating dataset (IMDB (Freebase [3]). Table 1 summarizes the statistic of the datasets. For datasets without node features, we use the one-hot vectors with length |V | as the node initial features to denote their existence. We provide further details for the datasets in Appendix A. 1 [28] and AMiner Baselines. To comprehensively evaluate the proposed HINormer against the state-of-the-art approaches, we consider a series of base- lines from three main categories, Homogeneous GNNs (including GCN [21], GAT [45], Transformer [44]), Meta-path based HGNNs (in- cluding RGCN [36], HetGNN [58], HAN [47], GTN [57], MAGNN [12]) and Meta-path free HGNNs (including RSHN [62], HetSANN [17], HGT [18], SimpleHGN [28]). We provide further details for these baselines in Appendix B. Settings and parameters. We conduct multi-class node classifica- tion on DBLP, Freebase, and AMiner, while multi-label node classifi- cation on IMDB. For each dataset, we randomly split the nodes with the proportion of 24:6:70 for training, validation and test. In partic- ular, for datasets DBLP and IMDB, we follow the standard split from HGB [28], and evaluate our model through the online leaderboard4. Micro-F1 and Macro-F1 are employed as metrics to evaluate the classification performance. All experiments are repeated for five times, and we report the averaged results with standard deviations. We provide further details of hyper-parameter settings for both the baselines and HINormer in Appendix C. 5.2 Performance Evaluation We conduct node classification on the four benchmark datasets. For our HINormer, we employ GCN [21] as the local structure encoder. To evaluate the flexibility of local structure encoder, we further adopt GraphSAGE, GIN, and non-parameter Adj as shown in Eq. (11), as local structure encoders for comparison. Node classification. For DBLP and IMDB, as we adopt the standard settings for experiments, we directly borrow the results published in HGB leaderboard for comparison. For the other two datasets, we follow the default hyper-parameter settings for all the baselines in their literature and further tune them according to their validation performance. We report the performance comparison in Table 2, and observe that HINormer can outperform all the baselines. In particular, we make the following observations. Firstly, the standard Transformer can achieve competitive performances against 1http://web.cs.ucla.edu/ yzsun/data/ 2https://www.aminer.org/data/ 3https://www.kaggle.com/karrrimba/movie-metadatacsv 4https://www.biendata.xyz/hgb/ HINormer: Representation Learning On Heterogeneous Information Networks with Graph Transformer WWW '23, May 1–5, 2023, Austin, TX, USA Table 2: Performance evaluation on node classification, with GCN as local structure encoder. Henceforth, tabular results are in percent; the best result is bolded and the runner-up is underlined. A dash (-) denotes that the models run out of memory on large graphs. Methods GCN GAT Transformer RGCN HetGNN HAN GTN MAGNN RSHN HetSANN HGT SimpleHGN DBLP IMDB Freebase AMiner Micro-F1 Macro-F1 Micro-F1 Macro-F1 Micro-F1 Macro-F1 Micro-F1 Macro-F1 91.47 ±0.34 93.39 ±0.30 93.99 ±0.11 92.07 ±0.50 92.33 ±0.41 92.05 ±0.62 93.97 ±0.54 93.76 ±0.45 93.81 ±0.55 80.56 ±1.50 93.49 ±0.25 94.46 ±0.22 90.84 ±0.32 93.83 ±0.27 93.48 ±0.12 91.52 ±0.50 91.76 ±0.43 91.67 ±0.49 93.52 ±0.55 93.28 ±0.51 93.34 ±0.58 78.55 ±2.42 93.01 ±0.23 94.01 ±0.24 64.82 ±0.64 64.86 ±0.43 66.29 ±0.69 62.95 ±0.15 51.16 ±0.65 64.63 ±0.58 65.14 ±0.45 64.67 ±1.67 64.22 ±1.03 57.68 ±0.44 67.20 ±0.57 67.36 ±0.57 57.88 ±1.18 58.94 ±1.35 62.79 ±0.65 58.85 ±0.26 48.25 ±0.67 57.74 ±0.96 60.47 ±0.98 56.49 ±3.20 59.85 ±3.21 49.47 ±1.21 63.00 ±1.19 63.53 ±1.36 68.34 ±1.58 69.04 ±0.58 67.89 ±0.39 60.82 ±1.23 62.99 ±2.31 61.42 ±3.56 - 64.43 ±0.73 61.43±5.37 - 66.43 ±1.88 67.49 ±0.97 59.81 ±3.04 59.28 ±2.56 63.35 ±0.46 59.08 ±1.44 58.44 ±1.99 57.05 ±2.06 - 58.18 ±3.87 57.37 ±1.49 - 60.03 ±2.21 62.49 ±1.69 85.75 ±0.41 84.92 ±0.68 85.72 ±0.43 81.58 ±1.44 72.34 ±1.42 81.90 ±1.51 - 82.64 ±1.59 73.33 ±2.71 - 85.74 ±1.24 86.44 ±0.48 75.74 ±1.10 74.32 ±0.95 74.15 ±0.28 62.53 ±2.31 55.42 ±1.45 64.67 ±2.21 - 68.60 ±2.04 51.48 ±4.20 - 74.98 ±1.61 75.73 ±0.97 HINormer 94.94 ±0.21 94.57 ±0.23 67.83 ±0.34 64.65 ±0.53 69.42 ±0.63 63.93 ±0.59 88.04 ±0.12 79.88 ±0.24 Table 3: Node classification using other GNNs as local structure encoders. Methods Transformer HINormer-Adj HINormer-SAGE HINormer-GIN HINormer-GCN DBLP IMDB Freebase AMiner Micro-F1 Macro-F1 Micro-F1 Macro-F1 Micro-F1 Macro-F1 Micro-F1 Macro-F1 93.88 ±0.66 93.35 ±0.58 67.21 ±0.77 64.70 ±0.65 67.89 ±0.39 63.35 ±0.46 85.72 ±0.43 74.15 ±0.28 94.57 ±0.25 94.07 ±0.30 67.98 ±0.27 63.68 ±0.58 68.98 ±0.26 94.26±0.09 94.37 ±0.24 95.11 ±0.27 93.85 ±0.10 94.01 ±0.26 94.75 ±0.29 68.02 ±0.57 67.41 ±0.41 68.50 ±0.37 64.15 ±0.41 63.55 ±0.49 65.59 ±0.34 68.64 ±0.44 68.87 ±0.83 69.42 ±0.63 64.64 ±0.49 64.12 ±0.50 64.23 ±0.67 63.93 ±0.59 86.82 ±0.43 77.77 ±0.77 87.50 ±0.35 87.72 ±0.25 88.04 ±0.12 79.06 ±0.63 79.32 ±0.50 79.88 ±0.24 HGNNs in most cases, which shows the effectiveness of context- based global attention mechanism for representation learning on HINs. Secondly, HINormer outperforms both standard Transformer and GAT by a large margin. This demonstrates the effectiveness and necessity of our local structure encoder and heterogeneous relation encoder to capture both the underlying contexts and semantics for node representation learning. Standard Transformer fails to cap- ture contextual structures and the heterogeneity with a simplified model, thus still suffers from the overfitting issue, while GAT fails to learn heterogeneity similarity and to interact with long-range nodes on the graph. Thirdly, it is interesting that no significant dif- ferences exist between the performance of meta-path based HGNNs and meta-path free HGNNs, showing that modeling heterogeneity in a learnable schema without prior knowledge might be a more practical manner. In light of this, our heterogeneous relation en- coder might be a more beneficial exploration for heterogeneity on HINs to capture the underlying semantics between nodes. Lastly, homogeneous GNNs are still powerful for representation learning on HINs, which demonstrates the effectiveness of neighborhood aggregation to capture the contextual structures on HINs. In some sense, to effectively represent the nodes, the local structure infor- mation might be more important than high-order semantics which are usually denoted by some pre-defined semantic schemas, such as meta-paths. Using other GNNs as local structure encoders. To demonstrate the flexibility of HINormer with different GNN backbones as the local structure encoder, we further utilize GIN, GraphSAGE and non-parameter Adj as the local structure encoders for comparison. For ease of comparison, we utilize a new split on datasets DBLP and IMDB for all the following experiments. The performance results are reported in Table 3. We can observe that, HINormer is capable of outperforming Transformer with different structure encoders, demonstrating the flexibility of HINormer to work with different GNN backbones to capture the local structures, assisted with the exploitation of heterogeneity. We also observe that, different GNN encoders contribute approximately to the overall performance, and even for HINormer-Adj which has no learnable parameters, it is interesting that it can still achieve promising performance, possibly due to the prominent power of neighborhood aggregation. 5.3 Model Analysis We further analyze HINormer from several aspects for node classi- fication, with GCN-backboned local structure encoder. Ablation study. To evaluate the contribution of each component in HINormer, we conduct an ablation study by comparing with several degenerate variants: (1) Transformer: we use the vanilla Transformer architecture with the D-hop context sampling strategy; (2) no LSE: we remove the local structure encoder, and use the original features of nodes transformed by heterogeneous feature projection as the input node representations. (3)no HRE: we remove the heterogeneous relation encoder and only calculate semantic similarities with their features, and this variant can be seen as a WWW '23, May 1–5, 2023, Austin, TX, USA Qiheng Mao, Zemin Liu, Chenghao Liu, Jianling Sun Table 4: Impact of different global attention mechanisms on node classification. Methods GAT DBLP IMDB Freebase AMiner Micro-F1 Macro-F1 Micro-F1 Macro-F1 Micro-F1 Macro-F1 Micro-F1 Macro-F1 93.93 ±0.19 93.47 ±0.22 65.32 ±1.13 59.69 ±3.53 69.04 ±0.58 59.28 ±2.56 84.92 ±0.68 74.32 ±0.95 HINormer-GAT HINormer-Transformer HINormer-GATv2 94.54 ±0.20 95.01 ±0.13 95.11 ±0.27 94.05 ±0.21 94.61 ±0.14 94.75 ±0.29 67.98 ±0.23 68.66 ±0.42 68.50 ±0.37 64.51 ±0.75 65.99 ±0.49 65.59 ±0.34 68.00 ±0.66 68.28 ±0.41 69.42 ±0.63 63.29 ±1.22 63.49 ±0.36 63.93 ±0.59 87.68 ±0.13 87.43 ±0.16 88.04 ±0.12 78.53 ±0.48 78.87 ±0.46 79.88 ±0.24 Figure 2: Ablation study. Figure 3: Scalability study. (a) Number of Transformer layers (b) Sequence length S homogeneous node-level Graph Transformer; (4) no HRE & LSE: we remove both the local structure and heterogeneous relation encoders together. We show the results of ablation study in Fig. 2, and make the following observations. Firstly, without the local structure encoder, HINormer fails to encode the local contexts for node representa- tions, resulting in a sharp performance degradation. It is necessary for the application of Graph Transformers on HINs to comple- ment local structural information with appropriate modules, and neighborhood aggregation might be a promising choice. Secondly, without heterogeneous relation encoder, the performance also gen- erally decreases, demonstrating that the exploitation of semantic relations is beneficial to HINormer. From another perspective, the improvement is not significant, thus how to effectively exploit the underlying semantic relations between nodes is still a burning question and we will continue to investigate in our future work. Thirdly, without both HRE and LSE, the performance significantly decreases. Due to the utilization of GATv2 [4] with the simplified attention mechanism instead of the vanilla self-attention in Trans- former to cope with the overfitting issue, no HRE & LSE can still outperform Transformer. Finally, the whole model HINormer can achieve the best performance, demonstrating its effectiveness for node representation learning on HINs. Impact of different attention mechanisms. To explore the im- pact of different global attention mechanisms, we conduct exper- iments on HINormer with three different attention mechanisms including GAT, Transformer, and GATv2, and illustrate the per- formance comparison in Table 4. Note that, the default attention mechanism in HINormer is GATv2. We first observe that all three variants can generally outperform GAT, showing that it is the global attention mechanisms rather than the neighborhood-level attention that can help to achieve superior performance. Secondly, though the three variants can achieve approaching performance, HINormer- GATv2 performs more stably and can slightly beat the others across the four datasets with fewer parameters. (c) hidden dimension d (d) Weight of heterogeneity similarity β Figure 4: Parameters sensitivity. Time comparison. We conduct node classification on DBLP to evaluate the time cost of both training (per epoch) and inferring for several representative models for comparison, including GAT, HGT, SimpleHGN and HINormer. The results are shown in Fig.3. We observe that our HINormer is as efficient as SimpleHGN and much faster than HGT. Relative low time cost with fewer parameters enhances the availability of HINormer in different settings. Parameters Sensitivity. We evaluate the sensitivity of several important hyperparameters in HINormer, and show their impact in Fig. 4. For the number of Transformer layers, smaller L is generally better for the overall performance. For the sequence length S which denotes the context size, its change does not significantly impact the performance, and a small S might be better due to the model efficiency. For the hidden dimension of Transformer layer, better performance usually profits from a larger d, due to its stronger capacity to capture the various semantics stemming from the graph heterogeneity. For heterogeneous similarity weight β, moderate values such as [0.1,0.5] would benefit the performance. 6 CONCLUSION In this paper, we investigate the problem of employing Graph Trans- former on heterogeneous information networks for node represen- tation learning. To achieve this, we propose a novel model named HINormer: Representation Learning On Heterogeneous Information Networks with Graph Transformer WWW '23, May 1–5, 2023, Austin, TX, USA HINormer, which capitalizes on a self-attention mechanism as- sisted by two key components, i.e., a local structure encoder and a heterogeneous relation encoder, to capture both the structural and heterogeneous information for node representation learning. Extensive experiments on four benchmark datasets demonstrate the effectiveness of our proposed HINormer. REFERENCES [1] Uri Alon and Eran Yahav. 2020. On the bottleneck of graph neural networks and its practical implications. arXiv preprint arXiv:2006.05205 (2020). [2] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. 2016. Layer normaliza- tion. arXiv preprint arXiv:1607.06450 (2016). [3] Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. 2008. Freebase: a collaboratively created graph database for structuring human knowledge. In Proceedings of the 2008 ACM SIGMOD international conference on Management of data. 1247–1250. [4] Shaked Brody, Uri Alon, and Eran Yahav. 2021. How attentive are graph attention networks? arXiv preprint arXiv:2105.14491 (2021). [5] Hongyun Cai, Vincent W Zheng, and Kevin Chen-Chuan Chang. 2018. A com- prehensive survey of graph embedding: Problems, techniques, and applications. IEEE TKDE 30, 9 (2018), 1616–1637. [6] Deli Chen, Yankai Lin, Wei Li, Peng Li, Jie Zhou, and Xu Sun. 2020. Measuring and relieving the over-smoothing problem for graph neural networks from the topological view. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 34. 3438–3445. [7] Dexiong Chen, Leslie O'Bray, and Karsten Borgwardt. 2022. Structure-aware transformer for graph representation learning. In International Conference on Machine Learning. PMLR, 3469–3489. [8] Yuxiao Dong, Nitesh V Chawla, and Ananthram Swami. 2017. metapath2vec: Scalable representation learning for heterogeneous networks. In Proceedings of the 23rd ACM SIGKDD international conference on knowledge discovery and data mining. 135–144. [9] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xi- aohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. 2020. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020). [10] Vijay Prakash Dwivedi and Xavier Bresson. 2020. A generalization of transformer networks to graphs. arXiv preprint arXiv:2012.09699 (2020). [11] Tao-yang Fu, Wang-Chien Lee, and Zhen Lei. 2017. Hin2vec: Explore meta-paths in heterogeneous information networks for representation learning. In Proceed- ings of the 2017 ACM on Conference on Information and Knowledge Management. 1797–1806. [12] Xinyu Fu, Jiani Zhang, Ziqiao Meng, and Irwin King. 2020. Magnn: Metap- ath aggregated graph neural network for heterogeneous graph embedding. In Proceedings of The Web Conference 2020. 2331–2341. [13] Aditya Grover and Jure Leskovec. 2016. node2vec: Scalable feature learning for networks. In KDD. 855–864. [14] William L Hamilton, Rex Ying, and Jure Leskovec. 2017. Inductive representation learning on large graphs. In NeurIPS. 1025–1035. [15] Kai Han, Yunhe Wang, Hanting Chen, Xinghao Chen, Jianyuan Guo, Zhenhua Liu, Yehui Tang, An Xiao, Chunjing Xu, Yixing Xu, et al. 2022. A survey on vision transformer. IEEE transactions on pattern analysis and machine intelligence (2022). [16] 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. [17] Huiting Hong, Hantao Guo, Yucheng Lin, Xiaoqing Yang, Zang Li, and Jieping Ye. 2020. An attention-based graph neural network for heterogeneous structural learning. In Proceedings of the AAAI conference on artificial intelligence, Vol. 34. 4132–4139. [18] Ziniu Hu, Yuxiao Dong, Kuansan Wang, and Yizhou Sun. 2020. Heterogeneous graph transformer. In Proceedings of The Web Conference 2020. 2704–2710. [19] Zhipeng Huang, Yudian Zheng, Reynold Cheng, Yizhou Sun, Nikos Mamoulis, and Xiang Li. 2016. Meta structure: Computing relevance in large heterogeneous information networks. In Proceedings of the 22nd ACM SIGKDD International conference on knowledge discovery and data mining. 1595–1604. [20] Diederik P. Kingma and Jimmy Ba. 2015. Adam: A Method for Stochastic Opti- mization. In ICLR. [21] Thomas N Kipf and Max Welling. 2017. Semi-supervised classification with graph convolutional networks. In ICLR. [22] Devin Kreuzer, Dominique Beaini, Will Hamilton, Vincent Létourneau, and Pru- dencio Tossou. 2021. Rethinking graph transformers with spectral attention. Advances in Neural Information Processing Systems 34 (2021), 21618–21629. [23] Jie Liu, Lingyun Song, Guangtao Wang, and Xuequn Shang. 2022. Meta-HGT : Metapath-aware Hypergraph Transformer for heterogeneous information net- work embedding. Neural Networks (2022). https://doi.org/10.1016/j.neunet.2022. 08.028 [24] Zemin Liu, Yuan Fang, Chenghao Liu, and Steven C.H. Hoi. 2021. Node-wise Lo- calization of Graph Neural Networks. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence. 1520–1526. [25] 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 Proceedings of the IEEE/CVF International Conference on Computer Vision. 10012–10022. WWW '23, May 1–5, 2023, Austin, TX, USA Qiheng Mao, Zemin Liu, Chenghao Liu, Jianling Sun [26] Zemin Liu, Trung-Kien Nguyen, and Yuan Fang. 2021. Tail-gnn: Tail-node graph neural networks. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining. 1109–1119. [27] Zemin Liu, Vincent W Zheng, Zhou Zhao, Fanwei Zhu, Kevin Chen-Chuan Chang, Minghui Wu, and Jing Ying. 2017. Semantic proximity search on heterogeneous graph by proximity embedding. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 31. [28] Qingsong Lv, Ming Ding, Qiang Liu, Yuxiang Chen, Wenzheng Feng, Siming He, Chang Zhou, Jianguo Jiang, Yuxiao Dong, and Jie Tang. 2021. Are we really making much progress? Revisiting, benchmarking and refining heterogeneous graph neural networks. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining. 1150–1160. [29] Grégoire Mialon, Dexiong Chen, Margot Selosse, and Julien Mairal. 2021. Graphit: Encoding graph structure in transformers. arXiv preprint arXiv:2106.05667 (2021). [30] Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. 2014. DeepWalk: Online learning of social representations. In KDD. 701–710. [31] Ladislav Rampášek, Mikhail Galkin, Vijay Prakash Dwivedi, Anh Tuan Luu, Guy Wolf, and Dominique Beaini. 2022. Recipe for a General, Powerful, Scalable Graph Transformer. arXiv preprint arXiv:2205.12454 (2022). [32] Rajeev Ranjan, Carlos D Castillo, and Rama Chellappa. 2017. L2-constrained softmax loss for discriminative face verification. arXiv preprint arXiv:1703.09507 (2017). [33] Yu Rong, Wenbing Huang, Tingyang Xu, and Junzhou Huang. 2019. Dropedge: Towards deep graph convolutional networks on node classification. arXiv preprint arXiv:1907.10903 (2019). [34] Aravind Sankar, Junting Wang, Adit Krishnan, and Hari Sundaram. 2020. Beyond localized graph neural networks: An attributed motif regularization framework. In 2020 IEEE International Conference on Data Mining (ICDM). IEEE, 472–481. [35] Aravind Sankar, Junting Wang, Adit Krishnan, and Hari Sundaram. 2022. Self- supervised role learning for graph neural networks. Knowledge and Information Systems 64, 8 (2022), 2091–2121. [36] 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. [37] Chuan Shi, Yitong Li, Jiawei Zhang, Yizhou Sun, and S Yu Philip. 2016. A survey of heterogeneous information network analysis. IEEE Transactions on Knowledge and Data Engineering 29, 1 (2016), 17–37. [38] Yu Shi, Qi Zhu, Fang Guo, Chao Zhang, and Jiawei Han. 2018. Easing embedding learning by comprehensive transcription of heterogeneous information networks. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. 2190–2199. [39] Yizhou Sun and Jiawei Han. 2012. Mining heterogeneous information networks: principles and methodologies. Synthesis Lectures on Data Mining and Knowledge Discovery 3, 2 (2012), 1–159. [40] Yizhou Sun, Jiawei Han, Xifeng Yan, Philip S Yu, and Tianyi Wu. 2011. Pathsim: Meta path-based top-k similarity search in heterogeneous information networks. Proceedings of the VLDB Endowment 4, 11 (2011), 992–1003. [41] 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. [42] Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. 2015. LINE: Large-scale information network embedding. In WWW. 1067–1077. [43] Jie Tang, Jing Zhang, Limin Yao, Juanzi Li, Li Zhang, and Zhong Su. 2008. Arnet- Miner: Extraction and Mining of Academic Social Networks. In KDD'08. 990–998. [44] 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). [45] Petar Veličković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. 2018. Graph attention networks. In ICLR. [46] Xiao Wang, Deyu Bo, Chuan Shi, Shaohua Fan, Yanfang Ye, and S Yu Philip. 2022. A survey on heterogeneous graph embedding: methods, techniques, applications and sources. IEEE Transactions on Big Data (2022). [47] Xiao Wang, Houye Ji, Chuan Shi, Bai Wang, Yanfang Ye, Peng Cui, and Philip S Yu. 2019. Heterogeneous graph attention network. In The world wide web conference. 2022–2032. [48] Xiao Wang, Nian Liu, Hui Han, and Chuan Shi. 2021. Self-supervised heteroge- neous graph neural network with co-contrastive learning. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining. 1726–1736. [49] Zhanghao Wu, Paras Jain, Matthew Wright, Azalia Mirhoseini, Joseph E Gonzalez, and Ion Stoica. 2021. Representing long-range context for graph neural networks with global attention. Advances in Neural Information Processing Systems 34 (2021), 13266–13279. [50] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. 2020. A comprehensive survey on graph neural networks. IEEE TNNLS 32, 1 (2020), 4–24. [51] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. 2019. How powerful are graph neural networks?. In ICLR. [52] Carl Yang, Yuxin Xiao, Yu Zhang, Yizhou Sun, and Jiawei Han. 2020. Heteroge- neous network representation learning: A unified framework with survey and benchmark. IEEE Transactions on Knowledge and Data Engineering (2020). [53] Chengxuan Ying, Tianle Cai, Shengjie Luo, Shuxin Zheng, Guolin Ke, Di He, Yanming Shen, and Tie-Yan Liu. 2021. Do transformers really perform badly for graph representation? Advances in Neural Information Processing Systems 34 (2021), 28877–28888. [54] Chengxuan Ying, Tianle Cai, Shengjie Luo, Shuxin Zheng, Guolin Ke, Di He, Yanming Shen, and Tie-Yan Liu. 2021. Do transformers really perform badly for graph representation? Advances in Neural Information Processing Systems 34 (2021), 28877–28888. [55] Zhitao Ying, Jiaxuan You, Christopher Morris, Xiang Ren, Will Hamilton, and Jure Leskovec. 2018. Hierarchical Graph Representation Learning with Differentiable Pooling. In NeurIPS. 4800–4810. [56] Jiaxuan You, Zhitao Ying, and Jure Leskovec. 2020. Design space for graph neural networks. Advances in Neural Information Processing Systems 33 (2020), 17009–17021. [57] Seongjun Yun, Minbyul Jeong, Raehyun Kim, Jaewoo Kang, and Hyunwoo J Kim. 2019. Graph transformer networks. Advances in neural information processing systems 32 (2019). [58] Chuxu Zhang, Dongjin Song, Chao Huang, Ananthram Swami, and Nitesh V Chawla. 2019. Heterogeneous graph neural network. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining. 793–803. [59] Jianan Zhao, Chaozhuo Li, Qianlong Wen, Yiqi Wang, Yuming Liu, Hao Sun, Xing Xie, and Yanfang Ye. 2021. Gophormer: Ego-Graph Transformer for Node Classification. arXiv preprint arXiv:2110.13094 (2021). [60] Lingxiao Zhao and Leman Akoglu. 2019. Pairnorm: Tackling oversmoothing in gnns. arXiv preprint arXiv:1909.12223 (2019). [61] Tianyu Zhao, Cheng Yang, Yibo Li, Quan Gan, Zhenyi Wang, Fengqi Liang, Huan Zhao, Yingxia Shao, Xiao Wang, and Chuan Shi. 2022. Space4HGNN: A Novel, Modularized and Reproducible Platform to Evaluate Heterogeneous Graph Neural Network. arXiv preprint arXiv:2202.09177 (2022). [62] Shichao Zhu, Chuan Zhou, Shirui Pan, Xingquan Zhu, and Bin Wang. 2019. Relation structure-aware heterogeneous graph neural network. In 2019 IEEE international conference on data mining (ICDM). IEEE, 1534–1539. HINormer: Representation Learning On Heterogeneous Information Networks with Graph Transformer WWW '23, May 1–5, 2023, Austin, TX, USA APPENDICES A Further Details of Datasets Datasets. We employ a total of four real HIN benchmark datasets, including two academic citation datasets and two movie-related datasets. The academic citation datasets include DBLPand AMiner, while the movie-related datasets include IMDB and Freebase. • DBLP is a bibliographic dataset in computer science, the dataset includes papers published between 1994 to 2014 of 20 conferences in 4 research fields. There are four types of nodes including authors(A), papers(P), terms(T) and venues (V). And we directly use the split dataset from HGB [28]. • AMiner is also an academic network, we uses a subgraph of the original dataset including papers of four classes. There are three types pf nodes including papers(P), authors(A) and references(R). • IMDB is a website about movies and related information, the only multi-label dataset includes movies from Action, Com- edy, Drama, Romance and Thriller classes. There are four types of nodes including movies(M), directors(D), actors(A) and keywords(K). And we directly use the split dataset from HGB. • Freebase[3] is a huge knowledge graph, and we use a sub- graph of 4 genres of entities including movies(M), actors(A), directors(D) and writers(W). B Further Details of Baselines To comprehensively evaluate the proposed HINormeragainst the state-of-the-art approaches, we consider a series of baselines from three main categories, Homogeneous GNNs, Meta-path based HGNNs and Meta-path free HGNNs. (1) Homogeneous GNNs • GCN: GCN [21] depends on the key operation of neighbor- hood aggregation to aggregate messages from the neighbor- ing nodes to form the node representations. In particular, it employs a mean-pooling to aggregate the neighborhood information. • GAT: GAT [45] replaces the average aggregation from neigh- bors with weighted aggregation from addition attention mechanism. And it also employs multi-head attention tech- nique to improve the performance. • Transformer: Transformer [44] employs the same context sampling strategy to conduct node-level representation learn- ing with standard Transformer architecture. (2) Meta-path based HGNNs • RGCN: RGCN [36] extends GCN to multiple edge types graphs, decomposing the heterogeneous graph convolution into two stages. For each node, the first step performs mean aggregation on specific edge type graph, and the second step aggregates the representations from all edge types. • HetGNN: HetGNN [58] firstly aggregates content features of nodes inside each neighborhood generated by type-specific random walks with a Bi-LSTM aggregator to get the type- specific embedding, then employs the attention mechanism on all type-specific to generate the final embedding vector for each node. • HAN: HAN [47] also employs a hierarchical attention mech- anism which includes the node-level attention for meta-path based neighbor aggregation and the semantic-level attention for meta-path related semantic aggregation. Both node-level and semantic-level attention are implemented by GAT. • GTN: GTN [57] replaces manual selection on meta-paths with automatic learning process of meta-paths, achieving the goal through sub-graph selection and matrix multiplication with learnable GCNs. • MAGNN: MAGNN [12] is based on HAN and further takes use of all nodes in a meta-path instance rather than only the nodes of the two endpoints. (3) Meta-path free HGNNs • RSHN: RSHN [62] firstly builds coarsened line graph to obtain embeddings of different edge types, and then uses a Message-Passing neural network to propagate both node and edge features. • HetSANN: HetSANN [17] employs type-specific GAT layers for the aggregation of local information to capture heteroge- neous information. • HGT: HGT [18] proposes a heterogeneous Transformer-like attention mechanism for neighborhood aggregation which is not global attention, using type-specific parameters to characterize the heterogeneous attention over each edge. It also proposes a type-aware sampling method to tackle large-scale HIN. • SimpleHGN: SimpleHGN [28] proposes a simple but strong baseline GAT-based model which considers both the edge type embedding and node embeddings to calculate the at- tention score. It constructs the Heterogeneous Graph Bench- mark (HGB) to standardize the process of HIN representation learning, making a solid contribution on the healthy devel- opment of HINs. C Hyperparameters Settings Baselines. As we adopts results of baseline published in HGB for DBLP and IMDB, we only report the hyperparameter settings of Freebase and AMiner. For meta-path based HGNNs, we use "M-A- M", "M-D-M" and "M-W-M" as meta-paths for Freebase, "P-A-P" and "P-R-P" as meta-paths for AMiner. For baseline GCN [21], we set d = 64 for both datasets. We set L = 3 for Freebase, and L = 4 for AMiner. For GAT [45], we set d = 64, nh = 8, L = 3, s = 0.05 for both datasets. For RGCN [36], we set d = 32, L = 5 for both datasets. For HetGNN [58], We set d = 128, and batch size as 200 for all datasets. For random walk, we set walk length as 30 and the window size as 5. For HAN [47], we set d = 8, da=128, nh = 8, L = 3 for both datasets. For MAGNN [12] we set d = 64, da=128, nh = 8, batch size as 8 and number of neighbor samples as 100 for both datasets. For RSHN [62], we set d = 32, L = 3 for both datasets. For HGT [18], we use layer normalization in each layer, and set d = 64, nh = 8, L = 3 for both datasets. For SimpleHGN [28], we set d = de = 64, nh = 8, β = 0.05, L = 3 for both datasets. We set s = 0.05 for AMiner and s = 0.1 for Freebase. WWW '23, May 1–5, 2023, Austin, TX, USA Qiheng Mao, Zemin Liu, Chenghao Liu, Jianling Sun Our model. We use Adam[20] as optimizer, LeakyReLU with nega- tive slope s = 0.2 as activation function and adopt the ReduceLROn- Plateau scheduler of Pytorch on validation loss, and early-stopping with patience of 50 is adopted to prevent overfitting. The learning rate is set to 1e-4, dropout rate is set to 0 for freebase and 0.5 for other datasets. The range of sequence length S is [10,200], the hid- den dimension d is set to 256 and the number of head nh is set to 2 for all datasets. The number of layers for local structure encoder Ks and heterogeneous relation encoder Kh is set to 5 for DBLP, 4 for IMDB and 3 for others. The search space of number of Transformer layers is {2,3,4,5} and {0.1, 0.2, 0.5, 1, 2} for heterogeneous weight β.
http://arxiv.org/abs/2302.11328v2
2023-04-06T07:25:14
2023-02-22T12:24:49
PAD: Towards Principled Adversarial Malware Detection Against Evasion Attacks
Machine Learning (ML) techniques can facilitate the automation of malicious software (malware for short) detection, but suffer from evasion attacks. Many studies counter such attacks in heuristic manners, lacking theoretical guarantees and defense effectiveness. In this paper, we propose a new adversarial training framework, termed Principled Adversarial Malware Detection (PAD), which offers convergence guarantees for robust optimization methods. PAD lays on a learnable convex measurement that quantifies distribution-wise discrete perturbations to protect malware detectors from adversaries, whereby for smooth detectors, adversarial training can be performed with theoretical treatments. To promote defense effectiveness, we propose a new mixture of attacks to instantiate PAD to enhance deep neural network-based measurements and malware detectors. Experimental results on two Android malware datasets demonstrate: (i) the proposed method significantly outperforms the state-of-the-art defenses; (ii) it can harden ML-based malware detection against 27 evasion attacks with detection accuracies greater than 83.45%, at the price of suffering an accuracy decrease smaller than 2.16% in the absence of attacks; (iii) it matches or outperforms many anti-malware scanners in VirusTotal against realistic adversarial malware.
[ "Deqiang Li", "Shicheng Cui", "Yun Li", "Jia Xu", "Fu Xiao", "Shouhuai Xu" ]
10.1109/TDSC.2023.3265665
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1109/TDSC.2023.3265665", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.11328v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11328v2", "@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", "stat.ML", "62", "I.2.1" ]
3 2 0 2 r p A 6 ] R C . s c [ 2 v 8 2 3 1 1 . 2 0 3 2 : v i X r a IEEE TRANSACTIONS ON DEPENDABLE AND SECURE COMPUTING, VOL. XX, NO. X, AUGUST 2023 1 PAD: Towards Principled Adversarial Malware Detection Against Evasion Attacks Deqiang Li, Shicheng Cui, Yun Li, Jia Xu, Fu Xiao and Shouhuai Xu Abstract-Machine Learning (ML) techniques can facilitate the automation of malicious software (malware for short) detection, but suffer from evasion attacks. Many studies counter such attacks in heuristic manners, lacking theoretical guarantees and defense effectiveness. In this paper, we propose a new adversarial training framework, termed Principled Adversarial Malware Detection (PAD), which offers convergence guarantees for robust optimization methods. PAD lays on a learnable convex measurement that quantifies distribution-wise discrete perturbations to protect malware detectors from adversaries, whereby for smooth detectors, adversarial training can be performed with theoretical treatments. To promote defense effectiveness, we propose a new mixture of attacks to instantiate PAD to enhance deep neural network-based measurements and malware detectors. Experimental results on two Android malware datasets demonstrate: (i) the proposed method significantly outperforms the state-of-the-art defenses; (ii) it can harden ML-based malware detection against 27 evasion attacks with detection accuracies greater than 83.45%, at the price of suffering an accuracy decrease smaller than 2.16% in the absence of attacks; (iii) it matches or outperforms many anti-malware scanners in VirusTotal against realistic adversarial malware. Index Terms-Malware Detection, Evasion Attack, Adversarial Example, Provable Defense, Deep Neural Network. (cid:70) 1 INTRODUCTION I NTERNET is widely used for connecting various modern devices, which facilitates the communications of our daily life but can spread cyber attacks at the same time. For example, Kaspersky [1] reported detecting 33,412,568 mal- ware samples in the year of 2020, 64,559,357 in 2021, and 109,183,489 in 2022. The scale of this threat motivates the use of Machine Learning (ML) techniques, including Deep Learning (DL), to automate malware detection. Promisingly, empirical evidence demonstrates the advanced performance of ML-based detection (see, e.g., [2], [3], [4], [5], [6]). Unfortunately, ML-based malware detectors are vulnera- ble to adversarial examples. These examples are a type of mal- ware variants and are often generated by modifying non- functional instructions in the existing executable programs (rather than writing them from scratch) [7], [8], [9], [10], [11], [12]. Adversarial examples can be equipped with poisoning attacks [13], [14], evasion attacks [12], [15], [16], or both [17]. In this paper, we focus on evasion attacks, which aim to mis- lead a malware detection model in the test phase. To combat evasive attacks, pioneers proposed several approaches, such as input transformation [18], weight regularization [19], and classifier randomization [20], most of which, however, have been broken by sophisticated attacks (e.g., [10], [21], [22], [23]). Nevertheless, recent studies empirically demonstrate • D. Li is with the School of Computer Science, Nanjing University of Posts • and Telecommunications, Nanjing, 210023, China S. Cui is with the School of Computer Engineering, Nanjing Institute of Technology, Nanjing, 211167, China • • Y. Li, J. Xu, and F. Xiao are with the School of Computer Science, Nanjing University of Posts and Telecommunications, Nanjing, 210023, China S. Xu is with Department of Computer Science, University of Colorado Colorado Springs, 1420 Austin Bluffs Pkwy, Colorado Springs, Colorado, 80918 USA. Email: [email protected] More information can be found at http://ieeexplore.ieee.org that adversarial training can harden ML models to certain extent [24], [25], which endows a model with robustness by learning from adversarial examples, akin to "vaccines". Figure 1 illustrates the schema of adversarial training. Owing to the efficiency of mapping representation per- turbations back to the problem space, researchers conduct adversarial training in the feature space [10], [15], [24], [25], [26]. However, "side-effect" features [10] cause inaccu- racy when conducting the inverse representation-mapping, leading to the robustness gap that the attained robustness cannot propagate to the problem space. In the feature space, adversarial training typically involves inner maximization (searching perturbations) and outer minimization (optimiz- ing model parameters). Both are handled with heuristic methods, lacking theoretical guarantees [24], [25]. This leads to the limitation of disallowing a rigorous analysis on the types of attacks that can be thwarted by the resultant model, especially in the context of discrete domains (e.g., malware detection). The fundamental concern is the optimization convergence: the inner maximization shall converge to a stationary point, and the resultant perturbation approaches the optimal one; the outer minimization has gradients of loss w.r.t. parameters proceeding toward zero regarding cer- tain metrics (e.g., (cid:96)2 norm) in gradient-based optimization. Intuitively, as long as convergence requirements are met, the defense model can mitigate other attacks less effectively than the one that is used for adversarial training. Existing methods cope with the limitations mentioned above with new assumptions [27], [28], [29]. For instance, Qi et al. propose searching text perturbations with theoretical guarantees on attackability by assuming the non-negativity of models [28], which produce attacks counting on sub- modular optimization [30]. Indeed, the non-negativity of models leads to binary monotonic classification (without involving the outer minimization mentioned above), which 1545-5971 © 2023 IEEE. Personal use of this material is permitted, but republication/redistribution requires IEEE permission. 2 IEEE TRANSACTIONS ON DEPENDABLE AND SECURE COMPUTING, VOL. XX, NO. X, AUGUST 2023 optimization convergence mentioned in (ii). Our contribu- tions are summarized as follows: • Adversarial training with formal treatment. We propose a new adversarial training framework, dubbed Principled Adversarial Malware Detection (PAD). PAD extends the malware detector with a customized adversary detector, where the customization is the convex distribution-wise measurement. For smooth models, PAD benefits conver- gence guarantees for adversarial training, resulting in provable robustness. • Robustness improvement. We establish a PAD model by combining a Deep Neural Network (DNN) based mal- ware detector and an input convex neural network based adversary detector. Furthermore, we enhance the model by leveraging adversarial training to incorporate a new mixture of attacks, termed Stepwise Mixture of Attacks, leading to the defense model dubbed PAD-SMA. Theoret- ical analysis shows the robustness of PAD-SMA, including attackability of inner maximization and convergence of outer minimization. • Experimental validation. We compare PAD-SMA with seven defenses proposed in the literature via the widely- used Drebin [35] and Malscan [36] malware datasets while considering a spectrum of attack methods, ranging from no attacks, 13 oblivious attacks, to 18 adaptive attacks. Experimental results show that PAD-SMA significantly outperforms the other defenses, by slightly sacrificing the detection accuracy when there are no adversarial attacks. Specifically, PAD-SMA thwarts a broad range of attacks effectively, exhibiting an accuracy ≥ 81.18% under 30 attacks on Drebin and an accuracy ≥ 83.45% under 27 attacks on Malscan, except for the Mimicry attack guided by multiple (e.g., 30 on Drebin or 10 on Malscan) benign software samples [9], [26]; it outperforms some anti-malware scanners (e.g., Symantec, Comodo), matches with some others (e.g., Microsoft), but falls behind Avira and ESET-NOD32 in terms of defense against adversarial malware examples (while noting that the attacker knows our features but not that of the scanners.) To the best of our knowledge, this is the first principled adversarial training framework for malware detection. We have made our code publicly available at https://github. com/deqangss/pad4amd. Paper outline. Section 2 reviews some background knowl- edge. Section 3 describes the framework of principled ad- versarial malware detection. Section 4 presents a defense method instantiated from the framework. Section 5 analyzes the proposed method. Section 6 presents our experiments and results. Section 7 discusses related prior studies. Section 8 concludes the paper. 2 BACKGROUND KNOWLEDGE Notations. The main notations are summarized as follows: • Input space: Let Z be the software space (i.e., problem space), and z ∈ Z be an example. • Feature extraction: Let φ : Z → X be a hand-crafted feature extraction function, where X ⊂ Rd is a discrete space and d is the number of dimensions. Fig. 1: Schema of feature space adversarial training and its three limitations related that: (i) the attained robustness back-propagates to the problem space (upper left); (ii) the inner maximization searches perturbations optimally (mid- dle); (iii) the outer minimization optimizes model parame- ters convergently (right). circumvents any attack that utilizes either feature addition or feature removal based perturbations, but not both [27], [31]. This type of classifiers tend to sacrifice detection accu- racy notably [10]. In order to relax this overly restrictive as- sumption, a recent study [29] resorts to the theory of weakly submodular optimization, which necessitates a concave and smooth model. However, modern ML architectures (e.g., deep neural networks) may not have a built-in concavity. Moreover, these models are not geared toward malware detection or adversarial training. From the domain of image processing, pioneers propose utilizing smooth ML models [32], [33], [34], because specific distance metrics (e.g., (cid:96)2 norm) can be incorporated to shape the loss landscape, leading to local concavity w.r.t. the input and thus easing the inner maximization. Furthermore, smoothness benefits the convergence of the outer minimization [32]. Because the proposed metrics are geared toward continuous input, they may not be suitable for software samples that are inher- ently discrete. Worst yet, semantics-preserving adversarial malware examples are not necessarily generated by small perturbations [10], [24]. Our Contributions. In this paper, we investigate adversarial training methods for malware detection by tackling three limitations of existing methods as follows. (i) We tackle the robustness gap by relaxing the constraint of "side-effect" features in training, and demonstrating that the resultant feature-space model can defend against practical attacks. (ii) We address the issue of adversarial training without con- vergence guarantee by learning convex measurements from data for quantifying distribution-wise perturbations, which regard examples falling outside of the underlying distribu- tion as adversaries. In this way, the inner maximizer has to bypass the malware detector and the newly introduced adversary detector, leading to a constrained optimization problem whose Lagrangian relaxation for smooth malware detectors can be concave. Consequently, the smoothness benefits the convergence of gradient-based outer minimiza- tion [32]. (iii) We address the incapability of rigorously resisting a range of attacks by mixing multiple types of gradient-based attack methods to approximate the optimal attack, which is used to implement adversarial training while enjoying the ∇θI y∈Y ∇θI ?OptimalForwardBack-propagateNon-appliedManipulate Inner max Outer minx+δx δx=δx∗ ?Convergentz′∈Z x′∈X J x′,1 Adv. appsConstraintestimatingParameter optimizing ∇θIt 22t=∞ 0 Feature extractionFeature set App setz∈Z MLmodelLossx∈X J x,y Labelsφ φ−1 ∇xI Side-effect?Problem spaceFeature space∇θI PAD: PRINCIPLED ADVERSARIAL MALWARE DETECTION AGAINST EVASION ATTACKS, D. LI, S. CUI, Y. LI, J. XU, F. XIAO AND S. XU. 3 • Malware detector: Let f : Z → Y map z ∈ Z to label space Y = {0, 1}, where "0" ("1") means software example z is benign (malicious). • Adversary detector: Let g : Z → R map z ∈ Z to a real- valued confidence score such that g(z) > τ means z is adversarial and non-adversarial otherwise, where τ is a pre-determined threshold. • Learning model: We extend malware detector f with a secondary detector g for identifying adversarial examples. Suppose f uses an ML model φθ : X → Y with f (*) = φθ(φ(*)) and g uses an ML model ψθ with g(*) = ψθ(φ(*)), where θ, θ are learnable parameter sets. • Loss function for model: F(θ, x, y) and G(θ, x) are the loss functions for learning models φθ and ψθ, respectively. • Criterion for attack: Let J (x) justify an adversarial ex- ample, which is based on F or a combination of F and ψθ depending on the context. • Training dataset: Let Dz denote the training dataset that contains example-label pairs. Furthermore, we have Dx = {(x, y) : x = φ(z), (z, y) ∈ Dz} in the feature space, which is sampled from a unknown distribution P. • Adversarial example: Adversarial malware example z(cid:48) = z + δz misleads f and g simultaneously (if g is present), where δz is a set of manipulations (e.g., string injection). Correspondingly, let x(cid:48) = φ(z(cid:48)) denote the adversarial example in the feature space with δx = x(cid:48) − x. 2.1 ML-based Malware & Adversary Detection We treat malware detection as binary classification. In ad- dition, an auxiliary ML model is used to detect adversarial examples [21], [23], [37]. Fig. 2: Integrated malware and adversary detectors. Fig.2 illustrates the workflow of integrated malware and adversary detectors. Formally, given an example-label pair (z, y), an malware detector f = φθ ◦ φ, and an adversary detector g = ψθ ◦ φ, the prediction is predict(z) =    f (z), 1, not sure, if g(z) ≤ τ if (g(z) > τ ) ∧ (f (z) = 1) if (g(z) > τ ) ∧ (f (z) = 0). (1) Intuitively, g "protects" f against z when g(z) > τ and f (z) = 1; "not sure" abstains f from classification, calling for further analysis. Hence, a small portion of normal (i.e., unperturbed) examples will be flagged by g. Detectors φθ and ψθ are learned from training dataset Dx by minimizing: min θ,θ E(z,y)∈Dx [F(θ, x, y) + G(θ, x)] , (2) where F is the loss for learning φθ (e.g., cross-entropy [38]) and G is for learning ψθ (which is specified according to the downstream un-supervised task). 2.2 Evasion Attacks The evasion attack can be manifested in both the problem space and the feature space [9], [10]. In the problem space, an attacker perturbs a malware example z to z(cid:48) to evade both f and g (if g is present). Consequently, we have x = φ(z) and x(cid:48) = φ(z(cid:48)) in the feature space. Owing to the non-differentiable nature of φ, previous studies suggest x(cid:48) obeys a "box" constraint u (cid:22) x(cid:48) (cid:22) u (i.e., x(cid:48) ∈ [u, u]) cor- responding to file manipulations, where "(cid:22)" is the element- wise "no bigger than" relation between vectors [9], [17], [24]. The evasion attack in the feature space can be described as: x(cid:48) = x+δx, (3) s.t. (φθ(x(cid:48)) = 0) ∧ (ψθ(x(cid:48)) ≤ τ ) ∧ (x(cid:48) ∈ X ) ∧ (x(cid:48) ∈ [u, u]). Since ψθ may not be present, in what follows we review former attack methods as they are, introduce the existing strategies to target both φθ and ψθ, and bring in the current inverse-mapping solutions (i.e., mapping feature perturba- tions to the problem space; see φ−1 in Figure 1). 2.2.1 Evasion Attack Methods Mimicry attack. A mimicry attacker [19], [26], [39] perturbs a malware example to mimic a benign application as much as possible. The attacker does not need to know the internal knowledge of models, but can query them. In such case, the attacker uses Nben (Nben ≥ 1) benign examples separately to guide manipulation, resulting in Nben perturbed exam- ples, of which the one bypassing the victim is used. Grosse attack. This attack [40] perturbs "sensitive" features to evade detection, where sensitivity is quantified by the gradients of the DNN's softmax output with respect to the input. A larger gradient value means higher sensitivity. This attack adds features to an original example. FGSM attack. This attack is introduced in the context of image classification [41] and later adapted to malware detec- tion [18], [24]. It perturbs a feature vector x in the direction of the (cid:96)∞ norm of gradients (i.e., sign operation) of the loss function with respect to the input: x(cid:48) = round (cid:16) Proj[u,u] (x + ε * sign(∇x F(θ, x, 1))) (cid:17) , where ε > 0 is the step size, Proj[u,u] projects an input into [u, u], and round is an element-wise operation which returns an integer-valued vector. Bit Gradient Ascent (BGA) and Bit Coordinate Ascent (BCA) attacks. Both attacks [24] iterate multiple times. In each iteration, BGA increases the feature value from '0' to '1' (i.e., adding a feature) if the corresponding partial derivative of the loss function with respect to the input is greater than d, where d or equal to the gradient's (cid:96)2 norm divided by is the input dimension. By contrast, at each iteration, BCA flips the value of the feature from '0' to '1' corresponding to the max gradient of the loss function with respect to the input. Technically speaking, given a malware instance-label pair (x, y), the attacker needs to solve √ max x(cid:48)∈[u,u] F(θ, x(cid:48), 1) s.t., x(cid:48) ∈ X . '0'z φ YesNoLabel Feature extractionAdversary detectorx x φθ ψθ Malware detectorNot Sure& & '0''1' 4 IEEE TRANSACTIONS ON DEPENDABLE AND SECURE COMPUTING, VOL. XX, NO. X, AUGUST 2023 Projected Gradient Descent (PGD) attack. It is proposed in the image classification context [42] and adapted to malware detection by accommodating the discrete input space [25]. The attack permits both feature addition and removal while retaining malicious functionalities, giving more freedom to the attacker. It finds perturbations via an iterative process with the initial perturbation as a zero vector: δ(t+1) x = Proj[u−x,u−x] (cid:16) x + α∇δx F(θ, x + δ(t) δ(t) x , 1) (cid:17) (4) where t is the iteration, α > 0 is the step size, Proj[u−x,u−x] projects perturbations into the predetermined space [u − x, u − x], and ∇δx denotes the derivative of loss function F with respect to δ(t) x . Since the derivative may be too small to make the attack progress, researchers normalize ∇δx F in the direction of (cid:96)1, (cid:96)2, or (cid:96)∞ norm [42], [43]: ep = arg max (cid:107)e(cid:107)p=1 (cid:104)∇δx F(θ, x + δ(t) x , 1), e(cid:105), where ep is the direction of interest, (cid:104)*, *(cid:105) denotes the inner product, and p = 1, 2, ∞. Adjusting p leads to PGD-(cid:96)1, PGD-(cid:96)2, and PGD-(cid:96)∞ attacks, respectively. After the loop, an extra operation is conducted to discretize the real-valued vector. For example, round(a) returns the vector closest to a in terms of (cid:96)1 norm distance. Mixture of Attacks (MA). This attack [9] organizes a mix- ture of attack methods upon a set of manipulations as large as possible. Two MA strategies are used: the "max" strategy selects the adversarial example generated by several attacks via maximizing a criterion (e.g., classifier's loss function F ); the iterating "max" strategy puts the resulting example from the last iteration as the new starting point, where the initial point is x. The iteration can promote attack effectiveness because of the non-concave ML model. 2.2.2 Oblivious vs. Adaptive Attacks The attacks mentioned above do not consider the adversary detector g, meaning that they degrade to oblivious attacks when g is present and would be less effective. By contrast, an adaptive attacker is conscious of the presence of g(*) = ψθ(φθ(*)), leading to an additional constraint ψθ(x(cid:48)) ≤ τ for a given feature representation vector x: max x(cid:48)∈[u,u] F(θ, x(cid:48), 1) s.t., (ψθ(x(cid:48)) ≤ τ ) ∧ (x(cid:48) ∈ X ), (5) where we substitute φ(x(cid:48)) = 0 with maximizing F(θ, x(cid:48), 1) owing to the aforementioned issue of non-differentiability. However, ψθ may not be affine (e.g., linear transforma- tion), meaning that the effective projection strategies used in PGD are not applicable anymore. In order to deal with ψθ(x(cid:48)) ≤ τ , researchers suggest three approaches: (i) Use gradient-based methods to cope with max x(cid:48)∈[u,u] [F(θ, x(cid:48), 1) − λψθ(x(cid:48))], (6) where λ ≥ 0 is a penalty factor for modulating the impor- tance between the two items [23]. (ii) Maximize F(θ, x(cid:48), 1) and −ψθ(x(cid:48)) alternatively as it is notoriously difficult to set λ properly [21]. (iii) Maximize F(θ, x(cid:48), 1) and −ψθ(x(cid:48)) in an orthogonal manner [23], where "orthogonal" means elimi- nating the mutual interaction between F and ψ from the geometrical perspective. For example, the attack perturbs x in the direction orthogonal to the direction of the gradients of −ψθ, which is in the direction of the gradients of F , to make it evade φθ but not react ψθ. Likewise, the attack alters the orthogonal direction to evade ψθ but not react φθ. 2.2.3 The Inverse Feature-Mapping Problem There is a gap between the feature space and the problem (i.e., software) space. Since feature extraction φ is non- differentiable, gradient-based methods cannot produce end- to-end adversarial examples. Moreover, φ−1 cannot be de- rived analytically due to "side-effect" features, which cause a non-bijective φ [10]. To fill the gap, Srndic and Laskov [26] propose directly mapping the perturbation vector δx to the problem space, leading to φ( ̃φ−1(x(cid:48))) (cid:54)= x(cid:48), where ̃φ−1 is an approxima- tion of φ−1. Nevertheless, experiments demonstrate that the attacks can evade anti-malware scanners. Li and Li [9] leverage this strategy to produce adversarial Android examples. Researchers also attempt to align δz with δx as much as possible. For example, Pierazzi et al. [10] collect a set of manipulations from gadgets of benign applications and implement ones that mostly align with the gradients of the loss function with respect to the input. Zhao et al. [11] propose incorporating gradient-based methods with Reinforcement Learning (RL), of which an RL-based model assists in obtaining manipulations in the problem space under the guidance of gradient information. In addition, black-box attack methods (without knowing the internals of the detector) directly manipulate malware examples, which avoids the inverse feature-mapping procedure [15]. In this paper, we use an approximate ̃φ−1 (implemen- tation details are deferred to the supplementary material). This strategy relatively eases the attack implementation and besides, our preliminary experiments show the "side-effect" features cannot decline the attack effectiveness notably in the refined Drebin feature space [35]. 2.3 Adversarial Training Adversarial training augments training dataset with adver- sarial examples by solving a min-max optimization problem [24], [40], [42], [44], [45], [46], as shown in Figure 1. The inner maximization looks for adversarial examples, while the outer minimization optimizes the model parameters upon the updated training dataset. Formally, given the training dataset Dx, we have min θ E(x,y)∈Dx (cid:20) F(θ, x, y) + β max x(cid:48)∈[u,u] F(θ, x(cid:48), 1) (cid:21) , (7) s.t., (x(cid:48) = x + δx) ∧ (x(cid:48) ∈ X ) where β ≥ 0 is used to balance between detection accuracy and robustness, while noting that only malware representa- tions play a role in the inner maximization. However, Owing to the NP-hard nature of searching discrete perturbations [32], the adversarial training meth- ods incorporate the (approximate) optimal attack without convergence guaranteed [24], [25], making their robustness questionable. For example, Al-Dujaili et al. [24] approximate the inner maximization via four types of attack algorithms, while showing that a hardened model cannot mitigate the attacks that are absent in the training phase. Furthermore, a PAD: PRINCIPLED ADVERSARIAL MALWARE DETECTION AGAINST EVASION ATTACKS, D. LI, S. CUI, Y. LI, J. XU, F. XIAO AND S. XU. 5 mixture of attacks is used to instantiate the framework of ad- versarial training [9]. Though the enhanced model can resist a range of attacks, it is still vulnerable to a mixture of attacks with iterative "max" strategy (more iterations are used, see Section 2.2.1). Thereby, it remains a question of rigorously uncovering the robustness of adversarial training. 3 THE PAD FRAMEWORK PAD aims to reshape adversarial training by rendering the inner maximization solvable analytically, with the establish- ment of a concave loss w.r.t. the input. The core idea is a learnable convex distance metric, with which distribution- wise perturbations can be measured, leading to a constraint attack problem, whose Lagrange relaxation is concave (ow- ing to the maximization) at reasonable circumstances. 3.1 Threat Model and Design Objective Threat model. Given a malware example z, malware detec- tor f , and adversary detector g (if g exists), an attacker mod- ifies z by searching for a set of non-functional instructions δz upon knowledge of detectors. Guided by Kerckhoff's principle that defense should not count on "security by obscurity" [10], we consider white-box attacks, meaning that the attacker has full knowledge of f and g. For assessing robustness of defense models, we use grey-box attacks where the attacker knows f but not g (i.e., oblivious attack [47]), or knows features used by f and g. Design Objective. As aforementioned, PAD is rooted in adversarial training. We propose incorporating f with an adversary detector g(*) = ψθ(φ(*)), where ψθ is the convex measurement. To this end, given a malware instance-label pair (x, y) where x = φ(z) and y = 1, we mislead both φθ and ψθ by perturbing x to x(cid:48), upon which we optimize model parameters. Formally, PAD uses objective min θ,θ E(x,y)∈Dx (cid:104) F(θ, x, y) + G(θ, x) + β1 F(θ, x(cid:48), 1) + β2 G(θ, x(cid:48)) (cid:105) , where x(cid:48) := max x(cid:48)∈[u,u] [F(θ, x(cid:48), 1) − λψθ(x(cid:48))] , s.t. (x + δx = x(cid:48)) ∧ (x(cid:48) ∈ X ), (8a) (8b) β1 and β2 weight the robustness against x(cid:48), and λ ≥ 0 is a penalty factor. This formulation has three merits: (i) Manipulations in the feature space: Eq.(8b) says that we can search feature perturbations without do- ing inverse-feature mapping, implying shorter training time. The remaining issue is whether the attained ro- bustness can propagate to the problem space or not; we will answer this affirmatively later (Section 3.2). (ii) Box-constraint manipulation: Eq.(8b) says the attacker can search x(cid:48) ∈ [u, u] without considering any norm- type constraints, meaning that the defender should resist semantics-based attacks rather than small pertur- bations. (iii) Continuous perturbation may be enough: It is NP- hard to search optimal discrete perturbations even for attacking linear models [32]. Eq.(8b) contains an auxil- iary detector ψθ, which can treat continuous perturba- tions in the range of [u, u] as anomalies while relaxing the discrete space X constraint in the training phase. The preceding formulation suggests that we can use the ef- ficient gradient-based optimization methods to solve Eq.8a and Eq.8b. In what follows we explain this intuitively and why a smooth F is necessary (e.g., for setting a proper λ, which is challenging as discussed in Section 2.2.2). 3.2 Design Rationale Bridge robustness gap. Recall that adversarial training is performed in the feature space while adversarial malware is in the problem space. Moreover, the perturbed instance x(cid:48) used for training may not be mapped back to any z(cid:48) ∈ Z, because "side-effect" features incur interdependent perturbations (i.e., modifying one feature would require to changing some of the others so as to preserve the functional- ity or semantics) [10], [44]. This leaves a "seam" for attackers when a non-bijective feature extraction φ is used. Indeed, the interdependence of features is reminiscent of the structural graph representation. This prompts us to propose using a directed graph to denote the relation: modifiable features are represented by graph nodes and their interdependencies are represented by graph edges. As a result, an asymmet- rical adjacent matrix (i.e., directed graph) can be used to represent the edge information, which however shrinks the manipulations in the space of [u, u]. Suppose for a given malware representation x, we can obtain the optimal adversarial example in the feature space w.r.t. criterion J . With or without considering the adjacent matrix constraint, we get the optimum ̃x∗, x∗ ∈ [u, u] with the criterion results satisfying J ( ̃x∗) = F(θ, ̃x∗, 1) − λψθ( ̃x∗) ≤ J (x∗). This in turn demonstrates that if an ad- versarial training model can resist x∗, so can ̃x∗ (otherwise, it contradicts the meaning of optimization). Therefore, we relax the attack constraint related to "side- effect" features and conduct adversarial training in the feature space so that the robustness can propagate to the problem space, at the potential price of sacrificing the detec- tion accuracy because more perturbations are considered. Defense against distribution-wise perturbation. We ex- plain Eq.(8b) via distributionally robust optimization [32]. We establish a point-wise metric C(*, x) = max{0, ψθ(*)−τ } to measure how far a point, say x(cid:48), to a population, while noting that other measures are also suitable as long as they are convex and continuous. A large portion (e.g., 95%) of training examples will have ψθ(x) ≤ τ . Based on C, we have a Wasserstein distance [48]: (cid:26)(cid:90) W (P(cid:48), P) := inf Γ C(x(cid:48), x)dΓ(x(cid:48), x) : Γ ∈ (cid:27) (cid:89) (P(cid:48), P) where (cid:81)(P(cid:48), P) is the joint distribution of P(cid:48) and P with marginal as P(cid:48) and P w.r.t. to the first and second argument, respectively. That is, the Wasserstein distance gets the in- fimum from a set of expectations. Because points x, x(cid:48) are in discrete space X , the integral form in the definition is a linear summation. We aim to build a malware detector f 6 IEEE TRANSACTIONS ON DEPENDABLE AND SECURE COMPUTING, VOL. XX, NO. X, AUGUST 2023 smoothness factor of f [49], [50] and thus force the attacker to increase λ when generating adversarial examples. Since the interval x+δx ∈ [u, u] relaxes the constraint on a discrete input, we can address this issue by treating contin- uous perturbations as anomalies, as stated earlier. Therefore, instead of heuristically searching for discrete perturbations, we directly use ψθ to detect continuous perturbations with- out using the discretization trick. 4 INSTANTIATING THE PAD FRAMEWORK We instantiate PAD into a model and associated adversarial training algorithm. Though PAD may be applicable to any differentiable ML algorithms, we consider Deep Neural Network (DNN) based malware detection because it has been intensively investigated [9], [51], [52], [53]. 4.1 Adjusting Malware Detector PAD requires the composition of F and φθ to be smooth. DNN consists of hierarchical layers, each of which typically has a linear mapping followed by a non-linear activation function. Most of these ingredients meet the smoothness condition, except for some activation functions (e.g., Recti- fied Linear Unit or ReLU [38]) owing to non-differentiability at point zero. To handle non-smooth activation functions, researchers suggest using over-parameterized DNNs, which yield semi-smooth loss landscapes [54]. Instead of increas- ing learnable parameters, we replace ReLU with smooth activation functions (e.g., Exponential Linear Unit or ELU [55]). The strategy is simple in the sense that the model architecture is changed slightly and fine-tuning suffices to recover the detection accuracy. Despite this, our preliminary experiments show it slightly reduces the detection accuracy. 4.2 Adversary Detector We propose a DNN-based g that is also learned from the features extracted by φ. Figure 4 shows the architecture of ψθ, which is an l-layer Input Convex Neural Network (ICNN) [56]. ICNN maps an input x recursively via non- negative transformations, along with adding a normal trans- formation on x: xi+1 = σ(θixi + θi xx + bi), where θ = {θi, θi x, bi : i = 1, . . . , l}, θi is non-negative, θi x has no such constraint, x1 = x, θ1 is identity matrix, and σ is a smooth activation function (e.g., ELU or Sigmoid [55]). We cast the adversary detection as a one-class classifica- tion task [57]. In the training phase, we perturb examples in Dx to obtain a set of new examples {x + δx : (x, y) ∈ Dx}, where δx is a vector of salt-and-pepper noises, meaning that at least half of elements in x are randomly selected and their values are set as their respective maximum. Formally, given an example x1 ∈ {x : (x, y) ∈ Dx} ∪ {x + δx : (x, y) ∈ Dx}, the loss function G is G(θ, x1) = pert log(ψθ(x1)) + (1 − pert) log(1 − ψθ(x1)), where pert = 0 indicates x1 is from Dx, and pert = 1 otherwise. In the test phase, we let the input pass through ψθ to perform the prediction as shown in Eq.(1). Fig. 3: An example showing how the loss changes under per- turbations when F is smooth (feasible region in the bottom- left figure), making F −λψθ strongly convex (feasible region in the rightmost figure) at x0 when λ = 3.0. that can classify x(cid:48) correctly with x(cid:48) ∼ P(cid:48) and W (P(cid:48), P) ≤ 0. Formally, the corresponding inner maximization is max P(cid:48):W (P(cid:48),P)≤0 Ex(cid:48)∼P(cid:48) F(θ, x(cid:48), 1). (9) It is non-trivial to tackle W (P(cid:48), P) directly owing to massive vectors on X × X . Instead, the dual problem is used: Proposition 1. Given a continuous function F , and continuous and convex distance C(*, x) = max{0, ψθ(*) − τ } with x ∼ P, the dual problem of Eq.(9) is (cid:110) inf λ Ex∼P max x(cid:48) (F(θ, x(cid:48), 1) − λψθ(x(cid:48)) + λτ ) : λ ≥ 0 (cid:111) , where x + δx = x(cid:48) ∈ X , x(cid:48) ∼ P(cid:48) and ψθ(x(cid:48)) ≥ τ . Its empirical version is Eq.(8b) for fixed λ and τ , except for the constraint [u, u] handled by clip operation. The proposition says PAD can defend against distributional per- turbations. Proof is deferred to the supplementary material. Concave inner maximization. Given an instance-label pair (x, y), let Taylor expansion approximate F(θ, x + δx, y) − λψθ(x + δx): F(θ, x+δx, y) − λψθ(x + δx) ∼= F −λψθ +(cid:104)∇x(F −λψθ), δx(cid:105) + 1 2 x ∇2 δ(cid:62) x(F −λψθ)δx. where F −λψθ denotes F(θ, x, y) − λψθ(x) for short. The insight is that if (i) the values of the entities in ∇x F are finite (i.e., smoothness [32]) when x ∈ [u, u], and (ii) ∇xψθ > 0 (i.e., strongly convex), then we can make F −λψθ concave by tweaking λ; this eases the inner maximization. Figure 3 illustrates the idea behind the design, by using a smoothed DNN model to fit the noising sin function (top- left figure). Owing to the smoothness of φθ and F (bottom- left figure), we transform the loss function to a concave function by incorporating a convex ψθ. The concavity is achieved gradually by raising λ, along with the feasible region changed, as shown in the right-hand figure. In the course of adjusting λ, there are three possible scenarios [23]: (i) λ is large enough, leading to a concave inner maximiza- tion. (ii) A proper λ may result in a linear model, which would be rare because of the difference between φθ and ψθ. (iii) λ is so small that the inner maximization is still a non-concave and nonlinear problem, which is true as for- mer heuristic adversarial training. In summary, we propose enhancing the robustness of f and g, which can reduce the 0.20.91.6Loss(,x,sin(x)+noise)x00.20.40.60.8Lossx0Feasible region0.20.40.60.8Loss(x),(e.g.,=12||xx0||2)x0=0.0=1.0=3.0 PAD: PRINCIPLED ADVERSARIAL MALWARE DETECTION AGAINST EVASION ATTACKS, D. LI, S. CUI, Y. LI, J. XU, F. XIAO AND S. XU. 7 Algorithm 1: Adversarial training Input: Training set Dz, epoch N , batch size B, factors β1, β2 and λ, iteration T , and step size αp for norm p ∈ {1, 2, ∞}. 1 Get Dx = {(φ(z), y) : (z, y) ∈ Dz} for the given Dz; 2 for j = 1 to N do 3 Sample a mini-batch {xi, yi}B Apply salt-and-pepper noises to {xi}B for t = 0 to T − 1 do i=1 from Dx; i=1; for p ∈ {1, 2, ∞} do Calculate perturbation δ(t+1) by Eq.(10) x,p and Eq.(11) for x ∈ {xi}B i=1 with yi = 1; end Select δ(t+1) x by Eq.(12); end Calculate the adversarial training loss via Eq.(8a); Backpropagate the errors for updating θ and θ; 4 5 6 7 8 9 10 11 12 13 end Algorithm 1 summarizes a PAD-based adversarial train- ing by incorporating the stepwise mixture of attacks. Given a training set, we preprocess software examples and obtain their feature representations (line 1). At each epoch, we first perturb the feature representations via salt-and-pepper noises (line 4) and then generate adversarial examples with the mixture of attacks (lines 5-10). Using the union of the original examples and their perturbed variants, we learn malware detector f and adversary detector g (lines 11-13). 5 THEORETICAL ANALYSIS We analyze effectiveness of the inner maximization and optimization convergence of the outer minimization, which together support robustness of the proposed method. As mentioned above, we make an assumption that PAD re- quires smooth learning algorithms (Section 4.1). Assumption 1 (Smoothness assumption [32]). The composi- tion of F and φθ meets the smoothness condition: (cid:107)∇x F(θ, x, y) − ∇x F(θ, x(cid:48), y)(cid:107)2 ≤ Lf (cid:107)∇x F(θ, x, y) − ∇x F(θ(cid:48), x, y)(cid:107)2 ≤ Lf (cid:107)∇θ F(θ, x, y) − ∇θ F(θ, x(cid:48), y)(cid:107)2 ≤ Lf xx(cid:107)x − x(cid:48)(cid:107)2, xθ(cid:107)θ − θ(cid:48)(cid:107)2, θx(cid:107)x − x(cid:48)(cid:107)2, and ψθ meets the smoothness condition: (cid:107)∇xψθ(x) − ∇xψθ(x(cid:48))(cid:107)2 ≤ Lg (cid:107)∇xψθ(x) − ∇xψθ(cid:48)(x)(cid:107)2 ≤ Lg xx(cid:107)x − x(cid:48)(cid:107)2, xθ(cid:107)θ − θ(cid:48)(cid:107)2, where x(cid:48) ∈ [u, u] is changed from x = φ(z) for a given example z and L∗ ∗∗ > 0 denotes the smoothness factor (∗ is the wildcard). Recall that the ψθ meets the strongly-convex condition: (cid:107)∇xψθ(x) − ∇xψθ(x(cid:48))(cid:107)2 ≥ Mg xx(cid:107)x − x(cid:48)(cid:107)2, where Mg xx > 0 is the convexity factor. Fig. 4: Architecture of an input convex neural network. 4.3 Adversarial Training Algorithm For the inner maximization (Eq.8b), we propose a mixture of PGD-(cid:96)1, PGD-(cid:96)2 and PGD-(cid:96)∞ attacks (see Section 2.2.1). The attacks proceed iteratively via "normalized" gradients ep = arg max (cid:107)e(cid:107)p=1 (cid:104)∇δx(F(θ, x + δ(t) x , 1) − λψθ(x + δ(t) x )), e(cid:105), and perturbation vectors (cid:110) δ(t+1) x,p = Proj[u−x,u−x] (cid:16) δ(t) x,p + αpep (cid:17) : p ∈ {1, 2, ∞} (10) (cid:111) , (11) where a perturbation vector is chosen by the scoring rule δ(t+1) x (cid:104) = arg max δ(t+1) x,p F(θ, round(x + δ(t+1) x,p ), 1) − λψθ(round(x + δ(t+1) x,p )) (cid:105) (12) at the tth iteration. The round operation is used because our initial experiments show that it leads to better robustness. Since the goal is to select the best attack in a stepwise fashion, it is termed Stepwise Mixture of Attacks (SMA). Note that from an attacker's perspective, there are three more steps: (i) We treat the dependencies between features as graphical edges. Since the summation of gradients can measure the importance of a group in the graph [58], we accumulate the gradients of the loss function with respect to the "side-effect" features and use the resulting gradient to decide whether to modify these features together. (ii) The round operation is used to discretize perturbations when the loop is terminated [25]. (iii) Map the perturbations back into the problem space. For the outer minimization (Eq.8a), we leverage a Stochas- tic Gradient Descent (SGD) optimizer, which proceeds itera- tively to find the model parameters. Basically, SGD samples a batch of B (a positive integer) pairs {(xi, yi)}B i=1 from Dx and updates the parameters with θ(j+1) = θ(j) − γ∇θ θ(j+1) = B (cid:88) F(θ(j), xi + δ(T ) xi , yi) and 1 B i=1 θ(j) − γ∇θ 1 B B (cid:88) i=1 G(θ(j), xi + δ(T ) xi ), where j is the iteration, γ is the learning rate, and δ(T ) is xi obtained from Eq.(12) with T loops for perturbing xi. We optimize the model parameters by Eq.(8a). Hidden layersOutput layer Input layer z φ z θx1 θ2 θl θ3 ForwardNeuronParameterNon-negative parameterθi θxi θx2 θx3 θx⋯ θxl 8 IEEE TRANSACTIONS ON DEPENDABLE AND SECURE COMPUTING, VOL. XX, NO. X, AUGUST 2023 xx. That is λMg Proposition 2. Assume the smoothness assumption holds. The loss of F −λψθ is (λMg xx + xx)-smoothness when Lf Lf xx)-strongly concave and (λLg xx < λMg xx − Lf − λLg xx + Lf xx 2 (cid:107)x(cid:48) − x(cid:107)2 2 ≤ L ≤ − xx − Lf xx 2 (cid:107)x(cid:48) − x(cid:107)2 2, where L = F(θ, x(cid:48), y) − λψθ(x(cid:48)) − F(θ, x, y) + λψθ(x) − (cid:104)∇x(F −λψθ), δx(cid:105) = J (x(cid:48)) − J (x) − (cid:104)∇xJ (x), δx(cid:105). xx 2 (cid:107)x(cid:48) − x(cid:107)2 Proof. By quadratic bounds derived from the smoothness, we have − Lf 2 ≤ F(θ, x(cid:48), y) − F(θ, x, y) − (cid:104)∇x F, x(cid:48) − x(cid:105) ≤ Lf 2. Since ψθ is convex, we get ψθ(x(cid:48)) − ψθ(x) − (cid:104)∇xψθ, x(cid:48) − x(cid:105) ≥ Mg 2 (cid:107)x(cid:48) − x(cid:107)2 2. Since ψθ is smooth, we get ψθ(x(cid:48)) − ψθ(x) − (cid:104)∇xψθ, x(cid:48) − x(cid:105) ≤ Lg 2 (cid:107)x(cid:48) − x(cid:107)2 xx 2. Combining these two inequalities leads to the proposition. 2 (cid:107)x(cid:48) − x(cid:107)2 xx xx Theorem 1 below quantifies the gap between the approx- and the optimal x. The proof is lengthy and imate adversarial example x(cid:48) = x + δ(T ) one, denoted by x∗ = x + δ∗ deferred to the supplementary material. Theorem 1. Suppose the smoothness assumption holds. If Lf λMg satisfies: xx, the perturbed example x(cid:48) = x + δ(T ) xx < from Algorithm 1 x x J (x∗) − J (x(cid:48)) J (x∗) − J (x) ≤ exp(− T d * λMg λLg xx − Lf xx xx + Lf xx ), where d is the input dimension. We now focus on the convergence of SGD when applied to the outer minimization. Without loss of generality, the following theorem is customized to the composition of φθ and F , which can be extended to the composition of ψθ and G. Let H(θ) = E(x,y)∈Dx F(θ, x∗(θ), y) denote the optimal adversarial loss on the entire training dataset Dx. Theorem 2. Suppose the smoothness assumption holds. Let ∆ = H(θ(0)) − minθ H(θ). If we set the learning rate to γ(j) = γ = min{1/L, (cid:112)∆/(Lζ 2N )}, the adversarial training satisfies 1 N N (cid:88) j=0 E (cid:13) (cid:13)∇H(θ(j)) (cid:13) (cid:13) (cid:13) (cid:13) ≤ ζ (cid:114) 8 ∆L N + 2ˆc, (13) where N is the number of epochs, L = Lf ˆc = (J (x∗) − J (x)) the variance of stochastic gradients. 2Lf θx xx−Lf xx θx(λLg λMg d * λMg λLg exp(− T xθ+Lf xx−Lf xx xx−Lf xx xx+Lf xx λMg xθ) + Lf θθ, ), and ζ is √ The proof is also deferred to the supplementary material. Theorem 2 says that the convergence rate of the adversarial training is O(1/ N ). Moreover, the approximation of the inner maximization has a constant effect on the convergence because of ˆc. More importantly, attacks achieving a lower at- tack effectiveness than this approximation possibly enlarge the effect and can be mitigated by this defense. 6 EXPERIMENTS We conduct experiments to validate the soundness of the proposed defense in the absence and presence of evasion attacks, by answering 4 Research Questions (RQs): • RQ1: Effectiveness of defenses in the absence of attacks: How effective is PAD-SMA when there is no attack? This is important because the defender does not know for certain whether there is an adversarial attack or not. • RQ2: Robustness against oblivious attacks: How robust is PAD-SMA against oblivious attacks where "oblivious" means the attacker is unaware of adversary detector g? • RQ3: Robustness against adaptive attacks: How robust is PAD-SMA against adaptive attacks? • RQ4: Robustness against practical attacks: How robust is PAD-SMA against attacks in the problem space? Datasets. Our experiments utilize two Android malware datasets: Drebin [35] and Malscan [36], which are widely used in the literature. The Drebin dataset initially contains 5,560 malicious apps and features extracted from 123,453 benign apps; both were collected before the year 2013. In order to obtain the customized features, [9] re-collects benign apps from the Androzoo repository [59] and re-scans the collections via VirusTotal, resulting in 42,333 benign examples. This leads to the Drebin dataset used in this paper containing 5,560 malicious apps and 42,333 benign apps. Malscan [36] contains 11,583 malicious apps and 11,613 benign apps, spanning from 2011 to 2018. These apps are labeled using VirusTotal [60]; an app is flagged as malicious if five or more malware scanners say the app is malicious, and as benign if no malware scanners flag it as malicious. We randomly split a dataset into three disjoint sets: 60% for training, 20% for validation, and 20% for testing. Feature extraction and manipulation. We use two fam- including: hard- ilies of features. (i) Manifest features, ware statements (e.g., camera and GPS module) because they may incur security concerns; permissions because they may be abused to breach a user's privacy; implicit In- tents because they are related to communications between app components (e.g., services). These features can be perturbed by injecting operations but may not be re- moved without undermining a program's functionality [9], [19]. (ii) Classes.dex features, including: "restricted" and "dangerous" Application Programming Interfaces (APIs), where a "restricted" API means that its invocation re- quires declaring the corresponding permissions and "dan- gerous" APIs include the ones related to Java reflection usage (e.g., getClass, getMethod, getField), encryp- tion usage (e.g., javax.crypto, Crypto.Cipher), the ex- plicit intent indication (e.g., setDataAndType, setFlags, addFlags), dynamic code loading (e.g., DexClassLoader, System.loadLibrary), and low-level command execu- tion (e.g., Runtime.getRuntime.exec). These APIs can be injected along with dead codes [10]. Note that APIs with the public modifier can be hidden via Java reflection [9], which involves reflection-related APIs used by our detector, referred to as "side-effect" features as mentioned above. These features may benefit the defender. We exclude some features. For manifest features (e.g., package name, activities, services, provider, and receiver), they can be injected or renamed [9], [61]. For Classes.dex fea- tures, existing manipulations include string (e.g., IP address) injection/encryption [9], [19], public or static API calls hid- den by Java reflection [9], [61], Function Call Graph (FCG) addition and rewiring [62], anti-data flow obfuscation [63], and control flow obfuscation (by using arithmetic branches) PAD: PRINCIPLED ADVERSARIAL MALWARE DETECTION AGAINST EVASION ATTACKS, D. LI, S. CUI, Y. LI, J. XU, F. XIAO AND S. XU. 9 [61]. For other types of features, app signatures can be re- signed [61]; native libraries can be modified by Executable and Linkable Format (ELF) section-wise addition, ELF sec- tion appending, and instruction substitution [64]. We use Androguard, a reverse engineering toolkit [65], to extract features. We apply a binary feature vector to denote an app, where "1" means a feature is present and "0" otherwise. The 10,000 top-frequency features are used. Defenses that are considered for comparison purposes. We consider 8 representative defenses: • DNN [40]: DNN based malware detector with no defen- sive hardening, which serves as the baseline; • AT-rFGSMk [24]: DNN-based malware detector hardened by Adversarial Training with the randomized round op- eration enabled FGSMk attack (AT-rFGSMk); • AT-MaxMA [9]: DNN-based malware detector hardened by Adversarial Training with the "Max" strategy enabled Mixture of Attacks (AT-MaxMA); • KDE [47]: Combining DNN model with a secondary de- tector for quarantining adversarial examples. The detector is a Kernel Density Estimator (KDE) built upon activations from the penultimate layer of DNN on normal examples; • DLA [37]: The secondary detector aims to capture differ- ences in DNN activations from the normal and adversarial examples. The adversarial examples are generated upon DNN. The activations from all dense layers are utilized, referred to as Dense Layer Analysis (DLA); • DNN+ [21], [66]: The secondary detector plugs an extra class into the DNN model for detecting adversarial exam- ples generated from DNN (DNN+); • ICNN: The secondary detector is the Input Convexity Neural Network (ICNN), which is established upon the feature space and does not change the DNN (Section 4.2); • PAD-SMA: Principled Adversarial Detection is realized by a DNN-based malware detector and an ICNN-based adversary detector, both of which are hardened by ad- versarial training incorporating the Stepwise Mixture of Attacks (PAD-SMA, Algorithm 1). At a high level, these defenses either harden the malware detector or introduce an adversary detector. More specifi- cally, AT-rFGSMk can achieve better robustness than adver- sarial training methods with the BGA, BCA, or Grosse attack [24]; AT-MaxMA with three PGD attacks can thwart a broad range of attacks but not iMaxMA, which is the iterative version of MaxMA [9]; KDE, DLA, DNN+ and ICNN aim to identify the adversarial examples by leveraging the under- lying difference inherent in ML models between a pristine example and its variant; PAD-SMA hardens the combination of DNN and ICNN by adversarial training. Metrics. We report classification results on the test set via five standard metrics of False Negative Rate (FNR), False Positive Rate (FPR), F1 score, Accuracy (Acc for short, which is the percentage of the test examples that are correctly classified) and balanced Accuracy (bAcc) [67]. Since we introduce g, a threshold τ is calculated on the validation set for rejecting examples. Let "@#" denote the percentage of the examples in the validation set being outliers (e.g., @5 means 5% of the examples are rejected by g). 6.1 RQ1: Effectiveness in the Absence of Attacks Experimental setup. We learn the aforementioned 8 de- tectors from the two datasets, respectively. In terms of malware detector model architecture, the DNN detector has 2 fully-connected hidden layers (each layer having 200 neurons) with ELU activation. The other 7 models also use this architecture. The adversary detector of DLA has the same setting as in [37]: ICNN has 2 convex hidden layers with 200 neurons each. For adversarial training, feature representations can be flipped from "0" to "1" if injection operation is conducted and from "1" to "0" if removal op- eration is conducted. Moreover, AT-rFGSMk uses the PGD- (cid:96)∞ attack, which additionally allows feature removals. It has 50 iterations with step size 0.02. AT-MaxMA uses three attacks, including PGD-(cid:96)∞ iterates 50 times with step size 0.02, PGD-(cid:96)2 iterates 50 times with step size 0.5, and PGD-(cid:96)1 attack iterates 50 times, to conduct the training with penalty factor β = 0.01 because a large β incurs a low detection accuracy on the test sets. DLA and DNN+ are learned from the adversarial examples generated by the MaxMA attack against the DNN model (i.e., adversarial training with an oblivious attack). PAD-SMA has three PGD attacks with the same step size as AT-MaxMA's except for g, which is learned from continuous perturbations. We set penalty factors β1 = 0.1 and β2 = 1.0 on the Drebin dataset and β1 = 0.01 and β2 = 1.0 on the Malscan dataset. In addition, we conduct a group of preliminary experiments to choose λ from {10−3, 10−2, . . . , 103} and finally set λ = 1 on both datasets. All detectors are tuned by the Adam optimizer with 50 epochs, mini-batch size 128, and learning rate 0.001, except for 80 epochs on the Malscan Dataset. Fig. 5: Sorted eigenvalues of Hessian matrix of F − λψθ w.r.t. input when λ = 1. Experiments on confirming that PAD-SMA yields concave inner maximization. Figure 5 illustrates sorted eigenvalues of the Hessian matrix of the loss function F −ψθ w.r.t. input. We randomly choose 100 instance-label pairs from test datasets of Drebin and Malscan, respectively. We let these instances separately pass through PAD-SMA or DNN 02000400060008000100008006004002000200Eigenvalue on Drebin0200040006000800010000Dimension8006004002000Eigenvalue on MalscanPAD-SMADNN 10 IEEE TRANSACTIONS ON DEPENDABLE AND SECURE COMPUTING, VOL. XX, NO. X, AUGUST 2023 TABLE 1: Effectiveness (%) of detectors without adversary detection capability in the absence of attacks. Defense DNN [40] AT-rFGSMk [24] AT-MaxMA [9] KDE [47] DLA [37] DNN+ [21], [66] ICNN PAD-SMA DNN [40] AT-rFGSMk [24] AT-MaxMA [9] KDE [47] DLA [37] DNN+ [21], [66] ICNN PAD-SMA Effectivenss (%) FNR FPR Acc 3.64 2.36 1.73 3.64 3.18 3.36 3.64 2.45 1.87 0.84 0.39 1.87 1.45 2.81 1.87 0.42 0.45 3.43 3.11 0.45 0.58 0.50 0.45 2.36 2.73 5.49 8.84 2.73 3.35 1.84 2.73 8.58 99.18 96.69 97.05 99.18 99.12 99.17 99.18 97.63 97.70 96.86 95.43 97.70 97.61 97.67 97.70 95.54 bAcc 97.96 97.10 97.58 97.96 98.12 98.07 97.96 97.59 97.70 96.84 95.39 97.70 97.60 97.68 97.70 95.50 F1 96.45 87.18 88.46 96.45 96.21 96.42 96.45 90.43 97.73 96.96 95.65 97.73 97.65 97.68 97.73 95.75 n i b e r D n a c s l a M TABLE 2: Accuracy (%) and F1 score (%) of detectors with adversary detection capability in the absence of attacks. Defense @1 (%) @5 (%) @10 (%) Acc F1 99.19 KDE 99.14 DLA DNN+ 99.37 ICNN 99.21 PAD-SMA 97.79 97.68 KDE 97.65 DLA DNN+ 97.81 ICNN 97.68 PAD-SMA 95.66 96.45 96.27 97.20 96.58 90.82 97.71 97.67 97.81 97.73 95.89 Acc 99.15 99.13 99.43 99.21 97.99 97.61 97.69 98.37 97.64 95.72 F1 96.33 96.27 97.44 96.58 88.61 97.61 97.63 98.38 97.74 95.83 Acc 99.17 99.14 99.54 99.14 98.14 97.82 97.80 98.58 97.70 95.59 F1 96.43 96.53 97.93 96.58 79.54 97.80 97.64 98.56 97.83 95.47 n i b e r D n a c s l a M (which has ψθ = 0) for calculating eigenvalues, and then average the eigenvalues element-wisely corresponding to the input dimension. We observe that most eigenvalues are near 0, PAD-SMA produces large negative eigenvalues, and DNN has relatively small positive eigenvalues. This shows that PAD-SMA can yield a concave inner maximization, confirming the theoretical results. Note that PAD-SMA still has positive eigenvalues on the Malcan dataset, and that robustness is achieved. Results answering RQ1. Table 1 reports the effectiveness of detectors on the two test sets. We observe that DNN achieves the highest detection accuracy (99.18% on Drebin and 97.70% on Malscan) and F1 score (96.45% on Drebin and 97.73% on Malscan). These accuracies are comparable to those reported in [35], [36], [40]. We also observe that KDE and ICNN have the same effectiveness as DNN because both are built upon DNN while introducing a separate model to detect adversarial examples. We further observe that when training with adversarial examples (e.g., AT- rFGSMk, AT-MaxMA, DLA, DNN+, and PAD-SMA), de- tectors' FNR decreases while FPR increases, leading to de- creased F1 scores. This can be attributed to the fact that only the perturbed malware is used in the adversarial training and that data imbalance makes things worse. Table 2 reports the accuracy and F1 score of detectors with adversary detection capability g. To observe the behav- ior of g, we abstain f from the prediction when g(x) ≥ τ . We expect to see that the trend of accuracy or F1 score will increase when removing as outliers more examples with high confidence from g on the validation set. However, this phenomenon is not always observed (e.g., DLA and ICNN). This might be caused by the fact that DLA and ICNN distinguish the pristine examples confidently in the training phase, while the rejected examples on the validation set are in the distribution and thus have little impact on the detection accuracy of f . PAD-SMA gets the downtrend of F1 score but not accuracy, particularly on the Drebin dataset. Though this is counter-intuitive, we attribute it to the adversarial training with adaptive attacks, which implicitly pushes g to predict the pristine malware examples with higher confidence than the benign ones. Thus, rejecting more validation examples actually causes more malware examples to be dropped, causing the remaining malware samples to be more similar to the benign ones and f to misclassify remaining malware, leading to lower F1 scores. In summary, PAD-SMA decreases FNR but increases FPR, leading to decreased accuracies (≤2.16%) and F1 scores (≤6.02%), which aligns with the malware detectors learned from adversarial training. The use of adversary detectors in PAD-SMA does not make the situation better. Answer to RQ1: There is no "free lunch" in the sense that using detectors trained from adversarial examples may suffer from a slightly lower accuracy when there are no adversarial attacks. 6.2 RQ2: Robustness against Oblivious Attacks Experimental setup. We measure the robustness of KDE, DLA, DNN+, ICNN, and PAD-SMA against oblivious at- tacks via the Drebin and Malscan datasets; we do not con- sider the other detectors (i.e., DNN, AT-rFGSMk, and AT- MaxMA) because they do not have g. We use the detectors learned in the previous group of experiments (for answering RQ1). The threshold is computed by dropping 5% validation examples with top confidence, which is suggested in [21], [37], [47], while noting that the accuracy of PAD-SMA is slightly better than that of AT-MaxMT at this setting. We separately wage 11 oblivious attacks to perturb mal- ware examples on the test set. For Grosse [40], BCA [24], FGSM [24], BGA [24], PGD-(cid:96)1 [25], PGD-(cid:96)2 [25], and PGD- (cid:96)∞ [25], these attacks proceed iteratively till the 100th loop is reached. Grosse, BCA, FGSM, and BGA are proposed to only permit the feature addition operation (i.e., flipping some '0's to '1's). FGSM has a step size 0.02 with random rounding. Three PGD attacks permit both feature addition and feature removal: PGD-(cid:96)2 has a step size 0.5 and PGD-(cid:96)∞ has a step size 0.02 (the settings are the same as adversarial training). For Mimicry [26], we leverage Nben benign examples to guide the attack (dubbed Mimicry×Nben). We select the one that can evade f to wage attacks and use a random one otherwise. MaxMA [9] contains PGD-(cid:96)1, PGD-(cid:96)2, and PGD- (cid:96)∞ attacks. The iterative MaxMA (dubbed iMaxMA) runs MaxMA 5 times, with the start point updated. SMA has 100 iterations with step size 0.5 for PGD-(cid:96)2 and 0.02 for PGD- (cid:96)∞. The three MA attacks use the scoring rule of Eq.(12) without g considered. PAD: PRINCIPLED ADVERSARIAL MALWARE DETECTION AGAINST EVASION ATTACKS, D. LI, S. CUI, Y. LI, J. XU, F. XIAO AND S. XU. 11 Fig. 6: Accuracy (Acc) of detectors against oblivious attacks with iteration from 0 to 100. Results. Fig.6 depicts the accuracy curves of the detectors on Drebin (top panel) and Malscan (bottom panel) datasets under the 7 oblivious attacks, along with the iterations ranging from 0 to 100. We make three observations. First, all these attacks cannot evade PAD-SMA (accuracy ≥ 90%), demonstrating the robustness of the proposed model. Second, the Grosse, BCA, and PGD-(cid:96)1 attacks can evade KDE, DLA, DNN+, and ICNN when 20 iterations are used, while recalling that these three attacks stop manipulating malware when the perturbed example can evade malware detector f . It is known that DNN is sensitive to small perturbations; KDE relies on the close distance between activations to reject large manipulations; DLA and DNN+ are learned upon the oblivious MaxMA, which modifies malware examples to a large extent; ICNN is also learned from salt-and-pepper noises which randomly change one half elements of a vector. Therefore, neither malware detec- tor f nor adversary detector g of KDE, DLA, and ICNN can impede small perturbations effectively. This explains why KDE, DLA, and ICNN can mitigate BGA and PGD-(cid:96)∞ attacks that use large perturbations. Third, a dip exists in the accuracy curve of KDE, DLA, or ICNN against rFGSM and PGD-(cid:96)2 when the iteration increases from 0 to 100. We find that both attacks can obtain small perturbations: rFGSM uses the random round (the rounding thresholds are randomly sampled from [0, 1]) [24] at iteration 1, and PGD-(cid:96)2 produces certain discrete perturbations at iteration 20 via round (the threshold is 0.5). Table 3 reports the attack results of Mimicry, MaxMA, iMaxMA, and SMA, which are not suitable for iterating with a large number of loops. We make three observations. First, PAD-SMA can effectively defend against these attacks, except for Mimicry×30 (with an accuracy of 65.45% on Malscan). Mimicry attempts to modify malware representa- tions to resemble benign ones. As reported in Section 6.1, adversarial training promotes ICNN (g of PAD-SMA) to implicitly distinguish malicious examples from benign ones. Both aspects decrease PAD-SMA's capability in mitigating the oblivious Mimicry attack effectively. Second, all detec- tors can resist MaxMA and iMaxMA, except for DNN+. Both attacks maximize the classification loss of DNN+, TABLE 3: Accuracy (%) of detectors under oblivious attacks (i.e., attacker is unaware of adversary detector g). Attack name No Attack Mimicry×1 Mimicry×10 Mimicry×30 MaxMA iMaxMA SMA No Attack Mimicry×1 Mimicry×10 Mimicry×30 MaxMA iMaxMA SMA n i b e r D n a c s l a M Accuracy (%) KDE DLA DNN+ ICNN PAD-SMA 96.28 56.64 20.91 10.64 96.46 96.46 32.09 98.02 49.74 18.13 8.65 98.13 98.13 6.00 96.80 55.82 20.91 10.64 96.82 96.82 27.82 98.41 53.65 18.68 6.94 98.55 98.55 26.68 97.02 58.18 23.55 12.82 29.64 29.64 31.18 97.86 47.81 21.68 14.23 84.23 84.23 19.03 96.62 54.91 21.00 10.00 96.64 96.64 32.36 98.11 49.32 17.06 7.00 98.16 98.16 7.32 97.64 94.18 84.18 81.27 97.64 97.64 94.27 99.65 83.68 69.13 65.45 99.65 99.65 96.68 leading DNN+ to misclassify perturbed examples as benign (rather than the newly introduced label). Third, all detectors are vulnerable to the SMA attack (with maximum accuracy of 32.36% on Drebin and 26.68% on Malscan), except for PAD-SMA. This is because SMA stops perturbing malware when a successful adversarial example against f is obtained although the degree of perturbations is small, which cannot be identified by g of KDE, DLA, DNN+, or ICNN. Answer to RQ2: PAD-SMA is significantly more robust than KDE, DLA, DNN+, and ICNN against oblivious at- tacks. Still, PAD-SMA cannot effectively resist the Mimicry attacks that are guided by multiple benign samples. 6.3 RQ3: Robustness against Adaptive Attacks Experimental setup. We measure the robustness of the de- tectors against adaptive attacks on the Drebin and Malscan datasets. We use the 8 detectors in the first group of ex- periments. The threshold τ is set as the one in the second group of experiments unless explicitly stated otherwise. The attacker knows f and g (if applicable) to manipulate mal- ware examples on the test sets. We change the 11 oblivious 1520406080100020406080100Acc on Drebin (%)Grosse1520406080100BCA1520406080100BGA1520406080100rFGSM1520406080100PGD-11520406080100PGD-21520406080100PGD-1520406080100Iteration020406080100Acc on Malscan (%)1520406080100Iteration1520406080100Iteration1520406080100Iteration1520406080100Iteration1520406080100Iteration1520406080100IterationKDEDLADNN+ICNNPAD-SMA 12 IEEE TRANSACTIONS ON DEPENDABLE AND SECURE COMPUTING, VOL. XX, NO. X, AUGUST 2023 TABLE 4: Accuracy (%) of detectors under adaptive attacks, where "Orth" stands for "orthogonal", "−" means an attack is not applicable. Attack name Groose BCA BGA rFGSM PGD-(cid:96)1 PGD-(cid:96)2 PGD-(cid:96)∞ Mimicry×1 Mimicry×10 Mimicry×30 MaxMA iMaxMA SMA Orth PGD-(cid:96)1 Orth PGD-(cid:96)2 Orth PGD-(cid:96)∞ Orth MaxMa Orth iMaxMa Groose BCA BGA rFGSM PGD-(cid:96)1 PGD-(cid:96)2 PGD-(cid:96)∞ Mimicry×1 Mimicry×10 Mimicry×30 MaxMA iMaxMA SMA Orth PGD-(cid:96)1 Orth PGD-(cid:96)2 Orth PGD-(cid:96)∞ Orth MaxMa Orth iMaxMa Drebin Malscan DNN AT-rFGSM AT-MaxMA KDE DLA DNN+ ICNN PAD-SMA Accuracy (%) 0.000 0.000 0.000 0.000 0.000 3.455 0.000 54.91 21.00 10.00 0.000 0.000 0.000 − − − − − 0.000 0.000 0.000 0.000 0.000 34.13 0.000 49.32 17.06 7.000 0.000 0.000 0.000 − − − − − 48.00 47.73 95.55 97.46 44.46 89.73 96.55 88.91 71.82 66.45 44.36 43.36 57.82 − − − − − 9.129 8.968 10.97 99.16 6.000 63.94 99.16 75.39 49.13 39.94 5.742 1.645 28.77 − − − − − 87.64 87.64 96.64 98.18 80.91 96.27 98.09 90.27 74.27 70.64 80.64 69.64 84.09 − − − − − 77.26 77.03 95.68 99.55 71.68 81.55 99.52 82.48 60.71 52.48 61.77 47.07 78.36 − − − − − 0.000 6.182 97.00 97.00 0.182 87.36 97.00 56.64 25.73 16.09 0.182 0.000 16.36 1.091 17.46 96.82 1.091 0.182 0.000 1.194 98.13 98.13 0.000 38.32 98.13 49.74 17.52 7.645 0.645 0.097 0.323 2.000 38.32 98.13 1.806 0.484 0.000 0.000 2.455 96.82 0.000 0.000 96.82 55.82 20.36 10.09 0.000 0.000 0.000 0.000 2.455 31.73 0.000 0.000 0.000 0.000 0.194 98.55 0.000 2.097 98.55 53.65 18.23 6.483 0.000 0.000 8.258 0.000 2.097 87.97 0.000 0.000 0.000 4.727 0.000 70.91 0.000 8.727 63.73 58.18 19.18 7.909 0.000 0.000 8.636 0.000 13.55 55.18 0.000 0.000 0.000 0.097 30.19 83.42 0.000 2.806 41.07 47.81 11.65 2.452 0.000 0.000 1.000 0.032 2.806 34.23 0.032 0.032 0.636 3.000 33.36 96.64 0.091 0.091 96.64 54.91 21.00 10.00 0.091 0.000 0.000 0.000 3.909 96.46 0.000 0.000 0.871 8.129 37.45 98.16 1.226 2.548 98.10 49.32 17.06 7.000 0.935 0.935 0.903 0.000 2.548 98.16 0.000 0.000 90.91 93.00 97.64 97.64 89.72 97.18 97.46 94.18 81.18 74.27 89.09 88.73 94.46 97.64 97.64 97.64 97.64 97.64 85.26 89.32 99.45 99.65 84.87 95.90 99.45 83.68 59.94 53.68 85.26 83.45 97.48 99.65 99.65 99.65 99.65 99.65 attacks to adaptive attacks by using the loss function given in Eq.(6), which contains both F and ψθ. When perturbing an example, a linear search is conducted to look for a λ from the set of {10−5, . . . , 105}. In addition, the Mimicry attack can query both f and g and get feedback then. On the other hand, since DNN, AT-rFGSM, and AT-MaxMA contain no adversary detector, the oblivious attacks trivially meet the adaptive requirement. The other 5 attacks are adapted from orthogonal (Orth for short) PGD [23], including Orth PGD-(cid:96)1, PGD-(cid:96)2, PGD-(cid:96)∞, MaxMA, and iMaxMA. We use the scoring rule of Eq.(12) to select the orthogonal manner. The hyper-parameters of attacks are the same as the second group of experiments, except for PGD-(cid:96)1 using 500 itera- tions, PGD-(cid:96)2 using 200 iterations with step size 0.05, and PGD-(cid:96)∞ using 500 iterations with step size 0.002. Results. Table 4 summarizes the experimental results. We make three observations. First, DNN is vulnerable to all attacks with 0% accuracy. The Mimicry attack achieves the lowest effectiveness in evading DNN because it modifies examples without using the internal information of victim detectors. AT-rFGSM can harden the robustness of DNN to some extent, but is still sensitive to BCA, PGD-(cid:96)1, MaxMa, and iMaxMA attacks (with an accuracy ≤ 47.73% on both datasets). With an adversary detector, KDE, DLA, DNN+, and ICNN can resist a few attacks (e.g., rFGSM and PGD- (cid:96)∞), but the effectiveness is limited. AT-MaxMA impedes a range of attacks except for iMaxMA (with a 69.94% accuracy on Drebin and 47.07% on Malscan) and Mimicry×30 (with a 70.64% accuracy on Drebin and 52.48% on Malscan), which are consistent with previous results [9]. Second, PAD-SMA significantly outperforms the other defenses (e.g., AT-MaxMA), by achieving robustness against 16 attacks on the Drebin dataset and 13 attacks on the Malscan dataset (with accuracy ≥ 85%). For example, PAD- SMA can mitigate MaxMA and iMaxMA, while AT-MaxMA can resist MaxMA but not iMaxMA (accuracy dropping by 11% on Drebin and 14.7% on Malscan). The reason is that PAD-SMA is optimized with convergence guaranteed, causing that more iterations do not promote attack effec- tiveness, which resonates our theoretical results. Moreover, PAD-SMA gains high detection accuracy (≥ 97.64%) against orthogonal attacks because the same scoring rule is used and PAD-SMA renders loss function concave. Third, Mimicry×30 can evade all defenses (with accu- racy ≤ 74.27% on Drebin and ≤ 53.68% on Malscan). We additionally conduct two experiments on Drebin: (i) when we retrain PAD-SMA with penalty factor β1 increased from β1 = 0.1 to β1 = 1.0, the detection accuracy increases to 85.27% against Mimicry×30 with the detection accuracy on PAD: PRINCIPLED ADVERSARIAL MALWARE DETECTION AGAINST EVASION ATTACKS, D. LI, S. CUI, Y. LI, J. XU, F. XIAO AND S. XU. 13 the test dataset decreasing notably (F1 score decreasing to 78.06%); (ii) when we train PAD-SMA on Mimicry×30 with additional 10 epochs, the robustness increases to 83.64% against Mimicry×30 but the detection accuracy also de- creases on the test set. These hint that our method, as other adversarial malware training methods, suffers from a trade- off between robustness and accuracy. Answer to RQ3: PAD-SMA outperforms the other de- fenses, by significantly hardening malware detectors against a range of adaptive attacks but not Mimicry×30. 6.4 RQ4: Robustness against Practical Attacks Experimental setup. We implement a system to produce adversarial malware for all attacks considered. We handle the inverse feature mapping problem (Section 4.3) as in [9], by mapping perturbations in the feature space to the problem space. Our manipulation proceeds as follows: (i) obtain feature perturbations; (ii) disassemble an app using Apktool [68]; (iii) perform manipulation and assemble per- turbed files using Apktool. We add manifest features and do not remove them for preserving an app's functionality. We permit all APIs that can be added and the APIs with public modifier but no class inheritance can be hidden by the re- flection technique (see supplementary materials for details). In addition, the functionality estimation is conducted by Android Monkey, which is an efficient fuzz testing tool that can randomly generate app activities to execute on Android devices, along with logs. If an app and its modified version have the same activities, we treat them as having the same functionality. However, we manually re-analyze the non- functional ones to cope with the randomness of Monkey. We wage Mimcry×30, iMaxMA, and SMA attacks because they achieve a high evasion capability in the feature space. Results. We respectively modify 1,098, 1,098, and 1,098 apps by waging the Mimcry×30, iMaxMA, and SMA attacks to the Drebin test set (leading to 1,100 malicious apps in total), and 2,790, 2,791, and 2,790 apps to the Malscan test set (leading to 3,100 malicious apps in total). Most failed cases are packed apps against ApkTool. TABLE 5: The number of apps with functionalities preserved from 100 randomly selected examples. Dataset Functionality Apps (#) No attack Mimicry×30 iMaxMA SMA Drebin Installable Monkey Andro- zoo Installable Monkey 89 80 86 76 89 68 84 58 89 66 86 65 89 65 83 64 Table 5 reports the number of modified apps that retain the malicious functionality. Given 100 randomly chosen apps, 89 apps on Drebin and 86 apps on Malscan can be deployed on an Android emulator (running Android API version 8.0 and ARM library supported). Monkey testing says that the ratio of functionality preservation is at least 73.03% (65 out of 89) on the Drebin dataset and 69.05% (58 out of 84) on the Malscan dataset. Through manual inspection, we find that the injection of null constructor cannot pass the verification mechanism of the Android Runtime. Moreover, Java reflection sometimes breaks an app's functionality when the app verifies whether an API name is changed and then chooses to throw an error. Fig. 7: Effectiveness of PAD-SMA and malware scanners against practical attacks. Fig.7 depicts the detection accuracy of detectors against Mimicry×30, iMaxMA, and SMA attacks. We observe that PAD-SMA cannot surpass Avira and ESET-NOD32 on both the Drebin and Malscan datasets. Note that these attacks know the feature space of PAD-SMA but not anti-malware scanners. Nevertheless, PAD-SMA achieves comparable ro- bustness to the three attacks by comparing with Microsoft, and outperforms McAfee, Symantec, and Comodo. In ad- dition, Kaspersky is seemingly adaptive to these attacks because it obtains a slightly better accuracy on the modified apps than the unperturbed ones (≤15.59%) on the Malscan dataset. Answer to RQ4: PAD-SMA is comparable to anti-malware scanners in the presence of practical attacks. It effectively mitigate iMaxMA and SMA attacks, but has limited success against Mimicry×30, akin to the cases of circumventing feature-space attacks. 7 RELATED WORK We divide related prior studies into two classes: Adversarial Malware Detection (AMD) vs. Adversarial ML (AML). Defenses against adversarial examples in AMD. We fur- ther divide the related literature into three categories: (i) robust feature extraction, (ii) learning model enhancement, and (iii) adversarial example detection. In terms of robust feature extraction, Drebin features, including manifest instructions (e.g., required permissions) and syntax instructions (e.g., sensitive APIs), are usually applied to resist adversarial examples [10], [14], [35], [40]. Furthermore, Demontis et al. [19] demonstrate the robust- ness of Drebin features using several evasion attacks. How- ever, a following study questions this observation with a mixture of attacks [9]. Moreover, to cope with obfuscation attacks, researchers suggest leveraging system API calls [5], and further enrich the representation by incorporating multiple modalities such as structural information (e.g., 020406080100Acc (%) on DrebinPAD-SMAKasperskyAviraMcAfeeMicrosoftESET-NOD32SymantecComodo020406080100Acc (%) on MalscanNo attackMimicry×30iMaxMASMA 14 IEEE TRANSACTIONS ON DEPENDABLE AND SECURE COMPUTING, VOL. XX, NO. X, AUGUST 2023 call graph), API usage (e.g., method argument types, API dependencies), and dynamic behaviors (e.g., network activ- ity, memory dump) [4], [6], [69]. In this paper, we mainly focus on improving the robustness of the learning model, although the feature robustness is also important. Therefore, we refine Drebin features by filtering the ones that can be easily manipulated. In terms of learning model enhancement, the defense mechanisms aim to enhance a malware detector itself to classify adversarial examples accurately. Several approaches exist, such as classifier randomization, ensemble learning, input transformation, and adversarial training, which are summarized by a recent survey [20]. We focus on adversarial training, which augments the training dataset with adver- sarial examples [24], [40], [44], [45]. In order to promote the robustness, the min-max adversarial training [42] in machine learning is adapted to the context of malware detection, aiming to make detectors perceive the optimal attack in a sense to resist non-optimal ones [24], [25]. In practice, the attackers are free enough to generate multiple types of adversarial examples, straightly leading to the instantiation of adversarial training incorporating a mixture of attacks [9]. In addition, combining adversarial training and ensemble learning further promotes robustness as long as the base model has a due amount of robustness [9]; a recent study demonstrates that diversified features also promote the robustness of ensemble model [69]. This paper aims to establish principled min-max adversarial training methods with rigorous robustness. Moreover, a new mixture of attacks is used to instantiate our framework. In terms of adversarial example detection, the defenses aim to identify adversarial examples for further analysis. There are two approaches. The first approach is to study detectors based on traditional ML models such as ensem- ble learning based (e.g., [70]). Inspired by the observation that grey-box attacks cannot thwart all basic building-block classifiers, Smutz et al. [70] propose identifying evasion attacks via prediction confidences. However, it is not clear how to adapt these ideas to deep learning models because they leverage properties which may not exist in DL models (e.g., neural networks are poorly, rather than well, calibrated [71]). The second approach is to leverage the invariant in malware features or detectors to recognize adversarial examples. For example, Grosse et al. [66] demonstrate the difference between examples and their perturbed versions using statistical tests. Li et al. [72] and Li et al. [73] respec- tively propose detecting adversarial examples via stacked denoising autoencoders. However, these defense models seemingly cannot deal with adaptive attacks [23], [66], [72]. Moreover, some defense models are not validated with adaptive attacks [73]. When compared with these prior studies, our solution leverages a convex DNN model to rec- ognize the evasion attacks, which is not only able to detect adversarial examples, but also able to promote principled defenses [32], leading to a formal treatment on robustness. Although our model has malware and adversary detectors, it is different from ensemble learning because they use different losses. Adversarial training in AML. Adversarial training aug- ments the training set with adversarial examples [41], [49]. Multiple heuristic strategies have been proposed to generate adversarial examples, including the one that casts adver- sarial training as a min-max optimization problem [42]. It minimizes the loss for learning ML models upon the most powerful attack (i.e., considering the worst-case scenario). However, owing to the non-linearity of DNNs, it is NP- hard to solve the inner maximization exactly [42]. There are two lines of studies to improve the min-max adversarial training: one aims to select or produce the optimal adver- sarial examples (e.g., via advanced criterion or new learning strategies [34], [46], [74], [75]); the other aims to analyze sta- tistical properties of resulting models (e.g.,via specific NN architectures or convexity assumptions [32], [76]). However, adversarial training is domain-specific, meaning that it is non-trivial to leverage these advancements for enhancing ML-based malware detectors. 8 CONCLUSION We devised a provable defense framework for malware de- tection against adversarial examples. Instead of hardening the malware detector solely, we use an indicator to alert the presence of adversarial examples. We instantiate the framework via adversarial training with a new mixture of attacks, along with a theoretical analysis on the resulting robustness. Experiments with two Android datasets demon- strate the soundness of the framework against a set of attacks, including 3 practical ones. Future research needs to design other principled or verifiable methods. Learning or devising robust features, especially dynamic analysis based features, may be key to detecting adversarial examples. Other open problems include unifying practical adversarial malware attacks, designing application-agnostic manipula- tions, and formally verifying functionality-preservation and model robustness. REFERENCES [1] V. CHEBYSHEV. (2020, March) Mobile malware evolution 2020 @ONLINE. [Online]. Available: https://securelist.com/ [2] E. Raff, J. Barker, J. Sylvester, and et al., "Malware detection by eating a whole exe," arXiv preprint arXiv:1710.09435, 2017. [3] Y. Ye, T. Li, D. A. Adjeroh, and S. S. Iyengar, "A survey on malware detection using data mining techniques," ACM Comput. Surv., vol. 50, no. 3, pp. 41:1–41:40, 2017. [4] X. Zhang, Y. Zhang, M. Zhong, and et al., "Enhancing state-of- the-art classifiers with api semantics to detect evolved android malware," in Proceedings of the 2020 CCS. New York, NY, USA: Association for Computing Machinery, 2020, p. 757–770. S. Hou, Y. Ye, Y. Song, and M. Abdulhayoglu, "Hindroid: An intelligent android malware detection system based on structured heterogeneous information network," in Proceedings of the 23rd KDD. Halifax, NS, Canada: ACM, 2017, pp. 1507–1515. [5] [6] L. Onwuzurike, E. Mariconti, P. Andriotis, and et al., "Mamadroid: Detecting android malware by building markov chains of behav- ioral models," ACM TOPS, vol. 22, no. 2, pp. 1–34, 2019. [7] X. Chen, C. Li, and et al., "Android HIV: A study of repackaging malware for evading machine-learning detection," IEEE T-IFS, vol. 15, pp. 987–1001, 2020. [8] L. Chen, S. Hou, and Y. Ye, "Securedroid: Enhancing security of machine learning-based detection against adversarial android malware attacks," in ACSAC. USA: ACM, 2017, pp. 362–372. [9] D. Li and Q. Li, "Adversarial deep ensemble: Evasion attacks and defenses for malware detection," IEEE T-IFS, vol. 15, 2020. [10] F. Pierazzi, F. Pendlebury, and et al., "Intriguing properties of adversarial ML attacks in the problem space," in IEEE S&P, San Francisco, CA, USA, May 18-21, 2020. IEEE, 2020, pp. 1332–1349. PAD: PRINCIPLED ADVERSARIAL MALWARE DETECTION AGAINST EVASION ATTACKS, D. LI, S. CUI, Y. LI, J. XU, F. XIAO AND S. XU. 15 [11] K. Zhao, H. Zhou, and et al., "Structural attack against graph based android malware detection," in CCS, Virtual Event, Republic of Korea, November 15 - 19, 2021. ACM, 2021, pp. 3218–3235. [12] W. Song, X. Li, S. Afroz, and et al., "MAB-Malware: A reinforce- ment learning framework for blackbox generation of adversarial malware," in ASIA CCS, Japan. ACM, 2022, pp. 990–1003. [13] S. Chen, M. Xue, L. Fan, and et al., "Automated poisoning at- tacks and defenses in malware detection systems: An adversarial machine learning approach," Comput. Secur., vol. 73, pp. 326–344, 2018. [14] O. Suciu, R. Marginean, Y. Kaya, and et al., "When does ma- chine learning FAIL? generalized transferability for evasion and poisoning attacks," in USENIX Security Symposium. USENIX Association, 2018, pp. 1299–1316. [15] L. Demetrio, B. Biggio, G. Lagorio, and et al., "Functionality- preserving black-box optimization of adversarial windows mal- ware," IEEE Trans. Inf. Forensics Secur., vol. 16, pp. 3469–3478, 2021. [16] L. Demetrio, S. E. Coull, B. Biggio, and et al., "Adversarial exem- ples: A survey and experimental evaluation of practical attacks on machine learning for windows malware detection," ACM Trans. Priv. Secur., vol. 24, no. 4, pp. 27:1–27:31, 2021. [17] A. Demontis, M. Melis, M. Pintor, and et al., "Why do adversarial attacks transfer? explaining transferability of evasion and poison- ing attacks," in 28th USENIX Security Symposium. Santa Clara, CA, USA: USENIX Association, 2019, pp. 321–338. [18] L. Chen, S. Hou, Y. Ye, and S. Xu, "Droideye: Fortifying security of learning-based classifier against adversarial android malware attacks," in FOSINT-SI'2018, 2018, pp. 253–262. [19] A. Demontis, M. Melis, B. Biggio, and et al., "Yes, machine learning can be more secure! a case study on android malware detection," IEEE TDSC, vol. 16, no. 4, pp. 711–724, 2019. [20] D. Li, Q. Li, Y. F. Ye, and S. Xu, "Arms race in adversarial malware detection: A survey," ACM Comput. Surv., vol. 55, no. 1, 2021. [21] N. Carlini and D. Wagner, "Adversarial examples are not easily detected: Bypassing ten detection methods," in Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security. Dallas, TX, USA: ACM, 2017, pp. 3–14. [22] A. Athalye, N. Carlini, and D. A. Wagner, "Obfuscated gradients give a false sense of security: Circumventing defenses to adversar- ial examples," CoRR, vol. abs/1802.00420, 2018. [23] O. Bryniarski, N. Hingun, and et al., "Evading adversarial ex- ample detection defenses with orthogonal projected gradient de- scent," in 10th ICLR. OpenReview.net, 2022. [24] A. Al-Dujaili, A. Huang, E. Hemberg, and U.-M. O'Reilly, "Ad- versarial deep learning for robust detection of binary encoded malware," in 2018 IEEE Security and Privacy Workshops (SPW). San Francisco, USA: IEEE Computer Society, 2018, pp. 76–82. [25] D. Li, Q. Li, Y. Ye, and S. Xu, "A framework for enhancing deep neural networks against adversarial malware," IEEE Trans. Netw. Sci. Eng., vol. 8, no. 1, pp. 736–750, 2021. [26] P. L. Nedim Rndic, "Practical evasion of a learning-based classifier: A case study," in Security and Privacy (SP), 2014 IEEE Symposium on. IEEE, 2014, pp. 197–211. [27] I. Incer, M. Theodorides, S. Afroz, and et al., "Adversarially robust malware detection using monotonic classification," in Proceedings of the ACM IWSPA@CODASPY. AZ, USA: ACM, 2018, pp. 54–63. [28] Q. Lei, L. Wu, P. Chen, and et al., "Discrete adversarial attacks and submodular optimization with applications to text classifica- tion," in Proceedings of MLSys 2019, CA, USA, 2019, A. Talwalkar, V. Smith, and M. Zaharia, Eds. mlsys.org, 2019. [29] H. Bao, Y. Han, Y. Zhou, and et al., "Towards understanding the robustness against evasion attack on categorical data," in The Tenth ICLR, Virtual Event. OpenReview.net, 2022. [30] Y. Wang, Y. Han, H. Bao, and et al., "Attackability characterization of adversarial evasion attack on discrete data," in The 26th ACM SIGKDD, Virtual Event, USA, 2020. ACM, 2020, pp. 1415–1425. [31] Y. Chen, S. Wang, D. She, and S. Jana, "On training robust PDF malware classifiers," in 29th USENIX Security Symposium. USENIX Association, 2020, pp. 2343–2360. [32] A. Sinha, H. Namkoong, and J. C. Duchi, "Certifying some distri- butional robustness with principled adversarial training," in 6th ICLR, Vancouver, Canada, Apr 30 - May 3. OpenReview.net, 2018. [33] Y. Wang, X. Ma, J. Bailey, and et al., "On the convergence and robustness of adversarial training," in Proceedings of the 36th ICML, vol. 97. PMLR, 09–15 Jun 2019, pp. 6586–6595. [34] X. Jia, Y. Zhang, B. Wu, and et al., "LAS-AT: adversarial training with learnable attack strategy," in IEEE/CVF Conference on CVPR, LA, USA, 2022. IEEE, 2022, pp. 13 388–13 398. [35] D. Arp, M. Spreitzenbarth, and et al., "Drebin: Effective and explainable detection of android malware in your pocket." in NDSS, vol. 14. San Diego, California, USA: The Internet Society, 2014, pp. 23–26. [36] Y. Wu, X. Li, D. Zou, and et al., "Malscan: Fast market-wide mobile malware scanning by social-network centrality analysis," in 34th IEEE/ACM International Conference on ASE, San Diego, CA, USA, November 11-15. IEEE, 2019, pp. 139–150. [37] P. Sperl, C. Kao, P. Chen, X. Lei, and K. B ̈ottinger, "DLA: dense- layer-analysis for adversarial example detection," in IEEE Eu- roS&P, Genoa, Italy, September 7-11. IEEE, 2020, pp. 198–215. [38] Y. LeCun, Y. Bengio, and G. Hinton, "Deep learning," nature, vol. 521, no. 7553, p. 436, 2015. [39] I. C. B. Biggio and D. M. et al., "Evasion attacks against machine learning at test time," in Machine Learning and Knowledge Discovery in Databases: European Conference. Springer, 2013, pp. 387–402. [40] K. Grosse, N. Papernot, P. Manoharan, and et al., "Adversarial examples for malware detection," in ESORICS. Oslo, Norway: Springer, 2017, pp. 62–79. [41] I. J. Goodfellow, J. Shlens, and C. Szegedy, "Explaining and har- nessing adversarial examples," in 3rd ICLR. San Diego, CA, USA: OpenReview.net, 2015. [42] A. Madry, A. Makelov, L. Schmidt, and et al., "Towards deep learning models resistant to adversarial attacks," in 6th ICLR, BC, Canada. OpenReview.net, 2018. [43] D. Li, Q. Li, Y. Ye, and S. Xu, "Enhancing deep neural net- works against adversarial malware examples," arXiv preprint arXiv:2004.07919, 2020. [44] L. Xu, Z. Zhan, S. Xu, and K. Ye, "An evasion and counter- evasion study in malicious websites detection," in CNS, 2014 IEEE Conference on. IEEE, 2014, pp. 265–273. [45] L. Chen, Y. Ye, and T. Bourlai, "Adversarial machine learning in malware detection: Arms race between evasion attack and defense," in EISIC'2017, 2017, pp. 99–106. [46] F. Tram`er, A. Kurakin, N. Papernot, and et al., "Ensemble adver- sarial training: Attacks and defenses," in 6th ICLR, BC, Canada. OpenReview.net, 2018. [47] T. Pang, C. Du, Y. Dong, and et al., "Towards robust detection of adversarial examples," in Advances in NeurIPS, 2018, pp. 4579– 4589. [48] C. Villani, Topics in optimal transportation. American Mathematical Soc., 2021, vol. 58. [49] C. Szegedy, W. Zaremba, I. Sutskever, and et al., "Intriguing properties of neural networks," in 2nd ICLR, Banff, AB, Canada, April 14-16, 2014. [50] S. Moosavi-Dezfooli, A. Fawzi, J. Uesato, and et al., "Robustness via curvature regularization, and vice versa," in IEEE Conference on CVPR, CA, USA. IEEE, 2019, pp. 9078–9086. [51] X. Yuan, P. He, Q. Zhu, and X. Li, "Adversarial examples: Attacks and defenses for deep learning," IEEE Trans. Neural Networks Learn. Syst., vol. 30, no. 9, pp. 2805–2824, 2019. [52] Y. Liu, C. Tantithamthavorn, L. Li, and Y. Liu, "Deep learning for android malware defenses: A systematic literature review," ACM Comput. Surv., 2022. [53] B. Kolosnjaji, A. Demontis, B. Biggio, and et al., "Adversarial malware binaries: Evading deep learning for malware detection in executables," in 2018 26th EUSIPCO, Sep. 2018, pp. 533–537. [54] Z. Allen-Zhu, Y. Li, and Z. Song, "A convergence theory for deep learning via over-parameterization," in Proceedings of the 36th ICML, vol. 97. Long Beach, USA: PMLR, 2019, pp. 242–252. [55] D. Clevert, T. Unterthiner, and S. Hochreiter, "Fast and accurate deep network learning by exponential linear units (elus)," in 4th ICLR. San Juan, Puerto Rico: OpenReview.net, 2016. [56] B. Amos, L. Xu, and J. Z. Kolter, "Input convex neural networks," in Proceedings of the 34th ICML, Sydney, NSW, Australia, 6-11 Au- gust, vol. 70. PMLR, 2017, pp. 146–155. [57] P. Oza and V. M. Patel, "One-class convolutional neural network," IEEE Signal Process. Lett., vol. 26, no. 2, pp. 277–281, 2019. [58] H. Wu, C. Wang, Y. Tyshetskiy, and et al., "Adversarial examples for graph data: Deep insights into attack and defense," in Proceed- ings of the 28th IJCAI. Macao, China: ijcai.org, 2019, pp. 4816–4823. [59] K. Allix, T. F. Bissyand ́e, J. Klein, and et al., "Androzoo: Collecting millions of android apps for the research community," in Proceed- 16 IEEE TRANSACTIONS ON DEPENDABLE AND SECURE COMPUTING, VOL. XX, NO. X, AUGUST 2023 ings of International Conference on MSR. NY, USA: ACM, 2016, pp. 468–471. [60] H. Sistemas. (2021, May) Virustotal. [Online]. Available: https://www.virustotal.com [61] F. Pellegatta. (2021, May) Aamo: Another android malware obfuscator. [Online]. Available: https://github.com/necst/aamo [62] S. Aonzo, G. C. Georgiu, L. Verderame, and A. Merlo, "Obfuscapk: An open-source black-box obfuscation tool for android apps," SoftwareX, vol. 11, p. 100403, 2020. [63] J. Jung, C. Jeon, M. Wolotsky, I. Yun, and T. Kim, "AVPASS: Leak- ing and Bypassing Antivirus Detection Model Automatically," in Black Hat USA Briefings (Black Hat USA), Las Vegas, NV, Jul. 2017. [64] Quarkslab. (2021, May) Lief: library for instrumenting executable files. [Online]. Available: https://ibotpeaches.github.io/Apktool [65] A. Desnos. (2020, February) Androguard @ONLINE. [Online]. Available: https://github.com/androguard/androguard [66] K. Grosse, P. Manoharan, N. Papernot, and et al., "On the (statistical) detection of adversarial examples," CoRR, vol. abs/1702.06280, 2017. [67] K. H. Brodersen, C. S. Ong, K. E. Stephan, and J. M. Buhmann, "The balanced accuracy and its posterior distribution," in 2010 20th International Conference on Pattern Recognition. Istanbul, Turkey: IEEE Computer Society, 2010, pp. 3121–3124. [68] C. Tumbleson. (2018, May) Apktool. [Online]. Available: https://ibotpeaches.github.io/Apktool [69] M. Ficco, "Malware analysis by combining multiple detectors and observation windows," IEEE Trans. Computers, vol. 71, no. 6, pp. 1276–1290, 2022. [70] C. Smutz and A. Stavrou, "When a tree falls: Using diversity in ensemble classifiers to identify evasion in malware detectors." in NDSS, 2016. [71] C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger, "On calibration of modern neural networks," in Proceedings of the 34th ICML, vol. 70. Sydney, Australia: PMLR, 2017, pp. 1321–1330. [72] D. Li, R. Baral, T. Li, and et al., "Hashtran-dnn: A framework for enhancing robustness of deep neural networks against adversarial malware samples," arXiv preprint arXiv:1809.06498, 2018. [73] H. Li, S. Zhou, W. Yuan, and et al., "Robust android malware detection against adversarial example attacks," in WWW '21: The Web Conference 2021. Virtual Event: ACM, 2021, pp. 3603–3612. [74] Y. Wang, D. Zou, J. Yi, and et al., "Improving adversarial robust- ness requires revisiting misclassified examples," in 8th ICLR, Addis Ababa, Ethiopia, April 26-30. OpenReview.net, 2020. [75] T. Bai, J. Luo, J. Zhao, and et al., "Recent advances in adversarial training for adversarial robustness," in Proceedings of the IJCAI, Virtual Event, 19-27 August. ijcai.org, 2021, pp. 4312–4321. [76] Y. Xing, Q. Song, and G. Cheng, "On the generalization properties of adversarial training," in The 24th AISTATS, Virtual Event, vol. 130. PMLR, 2021, pp. 505–513. [77] A. Paszke, S. Gross, F. Massa, and et al., "Pytorch: An imperative style, high-performance deep learning library," in NeurIPS. BC, Canada: Curran Associates, Inc., 2019, pp. 8024–8035. [78] F. Ceschin, M. Botacin, G. L ̈uders, and et al., "No need to teach new tricks to old malware: Winning an evasion challenge with xor-based adversarial samples," in Reversing and Offensive-Oriented Trends Symposium. NY, USA: ACM, 2021, p. 13–22. PAD: PRINCIPLED ADVERSARIAL MALWARE DETECTION AGAINST EVASION ATTACKS, D. LI, S. CUI, Y. LI, J. XU, F. XIAO AND S. XU. 17 APPENDIX A THEOREM PROOFS A.1 Notations Table 6 summarizes the notations for improving the read- ability of the proofs. A.2 Proposition 1 Proposition. Given continuous function F , and continuous and convex distance C(*, x) = max{0, ψθ(*) − τ } with x ∼ P, the dual problem of Ex(cid:48)∼P(cid:48) F(θ, x(cid:48), 1) is max P(cid:48):W (P(cid:48),P)≤0 (cid:110) Ex∼P max δx (F(θ, x + δx, 1) − λψθ(x + δx) + λτ ) : λ ≥ 0 inf λ where x + δx ∈ X , ψθ(x + δx) ≥ τ and W (P(cid:48), P) := inf Γ {(cid:82) C(x(cid:48), x)dΓ(x(cid:48), x) : Γ ∈ (cid:81)(P(cid:48), P)}. , (cid:111) Proof. The proof is adapted from the one presented in [32]. max P(cid:48):W (P(cid:48),P)≤0 Ex(cid:48)∼P(cid:48) F(θ, x(cid:48), 1) = max P(cid:48):W (P(cid:48),P)≤0 inf λ≥0 {Ex(cid:48)∼P(cid:48) [F(θ, x(cid:48), 1)] − λW (P(cid:48), P)} 1 = inf λ≥0 = inf λ≥0 ≤ inf λ≥0 max P(cid:48):W (P(cid:48),P)≤0 max Γ:W (P(cid:48),P)≤0 (cid:26) (cid:20) Ex∼P max x(cid:48) {Ex(cid:48)∼P(cid:48) [F(θ, x(cid:48), 1)] − λW (P(cid:48), P)} (cid:8)E(x(cid:48),x)∼Γ [F(θ, x(cid:48), 1) − λC(x(cid:48), x)](cid:9) (F(θ, x(cid:48), 1) − λC(x(cid:48), x)) (cid:21)(cid:27) , where 1 holds because of Slater's condition. Recall that x(cid:48) is perturbed from x, this constraint leads to max W (P(cid:48),P)≤0 (cid:8)E(x(cid:48),x)∼Γ [F(θ, x(cid:48), 1) − λC(x(cid:48), x)](cid:9) (cid:26) ≥Ex∼P max P(cid:48):W (P(cid:48),P)≤0 (cid:2)Ex(cid:48)∼P(cid:48)|P (F(θ, x(cid:48), 1) − λC(x(cid:48), x))(cid:3) (cid:27) ≥Ex∼P (cid:20) max x(cid:48)∈X (F(θ, x(cid:48)(x), 1) − λC(x(cid:48)(x), x)) (cid:21) − ζ, where ζ ≥ 0 exists as the maximum value of a distribution can have measurable distance to its expectation. As ζ is arbitrary, this gives max P(cid:48):W (P(cid:48),P)≤0 (cid:26) Ex(cid:48)∼P(cid:48) F(θ, x(cid:48), 1) (cid:20) = inf λ≥0 Ex∼P max x(cid:48) (F(θ, x(cid:48), 1) − λC(x(cid:48), x)) (cid:21)(cid:27) TABLE 6: Summary of notations Notation z ∈ Z y ∈ Y x ∈ X φ : Z → X φ−1, ̃φ−1 Meaning software sample z ∈ Z in the space Z ground truth label y corresponding to z in the space Y = {0, 1} representation vector in the discrete space X feature extraction φ maps z to x ∈ X exact and approximate inverse feature extrac- tions, respectively φθ : X → Y ML classifier φθ maps x into label space Y f : Z → Y ψθ : X → R malware detector f (*) = φθ(φ(*)) density estimator maps x to a real-value confi- dence score adversary detector g(*) = ψθ(φ(*)) the number of dimensions of data sample x learnable parameters of ML models loss functions for f and g, respectively criterion function for attackers training dataset on Z × Y, i.e., Dz ⊆ Z × Y training dataset on X × Y corresponding to Dz perturbations and adversarial example in the problem space, z(cid:48) = z + δz perturbations and adversarial example x(cid:48) = x+ δx ∈ X , and x∗ being optimal one a unit vector with (cid:107)e(cid:107)p = 1 for p norm positive values serving as penalty factors a point-wise measurement C : X × X → R the underlying distributions of x and x(cid:48), respec- tively Wasserstein distance batch size tth times of T iterations for attacks jth times of N epochs for training learning rate of optimization for training smoothness factors of classification loss w.r.t. input smoothness factor of classification loss w.r.t. pa- rameters smoothness factors of density estimation loss w.r.t. input convexity factor of ψθ g : Z → R n θ, θ F , G J : X → R Dz Dx δz, z(cid:48) δx, x(cid:48), x∗ ep β1, β2, λ C P, P(cid:48) Lf θx xx, Lg Lg xθ Mg xx W p = 1, 2, ∞ (cid:96)p norm types B t, T j, N γ xx, Lf Lf xθ Lemma 1. Given an instance-label pair (x, y) with perturbation ∀δ(t1) x ∈ [u − x, u − x] with 0 ≤ t1 < t2 ≤ T . We have x , δ(t2) J (x(t2)) − J (x(t1)) ≤ 1/2 xx − Lf xx λMg (cid:13) (cid:13) 2 (cid:13)∇xJ (x(t1)) (cid:13) (cid:13) (cid:13) 2 where x(t1) = x + δ(t1) x and x(t2) = x + δ(t2) x . (cid:26) Ex∼P (cid:20) max x(cid:48) = inf λ≥0 (F(θ, x(cid:48), 1) − λψθ(x(cid:48)) + λτ ) (cid:21)(cid:27) , Based on Proposition 2, we have which leads to the proposition. J (x(t2)) − J (x(t1)) A.3 Theorem 1 Theorem. Suppose the smoothness assumption holds. When Lf xx < λMg from Algorithm 1 satisfies: xx, the perturbed sample x(cid:48) = x + δ(T ) x J (x∗) − J (x(cid:48)) J (x∗) − J (x) ≤ exp(− T d * λMg λLg xx − Lf xx xx + Lf xx ), where d is the dimension and J (x) = F(θ, x, y) − λψθ(x). Proof. We first present the following lemma: ≤(cid:104)∇xJ (x(t1)), x(t2) − x(t1)(cid:105) − ∇xJ (x(t1)), a − x(t1)(cid:69) (cid:18)(cid:68) ≤ max a∈[u,u] − λMg xx − Lf xx 2 xx − Lf λMg xx 2 (cid:107)x(t2) − x(t1)(cid:107)2 2 (cid:19) (cid:107)a − x(t1)(cid:107)2 2 Let a − x(t1) follow the same direction as ∇xJ . We obtain (cid:13) (cid:13) 2 1/2 (cid:13)∇xJ (x(t1)) (cid:13) (cid:13) at the point a = the maximum (cid:13) xx−Lf 2 xx x(t1) −1/(Lf xx)∇xJ (x(t1)). This leads to the lemma. Further, let p (p = 1, 2, ∞) norm correspond to its dual ver- sion q (q = ∞, 2, 1). Considering two adjacent perturbations λMg xx −λMg with 0 ≤ t < T , we can derive: We additionally make an assumption of bounded gradi- IEEE TRANSACTIONS ON DEPENDABLE AND SECURE COMPUTING, VOL. XX, NO. X, AUGUST 2023 18 δ(t) x and δ(t+1) J (x + δ(t+1) x x ≥(cid:104)∇xJ (x + δ(t) )) − J (x + δ(t) x ) x )), αpep(cid:105) − α2 p λLg λLg xx + Lf xx 2 xx + Lf xx 2 =αp(cid:107)∇xJ (x + δ(t) x )(cid:107)q − α2 p By plugging in αp = we have (cid:107)∇xJ (x + δ(t) xx + Lf xx λLg x )(cid:107)q , )) − J (x + δ(t) x ) (cid:13) (cid:13)∇xJ (x + δ(t) (cid:13) x ) (cid:13) 2 (cid:13) (cid:13) q (cid:13) (cid:13)∇xJ (x + δ(t) (cid:13) x ) (cid:13) 2 (cid:13) (cid:13) 2 x J (x + δ(t+1) 1 xx + 2Lf xx 1 2λLg 2dλLg λMg dλLg xx + 2dLf xx xx − Lf xx xx + dLf xx ≥ 2 ≥ 3 ≥ (cid:0)J (x + δ∗ x )(cid:1) x) − J (x + δ(t) √ d(cid:107) * (cid:107)∞ ≥ (cid:107) * (cid:107)2 and where 2 holds because of inequalities (cid:107) * (cid:107)1 ≥ (cid:107) * (cid:107)2 on vector norms. 3 holds because of Lemma 1, while noting that the value of αp is not always held. Nevertheless, for any αp, we can derive certain theoretical results according to (cid:107)∇xJ (x + δ(t) x )(cid:107)q, but decreasing the elegance of formulation. Furthermore, we have J (x + δ(t+1) x (cid:16) x) − J (x + δ(t) J (x + δ∗ x ) ) − J (x + δ(t) x ) (cid:16) (cid:17) − J (x + δ∗ x) − J (x + δ(t+1) x λMg dλLg xx − Lf xx xx + dLf xx (cid:0)J (x + δ∗ x) − J (x + δ(t) x )(cid:1). = ≥ By re-organizing the preceding inequality, we obtain the gap between the optimal attack and the approximate one: J (x∗) − J (x(cid:48)) = J (x + δ∗ (cid:16) ≤ J (x + δ∗ x) − J (x + δ(T −1) x (cid:32) x) − J (x + δ(T ) x ) λMg dλLg (cid:17) ) 1 − xx − Lf xx xx + dLf xx (cid:33) ≤ * * * (cid:16) ≤ J (x + δ∗ x) − J (x + δ(0) x ) (cid:17) ≤(J (x∗) − J (x)) exp(− T d * This leads to the theorem. (cid:33)T xx − Lf xx xx + dLf xx (cid:32) 1 − λMg dλLg xx − Lf xx xx + Lf xx λMg λLg ). ents for SGD [33]. Assumption 2 (Boundness assumption [32]). The variance of stochastic gradients is bounded by a constant ζ 2 > 0 where E((cid:107)∇h(θ) − ∇H(θ)(cid:107)2 2) ≤ ζ 2. We first show H is smooth and then prove the SGD convergence under the approximate attack. Recall that Lf θx and Lf θθ denote the Lipschitz contant of ∇θ F(θ, x, y) w.r.t x and θ, respectively. Lemma 2. Let assumption 1 hold. Then, E(x,y)∈Dx F(θ, x∗, y) xθ+Lf is L-smooth, where L = Lf xx−Lf xx θx(λLg λMg + Lf θθ. xθ) Proof. Given any two sets of parameters θ1, θ2, we have: (cid:13)E(x,y)∈Dx [∇θ F(θ2, x∗(θ2), y) − ∇θ F(θ1, x∗(θ1), y)](cid:13) (cid:13) (cid:13)2 ≤E(x,y)∈Dx (cid:107)∇θ F(θ2, x∗(θ2), y) − ∇θ F(θ1, x∗(θ1), y)(cid:107)2 ≤E(x,y)∈Dx (cid:107)∇θ F(θ2, x∗(θ2), y) − ∇θ F(θ2, x∗(θ1), y)(cid:107)2 + E(x,y)∈Dx (cid:107)∇θ F(θ2, x∗(θ1), y) − ∇θ F(θ1, x∗(θ1), y)(cid:107)2 θx(cid:107)x∗(θ2) − x∗(θ1)(cid:107)2 + Lf (14) θθ(cid:107)θ1 − θ2(cid:107)2. ≤Lf The first and second inequalities hold because of the triangle inequality. Suppose J is parameterized by θ2, say Jθ2 , due to its concavity, we derive Jθ2 (x∗(θ2)) − Jθ2 (x∗(θ1)) ≤ (cid:10)∇xJθ2 (x∗(θ1)), x∗(θ2) − x∗(θ1)(cid:11) − λMg xx − Lf xx 2 (cid:107)x∗(θ2) − x∗(θ1)(cid:107)2 2; (cid:17) ) λMg xx − Lf xx 2 (cid:107)x∗(θ2) − x∗(θ1)(cid:107)2 2 ≤ Jθ2 (x∗(θ2)) − Jθ2 (x∗(θ1)). By combining the two inequalities, we obtain: (λMg xx − Lxx)(cid:107)x∗(θ2) − x∗(θ1)(cid:107)2 2 ≤(cid:104)∇xJθ2 (x∗(θ1)), x∗(θ2) − x∗(θ1)(cid:105) 4 ≤ (cid:104)∇xJθ2 (x∗(θ1)) − ∇xJθ1(x∗(θ1)), x∗(θ2) − x∗(θ1)(cid:105) 5 ≤ (cid:107)∇xJθ2 (x∗(θ1)) − ∇xJθ1(x∗(θ1))(cid:107)2 (cid:107)x∗(θ2) − x∗(θ1)(cid:107)2 6 ≤(Lf xθ) (cid:107)θ1 − θ2(cid:107)2 (cid:107)x∗(θ2) − x∗(θ1)(cid:107)2 where 4 holds as (cid:104)∇xJθ1(x∗(θ1)), x∗(θ2) − x∗(θ1)(cid:105) ≤ 0, 5 holds because of the Cauchy-Schwarz inequality, and 6 holds as Jθ2 is (Lf xθ)-smooth. Combining Eq.(14) and Eq.(15) leads to xθ + λLg xθ +λLg (15) (cid:107)∇H(θ1) − ∇H(θ2)(cid:107)2 (cid:107)θ1 − θ2(cid:107)2 ≤ (cid:18) Lf θx(λLg λMg xθ + Lf xx − Lf xx xθ) (cid:19) . + Lf θθ i=1, let h(θ) = 1 B A.4 Theorem 2 Let H(θ) = E(x,y)∈Dx F(θ, x∗(θ), y) denote the objective on the entire training dataset Dx. Given a batch of training data samples {(xi, yi)}B i , yi) de- note the mean classification loss on a batch of optimal adver- sarial examples. This implies that x∗ is perturbed from x sat- isfying (cid:104)∇xJ (x∗), x(cid:48) − x∗(cid:105) ≤ 0 with x(cid:48) near to x∗. Indeed, the parameter θ is updated by θ(j+1) = θ(j) − γ(j)∇ˆh(θ(j)), (cid:80)B where ˆh(θ(j)) = 1 i) on perturbed examples, B and γ(j) is the learning rate at jth iteration. i=1 F(θ(j), x(cid:48) i=1 F(θ, x∗ (cid:80)B Theorem. Let ∆ = H(θ(0)) − minθ H(θ). Under Assumption 1 and Assumption 2, if we set the learning rate to γ(j) = γ = minimum(1/L, (cid:112)∆/(Lζ 2N ), the adversarial training satisfies 1 N N (cid:88) j=0 E (cid:13) (cid:13)∇H(θ(j)) (cid:13) (cid:13) (cid:13) (cid:13) ≤ ζ (cid:114) 8 ∆L N + 2ˆc, (16) where N is the epochs (i.e., the total iterations of SGD), and ˆc = exp( T (J (x∗) − J (x)) d ) is a constant. Lf xx−λMg xx+Lf λLg xx 2Lf θx xx−Lf xx λMg xx PAD: PRINCIPLED ADVERSARIAL MALWARE DETECTION AGAINST EVASION ATTACKS, D. LI, S. CUI, Y. LI, J. XU, F. XIAO AND S. XU. 19 Proof. Inspired [32], we derive the following at the jth itera- tion: H(θ(j+1)) ≤H(θ(j)) + (cid:104)∇H(θ(j)), θ(j+1) − θ(j)(cid:105) + L 2 (cid:107)θ(j+1) − θ(j)(cid:107)2 2 =H(θ(j)) + γ(cid:104)∇H(θ(j)), ∇H(θ(j)) − ∇ˆh(θ(j))(cid:105) Lγ2 (cid:107)∇ˆh(θ(j))(cid:107)2 2 2 (cid:69) ∇H(θ(j)), ∇H(θ(j)) − ∇ˆh(θ(j)) =H(θ(j)) + (γ − Lγ2) − γ(cid:107)∇H(θ(j))(cid:107)2 2 + (cid:68) + Lγ2 2 − (γ − (cid:107)∇ˆh(θ(j)) − ∇H(θ(j))(cid:107)2 2 Lγ2 2 )(cid:107)∇H(θ(j))(cid:107)2 2 =H(θ(j)) + (γ − Lγ2) (cid:68) (cid:69) ∇H(θ(j)), ∇H(θ(j)) − ∇h(θ(j)) + Lγ2(cid:107)∇h(θ(j)) − ∇H(θ(j))(cid:107)2 γ 2 (cid:107)∇h(θ(j)) − ∇ˆh(θ(j))(cid:107)2 2. 2 − + γ + Lγ2 2 (cid:107)∇H(θ(j))(cid:107)2 2 } TelephonyManager telecom = // default ; String str = ""; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { str = telephonyMgr.getImei(); } else { str = telecom.getDeviceId(); } SmsManager smgr = SmsManager.getDefault(); smgr.sendTextMessage("97605", null, str, null, null); Listing 1: Sending sensitive information via SMS 1 if (False){ try { ConnectivityManager cmgr = null; NetworkInfo anet = cmgr.getActiveNetworkInfo(); } catch (Exception e) {} Listing 2: API insertion Taking conditional expectations of H(θ(j+1)) − H(θ(j)) on θ(j) and using E(∇h(θ(j))) = H(θ(j)), we have String mtd_name = "sendTextMessage"; Method send_sms = null; send_sms = 2 E(H(θ(j+1)) − H(θ(j))|θ(j)) ≤ − E((cid:107)∇H(θ(j))(cid:107)2 2) γ 2 (cid:107)∇h(θ(j)) − ∇ˆh(θ(j))(cid:107)2 2. +Lγ2ζ 2 + γ + Lγ2 2 Furthermore, we derive (cid:107)∇h(θ(j)) − ∇ˆh(θ(j))(cid:107)2 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) ∇θ F(θ(j), x(cid:48) B (cid:88) 1 B i=1 = i, yi) − 1 B B (cid:88) i=1 ∇θ F(θ(j), x∗ 2 (cid:13) (cid:13) (cid:13) i , yi) (cid:13) (cid:13) 2 ≤ ≤ ≤ 1 B 1 B 1 B B (cid:88) i=1 B (cid:88) i=1 B (cid:88) i=1 (cid:13) (cid:13)∇θ F(θ(j), x(cid:48) (cid:13) i, yi) − ∇θ F(θ(j), x∗ (cid:13) 2 (cid:13) i , yi) (cid:13) 2 Lf θx(cid:107)x(cid:48) i − x∗ i (cid:107)2 2 2Lf θx xx − Lxx λMg (J (x∗ i ) − J (x(cid:48) i)) ≤(J (x∗ i ) − J (xi)) 2Lf θx xx − Lf xx λMg exp( T d xx − λMg Lf xx xx + λLg Lf xx ) = ˆc. Plugging the preceding inequities into Ineq.(17) and taking telescope sum of it over j = 0, . . . , N − 1, we obtain 1 N N −1 (cid:88) j=0 E((cid:107)∇H(θ(j))(cid:107)2 2) ≤ 2 γN E(H(θ(0)) − H(θ(N ))) Using the fact γ ≤ 1 minθ H(θ) = ∆, we have + 2Lγζ 2 + (1 + Lγ)ˆc. L and H(θ(0)) − H(θ(N )) ≤ H(θ(0)) − 1 N N −1 (cid:88) i=0 E((cid:107)∇H(θ(i))(cid:107)2 2) ≤ 2∆ γN + 2Lγζ 2 + 2ˆc (cid:18) 2∆ γN + 2Lγζ 2 + 2ˆc (cid:19) ≤ min γ (cid:114) = ζ 8 ∆L N + 2ˆc, (17) smgr.getClass().getMethod(mtd_name, String.class, String.class, String.class, PendingIntent.class, PendingIntent.class); send_sms.invoke(smgr, "97605", null, str, null, null); Listing 3: API removal Fig. 8: Code snippets for perturbing apps. Manipulation inserts junk codes before sending text messages and 1 manipulation 2 hides the sendTextMessage using Java reflection. where γ = (cid:113) ∆ Lζ2 N . This leads to the theorem. APPENDIX B ADDITIONAL EXPERIMENTAL ANALYSIS B.1 Manipulation Example We show how to manipulate malware examples by conduct- ing perturbations in the feature space. For manifest features, we inject them into the file AndroidManifest.xml by fol- lowing the defined format. For API features, we leverage an example to illustrate the manipulation. Listing 1 shows the malware gets the device ID and then sends sensitive information from the phone to the outside world via SMS. We observe that apps (e.g., the one with md5 checksum 4cc8****f212 and the one with f07d****3b7b) use this pattern to retrieve a user's private information. In order to mislead malware detectors, Listing 2 shows how to inject irrelevant APIs into the code snippet, and Listing 3 hides sendTextMessage using Java reflection, both of which retain the malicious functionality. B.2 Training Time and Test Time We implement the defense models using PyTroch libraries [77] and run experiments on a CUDA-enabled GTX 2080 Ti 20 IEEE TRANSACTIONS ON DEPENDABLE AND SECURE COMPUTING, VOL. XX, NO. X, AUGUST 2023 (a) Drebin (b) Malscan Fig. 9: The cost of training time for defenses. GPU and Intel Xeon W-2133 [email protected]. Figure 9 reports the training time of the defenses. We observe that adversarial training-based defenses take much longer than standard training without involving adversarial examples. This is because searching for perturbations is con- ducted per iteration in standard training. Furthermore, AT- MaxMA and PAD-SMA leverage several attacks to produce adversarial examples and thus require more time. Since PAD-SMA encapsulates not only a malware detector but also an adversary detector, the longest cost is consumed. Furthermore, we report the Mean Test Time to Detection (MTTD) for PAD-SMA. We ignore the other defenses be- cause all models share the same feature extraction method and the ML part runs very fast. Using the Drebin test dataset, MTTD of PAD-SMA is 1.72s using 1 CPU core and 0.52s using 6 CPU cores. Using the Malscan test dataset, MTTD of PAD-SMA is 8.91s using 1 CPU core and 2.79s using 6 CPU cores. Our model may not hit the limit of the user's patience, particularly when multi-core computing is available, because the test time within 5s is reasonable [78]. 0200040006000800010000Cost of training time (S)DNNAT-rFGSMkAT-MaxMADLADNN+ICNNPAD-SMA31106841882872604710569040008000120001600020000Cost of training time (S)DNNAT-rFGSMkAT-MaxMADLADNN+ICNNPAD-SMA32215776051891624819370
http://arxiv.org/abs/2302.12000v2
2023-03-01T12:43:16
2023-02-22T12:02:23
Graph Construction using Principal Axis Trees for Simple Graph Convolution
Graph Neural Networks (GNNs) are increasingly becoming the favorite method for graph learning. They exploit the semi-supervised nature of deep learning, and they bypass computational bottlenecks associated with traditional graph learning methods. In addition to the feature matrix $X$, GNNs need an adjacency matrix $A$ to perform feature propagation. In many cases the adjacency matrix $A$ is missing. We introduce a graph construction scheme that construct the adjacency matrix $A$ using unsupervised and supervised information. Unsupervised information characterize the neighborhood around points. We used Principal Axis trees (PA-trees) as a source of unsupervised information, where we create edges between points falling onto the same leaf node. For supervised information, we used the concept of penalty and intrinsic graphs. A penalty graph connects points with different class labels, whereas intrinsic graph connects points with the same class label. We used the penalty and intrinsic graphs to remove or add edges to the graph constructed via PA-tree. This graph construction scheme was tested on two well-known GNNs: 1) Graph Convolutional Network (GCN) and 2) Simple Graph Convolution (SGC). The experiments show that it is better to use SGC because it is faster and delivers better or the same results as GCN. We also test the effect of oversmoothing on both GCN and SGC. We found out that the level of smoothing has to be selected carefully for SGC to avoid oversmoothing.
[ "Mashaan Alshammari", "John Stavrakakis", "Adel F. Ahmed", "Masahiro Takatsuka" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12000v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12000v2", "@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.IR", "cs.NE" ]
3 2 0 2 r a M 1 ] G L . s c [ 2 v 0 0 0 2 1 . 2 0 3 2 : v i X r a Graph Construction using Principal Axis Trees for Simple Graph Convolution Mashaan Alshammaria,∗, John Stavrakakisb, Adel F. Ahmedc, Masahiro Takatsukab aIndependent Researcher, Riyadh, Saudi Arabia bSchool of Computer Science, The University of Sydney, NSW 2006, Australia cInformation and Computer Science Department, King Fahd University of Petroleum and Minerals, Dhahran, Saudi Arabia Abstract Graph Neural Networks (GNNs) are increasingly becoming the favorite method for graph learning. They exploit the semi-supervised nature of deep learning, and they bypass computational bottlenecks associated with traditional graph learning methods. In addition to the feature matrix X, GNNs need an adja- cency matrix A to perform feature propagation. In many cases the adjacency matrix A is missing. We introduce a graph construction scheme that construct the adjacency matrix A using unsupervised and supervised information. Un- supervised information characterize the neighborhood around points. We used Principal Axis trees (PA-trees) as a source of unsupervised information, where we create edges between points falling onto the same leaf node. For supervised information, we used the concept of penalty and intrinsic graphs. A penalty graph connects points with different class labels, whereas intrinsic graph con- nects points with the same class label. We used the penalty and intrinsic graphs to remove or add edges to the graph constructed via PA-tree. This graph con- struction scheme was tested on two well-known GNNs: 1) Graph Convolutional Network (GCN) and 2) Simple Graph Convolution (SGC). The experiments show that it is better to use SGC because it is faster and delivers better or the same results as GCN. We also test the effect of oversmoothing on both GCN and SGC. We found out that the level of smoothing has to be selected carefully for SGC to avoid oversmoothing. Keywords: Deep learning, Graph convolutional networks, Simple Graph Convolution, Binary Space-Partitioning Trees ∗Corresponding author. Email addresses: [email protected] (Mashaan Alshammari ), [email protected] (John Stavrakakis), [email protected] (Adel F. Ahmed), [email protected] (Masahiro Takatsuka) Preprint submitted to Expert Systems with Applications March 2, 2023 1. Introduction Graph representation learning methods have gained popularity in recent years. The reason was the simplicity of modelling most of machine learning prob- lems using graph representation. Given a set of samples X with {x1, x2, * * * , xn}, one could construct a graph G(V, E), where the set V contains the feature vec- tors as graph vertices. The set E holds the relations between feature vectors represented as graph edges Hart et al. (2000). Graph Neural Network (GNNs) is one of the most effective schemes for graph representation learning. It has been applied to sentiment analysis Zhou et al. (2020); Liang et al. (2021); Phan et al. (2022) and computer vision tasks Qi et al. (2021); Zhang et al. (2022); Jia et al. (2022). The idea of designing a deep network for graph representation learning has come through multiple iterations Hammond et al. (2011); Bruna et al. (2013); Henaff et al. (2015); Defferrard et al. (2016). One of the well-known GNN meth- ods is Graph Convolutional Networks (GCN) Kipf & Welling (2017). Through- out the hidden layers, GCN performs feature propagation between neighbors on the graph, then a nonlinear transformation of the graph is passed to the next layer. The last layer in GCN was set as a softmax function to produce the labels on graph vertices. Simple Graph Convolution (SGC) was proposed by Wu et al. Wu et al. (2019) where they remove the nonlinearity between the layers. This means stacking K hidden layers is a matrix multiplication between the feature matrix X and the adjacency matrix A for K times. GCN and SGC both cannot create or modify graph edges, which means the graph has to be constructed before running GCN or SGC. There are methods to modify the adjacency matrix A to achieve higher accuracy Franceschi et al. (2019) or to improve robustness against attacks Jin et al. (2020). The prob- lem is, these methods only work with GCN, because they need the transition between the hidden layers to perform adjacency matrix optimization. Since this transition is absent in SGC and replaced by matrix multiplication, these adjacency optimization methods are not compatible with SGC. 2 We propose a new graph construction scheme based on unsupervised and su- pervised information. The proposed scheme works with GCN and SGC. For un- supervised graph edges creation, we used Principal Axis trees (PA-trees) Sproull (1991); McNames (2001), which is one type of Binary Space Partitioning trees (BSP-trees) Ram & Gray (2013). We also used supervised information to cre- ate graph edges. The field of dimensionality reduction introduced the concept of penalty and intrinsic graph. We used this concept to create edges from the training data Yan et al. (2007). Both unsupervised and supervised information were blended in one adjacency matrix and processed by either GCN or SGC. Our contributions can be summarized as the following: • The proposed graph construction scheme uses Principal Axis trees (PA- trees) to highlight the density in the dataset. It also utilizes the training data to characterize intraclass compactness and interclass separability. • We studied the effect of smoothing on GCN and SGC using the proposed graph construction. Our results provide an empirical evidence that SGC is more vulnerable to oversmoothing than GCN. This supports the findings presented in Zhao & Akoglu (2019); Yang et al. (2020). 2. Related work The learning task on graphs consists of two components: graph construction and learning algorithm. This study focuses on learning algorithms using deep learning. The next subsection introduces Graph Convolutional Network (GCN), while the following subsection discusses graph construction methods. 2.1. Graph Convolutional Network (GCN) Performing learning tasks on graphs is one of the long-studied problems in machine learning literature. One of the oldest methods in this field is spectral clustering Shi & Malik (1997); Weiss (1999); Shi & Malik (2000); Ng et al. (2001); von Luxburg (2007). Given a set of samples X with {x1, x2, * * * , xn}, spec- tral clustering method starts by constructing the adjacency matrix A ∈ Rn×n 3 using some pairwise similarity metric and the degree matrix Dii = (cid:80) j Aij. Then, eigen decomposition step is performed on the graph Laplacian L = D−1/2AD−1/2 to map the points into an embedding space. In that space, sim- ilar points fall closer to each other and can be detected using k-means. The biggest hurdle for spectral clustering is decomposing an n × n adjacency matrix, which can be prohibitive with large datasets Defferrard et al. (2016); Shaham et al. (2018). The superiority of spectral clustering comes from the mapping function. So, the question in the literature was: can we learn this mapping function instead of computing it through eigen decomposition. Designing a deep network that learns new representations of the feature vectors {x1, x2, * * * , xn}, can replace the deterministic mapping function in spectral clustering. The connectivity of the graph G is encoded in the graph Laplacian L, and the graph Laplacian eigenvectors define the graph Fourier transform Shuman et al. (2013). Finding the new representation of a feature vector x is done by performing the convolution between the input signal x with a filter g ∈ Rn Wu et al. (2021): x ∗G g = U (U (cid:62)x (cid:12) U (cid:62)g), (1) where U is the matrix of the eigenvectors of the graph Laplacian and (cid:12) is the elementwise product. If we set the filter gθ as diag(U (cid:62)g), then the formula in equation 1 can be rewritten as: x ∗G gθ = U gθU (cid:62)x. (2) One of the earliest studies in this field was done by Bruna et al Bruna et al. (2013), where they designed a convolutional net that operates on the spectrum of the input features. However, their approach still needs the expensive eigen decomposition step with complexity O(n3). The new direction of research was to approximate the filter gθ using Chebyshev polynomials. This idea has came through a series of refinements by different studies Defferrard et al. (2016); 4 Henaff et al. (2015). Graph convolutional network (GCN) introduces a first order approximation of Chebyshev polynomials. Approximating graph convo- lutions using Chebyshev polynomials takes the following form: x ∗G gθ = K (cid:88) i=0 θiTi( ̃L)x, (3) where ̃L = 2L λmax − In. The Chebyshev polynomials are defined recursively as: Ti(x) = 2xTi−1(x) − Ti−2(x) with T0(x) = 1 and T1(x) = x. GCN assumes that K = 1 and λmax = 2, therefore equation 3 is simplified as: x ∗G gθ = θ0x − θ1D−1/2AD−1/2x. (4) GCN further assumes that θ = θ0 = −θ1, which leads to a simpler definition of graph convolution: x ∗G gθ = θ(In + D−1/2AD−1/2)x. GCN is a multilayer network where a single layer is defined as: H = X ∗G gΘ = f ( ̄AXΘ), (5) (6) where ̄A = ̃D−1/2 ̃A ̃D−1/2 with self loops added to the adjacency ̃A = A + In. f (*) is the activation function which was set as ReLU (x) = max(0, x) for the hidden layers and sof tmax(x) for the last layer. A modification to GCN was introduced as Simple Graph Convolution (SGC) Wu et al. (2019). SGC removes the nonlinearity between GCN layers. In SGC, the learned representations ˆY of the input feature vectors X is defined as: ˆY = sof tmax( ̄A * * * ̄A ̄AXΘ(1)Θ(2) * * * Θ(K)), (7) where K is the number of layers. Let ̄AK denote the repeated multiplication of the adjacency matrix and Θ = Θ(1)Θ(2) * * * Θ(K). Then, equation 7 can be 5 rewritten as: ˆY = sof tmax( ̄AKXΘ). (8) Given this definition, SGC brought down the computations in the hidden layers to a pre-processing step with no weights needed ̄X = ̄AKX. The final layer becomes a linear logistic regression classifier ˆY = sof tmax( ̄XΘ). 2.2. Graph construction The methods introduced in the previous section need an adjacency matrix A to work on. For many applications adjacency matrix A is not present and has to be derived from the feature vectors. It is important to mention some studies that perform adjacency matrix modifications while training the GCN. Franceschi et al. Franceschi et al. (2019) designed a framework to modify the adjacency matrix to improve the performance of GCN. Jin et al. Jin et al. (2020) modified the adjacency matrix to prevent malicious attacks from compromising the learning algorithm. These methods use alternating optimization schema to update θ and A. They are not compatible with SGC, because SGC computes the hidden layers as a pre-processing step with no weights optimization. Constructing the adjacency matrix A involves identifying similar points and creating an edge linking them. In its simplest form, the adjacency matrix A can be constructed using the Euclidean distance: Aij = exp (cid:18) −d2 (i, j) σ (cid:19) , (9) where σ is a global scale set manually. Points separated by a small Euclidean distance are linked by an edge with large weight. There are two problems associated with constructing the adjacency matrix using the formula in equation 9 (Gaussian similarity): 1) the tuning of the parameter σ and 2) the resulting adjacency matrix is not sparse. Binary space-partitioning trees (BSP-trees) are very useful to define a hier- archical structure of the dataset Ram & Gray (2013). As we go deeper down a BSP-tree, the relevant neighborhood around the point x is narrowed down. 6 One of the famous BSP-trees is the principal-axis tree (PA-tree) Sproull (1991); McNames (2001). A PA-tree splits the feature vectors at the median along the first principal component. Constructing the adjacency matrix A from PA-tree can be done by creating edges linking the points that fall into the same leaf node. Defining similarity between points using binary space-partitioning trees was implemented for spectral clustering Yan et al. (2019); Wang et al. (2019). Graph construction using binary space-partitioning trees (BSP-trees) is done in an unsupervised way. Studies in the field of dimensionality reduction have constructed the graph using supervised information. Yan et al, Yan et al. (2007) proposed the concept of penalty and intrinsic graphs. Edges in the penalty graph Gp connect points from different classes. These edges were used to characterize the interclass separability. For intraclass compactness, they used the intrinsic graph Gi that connects points from the same class. From the review introduced in this section, we can identify three conditions for the graph G to be passed to a deep network. First, it has to work with both GCN and SGC, regardless of the fact that SGC skips the nonlinearity between the hidden layers. Second, most of the graph edges have to be constructed in an unsupervised manner. Finally, the construction scheme must use the training samples to add edges to the graph or remove edges that link samples from different classes. 3. Graph construction for GCN and SGC Our proposed graph construction method passes through two stages: 1) constructing graph edges using unsupervised information, and 2) add/remove edges from the graph based on supervised information. The next subsections introduce the problem statement followed by graph construction stages. 3.1. Problem statement The task of the proposed method is to perform node classification on the graph using two types of Graph Neural Networks (GNNs): GCN and SGC. 7 (a) input features (b) PA-tree graph GP A Figure 1: A graph constructed using principal Axis trees (PA-trees); (a) original feature matrix with three classes; (b) the graph obtained by connecting the points falling onto the same leaf node in a PA-tree. (Best viewed in color) There are some notations to be introduced before we present the problem state- ment. Let G = (V, E) be a graph where V is the set of vertices and E is the set of edges. Graph edges describe the similarity between each pair of points and represented by the adjacency matrix A ∈ Rn×n. The feature ma- trix X = {x1, x2, * * * , xn} ∈ Rn×d, where xi is the feature vector for the node vi. The graph G can be represented using the adjacency and feature matri- ces G = (A, X). In a node classification problem, only a subset of nodes Vl = {v1, v2, * * * , vl} have known class labels Yl = {y1, y2, * * * , yl}. The goal for a GNN is to learn a function fθ : Vl → Yl that maps nodes to their corre- sponding labels, then it can uncover the labels for unseen data. With the introduction of these notations, the problem can be stated as fol- lows: Given a feature matrix X and partial node label Yl in absence of the adjacency matrix A, construct A using a PA-tree, add/remove edges using penalty graph Gp and intrinsic graph Gi, then run GNN to perform node classification. 3.2. Constructing a graph using unsupervised information from PA-trees Binary Space Partitioning trees (BSP-trees) provide a hierarchical view for the input points. Principal Axis trees (PA-trees) are one type of BSP-trees, where they split the points at the median of the first principal component. We 8 (a) input features (b) penalty graph Gp (c) intrinsic graph Gi Figure 2: Constructing penalty and intrinsic graphs using training data; (a) original feature matrix with three classes; (b) the penalty graph connecting samples from different classes; (c) the intrinsic graph connecting samples from the same class. (Best viewed in color) created edges from PA-trees by connecting the points falling into the same leaf node: (xi, xj) ∈ EP A ⇔ xi ∈ W and xj ∈ W, (10) where W is a leaf node. One parameter that influence this process is the bucket size, which is the minimum number of points allowed in a leaf node to stop splitting. For small and mid-size datasets we set the bucket size to 20, the same setting was used by Yan et al. (2018, 2021). For large datasets we set the bucket size to 100. Figure 1 shows an example of constructing a graph using PA-trees. All points falling onto the same leaf node were fully connected. The points in the orange class that represents the smile, were split into two different tree branches. This can be explained by the position of this class. It stretches along the first principal component, and splitting at the median will break this class. This observation shows the importance of using supervised information to fill in these gaps created by unsupervised construction of the graph. 3.3. Constructing penalty and intrinsic graphs from the training data From the graph shown in Figure 1, it is evident that unsupervised infor- mation cannot capture the high-level relationships between classes. We have to use the training feature vectors to capture these high-level relationships between classes. Yan et al. Yan et al. (2007) presented a framework to construct edges 9 Algorithm 1: Graph construction for GCN and SGC Input: feature matrix X, partial labels Yl, and leaf node bucket size. Output: adjacency matrix A. 1 Construct a PA-tree using the samples in X 2 Construct a PA-tree graph: (xi, xj) ∈ EP A ⇔ xi ∈ W and xj ∈ W 3 Construct a penalty graph using Yl: (xi, xj) ∈ Ep ⇔ yi (cid:54)= yj 4 Construct an intrinsic graph using Yl: (xi, xj) ∈ Ei ⇔ yi = yj 5 Add edges in the intrinsic graph Gi to the PA-tree graph GP A: A = AP A + Ai 6 Remove edges in the penalty graph Gp from the final graph: A = A − Ap from the training feature vectors. They constructed two graphs, a penalty graph Gp (Figure 2-b) with edges connecting samples from different classes. This graph characterizes the interclass separability and defined as: (xi, xj) ∈ Ep ⇔ yi (cid:54)= yj, (11) where yi and yj are the class labels for the feature vectors xi and xj respectively. The second graph is the intrinsic graph Gi (Figure 2-c) which connects sam- ples from the same class to identify the intraclass compactness. The intrinsic graph Gi is defined as: (xi, xj) ∈ Ei ⇔ yi = yj. (12) The final adjacency matrix that was passed to GCN and SGC is the result of refining the graph produced by the PA-tree GP A. All edges in the penalty graph Gp should be removed from the PA-tree graph GP A. Also, all edges in the intrinsic graph Gi are added to the PA-tree graph GP A. The pseudocode in Algorithm 1 shows the steps of our graph construction method. 4. Experiments and discussions We designed the experiments to test the efficiency of the proposed graph construction scheme. We also examined different settings that have a mas- 10 mid-size datasets larg-size datasets small-size datasets N d 2 2 wine 2 BC-Wisc. digits 2 Dataset 1 Dataset 2 Dataset 3 Dataset 4 266 399 622 788 iris N 150 178 569 1797 d 4 Olivetti 13 PenDigits 30 mGamma credit card 64 N 400 10992 19020 30000 d 4096 16 10 24 Table 1: Properties of tested datasets. N = number of samples, d = number of features. (a) Dataset 1 (b) Dataset 2 (c) Dataset 3 (d) Dataset 4 Figure 3: small-size datasets used in the experiments; from left to right Dataset 1 to Dataset 4; source: Zelnik-Manor & Perona (2004); Fr ̈anti & Sieranoja (2018). (Best viewed in color) Figure 4: Accuracy scores for SGC and GCN using different datasets; (top row) small-size datasets where each box represents 50 runs; (middle row) mid-size datasets where each box represents 50 runs; (bottom row) large-size datasets where each box represents 10 runs. (Best viewed in color) 11 (a) small-size datasets (b) mid-size datasets (c) large-size datasets Figure 5: GCN and SGC training time. (Best viewed in color) sive influence over the learning algorithm. These settings include the level of smoothing used in GCN and SGC and the number of trees used to construct the graph. All the datasets used in the experiments are available publicly. Some datasets were retrieved from scikit-learn library Pedregosa et al. (2011); Buitinck et al. (2013), others were downloaded from public repositories. Table 1 shows the properties of the datasets and their sources. All experiments were coded in python 3, and can be found on the following GitHub repository https:// github.com/mashaan14/PAtree-SGC. Here are the properties of the machine used in the experiments: a Windows 11 machine with 20 GB of memory and a 3.10 GHz Intel Core i5-10500 CPU. 4.1. Testing the accuracy of GCN and SGC The results for testing the accuracy of GCN and SGC are shown in Figure 4. The top, middle, and bottom rows correspond to small, mid, and large datasets respectively. With Dataset 2 and Dataset 4, SGC outperforms GCN. But SGC falls short in Dataset 1 and Dataset 3. This can be explained by the na- ture of the sparse classes (i.e., points within the same class do not share a single mean). Since SGC performs feature propagation in the original feature space, points in these sparse classes got pulled towards other classes' means. GCN can be very useful in these situations because it uses nonlinear transformation after each round of feature propagation. These nonlinear transformations map the points in sparse classes closer to each other, which helps improving the accuracy. With mid and large size datasets, SGC outperforms GCN in six datasets 12 out of eight. This performance by SGC can be explained by the fact that most classes in these datasets have a single mean. Unlike small datasets, which are usually designed artificially with sparse classes, classes in real dataset have their own mean. GCN was the best performer in iris and wine datasets. These datasets contain sparse classes, which can be better separated by nonlinear transformation. Another aspect to look at when running GCN and SGC is the training time. The training process in GCN involves feature propagation and nonlinear transformation. While in SGC, the training only involves feature propagation. Figure 5 shows the training time for all of the 12 datasets. In case of large-size datasets, the training time for SGC was very small compared to GCN training time. There is a clear advantage for SGC over GCN, especially if we consider that SGC outperforms GCN in most of the datasets. The takeaway from this experiment, we recommend to use SGC because it is faster and most likely will deliver similar or better results than GCN. An exception would be if the user is certain that the dataset contains sparse classes where nonlinearity in GCN can be helpful. 4.2. The effect of graph smoothing on GCN and SGC accuracy The number of hidden layers in GCN and SGC controls the graph smoothing. Smoothing in GCN is coupled with nonlinearity transition from one hidden layer to another. While in SGC, smoothing is just a multiplication of the adjacency matrix A by the feature matrix X. The risk of oversmoothing is that node representations became indistinguishable after a number of hidden layers Yang et al. (2020). In this experiment, we test the effect of graph smoothing on GCN and SGC with our proposed graph construction. Eight datasets were tested, where de- signed the hidden layers to range from 1 to 50 layers for both GCN and SGC. For each network setup we took the test accuracy average for 10 runs. Out of the eight datasets (see Figure 6), GCN turns to be more resilient than SGC in six datasets. By resilient we mean the ability to deliver better accuracy with 13 Figure 6: Accuracy scores for SGC and GCN with a varying number of hidden layers; each point on the plot represents an average of 10 runs. (Best viewed in color) 14 an increasing number of layers. These results support the findings presented by Yang et al. Yang et al. (2020) where they stated that GCN has the ability to learn "anti-oversmoothing". The two datasets where SGC was better than GCN were Dataset 4 and BC-Wisc. This can be explained by the nature of classes in these two datasets, where points in each class share a single mean. In these situations, there is a low risk of oversmoothing. Because with each layer of smoothing, node repre- sentations in one class are turning to be the same as the class mean. This is not the case when we have a sparse class. Because with each layer of smoothing node representations in the sparse class are getting mixed with the neighboring classes. 4.3. The effect of the number of trees on GCN and SGC accuracy One factor that affects our graph construction scheme is the reliance on principle axis trees (PA-trees) to construct the graph. In this experiment, we investigate if using another type of Binary Space Partitioning trees (BSP-trees) with an increasing number of trees would improve the test accuracy of GCN and SGC. We used random projection trees (RP-trees) Dasgupta & Freund (2008); Dasgupta & Sinha (2015), where the number of trees ranged from 20 to 100. The box plots in Figure 7 show the average test accuracy for 50 runs. We found out that increasing the number of trees will not improve the performance of GCN and SGC. The same performance was delivered by a single PA-tree. This makes the cost of constructing and storing 100 RP-trees unjustified. 5. Conclusion Graph Neural Networks (GNNs) have become the go-to option for graph learning among researchers in machine learning community. GNN eases the computational demands associated with traditional graph learning techniques like spectral clustering. The adjacency matrix A is crucially important for learning in GNN. Despite some efforts for modifying the adjacency matrix while 15 Figure 7: Accuracy scores for SGC and GCN with a varying number of RP-trees; each box represents 50 runs. (Best viewed in color) 16 training the GNN, these efforts are not compatible with some types of GNNs such as Simple Graph Convolution (SGC). We present a graph construction scheme that uses unsupervised and super- vised information to construct the adjacency matrix A. The proposed scheme is independent from GNN training, which makes it compatible with both well- known types of GNNs like Graph Convolutional Network (GCN) and Graph Simple Graph Convolution (SGC). We used Principal Axis trees (PA-trees) as a source of unsupervised information to build the adjacency matrix. For super- vised information we adapted the concepts of penalty and intrinsic graphs from dimensionality reduction field. The experiments were designed to answer three questions: 1) how GCN and SGC are performing with the proposed graph construction in terms of test accuracy and training time? 2) how graph smoothing affects the performance of GCN and SGC? 3) does the performance of GCN and SGC improves by using multiple trees instead of one tree?. We found out that SGC can deliver better or similar test accuracy with far less training time compared to GCN. However, SGC was more vulnerable to the effects of graph smoothing than GCN. We also found out that adding more trees will not improve the test accuracy. Based on these results, we recommend using SGC with the proposed graph construction because of its speed. But the level of graph smoothing has to be selected carefully. This work can be extended by exploring different methods to construct the graph using unsupervised information. Also, the proposed graph construction scheme can be tested on other Graph Neural Networks (GNNs). References Bruna, J., Zaremba, W., Szlam, A., & LeCun, Y. (2013). Spectral networks and locally connected networks on graphs. doi:https://doi.org/10.48550/ ARXIV.1312.6203. Buitinck, L., Louppe, G., Blondel, M., Pedregosa, F., Mueller, A., Grisel, O., 17 Niculae, V., Prettenhofer, P., Gramfort, A., Grobler, J., Layton, R., Van- derPlas, J., Joly, A., Holt, B., & Varoquaux, G. (2013). API design for machine learning software: experiences from the scikit-learn project. In ECML PKDD Workshop: Languages for Data Mining and Machine Learn- ing (pp. 108–122). Dasgupta, S., & Freund, Y. (2008). Random projection trees and low dimen- sional manifolds. In Proceedings of the Fortieth Annual ACM Symposium on Theory of Computing STOC '08 (p. 537–546). New York, NY, USA: Association for Computing Machinery. doi:https://doi.org/10.1145/ 1374376.1374452. Dasgupta, S., & Sinha, K. (2015). Randomized partition trees for nearest neigh- bor search. Algorithmica, 72 , 237–263. doi:https://doi.org/10.1007/ s00453-014-9885-5. Defferrard, M., Bresson, X., & Vandergheynst, P. (2016). Convolutional neural networks on graphs with fast localized spectral filtering, . doi:https:// doi.org/10.48550/ARXIV.1606.09375. Dua, D., & Graff, C. (2017). UCI machine learning repository. URL: http: //archive.ics.uci.edu/ml. Franceschi, L., Niepert, M., Pontil, M., & He, X. (2019). Learning discrete struc- tures for graph neural networks. In Proceedings of the 36th International Conference on Machine Learning. Fr ̈anti, P., & Sieranoja, S. (2018). K-means properties on six clustering bench- mark datasets. URL: http://cs.uef.fi/sipu/datasets/. Hammond, D. K., Vandergheynst, P., & Gribonval, R. (2011). Wavelets on graphs via spectral graph theory. Applied and Computational Harmonic Analysis, 30 , 129–150. doi:https://doi.org/10.1016/j.acha.2010.04. 005. 18 Hart, P. E., Stork, D. G., & Duda, R. O. (2000). Pattern classification. Wiley Hoboken. Henaff, M., Bruna, J., & LeCun, Y. (2015). Deep convolutional networks on graph-structured data. doi:https://doi.org/10.48550/ARXIV.1506. 05163. Jia, X., Zhou, Y., Li, W., Li, J., & Yin, B. (2022). Data-aware relation learning- based graph convolution neural network for facial action unit recogni- tion. Pattern Recognition Letters, 155 , 100–106. doi:https://doi.org/ 10.1016/j.patrec.2022.02.010. Jin, W., Ma, Y., Liu, X., Tang, X., Wang, S., & Tang, J. (2020). Graph structure learning for robust graph neural networks. In 26th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD 2020 (pp. 66–74). Association for Computing Machinery. Kipf, T. N., & Welling, M. (2017). Semi-supervised classification with graph convolutional networks. In International Conference on Learning Repre- sentations (ICLR). Liang, Y., Meng, F., Zhang, J., Chen, Y., Xu, J., & Zhou, J. (2021). A de- pendency syntactic knowledge augmented interactive architecture for end- to-end aspect-based sentiment analysis. Neurocomputing, 454 , 291–302. doi:https://doi.org/10.1016/j.neucom.2021.05.028. von Luxburg, U. (2007). A tutorial on spectral clustering. Statistics and Com- puting, 17 . doi:https://doi.org/10.1007/s11222-007-9033-z. McNames, J. (2001). A fast nearest-neighbor algorithm based on a principal axis search tree. IEEE Transactions on Pattern Analysis and Machine Intelligence, 23 , 964–976. doi:https://doi.org/10.1109/34.955110. Ng, A., Jordan, M., & Weiss, Y. (2001). On spectral clustering: Analysis and an algorithm. In Advances in Neural Information Processing Systems. MIT 19 Press volume 14. URL: https://proceedings.neurips.cc/paper/2001/ file/801272ee79cfde7fa5960571fee36b9b-Paper.pdf. 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., & Duchesnay, E. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12 , 2825–2830. Phan, H. T., Nguyen, N. T., & Hwang, D. (2022). Convolutional atten- tion neural network over graph structures for improving the performance of aspect-level sentiment analysis. Information Sciences, 589 , 416–439. doi:https://doi.org/10.1016/j.ins.2021.12.127. Qi, C., Zhang, J., Jia, H., Mao, Q., Wang, L., & Song, H. (2021). Deep face clustering using residual graph convolutional network. Knowledge- Based Systems, 211 , 106561. doi:https://doi.org/10.1016/j.knosys. 2020.106561. Ram, P., & Gray, A. (2013). Which space partitioning tree to use for search? Advances in Neural Information Processing Systems, 26 . Shaham, U., Stanton, K., Li, H., Nadler, B., Basri, R., & Kluger, Y. (2018). Spectralnet: Spectral clustering using deep neural networks. doi:https: //doi.org/10.48550/arxiv.1801.01587. Shi, J., & Malik, J. (1997). Normalized cuts and image segmentation. In Proceedings of IEEE Computer Society Conference on Computer Vision and Pattern Recognition (pp. 731–737). doi:https://doi.org/10.1109/ CVPR.1997.609407. Shi, J., & Malik, J. (2000). Normalized cuts and image segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 22 , 888–905. doi:https://doi.org/10.1109/34.868688. 20 Shuman, D. I., Narang, S. K., Frossard, P., Ortega, A., & Vandergheynst, P. (2013). The emerging field of signal processing on graphs: Extending high- dimensional data analysis to networks and other irregular domains. IEEE Signal Processing Magazine, 30 , 83–98. doi:https://doi.org/10.1109/ MSP.2012.2235192. Sproull, R. F. (1991). Refinements to nearest-neighbor searching in k- dimensional trees. Algorithmica, 6 , 579–589. Wang, K. A., Bian, X., Liu, P., & Yan, D. (2019). Dc2: A divide-and-conquer algorithm for large-scale kernel learning with application to clustering. In 2019 IEEE International Conference on Big Data (Big Data) (pp. 5603– 5610). doi:https://doi.org/10.1109/BigData47090.2019.9006565. Weiss, Y. (1999). Segmentation using eigenvectors: a unifying view. In Proceed- ings of the Seventh IEEE International Conference on Computer Vision (pp. 975–982). doi:https://doi.org/10.1109/ICCV.1999.790354. Wu, F., Souza, A., Zhang, T., Fifty, C., Yu, T., & Weinberger, K. (2019). Simplifying graph convolutional networks. In Proceedings of the 36th In- ternational Conference on Machine Learning (pp. 6861–6871). PMLR. Wu, Z., Pan, S., Chen, F., Long, G., Zhang, C., & Yu, P. S. (2021). A com- prehensive survey on graph neural networks. IEEE Transactions on Neu- ral Networks and Learning Systems, 32 , 4–24. doi:10.1109/TNNLS.2020. 2978386. Yan, D., Gu, S., Xu, Y., & Qin, Z. (2019). Similarity kernel and clustering via random projection forests. doi:https://doi.org/10.48550/ARXIV.1908. 10506. Yan, D., Wang, Y., Wang, J., Wang, H., & Li, Z. (2018). K-nearest neighbor search by random projection forests. In 2018 IEEE International Confer- ence on Big Data (Big Data) (pp. 4775–4781). doi:https://doi.org/10. 1109/BigData.2018.8622307. 21 Yan, D., Wang, Y., Wang, J., Wang, H., & Li, Z. (2021). K-nearest neighbor search by random projection forests. IEEE Transactions on Big Data, 7 , 147–157. doi:https://doi.org/10.1109/TBDATA.2019.2908178. Yan, S., Xu, D., Zhang, B., Zhang, H.-j., Yang, Q., & Lin, S. (2007). Graph embedding and extensions: A general framework for dimensionality reduc- tion. IEEE Transactions on Pattern Analysis and Machine Intelligence, 29 , 40–51. doi:https://doi.org/10.1109/TPAMI.2007.250598. Yang, C., Wang, R., Yao, S., Liu, S., & Abdelzaher, T. (2020). Revisiting over- smoothing in deep GCNs. doi:https://doi.org/10.48550/arxiv.2003. 13663. Zelnik-Manor, L., & Perona, P. (2004). Self-tuning spectral clustering. In Proceedings of the 17th International Conference on Neural Information Processing Systems NIPS'04 (p. 1601–1608). Cambridge, MA, USA: MIT Press. Zhang, S.-X., Zhu, X., Hou, J.-B., & Yin, X.-C. (2022). Graph fusion network for multi-oriented object detection. Applied Intelligence, . doi:https:// doi.org/10.1007/s10489-022-03396-5. Zhao, L., & Akoglu, L. (2019). Pairnorm: Tackling oversmoothing in GNNs. doi:https://doi.org/10.48550/arxiv.1909.12223. Zhou, J., Huang, J. X., Hu, Q. V., & He, L. (2020). SK-GCN: Modeling syntax and knowledge via graph convolutional network for aspect-level sentiment classification. Knowledge-Based Systems, 205 , 106292. doi:https://doi. org/10.1016/j.knosys.2020.106292. 22
http://arxiv.org/abs/2302.11313v3
2023-08-12T22:47:28
2023-02-22T11:50:39
Time-varying Signals Recovery via Graph Neural Networks
The recovery of time-varying graph signals is a fundamental problem with numerous applications in sensor networks and forecasting in time series. Effectively capturing the spatio-temporal information in these signals is essential for the downstream tasks. Previous studies have used the smoothness of the temporal differences of such graph signals as an initial assumption. Nevertheless, this smoothness assumption could result in a degradation of performance in the corresponding application when the prior does not hold. In this work, we relax the requirement of this hypothesis by including a learning module. We propose a Time Graph Neural Network (TimeGNN) for the recovery of time-varying graph signals. Our algorithm uses an encoder-decoder architecture with a specialized loss composed of a mean squared error function and a Sobolev smoothness operator.TimeGNN shows competitive performance against previous methods in real datasets.
[ "Jhon A. Castro-Correa", "Jhony H. Giraldo", "Anindya Mondal", "Mohsen Badiey", "Thierry Bouwmans", "Fragkiskos D. Malliaros" ]
10.1109/ICASSP49357.2023.10096168
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1109/ICASSP49357.2023.10096168", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.11313v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11313v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "eess.SP", "@scheme": "http://arxiv.org/schemas/atom" }
[ "eess.SP", "cs.LG", "cs.SI" ]
3 2 0 2 g u A 2 1 ] P S . s s e e [ 3 v 3 1 3 1 1 . 2 0 3 2 : v i X r a ACCEPTED IN IEEE ICASSP 2023 1 Time-varying Signals Recovery via Graph Neural Networks John A. Castro-Correa1∗ , Jhony H. Giraldo2∗, Anindya Mondal3∗, Mohsen Badiey1, Thierry Bouwmans4, Fragkiskos D. Malliaros5 1 University of Delaware, USA 2 LTCI, Télécom Paris, Institut Polytechnique de Paris, France 3 Jadavpur University, India 4 Laboratoire Mathématiques, Image et Applications (MIA), La Rochelle Université, France 5 Université Paris-Saclay, CentraleSupélec, Inria, Centre for Visual Computing (CVN), France Abstract-The recovery of time-varying graph signals is a fundamental problem with numerous applications in sensor networks and forecasting in time series. Effectively capturing the spatio-temporal information in these signals is essential for the downstream tasks. Previous studies have used the smoothness of the temporal differences of such graph signals as an initial assumption. Nevertheless, this smoothness assumption could result in a degradation of performance in the corresponding application when the prior does not hold. In this work, we relax the requirement of this hypothesis by including a learning module. We propose a Time Graph Neural Network (TimeGNN) for the recovery of time-varying graph signals. Our algorithm uses an encoder-decoder architecture with a specialized loss composed of a mean squared error function and a Sobolev smoothness operator.TimeGNN shows competitive performance against previous methods in real datasets. Index Terms-Graph neural networks, graph signal processing, time-varying graph signal, recovery of signals I. INTRODUCTION Recent advances in information technology have led to an accumulation of large amounts of unstructured data. The representation and analysis of such irregular and complex data is a daunting task. Graph Signal Processing (GSP) and Graph Neural Networks (GNNs) are emerging research fields that have proved to be helpful for such tasks in recent years [1]–[6]. In GSP and GNNs, the data is modeled as signals or vectors on a set of nodes of a graph, incorporating both the feature information and the underlying structure of the data. GSP and GNNs thus provide new perspectives on data handling, connecting machine learning and signal processing [7], with profound impact in various fields like semi-supervised learning [3], computer vision [8], [9], and social media [10]. The sampling and reconstruction of graph signals are fundamental tasks that have recently attracted considerable attention from the signal processing and machine learning communities [1], [11]–[18]. Nevertheless, the problem of time- varying graph signal reconstruction1 has not been widely explored [18]. The reconstruction of time-varying graph signals *Authors have equal contributions Corresponding author: [email protected] 1One can think of the recovery of time-varying graph signals as a matrix completion task where each column (or row) is associated with time, and each row (or column) is associated with a vertex of a graph. has significant applications in data recovery in sensor networks, forecasting of time-series, and infectious disease prediction [16], [18], [20]–[22]. Previous studies have extended the definition of smooth signals from static to time-varying graph signals [23]. Similarly, other works have focused on the rate of convergence of the optimization methods used to solve the reconstruction problem [18], [20]. However, the success of these optimization- based methods requires appropriate prior assumptions about the underlying time-varying graph signals, which could be inflexible for real-world applications. In this work, we propose the Time Graph Neural Network (TimeGNN) model to recover time-varying graph signals. TimeGNN encodes the time series of each node in latent vectors. Therefore, these embedded representations are decoded to recover the original time-varying graph signal. Our architecture comprises: 1) a cascade of Chebyshev graph convolutions [2] with increasing order and 2) linear combination layers. Our algorithm considers spatio-temporal information using: 1) graph convolutions [2] and 2) a specialized loss function composed of a Mean Squared Error (MSE) term and a Sobolev smoothness operator [18]. TimeGNN shows competitive performance against previous methods in real-world datasets of time-varying graph signals. The main contributions of our work are summarized as follows: 1) we exploit GNNs to recover time-varying graph signals from their samples, 2) we relax the strict prior assump- tion of previous methods by including some learnable modules in TimeGNN, and 3) we perform experimental evaluations on natural and artificial data, and compare TimeGNN to four methods of the literature. The rest of the paper is organized as follows. Section II introduces the proposed TimeGNN model. Section III presents the experimental framework and results. Finally, Section IV shows the conclusions. II. TIME GRAPH NEURAL NETWORK A. Preliminaries We represent a graph with G = (V , E , A), where V is the set of nodes with |V | = N, E ⊆ {(i, j) | i, j ∈ V and i ̸= j} is the set of edges, and A ∈ RN×N is the weighted adjacency matrix with A(i, j) = ai, j ∈ R+ if (i, j) ∈ E and 0 otherwise. In this work, we consider connected, undirected, and weighted ACCEPTED IN IEEE ICASSP 2023 2 graphs. We also define the symmetrized Laplacian as L = I − D− 1 2 AD− 1 2 , where D = diag(A1) is the diagonal degree matrix of the graph. Finally, a node-indexed real-valued graph signal is a function x : V → R, so that we can represent a one-dimensional graph signal as x ∈ RN. B. Reconstruction of Time-varying Graph Signals The sampling and recovery of graph signals are crucial tasks in GSP [11], [12]. Several studies have used the smoothness assumption to address the sampling and recovery problems for static graph signals. The notion of global smoothness was formalized using the discrete p-Dirichlet form [24] given by: Sp(x) = (cid:34) 1 p ∑ i∈V ∑ j∈Ni A(i, j)[x( j) − x(i)]2 , (1) (cid:35) p 2 where Ni is the set of neighbors of node i. When p = 2, we have S2(x) which is known as the graph Laplacian quadratic form S2(x) = ∑(i, j)∈E A(i, j)[x( j) − x(i)]2 = xTLx [24]. For time-varying graph signals, some studies assumed that the temporal differences of time-varying graph signals are smooth ( [18], [23]). Let X = [x1, x2, . . . , xM] be a time-varying graph signal, where xs ∈ RN is a graph signal in G at time s. Qiu et al. [23] defined the smoothness of X as: S2(X) = M ∑ s=1 s Lxs = tr(XTLX). xT (2) S2(X) only computes the summation of the individual smoothness of each graph signal xs ∀ s ∈ {1, 2, . . . , M}, so we do not consider any temporal information. To address this problem, we can define the temporal difference operator Dh as follows [23]: −1 1 −1 Dh = 1            . . .    . . . −1   1 ∈ RM×(M−1). (3) Therefore, we have that XDh = [x2 −x1, x3 −x2, . . . , xM −xM−1]. Some studies [18], [23] have found that S2(XDh) shows better smoothness properties than S2(X) in real-world time-varying data, i.e. xs − xs−1 exhibits smoothness in the graph even if xs is not smooth across the graph. Qiu et.al. [23] used S2(XDh) to present a Time-varying Graph Signal Reconstruction (TGSR) method as follows: 1 2 min ̃X ∥J ◦ ̃X − Y∥2 F + υ 2 tr (cid:0)( ̃XDh)TL ̃XDh (cid:1) , (4) where J ∈ {0, 1}N×M is a sampling matrix, ◦ is the Hadamard product between matrices, υ is a regularization parameter, and Y ∈ RN×M is the matrix of observed values. The optimization problem in (4) has some limitations: 1) the solution of (4) could lose performance if the real-world dataset does not satisfy the smoothness prior assumption, and 2) (4) is solved with a conjugate gradient method in [23], which has Fig. 1: Cascade of Chebyshev graph convolutions. a slow convergence rate because S2( ̃XDh) is ill-conditioned ( [18]). Our algorithm relaxes the smoothness assumption by introducing a learnable module. Similarly, TimeGNN is fast once the GNN parameters are learned. C. Graph Neural Network Architecture TimeGNN is based on the Chebyshev spectral graph con- volutional operator defined by Defferrard et.al. [2], whose propagation rule is given as follows: X′ = K ∑ k=1 Z(k)W(k), (5) where W(k) is the kth matrix of trainable parameters, Z(k) is computed recursively as Z(1) = X, Z(2) = ˆLX, Z(k) = 2 ˆLZ(k−1) − Z(k−2), and ˆL = 2L − I. We use the filtering λmax operation in (5) to propose a new convolutional layer composed of: 1) a cascade of Chebyshev graph filters, and 2) a linear combination layer as in Fig. 1. More precisely, we define the propagation rule of each layer of TimeGNN as follows: H(l+1) = α ∑ ρ=1 μ (l) ρ ρ ∑ k=1 Z(k)W(k) l,ρ , (6) where H(l+1) is the output of layer l + 1, α is a hyperparameter, μ (l) is a learnable parameter, Z(k) is recursively computed as in ρ (5), and W(k) l,ρ is the kth learnable matrix in the layer l for the branch ρ. The architecture of TimeGNN is given by stacking n cascade layers as in (6), where the input is (J ◦ X)Dh. Finally, our loss function is such that: (7) (cid:1), (i, j)∈S L = (X(i, j) − ̄X(i, j))2 1 |S | ∑ +λtr (cid:0)( ̄XDh)T(L + εI) ̄XDh where ̄X is the reconstructed graph signal, S is the training set, with S a subset of the spatio-temporal sampled indexes given by J, and ε ∈ R+ is a hyperparameter. The term (cid:1) is the Sobolev smoothness ( [18]). tr (cid:0)( ̄XDh)T(L + εI) ̄XDh We can think of TimeGNN as an encoder-decoder network with a loss function given by an MSE term plus a Sobolev smoothness regularization. The first layers of TimeGNN encode the term (J ◦ X)Dh to an H-dimensional latent vector that is then decoded with the final layer. As a result, we LinearCombination ACCEPTED IN IEEE ICASSP 2023 3 Fig. 2: Pipeline of our Time Graph Neural Network (TimeGNN) for the recovery of time-varying graph signals. capture the spatio-temporal information using the GNN, the temporal encoding-decoding structure, and the regularization term tr (cid:0)( ̄XDh)T(L + εI) ̄XDh (cid:1) where we use the temporal operator Dh. The parameter λ in (7) weighs the importance of the regularization term against the MSE loss. Figure 2 shows the pipeline of our TimeGNN applied to a graph of the sea surface temperature in the Pacific Ocean. III. EXPERIMENTS AND RESULTS We compare TimeGNN with Graph Convolutional Networks (GCN) [3], Natural Neighbor Interpolation (NNI) [25], TGSR [23], and Time-varying Graph signal Reconstruction via Sobolev Smoothness (GraphTRSS) [18]. A. Implementation Details We implement TimeGNN and GCN using PyTorch and PyG [26]. We define the space search for the hyperparameters tuning of TimeGNN as follows: 1) number of layers {1, 2, 3}, 2) hidden units {2, 3, . . . , 10}, 3) learning rate [0.005, 0.05], 4) weight decay [1e − 5, 1e − 3], 5) λ ∈ [1e − 6, 1e − 3], 6) α ∈ {2, 3, 4}. Similarly, we set the following hyperparameters: 1) ε = 0.05, and 2) the number of epochs to 5, 000. The graphs are constructed based on the coordinate locations of the nodes in each dataset with a k-Nearest Neighbors (k-NN) algorithm as in [18]. NNI, TGRS, and GraphTRSS are implemented using the code in [18] in MATLAB® 2022b. The hyperparameters of the baseline methods are optimized following the same strategy as with TimeGNN. B. Datasets Synthetic Graph and Signals: We use the synthetic graph dataset developed in [23]. The graph contains 100 nodes randomly generated from a uniform distribution in a 100 × 100 square area using k-NN. The graph signals are generated with the recursive function xt = xt−1 + L−1/2ft , where x1 is a low frequency graph signal with energy 104, L−1/2 = Uλ −1/2UT, where U is the matrix of eigenvectors, λ = diag(λ1, λ2, . . . , λN) , . . . , λ −1/2 is the matrix of eigenvalues, λ −1/2 = diag(0, λ −1/2 ), N and ft is an i.i.d. Gaussian signal. PM 2.5 Concentration: We use the daily mean concentration of PM 2.5 in the air in California, USA2. Data were collected from 93 sensors over 220 days in 2015. 2 2https://www.epa.gov/outdoor-air-quality-data Sea-surface Temperature: We use the sea-surface temperature data, which are measured monthly and released by the NOAA PSL3. We use a sample of 100 locations in the Pacific Ocean over a duration of 600 months. Intel Lab Data: We use the data captured by the 54 sensors deployed at the Intel Berkeley Research Laboratory 4. The data consists of temperature readings between February 28th and April 5th, 2004. C. Evaluation Metrics We use the Root Mean Square Error (RMSE), Mean Absolute Error (MAE), and Mean Absolute Percentage Error (MAPE) metrics, as defined in [18], to evaluate our algorithm. D. Experiments We construct the graphs using k-NN with the coordinate locations of the nodes in each dataset with a Gaussian kernel as in [18]. We follow a random sampling strategy in all experiments. Therefore, we compute the reconstruction error metrics on the non-sampled vertices for a set of sampling densities. We evaluate all the methods with a Monte Carlo cross- validation with 50 repetitions for each sampling density. For the synthetic data, k = 5 in the k-NN, and the sampling densities are given by {0.1, 0.2, . . . , 0.9}. For PM2.5 concentration, k = 5 and the sampling densities are {0.1, 0.15, 0.2, . . . , 0.45}. For the sea-surface temperature, we keep k = 5 and the sampling densities are set to {0.1, 0.2, . . . , 0.9}. For Intel Lab data, we set k = 3 and the sampling densities at {0.1, 0.3, 0.5, 0.7}. E. Results and Discussion Figure 3 shows the performance of TimeGNN against the previous methods for all datasets using RMSE. Furthermore, Table I shows the quantitative comparisons using the averages of all metrics along the set of sampling densities. We do not plot the performance of GCN in Fig. 3 because this network performs considerably worse than the other methods, as shown in Table I. GCN was implemented using the same input and loss function as in TimeGNN. Our algorithm outperforms previous methods for several metrics in PM2.5 concentration 3https://psl.noaa.gov 4http://db.csail.mit.edu/labdata/labdata.html Time-varying SignalTimeGNNSea Surface TemperatureLaplacian MatrixEncoderDecoder ACCEPTED IN IEEE ICASSP 2023 4 Fig. 3: Comparison of TimeGNN to baseline methods in one synthetic and three real-world datasets (RMSE). TABLE I: Quantitative comparison of TimeGNN with the baselines in all datasets using the average error metrics. Method Synthetic Graph Signals RMSE MAE MAPE PM2.5 Concentration RMSE MAE MAPE Sea-surface Temperature RMSE MAE MAPE Intel Lab Data RMSE MAE MAPE GCN (Kipf and Welling [3]) NNI (Kiani et. al. [25]) GraphTRSS (Giraldo et. al. [18]) TGSR (Qiu et. al. [23]) TimeGNN (ours) 11.296 0.775 0.260 0.263 0.452 8.446 0.436 0.256 0.193 0.323 1.123 0.255 0.178 0.144 0.226 4.657 4.944 3.824 3.898 2.959 2.956 2.204 2.279 0.550 0.593 0.377 0.394 3.766 0.772 0.357 0.360 2.922 0.561 0.260 0.263 0.548 0.067 0.029 0.030 3.809 2.172 0.362 0.275 0.203 0.023 2.998 0.661 0.056 0.069 0.156 2.327 0.291 0.023 0.037 0.095 0.120 0.015 0.001 0.002 0.005 The best and second-best performing methods on each dataset are shown in red and blue, respectively. and sea-surface temperature datasets. The synthetic data were created to satisfy the conditions of smoothly evolving graph signals (Definition 1 in [23]), while here, we relaxed that prior assumption by adding a trainable GNN module. Therefore, TGRS and GraphTRSS are better suited for that artificial dataset, as shown in Fig. 3 and Table I. Similarly, the Intel Lab dataset is highly smooth. Some of the reasons behind our model's success in real-world datasets are: 1) its ability to capture spatio-temporal information, 2) its encoding-decoding structure, and 3) its powerful learning module given by a cascade of Chebyshev graph convolutions. IV. CONCLUSIONS In this paper, we introduced a GNN architecture named TimeGNN for the recovery of time-varying graph signals from their samples. Similarly, we proposed a new convolutional layer composed of a cascade of Chebyshev graph filters. TimeGNN includes a learning module that relaxes the requirement of strict smoothness assumptions. We found that our framework shows competitive performance against several approaches in the literature for reconstructing graph signals, delivering better performance in real datasets. Our algorithm could help solve problems like recovering missing data from sensor networks, forecasting weather conditions, intelligent transportation sys- tems, and many others. For future work, we plan to extend our framework to other graph filters like transformers [27], and alternative compact operators as introduced in [28]. Similarly, we will explore TimeGNN in highly dynamic 4D real datasets [29], [30]. Acknowledgments: This work was supported by DATAIA institute as part of the "Programme d'Investissement d'Avenir", (ANR-17-CONV-0003) operated by CentraleSupélec, by ANR (French National Research Agency) under the JCJC project GraphIA (ANR-20-CE23-0009-01), and by the Office of Naval Research, ONR (Grant No. N00014-21-1-2760). REFERENCES [1] A. Ortega et al., "Graph signal processing: Overview, challenges, and applications," in Proceedings of the IEEE, 2018. 1 [2] M. Defferrard, X. Bresson, and P. Vandergheynst, "Convolutional neural networks on graphs with fast localized spectral filtering," in NeurIPS, 2016. 1, 2 [3] T. N. Kipf and M. Welling, "Semi-supervised classification with graph convolutional networks," in ICLR, 2017. 1, 3, 4 [4] V. N. Ioannidis, A. G. Marques, and G. B. Giannakis, "A recurrent graph neural network for multi-relational data," in IEEE ICASSP, 2019. 1 [5] F. Gama et al., "Aggregation graph neural networks," in IEEE ICASSP, 2019. 1 [6] A. Duval and F. D. Malliaros, "Higher-order clustering and pooling for graph neural networks," in ACM CIKM, 2022. 1 [7] M. M. Bronstein et al., "Geometric deep learning: going beyond euclidean data," in IEEE Signal Process. Mag., 2017. 1 [8] J. H. Giraldo, S. Javed, and T. Bouwmans, "Graph moving object segmentation," IEEE T-PAMI, 2022. 1 [9] A. Mondal et al., "Moving object detection for event based vision using graph spectral clustering," in IEEE ICCV-W, 2021. 1 [10] A. Benamira et al., "Semi-supervised learning and graph neural networks for fake news detection," in IEEE/ACM ASONAM, 2019. 1 [11] A. G. Marques et al., "Sampling of graph signals with successive local aggregations," in IEEE TSP, 2015. 1, 2 [12] D. Romero et al., "Kernel-based reconstruction of graph signals," in IEEE TSP,2016. 1, 2 [13] D. Ramirez, A. G. Marques, and S. Segarra, "Graphsignal reconstruction and blind deconvolution for diffused sparse inputs," in IEEE ICASSP, 2017. 1 [14] A. Parada-Mayorga et al., "Blue-noise sampling on graphs," in IEEE T-SIPN, 2019. 1 [15] B. Guler et al., "Robust graph signal sampling," in IEEE ICASSP, 2019. 1 [16] B. Girault, A. Ortega, and S. S. Narayayan, "Graph vertex sampling with arbitrary graph signal Hilbert spaces," in IEEE ICASSP, 2020. 1 [17] J. Hara et al., "Design of graph signal sampling matrices for arbitrary signal subspaces," in IEEE ICASSP, 2021. 1 [18] J. H. Giraldo et al., "Reconstruction of time-varying graph signals via Sobolev smoothness," in IEEE T-SIPN, 2022. 1, 2, 3, 4 [19] B. Girault, "Stationary graph signals using an isometric graph translation," in EUSIPCO, 2015. [20] J. H. Giraldo and T. Bouwmans, "On the minimization of Sobolev norms of time-varying graph signals: Estimation of new Coronavirus disease 2019 cases," in IEEE MLSP, 2020. 1 [21] S. Chen and Y. C. Eldar, "Time-varying graph signal inpainting via unrolling networks," in IEEE ICASSP, 2021. 1 [22] A. Mondal et al., "Recovery of missing sensor data by reconstructing time-varying graph signals," in EUSIPCO, 2022. 1 ACCEPTED IN IEEE ICASSP 2023 5 [23] K. Qiu et al., "Time-varying graph signal reconstruction," in IEEE Journal of Selected Topics in Signal Processing, 2017. 1, 2, 3, 4 [24] D. I. Shuman et al., "The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains," in IEEE Signal Process. Mag., 2013. 2 [25] K. Kiani and K. Saleem, "K-nearest temperature trends: A method for weather temperature data imputation," in ICISDM, 2017. 3, 4 [26] M. Fey and J. E. Lenssen, "Fast graph representation learning with PyTorch Geometric," in ICLR-W, 2019. 3 [27] S. Yun et al., "Graph transformer networks," in NeurIPS, 2019. 4 [28] F. Ji and W. P. Tay, "A hilbert space theory of generalized graph signal processing," in IEEE TSP, 2019. 4 [29] M. Badiey, L. Wan, and A. Song, "Three-dimensional mapping of evolving internal waves during the Shallow Water 2006 experiment," in J. Acoust. Soc. Am., 2013. 4 [30] J. A. Castro-Correa et al., "Supervised classification of sound speed profiles via dictionary learning," in J. Atmos. Ocean. Technol., 2022. 4
http://arxiv.org/abs/2302.12001v2
2023-10-22T05:43:36
2023-02-22T11:49:19
Random Projection Forest Initialization for Graph Convolutional Networks
Graph convolutional networks (GCNs) were a great step towards extending deep learning to unstructured data such as graphs. But GCNs still need a constructed graph to work with. To solve this problem, classical graphs such as $k$-nearest neighbor are usually used to initialize the GCN. Although it is computationally efficient to construct $k$-nn graphs, the constructed graph might not be very useful for learning. In a $k$-nn graph, points are restricted to have a fixed number of edges, and all edges in the graph have equal weights. We present a new way to construct the graph and initialize the GCN. It is based on random projection forest (rpForest). rpForest enables us to assign varying weights on edges indicating varying importance, which enhanced the learning. The number of trees is a hyperparameter in rpForest. We performed spectral analysis to help us setting this parameter in the right range. In the experiments, initializing the GCN using rpForest provides better results compared to $k$-nn initialization.
[ "Mashaan Alshammari", "John Stavrakakis", "Adel F. Ahmed", "Masahiro Takatsuka" ]
10.1016/j.mex.2023.102315
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1016/j.mex.2023.102315", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.12001v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12001v2", "@rel": "related", "@type": "application/pdf" } ]
[ "MethodsX, Volume 11, December 2023, 102315" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.IR", "cs.NE" ]
3 2 0 2 t c O 2 2 ] G L . s c [ 2 v 1 0 0 2 1 . 2 0 3 2 : v i X r a Random Projection Forest Initialization for Graph Convolutional Networks Random Projection Forest Initialization for Graph Convolutional Networks Mashaan Alshammari Independent Researcher Riyadh, Saudi Arabia John Stavrakakis School of Computer Science The University of Sydney NSW 2006, Australia Adel F. Ahmed Information and Computer Science Department King Fahd University of Petroleum and Minerals Dhahran, Saudi Arabia Masahiro Takatsuka School of Computer Science The University of Sydney NSW 2006, Australia Editor: [email protected] [email protected] [email protected] [email protected] Abstract Graph convolutional networks (GCNs) were a great step towards extending deep learning to graphs. GCN uses the graph G and the feature matrix X as inputs. However, in most cases the graph G is missing and we are only provided with the feature matrix X. To solve this problem, classical graphs such as k-nearest neighbor (k-nn) are usually used to construct the graph G and initialize the GCN. Although it is computationally efficient to construct k-nn graphs, the constructed graph might not be very useful for learning. In a k-nn graph, points are restricted to have a fixed number of edges, and all edges in the graph have equal weights. Our contribution is Initializing GCN using a graph with varying weights on edges, which provides better performance compared to k-nn initialization. Our proposed method is based on random projection forest (rpForest). rpForest enables us to assign varying weights on edges indicating varying importance, which enhanced the learning. The number of trees is a hyperparameter in rpForest. We performed spectral analysis to help us setting this parameter in the right range. In the experiments, initializing the GCN using rpForest provides better results compared to k-nn initialization. Keywords: Deep learning, graph convolutional network (GCN), graph neural network (GNN), random projection forests 1 Introduction Convolutional neural networks (CNNs) proved to be effective in many applications. The convolution component in CNNs is only applicable to fixed grids like images and videos. Applying CNNs to non-grid data (graphs for example) can be useful for many applications. 1 Random Projection Forest Initialization for Graph Convolutional Networks Graph Convolutional Networks (GCNs) Kipf and Welling (2017) introduced a convolution component designed for graphs, where vertices are allowed to have a varying number of neighbors unlike fixed grids. GCNs were used in several application such as sentiment anal- ysis Phan et al. (2023), computer vision tasks Ren et al. (2022) and ranking gas adsorption properties Cong et al. (2022). Because the edges arrangements are different from one graph to another, GCN needs the adjacency matrix A to perform the convolutions. The GCN performs two changes to the input adjacency matrix: 1) it adds self-loops to include the vertex own feature vector into the convolution, and 2) it normalizes the adjacency matrix using the degree matrix D to avoid favoring vertices with many edges. These two changes were embedded in the convolution function of GCN. Researchers have improved the GCN algorithm in different ways such as: increasing the depth of GCN Li et al. (2023), implementing attention mechanism Veliˇckovi ́c et al. (2018); Cong et al. (2022), or replacing self-loops with trainable skip connection Tsitsulin et al. (2023). Our focus is on creating an adjacency matrix in an unsupervised way. GCN can classify graph vertices efficiently if the adjacency matrix is given, but it cannot create an adjacency matrix from scratch. This opens a new research track on how to create an adjacency matrix for GCN. An obvious solution is to use traditional methods to create the adjacency matrix such as: fully connected graph, k-nearest neighbor graph, and ε- neighborhood graph von Luxburg (2007). The fully connected graph grows exponentially with the number of vertices (n), which makes k-nn and ε-graphs more appealing. But if we compare k-nn and ε-graphs, we can see that k-nn graphs can be implemented using efficient data structures such as kd-trees. Franceschi et al. proposed a bi-level optimization for GCN graphs Franceschi et al. (2019). They used a number of sample graphs to train the GCN and based on the validation error they modified the original adjacency matrix. Although the method proposed by is effective in learning the adjacency matrix, it still uses the k-nearest Franceschi et al. neighbor graph. k-nn graphs have two problems. First, all vertices in a k-nn graph are restricted to k edges, this would limit the ability of vertices to connect to more similar neighbors. Second, all edges in a k-nn graph are assigned equal weights, which gives them the same level of importance when passed through a GCN. We present a new method to construct the adjacency matrix for GCN. We used random projection forests (rpForest) Yan et al. (2018, 2021) to construct the adjacency matrix. An rpForest is a collection of random projection trees (rpTree). rpTrees use random directions to partition the data points into tree nodes Dasgupta and Freund (2008); Dasgupta and Sinha (2015); Keivani and Sinha (2021). A leaf node in an rpTree represents a small region that contains similar points. We connect all points in a leaf node in each rpTree. If an edge keeps persisting over multiple rpTrees it will be assigned a higher weight. This would solve the equal weights problem in k-nn graphs. Also, since leaf nodes can have a varying number of points, this would allow points to connect to more or less neighbors depending on the density inside the leaf node. The experiments showed that a GCN with rpForest initialization performed better than a GCN with k-nn initialization. Our contributions are: 2 Random Projection Forest Initialization for Graph Convolutional Networks • Initializing GCN using a graph based on rpForest, that allows points to connect to a varying number of neighbors and assigns weights proportionate to the edge's occur- rence in the rpForest. • Providing a spectral analysis to set the hyperparameter (number of trees T ) in rpFor- est. 2 Related work This section discusses the recent advancements in graph convolutional networks, graph construction methods, and random projection forests. These three topics form the basis of our proposed method. 2.1 Graph Convolutional Networks (GCNs) The successful application of convolutional neural network (CNN) on imagery data has stimulated research to extend the convolution concept beyond images. Images can be viewed as a special case of graphs where edges and vertices are ordered on a fixed grid. The problem with applying convolutions on graphs is that vertices have a varying number of edges. GCN extended the convolution to graphs by performing three steps: 1) feature vectors are averaged within the node's local neighborhood, 2) the averaged features are transformed linearly, and 3) a nonlinear activation is applied to the averaged features Wei et al. (2023). Wu, et al. Wu et al. (2021) have categorized graph convolutional network methods into two categories: 1) spectral-based GCNs and 2) spatial-based GCNs. Spectral-based GCNs rely on spectral graph theory. The intuition is that the graph Laplacian carries rich information about graph geometry. A symmetric graph Laplacian is defined as L = D− 1 2 Ng et al. (2001); von Luxburg (2007). D is the degree matrix in which the diagonal shows the degree of each vertex Dii = (cid:80) j Aji. The graph Fourier transform projects an input graph signal x to an embedding space, where the basis are formed by eigenvectors of the normalized graph Laplacian L. The process of graph convolution can be thought of as convoluting an input signal x with a filter gθ = diag(θ) as shown in Equation (1): 2 = I − D− 1 2 AD− 1 2 LD− 1 gθ ∗ x = U gθU ⊤x, (1) where θ ∈ Rn is a parameter that controls the filter g and U is the matrix of eigenvectors ordered by eigenvalues. Bruna, et al. represented the filter g as a set of learnable parameters Bruna et al. (2013). Henaff, et al. Henaff et al. (2015) extended the model proposed by Bruna, et al. Bruna et al. (2013) to datasets where graphs are unavailable. Wu, et al. Wu et al. (2021) have identified three limitations for spectral-based GCNs: 1) any change in the graph structure would change the embedding space, 2) the learned filters are domain specific and cannot be applied to different graphs, 3) they require an eigen decomposition step, which is computationally expensive O(n3). Although the graph spectrum provides rich information, avoiding the eigen decompo- sition step will be a huge boost in terms of performance. Hammond, et al. Hammond et al. (2011) proposed an approximation of the filter gθ via Chebyshev polynomials Tk(x), 3 Random Projection Forest Initialization for Graph Convolutional Networks which was deployed into GCN by Defferrard, et al. Defferrard et al. (2016). The Chebyshev polynomials are recursively defined as: Tk(x) = 2xTk−1(x) − Tk−2(x), (2) with T0(x) = 1 and T1(x) = x. This formulation would allow us to perform the convolution on graphs as: gθ′ ∗ x = K (cid:88) k=0 kTk( ̃L)x, θ′ (3) λmax with ̃L = 2 L − IN . This K localization is a Kth-order neighborhood, which means that it depends on the nodes that are K steps away from the central node. This graph convolution was simplified by Kipf and Welling Kipf and Welling (2017). They limited the layer-wise convolution operation to K = 1, and set λmax = 2. Using these settings, the graph convolution in Equation (3) can be simplified to: gθ′ ∗ x = θ0x − θ1D− 1 2 AD− 1 2 x. (4) The time complexity for GCN is O(LAd + LN d2), where L is the number of layers, A is the adjacency matrix, d is the number of features, and N is the number of nodes You et al. (2020). 2.2 Graph Construction All methods explained in the previous section assume the graph G(V, E) to be already constructed. But this is not the case in many practical applications, where only the feature matrix X is provided. When a graph is missing, the most used way to construct it is to use the Gaussian heat kernel Belkin and Niyogi (2001): Aij = exp (cid:18) −d2 (i, j) 2σ2 (cid:19) , (5) where d2 (i, j) is the distance between the samples i and j. The problem with the heat kernel is that it heavily depends on the selection of the scaling parameter σ2, and usually the user has to try different values and selects the best one. This was improved by the self-tuning diffusion kernel Zelnik-Manor and Perona (2004): Aij = exp (cid:18) −d2 (i, j) σi σj (cid:19) , (6) where σi is the distance from the point xi to its Kth neighbor. Zelnik-manor and Perona have set K = 7 Zelnik-Manor and Perona (2004). Constructing a graph using these two approaches requires performing pairwise compar- isons, which means computations in order of O(n2). To avoid these computations, one could use a more efficient data structure. k-nearest neighbor graphs are usually implemented us- ing k-dimensional trees (also known as kd-trees) Bentley (1975). kd-trees start by selecting the dimension with maximum dispersion. Along that dimension they split at the median and place whatever less than the median in the left child and whatever greater than the 4 Random Projection Forest Initialization for Graph Convolutional Networks Figure 1: An example of running rpTree algorithm on points in 2D. At each node in the tree, a random direction is selected, and all points are projected onto it. Points are split at the median, where points less than the median (points in blue) are placed in the left child, and points larger than the median (points in orange) are placed in the right child. (Best viewed in color) median in the right child. After several recursive executions, the kd-tree algorithm scans the leaf nodes and returns the k-nearest neighbors. The k-nearest neighbor graph is defined as: Aij = (cid:40) 1, j ∈ knn(i) 0, otherwise . (7) We can identify two problems with a k-nearest neighbor graph: 1) it assigns equal weights on edges which gives all edges the same importance, and 2) it restricts all points to have k edges regardless of their position in the feature space. 2.3 Random Projection Forests (rpForests) Random projection forest (rpForest) is a collection of random projection trees (rpTrees) Dasgupta and Freund (2008); Freund et al. (2007). rpTrees use the same principle as kd-trees, that is partitioning the feature space and placing points in a binary tree. The difference is that kd-tree splits along the existing dimensions, while rpTree splits along random directions. In rpTrees, the root node contains all the data points, and the leaf nodes contain disjoint subsets of these data points. Each internal node in rpTree holds a random projection direction −→r and a scalar split point c along that random direction. Figure 1 shows an example of rpTree. 5 Random Projection Forest Initialization for Graph Convolutional Networks The most common use of rpTrees is performing k-nearest neighbor search. Yan, et al. Yan et al. (2021) used rpForest (i.e., a collection of rpTrees) to perform k-nn search. They modified the splitting rule by selecting three random directions, then project onto the one that yields the maximum dispersion of points. rpTree was used in anomaly detection application by Chen, et al. Chen et al. (2015). They also modified the splitting rule by examining if the points form two Gaussian components, they will split these two components into left and right nodes. Tavallali, et al. Tavallali et al. (2021) proposed a k-means tree, which outputs the centroids of clusters. All these modifications on rpTree are supported by the empirical evidence provided by Ram, et al. Ram and Gray (2013). They stated that the best performing binary space-partitioning trees are the ones that have better vector quantization and large partition margins. But these modifications add extra computations to the rpTree algorithm. 3 Proposed Method Our proposed method has two components: a neural network and a graph construction component. The next section explains the neural network component, followed by two sections discussing the graph construction component. 3.1 GCN and LDS Graph convolutional networks (GCNs) are used for semi-supervised node classification. A GCN propagation rule at the first layer is defined as: f (X, A) = ReLU (cid:16) AXW (0)(cid:17) , (8) where A is the adjacency matrix, ReLU is the activation function f (x) = max(0, x), and W (0) is the weight matrix for the first neural network layer. Two problems arise from this definition. First, the node's own feature vector is not included since A has zeros on the diagonal. This can be solved by allowing self-loops, and rewrite the adjacency matrix to be ̃A = A + I. The second problem is the normalization of the adjacency matrix, which can be solved by normalizing using the degree matrix D. The adjacency matrix becomes ˆA = D− 1 2 . By applying these changes, the GCN propagation rule in Equation (8) can be rewritten as: 2 ̃AD− 1 f (X, A) = ReLU (cid:16) ˆAXW (0)(cid:17) . (9) The most common architecture is a two-layer GCN, which can be defined using the following formula: f (X, A) = sof tmax (cid:16) ˆA ReLU (cid:16) ˆAXW (0)(cid:17) W (1)(cid:17) . (10) Franceschi, et al. Franceschi et al. (2019) proposed LDS method to learn the adjacency matrix A. It stands for Learning Discrete Structures (LDS). They used k-nearest neighbor graph to initialize the Graph Convolutional Networks (GCNs). The methodology involves initialization, sampling, inner optimization, and outer optimization. First, a four steps: parameter θ is initialized to be the adjacency matrix of k-nn graph and run GCN once to 6 Random Projection Forest Initialization for Graph Convolutional Networks Figure 2: A k-nn graph with k = 3; all edges were assigned equal weights even the ones connecting two different classes. (Best viewed in color) initialize its parameters. Then, the method iteratively sample graphs from θ to optimize for GCN parameters (inner optimizer) and θ (outer optimizer) in a bilevel optimization. In our experiments, we used both methods GCN and LDS to evaluate their performance when we initialize them using different graphs. The initializations we used in the experi- ments are k-nearest neighbor graph initialization and random projection forest (rpForest) initialization. 3.2 k-nearest neighbor Initialization GCN needs a graph to perform the convolutions. A common choice is to use the k-nearest neighbor graphs to initialize the GCN. In a k-nn graph, each point is connected to its nearest k neighbors. Intuitively, the adjacency matrix contains k × n nonzero entries since we have n points and each one of them has k edges. A formal definition for k-nn graphs is given in Equation (7). An example of k-nearest neighbor graph is shown in Figure 2. In that figure, we have three points in the blue class and five points in the orange class. The graph was constructed with k = 3. Note that some edges connect two points from two different classes. The existence of these edges is undesirable because they could confuse the classifier. But in an unsupervised graph construction, these edges are sometimes unavoidable. The solution is to assign a small weight on these edges connecting two different classes. Unfortunately, we cannot do that in k-nn graphs because all edges get an equal weight. k-nn provides a fast initialization for the graph convolution networks (GCN). But it assigns equal weights to all edges which gives the edges spanning two classes the same im- portance as edges connecting one class. To avoid this problem, we need a graph construction scheme that assigns small weights on edges connecting two classes. 7 Random Projection Forest Initialization for Graph Convolutional Networks Figure 3: An rpForest graph with T = 4; edges connecting the two classes were assigned a small weight (0.25) because they only appear in one tree out of four. (Best viewed in color) 3.3 rpForest Initialization The random projection tree (rpTree) is a binary space-partitioning tree. The root node contains all points in the dataset. For each node in the tree, the method picks a random direction −→r . The dimensions of −→r is Rd−1, where d is the number of dimensions in the dataset. All points in the tree node get projected onto −→r . Then, a split point c is selected 4 ] along −→r . In the projection space, if a point is less than c it is randomly between [ 1 placed in the left child, otherwise it is placed in the right child. rpTrees are particularly useful for k-nearest neighbor search. But in this paper, we are going to use them for graph construction. 4 , 3 A collection of rpTrees is called rpForest. rpForests were proposed by Yan, et al. Yan et al. (2018, 2021) and they applied it in spectral clustering similarity and k-nearest neighbor search. We used rpForests to construct a graph and use it as an input to the GCN. rpForests helped us to overcome two problems we identified with k-nn graphs. The problem of equal weights on edges, and the problem of restricting points to a fixed number of neighbors. We constructed a number of rpTrees. Then, we connect all points falling into the same leaf node. The intuition is simple, if a pair of points fall into the same leaf node in all rpTrees, they will be connected with the maximum weight. Otherwise, the weight on the edge connecting them will be proportionate to the number of the leaf nodes they fall in together. Also, the points will not be restricted to a fixed number of edges because the number of points varies from one leaf node to another. Figure 3 illustrates how did we construct a graph using rpForest. In that figure we used four rpTrees each of which has two levels meaning we only perform the split once. Apart from (rpTree 2), all trees have split the two classes into two different leaf nodes. The final 8 Random Projection Forest Initialization for Graph Convolutional Networks graph aggregates all edges in the trees. The edges connecting the two classes were assigned a small weight (0.25) because they only appear in one tree out of four. Edges connecting points from the same class were assigned higher weights (1 or 0.75) because they either appear in all trees or in three out of four trees. 4 Experiments and discussions We designed our experiments to test how k-nn and rpForest graphs affect the performance of GCN Kipf and Welling (2017) and LDS Franceschi et al. (2019). Unlike GCN, LDS iteratively improves the original graph based on the validation error. For the k-nn graph, we used the same settings used by the LDS algorithm, where k was set to be 10. For the rpForest graph, we set the number of trees T to be 10. In the next section we provide an empirical examination showing why it is safe to use T = 10 as the number of trees. The number of layers in GCN was kept less than 4 layers, to prevent a drop in the performance Li et al. (2023). We used two evaluation metrics: 1) the test accuracy was used to evaluate the performance, and 2) the number of edges in the graph was used to evaluate the storage efficiency. We modified the original python files provided by GCN and LDS, to include the code for rpForest graph. We used a different font for the names of datasets. The name of a dataset is written as dataset. The code used to produce the experiments is available on https://github.com/mashaan14/RPTree-GCN. All experiments were coded in python 3 and run on a machine with 20 GB of memory and a 3.10 GHz Intel Core i5-10500 CPU. Figure 4: Measuring the standard deviation of points along the smallest eigenvector v0; T = 10 represents an elbow point. (Best viewed in color) 4.1 Using spectral analysis to set the number of trees We are constructing the graph out of the leaf nodes in the rpForest. The number of rpTrees T is a hyperparameter in rpForest. Tuning T highly influences the outcome of rpForest. We 9 Random Projection Forest Initialization for Graph Convolutional Networks (a) 3rings299 (b) ring238 (c) sparse303 (d) sparse622 Figure 5: 2-dimensional datasets used in the experiments. (Best viewed in color) can identify two problems that could occur from different values of T . The first problem occurs when T is set to a low value, which risks feeding a disconnected graph to the GCN. A disconnected graph could mean one of the classes is not connected, which negatively affects the performance of the GCN. The second problem occurs when T is set to a high value. This will lead to a graph with so many edges, which could affect the memory efficiency of our method. Spectral analysis provides an elegant way to check the graph connectivity. The eigenvec- tor v0 associated with the smallest eigenvalue λ0 of the graph Laplacian L, that eigenvector should be constant. This was stated in (Proposition 2) by von Luxburg von Luxburg (2007). She wrote "In a graph consisting of only one connected component we thus only have the constant one vector 1 as eigenvector with eigenvalue 0 ". So, we used the standard deviation of points along the smallest eigenvector v0 to see if the graph is connected or not. If the graph is connected (i.e. it contains a one connected component) the standard deviation will be small. We used the ring238 dataset, which is a 2D dataset shown in Figure 5. In Figure 4, there is a clear elbow point at T = 10, which means the graph becomes connected from this point onwards. The second problem related to the number of trees T is setting T to a large value, which affects the memory efficiency. Naturally if we start with a low T , some edges will be missing. These edges will be created as we increase T . At some point, the graph will have the same edges even if we increase T . Based on our empirical analysis we set T = 10 in all experiments. 4.2 GCN and LDS using k-nn and rpForest graphs In this experiment, we compared the performance of GCN and LDS using k-nn and rpForest graphs. We used four 2-dimensional datasets. These 2D datasets are shown in Figure 5 with their class labels. We also used four datasets retrieved from scikit-learn library Pedregosa et al. (2011). For train and test splits we used the same settings in LDS paper Franceschi et al. (2019). These settings are shown in Table 1. In Figure 6 shows the results of running GCN and LDS on 2-dimensional datasets. general, we can see LDS performed better than GCN, whether it is using k-nn graph or rpForest graph. This can be explained by how these two methods work. GCN takes the graph and runs it through the deep network, it cannot modify the graph by adding or 10 Random Projection Forest Initialization for Graph Convolutional Networks Table 1: Summary statistics of the datasets. Figure 6: Running LDS and GCN using k-nn and rpForest graph on 2D datasets; (top) test accuracy; (bottom) total weights in the adjacency matrix A. (Best viewed in color) 11 Random Projection Forest Initialization for Graph Convolutional Networks Figure 7: Running LDS and GCN using k-nn and rpForest graph on scikit-learn datasets; (top) test accuracy; (bottom) total weights in the adjacency matrix A. (Best viewed in color) removing edges. On the other hand, LDS uses the validation error to modify the graph by keeping the edges that minimize the validation error. Of course, LDS needs more time than GCN. LDS performed better when given a graph based on rpForest compared to k-nn graph. But this was not the case with 3rings299 dataset, when the linear line split by rpForest breaks the two rings in 3rings299 dataset. Also, we observed that rpForest graph has improved the performance of GCN. The total weights in the adjacency matrix A gives us a hint about memory efficiency. Graphs in LDS have more weight than GCN, because LDS keeps modifying the graph by adding more edges. Another thing to highlight is rpForest graphs have more edges than k-nn graphs. The results of experiments on scikit-learn datasets are shown in Figure 7. GCN test accuracy was very close to the one delivered by LDS in iris and digits, even though LDS has the ability to modify the graph. Another observation is that when a GCN is fed an rpForest graph it performs better compared to k-nn graph. For the total weights metric, we had the same observation across all datasets. LDS requires more storage especially when we feed it an rpForest graph, whereas GCN requires less storage. 4.3 LDS using rpForest graph with extra edges The rpForest graph connects only the points from the same leaf node. In this experiment, we investigate if we add some edges between points from different leaf nodes, would this improve the performance. Figure 8 shows an example of rpForest graph and the edges that did not appear in the rpForest graph. We want to examine if we take a percentage of these edges that did not appear in the rpForest graph, would that increase the connectivity and consequently improve the performance. By looking at Figure 9, which shows LDS test accuracies using extra edges, we can see that these extra edges did not improve the performance. Even at the most extreme case when we included 100% of these edges, the performance dropped by 50% in some datasets. 12 Random Projection Forest Initialization for Graph Convolutional Networks Figure 8: (left) an rpForest graph; (right) edges that did not appear in the rpForest graph. (Best viewed in color) Figure 9: Running LDS using rpForest with extra edges; the percentage on the x-axis represents the percentage of extra edges; (top) test accuracy; (bottom) total weights in the adjacency matrix A. (Best viewed in color) 13 Random Projection Forest Initialization for Graph Convolutional Networks The memory footprint of these extra edges was very large. These findings emphasize on the ability of rpForest to find the most important edges for classification. One advantage for our method is assigning weights proportionate to the edge's occur- rence in the rpForest. This allows non-equal weights across the graph. A potential applica- tion for our method is the analysis of complex networks in the brain Stam and Reijneveld (2007). This is a research area in neuroscience that studies the complex connectivity on neuronal circuit dynamics. The functional connectivity between brain areas can be modeled as edges on a graph. These edges must have some varying weights, which is provided by our method. 5 Conclusion Graphs are useful in modeling real-world relationships. That is why researchers were keen on extending deep learning to graphs. One of the successful applications of deep learning on graphs is graph convolutional networks (GCNs). The problem with GCN is that it needs the graph prepared beforehand. In most cases, the graph must be constructed from the dataset. A common choice to construct the graph is to use k-nearest neighbor graph. But k-nn assigns equal weights on all edges, which gives all edges the same importance during deep learning training. We present a graph based on random projection forests (rpForest) with varying weights on edges. The weight on the edge was set proportional to how many trees it appears on. The number of trees is a hyperparameter in rpForest that needs careful tuning. We performed spectral analysis that helps us to set this parameter within the right range. The experiments revealed that initializing GCN using rpForest delivers better accuracy than k-nn initialization. We also showed that the edges provided by rpForest are the best for learning and adding extra edges did not improve the performance. For future work, we can try a different weight assignment strategy other than average, a Euclidean distance for example. Another potential extension to our work could be in- vestigating how different binary space-partitioning trees would affect the performance of the GCN. Also, it is important to examine how rpForest graph would perform in different methods of graph neural networks (GNNs). References Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps and spectral techniques for em- bedding and clustering. Advances in neural information processing systems, 14, 2001. Jon Louis Bentley. Multidimensional binary search trees used for associative searching. Commun. ACM, 18(9):509–517, September 1975. doi: https://doi.org/10.1145/361002. 361007. Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs, 2013. Fan Chen, Zicheng Liu, and Ming-ting Sun. Anomaly detection by using random projection forest. In 2015 IEEE International Conference on Image Processing (ICIP), pages 1210– 1214, 2015. doi: https://doi.org/10.1109/ICIP.2015.7350992. 14 Random Projection Forest Initialization for Graph Convolutional Networks Guojing Cong, Anshul Gupta, Rodrigo Neumann, Maira de Bayser, Mathias Steiner, and Breannd ́an ́O Conch ́uir. Prediction of CO2 adsorption in nano-pores with graph neural networks, 2022. Sanjoy Dasgupta and Yoav Freund. Random projection trees and low dimensional manifolds. In Proceedings of the Fortieth Annual ACM Symposium on Theory of Computing, STOC '08, page 537–546, New York, NY, USA, 2008. Association for Computing Machinery. ISBN 9781605580470. doi: https://doi.org/10.1145/1374376.1374452. Sanjoy Dasgupta and Kaushik Sinha. Randomized partition trees for nearest neighbor search. Algorithmica, 72(1):237–263, May 2015. ISSN 0178-4617. doi: https://doi.org/ 10.1007/s00453-014-9885-5. Micha ̈el Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural net- works on graphs with fast localized spectral filtering, 2016. Luca Franceschi, Mathias Niepert, Massimiliano Pontil, and Xiao He. Learning discrete structures for graph neural networks. In Proceedings of the 36th International Conference on Machine Learning, pages 1972–1982, 2019. Yoav Freund, Sanjoy Dasgupta, Mayank Kabra, and Nakul Verma. Learning the structure of manifolds using random projections. Advances in Neural Information Processing Systems, 20, 2007. David K. Hammond, Pierre Vandergheynst, and R ́emi Gribonval. Wavelets on graphs via spectral graph theory. Applied and Computational Harmonic Analysis, 30(2):129–150, 2011. ISSN 1063-5203. doi: https://doi.org/10.1016/j.acha.2010.04.005. Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph- structured data, 2015. Omid Keivani and Kaushik Sinha. Random projection-based auxiliary information can improve tree-based nearest neighbor search. Information Sciences, 546:526–542, 2021. doi: https://doi.org/10.1016/j.ins.2020.08.054. Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks, 2017. Guohao Li, Matthias M ̈uller, Guocheng Qian, Itzel C. Delgadillo, Abdulellah Abualshour, Ali Thabet, and Bernard Ghanem. Deepgcns: Making gcns go as deep as cnns. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(6):6923–6939, 2023. doi: https://doi.org/10.1109/TPAMI.2021.3074057. Andrew Ng, Michael Jordan, and Yair Weiss. On spectral clustering: Analysis and an algorithm. Advances in neural information processing systems, 14, 2001. F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blon- del, 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. 15 Random Projection Forest Initialization for Graph Convolutional Networks Huyen Trang Phan, Ngoc Thanh Nguyen, and Dosam Hwang. Aspect-level sentiment anal- ysis: A survey of graph convolutional network methods. Information Fusion, 91:149–172, 2023. doi: https://doi.org/10.1016/j.inffus.2022.10.004. Parikshit Ram and Alexander Gray. Which space partitioning tree to use for search? Ad- vances in Neural Information Processing Systems, 26, 2013. Haotian Ren, Wei Lu, Yun Xiao, Xiaojun Chang, Xuanhong Wang, Zhiqiang Dong, and Dingyi Fang. Graph convolutional networks in language and vision: A survey. Knowledge- Based Systems, 251:109250, 2022. doi: https://doi.org/10.1016/j.knosys.2022.109250. Cornelis J Stam and Jaap C Reijneveld. Graph theoretical analysis of complex net- works in the brain. Nonlinear Biomedical Physics, 2007. doi: https://doi.org/10.1186/ 1753-4631-1-3. Pooya Tavallali, Peyman Tavallali, and Mukesh Singhal. K-means tree: an optimal clus- tering tree for unsupervised learning. The Journal of Supercomputing, 77, 2021. doi: https://doi.org/10.1007/s11227-020-03436-2. Anton Tsitsulin, John Palowitch, Bryan Perozzi, and Emmanuel M ̈uller. Graph clustering with graph neural networks. Journal of Machine Learning Research, 24(127):1–21, 2023. URL http://jmlr.org/papers/v24/20-998.html. Petar Veliˇckovi ́c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li ́o, and Yoshua Bengio. Graph attention networks, 2018. Ulrike von Luxburg. A tutorial on spectral clustering. Statistics and Computing, 17(4): 395–416, 2007. ISSN 1573-1375. doi: https://doi.org/10.1007/s11222-007-9033-z. Lai Wei, Zhengwei Chen, Jun Yin, Changming Zhu, Rigui Zhou, and Jin Liu. Adaptive graph convolutional subspace clustering. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6262–6271, June 2023. Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and Philip S. Yu. A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems, 32(1):4–24, 2021. doi: https://doi.org/10.1109/TNNLS. 2020.2978386. Donghui Yan, Yingjie Wang, Jin Wang, Honggang Wang, and Zhenpeng Li. K-nearest neighbor search by random projection forests. In 2018 IEEE International Conference on Big Data (Big Data), pages 4775–4781, 2018. doi: https://doi.org/10.1109/BigData. 2018.8622307. Donghui Yan, Yingjie Wang, Jin Wang, Honggang Wang, and Zhenpeng Li. K-nearest neighbor search by random projection forests. IEEE Transactions on Big Data, 7(1): 147–157, 2021. doi: https://doi.org/10.1109/TBDATA.2019.2908178. Yuning You, Tianlong Chen, Zhangyang Wang, and Yang Shen. L2-gcn: Layer-wise In Proceedings of the and learned efficient training of graph convolutional networks. 16 Random Projection Forest Initialization for Graph Convolutional Networks IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 2127–2135, June 2020. Lihi Zelnik-Manor and Pietro Perona. Self-tuning spectral clustering. Advances in neural information processing systems, 17, 2004. 17
http://arxiv.org/abs/2302.11312v1
2023-02-22T11:49:12
2023-02-22T11:49:12
Behavior Proximal Policy Optimization
Offline reinforcement learning (RL) is a challenging setting where existing off-policy actor-critic methods perform poorly due to the overestimation of out-of-distribution state-action pairs. Thus, various additional augmentations are proposed to keep the learned policy close to the offline dataset (or the behavior policy). In this work, starting from the analysis of offline monotonic policy improvement, we get a surprising finding that some online on-policy algorithms are naturally able to solve offline RL. Specifically, the inherent conservatism of these on-policy algorithms is exactly what the offline RL method needs to overcome the overestimation. Based on this, we propose Behavior Proximal Policy Optimization (BPPO), which solves offline RL without any extra constraint or regularization introduced compared to PPO. Extensive experiments on the D4RL benchmark indicate this extremely succinct method outperforms state-of-the-art offline RL algorithms. Our implementation is available at https://github.com/Dragon-Zhuang/BPPO.
[ "Zifeng Zhuang", "Kun Lei", "Jinxin Liu", "Donglin Wang", "Yilang Guo" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11312v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11312v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Published as a conference paper at ICLR 2023 BEHAVIOR PROXIMAL POLICY OPTIMIZATION 2 School of Engineering, Westlake University. Jinxin Liu2 Donglin Wang23† Yilang Guo4 Zifeng Zhuang12∗ Kun Lei2∗ 1 Zhejiang University. 3 Institute of Advanced Technology, Westlake Institute for Advanced Study. 4 School of Software Engineering, Beijing Jiaotong University. {zhuangzifeng,leikun,liujinxin,wangdonglin}@westlake.edu.cn, [email protected] 3 2 0 2 b e F 2 2 ] G L . s c [ 1 v 2 1 3 1 1 . 2 0 3 2 : v i X r a ABSTRACT Offline reinforcement learning (RL) is a challenging setting where existing off- policy actor-critic methods perform poorly due to the overestimation of out-of- distribution state-action pairs. Thus, various additional augmentations are proposed to keep the learned policy close to the offline dataset (or the behavior policy). In this work, starting from the analysis of offline monotonic policy improvement, we get a surprising finding that some online on-policy algorithms are naturally able to solve offline RL. Specifically, the inherent conservatism of these on-policy algorithms is exactly what the offline RL method needs to overcome the overestimation. Based on this, we propose Behavior Proximal Policy Optimization (BPPO), which solves offline RL without any extra constraint or regularization introduced compared to PPO. Extensive experiments on the D4RL benchmark indicate this extremely succinct method outperforms state-of-the-art offline RL algorithms. Our implemen- tation is available at https://github.com/Dragon-Zhuang/BPPO. 1 INTRODUCTION Typically, reinforcement learning (RL) is thought of as a paradigm for online learning, where the agent interacts with the environment to collect experience and then uses that to improve itself (Sutton et al., 1998). This online process poses the biggest obstacles to real-world RL applications because of expensive or even risky data collection in some fields (such as navigation (Mirowski et al., 2018) and healthcare (Yu et al., 2021a)). As an alternative, offline RL eliminates the online interaction and learns from a fixed dataset, collected by some arbitrary and possibly unknown process (Lange et al., 2012; Fu et al., 2020). The prospect of this data-driven mode (Levine et al., 2020) is pretty encouraging and has been placed with great expectations for solving RL real-world applications. Unfortunately, the major superiority of offline RL, the lack of online interaction, also raises another challenge. The classical off-policy iterative algorithms should be applicable to the offline setting since it is sound to regard offline RL as a more severe off-policy case. But all of them tend to underperform due to the overestimation of out-of-distribution (shorted as OOD) actions. In policy evaluation, the Q-function will poorly estimate the value of OOD state-action pairs. This in turn affects the policy improvement, where the agent trends to take the OOD actions with erroneously estimated high values, resulting in low-performance (Fujimoto et al., 2019). Thus, some solutions keep the learned policy close to the behavior policy to overcome the overestimation (Fujimoto et al., 2019; Wu et al., 2019). Most offline RL algorithms adopt online interactions to select hyperparameters. This is because offline hyperparameter selection, which selects hyperparameters without online interactions, is always an open problem lacking satisfactory solutions (Paine et al., 2020; Zhang & Jiang, 2021). Deploying the policy learned by offline RL is potentially risky in certain areas (Mirowski et al., 2018; Yu et al., 2021a) since the performance is unknown. However, if the deployed policy can guarantee better performance than the behavior policy, the risk during online interactions will be greatly reduced. This inspires us to consider how to use offline dataset to improve behavior policy with a monotonic performance guarantee. We formulate this problem as offline monotonic policy improvement. ∗Equal contribution. †Corresponding author. 1 Published as a conference paper at ICLR 2023 To analyze offline monotonic policy improvement, we introduce the Performance Difference Theorem (Kakade & Langford, 2002). During analysis, we find that the offline setting does make the monotonic policy improvement more complicated, but the way to monotonically improve policy remains unchanged. This indicates the algorithms derived from online monotonic policy improvement (such as Proximal Policy Optimization) can also achieve offline monotonic policy improvement, which further means PPO can naturally solve offline RL. Based on this surprising discovery, we propose Behavior Proximal Policy Optimization (BPPO), an offline algorithm that monotonically improves behavior policy in the manner of PPO. Owing to the inherent conservatism of PPO, BPPO restricts the ratio of learned policy and behavior policy within a certain range, similar to the offline RL methods which make the learned policy close to the behavior policy. As offline algorithms are becoming more and more sophisticated, TD3+BC (Fujimoto & Gu, 2021), which augments TD3 (Fujimoto et al., 2018) with behavior cloning (Pomerleau, 1988), reminds us to revisit the simple alternatives with potentially good performance. BPPO is such a "most simple" alternative without introducing any extra constraint or regularization on the basis of PPO. Extensive experiments on the D4RL benchmark (Fu et al., 2020) indicate BPPO has outperformed state-of-the-art offline RL algorithms. 2 PRELIMINARIES 2.1 REINFORCEMENT LEARNING Reinforcement Learning (RL) is a framework of sequential decision. Typically, this problem is formulated by a Markov decision process (MDP) M = {S, A, r, p, d0, γ}, with state space S, action space A, scalar reward function r, transition dynamics p, initial state distribution d0(s0) and discount factor γ (Sutton et al., 1998). The objective of RL is to learn a policy, which defines a distribution over action conditioned on states π (at|st) at timestep t, where at ∈ A, st ∈ S. Given this definition, the trajectory τ = (s0, a0, * * * , sT , aT ) generated by the agent's interaction with environment M can be described as a distribution Pπ (τ ) = d0(s0) (cid:81)T t=0 π (at|st) p (st+1|st, at), where T is the length of the trajectory, and it can be infinite. Then, the goal of RL can be written as an expectation under the (cid:105) trajectory distribution J (π) = Eτ ∼Pπ(τ ) t=0 γtr(st, at) . This objective can also be measured by a state-action value function Qπ (s, a), the expected discounted return given action a in state s: Qπ (s, a) = Eτ ∼Pπ(τ |s,a) . Similarly, the value function Vπ (s) (cid:105) is the expected discounted return of certain state s: Vπ (s) = Eτ ∼Pπ(τ |s) t=0 γtr(st, at)|s0 = s Then, we can define the advantage function: Aπ (s, a) = Qπ (s, a) − Vπ (s). (cid:105) t=0 γtr(st, at)|s0 = s, a0 = a (cid:104)(cid:80)T (cid:104)(cid:80)T (cid:104)(cid:80)T . 2.2 OFFLINE REINFORCEMENT LEARNING In offline RL, the agent only has access to a fixed dataset with transitions D = collected by the behavior policy πβ. Without interacting with environment M, offline RL expects the agent can infer good policy from the dataset. Behavior cloning (BC) (Pomerleau, 1988), an approach of imitation learning, can directly imitate the action of each state with supervised learning: t=1 (cid:110) (st, at, st+1, rt)N (cid:111) ˆπβ = argmax π E(s,a)∼D [log π (a|s)] . (1) Note that the performance of ˆπβ trained by behavior cloning highly depends on the quality of transitions, also the collection process of behavior policy πβ. In the rest of this paper, improving behavior policy actually refers to improving the estimated behavior policy ˆπβ, because πβ is unknown. 2.3 PERFORMANCE DIFFERENCE THEOREM Theorem 1. (Kakade & Langford, 2002) Let the discounted unnormalized visitation frequencies as ρπ (s) = (cid:80)T t=0 γtP (st = s|π) and P (st = s|π) represents the probability of the t-th state equals to s in trajectories generated by policy π. For any two policies π and π(cid:48), the performance difference J∆ (π(cid:48), π) (cid:44) J (π(cid:48)) − J (π) can be measured by the advantage function: (cid:34) T J∆ (π(cid:48), π) = Eτ ∼Pπ(cid:48) (τ ) = Es∼ρπ(cid:48) (*),a∼π(cid:48)(*|s) [Aπ(s, a)] . (2) (cid:88) (cid:35) γtAπ(st, at) t=0 2 Published as a conference paper at ICLR 2023 Derivation detail is presented in Appendix A. This theorem implies that improving policy from π to π(cid:48) can be achieved by maximizing (2). From this theorem, Trust Region Policy Optimization (TRPO) (Schulman et al., 2015a) is derived, which can guarantee the monotonic performance improvement. We also applies this theorem to formulate offline monotonic policy improvement. 3 OFFLINE MONOTONIC IMPROVEMENT OVER BEHAVIOR POLICY In this section, we theoretically analyze offline monotonic policy improvement based on Theorem 1, namely improving the ˆπβ generated by behavior cloning (1) with offline dataset D. Applying the Performance Difference Theorem to the estimated behavior policy ˆπβ, we can get J∆ (π, ˆπβ) = Es∼ρπ(*),a∼π(*|s) (cid:2)Aˆπβ (s, a)(cid:3) . (3) Maximizing this equation can obtain a policy better than behavior policy ˆπβ. But the above equation is not tractable due to the dependence of new policy's state distribution ρπ (s). For standard online method, ρπ (s) is replaced by the old state distribution ρˆπβ (s). But in offline setting, ρˆπβ (s) cannot be obtained through interaction with the environment like online situation. We use the state distribution recovered by offline dataset ρD (s) for replacement, where ρD (s) = (cid:80)T t=0 γtP (st = s|D) and P (st = s|D) represents the probability of the t-th state equals to s in offline dataset. Therefore, the approximation of J∆ (π, πβ) can be written as: (cid:98)J∆ (π, ˆπβ) = Es∼ρD(*),a∼π(*|s) (cid:2)Aˆπβ (s, a)(cid:3) . (4) To measure the difference between J∆ (π, ˆπβ) and its approximation (cid:98)J∆ (π, ˆπβ), we introduce (cid:2)Aˆπβ (s, a)(cid:3) with state distribution ρˆπβ (s). During the proof, the the midterm Es∼ρˆπβ (s),a∼π(*|s) Ea |π (a|s) − ˆπβ (a|s)| between commonly-used total variational divergence DT V (π(cid:107)ˆπβ) [s] = 1 2 policy π, ˆπβ at state s is necessary. For the total variational divergence between offline dataset D and the estimated behavior policy ˆπβ, it may not be straightforward. We can view the offline dataset D = as a deterministic distribution, and then the distance is: (cid:110) (st, at, st+1, rt)N (cid:111) t=1 Proposition 1. For offline dataset D = divergence can be expressed as DT V (D(cid:107)ˆπβ) [st] = 1 2 (1 − ˆπβ (at|st)). (cid:110) (st, at, st+1, rt)N (cid:111) and policy ˆπβ, the total variational t=1 Detailed derivation process is presented in Appendix B. Now we are ready to measure the difference: Theorem 2. Given the distance DT V (π(cid:107)ˆπβ) [s] and DT V (D(cid:107)ˆπβ) [s] = 1 2 (1 − ˆπβ (at|st)), we can derive the following bound: J∆ (π, ˆπβ) ≥ (cid:98)J∆ (π, ˆπβ) − 4γAˆπβ * max s DT V (π(cid:107)ˆπβ) [s] * − 2γAˆπβ * max s DT V (π(cid:107)ˆπβ) [s] * E s∼ρˆπβ (*) E s∼ρD(*) [DT V (π(cid:107)ˆπβ) [s]] [1 − ˆπβ (a|s)] , (5) here Aˆπβ = max s,a (cid:12) (cid:12)Aˆπβ (s, a)(cid:12) (cid:12). The proof is presented in Appendix C. Compared to the theorem in online setting (Schulman et al., 2015a; Achiam et al., 2017; Queeney et al., 2021), the second right term of Equation (5) is similar while the third term is unique for [1 − ˆπβ (a|s)] represents the difference caused by the mismatch between offline the offline. E s∼ρD(*) dataset D and ˆπβ. When ˆπβ is determined, this term is one constant. And because the inequality maxs DT V (π(cid:107)ˆπβ) [s] ≥ E [DT V (π(cid:107)ˆπβ) [s]] holds, we can claim the following conclusion: s∼ρˆπβ (*) Conclusion 1 To guarantee the true objective J∆ (π, ˆπβ) non-decreasing, we should simultaneously maxi- (cid:2)Aˆπβ (s, a)(cid:3) and minimize [maxs DT V (π(cid:107)ˆπβ) [s]], which means of- mize Es∼ρD(*),a∼π(*|s) fline dataset D is really able to monotonically improve the estimated behavior policy ˆπβ. 3 Published as a conference paper at ICLR 2023 Suppose we have improved the behavior policy ˆπβ and get one policy πk. The above theorem only guarantees that πk has higher performance than ˆπβ but we are not sure whether πk is optimal. If offline dataset D can still improve the policy πk to get a better policy πk+1, we are sure that πk+1 must be closer to the optimal policy. Thus, we further analyze the monotonic policy improvement over policy πk. Applying the Performance Difference Theorem 1 to the policy πk, J∆ (π, πk) = Es∼ρπ(*),a∼π(*|s) [Aπk (s, a)] . (6) To approximate the above equation, common manner is replacing the ρπ with old policy state distribution ρπk . But in offline RL, πk is forbidden from acting in the environment. As a result, the state distribution ρπk is impossible to estimate. Thus, the only choice without any other alternative is replacing ρπk by the state distribution from offline dataset D: (cid:98)J∆ (π, πk) = Es∼ρD(*),a∼π(*|s) [Aπk (s, a)] . (7) Intuitively, this replacement is reasonable if policy πk, ˆπβ are similar which means this approximation must be related to the distance DT V (πk(cid:107)ˆπβ) [s]. Concretely, the gap can be formulated as follows: Theorem 3. Given the distance DT V (π(cid:107)πk) [s], DT V (πk(cid:107)ˆπβ) [s] and DT V (D(cid:107)ˆπβ) [s] = 1 2 (1 − ˆπβ (a|s)), we can derive the following bound: J∆ (π, πk) ≥ (cid:98)J∆ (π, πk) − 4γAπk * max s DT V (π(cid:107)πk) [s] * − 4γAπk * max s − 2γAπk * max s DT V (π(cid:107)πk) [s] * DT V (π(cid:107)πk) [s] * E s∼ρπk (*) E s∼ρˆπβ (*) E s∼ρD(*) [DT V (π(cid:107)πk) [s]] [DT V (πk(cid:107)ˆπβ) [s]] [1 − ˆπβ (a|s)] , (8) here Aπk = max s,a |Aπk (s, a)|. The proof is presented in Appendix D. Compared to the theorem 2, one additional term related to the distance of πk, ˆπβ has been introduced. [DT V (πk(cid:107)ˆπβ) [s]] is irrelevant to the target policy π which can also be viewed The distance E s∼ρˆπβ (*) as one constant. Besides, theorem 2 is a specific case of this theorem if πk = ˆπβ. Thus, we set π0 = ˆπβ since ˆπβ is the first policy to be improved and in the following section we will no longer deliberately distinguish ˆπβ, πk. Similarly, we can derive the following conclusion: Conclusion 2 To guarantee the true objective J∆ (π, πk) non-decreasing, we should simultaneously max- imize Es∼ρD(*),a∼π(*|s) [Aπk (s, a)] and minimize [maxs DT V (π(cid:107)πk) [s]], which means of- fline dataset D is still able to monotonically improve the policy πk, where k = 0, 1, 2, * * * . 4 BEHAVIOR PROXIMAL POLICY OPTIMIZATION In this section, we derive one practical algorithm based on the theoretical results. And surprisingly, the loss function of this algorithm is the same as the online on-policy method Proximal Policy Opti- mization (PPO) (Schulman et al., 2017). Furthermore, this algorithm highly depends on the behavior policy so we name it as Behavior Proximal Policy Optimization, shorted as BPPO. According to the Conclusion 2, to monotonically improve policy πk, we should jointly optimize: Maximize π Es∼ρD(*),a∼π(*|s) [Aπk (s, a)] & Minimize π max s DT V (π(cid:107)πk) [s], (9) here k = 0, 1, 2, * * * and π0 = ˆπβ. But minimizing the total divergence between π and πk results in a trivial solution π = πk which is impossible to make improvement over πk. A more reasonable optimization objective is to maximize (cid:98)J∆ (π, πk) while constraining the divergence: Maximize π Es∼ρD(*),a∼π(*|s) [Aπk (s, a)] s.t. max s DT V (π(cid:107)πk) [s] ≤ (cid:15). (10) 4 Published as a conference paper at ICLR 2023 For the term to be maximized, we adopt importance sampling to make the expectation only depend on the action distribution of old policy πk rather than new policy π: Es∼ρD(*),a∼π(*|s) [Aπk (s, a)] = Es∼ρD(*),a∼πk(*|s) (cid:20) π (a|s) πk (a|s) (cid:21) Aπk (s, a) . (11) In this way, this term is allowed to estimate by sampling state from offline dataset s ∼ ρD (*) then sampling action with old policy a ∼ πk (*|s). For the total variational divergence, we rewrite it as max s DT V (π(cid:107)πk) [s] = max s 1 2 = max s 1 2 (cid:90) a πk (a|s) (cid:12) (cid:12) (cid:12) (cid:12) π (a|s) πk (a|s) − 1 (cid:90) |π (a|s) − πk (a|s)| da a (cid:12) (cid:12) (cid:12) (cid:12) da = 1 2 max s E a∼πk(*|s) (cid:12) (cid:12) (cid:12) (cid:12) π (a|s) πk (a|s) (cid:12) (cid:12) − 1 (cid:12) (cid:12) . (12) In offline setting, only states s ∼ ρD (*) are available and other states are unable to access. So the operation maxs can also be expressed as max . When comparing Equation (11) and (12), we find s∼ρD(*) that the state distribution, the action distribution and the policy ratio both appear. Thus we consider how to insert the divergence constraint into Equation (11). The following constraints are equivalent: max s∼ρD(*) DT V (π(cid:107)πk) [s] ≤ (cid:15) ⇐⇒ max s∼ρD(*) ⇐⇒ max s∼ρD(*) E a∼πk(*|s) clip (cid:18) π (a|s) πk (a|s) (cid:12) (cid:12) (cid:12) (cid:12) π (a|s) πk (a|s) (cid:12) (cid:12) − 1 (cid:12) (cid:12) ≤ 2(cid:15) E a∼πk(*|s) (cid:19) , 1 − 2(cid:15), 1 + 2(cid:15) , clip (x, l, u) = min (max (x, l) , u) . (13) Here the max operation is impractical to solve, so we adopt a heuristic approximation (Schulman et al., 2015a) that changes max into expectation. Then divergence constraint (13) can be inserted: Lk (π) = Es∼ρD(*),a∼πk(*|s) (cid:20) min (cid:18) π (a|s) πk (a|s) Aπk (s, a), clip (cid:18) π (a|s) πk (a|s) (cid:19) (cid:19)(cid:21) , 1 − 2(cid:15), 1 + 2(cid:15) Aπk (s, a) , (14) where the operation min makes this objective become the lower bound of Equation (11). This loss function is quite similar to PPO (Schulman et al., 2017) and the only difference is the state distribution. That is why we claim that some online on-policy algorithms are naturally able to solve offline RL. 5 DISCUSSIONS AND IMPLEMENTATION DETAILS In this section, we first directly highlight why BPPO can solve offline reinforcement learning, namely, how to overcome the overestimation issue. Then we discuss some implementation details, especially, the approximation of the advantage Aπk (s, a). Finally, we analyze the relation between BPPO and previous algorithms including Onestep RL and iterative methods. Why BPPO can solve offline RL? According to the final loss (14) and Equation (13), BPPO actually constrains the closeness by the expectation of the total variational divergence: Es∼ρD(*),a∼πk(*|s) (cid:12) (cid:12) (cid:12) (cid:12) π (a|s) πk (a|s) − 1 (cid:12) (cid:12) (cid:12) (cid:12) ≤ 2(cid:15). (15) If k = 0, this equation ensures the closeness between learned policy π and behavior policy ˆπβ. When k > 0, one issue worthy of attention is whether the closeness between learned policy π and πk can indirectly constrain the closeness between π and ˆπβ. To achieve this, also to prevent the learned policy π completely away from ˆπβ, we introduce a technique called clip ratio decay. As the policy updates, the clip ratio (cid:15) gradually decreases until the certain training step (200 steps in our paper): (cid:15)i = (cid:15)0 × (σ)i IF i ≤ 200 ELSE (cid:15)i = (cid:15)200 (16) here i denotes the training steps, (cid:15)0 denotes the initial clip ratio, and σ ∈ (0, 1] is the decay coefficient. 5 Published as a conference paper at ICLR 2023 From Figure 1(a) and 1(b), we can find that the ratio πk/ˆπβ may be out of the certain range [1 − 2(cid:15), 1 + 2(cid:15)] (the region surrounded by the dotted pink and purple line) without clip ratio de- cay technique (also σ = 1). But the ra- tio stays within the range stably when the decay is applied which means the Equation (15) can ensure the close- ness between the final learned policy by BPPO and behavior policy. (a) hopper-medium (b) hopper-medium-replay Figure 1: Visualization of the importance weight between the updated policy πk and the estimated behavior policy ˆπβ. How to approximate the advantage? When calculating the loss function (14), the only difference from online situation is the approximation of advantage Aπk (s, a). In online RL, GAE (Generalized Advantage Estimation) (Schulman et al., 2015b) approximates the advantage Aπk using the data collected by policy πk. Obviously, GAE is inappropriate in offline situations due to the existence of online interaction. As a result, BPPO has to calculate the advantage Aπk = Qπk − Vπβ in off-policy manner where Qπk is calculated by Q-learning (Watkins & Dayan, 1992) using offline dataset D and Vπβ is calculated by fitting returns (cid:80)T t=0 γtr(st, at) with MSE loss. Note that the value function is Vπβ rather than Vπk since the state distribution has been changed into s ∼ ρD (*) in Theorem 2, 3. Algorithm 1 Behavior Proximal Policy Optimization (BPPO) 1: Estimate behavior policy ˆπβ by behavior cloning; 2: Calculate Q-function Qπβ by SARSA; 3: Calculate value function Vπβ by fitting returns; 4: Initialize k = 0 and set πk ← πβ & Qπk = Qπβ ; 5: for i = 0, 1, 2, * * * , I do Aπk = Qπk − Vπβ 6: Update the policy π by maximizing Lk (π); 7: if J(π) > J(πk) then 8: 9: 10: 11: 12: 13: 14: end if 15: 16: end for Set k = k + 1 & πk ← π; if advantage replacement then Calculate Qπk by Q-learning; Qπk = Qπβ ; end if else Besides, we have another simple choice based on the results that πk closes to the πβ with the help of clip ratio decay. We can replace all the Aπk with the Aπβ . This re- placement may introduce some er- ror but the benefit is that Aπβ must be more accurate than Aπk since off-policy estimation is potentially dangerous, especially in offline set- ting. We conduct a series of exper- iments in Section 7.2 to compare these two implementations and find that the latter one, advantage re- placement, is better. Based on the above implementation details, we summarize the whole workflow of BPPO in Algorithm 1. What is the relation between BPPO, Onestep RL and iterative methods? Since BPPO is highly related to on-policy algorithm, it may be naturally associated with Onestep RL (Brandfonbrener et al., 2021) that solves offline RL without off-policy evaluation. If we remove lines 8∼15 in Algorithm 1, we get Onestep version of BPPO, which means only the behavior policy ˆπβ is im- proved. In contrast, BPPO also improves πk, the pol- icy that has been improved over ˆπβ. The right figure shows the difference between BPPO and its Onestep ver- sion: Onestep strictly requires the new policy close to ˆπβ, while BPPO appropriately loosens this restriction. Figure 2: The difference between Onestep BPPO (left) and BPPO (right), where the decreasing circle corresponds to (cid:15) decay. If we calculate the Q-function in off-policy manner, namely, line 13 in Algorithm 1, the method becomes an iterative style. If we adopt advantage replacement, line 11, BPPO only estimates the advantage function once but updates many policies, from ˆπβ to πk. Onestep RL estimates the Q- function once and use it to update estimated behavior policy. Iterative methods estimate Q-function several times and then update the corresponding policy. Strictly speaking, BPPO is neither an Onestep nor iterative method. BPPO is a special case between Onestep and iterative. 6 N XSGDWHVWHSV ,PSRUWDQFH5DWLRk/%332ZLWKGHFD\%332ZLWKRXWGHFD\1+212N XSGDWHVWHSV ,PSRUWDQFH5DWLRk/π0ොπβε0π0ොπβπ1π2ε1ε2ε0 Published as a conference paper at ICLR 2023 6 RELATED WORK Offline Reinforcement Learning Most of the online off-policy methods fail or underperform in offline RL due to extrapolation error (Fujimoto et al., 2019) or distributional shift (Levine et al., 2020). Thus most offline algorithms typically augment existing off-policy algorithms with a penalty measuring divergence between the policy and the offline data (or behavior policy). Depending on how to implement this penalty, a variety of methods were proposed such as batch constrained (Fujimoto et al., 2019), KL-control (Jaques et al., 2019; Liu et al., 2022b), behavior-regularized (Wu et al., 2019; Fujimoto & Gu, 2021) and policy constraint (Kumar et al., 2019; Levine et al., 2020; Kostrikov et al., 2021). Other methods augment BC with a weight to make the policy favor high advantage actions (Wang et al., 2018; Siegel et al., 2020; Peng et al., 2019; Wang et al., 2020). Some methods extra introduced Uncertainty estimation (An et al., 2021b; Bai et al., 2022) or conservative (Kumar et al., 2020; Yu et al., 2021b; Nachum et al., 2019) estimation to overcome overestimation. Monotonic Policy Improvement Monotonic policy improvement in online RL was first introduced by Kakade & Langford (2002). On this basis, two classical on-policy methods Trust Region Policy Optimization (TRPO) (Schulman et al., 2015a) and Proximal Policy Optimization (PPO) (Schulman et al., 2017) were proposed. Afterwards, monotonic policy improvement has been extended to constrained MDP (Achiam et al., 2017), model-based method (Luo et al., 2018) and off-policy RL (Queeney et al., 2021; Meng et al., 2021). The main idea behind BPPO is to regularize each policy update by restricting the divergence. Such regularization is often used in unsupervised skill learning (Liu et al., 2021; 2022a; Tian et al., 2021) and imitation learning (Xiao et al., 2019; Kang et al., 2021). Xu et al. (2021) mentions that offline algorithms lack guaranteed performance improvement over the behavior policy but we are the first to introduce monotonic policy improvement to solve offline RL. 7 EXPERIMENTS We conduct a series of experiments on the Gym (v2), Adroit (v1), Kitchen (v0) and Antmaze (v2) from D4RL (Fu et al., 2020) to evaluate the performance and analyze the design choice of Behavior Proximal Policy Optimization (BPPO). Specifically, we aim to answer: 1) How does BPPO compare with previous Onestep and iterative methods? 2) What is the superiority of BPPO over its Onestep and iterative version? 3) What is the influence of hyperparameters clip ratio (cid:15) and clip ratio decay σ? Table 1: The normalized results on D4RL Gym, Adroit, and Kitchen. We bold the best results and BPPO is calculated by averaging mean returns over 10 evaluation trajectories and five random seeds. The symbol * specifies that the results are reproduced by running the offical open-source code. Suite Environment Iterative methods Onestep methods CQL TD3+BC Onestep RL IQL BC (Ours) BPPO (Ours) halfcheetah-medium-v2 hopper-medium-v2 walker2d-medium-v2 halfcheetah-medium-replay-v2 hopper-medium-replay-v2 walker2d-medium-replay-v2 halfcheetah-medium-expert-v2 hopper-medium-expert-v2 walker2d-medium-expert-v2 Gym locomotion-v2 total pen-human-v1 hammer-human-v1 door-human-v1 relocate-human-v1 pen-cloned-v1 hammer-cloned-v1 door-cloned-v1 relocate-cloned-v1 adroit-v1 total kitchen-complete-v0 kitchen-partial-v0 kitchen-mixed-v0 kitchen-v0 total locomotion+kitchen+adroit 44.0 58.5 72.5 45.5 95.0 77.2 91.6 105.4 108.8 698.5 37.5 4.4 9.9 0.2 39.2 2.1 0.4 -0.1 93.6 43.8 49.8 51.0 144.6 936.7 Gym Adroit Kitchen 48.3 59.3 83.7 44.6 60.9 81.8 90.7 98.0 110.1 677.4 8.4* 2.0* 0.5* -0.3* 41.5* 0.8* -0.4* -0.3* 52.2 0.0* 22.5* 25.0* 47.5 777.1 7 48.4 59.6 81.8 38.1 97.5 49.5 93.4 103.3 113.0 684.6 90.7* 0.2* -0.1* 2.1* 60.0 2.0 0.4 -0.1 155.2 2.0* 35.5* 28.0* 65.5 905.3 47.4 66.3 78.3 44.2 94.7 73.9 86.7 91.5 109.6 692.4 71.5 1.4 4.3 0.1 37.3 2.1 1.6 -0.2 118.1 62.5 46.3 51.0 159.8 43.5±0.1 61.3±3.2 74.2±4.6 40.1±0.1 66.0±18.3 33.4±11.2 64.4±8.5 64.9±7.7 107.7±3.5 555.5±57.2 61.6±9.7 2.0±0.9 7.8±3.5 0.1±0.0 58.8±16.0 0.5±0.2 0.9±0.8 -0.1±0.0 131.6±31.1 55.0±11.5 44.0±4.9 45.0±1.6 144.0±18.0 44.0±0.2 93.9±3.9 83.6±0.9 41.0±0.6 92.5±3.4 77.6±7.8 92.5±1.9 112.8±1.7 113.1±2.4 751.0±21.8 117.8±11.9 14.9±3.2 25.9±7.5 4.8±2.2 110.8±6.3 8.9±5.1 6.2±1.6 1.9±1.0 291.4±38.8 91.5±8.9 57.0±2.4 62.5±6.7 211.0±18.0 970.3 831.1±106.3 1253.4±78.6 Published as a conference paper at ICLR 2023 7.1 RESULTS ON D4RL BENCHMARKS We first compare BPPO with iterative methods including CQL (Kumar et al., 2020) and TD3+BC (Fujimoto & Gu, 2021), and Onestep methods including Onestep RL (Brandfonbrener et al., 2021) and IQL (Kostrikov et al., 2021). Most results of Onestep RL, IQL, CQL, TD3+BC are extracted from the paper IQL and the results with symbol * are reproduced by ourselves. Since BPPO first estimates a behavior policy and then improves it, we list the results of BC on the left side of BPPO. From Table 1, we find BPPO achieves comparable performance on each task of Gym and slightly outperforms when considering the total performance. For Adroit and Kitchen, BPPO prominently outperforms other methods. Compared to BC, BPPO achieves 51% performance improvement on all D4RL tasks. Interestingly, our implemented BC on Adroit and Kitchen nearly outperform the baselines, which may imply improving behavior policy rather than learning from scratch is better. Next, we evaluate whether BPPO can solve more difficult tasks with sparse reward. For Antmaze tasks, we also compare BPPO with Decision Transformer (DT) (Chen et al., 2021), RvS-G and RvS-R (Emmons et al., 2021). DT conditions on past trajectories to predict future actions using Transformer. RvS-G and RvS-R condition on goals or rewards to learn policy via supervised learning. Table 2: The normalized results on D4RL Antmaze tasks. The results of CQL and IQL are extracted from paper IQL while others are extracted from paper RvS. In the BC column, symbol * specifies the Filtered BC (Emmons et al., 2021) which removes the failed trajectories instead of standard BC. Environment CQL TD3+BC Onestep Umaze-v2 Umaze-diverse-v2 Medium-play-v2 Medium-diverse-v2 Large-play-v2 Large-diverse-v2 74.0 84.0 61.2 53.7 15.8 14.9 78.6 71.4 10.6 3.0 0.2 0.0 Total 303.6 163.8 64.3 60.7 0.3 0.0 0.0 0.0 61.0 IQL 87.5 62.2 71.2 70.0 39.6 47.5 DT 65.6 51.2 1.0 0.6 0.0 0.2 RvS-R RvS-G BC (Ours) BPPO (Ours) 64.4 70.1 4.5 7.7 3.5 3.7 65.4 60.9 58.1 67.3 32.4 36.9 51.7±20.4 48.3±17.2 16.7±5.2* 33.3±10.3* 48.3±11.7* 46.7±20.7* 95.0±5.5 91.7±4.1 51.7±7.5 70.0±6.3 86.7±8.2 88.3±4.1 378.0 118.6 153.9 321.0 245.0±85.5 483.3±35.7 As shown in Table 2, BPPO can outperform most tasks and is significantly better than other algorithms in the total performance of all tasks. We adopt Filtered BC in last four tasks, where only the successful trajectories is selected for behavior cloning. The performance of CQL and IQL is very impressive since no additional operations or information is introduced. RvS-G uses the goal to overcome the sparse reward challenge. The superior performance demonstrates the BPPO can also considerably improve the policy performance based on (Filtered) BC on tasks with sparse reward. 7.2 THE SUPERIORITY OF BPPO OVER ONESTEP AND ITERATIVE VERSION BPPO v.s. Onestep BPPO We choose to improve policy πk after it has been improved over behavior policy ˆπβ because Theorem 2 provides no guarantee of optimality. Besides, BPPO and Onestep RL are easily to be connected because BPPO is based on online method while Onestep RL solves offline RL without off-policy evaluation. Although Figure 2 gives an intuitive interpretation to show the advantage of BPPO over its Onestep version, the soundness is relatively weak. We further analyze the superiority of BPPO over its Onestep version empirically. (a) hopper-medium-v2 (b) hopper-medium-replay-v2 (c) hopper-medium-expert-v2 Figure 3: The comparison between BPPO and Onestep BPPO. The hyperparameters of both methods are tuned through the grid search, and then we exhibit their learning curves with the best performance. 8 *UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ%3322QHVWHS%332%&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ%3322QHVWHS%332%&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ%3322QHVWHS%332%& Published as a conference paper at ICLR 2023 In Figure3, we observe that both BPPO and Onestep BPPO can outperform the BC (the orange dotted line). This indicates both of them can achieve monotonic improvement over behavior policy ˆπβ. Another important result is that BPPO is stably better than Onestep BPPO and this demonstrates two key points: First, improving πk to fully utilize information is necessary. Second, compared to strictly restricting the learned policy close to the behavior policy, appropriate looseness is useful. BPPO v.s. iterative BPPO When approximating the advantage Aπk , we have two implementation choices. One is advantage replacement (line 11 in Algorithm 1). The other one is off-policy Q-estimation (line 13 in Algorithm 1), corresponding to iterative BPPO. Both of them will introduce extra error compared to true Aπk . The error of the former comes from replacement Aπk ← Aπβ while the latter comes from the off-policy estimation itself. We compare BPPO with iterative BPPO in Figure 4 and find that advantage replacement, namely BPPO, is obviously better. (a) halfcheetah-medium-replay (b) walker2d-medium-replay (c) halfcheetah-medium-expert (d) walker2d-medium-expert Figure 4: The comparison between BPPO (the green curves) and its iterative versions in which we update the Q network to approximate Qπk instead of Qπβ using in BPPO. In particular, we use "BPPOof f =5" to denote that we update Q-network for 5 gradient steps per policy training step. 7.3 ABLATION STUDY OF DIFFERENT HYPERPARAMETERS In this section, we evaluate the influence of clip ratio (cid:15) and its decay rate σ. Clip ratio restricts the policy close to behavior policy and it directly solves the offline overestimation. Since (cid:15) also appears in PPO, we can set it properly to avoid catastrophic performance, which is the unique feature of BPPO. σ gradually tightens this restriction during policy improvement. We show how these coefficients contribute to the performance of BPPO and more ablations can be found in Appendix G, I, and H. (a) hopper-medium-replay (b) hopper-medium-expert (c) hopper-medium-replay (d) hopper-medium-expert Figure 5: Ablation study on clip ratio (cid:15) (5(a), 5(b)) and clip ratio decay σ (5(c), 5(d)). Firstly, we analyze five values of the clip coefficient (cid:15) = (0.05, 0.1, 0.2, 0.25, 0.3). In most envi- ronment, like hopper-medium-expert 5(b), different (cid:15) shows no significant difference so we choose (cid:15) = 0.25, while only (cid:15) = 0.1 is obviously better than others for hopper-medium-replay. We then demonstrate how the clip ratio decay (σ = 0.90, 0.94, 0.96, 0.98, 1.00) affects the performance of BPPO. As shown in Figure 5(c), a low decay rate (σ = 0.90) or no decay (σ = 1.00) may cause crash during training. We use σ = 0.96 to achieve stable policy improvement for all environments. 8 CONCLUSION Behavior Proximal Policy Optimization (BPPO) starts from offline monotonic policy improvement, using the loss function of PPO to elegantly solve offline RL without any extra constraint or regu- larization introduced. This is because the inherent conservatism from the on-policy method PPO is naturally suitable to overcome overestimation in offline reinforcement learning. BPPO is very simple to implement and achieves superior performance on D4RL dataset. 9 *UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ%332%332off=5%332off=10%332off=20%332off=100%&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ     %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ     %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ     %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ     %& Published as a conference paper at ICLR 2023 9 ACKNOWLEDGEMENTS This work was supported by the National Science and Technology Innovation 2030 - Major Project (Grant No. 2022ZD0208800), and NSFC General Program (Grant No. 62176215). REFERENCES Joshua Achiam, David Held, Aviv Tamar, and Pieter Abbeel. Constrained policy optimization. In International conference on machine learning, pp. 22–31. PMLR, 2017. Gaon An, Seungyong Moon, Jang-Hyun Kim, and Hyun Oh Song. Uncertainty-based offline reinforcement learning with diversified q-ensemble. Advances in neural information processing systems, 34:7436–7447, 2021a. Gaon An, Seungyong Moon, Jang-Hyun Kim, and Hyun Oh Song. Uncertainty-based offline reinforcement learning with diversified q-ensemble. Advances in neural information processing systems, 34:7436–7447, 2021b. Chenjia Bai, Lingxiao Wang, Zhuoran Yang, Zhihong Deng, Animesh Garg, Peng Liu, and Zhaoran Wang. Pessimistic bootstrapping for uncertainty-driven offline reinforcement learning. arXiv preprint arXiv:2202.11566, 2022. David Brandfonbrener, Will Whitney, Rajesh Ranganath, and Joan Bruna. Offline rl without off-policy evaluation. Advances in Neural Information Processing Systems, 34:4933–4946, 2021. Lili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee, Aditya Grover, Misha Laskin, Pieter Abbeel, Aravind Srinivas, and Igor Mordatch. Decision transformer: Reinforcement learning via sequence modeling. Advances in neural information processing systems, 34:15084–15097, 2021. Xi Chen, Ali Ghadirzadeh, Tianhe Yu, Yuan Gao, Jianhao Wang, Wenzhe Li, Bin Liang, Chelsea Finn, and Chongjie Zhang. Latent-variable advantage-weighted policy optimization for offline rl. arXiv preprint arXiv:2203.08949, 2022. Ching-An Cheng, Tengyang Xie, Nan Jiang, and Alekh Agarwal. Adversarially trained actor critic for offline reinforcement learning. arXiv preprint arXiv:2202.02446, 2022. Scott Emmons, Benjamin Eysenbach, Ilya Kostrikov, and Sergey Levine. Rvs: What is essential for offline rl via supervised learning? arXiv preprint arXiv:2112.10751, 2021. Logan Engstrom, Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Firdaus Janoos, Larry Rudolph, and Aleksander Madry. Implementation matters in deep rl: A case study on ppo and trpo. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id=r1etN1rtPB. Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4rl: Datasets for deep data-driven reinforcement learning. arXiv preprint arXiv:2004.07219, 2020. Scott Fujimoto and Shixiang Shane Gu. A minimalist approach to offline reinforcement learning. Advances in neural information processing systems, 34:20132–20145, 2021. Scott Fujimoto, Herke Hoof, and David Meger. Addressing function approximation error in actor- critic methods. In International conference on machine learning, pp. 1587–1596. PMLR, 2018. Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In International Conference on Machine Learning, pp. 2052–2062. PMLR, 2019. Natasha Jaques, Asma Ghandeharioun, Judy Hanwen Shen, Craig Ferguson, Agata Lapedriza, Noah Jones, Shixiang Gu, and Rosalind Picard. Way off-policy batch deep reinforcement learning of implicit human preferences in dialog. arXiv preprint arXiv:1907.00456, 2019. Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In In Proc. 19th International Conference on Machine Learning. Citeseer, 2002. 10 Published as a conference paper at ICLR 2023 Yachen Kang, Jinxin Liu, Xin Cao, and Donglin Wang. Off-dynamics inverse reinforcement learning from hetero-domain. arXiv preprint arXiv:2110.11443, 2021. Ilya Kostrikov, Ashvin Nair, and Sergey Levine. Offline reinforcement learning with implicit q-learning. arXiv preprint arXiv:2110.06169, 2021. Aviral Kumar, Justin Fu, Matthew Soh, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. Advances in Neural Information Processing Systems, 32, 2019. Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. Advances in Neural Information Processing Systems, 33:1179–1191, 2020. Sascha Lange, Thomas Gabel, and Martin Riedmiller. Batch reinforcement learning. In Reinforcement learning, pp. 45–73. Springer, 2012. Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020. Jinxin Liu, Hao Shen, Donglin Wang, Yachen Kang, and Qiangxing Tian. Unsupervised domain adap- tation with dynamics-aware rewards in reinforcement learning. Advances in Neural Information Processing Systems, 34:28784–28797, 2021. Jinxin Liu, Donglin Wang, Qiangxing Tian, and Zhengyu Chen. Learn goal-conditioned policy with intrinsic motivation for deep reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 7558–7566, 2022a. Jinxin Liu, Hongyin Zhang, and Donglin Wang. Dara: Dynamics-aware reward augmentation in offline reinforcement learning. arXiv preprint arXiv:2203.06662, 2022b. Yuping Luo, Huazhe Xu, Yuanzhi Li, Yuandong Tian, Trevor Darrell, and Tengyu Ma. Algorithmic framework for model-based deep reinforcement learning with theoretical guarantees. arXiv preprint arXiv:1807.03858, 2018. Wenjia Meng, Qian Zheng, Yue Shi, and Gang Pan. An off-policy trust region policy optimiza- IEEE tion method with monotonic improvement guarantee for deep reinforcement learning. Transactions on Neural Networks and Learning Systems, 33(5):2223–2235, 2021. Piotr Mirowski, Matt Grimes, Mateusz Malinowski, Karl Moritz Hermann, Keith Anderson, Denis Teplyashin, Karen Simonyan, Andrew Zisserman, Raia Hadsell, et al. Learning to navigate in cities without a map. Advances in Neural Information Processing Systems, 31, 2018. Ofir Nachum, Bo Dai, Ilya Kostrikov, Yinlam Chow, Lihong Li, and Dale Schuurmans. Algaedice: Policy gradient from arbitrary experience. arXiv preprint arXiv:1912.02074, 2019. Tom Le Paine, Cosmin Paduraru, Andrea Michi, Caglar Gulcehre, Konrad Zolna, Alexander Novikov, Ziyu Wang, and Nando de Freitas. Hyperparameter selection for offline reinforcement learning. arXiv preprint arXiv:2007.09055, 2020. Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32, 2019. Xue Bin Peng, Aviral Kumar, Grace Zhang, and Sergey Levine. Advantage-weighted regression: Simple and scalable off-policy reinforcement learning. arXiv preprint arXiv:1910.00177, 2019. Dean A Pomerleau. Alvinn: An autonomous land vehicle in a neural network. Advances in neural information processing systems, 1, 1988. James Queeney, Yannis Paschalidis, and Christos G Cassandras. Generalized proximal policy optimization with sample reuse. Advances in Neural Information Processing Systems, 34:11909– 11919, 2021. 11 Published as a conference paper at ICLR 2023 John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International conference on machine learning, pp. 1889–1897. PMLR, 2015a. John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015b. John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. Noah Y Siegel, Jost Tobias Springenberg, Felix Berkenkamp, Abbas Abdolmaleki, Michael Neunert, Thomas Lampe, Roland Hafner, Nicolas Heess, and Martin Riedmiller. Keep doing what worked: Behavioral modelling priors for offline reinforcement learning. arXiv preprint arXiv:2002.08396, 2020. Richard S Sutton, Andrew G Barto, et al. Introduction to reinforcement learning. 1998. Qiangxing Tian, Guanchu Wang, Jinxin Liu, Donglin Wang, and Yachen Kang. Independent skill In Proceedings of the Twenty-Ninth International transfer for deep reinforcement learning. Conference on International Joint Conferences on Artificial Intelligence, pp. 2901–2907, 2021. Qing Wang, Jiechao Xiong, Lei Han, Han Liu, Tong Zhang, et al. Exponentially weighted imitation learning for batched historical data. Advances in Neural Information Processing Systems, 31, 2018. Ziyu Wang, Alexander Novikov, Konrad Zolna, Josh S Merel, Jost Tobias Springenberg, Scott E Reed, Bobak Shahriari, Noah Siegel, Caglar Gulcehre, Nicolas Heess, et al. Critic regularized regression. Advances in Neural Information Processing Systems, 33:7768–7778, 2020. Christopher JCH Watkins and Peter Dayan. Q-learning. Machine learning, 8:279–292, 1992. Yifan Wu, George Tucker, and Ofir Nachum. Behavior regularized offline reinforcement learning. arXiv preprint arXiv:1911.11361, 2019. Huang Xiao, Michael Herman, Joerg Wagner, Sebastian Ziesche, Jalal Etesami, and Thai Hong Linh. Wasserstein adversarial imitation learning. arXiv preprint arXiv:1906.08113, 2019. Haoran Xu, Xianyuan Zhan, Jianxiong Li, and Honglei Yin. Offline reinforcement learning with soft behavior regularization. arXiv preprint arXiv:2110.07395, 2021. Rui Yang, Chenjia Bai, Xiaoteng Ma, Zhaoran Wang, Chongjie Zhang, and Lei Han. Rorl: Robust offline reinforcement learning via conservative smoothing. arXiv preprint arXiv:2206.02829, 2022. Chao Yu, Jiming Liu, Shamim Nemati, and Guosheng Yin. Reinforcement learning in healthcare: A survey. ACM Computing Surveys (CSUR), 55(1):1–36, 2021a. Tianhe Yu, Aviral Kumar, Rafael Rafailov, Aravind Rajeswaran, Sergey Levine, and Chelsea Finn. Combo: Conservative offline model-based policy optimization. Advances in neural information processing systems, 34:28954–28967, 2021b. Siyuan Zhang and Nan Jiang. Towards hyperparameter-free policy selection for offline reinforcement learning. Advances in Neural Information Processing Systems, 34:12864–12875, 2021. 12 Published as a conference paper at ICLR 2023 A PROOF OF PERFORMANCE DIFFERENCE THEOREM 1 Proof. First note that Aπ(s, a) = Es(cid:48)∼p(s(cid:48)|s,a) [r(s, a) + γVπ (s(cid:48)) − Vπ(s)] . Therefore, (cid:35) γtAπ (st, at) γt (r (st, at) + γVπ (st+1) − Vπ (st)) (cid:35) Eτ ∼Pπ(cid:48) =Eτ ∼Pπ(cid:48) (cid:34) T (cid:88) t=0 (cid:34) T (cid:88) t=0 (cid:34) =Eτ ∼Pπ(cid:48) −Vπ (s0) + (cid:35) γtr (st, at) T (cid:88) t=0 = − Es0 [Vπ (s0)] + Eτ ∼Pπ(cid:48) (cid:35) γtr (st, at) (cid:34) T (cid:88) t=0 = − J (π) + J (π(cid:48)) (cid:44)J∆ (π(cid:48), π) (17) Now the first equation in 1 has been proved. For the proof of second equation, we decompose the expectation over the trajectory into the sum of expectation over state-action pairs: Eτ ∼Pπ(cid:48) (cid:35) γtAπ (st, at) (cid:34) T (cid:88) t=0 T (cid:88) (cid:88) (cid:104) t=0 (cid:88) s (cid:34) T (cid:88) P (st = s|π(cid:48)) Ea∼π(cid:48)(*|s) (cid:2)γtAπ (s, a)(cid:3) (cid:105) (cid:35) γtP (st = s|π(cid:48)) Ea∼π(cid:48)(*|s) [Aπ (s, a)] s (cid:88) t=0 (cid:104) ρπ(cid:48)(s)Ea∼π(cid:48)(*|s) [Aπ (s, a)] (cid:105) = = = s =Es∼ρπ(cid:48) (s),a∼π(cid:48)(*|s) [Aπ (s, a)] (18) B PROOF OF PROPOSITION 1 Proof. For state-action pair (st, at) ∈ D, it can be viewed as one deterministic policy that satisfies πD (a = at|st) = 1 and πD (a (cid:54)= at|st) = 0. So [P (at) |πD (at|st) − ˆπβ (at|st)| + P (a (cid:54)= at) |πD (a|st) − ˆπβ (a|st)|] da (cid:90) Ea |πD (a|st) − ˆπβ (a|st)| (cid:90) DT V (D(cid:107)ˆπβ) [st] = DT V (πD(cid:107)ˆπβ) [st] 1 2 1 2 1 2 1 2 1 2 (1 − ˆπβ (at|st)) (cid:90) = = = = = [P (at) (1 − ˆπβ (at|st)) + P (a (cid:54)= at) ˆπβ (a (cid:54)= at|st)] da [P (at) (1 − ˆπβ (at|st)) + (1 − P (at)) (1 − ˆπβ (at|st))] da C PROOF OF THEOREM 2 The definition of ̄Aπ,ˆπβ (s) is as follows: ̄Aπ,ˆπβ (s) = Ea∼π(*|s) (cid:2)Aˆπβ (s, a)(cid:3) 13 (19) (20) Published as a conference paper at ICLR 2023 Note that the expectation of advantage function Aˆπβ (s, a) depends on another policy π rather than ˆπβ, so ̄Aπ,ˆπβ (s) (cid:54)= 0. Furthermore, given the ̄Aπ,ˆπβ (s), the performance difference in Theorem 2 can be rewritten as: J∆ (π, ˆπβ) = Es∼ρπ(*),a∼π(*|s) (cid:98)J∆ (π, ˆπβ) = Es∼ρD(*),a∼π(*|s) (cid:2)Aˆπβ (s, a)(cid:3) = Es∼ρπ(*) (cid:2)Aˆπβ (s, a)(cid:3) = Es∼ρD(*) (cid:2) ̄Aπ,ˆπβ (s)(cid:3) (cid:2) ̄Aπ,ˆπβ (s)(cid:3) Lemma 1. For all state s, (cid:12) ̄Aπ,ˆπβ (s)(cid:12) (cid:12) (cid:12) ≤ 2 max a (cid:12)Aˆπβ (s, a)(cid:12) (cid:12) (cid:12) * DT V (π(cid:107)ˆπβ) [s] (21) (22) (23) Proof. The expectation of advantage function Aπ (s, a) over its policy π equals zero: Ea∼π [Aπ(s, a)] = Ea∼π [Qπ(s, a) − Vπ(s)] = Ea∼π [Qπ(s, a)] − Vπ(s) = 0 (24) Thus, with the help of Hölder's inequality, we get (cid:12) ̄Aπ,ˆπβ (s)(cid:12) (cid:12) (cid:12) = (cid:12) (cid:2)Aˆπβ (s, a)(cid:3) − Ea∼ˆπβ (*|s) ≤ (cid:107)π (a|s) − ˆπβ (a|s)(cid:107)1 =2DT V (π(cid:107)ˆπβ) [s] * max (cid:12)Ea∼π(*|s) (cid:13) (cid:13)Aˆπβ (s, a)(cid:13) (cid:13)∞ (cid:12)Aˆπβ (s, a)(cid:12) (cid:12) (cid:12) , ∀s a (cid:2)Aˆπβ (s, a)(cid:3)(cid:12) (cid:12) (25) Lemma 2. ((Achiam et al., 2017)) The divergence between two unnormalized visitation frequencies, (cid:107)ρπ (*) − ρπ(cid:48) (*)(cid:107)1 , is bounded by an average total variational divergence of the policies π and π(cid:48): (cid:107)ρπ (*) − ρπ(cid:48) (*)(cid:107)1 ≤ 2γ E s∼ρπ(cid:48) (*) [DT V (π(cid:107)π(cid:48)) [s]] (26) Given this powerful lemma and other preparation, now we are able to derive the bound of (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)J∆ (π, ˆπβ) − (cid:98)J∆ (π, ˆπβ) (cid:12): (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)J∆ (π, ˆπβ) − (cid:98)J∆ (π, ˆπβ) (cid:12) = (cid:12) (cid:16) (cid:12) (cid:12) (cid:12) Es∼ρπ(*) (cid:2) ̄Aπ,ˆπβ (s)(cid:3) − Es∼ρˆπβ (*) (cid:12) (cid:12) (cid:12) Es∼ρπ(*) (cid:2) ̄Aπ,ˆπβ (s)(cid:3) − Es∼ρD(*) (cid:16) (cid:2) ̄Aπ,ˆπβ (s)(cid:3)(cid:17) + Es∼ρˆπβ (cid:2) ̄Aπ,ˆπβ (s)(cid:3) (cid:12) (cid:12) (cid:12) (cid:2) ̄Aπ,ˆπβ (s)(cid:3) − Es∼ρD(*) = (cid:2) ̄Aπ,ˆπβ (s)(cid:3)(cid:17) (cid:12) (cid:12) (cid:12) (cid:12) (27) Based on Hölder's inequality and lemma 2, we can bound the first term as follows: (cid:16) (cid:12) (cid:12) (cid:12) (cid:12) Es∼ρπ(*) ≤2γ E s∼ρˆπβ (*) (cid:2) ̄Aπ,ˆπβ (s)(cid:3)(cid:17) (cid:12) (cid:2) ̄Aπ,ˆπβ (s)(cid:3) − Es∼ρˆπβ (*) (cid:12) (cid:12) ̄Aπ,ˆπβ (s)(cid:12) [DT V (π(cid:107)ˆπβ) [s]] * max (cid:12) (cid:12) (cid:12) (cid:12) s ≤ (cid:13) (cid:13)ρπ (*) − ρˆπβ (*)(cid:13) (cid:13)1 (cid:13) ̄Aπ,ˆπβ (s)(cid:13) (cid:13) (cid:13)∞ (28) For the second term, we can derive similar bound and furthermore let DT V (D(cid:107)ˆπβ) [s] = 1 2 (1 − ˆπβ (at|st)). Finally, using lemma 1, we get (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)J∆ (π, ˆπβ) − (cid:98)J∆ (π, ˆπβ) (cid:12) ≤2γ max s (cid:12) (cid:12) ̄Aπ,ˆπβ (s)(cid:12) (cid:12) =2γ max s (cid:12) ̄Aπ,ˆπβ (s)(cid:12) (cid:12) (cid:12) (cid:32) E s∼ρˆπβ (*) (cid:32) E s∼ρˆπβ (*) (cid:33) [DT V (π(cid:107)ˆπβ) [s]] + E s∼ρD(*) [DT V (D(cid:107)ˆπβ) [s]] [DT V (π(cid:107)ˆπβ) [s]] + E s∼ρD(*) 1 2 (cid:33) [1 − ˆπβ (a|s)] ≤4γ max s,a (cid:12)Aˆπβ (s, a)(cid:12) (cid:12) (cid:12) * max s DT V (π(cid:107)ˆπβ) [s] * (cid:32) E s∼ρˆπβ (*) [DT V (π(cid:107)ˆπβ) [s]] + E s∼ρD(*) 1 2 (cid:33) [1 − ˆπβ (a|s)] (29) 14 Published as a conference paper at ICLR 2023 D PROOF OF THEOREM 3 As an extension of Theorem 2, the proof process of Theorem 3 is similar. Based on the Equation (28), we can directly derive the final bound: (cid:12)J∆ (π, πk) − (cid:98)J∆ (π, πk) (cid:12) (cid:12) (cid:12) (cid:16) (cid:12) (cid:12) (cid:12) Es∼ρπ(*) (cid:2) ̄Aπ,πk (s)(cid:3) − Es∼ρπk (*) (cid:12) = = (cid:12) (cid:12) (cid:12) (cid:16) + Es∼ρˆπβ (*) (cid:2) ̄Aπ,πk (s)(cid:3) − Es∼ρD(*) (cid:16) + (cid:2) ̄Aπ,πk (s)(cid:3)(cid:17) (cid:2) ̄Aπ,πk (s)(cid:3)(cid:17) (cid:12) (cid:12) (cid:12) (cid:12) Es∼ρπ(*),a∼π(*|s) [Aπk (s, a)] − Es∼ρD(*),a∼π(*|s) [Aπk (s, a)] Es∼ρπk (*) (cid:2) ̄Aπ,πk (s)(cid:3) − Es∼ρˆπβ (*) (cid:12) (cid:12) (cid:12) (cid:2) ̄Aπ,πk (s)(cid:3)(cid:17) ≤2γ max s (cid:12) ̄Aπ,πk (s)(cid:12) (cid:12) (cid:12) (cid:32) E s∼ρπk (*) [DT V (π(cid:107)πk) [s]] + E s∼ρˆπβ (*) [DT V (πk(cid:107)ˆπβ) [s]] + E s∼ρD(*) ≤4γ max s,a |Aπk (s, a)| * max s DT V (π(cid:107)πk) [s] (cid:32) * E s∼ρπk (*) [DT V (π(cid:107)πk) [s]] + E s∼ρˆπβ (*) [DT V (πk(cid:107)ˆπβ) [s]] + E s∼ρD(*) 1 2 1 2 (cid:33) [1 − ˆπβ (a|s)] (cid:33) [1 − ˆπβ (a|s)] (30) E WHY GAE IS UNAVAILABLE IN OFFLINE SETTING? In traditional online situation, advantage Aπk (s, a) is estimated by Generalized Advantage Estimation (GAE) (Schulman et al., 2015b) using the data collected by policy πk. But in offline RL, only offline dataset D = from true behavior policy πβ is available. The advantage of (st, at) calculated by GAE is as follow: (cid:110) (st, at, st+1, rt)N t=1 (cid:111) Aπβ (st, at) = ∞ (cid:88) (γλ)l (cid:0)rt+l + γVπβ (st+l+1) − Vπβ (st+l)(cid:1) . (31) l=0 GAE can only calculate the advantage of (st, at) ∈ D. For (st, ̃at) ∼ D, where ̃at is an in- distribution action sampling but (st, ̃at) (cid:54)∈ D, GAE is unable to give any estimation. This is because the calculation process of GAE depends on the trajectory and does not have the ability to generalize to unseen state-action pairs. Therefore, GAE is not a satisfactory choice for offline RL. Offline RL forbids the interaction with environment, so data usage should be more efficient. Concretely, we expect advantage approximation method can not only calculate the advantage of (st, at), but also (st, ̃at). As a result, we directly estimate advantage with the definition Aπβ (s, a) = Qπβ (s, a) − Vπβ (s), where Q-function is estimated by SARSA and value function by fitting returns (cid:80)T t=0 γtr(st, at) with MSE loss. This function approximation method can generalize to the advantage of (st, ̃at). F THEORETICAL ANALYSIS FOR ADVANTAGE REPLACEMENT We choose to replace all Aπk with trustworthy Aπβ then theoretically measure the difference rather than empirically make Aπk learned by Q-learning more accurate. The difference caused by replacing the Aπk in (cid:98)J∆ (π, πk) with Aπβ (s, a) can be measured in the following theorem: Theorem 4. Given the distance DT V (πk(cid:107)πβ) [s] and assume the reward function satisfies |r (s, a)| ≤ Rmax for all s, a, then (cid:12) (cid:12) (cid:98)J∆ (π, πk) − Es∼ρD(*),a∼π(*|s) (cid:12) (cid:2)Aπβ (s, a)(cid:3)(cid:12) (cid:12) (cid:12) ≤ 2γ (γ + 1) * Rmax * E s∼ρπβ (*) [DT V (πk(cid:107)πβ) [s]] . (32) 15 Published as a conference paper at ICLR 2023 Proof. First note that Aπ(s, a) = Es(cid:48)∼p(s(cid:48)|s,a) [r(s, a) + γVπ (s(cid:48)) − Vπ(s)]. Then we have (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) = (cid:12) (cid:12) Es∼ρD(*),a∼π(*|s) [Aπk (s, a)] − Es∼ρD(*),a∼π(*|s) (cid:2)Aπβ (s, a)(cid:3) (cid:12) (cid:12) (cid:12) γ (cid:0)Vπk (s(cid:48)) − Vπβ (s(cid:48))(cid:1) − (cid:0)Vπk (s) − Vπβ (s)(cid:1) (cid:105)(cid:12) (cid:104) (cid:12) (cid:12) (cid:12) Es∼ρD(*),a∼π(*|s)Es(cid:48)∼p(s(cid:48)|s,a) (cid:20) (cid:12)Vπk (s(cid:48)) − Vπβ (s(cid:48))(cid:12) γ (cid:12) ≤Es∼ρD(*),a∼π(*|s)Es(cid:48)∼p(s(cid:48)|s,a) (cid:12) + (cid:12) (cid:12)Vπk (s) − Vπβ (s)(cid:12) (cid:12) (cid:21) (33) Similarly to Equation (18), the value function can be rewritten as Vπ (s) = Es∼ρπ(*) [r (s)]. Then the difference between two value function can be measured using Hölder's inequality and lemma 2: (cid:12)Vπk (s) − Vπβ (s)(cid:12) (cid:12) (cid:13)ρπk (*) − ρπβ (*)(cid:13) ≤ (cid:13) (cid:12) = (cid:13)1 (cid:107)r (s)(cid:107)∞ ≤ 2γ E (cid:12) (cid:12) (cid:12) (cid:12) Es∼ρπk (*) [r (s)] − Es∼ρπβ (*) [r (s)] (cid:12) (cid:12) [DT V (πk(cid:107)πβ) [s]] * max s |r (s)| (34) s∼ρπβ (*) Thus, the final bound is (cid:12) (cid:12) (cid:12) Es∼ρD(*),a∼π(*|s) [Aπk (s, a)] − Es∼ρD(*),a∼π(*|s) (cid:2)Aπβ (s, a)(cid:3) (cid:12) (cid:12) (cid:12) ≤Es∼ρD(*),a∼π(*|s)Es(cid:48)∼p(s(cid:48)|s,a) (cid:34) 2γ2 E s(cid:48)∼ρπβ (*) [DT V (πk(cid:107)πβ) [s(cid:48)]] * max s(cid:48) |r (s(cid:48))| +2γ E s∼ρπβ (*) [DT V (πk(cid:107)πβ) [s]] * max s (cid:35) |r (s)| =2γ (γ + 1) max s |r (s)| E s∼ρπβ (*) [DT V (πk(cid:107)πβ) [s]] (35) Note that the right end term of the equation is irrelevant to the policy π and can be viewed as a constant when optimizing π. Combining the result of Theorem 3 and 4, we get the following corollary: Corollary 1. Given the distance DT V (π(cid:107)πk) [s], DT V (πk(cid:107)ˆπβ) [s] and DT V (D(cid:107)ˆπβ) [s] = 1 2 (1 − ˆπβ (a|s)), we can derive the following bound: (cid:2)Aπβ (s, a)(cid:3) J∆ (π, πk) ≥ Es∼ρD(*),a∼π(*|s) DT V (π(cid:107)πk) [s] * [DT V (π(cid:107)πk) [s]] − 4γAπk * max s − 4γAπk * max s DT V (π(cid:107)πk) [s] * [DT V (πk(cid:107)ˆπβ) [s]] E s∼ρπk (*) E s∼ρˆπβ (*) − 2γAπk * max s DT V (π(cid:107)πk) [s] * E s∼ρD(*) [1 − ˆπβ (a|s)] − Cπk,πβ , (36) where Aπk = max s,a |Aπk (s, a)| and Cπk,πβ = 2γ (γ + 1) * max s,a |r (s, a)| E s∼ρπβ (*) [DT V (πk(cid:107)πβ) [s]]. Conclusion 3 To guarantee the true objective J∆ (π, πk) non-decreasing, we can also simultaneously maxi- (cid:2)Aπβ (s, a)(cid:3) and minimize [maxs DT V (π(cid:107)πk) [s]], k = 0, 1, 2, * * * . mize Es∼ρD(*),a∼π(*|s) G ABLATION STUDY ON AN ASYMMETRIC COEFFICIENT In this section, we give the details of all hyperparameter selections in our experiments. In addition to the aforementioned clip ratio (cid:15) and its clip decay coefficient σ, we introduce the ω ∈ (0, 1) as an asymmetric coefficient to adjust the advantage ̄Aπβ based on the positive or negative of advantage: ̄Aπβ = |ω − 1(Aπβ < 0)|Aπβ . (37) 16 Published as a conference paper at ICLR 2023 For ω > 0.5, that downweights the contributions of the state-action value Qπβ smaller than it's expectation, i.e., Vπβ while distributing more weights to larger Qπβ . The asymmetric coefficient can adjust the weight of advantage based on the Q performance, which downweights the contributions of the state-action value Q smaller than its expectation while distributing more weights to advantage with a larger Q value. We analyze how the three coefficients affect the performance of BPPO. We analyze three values of the asymmetric coefficient ω = (0.5, 0.7, 0.9) in three Gym environments. Figure 6 shows that ω = 0.9 is best for these tasks, especially in hopper-medium-v2 and hopper- medium-replay-v2. With a larger value ω, the policy improvement can be guided in a better direction, leading to better performance in Gym environments. Based on the performance of different coefficient values above, we use the asymmetric advantage coefficient ω = 0.9 for the Gym dataset training and ω = 0.7 for the Adroit, Antmaze, and Kitchen datasets training, respectively. (a) hopper-medium-v2 (b) hopper-medium-replay-v2 (c) hopper-medium-expert-v2 Figure 6: Ablation study on coefficient ω. We optimize the hyperparameters through the grid search, then we fix the value of other coefficients with the best performance and change the value of the asymmetric coefficient to analyze how it affects the BPPO. In particular, ω = 0.5 denotes without the asymmetric coefficient during the training phase (contributing equal value to all Advantages). H IMPORTANCE RATIO DURING TRAINING In this section, we consider exploring whether the importance weight between the improved policy πk and the behavior policy πβ will be arbitrarily large. To this end, we quantify this importance weight in the training phase in Figure 7. In Figure 7, we often observe that the ratio of the BPPO with decay always stays in the clipped region (the region surrounded by the dotted yellow and red line). However, the BPPO without decay is beyond the region in Figure 7(a) and 7(b). That demonstrates the improved policy without decay is farther away from the behavior policy than the case of BPPO with decay. It may cause unstable performance and even crashing, as shown in Figure 5(c), 5(d) and 10 when σ = 1.00 (i.e., without decay). (a) hopper-medium-v2 (b) hopper-medium-replay-v2 (c) hopper-medium-expert-v2 Figure 7: Visualization of the importance weight between the updated policy and the behavior policy trained by BC. When the performance of the policy is improved, we calculate the importance weight (i.e., the probability ratio) between the improved policy and the behavior policy. 17 *UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ   %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ   %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ   %&N XSGDWHVWHSV ,PSRUWDQFH5DWLRk/%332ZLWKGHFD\%332ZLWKRXWGHFD\1+212N XSGDWHVWHSV ,PSRUWDQFH5DWLRk/N XSGDWHVWHSV ,PSRUWDQFH5DWLRk/ Published as a conference paper at ICLR 2023 I COEFFICIENT PLOTS OF ONESTEP BPPO In this section, we exhibit the learning curves and coefficient plots of Onestep BPPO. As shown in Figure 8 and 9, (cid:15) = 0.25 and ω = 0.9 are best for those tasks. Figure 10 shows how the clip coefficient decay affects the performance of the Onestep BPPO. We can observe that the performance of the curve without decay or with low decay is unstable over three tasks and even crash during training in the "hopper-medium-replay-v2" task. Thus, we select σ = 0.96 to achieve a stable policy improvement for Onestep BPPO. that We use the coefficients with the best performance to compare with the BPPO in Figure 3. (a) hopper-medium-v2 (b) hopper-medium-replay-v2 (c) hopper-medium-expert-v2 Figure 8: Ablation study of Onestep BPPO on coefficient (cid:15). We optimize the hyperparameters through the grid search, then we fix the value of other coefficients with the best performance and change the value of the clip coefficient to analyze how it affects the Onestep BPPO. (a) hopper-medium-v2 (b) hopper-medium-replay-v2 (c) hopper-medium-expert-v2 Figure 9: Ablation study of Onestep BPPO on coefficient ω. We optimize the hyperparameters through the grid search, then we fix the value of other coefficients with the best performance and change the value of the asymmetric coefficient to analyze how it affects the Onestep BPPO. (a) hopper-medium-v2 (b) hopper-medium-replay-v2 (c) hopper-medium-expert-v2 Figure 10: Ablation study of Onestep BPPO on clip coefficient decay and its decay rate. We optimize the hyperparameters through the grid search, then we fix the value of other coefficients with the best performance and change the value of the clip decay coefficient to analyze how it affects the Onestep BPPO. In particular, σ = 1.00 denotes without the decay coefficient during the training phase. 18 *UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ     %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ     %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ     %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ   %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ   %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ   %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ     %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ     %&*UDGLHQW6WHS × 1RUPDOL]HG5HWXUQ     %& Published as a conference paper at ICLR 2023 J EXTRA COMPARISONS In this section, we have added the EDAC (An et al., 2021a), LAPO (Chen et al., 2022), RORL (Yang et al., 2022), and ATAC (Cheng et al., 2022) as the comparison baselines to further evaluate the superiority of the BPPO. Although the performance of the BPPO is slightly worse than the SOTA methods on Gym environment, the BPPO significantly outperforms all methods on the Adroit, Kitchen, and Antmaze datasets and has the best overall performance over all datasets. Table 3: The normalized results of all algorithms on Gym locomotion and Adroit datasets. The results of the EDAC, RORL, and ATAC are extracted from their original articles. Environment/method EDAC RORL ATAC Ours halfcheetah-medium-v2 hopper-medium-v2 walker2d-medium-v2 halfcheetah-medium-replay-v2 hopper-medium-replay-v2 walker2d-medium-replay-v2 halfcheetah-medium-expert-v2 hopper-medium-expert-v2 walker2d-medium-expert-v2 Gym locomotion-v2 total pen-human-v1 hammer-human-v1 door-human-v1 relocate-human-v1 pen-cloned-v1 hammer-cloned-v1 door-cloned-v1 relocate-cloned-v1 adroit-v1 total locomotion + adroit total 65.9 101.6 92.5 61.3 101 87.1 106.3 110.7 114.7 841.1 52.1 0.8 10.7 0.1 68.2 0.3 9.6 0 141.8 982.9 66.8 104.8 102.4 61.9 102.8 90.4 107.8 112.7 121.2 870.8 33.7 2.3 3.8 0 35.7 1.7 -0.1 0 77.1 947.9 54.3 102.8 91.0 49.5 102.8 94.1 95.5 112.6 116.3 818.9 79.3 6.7 8.7 0.3 73.9 2.3 8.2 0.8 180.2 999.1 44.0±0.2 93.9±3.9 83.6±0.9 41.0±0.6 92.5±3.4 77.6±7.8 92.5±1.9 112.8±1.7 113.1±2.4 751.0±21.8 117.8±11.9 14.9±3.2 25.9±7.5 4.8±2.2 110.8±6.3 8.9±5.1 6.2±1.6 1.9±1.0 291.4±38.8 1042.4±60.6 Table 4: The normalized results of all algorithms on Kitchen dataset. The results of the LAPO are extracted from its original article. Environment/method LAPO Ours kitchen-complete-v0 kitchen-partial-v0 kitchen-mixed-v0 53.2 53.7 62.4 91.5±8.9 57.0±2.4 62.5±6.7 kitchen-v0 total 169.3 211.0±18.0 Table 5: The normalized results of all algorithms on Antmaze dataset. The results of the RORL are extracted from its original article. Environment/method RORL Ours Umaze-v2 Umaze-diverse-v2 Medium-play-v2 Medium-diverse-v2 Large-play-v2 Large-diverse-v2 96.7 90.7 76.3 69.3 16.3 41.0 95.0±5.5 91.7±4.1 51.7±7.5 70.0±6.3 86.7±8.2 88.3±4.1 Antmaze-v2 total 390.3 483.3±35.7 19 Published as a conference paper at ICLR 2023 K IMPLEMENTATION AND EXPERIMENT DETAILS Following the online PPO method, we use tricks called 'code-level optimization' including learning rate decay, orthogonal initialization, and normalization of the advantage in each mini-batch, which are considered very important to the success of the online PPO algorithm (Engstrom et al., 2020). We clip the concatenated gradient of all parameters such that the 'global L2 norm' does not exceed 0.5. We use 2 layer MLP with 1024 hidden units for the Q and policy networks, and use 3 layer MLP with 512 hidden units for value function V . Our method is constructed by Pytorch (Paszke et al., 2019). Next, we introduce the training details of the Q, V , behavior policy πβ, and target policy π, respectively. • Q and V networks training: we run 2 × 106 steps for fitting value Q and V functions using learning rate 10−4, respectively • Behavior policy πβ training: we run 5 × 105 steps for πβ cloning using learning rate 10−4. • Target policy π: during policy improvement, we use the learning rate decay, i.e., decaying in each interval step in the first 200 gradient steps and then remaining the learning rate (decay rate σ = 0.96). We run 1,000 gradient steps for policy improvement for Gym, Adroit, and Kitchen tasks and run 100 gradient steps for Antmaze tasks. The selections of the initial policy learning rate, initial clip ratio, and asymmetric coefficient are listed in Table 6, respectively. Table 6: The selections of part of hyperparameters during policy improvement phase. Hyperparameter Task Initial policy learning rate Gym locomotion and cloned tasks of Adroit Kitchen, Antmaze, and human tasks of Adroit Initial clip ratio (cid:15) Asymmetric coefficient ω Hopper-medium-replay-v2 Antmaze Others Gym locomotion Others Value 10−4 10−5 0.1 0.5 0.25 0.9 0.7 20
http://arxiv.org/abs/2302.11298v1
2023-02-22T11:33:17
2023-02-22T11:33:17
Approximate spectral clustering density-based similarity for noisy datasets
Approximate spectral clustering (ASC) was developed to overcome heavy computational demands of spectral clustering (SC). It maintains SC ability in predicting non-convex clusters. Since it involves a preprocessing step, ASC defines new similarity measures to assign weights on graph edges. Connectivity matrix (CONN) is an efficient similarity measure to construct graphs for ASC. It defines the weight between two vertices as the number of points assigned to them during vector quantization training. However, this relationship is undirected, where it is not clear which of the vertices is contributing more to that edge. Also, CONN could be tricked by noisy density between clusters. We defined a directed version of CONN, named DCONN, to get insights on vertices contributions to edges. Also, we provided filtering schemes to ensure CONN edges are highlighting potential clusters. Experiments reveal that the proposed filtering was highly efficient when noise cannot be tolerated by CONN.
[ "Mashaan Alshammari", "Masahiro Takatsuka" ]
10.1016/j.patrec.2019.08.020
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1016/j.patrec.2019.08.020", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.11298v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11298v1", "@rel": "related", "@type": "application/pdf" } ]
[ "Pattern Recognition Letters, Volume 128, 2019" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.IR", "cs.NE" ]
Pattern Recognition Letters journal homepage: www.elsevier.com Approximate spectral clustering density–based similarity for noisy datasets Mashaan Alshammari ∗ and Masahiro Takatsuka School of Computer Science, The University of Sydney, NSW 2006, Australia A B S T R A C T Approximate spectral clustering (ASC) was developed to overcome heavy computational demands of spectral clustering (SC). It maintains SC ability in predicting non-convex clusters. Since it involves a preprocessing step, ASC defines new similarity measures to assign weights on graph edges. Connectivity matrix (CONN) is an efficient similarity measure to construct graphs for ASC. It defines the weight between two vertices as the number of points assigned to them during vector quantization training. However, this relationship is undirected, where it is not clear which of the vertices is contributing more to that edge. Also, CONN could be tricked by noisy density between clusters. We defined a directed version of CONN, named DCONN, to get insights on vertices contributions to edges. Also, we provided filtering schemes to ensure CONN edges are highlighting potential clusters. Experiments reveal that the proposed filtering was highly efficient when noise cannot be tolerated by CONN. 2018 Elsevier Ltd. All rights reserved. 1. Introduction Spectral clustering emerged to be an efficient learning paradigm. It broadens the definition of clustering process from "points that share a common mean" to "points that are strongly connected". This definition enables spectral clustering to identify more complex shaped clusters. However, the gains of spectral clustering are usually outweighed by its computational demands. Easing the computational demands of spectral clustering was essential to unleash its capabilities. Research efforts brought the concept of approximate spectral clustering (ASC). It operates by choosing a subset (m representatives) from the data (n points) and carry on with spectral clustering steps. Eventually, the outcome of m points will be generalized to all n points (Chen and Cai, 2011; Yan et al., 2009). The most important question about ASC was: how to de- fine similarities between m representatives. Distance-based, density-based, or hybrid similarities were the most used. Distance-based similarities are criticized including decaying parameters (Tasdemir, 2012). Defining similarities based on density is more accurate than distance-based. It creates edges based on continuous density of points between for representatives regardless of the distance between them. However, tracking density for each pair of representatives is computationally expensive (Tasdemir et al., 2015). Connectivity matrix (CONN) introduced by (Tasdemir, 2012) minimized the overhead of density tracking by utilizing information from the approximation process. It tracks which representatives are selected as the best matching units (BMUs) and second-best matching units (second BMUs). Then it creates the edges where the weights are the number of points sharing the same BMU. In the case of clean data, CONN is superior and it provides an approximated graph that highlights the potential clusters. The problem arises when there is a faulty density (i.e., group of points spanning the area between true clusters) caused by noisy input. CONN is guaranteed to create edges in such cases according to its definition. Faulty density could be determined from the perspective of the two representatives sharing a CONN edge (p,q). In this work, we introduce a directed version of CONN named DCONN. Examining this directed graph gives us more insights on whether a pair of representatives p and q are mutually agreeing on the density between them. If there is a large difference between the outgoing DCONN edge (p,q) and the incoming DCONN edge (q,p), a red flag is raised on this edge ∗ Corresponding author. Tel.: +61 2 9351 3423; fax: +61 2 9351 3838; e-mail: [email protected] for further inspection. Another test to discover faulty density performed locally by examining whether CONN edge (p,q) falls within the range of acceptance of a specific representative p. The acceptance range was defined as the mean of CONN edges to all direct neighbors of p. k-nearest neighbor and ε-neighborhood graphs involve parameters (i.e., k and ε) that require careful tuning. Since these conventional selections of graphs have their limitations, researchers developed various methods to construct the graph G = (V, E) for spectral clustering. We also presented a measure for the mutual agreements of all pair of edges in DCONN called (DCONN Balance). When DCONN Balance is low it means there are small differences between all outgoing and incoming edges in DCONN, which means the graph is well balanced. In this case, removing edges will not help because it could break clusters. If DCONN Balance is high most representatives are not mutually agreeing on edges. In such cases, removing edges could boost the performance by maintaining mutually agreed on edges. The experimental design revealed that removing edges from CONN graph based on the proposed measures could boost the performance of approximate spectral clustering. This work is organized as follows: in section 2 we review efforts from the literature representing a backbone of this work; the proposed method the experimental setup and discussion are presented in section 4. in section 3; introduced is 2. Related work , BB BB� and and cccccc(BB, BB�) Spectral clustering operates based on the connectivity of data points instead of compactness required by spherical methods. The idea was initiated back in 1990s and became an attractive clustering tool ever since, a useful summary of earlier efforts could be found in (Weiss, 1999). Given a graph G = (V,E), these efforts were looking for the minimum graph cut between , such that . This method was called minimum cut (MinCut). BB ∪ Unfortunately, MinCut tends to partition small and isolated BB� = φφ connected components and miss the significant ones because it increases with the number of edges. The notable effort by (Shi and Malik, 2000) introducing the concept of normalized cut (NCut), which was an enhancement over the minimum cut. The was normalized by the total weights from nodes term in . The proposed formula highlights and cccccc(BB, BB�) the significant cut between well-connected components. The BB� VV second smallest eigenvector of the graph Laplacian represents the value of and with LLssssss are affinity and degree matrices (DD − to all nodes in BB ∪ BB� = VV LLssssss = DD , where −1 2⁄ BB respectively. −1 2⁄ AA)DD AA NNcccccc(BB, BB�) DD The type of constructed graph G = (V, E), heavily influences the performance of spectral clustering. The conventional selection of the graph types involves: fully connected graph, k- nearest neighbor graph, and ε-neighborhood graph (von Luxburg, 2007). The former option tends to be inefficient when n is large, since it connects all points according to some similarity measure. In k- nearest neighbor graphs, each vertex p will be connected to q if it belongs to k-nearest neighbors of p (Marchette, 2004). The outcome of such graphs depends heavily on the selection of k which needs manual tuning in real applications. A graph design proposed by (Correa and Lindstrom, 2012) based on empty region graphs (ERGs). ERGs are graphs that connect neighboring points if the geometric region between them does not contain any other points. They proposed a β- skeleton ERG with a local scaling of similarity. The parameter β controls the diameter of balls centered at neighboring points p and q and their intersection defines the empty region. Furthermore, a graph constructed based on neighborhood density was introduced by (Inkaya, 2015). It operates based on a neighborhood construction (NC) by placing a hypersphere passing through the points p and q. The density of the NC is defined by the number of points in the hypersphere, with p and q directly connected if it was empty and indirectly connected otherwise. Subsequently, the density adaptive neighborhood (DAN) graph was constructed as: (3) (p, q) ∈ E(DAN) ⟺ p ∈ NC(q) or q ∈ NC(p) All aforementioned graph construction methods were primarily developed for spectral clustering. The emerging field of approximate spectral clustering (ASC) was designed to ease the computational demands of spectral clustering while preserving its superiority. ASC starts by selecting a subset m n, to perform spectral clustering on, out of n points, where m then generalize the outcome to all n. With this new field, we could still use the previous graph construction methods. Nevertheless, we could be more efficient if we utilize the approximation step as a guide to construct the graph G = (V, E). This was the motivation behind the development of CONN graph by (Tasdemir, 2012). It exploits the concept of induced Delaunay triangulation (Martinetz and Schulten, 1994). ≪ (p, q) ∈ E(CONN) ⟺ xxii ∈ VVpppp oooo xxii ∈ VVpppp (4) where matching-unit and q second-best-matching-unit. represents the number of points that p is their best- CONN has a couple of advantages that makes it the most suitable graph construction method for ASC with vector quantization. It does not require any parameters, since it uses the outcome of the vector quantization as is. Another advantage of CONN is that most of its computations are embedded in vector quantization training. Once the training finished, CONN could be trivially computed. Despite these advantages of CONN, its reliance on the density to draw edges could impact its accuracy when faulty density spans the void between clusters. This case is more likely to occur in real data since clusters are not well separated. Examining the directed version of CONN (named DCONN) would give us more insights about what edges to keep. From there we could derive filtered versions of CONN with less but more informative edges. VVpppp (1) (p, q) ∈ E(G) ⟺ p ∈ knn(q) or q ∈ knn(p) For ε-neighborhood graphs, one simply connects points with pair-wise distances less than ε. (p, q) ∈ E(G) ⟺ d(p, q) < ε (2) 3. Proposed Approach The proposed method aims to filter CONN edges that were created by faulty density or wrong positioning of representatives m. It starts by constructing a directed version of CONN graph, called DCONN. Then, it filters all edges where the difference between a pair of DCONN edges exceeds a global threshold. A second round of filtering was performed locally. Representatives could cut CONN edges that do not align with their local acceptance threshold. Finally, the pro- posed method performed spectral clustering using the filtered graphs. 3.1. DCONN graph DCONN graph is the directed version of CONN graph. In CONN an edge connecting p and q is defined as in Equation is the set of points where p is the best matching unit (4). (BMU) and q is the second best matching unit. While, is the reversed relationship with points where q is the BMU and p is the second BMU. For DCONN graph, a given CONN edge was split into a pair of edges defined as: VVpppp VVpppp (a) (b) (p, q) ∈ E(DCONN) ⟺ xxii ∈ VVpppp (5) (6) Fig. 2. Illustration of first round of filtering (global filtering). (a) histogram of the differences among CONN edges pairs, vertical red lines are thresholds (μ ± σ). (b) obtained CONNG graph (best viewed in color). The setup of DCONN enables us to uncover which vertex is (q, p) ∈ E(DCONN) ⟺ xxii ∈ VVpppp contributing more in the undirected CONN edge (p,q). For the CONN edge (p,q) will be example, if 7. For the vertex q this edge is useless because p is not the second BMU for any point assigned to q. Given how DCONN was constructed the previous relationship will be highlighted, since VVpppp = 7 VVpppp = 0 and and . (p, q) ∈ E(DCONN) = 7 (q, p) ∈ E(DCONN) = 0 (a) (b) Fig. 1. Graphs constructed via CONN (a) and DCONN (b). All edges from the central representative are wrongly linking two clusters. They were uncovered by DCONN definition as unidirectional edges (best viewed in color). Fig. 1 shows examples of CONN and DCONN graphs. In Fig. 1b the representative in the middle was not the second BMU for any representative in the middle ring. This explains why all edges going out of that representative are all unidirectional edges. This is an example of wrong positioning of representatives by the vector quantization method. The one representative in the middle has no neighbors in the same cluster. Therefore, it has to approach representatives in other clusters to satisfy its second BMU condition. Ideally, the CONN edges in the middle should not be created since they link two clusters which should be recognized as separate. 3.2. Filtering CONN graph Once CONN and DCONN graphs are constructed, we are ready to filter the former based on insights from the latter. The first round of filtering removes CONN edges with low mutual agreements. If the difference between a pair of DCONN edges is higher than a global threshold. This threshold is computed as the mean of all differences between edges pairs in DCONN and graph plus the standard deviation. For example, if the difference is 6. If this value is higher than the VVpppp = 7 global threshold (Tglobal), the CONN edge (p,q) is removed. VVpppp = 1 An example of a globally filtered graph is shown in Fig. 2. The histogram on the left shows the boundaries of acceptance which is the interval [μ ± σ]. We are concerned about the limit on the right that is slightly below 4. The pair of edges with a difference above that value will be eliminated. This is demonstrated by the graph on the right in which 5 CONN edges were eliminated. This globally filtered graph will be referred to as CONNG for the rest of this paper, and its definition is given by equation (7). The first round of CONN filtering was performed globally. This is a deficient setup when the data contains regions with different statistics. Therefore, it was rectified by a second round of filtering performed locally. Given a vertex p in CONN graph, it could be connected to multiple CONN edges. The local threshold was set as the mean of distances to all vertices connected to p plus the standard deviation. If a CONN edge exceeds the local threshold (i.e., Tlocal) it will get a vote for removal by p. Two graphs were derived using this filtering. The first graph removes all CONN edges with 1 removal vote, while the second removes edges with 2 removal votes. (a) (b) (c) Fig. 3. Illustration of second round of filtering (local filtering). (a) voting scheme based on local threshold (0: edge is within acceptance, 1: edge is violating one vertex threshold, 2: edge is violating both vertices thresholds). (b) CONNL1 graph removes all edges with 1 vote. (c) CONNL2 graph removes all edges with 2 votes (best viewed in color). (pp, qq) ∈ EE(CCCCNNNNGG) ⟺ (xxii ∈ VVpppp oooo xxii ∈ VVpppp) aaaaaa (�VVpppp − VVpppp� < TTgggggggggggg) (pp, qq) ∈ EE(CCCCNNNNLL1) ⟺ (pp, qq) ∈ EE(CCCCNNNNGG) aaaaaa (aa(pp, qq) < TTpp aaaaaa aa(pp, qq) < TTpp) (pp, qq) ∈ EE(CCCCNNNNLL2) ⟺ (pp, qq) ∈ EE(CCCCNNNNGG) aaaaaa (aa(pp, qq) < TTpp oooo aa(pp, qq) < TTpp) 3.4. Performing Spectral Clustering (7) (8) (9) Examples of aforementioned graphs are illustrated in Fig. 3. Fig. 3a is the voting scheme highlighted as weights on edges. In Fig. 3b, all the remaining faulty edges escaped the global filtering were removed, since they received one vote each. In Fig. 3c, these edges were kept since they did not receive two votes. This is understood since the neuron on the middle would not vote for removing these edges because it only has these two edges. Both graphs will be referred to as CONNL1 and CONNL2 in upcoming sections, and their definitions are given by equations (8) and (9) respectively. 3.3. DCONN balance measure DCONN is an addition on top of CONN, hence, it requires additional computations. Anticipating when the proposed method would outperform CONN helps to avoid unnecessary computations and contributes the efficiency of this proposal. This section introduces a proposed measure to evaluate CONN performance without carrying out all computations described in the previous section. The ultimate objective of CONN filtering proposed previously is removing edges with low mutual agreement. The lowest level of mutual agreement is in form of unidirectional DCONN edge. A CONN graph with high mutual agreement would have lower differences among its directed edges (i.e., DCONN). Computing these differences and normalizing them by weights on edges would give us a hint about the over- all mutual agreements in CONN graph. We call this score DCONN Balance Fig. 4 shows two examples of the same dataset with different noise levels. In the clean version, DCONN produces a well- balanced graph highlighting potential clusters. The gains obtained through filtering this graph will be outweighed by the additional computations. On the other hand, the noisy graph has multiple unidirectional edges. Removing these edges will therefore, additional ensure better clustering accuracy, barrier. be computations should not a (a) (b) Fig. 4. Constructing DCONN graph for clean and noisy versions of a synthetic dataset. (a) DCONN Balance = 0.2105; (b) DCONN Balance = 0.3166 (best viewed in color). Spectral clustering steps performed on the prepared graphs: CONN, CONNG, CONNL1, and CONNL2. It represents each graph by its corresponding affinity matrix where A(i, j) is defined as: (10) (11) AApppp = (p, q) ∈ E(CONN), wwheeooee pp ≠ qq −1 2⁄ −1 2⁄ −1 2⁄ −1 2⁄ R m×k LD AD = I − D Lsym = D The original work of (Ng et al., 2002) used a manually set parameter k to retrieve the top k eigenvectors defining the . We used this approach when the true embedding space number of clusters was known (e.g., synthetic data and data from UCI repository). However, when k was unknown like in image segmentation, we used an automatic detection scheme (Alshammari and Takatsuka, 2019). It starts by measuring the separation power of a given eigenvector. The separation was measured using DB index by (Davies and Bouldin, 1979), which is a ratio of intra-cluster and inter-clusters distances. The selected eigenvectors are the ones that have considerably large separation power than other eigenvectors. The embedding space is spanned by the qualifying eigenvectors . m×k R 4. Experiments The experiments involve different types of examined data: synthetic, images, and data retrieved from UCI repository. For each dataset, four graphs were derived: CONN, CONNG, CONNL1, and CONNL2. Over multiple runs we were mainly concerned about two metrics: clustering accuracy and number of edges in CONN graph. The former metric measures the effectiveness of the algorithm given the ground truth labels. The number of edges in CONN graph indicates the memory footprint for the algorithm. More edges mean more non-zero elements needed to be stored. We used a windows 10 machine to run the experiments with 3.40 GHz CPU and 8 GB of memory. Algorithms were coded in MATLAB 2017b. 4.1. Synthetic data from retrieved Three synthetic datasets were the supplementary materials provided by (Zelnik-Manor and Perona, 2005). The objective behind using synthetic data is to test the noise effect on CONN graph, moving from a clean to noisy data (see Fig. 5). Before running this experiment, it was anticipated that CONN filtering will be crucially needed in noisy cases. The number of representatives m was set manually by examining a range of values. Clustering accuracies and the number of edges used for clustering, were tracked and averaged over 100 runs. σ = 0 σ = 0.01 σ = 0.02 σ = 0.03 σ = 0.04 Fig. 5. Different noise levels injected into synthetic dataset. Table 1. Testing the original CONN and the proposed filtered graphs on synthetic datasets. White shaded rows are clustering accuracies, and grey shaded rows are number of edges. All are averaged over 100 runs. m 32 16 32 σ 0.01 0.02 0.03 0.04 0.01 0.02 0.03 0.04 0.01 0.02 0.03 0.04 CONN CONNG CONNL1 CONNL2 31.02 ± 1.0 32.75 ± 1.2 96.65 ± 10.6 88.68 ± 16.3 92.72 ± 12.3 89.44 ± 16.3 32.47 ± 1.1 33.48 ± 2.2 87.60 ± 15.6 82.95 ± 16.6 91.66 ± 12.6 85.13 ± 16.3 33.83 ± 1.5 35.03 ± 2.2 65.09 ± 4.9 63.64 ± 3.5 39.73 ± 2.7 42.49 ± 2.4 61.85 ± 5.3 62.67 ± 3.7 45.20 ± 2.9 49.13 ± 2.5 96.17 ± 7.2 96.20 ± 6.4 23.10 ± 1.5 23.71 ± 1.6 91.62 ± 8.7 91.50 ± 6.2 26.35 ± 1.7 28.29 ± 1.8 86.91 ± 4.1 85.09 ± 3.7 29.79 ± 1.8 32.55 ± 1.8 80.70 ± 4.6 79.29 ± 2.9 34.22 ± 2.2 37.54 ± 1.9 98.13 ± 6.4 99.19 ± 5.0 28.09 ± 0.5 28.18 ± 0.4 97.71 ± 8.3 98.95 ± 6.0 30.95 ± 1.5 31.49 ± 1.8 95.94 ± 7.6 94.06 ± 9.1 37.50 ± 2.5 39.60 ± 2.7 76.12 ± 9.1 71.85 ± 9.0 46.88 ± 2.5 50.34 ± 2.2 31.96 ± 1.1 67.74 ± 7.5 34.00 ± 2.0 63.30 ± 6.1 36.36 ± 2.0 95.45 ± 10.6 21.19 ± 1.0 85.56 ± 17.0 21.75 ± 1.3 88.52 ± 11.1 23.41 ± 1.6 80.11 ± 8.2 26.46 ± 1.8 98.17 ± 6.3 27.98 ± 0.4 96.69 ± 8.3 28.76 ± 0.9 90.81 ± 13.4 31.42 ± 2.0 80.68 ± 8.9 37.13 ± 2.1 34.05 ± 1.6 65.92 ± 4.0 41.70 ± 2.6 61.75 ± 4.7 47.76 ± 3.1 93.50 ± 9.2 23.83 ± 1.7 89.52 ± 8.9 28.03 ± 1.7 84.96 ± 3.8 32.53 ± 1.8 79.31 ± 3.4 37.50 ± 2.0 98.47 ± 5.7 28.23 ± 0.7 96.91 ± 9.4 31.62 ± 1.7 92.14 ± 9.6 39.46 ± 2.7 72.64 ± 8.4 50.75 ± 2.5 Table 1 shows the results of running multiple filtering schemes on synthetic data. For the first dataset containing three rings, CONN with no filtering was by far the best performer when the data was clean keeping a 4% advantage from its closest competitor (CONNL1). This advantage was not maintained in the consequent runs when noise levels increase. CONNL1 scored the highest accuracies when σ was 0.02, 0.03, and 0.04. Other filtering methods (e.g., CONNG and CONNL2) could not beat CONNL1 because it was the most aggressive filtering scheme. Another observation for this dataset was the number of edges that grows as the noise gets higher. This is explained by the movement of points where representatives need more edges to be connected. CONNL1 maintained the lowest number of edges in increasing noise levels. For the remaining datasets (smile and 4 lines), we experienced a similar observation as the first dataset. CONN was the best performer when the data was clean, however, it handed the first position to other methods as noise levels increase. For the smile dataset CONNL2 was the highest in consequent runs. CONNL1 tends to break edges in the middle of the arc representing the mouth because of density variations. For the 4 lines dataset, it requires σ to be 0.03 for other methods to beat CONN, with CONNL2 has 2% advantage. Nevertheless, with extreme noise (σ = 0.04), CONNL1 has 9% advantage over CONN. 4.2. Real images Four image segmentation datasets, retrieved from three sources, were used in this experiment. Berkeley segmentation dataset (BSDS500) was introduced by (Arbelaez et al., 2011). The 500 images contain different scenes to provide more diversity for the dataset. BSDS500 includes three evaluation metrics: segmentation covering (covering), rand index (RI), and variation of information (VI). For a comprehensive review on these metrics, we refer the reader to the original article by (Arbelaez et al., 2011). A rich and annotated dataset was developed at Graz University of Technology and introduced by (Opelt et al., 2004). It has 900 images for three objects: bike, car, and a person. It also includes the ground truth masks for all images. However, it does not include any evaluation metrics. Therefore, we converted all ground truth masks to be compatible with BSDS500 evaluation metrics. The last two datasets were retrieved from a repository by Weizmann Institute of Science (Alpert et al., 2007). The first dataset has a single object in the foreground, while the second has two objects. The supplied evaluation code computes F-measure for the foreground class. An influential parameter that must be set carefully in real images is the number of representatives m. We carried out a small experiment showing the number of color patterns in 25000 images retrieved from MIRFLICKR-25000 (Huiskes and Lew, 2008). The histogram in Fig. 6 shows that most of color patterns would be sufficiently represented by 100 representatives. Table 2 shows the scores of competing methods on BSDS500. CONNL1 was the best performer in terms of seg- mentation covering and variation of information. This was coupled with a considerable reduction in number of edges (100 edges less than CONN). Higher scores and less edges nominate CONNL1 to be the efficient method for BSDS500. The same observation continues to persist in GRAZ dataset (Table 3), where CONNL1 got higher scores with less edges. For Weizmann datasets (Table 4 and Table 5), CONNG got the highest scores. However, this graph was not very different from CONN, as one can tell from the number of edges. CONNL1 has the lowest number of edges and its performance deviated from CONN by +0.2% and −3.0% for both datasets. This leaves the choice for the user to balance the tradeoff between performance (clustering accuracy) and memory footprint (number of edges). 4.3. UCI repository datasets Three datasets were retrieved from UCI machine learning repository. These datasets were used in an experiment by (Tasdemir, 2012). The number of representatives was set similar to the values selected in that paper. By looking at Table 6, CONN produces the best performances in terms of clustering accuracy for datasets: image segmentation and pen digits. However, it falls short in Statlog dataset, handing the first position to CONNL1. Fig. 6. Setting the number of representatives m to 100 would sufficiently cover color patterns extracted from 25000 images (best viewed in color). Table 2. Testing the original CONN and the proposed filtered graphs on BSDS500. covering RI VI E m 100 CONN 0.39 0.68 2.67 280.7 ± 40.9 CONNG 0.39 0.67 2.68 280.5 ± 41.0 CONNL1 0.41 0.68 2.60 196.3 ± 33.4 CONNL2 0.40 0.68 2.67 261.7 ± 38.5 Table 3. Testing the original CONN and the proposed filtered graphs on GRAZ. covering RI VI E m 100 CONN 0.43 0.46 2.00 292.4 ± 36.7 CONNG 0.43 0.46 2.00 292.9 ± 36.5 CONNL1 0.48 0.50 1.83 200.5 ± 28.9 CONNL2 0.43 0.46 2.00 277.5 ± 35.0 Table 4. Testing the original CONN and the proposed filtered graphs on Weizmann dataset (1 object). F-measure E m 100 CONN 68.6 ± 0.2 255.2 ± 39.0 CONNG 69.0 ± 0.2 255.0 ± 39.9 CONNL1 68.8 ± 0.2 176.6 ± 29.9 CONNL2 68.6 ± 0.2 238.0 ± 36.1 Table 5. Testing the original CONN and the proposed filtered graphs on Weizmann dataset (2 objects). F-measure E m 100 CONN 51.72 ± 0.3 245.6 ± 47.2 CONNG 51.90 ± 0.3 246.0 ± 48.0 CONNL1 48.69 ± 0.3 171.2 ± 36.4 CONNL2 51.69 ± 0.2 230.0 ± 46.0 Table 6. Testing the original CONN and the proposed filtered graphs on UCI datasets. White shaded rows are clustering accuracies, and grey shaded rows are number of edges. All are averaged over 100 runs. Image Segmentation n = 2391 d = 19 C = 7 Statlog n = 6435 d = 4 C = 6 Pen Digits n = 10992 d = 16 C = 10 m 40 75 150 50 100 200 100 169 324 CONN 53.62 ± 4.9 96.00 ± 6.5 44.17 ± 4.3 159.25 ± 7.5 40.71 ± 5.2 291.21 ± 8.8 68.35 ± 4.4 116.49 ± 3.2 66.38 ± 2.9 275.00 ± 7.2 65.61 ± 1.8 623.84 ± 11.8 78.42 ± 5.1 363.71 ± 10.1 81.59 ± 4.3 585.45 ± 14.6 81.74 ± 4.3 CONNG 52.58 ± 5.1 94.42 ± 6.6 44.86 ± 4.6 159.59 ± 7.1 39.61 ± 4.3 288.59 ± 9.0 68.36 ± 3.8 116.84 ± 3.1 66.06 ± 2.7 274.01 ± 7.9 65.43 ± 1.9 621.13 ± 11.9 78.05 ± 5.2 363.84 ± 11.0 81.16 ± 5.2 584.19 ± 14.5 83.00 ± 4.5 1104.63 ± 17.3 1103.25 ± 19.5 CONNL1 50.78 ± 6.0 69.52 ± 5.1 42.18 ± 6.4 116.84 ± 6.5 37.87 ± 5.2 217.43 ± 7.5 70.73 ± 3.6 81.07 ± 3.5 71.73 ± 3.9 193.39 ± 7.4 71.19 ± 3.4 450.88 ± 10.9 77.93 ± 5.4 263.01 ± 9.4 76.76 ± 5.8 424.86 ± 11.7 71.46 ± 10.2 807.56 ± 16.6 CONNL2 51.87 ± 5.5 87.45 ± 5.9 44.93 ± 4.3 145.59 ± 6.8 39.81 ± 4.3 265.42 ± 8.6 68.86 ± 4.1 109.75 ± 3.7 67.49 ± 4.2 255.62 ± 7.1 66.46 ± 3.3 572.30 ± 11.6 77.96 ± 5.3 337.41 ± 9.7 79.48 ± 4.2 542.39 ± 15.4 79.85 ± 4.6 1027.75 ± 18.7 In general, the results produced by this experiment were below the expectations since the proposed filtering schemes were lagging behind the original CONN. This raised a question, why the proposed filtering works well for noisy synthetic data and real images but not for UCI datasets?. To answer this question, we examined 6 UCI datasets as well as real image datasets in terms of DCONN Balance measure described in subsection 3.3. The outcome of this experiment is shown in Fig. 7, in which the number of representatives m was fixed at 100. In that figure, all 6 UCI datasets are stacked on the left side of the plot, due to their low points to dimensions ratio. Interestingly, UCI datasets have higher DCONN Balance (greater than 0.2) than real image datasets. Real image datasets maintained DCONN Balance score lower than 0.2. Another observation is that DCONN Balance decreases as the points to dimensions ratio increase. Given these observations we can say that the proposed method performed better on real images because their DCONN Balance was not too high, at the same time it was not a completely balanced graph. On the other hand, it could not outperform CONN on UCI data because the graphs were extremely unbalanced. In addition, UCI data have low points to dimensions ratio. This makes removing an edge will severely impact the graph structure, compared to graphs with high points to dimensions ratio. The local filtering is consuming most of the proposed method computations. Reducing these computations would improve this method. Also, testing CONN hybrid similarity measures would contribute to the generality of this work. Fig. 7. Measuring DCONN Balance for 6 UCI datasets and 4 real image datasets with m set to 100. UCI datasets have low points to dimensions ratio and high DCONN Balance score. Real image data have high points to dimensions ratio and moderate DCONN Balance. 5. Conclusions References CONN is an efficient method to construct graphs for approximate spectral clustering (ASC). It utilizes the vector quantization step to track density information needed for weighing the graph edges. This gives CONN the ability to draw edges synthesizing the density of the data, and ultimately highlighting potential clusters. However, in case of noisy density, CONN is forced to draw edges given its definition. Also, the relationships in CONN are undirected, where the contribution of a vertex to the weight of an edge is not clear. We breakdown the undirected edges of CONN into directed edges, to highlight vertices contributions and perform global filtering accordingly. Also, we defined a local filtering to cut edges that could be drawn by noisy density that violates local statistics. Alpert, S., Galun, M., Basri, R., Brandt, A., 2007. Image Segmentation by Probabilistic Bottom-Up Aggregation and Cue Integration, 2007 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1-8. Alshammari, M., Takatsuka, M., 2019. Approximate spectral clustering with eigenvector selection and self-tuned k. Pattern Recognition Letters 122, 31-37. Arbelaez, P., Maire, M., Fowlkes, C., Malik, J., 2011. Contour Detection and Hierarchical Image Segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence 33, 898-916. Chen, X., Cai, D., 2011. Large scale spectral clustering with landmark-based representation. Proceedings of the National Conference on Artificial Intelligence 1, 313-318. the 1st ACM Correa, C.D., Lindstrom, P., 2012. Locally-scaled spectral clustering using empty region graphs. Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 1330-1338. Davies, D.L., Bouldin, D.W., 1979. A Cluster Separation Measure. IEEE Transactions on Pattern Analysis and Machine Intelligence PAMI-1, 224-227. Huiskes, M.J., Lew, M.S., 2008. The MIR flickr retrieval international evaluation. Proceedings of conference on Multimedia information retrieval, 39-43. Inkaya, T., 2015. A parameter-free similarity graph for spectral clustering. Expert Systems with Applications 42, 9489-9498. Marchette, D.J., 2004. Random graphs for statistical pattern recognition. Wiley-Interscience, Hoboken, N.J. Martinetz, T., Schulten, K., 1994. Topology representing networks. Neural Networks 7, 507-522. Ng, A.Y., Jordan, M.I., Weiss, Y., 2002. On spectral clustering: Analysis and an algorithm. Advances in Neural Information Processing Systems. Opelt, A., Fussenegger, M., Pinz, A., Auer, P., 2004. Weak Hypotheses and Boosting for Generic Object Detection and Recognition. Springer Berlin Heidelberg, Berlin, Heidelberg, pp. 71-84. Shi, J., Malik, J., 2000. Normalized cuts and image segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence 22, 888-905. Tasdemir, K., 2012. Vector quantization based approximate spectral clustering of large datasets. Pattern Recognition 45, 3034-3044. Tasdemir, K., Yalcin, B., Yildirim, I., 2015. Approximate spectral clustering with utilized similarity information using geodesic based hybrid distance measures. Pattern Recognition 48, 1465-1477. von Luxburg, U., 2007. A tutorial on spectral clustering. Statistics and Computing 17, 395-416. Weiss, Y., 1999. Segmentation using eigenvectors: A unifying view. Proceedings of the IEEE International Conference on Computer Vision 2, 975-982. Yan, D., Huang, L., Jordan, M.I., 2009. Fast approximate spectral clustering. Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, 907-916. Zelnik-Manor, L., Perona, P., 2005. Self-tuning spectral clustering. Advances in Neural Information Processing Systems, 1601-1608.
http://arxiv.org/abs/2302.11297v1
2023-02-22T11:32:24
2023-02-22T11:32:24
Approximate spectral clustering with eigenvector selection and self-tuned $k$
The recently emerged spectral clustering surpasses conventional clustering methods by detecting clusters of any shape without the convexity assumption. Unfortunately, with a computational complexity of $O(n^3)$, it was infeasible for multiple real applications, where $n$ could be large. This stimulates researchers to propose the approximate spectral clustering (ASC). However, most of ASC methods assumed that the number of clusters $k$ was known. In practice, manual setting of $k$ could be subjective or time consuming. The proposed algorithm has two relevance metrics for estimating $k$ in two vital steps of ASC. One for selecting the eigenvectors spanning the embedding space, and the other to discover the number of clusters in that space. The algorithm used a growing neural gas (GNG) approximation, GNG is superior in preserving input data topology. The experimental setup demonstrates the efficiency of the proposed algorithm and its ability to compete with similar methods where $k$ was set manually.
[ "Mashaan Alshammari", "Masahiro Takatsuka" ]
10.1016/j.patrec.2019.02.006
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1016/j.patrec.2019.02.006", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.11297v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11297v1", "@rel": "related", "@type": "application/pdf" } ]
[ "Pattern Recognition Letters, Volume 122, 2019" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.IR", "cs.NE" ]
1 3 2 0 2 b e F 2 2 ] G L . s c [ 1 v 7 9 2 1 1 . 2 0 3 2 : v i X r a Pattern Recognition Letters journal homepage: www.elsevier.com Approximate spectral clustering with eigenvector selection and self-tuned k Mashaan Alshammari∗∗, Masahiro Takatsuka School of Information Technologies, The University of Sydney, NSW 2006 Australia ABSTRACT The recently emerged spectral clustering surpasses conventional clustering methods by detecting clus- ters of any shape without the convexity assumption. Unfortunately, with a computational complexity of O(n3), it was infeasible for multiple real applications, where n could be large. This stimulates researchers to propose the approximate spectral clustering (ASC). However, most of ASC methods as- sumed that the number of clusters k was known. In practice, manual setting of k could be subjective or time consuming. The proposed algorithm has two relevance metrics for estimating k in two vital steps of ASC. One for selecting the eigenvectors spanning the embedding space, and the other to discover the number of clusters in that space. The algorithm used a growing neural gas (GNG) approximation, GNG is superior in preserving input data topology. The experimental setup demonstrates the efficiency of the proposed algorithm and its ability to compete with similar methods where k was set manually. © 2023 Elsevier Ltd. All rights reserved. 1. Introduction Spectral clustering (Shi and Malik (2000); Ng et al. (2002); von Luxburg (2007)) emerged to be an effective learning tool that attempts to capture non-convex similarities in input data. Unlike spherical clustering algorithms, spectral clustering does not assume compactness of clusters, instead it is driven by the connectivity between data points. This enables spectral clus- tering to uncover more complex shaped clusters leading to effi- cient clustering. It was used in many applications like: image segmentation (Shi and Malik (2000); Wang and Dong (2012)), object localization (Vora and Raman (2018)), and community networks (Wang et al. (2017)). Unfortunately, its computational cost prevented it from expanding to more practical problems, since its core component is decomposing the graph Laplacian L of size n × n, leaving the algorithm with a complexity of O(n3) (Yan et al. (2009)). Due to its ability of providing high quality clustering, spec- tral clustering computational demands were well studied in the literature. The most intuitive solution is to sample representa- tives from the dataset to perform spectral clustering then gener- alize the results. Clearly, these methods ignore data points de- pendencies while performing sampling, which could lead to a loss of small clusters. Therefore, sampling was replaced by vec- tor quantization to select m representatives (Yan et al. (2009)) ∗∗Corresponding author e-mail: [email protected] (Mashaan Alshammari), [email protected] (Masahiro Takatsuka) where m (cid:28) n. This approach accumulates the feature space dependencies into a set of representatives to perform spectral clustering on. Most of approximate spectral clustering methods assumed that the number of clusters k was known beforehand. This is a strong assumption giving that tuning k is not straightforward for many real applications (e.g., image segmentation Cheung et al. (2017)). The original work by (Ng et al. (2002)) indicates two uses of the parameter k. The first use related to selecting k eigenvectors corresponding to minimum eigenvalues of the normalized graph Laplacian L, those eigenvectors represent the embedding space Rn×k. Secondly, k was used by k-means to separate data points. We attempt to estimate the parameter k as well as reducing the complexity of spectral clustering. Initially, a growing neu- ral gas (Fritzke (1995)) is trained on the feature space to pro- duce representative neurons. Then, the neurons' affinity ma- trix was constructed to decompose the graph Laplacian. The first need of k was removed by selecting the eigenvectors that maximize a relevance metric based on separation between the graph nodes and explained variance. The final step performed by clustering neurons in the embedding space using k-means, where the number of clusters was estimated based on another metric. Although spectral clustering could be used in a range of applications, our experiments were mainly focused on im- age segmentation problems for two reasons. First, the studies that introduced these datasets used a spectral clustering bench- mark with a manual k. Second, the effect of automating k could 2 Fig. 1. Illustration of the proposed approach. be easily visualized in image segmentation problems. The pro- posed method showed a competitive performance to methods where k was manually tuned. This work is organized as follows: in section 2 we review ef- forts related to approximations of spectral clustering; sections 3 and 4 introduce our proposed solution followed by experimen- tal results. 2. Related Work 2 AD− 1 Given a graph G(V, E) connecting data points and the affin- ity matrix A, spectral clustering attempts to relax the normal- ized cut problem (Ncut) introduced by Shi and Malik (2000). Ng et al. (2002) proposed a symmetric graph Laplacian as Lsym = I − D− 1 2 . Then the points {x1, x2, * * * , xn} mapped into the embedding space Rn×k spanned by k smallest eigenvec- tors. In Rn×k, points form convex clusters that could be detected by running k-means to avoid iterative bipartitioning. This algo- rithm highlighted two uses of the parameter k. First, it is used to select the top k eigenvectors of the graph Laplacian L, then used as an input for k-means for clustering. Efforts in the liter- ature for automating k could be classified based on their source for evaluation, either eigenvalues or eigenvectors. One way to discover k is to count the number of eigenval- ues with multiplicity zero. Alternatively, one could look for the largest gap between k and k + 1 in the eigenvalues plot, this method is known as eigengap. Ideally, the gap between k and k + 1 is large (von Luxburg (2007)). However, these tech- niques need a clearly separated data (Zelnik-Manor and Perona (2005)). Liu et al. (2013) proposed a soft threshold to locate the eigengap. They used a parameter τ to penalize small eigenval- ues that are less important for clustering. Although τ has fixed limits (i.e., 0 < τ < 1), it still needs a carful tuning. The use of eigenvectors to estimate k was initiated by (Zelnik-Manor and Perona (2005)) where they look for an op- timal rotation ˆX of the matrix of eigenvectors X. The method starts by recovering the rotation of the first two eigenvectors then iteratively add one eigenvector to be rotated. A cost func- tion is computed with each iteration, and the optimal set is the one that yields the minimal cost. One deficiency of this method is the need for the parameter kmax, if not set, the method could have to rotate a Rm×m space which could be costly. This ap- proach was improved by (Tyuryukanov et al. (2018)) where they used a computationally efficient alignment cost. Also, they emphasized on the effectiveness the initialization scheme for better optimization. Although these methods are well formu- lated with sophisticated optimization, they could be computa- tionally inefficient. They require high dimensional optimization space and multiple initializations. Eigenvectors of L could be evaluated individually to avoid the need for high dimensional optimization space. Xiang and Gong (2008) proposed an eigenvector evaluation metric Rek based on the distribution of the points, whether it is unimodal and multimodal. Ultimately, eigenvectors with low discrimi- nation power ended up with low Rek scores. The number of clusters in the embedding space was estimated based on the lowest Bayesian information criterion (BIC). Another effort for estimating k was introduced by Zhao et al. (2010), where they ranked the eigenvectors based on the entropy caused by the ab- sence of that eigenvector. Nevertheless, to obtain the entropy score, one might need to examine different combinations of eigenvectors. Li et al. (2017) formulated a cost function to evaluate eigenvectors based on intra-cluster compactness and inter-cluster separation. Starting from k = 2, eigenvectors were evaluated and the set with minimum score will be returned. All aforementioned methods require a parameter kmax which is safely larger than the true number of clusters ktrue. In addition, they have not used the eigenvalues of L which they could pos- sess important information. The need for the parameter k could be eased by avoiding the method of Ng et al. (2002) (known as k-way approach). Alter- natively, the graph would go through iterations each of which uses a single eigenvector to bipartition the graph. This process of iterative spectral clustering was used by Bhatti et al. (2018) to partition the graph recursively. A cluster is established if it cannot find a gap that satisfies the minimum tolerance. It also was used by Wang et al. (2017) to detect community networks. They define a "critical edge" to highlight the most significant bipartition. Iterative spectral clustering was used by Vora and Raman (2018) for object localization. The main difficulty of iterative spectral clustering is how to specify the stopping crite- ria. Also, it processes the eigenvectors independently Shi and Malik (2000). The deficiencies of previous efforts to automate k could be summarized in three points. First, they use one source of infor- mation, either eigenvalues or eigenvectors. Second, they esti- mated one value for the number of eigenvectors and the number of clusters, however, these two values are not necessarily equal. Third, they used iterative clustering that is less efficient than us- ing k eigenvectors simultaneously. We attempted to avoid these shortcomings by proposing two evaluation metrics that utilize both eigenvalues and eigenvectors. e2 e3 e4 ⋮ em 1. Input data approximation using growing neural gas 2. A metric to estimate embedding space dimensions 3. Another metric to estimate the number of clusters k2 k3 k4 ⋮ km 3. Proposed Approach The proposed method provides an informed measure to es- timate the appropriate k. It starts by mapping input data into a growing neural gas (GNG). The spectral clustering continues by decomposing the graph Laplacian L. The obtained eigen- vectors were examined against a relevance metric to select the ones that provides best separation of graph nodes penalized by their eigenvalues. In the embedding space Rm×k, the value of k was estimated by another relevance metric that measures the separation of clusters and the accumulated sum of eigenvalues. 3.1. Growing Neural Gas Growing neural gas (GNG) was proposed by Fritzke (1995), it was an improvement over self-organizing map (SOM) and neural gas (NG). GNG starts by introducing a random point xi to the competing neurons. The winning neuron is the nearest and called the best matching unit wb: (cid:107)xi − wb(cid:107) = min i {(cid:107)xi − wi(cid:107)} (1) Then GNG computes the error of wb using: error(wb, t + 1) = error(wb, t) + (cid:107)wb − xi(cid:107)2 (2) The new positions of wb and its topological neighbors are com- puted as per the following adaption rules: wb(t + 1) = (cid:15)b(xi − wb) wd(t + 1) = (cid:15)k(xi − wd) (3) d represents all direct topological neighbors of wb, whereas (cid:15)b and (cid:15)d determine the amount of change. GNG introduces a new neuron to the map if the current iteration is a multiple of some parameter l. It first finds the neuron with the maxi- mum accumulated error wq, then determines its neighbor with the largest error w f . The new neuron is inserted between wq and w f and connects to both of them. The training stops if quanti- zation error is stable. 3.2. Approximating Data in Feature Space To perform spectral clustering on large input data, a prepro- cessing step using growing neural gas was deployed to mini- mize the input data. GNG was selected over the original pre- processing of k-means (Yan et al. (2009)) for two reasons. First, unlike k-means that places representatives and let the similarity measure connects them, GNG places representatives and con- nects them with edges. This leaves the similarity measure with an easy task of only weighing those edges produced by GNG, which is usually a sparse graph. Second, GNG uses the com- petitive Hebbian rule to draw edges, which produces a graph called "induced Delaunay triangulation". This graph forms a perfectly topology preserving map of input data (see Theorem 2 in Martinetz (1993) and the discussion therein). The most influential parameter of GNG is its size (m). In case of images, ideally, we would like to capture all color pat- terns with less number of neurons. Therefore, setting the lower 3 2. data (Top) Synthetic ∈ Fig. {4, 8, 16, 32, 64, 128, 256}, showing that m = 32 is an elbow point. (Bottom) Distribution of the number of peaks in the color histogram for 25000 images retrieved from MIRFLICKR-25000. The red vertical line is the size of GNG (best viewed in color). quantization for m error bound for GNG size was very critical. To uncover color pat- terns, we examined color histogram peaks in 25000 images re- trieved from MIRFLICKR-25000 (Huiskes and Lew (2008)). The distribution of color peaks illustrated in Fig. 2, in which it is observable that setting m in GNG to 100 neurons is suffi- cient to capture all color patterns. In case of synthetic data, a range of m values were examined using k-means++ algorithm. m was set as the number that represents an elbow point in the quantization error curve (Fig. 2). 3.3. Performing Spectral Clustering When m neurons are trained to approximate n points (m (cid:28) n), they became ready to be processed by spectral clustering. The first step is to construct the affinity matrix A = {Ai j}m i, j=1, where Ai j denotes the similarity between wi and w j. Commonly, A is constructed by a kernel with a global scale σ. In spite of its popularity, global σ processed all data points equally re- gardless of their status in the feature space. Therefore, it could be challenged when input data contains different local statistics (Zelnik-Manor and Perona (2005)). A more reasonable selec- tion of the scaling parameter is to set it locally as: Ai j = exp (cid:18) −d2(wi, w j) σiσ j (cid:19) The local scale σi could be set as: , where (i, j) ∈ EGNG (4) σi = d(wi, wK) (5) wK is the Kth neighbor of wi. In Zelnik-Manor and Perona (2005), it was set as K = 7, however, in our case it was set as K = 1, that is the direct neighbor of wi. This was consequent to the reduction performed by GNG in the preprocessing. The degree matrix D is defined as Dii = (cid:80) j A ji. The diagonal in D denotes the degree for all {wi}m i=1. Then, the normalized graph MIRFLICKR-25000 4 Fig. 4. Input data approximated using GNG, and the weights obtained through local σ. The Rek histograms suggest that two eigenvectors are suf- ficient to cluster synthetic data and four eigenvectors to segment the image. The red vertical lines represent the interval [μ ± σ] (best viewed in color). S c(Qi) is within-cluster distances in cluster i, and dce(Qi, Q j) is the distance between clusters i and j. Rek enables us to attach a score with every eigenvector for evaluation in order to select the most informative eigenvectors. By definition, an informative eigenvector has a substantially large Rek due to its small eigenvalue and large DBI score. Con- sequently, that eigenvector should standout from the remain- ing eigenvectors which are close to the mean score (μ) of Rek . Therefore, the selected eigenvectors are the ones that fall out- side the interval [μ ± σ], where μ is the mean Rek score and σ is the standard deviation of Rek scores. The bin size of this histogram was set as per Freedman-–Diaconis rule that is de- fined as 2Rm−1/3, where R is the inter–quartile range. The qualified eigenvectors from Rek histogram, constitute the matrix X ∈ Rm×k. On synthetic data, Rek performs efficiently to highlight the in- formative eigenvectors, since the graph is usually disconnected and the data is clearly separable. However, this is not the case in realistic data (e.g., images). Such data contain intercon- nected components that might promote unnecessary eigenvec- tors. Therefore, certain precautions have to be taken to make sure that X is discriminative for k-means to find the true clus- ters. In Fig. 5, we segmented the pigeon image using the eigen- vectors qualified from Rek histogram shown in Fig. 4 (i.e., e2, e3, e4, and e5). Interestingly, we could achieve more polished segmentation if we dropped the last eigenvector. This is justi- fied by the amount of variance explained by the eigenvectors. e2, e3, and e4 accumulate almost 80% of the variance. Hence, to ensure that X remains discriminative, we performed a prin- ciple component analysis (PCA) on the eigenvectors qualified from Rek histogram, and kept the ones that represent 80% of the variance. We called the obtained matrix X∗ ∈ Rm×k. 3.5. Clustering in the Embedding Space Rm×k The embedding space Rm×k is spanned by the eigenvectors selected by Rek histogram. In this space, the graph nodes form convex clusters. Therefore, they could be detected by k-means. One issue needs to be addressed is the number of clusters in the embedding space to run k-means. An intuitive way, to es- timate k is to measure Davies–Bouldin index over multiple k Fig. 3. Top eigenvectors of the approximated graph for the synthetic data. Laplacian is computed as Lsym = D− 1 (von Luxburg (2007)). 2 LD− 1 2 = I − D− 1 2 AD− 1 2 3.4. Evaluation of Graph Laplacian Eigenvectors Decomposing Lsym produces m nonnegative real-valued eigenvalues 0 = λ1 ≤ * * * ≤ λm. The graph nodes are separable in the space Rm×k spanned by the eigenvectors corresponding to k smallest eigenvalues. One way to uncover k is to count the eigenvalues of multiplicity 0 (von Luxburg (2007)). However, k is not always clear in eigenvalues and relying on this to uncover the number of clusters might not hold in case of noise (Zelnik- Manor and Perona (2005)). Another way to estimate the num- ber of dimensions in Rm×k is to recover the rotation that best aligns the neurons to a block-diagonal matrix L (Zelnik-Manor and Perona (2005)). The combination of eigenvectors that best recover such an alignment is the optimal set to construct Rm×k. However, recovering the alignment becomes more expensive as we approach m, since an m × m space needs to be rotated. This entails the tuning of another parameter that is kmax. According to von Luxburg (2007), the eigenvector corre- sponding to the second smallest eigenvalue provides a solu- tion to the Normalized Cut (NCut) problem. Therefore, the first eigenvector indicates the connectivity of the graph and the second indicates the largest cut in the graph, then more eigen- vectors are included if there are more clusters. Fig. 3 shows an empirical validation on the usefulness of the second eigenvector e2. Given that the true k equals 3, the e2 and e3 eigenvectors are the most informative. In contrast, e4, e5, and e6 contain no sep- aration of graph nodes. Therefore, we define a relevance metric Rek that measures the ability of separating the graph nodes into 2, 3, and 4 clusters. Additionally, this quantity was penalized by the eigenvalue corresponding to that eigenvector, to promote eigenvectors with smaller eigenvalues: = Rek (cid:80)4 c=2 DBIc(ek) λi , 1 ≤ i ≤ m DBIc is the Davies–Bouldin index value defined as: DBIc(ek) = 1 c c(cid:88) i=1 (cid:26) S c(Qi) + S c(Q j) dce(Qi, Q j) (cid:27) max i(cid:44) j (6) (7) Given one dimensional data {w1, w2, * * * , wn} in ek, it could be clustered into {Q1, Q2, * * * , Qc} clusters where c ∈ {2, 3, 4}. e2 e5 e4 e3 Approximated weighted graph Input data Input data Approximated weighted graph Rekscores histogram Table 1. Clustering results on synthetic datasets. 5 in MATLAB 2017b and carried out on a Windows 10 machine with 3.40 GHz CPU and 8GB of memory. 4.1. Synthetic data Table 1 shows the clustering results of 100 runs for every method, where m was selected as the elbow point in the quan- tization error curve. Some of used data was provided in sup- plementaries1 of (Zelnik-Manor and Perona (2005)). The effi- ciency of the proposed method (X∗) was clearly demonstrated across the four datasets, particularly in second and third datasets where it was close to full mark. Eigengap and eigenvectors alignment did not perform as well as X and X∗. Their low per- formances were due to large number of eigenvectors passed as dimensions for Rm×k, which confuses the number of clusters es- timation in that space. The performance of LRR cost fluctuates across different datasets which highlights the large influence of the parameter τ. 4.2. Real Images Weizmann segmentation evaluation dataset2 contains 100 RGB images, each of which has a single foreground object. Also, it provides three versions of human segmentation. The accuracy of the segmentation method was measured in terms of F-measure for the foreground class segmented by humans. This dataset was introduced by Alpert et al. (2007), where au- thors used the original version of spectral clustering (NCut) (Shi and Malik (2000)) for benchmarking. That version used man- ual selection for the parameter k, hence, we used that score as a baseline to evaluate the competing methods in this study. The produced segmented image was post processed using 3 × 3 me- dian filter to smooth small artifacts. In Table 2, the baseline score was 0.72 for the spectral clus- tering where k was manually set. The competing methods de- viated from the baseline score by −0.24, −0.19, −0.15, −0.11, and −0.08. This observation demonstrates the efficiency of the proposed method compared to the baseline. The first 3 meth- ods tend to provide more eigenvectors for the embedding space Rm×k which makes the task of detecting the number of clusters 1http://lihi.eew.technion.ac.il/files/Demos/ SelfTuningClustering.html 2http://www.wisdom.weizmann.ac.il/~vision/Seg_ Evaluation_DB/ Fig. 5. clustering results obtained through X and X∗. Fig. 6. Testing a range of k values to return the one with the lowest score (data in Fig. 3). With large k values, DBI tends to give a good score due to better separation. But our proposed criterion penalizes large k values and increases sharply to highlight the true k (k = 3) (best viewed in color). values. However, DBI tends to favor large values of k for bet- ter separation (see Fig. 6). A better approach would be uti- lizing the graph Laplacian eigenvalues to penalize large values of k that accumulate large sum of eigenvalues. Proposition 2 in (von Luxburg (2007)) states that "the multiplicity k of the eigenvalue 0 of L equals the number of connected components in the graph". Hence, a small sum of eigenvalues is preferable while examining different k values. Simply, this metric looks for the value of k that provides best separation of graph nodes and at the same time accumulates a small sum of eigenvalues. Rk = DBIk(X∗) + k(cid:88) i=1 λi , 2 ≤ k ≤ m (8) 4. Experiments Five methods were used to estimate the number of dimen- sions for the embedding space Rm×k. 1) eigengap method (von Luxburg (2007)), 2) eigenvectors alignment method (Zelnik- Manor and Perona (2005)), 3) Low-Rank Representation met- ric used in (Liu et al. (2013)) with τ = 0.08, 4) X, where the number of dimensions was estimated via Rek score, 5) X∗ is a refined version of X to keep the eigenvectors that hold 80% of the variance. To maintain a fair comparison amongst competing methods, the number of clusters in Rm×k was estimated using the metric in equation 8. All experiments were implemented 0102030405060708090100e2e3e4e5Explained varianceClustering using X={e2,e3,e4,e5} e2 e3 e4 e5 Clustering using X∗={e2,e3,e4} n 312 299 266 788 m 64 32 32 128 eigengap 0.35 ± 0.0 0.50 ± 0.1 0.52 ± 0.1 0.56 ± 0.1 eigenvectors alignment 0.53 ± 0.2 0.56 ± 0.1 0.64 ± 0.1 0.61 ± 0.2 LRR cost 0.48 ± 0.0 0.35 ± 0.0 0.30 ± 0.0 0.87 ± 0.1 X 0.65 ± 0.1 0.90 ± 0.1 0.97 ± 0.1 0.83 ± 0.0 X∗ 0.71 ± 0.2 0.93 ± 0.1 0.98 ± 0.1 0.79 ± 0.1 Table 2. Results on Weizmann segmentation evaluation dataset. The num- ber in parentheses indicates the deviation from the baseline score. 6 Table 3. Segmentation results on BSDS500. The number in parentheses indicates the deviation from the baseline score. difficult. For X, the proposed metric was good, but we could achieve a better performance if only keep the eigenvectors that hold 80% of the variance as in X∗. Berkeley Segmentation Data Set (BSDS500)3 is a more com- prehensive dataset to evaluate segmentation methods. It con- tains 500 images alongside their human segmentation. It also provides three segmentation evaluation metrics: segmentation covering, probabilistic rand index (PRI), and variation of infor- mation (VI). A good segmentation would result in high cover- ing, high PRI, and low VI scores. Arbelaez et al. (2011) tested a version of spectral clustering on (BSDS500), it is called Multi Scale NCut (Cour et al. (2005)). The scores on that study were used as a baseline for the competing methods here. In that spec- tral clustering implementation, k was set manually and the size of the affinity matrix A was n × n. As illustrated in Table 3, eigengap performed badly in terms of covering and VI, although it got a good PRI score. Strug- gling performances by the first three methods were due to the large number of eigenvectors passed for the embedding space. Better scores were achieved by X and X∗ with a clear advantage for X∗. This emphasizes that keeping the eigenvectors that are accountable for 80% of the variance would produce better seg- mentation than using all eigenvectors. Comparing X∗ to NCut scores reported in Arbelaez et al. (2011), where k was manually set, would be more insightful. X∗ deviated from the baseline method by −0.07, −0.11, and +0.59 in covering, PRI, and VI respectively. This deviation was due to approximating the input image by m representatives then estimating the value of k in two locations of the spectral clustering pipeline. 3https://www2.eecs.berkeley.edu/Research/Projects/CS/ vision/grouping/resources Fig. 7. Examples for large and small differences between manual and auto settings. Rows ordered as: original, human segmentation, manual k, and auto k. The number beneath is the F-score (best viewed in color). We rerun Weizmann dataset with manual setting to compare against auto estimated k. The mean difference μ between man- ual and auto k was 0.08 and the standard deviation σ was 0.09. The difference was larger than μ + 2σ in 3 images. We suspect the human semantics incorporated in the ground truth cause these bad scores. For example, the image of the cat in Fig. 7 was segmented as per human perspective regardless of col- ors presence. Although the colors were segmented correctly by auto k, it was not the desired output by the human segmentation. On the other hand, when the human segmentation has limited colors, we could get competitive results as shown in Fig. 7. The final experiment was a comparison with some approx- imate spectral clustering methods. Wang and Dong (2012) pulled out four images from BSDS500 to compare four ap- proximate methods: multi-level low-rank approximate spectral clustering-original space (MLASC-O), Nystr ̈om-based spectral clustering (Nystr ̈om), INystr ̈om with k-means (INystr ̈om), and k-means approximate spectral clustering (KASP). We used the aforementioned methods as a baseline of our proposed ap- proach, however k was provided manually in these methods. As shown in Table 4, X∗ outperformed the competing meth- ods in third and fourth images, with a clear advantage in the fourth one. For the first two images, X∗ deviated by −0.0436 and −0.0330 from the best performer in terms of segmentation covering. 5. Conclusions Spectral clustering is an effective clustering tool that is able to detect non-convex shaped clusters. Despite its effectiveness, the computational demands of spectral clustering hold it back from being practically integrated into real applications. The ef- Segmentation method Segmentation F-score NCut (Alpert et al. (2007)) 0.72 ± 0.018 eigengap 0.48 ± 0.1 (-0.24) eigenvectors alignment 0.53 ± 0.1 (-0.19) LRR cost 0.57 ± 0.1 (-0.15) X 0.61 ± 0.1 (-0.11) X∗ 0.64 ± 0.2 (-0.08) Segmentation method Covering PRI VI NCut (Arbelaez et al. (2011)) 0.45 0.78 2.23 eigengap 0.31 (-0.14) 0.69 (-0.09) 3.49 (1.26) eigenvectors alignment 0.34 (-0.11) 0.65 (-0.13) 3.10 (0.87) LRR cost 0.36 (-0.09) 0.67 (-0.11) 2.97 (0.74) X 0.37 (-0.08) 0.69 (-0.09) 2.96 (0.73) X∗ 0.38 (-0.07) 0.67 (-0.11) 2.82 (0.59) difference >  difference <  0.8847 0.8800 0.8004 0.9147 0.5391 0.6107 0.8073 0.8430 Table 4. Comparing the proposed method with the results reported in (Wang and Dong (2012)). The number in parentheses indicates the deviation from the best score (in bold), and its color illustrates the change direction. 7 ficient solution was to provide an approximation of input data. One factor was common among previous approximation tech- niques was the assumption of prior knowledge of the number of clusters k. An automated estimation of k alongside topology preserving approximation, were introduced in this work. We achieved that by setting two metrics, the former of which selects the embed- ding space dimensions Rm×k, while the latter detects the number of clusters in Rm×k. The first metric measure the relevance of an eigenvector ek based on its separation as well as possessing a small eigenvalue. Subsequently, the second cost function pro- motes the value of k that separates the graph nodes better, and at the same time accumulates a small sum of eigenvalues. Ex- periments demonstrate that the proposed approach provides a competitive performance to the methods where k was manually set. References Alpert, S., Galun, M., Basri, R., Brandt, A., 2007. Image segmentation by probabilistic bottom-up aggregation and cue integration, in: 2007 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1– 8. doi:10.1109/CVPR.2007.383017. Arbelaez, P., Maire, M., Fowlkes, C., Malik, J., 2011. Contour detection and IEEE Transactions on Pattern Analysis hierarchical image segmentation. and Machine Intelligence 33, 898–916. doi:10.1109/TPAMI.2010.161. Bhatti, S., Beck, C., Nedich, A., 2018. Data clustering and graph partitioning IEEE Transactions on Network Science and Engi- via simulated mixing. neering , 1–1doi:10.1109/TNSE.2018.2821598. Cheung, Y., Li, M., Peng, Q., Chen, C.L.P., 2017. A cooperative learning-based clustering approach to lip segmentation without knowing segment number. IEEE Transactions on Neural Networks and Learning Systems 28, 80–93. doi:10.1109/TNNLS.2015.2501547. Cour, T., Benezit, F., Shi, J., 2005. Spectral segmentation with multiscale graph decomposition. 2005 IEEE Conference on Computer Vision and Pattern Recognition (CVPR) 2, 1124–1131 vol. 2. doi:10.1109/CVPR.2005.332. Fritzke, B., 1995. A growing neural gas network learns topologies. Advances in Neural Information Processing Systems , 625–632. Huiskes, M.J., Lew, M.S., 2008. The mir flickr retrieval evaluation. Proceed- ings of the 1st ACM international conference on Multimedia information retrieval , 39–43. Li, Q., Fan, H., Sun, W., Li, J., Chen, L., Liu, Z., 2017. Fingerprints in the air: Unique identification of wireless devices using rf rss fingerprints. IEEE Sensors Journal 17, 3568–3579. doi:10.1109/JSEN.2017.2685564. Liu, G., Lin, Z., Yan, S., Sun, J., Yu, Y., Ma, Y., 2013. Robust recovery of subspace structures by low-rank representation. IEEE Transactions on Pat- tern Analysis and Machine Intelligence 35, 171–184. doi:10.1109/TPAMI. 2012.88. von Luxburg, U., 2007. A tutorial on spectral clustering. Statistics and Com- puting 17, 395–416. doi:10.1007/s11222-007-9033-z. Martinetz, T., 1993. Competitive hebbian learning rule forms perfectly topology preserving maps. Artificial Neural Networks and Machine Learning - ICANN 1993 , 427–434URL: https://doi.org/10.1007/ 978-1-4471-2063-6_104, doi:10.1007/978-1-4471-2063-6_104. Ng, A.Y., Jordan, M.I., Weiss, Y., 2002. On spectral clustering: Analysis and an algorithm. Advances in Neural Information Processing Systems . Shi, J., Malik, J., 2000. Normalized cuts and image segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence 22, 888–905. doi:10.1109/34.868688. Tyuryukanov, I., Popov, M., Meijden, M.v.d., Terzija, V., 2018. Discovering clusters in power networks from orthogonal structure of spectral embed- IEEE Transactions on Power Systems doi:10.1109/TPWRS.2018. ding. 2854962. Vora, A., Raman, S., 2018. Iterative spectral clustering for unsupervised object localization. Pattern Recognition Letters 106, 27–32. URL: http://www. sciencedirect.com/science/article/pii/S0167865518300473, doi:https://doi.org/10.1016/j.patrec.2018.02.012. Wang, L., Dong, M., 2012. Multi-level low-rank approximation-based spectral clustering for image segmentation. Pattern Recognition Letters 33, 2206– 2215. doi:http://dx.doi.org/10.1016/j.patrec.2012.07.024. Wang, T.S., Lin, H.T., Wang, P., 2017. Weighted-spectral clustering algo- rithm for detecting community structures in complex networks. Artificial Intelligence Review 47, 463–483. URL: https://doi.org/10.1007/ s10462-016-9488-4, doi:10.1007/s10462-016-9488-4. Xiang, T., Gong, S., 2008. Spectral clustering with eigenvector selection. Pat- tern Recognition 41, 1012–1029. URL: http://www.sciencedirect. com/science/article/pii/S0031320307003688, doi:https://doi. org/10.1016/j.patcog.2007.07.023. Yan, D., Huang, L., Jordan, M.I., 2009. Fast approximate spectral clustering. Proceedings of the 15th ACM SIGKDD international conference on Knowl- edge discovery and data mining , 907–916. Zelnik-Manor, L., Perona, P., 2005. Self-tuning spectral clustering. Advances in Neural Information Processing Systems , 1601–1608. Zhao, F., Jiao, L., Liu, H., Gao, X., Gong, M., 2010. Spectral cluster- ing with eigenvector selection based on entropy ranking. Neurocomput- ing 73, 1704–1717. URL: http://www.sciencedirect.com/science/ article/pii/S0925231210001311, doi:https://doi.org/10.1016/ j.neucom.2009.12.029. Image Proposed method output Evaluation metric Covering PRI VI Covering PRI VI Covering PRI VI Covering PRI VI Proposed method 0.4123 (-0.0436) 0.7304 (-0.0798) 2.5961 (0.2605) 0.5449 (-0.0330) 0.7383 (-0.0435) 2.0457 (0.1352) 0.5486 (0.0895) 0.6368 (0.0314) 1.9997 (-0.3529) 0.6548 (0.1989) 0.8407 (0.0930) 1.3756 (-0.5561) Other approximation methods (Wang and Dong (2012)) MLASC-O 0.4559 0.8102 2.3437 0.5779 0.7818 1.9105 0.3879 0.5638 2.7682 0.4559 0.7477 1.9317 Nyström 0.4275 0.7977 2.7179 0.5596 0.7726 1.985 0.3772 0.5608 2.8727 0.3625 0.7391 2.5098 INyström 0.2767 0.7436 3.4722 0.5026 0.7389 2.3529 0.4591 0.6054 2.3526 0.4462 0.7356 2.0553 KASP 0.4465 0.7387 2.3356 0.5692 0.7729 2.033 0.3766 0.5673 2.7855 0.4428 0.7128 2.051
http://arxiv.org/abs/2302.11296v1
2023-02-22T11:31:32
2023-02-22T11:31:32
Refining a $k$-nearest neighbor graph for a computationally efficient spectral clustering
Spectral clustering became a popular choice for data clustering for its ability of uncovering clusters of different shapes. However, it is not always preferable over other clustering methods due to its computational demands. One of the effective ways to bypass these computational demands is to perform spectral clustering on a subset of points (data representatives) then generalize the clustering outcome, this is known as approximate spectral clustering (ASC). ASC uses sampling or quantization to select data representatives. This makes it vulnerable to 1) performance inconsistency (since these methods have a random step either in initialization or training), 2) local statistics loss (because the pairwise similarities are extracted from data representatives instead of data points). We proposed a refined version of $k$-nearest neighbor graph, in which we keep data points and aggressively reduce number of edges for computational efficiency. Local statistics were exploited to keep the edges that do not violate the intra-cluster distances and nullify all other edges in the $k$-nearest neighbor graph. We also introduced an optional step to automatically select the number of clusters $C$. The proposed method was tested on synthetic and real datasets. Compared to ASC methods, the proposed method delivered a consistent performance despite significant reduction of edges.
[ "Mashaan Alshammari", "John Stavrakakis", "Masahiro Takatsuka" ]
10.1016/j.patcog.2021.107869
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1016/j.patcog.2021.107869", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.11296v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11296v1", "@rel": "related", "@type": "application/pdf" } ]
[ "Pattern Recognition, Volume 114, 2021" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.IR", "cs.NE" ]
3 2 0 2 b e F 2 2 ] G L . s c [ 1 v 6 9 2 1 1 . 2 0 3 2 : v i X r a Refining a k-nearest neighbor graph for a computationally efficient spectral clustering Mashaan Alshammari∗, John Stavrakakis, Masahiro Takatsuka School of Computer Science, The University of Sydney, NSW 2006, Australia Abstract Spectral clustering became a popular choice for data clustering for its ability of uncovering clusters of different shapes. However, it is not always preferable over other clustering methods due to its computational demands. One of the effective ways to bypass these computational demands is to per- form spectral clustering on a subset of points (data representatives) then generalize the clustering outcome, this is known as approximate spectral clustering (ASC). ASC uses sampling or quantization to select data repre- sentatives. This makes it vulnerable to 1) performance inconsistency (since these methods have a random step either in initialization or training), 2) local statistics loss (because the pairwise similarities are extracted from data representatives instead of data points). We proposed a refined version of k- nearest neighbor graph, in which we keep data points and aggressively reduce number of edges for computational efficiency. Local statistics were exploited to keep the edges that do not violate the intra-cluster distances and nul- lify all other edges in the k-nearest neighbor graph. We also introduced an optional step to automatically select the number of clusters C. The pro- posed method was tested on synthetic and real datasets. Compared to ASC methods, the proposed method delivered a consistent performance despite significant reduction of edges. Keywords: Spectral clustering, Approximate spectral clustering, k-nearest neighbor graph, Local scale similarity ∗Corresponding author. Tel.: +61 2 9351 3423; fax: +61 2 9351 3838 Email address: [email protected] (Mashaan Alshammari) Preprint submitted to Pattern Recognition February 23, 2023 1. Introduction Spectral clustering gains popularity due to its ability of uncovering clus- ters with non-convex shapes. It uses the spectrum of pairwise similarity matrices to map data points to a space where they can be easily sepa- rated [1, 2, 3, 4]. Spectral clustering has been used in image segmentation [5, 6], remote sensing image analysis [7, 8], and detecting clusters in networks [9, 10, 11, 12]. Despite its elegance in uncovering clusters, spectral clustering comes with a heavy computational price. Decomposing the pairwise similar- ity matrix requires O(N 3) for N data points. Spectral clustering is infeasible for applications with large N . For the graph G(V, E) represented by its affinity matrix A, reducing the size of A means removing some vertices in V , whereas making A sparser means removing edges. This is the motivation of approximate spectral clus- tering (ASC) [6, 7, 8, 13, 14, 15], which adds two steps to the original algo- rithm of spectral clustering. First, it places m prototypes in the data space where m (cid:28) N . Then, spectral clustering is carried out on m prototypes and uses the initial assignments to generalize the outcome. The m prototypes are usually placed via vector quantization methods (e.g., k-means and self- organizing maps). Despite being a popular choice for approximate spectral clustering, vector quantization could converge badly, resulting in ill represen- tation of data points due to randomness in initialization and/or training. Fig. 1 illustrates two graphs by Zelnik-Manor and Perona [16], where approximate spectral clustering graphs were confused by the variation in local statistics. Generally, one can identify three deficiencies related to ASC via vector quantization: 1) these methods have a random selection step either 2 Fig. 1. Running approximate spectral clustering (ASC) via vector quantization on syn- thetic data (best viewed in color). in initialization or training which affects the consistency of clustering, 2) the obtained m prototypes provide a global overview of the data leaving out local information that could be crucial for clustering 3) vector quantization methods have to accommodate noisy data points as part of their training. Considering aforementioned deficiencies, we proposed a graph for spectral clustering G = (V, E∗) where we kept the same number of vertices V and find the most important subset of edges E∗ ⊂ E. Our goal is to create a graph with less number of edges without compromising on the clustering 3 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 3 progressively and monitor local statistics to stop linking when links appear outside the local neighborhood of points. Then, we used mutual k-nearest neighbor graph [3] to filter edges that lack mutual agreement of the pair of points. The experiments show the proposed method outperforming ASC via vector quantization. This paper is outlined as follows: in the next section we introduce spectral clustering. Also, we reviewed different approaches in the literature to construct a graph. In section 3, we present our approach for refining k-nn graph and automatically selecting the number of clusters C. In section 4, experiments were discussed. Original data Graphs by SOM and weighted by local σ. Graphs by SOM and weighted by CONN. Graphs by k-means and weighted by CONN. Proposed graph. Fig. 1. Running approximate spectral clustering (ASC) via vector quantization on synthetic data (best viewed in color). accuracy. Hence, using a graph with edges less than E∗ would negatively impact the clustering accuracy. To get E∗, we used a set of refinement stages that are computation- ally inexpensive. It starts by linking data points to their nearest neighbors progressively and monitor local statistics to stop linking when links appear outside the local neighborhood of points. Then, we used mutual k-nearest neighbor graph [3] to filter edges that lack mutual agreement of the pair of points. The experiments show the proposed method outperforming ASC via vector quantization. This paper is outlined as follows: in the next section we introduce spec- tral clustering. Also, we reviewed different approaches in the literature to construct a graph. In section 3, we present our approach for refining k-nn graph and automatically selecting the number of clusters C. In section 4, experiments were discussed. 2. Spectral clustering (SC) The graph G(V, E) connecting data points and its digital representation the affinity matrix A are the core components of spectral clustering. This clustering scheme is a relaxation of the normalized cut problem (Ncut) in- troduced by Shi and Malik [1]. Their contribution made progress on the minimum cut (Mincut) defined as: cut (cid:0)B, ̄B(cid:1) = (cid:88) Aij , i∈B,j∈ ̄B (1) 4 where B ⊂ V, ̄B is the complement of B, and Aij is the similarity score between the nodes i and j. However, Mincut tends to cut isolated sets rather than significant partitions since it increases with the number of edges [1, 3]. Consequently, Ncut was introduced as: N cut (cid:0)B, ̄B(cid:1) = cut (cid:0)B, ̄B(cid:1) assoc (B, V ) + cut (cid:0)B, ̄B(cid:1) assoc (cid:0) ̄B, V (cid:1) . (2) It penalizes the cut cost by the total connections from the nodes in B to all nodes V in the graph. Let y be the exact solution of N cut (cid:0)B, ̄B(cid:1), with yi = 1 if i (cid:15) B, and −1 otherwise. Then N cut (cid:0)B, ̄B(cid:1) can be optimized as: min x N cut (x) = min y yT (D − A) y yT Dy , (3) where D and A are the degree and affinity matrices respectively. To exactly solve Ncut, we have to look for two subsets with strong intra- connections and relatively weak weights between them, which was shown to be an NP-complete problem by Shi and Malik [1]. However, by relaxing y to take real values it was shown by Shi and Malik [17] that equation 3 can be minimized by solving the generalized eigenvalue system: (D − A) y = λDy . (4) The second smallest eigenvalue λL of the graph Laplacian L = D − A and its corresponding eigenvector vL, provide an approximation for solving Ncut 5 [3, 18]. When there is a partitioning between B and ̄B such that: vL i =   α,  β, i ∈ B i ∈ ̄B , (5) Then B and ̄B becomes the optimal Ncut with a value of N cut (cid:0)B, ̄B(cid:1) = λL [18]. vL is used to bipartition the graph then the following eigenvectors are used to partition the graph further. 2.1. SC grouping algorithm Clustering through graph Laplacian eigenvectors could be done iteratively (i.e., ordered by eigenvalues) or by constructing an embedding space using top eigenvectors. The latter approach is more convenient and a well-known method for embedding space clustering was introduced by Ng, Jordan and Weiss [2]. They proposed a symmetric graph Laplacian Lsym = D−1/2AD−1/2 where D and A are degree and similarity matrices respectively. Lsym top eigenvectors constitute an embedding space in which points that are strongly connected will fall close to each other making clusters detectable by k-means. 2.2. Graph construction When it comes to spectral clustering, it is all about quantifying simi- larities. Ideally, points in the same cluster are linked by large weights so they can fall close in the embedding space. A na ̈ıve approach of assigning weights would be through Euclidean distance. However, this is not a prac- tical choice, since it only considers first-order relationships. In first-order relationships edges are drawn based on information from pair of points only. A more practical approach would be considering second-order relationships 6 where edges are drawn based on information from the neighbors. In the following subsections, we will go through some of the popular methods to construct a graph whose similarity matrix is fed into spectral clustering. 2.2.1. Conventional graphs Conventional choices of constructing a graph include k-nearest neighbor graph and (cid:15)-neighborhood graph. These graphs use first-order relationships. In nearest neighbor graph, each point is linked to k points of its nearest neighbors. While in (cid:15)-neighborhood graph, each point becomes a center of a sphere of radius (cid:15) and link with all points inside that sphere. These are straightforward approaches for constructing a graph, but their reliance on first-order relationships and hyperparameters limit their usability. Some re- strictions could be applied to boost their performance. For example, connect with k-neighbors if they are closer than a threshold distance. Interested reader is referred to section 2.2 in [3] and Appendix D in [19]. 2.2.2. Approximate graphs Approximate graphs use vector quantization method to construct a graph using a reduced set of prototypes. These methods can be classified into two categories: 1) methods that only places prototypes in the feature space such as k-means [12, 20], 2) methods that are capable of placing prototypes and connecting them by edges (self-organizing map [11, 21] and neural gas [22, 23]). k-means attempts to minimize the sum of squared distances be- tween points and their closest prototypes. Self-organizing map (SOM) uses a predefined lattice that connects prototypes. During SOM training, a winning prototype would pull its neighbors in the lattice towards the selected data 7 point. Neural gas (NG) was an improvement over SOM since it links proto- types based on their location on the feature space not on the lattice. During NG training, the winning prototype would link to its closest neighbor, and that edge is allowed to age and "die" if it is not updated again. Both SOM and NG can produce a graph with less edges and vertices making spectral clustering computationally efficient. Once the vector quantization training finishes, pairwise similarities could be set as: 1) a prototype to prototype similarity (approximate graph [8, 14])) or 2) a prototype to data point similarity (anchor graph [24, 25]). The former was used as a benchmark in experiments due to its a larger presence in the literature. Connectivity matrix (CONN) [14] defines the similarity for a pair of prototypes according to the induced Delaunay triangulation [23] which links the pair if there exists a data point that selects them as first and second best matching units (BMUs). When such a point does not exist, the pair of prototypes are not linked which makes CONN capable of producing sparse graphs. Growing neural gas (GNG) was used in [6] as approximation graph. GNG applies the same training as NG, but in an incremental manner, where prototypes introduced to bridge the gaps during training. A comparison study [15] discussed different approximate graphs and how to assign their weights using local scaling [16] or CONN [8, 14]. 2.2.3. Proximity graphs In proximity graphs, a pair of points are linked if they satisfy a predefined condition. This makes them use second-order relationships since the linking decision is based on neighbors. In [26], that condition was if the neighborhood between pair of points is empty from any other point, then the pair should be 8 linked. This type of graphs is known as empty region graphs (ERGs). ERGs rely on β parameter to identify the neighborhood, that should be empty, to link the pair with an edge. Edges in the graph were locally scaled using similarity metric in [16] to achieve accurate clustering. A more sophisticated condition for the empty region could be parameter free. Inkaya et al. intro- duced neighborhood construction NC algorithm [27]. It starts by assigning direct neighbors as core neighbors and indirectly connects a point to other points through its core neighbors. Then it tracks the density between each pair, a pair having a density zero represents core neighbors. Once each point has a list of neighbors, the method tests the mutuality between neighbors' lists, and drops the points lacking mutual agreement. Drawback of NC in- clude isolated vertices, subgraphs, and asymmetric similarity matrix. This was rectified in [28], where additional steps were proposed to achieve symmet- ric similarity matrix. An undirected graph was constructed using NC, and if its connected components is less than the desired number of clusters C, edges were introduced between nearest points to satisfy the condition. Proximity graphs are capable of capturing underlying shape of the data. However, they came with a heavy computational price or the need for a hyperparameter. Density calculation alone requires O(n3) [27]. 2.2.4. Constrained graphs Constrained graphs require special types of constraints prior to data link- age. These constraints are must-link ML and cannot-link CL to force link or unlink of data points regardless of their location in the feature space. Au- thors of [29] found that constraints are limited to a small number of points which is not very useful for clustering. They introduced an affinity propaga- 9 tion method where points are linked not only based on their affinity but with evaluation of nearby constraints. This makes a greater impact of constraints to improve clustering. Another approach introduced by Li, Liu and Tang [30]. Instead of applying the constraints to the similarity matrix, they were applied to the eigenvectors constituting the embedding space. In that space must- link points should be close to each other and cannot-link points should be far apart. The authors created a measure of "good representation" that should hold the minimum cost when optimized. This method has a computational advantage over applying constraints to the similarity matrix. A separation of constrained graphs was proposed in [31]. Must-link graph and cannot-link graph were created, and bi-objective graph optimization employed instead of eigen-decomposition. It is clear that constraining the graph created from data points would get better clustering results. However, this comes at a price of fundamentally changing the problem into semi-supervised instead of unsupervised. Constraints are usually created from the ground truth. 3. Refined k-nearest neighbor graph for Spectral clustering From the previous overview, it can be noticed that there is no graph selec- tion that works for different sets of data. Every method has to compromise at some stage, but we believe that local statistics between data points rep- resent clustering information and should not be compromised. The ultimate goal of spectral clustering is to detect non-convex clusters, and local statis- tics are crucially important to achieve that goal. They have been avoided in approximate spectral clustering for computational efficiency. Also, most of the weirdly shaped clusters could be detected by approximation as long as 10 Fig. 2. A summary of the proposed approach. (a) k-nearest neighbor graph with k set according to local statistics; (b) mutual k-nearest neighbor graph to filter edges lacking mutual agreement; (c) an optional step to locally monitor the change in eigenvalues to detect the number of clusters C; (d) clustering outcome (best viewed in color). they are dense, but this is not always the case. Our method attempts to balance the tradeoff between locally scaled graphs and computational efficiency. It starts by creating k-nearest neigh- bor graph at each point and stop when it violates local statistics. Then, a mutuality check was run to ensure agreement among data points. We also introduced an eigengap detection method to uncover number of clusters C. Overview of the method is shown in Fig. 2. 3.1. Setting k in k-nearest neighbor graph Conventional k-nearest neighbor graphs have the problem of treating all data points equally. Due to their location in feature space, data points have different needs for the number of edges that could be larger or smaller than k. Ignoring these needs, and forcing each point to have k edges, might result in linking two clusters or breaking a single cluster. Therefore, the parameter k should be adaptively computed to accommodate the needs for each data point. Setting k manually for each data point is not a practical process. There- 11 8 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 link points should be close to each other and cannot-link points should be far apart. The authors created a measure of "good representation" that should hold the minimum cost when optimized. This method has a computational advantage over applying constraints to the similarity matrix. A separation of constrained graphs was proposed in [33]. Must-link graph and cannot-link graph were created, and bi-objective graph optimization employed instead of eigen-decomposition. It is clear that constraining the graph created from data points would get better clustering results. However, this comes at a price of fundamentally changing the problem into semi-supervised instead of unsupervised. Constraints are usually created from the ground truth. 3. Refined k-nearest neighbor graph for Spectral clustering From the previous overview, it can be noticed that there is no graph selection that works for different sets of data. Every method has to compromise at some stage, but we believe that local statistics between data points represents clustering information and should not be compromised. The ultimate goal of spectral clustering is to detect non-convex clusters, and local statistics are crucially important to achieve that goal. They have been avoided in approximate spectral clustering for computational efficiency. Also, most of the weirdly shaped clusters could be detected by approximation as long as they are dense, but this is not always the case. (a) (b) (c) (d) Fig. 2. A summary of the proposed approach. (a) k-nearest neighbor graph with k set according to local statistics; (b) mutual k-nearest neighbor graph to filter edges lacking mutual agreement; (c) an optional step to locally monitor the change in eigenvalues to detect the number of clusters; (d) clustering outcome (best viewed in color). Our method attempts to balance the tradeoff between locally scaled graphs and computational efficiency. It starts by creating k-nearest neighbor graph at each point and stop when it violates local statistics. Then, a Fig. 3. Distribution of distances from the point marked as ×. (dashed line) k = 7 (solid line) k set by the proposed method (dotted line) k set by the proposed method plus 20 neighbors. fore, we used the distribution of distances to monitor how it changes as we add more neighboring distances to the distribution. The intuition behind it is at some point we are leaving the current cluster to another cluster while adding more neighbors. This movement between clusters should be reflected on the distribution of distances. First, we need a baseline distribution of dis- tances indicating how distances are distributed in the current cluster. Also, we need a threshold to notify us that we are leaving the baseline distribu- 12 10 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 the sparsity of a cluster. In Fig. 3 (a), the point marked as x sits ina sparse cluster making its distribution more naturally looking covering large interval (0.1,0.4), due tovarying distances around it. On the other hand, the point inbottom row sitting in a dense cluster has a sharp distribution covering a narrow interval (0.01,0.04), given similar distances around it. (a) (b) (c) (d) Fig. 3. Illustration of tracking the distribution of distances to automatically set k in k-nearest neighbor graph. Column on the left shows the location of data point. Column on the right shows three distributions: (dashed line) baseline distribution k=7 (solid line) automatically selected distribution (dotted line) if we add more 20 neighbors to the automatically selected distribution. tion towards something different. Our baseline distribution is the normal distribution of distances to the first seven neighbors, this was selected for locally scaled pairwise distances in [16, 19]. By setting the baseline distri- bution to seven we're implying that the first seven neighbors belong to the same cluster. This is a strong assumption and it fails in large datasets (as we will see in Table 3) where we had to change it to be fifty, because seven was very narrow. that's why we are currently working on figuring this parameter automatically. Since we are moving in one direction which is far from the mean μ of the baseline distribution, we set the threshold to stop adding more neighbors as [μ + σ]. Once the new mean is outside the interval [μ + σ] we set the k for the current point at its current neighbor. In Fig. 3, we compare the distribution of distances for two points sitting in different locations in the feature space. The plot on the right shows a dashed line that is a baseline distribution of distances k = 7, solid line is the selected distribution set not to violate the interval [μ+σ], dotted line is the distribution if we add 20 more neighbors beyond [μ+σ]. The selected distribution kept the shape of baseline distribution while adding more edges that are useful for clustering. However, if we keep adding more neighbors beyond[μ + σ] interval, the distribution becomes flatter losing the shape of the baseline. Interestingly the distribution of distances indicates the sparsity of a cluster. In Fig. 3 (a), the point marked as × sits in a sparse cluster making its distribution more naturally looking covering large interval (0.1,0.4), due to varying distances around it. On the other hand, the point in bottom row sitting in a dense cluster has a sharp distribution covering a narrow interval (0.01,0.04), given similar distances 13 Algorithm 1: Constructing a refined k-nearest neighbor graph Input: N data points, maximum number of neighbors kmax Output: Refined k-nearest neighbor graph /* The following step has computations in order of O(dN logN ) 1 Construct k-nn graph where k = kmax represented by its distance matrix D(N, kmax) /* The following loop has computations in order of O(Nkmax) */ */ 2 for i = 1 to N do 3 for j = 1 to kmax do 4 DMi,j = mean(Di, 1 to j) + standard deviation(Di, 1 to j) 5 let DM 7(N, kmax) be an empty matrix 6 let all columns in DM 7 equal the 7th column in DM 7 D∗(N, kmax) = DM 7(N, kmax) − DM (N, kmax) /* The following loop has computations in order of O(Nkmax) */ 8 for all elements in D∗(N, kmax) do 9 if D∗ i,j < 0 then D∗ i,j = 0 10 /* The following loop has computations in order of O(Nkmax) */ 11 for all elements in D∗(N, kmax) do i,j == 0 or D∗ if D∗ j,i == 0 then 12 i,j = 0 D∗ D∗ j,i = 0 13 14 Construct refined k-nn using distance matrix D∗(N, kmax) around it. The computational bottleneck is to get the initial k-nearest neighbor graph. These computations could be reduced by using efficient data structure like kd-trees which can be constructed in O(dN logN ) [34]. The parameter k was set as kmax. By setting kmax we are comfortable that each data point requires edges less than kmax. Then, getting the refined k-nearest neighbor graph requires low computations O(N kmax). Once we have the distance ma- trix of size N × kmax, we compute mean and standard deviation μ0 and σ0 14 Fig. 4. Illustration on the importance of mutuality test. (a) refined k-nn graph with di- rected edges, (b) refined k-nn graph with undirected edges, (c) refined k-nn after removing edges lacking mutual agreement (best viewed in color). for the first seven columns. Then we add more neighbors to compute the new mean μi. Once μi > μ0 + σ0, the comparison stops and all elements up to kmax are nullified. This process is illustrated by steps 1–5 in Algorithm 1. 3.2. Checking mutual agreement The graph obtained in the previous step is a directed graph. Each edge indicates the existence of the destination point in the source point refined k-nn list. A pair of points have a mutual agreement if they have each other in their refined k-nn lists. Fig. 4 shows how crucial this step is. If we convert the refined k-nn graph Fig. 4 (a) into undirected graph Fig. 4 (b) and proceed with spectral clustering, we should not expect great results since all clusters are connected. However, if we drop the edges between neighbors lacking mutual agreement, we end up with a graph highlighting groups of points separated by different local statistics (check steps 6–7 in Algorithm 1). 15 12 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 agreement, we end up with a graph highlighting groups of points separated by different local statistics (check steps 6-7 in Algorithm 1). (a) (b) (c) Fig. 4. Illustration on the importance of mutuality test. (a) refined k-nn graph with directed edges, (b) refined k-nn graph with undirected edges, (c) refined k-nn after removing edges lacking mutual agreement (best viewed in color). 3.3 Looking for the eigengap Once the graph is ready, we can construct the pairwise similarity matrix and assign weights on edges. We used the similarity introduced by Zelnik-Manor and Perona [16] it is superior in highlighting clusters with different statistics. A is defined as follows: A(cid:3036)(cid:3037)(cid:3404)exp(cid:4678)(cid:3398)d(cid:2870)(cid:4666)i,j(cid:4667)σ(cid:3036) σ(cid:3037)(cid:4679) . (6) The local scale σ(cid:3036) set as the distance of a point to its kth neighbor, here we set it to be the 7th neighbor d(cid:4666)i,i(cid:3038)(cid:2880)(cid:2875)(cid:4667). The eigen-decomposition is carried out afterwards to get the top C eigenvectors (C is number of clusters). Setting C manually is not practical. Our recent work in [6] introduced a framework to uncover C by evaluating eigenvectors independently and calculate Davies-Bouldin index (DBI) for each eigenvector. However, that framework was built around approximate spectral clustering where number of prototypes is m compared to N points in our case (m ≪ N). Applying the same framework here could be computationally expensive. Therefore, we preferred to track the change in eigenvalues. Liu et al. proposed predicting C from eigenvalues, but their method requires a parameter  [35]. To keep it simple, we start with 2nd and 3rd eigenvalues and compute their 3.3. Looking for the eigengap Once the graph is ready, we can construct the pairwise similarity matrix and assign weights on edges. We used the similarity introduced by Zelnik- Manor and Perona [16] it is superior in highlighting clusters with different statistics. The affinity matrix A is defined as follows: Aij = exp (cid:18) −d2 (i, j) σi σj (cid:19) . (6) The local scale σi set as the distance of a point to its kth neighbor, here we set it to be the 7th neighbor d(i, ik=7). The eigen-decomposition is carried out afterwards to get the top C eigenvectors (C is number of clusters). Setting C manually is not practical. Our recent work in [6] introduced a framework to uncover C by evaluating eigenvectors independently and calculate Davies- Bouldin index (DBI) for each eigenvector. However, that framework was built around approximate spectral clustering where number of prototypes is m compared to N points in our case m (cid:28) N . Applying the same framework here could be computationally expensive. Therefore, we preferred to track the change in eigenvalues. Liu et al. proposed predicting C from eigenvalues, but their method requires a parameter τ [32]. To keep it simple, we start with 2nd and 3rd eigenvalues and compute their mean and standard deviation. As we add more eigenvalues we check if the new mean is less than old mean plus standard deviation (see steps 1–3 in Algorithm 2). C would be set as: C = i, where μi+1 > μi + σi. (7) 16 Fig. 5. Illustration on the importance of mutuality test. (a) refined k-nn graph with di- rected edges, (b) refined k-nn graph with undirected edges, (c) refined k-nn after removing edges lacking mutual agreement (best viewed in color). 3.4. Clustering in the embedding space In spectral clustering, it is not enough to specify only the number of clusters C, it also needs the number of dimensions of the embedding space. The original algorithm [2] states that for C clusters k-means should operates in the top C eigenvectors space. In practice, C eigenvectors could be detected in a space where number of eigenvectors is less than C. For example, in Fig. 5 the original data points form three clusters, and by plotting them using top two eigenvectors, it is clear that clusters are separated and detectable via k-means. Therefore, it is worth checking how k-means would perform in an embedding space with less than C eigenvectors. For all eigenvectors less than C, we constructed embedding spaces starting by 2nd and 3rd eigenvectors then add one more eigenvector up to C. On each embedding space, k-means operates to detect C clusters. We end up with C vectors each of which represents cluster memberships. To choose the right cluster membership, we applied each membership vector to the refined k-nn 17 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 13 mean and standard deviation. As we add more eigenvalues we check if the new mean is less than old mean plus standard deviation (see steps 1-3 in Algorithm 2). C would be set as: C(cid:3404)i, where μ(cid:3036)(cid:2878)(cid:2869)(cid:3408)μ(cid:3036)(cid:3397)σ(cid:3036) . (7) 3.4 Clustering in the embedding space In spectral clustering, it is not enough to specify only the number of clusters C, it also needs the number of dimensions of the embedding space. The original algorithm [2] states that for C clusters k-means should operates in the top C eigenvectors space. In practice, C eigenvectors could be detected in a space where number of eigenvectors is less than C. For example, in Fig. 5 the original data points form three clusters, and by plotting them using top two eigenvectors, it is clear that clusters are separated and detectable via k-means. Therefore, it is worth checking how k-means would perform in an embedding space with less than C eigenvectors. (a) (b) (c) Fig. 5. Illustration of embedding space projection. (a) k-nn refined graph; (b) data points in feature space; (c) data points projected onto 2nd and 3rd eigenvectors of graph Laplacian. For all eigenvectors less than C, we constructed embedding spaces starting by 2nd and 3rd eigenvectors then add one more eigenvector up to C. On each embedding space, k-means operates to detect C clusters. We end up with C vectors each of which represents cluster memberships. To choose the right cluster membership, we applied each membership vector to the refined k-nn graph and sum the weights of inter-cluster edges. Inter-cluster edges link points with different cluster membership. The right membership vector is the one that yields Algorithm 2: Clustering in embedding space with unknown C Input: A refined k-nn graph G(V, E) with N vertices, number of required eigenvalues λmax Output: N data points grouped into C clusters 1 Compute graph Laplacian Lsym = D−1/2AD−1/2 /* The following step has computations in order of O(N 3) */ 2 Compute eigenvalues λ and eigenvectors v of graph Laplacian Lsym /* The following loop has computations in order of O(λmax) */ 3 for i = 3 to λmax do 4 if λi+1 > (mean(λ2 to i) + standard deviation(λ2 to i) then 5 set C = i /* The following loop has computations in order of O(CdtN ) */ 6 for all elements in D∗(N, kmax) do 7 run k-means with k = C on N data points using eigenvectors v2 to vi of v. set li as the label vector returned by k-means. /* The following loop has computations in order of O(CE) */ 9 for i = 2 to C do 10 let ai be the variable holding sum of weights connecting unmatched labels in li. label all vertices in V using li. for each edge E(p, q) in E where p, q ∈ V do if labels are different li(p) (cid:54)= li(q) then ai = ai + E(p, q) 8 11 12 13 14 15 Return the lowest ai and its associated li graph and sum the weights of inter-cluster edges. Inter-cluster edges link points with different cluster membership. The right membership vector is the one that yields the lowest sum of inter-cluster weights. Ideally, this sum would be zero indicating no edges are linking different clusters (see steps 4–6 in Algorithm 2). 18 3.5. Integration with SpectralNet Spectral clustering using deep neural networks (SpectralNet) was intro- duced by Shaham et al. [33]. They highlighted two shortcomings of spectral clustering: 1) the scalability issue with large datasets where direct computa- tion of eigenvectors could be infeasible, and 2) the generalization issue which is extending spectral embedding to unseen data in a task commonly known as out-of-sample-extension [34, 35, 36]. Our proposed method could be integrated with SpectralNet. The Spec- tralNet consists of three main stages: 1) unsupervised learning of an affinity matrix given a distance measure, via a Siamese network, 2) unsupervised learning of an embedding space by optimizing spectral clustering objective, and 3) learning cluster assignments by running k-means in the embedding space. Our method for filtering the graph could be executed before running the Siamese net. Siamese nets [37, 38] are trained to learn complex affin- ity relations that cannot be captured by Euclidean distance. Shaham et al. [33] empirically found that using Siamese net to determine the affinity often improves the quality of clustering. Siamese nets are usually trained on similar (positive) and dissimilar (neg- ative) pairs of data points. For labeled data, positive and negative pairs could be decided from the labels. For example, a pair with the same label is set a positive pair, while a pair with different labels is set as negative pair. But this is not the case with unlabeled data where nearest neighbor graph can be used to determine positive and negative pairs. Shaham et al. [33] con- structed positive pairs for Siamese net by pairing each point with two of its nearest neighbors. An equal number of negative pairs was randomly chosen 19 from farther neighbors. We used a different approach in our experiments. We let our method detailed in Algorithm 1 to decide how many neighbors a data points should have as positive pairs. Then, an equal number of farther neighbors is set as negative pairs. Our approach to pass positive and negative pairs to Siamese has two advantages. First, the number of positive pairs is not fixed for all data points. This makes points in dense regions to have more positive and negative pairs. Second, we did not use a random selection for negative pairs, instead we assigned farther neighbors as negative pairs. This would contribute to the consistency of the method over independent executions. 4. Experiments and discussions Experiments were conducted using synthetic data, real data, and a dataset with an increasing noise (10% to 50% of N ). The proposed method was com- pared against approximate spectral clustering (ASC) methods. The most famous vector quantization for ASC are: k-means and self-organizing map (SOM). These were selected for approximation. Similarities between pro- totypes obtained through k-means and SOM were computed using local σ [16], CONN [14], and CONNHybrid [8]. There were other similarity metrics proposed in [8], but they were built on top of CONN and their performance was highly correlating with CONN. All experiments were coded in MAT- LAB 2018b and run on a windows 10 machine (3.40 GHz CPU and 8 GB of memory). The code is available on https://github.com/mashaan14/ Spectral-Clustering. 20 4.1. Evaluation metrics The performance of competing methods was evaluated by comparing la- bels obtained by the clustering method with the true labels provided in ground truth. Two metrics were used for the evaluation: clustering accu- racy (ACC) and adjusted Rand index (ARI). Clustering accuracy checks one on one assignments and computes the percentage of hits. Let Ti and Li be ground truth labels and labels obtained through clustering respectively. Then, accuracy is defined as [39]: ACC(T, L) = (cid:80)N i=1 δ(Ti, map(Li)) N , (8) where N is the number of points and the function δ(x, y) equals one when x = y and equals zero otherwise. The function map(Li) is the permutation mapping that maps the obtained cluster labels to its equivalent in the ground truth labels. The adjusted Rand index (ARI) [40] is one of the "pair counting evalu- ation measures". For two groupings T and L, ARI counts how many pairs T and L agreed or disagreed. It has better bounds than the original Rand index (RI) [41]. The upper bound is 1 indicating identical groupings and the lower bound 0 indicates random groupings. Let N be the number of elements in the contingency table with T rows and L columns. Given all possible pairs (cid:1), they can be classified into four types: n11: pairs in the same cluster in (cid:0)n in both T and L; n00: pairs in different clusters in both T and L; n01: pairs 2 in the same cluster in T but in different clusters in L; n10: pairs in different 21 Fig. 6. Synthetic datasets used in the experiments. clusters in T but in the same cluster in L. Then, ARI is defined as: ARI(T, L) = 2(n00n11 − n01n10) (n00 + n01)(n01 + n11) + (n00 + n10)(n10 + n11) . (9) The computational efficiency of competing methods was measured by the percentage of edges used compared to all edges in a fully connected graph. This is more suitable measure than simply measuring the running time which is sensitive to the experimental setup (e.g., computation power, machine used, etc.). The metric is computed as follows: E% = E(G) E(Gf ull) , (10) where E(G) is the number of edges in the filtered graph and E(Gf ull) is the number of edges in the fully connected graph. 4.2. Synthetic datasets For approximate spectral clustering (ASC), the number of prototypes was selected as the elbow point in the quantization error curve by k-means. It was set as 32, 32, 64, and 32 for sparse303, ring, aggregation, and sparse622 22 16 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 sparse303 ring aggregation sparse622 Fig. 6. Synthetic datasets used in the experiments. Table 1. Properties of tested datasets. N = number of samples, d = number of dimensions (i.e., features), and C = number of clusters. Synthetic datasets Real datasets N d C N d C sparse303 303 2 3 iris 150 4 3 ring 238 2 3 wine 178 13 3 aggregation 788 2 7 ImageSeg 2100 18 7 sparse622 622 2 5 statlog 6435 5 6 PenDigits 10992 16 10 mGamma 19020 10 2 4.2 Synthetic datasets For approximate spectral clustering (ASC), the number of prototypes was selected as the elbow point in the quantization error curve by k-means. It was set as 32, 32, 64, and 32 for sparse303, ring, aggregation, and sparse622 respectively. As a general observation, prototypes placed by self-organizing map (SOM) performed better than the ones placed by k-means (especially in sparse303 and sparse622). This behaviour could be explained by training of SOM in which prototypes move as a group towards a data point and not independent from each other as in k-means. This enables SOM to place more neurons into dense regions than k-means (please refer to Fig. 1 for illustration). In terms of the similarity metric, CONN and CONNHybrid have a slight advantage over local  especially in aggregation dataset in which all clusters are dense. In ring dataset, CONN and CONNHybrid achieved similar performances higher than local . There were performance drops when C was unknown compared when it was given. The most significant drops occurred in sparse622 when it reached 50% drop compared to when C was given. In sparse303, the drop was around 25%. For ring and aggregation datasets the drop was smaller compared to sparse datasets with Table 1. Properties of tested datasets. N = number of samples, d = number of dimen- sions (i.e., features), and C = number of clusters. respectively. As a general observation, prototypes placed by self-organizing map (SOM) performed better than the ones placed by k-means (especially in sparse303 and sparse622). This behaviour could be explained by training of SOM in which prototypes move as a group towards a data point and not independent from each other as in k-means. This enables SOM to place more neurons into dense regions than k-means (please refer to Fig. 1 for illustration). In terms of the similarity metric, CONN and CONNHybrid have a slight advantage over local σ especially in aggregation dataset in which all clusters are dense. In ring dataset, CONN and CONNHybrid achieved similar performances higher than local σ. There were performance drops when C was unknown compared when it was given. The most significant drops occurred in sparse622 when it reached 50% drop compared to when C was given. In sparse303, the drop was around 25%. For ring and aggregation datasets the drop was smaller com- pared to sparse datasets with exception of local σ in aggregation dataset. Usually in sparse datasets, the graph has a single connected component and by giving C we are forcing the method to break it into the desired number of connected components. But when C is unknown it was very difficult for the 23 16 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 sparse303 ring aggregation sparse622 Fig. 6. Synthetic datasets used in the experiments. Table 1. Properties of tested datasets. N = number of samples, d = number of dimensions (i.e., features), and C = number of clusters. Synthetic datasets Real datasets N d C N d C sparse303 303 2 3 iris 150 4 3 ring 238 2 3 wine 178 13 3 aggregation 788 2 7 ImageSeg 2100 18 7 sparse622 622 2 5 statlog 6435 5 6 PenDigits 10992 16 10 mGamma 19020 10 2 4.2 Synthetic datasets For approximate spectral clustering (ASC), the number of prototypes was selected as the elbow point in the quantization error curve by k-means. It was set as 32, 32, 64, and 32 for sparse303, ring, aggregation, and sparse622 respectively. As a general observation, prototypes placed by self-organizing map (SOM) performed better than the ones placed by k-means (especially in sparse303 and sparse622). This behaviour could be explained by training of SOM in which prototypes move as a group towards a data point and not independent from each other as in k-means. This enables SOM to place more neurons into dense regions than k-means (please refer to Fig. 1 for illustration). In terms of the similarity metric, CONN and CONNHybrid have a slight advantage over local  especially in aggregation dataset in which all clusters are dense. In ring dataset, CONN and CONNHybrid achieved similar performances higher than local . There were performance drops when C was unknown compared when it was given. The most significant drops occurred in sparse622 when it reached 50% drop compared to when C was given. In sparse303, the drop was around 25%. For ring and aggregation datasets the drop was smaller compared to sparse datasets with Table 2. Evaluating competing methods on synthetic data for 100 runs. Three rows for each dataset: ACC: mean accuracy ± standard deviation, ARI: mean adjusted Rand index ± standard deviation, and E%: the percentage of edges compared to edges in a fully connected graph. Bold values are the best scores. eigengap detection to uncover C because it was a single connected compo- nent which cause the sharp drops in performance. For ring and aggregation datasets, ASC passes a graph with multiple connected components making the task easier for the eigengap detector. The major drawback of ASC that kept persisting across all synthetic datasets is the standard deviation of performance scores. In different exper- iments it reached 17% of ACC and 0.2 of ARI, this highlights the inconsis- 24 20 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 Table 2. Evaluating competing methods on synthetic data for 100 runs. Three rows for each dataset: ACC: mean accuracy with standard deviation, ARI: mean adjusted Rand index with standard deviation, and E%: the percentage of edges compared to edges in a fully connected graph. Bold values are the best scores. C is given Local σ Local σ CONN CONN CONNHybrid CONNHybrid Ours k-means SOM k-means SOM k-means SOM sparse303 ACC 73.50 ± 08.86 80.04 ± 05.25 62.90 ± 17.40 85.25 ± 13.60 51.83 ± 15.84 82.64 ± 14.03 99.67 ± 00.00 ARI 0.467 ± 0.11 0.586 ± 0.06 0.395 ± 0.26 0.748 ± 0.21 0.198 ± 0.22 0.686 ± 0.23 0.990 ± 0.00 E% 1.08 ± 0.00 0.19 ± 0.00 0.09 ± 0.01 0.11 ± 0.01 0.09 ± 0.01 0.11 ± 0.01 3.51 ± 0.00 Ring ACC 85.26 ± 00.67 86.99 ± 01.94 92.76 ± 05.88 94.25 ± 05.99 90.67 ± 05.02 91.19 ± 05.55 99.16 ± 00.00 ARI 0.691 ± 0.01 0.739 ± 0.03 0.843 ± 0.12 0.870 ± 0.13 0.803 ± 0.10 0.811 ± 0.11 0.976 ± 0.00 E% 1.76 ± 0.00 0.30 ± 0.00 0.13 ± 0.01 0.14 ± 0.01 0.13 ± 0.01 0.14 ± 0.01 4.41 ± 0.00 aggregation ACC 86.62 ± 05.52 79.90 ± 05.75 98.31 ± 03.13 96.65 ± 04.48 96.96 ± 04.23 95.50 ± 06.65 99.02 ± 01.42 ARI 0.837 ± 0.08 0.735 ± 0.07 0.971 ± 0.04 0.942 ± 0.07 0.951 ± 0.06 0.930 ± 0.09 0.978 ± 0.02 E% 0.65 ± 0.00 0.05 ± 0.00 0.04 ± 0.00 0.03 ± 0.00 0.03 ± 0.00 0.03 ± 0.00 1.42 ± 0.00 sparse622 ACC 80.69 ± 02.72 77.56 ± 08.00 85.28 ± 06.94 91.35 ± 06.75 76.79 ± 07.93 83.05 ± 04.27 96.33 ± 06.46 ARI 0.670 ± 0.03 0.645 ± 0.08 0.780 ± 0.09 0.854 ± 0.09 0.634 ± 0.08 0.706 ± 0.05 0.931 ± 0.07 E% 0.26 ± 0.00 0.04 ± 0.00 0.03 ± 0.00 0.03 ± 0.00 0.02 ± 0.00 0.03 ± 0.00 1.69 ± 0.00 C is unknown Local σ Local σ CONN CONN CONNHybrid CONNHybrid Ours k-means SOM k-means SOM k-means SOM sparse303 ACC 60.45 ± 08.33 65.89 ± 04.55 52.38 ± 17.00 67.88 ± 14.77 44.22 ± 11.48 65.87 ± 11.94 99.67 ± 00.00 ARI 0.338 ± 0.16 0.466 ± 0.09 0.262 ± 0.27 0.533 ± 0.23 0.102 ± 0.17 0.496 ± 0.20 0.990 ± 0.00 E% 1.08 ± 0.00 0.19 ± 0.00 0.09 ± 0.00 0.11 ± 0.01 0.09 ± 0.00 0.11 ± 0.01 3.51 ± 0.00 ring ACC 80.46 ± 04.43 76.67 ± 01.38 88.06 ± 08.02 84.34 ± 09.26 88.87 ± 07.20 86.33 ± 07.50 99.16 ± 00.00 ARI 0.638 ± 0.05 0.637 ± 0.03 0.781 ± 0.13 0.733 ± 0.14 0.778 ± 0.12 0.745 ± 0.12 0.976 ± 0.00 E% 1.76 ± 0.00 0.30 ± 0.00 0.13 ± 0.01 0.14 ± 0.01 0.13 ± 0.00 0.14 ± 0.01 4.41 ± 0.00 aggregation ACC 61.50 ± 12.03 51.24 ± 01.58 89.42 ± 09.49 87.84 ± 10.98 87.35 ± 09.25 83.01 ± 10.12 95.17 ± 01.36 ARI 0.485 ± 0.17 0.361 ± 0.03 0.853 ± 0.11 0.827 ± 0.13 0.834 ± 0.10 0.777 ± 0.12 0.903 ± 0.01 E% 0.65 ± 0.00 0.05 ± 0.00 0.04 ± 0.00 0.03 ± 0.00 0.04 ± 0.00 0.03 ± 0.00 1.42 ± 0.00 sparse622 ACC 42.07 ± 00.69 42.00 ± 00.20 51.76 ± 10.88 49.30 ± 10.35 42.04 ± 03.90 43.00 ± 03.34 96.80 ± 05.65 ARI 0.275 ± 0.05 0.307 ± 0.02 0.392 ± 0.13 0.341 ± 0.15 0.280 ± 0.07 0.232 ± 0.06 0.936 ± 0.06 E% 0.26 ± 0.00 0.04 ± 0.00 0.02 ± 0.00 0.03 ± 0.00 0.03 ± 0.00 0.03 ± 0.00 1.69 ± 0.00 The major drawback of ASC that kept persisting across all synthetic datasets is the standard deviation of performance scores. In different experiments it reached 17% of ACC and 0.2 of ARI, this highlights the inconsistency of these methods. Our proposed method achieved a score close to a full mark across all synthetic datasets. Another advantage of our method was the consistent performance. This indicates that no matter how many times you repeat the method there is a high chance to get a score close to the full mark. tency of these methods. Our proposed method achieved a score close to a full mark across all synthetic datasets. Another advantage of our method was the consistent performance. This indicates that no matter how many times you repeat the method there is a high chance to get a score close to the full mark. The third evaluation metric was the percentage of used edges compared to fully connected undirected graph. All ASC methods had a lower number of edges than our method because they are constructing a graph out of m prototypes and ours used all data points N (m (cid:28) N ). However, the high- est percentage of edges for our method was 4.41% in ring dataset. This means that 95.59% were removed from the fully connected graph, this is a considerable reduction in computations and memory footprint. 4.3. Real datasets For real datasets the number of prototypes in ASC methods was set by monitoring quantization error to 32, 32, 40, 100, 500, and 1000 for datasets: iris, wine, ImageSeg, statlog, Pen digits, and mGamma. For iris dataset and when C was given our method achieved the highest performance with a low standard deviation across all runs. However, when C was unknown our method dropped the most compared to ASC methods since we lost an en- tire cluster. SOM based approximation scores above k-means approximation across all similarity measures when C was given, due to high quality graphs provided by SOM. For memory footprint, our method used 6.76% of edges compared to a full graph out of all points in iris. In wine dataset, our method lagged behind ASC methods with a little performance drop when C was unknown. We went to investigate that by 25 Table 3. Testing competing methods on real datasets for 100 runs. Three rows for each dataset: ACC: mean accuracy ± standard deviation, ARI: mean adjusted Rand index ± standard deviation, and E%: the percentage of edges compared to edges in a fully connected graph. Bold values are the best scores. 26 22 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 C is given Local σ Local σ CONN CONN CONNHybrid CONNHybrid Ours k-means SOM k-means SOM k-means SOM iris ACC 67.45 ± 9.49 82.99 ± 7.69 77.11 ± 10.29 81.31 ± 10.17 78.26 ± 10.44 84.59 ± 8.84 90.00 ± 0.00 ARI 0.556 ± 0.08 0.650 ± 0.06 0.591 ± 0.11 0.614 ± 0.13 0.634 ± 0.11 0.685 ± 0.09 0.740 ± 0.00 E% 4.50 ± 0.00 0.77 ± 0.00 0.40 ± 0.03 0.43 ± 0.03 0.39 ± 0.03 0.44 ± 0.03 6.76 ± 0.00 wine ACC 82.64 ± 6.56 75.99 ± 14.63 68.84 ± 10.29 65.77 ± 12.27 74.53 ± 12.30 70.44 ± 11.17 69.66 ± 0.00 ARI 0.591 ± 0.09 0.519 ± 0.21 0.376 ± 0.14 0.337 ± 0.17 0.473 ± 0.17 0.417 ± 0.16 0.331 ± 0.00 E% 3.15 ± 0.00 0.54 ± 0.00 0.22 ± 0.02 0.25 ± 0.01 0.22 ± 0.01 0.25 ± 0.02 5.75 ± 0.00 ImageSeg ACC 42.50 ± 9.81 54.67 ± 5.40 48.75 ± 13.29 50.95 ± 6.39 34.80 ± 14.47 50.14 ± 10.06 64.85 ± 2.99 ARI 0.246 ± 0.11 0.381 ± 0.07 0.334 ± 0.14 0.387 ± 0.06 0.190 ± 0.16 0.360 ± 0.12 0.498 ± 0.03 E% 0.04 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.50 ± 0.00 statlog ACC 56.60 ± 5.57 60.92 ± 6.09 64.06 ± 3.67 64.85 ± 2.87 59.68 ± 3.96 61.76 ± 2.51 59.30 ± 0.90 ARI 0.380 ± 0.06 0.450 ± 0.07 0.501 ± 0.04 0.518 ± 0.03 0.431 ± 0.07 0.463 ± 0.04 0.466 ± 0.01 E% 0.06 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.28 ± 0.00 Pen digits ACC 63.30 ± 07.87 66.35 ± 06.18 61.33 ± 21.14 73.13 ± 16.50 63.35 ± 20.34 64.77 ± 27.08 83.41 ± 03.95 ARI 0.494 ± 0.07 0.525 ± 0.06 0.462 ± 0.20 0.609 ± 0.17 0.479 ± 0.20 0.535 ± 0.27 0.712 ± 0.03 E% 0.21 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.72 ± 0.00 mGamma ACC 66.57 ± 00.14 59.28 ± 05.08 64.66 ± 00.97 62.81 ± 01.79 66.13 ± 01.98 62.02 ± 01.61 65.54 ± 00.00 ARI 0.080 ± 0.00 0.018 ± 0.03 0.017 ± 0.03 0.021 ± 0.03 0.034 ± 0.04 0.007 ± 0.03 0.065 ± 0.00 E% 0.28 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.43 ± 0.00 C is unknown Local σ Local σ CONN CONN CONNHybrid CONNHybrid Ours k-means SOM k-means SOM k-means SOM iris ACC 66.66 ± 00.07 66.67 ± 00.00 67.99 ± 05.56 65.87 ± 05.19 68.07 ± 02.74 67.31 ± 02.47 66.67 ± 00.00 ARI 0.568 ± 0.00 0.568 ± 0.00 0.527 ± 0.07 0.498 ± 0.08 0.552 ± 0.02 0.554 ± 0.03 0.558 ± 0.00 E% 4.50 ± 0.00 0.77 ± 0.00 0.39 ± 0.02 0.43 ± 0.03 0.40 ± 0.03 0.43 ± 0.03 6.76 ± 0.00 wine ACC 69.00 ± 05.69 61.73 ± 13.08 62.64 ± 09.26 59.12 ± 11.86 63.89 ± 08.02 59.02 ± 10.62 67.42 ± 00.00 ARI 0.460 ± 0.10 0.341 ± 0.21 0.328 ± 0.15 0.276 ± 0.18 0.340 ± 0.15 0.278 ± 0.18 0.408 ± 0.00 E% 3.15 ± 0.00 0.54 ± 0.00 0.22 ± 0.02 0.25 ± 0.02 0.22 ± 0.01 0.25 ± 0.01 5.75 ± 0.00 ImageSeg ACC 15.75 ± 03.24 24.62 ± 05.97 24.60 ± 06.37 28.57 ± 00.01 24.19 ± 06.42 27.07 ± 04.29 26.81 ± 02.74 ARI 0.006 ± 0.02 0.124 ± 0.08 0.074 ± 0.05 0.102 ± 0.00 0.070 ± 0.05 0.091 ± 0.03 0.094 ± 0.01 E% 0.04 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.50 ± 0.00 statlog ACC 34.17 ± 02.66 33.02 ± 00.84 32.90 ± 00.26 32.97 ± 00.16 33.09 ± 00.13 33.17 ± 00.08 32.96 ± 00.00 ARI 0.099 ± 0.04 0.137 ± 0.00 0.079 ± 0.00 0.080 ± 0.00 0.082 ± 0.00 0.083 ± 0.00 0.080 ± 0.00 E% 0.06 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.28 ± 0.00 Pen digits ACC 19.92 ± 03.75 20.54 ± 01.52 11.19 ± 01.86 15.98 ± 03.75 11.17 ± 01.88 15.21 ± 04.03 18.66 ± 00.00 ARI 0.067 ± 0.04 0.116 ± 0.02 0.003 ± 0.01 0.038 ± 0.03 0.003 ± 0.01 0.030 ± 0.03 0.049 ± 0.00 E% 0.21 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.72 ± 0.00 mGamma ACC 66.61 ± 00.21 57.96 ± 06.28 64.20 ± 01.39 63.19 ± 01.76 65.56 ± 01.90 62.78 ± 01.91 16.85 ± 01.54 ARI 0.081 ± 0.00 0.014 ± 0.02 0.027 ± 0.03 0.027 ± 0.03 0.027 ± 0.04 0.020 ± 0.03 0.038 ± 0.00 E% 0.28 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.43 ± 0.00 Our method achieved the highest score for ImageSeg dataset when C was given. Projecting the points onto first three principal components reveal non-convex clusters with varying densities. This explains the high score delivered by our method. For statlog dataset, the performance of our method was in line with ASC methods with a slight advantage for methods based on CONN similarity measure. projecting points in wine dataset onto their first three principle components. The three clusters were of a convex shape and similar density. In such cases, we do not expect our method to outperform ASC methods that are capable of capturing convex clusters. The inconsistency of ASC methods continues to persist with the standard deviation of runs reached 14% of ACC and 0.2 of ARI. Our method achieved the highest score for ImageSeg dataset when C was given. Projecting the points onto first three principal components reveal non- convex clusters with varying densities. This explains the high score delivered by our method. For statlog dataset, the performance of our method was in line with ASC methods with a slight advantage for methods based on CONN similarity measure. For the last two datasets: Pen digits and mGamma, the value of the base- line distribution of 7 neighbors was not providing good results. Therefore, it was set manually to be 50 neighbors after testing a range of values. This change makes our method the best performer in Pen digits dataset when C was given. For mGamma dataset, the proposed method was close to the best performer when C was given. But when C was unknown it produced 13 clusters compared to 2 clusters in the ground truth, causing a sharp decline in ACC. 4.4. Noise robustness test The last experiment was testing competing methods' robustness against increasing noise, where C was given. The datasets in Fig. 7 were retrieved from [16] and the evaluation in Fig. 8 was based on ARI. In general, CONN based similarities performed better when data was clean. With increasing 27 Fig. 7. Datasets used for noise robustness test contaminated by 10% to 50% noisy points. noise, ASC methods start to drop in performance. On the other hand, our method continues to score better than ASC methods with noise approaching 30% of the data. Even with 40% noise, our method delivered the highest score on lines dataset. The core difference between our method and ASC methods is that our method cuts noisy points since they do not match the lines/rings density and ASC tries to accommodate noisy points due to its vector quantization component. 4.5. Experiments for Integration with SpectralNet For Integration with spectral clustering using deep neural networks (Spec- tralNet), we used three synthetic datasets, three methods, four evaluation metrics. The three datasets are: cc, aggregation, and compound, shown in Fig. 9. Two of the three methods were designed as described by Shaham et al. [33], where each data point is paired with k of its nearest neighbors to form positive points. In our experiments we set k as k = 2 and k = 4. Once positive pairs are constructed, an equal number of randomly selected farther neighbors is set as negative pairs. In the third method we let the proposed method detailed in Algorithm 1 to decide the number of positive pairs. Then, an equal number of farther neighbors as set as negative pairs. 28 20 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 delivered by our method. For statlog dataset, the performance of our method was in line with ASC methods with a slight advantage for methods based on CONN similarity measure. For the last two datasets: Pen digits and mGamma, the value of the baseline distribution of 7 neighbors was not providing good results. Therefore, it was set manually to be 50 neighbors after testing a range of values. This change makes our method the best performer in Pen digits dataset when C was given. For mGamma dataset, the proposed method was close to the best performer when C was given. But when C was unknown it produced 13 clusters compared to 2 clusters in the ground truth, causing a sharp decline in ACC. 4.4 Noise robustness test The last experiment was testing competing methods' robustness against increasing noise, where C was given. The datasets in Fig. 7 were retrieved from [16] and the evaluation in Fig. 8 was based on ARI. In general, CONN based similarities performed better when data was clean. With increasing noise, ASC methods start to drop in performance. On the other hand, our method continues to score better than ASC methods with noise approaching 30% of the data. Even with 40% noise, our method delivered the highest score on lines dataset. The core difference between our method and ASC methods is that our method cuts noisy points since they do not match the lines/rings density and ASC tries to accommodate noisy points due to its vector quantization component. 0% 10% 20% 30% 40% 50% Fig. 7. Two datasets used for noise robustness test contaminated by 10% to 50% noisy points. Fig. 8. Results of noise robustness test; (a) results on lines datasets; (b) results on rings dataset (best viewed in color). 29 22 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 (a) (b) Fig. 8. Results of noise robustness test; (a) results on lines datasets; (b) results on rings dataset (best viewed in color). 5. Conclusion Spectral clustering is a clustering paradigm with heavy computational demands. These demands were closely studied in the literature, and many solutions were proposed. However, many of these solutions compromised on consistency of clustering, or local statistics that are crucial for sparseness and noise detection. We proposed Fig. 9. Datasets used for SpectralNet experiments. For evaluation metrics, we used clustering accuracy and ARI that are de- scribed in equations 8 and 9 respectively. In addition to ACC and ARI we used normalized mutual information (NMI) as an evaluation metric because it was reported in the original SpectralNet paper [33]. NMI is defined as: N M I(T, L) = I(T ; L) max{H(T ), H(L)} , (11) where T and L be ground truth labels and labels obtained through clustering respectively. I(T ; L) denotes the mutual information between T and L, and H(*) denotes their entropy. We also used the total number of pairs as an indicator of computational efficiency. Table 4 displays the results of our SpectralNet experiments. In cc dataset, our proposed method outperformed the method with fixed k. Our method achieved ARI score of 0.800 with an increase of 30% over its closest com- petitor. This performance was largely due to the higher number of pairs passed to Siamese net. Our method passed 21,478 pairs on average, com- pared to 6,000 and 12,000 pairs passed by k = 2 and k = 4 respectively. 30 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 25 where $T$ and $L$ be ground truth labels and labels obtained through clustering respectively. $I(T;L)$ denotes the mutual information between $T$ and $L$, and $H(\cdot)$ denotes their entropy. We also used the total number of pairs as an indicator of computational efficiency. In \texttt{cc} dataset, our proposed method outperformed the method with fixed $k$. It got ARI score of 0.800 with an increase of 30\% over its closest competitor. This performance was largely due to the higher number of pairs passed to Siamese net. Our method passed 21478 pairs on average, compared to 6000 and 12000 pairs passed by $k=2$ and $k=4$ respectively. In \texttt{aggregation} dataset, $k=2$ was the best performer with ARI score of 0.808. Our method came behind $k=2$ by almost 10\%. However, the performance of fixed $k$ method dropped by 20\% when we run $k=4$. In \texttt{compound} dataset, our method was the best performer with ARI score of 0.705 with a difference of 15\% from the second performer. This experiment reveals that although Siamese nets are superior in building an affinity matrix, they still need an informative selection of positive and negative pairs. Fixing the number of positive pairs for all points limits the influence of points in dense regions. Points in dense regions should be able to pair with more nieghbors to strengthen intra-cluster connections. cc aggregation compound Table 4. Results of experiments for Integration with SpectralNet for 10 runs. Four rows for each dataset: ACC: mean accuracy ± standard deviation, ARI: mean adjusted Rand index ± standard deviation, NMI: mean normalized mutual information ± standard deviation, and Total pairs: the total number of positive and negative pairs passed to Siamese net. Bold values are the best scores. In aggregation dataset, k = 2 was the best performer with ARI score of 0.808. Our method scored lower ARI than k = 2, close to 10%. However, the performance of k = 4 was worse than ours, 40% when compared to ground truth. In compound dataset, our method was the best performer with ARI score of 0.705 with a difference of 15% from the second performer. This experiment reveals that although Siamese nets are superior in build- ing an affinity matrix, they still need an informative selection of positive and negative pairs. Fixing the number of positive pairs for all points limits the influence of points in dense regions. Points in dense regions should be able to pair with more neighbors to strengthen intra-cluster connections. 31 26 M. Alshammari et al. / Pattern Recognition 00 (2019) 000–000 k = 2 k = 4 Ours cc ACC 82.36 ± 14.59 77.00 ± 15.27 93.35 ± 10.99 ARI 0.504 ± 0.41 0.385 ± 0.40 0.800 ± 0.32 NMI 0.568 ± 0.35 0.450 ± 0.36 0.810 ± 0.27 Total pairs 6000.00 ± 0.00 12000.00 ± 0.00 21478 ± 127 aggregation ACC 83.73 ± 06.00 67.98 ± 10.97 72.45 ± 09.55 ARI 0.808 ± 0.07 0.599 ± 0.15 0.702 ± 0.10 NMI 0.867 ± 0.05 0.714 ± 0.10 0.782 ± 0.09 Total pairs 3152.00 ± 0.00 6304.00 ± 0.00 10760 ± 29 compound ACC 68.97 ± 08.56 71.71 ± 08.23 79.50 ± 05.91 ARI 0.545 ± 0.15 0.572 ± 0.15 0.705 ± 0.11 NMI 0.617 ± 0.10 0.660 ± 0.09 0.776 ± 0.09 Total pairs 1596.00 ± 0.00 3192.00 ± 0.00 5450 ± 48 5. Conclusion Spectral clustering is a clustering paradigm with heavy computational demands. These demands were closely studied in the literature, and many solutions were proposed. However, many of these solutions compromised on consistency of clustering, or local statistics that are crucial for sparseness and noise detection. We proposed a series of refinement stages to the well-known k-nearest neighbor graph. The obtained graph can detect sparse clusters and noisy points. Also, our method was capable of delivering consistent clustering over multiple runs, since it was based on k-nearest neighbor graph with no random operations involved. Compared to approximate spectral clustering (ASC), the proposed method detected sparse clusters, and achieved accurate clustering with substantial noise. The future directions of this work lie in two areas: 1) improving memory efficiency, and 2) automatically finding number of neighbors included in the baseline distribution. For memory efficiency, our method still requires memory larger than ASC methods to store the graph. ASC benefits from reducing nodes through vector quantization. Reducing nodes in a deterministic way would improve the memory efficiency of this work. Additionally, the number of neighbors included in the baseline distribution was tuned manually. The baseline distribution was used as a reference to whether or not further edges will be eliminated. 5. Conclusion Spectral clustering is a clustering paradigm with heavy computational demands. These demands were closely studied in the literature, and many solutions were proposed. However, many of these solutions compromised on consistency of clustering, or local statistics that are crucial for sparseness and noise detection. We proposed a series of refinement stages to the well-known k-nearest neighbor graph. The obtained graph can detect sparse clusters and noisy points. Also, our method was capable of delivering consistent clustering over multiple runs, since it was based on k-nearest neighbor graph with no random operations involved. Compared to approximate spectral clustering (ASC), the proposed method detected sparse clusters, and achieved accurate clustering with substantial noise. The future directions of this work lie in two areas: 1) improving memory efficiency, and 2) automatically finding number of neighbors included in the baseline distribution. For memory efficiency, our method still requires mem- ory larger than ASC methods to store the graph. ASC benefits from reducing nodes through vector quantization. Reducing nodes in a deterministic way would improve the memory efficiency of this work. Additionally, the number of neighbors included in the baseline distribution was tuned manually. The baseline distribution was used as a reference to whether or not further edges will be eliminated. References [1] J. Shi, J. Malik, Normalized cuts and image segmentation, IEEE Trans- actions on Pattern Analysis and Machine Intelligence 22 (2000) 888–905. 32 doi:10.1109/34.868688. [2] A. Y. Ng, M. I. Jordan, Y. Weiss, On spectral clustering: Analysis and an algorithm, Advances in Neural Information Processing Systems (2002). [3] U. von Luxburg, A tutorial on spectral clustering, Statistics and Com- puting 17 (2007) 395–416. doi:10.1007/s11222-007-9033-z. [4] M. Filippone, F. Camastra, F. Masulli, S. Rovetta, A survey of kernel and spectral methods for clustering, Pattern Recognition 41 (2008) 176– 190. URL: http://www.sciencedirect.com/science/article/pii/ S0031320307002580. doi:https://doi.org/10.1016/j.patcog.2007. 05.018. [5] L. Wang, M. Dong, Multi-level low-rank approximation-based spec- tral clustering for image segmentation, Pattern Recognition Letters 33 (2012) 2206–2215. doi:http://dx.doi.org/10.1016/j.patrec.2012. 07.024. [6] M. Alshammari, M. Takatsuka, Approximate spectral clustering with eigenvector selection and self-tuned k, Pattern Recognition Letters 122 (2019) 31–37. URL: http://www.sciencedirect.com/science/ article/pii/S0167865519300315. doi:https://doi.org/10.1016/j. patrec.2019.02.006. [7] K. Tasdemir, A hybrid similarity measure for approximate spectral clustering of remote sensing images, 2013 IEEE International Geoscience and Remote Sensing Symposium - IGARSS (2013) 3136–3139. doi:10. 1109/IGARSS.2013.6723491. [8] K. Tasdemir, B. Yalcin, I. Yildirim, Approximate spectral clustering with utilized similarity information using geodesic based hybrid distance measures, Pattern Recognition 48 (2015) 1465–1477. doi:https://doi. org/10.1016/j.patcog.2014.10.023. [9] I. Tyuryukanov, M. Popov, M. v. d. Meijden, V. Terzija, Discovering clusters in power networks from orthogonal structure of spectral em- bedding, IEEE Transactions on Power Systems (2018). doi:10.1109/ TPWRS.2018.2854962. 33 [10] T. Wang, H. Lin, P. Wang, Weighted-spectral clustering algorithm for detecting community structures in complex networks, Artificial Intel- ligence Review 47 (2017) 463–483. URL: https://doi.org/10.1007/ s10462-016-9488-4. doi:10.1007/s10462-016-9488-4. [11] T. Kohonen, Essentials of the self-organizing map, Neural Networks 37 (2013) 52–65. URL: http://www.sciencedirect.com/science/ article/pii/S0893608012002596. doi:https://doi.org/10.1016/j. neunet.2012.09.018. [12] D. Arthur, S. Vassilvitskii, K-means++: The advantages of careful seeding, Proceedings of the Annual ACM-SIAM Symposium on Discrete Algorithms 07-09-January-2007 (2007) 1027–1035. [13] D. Yan, L. Huang, M. I. Jordan, Fast approximate spectral cluster- ing, Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining (2009) 907–916. [14] K. Tasdemir, Vector quantization based approximate spectral clustering of large datasets, Pattern Recognition 45 (2012) 3034–3044. doi:https: //doi.org/10.1016/j.patcog.2012.02.012. [15] M. Alshammari, M. Takatsuka, Approximate spectral clustering using topology preserving methods and local scaling, The 25th International Conference on Neural Information Processing (ICONIP 2018) (2018). [16] L. Zelnik-Manor, P. Perona, Self-tuning spectral clustering, Advances in Neural Information Processing Systems (2005) 1601–1608. Normalized cuts J. Malik, pp. 1997, [17] J. Shi, tion, inward/record.uri?eid=2-s2.0-0030646927&partnerID=40&md5= 42573d155d149f8aaa0e35a0ea7664a2. 609407. segmenta- https://www.scopus.com/ doi:Doi10.1109/Cvpr.1997. 731–737. URL: and image [18] M. Meila, J. Shi, Learning segmentation by random walks, Advances in Neural Information Processing Systems (2001). [19] M. Sugiyama, Dimensionality reduction of multimodal labeled data by local fisher discriminant analysis, Journal of machine learning research 8 (2007) 1027–1061. 34 [20] S. Lloyd, Least squares quantization in pcm, IEEE Transactions on In- formation Theory 28 (1982) 129–137. doi:10.1109/TIT.1982.1056489. [21] T. Kohonen, The self-organizing map, Proceedings of the IEEE 78 (1990) 1464–1480. [22] T. Martinetz, K. Schulten, A "neural-gas" network learns topologies, University of Illinois at Urbana-Champaign Champaign, IL (1991). [23] T. Martinetz, K. Schulten, Topology representing networks, Neural Networks 7 (1994) 507–522. doi:10.1016/0893-6080(94)90109-0. [24] R. Wang, F. Nie, W. Yu, Fast spectral clustering with anchor graph for large hyperspectral images, IEEE Geoscience and Remote Sensing Letters 14 (2017) 2003–2007. doi:10.1109/LGRS.2017.2746625. [25] J. Guo, J. Ye, Anchors bring ease: An embarrassingly simple approach to partial multi-view clustering, Proceedings of the AAAI Conference on Artificial Intelligence 33 (2019) 118–125. [26] C. D. Correa, P. Lindstrom, Locally-scaled spectral clustering using empty region graphs, in: Proceedings of the 18th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '12, Association for Computing Machinery, New York, NY, USA, 2012, p. 1330–1338. URL: https://doi.org/10.1145/2339530. 2339736. doi:10.1145/2339530.2339736. [27] T. ̇Inkaya, S. Kayalıgil, N. E. ̈Ozdemirel, An adaptive neighbour- hood construction algorithm based on density and connectivity, Pattern Recognition Letters 52 (2015) 17–24. URL: http://www. sciencedirect.com/science/article/pii/S0167865514002815. doi:https://doi.org/10.1016/j.patrec.2014.09.007. [28] T. Inkaya, tering, URL: S0957417415005345. 07.074. A parameter-free similarity graph for spectral clus- Expert Systems with Applications 42 (2015) 9489–9498. http://www.sciencedirect.com/science/article/pii/ doi:https://doi.org/10.1016/j.eswa.2015. [29] L. Zhengdong, M. A. Carreira-Perpinan, Constrained spectral cluster- ing through affinity propagation, 2008 IEEE Conference on Computer 35 Vision and Pattern Recognition (2008) 1–8. doi:10.1109/CVPR.2008. 4587451. [30] Z. Li, J. Liu, X. Tang, Constrained clustering via spectral regularization, 2009 IEEE Conference on Computer Vision and Pattern Recognition (2009) 421–428. doi:10.1109/CVPR.2009.5206852. [31] R. Zhang, F. Nie, X. Li, clustering with parameter-free constraint, Neurocomputing 241 (2017) 164– 170. URL: http://www.sciencedirect.com/science/article/pii/ S0925231217303089. doi:https://doi.org/10.1016/j.neucom.2017. 01.085. Self-weighted spectral [32] G. Liu, Z. Lin, S. Yan, J. Sun, Y. Yu, Y. Ma, Robust recovery of subspace structures by low-rank representation, IEEE Transactions on Pattern Analysis and Machine Intelligence 35 (2013) 171–184. doi:10. 1109/TPAMI.2012.88. [33] U. Shaham, K. Stanton, H. Li, B. Nadler, R. Basri, Y. Kluger, 6th Spectralnet: Spectral clustering using deep neural networks, ICLR International Conference 2018 https: //www.scopus.com/inward/record.uri?eid=2-s2.0-85071002796& partnerID=40&md5=50cd7687ec9a8a763991553362caa86c. on Learning Representations, (2018). URL: - Conference Track Proceedings [34] Y. Bengio, J.-F. Paiement, P. Vincent, O. Delalleau, N. Le Roux, isomap, mds, https: M. Ouimet, eigenmaps, clustering, //www.scopus.com/inward/record.uri?eid=2-s2.0-33947233031& partnerID=40&md5=0277a925a2ef56079a83a8f33b5b4cde. Out-of-sample extensions 2004. URL: spectral and lle, for [35] C. Fowlkes, S. Belongie, F. Chung, J. Malik, Spectral grouping using the nystrom method, IEEE Transactions on Pattern Analysis and Machine Intelligence 26 (2004) 214–225. doi:10.1109/TPAMI.2004.1262185. [36] R. Coifman, S. Lafon, Geometric harmonics: A novel for multiscale Applied 31–52. eid=2-s2.0-33745398604&doi=10.1016%2fj.acha.2005.07. tool functions, (2006) https://www.scopus.com/inward/record.uri? and Computational Harmonic Analysis URL: extension of out-of-sample empirical 21 36 005&partnerID=40&md5=9996d6b162cca026a4caf1805004eff5. doi:10.1016/j.acha.2005.07.005. Dimensionality reduction by [37] R. Hadsell, S. Chopra, Y. LeCun, volume 2, 2006, pp. 1735–1742. learning an invariant mapping, URL: https://www.scopus.com/inward/record.uri?eid=2-s2. 0-33845594569&doi=10.1109%2fCVPR.2006.100&partnerID=40&md5= 6b88a96eb9703c28939e5534c7ba6bd8. doi:10.1109/CVPR.2006.100. [38] U. Shaham, R. Lederman, Learning by coincidence: Siamese Pattern Recognition 74 https://www.scopus.com/inward/record. networks and common variable learning, (2018) uri?eid=2-s2.0-85032304883&doi=10.1016%2fj.patcog.2017. 09.015&partnerID=40&md5=358ba20ecd4f9a87026ad0474790aeca. doi:10.1016/j.patcog.2017.09.015. 52–63. URL: [39] D. Cai, X. He, J. Han, Document clustering using locality preserving indexing, IEEE Transactions on Knowledge and Data Engineering 17 (2005) 1624–1637. doi:10.1109/TKDE.2005.198. [40] L. Hubert, P. Arabie, Comparing partitions, Journal of Classifi- cation 2 (1985) 193–218. URL: https://www.scopus.com/inward/ record.uri?eid=2-s2.0-0000008146&doi=10.1007%2fBF01908075& partnerID=40&md5=bd03cf70caee7de0ccf3c0dd431b97ca. doi:10.1007/BF01908075. [41] W. M. Rand, Objective criteria for the evaluation of cluster- ing methods, Journal of the American Statistical Association 66 (1971) 846–850. URL: https://www.scopus.com/inward/record. uri?eid=2-s2.0-84950632109&doi=10.1080%2f01621459.1971. 10482356&partnerID=40&md5=3bcb39c5cbd4ccf7dec3e0fa080b1759. doi:10.1080/01621459.1971.10482356. 37
http://arxiv.org/abs/2302.11295v1
2023-02-22T11:27:06
2023-02-22T11:27:06
Fair Correlation Clustering in Forests
The study of algorithmic fairness received growing attention recently. This stems from the awareness that bias in the input data for machine learning systems may result in discriminatory outputs. For clustering tasks, one of the most central notions of fairness is the formalization by Chierichetti, Kumar, Lattanzi, and Vassilvitskii [NeurIPS 2017]. A clustering is said to be fair, if each cluster has the same distribution of manifestations of a sensitive attribute as the whole input set. This is motivated by various applications where the objects to be clustered have sensitive attributes that should not be over- or underrepresented. We discuss the applicability of this fairness notion to Correlation Clustering. The existing literature on the resulting Fair Correlation Clustering problem either presents approximation algorithms with poor approximation guarantees or severely limits the possible distributions of the sensitive attribute (often only two manifestations with a 1:1 ratio are considered). Our goal is to understand if there is hope for better results in between these two extremes. To this end, we consider restricted graph classes which allow us to characterize the distributions of sensitive attributes for which this form of fairness is tractable from a complexity point of view. While existing work on Fair Correlation Clustering gives approximation algorithms, we focus on exact solutions and investigate whether there are efficiently solvable instances. The unfair version of Correlation Clustering is trivial on forests, but adding fairness creates a surprisingly rich picture of complexities. We give an overview of the distributions and types of forests where Fair Correlation Clustering turns from tractable to intractable. The most surprising insight to us is the fact that the cause of the hardness of Fair Correlation Clustering is not the strictness of the fairness condition.
[ "Katrin Casel", "Tobias Friedrich", "Martin Schirneck", "Simon Wietheger" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11295v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11295v1", "@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.CC", "cs.CY", "cs.DM", "cs.DS" ]
Fair Correlation Clustering in Forests Katrin Casel ! Humboldt University of Berlin, Germany Tobias Friedrich ! Hasso Plattner Institute, University of Potsdam, Germany Martin Schirneck ! Faculty of Computer Science, University of Vienna, Austria Simon Wietheger ! Hasso Plattner Institute, University of Potsdam, Germany Abstract The study of algorithmic fairness received growing attention recently. This stems from the awareness that bias in the input data for machine learning systems may result in discriminatory outputs. For clustering tasks, one of the most central notions of fairness is the formalization by Chierichetti, Kumar, Lattanzi, and Vassilvitskii [NeurIPS 2017]. A clustering is said to be fair, if each cluster has the same distribution of manifestations of a sensitive attribute as the whole input set. This is motivated by various applications where the objects to be clustered have sensitive attributes that should not be over- or underrepresented. Most research on this version of fair clustering has focused on centriod-based objectives. In contrast, we discuss the applicability of this fairness notion to Correlation Clustering. The existing literature on the resulting Fair Correlation Clustering problem either presents approximation algorithms with poor approximation guarantees or severely limits the possible distributions of the sensitive attribute (often only two manifestations with a 1:1 ratio are considered). Our goal is to understand if there is hope for better results in between these two extremes. To this end, we consider restricted graph classes which allow us to characterize the distributions of sensitive attributes for which this form of fairness is tractable from a complexity point of view. While existing work on Fair Correlation Clustering gives approximation algorithms, we focus on exact solutions and investigate whether there are efficiently solvable instances. The unfair version of Correlation Clustering is trivial on forests, but adding fairness creates a surprisingly rich picture of complexities. We give an overview of the distributions and types of forests where Fair Correlation Clustering turns from tractable to intractable. As the most surprising insight, we consider the fact that the cause of the hardness of Fair Correlation Clustering is not the strictness of the fairness condition. We lift most of our results to also hold for the relaxed version of the fairness condition. Instead, the source of hardness seems to be the distribution of the sensitive attribute. On the positive side, we identify some reasonable distributions that are indeed tractable. While this tractability is only shown for forests, it may open an avenue to design reasonable approximations for larger graph classes. 2012 ACM Subject Classification Theory of computation → Graph algorithms analysis; Social and professional topics → Computing / technology policy; Theory of computation → Dynamic programming Keywords and phrases correlation clustering, disparate impact, fair clustering, relaxed fairness 1 Introduction In the last decade, the notion of fairness in machine learning has increasingly attracted interest, see for example the review by Pessach and Schmueli [32]. Feldman, Friedler, Moeller, Scheidegger, and Venkatasubramanian [26] formalize fairness based on a US Supreme Court decision on disparate impact from 1971. It requires that sensitive attributes like gender or skin color should neither be explicitly considered in decision processes like hiring but 3 2 0 2 b e F 2 2 ] G L . s c [ 1 v 5 9 2 1 1 . 2 0 3 2 : v i X r a 2 Fair Correlation Clustering also should the manifestations of sensitive attributes be proportionally distributed in all outcomes of the decision process. Feldman et al. formalize this notion for classification tasks. Chierichetti, Kumar, Lattanzi, and Vassilvitskii [19] adapt this concept for clustering tasks. In this paper we employ the same disparate impact based understanding of fairness. Formally, the objects to be clustered have a color assigned to them that represents some sensitive attribute. Then, a clustering of these colored objects is called fair if for each cluster and each color the ratio of objects of that color in the cluster corresponds to the total ratio of vertices of that color. More precisely, a clustering is fair, if it partitions the set of objects into fair subsets. (cid:73) Definition 1 (Fair Subset). Let U be a finite set of objects colored by a function c : U → [k] for some k ∈ N>0. Let Ui = {u ∈ U | c(u) = i} be the set of objects of color i for all i ∈ [k]. Then, a set S ⊆ U is fair if and only if for all colors i ∈ [k] we have |S∩Ui| |S| = |Ui| |U | . To understand how this notion of fairness affects clustering decisions, consider the following example. Imagine that an airport security wants to find clusters among the travelers to assign to each group a level of potential risk with corresponding anticipating measures. There are attributes like skin color that should not influence the assignment to a risk level. A bias in the data, however, may lead to some colors being over- or underrepresented in some clusters. Simply removing the skin color attribute from the data may not suffice as it may correlate with other attributes. Such problems are especially likely if one of the skin colors is far less represented in the data than others. A fair clustering finds the optimum clustering such that for each risk level the distribution of skin colors is fair, by requiring the distribution of each cluster to roughly match the distribution of skin colors among all travelers. The seminal fair clustering paper by Chierichetti et al. [19] introduced this notion of fairness for clustering and studied it for the objectives k-center and k-median. Their work was extended by Bera, Chakrabarty, Flores, and Negahbani [11], who relax the fairness constraint in the sense of requiring upper and lower bounds on the representation of a color in each cluster. More precisely, they define the following generalization of fair sets. (cid:73) Definition 2 (Relaxed Fair Set). For a finite set U and coloring c : U → [k] for some k ∈ N>0 let pi, qi ∈ Q with 0 < pi (cid:54) |Ui| (cid:54) qi < 1 for all i ∈ [k], where Ui = {u ∈ U | c(u) = i}. A set |U | S ⊆ U is relaxed fair with respect to qi and pi if and only if pi (cid:54) |S∩Ui| (cid:54) qi for all i ∈ [k]. |S| Following these results, this notion of (relaxed) fairness was extensively studied for centroid- based clustering objectives with many positive results. For example, Bercea et al. [12] give bicreteira constant-factor approximations for facility location type problems like k-center and k-median. Bandyapadhyay, Fomin and Simonov [7] use the technique of fair coresets introduced by Schmidt, Schwiegelshohn, and Sohler [34] to give constant factor approximations for many centroid-based clustering objectives; among many other results, they give a PTAS for fair k-means and k-median in Euclidean space. Fairness for centroid-based objectives seems to be so well understood, that most research already considers more generalized settings, like streaming [34], or imperfect knowledge of group membership [25]. In comparison, there are few (positive) results for this fairness notion applied to graph clustering objectives. The most studied with respect to fairness among those is Correlation Clustering, arguably the most studied graph clustering objective. For Correlation Clustering we are given a pairwise similarity measure for a set of objects and the aim is to find a clustering that minimizes the number of similar objects placed in separate clusters and the number of dissimilar objects placed in the same cluster. Formally, the input to Casel, Friedrich, Schirneck & Wietheger 3 Correlation Clustering is a graph G = (V, E), and the goal is to find a partition P of V that minimizes the Correlation Clustering cost defined as cost(G, P) = |{{u, v} ∈ (cid:0)V 2 (cid:1) \ E | P[u] = P[v]}| + |{{u, v} ∈ E | P[u] 6= P[v]}|. (1) Fair Correlation Clustering then is the task to find a partition into fair sets that minimizes the Correlation Clustering cost. We emphasize that this is the complete, unweighted, min-disagree form of Correlation Clustering. (It is often called complete because every pair of objects is either similar or dissimilar but none is indifferent regarding the clustering. It is unweighted as the (dis)similarity between two vertices is binary. A pair of similar objects that are placed in separate clusters as well as a pair of dissimilar objects in the same cluster is called a disagreement, hence the naming of the min-disagree form.) There are two papers that appear to have started studying Fair Correlation Clus- tering independently1. Ahmadian, Epasto, Kumar, and Mahdian [2] analyze settings where the fairness constraint is given by some α and require that the ratio of each color in each cluster is at most α. For α = 1 2 , which corresponds to our fairness definition if there are two colors in a ratio of 1 : 1, they obtain a 256-approximation. For α = 1 k , where k is the number of colors in the graph, they give a 16.48k2-approximation. We note that all their variants are only equivalent to our fairness notion if there are α−1 colors that all occur equally often. Ahmadi, Galhotra, Saha, and Schwartz [1] give an O(c2)-approximation algorithm for instances with two colors in a ratio of 1 : c. In the special case of a color ratio of 1 : 1, they obtain a 3β + 4-approximation, given any β-approximation to unfair Correlation Clustering. With a more general color distribution, their approach also worsens drastically. For instances with k colors in a ratio of 1 : c2 : c3 : . . . : ck for positive integers ci, they give an O(k2 * max2(cid:54)i(cid:54)k ci)-approximation for the strict, and an O(k2 * max2(cid:54)i(cid:54)k qi)-approximation for the relaxed setting2. Following these two papers, Friggstad and Mousavi [28] provide an approximation to the 1 : 1 color ratio case with a factor of 6.18. To the best of our knowledge, the most recent publication on Fair Correlation Clustering is by Ahmadian and Negahbani [3] who give approximations for Fair Correlation Clustering with a slightly different way of relaxing fairness. They give an approximation with ratio O(ε−1k max2(cid:54)i(cid:54)k ci) for color distribution 1 : c2 : c3 : . . . : ck, where ε relates to the amount of relaxation (roughly qi = (1 + (cid:15))ci for our definition of relaxed fairness). All these results for Fair Correlation Clustering seem to converge towards consid- ering the very restricted setting of two colors in a ratio of 1 : 1 in order to give some decent approximation ratio. In this paper, we want to understand if this is unavoidable, or if there is hope to find better results for other (possibly more realistic) color distributions. In order to isolate the role of fairness, we consider "easy" instances for Correlation Clustering, and study the increase in complexity when adding fairness constraints. Correlation Clustering without the fairness constraint is easily solved on forests. We find that Fair Correlation Clustering restricted to forests turns NP-hard very quickly, even when ad- ditionally assuming constant degree or diameter. Most surprisingly, this hardness essentially also holds for relaxed fairness, showing that the hardness of the problem is not due to the strictness of the fairness definition. 1 Confusingly, they both carry the title Fair Correlation Clustering. 2 Their theorem states they achieve an O(max2(cid:54)i(cid:54)k qi)-approximation but when looking at the proof it seems they have accidentally forgotten the k2 factor. 4 Fair Correlation Clustering On the positive side, we identify color distributions that allow for efficient algorithms. Not surprisingly, this includes ratio 1 : 1, and extends to a constant number of k colors with distribution c1 : c2 : c3 : . . . : ck for constants c1, . . . , ck. Such distributions can be used to model sensitive attributes with a limited number of manifestation that are almost evenly distributed. Less expected, we also find tractability for, in a sense, the other extreme. We show that Fair Correlation Clustering on forests can be solved in polynomial time for two colors with ratio 1 : c with c being very large (linear in the number of overall vertices). Such a distribution can be used to model a scenario where a minority is drastically underrepresented and thus in dire need of fairness constraints. Although our results only hold for forests, we believe that they can offer a starting point for more general graph classes. We especially hope that our work sparks interest in the so far neglected distribution of ratio 1 : c with c being very large. 1.1 Related Work The study of clustering objectives similar or identical to Correlation Clustering dates back to the 1960s [10, 33, 37]. Bansal, Blum, and Chawla [8] were the first to coin the term Correlation Clustering as a clustering objective. We note that it is also studied under the name Cluster Editing. The most general formulation of Correlation Clustering regarding weights considers two positive real values for each pair of vertices, the first to be added to the cost if the objects are placed in the same cluster and the second to be added if the objects are placed in separate clusters [4]. The recent book by Bonchi, García-Soriano, and Gullo [13] gives a broad overview of the current research on Correlation Clustering. We focus on the particular variant that considers a complete graph with {−1, 1} edge- weights, and the min disagreement objective function. This version is APX-hard [16], implying in particular that there is no algorithm giving an arbitrarily good approximation unless P = NP. The best known approximation for Correlation Clustering is the very recent breakthrough by Cohen-Addad, Lee and Newman [20] who give a ratio of (1.994 + (cid:15)). We show that in forests, all clusters of an optimal Correlation Clustering solution have a fixed size. In such a case, Correlation Clustering is related to k-Balanced Partitioning. There, the task is to partition the graph into k clusters of equal size while minimizing the number of edges that are cut by the partition. Feldmann and Foschini [27] study this problem on trees and their results have interesting parallels with ours. Aside from the results on Fair Correlation Clustering already discussed above, we are only aware of three papers that consider a fairness notion close to the one of Chierichetti et al. [19] for a graph clustering objective. Schwartz and Zats [35] consider incomplete Fair Correlation Clustering with the max-agree objective function. Dinitz, Srinivasan, Tsepenekas, and Vullikanti [23] study Fair Disaster Containment, a graph cut problem involving fairness. Their problem is not directly a fair clustering problem since they only require one part of their partition (the saved part) to be fair. Ziko, Yuan, Granger, and Ayed [38] give a heuristic approach for fair clustering in general that however does not allow for theoretical guarantees on the quality of the solution. 2 Contribution We now outline our findings on Fair Correlation Clustering. We start by giving several structural results that underpin our further investigations. Afterwards, we present our algorithms and hardness results for certain graph classes and color ratios. We further show that the hardness of fair clustering does not stem from the requirement of the clusters Casel, Friedrich, Schirneck & Wietheger 5 Figure 1 Example forest where a cluster of size 4 and two clusters of size 2 incur the same cost. With one cluster of size 4 (left), the inter-cluster cost is 0 and the intra-cluster cost is 4. With two clusters of size 2 (right), both the inter-cluster and intra-cluster cost are 2. exactly reproducing the color distribution of the whole graph. This section is concluded by a discussion of possible directions for further research. 2.1 Structural Insights We outline here the structural insights that form the foundation of all our results. We first give a close connection between the cost of a clustering, the number of edges "cut" by a clustering, and the total number of edges in the graph. We refer to this number of "cut" edges as the inter-cluster cost as opposed to the number of non-edges inside clusters, which we call the intra-cluster cost. Formally, the intra- and inter-cluster cost are the first and second summand of the Correlation Clustering cost in Equation (1), respectively. The following lemma shows that minimizing the inter-cluster cost suffices to minimize the total cost if all clusters are of the same size. This significantly simplifies the algorithm development for Correlation Clustering. (cid:73) Lemma 3. Let P be a partition of the vertices of an m-edge graph G. Let χ denote the inter-cluster cost incurred by P on G. If all sets in the partition are of size d, then cost(P) = (d−1) 2 n − m + 2χ. In particular, if G is a tree, cost(P) = (d−3) 2 n + 2χ + 1. The condition that all clusters need to be of the same size seems rather restrictive at first. However, we prove in the following that in bipartite graphs and, in particular, in forests and trees there is always a minimum-cost fair clustering such that indeed all clusters are equally large. This property stems from how the fairness constraint acts on the distribution of colors and is therefore specific to Fair Correlation Clustering. It allows us to fully utilize Lemma 3 both for building reductions in NP-hardness proofs as well as for algorithmic approaches as we can restrict our attention to partitions with equal cluster sizes. Consider two colors of ratio 1 : 2, then any fair cluster must contain at least 1 vertex of the first color and 2 vertices of the second color to fulfil the fairness requirement. We show that a minimum-cost clustering of a forest, due to the small number of edges, consists entirely of such minimal clusters. Every clustering with larger clusters incurs a higher cost. (cid:73) Lemma 4. Let F be a forest with k (cid:62) 2 colors in a ratio of c1 : c2 : . . . : ck with ci ∈ N>0 for all i ∈ [k], gcd(c1, c2, . . . , ck) = 1, and Pk i=1 ci (cid:62) 3. Then, all clusters of every minimum-cost fair clustering are of size d = Pk i=1 ci. Lemma 4 does not extend to two colors in a ratio of 1 : 1 as illustrated in Figure 1. In fact, this color distribution is the only case for forests where a partition with larger clusters can have the same (but no smaller) cost. We prove a slightly weaker statement than Lemma 4, namely, that there is always a minimum-cost fair clustering whose cluster sizes are given by the color ratio. We find that this property, in turn, holds not only for forests but for every bipartite graph. Note that in general bipartite graphs there are more color ratios than only 1 : 1 that allow for these ambiguities. 6 Fair Correlation Clustering Table 1 Running times of our algorithms for Fair Correlation Clustering on forests depending on the color ratio. Value p is any rational such that n/p − 1 is integral; c1, c2, . . . , ck are coprime positive integers, possibly depending on n. Functions f and g are given in Theorems 23 and 27. Color Ratio 1 : 1 1 : 2 Running Time O(n) O(n6) 1 : (n/p − 1) O(cid:0)nf (p)(cid:1) c1 : c2 : . . . : ck O(cid:0)ng(c1,...,ck)(cid:1) (cid:73) Lemma 5. Let G = (A ∪ B, E) be a bipartite graph with k (cid:62) 2 colors in a ratio of c1 : c2 : . . . : ck with ci ∈ N>0 for all i ∈ [k] and gcd(c1, c2, . . . , ck) = 1. Then, there is a minimum-cost fair clustering such that all its clusters are of size d = Pk i=1 ci. Further, each minimum-cost fair clustering with larger clusters can be transformed into a minimum-cost fair clustering such that all clusters contain no more than d vertices in linear time. In summary, the results above show that the ratio of the color classes is the key parameter determining the cluster size. If the input is a bipartite graph whose vertices are colored with k colors in a ratio of c1 : c2 : * * * : ck, our results imply that without loosing optimality, solutions can be restricted to contain only clusters of size d = Pk i=1 ci, each with exactly ci vertices of color i. Starting from these observations, we show in this work that the color ratio is also the key parameter determining the complexity of Fair Correlation Clustering. On the one hand, the simple structure of optimal solutions restricts the search space and enables polynomial-time algorithms, at least for some instances. On the other hand, these insights allow us to show hardness already for very restricted input classes. The technical part of most of the proofs consists of exploiting the connection between the clustering cost, total number of edges, and the number of edges cut by a clustering. 2.2 Tractable Instances We start by discussing the algorithmic results. The simplest case is that of two colors, each one occurring equally often. We prove that for bipartite graphs with a color ratio 1 : 1 Fair Correlation Clustering is equivalent to the maximum bipartite matching problem, namely, between the vertices of different color. Via the standard reduction to computing maximum flows, this allows us to benefit from the recent breakthrough by Chen, Kyng, Liu, Peng, Probst Gutenberg, and Sachdeva [18]. It gives an algorithm running in time m1+o(1). The remaining results focus on forests as the input, see Table 1. It should not come as a surprise that our main algorithmic paradigm is dynamic programming. A textbook version finds a maximum matching in linear time in a forests, solving the 1 : 1 case. For general color ratios, we devise much more intricate dynamic programs. We use the color ratio 1 : 2 as an introductory example. The algorithm has two phases. In the first, we compute a list of candidate splittings that partition the forest into connected parts containing at most 1 blue and 2 red vertices each. In the second phase, we assemble the parts of each of the splittings to fair clusters and return the cheapest resulting clustering. The difficulty lies in the two phases not being independent from each other. It is not enough to minimize the "cut" edges in the two phases separately. We prove that the costs incurred by the merging additionally depends on the number of of parts of a certain type generated in the splittings. Tracking this along with the number of cuts results in a O(n6)-time algorithm. Note that we did not optimize the running time as long as it is polynomial. Casel, Friedrich, Schirneck & Wietheger 7 Table 2 Complexity of Fair Correlation Clustering on trees and general graphs depending on the diameter. The value c is a positive integer, possibly depending on n. Diameter Color Ratio Trees General Graphs 2, 3 (cid:62) 4 any 1 : c O(n) NP-hard NP-hard NP-hard We generalize this to k colors in a ratio c1 : c2 : * * * : ck.3 We now have to consider all possible colorings of a partition of the vertices such that in each part the i-th color occurs at most ci times. While assembling the parts, we have to take care that the merged colorings remain compatible. The resulting running time is O(ng(c1,...,ck)) for some (explicit) polynomial g. Recall that, by Lemma 4, the minimum cluster size is d = Pk i=1 ci. If this is a constant, then the dynamic program runs in polynomial time. If, however, the number of colors k or some color's proportion grows with n, it becomes intractable. Equivalently, the running time gets worse if there are very large but sublinearly many clusters. To mitigate this effect, we give a complementary algorithm at least for forests with two colors. Namely, consider the color ratio 1 : n p − 1. Then, an optimal solution has p clusters each of size d = n/p. The key observation is that the forest contains p vertices of the color with fewer occurrences, say, blue, and any fair clustering isolates the blue vertices. This can be done by cutting at most p − 1 edges and results in a collection of (sub-)trees where each one has at most one blue vertex. To obtain the clustering, we split the trees with red excess vertices and distribute those among the remaining parts. We track the costs of all the O(npoly(p)) many cut-sets and rearrangements to compute the one of minimum cost. In total, the algorithm runs in time O(nf (p)) for some polynomial in p. In summary, we find that if the number of clusters p is constant, then the running time is polynomial. Considering in particular an integral color ratio 1 : c,4, we find tractability for forests if c = O(1) or c = Ω(n). We will show next that Fair Correlation Clustering with this kind of a color ratio is NP-hard already on trees, hence the hardness must emerge somewhere for intermediate c. 2.3 A Dichotomy for Bounded Diameter Table 2 shows the complexity of Fair Correlation Clustering on graphs with bounded diameter. We obtain a dichotomy for trees with two colors with ratio 1 : c. If the diameter is at most 3, an optimal clustering is computable in O(n) time, but for diameter at least 4, the problem becomes NP-hard. In fact, the linear-time algorithm extends to trees with an arbitrary number of colors in any ratio. The main result in that direction is the hardness of Fair Correlation Clustering already on trees with diameter at least 4 and two colors of ratio 1 : c. This is proven by a reduction from the strongly NP-hard 3-Partition problem. There, we are given positive integers a1, . . . , a' where ' is a multiple of 3 and there exists some B with P' i=1 ai = B * ' 3 . The task is to partition the numbers ai into triples such that each one of those sums to B. The problem remains NP-hard if all the ai are strictly between B/4 and B/2, ensuring that, if some subset of the numbers sums to B, it contains exactly three elements. 3 The ci are coprime, but they are not necessarily constants with respect to n. 4 In a color ratio 1 : c, c is not necessarily a constant, but ratios like 2 : 5 are not covered. 8 Fair Correlation Clustering Figure 2 The tree with diameter 4 in the reduction from 3-Partition to Fair Correlation Clustering. We model this problem as an instance of Fair Correlation Clustering as illustrated in Figure 2. We build ' stars, where the i-th one consists of ai red vertices, and a single star of '/3 blue vertices. The centers of the blue star and all the red stars are connected. The color ratio in the resulting instance is 1 : B. Lemma 4 then implies that there is a minimum-costs clustering with '/3 clusters, each with a single blue vertex and B red ones. We then apply Lemma 3 to show that this cost is below a certain threshold if and only if each cluster consist of exactly three red stars (and an arbitrary blue vertex), solving 3-Partition. 2.4 Maximum Degree The reduction above results in a tree with a low diameter but arbitrarily high maximum degree. We have to adapt our reductions to show hardness also for bounded degrees. The results are summarized in Table 3. If the Fair Correlation Clustering instance is not required to be connected, we can represent 3-Partition with a forest of trees with maximum degree 2, that is, a forest of paths. The input numbers are modeled by paths with ai vertices. The forest also contains '/3 isolated blue vertices, which again implies that an optimal fair clustering must have '/3 clusters each with B red vertices. By defining a sufficiently small cost threshold, we ensure that the fair clustering has cost below it if and only if none of the path-edges are "cut" by the clustering, corresponding to a partition of the ai. There is nothing special about paths, we can arbitrarily restrict the shape of the trees, as long it is always possible to form such a tree with a given number of vertices. However, the argument crucially relies on the absence of edges between the ai-paths/trees and does not transfer to connected graphs. This is due to the close relation between inter-cluster costs and the total number of edges stated in Lemma 3. The complexity of Fair Correlation Clustering on a single path with a color ratio 1 : c therefore remains open. Notwithstanding, we show hardness for trees in two closely related settings: keeping the color ratio at 1 : c but raising the maximum degree to 5, or having a single path but a total of n/2 colors and each color shared by exactly 2 vertices. For the case of maximum degree 5 and two colors with ratio 1 : c, we can again build on the 3-Partition machinery. The construction is inspired by how Feldmann and Foschini [27] used the problem to show hardness of computing so-called k-balanced partitions. We adapt it to our setting in which the vertices are colored and the clusters need to be fair. For the single path with n/2 colors, we reduce from (the 1-regular 2-colored variant of) the Paint Shop Problem for Words [24]. There, a word is given in which every symbol ...l3......a1...a2...al Casel, Friedrich, Schirneck & Wietheger 9 Table 3 Hardness of Fair Correlation Clustering on trees and forests depending on the maximum degree. The value c is a positive integer, possibly depending on n. The complexity for paths (trees with maximum degree 2) with color ratio 1 : c is open. Max. Degree Color Ratio Trees Forests 2 (cid:62) 2 (cid:62) 5 1 : c n/2 colors, 2 vertices each NP-hard NP-hard NP-hard 1 : c NP-hard NP-hard appears exactly twice. The task is to assign the values 0 and 1 to the letters of the word5 such that that, for each symbol, exactly one of the two occurrences receives a 1, but the number of blocks of consecutive 0s and 1s over the whole word is minimized. In the translation to Fair Correlation Clustering, we represent the word as a path and the symbols as colors. To remain fair, there must be two clusters containing exactly one vertex of each color, translating back to a 0/1-assignment to the word. 2.5 Relaxed Fairness One could think that the hardness of Fair Correlation Clustering already for classes of trees and forests has its origin in the strict fairness condition. After all, the color ratio in each cluster must precisely mirror that of the whole graph. This impression is deceptive. Instead, we lift most of our hardness results to Relaxed Fair Correlation Clustering considering the relaxed fairness of Bera et al. [11]. Recall Definition 2. It prescribes two rationals pi and qi for each color i and allows, the proportion of i-colored elements in any cluster to be in the interval [pi, qi], instead of being precisely ci/d, where d = Pk j=1 cj. The main conceptual idea is to show that, in some settings but not all, the minimum- cost solution under a relaxed fairness constraint is in fact exactly fair. This holds for the settings described above where we reduce from 3-Partition. In particular, Relaxed Fair Correlation Clustering with a color ratio of 1 : c is NP-hard on trees with diameter 4 and forests of paths, respectively. Furthermore, the transferal of hardness is immediate for the case of a single path with n/2 colors and exactly 2 vertices of each color. Any relaxation of fairness still requires one vertex of each color in every cluster, maintaining the equivalence to the Paint Shop Problem for Words. In contrast, algorithmic results are more difficult to extend if there are relaxedly fair solutions that have lower cost than any exactly fair one. We then no longer know the cardinality of the clusters in an optimal solution. As a proof of concept, we show that a slight adaption of our dynamic program for two colors in a ratio of 1 : 1 still works for what we call α-relaxed fairness.6 There, the lower fairness ratio is pi = α * ci d and the upper one is qi = 1 d for some parameter α ∈ (0, 1). We give an upper bound on the necessary cluster size depending on α, which is enough to find a good splitting of the forest. Naturally, the running time now also depends on α, but is of the form O(nh(1/α)) for some polynomial h. In particular, we get an polynomial-time algorithm for constant α. The proof of correctness α * ci 5 The original formulation [24] assigns colors, aligning better with the paint shop analogy. We change the exposition here in order to avoid confusion with the colors in the fairness sense. 6 This should not be confused with the notion of α-fairness in resource allocation [30, 31]. 10 Fair Correlation Clustering consists of an exhaustive case distinction already for the simple case of 1 : 1. We are confident that this can be extended to more general color ratios, but did not attempt it in this work. 2.6 Summary and Outlook We show that Fair Correlation Clustering on trees, and thereby forests, is NP-hard. It remains so on trees of constant degree or diameter, and–for certain color distributions–it is also NP-hard on paths. On the other hand, we give a polynomial-time algorithm if the minimum size d of a fair cluster is constant. We also provide an efficient algorithm for the color ratio 1 : c if the total number of clusters is constant, corresponding to c ∈ Θ(n). For our main algorithms and hardness results, we prove that they still hold when the fairness constraint is relaxed, so the hardness is not due to the strict fairness definition. Ultimately, we hope that the insights gained from these proofs as well as our proposed algorithms prove helpful to the future development of algorithms to solve Fair Correlation Clustering on more general graphs. In particular, fairness with color ratio 1 : c with c being very large seems to be an interesting and potentially tractable type of distribution for future study. As first steps to generalize our results, we give a polynomial-time approximation scheme (PTAS) for Fair Correlation Clustering on forests. Another avenue for future research could be that Lemma 5, bounding the cluster size of optimal solutions, extends also to bipartite graphs. This may prove helpful in developing exact algorithms for bipartite graphs with other color ratios than 1 : 1. Parameterized algorithms are yet another approach to solving more general instances. When looking at the decision version of Fair Correlation Clustering, our results can be cast as an XP-algorithm when the problem is parameterized by the cluster size d, for it can be solved in time O(ng(d)) for some function g. Similarly, we get an XP-algorithm for the number of clusters as parameter. We wonder whether Fair Correlation Clustering can be placed in the class FPT of fixed-parameter tractable problems for any interesting structural parameters. This would require a running time of, e.g., g(d) * poly(n). There are FPT-algorithms for Cluster Editing parameterized by the cost of the solution [15]. Possibly, future research might provide similar results for the fair variant as well. A natural extension of our dynamic programming approach could potentially lead to an algorithm parameterizing by the treewidth of the input graph. Such a solution would be surprising, however, since to the best of our knowledge even for normal, unfair Correlation Clustering7 and for the related Max Dense Graph Partition [22] no treewidth approaches are known. Finally, it is interesting how Fair Correlation Clustering behaves on paths. While we obtain NP-hardness for a particular color distribution from the Paint Shop Problem For Words, the question of whether Fair Correlation Clustering on paths with for example two colors in a ratio of 1 : c is efficiently solvable or not is left open. However, we believe that this question is rather answered by the study of the related (discrete) Necklace Splitting problem, see the work of Alon and West [6]. There, the desired cardinality of every color class is explicitly given, and it is non-constructively shown that there always exists a split of the necklace with the number of cuts meeting the obvious lower bound. A constructive splitting procedure may yield some insights for Fair Correlation Clustering on paths. 7 In more detail, no algorithm for complete Correlation Clustering has been proposed. Xin [36] gives a treewidth algorithm for incomplete Correlation Clustering for the treewidth of the graph of all positively and negatively labeled edges. Casel, Friedrich, Schirneck & Wietheger 11 3 Preliminaries We fix here the notation we are using for the technical part and give the formal definition of Fair Correlation Clustering. 3.1 Notation We refer to the set of natural numbers {0, 1, 2, . . .} by N. For k ∈ N, let [k] = {1, 2, . . . , k} and N>k = N \ ({0} ∪ [k]). We write 2[k] for the power set of [k]. By gcd(a1, a2, . . . , ak) we denote the greatest common divisor of a1, a2 . . . , ak ∈ N. 2 An undirected graph G = (V, E) is defined by a set of vertices V and a set of edges (cid:1) = {{u, v} | u, v ∈ V, u 6= v}. If not stated otherwise, by the size of G we refer to . We call a (cid:1) = ∅. denote the subgraph induced by S. The degree of E ⊆ (cid:0)V n + m, where n = |V | and m = |E|. A graph is called complete if m = n(n−1) graph G = (A ∪ B, E) bipartite if there are no edges in A nor B, i.e., E ∩ (cid:0)A S, E ∩ (cid:0)S For every S ⊆ V , we let G[S] = (cid:1) = E ∩ (cid:0)B (cid:1)(cid:17) (cid:16) 2 2 2 2 a vertex v ∈ V is the number of edges incident to that vertex, δ(v) = |{u | {u, v} ∈ E}|. The degree of a graph G = (V, E) is the maximum degree of any of its vertices δ(G) = maxv∈V δ(v). A path of length k in G is a tuple of vertices (v1, v2, . . . , vk−1) such that for each 1 (cid:54) i < k − 1 we have {vi, vi+1} ∈ E. We only consider simple paths, i.e., we have vi 6= vj for all i 6= j. A graph is called connected if for every pair of vertices u, v there is a path connecting u and v. The distance between two vertices is the length of the shortest path connecting these vertices and the diameter of a graph is the maximum distance between a pair of vertices. A circle is a path (v1, v2, . . . , vk) such that v1 = vk and vi 6= vj only for all other pairs of i 6= j. A forest is a graph without circles. A connected forest is called a tree. There is exactly one path connecting every pair of vertices in a tree. A tree is rooted by choosing any vertex r ∈ V as the root. Then, every vertex v, except for the root, has a parent, which is the next vertex on the path from v to r. All vertices that have v as a parent are referred to as the children of v. A vertex without children is called a leaf. Given a rooted tree T , by Tv we denote the subtree induced by v and its descendants, i.e., the set of vertices such that there is a path starting in v and ending in that vertex without using the edge to v's parent. Observe that each forest is a bipartite graph, for example by placing all vertices with even distance to the root of their respective tree on one side and the other vertices on the other side. A finite set U can be colored by a function c : U → [k], for some k ∈ N>0. If there are only two colors, i.e., k = 2, for convenience we call them red and blue, instead by numbers. For a partition P = {S1, S2, . . . , Sk} with Si ∩ Sj = ∅ for i 6= j of some set U = S1 ∪ S2 ∪ . . . ∪ Sk and some u ∈ U we use P[u] to refer to the set Si for which u ∈ Si. Further, we define the term coloring on sets and partitions. The coloring of a set counts the number of occurrences of each color in the set. (cid:73) Definition 6 (Coloring of Sets). Let S be a set colored by a function c : S → [k]. Then, the coloring of S is an array CS such that CS[i] = |{s ∈ S | c(s) = i}| for all i ∈ [k]. The coloring of a partition counts the number of occurrences of set colorings in the partition. (cid:73) Definition 7 (Coloring of Partitions). Let U be a colored set and let P be a partition of U . Let C = {CS | S ⊆ U } denote the set of set colorings for which there is a subset of U with that coloring. By an arbitrarily fixed order, let C1, C2, . . . , C' denote the elements of C. Then, the coloring of P is an array CP such that CP [i] = |{S ∈ P | CS = Ci}| for all i ∈ [']. 12 Fair Correlation Clustering 3.2 Problem Definitions In order to define Fair Correlation Clustering, we first give a formal definition of the unfair clustering objective. Correlation Clustering receives a pairwise similarity measure for a set of objects and aims at minimizing the number of similar objects placed in separate clusters and the number of dissimilar objects placed in the same cluster. For the sake of consistency, we reformulate the definition of Bonchi et al. [13] such that the pairwise similarity between objects is given by a graph rather than an explicit binary similarity function. Given a graph G = (V, E) and a partition P of V , the Correlation Clustering cost is cost(G, P) = |{{u, v} ∈ (cid:0)V 2 (cid:1) \ E | P[u] = P[v]}| + |{{u, v} ∈ E | P[u] 6= P[v]}|. We refer to the first summand as the intra-cluster cost ψ and the second summand as the inter-cluster cost χ. Where G is clear from context, we abbreviate to cost(P). Sometimes, we consider the cost of P on an induced subgraph. To this end, we allow the same cost definition as above also if P partitions some set V 0 ⊇ V . We define (unfair) Correlation Clustering as follows. Correlation Clustering Input: Task: Graph G = (V, E). Find a partition P of V that minimizes cost(P). We emphasize that this is the complete, unweighted, min-disagree form of Correlation Clustering. It is complete as every pair of objects is either similar or dissimilar but none is indifferent regarding the clustering. It is unweighted as the (dis)similarity between two vertices is binary. A pair of similar objects that are placed in separate clusters as well as a pair of dissimilar objects in the same cluster is called a disagreement, hence the naming of the min-disagree form. An alternative formulation would be the max-agree form with the objective to maximize the number of pairs that do not form a disagreement. Note that both formulations induce the same ordering of clusterings though approximation factors may differ because of the different formulations of the cost function. Our definition of the Fair Correlation Clustering problem loosely follows [2]. The fairness aspect limits the solution space to fair partitions. A partition is fair if each of its sets has the same color distribution as the universe that is partitioned. (cid:73) Definition 8 (Fair Subset). Let U be a finite set of elements colored by a function c : U → [k] for some k ∈ N>0. Let Ui = {u ∈ U | c(u) = i} be the set of elements of color i for all i ∈ [k]. Then, some S ⊆ U is fair if and only if for all colors i ∈ [k] we have |S∩Ui| |S| = |Ui| |U | . (cid:73) Definition 9 (Fair Partition). Let U be a finite set of elements colored by a function c : U → [k] for some k ∈ N>0. Then, a partition S1 ∪ S2 ∪ . . . ∪ S' = U is fair if and only if all sets S1, S2, . . . , S' are fair. We now define complete, unweighted, min-disagree variant of the Fair Correlation Clustering problem. When speaking of (Fair) Correlation Clustering, we refer to this variant, unless explicitly stated otherwise. Casel, Friedrich, Schirneck & Wietheger 13 Fair Correlation Clustering Input: Task: Graph G = (V, E), coloring c : V → [k]. Find a fair partition P of V that minimizes cost(P). 4 Structural Insights We prove here the structural results outlined in Subsection 2.1. The most important insight is that in bipartite graphs, and in forests in particular, there is always a minimum-cost fair clustering such that all clusters are of some fixed size. This property is very useful, as it helps for building reductions in hardness proofs as well as algorithmic approaches that enumerate possible clusterings. Further, by the following lemma, this also implies that minimizing the inter-cluster cost suffices to minimize the Correlation Clustering cost, which simplifies the development of algorithms solving Fair Correlation Clustering on such instances. (cid:73) Lemma 3. Let P be a partition of the vertices of an m-edge graph G. Let χ denote the inter-cluster cost incurred by P on G. If all sets in the partition are of size d, then cost(P) = (d−1) 2 n − m + 2χ. In particular, if G is a tree, cost(P) = (d−3) 2 n + 2χ + 1. d clusters there are d(d−1) Proof. Note that in each of the n pairs of vertices, each incurring an intra-cost of 1 if not connected by an edge. Let the total intra-cost be ψ. As there is a total of m edges, we have 2 cost(P) = χ + ψ = χ + n d * d(d − 1) 2 − (m − χ) = (d − 1)n 2 − m + 2χ. (cid:74) In particular, if G is a tree, this yields cost(P) = (d−3)n 2 + 2χ + 1 as there m = n − 1. 4.1 Forests We find that in forests in every minimum-cost partition all sets in the partition are of the minimum size required to fulfill the fairness requirement. (cid:73) Lemma 4. Let F be a forest with k (cid:62) 2 colors in a ratio of c1 : c2 : . . . : ck with ci ∈ N>0 for all i ∈ [k], gcd(c1, c2, . . . , ck) = 1, and Pk i=1 ci (cid:62) 3. Then, all clusters of every minimum-cost fair clustering are of size d = Pk i=1 ci. Proof. Let d = Pk i=1 ci. For any clustering P of V to be fair, all clusters must be at least of size d. We show that if there is a cluster S in the clustering with |S| > d, then we decrease the cost by splitting S. First note that in order to fulfill the fairness constraint, we have |S| = ad for some a ∈ N(cid:62)2. Consider a new clustering P 0 obtained by splitting S into S1, S2, where S1 ⊂ S is an arbitrary fair subset of S of size d and S2 = S \ S1. Note that the cost incurred by every edge and non-edge with at most one endpoint in S is the same in both clusterings. Let ψ be the intra-cluster cost of P on F [S]. Regarding the cost incurred by the edges and non-edges with both endpoints in S, we know that cost(F [S], P) (cid:62) ψ (cid:62) ad(ad − 1) 2 − (ad − 1) = a2d2 − 3ad + 2 2 since the cluster is of size ad and as it is part of a forest it contains at most ad − 1 edges. In the worst case, the P 0 cuts all the ad − 1 edges. However, we profit from the smaller cluster 14 Fair Correlation Clustering sizes. We have cost(F [S], P 0) = χ + ψ (cid:54) ad − 1 + d(d − 1) 2 2d2 + a2d2 − 2ad2 + ad − 2 2 + . (a − 1)d * ((a − 1)d − 1) 2 = Hence, P 0 is cheaper by cost(F [S], P) − cost(F [S], P 0) (cid:62) 2ad2 − 2d2 − 4ad + 4 2 = ad(d − 2) − d2 + 2. This term is increasing in a. As a (cid:62) 2, by plugging in a = 2, we hence obtain a lower bound of cost(F [S], P) − cost(F [S], P 0) (cid:62) d2 − 4d + 2. For d (cid:62) 2, the bound is increasing in d and it is positive for d > 3. This means, if d > 3 no clustering with a cluster of size more than d has minimal cost implying that all optimum clusterings only consist of clusters of size d. Last, we have to argue the case d = 3, i.e., we have a color ratio of 1 : 2 or 1 : 1 : 1. In this case d2 − 4d + 2 evaluates to −1. However, we obtain a positive change if we do not split arbitrarily but keep at least one edge uncut. Note that this means that one edge less is cut and one more edge is present, which means that our upper bound on cost(T [S], P 0) decreases by 2, so P is now cheaper. Hence, assume there is an edge {u, v} such that c(u) 6= c(v). Then by splitting S into {u, v, w} and S \ {u, v, w} for some vertex w ∈ S \ {u, v} that makes the component {u, v, w} fair, we obtain a cheaper clustering. If there is no such edge {u, v}, then T [S] is not connected. This implies there are at most 3a − 3 edges if the color ratio is 1 : 1 : 1 since no edge connects vertices of different colors and there are a vertices of each color, each being connected by at most a − 1 edges due to the forest structure. By a similar argument, there are at most 3a − 2 edges if the color ratio is 1 : 2. Hence, the lower bound on cost(T [S], P) increases by 1. At the same time, even if P 0 cuts all edges it cuts at most 3a − 2 times, so it is at least 1 cheaper than anticipated. Hence, in this case (cid:74) cost(T [S], P 0) < cost(T [S], P) no matter how we cut. Note that Lemma 4 makes no statement about the case of two colors in a ratio of 1 : 1. 4.2 Bipartite Graphs We are able to partially generalize our findings for trees to bipartite graphs. We show that there is still always a minimum-cost fair clustering with cluster sizes fixed by the color ratio. However, in bipartite graphs there may also be minimum-cost clusterings with larger clusters. We start with the case of two colors in a ratio of 1 : 1 and then generalize to other ratios. (cid:73) Lemma 10. Let G = (A ∪ B, E) be a bipartite graph with two colors in a ratio of 1 : 1. Then, there is a minimum-cost fair clustering of G that has no clusters with more than 2 vertices. Further, each minimum-cost fair clustering can be transformed into a minimum-cost fair clustering such that all clusters contain no more than 2 vertices in linear time. If G is a forest, then no cluster in a minimum-cost fair clustering is of size more than 4. Proof. Note that, due to the fairness constraint, each fair clustering consists only of evenly sized clusters. We prove both statements by showing that in each cluster of at least 4 vertices there are always two vertices such that by splitting them from the rest of the cluster the cost does not increase and fairness remains. Let P be a clustering and S ∈ P be a cluster with |S| (cid:62) 4. Let SA = S ∩ A and SB = S ∩ B. Assume there is a ∈ Sa and b ∈ Sb such that a and b have not the same color. Casel, Friedrich, Schirneck & Wietheger 15 Then, the clustering P 0 obtained by splitting S into {a, b} and S \ {a, b} is fair. We now analyze for each pair of vertices u, v, u 6= v how the incurred Correlation Clustering cost changes. The cost does not change for every pair of vertices of which at most one vertex of u and v is in S. Further, it does not change if either {u, v} = {a, b} or {u, v} ⊆ S \ {a, b}. There are at most |SA| − 1 + |SB| − 1 = |S| − 2 edges with one endpoint in {a, b} and the other in S \ {a, b}. Each of them is cut in P 0 but not in P, so they incur an extra cost of at most |S| − 2. However, due to the bipartite structure, there are |SA| − 1 vertices in S \ {a, b} that have no edge to a and |SB| − 1 vertices in S \ {a, b} that have no edge to b. These |S| − 2 vertices incur a total cost of |S| − 2 in P but no cost in P 0. This makes up for any cut edge in P, so splitting the clustering never increases the cost. If there is no a ∈ Sa and b ∈ Sb such that a and b have not the same color, then either SA = ∅ or SB = ∅. In both cases, there are no edges inside S, so splitting the clustering in an arbitrary fair way never increases the cost. By iteratively splitting large clusters in any fair clustering, we hence eventually obtain a minimum-cost fair clustering such that all clusters consist of exactly two vertices. Now, assume G is a forest and there would be a minimum-cost clustering P with some cluster S ∈ P such that |S| > 2a for some a ∈ N>2. Consider a new clustering P 0 obtained by splitting S into {u, v} and S \ {u, v}, where u and v are two arbitrary vertices of different color that have at most 1 edge towards another vertex in S. There are always two such vertices due to the forest structure and because there are S 2 vertices of each color. Then, P 0 is still a fair clustering. Note that the cost incurred by each edge and non-edge with at most one endpoint in S is the same in both clusterings. Let ψ denote the intra-cluster cost of P in G[S]. Regarding the edges and non-edges with both endpoints in S, we know that cost(G[S], P) (cid:62) ψ (cid:62) 2a(2a − 1) 2 − (2a − 1) = 2a2 − 3a + 1 as the cluster consists of 2a vertices and has at most 2a − 1 edges due to the forest structure. In the worst case, P 0 cuts 2 edges. However, we profit from the smaller cluster sizes. We have cost(G[S], P 0) (cid:54) 2 + ψ (cid:54) 2 + 1 + 2(a − 1)(2(a − 1) − 1) 2 − (2a − 1 − 2) = 2a2 − 5a + 6. Hence, P costs at least 2a − 5 more than P 0, which is positive as a > 2. Thus, in every (cid:74) minimum-cost fair clustering all clusters are of size 4 or 2. We employ an analogous strategy if there is a different color ratio than 1 : 1 in the graph. However, then we have to split more than 2 vertices from a cluster. To ensure that the clustering cost does not increase, we have to argue that we can take these vertices in some balanced way from both sides of the bipartite graph. (cid:73) Lemma 5. Let G = (A ∪ B, E) be a bipartite graph with k (cid:62) 2 colors in a ratio of c1 : c2 : . . . : ck with ci ∈ N>0 for all i ∈ [k] and gcd(c1, c2, . . . , ck) = 1. Then, there is a minimum-cost fair clustering such that all its clusters are of size d = Pk i=1 ci. Further, each minimum-cost fair clustering with larger clusters can be transformed into a minimum-cost fair clustering such that all clusters contain no more than d vertices in linear time. Proof. Due to the fairness constraint, each fair clustering consists only of clusters that are of size ad, where a ∈ N>0. We prove the statements by showing that a cluster of size at least 2d can be split such that the cost does not increase and fairness remains. Let P be a clustering and S ∈ P be a cluster with |S| = ad for some a (cid:62) 2. Let SA = S ∩ A as well as SB = S ∩ B and w.l.o.g. |SA| (cid:62) |SB|. Our proof has three steps. 16 Fair Correlation Clustering First, we show that there is a fair eS ⊆ S such that | eS| = d and | eS ∩ A| (cid:62) | eS ∩ B|. Then, we construct a fair set bS ⊆ S by replacing vertices in eS with vertices in SB \ eS such that still | bS| = d, | bSA| (cid:62) | bSB|, with bSA = bS ∩ A and bSB = bS ∩ B, and additionally | bSA| − | ˆSB| (cid:54) |SA| − |SB|. Last, we prove that splitting S into bS and S \ bS does not increase the clustering cost. We then observe that the resulting clustering is fair, so the lemma's statements hold because any fair clustering with a cluster of more than d vertices is transformed into a fair clustering with at most the same cost, and only clusters of size d by repeatedly splitting larger clusters. For the first step, assume there would be no such eS ⊆ S, i.e., that we only could take s < d 2 vertices from SA without taking more than ci vertices of each color i ∈ [k]. Let si be the number of vertices of color i among these s vertices for all i ∈ [k]. Then, if si = 0 there is no vertex of color i in SA as we could take the respective vertex into eS, otherwise. Analogously, if si < ci, then there are no more then si vertices of color i in SA. If we take si = ci vertices, then up to all of the aci = asi vertices of that color are possibly in SA. Hence, |SA| (cid:54) Pk 2 . This contradicts SA (cid:62) SB because |A| + |B| = ad. Thus, there is a fair set eS of size d such that | eS ∩ SA| (cid:62) | eS ∩ SB|. i=1 asi = as < ad Now, for the second step, we transform eS into bS. Note that, if |SA \ eS| (cid:62) |SB \ eS| it suffices to set bS = eS. Otherwise, we replace some vertices from eS ∩ SA by vertices of the respective color from SB \ eS. We have to show that after this we still take at least as many vertices from SA as from SB and |SA| − | bSA| (cid:62) |SB| − | bSB|. Let δ = |SB \ eS| − |SA \ eS| > 0. Recall that |SA| (cid:62) |SB|, so δ (cid:54) | eS ∩ A| − | eS ∩ B|. Then, we build bS from eS by replacing (cid:54) d δ 2 vertices from eS ∩ SA with vertices of the respective color from SB \ eS. If there are 2 2 vertices, we have |SA \ bSA| = |SB \ bSB| and | bSA| (cid:62) | bSB|. Consequently, bS fulfills the such δ requirements. Assume there would be no such δ 2 vertices. Let si be the number of vertices of color i among these vertices for all i ∈ [k]. By a similar argumentation as above and because there are only (a − 1)ci vertices of each color i in S \ bS, we have 2 vertices but that we could only replace s < δ |SB \ bS| (cid:54) k X i=1 (a − 1)si = (a − 1)s < (a − 1)d 2 . This contradicts |SB \ eS| > |SA \ eS| as |(SA ∪ SB) \ eS| = (a − 1)d. Hence, there are always enough vertices to create bS. For the last step, we show that splitting S into bS and S \ bS does not increase the cost by analyzing the change for each pair of vertices {u, v} ∈ (cid:0)V (cid:1). If not u ∈ S and v ∈ S, the pair is not affected. Further, it does not change if either {u, v} ⊆ bS or {u, v} ⊆ (S \ bS). For the remaining pairs of vertices, there are at most 2 | bSA| * |SB \ bSB| + | bSB| * |SA \ bSA| = | bSA| * |SB| + | bSB| * |SA| − 2 (cid:16) (cid:17) | bSA| * | bSB| edges that are cut when splitting S into bS and S \ bS. At the same time, there are | bSA| * |SA \ bSA| + | bSB| * |SB \ bSB| = | bSA| * |SA| + | bSB| * |SB| − | bSA|2 − | bSB|2 Casel, Friedrich, Schirneck & Wietheger 17 pairs of vertices that are not connected and placed in separate clusters in P 0 but not in P. Hence, we have P is more expansive than P 0 by at least cost(P) − cost(P 0) (cid:62) | bSA| * |SA| + | bSB| * |SB| − | bSA| * |SB| − | bSB| * |SA| (cid:16) (cid:17) (cid:16) − (cid:16) (cid:62) | bSA|2 − 2 (cid:17) | bSA| * | bSB| + | bSB|2(cid:17) (cid:16) | bSA| − | bSB| * (|SA| − |SB|) − | bSA| − | bSB| (cid:17)2 . This is non-negative as | bSA| (cid:62) | bSB| and | bSA| − | bSB| (cid:54) |SA| − |SB|. Hence, splitting a cluster (cid:74) like this never increases the cost. Unlike in forests, however, the color ratio yields no bound on the maximum cluster size in minimum-cost fair clusterings on bipartite graphs but just states there is a minimum-cost fair clustering with bounded cluster size. Let G = (R ∪ B, {{r, b} | r ∈ R ∧ b ∈ B}) be a complete bipartite graph with |R| = |B| such that all vertices in R are red and all vertices in B are blue. Then, all fair clusterings in G have the same cost, including the one with a single cluster S = R ∪ B. This holds because of a similar argument as employed in the last part of Lemma 10 since every edge that is cut by a clustering is compensated for with exactly one pair of non-adjacent vertices that is then no longer in the same cluster. 5 Hardness Results This section provides NP-hardness proofs for Fair Correlation Clustering under various restrictions. 5.1 Forests and Trees With the knowledge of the fixed sizes of clusters in a minimum-cost clustering, we are able to show that the problem is surprisingly hard, even when limited to certain instances of forests and trees. To prove the hardness of Fair Correlation Clustering under various assumptions, we reduce from the strongly NP-complete 3-Partition problem [29]. 3-Partition Input: Task: n = 3p with p ∈ N, positive integers a1, a2, . . . , an, and B ∈ N such that 4 < ai < B B Decide if there is a partition of the numbers ai into triples such that the sum of each triple is B. 2 as well as Pn i=1 ai = pB. Our first reduction yields hardness for many forms of forests. (cid:73) Theorem 11. Fair Correlation Clustering on forests with two colors in a ratio of 1 : c is NP-hard. It remains NP-hard when arbitrarily restricting the shape of the trees in the forest as long as for every a ∈ N it is possible to form a tree with a vertices. Proof. We reduce from 3-Partition. For every ai, we construct an arbitrarily shaped tree of ai red vertices. Further, we let there be p isolated blue vertices. Note that the ratio 18 Fair Correlation Clustering Figure 3 The tree with diameter 4 in the reduction from 3-Partition to Fair Correlation Clustering. The notation follows that of Theorem 12. between blue and red vertices is 1 : B. We now show that there is a fair clustering P such that cost(P) = p * B(B + 1) 2 − p(B − 3) if and only if the given instance is a yes-instance for 3-Partition. If we have a yes-instance of 3-Partition, then there is a partition of the set of trees into p clusters of size B. By assigning the blue vertices arbitrarily to one unique cluster each, we hence obtain a fair partition. As there are no edges between the clusters and each cluster consists of B + 1 vertices and B − 3 edges, this partition has a cost of p * B(B+1) − p(B − 3). 2 For the other direction, assume there is a fair clustering of cost B(B+1) − p(B − 3). By Lemma 4, each of the clusters consists of exactly one blue and B red vertices. Each cluster requires B(B+1) edges, but the graph has only p(B − 3) edges. The intra-cluster cost alone 2 is hence at least p * B(B+1) − p(B − 3p). This means that the inter-cluster cost is 0, i.e., the partition does not cut any edges inside the trees. Since all trees are of size greater than B 4 and less than B 2 , this implies that each cluster consists of exactly one blue vertex and exactly three uncut trees with a total of B vertices. This way, such a clustering gives a solution to 3-Partition, so our instance is a yes-instance. 2 2 As the construction of the graph only takes polynomial time in the instance size, this (cid:74) implies our hardness result. Note that the hardness holds in particular for forests of paths, i.e., for forests with maximum degree 2. With the next theorem, we adjust the proof of Theorem 11 to show that the hardness remains if the graph is connected. (cid:73) Theorem 12. Fair Correlation Clustering on trees with diameter 4 and two colors in a ratio of 1 : c is NP-hard. Proof. We reduce from 3-Partition. For every ai, we construct a star of ai red vertices. Further, we let there be a star of p blue vertices. We obtain a tree of diameter 4 by connecting the center v of the blue star to all the centers of the red stars. The construction is depicted in Figure 3. Note that the ratio between blue and red vertices is 1 : B. We now show that there is a fair clustering P such that cost(P) (cid:54) pB2 − pB 2 + 7p − 7 ...l3......a1...a2...al Casel, Friedrich, Schirneck & Wietheger 19 if and only if the given instance is a yes-instance for 3-Partition. If we have a yes-instance of 3-Partition, then there is a partition of the set of stars into p clusters of size B, each consisting of three stars. By assigning the blue vertices arbitrarily to one unique cluster each, we hence obtain a fair partition. We first compute the inter-cluster cost χ. We call an edge blue or red if it connects two blue or red vertices, respectively. We call an edge blue-red if it connects a blue and a red vertex. All p − 1 blue edges are cut. Further, all edges between v (the center of the blue star) and red vertices are cut except for the three stars to which v is assigned. This causes 3p − 3 more cuts, so the inter-cluster cost is χ = 4p − 4. Each cluster consists of B + 1 vertices and B − 3 edges, except for the one containing v which has B edges. The intra-cluster cost is hence ψ = p (cid:18) B(B + 1) 2 (cid:19) − B + 3 − 3 = pB2 − pB 2 + 3p − 3. Combining the intra- and inter-cluster costs yields the desired cost of cost(P) = χ + ψ = pB2 − pB 2 + 7p − 7. 2 For the other direction, assume there is a fair clustering of cost at most pB2−pB + 7p − 7. As there are p(B +1) vertices, Lemma 4 gives that there are exactly p clusters, each consisting of exactly one blue and B red vertices. Let a denote the number of red center vertices in the cluster of v. We show that a = 3. To this end, let χr denote the number of cut red edges. We additionally cut p − 1 blue and 3p − a blue-red edges. The inter-cluster cost of the clustering hence is χ = χr + 4p − a − 1. Regarding the intra-cluster cost, there are no missing blue edges and as v is the only blue vertex with blue-red edges, there are (p − 1)B + B − a = pB − a missing blue-red edges. Last, we require p * B(B−1) red edges, but the graph has only pB − 3p red edges and χr of them are cut. Hence, there are at least p * B(B−1) 2 − pB + 3p + χr missing red edges, resulting in a total intra-cluster cost of ψ (cid:62) p * B(B−1) + 3p + χr − a. This results in a total cost of 2 2 cost(P) = χ + ψ (cid:62) pB2 − pB 2 + 7p + 2χr − 2a − 1. 2 As we assumed cost(P) (cid:54) pB2−pB + 7p − 7, we have 2χr − 2a + 6 (cid:54) 0, which implies a (cid:62) 3 since χr (cid:62) 0. Additionally, χr (cid:62) aB 4 − (B − a), because there are at least B 4 red vertices connected to each of the a chosen red centers but only a total of B − a of them can be placed 2 + 6 (cid:54) 0, implying a < 4 in their center's cluster. Thus, we have aB and proving our claim of a = 3. Further, as a = 3, we obtain χr (cid:54) 0, meaning that no red edges are cut, so each red star is completely contained in a cluster. Given that every red star is of size at least B 2 , this means each cluster consists of exactly three complete red stars with a total number of B red vertices each and hence yields a solution to the 3-Partition instance. 2 − 2B + 6 = (a−4)B 4 and at most B As the construction of the graph only takes polynomial time in the instance size and the (cid:74) constructed tree is of diameter 4, this implies our hardness result. The proofs of Theorems 11 and 12 follow the same idea as the hardness proof of [27, Theorem 2], which also reduces from 3-Partition to prove a hardness result on the k- Balanced Partitioning problem. There, the task is to partition the vertices of an uncolored graph into k clusters of equal size [27]. 20 Fair Correlation Clustering Figure 4 Tree with maximum degree 5 in the reduction from 3-Partition to Fair Correlation Clustering (Theorem 13). k-Balanced Partitioning Input: Task: Graph G = (V, E), k ∈ [n]. Find a partition P of V that minimizes |{{u, v} ∈ E | P[u] 6= P[v]}| under the constraint that |P| = k and |S| (cid:54) d n k e for all S ∈ P . k-Balanced Partitioning is related to Fair Correlation Clustering on forests in the sense that the clustering has to partition the forest into clusters of equal sizes by Lemmas 4 and 10. Hence, on forests we can regard Fair Correlation Clustering as the fair variant of k-Balanced Partitioning. By [27, Theorem 8], k-Balanced Partitioning is NP-hard on trees of degree 5. In their proof, Feldmann and Foschini [27] reduce from 3-Partition. We slightly adapt their construction to transfer the result to Fair Correlation Clustering. (cid:73) Theorem 13. Fair Correlation Clustering on trees of degree at most 5 with two colors in a ratio of 1 : c is NP-hard. Proof. We reduce from 3-Partition, which remains strongly NP-hard when limited to instances where B is a multiple of 4 since for every instance we can create an equivalent instance by multiplying all integers by 4. Hence, assume a 3-Partition instance such that B is a multiple of 4. We construct a graph for Fair Correlation Clustering by representing each ai for i ∈ [n] by a gadget Ti. Each gadget has a center vertex that is connected to the end of five paths: one path of length ai, three paths of length B 4 , and one path of length B 4 − 1. Then, for i ∈ [n − 1], we connect the dangling ends of the paths of length B 4 − 1 in the gadgets Ti and Ti+1 by an edge. So far, the construction is similar to the one by Feldmann and Foschini [27]. We color all vertices added so far in red. Then, we add a path of 4n 3 blue vertices and connect it by an edge to an arbitrary vertex of degree 1. The resulting graph is depicted in Figure 4. Note that the construction takes polynomial time and we obtain a graph of degree 5. We now prove that it has a fair clustering P such that cost(P) (cid:54) (B − 2)n 2 + 20n 3 − 3 if and only if the given instance is a yes-instance for 3-Partition. B4−1a1B4B4B4B4−1a2B4B4B4B4−1anB4B4B4T1T2Tn...4n3 Casel, Friedrich, Schirneck & Wietheger 21 Assume we have a yes-instance for 3-Partition. We cut the edges connecting the different gadgets as well as the edges connecting the ai-paths to the center of the stars. Then, we have n components of size B and 1 component of size ai for each i ∈ [n]. The latter ones can be merged into p = n 3 clusters of size B without further cuts. Next, we cut all edges between the blue vertices and assign one blue vertex to each cluster. Thereby, note that the blue vertex that is already connected to a red cluster should be assigned to this cluster. This way, we obtain a fair clustering with inter-cluster cost χ = n − 1 + n + 4n 3 − 2, which, by Lemma 3, gives cost(P) = (B−2)n 3 − 1 = 10n 2 + 20n 3 − 3. (B−2)n 3 * B red and 4n For the other direction, let there be a minimum-cost fair clustering P of cost at most 3 − 3. As Pn 3 , the graph consists of 4n 2 + 20n i=1 ai = nB 3 blue vertices. By Lemma 4, P hence consists of 4n 3 clusters, each consisting of one blue vertex and B red vertices. Thus, P has to cut the 4n 3 − 1 edges on the blue path. Also, P has to partition the red vertices into sets of size B. By [27, Lemma 9] this requires at least 2n − 1 cuts. This 3 − 2, leading to a Correlation bounds the inter-cluster cost by χ (cid:62) 2n − 1 + 4n Clustering cost of (B−2)n 3 − 3 as seen above, so we know that no more edges are cut. Further, the unique minimum-sized set of edges that upon removal leaves no red components of size larger than B is the set of the n − 1 edges connecting the gadgets and the n edges connecting the ai paths to the center vertices [27, Lemma 9]. Hence, P has to cut exactly these edges. As no other edges are cut, the ai paths can be combined to clusters of size B (cid:74) without further cuts, so the given instance has to be a yes-instance for 3-Partition. 3 − 1 = 10n 2 + 20n 5.2 Paths Theorem 11 yields that Fair Correlation Clustering is NP-hard even in a forest of paths. The problem when limited to instances of a single connected path is closely related to the Necklace Splitting problem [5, 6]. Discrete Necklace Splitting Input: Task: Opened necklace N , represented by a path of n * k beads, each in one of t colors such that for each color i there are ai * k beads of that color for some ai ∈ N. Cut the necklace such that the resulting intervals can be partitioned into k collections, each containing the same number of beads of each color. The only difference to Fair Correlation Clustering on paths, other than the naming, is that the number of clusters k is explicitly given. From Lemmas 4 and 10 we are implicitly given this value also for Fair Correlation Clustering, though. However, Alon and West [6] do not constructively minimize the number of cuts required for a fair partition but non-constructively prove that there is always a partition of at most (k − 1) * t cuts, if there are t colors and the partition is required to consist of exactly k sets with the same amount of vertices of each color. Thus, it does not directly help us when solving the optimization problem. Moreover, Fair Correlation Clustering on paths is related to the 1-regular 2-colored variant of the Paint Shop Problem for Words (PPW). For PPW, a word is given as well as a set of colors, and for each symbol and color a requirement of how many such symbols should be colored accordingly. The task is to find a coloring that fulfills all requirements and minimizes the number of color changes between adjacent letters [24]. 22 Fair Correlation Clustering Paint Shop Problem for Words (PPW) Input: Task: Word w = w1, w2, . . . , wn ∈ Σ∗, number of colors k ∈ N>0, and require- ment function r : Σ × [k] → N such that for each symbol s used in w with w[s] occurrences we have Pk i=1 r(s, i) = w[s]. Find an assignment function f : [n] → [k] of colors to the letters in w such that for each symbol s ∈ Σ and color i ∈ [k] the coloring fulfills the requirement function, i.e., |{j ∈ [n] | wj = s ∧ f (j) = i}| = r(s, i). The assignment f should minimze the number of color changes |{j ∈ [n − 1] | f (j) 6= f (j + 1)}|. Let for example w = aabab and r(a, 1) = 2, r(a, 2) = r(b, 1) = r(b, 2) = 1. Then, the assignment f with f (1) = f (2) = f (3) = 1 and f (4) = f (5) = 2 fulfills the requirement and has 1 color change. PPW instances with a word containing every symbol exactly twice and two PPW-colors, each requiring one of each symbol, are called 1-regular 2-colored and are shown to be NP- hard and even APX-hard [14]. With this, we prove NP-hardness of Fair Correlation Clustering even on paths. (cid:73) Theorem 14. Fair Correlation Clustering on paths is NP-hard, even when limited to instances with exactly 2 vertices of each color. Proof. We reduce from 1-regular 2-colored PPW. Let w = s1s2, . . . , s'. We represent the ' 2 different symbols by ' 2 colors and construct a path of length ', where each type of symbol is represented by a unique color. By Lemma 4, any optimum Fair Correlation Clustering solution partitions the paths into two clusters, each containing every color exactly once, while minimizing the number of cuts (the inter-cluster cost) by Lemma 3. As this is exactly equivalent to assigning the letters in the word to one of two colors and minimizing the number (cid:74) of color changes, we obtain our hardness result. APX-hardness however is not transferred since though there is a relationship between the number of cuts (the inter-cluster cost) and the Correlation Clustering cost, the two measures are not identical. In fact, as Fair Correlation Clustering has a PTAS on forests by Theorem 42, APX-hardness on paths would imply P = NP. On a side note, observe that for every Fair Correlation Clustering instance on paths we can construct an equivalent PPW instance (though not all of them are 1-regular 2-colored) by representing symbols by colors and PPW-colors by clusters. We note that it may be possible to efficiently solve Fair Correlation Clustering on paths if there are e.g. only two colors. There is an NP-hardness result on PPW with just two letters in [24], but a reduction from these instances is not as easy as above since its requirements imply an unfair clustering. 5.3 Beyond Trees By Theorem 12, Fair Correlation Clustering is NP-hard even on trees with diameter 4. Here, we show that if we allow the graph to contain circles, the problem is already NP-hard for diameter 2. Also, this nicely contrasts that Fair Correlation Clustering is solved on trees of diameter 2 in linear time, as we will see in Subsection 6.1. (cid:73) Theorem 15. Fair Correlation Clustering on graphs of diameter 2 with two colors in a ratio of 1 : 1 is NP-hard. Casel, Friedrich, Schirneck & Wietheger 23 Figure 5 Graph as constructed by Ahmadi et al. [1] for the reduction from Correlation Clustering to Fair Correlation Clustering. The blue vertices and edges correspond to the original graph G = (V, E), red vertices and edges to its mirror, i.e., V 0 and E0, and black edges to eE. Proof. Cluster Editing, which is an alternative formulation of Correlation Clustering, is NP-hard on graphs of diameter 2 [9]. Further, Ahmadi et al. [1] give a reduction from Correlation Clustering to Fair Correlation Clustering with a color ratio of 1 : 1. They show that one can solve Correlation Clustering on a graph G = (V, E) by solving Fair Correlation Clustering on the graph G0 = (V ∪ V 0, E ∪ E0 ∪ eE) that mirrors G. The vertices in V are colored blue and the vertices in V 0 are colored red. Formally, V 0 = {u0 | u ∈ V } and E0 = {{u0, v0} | {u, v} ∈ E}. Further, eE connects every vertex with its mirrored vertex as well as the mirrors of adjacent vertices, i.e., eE = {{u, u0} | u ∈ V } ∪ {{u, v0} | u ∈ V ∧ v0 ∈ V 0 ∧ {u, v} ∈ E}, see Figure 5. 2 Observe that if G has diameter 2 then G0 also has diameter 2 as follows. As every pair of vertices {u, v} ∈ (cid:0)V (cid:1) is of maximum distance 2 and the vertices as well as the edges of G (cid:1) is of maximum distance 2. Further, every are mirrored, every pair of vertices {u0, v0} ∈ (cid:0)V 0 vertex and its mirrored vertex have a distance of 1. For every pair of vertices u ∈ V, v0 ∈ V 0 we distinguish two cases. If {u, v} ∈ E, then {u, v0} ∈ eE, so the distance is 1. Otherwise, as the distance between u and v is at most 2 in G, there is w ∈ V such that {u, w} ∈ E and {v, w} ∈ E. Thus, {u, w0} ∈ eE and {w0, v0} ∈ E0, so the distance of u and v0 is at most 2. As Correlation Clustering on graphs with diameter 2 is NP-hard and the reduction by Ahmadi et al. [1] constructs a graph of diameter 2 if the input graph is of diameter 2, we (cid:74) have proven the statement. 2 Further, we show that on general graphs Fair Correlation Clustering is NP-hard, even if the colors of the vertices allow for no more than 2 clusters in any fair clustering. This contrasts our algorithm in Subsection 6.4 solving Fair Correlation Clustering on forests in polynomial time if the maximum number of clusters is constant. To this end, we reduce from the NP-hard Bisection problem [29], which is the k = 2 case of k-Balanced Partitioning. Bisection Input: Task: Graph G = (V, E). Find a partition P = {A, B} of V that minimizes |{{u, v} ∈ E | u ∈ A ∧ v ∈ B}| under the constraint that |A| = |B|. (cid:73) Theorem 16. Fair Correlation Clustering on graphs with two colors in a ratio of 1 : c is NP-hard, even if c = n 2 − 1 and the graph is connected. 24 Fair Correlation Clustering Figure 6 Graph constructed for the reduction from Bisection to a Fair Correlation Clus- tering instance with just 2 large clusters. The middle part corresponds to the input graph G and is colored red. Clique1 and Clique2 are both cliques of |V | red vertices and one blue vertex each. Proof. We reduce from Bisection. Let G = (V, E) be a Bisection instance and assume it has an even number of vertices (otherwise it is a trivial no-instance). The idea is to color all of the vertices in V red and add two cliques, each consisting of one blue and |V | red vertices to enforce that a minimum-cost Fair Correlation Clustering consists of exactly two clusters and thereby partitions the vertices of the original graph in a minimum-cost bisection. The color ratio is 2 : 3|V | which equals 1 : |V 0| 2 − 1 with V 0 being the set of the newly constructed graph. We have to rule out the possibility that a minimum-cost Fair Correlation Clustering is just one cluster containing the whole graph. We do this by connecting the new blue vertices v1, v2 to only one arbitrary red vertex v ∈ V . We illustrate the scheme in Figure 6. We first argue that every clustering with two clusters is cheaper than placing all vertices in the same cluster. Let n = |V | as well as m = |E|. Let P be a clustering that places all vertices in a single cluster. Then, cost(P) = (3n + 2)(3n + 1) 2 (cid:18) − m + 2 + 2 * n(n + 1) 2 (cid:19) = 7n2 2 + 7n 2 − m − 1, as the cluster is of size 3n + 2, there is a total of m + 2 plus the edges of the cliques, and no edge is cut. Now assume we have a clustering P 0 with an inter-cluster cost of χ0 that puts each clique in a different cluster. Then, cost(P 0) = χ0 + 2 * (cid:18) − ( 3n 2 + 1)( 3n 2 ) 2 + n − m + 2χ0 (cid:54) 9n2 4 = 7n2 4 m − χ0 + (cid:19) n(n + 1) 2 + n − m + 2, since there are at most n edge from v to either v1 or v2, so χ (cid:54) n2 more expensive by 2 * n 2 inter-cluster edges between vertices of V and one inter-cluster 4 + 1. Placing all vertices in the same cluster is hence cost(P) − cost(P 0) (cid:62) 7n2 2 + 7n 2 − m − 1 − (cid:18) 9n2 4 (cid:19) + n − m + 2 = 5n2 4 + 5n 2 − 3 than any clustering with two clusters. This is positive for n (cid:62) 2. Thus, Fair Correlation Clustering will always return at least two clusters. Also, due to the fairness constraint and there being only two blue vertices, it creates exactly two clusters. Further, it does not cut vertices from one of the two cliques for the following reason. As the clusters are of fixed size, by Lemma 3 we can focus on the inter-cluster cost to argue that a minimum-cost Fair Correlation Clustering only cuts edges in E. First, note Gvv2Clique1v1Clique2 Casel, Friedrich, Schirneck & Wietheger 25 that it is never optimal to cut vertices from both cliques as just cutting the difference from one clique cuts fewer edges. This also implies that at most n 2 red vertices are cut from the clique as otherwise, the other cluster would have more than the required 3n 2 red vertices. So, assume 0 < a (cid:54) n 2 red vertices are cut from one clique. Any such solution has an inter-cluster cost of a * (n + 1 − a) + χE, where χE is the number of edges in E that are cut to split V into two clusters of size n 2 − a as required to make a fair partition. We note that by not cutting the cliques and instead cutting off a vertices from the cluster of size n 2 + a, we obtain at most a * n 2 < n + 1 − a, this implies that no optimal solution cuts the cliques. Hence, each optimal solution partitions the V in a minimum-cost bisection. Thus, by solving Fair Correlation Clustering on the constructed graph we can solve Bisection in G. As further, the constructed graph is of polynomial size in |V |, we (cid:74) obtain our hardness result. 2 + χE cuts. As n 2 + a and n 6 Algorithms The results from Section 5 make it unlikely that there is a general polynomial time algorithm solving Fair Correlation Clustering on trees and forests. However, we are able to give efficient algorithms for certain classes of instances. 6.1 Simple Cases First, we observe that Fair Correlation Clustering on bipartite graphs is equivalent to the problem of computing a maximum bipartite matching if there are just two colors that occur equally often. This is due to there being a minimum-cost fair clustering such that each cluster is of size 2. (cid:73) Theorem 17. Computing a minimum-cost fair clustering with two colors in a ratio of 1 : 1 is equivalent to the maximum bipartite matching problem under linear-time reductions, provided that the input graph has a minimum-cost fair clustering in which each cluster has cardinality at most 2. Proof. Let the colors be red and blue. By assumption, there is an optimum clustering for which all clusters are of size at most 2. Due to the fairness constraint, each such cluster consists of exactly 1 red and 1 blue vertex. By Lemma 3, the lowest cost is achieved by the lowest inter-cluster cost, i.e., when the number of clusters where there is an edge between the two vertices is maximized. This is exactly the matching problem on the bipartite graph G0 = (R ∪ B, E0), with R and B being the red and blue vertices, respectively, and E0 = {{u, v} ∈ E | u ∈ R ∧ v ∈ B}. After computing an optimum matching, each edge of the matching defines a cluster and unmatched vertices are packed into fair clusters arbitrarily. For the other direction, if we are given an instance G0 = (R∪B, E0) for bipartite matching, we color all the vertices in R red and the vertices in B blue. Then, a minimum-cost fair clustering is a partition that maximizes the number of edges in each cluster as argued above. As each vertex is part of exactly one cluster and all clusters consist of one vertex in R and (cid:74) one vertex in B, this corresponds to a maximum bipartite matching in G0. By Lemma 10, the condition of Theorem 17 is met by all bipartite graphs. The re- cent maxflow breakthrough [18] also gives an m1+o(1)-time algorithm to compute bipartite matchings, this then transfers also to Fair Correlation Clustering with color ratio 1 : 1. For Fair Correlation Clustering on forests, we can do better as the reduction in Theorem 17 again results in a forest, for which bipartite matching can be solved in linear time by standard techniques. We present the algorithm here for completeness. 26 Fair Correlation Clustering Figure 7 Shape of every tree with diameter 3. (cid:73) Theorem 18. Fair Correlation Clustering on forests with a color ratio 1 : 1 can be solved in time O(n). Proof. We apply Theorem 17 to receive a sub-forest of the input for which we have to compute a maximum matching. We do so independently for each of the trees by running the following dynamic program. We visit all vertices, but each one only after we have already visited all its children (for example by employing topological sorting). For each vertex v, we compute the maximum matching Mv in the subtree rooted at v as well as the maximum matching M 0 v in the subtree rooted at v assuming v is not matched. We directly get that M 0 v is simply the union of the matchings Mu for each child u of v. Further, either Mv = M 0 v or in Mv there is an edge between v and some child u. In the latter case, Mv is the union of {u, v}, M 0 u, and the union of all Mw for all children w 6= u. Trying out all possible choices of u and comparing them among another and to M 0 v yields Mv. In the end, the maximum matching in the tree with root r is Mr. Each vertex is visited once. If the matchings are not naively merged during the process but only their respective sizes are tracked and the maximum matching is retrieved after the dynamic program by using a back-tracking approach, the time complexity per vertex is linear (cid:74) in the number of its children. Thus, the dynamic program runs in time in O(n). Next, recall that Theorem 12 states that Fair Correlation Clustering on trees with a diameter of at least 4 is NP-hard. With the next theorem, we show that we can efficiently solve Fair Correlation Clustering on trees with a diameter of at most 3, so our threshold of 4 is tight unless P = NP. (cid:73) Theorem 19. Fair Correlation Clustering on trees with a diameter of at most 3 can be solved in time O(n). Proof. Diameters of 0 or 1 are trivial and the case of two colors in a ratio of 1 : 1 is handled by Theorem 17. So, assume d > 2 to be the minimum size of a fair cluster. A diameter of two implies that the tree is a star. In a star, the inter-cluster cost equals the number of vertices that are not placed in the same cluster as the center vertex. By Lemma 4, every clustering of minimum cost has minimum-sized clusters. As in a star, all these clusterings incur the same inter-cluster cost of n − d + 1 they all have the same Correlation Clustering cost by Lemma 3. Hence, outputting any fair clustering with minimum-sized clusters solves the problem. Such a clustering can be computed in time in O(n). If we have a tree of diameter 3, it consists of two adjacent vertices u, v such that every vertex w ∈ V \ {u, v} is connected to either u or v and no other vertex, see Figure 7. This is due to every graph of diameter 3 having a path of four vertices. Let the two in the middle be u and v. The path has to be an induced path or the graph would not be a tree. We can attach other vertices to u and v without changing the diameter but as soon as we attach ......uv Casel, Friedrich, Schirneck & Wietheger 27 a vertex elsewhere, the diameter increases. Further, there are no edges between vertices in V \ {u, v} as the graph would not be circle-free. For the clustering, there are now two possibilities, which we try out separately. Either u and v are placed in the same cluster or not. In both cases, Lemma 4 gives that all clusters are of minimal size d. If u and v are in the same cluster, all clusterings of fair minimum sized clusters incur an inter-cluster cost of n − d + 2 as all but d − 2 vertices have to be cut from u and v. In O(n), we greedily construct such a clustering P1. If we place u and v in separate clusters, the minimum inter-cluster is achieved by placing as many of their respective neighbors in their respective clusters as possible. After that, all remaining vertices are isolated and are used to make these two clusters fair and if required form more fair clusters. Such a clustering P2 is also computed in O(n). We then return the cheaper clustering. This is a fair clustering of minimum cost as either u and v are placed in the same cluster or not, (cid:74) and for both cases, P1 and P2 are of minimum cost, respectively. 6.2 Color Ratio 1 : 2 We now give algorithms for Fair Correlation Clustering on forests that do not require a certain diameter or degree. As a first step to solve these less restricted instances, we develop an algorithm to solve Fair Correlation Clustering on forests with a color ratio of 1 : 2. W.l.o.g., the vertices are colored blue and red with twice as many red vertices as blue ones. We call a connected component of size 1 a b-component or r-component, depending on whether the contained vertex is blue or red. Analogously, we apply the terms br-component, rr-component, and brr-component to components of size 2 and 3. 6.2.1 Linear Time Attempt Because of Lemma 4, we know that in every minimum-cost fair clustering each cluster contains exactly 1 blue and 2 red vertices. Our high-level idea is to employ two phases. In the first phase, we partition the vertices of the forest F in a way such that in every cluster there are at most 1 blue and 2 red vertices. We call such a partition a splitting of F . We like to employ a standard tree dynamic program that bottom-up collects vertices to be in the same connected component and cuts edges if otherwise there would be more than 1 blue or 2 red vertices in the component. We have to be smart about which edges to cut, but as only up to 3 vertices can be placed in the topmost component, we have only a limited number of possibilities we have to track to find the splitting that cuts the fewest edges. After having found that splitting, we employ a second phase, which finds the best way to assemble a fair clustering from the splitting by merging components and cutting as few additional edges as possible. As, by Lemma 3, a fair partition with the smallest inter-cluster cost has a minimum Correlation Clustering cost, this would find a minimum-cost fair clustering. Unfortunately, the approach does not work that easily. We find that the number of cuts incurred by the second phase also depends on the number of br- and r-components. (cid:73) Lemma 20. Let F = (V, E) be an n-vertex forest with colored vertices in blue and red in a ratio of 1 : 2. Suppose in each connected component (in the above sense) there is at most 1 blue vertex and at most 2 red vertices. Let #(br) and #(r) be the number of br- and r-components, respectively. Then, after cutting max(0, #(br)−#(r) ) edges, the remaining connected components can be merged such that all clusters consist of exactly 1 blue and 2 red vertices. Such a set of edges can be found in time in O(n). Further, when cutting less than max(0, #(br)−#(r) ) edges, such merging is not possible. 2 2 28 Fair Correlation Clustering Figure 8 A tree for which the splitting with the minimum number of cuts (right) has 3 more br-components and 1 less r-component than a splitting with one more edge cut (left). Proof. As long as possible, we arbitrarily merge b-components with rr-components as well as br-components with r-components. For this, no edges have to be cut. Then, we split the remaining rr-components and merge the resulting r-components with one br-component each. This way, we incur max(0, #(br)−#(r) ) more cuts and obtain a fair clustering as now each cluster contains two red and one blue vertex. This procedure is done in time in O(n). Further, there is no cheaper way. For each br-component to be merged without further cuts we require an r-component. There are #(r) r-components and each cut creates either at most two r-components or one r-component while removing a br-component. Hence, max(0, #(br)−#(r) (cid:74) ) cuts are required. 2 2 For our approach to work, the first phase has to simultaneously minimize the number of cuts as well as the difference between br- and r-components. This is, however, not easily possible. Consider the tree in Figure 8. There, with one additional cut edge we have three br-components less and one r-component more. Using a standard tree dynamic program, therefore, does not suffice as when encoun- tering the tree as a subtree of some larger forest or tree, we would have to decide between optimizing for the number of cut edges or the difference between br- and r-components. There is no trivial answer here as the choice depends on how many br- and r-components are obtained in the rest of the graph. For our approach to work, we hence have to track both possibilities until we have seen the complete graph, setting us back from achieving a linear running time. 6.2.2 The Join Subroutine In the first phase, we might encounter situations that require us to track multiple ways of splitting various subtrees. When we reach a parent vertex of the roots of these subtrees, we join these various ways of splitting. For this, we give a subroutine called Join. We first formalize the output by the following lemma, then give an intuition on the variables, and lastly prove the lemma by giving the algorithm. (cid:73) Lemma 21. Let R1, R2, . . . , R'1 for '1 ∈ N>1 with Ri ∈ (N ∪ {∞})'2 for '2 ∈ N, i ∈ ['1] and f be a computable function f : ['2] × ['2] → 2['2]. For x ∈ ['2], let Ax = {M ∈ (['2])'1 | x ∈ bf (M [1], M [2], . . . , M ['2])}, whereby for all x1, x2, . . . ∈ ['2] bf (x1, x2) = f (x1, x2) Casel, Friedrich, Schirneck & Wietheger 29 Figure 9 Exemplary graph for a Join subroutine. and for all 2 (cid:54) k (cid:54) '2 bf (x1, x2, . . . , xk) = [ f (x, xk). x∈bf (x1,x2,...,xk−1) Then, an array R ∈ (N ∪ {∞})'2 such that R[x] = minM ∈Ax can be computed in time in O('1 * '2 2 * Tf ), where Tf is the time required to compute f . P'1 i=1 Ri[M [i]] for all x ∈ ['2] As we later reuse the routine, it is formulated more generally than required for this section. Here, for the 1 : 2 case, assume we want to join the splittings of the children u1, u2, . . . , u'1 of some vertex v. For example, assume v has three children as depicted in Figure 9. Then, for each child ui, let there be an array Ri such that Ri[x] is the minimum number of cuts required to obtain a splitting of the subtree Tui that has exactly x more br-components than r-components. For our example, assume all edges between v and its children have to be cut. We see, that R1[−1] = 1 and R1[x] = ∞ for x 6= −1, as the only possible splitting for the subtree of u1 cuts only the edge to v and has one more r-component than br-components. Further, we have R2[1] = 1 (by only cutting {v, u2}), R2[−1] = 2 (by cutting both edges of u2), and R2[x] = ∞ for x /∈ {−1, 1}. Last, note that R3 = R2. The function f returns the set of indices that should be updated when merging two possibilities. When a splitting of one child's subtree has x1 more br-components and a splitting of another child's subtree has x2 more br-components, then the combination of these splittings has x1 + x2 more br-components than r-components. Hence, the only index to update is f (x1, x2) = {x1 + x2}. Later, we will require to update more than a single index, so f is defined to return a set instead of a single index. Note that by the definition of f and bf , each value placed in R[x] by the routine corresponds to choosing exactly one splitting from each array Ri such that the total difference between br-components and r-components sums up to exactly x. In our example, assume any splitting is chosen for each of the three subtrees. Let xi denote the difference of br- and r-components of the chosen splitting for the subtree rooted at ui for 1 (cid:54) i (cid:54) 3. Then, Join sets R[x] for x = x1 + x2 + x3. If there are multiple ways to achieve an index x, the one with the minimum number of cuts is stored in R[x]. In the example, we have 4 possibilities, as x1 = −1 and x2, x3 ∈ {−1, 1}. Note that x1 = −1, x2 = −1, x3 = 1 and x1 = −1, x2 = 1, x3 = −1 both evaluate to x = −1. Hence, only one of the two combinations is stored (the one with fewer cuts, here an arbitrary one as both variants imply 4 cuts). For the resulting array R, we have R[−3] = 5, R[−1] = 4, R[1] = 3, and R[x] = ∞ for x /∈ {−3, −1, 1}. Observe that the numbers of cuts in R correspond to the sums of the numbers of cuts in the subtrees for the respective choice of xi. vu1u2u3 30 Fair Correlation Clustering We now describe how the Join subroutine is computed. Proof of Lemma 21. The algorithm works in an iterative manner. Assume it has found the minimum value for all indices using the first i − 1 arrays and they are stored in Ri−1. It then joins the i-th array by trying every index x1 in Ri−1 with every index x2 in Ri. Each time, for all indices x ∈ f (x1, x2), it sets Ri[x] to Ri−1[x1] + Ri[x2] if it is smaller than the current element there. Thereby, it tries all possible ways of combining the interim solution with Ri and for each index tracks the minimum that can be achieved. Formally, we give the algorithm in Algorithm 1. Algorithm 1 The Join subroutine. Input: R1, R2, . . . , R'1 for '1 (cid:62) 2 with Ri ∈ (N ∪ {∞})'2 for 0 (cid:54) i < '1, and a computable function f : ['2] × ['2] → 2['2]. Output: R ∈ (N ∪ {∞})'2 such that, for all x ∈ ['2], R[x] = minM ∈Ax P'1 i=1 Ri[M [i]] with Ax = {M ∈ (['2])'1 | x ∈ bf (M [1], M [2], . . . , M ['2])}, bf (x1, x2, . . . , xk) = S f (x, xk), and bf (x1, x2) = f (x1, x2). x∈bf (x1,x2,...,xk−1) 1 R ← R1 2 for i ← 2 to '1 do R0 ← R foreach (x1, x2) ∈ (['2])2 do foreach x ∈ f (x1, x2) do 4 3 5 6 7 R0[x] ← min (R0[x], R[x1] + Ri[x2]) R ← R0 The algorithm terminates after O(k * '2 * Tf ) iterations due to the nested loops. We prove by induction that R is a solution of Join over the arrays R1, . . . , Ri after each iteration i. The first one simply tries all allowed combinations of the arrays R1, R2 and tracks the minimum value for each index, matching our definition of Join. Now assume the statement holds for some i. Observe that we only update a value R[x] if there is a respective M ∈ Ax, so none of the values is too small. To show that no value is too large, take any x ∈ ['2] and let a be the actual minimum value that can be obtained for R[x] in this iteration. Let j1, j2, . . . , ji+1 with x ∈ bf (j1, j2, . . . , ji+1) be the indices that obtain a. Then, there is y ∈ ['2] such that after joining the first i arrays the value at index y is a − Ri+1[ji+1] and y ∈ bf (j1, j2, . . . , ji). This implies R[y] (cid:54) a − Ri+1 by our induction hypothesis. Further, as both x ∈ bf (j1, j2, . . . , ji+1) and y ∈ bf (j1, j2, . . . , ji), we have x ∈ f (y, ji+1). Thus, in this iteration, R[x] is set to at (cid:74) most R[y] + Ri+1[ji+1] (cid:54) a. With this, all values are set correctly. Observe that in the case of f (x1, x2) = {x1 + x2}, which is relevant to this section, the loop in lines 4-6 computes the (min, +)-convolution of the arrays R and Ri. Simply trying all possible combinations as done in the algorithm has a quadratic running time. This cannot be improved without breaking the MinConv Conjecture, which states there is no algorithm computing the (min, +)-convolution of two arrays of length n in time in O(n2−ε) for any constant ε > 0 [21]. Casel, Friedrich, Schirneck & Wietheger 31 6.2.3 The Tracking Algorithm With the Join subroutine at hand, we are able to build a dynamic program solving Fair Correlation Clustering on forests with two colors in a ratio of 1 : 2. We first describe how to apply the algorithm to trees and then generalize it to work on forests. In the first phase, for each possible difference between the number of br-components and r-components, we compute the minimum number of cuts to obtain a splitting with that difference. In the second phase, we find the splitting for which the sum of edges cut in the first phase and the number of edges required to turn this splitting into a fair partition is minimal. This sum is the inter-cluster cost of that partition, so by Lemma 3 this finds a fair partition with the smallest Correlation Clustering cost. Splitting the tree. In the first phase, our aim is to compute an array D, such that, for all integers −n (cid:54) x (cid:54) n 3 , D[x] ⊆ E is a minimum-sized set of edges such that x = br(T − D[x]) − r(T − D[x]), where br(T −D[x]) and r(T −D[x]) are the number of br- and r-components in T −D[x], respectively. To mark the case if no such set exists, we expect D[x] = N to have an infinitely large entry. We fill the array in a dynamic programming way, by computing an array Dh v for each vertex v, and every possible head h ∈ {∅, r, b, rr, br}. Here, Dh v [x], is a minimum-sized set of edges such that in the subtree Tv rooted at v upon removal we have exactly x more br-components than r-components. The head h refers to the colors in the topmost component, which is of particular interest as it might later contain vertices from outside Tv as well. Head h = r refers to a component with a red vertex, h = br with a blue and a red vertex so on. This component is empty (h = ∅) if the edge above v is cut. The head is not counted as an br-component or r-component for the computation of x. Figure 10 gives examples of how a head is composed from the splittings of the children. In the following, we only show how to compute ∆h v [x]|, the size of the set of edges to obtain a respective splitting. The set Dh v [x] is, however, obtained by a simple backtracking v [x] = N, we have ∆h approach in the same asymptotic running time. If Dh v [x] = ∞. We initialize all values with ∆h v [x] = ∞, meaning we know of no set of edges which upon removal give that head and that difference between br- and r-components. Then, for every red leaf v we set ∆r v[0] = 1. This concludes the computations for the leaves, as the only possibilities are to cut the edge above the leaf or not. Now suppose we have finished the computation for all children u1, u2, . . . , uk of some vertex v. Observe that at most two children of v are placed in a head with v. For every head h ∈ {∅, r, b, rr, br} that is formable at vertex v, we try all possibilities to obtain that head. v[−1] = 1. For every blue leaf v we set ∆b v[0] = 0 and ∆∅ v[0] = 0 and ∆∅ v [x] = |Dh If h ∈ {r, b} and c(v) corresponds to h, this is done by choosing ∅ heads for all children. There is no unique splitting of the subtrees however, as for each subtree rooted at some child vertex ui there is a whole array D∅ of possible splittings with different numbers of ui br- and r-components. To find the best choices for all child vertices, we employ the Join subroutine that, when called with f (x1, x2) = {x1 + x2} and a list of arrays, returns an array R such that, for all indices x R[x] is the minimum value obtained by summing up exactly one value from each of the input arrays such that the indices of the chosen values sum up to ). Here and in the following, we only call the Join i. We hence set ∆h subroutine with at least two arrays. If we would only input a single array, we go on as if the Join subroutine returned that array. We note that here our indexing ranges from −n to 3 while the Join subroutine assumes positive indices. We hence implicitly assume that an n v = Join(∆∅ u1 , . . . , ∆∅ uk 32 Fair Correlation Clustering (a) (b) (c) (d) (e) Figure 10 Exemplary subtree with various possibilities to obtain a head. Figures 10a and 10b show splittings with an rr-head (dark green). The choice for the heads of the children (light green) is unambiguous as the only way to obtain an rr-head is to choose the r-head for the left child and an ∅-head for the right one. Both the left and the right variants have to be considered as they differ in the number of br-components minus the number of r-components. The splittings in Figures 10c–10e create an ∅-head, as they cut the edge above the root of the subtree, so no vertices of the subtree can be part of a component with vertices outside the subtree. Out of these 3 splittings, however, only Figures 10c and 10d will be further considered as Figure 10e obtains the same difference between br- and r-components as Figure 10c but cuts one more edge. We note that other splittings obtain an ∅-head as well that are not listed here. Casel, Friedrich, Schirneck & Wietheger 33 index of x here maps to an index x + n + 1 in the subroutine. If h = br or both h = rr and c(v) corresponds to r, then the heads for all children should be ∅ except for one child that we place in the same component as v. It then has a head h0 ∈ {r, b}, depending on h and c(v). We have h0 = r if h = rr and c(v) corresponds to R or h = rb and c(v) corresponds to b. Otherwise, h0 = b. For all i ∈ [k], we compute an array ∆0 ), referring to ui having the non-empty head. ui ui−1 Lastly, for all −n (cid:54) x (cid:54) n , . . . , ∆∅ uk v [x] = mini∈[k] ∆0 ui , ∆h0 ui+1 ui 3 , we set ∆h = Join(∆∅ u1 , . . . , ∆∅ , ∆∅ [x]. ui+1 ui+1 ui−1 ui−1 uj+1 uj−1 , ∆∅ , ∆∅ , ∆∅ , ∆h2 uj , ∆h1 ui , ∆h0 ui , . . . , ∆∅ , . . . , ∆∅ , . . . , ∆∅ uk , . . . , ∆∅ uk v . Note that here we have to shift all values in ∆r If h = ∅, then we have to try out all different possibilities for the component v is in and, in each case, cut the edge above v. First assume we want to place v in a brr-component. Then it has to be merged with to vertices, either by taking a head h0 ∈ {br, rr} at one child or by taking heads h1, h2 ∈ {r, b} at two children. The exact choices for h0, h1, h2 of course depend on c(v). We compute an array ∆h0 = Join(∆∅ , . . . , ∆∅ ) for u1 the first option. For the second option, we compute the arrays ∆i,j = Join(∆∅ ) for all pairs of chil- u1 dren ui, uj of v such that i < j and {v, ui, uj} is a brr-component. We now have stored the minimum number of cuts for all ways to form a brr-component with v and for all possibilities for x in the arrays ∆h0 and ∆i,j for all possibilities of i, j. However, v may also be in an r-, b-, rr-, or br-component. Hence, when computing ∆∅ v[x] we take the minimum value at position x not only among the arrays ∆h0 and ∆i,j but also of the arrays ∆r v , and ∆br v to the left by one since by isolating v we create another r-component. An entry we have written into ∆r v[x] hence should actually be placed in ∆r v to the right, since here we create a new br-component at the top of the subtree. Lastly, as long as v is not the root of T , we have to increase all values in ∆∅ v by one, reflecting the extra cut we have to make above v. After all computations are completed by the correctness of the Join subroutine and an inductive argument, ∆h v is correctly computed for all vertices v and heads h. Note that in the Join subroutine, as f (x1, x2) returns the correct index for merging two subtrees, bf (x1, x2, . . . , xk) gives the correct index of merging k subtrees. In particular, ∆∅ r is the array containing for each −n (cid:54) x (cid:54) n 3 the minimum number of edges to cut such that the there are exactly x more br-components than r-components, where r is the root of T . By adjusting the Join subroutine to track the exact combination that leads to the minimum value at each position, we also obtain an array D that contains not only the numbers of edges but the sets of edges one has to cut or is marked with N if no such set exists. v[x − 1]. Similarly, we have to shift ∆br v , ∆rr v, ∆br At each node, computing the arrays takes time O(n5), which is dominated by computing O(n2) arrays Du,w in time O(n3) each by Lemma 21 since '1, '2 ∈ O(n). This phase hence takes time in O(n6). Assembling a fair clustering. Let D be the set computed in the first phase. Note that each set of edges D[x] directly gives a splitting, namely the partition induced by the connected components in T − D[x]. By Lemma 20, the cheapest way to turn the splitting given by D[x] into a clustering more cuts. 2 2 ) is minimal. We return the of sets of 1 blue and 2 red vertices is found in linear time and incurs max(0,x) Hence, we find the −n (cid:54) x (cid:54) n corresponding clustering as it has the minimum inter-cluster cost. 3 for which |D[x]| + max(0, x This phase takes only constant time per splitting if we tracked the number of components of each type in the first phase and is therefore dominated by the first phase. 34 Fair Correlation Clustering Forests. Our algorithm is easily generalized to also solve Fair Correlation Clustering on unconnected forests with two colors in a ratio of 1 : 2 by slightly adapting the first phase. We run the dynamic program as described above for each individual tree. This still takes overall time in O(n6). For each tree Ti in the forest and every h ∈ {∅, r, b, rr, br}, let then ∆∅ Ti denote the array ∆∅ r with r being the root of tree Ti. To find a splitting of the whole forest and not just on the individual trees, we perform an additional run of the Join subroutine using these arrays ∆Ti and the function f (x1, x2) = {x1 + x2}. This gives us an array R such that R[x] is the minimum number of cuts required to obtain a splitting with exactly x more br-components than r-components for the whole tree rather than for the individual trees. Note that we choose the ∅-head at each tree as the trees are not connected to each other, so in order to find a splitting we do not yet have to consider how components of different trees are merged, this is done in the second phase. The first phase then outputs an array D that contains the set of edges corresponding to R, which is obtained by a backtracking approach. As the additional subroutine call takes time in O(n3), the asymptotic run time of the algorithm does not change. This gives the following result. (cid:73) Theorem 22. Fair Correlation Clustering on forests with two colors in a ratio of 1 : 2 can be solved in time in O(n6). 6.3 Small Clusters To obtain an algorithm that handles more colors and different color ratios, we generalize our approach for the 1 : 2 color ratio case from the previous section. We obtain the following. (cid:73) Theorem 23. Let F be a forest of n vertices, each colored in one of k (cid:62) 2 colors. Let the colors be distributed in a ratio of c1 : c2 : . . . : ck with ci ∈ N>0 for all i ∈ [k] and gcd(c1, c2, . . . , ck) = 1. Then Fair Correlation Clustering on F can be solved in time in O(n2 setvars+setmax+2 * setvarssetmax), where setvars = Qk i=1 ci. i=1(ci + 1) and setmax = Pk Once more, the algorithm runs in two phases. First, it creates a list of possible splittings, i.e., partitions in which, for every color, every component has at most as many vertices of that color as a minimum-sized fair component has. In the second phase, it checks for these splittings whether they can be merged into a fair clustering. Among these, it returns the one of minimum cost. We first give the algorithm solving the problem on trees and then generalize it to also capture forests. Splitting the forest. For the first phase in the 1:2 approach, we employed a dynamic program that kept track of the minimum number to obtain a splitting for each possible cost incurred by the reassembling in the second phase. Unfortunately, if we are given a graph with k (cid:62) 2 colors in a ratio of c1 : c2 : . . . : ck, then the number of cuts that are required in the second phase is not always as easily bounded by the difference of the number of two component types like r- and br-components in the 1 : 2 case. However, we find that it suffices to track the minimum number of cuts required to obtain any possible coloring of a splitting. We first bound the number of possible colorings of a splitting. As during the dynamic program we consider splittings of a subgraph of G most of the time, we also have to count all possible colorings of splittings of less than n vertices. Casel, Friedrich, Schirneck & Wietheger 35 (cid:73) Lemma 24. Let U be a set of n elements, colored in k ∈ N>1 colors, and let d1, d2, . . . , dk ∈ N. Let S be the set of all possible partitions of subsets of U such that for every color i there are at most di vertices of that color in each cluster. Let C be the set of all colorings of partitions in S. Then, |C| (cid:54) (n + 1)setvars−1, where setvars = Qk i=1(di + 1). Proof. The number of sets with different colorings is at most setvars as there are 0 to di many vertices of color i in each component. Thus, a coloring of a partition P using only these sets is characterized by an array of size setvars with values in [n] ∪ {0} as no component occurs more than n times. There are (n + 1)setvars ways to fill such an array. However, as the set colorings together have to form a partition, the last entry is determined by the first (cid:74) setvars − 1 entries, giving only (n + 1)setvars−1 possibilities. With this, we employ a dynamic program similar to the one presented in Subsection 6.2 but track the minimum cut cost for all colorings of splittings. It is given by the following lemma. (cid:73) Lemma 25. Let F = (V, E) be a forest with vertices in k colors. Further, let d1, d2, . . . , dk ∈ N and S be the set of all possible partitions of V such that there are at most di vertices of color i in each cluster for i ∈ [k]. Let C be the set of all colorings of partitions in S. Then, in time in O(n2 setvars+setmax+2 * setvarssetmax) with setvars = Qk i=1 di, for all C ∈ C, we find a minimum-sized set DC ⊆ E such that the connected components in F − DC form a partition of the vertices with coloring C or certify that there is no such set. i=1(di + 1) and setmax = Pk Proof. We first describe how to solve the problem on a tree T and then generalize the approach to forests. We call a partition of the vertices such that for every color i there are at most di vertices of that color in each cluster a splitting. We employ a dynamic program that computes the set DC for the colorings of all possible splittings and all subtrees rooted at each vertex in T . We do so iteratively, by starting to compute all possible splittings at the leaves and augmenting them towards the root. Thereby, the connected component that is connected to the parent of the current subtree's root is of particular importance as it is the only connected component that can be augmented by vertices outside the subtree. We call this component the head. Note that the head is empty if the edge between the root and its parent is cut. We do not count the head in the coloring of the splitting and only give it explicitly. Formally, for every v ∈ V , every possible coloring of a splitting C, and every possible coloring h of the head we compute Dh v [C] ⊆ E, the minimum-sized set of edges such that the connected components of Tv − Dh v [C] form a v [C] = N, an infinitely large set, if no such splitting with coloring C and head h. We set Dh set exists. Let all Dh v [C] be initialized with N. Then, for every leaf v with parent w, we set hc(v) [C∅] = ∅, where hc(v) is the coloring of the component {v} and C∅ the coloring of the D v partition over the empty set. Also, we set Dh∅ v [Cc(v)] = {{v, w}}, where the vertex v is not placed in the head as the edge to its parent is cut. As to cut or not to cut the edge above are the only options for leaves, this part of the array is now completed. Next, suppose we have finished the computation for all children of some vertex v. For every possible coloring h of the head that is formable at vertex v, we try all possibilities to obtain that coloring. To this end, first assume h to be non-empty. Therefore, v has to be placed in the head. Let h−c(v) denote the coloring obtained by decreasing h by one at color c(v). To obtain head h, we hence have to choose colorings of splittings of the subtrees rooted at the children u1, u2, . . . , u' of v such that their respective heads hu1 , hu2 , . . . , hu' combine to h−c(v). A 36 Fair Correlation Clustering combination of colorings C1, C2, . . . , C' refers to the coloring of the union of partitions M1, M2, . . . , M' that have the respective colorings and is defined as the element-wise sum over the arrays C1, C2, . . . , C'. Often, there are multiple ways to choose heads for the child vertices that fulfill this requirement. As every head is of size at most setmax, h−c(v) and contains v, it is composed of less than setmax non-empty heads. As there are at most setvars possible heads and we have to choose less than setmax children, there are at most (cid:1) * setvarssetmax−1 < nsetmax−1 * setvarssetmax−1 possible ways to form h−c(v) with (cid:0) n setmax−1 the children of v. Let each way be described by a function H assigning each child of v a certain, possibly empty, head. Then, even for a fixed H, there are multiple splittings possible. This stems from the fact that even if the head H(u) for a child u is fixed, there might be multiple splittings of the subtree of u with different colorings resulting in that head. For each possible H, we hence employ the Join subroutine with the arrays DH(u) for all children u using the cardinality of the sets as input for the subroutine. For the sake of readability, we index the arrays here by some vector C instead of a single numerical index as used in the algorithmic description of the Join subroutine. We implicitly assume that each possible coloring is represented by a positive integer. By letting these indices enumerate the vectors in a structured way, converting between the two formats only costs an additional time factor in O(n). u For f (x1, x2) we give the function returning a set containing only the index of the coloring obtained by combining the colorings indexed by x1 and x2, which is computable in time in O(n). Combining the colorings means for each set coloring summing the occurrences in both partition colorings. Thereby, bf (x1, x2, . . . , xk) as defined in the Join subroutine returns the index of the combination of the colorings indexed by x1, x2, . . . , xk. Note that there are at most n arrays and each is of length less than (n + 1)setvars−1 as there are so many different colorings by Lemma 24. After executing the Join subroutine, by Lemma 21, we obtain an array DH that contains the minimum cut cost required for all possible colorings that can be achieved by splitting according to H. By modifying the Join subroutine slightly to use a simple backtracking approach, we also obtain the set D ⊆ E that achieves this cut cost. We conclude our computation of Dh v by element-wisely taking the minimum-sized set over all computed arrays DH for the possible assignments H. If h is the empty head, i.e., the edge above v is cut, then v is placed in a component that is either of size setmax or has a coloring corresponding to some head h0. In the first case, we compute an array Dfull in the same manner as described above by trying all suitable assignments H and employing the Join subroutine. In the second case, we simply take the already filled array Dh0 v . Note that in both cases we have to increment all values in the array by one to reflect cutting the edge above v, except if v is the root vertex. Also, we have to move the values in the arrays around, in order to reflect that the component containing v is no longer a head but with the edge above v cut should also be counted in the coloring of the splitting. Hence, the entry Dfull[C] is actually stored at Dfull[C−full] with C−full being the coloring C minus the coloring of a minimum-sized fair cluster. If no such entry Dfull[C−full] exists, we assume it to be ∞. The same goes for accessing the arrays Dh0 v where we have to subtract the coloring h0 from the index. Taking the element-wise minimum-sized element over the such modified arrays Dfull and Dh0 v for all possibilities for h0 yields D∅ v. By the correctness of the Join subroutine and as we try out all possibilities to build the specified heads and colorings at every vertex, we thus know that after completing the computation at the root r of T , the array D∅ r contains for every possible coloring of a splitting of the tree the minimum cut cost to achieve that coloring. For each of the n vertices and the setvars possible heads, we call the Join subroutine Casel, Friedrich, Schirneck & Wietheger 37 at most nsetmax−1 * setvarssetmax−1 many times. Each time, we call it with at most n arrays and, as by Lemma 24 there are O(nsetmax) possible colorings, all these arrays have that many elements. Hence, each subroutine call takes time in O(n * (nsetvars)2) = O(n2 setvars+1), so the algorithm takes time in O(n2 setvars+setmax+2 * setvarssetmax), including an additional factor in O(n) to account for converting the indices for the Join subroutine. When the input graph is not a tree but a forest F , we apply the dynamic program on every tree in the forest. Then, we additionally run the Join subroutine with the arrays for the ∅-head at the roots of all trees in the forest. The resulting array contains all minimum-cost solutions from all possible combinations from colorings of splittings from the individual trees and is returned as output. The one additional subroutine does not change the asymptotic (cid:74) running time. Because of Lemmas 4 and 10 it suffices to consider partitions as possible solutions that have at most ci vertices of color i in each cluster, for all i ∈ [k]. We hence apply Lemma 25 on the forest F and set di = ci for all i ∈ [k]. This way, for every possible coloring of a splitting we find the minimum set of edges to obtain a splitting with that coloring. Assembling a fair clustering. Let D be the array produced in the first phase, i.e., for every coloring C of a splitting, D[C] is a minimum-sized set of edges such that the connected components in F − D[C] induce a partition with coloring C. In the second phase, we have to find the splitting that gives the minimum Correlation Clustering cost. We do so by deciding for each splitting whether it is assemblable, i.e., whether its clusters can be merged such that it becomes a fair solution with all clusters being no larger than setmax. Among these, we return the one with the minimum inter-cluster cost computed in the first phase. This suffices because of the following reasons. First, note that deciding assemblability only depends on the coloring of the splitting so it does not hurt that in the first phase we tracked only all possible colorings of splittings and not all possible splittings themselves. Second, we do not have to consider further edge cuts in this phase: Assume we have a splitting S with coloring CS and we would obtain a better cost by further cutting a edges in S, obtaining another splitting S0 of coloring CS0. However, as we filled the array D correctly, there is an entry D[CS0] and |D[CS0]| (cid:54) |D[CS]| + a. As we will consider this value in finding the minimum anyway, there is no need to think about cutting the splittings any further. Third, the minimum inter-cluster cost yields the minimum Correlation Clustering cost by Lemma 3. When merging clusters, the inter-cluster cost computed in the first phase may decrease but not increase. If it decreases, we overestimate the cost. However, this case implies that there is an edge between the two clusters and as they are still of size at most setmax when merged, in the first phase we will also have found another splitting considering this case. We employ a dynamic program to decide the assemblability for all possible O(nsetvars) colorings of splittings. Define the size of a partition coloring to be the number of set colorings in that partition coloring (not necessarily the number of different set colorings). We decide assemblability for all possible colorings of splittings from smallest to largest. Note that each such coloring is of size at least setmax , then all contained set setmax . If it is of size exactly colorings are of size setmax, so this partition coloring is assemblable if and only if all set colorings are fair. Now assume we have found all assemblable colorings of splittings of size exactly j (cid:62) n setmax . Assume a partition coloring C of size j + 1 is assemblable. Then, at least two set colorings C1, C2 from C are merged together. Hence, let C 0 be the partition n n 38 Fair Correlation Clustering coloring obtained by removing the set colorings C1, C2 from C and adding the set coloring of the combined coloring of C1 and C2. Now, C 0 is of size j and is assemblable. Thus, every assemblable splitting with j + 1 components has an assemblable splitting with j components. The other way round, if we split a set coloring of an assemblable partition coloring of size j we obtain an assemblable partition coloring of size j + 1. Hence, we find all assemblable colorings of splittings of size j +1 by for each assemblable partition coloring of size j (less than nsetvars many) trying each possible way to split one of its set colorings (less than i * 2setmax as there are j set colorings each of size at most setmax). Thus, to compute all assemblable colorings of splittings of size j + 1, we need time in O(nsetvars * j * 2setmax), which implies a total time for the n − n setmax iterations in the second phase in O(nsetvars+2 * 2setmax). This is dominated by the running time of the first phase. The complete algorithm hence runs in time in O(n2setvars+setmax+2 * setvarssetmax), which implies Theorem 23. This gives an algorithm that solves Fair Correlation Clustering on arbitrary forests. The running time however may be exponential in the number of vertices depending on the color ratio in the forest. 6.4 Few Clusters The algorithm presented in the previous section runs in polynomial time if the colors in the graph are distributed in a way such that each cluster in a minimum-cost solution is of constant size. The worst running time is obtained when there are very large but few clusters. For this case, we offer another algorithm, which runs in polynomial time if the number of clusters is constant. However, it is limited to instances where the forest is colored in two colors in a ratio of 1 : c for some c ∈ N. The algorithm uses a subroutine that computes the minimum number of cuts that are required to slice off clusters of specific sizes from the tree. It is given by Lemma 26. (cid:73) Lemma 26. Let T = (V, E) be a tree rooted at r ∈ V and k ∈ N. Then, we can compute an array R such that, for each a0 ∈ [n] and a = a1, a2, . . . , ak ∈ ([n − 1] ∪ {0})k with ai (cid:62) ai+1 for i ∈ [k − 1] and Pk i=0 ai = n, we have that R[a0, a] is the partition P = {S0, S1, . . . , Sk} of V with minimum inter-cluster cost that satisfies r ∈ S0 and |Si| = ai for i ∈ [k]. The computation time is in O((k + 3)! * n2k+3). Proof. We give a construction such that R[a0, a] stores not the partition itself but the incurred inter-cluster cost. By a simple backtracking approach, the partitions are obtained as well. We employ a dynamic program that involves using the Join subroutine. For the sake of readability, we index the arrays here by some vector a ∈ [n]k and a0 ∈ [n] instead of a single numerical index as used in the algorithmic description of the Join subroutine. We implicitly assume that each possible a0, a is represented by some index in [nk+1]. By letting these indices enumerate the vectors in a structured way, converting between the two formats only costs an additional time factor in O(k). v be an array with ∞-values at all indices except for R0 Starting at the leaves and continuing at the vertices for which all children have finished their computation, we compute an array Rv with the properties described for R but for the subtree Tv for each vertex v ∈ V . In particular, for every vertex v we do the following. Let R0 v[1, (0, 0, . . . , 0)] = 0, as this is the only possible entry for the tree T [{v}]. If v has no children, then R = R0 v. Otherwise, let the children of v be u1, u2, . . . , u'. Then we call the Join subroutine with the arrays R0 v, Ru1, Ru2, . . . , Ru' . We have to define f such that it gives all possibilities to combine the children's subtrees partitions and v. For all Casel, Friedrich, Schirneck & Wietheger 39 0, a0 recall that f ((a0, a), (a0 possible values of a0, a and a0 0, a0)) should return a set of indices of the form (a00 0 , a00). Each such index describes a combination of all possibilities for v and 0, a0). First, the already considered children (a0, a) and the possibilities for the next child (a0 we consider the possibility to cut the edge between v and the child u that is represented by (a0 0, a00). Then, we add all possible ways of merging the two sets with their k + 1 clusters each. As we cut the edge {u, v}, there are k possible ways to place the cluster containing u (all but the cluster containing v) and then there are k! ways to assign the remaining clusters. All these are put into the set f ((a0, a), (a0 0, a0)). Second, we assume the edge {u, v} is not cut. Then, the clusters containing v and u have to be merged, so there are only k! possible ways to assign the other clusters. In particular, for all indices (a00 0, a0)) this way, we have a00 0. Note that f can be computed in O(k * k!). Note that bf (x1, x2, . . . , x') as defined in the Join subroutine lists all possibilities to cut the combined tree as it iteratively combines all possibilities for the first child and the vertex v and for the resulting tree lists all possible combinations with the next child and so on. The Join subroutine takes time in O((k + 1) * (cid:0)nk+1(cid:1)2 * (k * k!) * k), which is in O((k + 3)! * n2k+2). All (cid:74) O(n) calls of the subroutine hence take time in O((k + 3)! * n2k+3). 0 , a00) put into f ((a0, a), (a0 0 = a0 + a0 With this, we are able to give an algorithm for graphs with two colors in a ratio of 1 : c, which runs in polynomial time if there is only a constant number of clusters, i.e., if c ∈ Θ(n). (cid:73) Theorem 27. Let F be an n-vertex forest with two colors in a ratio of 1 : c with c ∈ N>0 c+1 . Then, Fair Correlation Clustering on F can be solved in O(np3+p2+p). and let p = n Proof. Note that, if there are c red vertices per 1 blue vertex, p = n c+1 is the number of blue vertices. By Lemma 4, any minimum-cost clustering consists of p clusters, each containing exactly one blue vertex, and from Lemma 3 we know that it suffices to minimize the number of edges cut by any such clustering. All blue vertices are to be placed in separate clusters. They are separated by cutting at most p − 1 edges, so we try all of the O((p − 1) * (cid:0)n−1 (cid:1)) subsets of edges of size at most p − 1. Having cut these edges, we have ' trees T1, T2, . . . , T', with p of them containing exactly one blue vertex and the others no blue vertices. We root the trees at the blue vertex if they have one or at an arbitrary vertex otherwise. For each tree Ti, let ri be the number of red vertices. If we have exactly p trees and ri = c for all i ∈ [p], we have found a minimum-cost clustering, where the i-th cluster is simply the set of vertices of Ti for all i ∈ [p]. Otherwise, we must cut off parts of the trees and assign them to other clusters in order to make the partition fair. To this end, for each tree Ti we compute an array Ri that states the cost of cutting up to p − 1 parts of certain sizes off. More precisely, Ri[(a1, a2, . . . , ap−1)] is the number of cuts required to cut off p − 1 clusters of size a1, a2, . . . , ap−1, respectively, and ∞ if there is no such way as Pp−1 i=1 > ri. It suffices to compute Ri[(a1, a2, . . . , ap−1)] with 0 (cid:54) ai (cid:54) ai+1 (cid:54) n for i ∈ [p − 2]. p−1 We compute these arrays employing Lemma 26. Note that here we omitted the a0 used in the lemma, which here refers to the number of vertices not cut from the tree. However, a0 is still unambiguously defined over a as all the values sum up to the number of vertices in this tree. Further, by connecting all trees without blue vertices to some newly added auxiliary vertex z and using this tree rooted at z as input to Lemma 26, we reduce the number of subroutine calls to p + 1. Then, the only entries from the array obtained for the all-red tree we consider are the ones with a0 = 1 as we do not want to merge z in a cluster but every vertex except z from this tree has to be merged into another cluster. We call the array obtained from this tree R0 and the arrays obtained for the other trees R1, R2, . . . , Rp, respectively. 40 Fair Correlation Clustering Note that every fair clustering is characterized by choosing one entry from each array Ri and assigning the cut-off parts to other clusters. As each array has less than np p! entries and there are at most (p!)p ways to assign the cut-off parts to clusters, there are at most np2 possibilities in total. For each of these, we compute in linear time whether they result in a fair clustering. Among these fair clusterings, we return the one with the minimum inter-cluster cost, computed by taking the sum over the chosen entries from the arrays Ri. By Lemma 3, this clustering has the minimum Correlation Clustering cost. We obtain a total running time of (cid:19) (cid:18)n − 1 p − 1 np+3 + np2+p−2(cid:17) ) ⊆ O(np3+p2+p). + np2+1(cid:17) O((p − 1) * (p + 1) * (cid:74) (cid:16) (cid:16) * Combining the results of Theorems 23 and 27, we see that for the case of a forest with two colors in a ratio of 1 : c for some c ∈ N>0, there are polynomial-time algorithms when the clusters are either of constant size or have sizes in Θ(n). As Theorem 11 states that Fair Correlation Clustering on forests is NP-hard, we hence know that this hardness evolves somewhere between the two extremes. 7 Relaxed Fairness It might look like the hardness results for Fair Correlation Clustering are due to the very strict definition of fairness, which enforces clusters of a specific size on forests. However, in this section, we prove that even when relaxing the fairness requirements our results essentially still hold. 7.1 Definitions We use the relaxed fairness constraint as proposed by Bera et al. [11] and employed for Fair Correlation Clustering by Ahmadi et al. [1]. For the following definitions, given a set U colored by a function c : U → k, by Ui = {u ∈ U | c(u) = i} we denote the set of vertices of color i for all i ∈ [k]. (cid:73) Definition 28 (Relaxed Fair Set). Let U be a finite set of elements colored by a function c : U → [k] for some k ∈ N>0 and let pi, qi ∈ Q with 0 < pi (cid:54) |Ui| (cid:54) qi < 1 for all i ∈ [k]. |U | Then, some S ⊆ U is relaxed fair with regard to the qi and pi if and only if for all colors i ∈ [k] we have pi (cid:54) |S∩Ui| (cid:54) qi. |S| Note that we require pi and qi to be such that an exact fair solution is also relaxed fair. Further, we exclude setting pi or qi to 0 as this would allow clusters that do not include every color, which we do not consider fair. (cid:73) Definition 29 (Relaxed Fair Partition). Let U be a finite set of elements colored by a function c : U → [k] for some k ∈ N>0 and let pi, qi ∈ Q with 0 < pi (cid:54) |Ui| (cid:54) qi < 1 for all |U | i ∈ [k]. Then, a partition S1 ∪ S2 ∪ . . . ∪ S' = U is relaxed fair with regard to the qi and pi if and only if all sets S1, S2, . . . , S' are relaxed fair with regard to the qi and pi. Relaxed Fair Correlation Clustering Input: Task: Graph G = (V, E), coloring c : V → [k], pi, qi ∈ Q with 0 < pi (cid:54) |Ui| |U | qi < 1 for all i ∈ [k]. Find a relaxed fair partition P of V with regard to the pi and qi that minimizes cost(P). (cid:54) Casel, Friedrich, Schirneck & Wietheger 41 While we use the above definition for our hardness results, we restrict the possibilities for the pi and qi for our algorithms. (cid:73) Definition 30 (α-relaxed Fair Set). Let U be a finite set of elements colored by a function c : U → [k] for some k ∈ N>0 and let 0 < α < 1. Then, some S ⊆ U is α-relaxed fair if and only if it is relaxed fair with regard to pi = α|Ui| |U | and qi = |Ui| α|U | for all i ∈ [k]. (cid:73) Definition 31 (α-relaxed Fair Partition). Let U be a finite set of elements colored by a function c : U → [k] for some k ∈ N>0 and let 0 < α < 1. Then, a partition S1∪S2∪. . .∪S' = U is α-relaxed fair if and only if all sets S1, S2, . . . , S' are α-relaxed fair. α-relaxed Fair Correlation Clustering Input: Task: Graph G = (V, E), coloring c : V → [k], 0 < α < 1. Find a α-relaxed fair partition P of V that minimizes cost(P). 7.2 Hardness for Relaxed Fairness The hardness result for exact fairness on paths, see Theorem 14, directly carries over to the relaxed fairness setting. This is due to it only considering instances in which there are exactly two vertices of each color. As any relaxed fair clustering still requires at least one vertex of every color in each cluster, this means that every relaxed clustering either consists of a single cluster or two clusters, each with one vertex of every color. Thereby, relaxing fairness makes no difference in these instances. (cid:73) Corollary 32. Relaxed Fair Correlation Clustering on paths is NP-hard, even when limited to instances with exactly 2 vertices of each color. Our other hardness proofs for relaxed fairness are based on the notion that we can use similar constructions as for exact fairness and additionally prove that in these instances the minimum-cost solution has to be exactly fair and not just relaxed fair. To this end, we require a lemma giving a lower bound on the intra-cluster cost of clusterings. (cid:73) Lemma 33. Let G = (V, E) be an n-vertex m-edge graph and P a partition of V with an inter-cluster cost of χ. Then, the intra-cluster cost of P is at least n2 2 − m + χ. If 2|P| − n |S| = n 2 −m+χ. 2|P| − n |P| for all clusters S ∈ P, then the intra-cluster cost of P is exactly ψ = n2 Proof. We first prove the lower bound. We employ the Cauchy-Schwarz inequality, stating (cid:17) that for every ' ∈ N, x1, x2, . . . , x', and y1, y2, . . . , y', we have (cid:16)P' i=1 xiyi i=1 x2 i (cid:16)P' (cid:16)P' (cid:16)P' (cid:17)2 (cid:17)2 (cid:54) (cid:17) * . In particular, it holds that i . Observe that we can write (cid:54) ' * P' i=1 x2 i=1 y2 i i=1 xi the intra-cluster cost ψ of P as ψ = X S∈P |S| * (|S| − 1) 2 ! − (m − χ) = ! |S|2 − 1 2 X S∈P ! X S∈P |S| 2 − m + χ = 1 2 ! |S|2 − n 2 X S∈P − m + χ. By Cauchy-Schwarz, we have P intra-cluster cost from below by ψ (cid:62) n2 S∈P |S|2 (cid:62) 1 2|P| − n |P| * (cid:0)P 2 − m + χ. S∈P |S|(cid:1)2 = n2 |P| . This bounds the 42 Fair Correlation Clustering For the second statement, assume all clusters of P to be of size n 1 2 * n |P| * (cid:16) n |P| − 1 (cid:17) pairs of vertices in each cluster. Thereby, we have |P| . Then, there are ψ = |P| * 1 2 * n |P| (cid:18) n |P| * (cid:19) − 1 − (m − χ) = n2 2|P| − n 2 − m + χ. (cid:74) We further show that no clustering with clusters of unequal size achieves the lower bound given by Lemma 33. (cid:73) Lemma 34. Let G = (V, E) be an n-vertex m-edge graph and P a partition of V with an |P| + a for some a (cid:62) 0. inter-cluster cost of χ such that there is a cluster S ∈ P with |S| = n Then, the intra-cluster cost of P is ψ (cid:62) a2|P| 2|P|−2 + n2 2|P| − n 2 − m + χ. Proof. If a = 0, the statement is implied by Lemma 33. So, assume a > 0. We write the intra-cluster cost as ψ = (cid:18) n |P| * 1 2 (cid:19) + a * (cid:18) n |P| (cid:19) + a − 1 + ψrest with ψrest being the intra-cluster cost incurred by P \ {S}. By applying Lemma 33 on P \ {S}, we have ψ (cid:62) 1 2 (cid:18) n |P| * (cid:19) + a * (cid:18) n |P| (cid:16) (cid:19) + a − 1 + (cid:17)2 n − ( n |P| + a) 2(|P| − 1) n − ( n |P| + a) 2 − − m + χ + a2 2 − n 2|P| − a 2 + n2 − 2n2/|P| − 2an + n2/|P|2 + 2a n |P| + a2 2|P| − 2 = n2 an 2|P|2 + |P| n n + − 2|P| 2 + a 2 − m + χ. Bringing the first summands to a common denominator of 2|P| − 2 yields ψ (cid:62) (cid:18) n2(|P| − 1) |P|2 + an(2|P| − 2) |P| + a2(|P| − 1) + n2 − 2n2 |P| − 2an + n2 |P|2 + 2an |P| (cid:19) + a2 − m + χ + a2|P| + n2 − n 2 2an|P| |P| (cid:14)(2|P| − 2) − (cid:18) n2|P| = (cid:18) = − |P|2 + n2 |P| + a2|P| + n2 (cid:14)(2|P| − 2) − (cid:19) (cid:19) − 2an (cid:14)(2|P| − 2) − n 2 − m + χ − m + χ. 2n2 |P| n 2 We then add 0 = − n2 2|P| * 2|P |−2 2|P |−2 + n2 2|P| and obtain ψ (cid:62) = (cid:18) − n2 |P| a2|P| 2|P| − 2 + a2|P| + n2 − (cid:19) n2(|P| − 1) |P| (cid:14)(2|P| − 2) + n2 2|P| − n 2 − m + χ + n2 2|P| − n 2 − m + χ. (cid:74) Observe that as |P| > 1 and a 6= 0 this means that such a clustering never achieves the lower bound given by Lemma 33. In particular, this means that for fixed inter-cluster costs in minimum-cost fair clusterings in forests all clusters are of equal size. This way, we are able to transfer some hardness results obtained for exact fairness to relaxed fairness. Casel, Friedrich, Schirneck & Wietheger 43 (cid:73) Theorem 35. For every choice of 0 < p1 (cid:54) 1 (cid:54) q2 < 1, c+1 Relaxed Fair Correlation Clustering on forests with two colors in a ratio of 1 : c is NP-hard. It remains NP-hard when arbitrarily restricting the shape of the trees in the forest as long as for every a ∈ N it is possible to form a tree with a vertices. (cid:54) q1 < 1 and 0 < p2 (cid:54) c c+1 Proof. We reduce from 3-Partition. Recall that there are 3p values a1, a2, . . . , a3p and the task is to partition them in triplets that each sum to B. We construct a forest F as follows. For every ai we construct an arbitrary tree of ai red vertices. Further, we let there be p isolated blue vertices. Note that the ratio between blue and red vertices is 1 : B. We now show that there is a relaxed fair clustering P such that cost(P) (cid:54) p * B(B + 1) 2 − p(B − 3) if and only if the given instance is a yes-instance for 3-Partition. If we have a yes-instance of 3-Partition, then there is a partition of the set of trees into p clusters of size B. By assigning the blue vertices arbitrarily to one unique cluster each, we hence obtain an exactly fair partition, which is thus also relaxed fair. As there are no edges between the clusters and each cluster consists of B + 1 vertices and B − 3 edges, this partition has a cost of p * B(B+1) − p(B − 3). For the other direction, assume there is a relaxed fair clustering P such that cost(P) (cid:54) p * B(B+1) − p(B − 3). We prove that this clustering has to be not just relaxed fair but exactly fair. Note that |V | = p(B + 1) and |E| = p(B − 3). As the inter-cluster cost χ is non-negative, by Lemma 33 the intra-cluster cost has a lower bound of 2 2 ψ (cid:62) (p(B + 1))2 2|P| − p(B + 1) 2 − p(B − 3). As there are exactly p blue vertices and the relaxed fairness constraint requires putting at least one blue vertex in each cluster, we have |P| (cid:54) p. Hence, ψ (cid:62) p(B + 1)2 2 − p(B + 1) 2 − p(B − 3) = p * B(B + 1) 2 − p(B − 3) (cid:62) cost(P). This implies that the inter-cluster cost of P is 0 and |P| = p. Lemma 34 then gives that all clusters in P consist of exactly B + 1 vertices. As each of the p clusters has at least 1 blue vertex and there are p blue vertices in total, we know that each cluster consists of 1 blue and B red vertices. Since all trees are of size greater than B 2 , this implies each cluster consists of exactly one blue vertex and exactly three uncut trees with a total of B vertices. This way, such a clustering gives a solution to 3-Partition, so our instance is a yes-instance. 4 and less than B As the construction of the graph only takes polynomial time in the instance size, this (cid:74) implies our hardness result. Indeed, we note that we obtain our hardness result for any fairness constraint that allows the exactly fair solution and enforces at least 1 vertex of each color in every cluster. The same holds when transferring our hardness proof for trees of diameter 4. (cid:73) Theorem 36. For every choice of 0 < p1 (cid:54) 1 (cid:54) q2 < 1, c+1 Relaxed Fair Correlation Clustering on trees with diameter 4 and two colors in a ratio of 1 : c is NP-hard. (cid:54) q1 < 1 and 0 < p2 (cid:54) c c+1 44 Fair Correlation Clustering Proof. We reduce from 3-Partition. We assume B2 > 16p. We can do so as we obtain an equivalent instance of 3-Partition when multiplying all ai and B by the same factor, here some value in O(p). For every ai we construct a star of ai red vertices. Further, we let there be a star of p blue vertices. We obtain a tree of diameter 4 by connecting the center v of the blue star to all the centers of the red stars. Note that the ratio between blue and red vertices is 1 : B. We now show that there is a relaxed fair clustering P such that cost(P) (cid:54) pB2 − pB 2 + 7p − 7 if and only if the given instance is a yes-instance for 3-Partition. If we have a yes-instance of 3-Partition, then there is a partition of the set of stars into p clusters of size B, each consisting of three stars. By assigning the blue vertices arbitrarily to one unique cluster each, we hence obtain an exact fair partition, which is thus also relaxed fair. We first compute the inter-cluster cost. We call an edge blue or red if it connects two blue or red vertices, respectively. We call an edge blue-red if it connects a blue and a red vertex. All p − 1 blue edges are cut. Further, all edges between v (the center of the blue star) and red vertices are cut except for the three stars to which v is assigned. This causes 3p − 3 more cuts, so the inter-cluster cost is χ = 4p − 4. Each cluster consists of B + 1 vertices and B − 3 edges, except for the one containing v which has B edges. The intra-cluster cost is ψ = p (cid:18) B(B + 1) 2 (cid:19) − B + 3 − 3 = pB2 − pB 2 + 3p − 3. Combining the intra- and inter-cluster costs yields the desired cost of cost(P) = χ + ψ = pB2 − pB 2 + 7p − 7. For the other direction, assume there is a relaxed fair clustering P such that cost(P) (cid:54) pB2−pB + 7p − 7. We prove that this clustering is not just relaxed fair but exactly fair. 2 To this end, we first show |P| = p. Because each cluster requires one of the p blue vertices, we have |P| (cid:54) p. Now, let χ denote the inter-cluster cost of P. Note that |V | = p(B + 1) and |E| = p(B − 3) + 3p + p − 1 = p(B + 1) − 1. Then, by Lemma 33, we have (2) ψ (cid:62) (p(B + 1))2 2|P| − p(B + 1) 2 − (p(B + 1) − 1) + χ = p2B2 + 2p2B + p2 2|P| − 3p(B + 1) 2 + 1 + χ. Note that the lower bound is decreasing in |P|. If we had |P| (cid:54) p − 1, then ψ (cid:62) p2B2 + 2p2B + p2 2(p − 1) − 3p(B + 1) 2 + 1 + χ. As the inter-cluster cost χ is non-negative, we would thereby get cost(P) (cid:62) p2B2 + 2p2B + p2 2(p − 1) (cid:62) p2B2 + 2p2B + p2 2(p − 1) − − 3p(B + 1) 2 + 1 + χ 3p2B − 3pB + 3p2 − 3p 2(p − 1) + 2p − 2 2(p − 1) (cid:62) p2B2 − p2B − 2p2 + 3pB + 5p − 2 2(p − 1) . Casel, Friedrich, Schirneck & Wietheger 45 However, we know cost(P) (cid:54) pB2 − pB 2 + 7p − 7 = = p2B2 − pB2 − p2B + pB + 14p2 − 14p − 14p + 14 2(p − 1) p2B2 − pB2 − p2B + pB + 14p2 − 28p + 14 2(p − 1) . Hence, |P| (cid:54) p − 1 holds only if −2p2 + 3pB + 5p − 2 (cid:54) −pB2 + pB + 14p2 − 28p + 14 which is equivalent to pB2 − 16p2 + 2pB + 33p − 16 (cid:54) 0. As we assume B2 > 16p, this is always false, so |P| = p. Plugging this into Equation 2 yields ψ (cid:62) pB2 + 2pB + p 2 − 3p(B + 1) 2 + 1 + χ = pB2 − pB 2 − p + 1 + χ. As cost(P) = χ + ψ, we have pB2 − pB 2 − p + 1 + 2χ (cid:54) cost(P) (cid:54) pB2 − pB 2 + 7p − 7, (3) which yields χ (cid:54) 4p − 4. As no two blue vertices are placed in the same cluster, the cuts between blue vertices incur an inter-cluster cost of exactly p − 1. To estimate the number of cut blue-red edges, let a denote the number of red center vertices placed in the cluster of the blue center vertex v. Then, there are 3p − a of the 3p red edges cut. Let χr denote the number of cut red edges. Note that χ = p − 1 + 3p − a + χr = 4p − a − 1 + χr. We prove that a = 3. As χ (cid:54) 4p − 4 we have χr − a (cid:54) −3, whence a (cid:62) 3. Next, we bound χr by a. Let δ ∈ Z be such that B + δ is the number of red vertices in the cluster containing the blue center vertex v. Then, χr (cid:62) aB 4 − (B + δ − a) = (a − 4)B 4 − δ + a as each red center vertex is connected to at least B only space for B + δ − a of them. First, assume δ (cid:54) 0. This implies χr − a (cid:62) (a−4)B required χr − a (cid:54) −3, this gives a < 4, as desired. 4 red leaves but in the cluster of v there is . As we 4 The case δ (cid:62) 1 is a bit more involved. From Lemma 34, p = |P|, and m = n − 1 = p(B + 1) − 1, we get ψ (cid:62) δ2|P| 2|P| − 2 + (p(B + 1))2 2|P| − p(B + 1) 2 −m+χ = δ2p 2p − 2 + pB2 + 2pB + p 2 − 3p(B + 1) 2 +χ+1. This yields δ2p 2p − 2 + pB2 − pB 2 − p + 2χ + 1 (cid:54) cost(P) (cid:54) pB2 − pB 2 + 7p − 7. We derive from this inequality that χ (cid:54) 4p − 4 − δ2p 4p−4 and χr − a (cid:54) −3 − δ2p 4p−4 implying (a − 4)B 4 − δ (cid:54) −3 − δ2p 4p − 4 The right-hand side is decreasing in δ, and by plugging in the minimum value for the case δ (cid:62) 1, we finally get (a−4)B 4p−4 . This shows that a < 4 must hold here as well. (cid:54) −2 − p 4 46 Fair Correlation Clustering Figure 11 Exemplary path with a color ratio of 1 : 1 where there is a 2 3 -relaxed fair clustering of cost 3 (marked by the orange lines) and the cheapest exactly fair clustering costs 4. Thus, we have proven a = 3, which also gives χr = 0 and χ = 4p − 4. So, not only do we have that cost(P) (cid:54) pB2−pB + 7p − 7 but cost(P) = pB2−pB + 7p − 7. In Equation 3 we see that for χ = 4p − 4 this hits exactly the lower bound established by Lemma 33. Hence, by Lemma 34, this implies that all clusters consist of exactly 1 blue and B red vertices and the clustering is exactly fair. 2 2 As χr = 0, all red stars are complete. Given that every red star is of size at least B 4 and at most B 2 , this means each cluster consists of exactly three complete red stars with a total number of B red vertices each and hence yields a solution to the 3-Partition instance. As the construction of the graph only takes polynomial time in the instance size and the (cid:74) constructed tree is of diameter 4, this implies our hardness result. In the hardness proofs in this section, we argued that for the constructed instances clusterings that are relaxed fair, but not exactly fair would have a higher cost than exactly fair ones. However, this is not generally true. It does not even hold when limited to paths and two colors in a 1 : 1 ratio, as illustrated in Figure 11. Because of this, we have little hope to provide a general scheme that transforms all our hardness proofs from Section 5 to the relaxed fairness setting at once. Thus, we have to individually prove the hardness results in this setting as done for Theorems 35 and 36. We are optimistic that the other hardness results still hold in this setting, especially as the construction for Theorem 13 is similar to the ones employed in this section. We leave the task of transferring these results to future work. 7.3 Algorithms for Relaxed Fairness We are also able to transfer the algorithmic result of Theorem 23 to a specific α-relaxed fairness setting. We exploit that the algorithm does not really depend on exact fairness but on the fact that there is an upper bound on the cluster size, which allows us to compute respective splittings. In the following, we show that such upper bounds also exist for α-relaxed fairness with two colors in a ratio of 1 : 1 and adapt the algorithm accordingly. To compute the upper bound, we first prove Lemma 37, which analogously to Lemma 4 bounds the size of clusters but in uncolored forests. Using this lemma, with Lemma 38, we then prove an upper bound on the cluster size in minimum-cost α-relaxed fair clusterings for forests with two colors in ratio 1 : 1. (cid:73) Lemma 37. Let F = (V, E) be an n-vertex m-edge forest and let P1 = {V }. Further, let S ⊂ V with 4 < |S| (cid:54) n − 3 and let P2 = {S, V \ S}. Then, cost(P1) > cost(P2). Proof. We have cost(P1) = n(n−1) 2 − m as there are n(n−1) pairs of vertices and m edges, none of which is cut by P1. In the worst case, P2 cuts all of the at most n − 1 edges in the 2 Casel, Friedrich, Schirneck & Wietheger 47 forest. It has one cluster of size |S| and one of size n − |S|, so cost(P2) (cid:54) n − 1 + (n − |S|)(n − |S| − 1) 2 + = = n(n − 1) 2 n(n − 1) 2 Then, we have + −2n|S| + |S|2 + |S| 2 − n|S| + |S|2 − m + 2n − 2. |S|(|S| − 1) 2 |S|2 − |S| 2 + − (m − n − 1) − m + 2n − 2 cost(P1) − cost(P2) (cid:62) n|S| − |S|2 − 2n + 2 (cid:62) (|S| − 2)n − |S|2 + 2. Note that the bound is increasing in n. As we have, n (cid:62) |S| + 3 and |S| > 4, this gives cost(P1) − cost(P2) (cid:62) (|S| − 2)(|S| + 3) − |S|2 + 2 = |S| − 4 > 0. (cid:74) With the knowledge of when it is cheaper to split a cluster, we now prove that also for α-relaxed Fair Correlation Clustering there is an upper bound on the cluster size in minimum-cost solutions in forests. The idea is to assume a cluster of a certain size and then argue that we can split it in a way that reduces the cost and keeps α-relaxed fairness. (cid:73) Lemma 38. Let F be a forest with two colors in a ratio of 1 : 1. Let 0 < α < 1 and let ˆα ∈ N be minimal such that 2 ˆα α > 4. Then, if P is a minimum-cost α-relaxed fair clustering on F , we have |S| < 4 ˆα Proof. Assume otherwise, i.e., there is a cluster S with |S| (cid:62) 4 ˆα α2 . Let b and r denote the number of blue and red vertices in S, respectively, and assume w.l.o.g. that b (cid:54) r. Because |S| (cid:62) 4 ˆα (cid:62) 2 ˆα α|S| and thereby r (cid:62) b (cid:62) 2 ˆα α . α|S| . Due to the α-relaxed fairness constraint, this yields b α2 for all S ∈ P. α ∈ N and 2 ˆα α2 we have α Then, consider the clustering obtained by splitting off ˆα blue and 2 ˆα α − ˆα red vertices of from S into a new cluster S1 and let S2 = S \ S1. Note that we choose ˆα in a way that this is possible, i.e., that both sizes are natural numbers. As the cost induced by all edges with at most one endpoint in S remains the same and the cost induced by the edges with both endpoints in S decreases, as shown in Lemma 37, the new clustering is cheaper than P. As we now prove that the new clustering is also α-relaxed Fair, this contradicts the optimality of P. (cid:62) 2 ˆα |S| 2 of ˆα ˆα+ 2 ˆα α − ˆα We first prove the α-relaxed fairness of S1. Regarding the blue vertices, we have a portion 2 in S1, which fits the α-relaxed fairness constraint. Regarding the red vertices, 2 , which fits the α-relaxed fairness constraint as 0 < α < 1, so = 1 − α 2 ˆα α − ˆα = α we have (cid:62) α 1 − α 2 Now we prove the α-relaxed fairness of S2. The portion of blue vertices in S2 is 2 = 2α−α2 (cid:54) 1 2α . 2α ˆα+ 2 ˆα α − ˆα 2 and 1 − α (cid:1) (cid:54) b − ˆα. As S is α-relaxed fair, we have r (cid:54) 2b b− ˆα , r+b− 2 ˆα α 2α . We start with showing the value α − b 2 and 1 so we have to show that this value lays between α is at least α because otherwise 2 by proving α b b+r < (cid:19) 2 * (cid:0)r + b − 2 ˆα α = α b 2 . Hence, we have b+ 2b α −b (cid:18) 2b α − b + b − 2ˆα α (cid:19) * (cid:54) α 2 = b − ˆα. * r + b − 2ˆα α α 2 (cid:18) Similarly, we show the ratio is at most 1 α . As we assume r (cid:62) b, we have r + b − 2 ˆα (cid:18) 2ˆα α (cid:62) 2b − r + b − 2ˆα α (cid:62) 2 ˆα α b − − (cid:18) (1 − α)b + (α2 − 1) (cid:19)(cid:19) ˆα α = 2α (b − ˆα) . 2α by proving the equivalent statement of 2α(b − ˆα) (cid:54) 48 Fair Correlation Clustering The second step holds because we assumed b (cid:62) 2 ˆα α (cid:62) α ˆα+ ˆα α = (α2 − 1) ˆα α know that r (cid:62) 2 ˆα As r (cid:62) b, this implies (cid:62) 0. Now, we regard the portion of red vertices in S2, which is α − 2ˆα or, in other words, r − (cid:0) 2 ˆα α , that is, (1 − α)r (cid:62) 2 ˆα ˆα α −α ˆα 1−α , so we have (1 − α)b + α − ˆα) . We α + ˆα(cid:1) (cid:62) αr − ˆα. r−( 2 ˆα r+b− 2 ˆα α r − (cid:18) 2ˆα α (cid:19) + ˆα (cid:62) α 2 (cid:18) * r + b − (cid:19) 2ˆα α and therefore α − ˆα) r−( 2 ˆα r+b− 2 ˆα α (cid:62) α 2 . It remains to prove that this ratio is also at most 1 2α . We have r (cid:62) 2 ˆα α − ˆα, which is equivalent to (cid:18) 2α − 1 − (cid:19) α 2 − α r (cid:54) 4ˆα − 2α ˆα − 2ˆα α . Note that 2α − 1 − α αr 2−α . With this, the above inequality implies 2−α = − 2α2−4α+2 2−α = − 2(α−1)2 2−α < 0 and that r (cid:54) 2b α − b gives b (cid:62) r α −1 = 2 (2α − 1)r − b (cid:54) 4ˆα − 2α ˆα − 2ˆα α From this, we finally arrive at 2α * (cid:0)r − (cid:0) 2 ˆα α − ˆα(cid:1)(cid:1) (cid:54) r + b − 2 ˆα α , that is, α − ˆα) r−( 2 ˆα r+b− 2 ˆα α (cid:54) 1 2α . This proves that both S1 and S2 are α-relaxed fair. As splitting S into S1 and S2 remains α-relaxed fair and is cheaper, this contradicts S being in a minimum-cost α-relaxed fair (cid:74) clustering. We are now able to adapt the algorithm presented in Subsection 6.3 to solve Relaxed Fair Correlation Clustering on forests with two colors in a ratio of 1 : 1. While the original algorithm exploited that any optimum solution has fair clusters of minimum size, with Lemma 38 we are able to bound the clusters also in the α-relaxed setting. Like the original algorithm, we first create a list of possible splittings. However, these splittings can contain not only components with one or two vertices, as we know would suffice for the exact fairness with two colors in a 1 : 1 ratio, but each component may contain up to 4 ˆα α > 4 as defined in Lemma 38. In the following, we set d = 4 ˆα α2 to refer to this maximum size of a cluster. In the second phase, it checks which of these splitting can be merged into an α-relaxed fair clustering and among these returns the one of minimum cost. α2 vertices with ˆα being the smallest natural number such that 2 ˆα α ∈ N and 2 ˆα Splitting the forest. To get the optimal way to obtain a splitting of each possible coloring, we simply apply Lemma 25 and set d1 = d2 = d as we know the optimum solution has to be among clusters with no more than d vertices of either color. This phase takes time in O(n2(d+1)2+2d+2 * (cid:0)(d + 1)2(cid:1)2d ) = O(n2d2+6d+4 * (d + 1)4d). Assembling a fair clustering. In the second phase, we have to find a splitting in D∅ r that can be transformed into an α-relaxed fair clustering and yields the minimum Correlation Clustering cost. As we tracked the minimum inter-cluster cost for each possible partition coloring of splittings in Casel, Friedrich, Schirneck & Wietheger 49 the first phase, we do not have to consider cutting more edges in this phase, because for the resulting splittings coloring we already have tracked a minimum inter-cluster cost. Hence, the only questions are whether a splitting is assemblable, i.e., whether its components can be merged such that it becomes an α-relaxed fair clustering, and, if so, what the cheapest way to do so is. Regarding the first question, observe that the assemblability only depends on the partition coloring of the splitting. Hence, it does not hurt that in the first phase we tracked only all possible partition colorings of splittings and not all possible splittings themselves. First, note that the coloring of a splitting may itself yield an α-relaxed fair clustering. We mark all such partition colorings as assemblable, taking time in O(nd2+1). For the remaining partition colorings, we employ the following dynamic program. d e. If it is of size exactly d n Recall that the size of a partition coloring refers to the number of set colorings it contains (not necessarily the number of different set colorings). We decide assemblability for all possible partition colorings from smallest to largest. Note that each partition coloring is of size at least d n d e, then there are no two set colorings that can be merged and still be of size at most d, as all other set colorings are of size at most d. Hence, in this case, a splitting is assemblable if and only if it is already an α-relaxed fair clustering so we have already marked the partition colorings correctly. Now, assume that we decided assemblability for all partition colorings of size i (cid:62) d n d e. We take an arbitrary partition coloring C of size i + 1, which is not yet marked as assemblable. Then, it is assemblable if and only if at least two of its set colorings are merged together to form an α-relaxed fair clustering. In particular, it is assemblable if and only if there are two set colorings C1, C2 in C such that the coloring C 0 obtained by removing the set colorings C1, C2 from C and adding the set coloring of the combined coloring of C1 and C2 is assemblable. Note that C 0 is of size i. Given all assemblable partition colorings of size i, we therefore find all assemblable partition colorings of size i + 1 by for each partition coloring of size i trying each possible way to split one of its set colorings into two. As there are at most id2 partition colorings of size i, this takes time in O(id2 * i * 2d). The whole dynamic program then takes time in O(nd2+1 * 2d) ⊆ O(nd2+d+1). S∈P |S|(|S−1|) 2 It remains to answer how we choose the assembling yielding the minimum cost. In the algorithm for exact fairness, we do not have to worry about that as there we could assume that the Correlation Clustering cost only depends on the inter-cluster cost. Here, this is not the case as the α-relaxed fairness allows clusters of varying size, so Lemma 3 does not apply. However, recall that we can write the Correlation Clustering cost of some partition P of the vertices as P + 2χ, where χ is the inter-cluster cost. The cost hence only depends on the inter-cluster cost and the sizes of the clusters, which in turn depends on the partition coloring. To compute the cost of a splitting, we take the inter-cluster cost computed in the first phase for χ. Once more, we neglect decreasing inter-cluster cost due to the merging of clusters as the resulting splitting is also considered in the array produced in the first phase. By an argument based on the Cauchy-Schwarz Inequality, we see that merging clusters only increases the value of P as we have fewer but larger squares. Hence, the cheapest cost obtainable from a splitting which is itself α-relaxed fair is just this very clustering. If a splitting is assemblable but not α-relaxed fair itself, the sum is the minimum among all the values of the sums of α-relaxed fair splittings it can be merged into. This value is easily computed by not only passing down assemblability but also the value of this sum in the dynamic program described above and taking the minimum if there are multiple options for a splitting. This does not change the running time asymptotically and the running time of the second phase is dominated by the one of the first phase. |S|(|S−1|) 2 S∈P 50 Fair Correlation Clustering The complete algorithm hence runs in time in O(n2d2+6d+4 * (d + 1)4d). (cid:73) Theorem 39. Let F be an n-vertex forest in which the vertices are colored with two colors in a ratio of 1 : 1. Then α-relaxed Fair Correlation Clustering on F can be solved in time in O(n2d2+6d+4 * (d + 1)4d), where d = 4 ˆα α ∈ N and 2 ˆα α2 and ˆα ∈ N is minimal such that 2 ˆα α > 4. We are confident that Lemma 38 can be generalized such that for an arbitrary number of colors in arbitrary ratios the maximum cluster size is bounded by some function in α and the color ratio. Given the complexity of this lemma for the 1 : 1 case, we leave this task open to future work. If such a bound is proven, then the algorithmic approach employed in Theorem 39 is applicable to arbitrarily colored forests. Similarly, bounds on the cluster size in the more general relaxed fair clusterings can be proven. As an intermediate solution, we note that for Relaxed Fair Correlation Clustering we can employ the approach used for α-relaxed Fair Correlation Clustering by setting α large enough to contain all allowed solutions and filtering out solutions that do not match the relaxed fairness constraint in the assembling phase. We do not give this procedure explicitly here as we suspect for these cases it is more promising to calculate the precise upper bound on the maximum cluster size and perform the algorithm accordingly instead of reducing to the α-relaxed variant. 8 Approximations So far, we have concentrated on finding an optimal solution to Fair Correlation Clus- tering in various instances. Approximation algorithms that do not necessarily find an optimum but near-optimum solutions efficiently are often used as a remedy for hard problems, for example, the 2.06-approximation to (unfair) Correlation Clustering [17]. In this section, we find that just taking any fair clustering is a quite close approximation and the approximation becomes even closer to the optimum if the minimum size of any fair cluster, as given by the color ratio, increases. Formally, a problem is an optimization problem if for every instance I there is a set of permissible solutions S(I) and an objective function m : S(I) → R>0 assigning a score to each solution. Then, some S ∈ S(I) is an optimal solution if it has the highest or lowest score among all permissible solutions, depending on the problem definition. We call the score of this solution m∗(I). For example, for Fair Correlation Clustering, the instance is given by a graph with colored vertices, every fair clustering of the vertices is a permissible solution, the score is the Correlation Clustering cost, and the objective is to minimize this cost.8 An α-approximation an optimization problem is an algorithm that, for each (cid:54) α. For Fair instance I, outputs a permissible solution S ∈ S(I) such that 1 α Correlation Clustering in particular, this means the algorithm outputs a fair clustering with a cost of at most α times the minimum clustering cost. (cid:54) m(S) m∗(I) APX is the class of problems that admit an α-approximation with α ∈ O(1). A polynomial- time approximation scheme (PTAS), is an algorithm that for each optimization problem instance as well as parameter ε > 0 computes a (1 + ε)-approximation for a minimization problem or a (1 − ε)-approximation for a maximization problem in time in O(nf (ε)), for some computable function f depending only on ε. We use PTAS to refer to the class of 8 We note that the clustering cost could be 0, which contradicts the definition m : S(I) → R>0. However, every 0-cost clustering simply consists of the connected components of the graph. We do not consider those trivial instances. Casel, Friedrich, Schirneck & Wietheger 51 optimization problems admitting a PTAS. An optimization problem L is called APX-hard if every problem in APX has a PTAS-reduction to L, i.e., a PTAS for L implies there is a PTAS for every problem in APX. If L is additionally in APX itself, L is called APX-complete. By definition, we have PTAS ⊆ APX. Further, PTAS 6= APX unless P = NP. We find that taking any fair clustering of a forest yields a good approximation. (cid:73) Theorem 40. Let F be an n-vertex m-edge forest with k (cid:62) 2 colors in a ratio of c1 : c2 : (d2−d)n+2dm . . . : ck and d = Pk (d2−5d+4)n+2dm -approximation for Fair Correlation Clustering on F computable in time in O(n). i=1 ci (cid:62) 4. Then, there is a Proof. By first sorting the vertices by color and then iteratively adding the next ci vertices of each color i to the next cluster, we obtain a fair clustering P with clusters of size d in linear time. In the worst-case, P cuts all m edges. Hence, by Lemma 3, we have cost(P) (cid:54) (d − 1)n 2 − m + 2m = (d − 1)n 2 + m. We compare this cost to the one of a minimum-cost fair clustering P ∗. By Lemma 4, P ∗ d clusters contains at most d − 1 edges due to d * (d − 1) edges are placed inside a cluster. Then, for to consist of clusters of size d. Each of the n the forest structure. Hence, at most n the inter-cluster cost, we have χ (cid:62) m − n d − n + m. Lemma 3 gives d * (d − 1) = n cost(P ∗) (cid:62) (d − 1)n 2 − m + 2 (cid:16) n d − n + m (cid:17) = (d − 5)n 2 + 2n d + m. Thereby, P yields an α-approximation to Fair Correlation Clustering, where α = (cid:18) (d − 1)n 2 (cid:19) + m (cid:14) (cid:0)d2 − d(cid:1) n + 2dm 2d = (cid:19) + + m (cid:18) (d − 5)n 2n 2 d (cid:0)d2 − 5d + 4(cid:1) n + 2dm 2d ! (cid:14) ! (cid:0)d2 − d(cid:1) n + 2dm (d2 − 5d + 4) n + 2dm . = (cid:74) Observe that α is decreasing in d for d (cid:62) 4 and converges to 1 as d → ∞. Further, for 4n+10m < 5. Thus, for d (cid:62) 5 we have a 5-approximation to Fair d = 5 we obtain α = 20n+10m Correlation Clustering on forests. For d = 4, α becomes linear in m n and for smaller d it is not necessarily positive or not even defined if (cid:0)d2 − 5d + 4(cid:1) n + 2dm = 0. This is because if there are very small clusters, then in forests there are solutions of almost no cost. If d = 2, i.e., there are two colors in a 1 : 1 ratio, there are even forests with a cost of 0, namely the ones where all vertices have degree 1 and each edge connects 2 vertices of different colors. A solution cutting every edge is then much worse than an optimum solution. If the factor becomes negative or not defined, this is due to us bounding the inter-cluster cost of the optimum clustering by n d − n + m, which is possibly negative, while the inter-cluster cost is guaranteed to be non-negative. On trees, however, if the clusters are small even an optimum solution has to cut some edges as now there always are edges between the clusters. Hence, in this case, we obtain a good approximation for all possible d. Note that the proof of Theorem 40 does not really require d (cid:62) 4 but for d < 4 the approximation factor is just not helpful or defined. This changes, if we assume the forest to be a tree and plug in m = n − 1. (cid:73) Corollary 41. Let T be an n-vertex tree with k (cid:62) 2 colors in a ratio of c1 : c2 : . . . : ck (d2+d)n−2d and d = Pk (d2−3d+4)n−2d -approximation to Fair Correlation Clustering on T that is computed in time in O(n). i=1 ci. Then, there is a 52 Fair Correlation Clustering Now, the approximation factor is still decreasing in d and converges to 1 as d → ∞. 2n−4 < 3. Therefore, However, it is positive and defined for all d (cid:62) 2. For d = 2 we obtain 6n−4 we have a 3-approximation to Fair Correlation Clustering on trees. Nevertheless, our results for forest suffice to place Fair Correlation Clustering in APX and even in PTAS. First, for d (cid:62) 5 we have a 5-approximation to Fair Correlation Clustering on forests. If d (cid:54) 4, a minimum-cost fair clustering is found on the forest in polynomial time by Theorem 23. Hence, Fair Correlation Clustering on forests is in APX. Next, recall that the larger the minimum fair cluster size d, the better the approximation becomes. Recall that our dynamic program for Theorem 23 has better running time the smaller the value d. By combining these results, we obtain a PTAS for Fair Correlation Clustering on forests. This contrasts Fair Correlation Clustering on general graphs, as even unfair Correlation Clustering is APX-hard there [16] and therefore does not admit a PTAS unless P = NP. (cid:73) Theorem 42. There is a PTAS for Fair Correlation Clustering on forests. Moreover, an (1+ε)-approximate fair clustering can be computed in time O(npoly(1/ε)). Proof. If d (cid:54) 4, we find a minimum-cost fair clustering in polynomial time by Theorem 23. (cid:54) 1 + ε, it suffices to return any fair clustering by Theorem 40. (d2−d)n+2dm Else, if (d2−5d+4)n+2dm Otherwise, we have d (cid:62) 5 and 1 + ε < (cid:0)d2 − d(cid:1) n + 2dm (d2 − 5d + 4) n + 2dm (cid:0)d2 − d(cid:1) n (d2 − 5d) n < = d − 1 d − 5 . It follows that, d − 5 + dε − 5ε < d − 1, which simplifies to d < 4 ε + 5. Hence, by Theorem 23, we find a minimum-cost fair clustering in time in O(nf (ε)) for some computable function f independent from n. In all cases, we find a fair clustering with a cost of at most 1 + ε times the minimum Correlation Clustering cost and take time in O(nf (ε)), giving a PTAS. To show that f is in fact bounded by a polynomial in 1/ε, we only need to look at the third case (otherwise f is constant). The bound d < 4 i=1 ci together imply the the number of colors k is constant w.r.t. n. Under this condition, the exponent of the (cid:74) running time in Theorem 23 is a polynomial in d and thus in 1/ε. ε + 5 and d = Pk References 1 2 3 Saba Ahmadi, Sainyam Galhotra, Barna Saha, and Roy Schwartz. Fair correlation clustering. CoRR, arXiv:2002.03508, 2020. ArXiv preprint. URL: https://arxiv.org/abs/2002.03508. Sara Ahmadian, Alessandro Epasto, Ravi Kumar, and Mohammad Mahdian. Fair correlation clustering. In Proceedings of the 23rd Conference on Artificial Intelligence and Statistics (AIS- TATS), page 4195–4205, 2020. URL: https://proceedings.mlr.press/v108/ahmadian20a. html. Sara Ahmadian and Maryam Negahbani. Improved approximation for fair correlation clustering. CoRR, abs/2206.05050, 2022. doi:10.48550/arXiv.2206.05050. 4 Nir Ailon, Moses Charikar, and Alantha Newman. Aggregating inconsistent information: Ranking and clustering. Journal of the ACM, 55(5):23:1–23:27, 2008. doi:10.1145/1411509. 1411513. 5 Noga Alon. Splitting necklaces. Advances in Mathematics, 63(3):247–253, 1987. doi:10.1016/ 0001-8708(87)90055-7. 6 Noga Alon and Douglas B. West. The Borsuk-Ulam theorem and bisection of necklaces. Proceedings of the American Mathematical Society, 98(4):623–628, 1986. doi:10.2307/2045739. Casel, Friedrich, Schirneck & Wietheger 53 7 Sayan Bandyapadhyay, Fedor V. Fomin, and Kirill Simonov. On coresets for fair clustering in metric and euclidean spaces and their applications. In Proceedings of the 48th International Colloquium on Automata, Languages, and Programming (ICALP), pages 23:1–23:15, 2021. doi:10.4230/LIPIcs.ICALP.2021.23. 8 Nikhil Bansal, Avrim Blum, and Shuchi Chawla. Correlation clustering. Machine Learning, 9 56(1–3):89–113, 2004. doi:10.1023/B:MACH.0000033116.57574.95. Lucas Bastos, Luiz Satoru Ochi, Fábio Protti, Anand Subramanian, Ivan César Martins, and Rian Gabriel S. Pinheiro. Efficient algorithms for cluster editing. Journal of Combinatorial Optimization, 31(1):347–371, 2016. doi:10.1007/s10878-014-9756-7. 10 Amir Ben-Dor, Ron Shamir, and Zohar Yakhini. Clustering gene expression patterns. Journal 14 15 13 11 12 of Computational Biology, 6(3–4):281–297, 1999. doi:10.1089/106652799318274. Suman K. Bera, Deeparnab Chakrabarty, Nicolas J. Flores, and Maryam Negahbani. Fair algorithms for clustering. In Proceedings of the 33rd Conference on Neural Information Processing Systems (NeurIPS), page 4954–4965, 2019. Ioana Oriana Bercea, Martin Gross, Samir Khuller, Aounon Kumar, Clemens Rösner, Daniel R. Schmidt, and Melanie Schmidt. On the cost of essentially fair clusterings. In Proceedings of the 2019 Conference on Approximation for Combinatorial Optimization Problems and the 2019 Conference on Randomization in Computation (APPROX/RANDOM), volume 145 of LIPIcs, pages 18:1–18:22, 2019. Francesco Bonchi, David García-Soriano, and Francesco Gullo. Correlation Clustering. Morgan & Claypool Publishers, 2022. doi:10.2200/S01163ED1V01Y202201DMK019. Paul Simon Bonsma, Thomas Epping, and Winfried Hochstättler. Complexity results on restricted instances of a paint shop problem for words. Discrete Applied Mathematics, 154(9):1335–1343, 2006. doi:10.1016/j.dam.2005.05.033. Sebastian Böcker and Jan Baumbach. Cluster editing. In Proceedings of the 9th Conference on Computability in Europe (CiE), page 33–44, 2013. doi:10.1007/978-3-642-39053-1_5. 16 Moses Charikar, Venkatesan Guruswami, and Anthony Wirth. Clustering with qualitative information. Journal of Computer and System Sciences, 71(3):360–383, 2005. doi:10.1016/j. jcss.2004.10.012. Shuchi Chawla, Konstantin Makarychev, Tselil Schramm, and Grigory Yaroslavtsev. Near optimal LP rounding algorithm for correlation clustering on complete and complete k-partite graphs. In Proceedings of the 47th Symposium on Theory of Computing (STOC), page 219–228, 2015. doi:10.1145/2746539.2746604. Li Chen, Rasmus Kyng, Yang P. Liu, Richard Peng, Maximilian Probst Gutenberg, and Sushant Sachdeva. Maximum Flow and Minimum-Cost Flow in Almost-Linear Time. In Proceedings of the 63rd Symposium on Foundations of Computer Science (FOCS), pages 612–623, 2022. doi:10.1109/FOCS54457.2022.00064. Flavio Chierichetti, Ravi Kumar, Silvio Lattanzi, and Sergei Vassilvitskii. Fair clustering through fairlets. In Proceedings of the 31st Conference on Neural Information Processing Systems (NeurIPS), page 5036–5044, 2017. 17 18 19 20 Vincent Cohen-Addad, Euiwoong Lee, and Alantha Newman. Correlation Clustering with Sherali-Adams. In Proceedings of the 63rd Symposium on Foundations of Computer Science (FOCS), pages 651–661. IEEE, 2022. doi:10.1109/FOCS54457.2022.00068. 21 Marek Cygan, Marcin Mucha, Karol Węgrzycki, and Michał Włodarczyk. On problems equivalent to (min,+)-convolution. ACM Transactions on Algorithms, 15(1):14:1–14:25, 2019. doi:10.1145/3293465. Julien Darlay, Nadia Brauner, and Julien Moncel. Dense and sparse graph partition. Discrete Applied Mathematics, 160(16):2389–2396, 2012. doi:10.1016/j.dam.2012.06.004. 22 23 Michael Dinitz, Aravind Srinivasan, Leonidas Tsepenekas, and Anil Vullikanti. Fair disaster containment via graph-cut problems. In Proceedings of the 25th Conference on Artificial Intelligence and Statistics (AISTATS), page 6321–6333, 2022. URL: https://proceedings. mlr.press/v151/dinitz22a.html. 54 Fair Correlation Clustering 24 25 Thomas Epping, Winfried Hochstättler, and Peter Oertel. Complexity results on a paint shop problem. Discrete Applied Mathematics, 136:2-3:217–226, 2004. doi:10.1016/S0166-218X(03) 00442-6. Seyed A. Esmaeili, Brian Brubach, Leonidas Tsepenekas, and John P. Dickerson. Probabilistic fair clustering. In Proceedings of the 34th Conference on Neural Information Processing Systems (NeurIPS), page 12743–12755, 2020. 26 Michael Feldman, Sorelle A. Friedler, John Moeller, Carlos Scheidegger, and Suresh Venkata- subramanian. Certifying and removing disparate impact. In Proceedings of the 21th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), page 259–268, 2015. doi:10.1145/2783258.2783311. 27 Andreas E. Feldmann and Luca Foschini. Balanced partitions of trees and applications. 28 Algorithmica, 71(2):354–376, 2015. doi:10.1007/s00453-013-9802-3. Zachary Friggstad and Ramin Mousavi. Fair correlation clustering with global and local guarantees. In Proceedings of the 2021 Workshop on Algorithms and Data Structures (WADS), page 414–427, 2021. doi:10.1007/978-3-030-83508-8_30. 29 Michael R. Garey and David S. Johnson. Computers and intractability: A guide to the theory 30 31 of NP-completeness. W. H. Freeman, 1979. Jonggyu Jang and Hyun Jong Yang. α-Fairness-maximizing user association in energy- constrained small cell networks. IEEE Transactions on Wireless Communications, 21(9):7443– 7459, 2022. doi:10.1109/TWC.2022.3158694. Suchi Kumari and Anurag Singh. Fair end-to-end window-based congestion control in time- varying data communication networks. International Journal of Communication Systems, 32(11), 2019. doi:10.1002/dac.3986. 32 Dana Pessach and Erez Shmueli. A review on fairness in machine learning. ACM Computing 33 Surveys, 55(3):51:1–51:44, 2022. doi:10.1145/3494672. Simon Régnier. Sur quelques aspects mathématiques des problèmes de classification automa- tique. Mathématiques et Sciences Humaines, 82:31–44, 1983. 34 Melanie Schmidt, Chris Schwiegelshohn, and Christian Sohler. Fair coresets and streaming algorithms for fair k-means. In Proceedings of the 17th Workshop on Approximation and Online Algorithms (WAOA), page 232–251, 2020. doi:10.1007/978-3-030-39479-0_16. 35 Roy Schwartz and Roded Zats. Fair correlation clustering in general graphs. In Proceedings of the 2022 Conference on Approximation for Combinatorial Optimization Problems and the 2022 Conference on Randomization in Computation (APPROX/RANDOM), pages 37:1–37:19, 2022. doi:10.4230/LIPIcs.APPROX/RANDOM.2022.37. 36 Xiao Xin. An FPT algorithm for the correlation clustering problem. Key Engineering Materials, 37 38 474–476:924–927, 2011. doi:10.4028/www.scientific.net/KEM.474-476.924. Charles T. Zahn, Jr. Approximating symmetric relations by equivalence relations. Journal of the Society for Industrial and Applied Mathematics, 12(4):840–847, 1964. doi:10.1137/0112071. Imtiaz Masud Ziko, Jing Yuan, Eric Granger, and Ismail Ben Ayed. Variational fair clus- tering. In Proceedings of the 35th AAAI Conference on Artificial Intelligence (AAAI), page 11202–11209, 2021. doi:10.1609/aaai.v35i12.17336.
http://arxiv.org/abs/2302.11294v3
2023-10-27T06:25:17
2023-02-22T11:26:50
Distributional Learning of Variational AutoEncoder: Application to Synthetic Data Generation
The Gaussianity assumption has been consistently criticized as a main limitation of the Variational Autoencoder (VAE) despite its efficiency in computational modeling. In this paper, we propose a new approach that expands the model capacity (i.e., expressive power of distributional family) without sacrificing the computational advantages of the VAE framework. Our VAE model's decoder is composed of an infinite mixture of asymmetric Laplace distribution, which possesses general distribution fitting capabilities for continuous variables. Our model is represented by a special form of a nonparametric M-estimator for estimating general quantile functions, and we theoretically establish the relevance between the proposed model and quantile estimation. We apply the proposed model to synthetic data generation, and particularly, our model demonstrates superiority in easily adjusting the level of data privacy.
[ "Seunghwan An", "Jong-June Jeon" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11294v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11294v3", "@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" ]
3 2 0 2 t c O 7 2 ] L M . t a t s [ 3 v 4 9 2 1 1 . 2 0 3 2 : v i X r a Distributional Learning of Variational AutoEncoder: Application to Synthetic Data Generation Seunghwan An and Jong-June Jeon∗ Department of Statistical Data Science, University of Seoul, S. Korea {dkstmdghks79, jj.jeon}@uos.ac.kr Abstract The Gaussianity assumption has been consistently criticized as a main limitation of the Variational Autoencoder (VAE) despite its efficiency in computational modeling. In this paper, we propose a new approach that expands the model capacity (i.e., expressive power of distributional family) without sacrificing the computational advantages of the VAE framework. Our VAE model's decoder is composed of an infinite mixture of asymmetric Laplace distribution, which possesses general distribution fitting capabilities for continuous variables. Our model is represented by a special form of a nonparametric M-estimator for estimating general quantile functions, and we theoretically establish the relevance between the proposed model and quantile estimation. We apply the proposed model to synthetic data generation, and particularly, our model demonstrates superiority in easily adjusting the level of data privacy. 1 Introduction Variational Autoencoder (VAE) [31, 51] and Generative Adversarial Networks (GAN) [22] are generative models that are used to estimate the underlying distribution of a given dataset. To avoid the curse of dimensionality, VAE and GAN commonly introduce a low-dimensional latent space on which a conditional generative model is defined. By minimizing an information divergence between the original data and its generated data, the generative models are learned to produce synthetic data similar to the original one. Accordingly, VAE and GAN have been applied in various applications, such as generating realistic images, texts, and synthetic tabular data for privacy preservation purposes [30, 60, 63, 65, 34]. However, the difference in the strength of the assumption about the generative distribution brings significant contrasts in the VAE and GAN generation performances [30, 7, 17]. In the GAN frame- work, the adversarial loss enables direct minimization of the Jensen-Shannon divergence between the ground-truth density function and the generative distribution under no distributional assumption [13, 59]. Roughly speaking, the GAN employs a nonparametric model as its conditional generative model defined on the latent space. On the contrary, in the VAE framework, the Gaussianity assumption has been favored [31, 32, 15, 10, 39]. It is because Gaussianity gives us three advantages: 1) the reconstruction loss can be interpreted as the mean squared error that is one of the most popular losses in optimization theory, 2) generating a new sample is computationally straightforward, and 3) KL-divergence is computed in a simple closed form. However, these benefits have led us to pay the price for the distributional capacity of the generative model, in that the generative model of the VAE is constrained in the form of marginalization of the product of the two Gaussian distributions. Here, the distributional capacity means the expressive power of the distributional family. This restricted distributional capacity has ∗Corresponding author. 37th Conference on Neural Information Processing Systems (NeurIPS 2023). been the critical limitation [8, 33] and leads to a heavy parameterization of the decoder mean vector to approximate complex underlying distributions. To increase the distributional capacity in synthetic data generation, [63, 65] introduce the multi- modality in the distributional assumption of the decoder, which is known as the mode-specific normalization technique. Although the mixture Gaussian decoder modeling of [63, 65] allows handling more complex distributions of the observed dataset while preserving all of the advantages of Gaussianity, we numerically find that the mixture Gaussian is not enough to capture the complex underlying distribution. Our main contribution is that, beyond Gaussianity, we propose a novel VAE learning method that directly estimates the conditional cumulative distribution function (CDF) while maintaining the objective of maximizing the Evidence Lower Bound (ELBO) of the observed dataset. It implies that we have a nonparametric distribution assumption on the generative model. We call this approach distributional learning of the VAE, which is enabled by estimating an infinite number of conditional quantiles [4, 20]. By adopting the continuous ranked probability score (CRPS) loss, the objective function of our proposed distribution learning method is computationally tractable [21, 43, 20]. In our proposed distributional learning framework, 1) the reconstruction loss is equivalent to the CRPS loss, which is a proper scoring rule [21, 43], 2) generating a new sample is still computationally straightforward due to the inverse transform sampling, and 3) KL-divergence is still computed in a simple closed form. To show the effectiveness of our proposed model in capturing the underlying distribution of the dataset, we evaluate our model for synthetic data generation with real tabular datasets. 2 Related Work Modeling of the decoder and reconstruction loss. To increase the distributional capacity, many papers have focused on decoder modeling while not losing the mathematical link to maximize the ELBO. [57, 1] assume their decoder distributions as Student-t and asymmetric Laplace distributions, respectively, to mitigate the zero-variance problem that the model training becomes unstable if the estimated variance of the decoder shrinks to zero in Gaussian VAE [41, 55, 15]. [2] proposes a general distribution of the decoder, which allows improved robustness by optimizing the shape of the loss function during training. Recently, [5] proposes a reconstruction loss that directly minimizes the blur error of the VAE by modeling the covariance matrix of multivariate Gaussian decoder. On the other hand, there exists a research direction that focuses on replacing the reconstruction loss without concern for losing the mathematical derivation of the lower bound. [38, 52, 46] replace the reconstruction loss with an adversarial loss of the GAN framework. [27] introduces a feature-based loss that is calculated with a pre-trained convolutional neural network (CNN). Another approach by [14] adopts Watson's perceptual model, and [28] directly optimizes the generative model in the frequency domain by a focal frequency reconstruction loss. Most of the above-mentioned methods aim to capture the properties of human perception by replacing the element-wise loss (L1 or L2-norm), which hinders the reconstruction of images [38]. Synthetic data generation. The GAN framework is widely adopted in the synthetic data generation task since it enables synthetic data generation in a nonparametric approach [12, 47, 63, 65]. [63, 65] assume that continuous columns of tabular datasets can be approximated by the Gaussian mixture distribution and model their decoder using Gaussian mixture distribution. Additionally, [63, 65] preprocess the continuous variables using the variational Gaussian mixture model [3], which is known as the mode-specific normalization technique. However, the preprocessing step requires additional computational resources and hyperparameter tuning of the number of modes. Other approaches by [47, 65] regularize the discrepancy between the first and second-order statistics of the observed and synthetic dataset. [12] proposes the GAN-based synthesizer, which focuses on generating high-dimensional discrete variables with the assistance of the pre-trained AutoEncoder. 3 Proposal Let x ∈ Rp+q be an observation consisting of continuous and discrete variables and I = IC ∪ ID = {1, * * * , (p + q)} be an index set of the variables, where IC and ID correspond to index sets of 2 p continuous and q discrete variables. Tj denotes the number of levels for the discrete variables xj, j ∈ ID. We denote the ground-truth underlying distribution (probability density function, PDF) as p(x) and the ground-truth CDF as F (x). Let z be a latent variable, where z ∈ Rd and d < p + q. The prior and posterior distribution of z are assumed to be p(z) = N (z|0, I) and q(z|x; φ) = N (cid:0)z|μ(x; φ), diag(σ2(x; φ))(cid:1), respectively. Here, I is d × d identity matrix, μ : Rp+q (cid:55)→ Rd, σ2 : Rp+q (cid:55)→ Rd + are neural networks parameterized with φ, and diag(a), a ∈ Rd denotes a diagonal matrix with diagonal elements a. Moreover, we consider α ∈ [0, 1] as a random variable having density p(α). 3.1 Distributional Learning Our proposed model assumes that p(x) is parametrized by an infinite mixture of asymmetric Laplace distribution (ALD) [4]. The ALD is characterized by two parameters: α, representing the asymmetry, and β > 0, representing the scale. By considering these parameters, along with the model parameter θ, we can define the probability model of x as follows: p(x; θ, β) = (cid:90) (cid:90) 1 0 p(x|z, α; θ, β)p(z, α)dαdz. Assumption 1. (1) {xj}j∈I are conditionally independent given z. (2) The discrete random variables {xj}j∈ID are independent of α. (3) α and z are independent. By Assumption 1-(1), we model the dependency between xjs solely through the latent variable z [49]. Assumption 1-(2) implies that α is related only to the continuous variables. Then, the decoder of our VAE model denoted as p(x|z, α; θ, β) is specified by equation (1): p(x|z, α; θ, β) = = (cid:89) j∈IC (cid:89) j∈IC p(xj|z, α; θj, β) * (cid:89) j∈ID p(xj|z; θj) (1) α(1 − α) β (cid:18) exp −ρα (cid:18) xj − Dj(α, z; θj) β (cid:19)(cid:19) * (cid:89) Tj (cid:89) j∈ID l=1 πl(z; θj)I(xj =l), where θ = (θ1, * * * , θp+q), β is a non-trainable constant, ρv(u) = u(v − I(u < 0)) (check function), and I(*) denotes the indicator function. Dj(*, *; θj) : [0, 1] × Rd (cid:55)→ R is the location parameter of ALD, which is parameterized with θj [1]. For discrete variables, π(*; θj) : Rd (cid:55)→ ∆Tj −1 is a neural network parameterized with θj, where ∆Tj −1 is the standard (Tj − 1)-simplex for all z ∈ Rd, and the subscript l referes to the lth element of the output π. Assumption 1-(3) leads our objective function, min θ,φ Ep(x)Eq(z|x;φ) (cid:90) 1 (cid:88) (cid:16) ρα xj − Dj(α, z; θj) (cid:17) dα −   j∈IC 0 + β * Ep(x)[KL(q(z|x; φ)∥p(z))],  I(xj = l) * log πl(z; θj)  (cid:88) Tj (cid:88) j∈ID l=1 (2) where constant terms are omitted. In order to achieve balanced learning of the two reconstruction losses in (2), we have removed the weight β associated with the second reconstruction loss. We refer to our model as 'DistVAE.' The first term in (2) corresponds to the CRPS loss, which measures the accuracy of the proposed CDF approximation with respect to the ground-truth CDF of the underlying distribution [21, 43, 20]. Interestingly, (2) is the limit of the negative ELBO derived from a finite mixture of ALD. We introduce α, a discrete uniform random variable taking values on αk = k/K for k = 1, * * * , K. Then, the negative ELBO of p(x; θ, β) scaled with β is written by Eq(z|x;φ)   (cid:88) j∈IC  1 K − β * Eq(z|x;φ)  (cid:88) K (cid:88) k=1 Tj (cid:88) j∈ID l=1 (cid:16) ραk xj − Dj(αk, z; θj) (cid:17)   − β p K K (cid:88) k=1  log αk(1 − αk) + βp log β I(xj = l) * log πl(z; θj)  + β * KL(q(z|x; φ)∥p(z)) (3) 3 (see Appendix A.1 for detailed derivation). The reconstruction loss, which corresponds to the first term of (3), is a composite quantile loss for estimating the target quantiles αks [64, 35, 45, 62, 9]. This entails adopting a Bayesian perspective for α as a prior (the Bayesian modeling for estimating multiple quantiles). Furthermore, throughout the derivation of the reconstruction loss, the role of α is pivotal in ensuring the representation of the reconstruction loss. To prevent the observation x from influencing the distribution of α, α is only assigned with a prior distribution, and the resulting reconstruction loss becomes the CRPS loss, a proper scoring rule. However, for distributional learning of VAE, it is necessary to estimate conditional quantiles for an infinite number of quantile levels, denoted by K → ∞ [50]. The subsequent Theorem 1 establishes the convergence of the negative ELBO (3) to our objective function (2) as K → ∞ [4]. Theorem 1. For all j ∈ IC, suppose that (cid:82) 1 Ep(x)Eq(z|x;φ)[ρα(xj − Dj(α, z; θj))] is continuous over α ∈ (0, 1). Then, (cid:0)xj − Dj(α, z; θj)(cid:1)dα < ∞, and Ep(x)Eq(z|x;φ)ρα 0 lim K→∞ Ep(x)Eq(z|x;φ) (cid:34) 1 K K (cid:88) k=1 (cid:16) ραk xj − Dj(αk, z; θj) (cid:17) (cid:35) = Ep(x)Eq(z|x;φ) (cid:20)(cid:90) 1 (cid:16) ρα 0 xj − Dj(α, z; θj) (cid:17) (cid:21) dα , and limK→∞ 1 K (cid:80)K k=1 log αk(1 − αk) = (cid:82) 1 0 log α(1 − α)dα = −2. 3.2 Theoretical Results In this section, we aim to provide theoretical insights into the ability of DistVAE, utilizing the objective function (2), to recover the ground-truth distribution p(x). To simplify the analysis without loss of generality, we consider the scenario where x comprises only p continuous random variables. Hence, we have I = IC = {1, * * * , p}, and p(x) is defined over x ∈ Rp with p(x) > 0 for all x ∈ Rp. First, define a function q(x|z; φ) by q(x|z; φ) := p(x)q(z|x; φ) q(z; φ) , where q(z; φ) := (cid:82) q(z|x; φ)p(x)dx is the aggregated posterior [58]. Clearly, q(x|z; φ) is a PDF of x for a given z. q(x|z; φ) is a conditional PDF of x parametrized by φ and it is an approximated PDF of (cid:82) 1 0 p(x|z, α; θ, β)dα. Since we assume that xjs are conditionally independent in Assumption 1, q(x|z; φ) = (cid:81)p j=1 qj(xj|z; φ) and the conditional CDF is written as F (x|z; φ) = p (cid:89) j=1 Fj(xj|z; φ), where Fj(xj|z; φ) := (cid:90) xj −∞ qj(x|z; φ)dx. (4) For notational simplicity, we let θ∗(φ) ∈ arg min θ Ep(x)q(z|x;φ) p (cid:88) (cid:90) 1 j=1 0 ρα(xj − Dj(α, z; θj))dα, p(φ)). 1(φ), * * * , θ∗ where θ∗(φ) = (θ∗ Assumption 2. (1) Given an arbitrary φ, Fj(*|z; φ) : R (cid:55)→ [0, 1] is absolutely continuous and strictly monotone increasing for all j = 1, * * * , p, and z ∈ Rd. (2) Given an arbitrary θ, Dj(*, z; θj) is invertible and differentiable for all j = 1, * * * , p and z ∈ Rd. (3) The aggregated posterior q(*; φ) is absolutely continuous to the prior distribution of z. Theorem 2. Under Assumption 2, for an arbitrary φ,  KL p(x) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:90) p (cid:89) j=1 d dxj D−1 j (xj, z; θ∗ j (φ))q(z; φ)dz   = 0. Theorem 2 shows that DistVAE is capable of recovering the ground-truth distribution p(x), indicating its ability to facilitate distributional learning rather than data reconstruction. Nevertheless, relying on the aggregated posterior distribution may lead to overfitting [25, 42], and sampling from the 4 aggregated posterior can introduce computational challenges due to the absence of a straightforward closed-form representation for q(z; φ). To address these concerns, we propose an alternative approach that leverages the prior distribution p(z) instead of q(z; φ), thereby enabling a computationally efficient synthetic generation process. This is substantiated by Theorem 3. We define the estimated PDF ˆp(x; θ∗(φ)) and CDF ˆF (x; θ∗(φ)) as ˆp(x; θ∗(φ)) := ˆF (x; θ∗(φ)) := (cid:90) p (cid:89) j=1 (cid:90) p (cid:89) j=1 d dxj D−1 j (xj, z; θ∗ j (φ))p(z)dz D−1 j (xj, z; θ∗ j (φ))p(z)dz. (5) (6) Theorem 3. Suppose that φ is given such that KL(q(z; φ)∥p(z)) < ε for any ε > 0. Then, under Assumption 2,  KL p(x) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:90) p (cid:89) j=1 d dxj D−1 j (xj, z; θ∗ j (φ))p(z)dz   < ε. Theorem 3 shows that even if we use the prior distribution p(z) instead of the aggregated posterior q(z; φ), it is feasible to minimize the KL-divergence between the ground-truth PDF p(x) and our estimated PDF ˆp(x; θ∗(φ)) of (5). This is achievable because the KL-divergence term in (2) is the upper bound of KL(q(z; φ)∥p(z)) and is minimized during the training process. Since each conditional distribution of the estimated PDF depends on the same latent variable, it can be seen that the correlation structure between covariates is modeled implicitly. [24, 41, 37] have highlighted the role of the KL-divergence weight parameter β in controlling the precision of reconstruction. In our case, where the reconstruction loss is based on the CRPS loss, an increase in β leads to a less accurate estimation of the ground-truth CDF. It implies that a large β corresponds to lower-quality synthetic data, but it also enhances privacy level. Thus, β introduces a trade-off between the quality of synthetic data and the risk of privacy leakage. The privacy level can be adjusted by manipulating β [47], as demonstrated in the experimental results presented in Section 4. 3.2.1 Synthetic Data Generation By estimating the conditional quantile functions, we can transform the synthetic data generation process into inverse transform sampling. This conversion offers a notable advantage as it provides a straightforward and efficient approach to generating synthetic data. We denote a synthetic sample of xj as ˆxj for j ∈ I, and the synthetic data generation process can be summarized as follows: 1. Sampling from the prior distribution: z ∼ p(z). 2. Inverse transform sampling: For j ∈ IC, ˆxj = Dj(uj|z; θj), where uj ∼ U (0, 1). 3. Gumbel-Max trick [23]: For j ∈ ID, ˆxj = arg maxl=1,*** ,Tj {log πl(z; θj) + Gl}, where Gl ∼ Gumbel(0, 1), and l = 1, * * * , Tj. Note that both continuous and discrete variables share the same latent variable z. This shared latent variable allows for capturing the dependencies between variables. We numerically observe that the sampling, implemented using the Gumbel-Max trick, maintains the imbalanced ratio of the labels in the discrete variable. 3.2.2 Parameterization of ALD As introduced in [20], for j ∈ IC, we parameterize the function Dj, the location parameter of ALD, by a linear isotonic spline as follows: Dj(α, z; θj) = γ(j)(z) + M (cid:88) m=0 b(j) m (z)(α − dm)+ s.t. k (cid:88) m=0 b(j) m (z) ≥ 0, k = 1, * * * , M, (7) 5 0 (z), * * * , b(j) where γ(j)(z) ∈ R, b(j)(z) = (b(j) M (z)) ∈ RM +1, d = (d0, * * * , dM ) ∈ [0, 1]M +1, 0 = d0 < * * * < dM = 1, and (u)+ := max(0, u). θj is a neural network parameterized mapping such that θj : Rd (cid:55)→ R × RM +1, which takes z as input and outputs γ(j)(z) and b(j)(z). The constraint is introduced to ensure monotonicity. As demonstrated in [20], the reconstruction loss can be computed in a closed form by utilizing the parameterization of (7) (refer to Appendix A.5 for a detailed description of the loss function). This implies that our objective function (2) is computationally tractable. Note that the linear isotonic spline is not differentiable for finite points where the measure has no point mass. 4 Experiments 4.1 Overview Dataset. For evaluation, we consider following real tabular datasets: covertype, credit, loan, adult, cabs, and kings (see Appendix A.8 for detailed data descriptions). We treat the ordinal variables as continuous variables and discretize the estimated CDF (see Appendix A.6 for the discretization algorithm). Synthetic samples of ordinal variables are rounded to the first decimal place. Compared models. We compare DistVAE† with the state-of-the-art synthesizers; CTGAN [63], TVAE [63], and CTAB-GAN [65]. All models have the same size of the latent dimension (d = 2). The chosen latent space indeed limits the capacity of decoders for all models. However, we maintain a small and consistent number of parameters across all models during the experiment to isolate the performance differences in synthetic data generation to the methodologies of each synthesizer, specifically emphasizing the contribution of the decoder model's flexibility in estimating underlying distributions (see Table 10 in Appendix A.9 for a comprehensive comparison of the model parameters). 4.2 Evaluation Metrics To assess the quality of the synthetic data, we employ three types of assessment criteria: 1) machine learning utility, 2) statistical similarity, and 3) privacy preservability. Each criterion is evaluated using multiple metrics, and the performance of synthesizers is reported by averaged metrics over the real tabular datasets. The synthetic dataset is generated to have an equal number of samples as the real training dataset. Machine learning utility. The machine learning utility (MLu) is measured by the predictive performance of the trained model over the synthetic data. We consider three popular machine learning algorithms: linear (logistic) regression, Random Forest [6], and Gradient Boosting [19]. We measure the performance by utilizing the mean absolute relative error (MARE) for regression tasks [47] and the F1 score for classification tasks [63, 65, 61, 29, 47, 12, 18]. Statistical similarity. The marginal distributional similarity between the real training and synthetic datasets is evaluated using two metrics: the Kolmogorov statistic and the 1-Wasserstein distance [18]. These metrics measure the distance between the empirical marginal CDFs [40]. The joint distributional similarity is assessed by comparing the correlation matrices [65]. To compute the correlation matrix and measure the L2 distance between the correlation matrices of the real training and synthetic datasets, we employ the dython library ‡. These enable a comprehensive evaluation of both marginal and joint distributional similarities between the real training and synthetic datasets. Privacy preservability. The privacy-preserving capacity is measured using three metrics: the distance to closest record (DCR) [47, 65], membership inference attack [54, 12, 47], and attribute disclosure [12, 44]. As in [65], the DCR is defined as the 5th percentile of the L2 distances between all real training samples and synthetic samples. Since the DCR is a L2 distance-based metric, it is computed using only continuous variables. A higher DCR value indicates a more effective preservation of privacy, indicating a lack of overlap between the real training data and the synthetic samples. Conversely, an excessively large DCR score suggests a lower quality of the generated synthetic dataset. Therefore, the DCR metric provides insights into both the privacy-preserving capability and the quality of the synthetic dataset. †We release the code at https://github.com/an-seunghwan/DistVAE. ‡http://shakedzy.xyz/dython/modules/nominal/#associations 6 The membership inference attack evaluation follows the steps detailed in Appendix A.7. The procedure is customized to be applied to a VAE-based synthesizer, such as DistVAE and TVAE. By transforming the problem into a binary classification task, we aim to identify the intricate relationship between the real training data and the synthetic samples. Higher binary classification scores indicate a higher vulnerability of the target synthesizer to membership inference attacks. Attribute disclosure refers to the situation where attackers can uncover additional covariates of a record by leveraging a subset of covariates they already possess, along with similar records from the synthetic dataset. To quantify the extent to which attackers can accurately identify these additional covariates, we employ classification metrics. Higher attribute disclosure metrics indicate an increased risk of privacy leakage, implying that attackers can precisely infer unknown variables. In terms of privacy concerns, attribute disclosure can be considered a more significant issue than membership inference attacks, as attackers are assumed to have access to only a subset of covariates for a given record [12]. 4.3 Results Machine learning utility. We expect a high-quality synthesizer to generate synthetic data with comparable predictive performance to the real training dataset, denoted as the 'Baseline' in Table 1. The results in Table 1 demonstrate that DistVAE achieves a competitive MARE score and outperforms other methods in terms of the F1 score. Furthermore, the performance of MLu improves as the value of β decreases, indicating that the quality of the generated synthetic data is controlled by β. For a comprehensive overview of the MLu scores for all tabular datasets, please refer to Appendix A.10. Table 1: Averaged MLu metrics (MARE, F1). Mean and standard deviation values are obtained from 10 repeated experiments. ↑ denotes higher is better and ↓ denotes lower is better. Model MARE ↓ Baseline CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) 0.150±0.200 0.321±0.271 0.225±0.215 0.403±0.392 0.349±0.328 0.344±0.316 0.392±0.348 F1 ↑ 0.814±0.101 0.672±0.234 0.594±0.295 0.702±0.162 0.769±0.128 0.762±0.134 0.679±0.190 Table 2: Averaged correlation structural similarity. 'CorrDist' represents L2 dis- tance between the correlation matrices of synthetic and real training datasets. Mean and standard deviation values are obtained from 10 repeated experiments. Lower is better. Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) CorrDist 2.180±0.467 2.739±0.796 2.575±0.513 1.473±0.398 1.730±0.548 3.113±1.119 Statistical similarity. The evaluation results for joint and marginal distributional similarities are presented in Table 2 and 3. In Table 2, DistVAE achieves the lowest CorrDist score, indicating its ability to accurately preserve the correlation structure of the real training dataset in the generated synthetic dataset. Furthermore, DistVAE surpasses other methods in Table 3 when it comes to marginal distributional similarity, suggesting that it successfully captures the underlying distribution of the observed dataset. Notably, reducing the value of β leads to an enhancement in the quality of the synthetic dataset, as evidenced by improvements in the correlation structure and similarity of the marginal distributions. Figure 1 provides visualizations of the estimated CDFs (6) for each continuous (or ordinal) variable in the cabs dataset. For detailed statistical similarity scores and additional visualizations of estimated CDFs for all tabular datasets, please refer to Appendix A.10. Privacy preservability. The privacy preservability performances of synthesizers, as measured by the DCR, are presented in Table 4. DistVAE performs best in preserving privacy, with the highest DCR values compared to other methods. Notably, as the value of β increases in DistVAE, the DCR between the real training and synthetic datasets (R&S) also increases. This indicates that the risk of privacy leakage can be controlled by adjusting β, where higher values of β correspond to a higher level of privacy protection. Moreover, DistVAE consistently achieves large DCR values for the synthetic dataset (S) across all β values, indicating its ability to generate diverse synthetic samples. On the other hand, CTAB-GAN generates duplicated records in the synthetic dataset, resulting in 7 Table 3: Averaged marginal distributional similarity. K-S denotes the Kolmogorov-Smirnov statistic, and 1-WD represents the 1-Wasserstein distance. Mean and standard deviation values are obtained from 10 repeated experiments. Lower is better. Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) Continuous Discrete K-S 1-WD K-S 1-WD 0.133±0.106 0.196±0.135 0.157±0.089 0.090±0.065 0.081±0.039 0.092±0.037 0.087±0.025 0.220±0.099 0.130±0.037 0.075±0.026 0.083±0.019 0.121±0.058 0.168±0.195 0.385±0.144 0.106±0.083 0.030±0.017 0.027±0.021 0.059±0.034 0.521±0.532 1.681±1.668 0.412±0.378 0.118±0.100 0.116±0.110 0.241±0.163 Figure 1: cabs dataset. Empirical (solid orange) and estimated (dashed blue) CDFs of continuous and ordinal variables (Monte Carlo approximated with 5000 samples). We standardize covariates and remove observations outside the 1% and 99% percentile range. relatively lower DCR scores for the synthetic dataset (S). For detailed DCR scores for all tabular datasets, please refer to Appendix A.10. Table 4: Privacy preservability: Averaged distance to closest record (DCR) between real training and synthetic datasets (R&S), between the same real training datasets (R), and between the same synthetic datasets (S). Mean and standard deviation values are obtained from 10 repeated experiments. The DCR (R) score represents the baseline diversity of datasets. Higher is better. S Model R&S R CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) 0.426±0.229 0.470±0.181 0.508±0.259 0.444±0.250 0.463±0.282 0.517±0.272 0.237±0.153 0.237±0.153 0.237±0.153 0.237±0.153 0.237±0.153 0.237±0.153 0.356±0.202 0.278±0.195 0.039±0.073 0.463±0.288 0.479±0.310 0.511±0.335 To evaluate the membership inference attack, we prepare one attack model per class. The attack testing records comprise an equal number of real training and test records, distinguished by the labels in and out, respectively. Note that the test records are not employed in constructing the attack models. We employ gradient-boosting classifiers as the attack models, and for computational feasibility, we limit the number of attack models to one (i.e., C = 1). For the membership inference attack evaluation, we utilize accuracy and AUC (Area Under Curve) as the evaluation metrics. Since the target labels (in/out) are balanced, and the task is a binary classification problem, these metrics are appropriate. The results presented in Table 5 reveal that both DistVAE and TVAE achieve nearly identical accuracy and AUC scores of 0.5. This indicates that the attack models can not distinguish between members of the real training and test datasets. Consequently, the membership inference attack is unsuccessful for both models. Therefore, DistVAE effectively generates synthetic datasets while ensuring privacy against membership inference attacks. A comprehensive assessment of membership inference attack performances for all tabular datasets can be found in Appendix A.10. 8 Table 5: Privacy preservability: Averaged membership inference attack performance. Mean and standard deviation values are obtained from 10 repeated experiments. Model Accuracy AUC TVAE DistVAE(β = 0.5) 0.495±0.019 0.500±0.003 0.495±0.019 0.500±0.003 Table 6: Privacy preservability: Averaged attribute disclosure performance with the F1 score. Mean and standard deviation values are obtained from 10 repeated experiments. Lower is better. Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) Number of neighbors (k) 1 10 100 0.262±0.091 0.437±0.162 0.257±0.123 0.328±0.088 0.307±0.073 0.265±0.105 0.282±0.087 0.438±0.160 0.258±0.114 0.328±0.076 0.313±0.068 0.253±0.103 0.275±0.087 0.432±0.162 0.261±0.111 0.310±0.072 0.297±0.066 0.232±0.101 We present the attribute disclosure performance results in Table 6. For each value of k, we observe that as β increases, the F1 score of DistVAE decreases. Also, DistVAE achieves the smallest F1 score when k equals 10 and 100. Based on these results, we can conclude that DistVAE can generate synthetic datasets with a low risk of attribute disclosure, and the level of privacy preservation is controlled by β. Please refer to Appendix A.10 for a detailed evaluation of attribute disclosure performance for all tabular datasets. Quantile estimation. To investigate the quantile estimation performance, we also evaluate DistVAE I(xi < ˆQα), where using the Vrate(α) metric [11]. The Vrate(α) is defined as α ∈ (0, 1), Itest is the set of indices for the test dataset, xi is the i-th sample in the test dataset, and ˆQα is the empirical α-quantile of the synthetic data. Since Vrate(α) indicates the proportion of compliance samples in the test dataset, the Vrate(α) score should be close to α. 1 |Itest| i∈Itest (cid:80) Table 7: Averaged Vrate(α) and |α − Vrate(α)|. α 0.1 0.3 0.5 0.7 0.9 Vrate(α) |α − Vrate(α)| 0.204 0.104 0.373 0.083 0.533 0.04 0.725 0.032 0.908 0.008 The Vrate(α) evaluation results are presented in Table 7. Table 7 shows that the ratio of violated test samples (|α − Vrate(α)|) decreases as α increases, indicating a better performance for estimat- ing larger quantiles. However, the ratio of violated test samples is relatively large for smaller α values, which may be due to extremely skewed continuous variables, such as capital-gain and capital-loss from adult dataset, that make the quantile estimation unstable. 5 Conclusion and Limitations This paper introduces a novel distributional learning method of VAE, which aims to effectively capture the underlying distribution of the observed dataset using a nonparametric approach. Our proposed method involves directly estimating CDFs using the CRPS loss while maintaining the mathematical derivation of the lower bound. In our study, we confirm that the proposed decoder enhances the performance of generative models for tabular data. However, this conclusion relies on the assumption of conditional independence among the observed variables given the latent variable. When the dimension of the latent variable is small, this assumption is prone to violation. Therefore, in cases where the size of the latent 9 space is limited, the proposed nonparametric fitting of the decoder might not accurately represent the underlying distribution. Particularly in the image domain, where adjacent pixel values exhibit significant dependence, it remains uncertain whether our proposed model would lead to notable improvements in image data generation with a low-dimensional latent space. Nevertheless, classical image datasets, such as CIFAR-10 [36], often exhibit pixel value distributions that deviate considerably from Gaussian, with the frequencies of edge values (0 and 255) dominating more than other pixel values [16, 53]. Other image datasets, as presented in [48], demonstrate multi-modality in pixel value distributions. These experimental findings suggest that leveraging the capacity of distributional learning could be advantageous in approximating the ground-truth distribution of image data when the latent variable effectively captures conditional independence among the image pixels. Consequently, we expect that compromising biases arising from violating conditional independence and marginally misspecified distributions may further enhance our results, and we leave it for future research. On the other hand, we consider two approaches to enhance the performance of quantile estimation. Firstly, we plan to extend the parameterization of conditional quantile functions to a more flexible monotonic regression model. Secondly, we intend to incorporate the Uniform Pessimistic Risk (UPR) [26] into the VAE framework to handle lower quantile levels better. Furthermore, we are exploring the expansion of DistVAE into a time-series distributional forecasting model by adopting the conditional VAE framework [56]. This extension will enable the application of our method to time-series data, opening new avenues for distributional forecasting. Acknowledgments and Disclosure of Funding This work was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. NRF-2022R1A4A3033874 and No. NRF-2022R1F1A1074758). This work was also supported by Korea Environmental Industry & Technology Institute (KEITI) through 'Core Technology Development Project for Environmental Diseases Prevention and Man- agement', funded by Korea Ministry of Environment (MOE) (2021003310005). The authors ac- knowledge the Urban Big data and AI Institute of the University of Seoul supercomputing resources (http://ubai.uos.ac.kr) made available for conducting the research reported in this paper. References [1] Haleh Akrami, Anand Joshi, Sergul Aydore, and Richard Leahy. Deep quantile regression for uncertainty estimation in unsupervised and supervised lesion detection. Machine Learning for Biomedical Imaging, 1:1–23, 2022. [2] Jonathan T. Barron. A general and adaptive robust loss function. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 4326–4334, 2017. [3] David M. Blei, Alp Kucukelbir, and Jon D. McAuliffe. Variational inference: A review for statisticians. Journal of the American Statistical Association, 112:859 – 877, 2016. [4] Axel Brando, Jose A Rodriguez, Jordi Vitria, and Alberto Rubio Muñoz. Modelling heteroge- neous distributions with an uncountable mixture of asymmetric laplacians. Advances in neural information processing systems, 32, 2019. [5] Gustav Bredell, Kyriakos Flouris, Krishna Chaitanya, Ertunc Erdil, and Ender Konukoglu. Explicitly minimizing the blur error of variational autoencoders. In The Eleventh International Conference on Learning Representations, 2023. [6] Leo Breiman. Random forests. Machine learning, 45:5–32, 2001. [7] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In International Conference on Learning Representations, 2019. [8] Yuri Burda, Roger Baker Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. CoRR, abs/1509.00519, 2015. [9] Alex J. Cannon. Non-crossing nonlinear regression quantiles by monotone composite quantile regression neural network, with application to rainfall extremes. Stochastic Environmental Research and Risk Assessment, 32:3207–3225, 2018. 10 [10] Lluís Castrejón, Nicolas Ballas, and Aaron C. Courville. Improved conditional vrnns for video prediction. 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pages 7607–7616, 2019. [11] Cathy W.S. Chen, Richard Gerlach, Bruce B.K. Hwang, and Michael McAleer. Forecasting Value-at-Risk using nonlinear regression quantiles and the intra-day range. International Journal of Forecasting, 28(3):557–574, 2012. [12] E. Choi, Siddharth Biswal, Bradley A. Malin, Jon D. Duke, Walter F. Stewart, and Jimeng Sun. Generating multi-label discrete patient records using generative adversarial networks. In Machine Learning in Health Care, 2017. [13] Antonia Creswell, Tom White, Vincent Dumoulin, Kai Arulkumaran, Biswa Sengupta, and IEEE signal processing Anil A Bharath. Generative adversarial networks: An overview. magazine, 35(1):53–65, 2018. [14] Steffen Czolbe, Oswin Krause, Ingemar Cox, and Christian Igel. A loss function for generative neural networks based on watson's perceptual model. In Proceedings of the 34th International Conference on Neural Information Processing Systems, NIPS'20, Red Hook, NY, USA, 2020. Curran Associates Inc. [15] Bin Dai and David Wipf. Diagnosing and enhancing VAE models. In International Conference on Learning Representations, 2019. [16] Luke N Darlow, Elliot J Crowley, Antreas Antoniou, and Amos J Storkey. Cinic-10 is not imagenet or cifar-10. arXiv preprint arXiv:1810.03505, 2018. [17] Andrés Diaz-Pinto, Adrián Colomer, Valery Naranjo, Sandra Morales, Yanwu Xu, and Alejan- dro F Frangi. Retinal image synthesis for glaucoma assessment using dcgan and vae models. In Ideal, 2018. [18] Kevin Fang, Vaikkunth Mugunthan, Vayd Ramkumar, and Lalana Kagal. Overcoming challenges of synthetic data generation. 2022 IEEE International Conference on Big Data (Big Data), pages 262–270, 2022. [19] Jerome H Friedman. Greedy function approximation: a gradient boosting machine. Annals of statistics, pages 1189–1232, 2001. [20] Jan Gasthaus, Konstantinos Benidis, Yuyang Wang, Syama Sundar Rangapuram, David Salinas, Valentin Flunkert, and Tim Januschowski. Probabilistic forecasting with spline quantile function In The 22nd international conference on artificial intelligence and statistics, pages rnns. 1901–1910. PMLR, 2019. [21] Tilmann Gneiting and Adrian E. Raftery. Strictly proper scoring rules, prediction, and estimation. Journal of the American Statistical Association, 102:359 – 378, 2007. [22] Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron C. Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014. [23] Emil Julius Gumbel. Statistical theory of extreme values and some practical applications: a series of lectures, volume 33. US Government Printing Office, 1954. [24] Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-VAE: Learning basic visual concepts with a constrained variational framework. In International Conference on Learning Representations, 2017. [25] Matthew D Hoffman and Matthew J Johnson. Elbo surgery: yet another way to carve up the variational evidence lower bound. In Workshop in Advances in Approximate Bayesian Inference, NIPS, volume 1, 2016. [26] Sungchul Hong and Jong-June Jeon. Uniform pessimistic risk and optimal portfolio. ArXiv, abs/2303.07158, 2023. [27] Xianxu Hou, L. Shen, Ke Sun, and Guoping Qiu. Deep feature consistent variational autoencoder. 2017 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 1133–1141, 2016. [28] Liming Jiang, Bo Dai, Wayne Wu, and Chen Change Loy. Focal frequency loss for image reconstruction and synthesis. 2021 IEEE/CVF International Conference on Computer Vision (ICCV), pages 13899–13909, 2020. 11 [29] Sanket Kamthe, Samuel A. Assefa, and Marc Peter Deisenroth. Copula flows for synthetic data generation. ArXiv, abs/2101.00598, 2021. [30] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 4396–4405, 2018. [31] Diederik P. Kingma and Max Welling. Auto-Encoding Variational Bayes. In 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014. [32] Durk P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In Advances in neural information processing systems, pages 3581–3589, 2014. [33] Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016. [34] A Kiran and S Saravana Kumar. A comparative analysis of gan and vae based synthetic data generators for high dimensional, imbalanced tabular data. In 2023 2nd International Conference for Innovation in Technology (INOCON), pages 1–6. IEEE, 2023. [35] Roger W. Koenker, Limin Peng, Victor Chernozhukov, and Xuming He. Handbook of quantile regression. 2017. [36] Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009. [37] Abhishek Kumar and Ben Poole. On implicit regularization in β-vaes. In International Conference on Machine Learning, pages 5480–5490. PMLR, 2020. [38] Anders Boesen Lindbo Larsen, Søren Kaae Sønderby, Hugo Larochelle, and Ole Winther. Autoencoding beyond pixels using a learned similarity metric. In Maria Florina Balcan and Kilian Q. Weinberger, editors, Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pages 1558–1566, New York, New York, USA, 20–22 Jun 2016. PMLR. [39] Alex X. Lee, Anusha Nagabandi, Pieter Abbeel, and Sergey Levine. Stochastic latent actor- critic: Deep reinforcement learning with a latent variable model. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 741–752. Curran Associates, Inc., 2020. [40] Erich Leo Lehmann. Elements of large-sample theory. 1998. [41] James Lucas, G. Tucker, Roger Baker Grosse, and Mohammad Norouzi. Don't blame the elbo! a linear vae perspective on posterior collapse. In Neural Information Processing Systems, 2019. [42] Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adver- sarial autoencoders. arXiv preprint arXiv:1511.05644, 2015. [43] James E. Matheson and Robert L. Winkler. Scoring rules for continuous probability distributions. Management Science, 22:1087–1096, 1976. [44] Stan Matwin, Jordi Nin, Morvarid Sehatkar, and Tomasz Szapiro. A review of attribute disclosure control. In Advanced Research in Data Privacy, 2015. [45] Sangjun Moon, Jong-June Jeon, Jason Eng Hun Lee, and Yongdai Kim. Learning multiple quantiles with neural networks. Journal of Computational and Graphical Statistics, 30:1238 – 1248, 2021. [46] Prateek Munjal, Akanksha Paul, and N. C. Krishnan. Implicit discriminator in variational autoencoder. 2020 International Joint Conference on Neural Networks (IJCNN), pages 1–8, 2019. [47] Noseong Park, Mahmoud Mohammadi, Kshitij Gorde, Sushil Jajodia, Hongkyu Park, and Youngmin Kim. Data synthesis based on generative adversarial networks. Proc. VLDB Endow., 11:1071–1083, 2018. [48] V. Parmar, Bogdan Penkovsky, Damien Querlioz, and Manan Suri. Hardware-efficient stochastic binary cnn architectures for near-sensor computing. Frontiers in Neuroscience, 15, 2022. 12 [49] J. Peters, Dominik Janzing, and Bernhard Schölkopf. Elements of causal inference: Foundations and learning algorithms. 2017. [50] Kostantinos N Plataniotis and Dimitris Hatzinakos. Gaussian mixtures and their applications to signal processing. Advanced signal processing handbook, pages 89–124, 2017. [51] Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International Conference on Machine Learning, 2014. [52] Mihaela Rosca, Balaji Lakshminarayanan, David Warde-Farley, and Shakir Mohamed. Varia- tional approaches for auto-encoding generative adversarial networks. ArXiv, abs/1706.04987, 2017. [53] Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P. Kingma. PixelCNN++: Improving the pixelCNN with discretized logistic mixture likelihood and other modifications. In International Conference on Learning Representations, 2017. [54] R. Shokri, Marco Stronati, Congzheng Song, and Vitaly Shmatikov. Membership inference attacks against machine learning models. 2017 IEEE Symposium on Security and Privacy (SP), pages 3–18, 2016. [55] Nicki Skafte, Martin Jø rgensen, and Sø ren Hauberg. Reliable training and estimation of variance networks. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. [56] Kihyuk Sohn, Honglak Lee, and Xinchen Yan. Learning structured output representation using deep conditional generative models. In NIPS, 2015. [57] Hiroshi Takahashi, Tomoharu Iwata, Yuki Yamanaka, Masanori Yamada, and Satoshi Yagi. Student-t variational autoencoder for robust density estimation. In International Joint Confer- ence on Artificial Intelligence, 2018. [58] Jakub Tomczak and Max Welling. Vae with a vampprior. In Amos Storkey and Fernando Perez-Cruz, editors, Proceedings of the Twenty-First International Conference on Artificial Intelligence and Statistics, volume 84 of Proceedings of Machine Learning Research, pages 1214–1223. PMLR, 09–11 Apr 2018. [59] Kunfeng Wang, Chao Gou, Yanjie Duan, Yilun Lin, Xinhu Zheng, and Fei-Yue Wang. Genera- tive adversarial networks: introduction and outlook. IEEE/CAA Journal of Automatica Sinica, 4(4):588–598, 2017. [60] Wenlin Wang, Zhe Gan, Hongteng Xu, Ruiyi Zhang, Guoyin Wang, Dinghan Shen, Changyou Chen, and Lawrence Carin. Topic-guided variational auto-encoder for text generation. 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 166–177, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. [61] Bingyang Wen, Yupeng Cao, Fan Yang, Koduvayur Subbalakshmi, and Rajarathnam Chan- dramouli. Causal-TGAN: Causally-aware synthetic tabular data generative adversarial network, 2022. [62] Ruofeng Wen, Kari Torkkola, Balakrishnan Narayanaswamy, and Dhruv Madeka. A multi- horizon quantile recurrent forecaster. arXiv: Machine Learning, 2017. [63] Lei Xu, Maria Skoularidou, Alfredo Cuesta-Infante, and Kalyan Veeramachaneni. Modeling tabular data using conditional gan. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché- Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. [64] Keming Yu and Rana Moyeed. Bayesian quantile regression. Statistics & Probability Letters, 54:437–447, 2001. [65] Zilong Zhao, Aditya Kunar, Robert Birke, and Lydia Y. Chen. Ctab-gan: Effective table data synthesizing. In Vineeth N. Balasubramanian and Ivor Tsang, editors, Proceedings of The 13th Asian Conference on Machine Learning, volume 157 of Proceedings of Machine Learning Research, pages 97–112. PMLR, 17–19 Nov 2021. 13 A Appendix A.1 Derivation of ELBO log p(x; θ, β) = log = log (cid:90) (cid:90) p(αk) p(αk) K (cid:88) k=1 K (cid:88) k=1 p(x|z, αk; θ, β)p(z)dz p(x|z, αk; θ, β) p(z) q(z|x; φ) q(z|x; φ)dz (cid:90) p(αk) K (cid:88) k=1 q(z|x; φ) log (cid:16) p(x|z, αk; θ, β) p(z) q(z|x; φ) (cid:17) dz Eq(z|x;φ)[log p(x|z, αk; θ, β)] − KL(q(z|x; φ)∥p(z)) ≥ = = 1 K 1 K K (cid:88) k=1 K (cid:88) k=1 Eq(z|x;φ) = Eq(z|x;φ)   (cid:88) j∈IC  +Eq(z|x;φ)  (cid:88)   (cid:88) j∈IC 1 K K (cid:88) k=1 log p(xj|z, αk; θj, β) + (cid:88) j∈ID  log p(xj|z; θj, β)  − KL(q(z|x; φ)∥p(z)) log αk(1 − αk) β − ραk (cid:18) xj − Dj(αk|z, θj) β  (cid:19)  Tj (cid:88)  I(xj = l) * log πl(z; θj)  − KL(q(z|x; φ)∥p(z))  = Eq(z|x;φ) − j∈ID l=1 1 β * (cid:88) j∈IC 1 K K (cid:88) k=1 (cid:16) ραk (cid:17)   + p K K (cid:88) k=1 xj − Dj(αk|z, θj)  log αk(1 − αk) − p * log β +Eq(z|x;φ)   (cid:88) Tj (cid:88) l=1 j∈ID  (cid:32) = − 1 β Eq(z|x;φ)  (cid:88) j∈IC I(xj = l) * log πl(z; θj)  − KL(q(z|x; φ)∥p(z)) 1 K K (cid:88) k=1 (cid:16) ραk xj − Dj(αk|z, θj) (cid:17)   − β p K K (cid:88) k=1 log αk(1 − αk) + βp * log β −β * Eq(z|x;φ)   (cid:88) Tj (cid:88) j∈ID l=1 by Jensen's inequality.  I(xj = l) * log πl(z; θj)  + β * KL(q(z|x; φ)∥p(z)) (cid:33) , 14 A.2 Proof of Theorem 1 Proof. Ep(x)Eq(z|x;φ) (cid:34) 1 K K (cid:88) k=1 (cid:16) ραk xj − Dj(αk|z, θj) (cid:35) (cid:17) = = 1 K K (cid:88) k=1 h(αk) K (cid:88) k=1 h(αk) * (αk − αk−1), where α0 := 0 and Ep(x)Eq(z|x;φ) (cid:16) (cid:104) ραk xj − Dj(αk|z, θj) (cid:17)(cid:105) is denoted as h(αk). Since αk ∈ [αk−1, αk] and h(*) : [0, 1] (cid:55)→ R is a continuous function, for j ∈ IC, lim K→∞ Ep(x)Eq(z|x;φ) (cid:34) 1 K K (cid:88) k=1 (cid:16) ραk xj − Dj(αk|z, θj) (cid:17) (cid:35) = lim K→∞ K (cid:88) k=1 h(αk) * (αk − αk−1) = = (cid:90) 1 0 (cid:90) 1 0 h(α)dα Ep(x)Eq(z|x;φ) (cid:16) (cid:104) ρα xj − Dj(α|z, θj) (cid:17)(cid:105) dα = Ep(x)Eq(z|x;φ) (cid:20)(cid:90) 1 (cid:16) ρα 0 xj − Dj(α|z, θj) (cid:17) dα (cid:21) , by the definition of the Riemann integral and the Fubini-Tonelli theorem. The proof is complete. A.3 Proof of Theorem 2 Proof. Ep(x)q(z|x;φ) min θ p (cid:88) (cid:90) 1 j=1 0 So, for all j = 1, * * * , p, ρα(xj − Dj(α, z; θj))dα = Eq(z;φ)q(x|z;φ) p (cid:88) (cid:90) 1 j=1 0 ρα(xj − Dj(α, z; θj))dα = p (cid:88) j=1 Eq(z;φ)Eq(xj |z;φ) (cid:90) 1 0 ρα(xj − Dj(α, z; θj))dα. θ∗ j (φ) ∈ arg min θj Eq(z;φ)Eq(xj |z;φ) (cid:90) 1 0 ρα(xj − Dj(α, z; θj))dα, and it is proper scoring rule relative to Fj(*|z; φ) for all z ∈ Rd. It implies that D−1 Fj(xj|z; φ), and d dxj j (φ)) = qj(xj|z; φ), for all xj ∈ R, by Assumption 2. j (xj, z; θ∗ D−1 j (xj, z; θ∗ j (φ)) = It follows that (cid:90) p (cid:89) j=1 d dxj D−1 j (xj, z; θ∗ j (φ))q(z; φ)dz = (cid:90) p (cid:89) j=1 qj(xj|z; φ)q(z; φ)dz (cid:90) q(x|z; φ)q(z; φ)dz (cid:90) p(x)q(z|x; φ) q(z; φ) q(z; φ)dz (cid:90) p(x)q(z|x; φ)dz = = = = p(x). The proof is complete. 15 A.4 Proof of Theorem 3 Proof. Ep(x)q(z|x;φ) min θ p (cid:88) (cid:90) 1 j=1 0 So, for all j = 1, * * * , p, ρα(xj − Dj(α, z; θj))dα = Eq(z;φ)q(x|z;φ) p (cid:88) (cid:90) 1 j=1 0 ρα(xj − Dj(α, z; θj))dα = p (cid:88) j=1 Eq(z;φ)Eq(xj |z;φ) (cid:90) 1 0 ρα(xj − Dj(α, z; θj))dα. θ∗ j (φ) ∈ arg min θj Eq(z;φ)Eq(xj |z;φ) (cid:90) 1 0 ρα(xj − Dj(α, z; θj))dα, and it is proper scoring rule relative to Fj(*|z; φ) for all z ∈ Rd. It implies that D−1 Fj(xj|z; φ), and d dxj j (φ)) = qj(xj|z; φ), for all xj ∈ R, by Assumption 2. j (xj, z; θ∗ D−1 j (xj, z; θ∗ j (φ)) = It follows that  (cid:13) (cid:13) (cid:13) p(x) (cid:13) (cid:13) KL (cid:90) p (cid:89) j=1 d dxj D−1 j (xj, z; θ∗ j (φ))p(z)dz   = KL = KL = KL = KL  (cid:32) p(x) (cid:13) (cid:13) (cid:13) p(x) (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) p(x) p(x) (cid:32) (cid:32) qj(xj|z; φ)p(z)dz   (cid:90) p (cid:89) j=1 (cid:90) q(x|z; φ)p(z)dz (cid:33) (cid:33) (cid:33) (cid:90) p(x)q(z|x; φ) q(z; φ) p(z)dz (cid:90) p(z)q(z|x; φ) p(x) q(z; φ) (cid:90) p(z)q(z|x; φ) dz = Ep(x) (cid:20) − log (cid:20)(cid:90) ≤ Ep(x) q(z|x; φ) log = = = (cid:90) (cid:90) (cid:90) (cid:90) p(x)q(z|x; φ) log p(x)q(z|x; φ) log (cid:90) q(z; φ) log q(z; φ) p(z) dz q(z; φ) (cid:21) dz (cid:21) dz dzdx dxdz q(z; φ) p(z) q(z; φ) p(z) q(z; φ) p(z) by Jensen's inequality, Fubini-Tonelli theorem, and the assumptions. The proof is complete. = KL(q(z; φ)∥p(z)) < ε, A.5 Closed Form Loss 2 * (cid:90) 1 0 (cid:16) ρα xj − Dj(α, z, θj) (cid:17) dα = (2 ̃αj − 1)xj + (1 − 2 ̃αj)γ(j)(z) + b(j) m (z) (cid:32) 1 − d3 m 3 M (cid:88) m=1 − dm − max( ̃αj, dm)2 + 2 max( ̃αj, dm)dm (cid:33) , where Dj( ̃αj, z; θj) = xj, ̃αj = xj −γ(j)(z)+(cid:80)m0 m=0 b(j) Dj(dm0+1, z; θj). (cid:80)m0 m=0 b(j) m (z) m (z)dm , and Dj(dm0 , z; θj) ≤ xj ≤ 16 A.6 Discretization of Estimated CDF To ensure appropriate discretization of the estimated CDF for ordinal variables, we propose a post-ad- hoc discretization step [53]. We focus on the case where p = 1 and q = 0 for brevity. We denote the set of observed possible values for the ordinal variable as x(1), x(2), * * * , x(m). The discretization algorithm for the estimated CDF is presented in Algorithm 1, and we provide an example of the discretization algorithm's outcome in Figure 2. Algorithm 1 Discretization of Estimated CDF Input {x(1), x(2), * * * , x(m)}, Estimated CDF ˆF (*; θ) Output Discretized CDF ˆF ∗(*; θ) (1) Compute ˆF (x(i) − 0.5; θ) and ˆF (x(i) + 0.5; θ) for i = 1, * * * , m. (2) Discretization: For i = 1, * * * , m, ˆF ∗(x(i); θ) := ˆF ∗(x(i−1); θ) + ˆF (x(i) + 0.5; θ) − ˆF (x(i) − 0.5; θ), where ˆF ∗(x(0); θ) := 0. (3) Ensure monotonicity: For i = 1, * * * , m − 1, if ˆF ∗(x(i); θ) > ˆF ∗(x(i+1); θ), ˆF ∗(x(i+1); θ) := ˆF ∗(x(i); θ). Figure 2: Discretized CDF for ordinal variable educational-num of adult dataset. 'estimate' indicates ˆF (*; θ), 'calibration' indicates ˆF ∗(*; θ), and 'empirical' indicates the empirical CDF of the observed dataset. 17 A.7 Membership Inference Attack [47] propose the customized membership inference attack method of [54] to attack the GAN-based synthesizer. Similarly, we propose the customized membership inference attack method of [54] to attack the VAE-based synthesizer. Assumption 3 ([54]). In the membership inference attack, the attacker attacks the target model under the following assumptions: (A1) The attacker is only allowed for black-box access, where the attacker can only supply inputs to the model and receive the model's output(s). (A2) The attacker can obtain as many outputs as they want from a target model to attack. (A3) The real and synthetic datasets should not have common records. (A4) The attacker knows the algorithm and architecture of the target model. Denote D∗ of the membership inference attack are outlined below: train and D∗ test as the real training and test datasets. Under Assumption 3, the overall steps 1. Generate shadow training and test datasets D(i) test, i = 1, * * * , C from M ∗ by (A1), where M ∗ is the model attacker wants to attack. By (A2), the attacker is allowed to obtain shadow datasets such as |D(i) test = ∅, for i = 1, * * * , C. Under (A3), D(i) train| and D(i) train = ∅, for i = 1, * * * , C. train ∩ D(j) train| = |D∗ train, D(i) train ∩ D∗ 2. Train shadow models M1, * * * , MC under (A4), i.e., each shadow model is trained similarly to the target model M ∗. 3. For i = 1, * * * , C, (a) Obtain representation vectors z from the encoder of Mi with the input of D(i) train. Then, attacking training records are (y, z, in). (b) Obtain representation vectors z from the encoder of Mi with the input of D(i) test. Then, attacking training records are (y, z, out). where y is the labels of shadow dataset records. And we assume that y consists of the MLu classification target. 4. Merge all attack training records, (y, z, in/out). 5. For each class of y, train attack model which is a binary classification model which classifies in/out based on the representation vectors z. 6. Now it is ready to attack. Note that we use the representation vector of VAE instead of the output of the GAN discriminator [47]. 18 A.8 Dataset Descriptions Websites • covertype: forest-cover-type-dataset https://www.kaggle.com/datasets/uciml/ • credit: https://www.kaggle.com/c/home-credit-default-risk • loan: https://www.kaggle.com/datasets/teertha/personal-loan-modeling • adult: https://www.kaggle.com/datasets/uciml/adult-census-income • cabs: https://www.kaggle.com/datasets/arashnic/ taxi-pricing-with-mobility-analytics?select=test.csv • kings: https://www.kaggle.com/datasets/harlfoxem/housesalesprediction Table 8: Description of datasets. #C represents the number of continuous and ordinal variables. #D denotes the number of discrete variables. Dataset Train/Test Split Regression Target Classification Target #C #D covertype credit loan adult cabs kings 45k/5k 45k/5k 4k/1k 40k/5k 40k/1k 20k/1k Elevation AMT_CREDIT Age age Trip_Distance long Cover_Type TARGET Personal Loan income Surge_Pricing_Type condition 10 10 5 5 6 11 1 9 6 9 7 7 19 A.9 Experimental Settings We run all experiments using Geforce RTX 3090 GPU, and our experimental codes are all available with pytorch. Table 9: Hyper-parameter settings for tabular dataset experiments. Model epochs batch size learning rate β (or decoder std range) d M CTGAN TVAE CTAB-GAN DistVAE 300 200 150 100 500 256 500 256 0.0002 0.005 0.0002 0.001 - [0.1, 1] - 0.5 2 2 2 2 - - - 10 Table 10: The number of model parameters for tabular dataset experiments. Model covtype credit adult loan cabs kings CTGAN TVAE CTAB-GAN DistVAE 20k 10k 12k 10k 32k 12k 13k 12k 52k 13k 14k 13k 13k 6k 5k 6k 30k 10k 12k 10k 51k 10k 15k 16k Table 11: Classifier and regressor used to evaluate synthetic data quality. The names of all parameters used in the description are consistent with those defined in corresponding packages. Tasks Model Description Linear Regression Regression Random Forest Gradient Boosting Logistic Regression Classification Random Forest Gradient Boosting Package: statsmodels.api.sm.OLS, setting: without intercept, defaulted values Package: sklearn.ensemble.RandomForestRegressor, setting: random_state=0, defaulted values Package: sklearn.ensemble.GradientBoostingRegressor, setting: random_state=0, defaulted values Package: sklearn.linear_model.LogisticRegression, setting: multi_class='ovr', fit_intercept=False, defaulted values Package: sklearn.ensemble.RandomForestClassifier, setting: random_state=0, defaulted values Package: sklearn.ensemble.GradientBoostingClassifier, setting: random_state=0, defaulted values 20 A.10 Detailed Experimental Results (a) covtype (b) credit (c) loan Figure 3: Empirical and estimated CDFs of continuous and count variables (Monte Carlo approxi- mated with 5000 samples). We standardize covariates and remove observations outside the 1% and 99% percentile range. 21 (a) adult (b) cabs (c) kings Figure 4: Empirical and estimated CDFs of continuous and count variables (Monte Carlo approxi- mated with 5000 samples). We standardize covariates and remove observations outside the 1% and 99% percentile range. 22 Table 12: MLu metrics (MARE, F1). Mean and standard deviation values are obtained from 10 repeated experiments. ↑ denotes higher is better and ↓ denotes lower is better. Dataset Model Baseline CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) Dataset Model Baseline CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) (a) covertype credit loan MARE ↓ 0.035 0.058±0.007 0.079±0.007 0.065±0.004 0.044±0.002 0.045±0.001 0.063±0.001 F1 ↑ MARE ↓ F1 ↑ MARE ↓ F1 ↑ 0.718 0.227±0.030 0.504±0.032 0.493±0.027 0.605±0.006 0.557±0.007 0.443±0.018 0.064 0.593±0.150 0.260±0.135 0.887±0.351 0.763±0.068 0.774±0.035 0.870±0.022 (b) 0.927 0.914±0.006 0.091±0.286 0.913±0.005 0.926±0.001 0.926±0.000 0.904±0.010 0.020 0.258±0.020 0.124±0.033 0.247±0.019 0.249±0.007 0.249±0.005 0.249±0.005 0.948 0.842±0.109 0.785±0.288 0.887±0.026 0.914±0.009 0.897±0.002 0.893±0.005 adult cabs kings MARE ↓ 0.216 0.297±0.030 0.238±0.006 0.321±0.036 0.232±0.004 0.234±0.006 0.327±0.008 F1 ↑ MARE ↓ F1 ↑ MARE ↓ F1 ↑ 0.854 0.796±0.022 0.809±0.016 0.730±0.069 0.825±0.009 0.822±0.003 0.751±0.010 0.565 0.721±0.046 0.642±0.035 0.894±0.116 0.803±0.129 0.760±0.062 0.839±0.042 0.743 0.674±0.024 0.689±0.031 0.582±0.047 0.707±0.010 0.725±0.004 0.447±0.009 0.001 0.001±0.000 0.010±0.005 0.001±0.000 0.001±0.000 0.001±0.000 0.002±0.000 0.695 0.579±0.035 0.687±0.041 0.608±0.022 0.640±0.002 0.644±0.003 0.637±0.004 Figure 5: Machine learning utilities for compared models and real tabular datasets. For a detailed comparison of the models and their performance, we present the paired (MARE, F1) scores for all tabular datasets in Figure 5. A better score, indicating a superior performance in terms of MLu, is represented by a dot located in the upper left corner. Notably, Figure 5 consistently demonstrates that DistVAE achieves the best or at least competitive MLu across all tabular datasets. TVAE exhibits a notably low F1 score in the credit dataset because it fails to handle the highly imbalanced discrete target variable. This comparative analysis highlights the strong MLu performance of DistVAE and the specific limitations of TVAE in certain scenarios. 23 Table 13: Correlation structure similarity. 'CorrDist' represents L2 distance between the correlation matrix of synthetic and real datasets. Mean and standard deviation values are obtained from 10 repeated experiments. Lower is better. Dataset Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) covertype credit loan adult cabs kings CorrDist CorrDist CorrDist CorrDist CorrDist CorrDist 2.167±0.419 1.969±0.146 2.351±0.185 1.179±0.090 2.359±0.018 2.946±0.007 2.323±0.362 4.021±0.451 2.696±0.275 2.072±0.162 2.229±0.102 3.161±0.006 2.282±0.177 2.404±0.408 2.073±0.110 1.654±0.050 1.910±0.019 2.113±0.015 1.788±0.217 2.231±0.269 2.387±0.470 0.830±0.078 0.746±0.042 3.186±0.007 1.679±0.129 3.136±0.686 2.532±0.225 1.481±0.071 1.495±0.047 1.930±0.004 2.839±0.246 2.665±0.296 3.411±0.399 1.559±0.135 1.621±0.149 5.339±0.006 24 Table 14: Marginal statistical similarity. K-S denotes the Kolmogorov–Smirnov statistic and 1-WD represents the 1-Wasserstein distance. Mean and standard deviation values are obtained from 10 repeated experiments. Lower is better. Dataset Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) Dataset Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) Dataset Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) Dataset Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) (a) Continuous covertype credit loan K-S 1-WD K-S 1-WD K-S 1-WD 0.080±0.011 0.088±0.008 0.073±0.011 0.032±0.003 0.049±0.001 0.064±0.001 0.108±0.014 0.156±0.018 0.096±0.014 0.041±0.005 0.079±0.001 0.112±0.000 0.132±0.017 0.156±0.036 0.140±0.021 0.088±0.014 0.084±0.008 0.146±0.003 0.088±0.013 0.200±0.035 0.111±0.013 0.089±0.004 0.093±0.002 0.113±0.001 0.112±0.055 0.162±0.024 0.181±0.070 0.060±0.010 0.056±0.003 0.057±0.003 0.061±0.016 0.201±0.024 0.153±0.023 0.048±0.003 0.054±0.002 0.056±0.002 (b) Continuous adult cabs kings K-S 1-WD K-S 1-WD K-S 1-WD 0.323±0.126 0.477±0.053 0.275±0.122 0.209±0.064 0.138±0.041 0.115±0.005 0.086±0.017 0.414±0.070 0.178±0.053 0.114±0.009 0.111±0.007 0.234±0.002 0.045±0.007 0.098±0.008 0.086±0.008 0.044±0.003 0.046±0.002 0.052±0.001 0.060±0.011 0.139±0.023 0.118±0.015 0.067±0.003 0.068±0.003 0.074±0.002 0.109±0.012 0.195±0.018 0.188±0.035 0.110±0.008 0.115±0.007 0.120±0.002 0.116±0.016 0.213±0.046 0.128±0.019 0.089±0.003 0.093±0.002 0.137±0.002 (c) Discrete covertype credit loan K-S 1-WD K-S 1-WD K-S 1-WD 0.591±0.003 0.238±0.042 0.052±0.028 0.023±0.010 0.011±0.005 0.109±0.003 1.629±0.011 0.606±0.033 0.180±0.126 0.073±0.046 0.036±0.025 0.379±0.014 0.061±0.008 0.583±0.045 0.034±0.006 0.020±0.003 0.018±0.001 0.027±0.001 0.147±0.024 1.566±0.116 0.076±0.018 0.046±0.006 0.042±0.003 0.068±0.004 0.070±0.010 0.193±0.028 0.039±0.011 0.019±0.005 0.011±0.002 0.009±0.002 0.076±0.013 0.221±0.043 0.046±0.013 0.027±0.008 0.015±0.005 0.013±0.005 (d) Discrete adult cabs kings K-S 1-WD K-S 1-WD K-S 1-WD 0.065±0.008 0.479±0.048 0.169±0.018 0.037±0.004 0.031±0.004 0.070±0.002 0.463±0.051 5.228±0.273 0.745±0.294 0.248±0.026 0.239±0.019 0.457±0.010 0.069±0.016 0.411±0.088 0.086±0.013 0.060±0.017 0.070±0.003 0.083±0.003 0.238±0.036 1.202±0.212 0.443±0.074 0.241±0.084 0.292±0.010 0.326±0.011 0.140±0.018 0.405±0.034 0.255±0.027 0.022±0.004 0.023±0.003 0.059±0.002 0.529±0.064 1.262±0.099 0.979±0.107 0.071±0.012 0.073±0.008 0.204±0.011 25 Table 15: Privacy preservability: Distance to closest record (DCR) between real training and synthetic datasets (R&S), between the same real training datasets (R), and between the same synthetic datasets (S). Mean and standard deviation values are obtained from 10 repeated experiments. Higher is better. Dataset Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) Dataset Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) Dataset Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) (a) (b) covertype Dataset credit R&S R S Model R&S R S 0.715±0.026 0.676±0.031 0.892±0.031 0.765±0.008 0.878±0.008 0.907±0.012 0.329±0.000 0.329±0.000 0.329±0.000 0.329±0.000 0.329±0.000 0.329±0.000 0.514±0.094 0.482±0.025 0.011±0.005 0.819±0.010 0.906±0.009 0.939±0.008 CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) 0.624±0.033 0.627±0.118 0.715±0.025 0.692±0.012 0.700±0.006 0.718±0.007 0.452±0.000 0.452±0.000 0.452±0.000 0.452±0.000 0.452±0.000 0.452±0.000 0.592±0.061 0.423±0.212 0.014±0.006 0.742±0.012 0.750±0.005 0.757±0.007 (c) (d) loan Dataset adult R&S R S Model R&S R S 0.249±0.017 0.298±0.057 0.272±0.024 0.244±0.025 0.238±0.019 0.243±0.015 0.109±0.000 0.109±0.000 0.109±0.000 0.109±0.000 0.109±0.000 0.109±0.000 0.243±0.024 0.154±0.026 0.076±0.051 0.245±0.020 0.241±0.023 0.240±0.025 CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) 0.063±0.017 0.277±0.039 0.152±0.064 0.060±0.040 0.048±0.027 0.177±0.002 0.000±0.000 0.000±0.000 0.000±0.000 0.000±0.000 0.000±0.000 0.000±0.000 0.000±0.000 0.000±0.000 0.000±0.000 0.005±0.001 0.003±0.000 0.001±0.000 (e) (f) cabs Dataset kings R&S R S Model R&S R S 0.353±0.006 0.339±0.008 0.423±0.025 0.364±0.004 0.364±0.004 0.368±0.003 0.332±0.000 0.332±0.000 0.332±0.000 0.332±0.000 0.332±0.000 0.332±0.000 0.341±0.010 0.195±0.015 0.012±0.023 0.368±0.005 0.367±0.004 0.365±0.005 CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) 0.550±0.016 0.603±0.091 0.596±0.030 0.540±0.009 0.552±0.008 0.692±0.013 0.199±0.000 0.199±0.000 0.199±0.000 0.199±0.000 0.199±0.000 0.199±0.000 0.447±0.030 0.414±0.053 0.122±0.135 0.600±0.013 0.605±0.014 0.763±0.015 Table 16: Privacy preservability: Membership inference attack performance. Mean and standard deviation values are obtained from 10 repeated experiments. (a) (b) Dataset Model covertype Dataset credit Accuracy AUC Model Accuracy AUC TVAE DistVAE(β = 0.5) 0.499±0.007 0.500±0.003 0.499±0.007 0.500±0.003 TVAE DistVAE(β = 0.5) 0.500±0.001 0.500±0.001 0.500±0.001 0.500±0.001 (c) (d) Dataset Model loan Dataset adult Accuracy AUC Model Accuracy AUC TVAE DistVAE(β = 0.5) 0.497±0.015 0.502±0.006 0.497±0.015 0.502±0.006 TVAE DistVAE(β = 0.5) 0.493±0.017 0.500±0.000 0.493±0.017 0.500±0.000 (e) (f) Dataset Model cabs Dataset kings Accuracy AUC Model Accuracy AUC TVAE DistVAE(β = 0.5) 0.480±0.033 0.498±0.003 0.480±0.033 0.498±0.003 TVAE DistVAE(β = 0.5) 0.507±0.025 0.502±0.004 0.507±0.025 0.502±0.004 26 Table 17: Privacy preservability: Attribute disclosure performance with F1 score. Mean and standard deviation values are obtained from 10 repeated experiments. Lower is better. (a) covtype (b) credit Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) Number of neighbors (k) Number of neighbors (k) 1 10 100 Model 1 10 100 0.161±0.030 0.356±0.086 0.200±0.035 0.308±0.025 0.264±0.024 0.141±0.019 0.175±0.029 0.357±0.091 0.225±0.042 0.338±0.037 0.294±0.036 0.135±0.013 0.155±0.041 0.349±0.094 0.238±0.033 0.313±0.035 0.282±0.029 0.115±0.011 CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) 0.319±0.009 0.615±0.147 0.322±0.007 0.339±0.013 0.339±0.010 0.332±0.007 0.330±0.009 0.618±0.143 0.332±0.012 0.337±0.011 0.324±0.005 0.317±0.007 0.323±0.011 0.614±0.145 0.331±0.010 0.315±0.012 0.301±0.004 0.293±0.007 (c) loan (d) adult Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) Number of neighbors (k) Number of neighbors (k) 1 10 100 Model 1 10 100 0.439±0.027 0.611±0.153 0.475±0.048 0.505±0.043 0.449±0.038 0.458±0.013 0.447±0.022 0.602±0.152 0.443±0.027 0.465±0.038 0.440±0.035 0.441±0.035 0.426±0.033 0.596±0.157 0.435±0.030 0.439±0.032 0.423±0.031 0.416±0.031 CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) 0.234±0.012 0.318±0.081 0.199±0.032 0.270±0.018 0.264±0.006 0.205±0.005 0.255±0.021 0.318±0.080 0.202±0.032 0.280±0.021 0.276±0.005 0.187±0.003 0.261±0.023 0.307±0.080 0.205±0.031 0.268±0.015 0.260±0.007 0.166±0.002 (e) cabs (f) kings Model CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) Number of neighbors (k) Number of neighbors (k) 1 10 100 Model 1 10 100 0.238±0.009 0.385±0.079 0.235±0.010 0.251±0.010 0.246±0.010 0.238±0.010 0.246±0.006 0.383±0.079 0.236±0.008 0.241±0.007 0.240±0.006 0.220±0.009 0.231±0.010 0.381±0.081 0.237±0.011 0.225±0.005 0.227±0.008 0.199±0.005 CTGAN TVAE CTAB-GAN DistVAE(β = 0.5) DistVAE(β = 1) DistVAE(β = 5) 0.200±0.009 0.338±0.045 0.111±0.068 0.293±0.019 0.281±0.016 0.215±0.010 0.257±0.032 0.349±0.046 0.111±0.088 0.310±0.041 0.306±0.039 0.221±0.036 0.269±0.036 0.345±0.044 0.123±0.114 0.301±0.050 0.290±0.041 0.205±0.038 27
http://arxiv.org/abs/2302.11289v1
2023-02-22T11:14:16
2023-02-22T11:14:16
Recon: Reducing Conflicting Gradients from the Root for Multi-Task Learning
A fundamental challenge for multi-task learning is that different tasks may conflict with each other when they are solved jointly, and a cause of this phenomenon is conflicting gradients during optimization. Recent works attempt to mitigate the influence of conflicting gradients by directly altering the gradients based on some criteria. However, our empirical study shows that ``gradient surgery'' cannot effectively reduce the occurrence of conflicting gradients. In this paper, we take a different approach to reduce conflicting gradients from the root. In essence, we investigate the task gradients w.r.t. each shared network layer, select the layers with high conflict scores, and turn them to task-specific layers. Our experiments show that such a simple approach can greatly reduce the occurrence of conflicting gradients in the remaining shared layers and achieve better performance, with only a slight increase in model parameters in many cases. Our approach can be easily applied to improve various state-of-the-art methods including gradient manipulation methods and branched architecture search methods. Given a network architecture (e.g., ResNet18), it only needs to search for the conflict layers once, and the network can be modified to be used with different methods on the same or even different datasets to gain performance improvement. The source code is available at https://github.com/moukamisama/Recon.
[ "Guangyuan Shi", "Qimai Li", "Wenlong Zhang", "Jiaxin Chen", "Xiao-Ming Wu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11289v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11289v1", "@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 2 2 ] G L . s c [ 1 v 9 8 2 1 1 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 RECON: REDUCING CONFLICTING GRADIENTS FROM THE ROOT FOR MULTI-TASK LEARNING Guangyuan Shi, Qimai Li, Wenlong Zhang, Jiaxin Chen, Xiao-Ming Wu(cid:12) Department of Computing, The Hong Kong Polytechnic University, Hong Kong S.A.R., China {guang-yuan.shi, qee-mai.li, wenlong.zhang}@connect.polyu.hk, [email protected], [email protected] ABSTRACT A fundamental challenge for multi-task learning is that different tasks may con- flict with each other when they are solved jointly, and a cause of this phenomenon is conflicting gradients during optimization. Recent works attempt to mitigate the influence of conflicting gradients by directly altering the gradients based on some criteria. However, our empirical study shows that "gradient surgery" cannot ef- fectively reduce the occurrence of conflicting gradients. In this paper, we take a different approach to reduce conflicting gradients from the root. In essence, we investigate the task gradients w.r.t. each shared network layer, select the layers with high conflict scores, and turn them to task-specific layers. Our experiments show that such a simple approach can greatly reduce the occurrence of conflict- ing gradients in the remaining shared layers and achieve better performance, with only a slight increase in model parameters in many cases. Our approach can be easily applied to improve various state-of-the-art methods including gradient ma- nipulation methods and branched architecture search methods. Given a network architecture (e.g., ResNet18), it only needs to search for the conflict layers once, and the network can be modified to be used with different methods on the same or even different datasets to gain performance improvement. The source code is available at https://github.com/moukamisama/Recon. 1 INTRODUCTION Multi-task learning (MTL) is a learning paradigm in which multiple different but correlated tasks are jointly trained with a shared model (Caruana, 1997), in the hope of achieving better performance with an overall smaller model size than learning each task independently. By discovering shared structures across tasks and leveraging domain-specific training signals of related tasks, MTL can achieve efficiency and effectiveness. Indeed, MTL has been successfully applied in many domains including natural language processing (Hashimoto et al., 2017), reinforcement learning (Parisotto et al., 2016; D'Eramo et al., 2020) and computer vision (Vandenhende et al., 2021). A major challenge for multi-task learning is negative transfer (Ruder, 2017), which refers to the performance drop on a task caused by the learning of other tasks, resulting in worse overall perfor- mance than learning them separately. This is caused by task conflicts, i.e., tasks compete with each other and unrelated information of individual tasks may impede the learning of common structures. From the optimization point of view, a cause of negative transfer is conflicting gradients (Yu et al., 2020), which refers to two task gradients pointing away from each other and the update of one task will have a negative effect on the other. Conflicting gradients make it difficult to optimize the multi- task objective, since task gradients with larger magnitude may dominate the update vector, making the optimizer prioritize some tasks over others and struggle to converge to a desirable solution. Prior works address task/gradient conflicts mainly by balancing the tasks via task reweighting or gradient manipulation. Task reweighting methods adaptively re-weight the loss functions by ho- moscedastic uncertainty (Kendall et al., 2018), balancing the pace at which tasks are learned Chen et al. (2018); Liu et al. (2019), or learning a loss weight parameter (Liu et al., 2021b). Gradient manipulation methods reduce the influence of conflicting gradients by directly altering the gradients based on different criteria (Sener & Koltun, 2018; Yu et al., 2020; Chen et al., 2020; Liu et al., 1 Published as a conference paper at ICLR 2023 2021a) or rotating the shared features (Javaloy & Valera, 2022). While these methods have demon- strated effectiveness in different scenarios, in our empirical study, we find that they cannot reduce the occurrence of conflicting gradients (see Sec. 3.3 for more discussion). We propose a different approach to reduce conflicting gradients for MTL. Specifically, we investi- gate layer-wise conflicting gradients, i.e., the task gradients w.r.t. each shared network layer. We first train the network with a regular MTL algorithm (e.g., joint-training) for a number of iterations, com- pute the conflict scores for all shared layers, and select those with highest conflict scores (indicating severe conflicts). We then set the selected shared layers task-specific and train the modified network from scratch. As demonstrated by comprehensive experiments and analysis, our simple approach Recon has the following key advantages: (1) Recon can greatly reduce conflicting gradients with only a slight increase in model parameters (less than 1% in some cases) and lead to significantly bet- ter performance. (2) Recon can be easily applied to improve various gradient manipulation methods and branched architecture search methods. Given a network architecture, it only needs to search for the conflict layers once, and the network can be modified to be used with different methods and even on different datasets to gain performance improvement. (3) Recon can achieve better performance than branched architecture search methods with a much smaller model. 2 RELATED WORKS In this section, we briefly review related works in multi-task learning in four categories: tasks clus- tering, architecture design, architecture search, and task balancing. Tasks clustering methods mainly focus on identifying which tasks should be learned together (Thrun & O'Sullivan, 1996; Zamir et al., 2018; Standley et al., 2020; Shen et al., 2021; Fifty et al., 2021). Architecture design methods include hard parameter sharing methods (Kokkinos, 2017; Long et al., 2017; Bragman et al., 2019), which learn a shared feature extractor and task-specific decoders, and soft parameters sharing methods (Misra et al., 2016; Ruder et al., 2019; Gao et al., 2019; 2020; Liu et al., 2019), where some parameters of each task are assigned to do cross-task talk via a sharing mechanism. Compared with soft parameters sharing methods, our approach Recon has much better scalability when dealing with a large number of tasks. Instead of designing a fixed network structure, some methods (Rosenbaum et al., 2018; Meyerson & Miikkulainen, 2018; Yang et al., 2020) propose to dynamically self-organize the network for differ- ent tasks. Among them, branched architecture search (Guo et al., 2020; Bruggemann et al., 2020) methods are more related to our work. They propose an automated architecture search algorithm to build a tree-structured network by learning where to branch. In contrast, our method Recon decides which layers to be shared across tasks by considering the severity of layer-wise conflicting gradients, resulting in a more compact architecture with lower time cost and better performance. Another line of research is task balancing methods. To address task/gradient conflicts, some meth- ods attempt to re-weight the multi-task loss function using homoscedastic uncertainty (Kendall et al., 2018), task prioritization (Guo et al., 2018), or similar learning pace (Liu et al., 2019; 2021b). GradNorm (Chen et al., 2018) learns task weights by dynamically tuning gradient magnitudes. MGDA (Sener & Koltun, 2018) find the weights by minimizing the norm of the weighted sum of task gradients. To reduce the influence of conflicting gradients, PCGrad (Yu et al., 2020) projects each gradient onto the normal plane of another gradient and uses the average of projected gradi- ents for update. Graddrop (Chen et al., 2020) randomly drops some elements of gradients based on element-wise conflict. CAGrad (Liu et al., 2021a) ensures convergence to a minimum of the aver- age loss across tasks by gradient manipulation. RotoGrad (Javaloy & Valera, 2022) re-weights task gradients and rotates the shared feature space. Instead of manipulating gradients, our method Recon leverages gradient information to modify network structure to mitigate task conflicts from the root. 3 PILOT STUDY: TASK CONFLICTS IN MULTI-TASK LEARNING 3.1 MULTI-TASK LEARNING: PROBLEM DEFINITION Multi-task learning (MTL) aims to learn a set of correlated tasks {Ti}T i=1 simultaneously. For each task Ti, the empirical loss function is Li(θsh, θi), where θsh are parameters shared among all tasks 2 Published as a conference paper at ICLR 2023 Figure 1: The distributions of gradient conflicts (in terms of cos φij) of the joint-training baseline and state-of-the-art gradient manipulation methods on Multi-Fashion+MNIST benchmark. and θi are task-specific parameters. The goal is to find optimal parameters θ = {θsh, θ1, θ2, * * * , θT } to achieve high performance across all tasks. Formally, it aims to minimize a multi-task objective: θ∗ = arg min θ T (cid:88) wiLi(θsh, θi), (1) i where wi are pre-defined or dynamically computed weights for different tasks. A popular choice is to use the average loss (i.e., equal weights). However, optimizing the multi-task objective is difficult, and a known cause is conflicting gradients. 3.2 CONFLICTING GRADIENTS Let gi = ∇θsh Li(θsh, θi) denote the gradient of task Ti w.r.t. the shared parameters θsh (i.e., a vector of the partial derivatives of Li w.r.t. θsh) and gts i = ∇θiLi(θsh, θi) denote the gradient w.r.t. the task-specific parameters θi. A small change of θsh in the direction of negative gi is θsh ← θsh −αgi, with a sufficiently small step size α. The effect of this change on the performance of another task Tj is measured by: ∆Lj = Lj(θsh − αgi, θj) − Lj(θsh, θj) = −αgi * gj + o(α), (2) where the second equality is obtained by first order Taylor approximation. Likewise, the effect of a small update of θsh in the direction of the negative gradient of task Tj (i.e., −gj) on the performance of task Ti is ∆Li = −αgi * gj + o(α). Notably, the model update for task Ti is considered to have a negative effect on task Tj when gi * gj < 0, since it increases the loss of task Tj, and vice versa. A formal definition of conflicting gradients is given as follows (Yu et al., 2020). Definition 1 (Conflicting Gradients). The gradients gi and gj(i (cid:54)= j) are said to be conflicting with each other if cos φij < 0, where φij is the angle between gi and gj. As shown in Yu et al. (2020), conflicts in gradient pose serious challenges for optimizing the multi- task objective (Eq. 1). Using the average gradient (i.e., 1 i=1 gi) for gradient decent may hurt the T performance of individual tasks, especially when there is a large difference in gradient magnitudes, which will make the optimizer struggle to converge to a desirable solution. (cid:80)T 3.3 GRADIENT SURGERY CANNOT EFFECTIVELY REDUCE CONFLICTING GRADIENTS To mitigate the influence of conflicting gradients, several methods (Yu et al., 2020; Chen et al., 2020; Liu et al., 2021a) have been proposed to perform "gradient surgery". Instead of following the average gradient direction, they alter conflicting gradients based on some criteria and use the modified gradients for model update. We conduct a pilot study to investigate whether gradient ma- nipulation can effectively reduce the occurrence of conflicting gradients. For each training iteration, we first calculate the task gradients of all tasks w.r.t. the shared parameters (i.e., gi for any task i) and compute the conflict angle between any two task gradients gi and gj in terms of cosφij. We then count and draw the distribution of cosφij in all training iterations. We provide the statistics of the joint-training baseline (i.e., training all tasks jointly with equal loss weights and all parameters shared) and several state-of-the-art gradient manipulation methods including GradDrop (Chen et al., 2020), PCGrad (Yu et al., 2020), CAGrad (Liu et al., 2021a), and MGDA (Sener & Koltun, 2018) on Multi-Fashion+MNIST (Lin et al., 2019), CityScapes, NYUv2, and PASCAL-Context datasets. 3 [1.00,0.03](0.03,0.02](0.02,0.01](0.01,0.00](0.00, -0.01](-0.01, -0.02](-0.02, -0.03](-0.03, -1.00]cosij0.000.050.100.150.200.250.300.35ProbabilityJoint-trainGraddropPCGradCAGradMGDA Published as a conference paper at ICLR 2023 (a) Joint-train (b) PCGrad (c) Recon (d) Recon Figure 2: Illustration of the differences between joint-training, gradient manipulation, and our ap- proach. (a) In joint-training, the update vector (in green) is the average gradient 1 2 (gi + gj). Due to the conflict between gi and gj, the update vector is dominated by gi (in red). (b) PCGrad (Yu et al., 2020) projects each gradient onto the normal plane of the other one and uses the average of the projected gradients (indicated by dashed grey arrows) as the update vector (in green). As such, the update vector is less dominated by gi. (c) Our approach Recon finds the parameters contributing most (e.g., θ3) to gradient conflicts and turns them into task specific ones. In effect, it performs an orthographic/coordinate projection of conflicting gradients to the space of the rest parameters (e.g., θ1 and θ2) such that the projected gradients gfix j are better aligned. (d) Illustration of Recon i turning a shared layer with high conflict score to task-specific layers. and gfix The results are provided in Fig. 1, Fig. 5, Fig. 6, Fig. 7, Table 6, and Tables 8-10. It can be seen that gradient manipulation methods can only slightly reduce the occurrence of conflicting gradients (compared to joint-training) in some cases, and in some other cases they even increase it. 4 OUR APPROACH: REDUCING CONFLICTING GRADIENTS FROM THE ROOT Our pilot study shows that adjusting gradients for model update cannot effectively prevent the oc- currence of conflicting gradients in MTL, which suggests that the root causes of this phenomenon may be closely related to the nature of different tasks and the way how model parameters are shared among them. Therefore, to mitigate task conflicts for MTL, in this paper, we take a different ap- proach to reduce the occurrence of conflicting gradients from the root. 4.1 RECON: REMOVING LAYER-WISE CONFLICTING GRADIENTS i sh }n denote the gradient of task Ti w.r.t. the kth shared layer θ(k) Our approach is extremely simple and intuitive. We first identify the shared network layers where conflicts occur most frequently and then turn them into task-specific parameters. Suppose the shared model parameters θsh are composed of n layers, i.e., θsh = {θ(k) sh is the kth shared sh , i.e., g(k) layer. Let g(k) is a vector of the partial derivatives of Li w.r.t. the parameters of θ(k) ij denote the angle between g(k) and g(k) Definition 2 (Layer-wise Conflicting Gradients). The gradients g(k) conflicting with each other if cos φ(k) Definition 3 (S-Conflict Score). For any −1 < S ≤ 0, the S-conflict score for the kth shared layer is the number of different pairs (i, j)(i (cid:54)= j) s.t. cos φ(k) . We define layer-wise conflicting gradients and S-conflict score as follows. k=1, where θ(k) (i (cid:54)= j) are said to be sh . Let φ(k) ij < S, denoted as s(k). and g(k) ij < 0. j j i i i S indicates the severity of conflicts, and setting S smaller means we care about cases of more severe conflicts. The S-conflict score s(k) indicates the occurrence of conflicting gradients at severity level S for the kth shared layer. If s(k) = (cid:0)T (cid:1), it means that for any two different tasks, there is a conflict in their gradients w.r.t. the kth shared layer. By computing S-conflict scores, we can identify the shared layers where conflicts occur most frequently. 2 We describe our method Recon in Algorithm 1. First, we train the network for I iterations and compute S-conflict scores for each shared layer θ(k) in every iteration, denoted by {s(k) i=1. Then, i }I 4 giigjθθ1θθ2θθ3giigjθθ1θθ2θθ3giigjθθ1θθ2θθ3gjjfixgiifixTask1Task2High conflict scoreTurned task-specificTask1Task2 Published as a conference paper at ICLR 2023 Algorithm 1: Recon: Removing Layer-wise Conflicting Gradients Input: Model parameters θ, learning rate α, a set of tasks {Ti}T i=1, number of iterations I for computing conflict scores, conflict severity level S, number of selected layers K. // Train the network and compute conflict scores for all layers for iteration i = 1, 2, . . . , I do for i = 1 , 2, . . . , T do Compute the gradients of task Ti w.r.t. all shared layers, i.e., {g(k) i }n k=1 ; end Calculate the S-conflict scores for all shared layers in the current iteration, i.e., {s(k) Update θ with joint-training or any gradient manipulation method ; i }n k=1; end // Set layers with top conflict scores task-specific For each layer k, calculate the sum of S-conflict scores in all iterations, i.e., s(k) = (cid:80)I Select the top K layers with highest s(k) and set them task-specific; // Train the modified network from scratch for iteration i = 1, 2, . . . do i=1 s(k) i ; Update θ with joint-training or any gradient manipulation method; end Output: Model parameters θ. we sum up the scores in all iterations, i.e., s(k) = (cid:80)I , and find the layers with highest s(k) scores. Next, we set these layers to be task-specific and train the modified network from scratch. We demonstrate the effectiveness of Recon by a theoretical analysis in Sec. 4.2 and comprehensive ex- periments in Sec. 5. The results show that Recon can effectively reduce the occurrence of conflicting gradients in the remaining shared layers and lead to substantial improvements over state-of-the-art. i=1 s(k) i 4.2 THEORETICAL ANALYSIS Here, we provide a theoretical analysis of Recon. Let θsh = {θfix shared parameters, and θcf Notice that θcf 2 , * * * , θcf 1 , θcf model parameters are θr = {θfix sh are those that will be turned to task-specific parameters θcf T will all be initialized with θcf sh are the remaining 2 , * * * , θcf T . sh. Therefore, after applying Recon, the T }. An one-step gradient update of θr is: sh}, where θfix 1 , . . . , θts 1 , . . . , θcf sh , θcf 1 , θcf sh , θcf T , θts ˆθfix sh = θfix sh − α T (cid:88) i=1 wigfix i , ˆθcf i = θcf i − αgcf i , ˆθts i = θts i − αgts i , i = 1, . . . , T, (3) i = ∇θts where wi are weight parameters, gts Li, gcf Li. Notice that different methods such as joint-training, MGDA Sener & Koltun (2018), PCGrad Yu et al. (2020), and CAGrad Liu et al. (2021a) choose different wi dynamically. sh , θcf Without applying Recon, the model parameters are θ = {θfix ent update of θ is given by T }. An one-step gradi- Li and gfix i = ∇θfix 1 , . . . , θts i = ∇θcf sh, θts sh sh i ˆθfix sh = θfix sh − α T (cid:88) i=1 wigfix i , ˆθcf sh = θcf sh − α T (cid:88) i=1 wigcf i , ˆθts i = θts i − αgts i , i = 1, . . . , T. (4) After the one-step updates, the loss functions with the updated parameters ˆθr and ˆθ respectively are: L(ˆθr) = T (cid:88) i=1 Li (cid:16)ˆθfix sh , ˆθcf i , ˆθts i (cid:17) , and, L(ˆθ) = T (cid:88) i=1 Li (cid:16)ˆθfix sh , ˆθcf sh, ˆθts i (cid:17) , (5) where Li is the loss function of task Ti. Denote the set of indices of the layers turned task-specific by P, then θcf i=1 wi = 1, then we have the following theorem. sh }, k ∈ P. Assume that (cid:80)T sh = {θ(k) 5 Published as a conference paper at ICLR 2023 Table 1: Multi-task learning results on Multi-Fashion+MNIST dataset. All experiments are repeated over 3 random seeds and the mean values are reported. ∆m% denotes the average relative improve- ment of all tasks. #P denotes model size (MB). The grey cell color indicates that Recon improves the result of the base model. The best average result is marked in bold. Method T1 Acc↑ T2 Acc↑ ∆m%↑ #P. Single-task RotoGrad BMTAS Joint-train w/ Recon MGDA w/ Recon 98.37 89.63 - 85.62 98.10 88.25 -0.91 42.81 98.20 89.71 -0.04 85.61 97.42 88.82 -0.94 42.81 98.13 89.26 -0.33 43.43 95.19 89.46 -1.71 42.81 98.33 89.28 -0.22 43.43 PCGrad w/ Recon GradDrop w/ Recon CAGrad w/ Recon MMoE w/ Recon 97.37 88.68 -1.04 42.81 98.25 89.67 -0.04 105.70 98.28 89.65 -0.04 43.43 98.30 89.77 0.04 43.43 98.25 89.51 -0.13 43.43 97.38 88.57 -1.10 42.81 97.47 88.85 -0.90 42.81 98.27 89.51 -0.12 85.62 Table 2: Multi-task learning results on CelebA dataset. All experiments are repeated over 3 random seeds and the mean values are reported. ∆m% denotes the average relative improvement of all tasks. #P denotes model size (MB). The grey cell color indicates that Recon improves the result of the base model. The best average result is marked in bold. Method Average Error ∆m% ↑ #P. Single-task 8.38 - 1706.03 Joint-train w/ Recon CAGrad w/ Recon Graddrop w/ Recon PCGrad w/ Recon 8.33 0.55 43.26 8.22 1.92 68.03 8.31 0.79 43.26 8.23 1.74 68.03 8.33 0.23 43.26 8.20 2.13 68.03 8.64 -3.14 43.26 8.36 0.24 68.03 Theorem 4.1. Assume that L is differentiable and for any two different tasks Ti and Tj, it satisfies i (cid:107) < (cid:107)g(k) ij (cid:107)g(k) cos φ(k) ∀k ∈ P j (cid:107), (6) then for any sufficiently small learning rate α > 0, L(ˆθr) < L(ˆθ). (7) The theorem indicates that a single gradient update on the model parameters of Recon achieves lower loss than that on the original model parameters. The proof is provided in Appendix A 5 EXPERIMENTS In this section, we conduct extensive experiments to evaluate our approach Recon for multi-task learning and demonstrate its effectiveness, efficiency and generality. 5.1 EXPERIMENTAL SETUP Datasets. We evaluate Recon on 4 multi-task datasets, namely Multi-Fashion+MNIST (Lin et al., 2019), CityScapes (Cordts et al., 2016), NYUv2 (Couprie et al., 2013), PASCAL-Context (Mot- taghi et al., 2014), and CelebA (Liu et al., 2015). The tasks of each dataset are described as follows. 1) Multi-Fashion+MNIST contains two image classification tasks. Each image consists of an item from FashionMNIST and an item from MNIST. 2) CityScapes contains 2 vision tasks: 7-class se- mantic segmentation and depth estimation. 3) NYUv2 contains 3 tasks: 13-class semantic segmen- tation, depth estimation and normal prediction. 4) PASCAL-Context consists of 5 tasks: semantic segmentation, human parts segmentation and saliency estimation, surface normal estimation, and edge detection. 5) CelebA contains 40 binary classification tasks. Baselines. The baselines include 1) single-task learning (single-task): training all tasks indepen- dently; 2) joint-training (joint-train): training all tasks together with equal loss weights and all parameters shared; 3) gradient manipulation methods: MGDA (Sener & Koltun, 2018), PCGrad (Yu et al., 2020), GradDrop (Chen et al., 2020), CAGrad (Liu et al., 2021a), RotoGrad (Javaloy & Valera, 2022); 4) branched architecture search methods: BMTAS (Bruggemann et al., 2020); 5) Architec- ture design methods: Cross-Stitch (Misra et al., 2016), MMoE (Ma et al., 2018). Following Liu et al. (2021a), we implement Cross-Stitch based on SegNet (Badrinarayanan et al., 2017). For a fair comparison, all methods use same configurations and random seeds. We run all experiments 3 times with different random seeds. More experimental details are provided in Appendix B. Relative task improvement. Following Maninis et al. (2019), we compute the relative task im- provement with respect to the single-task baseline for each task. Given a task Tj, the relative task 6 Published as a conference paper at ICLR 2023 Table 3: Multi-task learning results on CityScapes dataset. All experiments are repeated over 3 random seeds and the mean values are reported. ∆m% denotes the average rel- ative improvement of all tasks. #P denotes the model size (MB). The grey cell color indicates that Recon improves the result of the base model. The best average result is marked in bold. Segmentation Depth Method (Higher Better) mIoU Pix Acc Abs Err Rel Err (Lower Better) ∆m% ↑ #P. Single-task Cross-Stitch RotoGrad Joint-train w/ Recon MGDA w/ Recon Graddrop w/ Recon PCGrad w/ Recon CAGrad w/ Recon 74.36 74.05 73.38 74.13 74.17 70.74 71.01 74.08 74.17 73.98 74.18 73.81 74.22 93.22 93.17 92.97 93.13 93.21 92.19 92.17 93.08 93.11 93.08 93.14 93.02 93.10 0.0128 0.0162 0.0147 0.0166 0.0136 0.0130 0.0129 0.0173 0.0134 0.02 0.0136 0.0153 0.0130 29.98 116.66 82.31 116.00 43.18 47.09 33.41 115.79 41.37 114.50 46.02 88.29 38.27 -79.04 -47.81 -79.32 -12.63 -16.22 -4.46 -80.48 -10.69 -78.39 -14.92 -53.81 -7.38 190.59 190.59 103.43 95.43 108.44 95.43 108.44 95.43 108.44 95.43 108.44 95.43 108.44 (a) (b) Figure 3: The performance of CAGrad combined with Recon on the Multi-Fashion+MNIST bench- mark with (a) different number of se- lected layers K (b) different severity value S for computing conflict scores. improvement is ∆mTj = 1 i=1(−1)li(Mi − Si)/Si, where Mi, Si refer to metrics for the ith cri- K terion obtained by objective model and single-task model respectively, li = 1 if a lower value for the criterion is better and 0 otherwise. The average relative task improvement is ∆m = 1 j=1 ∆mTj . T (cid:80)T (cid:80)K 5.2 COMPARISON WITH THE STATE-OF-THE-ART Recon improves the performance of all base models. The main results on Multi-Fashion+MNIST, and CelebA, CityScapes, PASCAL-Context, and NYUv2, are presented in Table 1, Table 2, Table 3, Table 4, and Table 5 respectively. (1) Compared to gradient manipulation methods, Recon consis- tently improves their performance in most evaluation metrics, and achieve comparable performance on the rest of evaluation metrics. (2) Compared with branched architecture search methods and architecture design methods, Recon can further improve the performance of BMTAS and MMoE. Besides, Recon combined with other gradient manipulation methods with small model size can achieve better results than branched architecture search methods with much bigger models. Small increases in model parameters can lead to good performance gains. Note that Recon only changes a small portion of shared parameters to task-specific. As shown in Table 1-5, Re- con increases the model size by 0.52% to 57.25%. Recon turns 1.42%, 1.46%, 12.77%, 0.26%, 9.80% shared parameters to task-specific on Multi-Fashion+MNIST, CelebA, CityScapes, NYUv2 and PASCAL-Context respectively. The results suggest that the gradient conflicts in a small portion (less than 13%) of shared parameters impede the training of the model for multi-task learning. Recon is compatible with various neural network architectures. We use ResNet18 on Multi- Fashion+MNIST, SegNet (Badrinarayanan et al., 2017) on CityScapes, MTAN (Liu et al., 2019) on NYUv2, and MobileNetV2 (Sandler et al., 2018) on PASCAL-Context. Recon improves the per- formance of baselines with different neural network architectures, including the architecture search method BMTAS (Bruggemann et al., 2020) which finds a tree-like structure for multi-task learning. Only one search of conflict layers is needed for the same network architecture. An interesting observation from our experiments is that network architecture seems to be the deciding factor for the conflict layers found by Recon. With the same network architecture (e.g., ResNet18), the found conflict layers are quite consistent w.r.t. (1) different training stages (e.g., the first 25% iterations, or the middle or last ones) (see Table 12 and Table 13 and discussion in Appendix C), (2) different MTL methods (e.g., joint-training or gradient manipulation methods) (see Table 14 and discussion in Appendix C), and (3) different datasets (see Table 15 and Table 16 and discussion in Appendix C). 7 5101520253035K0.60.40.20.0Performancem %0.150.100.050.00S0.30.20.1Performancem % Published as a conference paper at ICLR 2023 Table 4: Multi-task learning results on PASCAL-Context dataset with 4-task setting. All exper- iments are repeated over 3 random seeds and the mean values are reported. ∆m% denotes the average relative improvement of all tasks. #P denotes the model size (MB). The grey cell color indicates Recon improves the result of the base model. The best average result is marked in bold. SemSeg PartSeg saliency Surface Normal (Higher Better) (Lower Better) mIoU Pix Acc mIoU Pix Acc (Higher Better) mIoU Angle Distance (Lower Better) Mean Median Within t◦ (Higher Better) 22.5 11.25 ∆m% ↑ #P. 65.00 64.06 64.73 46.05 55.82 63.91 65.02 64.14 64.48 63.37 64.60 64.89 64.78 90.53 90.45 90.50 86.62 87.73 90.45 90.45 90.34 90.45 90.17 90.40 90.44 90.46 59.59 57.91 59.00 54.82 56.31 58.01 59.22 57.62 59.08 57.49 59.27 58.87 59.96 92.61 92.17 92.44 91.39 91.67 92.19 92.46 92.12 92.46 92.07 92.47 92.36 92.58 65.61 62.71 66.17 64.76 64.91 63.09 66.14 62.64 66.23 64.16 65.67 63.42 65.96 14.55 16.40 14.99 15.77 15.12 16.34 14.95 16.46 14.94 16.30 14.92 15.66 14.74 12.36 14.23 12.68 13.54 12.88 14.19 12.73 14.28 12.72 14.12 12.71 13.44 12.57 46.51 39.38 44.82 41.98 44.36 39.62 44.96 39.29 45.03 39.80 45.10 42.29 45.62 81.29 75.93 80.11 77.82 79.81 76.06 80.22 75.71 80.25 76.23 80.33 78.14 80.84 30.09 8.04 10.20 8.04 10.20 8.04 10.20 8.04 10.20 8.04 10.20 15.18 16.83 -4.82 -0.66 -7.67 -4.14 -4.59 -0.55 -5.00 -0.63 -4.37 -0.76 -2.89 -0.19 Method Single-task Joint-train w/ Recon MGDA w/ Recon PCGrad w/ Recon Graddrop w/ Recon CAGrad w/ Recon BMTAS w/ Recon Table 5: Multi-task learning results on NYUv2 dataset with MTAN as backbone. All experiments are repeated over 3 random seeds and the mean values are reported. ∆m% denotes the average relative improvement of all tasks. #P denotes the model size (MB). The grey cell color indicates that Recon improves the result of the base model. The best average result is marked in bold. Segmentation Depth Surface Normal Angle Distance (Higher Better) (Lower Better) (Lower Better) mIoU Pix Acc Abs Err Rel Err Mean Median Within t◦ (Higher Better) 22.5 11.25 30 38.67 40.45 39.48 39.54 29.28 32.82 38.70 40.14 38.55 38.61 39.89 39.92 64.27 66.15 65.23 65.20 60.30 61.26 64.97 66.08 65.07 65.48 66.47 66.07 0.6881 0.5051 0.5491 0.5312 0.6027 0.5884 0.5565 0.5265 0.54 0.5350 0.5496 0.5320 0.2788 0.2134 0.2235 0.2234 0.2515 0.2295 0.2333 0.2241 0.23 0.2271 0.2281 0.2200 24.87 27.58 27.87 26.55 24.89 25.17 27.41 26.51 26.90 26.31 26.36 25.80 18.99 23.00 23.76 21.40 19.32 19.72 23.00 21.45 22.05 21.11 21.47 20.59 30.43 24.69 22.68 26.53 29.85 28.18 23.79 26.51 24.98 26.90 25.50 27.60 57.81 49.47 47.91 52.60 57.18 56.49 49.45 52.48 51.36 53.21 52.68 54.31 69.70 62.36 61.58 65.31 69.38 68.96 62.87 65.26 64.41 65.95 65.90 67.05 Method Single-task Cross-Stitch Joint-train w/ Recon MGDA w/ Recon Graddrop w/ Recon PCGrad w/ Recon CAGrad w/ Recon ∆m% ↑ #P. 4.16 0.75 4.14 -2.26 0.53 0.49 4.67 2.02 3.87 3.74 5.80 285.88 285.88 168.72 169.59 168.72 169.59 168.72 169.59 168.72 169.59 168.72 169.59 Hence, in our experiments, we only search for the conflict layers once with the joint-training baseline in the first 25% training iterations and modify the network to improve various methods on the same dataset. We also find that the conflict layers found on one dataset can be used to modify the network to be directly applied on another dataset to gain performance improvement. 5.3 ABLATION STUDY AND ANALYSIS Recon greatly reduces the occurrence of conflicting gradients. In Fig. 4 and Table 6, we compare the distribution of cos φij before and after applying Recon on Multi-Fashion+MNIST (the results on other datasets are provided in Appendix C). It can be seen that Recon greatly reduces the numbers of gradient pairs with severe conflicts (cos φij ∈ (−0.01, −1]) by at least 67% and up to 79% when compared with joint-training, while gradient manipulation methods only slightly reduce the percentage and some even increases it. Similar observations can be made from Tables 8-10. Randomly selecting conflict layers does not work. To show that the performance gain of Re- con comes from selecting the layers with most severe conflicts instead of merely increasing model parameters, we further compare Recon with the following two baselines. RSL: randomly selecting 8 Published as a conference paper at ICLR 2023 Figure 4: The distribution of gradient conflicts (in terms of cos φij) of baselines and baselines with Recon on Multi-Fashion+MNIST dataset. Table 6: The distribution of gradient conflicts (in terms of cos φij) w.r.t. the shared parameters on Multi-Fashion+MNIST dataset. "Reduction" means the percentage of conflicting gradients in the interval of (−0.01, −1.0] reduced by the model compared with joint-training. The grey cell color indicates Recon greatly reduces the conflicting gradients (more than 50%). In contrast, gradient manipulation methods only slightly decrease their occurrence, and some method even increases it. cos φij [1.0, 0) (0, -0.01] (-0.01, -0.02] (-0.02, -0.03] (-0.03, -1.0] Joint-train w/ RSL w/ RSP w/ Recon MGDA w/ Recon Graddrop w/ Recon PCGrad w/ Recon CAGrad w/ Recon 56.56 31.25 9.26 2.05 1.25 53.44 27.35 13.45 4.18 1.58 58.15 34.33 6.38 0.8 0.34 40.13 58.53 37.67 3.04 0.5 0.25 69.82 56.06 32.36 8.87 1.71 1.0 7.80 56.50 40.93 2.12 0.26 0.18 79.62 57.26 31.06 8.93 1.72 1.03 7.01 57.61 38.28 3.32 0.54 0.26 67.20 56.72 31.19 9.09 1.90 1.10 3.74 57.75 38.76 2.87 0.42 0.2 72.21 56.18 31.25 9.37 2.00 1.20 -0.08 59.06 37.84 2.44 0.41 0.25 75.32 Reduction (%) - -52.94 Table 7: Comparison of Recon with RSL and RSP. PD: performance drop compared to Recon. Seed w/ RSL w/ RSP w/ Recon 0 1 2 0 1 2 - (cid:51) (cid:51) (cid:51) - (cid:51) (cid:51) (cid:51) - (cid:51) CAGrad PCGrad Task 1 Task2 Acc↑ 97.60 97.11 94.62 97.11 97.81 81.18 98.28 PD 0.68 1.18 3.66 1.18 0.47 17.10 0 Acc↑ 64.39 87.61 87.68 85.57 88.28 76.56 89.65 PD 25.26 2.04 1.96 4.07 1.36 13.09 0 #P. 73.02 83.63 76.33 52.25 51.96 47.50 43.42 Task 1 Task2 Acc↑ 97.43 94.92 92.90 96.93 97.63 88.71 98.30 PD 0.87 3.39 5.40 1.38 0.68 9.59 0 Acc↑ 65.57 87.31 87.41 88.16 88.55 84.51 89.77 PD 24.21 2.46 2.36 1.62 1.22 5.27 0 #P. 73.02 83.63 76.33 52.25 51.96 47.50 43.42 same number of layers as Recon and set them task-specific. RSP: randomly selecting similar amount of parameters as Recon and set them task-specific. The results in Table 7 show that both RSL and RSP lead to significant performance drops, which verifies the effectiveness of the selection strategy of Recon. We compare Recon with the baselines that selects the first or last K layers in Appendix C. Ablation study on hyperparameters. We study the influence of the conflict severity S and the number of selected layers K on the performance of CAGrad w/ Recon on Multi-Fashion+MNIST. As shown in Fig. 3, a small K leads to a significant performance drop, which indicates that there are still some shared network layers suffering from severe gradient conflicts, while a large K will not lead to further performance improvement since severe conflicts have been resolved. For the conflict severity S, we find that a high value of S (e.g., 0.0) leads to performance drops since it includes too many gradient pairs with small conflicts, while some of them are helpful for learning common structures and should not be removed. In the meantime, a too small S (e.g., −0.15) also leads to performance degradation because it ignores too many gradient pairs with large conflicts, which may be detrimental to learning. While K and S are sensitive, we may only need to tune them once for a given network architecture, as discussed in Sec. 5.2. 6 CONCLUSION We have proposed a very simple yet effective approach, namely Recon, to reduce the occurrence of conflicting gradients for multi-task learning. By considering layer-wise gradient conflicts and iden- tifying the shared layers with severe conflicts and setting them task-specific, Recon can significantly reduce the occurrence of severe conflicting gradients and boost the performance of existing meth- ods with only a reasonable increase in model parameters. We have demonstrated the effectiveness, efficiency, and generality of Recon via extensive experiments and analysis. 9 [1.00, 0.00](0.00, -0.01](-0.01, -0.02](-0.02, -0.03](-0.03, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityJoint-trainJoint-train w/ RSPJoint-train w/ RSLJoint-train w/ Recon[1.00, 0.00](0.00, -0.01](-0.01, -0.02](-0.02, -0.03](-0.03, -1.00]cosij0.00.10.20.30.40.5ProbabilityMGDAMGDA w/ Recon[1.00, 0.00](0.00, -0.01](-0.01, -0.02](-0.02, -0.03](-0.03, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityGraddropGraddrop w/ Recon[1.00, 0.00](0.00, -0.01](-0.01, -0.02](-0.02, -0.03](-0.03, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityPCGradPCGrad w/ Recon[1.00, 0.00](0.00, -0.01](-0.01, -0.02](-0.02, -0.03](-0.03, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityCAGradCAGrad w/ Recon Published as a conference paper at ICLR 2023 ACKNOWLEDGMENTS The authors would like to thank Lingzi Jin for checking the proof of Theorem A.1 and the anony- mous reviewers for their insightful and helpful comments. REFERENCES Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. Segnet: A deep convolutional encoder- decoder architecture for image segmentation. IEEE transactions on pattern analysis and machine intelligence, 39(12):2481–2495, 2017. Felix JS Bragman, Ryutaro Tanno, Sebastien Ourselin, Daniel C Alexander, and Jorge Cardoso. Stochastic filter groups for multi-task cnns: Learning specialist and generalist convolution kernels. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1385–1394, 2019. David Bruggemann, Menelaos Kanakis, Stamatios Georgoulis, and Luc Van Gool. Automated search for resource-efficient branched multi-task networks. British Machine Vision Conference (BMVC), 2020. Rich Caruana. Multitask learning. Machine learning, 28(1):41–75, 1997. Zhao Chen, Vijay Badrinarayanan, Chen-Yu Lee, and Andrew Rabinovich. Gradnorm: Gradient normalization for adaptive loss balancing in deep multitask networks. In International Conference on Machine Learning, pp. 794–803. PMLR, 2018. Zhao Chen, Jiquan Ngiam, Yanping Huang, Thang Luong, Henrik Kretzschmar, Yuning Chai, and Just pick a sign: Optimizing deep multitask models with gradient sign Dragomir Anguelov. dropout. Advances in Neural Information Processing Systems, 33:2039–2050, 2020. Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2016. Camille Couprie, Cl ́ement Farabet, Laurent Najman, and Yann LeCun. Indoor semantic segmenta- tion using depth information. CoRR, abs/1301.3572, 2013. Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009. Carlo D'Eramo, Davide Tateo, Andrea Bonarini, Marcello Restelli, Jan Peters, et al. Sharing knowl- edge in multi-task deep reinforcement learning. In International Conference on Learning Repre- sentations, pp. 1–11. OpenReview. net, 2020. Chris Fifty, Ehsan Amid, Zhe Zhao, Tianhe Yu, Rohan Anil, and Chelsea Finn. Efficiently identify- ing task groupings for multi-task learning. Advances in Neural Information Processing Systems, 34:27503–27516, 2021. Yuan Gao, Jiayi Ma, Mingbo Zhao, Wei Liu, and Alan L Yuille. Nddr-cnn: Layerwise feature fusing in multi-task cnns by neural discriminative dimensionality reduction. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 3205–3214, 2019. Yuan Gao, Haoping Bai, Zequn Jie, Jiayi Ma, Kui Jia, and Wei Liu. Mtl-nas: Task-agnostic neural architecture search towards general-purpose multi-task learning. In Proceedings of the IEEE/CVF Conference on computer vision and pattern recognition, pp. 11543–11552, 2020. Michelle Guo, Albert Haque, De-An Huang, Serena Yeung, and Li Fei-Fei. Dynamic task priori- tization for multitask learning. In Proceedings of the European conference on computer vision (ECCV), pp. 270–287, 2018. Pengsheng Guo, Chen-Yu Lee, and Daniel Ulbricht. Learning to branch for multi-task learning. In International Conference on Machine Learning, pp. 3854–3863. PMLR, 2020. 10 Published as a conference paper at ICLR 2023 Kazuma Hashimoto, Caiming Xiong, Yoshimasa Tsuruoka, and Richard Socher. A joint many-task model: Growing a neural network for multiple nlp tasks. Empirical Methods in Natural Language Processing (EMNLP), 2017. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recog- nition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 770–778, 2016. Adri ́an Javaloy and Isabel Valera. Rotograd: Gradient homogenization in multitask learning. In International Conference on Learning Representations, 2022. Alex Kendall, Yarin Gal, and Roberto Cipolla. Multi-task learning using uncertainty to weigh losses In Proceedings of the IEEE/CVF conference on computer for scene geometry and semantics. vision and pattern recognition, pp. 7482–7491, 2018. Iasonas Kokkinos. Ubernet: Training a universal convolutional neural network for low-, mid-, and high-level vision using diverse datasets and limited memory. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6129–6138, 2017. Xi Lin, Hui-Ling Zhen, Zhenhua Li, Qing-Fu Zhang, and Sam Kwong. Pareto multi-task learning. Advances in Neural Information Processing Systems, 32, 2019. Bo Liu, Xingchao Liu, Xiaojie Jin, Peter Stone, and Qiang Liu. Conflict-averse gradient descent for multi-task learning. Advances in Neural Information Processing Systems, 34:18878–18890, 2021a. Liyang Liu, Yi Li, Zhanghui Kuang, J Xue, Yimin Chen, Wenming Yang, Qingmin Liao, and Wayne Zhang. Towards impartial multi-task learning. In International Conference on Learning Repre- sentations, 2021b. Shikun Liu, Edward Johns, and Andrew J Davison. End-to-end multi-task learning with attention. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 1871–1880, 2019. Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE international conference on computer vision, pp. 3730–3738, 2015. Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Philip S Yu. Learning multiple tasks with multilinear relationship networks. Advances in Neural Information Processing Systems, 30, 2017. Jiaqi Ma, Zhe Zhao, Xinyang Yi, Jilin Chen, Lichan Hong, and Ed H Chi. Modeling task relation- ships in multi-task learning with multi-gate mixture-of-experts. In Proceedings of the 24th ACM SIGKDD international conference on knowledge discovery & data mining, pp. 1930–1939, 2018. Kevis-Kokitsi Maninis, Ilija Radosavovic, and Iasonas Kokkinos. Attentive single-tasking of multi- ple tasks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recog- nition, pp. 1851–1860, 2019. Elliot Meyerson and Risto Miikkulainen. Beyond shared hierarchies: Deep multitask learning through soft layer ordering. In International Conference on Learning Representations, 2018. Ishan Misra, Abhinav Shrivastava, Abhinav Gupta, and Martial Hebert. Cross-stitch networks for multi-task learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 3994–4003, 2016. Roozbeh Mottaghi, Xianjie Chen, Xiaobai Liu, Nam-Gyu Cho, Seong-Whan Lee, Sanja Fidler, Raquel Urtasun, and Alan Yuille. The role of context for object detection and semantic segmen- tation in the wild. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 891–898, 2014. Emilio Parisotto, Lei Jimmy Ba, and Ruslan Salakhutdinov. Actor-mimic: Deep multitask and transfer reinforcement learning. In International Conference on Learning Representations, 2016. 11 Published as a conference paper at ICLR 2023 Clemens Rosenbaum, Tim Klinger, and Matthew Riemer. Routing networks: Adaptive selection of non-linear functions for multi-task learning. In International Conference on Learning Represen- tations, 2018. Sebastian Ruder. An overview of multi-task learning in deep neural networks. arXiv preprint arXiv:1706.05098, 2017. Sebastian Ruder, Joachim Bingel, Isabelle Augenstein, and Anders Søgaard. Latent multi-task ar- chitecture learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 4822–4829, 2019. Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mo- bilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 4510–4520, 2018. Ozan Sener and Vladlen Koltun. Multi-task learning as multi-objective optimization. Advances in Neural Information Processing Systems, 31, 2018. Jiayi Shen, Xiantong Zhen, Marcel Worring, and Ling Shao. Variational multi-task learning with gumbel-softmax priors. Advances in Neural Information Processing Systems, 34:21031–21042, 2021. Trevor Standley, Amir Zamir, Dawn Chen, Leonidas Guibas, Jitendra Malik, and Silvio Savarese. Which tasks should be learned together in multi-task learning? In International Conference on Machine Learning, pp. 9120–9132. PMLR, 2020. Sebastian Thrun and Joseph O'Sullivan. Discovering structure in multiple learning tasks: The tc algorithm. In International Conference on Machine Learning, volume 96, pp. 489–497, 1996. Simon Vandenhende, Stamatios Georgoulis, Wouter Van Gansbeke, Marc Proesmans, Dengxin Dai, and Luc Van Gool. Multi-task learning for dense prediction tasks: A survey. IEEE transactions on pattern analysis and machine intelligence, 2021. Ruihan Yang, Huazhe Xu, Yi Wu, and Xiaolong Wang. Multi-task reinforcement learning with soft modularization. Advances in Neural Information Processing Systems, 33:4767–4777, 2020. Tianhe Yu, Saurabh Kumar, Abhishek Gupta, Sergey Levine, Karol Hausman, and Chelsea Finn. Gradient surgery for multi-task learning. Advances in Neural Information Processing Systems, 33:5824–5836, 2020. Amir R Zamir, Alexander Sax, William Shen, Leonidas J Guibas, Jitendra Malik, and Silvio Savarese. Taskonomy: Disentangling task transfer learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 3712–3722, 2018. 12 Published as a conference paper at ICLR 2023 A PROOF OF THEOREM A.1 Theorem A.1. Assume that L is differentiable and for any two different tasks Ti and Tj, it satisfies i (cid:107) < (cid:107)g(k) ij (cid:107)g(k) cos φ(k) ∀k ∈ P j (cid:107), (8) then for any sufficiently small learning rate α > 0, L(ˆθr) < L(ˆθ). Proof. We consider the first order Taylor approximation of Li. For normal update, we have (cid:16)ˆθfix sh , ˆθcf sh, ˆθts i (cid:17) =Li Li (cid:0)θfix (cid:1) + (ˆθfix sh , θcf sh − θcf sh, θts i sh)(cid:62)gcf sh − θfix i − θts sh )(cid:62)gfix i i )(cid:62)gts i + (ˆθts + (ˆθcf i + o(α). For Recon update, we have sh , ˆθcf (cid:16)ˆθfix Li i , ˆθts i (cid:17) =Li (cid:0)θfix (cid:1) + (ˆθfix sh , θcf i − θcf sh, θts i sh)(cid:62)gcf sh − θfix i − θts sh )(cid:62)gts i i )(cid:62)gts i + (ˆθts + (ˆθcf i + o(α). The difference between the two loss functions after the update is (cid:16)ˆθfix sh , ˆθcf i , ˆθts i (cid:17) − Li (cid:16)ˆθfix sh , ˆθcf sh, ˆθts i (cid:17) Li =(ˆθcf sh)(cid:62)gcf i + o(α)  (cid:62) wjgcf j  gcf i + o(α) T (cid:88) j=1 wj (cid:0)gcf i − gcf j (cid:1)(cid:62) gcf i + o(α) i − ˆθcf  gcf = − α i − = − α = − α T (cid:88) j=1 T (cid:88) j=1 wj (cid:0)(cid:107)gcf i (cid:107)2 − gcf j (cid:62)gcf i (cid:1) + o(α). (17) Assume, without loss of generality, that (cid:107)gcf (cid:13) (cid:13)gcf i (cid:13) 2 (cid:13) − gcf j (cid:62)gcf i = = (cid:13) 2 (cid:13) (cid:13) i (cid:107) (cid:54)= 0, then (cid:18)(cid:13) (cid:13)g(k) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)g(k) (cid:13) i i (cid:88) k∈P (cid:88) k∈P > 0. − g(k) i (cid:19) (cid:62)g(k) j (cid:16)(cid:13) (cid:13)g(k) (cid:13) i (cid:13) (cid:13) − cos φ(k) (cid:13) ij (cid:13) (cid:13)g(k) (cid:13) j (cid:17) (cid:13) (cid:13) (cid:13) Hence, the above difference is negative, if α is sufficiently small. As such, the difference between the multi-task loss functions is also negative, if α is sufficiently small. (cid:16)ˆθfix sh , ˆθcf i , ˆθts i (cid:17) − T (cid:88) i=1 Li L(ˆθr) − L(ˆθ) = T (cid:88) i=1 Li B EXPERIMENTAL SETUP B.1 MULTI-FASHION+MNIST (cid:16)ˆθfix sh , ˆθcf sh, ˆθts i (cid:17) < 0 (21) Model. We adopt ResNet18 (He et al., 2016) without pre-training as the backbone and modify the dimension of the output features to 100 for the last linear layer. For the task-specific heads, we define two linear layers followed by a ReLU function. 13 (9) (10) (11) (12) (13) (14) (15) (16) (18) (19) (20) Published as a conference paper at ICLR 2023 Tasks, losses, and metrics. Each task is a classification problem with 10 classes and we use the cross-entropy loss as the classification loss. For evaluation, we use the classification accuracy as the metric for each task. Model hyperparameters. We train the model for 120 epochs with the batch size of 256. We adopt SGD with an initial learning rate of 0.1 and decay the learning rate by 0.1 at the 60th and 90th epoch. Baseline hyperparameters. For CAGrad, we set α = 0.2. For BMTAS, we set the resource loss weight to 1.0, and we search the architecture for 100 epochs. For RotoGrad, we set Rk = 100 which is equal to the dimension of shared features and set the learning rate of rotation parameters as learning rate of the neural networks. For MMoE, the initial learning rate of expert networks and gates are 0.1 and 1e − 3 respectively. Recon hyperparameters. We use CAGrad to train the model for 30 epochs and compute the conflict score of each shared layer. We set S = −0.1 for computing the scores. We select 25 layers with the highest conflict scores and turn them into task-specific layers. B.2 CITYSCAPES Model. We adopt SegNet (Badrinarayanan et al., 2017) as the backbone where the decoder is split into two convolutional heads. Model hyperparameters. We train the model for 200 epochs with the batch size of 8. We adopt Adam with an initial learning rate of 5e − 5 and decay the learning rate by 0.5 at the 100th epoch. Baselines hyperparameters. For CAGrad, we set α = 0.2. For RotoGrad, we set Rk = 1024 and set the learning rate of rotation parameters as 10 times less than the learning rate of the neural networks. Recon hyperparameters. We use joint-train to train the model for 40 epochs and compute the conflict score of each shared layer. We set S = 0.0 for computing the scores. We select 39 layers with the highest conflict scores and turn them into task-specific layers. B.3 NYUV2 Model. We adopt MTAN (Liu et al., 2019) – the SegNet combined with task-specific attention modules on the encoder. Model hyperparameters. We train the model for 200 epochs with the batch size of 2. We adopt Adam with an initial learning rate of 1e − 4 and decay the learning rate by 0.5 at the 100th epoch. Baseline hyperparameters. For CAGrad, we set α = 0.4 similar with Liu et al. (2021a). Recon hyperparameters. We use joint-train to train the model for 40 epochs and compute the conflict score of each shared layer. We set S = −0.02 for computing the scores. We select 22 layers with the highest conflict scores and turn them into task-specific layers. B.4 PASCAL-CONTEXT Model. Following Bruggemann et al. (2020), we employ MobileNetv2 Sandler et al. (2018) as the backbone with a reduced design of the ASPP module (R-ASPP) (Sandler et al., 2018). We pre-train the model on ImageNet (Deng et al., 2009). Model hyperparameters. We train the model for 130 epochs with the batch size of 6. We adopt Adam with an initial learning rate of 1e − 4 and decay the learning rate by 0.1 at the 70th and 100th epoch. Baselines hyperparameters. For CAGrad, we set α = 0.1. For BMTAS, we set the resoure loss weight to 0.1, and we search the architecture for 130 epochs. Recon hyperparameters. We use joint-train to train the model for 40 epochs and compute the conflict score of each shared layer. We set S = −0.02 for computing the scores. We select 85 layers with the highest conflict scores and turn them into task-specific layers. 14 Published as a conference paper at ICLR 2023 B.5 CELEBA Model. Following Sener & Koltun (2018), we use ResNet18 (He et al., 2016) as the backbone network. We pre-train the model on ImageNet (Deng et al., 2009). Model hyperparameters. We train the model for 5 epochs. We adopt Adam with an initial learning rate of 5e − 5 and decay the learning rate by 0.5 at the 3th epoch. Baselines hyperparameters. For CAGrad, we set α = 0.1. Recon hyperparameters. We use joint-train to train the model for 2 epochs and compute the conflict score of each shared layer. We set S = −0.05. We select 25 layers with the highest conflict scores and turn them into task-specific layers. C ADDITIONAL ABLATION STUDY The distribution of gradient conflicts. In addition to the statistics on Multi-Fashion+MNIST, we further show the distributions of gradient conflicts of various baselines on CityScapes, NYUv2, and PASCAL-Context in Fig 5, Fig 6, and Fig 7 respectively. We compare the distributions with those of baselines w/ Recon on the three datasets in Fig. 8, Fig. 9, and Fig. 10 respectively. The detailed statistics are provided in Tables 8-10. Figure 5: The distributions of gradient conflicts (in terms of cos φij) of the joint-training baseline and state-of-the-art gradient manipulation methods on CityScapes dataset. Figure 6: The distributions of gradient conflicts (in terms of cos φij) of the joint-training baseline and state-of-the-art gradient manipulation methods on NYUv2 dataset. Figure 7: The distributions of gradient conflicts (in terms of cos φij) of the joint-training baseline and state-of-the-art gradient manipulation methods on PASCAL-Context dataset. 15 [1.00,0.08](0.08,0.06](0.06,0.04](0.04,0.02](0.02,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.000.050.100.150.20ProbabilityJoint-trainGraddropPCGradCAGradMGDA[1.00,0.08](0.08,0.06](0.06,0.04](0.04,0.02](0.02,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.5ProbabilityJoint-trainGraddropPCGradCAGradMGDA[1.00,0.08](0.08,0.06](0.06,0.04](0.04,0.02](0.02,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.000.050.100.150.200.25ProbabilityJoint-trainGraddropPCGradCAGradMGDA Published as a conference paper at ICLR 2023 Figure 8: The distribution of gradient conflicts (in terms of cos φij) w.r.t. the shared parameters on CityScapes. RSL: randomly selecting same number of layers as Recon and set them task-specific. RSP: randomly selecting similar amount of parameters as Recon and set them task-specific. Figure 9: The distribution of gradient conflicts (in terms of cos φij) of baselines and baselines with Recon on NYUv2. RSL: randomly selecting same number of layers as Recon and set them task- specific. RSP: randomly selecting similar amount of parameters as Recon and set them task-specific. Figure 10: The distribution of gradient conflicts (in terms of cos φij) of baselines and baselines with Recon on PASCAL-Context. RSL: randomly selecting same number of layers as Recon and set them task-specific. RSP: randomly selecting similar amount of parameters as Recon and set them task-specific. Table 8: The distribution of gradient conflicts (in terms of cos φij) w.r.t. the shared parameters on CityScapes dataset. "Reduction" means the percentage of conflicting gradients in the interval of (−0.02, −1.0] reduced by the model compared with joint-training. The grey cell color indicates Recon greatly reduces the conflicting gradients (more than 50%). In contrast, gradient manipulation methods only moderately decrease their occurrence (MGDA deceases it by 22%), and some methods even increase it. Joint-train w/ RSL w/ RSP w/ Recon MGDA w/ Recon Graddrop w/ Recon PCGrad w/ Recon CAGrad w/ Recon cos φij [1.0, 0) (0, -0.02] (-0.02, -0.04] (-0.04, -0.06] (-0.06, -0.08] (-0.08, -1.0] 59.55 10.14 8.52 6.45 4.79 10.54 53.16 9.01 7.34 5.69 4.53 20.26 Reduction (%) - -24.82 59.56 9.61 8.19 6.49 4.76 11.38 -1.72 73.82 19.75 5.17 1.05 0.16 0.05 78.78 59.85 9.58 7.94 6.24 4.41 11.98 -0.89 74.52 19.43 4.89 0.96 0.15 0.06 80.03 60.79 11.13 8.83 6.05 4.06 9.13 7.36 74.54 19.77 4.62 0.89 0.13 0.04 81.22 58.29 10.77 8.72 6.48 4.61 11.13 -2.11 73.62 20.13 5.13 0.94 0.14 0.03 79.41 63.9 12.51 8.59 5.39 3.29 6.33 22.11 78.27 12.54 5.54 2.23 0.85 0.56 69.70 16 [1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityJoint-trainJoint-train w/ RSPJoint-train w/ RSLJoint-train w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityMGDAMGDA w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityGraddropGraddrop w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityPCGradPCGrad w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityCAGradCAGrad w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.60.7ProbabilityJoint-trainJoint-train w/ RSPJoint-train w/ RSLJoint-train w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.60.7ProbabilityMGDAMGDA w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.60.7ProbabilityGraddropGraddrop w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.60.7ProbabilityPCGradPCGrad w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.60.7ProbabilityCAGradCAGrad w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityJoint-trainJoint-train w/ RSPJoint-train w/ RSLJoint-train w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityMGDAMGDA w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityGraddropGraddrop w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityPCGradPCGrad w/ Recon[1.00,0.00](0.00, -0.02](-0.02, -0.04](-0.04, -0.06](-0.06, -0.08](-0.08, -1.00]cosij0.00.10.20.30.40.50.6ProbabilityCAGradCAGrad w/ Recon Published as a conference paper at ICLR 2023 Table 9: The distribution of gradient conflicts (in terms of cos φij) w.r.t. the shared parameters on NYUv2 dataset. "Reduction" means the percentage of conflicting gradients in the interval of (−0.04, −1.0] reduced by the model compared with joint-training. The grey cell color indicates Recon greatly reduces the conflicting gradients (more than 50%). In contrast, gradient manipulation methods only slightly decrease their occurrence, and some methods even increase it. cos φij [1.0, 0) (0, -0.02] (-0.02, -0.04] (-0.04, -0.06] (-0.06, -0.08] (-0.08, -1.0] Joint-train w/ RSL w/ RSP w/ Recon MGDA w/ Recon Graddrop w/ Recon PCGrad w/ Recon CAGrad w/ Recon 61.96 3.85 3.63 3.39 3.11 24.05 52.61 3.75 3.60 3.43 3.30 33.31 59.70 3.47 3.41 3.11 2.94 27.37 -9.39 73.99 14.17 7.07 2.89 1.13 0.76 84.35 61.28 2.97 2.77 2.81 2.64 27.53 -7.95 74.08 13.38 7.21 3.19 1.28 0.87 82.52 62.93 3.83 3.70 3.45 3.16 22.92 3.34 75.35 13.50 6.71 2.71 1.03 0.70 85.47 63.25 3.61 3.62 3.26 3.06 23.20 3.37 75.54 12.66 6.66 2.98 1.25 0.90 83.21 61.95 3.53 3.39 3.21 3.05 24.88 -1.93 74.49 14.20 6.96 2.71 1.01 0.63 85.76 Reduction (%) - -31.06 Table 10: The distribution of gradient conflicts (in terms of cos φij) w.r.t. the shared parameters on PASCAL-Context dataset. "Reduction" means the percentage of conflicting gradients in the interval of (−0.02, −1.0] reduced by the model compared with joint-training. The grey cell color indicates Recon greatly reduces the conflicting gradients (more than 50%). In contrast, gradient manipulation methods only slightly decrease their occurrence, and some methods even increase it. cos φij [1.0, 0) (0, -0.02] (-0.02, -0.04] (-0.04, -0.06] (-0.06, -0.08] (-0.08, -1.0] 61.26 9.66 7.90 5.85 4.16 11.16 Reduction (%) - Joint-train w/ RSL w/ RSP w/ Recon MGDA w/ Recon Graddrop w/ Recon PCGrad w/ Recon CAGrad w/ Recon 59.20 21.01 9.91 3.05 1.32 1.30 46.41 60.47 18.25 9.10 3.88 1.79 2.29 41.31 63.99 23.57 7.65 2.59 1.07 1.13 57.21 60.40 8.51 7.27 5.68 4.35 13.80 -6.98 63.61 33.53 2.04 0.45 0.17 0.20 90.16 61.18 9.66 7.89 5.80 4.21 11.24 -0.24 63.76 23.41 7.83 2.71 1.12 1.16 55.90 61.35 9.83 7.90 5.82 4.13 10.97 0.86 63.83 23.61 7.65 2.66 1.10 1.16 56.76 60.99 9.95 8.03 5.91 4.23 10.88 0.07 63.78 24.04 7.53 2.51 1.04 1.08 58.20 Table 11: Multi-task learning results on Multi-Fashion+MNIST dataset. LSK refers to turning the fist K layers into task-specific layers. FSK refers to turning the last K layers into task-specific layers. PD denotes the performance drop compared with Recon. LSK FSK w/ Recon Task 1 CAGrad Task2 (cid:51) (cid:51) - (cid:51) Acc↑ 97.63 98.21 98.28 PD 0.66 0.07 0 Acc↑ 89.14 89.15 89.65 PD 0.50 0.50 0 Task 1 PCGrad Task2 Acc↑ 97.63 98.19 98.30 PD 0.65 0.09 0 Acc↑ 88.98 89.51 89.77 PD 0.66 0.13 0 #P. 84.17 48.90 43.42 #P. 84.17 48.90 43.42 Selecting the first K layers and the last K Layers as conflict layers does not work. To fur- ther support the conclusion that the selection of parameters with higher probability of conflicting gradients contributes most to the performance gain rather than the increase in model capacity. We compare Recon with two baselines: (1) Select the first K neural network layers and turn them into task-specific layers. (2) Select the last K neural network layers and turn them into task-specific layers. The multi-task learning results on the Multi-Fashion+MNIST benchmark are presented in Table 11. The results show that if we directly turn the top or the bottom of the neural network into task-specific parameters, it still will lead to performance degradation compared to Recon. Recon finds similar layers in different training stages. Recon ranks the network layers according to the computed S-conflict scores. The ranking result can be represented as a layer permutation, denoted as π, and π(l) is the position of layer l. The similarity between two rankings πi and πj can be measured as: d(πi, πj) = |πi(l) − πj(l)|, (22) l∈L where L denotes the set of neural network layers. In Table 12, we measure the differences in rankings obtained in different training stages (e.g., in the first 25% iterations or the second 25% iterations) (cid:88) 1 |L| 17 Published as a conference paper at ICLR 2023 Table 12: The distance between the layer permutations (rankings) obtained in different training stages on Multi-Fashion+MNIST dataset. "Iter." denotes iterations. Training Stage 1st 25% Iter. 2nd 25% Iter. 3rd 25% Iter. 4th 25% Iter. All Iter. 1st 25% Iter. 0 2.39 1.85 1.95 1.36 2nd 25% Iter. - 0 2.14 2.24 1.95 3rd 25% Iter. - - 0 0.68 0.82 4th 25% Iter. All Iter. - - - 0 0.97 - - - - 0 Table 13: Performance of the networks modified by Recon with conflict layers found in different training stages of joint-training on CityScapes dataset. ∆m% denotes the average relative improve- ment of all tasks. #P denotes the model size (MB). The best result is marked in bold. Model Single-task 1st 25% Iterations 2nd 25% Iterations 3rd 25% Iterations 4th 25% Iterations All Iterations Depth (Lower Better) Segmentation (Higher Better) mIoU Pix Acc Abs Err Rel Err 29.98 74.36 43.18 74.17 42.45 74.20 41.34 74.80 41.34 74.80 41.34 74.80 0.0128 0.0136 0.0135 0.0136 0.0136 0.0136 93.22 93.21 93.19 93.19 93.19 93.19 ∆m% #P. 190.59 108.439 108.440 109.567 109.567 109.567 -12.63 -11.83 -10.90 -10.90 -10.90 on Multi-Fashion+MNIST by Eq. 22. The small distances (less than 2.4) indicate that the layers found in different training stages are quite similar. In Table 13, we compare the performance of the networks modified by Recon with conflict layers found in different training stages on CityScapes. It can be seen that the results of the last three rows are the same, which is because the layers found in the 3rd 25% iterations, 4th 25% iterations, and all iterations are exactly the same (the rankings may be slightly different though). The layers found in the later stages lead to slightly better performance than those found in the early stages (i.e., 1st 25% iterations and 2nd 25% iterations), indicating the conflict scores in early iterations might be a little noisy. However, since the performance gaps are acceptably small, to save time, we use the initial 25% training iterations to find conflict layers. Table 14: The distance between the layer permutations (rankings) obtained by Recon with different methods on Multi-Fashion+MNIST dataset. Method Joint-train CAGrad PCGrad Gradrop MGDA PCGrad Gradrop MGDA - - - 0 1.56 0 1.07 0.78 0.59 1.71 - 0 1.17 0.83 1.32 - - 0 0.68 1.90 Joint-train CAGrad - - - - 0 Recon finds similar layers with different MTL methods. In Table 14, we measure the differences in layer permutations (rankings) obtained by Recon with different methods (e.g., CAGrad and PC- Grad) on Multi-Fashion+MNIST by Eq. 22. The small distances (less than 1.9) indicate that the layers found by Recon with different methods are quite similar. Therefore, in our experiments, we only use joint-training to search for the conflict layers once, and directly apply the modified network to improve different gradient manipulation methods as shown in Tables 1-5. The conflict layers found by Recon with the same architecture are transferable between dif- ferent datasets. We conduct experiments with three different architectures: ResNet18, SegNet, and MTAN. (1) For Resnet18, we find that the layers found by Recon on CelebA and those found on Multi-Fashion+MNIST are exactly the same. (2) For SegNet, we find that 95% layers (38 out of 40) 18 Published as a conference paper at ICLR 2023 Table 15: Multi-task learning results on NYUv2 dataset with SegNet as backbone. Recon∗ de- notes setting the layers found on CityScapes to task-specific. ∆m% denotes the average relative improvement of all tasks. #P denotes the model size (MB). The grey cell color indicates that Recon or Recon∗ improves the result of the base model. Segmentation Depth Surface Normal Method (Higher Better) (Lower Better) Angle Distance (Lower Better) mIoU Pix Acc Abs Err Rel Err Mean Median Within t◦ (Higher Better) 22.5 30 11.25 Single-task 38.67 64.27 0.6881 0.2788 24.8683 18.9919 30.43 57.81 69.7 Joint-train w/ Recon w/ Recon∗ MGDA w/ Recon w/ Recon∗ Graddrop w/ Recon w/ Recon∗ PCGrad w/ Recon w/ Recon∗ CAGrad w/ Recon w/ Recon∗ 38.62 40.68 38.81 25.71 36.64 36.85 39.01 39.78 39.97 40.01 40.03 39.93 38.87 40.68 39.97 65.36 66.12 63.69 57.72 62.36 63.51 66.13 65.63 65.71 65.77 65.92 65.46 66.54 66.12 65.92 0.5378 0.5786 0.5637 0.6033 0.5613 0.5760 0.5462 0.5460 0.5544 0.5349 0.5523 0.5494 0.5331 0.5372 0.5298 0.2273 0.2558 0.2413 0.2358 0.2255 0.2362 0.2296 0.2280 0.2261 0.2227 0.2384 0.2315 0.2289 0.2266 0.2273 29.92 26.72 26.75 24.53 24.66 24.89 29.72 26.42 26.52 28.53 26.24 26.82 25.85 25.44 25.56 25.82 21.41 21.73 18.65 18.66 18.96 25.51 21.16 21.37 24.08 20.89 21.70 20.60 19.87 20.11 20.79 26.58 26.16 31.22 31.30 30.53 19.87 26.89 26.65 22.33 27.30 26.34 27.50 28.96 28.69 44.29 52.58 51.80 58.46 58.47 57.94 44.68 53.16 52.65 47.42 53.66 52.04 54.41 56.00 55.37 57.36 65.20 64.64 70.21 70.16 69.82 58.12 65.84 65.46 60.69 66.25 64.74 67.10 68.28 67.75 ∆m% ↑ #P. 285.88 95.58 139.59 121.59 95.58 139.59 121.59 95.58 139.59 121.59 95.58 139.59 121.59 95.58 139.59 121.59 -1.62 2.15 1.59 -2.15 5.37 4.34 -1.52 4.45 4.21 1.43 4.19 3.53 5.60 6.99 6.47 Table 16: Multi-task learning results on CityScapes dataset with MTAN as backbone. Recon∗ de- notes setting the layers found on NYUv2 to task-specific. ∆m% denotes the average relative improvement of all tasks. #P denotes the model size (MB). The grey cell color indicates that Recon or Recon∗ improves the result of the base model. Segmentation Depth Method (Higher Better) mIoU Pix Acc Abs Err Rel Err (Lower Better) ∆m% ↑ #P. Single-task 73.74 93.05 0.0129 27.71 Joint-train w/ Recon w/ Recon∗ MGDA w/ Recon w/ Recon∗ Graddrop w/ Recon w/ Recon∗ PCGrad w/ Recon w/ Recon∗ CAGrad w/ Recon w/ Recon∗ 75.35 75.72 76.32 70.46 72.23 70.83 75.19 75.60 76.49 75.64 75.89 76.24 75.26 75.65 76.25 93.55 93.74 93.76 91.75 92.60 92.14 93.53 93.72 93.82 93.54 93.71 93.69 93.50 93.71 93.74 45.64 40.90 46.40 34.33 26.93 25.69 46.35 38.55 47.54 43.53 40.05 45.24 44.23 36.23 40.05 -23.26 -11.36 -16.44 -26.02 1.37 1.31 -23.90 -8.71 -16.81 -23.60 -10.35 -14.66 -23.40 -6.15 -8.99 0.0169 0.0130 0.0132 0.0224 0.0122 0.0125 0.0168 0.0127 0.0129 0.02 0.0129 0.0128 0.0176 0.0125 0.0123 19 190.58 157.19 196.32 159.19 157.19 196.32 159.19 157.19 196.32 159.19 157.19 196.32 159.19 157.19 196.32 159.19 Published as a conference paper at ICLR 2023 found on NYUv2 are identical to those found on CityScapes. On NYUv2, we compare the perfor- mance of using conflict layers found on NYUv2 (baselines w/ Recon) to that of using conflict layers found on CityScapes (i.e., baselines w/ Recon∗), as shown in Table 15. (3) For MTAN (SegNet with attention), we find that 68% layers (17 out of 25) found on CityScapes are identical to those found on NYUv2. On CityScapes, we compare the performance of using conflict layers found on CityScapes (baselines w/ Recon) to that of using conflict layers found on NYUv2 (i.e., baselines w/ Recon∗), as shown in Table 16. The results show that the conflict layers found on one dataset can be used to modify the network to be directly used on another dataset to consistently improve the performance of various baselines, while searching for the conflict layers again on the new dataset may lead to better performance. Figure 11: Comparison of running time (one iteration, excludes data fetching) on CelebA dataset. Analysis of running time. We evaluate how Recon scales with the number of tasks on CelebA dataset, by comparing the running time of one iteration used by Recon in computing gradient conflict scores (the most time-consuming part of Recon) to that of the baselines. The results in Fig. 11 show that Recon is as fast as other gradient manipulation methods such as CAGrad (Liu et al., 2021a) and Graddrop (Chen et al., 2020), but much slower than joint-training especially when the number of tasks is large, which is natural since Recon needs to compute pariwise cosine similarity of task gradients. However, since Recon only needs to search for the conflict layers once for a given network architecture, as discussed above, the running time is not a problem. 20 246810121416182022242628303234363840Number of tasks0.00.10.20.30.40.50.60.70.80.91.01.11.21.31.41.51.61.71.81.92.02.12.22.3Time (s/iter)ReconJoint-trainCAGradGraddropPCGrad
http://arxiv.org/abs/2302.11286v1
2023-02-22T11:05:05
2023-02-22T11:05:05
Neural-based classification rule learning for sequential data
Discovering interpretable patterns for classification of sequential data is of key importance for a variety of fields, ranging from genomics to fraud detection or more generally interpretable decision-making. In this paper, we propose a novel differentiable fully interpretable method to discover both local and global patterns (i.e. catching a relative or absolute temporal dependency) for rule-based binary classification. It consists of a convolutional binary neural network with an interpretable neural filter and a training strategy based on dynamically-enforced sparsity. We demonstrate the validity and usefulness of the approach on synthetic datasets and on an open-source peptides dataset. Key to this end-to-end differentiable method is that the expressive patterns used in the rules are learned alongside the rules themselves.
[ "Marine Collery", "Philippe Bonnard", "François Fages", "Remy Kusters" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11286v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11286v1", "@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 2 2 ] G L . s c [ 1 v 6 8 2 1 1 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 NEURAL-BASED CLASSIFICATION RULE LEARNING FOR SEQUENTIAL DATA Marine Collery1,2∗, Philippe Bonnard1, Franc ̧ois Fages2 & Remy Kusters1,3 1IBM France Lab, 2Inria Saclay, 3IBM Research ABSTRACT Discovering interpretable patterns for classification of sequential data is of key im- portance for a variety of fields, ranging from genomics to fraud detection or more generally interpretable decision-making. In this paper, we propose a novel differ- entiable fully interpretable method to discover both local and global patterns (i.e. catching a relative or absolute temporal dependency) for rule-based binary classi- fication. It consists of a convolutional binary neural network with an interpretable neural filter and a training strategy based on dynamically-enforced sparsity. We demonstrate the validity and usefulness of the approach on synthetic datasets and on an open-source peptides dataset. Key to this end-to-end differentiable method is that the expressive patterns used in the rules are learned alongside the rules themselves. 1 INTRODUCTION During the last decades, machine learning and in particular neural networks have made tremendous progress on classification tasks for a variety of fields such as healthcare, fraud detection or entertain- ment. They are able to learn from various data types ranging from images to timeseries and achieve impressive classification accuracy. However, they are difficult or impossible to understand by a hu- man. Recently, explaining those black-box models has attracted considerable research interest under the field of Explainable AI (XAI). However, as stated by Rudin (2019), those aposteriori approaches are not the solution for high stakes decision-making and more interest should be placed on learning models that are interpretable in the first place. Rule-based methods are interpretable, human-readable and have been widely adopted in different industrial fields with Business Rule Management Systems (BRMS). In practice however, those rules are manually written by experts. One of the reasons manually-written rule models cannot easily be replaced with learned rule models is that rule-base learning models are not able to learn as expressive rules with higher-level concepts and complex grammar (Kramer, 2020). Moreover, due to the lack of latent representations, rule-based learning methods underperform w.r.t. state-of-the-art neural networks (Beck & F ̈urnkranz, 2021). Classical classification rule learning algorithms (Cohen, 1995; Breiman et al., 1984; Dash et al., 2018; Lakkaraju et al., 2016; Su et al., 2016) as well as neural-based approaches to learn rules (Qiao et al., 2021; Kusters et al., 2022) (or logical expressions with Riegel et al. (2020)) do not provide the grammar required to learn classification rules on sequential data. Numerous approaches for learning classification rules on sequential data in the field of sequential pattern mining have been studied in the past such as Egho et al. (2015); Zhou et al. (2013); Holat et al. (2014) but with a different goal in mind : improve the performance of extracted patterns for a fixed rule grammar as opposed to extending the rule grammar. Another domain of research focuses on training binary neural networks to obtain more computational efficient model storing, computation and evaluation efficiency (Geiger & Team, 2020; Helwegen et al., 2019). It comes with fundamental optimization challenges around weights updates and gradient computation. In this paper, we bridge three domains and introduce a binary neural network to learn classification rules on sequential data. We propose a differentiable rule-based classification model for sequen- tial data where the conditions are composed of sequence-dependent patterns that are discovered ∗Corresponding author [email protected] 1 Published as a conference paper at ICLR 2023 alongside the classification task itself. More precisely, we aim at learning a rule of the following structure: if pattern then class = 1 else class = 0. In particular we consider two types of patterns: lo- cal and global patterns as introduced in Aggarwal (2002) that are in practice studied independently with a local and a global model. A local pattern describes a subsequence at a specific position in the sequence while a global pattern is invariant to the location in the sequence (Fig 2). The network, that we refer to as Convolutional Rule Neural Network (CR2N), builds on top of a base rule model that is comparable to rule models for tabular data presented in Qiao et al. (2021); Kusters et al. (2022). The contributions of this paper are the following: i) We propose a convolutional binary neural net- ii) We work that learns classification rules together with the sequence-dependent patterns in use. present a training strategy to train a binarized neural network while dynamically enforcing sparsity. iii) We show on synthetic and real world datasets the usefulness of our architecture with the impor- tance of the rule grammar and the validity of our training process with the importance of sparsity. 2 BASE RULE MODEL The base rule model we invoke is composed of three consecutive layers (Fig 1). The two last layers respectively mimic logical AND and OR operators (Qiao et al., 2021; Kusters et al., 2022). On top of these layers, we add an additional layer that is specific for categorical input data and corresponds to an OR operator for each categorical variable over every possible value it can take. StackedOR layer k nk, K(cid:1) (cid:0)(cid:80) AND layer (K, H) OR layer (H, 1) xc1 = A1 . B1 . . C1 D1 xc2 = A2 . B2 . . C2 D2 xc3 = A3 . B3 . . C3 D3 B1 x1 x1 D2 x2 x2 C3 x3 h1 B1 and D2 h2 h2 h3 D2 and C3 h4 h5 y if (B1 and D2) or (D2 and C3) then 1 else 0 Figure 1: Example of a trained base rule model architecture for the rule if (B1 and D2) or (D2 and C3) then 1 else 0 on 3 categorical variables xc1, xc2 and xc3 (xck ∈ {Ak, Bk, Ck, Dk}). For simplicity, the truth value of xc1 = B1 is replaced by B1 for example. Plain (dotted) lines represent activated (masked) weights. An example evaluation of the model is represented with the filled neurons (neuron=1) for the binary input xc1 = B1, xc2 = D2 and xc3 = A3. The AND layer takes binary features (which are atomic boolean formulae) as input and outputs to the OR layer. The output of the OR layer is mapped to the classification label y. These layers have binary weights specifying the nodes that are included in the respective boolean expression (conjunction or disjunction). In other words, this network implements the evaluation of a DNF and has a direct equivalence with a binary classification rule like if (A ∧ B) ∨ C then class = 1 else class = 0, where A, B and C are binary input features (atoms in logical terms). In this paper, we focus on supervised binary classification where we predict the label y ∈ {0, 1} given input data x. The base rule model is illustrated in Fig 1 and is composed of three binary neural layers. • Input neurons x, are binarized input features of size K (xc are one-hot encoded categorical input features of size n). • Hidden neurons h, are conjunctions of the input features of size H. 2 Published as a conference paper at ICLR 2023 • Output neuron y, is a disjunction of the (hidden) conjunctions. We assign to each of boolean operations, i.e. AND and OR operations, a binary weight (Wand and Wor respectively) that plays the role of a mask to filter nodes with regards to their respective logical operation. For the sake of simplicity, we did not extend the model with a logical NOT operation. The disjunction operation is implemented as, y = min(Worh, 1). (1) If none of the neurons h are activated then y = 0, and y = 1 if at least one is. For the conjunction operation, we use the De Morgan's law that express the conjunction with the OR operator A ∧ B = ¬(¬A ∨ ¬B). Combined with Eq 1, we obtain: h = ¬(min(Wand(¬x), 1)) = 1 − min(Wand(1 − x), 1). (2) StackedOR Input Layer As defined previously, the AND layer takes binary input features as In this paper, we propose to add an additional layer for categorical data. A categorical input. variable xc can take one value αc i out of a fixed number of possible values n e.g. {α0, . . . , α3} = {A, B, C, D}. Without any additional layer, it requires a one-hot encoding to be provided as input to the AND layer. Binary inputs xc = A and xc = B are then given as input to the AND layer that can in theory represent the impossible expression xc = A ∧ xc = B i.e the model has to learn the hidden categorical relationship between the one-hot encoded variables. To prevent learning a distribution we already know, we deepen the model with the addition of a stacked architecture of OR layers as input of the AND layer as shown in Fig 1. This structure is defined by K weights, W k stack, for each input categorical variables and will be referred to as the StackedOR layer with Wstack weights. To conclude, the base rule model is composed of a StackedOR layer for categorical variables, a logical AND layer and an OR layer. The formal grammar that this architecture can express is specified with the following production rules (see Appendix A for the full grammar): rule → if base expressionthen class = 1 else class = 0 base expression → conjunction | conjunction ∨ base expression conjunction → predicate | predicate ∧ conjunction predicate → categorical expression | literal categorical expression → categorical literal | categorical literal ∨ categorical expression 0 | . . . | xc = αc categorical literal → xc = αc nc (or simply αc 0 | . . . | αc nc ) (3) literal → x1 | x2 | . . . This grammar is also limited by the model architecture: conjunction contains at most one occurrence of each predicate and the total number of conjunction(s) is bounded by the number of hidden nodes. 3 CONVOLUTIONAL RULE NEURAL NETWORK Our main contribution is to extend the base rule model for sequential data. We apply the base rule model as a 1D-convolutional window of fixed length l ∈ N over a sequence and retrieve all outputs as input for an additional disjunctive layer which we refer to as the ConvOR layer as shown in Fig 2 1. The base rule model learns a DNF over the window size length and the ConvOR layer indicates where along the sequence that logical expression is true. If the evaluation of the logical expression is true all along the sequence then it can be described as a global pattern, otherwise the learned pattern represents a local pattern. The model input is now of size (cid:80) k l × nk and output of StackedOR layer (or input of the AND layer) is l × K. Other dimensions are not impacted. For simplicity in the following, K is fixed to 1 i.e. input data is composed of one categorical variable evolving sequentially. The method is still valid for K > 1. Fig 1 is also still valid with a change of index, k is now referring to the position in the window of size l. With this approach, different sequence-dependent expressions can be extracted and their nature de- pends on the weights of the ConvOR layer (Fig 2). If all the weights, Wconv, of the ConvOR layer 1A natural extension for sequential data of the base rule architecture would be to extend it with an explicit recursion of the base rule model, similar to a RNN. This approach was tested but faced the same limitations as any classical RNNs, i.e., vanishing gradients and only captures short-term dependencies. 3 Published as a conference paper at ICLR 2023 t D B C A D B A Filter: Base Rule Model (B at t-2 and D at t-1) or (D at t-1 and C at t-0) Evaluation of base rule model on every window ConvOR layer local (B at t-5 and D at t-4) or (D at t-4 and C at t-3) y global B-D or D- C in sequence Figure 2: Example of a trained CR2N architecture. The base rule model is applied as 1D- convolutional window over the sequence (i.e. sliding window). The resulting boolean values are given as input of the ConvOR layer which indicates through its activated weights where along the sequence the expression learned by the base model is true. The output of the ConvOR layer is mapped to the label of the sequence y. For local patterns, the base model expression needs to be shifted accordingly to the ConvOR layer weights. For a real-domain application like fraud detec- tion, by providing meaning to B, C and D, we could have for example if "receiving a transaction of amount X"(B) is followed by "emitting a transaction of amount X" (D) or "emitting a transaction of amount X"(D) is followed by "closing the bank account"(C) then class=fraud. are activated (i.e. equal to 1), the logical expression learned by the base model is true in all the sequence: a global pattern is learned. If only some of the weight of the ConvOR layer are acti- vated, the logical expression learned by the base model is valid only in the window associated to that weight: a local pattern is learned. The base model logical expression is modified accordingly to match that shift (see example in Fig 2 with a shift of 3 sequential steps). The obtained weights thus translate to a rule grammar with the following production rules: rule expression → local pattern | global pattern → if expression then class = 1 else class = 0 (4) We introduce t, the position when the last observation in a sequence was made. With t being our reference, in a sequence of size N ∈ N, t − i refers to the moment of the ith observation before t (0 ≤ i ≤ N − 1). A, B, C and D are toy binary input possible values for our categorical variable xc (they cannot be activated simultaneously at the same position t in the sequence). With those definitions, we list below examples of different sequence-dependent expressions that can be expressed with the proposed architecture (see Fig 2): A local pattern is an expression composed of predicates that are true at a specific position i, for example A at t-15. Based on Eq 3 we have: local pattern → base expression predicate → categorical expression at t-i | literal at t-i. (5) A global pattern is an expression describing the presence of a pattern anywhere in the sequence, for example B-D in sequence is a global pattern where "−" sign refers to "followed by" and "∗" correspond to any unique literal (equivalent to ∀i ∈ [0; N − 1], B at t-i-1 and D at t-i) . If inputs are sequences of characters, global patterns can be compared to simple regular expressions supporting the logical OR (metacharacter'[ ]'). Based on Eq 3 we have: global pattern → base expression conjunction → predicate | * | predicate − conjunction (6) 4 Published as a conference paper at ICLR 2023 Additional special cases can be pointed out such as the learning of a global pattern over an interval (e.g. B-*-D in window [t-6; t-3]) or the learning of sequence characteristics dependant expression such as 4 ≤ len(sequence) ≤ 6 based on the sequence length (not shown on Fig 2 but it corresponds to a specific case where the base model has learned an always true rule). Also, it is important to note that base expression and conjunction in both grammars are bounded by the fixed window size l. To ensure full equivalence between the model and rule, sequences boundaries need to be considered, especially for global patterns. All sequences are padded on both ends with a sequence of 0 of size l − 1 (not shown for simplicity on Fig 2). Also sequences of different lengths are supported by creating a model based on the maximal available sequence length M in the data and padding shorter sequences with a sequence of 0 of appropriate length. ConvOR layer input size is then M + l − 1. With this one architecture we can model both local and global patterns. However for optimization reasons detailed below, we choose to differentiate the two into two distinct models: a local and a global model. The ConvOR layer weights for the global model are set and fixed to 1 during training. 4 TRAINING STRATEGY To overcome training challenges attributed to binarized neural networks (Geiger & Team, 2020), we use latent weights and enforce sparsity dynamically. We define a loss function that penalizes complex rules and the model is trained via automatic differentiation (Pytorch) with Adam optimizer. Latent weights The binary model parameters introduced above (Wand, Wor, Wstack, Wconv) are trained indirectly via the training of a continuous parameter loc which is activated (binarized) by a sigmoid function (Kusters et al., 2022). With such binary weights and continuous relaxation Eq 1 and 2 are differentiable with nonzero derivatives (Kusters et al., 2022). As opposed to when using a straight through estimator (Qiao et al., 2021), non-zero gradients are ensured during the backward pass. To overcome training limitations, we use a hard concrete distribution (Qiao et al., 2021; Louizos et al., 2018). It rescales the weights and the random variable introduced during training prevents from obtaining local minima (Appendix B). Weight values are in [0, 1] during training, while for testing and rule extraction, a Heaviside is applied to them (≥ 0.5) to ensure strict binarization. Loss function We define the loss function L composed of a mean-squared error component along with a regularization term that penalize the complexity of the rule, L = Lmse + λΠ (7) That regularization term Π, or penalty, evaluates the number of terminal conditions in the rule. In practice we use λ = 10−5. For a layern of input size I and output size O, the number of terminal conditions per output corresponds to the weighted sum of the number of terminal conditions of each output of the previous layer i.e. Πlayern = (cid:80) I Wlayern Πlayern−1, a vector of size O. For the first layer, the StackedOR layer, Πstack is defined as the sum over the input dimension of the weights and we can then express the number of terminal conditions of the base rule model Πbase. Πlayer0 = Πstack =    stack (cid:80) W1 ... (cid:80) WK stack    , Πbase = (cid:88) Wor (cid:88) WandΠstack (8) For optimizing Π for local patterns, we have to minimize the activated ConvOR layer weights. For global patterns, we want them to all be activated. A condition could be set on the sum of ConvOR layer weights (Eq 9) to shift from one optimization problem to the other but with loss of continuity and thus differentiability (interesting values of τ being M + l − 1, the ConvOR layer input size, that would correspond to all ConvOR layer weights being equal to 1, or M − l + 1 that would allow for 2(l − 1) weights to be 0, and corresponds to the padding required for properly accounting for sequence boundaries (Section 3)). Πlocal = Πbase (cid:88) Wconv, Πglobal = Πbase, Π∗ = (cid:40) Πglobal Πlocal if (cid:80) Wconv ≥ τ otherwise (9) 5 Published as a conference paper at ICLR 2023 Table 1: Ground truth applied on sequences of letters (A to F) to generate synthetic unbalanced datasets 1, 2, 3 and 4 along with the distributions of the positive class. In the patterns, t refers to the position when the last observation in a sequence was made. Balanced datasets with same ground truth are generated and are referred to as the dataset number followed by the letter b (Appendix D). Ground truth # Distribution (%) C at t-4 A at t-6 and C at t-4 (A at t-6 and C at t-4) or (B at t-5 and C at t-3) B-D in sequence 1 2 3 4 14.2 1.5 3.6 20.4 Due to non continuity of Π∗ in Eq 9, we choose to have two models with the same architecture for the two cases: the local and the global model respectively more relevant for their associated pattern. For the local model, all weights are trainable and Π = Πlocal. For the global model, weights in the ConvOR layer are fixed and set to 1, and Π = Πglobal. Enforced sparsity Sparsity of the model is crucial to learn concise expressions, the model needs to generalize without observing all possible instances at training time. The first requirement for that matter is sparsity in the base rule model. In addition to the regularization term in the loss function, we propose to use a sparsify-during-training method (Hoefler et al., 2021) and dynamically enforce sparsity in weights from 0% to an end rate rf set to 99% in our case (Lin et al., 2020). Sparsify-during-training method can also benefit the quality of the training in terms of convergence by correcting for approximation errors due to premature pruning in early iterations but is highly dependant on the sparsification schedule (Hoefler et al., 2021). Every 16 iterations s and for a total of sf training iterations, every trainable weight is pruned with a binary mask, m (of size of its associated weight and applied with Hadamard product ((cid:12))) (Lin et al., 2020; Zhu & Gupta, 2017). We propose a mask based on the maximum of weight magnitude loc and pruning rate r (Zhu & Gupta, 2017) making the assumption that it contributes to generalization (Eq 10). This strategy can be more aggressive than state-of-art contributions (Lin et al., 2020) due to its dependency to the loc maximum value. During training, the model with the highest prediction accuracy on validation dataset and the highest sparsity (evaluated at each epoch) is kept. (cid:18) r = rf − rf 1 − (cid:19)3 , s sf mi,j = |loci,j| ≥ r × maxi,j(loc), ˆW = W (cid:12) m (10) Additional training optimizations have been tested out such as for example using a binarized opti- mizer (Helwegen et al., 2019; Geiger & Team, 2020), adding a scheduled cooling on the sigmoid of the binarized weights, alternating the training of each layer every few epochs (Qiao et al., 2021) or using a learning rate scheduler. Those techniques are not presented here but would be of interest for improving results on specific datasets. 5 EXPERIMENTS In order to evaluate the validity and usefulness of this method, we apply it to both synthetic datasets and UCI membranolytic anticancer peptides dataset (Grisoni et al., 2019; Dua & Graff, 2017). Synthetic Datasets We propose 8 synthetic datasets based on 4 ground truth expressions in both balanced and unbalanced distributions for discovering simple binary classification rules with local or global patterns as shown in Table 1. There are 1000 sequences of letters (A to F) of different length from 4 to 14 letters in each of them (Mean around 9±3). Generation is detailed in Appendix D. Peptides Dataset Besides the synthetic datasets, real-world UCI anticancer peptides dataset com- posed of labeled one-letter amino acid sequences, is used (Grisoni et al., 2019; Dua & Graff, 2017). The multi-classification problem is transformed into a binary classification problem is the same manner as Nwegbu et al. (2022) (see Appendix C). Sequence length are from 5 to 38 letters (Mean: 17 ± 5.5) and positive class distribution is 79%. 6 Published as a conference paper at ICLR 2023 Experimental Setting All datasets are partitioned in a stratified fashion with 60% for training, 20% for validation and 20% for testing datasets and we use a batch size of 100 sequences. The hidden size in the base rule model is set to the double of the input size of the AND layer (which is the window size of the convolution). More details on experimental setting can be found in Appendix E. At each epoch (200 in total), we evaluate the model against the validation dataset and keep the model with the highest accuracy and in case of equality the model with lowest penalty. For each experiment, we run the algorithm 10 times with different weights initializations. Resulting metrics are averaged over these runs. We run the experiments with two different window sizes (3 and 6) for the CR2N convolution filter size. We compare the two versions of the architecture: the local and global models described in Section 4 and study three different dynamic pruning strategies: none, dynamic enforced sparsity from epoch=0 and from epoch=30 (arbitrary). 6 RESULTS Figure 3: Representations of key results obtained on the synthethic datasets. Error bars represent the standard deviation over the 10 executions with different weights initializations. Full results are available in Appendix F. 7 globallocalModel0.60.81.0BalancedAccuracy(a)window=6,pruning=NogloballocalModel0100200Penalty(b)window=6,pruning=No36WindowSize0.60.81.0BalancedAccuracy(c)model=local,pruning=NoNoYes30PruningStrategy050100150BestEpoch(d)window=6,model=localNoYes30PruningStrategy0.60.81.0BalancedAccuracy(e)window=6,model=localNoYes30100200Penalty(f)window=6,model=localNoYes30PruningStrategy020Dataset1234unbalancedbalanced Published as a conference paper at ICLR 2023 Table 2: Performance metrics obtained for the different models, window size and pruning strategy on the peptides dataset, along with the standard deviations over the 10 executions with different weights initializations. (Bal. Acc.: balanced accuracy, Epoch: best epoch). Model Window Pruning Accuracy Bal. Acc. Penalty (Π) Epoch global local 3 6 3 6 No Yes 30 No Yes 30 No Yes 30 No Yes 30 88.9 ± 5.0 85.3 ± 5.3 88.7 ± 5.0 91.2 ± 1.0 89.5 ± 3.6 91.0 ± 1.3 90.0 ± 3.7 90.3 ± 1.5 89.2 ± 5.2 92.1 ± 1.0 88.0 ± 4.7 91.7 ± 1.5 75.3 ± 12.7 67.3 ± 14.3 75.4 ± 12.9 58.7 ± 35.9 19.4 ± 15.9 46.9 ± 28.0 105 ± 60 23 ± 20 48 ± 22 81.8 ± 2.0 77.6 ± 9.3 82.0 ± 2.8 78.7 ± 9.7 81.6 ± 1.6 76.3 ± 13.2 83.5 ± 2.5 74.6 ± 12.4 83.5 ± 2.6 220.0 ± 56.5 132.7 ± 93.9 97.3 ± 60.6 694.3 ± 269.3 885.2 ± 328.7 674.7 ± 483.9 3.9k ± 1.4k 1.0k ± 1.0k 1.8k ± 0.6k 92 ± 82 33 ± 15 71 ± 19 77 ± 48 25 ± 8 49 ± 13 91 ± 58 34 ± 16 49 ± 10 Rule grammar and expressivity The importance of the rule model expressivity can be seen con- cretely by comparing the different patterns the local and global models have learned for dataset 3b for example: 1. (A or B)-*-(C)-*-*-(A or B or C or D or E or F) in sequence (global, no pruning, window size=6), and 2. (B at t-5 and C at t-3) or (A at t-6 and C at t-4) (local, pruning, window size=6). In the first case, the grammar is not appropriate to model the data (as a reminder, the global model is a constrained version of the local model) as opposed to the local model that learned the perfect rule. In practice, on real data, obtained patterns, such as "if (D or E or G or H or I or N or Q or T or Y)-*-*-*-(D or E or G or I or N or Q or S or T or V or Y) in sequence" obtained for labelling 'invalid-virtual' peptides, can be explored further by a domain expert. Black box approaches do not provide such insights. It is also highlighted by comparing experiments with local or global model and experiments with different window sizes. First of all, the accuracy of the local model is higher compared to the global model on balanced synthetic datasets 1, 2 and 3 (Fig 3(a)). For balanced and unbalanced dataset 4, both models achieve very high accuracies (> 95%). However, as shown on Fig 3(b), it is at the cost of rule complexity for the local approach with averaged penalty values higher than 60 (and standard deviation higher than 50) compared to lower than 10 for the global model (and standard deviation lower than 5). It points out that the local model in that case requires on average at least more than 6 times more terminal conditions in the learned rule than the global model for comparable accuracies, but also that the weights initial states have a huge impact on the rule complexity when the rule grammar is not expressive enough (with no pruning). Those results are confirmed on real-world dataset with the peptides dataset, accuracies between the local and global models especially for a window size of 6 are comparable. However there is an order of magnitude difference for the penalty, global approach being more concise. It is important to note that by architecture the global approach has less weights to train and thus a much lower maximum penalty. Datasets 2b and 3b benefit from a bigger window size (highly expected for dataset 3/3b due to ground truth pattern size) as shown in Fig 3(c). Accuracies are also higher with window size 6 than 3 for the peptides dataset at the cost of also higher penalties (Table 2). The more expressive the model is i.e. the more patterns it can model, training limitations aside, the better for the performance. Of course any black box neural network with no such 1-1 rule mapping constrained architecture would reach 100% accuracy, but it is that mapping in particular that makes the model relevant, expressive and fully interpretable. Also, the best performances in accuracy for the peptides dataset (∼ 91%) are comparable to the best results (∼ 92%) obtained from classification with single kernels when applied to that same dataset in Nwegbu et al. (2022), our model providing an additional fully-interpretable property. The presented model is also flexible due to its logical equivalence and can be inputted into other logical layers for deeper architectures to extend the rule grammar (Beck & F ̈urnkranz, 2021). It can also be extended for timeseries, temporal aggregates or 8 Published as a conference paper at ICLR 2023 multi-classification problems. Other rule grammar extensions can be inspired by Linear Temporal Logic domain and regular expression pattern mining (De Giacomo et al., 2022). However the more expressive the model is the more attention is required for training and rule complexity. Sparsity and training strategy The importance of the model sparsity is pointed out by the exper- iments with different pruning strategies. First, looking at training scenarios, both on synthethic and peptide datasets, experiments with sparsity-during-training approaches reach the best model faster on average than without (lower best epoch Fig 3(d)). Then, regarding the performance in terms of accuracy, we can differentiate two cases: balanced and unbalanced datasets. Training of unbalanced datasets is more affected by the aggressive dynamic pruning strategy than balanced datasets with a drop in average of around 0.2 in accuracy for dataset 1 compared to an equivalent accuracy for balanced dataset 1 for example (Fig 3(e)). The pruning strategy starting after 30 epochs is preferred in both cases. Average accuracies with a pruning strategy not starting immediately (30 epochs) are comparable to the ones obtain without pruning for balanced datasets. In terms of rule complexity, penalty values are lower with pruning and even lower when starting after 30 epochs in most cases (Fig 3(f)). With our pruning strategy (Eq 10), we make the assumption that lower positive loc values are asso- ciated to overfitting or redundancy by taking into account that values closer to 0, i.e. on the sigmoid slope, are more likely to shift thus less 'certain'. As pointed out in early work by Prechelt (1997), the dynamic pruning strategy helps to overcome possible lower generalization ability compared to a fixed pruning which could explain cases of better performance (peptide dataset local model window size of 3 for example). Prechelt proposed a different pruning strategy based on a generalization loss to characterize the amount of overfitting. When this strategy is relevant in more general cases and can be applied to many different networks, our strategy is tailored for minimizing positive trainable parameter values. Sparsity of the model is also induced via the regularization term Π in the loss function L (Eq 7). While this method is parameterized with a relative importance of sparsity for training optimization and provides an uncontrolled target sparsity, a dynamic pruning strategy is easier to control for both target sparsity and accuracy but is highly dependent on the pruning schedule (Hoefler et al., 2021). An interesting point is made by Hoefler et al. (2021) about the convolutional operator that 'can be seen as a sparse version of fully-connected layers'. That level of forced sparsity in our model is therefore defined by the fixed window size model parameter with respect to the maximum sequence length. The ideal sparser window size would be the size of the maximum temporal hidden pattern in distribution that can only be approximated with external or expert knowledge and/or tuned with trial and error. With or without a dynamic pruning strategy, for highly unbalanced datasets (2 and 3), experiments have shown that the training strategy of the model is not suitable. Indeed most of them, label everything with the majority class (50% balanced accuracy). It corresponds to the specific case of learning an empty rule (penalty=0) (Fig 3(a,c,e)). For unbalanced datasets 1 and 4, their best models do not reach on average the same accuracies as in their balanced versions. Overall this training strategy is both the key and the main limitation of our approach: it can provide a sharp concise rule with minimal redundancy and simplified logical expression but it is highly dependent on numerous model, training and pruning parameters and is not suited as is for highly unbalanced datasets. 7 CONCLUSION To conclude, we presented a 1D-convolutional neural architecture to discover local and global pat- terns in sequential data while learning binary classification rules. This architecture is fully differ- entiable, interpretable and requires sparsity that is enforced dynamically. One main limitation is its dependence to the window size and sparsity scheduler parameters. Further work will consist in integrating this block into more complex architectures to augment the expressivity of the learned rules as well as extending it for multi-classification. 9 Published as a conference paper at ICLR 2023 AUTHOR CONTRIBUTIONS M.C. and R.K. designed the model. R.K. encouraged M.C. to investigate the use of convolutions and supervised the findings of this work. P.B. and F.F. helped supervise the project. M.C. vali- dated the training strategy and carried out the implementation and the experiments. M.C. wrote the manuscript. All authors provided critical feedback and helped shape the manuscript. ACKNOWLEDGMENTS We would like to thank Shubham Gupta for helpful discussions and constructive feedback as well as Yusik Kim for reviewing the manuscript. This work has been partially funded by the French government as part of project PSPC AIDA 2019-PSPC-09, in the framework of the "Programme d'Investissement d'Avenir". REFERENCES Charu C. Aggarwal. On effective classification of strings with wavelets. In Proceedings of the Eighth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '02, pp. 163–172, New York, NY, USA, July 2002. Association for Computing Machinery. ISBN 978-1-58113-567-1. doi: 10.1145/775047.775071. Florian Beck and Johannes F ̈urnkranz. Beyond DNF: First Steps towards Deep Rule Learning. In Broˇna Brejov ́a, Lucie Ciencialov ́a, Martin Holeˇna, Frantiˇsek Mr ́az, Dana Pardubsk ́a, Martin Pl ́atek, and Tom ́aˇs Vinaˇr (eds.), Proceedings of the 21st Conference Information Technologies – Applications and Theory (ITAT 2021), volume 2962 of CEUR Workshop Proceedings, pp. 61–68, Hotel Heˇlpa, N ́ızke Tatry and Mur ́anska planina, September 2021. CEUR. Leo Breiman, Jerome Friedman, Charles J. Stone, and R. A. Olshen. Classification and Regression Trees. Taylor & Francis, January 1984. ISBN 978-0-412-04841-8. Noam Chomsky. Three models for the description of language. IRE Transactions on information theory, 2(3):113–124, 1956. Publisher: IEEE. William W. Cohen. Fast Effective Rule Induction. In In Proceedings of the Twelfth International Conference on Machine Learning, pp. 115–123. Morgan Kaufmann, 1995. Sanjeeb Dash, Oktay Gunluk, and Dennis Wei. Boolean Decision Rules via Column Generation. In Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. Giuseppe De Giacomo, Marco Favorito, Jianwen Li, Moshe Y. Vardi, Shengping Xiao, and Shufang Zhu. LTLf Synthesis as AND-OR Graph Search: Knowledge Compilation at Work. In Proceed- ings of the Thirty-First International Joint Conference on Artificial Intelligence, pp. 2591–2598, Vienna, Austria, July 2022. International Joint Conferences on Artificial Intelligence Organiza- tion. ISBN 978-1-956792-00-3. doi: 10.24963/ijcai.2022/359. Dheeru Dua and Casey Graff. UCI Machine Learning Repository. University of California, Irvine, School of Information and Computer Sciences, 2017. Elias Egho, Dominique Gay, Marc Boulle, Nicolas Voisine, and Fabrice Clerot. A Parameter-Free Approach for Mining Robust Sequential Classification Rules. In 2015 IEEE International Con- ference on Data Mining, pp. 745–750, Atlantic City, NJ, November 2015. IEEE. ISBN 978-1- 4673-9504-5. doi: 10.1109/ICDM.2015.87. Lukas Geiger and Plumerai Team. Larq: An open-source library for training binarized neural net- works. Journal of Open Source Software, 5(45):1746, January 2020. doi: 10.21105/joss.01746. Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 249–256. JMLR Workshop and Conference Proceedings, March 2010. 10 Published as a conference paper at ICLR 2023 Francesca Grisoni, Claudia S. Neuhaus, Miyabi Hishinuma, Gisela Gabernet, Jan A. Hiss, Masaaki Kotera, and Gisbert Schneider. De novo design of anticancer peptides by ensemble artificial neural networks. Journal of Molecular Modeling, 25(5):112, April 2019. ISSN 0948-5023. doi: 10.1007/s00894-019-4007-6. Koen Helwegen, James Widdicombe, Lukas Geiger, Zechun Liu, Kwang-Ting Cheng, and Roeland Nusselder. Latent Weights Do Not Exist: Rethinking Binarized Neural Network Optimization. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. Torsten Hoefler, Dan Alistarh, Tal Ben-Nun, Nikoli Dryden, and Alexandra Peste. Sparsity in Deep Learning: Pruning and growth for efficient inference and training in neural networks. Journal of Machine Learning Research, 22(241):1–124, 2021. Pierre Holat, Marc Plantevit, Chedy Raissi, Nadi Tomeh, Thierry Charnois, and Bruno Cremilleux. In 2014 IEEE International Sequence Classification Based on Delta-Free Sequential Patterns. Conference on Data Mining, pp. 170–179, Shenzhen, China, December 2014. IEEE. ISBN 978- 1-4799-4302-9 978-1-4799-4303-6. doi: 10.1109/ICDM.2014.154. Stefan Kramer. A Brief History of Learning Symbolic Higher-Level Representations from Data In Proceedings of the Twenty-Ninth International Joint Con- (And a Curious Look Forward). ference on Artificial Intelligence, pp. 4868–4876, Yokohama, Japan, July 2020. International Joint Conferences on Artificial Intelligence Organization. doi: 10.24963/ijcai.2020/678. ISBN 978-0-9992411-6-5. Remy Kusters, Yusik Kim, Marine Collery, Christian de Sainte Marie, and Shubham Gupta. Differ- entiable Rule Induction with Learned Relational Features. arXiv:2201.06515 [cs, stat], January 2022. Himabindu Lakkaraju, Stephen H. Bach, and Jure Leskovec. Interpretable Decision Sets: A Joint In Proceedings of the 22nd ACM SIGKDD Inter- Framework for Description and Prediction. national Conference on Knowledge Discovery and Data Mining, pp. 1675–1684, San Francisco California USA, August 2016. ACM. ISBN 978-1-4503-4232-2. doi: 10.1145/2939672.2939874. Tao Lin, Sebastian U. Stich, Luis Barba, Daniil Dmitriev, and Martin Jaggi. Dynamic model pruning with feedback. In International Conference on Learning Representations, 2020. Christos Louizos, Max Welling, and Diederik P. Kingma. Learning sparse neural networks through L0 regularization. In International Conference on Learning Representations, 2018. Nnanyelugo Nwegbu, Santosh Tirunagari, and David Windridge. A novel kernel based approach to arbitrary length symbolic data with application to type 2 diabetes risk. Scientific Reports, 12: 4985, March 2022. ISSN 2045-2322. doi: 10.1038/s41598-022-08757-1. Lutz Prechelt. Connection pruning with static and adaptive pruning schedules. Neurocomputing, 16 (1):49–61, July 1997. ISSN 0925-2312. doi: 10.1016/S0925-2312(96)00054-9. Litao Qiao, Weijia Wang, and Bill Lin. Learning accurate and interpretable decision rule sets from neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 4303–4311, 2021. Ryan Riegel, Alexander Gray, Francois Luus, Naweed Khan, Ndivhuwo Makondo, Ismail Yunus Akhalwaya, Haifeng Qian, Ronald Fagin, Francisco Barahona, Udit Sharma, Shajith Ikbal, Hima Karanam, Sumit Neelam, Ankita Likhyani, and Santosh Srivastava. Logical Neural Networks, June 2020. Cynthia Rudin. Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence, 1(5):206–215, May 2019. ISSN 2522-5839. doi: 10.1038/s42256-019-0048-x. Guolong Su, Dennis Wei, Kush R. Varshney, and Dmitry M. Malioutov. Interpretable Two-level Boolean Rule Learning for Classification, June 2016. 11 Published as a conference paper at ICLR 2023 Cheng Zhou, Boris Cule, and Bart Goethals. Itemset Based Sequence Classification. In David Hutchison, Takeo Kanade, Josef Kittler, Jon M. Kleinberg, Friedemann Mattern, John C. Mitchell, Moni Naor, Oscar Nierstrasz, C. Pandu Rangan, Bernhard Steffen, Madhu Sudan, Demetri Ter- zopoulos, Doug Tygar, Moshe Y. Vardi, Gerhard Weikum, Camille Salinesi, Moira C. Norrie, and ́Oscar Pastor (eds.), Advanced Information Systems Engineering, volume 7908, pp. 353– 368. Springer Berlin Heidelberg, Berlin, Heidelberg, 2013. ISBN 978-3-642-38708-1 978-3-642- 38709-8. doi: 10.1007/978-3-642-40988-2 23. Michael Zhu and Suyog Gupta. To prune, or not to prune: exploring the efficacy of pruning for model compression, November 2017. URL http://arxiv.org/abs/1710.01878. arXiv:1710.01878 [cs, stat]. A CONTEXT-FREE GRAMMAR Context-free grammar (Chomsky, 1956) A context (VT , VN , S, R) where free-grammar is a 4-tuple G = − VT , is finite set of terminals or terminal elements in the language that form the alphabet of the language. − VN , disjoint from VT , is a finite set of non terminal elements (variables) that define a sub- language of L. We note V = VN ∪ VT , the vocabulary of the grammar. − S ∈ VN , is the start symbol or variable that defines the whole sentence. − R is a finite set of rules or production rules of the form A → w with A ∈ VN and w ∈ V ∗ In the following, we have 3 different types of terminal elements on the syntax level: • reserved words, distinguished with the following style : reserved • signs, such as for example −, ∗, ... • other terminal elements that are defined prior to the grammar, distinguished with the fol- lowing style: terminal Production rules presented in the paper (Eq 3, Eq 4, Eq 5 and Eq 6) define grammars when associated to values for VT , VN and S. Here is an example for the base rule model grammar with production rules in Eq 3. VT = {if, then class = 1 else class = 0, ∧, ∨, =} ∪ (cid:8)x1, x2, . . . (cid:9) ∪ n1 , . . . , xck = αk nk 0, . . . , xc1 = α1 xc1 = α1 (cid:110) (cid:111) VN = {rule, base expression, conjunction, predicate, categorical expression, categorical literal, literal} S = {rule} B HARD CONCRETE DISTRIBUTION (LOUIZOS ET AL., 2018) Parameters are set as follows: β = 2/3, ζ = 1.1 and γ = −0.1. u ∼ U (0, 1), s = σ((log(u) − log(1 − u) + loc)/β), ˆs = s ∗ (ζ − γ) + γ W = min(max(ˆs, 0), 1) (11) (12) (13) C PEPTIDES DATASET UCI anticancer peptides dataset (Grisoni et al., 2019) (Available on Dua & Graff (2017)) is com- posed of one-letter amino acid sequences (of variable length) and each sequence is labeled with its anticancer activity on breast cancer cell lines. The dataset provides 4 classes with the following dis- tribution: 83 inactive-exp, 750 inactive-virtual, 98 moderately active and 18 very active. Sequences 12 Published as a conference paper at ICLR 2023 lengths range from 5 to 38 letters (Mean: 17 ± 5.5). We transform this multi-classification problem into a binary classification problem (as done in Nwegbu et al. (2022)). Class 'inactive-virtual' is the positive class (750) and all the other are combined as the negative class (199). No other processing of the data is necessary and we leave it as is. D SYNTHETIC DATASETS GENERATION Balanced datasets are generated randomly with the same ground truth as unbalanced datasets. Then, they are upsampled until the minority class represents half of the goal dataset size and appropriate number of majority class are randomly removed. E EXPERIMENTAL SETTING The loc-parameters for weights computation are initialized with xavier uniform initialization method (Glorot & Bengio, 2010). The loss function is described in Eq 7 and depends on the MSE loss and regularization coefficient λ = 10−5. The adam optimizer is used with a fixed learning rate set to 0.1 and a run consists of 200 epochs. Experiments were run on CPU on a MacBookPro18,2 (2021) with Apple M1 Max chip, 10 Cores, 32 GB of RAM and running macOS Monterey Version 12.4. F FULL EXPERIMENT RESULTS Table 3: Performance metrics obtained for the different models, window size and pruning strategy on the synthetic datasets. Values are followed by the standard deviation over the 10 executions with different weights initializations. (Bal Acc: balanced accuracy, Epoch: best epoch). Dataset Model Window Pruning Bal. Acc. Penalty 1 1b global local global local 3 6 3 6 3 6 3 6 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 54.9 ± 3.9 50.0 ± 0.0 50.0 ± 0.0 100.0 ± 0.0 90.0 ± 20.0 85.0 ± 22.9 100.0 ± 0.0 80.9 ± 23.6 95.0 ± 15.0 70.7 ± 4.0 68.5 ± 6.6 71.6 ± 3.5 76.5 ± 3.4 70.2 ± 4.3 72.7 ± 5.1 100.0 ± 0.0 100.0 ± 0.0 100.0 ± 0.0 100.0 ± 0.0 100.0 ± 0.0 100.0 ± 0.0 0.0 ± 0.0 0.0 ± 0.0 0.0 ± 0.0 9.5 ± 8.1 0.0 ± 0.0 0.0 ± 0.0 1.8 ± 1.5 0.8 ± 0.4 0.7 ± 0.5 5.8 ± 5.6 1.1 ± 1.4 0.9 ± 0.3 5.1 ± 1.6 5.8 ± 2.8 5.0 ± 1.3 37.4 ± 20.3 12.5 ± 5.5 15.4 ± 6.9 3.0 ± 3.1 1.0 ± 0.0 1.0 ± 0.0 12.6 ± 10.1 1.0 ± 0.0 1.0 ± 0.0 13 Epoch 3 ± 1 3 ± 2 2 ± 1 109 ± 64 1 ± 1 1 ± 1 63 ± 24 56 ± 47 41 ± 27 96 ± 50 26 ± 18 79 ± 43 81 ± 27 47 ± 31 60 ± 16 108 ± 49 29 ± 15 53 ± 13 70 ± 47 49 ± 39 54 ± 30 116 ± 52 77 ± 24 87 ± 27 Published as a conference paper at ICLR 2023 Dataset Model Window Pruning Bal. Acc. Penalty Epoch Table 3 continued from previous page 2 2b 3 3b global local global local global local global local 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 90.5 ± 0.0 85.7 ± 9.8 90.5 ± 0.0 94.2 ± 0.6 90.5 ± 0.0 91.0 ± 1.5 97.9 ± 2.6 97.4 ± 2.6 98.0 ± 2.4 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 ± 0.0 0.0 ± 0.0 0.0 ± 0.0 0.0 ± 0.0 0.0 ± 0.0 0.0 ± 0.0 3.7 ± 2.1 2.3 ± 0.6 2.0 ± 0.0 19.8 ± 7.7 2.0 ± 0.0 12.4 ± 13.0 2.8 ± 1.2 1.5 ± 0.5 1.6 ± 0.5 100.0 ± 0.0 100.0 ± 0.0 100.0 ± 0.0 12.5 ± 7.4 2.0 ± 0.0 2.4 ± 1.2 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 50.0 ± 0.0 79.8 ± 8.1 70.5 ± 8.1 80.4 ± 9.2 90.2 ± 1.4 77.4 ± 7.4 87.7 ± 3.1 89.8 ± 6.3 86.2 ± 8.0 92.5 ± 4.6 97.1 ± 1.2 95.7 ± 2.9 96.8 ± 0.9 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 ± 0.0 0.0 ± 0.0 0.0 ± 0.0 0.0 ± 0.0 0.0 ± 0.0 0.0 ± 0.0 4.6 ± 2.2 3.1 ± 1.4 2.8 ± 0.6 26.2 ± 15.3 14.1 ± 8.0 11.5 ± 6.6 8.5 ± 3.9 6.1 ± 8.2 4.2 ± 1.8 15.1 ± 7.9 10.1 ± 12.9 7.6 ± 2.9 14 3 ± 1 3 ± 1 2 ± 1 1 ± 1 1 ± 0 1 ± 1 1 ± 1 1 ± 1 1 ± 1 1 ± 1 1 ± 0 1 ± 0 44 ± 37 39 ± 21 51 ± 24 89 ± 36 71 ± 16 61 ± 26 58 ± 42 43 ± 28 54 ± 29 105 ± 56 51 ± 21 68 ± 22 2 ± 1 2 ± 1 2 ± 1 1 ± 1 1 ± 0 1 ± 0 1 ± 1 2 ± 1 1 ± 1 1 ± 0 1 ± 1 2 ± 1 98 ± 51 48 ± 31 57 ± 36 120 ± 51 35 ± 13 61 ± 10 95 ± 64 50 ± 34 64 ± 22 123 ± 49 43 ± 8 69 ± 21 2.2 ± 0.6 1.6 ± 0.8 1.8 ± 0.6 4.3 ± 3.4 1.7 ± 0.9 2.0 ± 0.0 28.6 ± 14.5 3.4 ± 5.1 12.5 ± 8.7 68.8 ± 51.0 3.3 ± 5.2 21.9 ± 17.5 2.7 ± 1.1 2.1 ± 0.3 2.0 ± 0.0 6.7 ± 3.8 4.7 ± 8.1 2.2 ± 0.6 39.9 ± 17.5 29.2 ± 9.4 35.9 ± 17.3 Epoch 42 ± 28 28 ± 14 42 ± 25 72 ± 35 33 ± 20 43 ± 15 108 ± 40 30 ± 37 58 ± 39 109 ± 31 11 ± 13 57 ± 24 16 ± 8 29 ± 18 42 ± 32 90 ± 52 50 ± 22 69 ± 25 76 ± 38 60 ± 14 53 ± 14 122.6 ± 100.2 103.9 ± 77.3 79.0 ± 55.9 107 ± 42 44 ± 16 68 ± 12 Published as a conference paper at ICLR 2023 Dataset Model Window Pruning Bal. Acc. Penalty Table 3 continued from previous page 4 4b global local global local 3 6 3 6 3 6 3 6 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 No Yes 30 100.0 ± 0.0 90.0 ± 20.0 95.0 ± 15.0 100.0 ± 0.0 86.2 ± 21.3 100.0 ± 0.0 98.7 ± 0.4 59.1 ± 12.9 77.1 ± 20.7 99.1 ± 0.6 52.1 ± 5.2 79.3 ± 19.2 100.0 ± 0.0 99.2 ± 2.4 100.0 ± 0.0 100.0 ± 0.0 99.2 ± 2.4 100.0 ± 0.0 100.0 ± 0.0 99.0 ± 2.0 98.7 ± 4.0 100.0 ± 0.0 88.2 ± 7.8 98.0 ± 3.9 15
http://arxiv.org/abs/2302.12095v5
2023-08-29T05:34:25
2023-02-22T11:01:20
On the Robustness of ChatGPT: An Adversarial and Out-of-distribution Perspective
ChatGPT is a recent chatbot service released by OpenAI and is receiving increasing attention over the past few months. While evaluations of various aspects of ChatGPT have been done, its robustness, i.e., the performance to unexpected inputs, is still unclear to the public. Robustness is of particular concern in responsible AI, especially for safety-critical applications. In this paper, we conduct a thorough evaluation of the robustness of ChatGPT from the adversarial and out-of-distribution (OOD) perspective. To do so, we employ the AdvGLUE and ANLI benchmarks to assess adversarial robustness and the Flipkart review and DDXPlus medical diagnosis datasets for OOD evaluation. We select several popular foundation models as baselines. Results show that ChatGPT shows consistent advantages on most adversarial and OOD classification and translation tasks. However, the absolute performance is far from perfection, which suggests that adversarial and OOD robustness remains a significant threat to foundation models. Moreover, ChatGPT shows astounding performance in understanding dialogue-related texts and we find that it tends to provide informal suggestions for medical tasks instead of definitive answers. Finally, we present in-depth discussions of possible research directions.
[ "Jindong Wang", "Xixu Hu", "Wenxin Hou", "Hao Chen", "Runkai Zheng", "Yidong Wang", "Linyi Yang", "Haojun Huang", "Wei Ye", "Xiubo Geng", "Binxin Jiao", "Yue Zhang", "Xing Xie" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12095v5", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12095v5", "@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.CL", "cs.LG" ]
3 2 0 2 g u A 9 2 ] I A . s c [ 5 v 5 9 0 2 1 . 2 0 3 2 : v i X r a On the Robustness of ChatGPT: An Adversarial and Out-of-distribution Perspective Jindong Wang1∗, Xixu Hu1,2‡†, Wenxin Hou3†, Hao Chen4, Runkai Zheng1,5‡, Yidong Wang6, Linyi Yang7, Wei Ye6, Haojun Huang3, Xiubo Geng3, Binxing Jiao3, Yue Zhang7, Xing Xie1 1Microsoft Research, 2City University of Hong Kong, 3Microsoft STCA, 4Carnegie Mellon University, 5Chinese University of Hong Kong (Shenzhen), 6Peking University, 7Westlake University https://github.com/microsoft/robustlearn Abstract ChatGPT is a recent chatbot service released by OpenAI and is receiving increasing attention over the past few months. While evaluations of various aspects of Chat- GPT have been done, its robustness, i.e., the performance to unexpected inputs, is still unclear to the public. Robustness is of particular concern in responsible AI, especially for safety-critical applications. In this paper, we conduct a thorough eval- uation of the robustness of ChatGPT from the adversarial and out-of-distribution (OOD) perspective. To do so, we employ the AdvGLUE and ANLI benchmarks to assess adversarial robustness and the Flipkart review and DDXPlus medical diag- nosis datasets for OOD evaluation. We select several popular foundation models as baselines. Results show that ChatGPT shows consistent advantages on most adversarial and OOD classification and translation tasks. However, the absolute performance is far from perfection, which suggests that adversarial and OOD robustness remains a significant threat to foundation models. Moreover, ChatGPT shows astounding performance in understanding dialogue-related texts and we find that it tends to provide informal suggestions for medical tasks instead of definitive answers. Finally, we present in-depth discussions of possible research directions. 1 Introduction Large language models (LLMs), or foundation models (Bommasani et al., 2021), have achieved significant performance on various natural language process (NLP) tasks. Given their superior in-context learning capability (Min et al., 2022), prompting foundation models has emerged as a widely adopted paradigm of NLP research and applications. ChatGPT is a recent chatbot service released by OpenAI (OpenAI, 2023), which is a variant of the Generative Pre-trained Transformers (GPT) family. Thanks to its friendly interface and great performance, ChatGPT has attracted over 100 million users in two months. It is of imminent importance to evaluate the potential risks behind ChatGPT given its increasing worldwide popularity in diverse applications. While previous efforts have evaluated various aspects of ChatGPT in law (Choi et al., 2023), ethics (Shen et al., 2023), education (Khalil and Er, 2023), and reasoning (Bang et al., 2023), we focus on its robustness (Bengio et al., 2021), which, to our best knowledge, has not been thoroughly evaluated yet. Robustness refers to the ability to withstand disturbances or external factors that may cause it to malfunction or provide inaccurate results. It is ∗Contact: [email protected]. †Equal contribution. ‡Work done during internship at Microsoft Research Asia. Technical report. Figure 1: Robustness evaluation of different foundation models: performance vs. parameter size. Results show that ChatGPT shows consistent advantage on adversarial and OOD classification tasks. However, its absolute performance is far from perfection, indicating much room for improvement. important to practical applications especially the safety-critical scenarios. For instance, if we apply ChatGPT or other foundation models to fake news detection, a malicious user might add noise or certain perturbations to the content to bypass the detection system. Without robustness, the reliability of the system collapses. Robustness threats exist in a wide range of scenarios: out-of-distribution (OOD) samples (Wang et al., 2022), adversarial inputs (Goodfellow et al., 2014), long-tailed samples (Zhang et al., 2021), noisy inputs (Natarajan et al., 2013), and many others. In this paper, we pay special attention to two popular types of robustness: the adversarial and OOD robustness, both of which are caused through input perturbation. Specifically, adversarial robustness studies the model's stability to adversarial and imperceptible perturbations, e.g., adding trained noise to an image or changing some keywords of a text. On the other hand, OOD robustness measures the performance of a model on unseen data from different distributions of the training data, e.g., classifying sketches using a model trained for art painting or analyzing a hotel review using a model trained for appliance review. More background of these robustness is elaborated in Section 2.2. Zero-shot robustness evaluation. While robustness research often requires training and optimization (e.g., fine-tuning, linear probing, domain adaptation and generalization, Section 2.2), in this work, we focus on zero-shot robustness evaluation. Given a foundation model, we perform inference directly on the test dataset for evaluation. We argue that it becomes more expensive and unaffordable to train, or even load existing (and future, larger) foundation models. For instance, the largest Flan-T5 model has 11 billion parameters (Chung et al., 2022), which is already beyond the capability of most researchers and practitioners. Thus, their zero-shot performance becomes important to downstream tasks. On the other hand, foundation models are typically trained on huge volumes of datasets with huge amount of parameters, which seems to challenge conventional machine learning theories (Appendix C): Are large foundation models all we need for robustness? In this work, we conduct a thorough evaluation of ChatGPT on its adversarial and OOD robustness for natural language understanding tasks. It is challenging to select appropriate datasets for evaluating ChatGPT since it is known to be trained on huge text datasets as of 2021. Eventually, we leverage several recent datasets for our evaluation: AdvGLUE (Wang et al., 2021) and ANLI (Nie et al., 2020a) for adversarial robustness and two new datasets for OOD robustness: Flipkart review (Vaghani and Thummar, 2023) and DDXPlus medical diagnosis datasets (Tchango et al., 2022). Furthermore, we randomly selected 30 samples from AdvGLUE to form an adversarial translation dataset to evaluate the translation performance. These datasets represent various levels of robustness, thus provide a fair evaluation. The detailed information of these datasets are introduced in Section 3. We then select 2 100101102ModelParameters(Billions)020406080AttackSuccessRate(%)AdversarialRobustness100101102ModelParameters(Billions)020406080Zero-shotF1Score(%)Out-of-distributionRobustnessDeBERTa-LBART-LGPT-J-6BFlan-T5-LGPT-NEOX-20BOPT-66BBLOOMtext-davinci-002text-davinci-003ChatGPTRandom several popular foundation models from Huggingface model hub and OpenAI service4 to compare with ChatGPT. In summary, we have 9 tasks and overall 2, 089 test examples.5 Our findings. We perform zero-shot inference on all tasks using these models and Fig. 1 summarizes our main results. The major findings of the study include: 1. What ChatGPT does well: • ChatGPT shows consistent improvements on most adversarial and OOD classification tasks. • ChatGPT is good at translation tasks. Even in the presence of adversarial inputs, it can consistently generate readable and reasonable responses. • ChatGPT is better at understanding dialogue-related texts than other foundation models. This could be attributed to its enhanced ability as a chatbot service, leading to good performance on DDXPlus dataset. 2. What ChatGPT does not do well: • The absolute performance of ChatGPT on adversarial and OOD classification tasks is still far from perfection even if it outperforms most of the counterparts. • The translation performance of ChatGPT is worse than its instruction-tuned sibling model text-davinci-003. • ChatGPT does not provide definitive answers for medical-related questions, but instead offers informed suggestions and analysis. Thus, it can serve as a friendly assistant. 3. Other general findings about foundation models: • Task-specific fine-tuning helps language models perform better on related tasks, e.g., NLI-fine-tuned RoBERTa-L has similar performance to Flan-T5-L. • Instruction tuning benefits large language models, e.g., Flan-T5-L achieves comparable performance to text-davinci-002 and text-davinci-002 with significantly less parameters. Beyond evaluations, we share more reflections in the discussion and limitation sections, providing experience and suggestions to future research. Finally, we open-source our code and results at https://github.com/microsoft/robustlearn to facilitate future explorations. 2 Background 2.1 Foundation Models, ChatGPT, and Existing Evaluation Foundation models have become a popular research and application paradigm for natural language process tasks. Since foundation models are trained on large volumes of data, they show significant per- formance improvement on different downstream tasks such as sentiment analysis, question answering, automatic diagnosis, logical reasoning, and sequence tagging. ChatGPT is a generative foundation model that belongs to the GPT-3.5 series in OpenAI's GPT family, coming after GPT (Radford et al., 2018), GPT-2 (Radford et al., 2019), GPT-3 (Brown et al., 2020), and InstructGPT (Ouyang et al., 2022). In contrast to its predecessors, ChatGPT makes it easy for every one to use just through a browser with enhanced multi-turn dialogue capabilities. Although the technical details of ChatGPT is still not released, it is known to be trained using reinforcement learning from human feedback (RLHF) (Christiano et al., 2017) with instruction tuning. Other than natural language processing, there are also emerging efforts in building foundation models for computer vision (Dehghani et al., 2023), music generation (Agostinelli et al., 2023), biology (Luo et al., 2022; Lee et al., 2020), and speech recognition (Radford et al., 2022). Previous efforts evaluate ChatGPT in different aspects (van Dis et al., 2023). Bang et al. (2023) proposes a multi-task, multi-modal, and multilingual evaluation of ChatGPT on different tasks. They showed that ChatGPT performs reasonably well on most tasks, while it does not bring great performance on low-resource tasks. Similar empirical evaluations are also made by Gozalo-Brizuela and Garrido-Merchan (2023); Azaria (2022). Specifically, Qin et al. (2023) also did several evaluations 4Huggingface: https://huggingface.co/models. OpenAI service: https://openai.com/api. 5Although the sample size may seem small, it must be noted that due to the current unavailability of an API service for ChatGPT, conducting experiments on a larger scale is challenging. 3 and they found that ChatGPT does not do well on fine-grained downstream tasks such as sequence tagging. In addition to research from artificial intelligence, researchers from other areas also showed interest in ChatGPT. Hacker et al. (2023); Shen et al. (2023) expressed concerns that ChatGPT and other large models should be regulated since they are double-edged swords. The evaluations on ethics are done in (Zhuo et al., 2023). There are reflections and discussions from law (Choi et al., 2023), education (Khalil and Er, 2023; M Alshater, 2022; Susnjak, 2022; Guo et al., 2023), human-computer interaction (Tabone and de Winter, 2023), medicine (Jeblick et al., 2022), and writing (Biswas, 2023). To the best of our knowledge, a thorough robustness evaluation is currently under-explored. 2.2 Robustness In the following, we present the formulation of robustness with the classification task (other tasks can be formulated similarly). We are given a K-class classification dataset D = {xi, yi}n i=1, where x ∈ Rd and y ∈ [K] are its d-dimensional input and output, respectively. We use l[*, *] to denote the loss function. Adversarial robustness An adversarial input (Goodfellow et al., 2014) x′ is generated by adding a ε-bounded, imperceptible perturbation δ to the original input x. The optimal classifier can be learned by optimizing the following objective (Madry et al., 2017): min f ∈H E(x,y)∈D max |δ|≤ε l[f (x + δ), y]. Out-of-distribution robustness On the other hand, OOD robustness (generalization) (Wang et al., 2022; Shen et al., 2021) aims to learn an optimal classifier on an unseen distribution by training on existing data. One popular formulation for OOD robustness is to minimize the average risk on all distributions e, which is sampled over the set of all possible distributions (could be large than D): Ee∼QE(x,y)∈De l[f (x), y]. min f ∈H Yang et al. (2022) presented GLUE-X, a benchmark based on GLUE and then conducted a thorough evaluation of the OOD robustness of language models by training on in-distribution (ID) sets and then testing on OOD sets. Ours, however, performs zero-shot evaluation. The OOD robustness of ChatGPT cannot be evaluated by GLUE and GLUE-X benchmarks since it may include the entire GLUE datasets in its training data. 3 Datasets and Tasks 3.1 Adversarial Datasets We adopt AdvGLUE (Wang et al., 2021) and adversarial natural language inference (ANLI) (Nie et al., 2020a) benchmarks for evaluating adversarial robustness. AdvGLUE is a modified version of the existing GLUE benchmark (Wang et al., 2019) by adding different kinds of adversarial noise to the text: word-level perturbation (typo), sentence-level perturbation (distraction), and human-crafted perturbations. We adopt 5 tasks from AdvGLUE: SST-2, QQP, MNLI, QNLI, and RTE. Since the test set of AdvGLUE is not public, we adopt its development set instead for evaluation. Although AdvGLUE is a classification benchmark, we additionally construct an adversarial machine translation (En → Zh) dataset, termed AdvGLUE-T, by randomly selecting 30 samples from AdvGLUE. ANLI is a large-scale dataset designed to assess the generalization and robustness of natural language inference (NLI) models, which was created by Facebook AI Research. It comprises 16,000 premise- hypothesis pairs that are classified into three categories: entailment, contradiction, and neutral. The dataset is divided into three parts (R1, R2, and R3) based on the number of iterations used during its creation, with R3 being the most difficult and diverse. Therefore, we select the test set of R3 for evaluating the adversarial robustness of our models. Detailed information of AdvGLUE and ANLI can be found in Appendix A.1. 4 Table 1: Statistics of test sets in this paper Area Dataset Task #Sample #Class Adversarial robustness SST-2 QQP MNLI QNLI RTE ANLI AdvGLUE-T sentiment classification quora question pairs multi-genre natural language inference question-answering NLI textual entailment recognition text classification machine translation (En → Zh) OOD robustness Flipkart DDXPlus sentiment classification medical diagnosis classification 148 78 121 148 81 1200 30 331 100 2 3 3 2 2 3 - 2 50 3.2 Out-of-distribution Datasets We adopt two new datasets6 for OOD robustness evaluation: Flipkart (Vaghani and Thummar, 2023) and DDXPlus (Tchango et al., 2022). Flipkart is a product review dataset and DDXPlus is a new medical diagnosis dataset, both of which are released in 2022. These two datasets can be used to construct classification tasks. We randomly sample a subset of each dataset to form the test sets. Detailed introduction and construction of each test set can be found in Appendix A.2. Table 1 shows the statistics of each dataset. Remark: Finding an OOD dataset for large models like ChatGPT is difficult due to the unavailability of its training data. Consider these datasets as 'out-of-example' datasets since they did not show up in ChatGPT's training data. Additionally, distribution shift may happen at different dimensions: not only across domains, but also across time. Thus, even if ChatGPT and other LLMs may already use similar datasets like medical diagnosis and product review, our selected datasets are still useful for OOD evaluation due to temporal distribution shift. Finally, we must admit the limitation of these datasets and look forward to brand new ones for more thorough evaluation. 4 Experiment 4.1 Zero-shot Classification 4.1.1 Setup We compare the performance of ChatGPT on AdvGLUE classification benchmark with the following existing popular foundation models: DeBERTa-L (He et al., 2020), BART-L (Lewis et al., 2020), GPT-J-6B (Wang and Komatsuzaki, 2021), Flan-T5 (Raffel et al., 2020; Chung et al., 2022), GPT- NEOX-20B (Black et al., 2022), OPT-66B (Zhang et al., 2022a), BLOOM (Scao et al., 2022), and GPT-3 (text-davinci-002 and text-davinci-003) 7. The latter two are from OpenAI API service and the rest are on Huggingface model hub. The notation '-L' means '-large', as we only evaluate the large version of these models. The detailed information of these models are introduced in Appendix D. For adversarial classification tasks on AdvGLUE and ANLI, we adopt attack success rate (ASR) as the metric for robustness. The metric details are listed in Appendix B. For OOD classification tasks, F1-score (F1) is adopted as the metric. As mentioned before, we only perform zero-shot evaluation. Thus, we simply run all models on a local computer with plain GPUs, which could be the case in most downstream applications.8 Note that we use the NLI-fine-tuned version of DeBERTa-L and BART-L on natural language inference tasks to perform zero-shot classification since they are not originally designed for text classification. For other models, we adopt the prompt-based paradigm to 6Considering ChatGPT is reported to be trained on a substantial corpus of internet language data as of 2021, identifying an out-of-distribution dataset poses a difficulty. Furthermore, we concern that previous natural language processing datasets predating 2022 may have been assimilated by ChatGPT, so we only utilize datasets that are recently released. 7Note that the classification task may be unfavorable to the generative models since we did not limit their output space as discriminative models like DeBERTa-L do. 8Even the local computer is not that "plain" since it requires at least 1 A100 GPU with 80 GB of memory. 5 Table 2: Zero-shot classification results on adversarial (ASR↓) and OOD (F1↑) datasets. The best and second-best results are highlighted in bold and underline. Model & #Param. Random DeBERTa-L (435 M) BART-L (407 M) GPT-J-6B (6 B) Flan-T5-L (11 B) GPT-NEOX-20B (20 B) OPT-66B (66 B) BLOOM (176 B) text-davinci-002 (175 B) text-davinci-003 (175 B) ChatGPT (175 B) Adversarial robustness (ASR↓) SST-2 QQP MNLI QNLI RTE ANLI OOD robustness (F1↑) DDXPlus Flipkart 50.0 66.9 56.1 48.7 40.5 52.7 47.6 48.7 46.0 44.6 39.9 50.0 39.7 62.8 59.0 59.0 56.4 53.9 59.0 28.2 55.1 18.0 66.7 64.5 58.7 73.6 48.8 59.5 60.3 73.6 54.6 44.6 32.2 50.0 46.6 52.0 50.0 50.0 54.0 52.7 50.0 45.3 38.5 34.5 50.0 60.5 56.8 56.8 56.8 48.1 58.0 56.8 35.8 34.6 24.7 66.7 69.3 57.7 66.5 68.6 70.0 58.3 66.5 68.8 62.9 55.3 20.0 60.6 57.8 28.0 58.3 39.4 44.5 28.0 57.5 57.3 60.6 4.0 4.5 5.3 2.4 8.4 12.3 0.3 0.1 18.9 19.6 20.2 get answers for classification by inputting prompts. All prompts used in this paper are presented in Appendix E. Note that we manually processed some outputs since the outputs of some generative LLMs are not easy to control. 4.1.2 Results The classification results of adversarial and OOD robustness are shown in Table 2. First, ChatGPT shows consistent improvements on adversarial datasets. It outperforms all counterparts on all adversarial classification tasks. However, we see that there is still room for improvement since the absolute performance is far from perfection. For instance, the ASRs on SST-2 and ANLI are 40% and 55.3%, respectively, indicating much room for improvement. This could be due to the reason that they are trained on clean corpus and some adversarial texts are washed out from the training data. Beyond ChatGPT, it is also surprising to find that most methods only achieve slightly better than random guessing, while some even do not beat random guessing. This indicates that the zero-shot adversarial robustness of most foundation models is not promising. Such adversarial vulnerability poses a major threat to various applications of foundation models, which we will further discuss in Section 5.1 and Appendix C.1. In addition to foundation models, we are surprised to find that some small models also achieve great performance on adversarial tasks while it has much less parameters than the strong models (e.g, DeBERTa-L on QQP and QNLI tasks). This indicate that fine-tuning on relevant tasks can still improve the performance. Furthermore, Flan-T5 also achieves comparable performance to most larger models. Since Flan-T5 is also trained via instruction tuning, this implies the efficacy of such training approach in prompting-based NLP tasks. Second, all models after GPT-2 (text-davinci-002, text-davinci-003, and ChatGPT) perform well on OOD datasets. This observation is in consistency with recent finding in OOD research that the in-distribution (ID) and OOD performances are positively correlated (Miller et al., 2021). However, ChatGPT and its sibling models perform much better on DDXPlus, indicating its ability to recognize new or diverse domain data. Additionally, some large models performs better, e.g., Flan-T5-L outperforms some larger models such as OPT-66B and BLOOM. This can be explained as overfitting on certain large models or they have an inverse ID-OOD relation (Teney et al., 2022) on our test sets. It should also be noted that the absolute performance of ChatGPT and davinci series are still far from perfection. More discussions on OOD are presented in Section 5.2 and Appendix A.2 shows some informal analysis from the perspective of OOD theory. Third, on the DDXPlus dataset, ChatGPT is better at understanding diaglogue-related texts compared with other LLMs. The DDXPlus benchmark presents a formidable challenge for many models. The majority of models perform at a level akin to random chance, with the exception of the davinci series and ChatGPT, which exhibit exceptional performance. One plausible explanation for the superior performance of these three models may be their substantial increase in the number of model parameters. This substantial increase in parameter count may enable the model to learn more complex representations and subsequently result in an improvement of performance. Another 6 possible reason for the success of ChatGPT is its ability to understand the conversational context of DDXPlus, which consists of doctor-posed diagnostic questions and patient responses. ChatGPT has demonstrated superior performance in understanding conversational context compared to previous models, which likely contributes to its improved performance on this dataset. Finally, it is worth noting that due to the critical nature of the healthcare field, ChatGPT does not provide definitive answers in medical-related questions but instead offers informed suggestions and analysis, followed by a recommendation for further offline testing and consultation to ensure accurate diagnosis. When the provided information is insufficient to make a judgment, ChatGPT will acknowledge this and offer an explanation, demonstrating its responsible approach to medical-related inquiries. This highlights the benefits of using ChatGPT for medical-related inquiries compared to search engines, as it can provide comprehensive analysis and suggestions without requiring the users to have medical expertise, while also being responsible and cautious in its responses. This suggests a promising future for the integration of ChatGPT in computer-aided diagnosis systems. 4.2 Zero-shot Machine Translation 4.2.1 Setup We further evaluate the adversarial robustness of ChatGPT on an English-to-Chinese (En → Zh) machine translation task. The test set (AdvGLUE-T) is sub-sampled from the adversarial English text in AdvGLUE and we manually translate them into Chinese as ground truth. We evaluate the zero-shot translation performance of ChatGPT against text-davinci-002 and text-davinci-003. We further adopt two fine-tuned machine translation models from the Huggingface model hub: OPUS- MT-EN-ZH (Tiedemann and Thottingal, 2020) and Trans-OPUS-MT-EN-ZH9 More details of the models used are included in Appendix D. We report BLEU, GLEU, and METEOR in experiments to conduct a fair comparison among several models.10 4.2.2 Results The results of zero-shot machine translation are shown in Table 3. Note that all three models from the GPT family outperforms the fine-tuned models. Interestingly, text-davinci-003 generalizes the best on all metrics. The performance of ChatGPT is better to text-davinci-002 on BLUE and GLUE, but slightly worse on METOR. While differing in metrics, we find the translated texts of ChatGPT (and text-davinci-002 and text-davinci-003) is very readable and reasonable to humans, even given adversarial inputs. This indicates the adversarial robustness capability on machine translation of ChatGPT might originate from GPT-3. Table 3: Zero-shot machine translation results on adversarial text sampled from AdvGLUE. Model BLEU↑ GLEU↑ METOR↑ OPUS-MT-EN-ZH Trans-OPUS-MT-EN-ZH text-davinci-002 text-davinci-003 ChatGPT 18.11 15.23 24.97 30.60 26.27 26.78 24.89 36.30 40.01 37.29 46.38 45.02 59.28 61.88 58.95 4.3 Case Study Table 4 shows some results of ChatGPT across word-level (typo) and sentence-level (distraction) adversarial inputs. It is evident that both adversaries pose a considerable challenge to ChatGPT, through their ability to mislead the model's judgement. It should be noted that these adversaries are prevalent in everyday interactions, and the existence of numerous forms of textual adversarial attacks highlights the necessity of defensive strategies for ChatGPT. Table 6 presents some cases of ChatGPT on OOD inputs. Unlike adversarial inputs, it is not easy to analyze why ChatGPT performs bad for OOD datasets since the notion of "distribution" is hard to quantify. 9Note that there are only few En → Zh machine translation models released on Huggingface model hub and we pick the top two with the most downloads. 10We use NLTK (https://www.nltk.org/) to calculate these metrics. 7 Table 4: Case study on adversarial examples. Adversarial manipulations are marked red. Type davinci003 Truth Input ChatGPT i think you 're here for raunchy college humor . Mr. Tsai is a very oriignal artist in his medium , and what time is it there? Q1: Can you TRANSLATE these to English language? Q2: Cn you translate ths from Bengali to English lagnuage? Positive Positive Negative Negative Positive Positive Not equivalent Not equivalent Equivalent Q1: What are the best things in Hog Kong? Q2: What is the best thing in Hong Kong? Equivalent Not equivalent Not equivalent word-level (typo) Question: What is the minimum required if you want to teach in Canada? Sentence: @KMcYo0 In most provinces a second Bachelor's Degree such as a Bachelor of Education is required to become a qualified teacher. Question: @uN66rN What kind of water body is rumored to be obscuring Genghis Khan's burial site? Sentence: Folklore says that a river was diverted over his grave to make it impossible to find (the same manner of burial as the Sumerian King Gilgamesh of Uruk and Atilla the Hun). Not entailment Entailment Entailment Entailment Not entailment Not entailment sentence-level (distraction) https://t.co/1GPp0U the iditarod lasts for days - this just felt like it did . Negative Positive Negative holden caulfield did it better . https://t.co/g4vJKP Negative Positive Negative 5 Discussion 5.1 Adversarial Attack Remains a Major Threat As discussed in experiments, dealing with adversarial inputs still remains challenging to large foundation models. With the proliferation of foundation model service such as ChatGPT, such adversarial vulnerability remains a major threat to various downstream scenarios, especially those safety-critical applications. On the other hand, since adversarial inputs are subjectively generated by humans, but not exist in nature, we argue that foundation models might never cover all distributions of possible adversarial inputs during their training (Ilyas et al., 2019). Other than error correction, a possible solution for model owners is to first inject adversarial inputs to their training data, which could improve its robustness to existing adversarial noise. Then, as a long-standing goal to improve the model robustness, the pre-trained model can be continuously trained on human-generated or algorithm-generated adversarial inputs. As for those who cannot train large models and only use them in downstream tasks, such threat still exists due to the defect inheritance of pre-trained models. In this case, how to achieve perfect fine- tuning or adaptation performance on downstream tasks while certainly reducing the defect inheritance remains a major challenge. Luckily, some pioneering work (Zhang et al., 2022b; Chin et al., 2021) might provide solutions. This represents a novel and emerging direction for future research. However, as foundation models grow larger that go beyond the capabilities of most researchers, reducing the defects through fine-tuning could be impossible. An open question rises for both model owners and downstream users on how to defend the adversarial attack. In addition to adversaries in training data, prompts can also be attacked (Maus et al., 2023), which requires further knowledge and algorithms to deal with. This is currently a challenging problem due to the sensitivity of prompting to LLMs. 8 5.2 Can OOD Generalization be Solved by Large Foundation Models? Larger models like ChatGPT and text-davinci-003 have the potential to achieve superior performance on OOD datasets with better prompt engineering, inspiring us to think of the problem: is OOD generalization solved by these giant models? The huge training data and parameters are a double- edged sword: overfitting vs. generalization. It is also intuitive to think that OOD data is unseen during training, so adding it into training set is enough, which is what these large models did. Is the "unreasonable effectiveness of data" (Sun et al., 2017) real? However, as the model sizes are becoming larger, it still remains unknown when and why LLMs will overfit. Another possible reason is the training data of ChatGPT and text-davinci-003 actually encompass similar distributions to our test sets even if they are collected after 2021. Flipkart is for product review and DDXPlus is for medical diagnosis, which in fact are common domains widely existing on the Internet. Thus, they could be not OOD to these models, that could lead to overfitting. New datasets from long-tailed domains are in need for more fair evaluations. Finally, our analysis does not show that ID-OOD performances are always positively correlated (Miller et al., 2021), but can sometimes inversely correlated (Teney et al., 2022). Regularization and other techniques should be developed to improve the OOD performance of language models. 5.3 Beyond NLP Foundation Models Adversarial and OOD robustness do not only exist in natural language, but also in other domains. In fact, most research comes from machine learning and computer vision communities. Researchers in computer vision area could possibly think: can we solve OOD and adversarial robustness in image data by training a vision foundation model? For instance, the recent ViT-22B (Dehghani et al., 2023) scales vision Transformer (Dosovitskiy et al., 2020) to 22 billion parameters by training it on the 4 billion JFT dataset (Zhai et al., 2022) (a larger version of the previous JFT-300M dataset (Sun et al., 2017)), which becomes the largest vision foundation model to date. ViT-22B shows superior performance on different image classification tasks. However, it does not show "emergent abilities" (Wei et al., 2022) with the increment of parameters as other LLMs. Not only LLMs, the robustness in other areas also remains to be solved. Back to theory, algorithms, and optimization areas, which foundational research areas in artificial intelligence. Will the large foundation models disrupt these areas? First, we should acknowledge that the success of foundation models should also attribute to these areas, e.g., most LLMs adopt the Transformer (Vaswani et al., 2017) and other advanced learning and training research. Second, the success of foundation models shed light on these areas: can we solve the problems like adversarial and OOD by developing new theories, algorithms, and optimization methods? Such research could offer valuable contribution to foundation models, e.g., improve the data and training efficiency and efficacy. Finally, researchers in these areas should not be dis-encouraged since the advance of scientific research should be diverse and not restricted to those done with rich computing resources. 6 Limitation This paper offers a preliminary empirical study on the robustness of large foundation models, which has the following limitations. First, we only perform zero-shot classification using ChatGPT and other models. Results of these models could change if we perform fine-tuning or adaptation given enough computing resources. But as we stated in introduction, it is expensive and un-affordable to perform further operation on today's latest foundation models, we believe zero-shot evaluation is reasonable. Second, it seems controversial to evaluate large foundation models on small datasets in this work. However, since the training data of ChatGPT and some large models remains unclear, it is difficult to find larger datasets. Especially, ChatGPT is trained on huge datasets on the Internet as of 2021, making it more difficult to find appropriate datasets for thorough evaluation. We do believe more datasets can be used for such evaluation. Third, we did most evaluations on text classification and only minor evaluations on machine trans- lation. It is well-known that ChatGPT and other foundation models can do more tasks such as 9 generation. Again, because of lack of appropriate datasets, evaluating generation performance is also difficult. We also admit that introducing more proper prompts could improve its performance. Fourth, it is worth noting that ChatGPT is mainly designed to be a chatbot service rather than a tool for text classification. Our evaluations are mainly for classification, which have nothing to do with the robustness of ChatGPT for online chatting experience. We do hope every end-user can find ChatGPT helpful in their lives. Finally, we could further provide detailed synopsis by conducting experiments on data before 2021 as comparisons and analyzing more OOD cases to see why ChatGPT succeeds or fails. Other experiments include detailed ablation study using different language models and investigation of induced outputs by LLMs through prompts. These can be done in future work. Another claim is that ChatGPT is not perfect for adversarial tasks. But we also need to develop certain metrics to show 'how good' is the performance. 7 Conclusion This paper presented a preliminary evaluation of the robustness of ChatGPT from the adversarial and out-of-distribution perspective. While we acknowledge the advance of large foundation models on adversarial and out-of-distribution robustness, our experiments show that there is still room for improvement to ChatGPT and other large models on these tasks. Afterwards, we presented in-depth analysis and discussion beyond NLP area, and then highlight some potential research directions regarding foundation models. We hope our evaluation, analysis, and discussions could provide experience to future research. Acknowledgement This paper received attentions from many experts since its first version was released on ArXiv. Authors would like to thank all who gave constructive feedback to this work. Disclaimer Potential Ethics and Societal Concerns raised by ChatGPT Robustness The increasing popular- ity of ChatGPT and other chatbot services certainly face some new concerns from both ethics and society. The purpose of this paper is to show that ChatGPT can be attacked by adversarial and OOD examples using existing public dataset, but not to attack it intentionally. We hope that this will not be leverage by end-users. Finally, we also hope the community can realize the importance of robustness research and develop new technologies to make our systems more secure, robust, and responsible. ChatGPT usage Some authors in this paper are from mainland China where ChatGPT is currently unavailable. In order to conduct this research without disobeying local laws and OpenAI service terms, Hao Chen, who is one of our coauthors and lives in U.S., did all experiments related to ChatGPT and OpenAI. All experiments on ChatGPT are based on its Feb 13 version. Further updates of ChatGPT may lead to change of the results in this paper. The contribution of each author Jindong led the project, designed experiments, wrote the code framework, and wrote the paper. Xixu and Wenxin shared equal contributions. Xixu was in charge of processing, experimenting, and writing about the DDXPlus and ANLI datasets. Wenxin designed all prompts to generative models and wrote about this part. Hao did the machine translation experiments, wrote necessary codes, and was in charge of code organization and reproducibility. Runkai helped polish the paper and organized case study. Other authors actively participated in this project from day one, reviewed the paper carefully, and provided valuable comments to improve this work. References Andrea Agostinelli, Timo I Denk, Zalán Borsos, Jesse Engel, Mauro Verzetti, Antoine Caillon, Qingqing Huang, Aren Jansen, Adam Roberts, Marco Tagliasacchi, et al. Musiclm: Generating music from text. arXiv preprint arXiv:2301.11325, 2023. 10 Amos Azaria. Chatgpt usage and limitations. 2022. Yejin Bang, Samuel Cahyawijaya, Nayeon Lee, Wenliang Dai, Dan Su, Bryan Wilie, Holy Lovenia, Ziwei Ji, Tiezheng Yu, Willy Chung, et al. A multitask, multilingual, multimodal evaluation of chatgpt on reasoning, hallucination, and interactivity. arXiv preprint arXiv:2302.04023, 2023. Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the European conference on computer vision (ECCV), pages 456–473, 2018. 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:151–175, 2010. Yoshua Bengio, Yann Lecun, and Geoffrey Hinton. Deep learning for ai. Communications of the ACM, 64(7):58–65, 2021. Som Biswas. Chatgpt and the future of medical writing, 2023. Sid Black, Stella Biderman, Eric Hallahan, Quentin Anthony, Leo Gao, Laurence Golding, Horace He, Connor Leahy, Kyle McDonell, Jason Phang, Michael Pieler, USVSN Sai Prashanth, Shivanshu Purohit, Laria Reynolds, Jonathan Tow, Ben Wang, and Samuel Weinbach. Gpt-neox-20b: An open- source autoregressive language model, 2022. URL https://arxiv.org/abs/2204.06745. 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. Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020. Ting-Wu Chin, Cha Zhang, and Diana Marculescu. Renofeation: A simple transfer learning method for improved adversarial robustness. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3243–3252, 2021. Jonathan H Choi, Kristin E Hickman, Amy Monahan, and Daniel Schwarcz. Chatgpt goes to law school. Available at SSRN, 2023. Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. Advances in neural information processing systems, 30, 2017. Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, et al. Scaling instruction-finetuned language models. arXiv preprint arXiv:2210.11416, 2022. Mostafa Dehghani, Josip Djolonga, Basil Mustafa, Piotr Padlewski, Jonathan Heek, Justin Gilmer, Andreas Steiner, Mathilde Caron, Robert Geirhos, Ibrahim Alabdulmohsin, et al. Scaling vision transformers to 22 billion parameters. arXiv preprint arXiv:2302.05442, 2023. 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. Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. Roberto Gozalo-Brizuela and Eduardo C Garrido-Merchan. Chatgpt is not all you need. a state of the art review of large generative ai models. arXiv preprint arXiv:2301.04655, 2023. Biyang Guo, Xin Zhang, Ziyuan Wang, Minqi Jiang, Jinran Nie, Yuxuan Ding, Jianwei Yue, and Yupeng Wu. How close is chatgpt to human experts? comparison corpus, evaluation, and detection. arXiv preprint arXiv:2301.07597, 2023. 11 Philipp Hacker, Andreas Engel, and Marco Mauer. Regulating chatgpt and other large generative ai models. arXiv preprint arXiv:2302.02337, 2023. Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. Deberta: Decoding-enhanced bert with disentangled attention. arXiv preprint arXiv:2006.03654, 2020. Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. Advances in neural information processing systems, 32, 2019. Katharina Jeblick, Balthasar Schachtner, Jakob Dexl, Andreas Mittermeier, Anna Theresa Stüber, Johanna Topalis, Tobias Weber, Philipp Wesp, Bastian Sabel, Jens Ricke, et al. Chatgpt makes medicine easy to swallow: An exploratory case study on simplified radiology reports. arXiv preprint arXiv:2212.14882, 2022. Mohammad Khalil and Erkan Er. Will chatgpt get you caught? rethinking of plagiarism detection. arXiv preprint arXiv:2302.04335, 2023. Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. Large language models are zero-shot reasoners. 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=e2TBb5y0yFf. Jinhyuk Lee, Wonjin Yoon, Sungdong Kim, Donghyeon Kim, Sunkyu Kim, Chan Ho So, and Jaewoo Kang. Biobert: a pre-trained biomedical language representation model for biomedical text mining. Bioinformatics, 36(4):1234–1240, 2020. Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7871–7880, 2020. Renqian Luo, Liai Sun, Yingce Xia, Tao Qin, Sheng Zhang, Hoifung Poon, and Tie-Yan Liu. Biogpt: generative pre-trained transformer for biomedical text generation and mining. Briefings in Bioinformatics, 23(6), 2022. Muneer M Alshater. Exploring the role of artificial intelligence in enhancing academic performance: A case study of chatgpt. Available at SSRN, 2022. Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017. Natalie Maus, Patrick Chao, Eric Wong, and Jacob Gardner. Adversarial prompting for black box foundation models. arXiv preprint arXiv:2302.04237, 2023. John P Miller, Rohan Taori, Aditi Raghunathan, Shiori Sagawa, Pang Wei Koh, Vaishaal Shankar, Percy Liang, Yair Carmon, and Ludwig Schmidt. Accuracy on the line: on the strong correlation between out-of-distribution and in-distribution generalization. In International Conference on Machine Learning, pages 7721–7735. PMLR, 2021. Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe, Mike Lewis, Hannaneh Hajishirzi, and Luke Zettlemoyer. Rethinking the role of demonstrations: What makes in-context learning work? arXiv preprint arXiv:2202.12837, 2022. Nagarajan Natarajan, Inderjit S Dhillon, Pradeep K Ravikumar, and Ambuj Tewari. Learning with noisy labels. Advances in neural information processing systems, 26, 2013. Yixin Nie, Adina Williams, Emily Dinan, Mohit Bansal, Jason Weston, and Douwe Kiela. Ad- versarial nli: A new benchmark for natural language understanding. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics. Association for Computational Linguistics, 2020a. 12 Yixin Nie, Adina Williams, Emily Dinan, Mohit Bansal, Jason Weston, and Douwe Kiela. Adversarial nli: A new benchmark for natural language understanding. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4885–4901, 2020b. OpenAI. https://chat.openai.com.chat, 2023. Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. arXiv preprint arXiv:2203.02155, 2022. Chengwei Qin, Aston Zhang, Zhuosheng Zhang, Jiaao Chen, Michihiro Yasunaga, and Diyi Yang. Is chatgpt a general-purpose natural language processing task solver? arXiv preprint arXiv:2302.06476, 2023. Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language under- standing by generative pre-training. In Advances in neural information processing systems, pages 8735–8745, 2018. 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. 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. Alec Radford, Jong Wook Kim, Tao Xu, Greg Brockman, Christine McLeavey, and Ilya Sutskever. Robust speech recognition via large-scale weak supervision. arXiv preprint arXiv:2212.04356, 2022. 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. The Journal of Machine Learning Research, 21(1):5485–5551, 2020. Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2383–2392, 2016. Teven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ili ́c, Daniel Hesslow, Roman Castagné, Alexandra Sasha Luccioni, François Yvon, Matthias Gallé, et al. Bloom: A 176b- parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100, 2022. Yiqiu Shen, Laura Heacock, Jonathan Elias, Keith D Hentel, Beatriu Reig, George Shih, and Linda Moy. Chatgpt and other large language models are double-edged swords, 2023. Zheyan Shen, Jiashuo Liu, Yue He, Xingxuan Zhang, Renzhe Xu, Han Yu, and Peng Cui. Towards out-of-distribution generalization: A survey. arXiv preprint arXiv:2108.13624, 2021. Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng, and Christopher Potts. 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, 2013. Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In Proceedings of the IEEE international conference on computer vision, pages 843–852, 2017. Teo Susnjak. Chatgpt: The end of online exam integrity? arXiv preprint arXiv:2212.09292, 2022. Wilbert Tabone and Joost de Winter. Using chatgpt for human–computer interaction research: A primer. 2023. Arsene Fansi Tchango, Rishab Goel, Zhi Wen, Julien Martel, and Joumana Ghosn. Ddxplus: A new dataset for automatic medical diagnosis. Proceedings of the Neural Information Processing Systems-Track on Datasets and Benchmarks, 2, 2022. 13 Damien Teney, Yong Lin, Seong Joon Oh, and Ehsan Abbasnejad. Id and ood performance are sometimes inversely correlated on real-world datasets. arXiv preprint arXiv:2209.00613, 2022. Jörg Tiedemann and Santhosh Thottingal. OPUS-MT - Building open translation services for the World. In Proceedings of the 22nd Annual Conferenec of the European Association for Machine Translation (EAMT), Lisbon, Portugal, 2020. Nirali Vaghani and Mansi Thummar. Flipkart product reviews with sentiment dataset, 2023. URL https://www.kaggle.com/dsv/4940809. Leslie G Valiant. A theory of the learnable. Communications of the ACM, 27(11):1134–1142, 1984. Eva AM van Dis, Johan Bollen, Willem Zuidema, Robert van Rooij, and Claudi L Bockting. Chatgpt: five priorities for research. Nature, 614(7947):224–226, 2023. 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. Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. 2019. In the Proceedings of ICLR. Ben Wang. Mesh-Transformer-JAX: Model-Parallel Implementation of Transformer Language Model with JAX. https://github.com/kingoflolz/mesh-transformer-jax, May 2021. Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax, May 2021. Boxin Wang, Chejian Xu, Shuohang Wang, Zhe Gan, Yu Cheng, Jianfeng Gao, Ahmed Hassan Awadallah, and Bo Li. Adversarial glue: A multi-task benchmark for robustness evaluation of language models. arXiv preprint arXiv:2111.02840, 2021. Jindong Wang, Cuiling Lan, Chang Liu, Yidong Ouyang, Tao Qin, Wang Lu, Yiqiang Chen, Wenjun Zeng, and Philip Yu. Generalizing to unseen domains: A survey on domain generalization. IEEE Transactions on Knowledge and Data Engineering, 2022. 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. Adina Williams, Nikita Nangia, and Samuel R Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL HLT 2018, pages 1112–1122. Association for Computational Linguistics (ACL), 2018. Yaqi Xie, Chen Yu, Tongyao Zhu, Jinbin Bai, Ze Gong, and Harold Soh. Translating natural language to planning goals with large-language models. arXiv preprint arXiv:2302.05128, 2023. Linyi Yang, Shuibai Zhang, Libo Qin, Yafu Li, Yidong Wang, Hanmeng Liu, Jindong Wang, Xing Xie, and Yue Zhang. Glue-x: Evaluating natural language understanding models from an out-of- distribution generalization perspective. arXiv preprint arXiv:2211.08073, 2022. Xiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, and Lucas Beyer. Scaling vision transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12104–12113, 2022. Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068, 2022a. Yifan Zhang, Bingyi Kang, Bryan Hooi, Shuicheng Yan, and Jiashi Feng. Deep long-tailed learning: A survey. arXiv preprint arXiv:2110.04596, 2021. 14 Ziqi Zhang, Yuanchun Li, Jindong Wang, Bingyan Liu, Ding Li, Yao Guo, Xiangqun Chen, and Yunxin Liu. Remos: reducing defect inheritance in transfer learning via relevant model slicing. In Proceedings of the 44th International Conference on Software Engineering, pages 1856–1868, 2022b. Terry Yue Zhuo, Yujin Huang, Chunyang Chen, and Zhenchang Xing. Exploring ai ethics of chatgpt: A diagnostic analysis. arXiv preprint arXiv:2301.12867, 2023. 15 A Detailed Introduction of Datasets and Tasks A.1 AdvGLUE and ANLI AdvGLUE (Wang et al., 2021) is an evaluation benchmark for natural language processing models, with a specific focus on adversarial robustness. It includes five natural language understanding tasks from the GLUE benchmark: Sentiment Analysis (SST-2), Duplicate Question Detection (QQP), and Natural Language Inference (NLI, including MNLI, RTE, QNLI). It includes different types of attacks including word-level transformations, sentence-level manipulations, and human-written adversarial examples. SST-2 The Stanford Sentiment Treebank (Socher et al., 2013) is composed of sentences originating from movie reviews, along with corresponding human-annotated sentiments. The goal is to predict the sentiment (positive or negative) when given a review sentence. QQP Quora Question Pairs (QQP) dataset consists of pairs of questions gathered from Quora, which is a platform for community question-answering. The aim is to predict if two questions are semantically equivalent. MNLI Multi-Genre Natural Language Inference Corpus (Williams et al., 2018) is a dataset of sentence pairs for textual entailment. The task is to predict whether the premise sentence entails, contradicts, or is neutral to the hypothesis sentence. QNLI The Question-answering NLI (QNLI) dataset consists of question-sentence pairs extrated and modified from the Stanford Question Answering Dataset (Rajpurkar et al., 2016). The task is to predict if the context sentence has the answer to a given question. RTE The Recognizing Textual Entailment (RTE) dataset contains examples constructed using news and Wikipedia text from annual textual entailment challenges. The goal is to predict the relationship between a pair of sentences, which can be categorized into two classes: entailment and not entailment. Note that neutral and contradiction are considered as not entailment. AdvGLUE-T We create an adversarial machine translation dataset (En → Zh) called AdvGLUE-T by randomly extracting 30 samples from AdvGLUE. Adversarial NLI (ANLI) (Nie et al., 2020b) is a benchmark for natural language understanding collected by using human-and-model-in-the-loop training method. This benchmark is designed to challenge the current models in natural language inference. Human annotators acted as adversaries by trying to fool the model into mis-classifying with the found vulnerabilities, while these sentences are still understandable to other humans. A.2 Flipkart and DDXPlus Flipkart (Vaghani and Thummar, 2023) includes information on 104 different types of products from flipkart.com, such as electronics, clothing, home decor, and more. It contains 205,053 data and their corresponding sentiment labels (positive, negative, or neutral). In our study, we select all its instances with review text length between 150 and 160 to ease the experiments. This leads to 331 samples in total. DDXPlus (Tchango et al., 2022) is a dataset designed for automatic medical diagnosis, which consists of synthetic data of around 1.3 million patients, providing a differential diagnosis and the true pathology, symptoms, and antecedents for each patient. We randomly sampled 100 records from the test set. As the original records were in French, we translated them into English using the evidences and conditions dictionaries provided in the dataset. The resulting data was then formatted into a context of age, gender, initial evidence, and inquiry dialogue, enabling the model to select the most probable disease from all considered pathology using the information provided in the conversation. B Evaluation Metrics Attack Success Rate (ASR) Following (Wang et al., 2021), the metric of ASR is adopted for evaluating the effectiveness of the system against adversarial inputs. Specifically, given a dataset D = {(xi, yi)}N i=1 consisting of N samples xi and corresponding ground truth labels yi, the success 16 rate of an adversarial attack method A, which generates adversarial examples A(x) given an input x to attack a surrogate model f , is computed as: ASR = (cid:88) (x,y)∈D 1[f (A(x)) ̸= y] 1[f (x) = y] (1) Basically, the robustness of a model is inversely proportional to the attack success rate. C An Informal Analysis from the Theory Perspective This section presents a brief overview of existing machine learning and robustness theory, assisting potential analysis of large foundation models. C.1 Machine Learning Theory The foundational learning theory in machine learning is called the probably approximately correct (PAC) theory (Valiant, 1984). While our focus is to facilitate the analysis of foundation models, we only discuss the theory related to generalization error, which is the basic one. In binary classification, we define the true labeling function f : X → [0, 1] for domain D. For any classifier h : X → [0, 1], the classification error is defined as: ε(h, f ) = Ex∼D[h(x) ̸= f (x)] = Ex∼D[|h(x) − f (x)|]. (2) Theorem 1 (Generalization error) Let H be a finite hypothesis set, m the number of training samples, and 0 < δ < 1, then for any h ∈ H, (cid:32) P |E(h) − ˆE(h)| ≤ (cid:114) ln |H| + ln(2/δ) 2m (cid:33) ≥ 1 − δ, (3) where E(h) and ˆE(h) are the ideal and empirical (learned) risk on h, respectively. Theorem 1 indicates that the generalization error is determined by the number of training samples m and the size of the hypothesis space H. The superior performance of large foundation models are typically trained on huge datasets (m is large). However, the hypothesis set H is finite. Therefore, the increment of m and |H| could lead to a lower generalization error according to Theorem 1. This seems to explain why large foundation models such as ChatGPT and text-davinci-003 achieve superior performance in zero-shot classification on some tasks. Note taht the theoretical analysis on foundation models is still underexplored, hence, this analysis could be wrong and we still look forward to theoretical advances in this area. However, as large foundation models become more complex, it could possibly induce a high VC- dimension (Valiant, 1984). At the same time, their training data sizes are certainly larger than existing machine learning research. It remains unknown why such models do not overfit on existing datasets. C.2 Out-of-distribution Robustness Theory OOD assumes training on a source dataset Ds and test on another unseen dataset Dt. The key challenge is that the distributions between Ds and Dt are not the same. Although it is impossible to evaluate the risk on an unseen dataset since we cannot even access it, we can borrow the classic domain adaptation theory to analyze the risk on the target domain by assuming its availability. Theorem 2 (Target error bound based on H-divergence (Ben-David et al., 2010)) Let H be a hypothesis space with VC dimension d. Given sample set with size m i.i.d. sampled from the source domain, then, with probability at least 1 − δ, for any h ∈ H, we have: εt(h) ≤ ˆεs(h) + dH( ˆDs, ˆDt) + λ∗ + (cid:115) (cid:18) 4 m d log 2em d + log (cid:19) , 4 δ where e is natural logarithm, λ∗ = εs(h∗) + εt(h∗) is the ideal joint risk, and h∗ = arg min h∈H εt(h) is the optimal classifier on the source and target domains. (4) εs(h) + 17 Theory 2 indicates that the error bound on the target domain is bounded by four terms: 1) source empirical error, 2) the distribution discrepancy between source and target domains, 3) ideal joint error, and 4) some constant related to sample size and VC dimension. Conventional OOD generalization and adaptation research (Wang et al., 2022) focus on minimizing the distribution discrepancy between source and target domains (dH( ˆDs, ˆDt)) while assuming the source risk (ˆεs(h)) is determined. Meanwhile, the last term ( *) can also be reduced due to the increment of m. Similar to the above generalization analysis, we can also interpret the success of large foundation models as they simply achieving low generalization error on the source data, thus also minimizes the risk on the target domain. But it is also important to note that this analysis is not rigorous. Finally, VC-dimension has no correlation with the distribution of datasets, which also cannot explain the strong OOD performance of these foundation models. √ D Foundation Models used in Experiments In this section, we provide a brief introduction to the foundation models used in our experiments. BART-L (Lewis et al., 2020) BART is based on bidirectional and auto-regressive transformer. It is trained on a combination of auto-regressive and denoising objectives, which makes BART feasible for both generation and understanding tasks. In a nutshell, BART is designed to handle both understanding and generation tasks, making it a more versatile model, while BERT is more focused on understanding. DeBERTa-L (He et al., 2020) DeBERTa introduces a disentangled attention mechanism and an enhanced decoding scheme for BERT. The disentangled attention mechanism allows DeBERTa to capture the contextual information between different tokens in a sentence more effectively, while the enhanced decoding scheme makes the model generate natural language sentences with higher quality. GPT-J-6B (Wang and Komatsuzaki, 2021) is a transformer model trained using Mesh Transformer JAX (Wang, 2021). It is a series of models with '6B' denoting 6 billion parameters. Flan-T5 (Raffel et al., 2020; Chung et al., 2022) Flan-T5 adopts a text-to-text strategy where input and output are both natural language sentences to execute a variety of tasks like machine translation, summarization, and question answering. This input-output form allows Flan-T5 to accomplish held-out tasks when given an input sentence as prompt. GPT-NEOX-20B (Black et al., 2022) GPT-NeoX-20B is a language model with 20 billion parameters trained on the Pile. It is the largest public dense autoregressive model. It outperformed GPT-3 and FairSeq models with similar size in five-shot reasoning tasks. OPT (Zhang et al., 2022a) Open Pre-trained Transformers (OPT) is a suite of pre-trained transformer models that are decoder-only and have parameter sizes ranging from 125 million to 175 billion. While offering comparable performance to GPT-3 (Brown et al., 2020), OPT-175B was developed with just 1/7th of the carbon footprint. BLOOM (Scao et al., 2022) BLOOM extends pre-training from mono-lingual to cross-lingual. BLOOM combines one unsupervised objective and one supervised objective for pre-training. The unsupervised one only uses monolingual data, and the supervised one adopts parallel data. The cross-lingual language models can bring significant improvements for low-resource languages. text-davinci-002 and text-davinci-003 text-davinci-002 and text-davinci-003 11 are based on GPT- 3 (Brown et al., 2020). They accomplish any task that other models can, generally produce output that is of higher quality, longer in length, and more faithful to instructions. E Details on Prompts E.1 Prompts We list all prompts used in this study in Table 5. 11https://platform.openai.com/docs/models/gpt-3 18 Dataset SST-2 QQP MNLI QNLI RTE Table 5: All prompts used in this study. Prompt Please classify the following sentence into either positive or negative. Answer me with "positive" or "negative", just one word. Are the following two questions equivalent or not? with "equivalent" or "not_equivalent". Answer me Are the following two sentences entailment, neutral or contradiction? Answer me with "entailment", "neutral" or "contradiction". Are the following question and sentence entailment or not_entailment? Answer me with "entailment" or "not_entailment". Are the following two sentences entailment or not_entailment? Answer me with "entailment" or "not_entailment". AdvGLUE-T Translate the following sentence from Engilish to Chinese. ANLI Flipkart DDXPlus Are the following paragraph entailment, neutral or contradiction? Answer me with "entailment", "neutral" or "contradiction". answer should be a single word. The answer is: The Is the following sentence positive, neutral, or negative? me with "positive", "neutral", or "negative", just one word. Answer ['spontaneous pneumothorax', 'cluster Imagine you are an intern doctor. Based on the previous dialogue, what is the diagnosis? Select one answer among the following lists: headache', 'boerhaave', 'spontaneous rib fracture', 'gerd', 'hiv (initial infection)', 'anemia', 'viral pharyngitis', 'inguinal hernia', 'myasthenia gravis', 'whooping cough', 'anaphylaxis', 'epiglottitis', 'guillain-barré syndrome', 'acute laryngitis', 'croup', 'psvt', 'atrial fibrillation', 'bronchiectasis', 'allergic sinusitis', 'chagas', 'scombroid food poisoning', 'myocarditis', 'larygospasm', 'acute dystonic reactions', 'localized edema', 'sle', 'tuberculosis', 'unstable angina', 'stable angina', 'ebola', 'acute otitis media', 'panic attack', 'bronchospasm / acute asthma exacerbation', 'bronchitis', 'acute copd exacerbation / infection', 'pulmonary embolism', 'urti', 'influenza', 'pneumonia', 'acute rhinosinusitis', 'chronic rhinosinusitis', 'bronchiolitis', 'pulmonary neoplasm', 'possible nstemi / stemi', 'sarcoidosis', 'pancreatic neoplasm', 'acute pulmonary edema', 'pericarditis', 'cannot decide']. should be a single word. The answer is: The answer 19 Table 6: Case study on OOD examples. Input Truth davinci003 ChatGPT quality of cover is not upto mark but the content in the book is really good from foundation to difficult level questions are of latest pattern great work worst product dont buy flipcart should not sell such useless product prepared food only one time it damaged smoke came out and burned it good for nothing definitely it will not fit wagon r either front or back it will cover one side fully and the other side partially thickness is not that much average product this ink is genuine but the problem with printer is it shows red light after 100pages but i still used the cartridge and at last 357 pages were printed working fine good but received in messy box and there is bent on inverter at corner think mistake of courier facility whatever but working fine no issue Positive Positive Positive Positive Negative Negative Positive Negative Negative Negative Positive Neutral Negative Positive Positive E.2 OOD Case Study We list some of the OOD examples for case study in Table 6. 20