diff --git "a/abs_29K_G/test_abstract_long_2405.03003v1.json" "b/abs_29K_G/test_abstract_long_2405.03003v1.json" new file mode 100644--- /dev/null +++ "b/abs_29K_G/test_abstract_long_2405.03003v1.json" @@ -0,0 +1,679 @@ +{ + "url": "http://arxiv.org/abs/2405.03003v1", + "title": "Parameter-Efficient Fine-Tuning with Discrete Fourier Transform", + "abstract": "Low-rank adaptation~(LoRA) has recently gained much interest in fine-tuning\nfoundation models. It effectively reduces the number of trainable parameters by\nincorporating low-rank matrices $A$ and $B$ to represent the weight change,\ni.e., $\\Delta W=BA$. Despite LoRA's progress, it faces storage challenges when\nhandling extensive customization adaptations or larger base models. In this\nwork, we aim to further compress trainable parameters by enjoying the powerful\nexpressiveness of the Fourier transform. Specifically, we introduce FourierFT,\nwhich treats $\\Delta W$ as a matrix in the spatial domain and learns only a\nsmall fraction of its spectral coefficients. With the trained spectral\ncoefficients, we implement the inverse discrete Fourier transform to recover\n$\\Delta W$. Empirically, our FourierFT method shows comparable or better\nperformance with fewer parameters than LoRA on various tasks, including natural\nlanguage understanding, natural language generation, instruction tuning, and\nimage classification. For example, when performing instruction tuning on the\nLLaMA2-7B model, FourierFT surpasses LoRA with only 0.064M trainable\nparameters, compared to LoRA's 33.5M. Our code is released at\n\\url{https://github.com/Chaos96/fourierft}.", + "authors": "Ziqi Gao, Qichao Wang, Aochuan Chen, Zijing Liu, Bingzhe Wu, Liang Chen, Jia Li", + "published": "2024-05-05", + "updated": "2024-05-05", + "primary_cat": "cs.LG", + "cats": [ + "cs.LG", + "cs.AI", + "cs.CL" + ], + "label": "Original Paper", + "paper_cat": "Parameter AND Efficient AND Fine AND Tuning", + "gt": "Low-rank adaptation~(LoRA) has recently gained much interest in fine-tuning\nfoundation models. It effectively reduces the number of trainable parameters by\nincorporating low-rank matrices $A$ and $B$ to represent the weight change,\ni.e., $\\Delta W=BA$. Despite LoRA's progress, it faces storage challenges when\nhandling extensive customization adaptations or larger base models. In this\nwork, we aim to further compress trainable parameters by enjoying the powerful\nexpressiveness of the Fourier transform. Specifically, we introduce FourierFT,\nwhich treats $\\Delta W$ as a matrix in the spatial domain and learns only a\nsmall fraction of its spectral coefficients. With the trained spectral\ncoefficients, we implement the inverse discrete Fourier transform to recover\n$\\Delta W$. Empirically, our FourierFT method shows comparable or better\nperformance with fewer parameters than LoRA on various tasks, including natural\nlanguage understanding, natural language generation, instruction tuning, and\nimage classification. For example, when performing instruction tuning on the\nLLaMA2-7B model, FourierFT surpasses LoRA with only 0.064M trainable\nparameters, compared to LoRA's 33.5M. Our code is released at\n\\url{https://github.com/Chaos96/fourierft}.", + "main_content": "Introduction Large foundation models (LFMs) have demonstrated exceptional performance on tasks of multiple domains, including natural language processing (NLP) (Liu et al., 2019; He et al., 2020; Radford et al., 2019; Brown et al., 2020; Li et al., 2022) and computer vision (CV) (Liu et al., 2023a;b; Singh et al., 2022; Rombach et al., 2022). Owing to their *Equal contribution 1Hong Kong University of Science and Technology (Guangzhou) 2Hong Kong University of Science and Technology 3Sun Yat-sen University 4International Digital Economy Academy 5AI Lab, Tencent. Correspondence to: Jia Li . Proceedings of the 41 st International Conference on Machine Learning, Vienna, Austria. PMLR 235, 2024. Copyright 2024 by the author(s). Figure 1. Summary of the performance (y-axis) of fine-tuning methods with different numbers (x-axis) of trainable parameters on NLP (left) and CV (right) tasks. The left side shows the instruction tuning task, where the LLaMA2-7B model is fine-tuned with Alpaca and evaluated by GPT-4. The right side shows the image classification task, where the Vision Transformer (ViT) is finetuned and tested on the DTD dataset. Black circles (\u25cf) represent the Full Fine-tuning (FF) method. Orange circles (\u25cf) represent LoRA method with r = {32, 64, 128} (left) and r = {8, 16, 32} (right). Blue circles (\u25cf) represent our proposed method with n = {1000, 2000} (left) and n = {3000, 10000} (right). impressive capabilities, fine-tuning LFMs for a wide range of downstream tasks has become prevalent (Wang et al., 2022; Taori et al., 2023; Qiu et al., 2020). Under the full fine-tuning paradigm, the new model adapted to each customized task typically contains as many parameters as the original model (Qiu et al., 2020; Raffel et al., 2020; Chen et al., 2024; Gao et al., 2024). As models grow larger and customization needs expand, the demand for storing finetuned checkpoints rises, resulting in both costly storage and memory consumption. As a popular way to address this issue, LoRA (Hu et al., 2021) represents the weight change with two low-rank matrices A and B, i.e., W0+\u2206W = W0+BA. Despite LoRA\u2019s superb performance, its large size of trainable parameters still brings high IT infrastructure consumption, which affects both ends of public communities and individual users. For the former, an intuitive example is that a LoRA adapter (finetuned weights) for a specific style of the stable diffusion model (Rombach et al., 2022) requires about 40MB of memory. This necessitates the LFM communities (e.g., Civi1 arXiv:2405.03003v1 [cs.LG] 5 May 2024 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform tai (Civitai, 2024)) to bear high storage and bandwidth costs to cater to a large user base. For the latter, fewer parameters mean direct RAM savings when loading fine-tuned weights in mobile APPs, enabling sufficient customization for individual users (Zhou et al., 2022). To this end, we naturally ask the question: How can we aggressively compress trainable parameters even further for fine-tuning LFMs? Previous works have demonstrated the powerful expressiveness of Fourier basis in data compression, where extremely sparse spectral information can be used to recover highfidelity data (e.g., 1D signal vectors (Zwartjes & Gisolf, 2007; Duarte & Baraniuk, 2013; Rudelson & Vershynin, 2008) and 2D image matrices (Vlaardingerbroek & Boer, 2013; Song et al., 2021; Shi et al., 2014)). More importantly, when dealing with more general (non-image) matrices that lack strong spatial semantics and are not frequency-sparse, Fourier transform can still handle recovery effectively (Chen & Chi, 2013; Yang & Xie, 2016). Motivated by this, we investigate the potential for updating the weight change \u2206W with its sparse spectral coefficients for fine-tuning LFMs. In this paper, we aim to aggressively reduce the number of trainable parameters for fine-tuning LFMs. To this end, we propose FourierFT (Fourier Transform for Fine-Tuning), which treats the weight change \u2206W as a matrix in the spatial domain, and learns its sparse spectral coefficients. Specifically, we first randomly select n spectral entries that are shared across all layers. For each layer, FourierFT learns n spectral coefficients located at these n selected entries and then directly applies inverse discrete Fourier transform to compute the updated \u2206W. Therefore, fine-tuning a pretrained model with Lt layers only requires storing 2n entry parameters and nLt coefficient parameters for FourierFT. Empirically, we compare our method with state-of-the-art LoRA variants and other parameter-efficient fine-tuning methods on various tasks including (1) natural language understanding (on the GLUE benchmark), (2) natural language generation (on the E2E benchmark), (3) instruction tuning (with LLaMA-family models), and (4) image classification (with vision transformers). FourierFT can always achieve comparable or even better performance than LoRA, with about 6.0%, 9.4%, 0.2% and 9.2% of LoRA\u2019s trainable parameters for these 4 tasks, respectively. For example in Figure 1, on the instruction tuning task, our FourierFT method outperforms LoRA with only 64K trainable parameters. Moreover, it achieves a comparable score to Full Fine-tuning with only 128K parameters. 2. Related Works Parameter-Efficient Fine-Tuning. With the rapid expansion of large foundation models (LFM), it has become challenging and important to efficiently adapt them for specific tasks. To this end, numerous methods for parameter-efficient fine-tuning (PEFT) are proposed, demonstrating impressive capabilities in both efficiency and accuracy. Existing PEFT methods are broadly partitioned into two categories: nonweight-based and weight-based methods. Non-weight-based methods do not optimize pre-trained LFMs at the weight level. Instead, they achieve fine-tunings by introducing additional modules or optimizing prompts and prefixes. Adapter tuning (He et al., 2021; Rebuffi et al., 2017; Pfeiffer et al., 2020; Houlsby et al., 2019; R\u00a8 uckl\u00b4 e et al., 2020; Lin et al., 2020) aims to introduce light-weighted neural modules, called adapters, between pre-trained layers of the base model. These methods keep the pre-trained weights frozen and efficiently fine-tune the adapters for customized tasks. Prompt tuning (Brown et al., 2020; Lester et al., 2021; Gao et al., 2020; Diao et al., 2022) and prefix tuning (Li & Liang, 2021) insert additional prompts or prefix tokens to the layers of the base model. Weight-based methods, represented by LoRA (Hu et al., 2021), introduce and then update weight changes that can be merged with the original weights to avoid inference latency. LoRA\u2019s innovation lies in the multiplication of low-rank matrices to approximate weight changes. Building upon this, AdaLoRA (Zhang et al., 2023) extends the LoRA method by distributing the parameter budget across weight matrices with importance scores. Additionally, Q-LoRA (Dettmers et al., 2023) proposes to back-propagate gradients upon LoRA through a quantized pre-trained model with 4-bit NormalFloat. Here, we focus on weight-based methods and achieve huge parameter reduction with the powerful expressiveness of Fourier basis, rather than following the low-rank structure. Sparse Fourier Transform in Deep Learning. Sparse Fourier transform (SFT) has flourished in various fields of deep learning (DL). The SFT technique mainly involves using sparse spectral coefficients of significant (Xu et al., 2020; Ehrlich & Davis, 2019; Gueguen et al., 2018; Tang et al., 2022) or even random (Lin et al., 2014; Rawat et al., 2019; Herrmann, 2010) spectral entries, for representation learning. One important application of this technique is matrix recovery. Patel et al. (2011) designs a gradient-based compressed sensing method to recover images with their sparse Fourier information. Shechtman et al. (2014) proposes an efficient phase retrieval method that improves data recovery using sparse Fourier coefficients. Importantly, previous works (Chen & Chi, 2013; Yang & Xie, 2016; Gao et al., 2022) show that even when the original data is not frequency-sparse, SFT can effectively recover the data with extremely few parameters. Although previous works lack studies on the recovery for the weight matrices of DL models with SFT, the aforementioned methods provide potential support for this work. 2 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform Pre-trained Weights \ud835\udc4a\u2208\u211d!!\u00d7!\" \ud835\udc35= 0 \ud835\udc34= \ud835\udca9(0, \ud835\udf0e!) \u210e \ud835\udc65 \ud835\udc51# \ud835\udc51$ \ud835\udc5f Pre-trained Weights \ud835\udc4a\u2208\u211d!!\u00d7!\" \u210e \ud835\udc65 \ud835\udc51# \ud835\udc51$ Random entries (shared across layers) \u211d!\u00d7# \ud835\udc5b Coefficients : Frozen : Trainable LoRA FourierFT IDFT Dense Spectral Matrix F Figure 2. Overview of LoRA (left) and our FourierFT (right) method. In LoRA, only low-rank (r) matrices A and B are trained. The weight change is represented by their multiplication, i.e., \u2206W = BA. For each pre-trained weight W, the theoretical number of trainable parameters in LoRA is r \u00d7 (d1 + d2). In FourierFT, we first randomly generate the spectral entry matrix R2\u00d7n, which is shared across all layers to reduce parameter storage requirements. The complete spectral matrix is formed by a trainable coefficient vector Rn located at selected entries and 0s at the remaining entries. We obtain the weight change \u2206W by directly performing inverse discrete Fourier transform (IDFT) on the updated spectral matrix. For all L adapted layers, FourierFT needs to store n \u00d7 (2 + L) parameters. 3. Method We present FourierFT (depicted in Figure 2), a parameterefficient fine-tuning method based on discrete Fourier transform. FourierFT follows the principle of only learning the change in the pre-trained weight, as proposed by LoRA (Hu et al., 2021). However, unlike LoRA, FourierFT does not adopt the low-rank structure but learns a set of spectral coefficients of Fourier basis. Specifically, we randomly initialize the spectral entry matrix, which is frozen and shared across all layers. We make the spectral coefficients located at selected entries trainable, which jointly form the spectral matrix. Lastly, we apply the inverse discrete Fourier transform to the spectral matrix, yielding its spatial-domain counterpart as the updated weight change. 3.1. Forward Pass We follow the paradigm of only learning weight changes, as adopted by LoRA-based methods (Hu et al., 2021; Dettmers et al., 2023; Zhang et al., 2023). This can avoid inference latency by merging the pre-trained weight and its change. Formally, we define each pre-trained weight matrix as W0 \u2208 Rd1\u00d7d2, and the weight change for fine-tuning as \u2206W \u2208 Rd1\u00d7d2. LoRA aims to parameterize \u2206W in the form of low-rank decomposition in the forward pass: h = W0x + \u2206Wx = W0x + BAx, (1) where B \u2208Rd1\u00d7r and A \u2208Rr\u00d7d2 with the rank r \u226a min(d1,d2) are trainable matrices. The advantage of FourierFT is that the orthogonal and expressive Fourier basis enables recovery of informative weight changes. This promisingly suggests achieving comparable performance to LoRA with significantly fewer parameters. We first randomly initialize the entry matrix E \u2208R2\u00d7n containing discrete 2D spectral entries. Then we randomly initialize the coefficients c \u2208Rn with a normal Gaussian distribution. The proposed forward pass is: F = TODENSE(E,c) (2) Sp,q = d1\u22121 \u2211 j=0 d2\u22121 \u2211 k=0 Fj,kei2\u03c0( p d1 j+ q d2 k) (3) h = W0x + \u2206Wx = W0x + \u03b1R(S)x. (4) Specifically, TODENSE in Eq. 2 represents to construct the spectral matrix F \u2208Rd1\u00d7d2, i.e., Fj,k = cl (resp. 0), if j = E0,l & k = E1,l (resp. else). Eq. 3 computes the spatio matrix S via the inverse discrete Fourier transform, where i represents the imaginary unit. Finally, in Eq. 4, we take the real part of the complex matrix S (denoted as R(S)) and scale it by \u03b1. Kindly note that all layers involve training various c vectors, while sharing the matrix E and value \u03b1. The pseudocode for FourierFT is shown as Algorithm 1, adhering to the PyTorch style. Initialization for the Entry Matrix E. Previous works lack studies on the importance of the spectral entries in the weight change. Thus, we fill this gap by introducing adjustable frequency bias, causing the entries to be more likely sampled in this area. In addition to randomly sampling entries in the full d1 \u00d7 d2-sized spectral matrix (i.e., no bias), we also implement entry sampling with a bias towards a favored central frequency, e.g., low, middle, or 3 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform Algorithm 1 PyTorch-style pseudocode for FourierFT. class FourierFT(nn.Module): def __init__( self, n: int = 100, # number of trainable parameters alpha: float = 300.0, # scaling d1: int = 4096, # input dimension d2: int = 4096, # output dimension base_layer: nn.Module # pre-trained layer ) # definitions self.d1 = d1 self.d2 = d2 self.n = n self.alpha = alpha self.base_layer = base_layer # entry initialization (no frequency bias) self.E = torch.randperm(d1 * d2)[:n] self.E = torch.stack([self.E // self.d1, self.E % self.d2], dim=0) # spectral coefficient initialization self.c = nn.Parameter(torch.randn(n), \\\\ requires_grad=True) def forward(self, x: torch.Tensor): # get dense spectral matrix (Eq.2) F = torch.zeros(self.d1, self.d2) F[self.E[0, :], self.E[1, :]] = self.c # compute Delta_W (Eq.3) Delta_W = torch.fft.ifft2(F).real * self.alpha # merge (Eq.4) h = self.base_layer(x) h += torch.einsum(\u2019ijk,kl->ijl\u2019, x, Delta_W) return h high frequencies. Formally, we apply the Gaussian bandpass filter (Gonzales & Wintz, 1987) to model the sampling probability for the entry (u,v),0 \u2264u \u2264d1\u22121,0 \u2264v \u2264d2\u22121: p(u,v) = exp\u239b \u239d\u2212(D2 \u2212f 2 c DW ) 2\u239e \u23a0, (5) where D represents the distance from the point (u,v) to the origin (center of the matrix), fc is the favored central frequency, and W represents the bandwidth. In Figure 3, we visualize the sampling probability map of a 768 \u00d7 768-sized spectral matrix with different fc and W = 200. fc = 0 fc = 100 fc = 200 fc = 350 fc = 480 0 0.5 1 Figure 3. Visualization of entry sampling probability at different favored central frequencies fc. Kindly note that unless specially stated, FourierFT is set by default to the entry initialization with no frequency bias. 3.2. Parameter Summary We summarize the number of trainable parameters for LoRA and FourierFT in Table 1. LoRA relies on a pair of trainable matrices A and B for each layer. Let the number of layers for fine-tuning be Lt. The total number of parameters in Table 1. Theoretical number of trainable parameters and storage requirements for fine-tuning. For both LoRA and FourierFT methods, only the query and value layers are tuned within the transformer architectures. The configurations that are exactly chosen in the \u2018Experiments\u2019 Section are highlighted . Base Models LoRA FourierFT r # Trainable Parameters Required Bytes n # Trainable Parameters Required Bytes RoBERTa Base 4 147K 574KB 200 4.8K 18.8KB 8 295K 1.13MB 200 24K 94KB RoBERTa Large 4 393K 1.5MB 200 9.6K 36.5KB 8 786K 3MB 1000 48K 183KB GPT-2 Medium 4 350K 1.34MB 500 24K 94KB 8 786K 3MB 1000 48K 188KB GPT-2 Large 4 737K 2.81MB 500 36K 141KB 8 1.47M 5.74MB 1000 72K 282KB LLaMA-2 7B 16 8.39M 32.8MB 1000 64K 250KB 64 33.5M 131.1MB 2000 128K 500KB LLaMA-2 13B 16 13.1M 51.2MB 1000 80K 312KB 64 52.4M 204.8MB 2000 160K 625KB ViT Base 8 295K 1.13MB 3000 72K 281KB 16 590K 2.25MB 10000 239K 934KB ViT Large 8 786K 2.93MB 3000 144K 563KB 16 1.57M 6MB 10000 480K 1.83MB LoRA is determined by the rank r and the dimension of weights d = d1 = d2: \u2223\u0398\u2223LoRA = 2 \u00d7 d \u00d7 Lt \u00d7 r. For Fourier, the total number takes the form: \u2223\u0398\u2223F ourierF T = n \u00d7 Lt. As an intuitive example, the RoBERTa Base model contains 12 transformer blocks with d = 768, resulting in Lt = 24 layers when we only fine-tune the query and value ones. Therefore, we have \u2223\u0398\u2223LoRA = 294,912 for r = 8, and \u2223\u0398\u2223F ourierF T = 24,000 for n = 1000. In Table 1, we highlight the configurations where LoRA and our method achieve matched performance in subsequent experiments. We note that the advantage of parameter efficiency in FourierFT becomes more pronounced as the model\u2019s scale (depth and width) increases (e.g., RoBERTa Base \u2192RoBERTa Large). This could be because \u2223\u0398\u2223LoRA has an explicit linear relationship with width d, unlike \u2223\u0398\u2223F ourierF T . 4. Experiments In this section, we evaluate FourierFT in the domains of natural language processing (NLP) and computer vision (CV). For NLP, we implement FourierFT for fine-tuning (1) RoBERTa (Base & Large) on natural language understanding (GLUE, (Wang et al., 2018)), (2) GPT-2 (Medium & Large) on natural language generation (E2E, (Novikova et al., 2017)) and (3) LLaMA-family models (7B & 13B) on instruction tuning. For CV, we apply FourierFT to fine-tune the (4) vision transformers (Base & Large) on image classification. Finally, we conduct ablation studies to analyze the effect of frequency bias, the parameter scalability, and the 4 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform Table 2. Performance of various fine-tuning methods with RoBERTa Base (RoBbase) and RoBERTa Large (RoBlarge) models on 6 datasets of the GLUE benchmark. We report the Matthew\u2019s correlation coefficient (MCC) for CoLA, Pearson correlation coefficient (PCC) for STS-B and accuracy (Acc.) for all the remaining tasks. We report the median result of 5 runs, each using different random seeds. The best results for each dataset are shown in bold. Higher is better for all metrics in 6 datasets. Model & Method # Trainable Parameters SST-2 (Acc.) MRPC (Acc.) CoLA (MCC) QNLI (Acc.) RTE (Acc.) STS-B (PCC) Avg. RoBbase(FF) 125M 94.8 90.2 63.6 92.8 78.7 91.2 85.2 RoBbase(BitFit) 0.1M 93.7 92.7 62 91.8 81.5 90.8 85.4 RoBbase(AdptD) 0.3M 94.2\u00b10.1 88.5\u00b11.1 60.8\u00b10.4 93.1\u00b10.1 71.5\u00b12.7 89.7\u00b10.3 83.0 RoBbase(AdptD) 0.9M 94.7\u00b10.3 88.4\u00b10.1 62.6\u00b10.9 93.0\u00b10.2 75.9\u00b12.2 90.3\u00b10.1 84.2 RoBbase(LoRA) 0.3M 95.1\u00b10.2 89.7\u00b10.7 63.4\u00b11.2 93.3\u00b10.3 78.4\u00b10.8 91.5\u00b10.2 85.2 RoBbase(AdaLoRA) 0.3M 94.5\u00b10.2 88.7\u00b10.5 62.0\u00b10.6 93.1\u00b10.2 81.0\u00b10.6 90.5\u00b10.2 85.0 RoBbase(DyLoRA) 0.3M 94.3\u00b10.5 89.5\u00b10.5 61.1\u00b10.3 92.2\u00b10.5 78.7\u00b10.7 91.1\u00b10.6 84.5 RoBbase(FourierFT) 0.024M 94.2\u00b10.3 90.0\u00b10.8 63.8\u00b11.6 92.2\u00b10.1 79.1\u00b10.5 90.8\u00b10.2 85.0 RoBlarge(FF) 356M 96.4 90.9 68 94.7 86.6 92.4 88.2 RoBlarge(AdptP) 3M 96.1\u00b10.3 90.2\u00b10.7 68.3\u00b11.0 94.8\u00b10.2 83.8\u00b12.9 92.1\u00b10.7 87.6 RoBlarge(AdptP) 0.8M 96.6\u00b10.2 89.7\u00b11.2 67.8\u00b12.5 94.8\u00b10.3 80.1\u00b12.9 91.9\u00b10.4 86.8 RoBlarge(AdptH) 6M 96.2\u00b10.3 88.7\u00b12.9 66.5\u00b14.4 94.7\u00b10.2 83.4\u00b11.1 91.0\u00b11.7 86.8 RoBlarge(AdptH) 0.8M 96.3\u00b10.5 87.7\u00b11.7 66.3\u00b12.0 94.7\u00b10.2 72.9\u00b12.9 91.5\u00b10.5 84.9 RoBlarge(LoRA) 0.8M 96.2\u00b10.5 90.2\u00b11.0 68.2\u00b11.9 94.8\u00b10.3 85.2\u00b11.1 92.3\u00b10.5 87.8 RoBlarge(FourierFT) 0.048M 96.0\u00b10.2 90.9\u00b10.3 67.1\u00b11.4 94.4\u00b10.4 87.4\u00b11.6 91.9\u00b10.4 88.0 expressiveness of the Fourier basis. Baselines. We compare our FourierFT method with popular parameter-efficient fine-tuning (PEFT) methods. To ensure a comprehensive and fair comparison, we prioritize replicating the setups used in previous works and reusing their reported results. Involved baselines are: \u25cfFull Fine-tuning (FF) During fine-tuning, the base model is initialized with pre-trained weights and biases, and all parameters will undergo gradient updates. \u25cfBitfit (Zaken et al., 2021) Only the bias vectors are finetuned while all other parameters are frozen. \u25cfAdapter tuning This research line was first investigated by Houlsby et al. (2019), which proposes the AdapterH method. AdapterH inserts two-layer adapters between the self-attention and the FNN modules, followed by a subsequent residual connection. We compare it with three additional variants of it. AdapterL (Lin et al., 2020) is more parameter-efficient, with adapter layers applied only after the MLP modules and subsequent to a LayerNorm. AdapterP (Pfeiffer et al., 2020) implements the adapter layers after the feed-forward layer. This design was chosen through a grid search including all settings related to the adapter\u2019s position, number, ect. AdapterD (R\u00a8 uckl\u00b4 e et al., 2020) further enhances the parameter efficiency by dropping adapter layers that are not activated. \u25cfLoRA (Hu et al., 2021) LoRA is the state-of-the-art method for PEFT. It parameterizes incremental weight updates using trainable low-rank matrices. \u25cfDyLoRA (Valipour et al., 2022) This method trains dynamic search-free LoRA models for the best rank choice. \u25cfAdaLoRA (Zhang et al., 2023) This method proposes the SVD-based fine-tuning and prunes redundant singular values with the importance-aware rank allocation. 4.1. Natural Language Understanding Models and Datasets. We evaluate our method on the GLUE benchmark (General Language Understanding Evaluation (Wang et al., 2018)), which consists of a wide range of natural language understanding (NLU) tasks, including single-sentence classification tasks, similarity and paraphrase tasks and natural language inference tasks. We finetune the pre-trained RoBERTa Base and Large foundation models (Liu et al., 2019) for evaluation. Implementation Details. For both models, FourierFT is allowed to have 1000 out of 7682 (RoBERTa Base) and 10242 (RoBERTa Large) trainable spectral coefficients in each layer, i.e., n = 1000. We randomly sample the spectral entries with no frequency bias, which is shared1 across all 24 (Base) and 48 (Large) layers. For all 6 datasets in GLUE, we tune the hyperparameters of the learning rates and the scaling values. We follow the experimental setup applied in Hu et al. (2021), which involves fine-tuning only the query and value weights in each transformer block and 1We use the value 2024 as the seed for all layers. 5 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform Table 3. Results from GPT-2 Medium and Large models on the E2E benchmark. We present the result from the final epoch. For all metrics, higher values indicate better performance. * indicates that the results are taken from prior works. Best results are shown in bold. Model Method # Trainable Parameters BLEU NIST METEOR ROUGE-L CIDEr GPT-2 Medium FT* 354.92M 68.2 8.62 46.2 71.0 2.47 AdptL* 0.37M 66.3 8.41 45.0 69.8 2.40 AdptL* 11.09M 68.9 8.71 46.1 71.3 2.47 AdptH* 11.09M 67.3\u00b1.6 8.5\u00b1.07 46.0\u00b1.2 70.7\u00b1.2 2.44\u00b1.01 LoRA 0.35M 68.9\u00b1.3 8.76\u00b1.06 46.6\u00b1.1 71.5\u00b1.1 2.53\u00b1.03 FourierFT 0.048M 69.1\u00b1.1 8.82 \u00b1.05 47.0 \u00b1.3 71.8 \u00b1.1 2.51\u00b1.02 GPT-2 Large FT* 774.03M 68.5 8.78 46.0 69.9 2.45 AdptL* 0.88M 69.1\u00b1.1 8.68\u00b1.03 46.3\u00b1.0 71.4\u00b1.2 2.49\u00b1.0 AdptL* 23.00M 68.9\u00b1.3 8.70\u00b1.04 46.1\u00b1.1 71.3\u00b1.2 2.45\u00b1.02 LoRA 0.77M 70.1\u00b1.3 8.83\u00b1.02 46.8\u00b1.2 72.0\u00b1.3 2.47\u00b1.02 FourierFT 0.072M 70.2\u00b1.2 8.90\u00b1.02 47.0\u00b1.2 71.8\u00b1.1 2.50 \u00b1.02 Table 4. The average scores on MT-Bench and Vicuna assessed by GPT-4. \u2020 indicates updating the layers other than lm head. Higher score is better. Model Method # Trainable Parameters MT-Bench Vicuna LLaMA1-7B LoRA\u2020 159.9M 5.05\u00b1.3 6.85\u00b1.4 LoRA 33.5M 4.99\u00b1.3 6.81\u00b1.3 FourierFT 0.064M 5.09\u00b1.6 6.85\u00b1.8 LLaMA1-13B LoRA\u2020 250.3M 5.28\u00b1.6 7.02\u00b1.3 LoRA 52.4M 5.21\u00b1.4 6.97\u00b1.4 FourierFT 0.08M 5.23\u00b1.3 7.14\u00b1.5 LLaMA2-7B LoRA\u2020 159.9M 5.19\u00b1.1 7.38\u00b1.3 LoRA 33.5M 5.20\u00b1.3 7.35\u00b1.6 FourierFT 0.064M 5.18\u00b1.3 7.49\u00b1.4 LLaMA2-13B LoRA\u2020 250.3M 5.78\u00b1.2 7.89\u00b1.5 LoRA 52.4M 5.80\u00b1.2 7.89\u00b1.6 FourierFT 0.08M 5.82\u00b1.3 7.92\u00b1.5 fully fine-tuning the classification head. We provide the hyperparameters in Table 9 in Appendix. Results. Results are summarized in Table 2. Following Hu et al. (2021), Zhang et al. (2023) and Valipour et al. (2022), we specify the number of trainable parameters for the finetuned layers excluding the classification head. We report the median of 5 random seed results, where the best epoch is selected for each run. In general, FourierFT achieves better or on-par performance compared with baseline methods with significantly fewer trainable parameters. Notably, FourierFT outperforms all baselines including fully fine-tuning the RoBERTa Base on CoLA and the RoBERTa Large on RTE. As mentioned in Section 3.2, the parameter count of LoRA is dependent on both the width and depth of models, resulting in a larger count growth (LoRA: 0.8M/0.3M \u22482.7; ours: 0.048M/0.024M = 2) compared to FourierFT. Nevertheless, FourierFT still performs comparably to LoRA, demonstrating the potential scalability of our method when facing even larger models. 4.2. Natural Language Generation Models and Datasets. We evaluate the performance of FourierFT on the E2E natural language generation (NLG) task (Novikova et al., 2017). We fine-tune the GPT-2 (Radford et al., 2019) Medium (354M) and Large (774M) models, which are both decoder-only and have 24 and 36 transformer blocks, respectively. The E2E benchmark contains roughly 42,000 training, 4,600 validation and 4,600 test samples from the restaurant domain. Implementation Details. We report prior results for baselines other than LoRA. For both LoRA and our method, we fine-tune the GPT-2 Medium and Large models with a linear learning rate scheduler for 5 epochs, where we tune the batch size and learning rate. We report the average results over 3 runs, where the last epoch is selected for each run. We provide the hyperparameters in Table 10 in Appendix. Results. We show the results in Table 3. We note that FourierFT can achieve the best performance on most metrics. More importantly, FourierFT only requires 13.7% and 9.4% of the parameter counts of LoRA, for the GPT-2 Medium and Large models respectively. 4.3. Instruction Tuning Models and Datasets. Instruction tuning, as described in (Ouyang et al., 2022; Wei et al., 2021; Mishra et al., 2021), refers to the process of fine-tuning a language model on a collection of paired prompts and responses. We apply LoRA and FourierFT to fine-tune the LLaMA (Touvron et al., 2023a) and LLaMA2 (Touvron et al., 2023b) families. Specifically, we consider the LLaMA-7B, LLaMA-13B, LLaMA2-7B and LLaMA2-13B as base models, which are fine-tuned on the Alpaca dataset (Taori et al., 2023). Alpaca contains 51K instruction-following demonstrations generated from text-davinci-003 (GPT-3.5) (Wang et al., 2022). For evaluation, we use the fine-tuned models to generate responses for the pre-defined questions, which are from the MT-Bench (Zheng et al., 2023) and Vicuna Eval (Chiang et al., 2023). GPT-4 takes these answers as input and evaluates them with scores within 10. Implementation Details. For LoRA, we use r = 64 and apply two configurations: (1) updating all linear layers except the language modelling head (lm head); (2) updating only the WQ and WV matrices. For FourierFT, we only adopt the latter configuration with n = 1000. To ensure the 6 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform Table 5. Fine-tuning results with ViT Base and Large models on different image classification datasets. We report the accuracy (%) after 10 epochs. Avg. represents the average accuracy of each method on all datasets. The best performance is shown in bold. Model Method # Trainable Parameters OxfordPets StanfordCars CIFAR10 DTD EuroSAT FGVC RESISC45 CIFAR100 Avg. ViT-Base LP 90.28\u00b10.43 25.76\u00b10.28 96.41\u00b10.02 69.77\u00b10.67 88.72\u00b10.13 17.44\u00b10.43 74.22\u00b10.10 84.28\u00b10.11 68.36 FF 85.8M 93.14\u00b10.40 79.78\u00b11.15 98.92\u00b10.05 77.68\u00b11.21 99.05\u00b10.09 54.84\u00b11.23 96.13\u00b10.13 92.38\u00b10.13 86.49 LoRA 581K 93.19\u00b10.36 45.38\u00b10.41 98.78\u00b10.05 74.95\u00b10.40 98.44\u00b10.15 25.16\u00b10.16 92.70\u00b10.18 92.02\u00b10.12 77.58 FourierFT 72K 93.21\u00b10.26 46.11\u00b10.24 98.58\u00b10.07 75.09\u00b10.37 98.29\u00b10.04 27.51\u00b10.64 91.97\u00b10.31 91.20\u00b10.14 77.75 FourierFT 239K 93.05\u00b10.34 56.36\u00b10.66 98.69\u00b10.08 77.30\u00b10.61 98.78\u00b10.11 32.44\u00b10.99 94.26\u00b10.20 91.45\u00b10.18 80.29 ViT-Large LP 91.11\u00b10.30 37.91\u00b10.27 97.78\u00b10.04 73.33\u00b10.26 92.64\u00b10.08 24.62\u00b10.24 82.02\u00b10.11 84.28\u00b10.11 72.96 FF 303.3M 94.43\u00b10.56 88.90\u00b10.26 99.15\u00b10.05 81.79\u00b11.01 99.04\u00b10.08 68.25\u00b11.63 96.43\u00b10.07 93.58\u00b10.19 90.20 LoRA 1.57M 94.82\u00b10.09 73.25\u00b10.36 99.13\u00b10.03 81.79\u00b10.45 98.63\u00b10.07 42.32\u00b10.98 94.71\u00b10.25 94.87\u00b10.10 84.94 FourierFT 144K 94.46\u00b10.28 69.56\u00b10.30 99.10\u00b10.04 80.83\u00b10.43 98.65\u00b10.09 39.92\u00b10.68 93.86\u00b10.14 93.31\u00b10.09 83.71 FourierFT 480K 94.84\u00b10.05 79.14\u00b10.67 99.08\u00b10.01 81.88\u00b10.50 98.66\u00b10.03 51.28\u00b10.68 95.20\u00b10.07 93.37\u00b10.11 86.68 feasibility of training on a single GPU, we deploy the quantization method in Dettmers et al. (2023) for fine-tuning. We train with both methods for only one epoch, and report the average scores of all answers. We provide the hyperparameter setup in Table 11 in the Appendix. Results. The results are shown in Table 4. We find that the expressive power of the 13B model is much stronger than that of the 7B model, regardless of which fine-tuning method is used. Moreover, FourierFT closely matches or slightly exceeds LoRA\u2019s performance with less than 0.2% of its parameters. We provide practical examples containing questions, answers and reviews in the Appendix D. 4.4. Image Classification Models and Datasets. We evaluate our method on the image classification task. We adopt the Base and Large versions of the popular CV foundation model, Vision Transformer (ViT) (Dosovitskiy et al., 2020). The ViTs are pretrained on the ImageNet-21K dataset (Ridnik et al., 2021). The datasets for fine-tuning include OxfordPets (372), CIFAR10 (10), DTD (47), EuroSAT (10) and RESISC45 (45) with small label spaces, as well as StanfordCars (196), FGVC (100) and CIFAR100 (100) with large label spaces. Detailed information is provided in Table 8 in the Appendix. Implementation Details. We include three baselines for evaluation: Full Fine-tuning (FF), Linear Probing (LP, finetuning the classification head only), and LoRA. For both LoRA and our method, only the query and value matrices of ViT are updated. We use r = 16 for LoRA and n = {3000,10000} for FourierFT. We tune the learning rates and weight decay for all methods, and set the maximum training epoch to 10. We provide the hyperparameters in Table 12 in Appendix. 2Numbers in parentheses indicate class counts for each dataset. Results. Table 5 summarizes the results for 8 image classification datasets with the ViT Base and Large models. Both LoRA and FourierFT methods significantly outperform the Linear Probing, demonstrating their effectiveness in the CV domain. Our method obtains matched performance using 12.4% and 9.2% of LoRA\u2019s parameter count, with ViT Base and Large models, respectively. Notably, when we increase the parameter count of FourierFT to 41.1% (ViT Base) and 30.6% (ViT Large) of LoRA\u2019s, it can outperform LoRA by 3.5% and 2.0% respectively. Moreover, our method can even (slightly) outperform the Full Fine-tuning method on OxfordPets and DTD with the ViT Large model. 4.5. Study Effect of Frequency Bias. We examine how the performance is affected by the frequency bias, i.e., the central frequency fc in Eq. 5. We directly apply the optimal hyperparameters searched in Table 2 and fine-tune the RoBERTa Base on the MRPC, STS-B, CoLA and RTE datasets. From Figure 5, we note that the fine-tuning performance of FourierFT without any frequency bias can surpass most cases that are restricted by the central frequency bias. This indicates the universality of our method. Surprisingly, we find that it is always possible to obtain results better than \u201cNo bias\u201d by traversing the fc values. Since this traversal is not efficient, we do not conduct further exploration in this paper. However, we believe that making fc trainable will be a promising new direction for improving FourierFT. Parameter Scalability. We explore the relationship between the number of trainable parameters and the performance of LoRA and our method. We use the set of ranks r = {1,2,4,6,8,15} for LoRA and n = {50,100,200,1000,6144,12288} for FourierFT on 6 tasks of the GLUE benchmark. For both LoRA and ours, the learning rate, and scaling hyperparameters are tuned. For fairness, we ensure that the number of trials for hyperparam7 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform 4 6 8 10 ln # Trainable Parameters 88 89 90 Accuracy MRPC LoRA FourierFT 4 6 8 10 ln # Trainable Parameters 58 60 62 64 Matthew s Corr. CoLA 4 6 8 10 ln # Trainable Parameters 78 80 Accuracy RTE 4 6 8 10 ln # Trainable Parameters 90.0 90.5 91.0 91.5 Pearson Corr. STS-B 4 6 8 10 ln # Trainable Parameters 94.0 94.5 95.0 Accuracy SST-2 4 6 8 10 ln # Trainable Parameters 90 91 92 Accuracy QQP Figure 4. Performance on the GLUE benchmark with RoBERTa Base vs. number of trainable parameters (each layer) of LoRA and ours. For all 6 datasets, we apply the setting of r = {1, 2, 4, 6, 8, 15} for LoRA and n = {50, 100, 200, 1000, 6144, 12288}. 0 100 200 300 400 500 fc 76 77 78 79 Acc. RTE No bias 0 100 200 300 400 500 fc 89.2 89.4 89.6 89.8 90.0 Acc. MRPC No bias 0 100 200 300 400 500 fc 90.5 90.6 90.7 90.8 PCC. STS-B No bias 0 100 200 300 400 500 fc 62.0 62.5 63.0 63.5 MCC. CoLA No bias Figure 5. Results on 4 datasets in GLUE with different fc values. eter search is 30 for both methods. As shown in Figure 4, our method outperforms LoRA on all 6 datasets. In detail, our method is significantly better than LoRA with the same parameter count, i.e., {r = 4,n = 6144} & {r = 8,n = 12288}. Moreover, we observe that a larger number of parameters does not always bring performance gains for LoRA. On the contrary, the increase of n can consistently improve the accuracy of FourierFT. On most tasks, FourierFT with n = 50 can achieve comparable or even better (MRPC, CoLA, RTE) performance than LoRA with r = 1. In this case, the parameter count in LoRA is about 31 \u00d7 that of ours. Basis Expressiveness. The inverse discrete Fourier transform (IDFT) in Eq. 3 is equivalent to the matrix multiplication (Lu et al., 2021): S = BfFB\u22ba f, where B is the transformation matrix of IDFT that contains the Fourier basis. To evaluate its expressivity, we replace the Fourier basis with random and orthogonal basis, respectively. Specifically, for F \u2208Rd1\u00d7d2, we initialize random basis B1 r \u2208Rd1\u00d7d1 and B2 r \u2208Rd2\u00d7d2 with the normal Gaussian distribution. Then Eq. 3 becomes S = B1 rFB2 r. A similar way is used for the orthogonal basis. We compare FourierFT with the random basis (R-B) and orthogonal basis (O-B) on the GLUE benchmark. Table 6 shows the results. We note that the Fourier basis used in our method outperforms the random and orthogonal basis. In addition, the expressive power of the orthogonal basis is much stronger than that of the random basis. The stronger expressive power of the Fourier basis compared to the general orthogonal basis may be attributed to its effective capture of the spectral information of \u2206W. Table 6. Results with three types of basis. Model RTE CoLA Ours R-B O-B Ours R-B O-B Base 79.1 72.7(\u21938.1%) 75.6(\u21934.4%) 63.8 58.7(\u21938.0%) 60.0(\u21936.0%) Large 87.4 81.8(\u21936.4%) 83.6(\u21934.3%) 67.1 64.8(\u21933.4%) 66.1(\u21931.5%) 5.", + "additional_graph_info": { + "graph": [ + [ + "Ziqi Gao", + "Zijing Liu" + ], + [ + "Ziqi Gao", + "Qichao Wang" + ], + [ + "Ziqi Gao", + "Aochuan Chen" + ], + [ + "Zijing Liu", + "Xianbin Ye" + ], + [ + "Qichao Wang", + "Bingzhe Wu" + ], + [ + "Qichao Wang", + "Tian Bian" + ], + [ + "Qichao Wang", + "Yian Yin" + ], + [ + "Aochuan Chen", + "Sijia Liu" + ], + [ + "Aochuan Chen", + "Yihua Zhang" + ], + [ + "Aochuan Chen", + "Yuguang Yao" + ], + [ + "Aochuan Chen", + "Yimeng Zhang" + ] + ], + "node_feat": { + "Ziqi Gao": [ + { + "url": "http://arxiv.org/abs/2405.03003v1", + "title": "Parameter-Efficient Fine-Tuning with Discrete Fourier Transform", + "abstract": "Low-rank adaptation~(LoRA) has recently gained much interest in fine-tuning\nfoundation models. It effectively reduces the number of trainable parameters by\nincorporating low-rank matrices $A$ and $B$ to represent the weight change,\ni.e., $\\Delta W=BA$. Despite LoRA's progress, it faces storage challenges when\nhandling extensive customization adaptations or larger base models. In this\nwork, we aim to further compress trainable parameters by enjoying the powerful\nexpressiveness of the Fourier transform. Specifically, we introduce FourierFT,\nwhich treats $\\Delta W$ as a matrix in the spatial domain and learns only a\nsmall fraction of its spectral coefficients. With the trained spectral\ncoefficients, we implement the inverse discrete Fourier transform to recover\n$\\Delta W$. Empirically, our FourierFT method shows comparable or better\nperformance with fewer parameters than LoRA on various tasks, including natural\nlanguage understanding, natural language generation, instruction tuning, and\nimage classification. For example, when performing instruction tuning on the\nLLaMA2-7B model, FourierFT surpasses LoRA with only 0.064M trainable\nparameters, compared to LoRA's 33.5M. Our code is released at\n\\url{https://github.com/Chaos96/fourierft}.", + "authors": "Ziqi Gao, Qichao Wang, Aochuan Chen, Zijing Liu, Bingzhe Wu, Liang Chen, Jia Li", + "published": "2024-05-05", + "updated": "2024-05-05", + "primary_cat": "cs.LG", + "cats": [ + "cs.LG", + "cs.AI", + "cs.CL" + ], + "main_content": "Introduction Large foundation models (LFMs) have demonstrated exceptional performance on tasks of multiple domains, including natural language processing (NLP) (Liu et al., 2019; He et al., 2020; Radford et al., 2019; Brown et al., 2020; Li et al., 2022) and computer vision (CV) (Liu et al., 2023a;b; Singh et al., 2022; Rombach et al., 2022). Owing to their *Equal contribution 1Hong Kong University of Science and Technology (Guangzhou) 2Hong Kong University of Science and Technology 3Sun Yat-sen University 4International Digital Economy Academy 5AI Lab, Tencent. Correspondence to: Jia Li . Proceedings of the 41 st International Conference on Machine Learning, Vienna, Austria. PMLR 235, 2024. Copyright 2024 by the author(s). Figure 1. Summary of the performance (y-axis) of fine-tuning methods with different numbers (x-axis) of trainable parameters on NLP (left) and CV (right) tasks. The left side shows the instruction tuning task, where the LLaMA2-7B model is fine-tuned with Alpaca and evaluated by GPT-4. The right side shows the image classification task, where the Vision Transformer (ViT) is finetuned and tested on the DTD dataset. Black circles (\u25cf) represent the Full Fine-tuning (FF) method. Orange circles (\u25cf) represent LoRA method with r = {32, 64, 128} (left) and r = {8, 16, 32} (right). Blue circles (\u25cf) represent our proposed method with n = {1000, 2000} (left) and n = {3000, 10000} (right). impressive capabilities, fine-tuning LFMs for a wide range of downstream tasks has become prevalent (Wang et al., 2022; Taori et al., 2023; Qiu et al., 2020). Under the full fine-tuning paradigm, the new model adapted to each customized task typically contains as many parameters as the original model (Qiu et al., 2020; Raffel et al., 2020; Chen et al., 2024; Gao et al., 2024). As models grow larger and customization needs expand, the demand for storing finetuned checkpoints rises, resulting in both costly storage and memory consumption. As a popular way to address this issue, LoRA (Hu et al., 2021) represents the weight change with two low-rank matrices A and B, i.e., W0+\u2206W = W0+BA. Despite LoRA\u2019s superb performance, its large size of trainable parameters still brings high IT infrastructure consumption, which affects both ends of public communities and individual users. For the former, an intuitive example is that a LoRA adapter (finetuned weights) for a specific style of the stable diffusion model (Rombach et al., 2022) requires about 40MB of memory. This necessitates the LFM communities (e.g., Civi1 arXiv:2405.03003v1 [cs.LG] 5 May 2024 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform tai (Civitai, 2024)) to bear high storage and bandwidth costs to cater to a large user base. For the latter, fewer parameters mean direct RAM savings when loading fine-tuned weights in mobile APPs, enabling sufficient customization for individual users (Zhou et al., 2022). To this end, we naturally ask the question: How can we aggressively compress trainable parameters even further for fine-tuning LFMs? Previous works have demonstrated the powerful expressiveness of Fourier basis in data compression, where extremely sparse spectral information can be used to recover highfidelity data (e.g., 1D signal vectors (Zwartjes & Gisolf, 2007; Duarte & Baraniuk, 2013; Rudelson & Vershynin, 2008) and 2D image matrices (Vlaardingerbroek & Boer, 2013; Song et al., 2021; Shi et al., 2014)). More importantly, when dealing with more general (non-image) matrices that lack strong spatial semantics and are not frequency-sparse, Fourier transform can still handle recovery effectively (Chen & Chi, 2013; Yang & Xie, 2016). Motivated by this, we investigate the potential for updating the weight change \u2206W with its sparse spectral coefficients for fine-tuning LFMs. In this paper, we aim to aggressively reduce the number of trainable parameters for fine-tuning LFMs. To this end, we propose FourierFT (Fourier Transform for Fine-Tuning), which treats the weight change \u2206W as a matrix in the spatial domain, and learns its sparse spectral coefficients. Specifically, we first randomly select n spectral entries that are shared across all layers. For each layer, FourierFT learns n spectral coefficients located at these n selected entries and then directly applies inverse discrete Fourier transform to compute the updated \u2206W. Therefore, fine-tuning a pretrained model with Lt layers only requires storing 2n entry parameters and nLt coefficient parameters for FourierFT. Empirically, we compare our method with state-of-the-art LoRA variants and other parameter-efficient fine-tuning methods on various tasks including (1) natural language understanding (on the GLUE benchmark), (2) natural language generation (on the E2E benchmark), (3) instruction tuning (with LLaMA-family models), and (4) image classification (with vision transformers). FourierFT can always achieve comparable or even better performance than LoRA, with about 6.0%, 9.4%, 0.2% and 9.2% of LoRA\u2019s trainable parameters for these 4 tasks, respectively. For example in Figure 1, on the instruction tuning task, our FourierFT method outperforms LoRA with only 64K trainable parameters. Moreover, it achieves a comparable score to Full Fine-tuning with only 128K parameters. 2. Related Works Parameter-Efficient Fine-Tuning. With the rapid expansion of large foundation models (LFM), it has become challenging and important to efficiently adapt them for specific tasks. To this end, numerous methods for parameter-efficient fine-tuning (PEFT) are proposed, demonstrating impressive capabilities in both efficiency and accuracy. Existing PEFT methods are broadly partitioned into two categories: nonweight-based and weight-based methods. Non-weight-based methods do not optimize pre-trained LFMs at the weight level. Instead, they achieve fine-tunings by introducing additional modules or optimizing prompts and prefixes. Adapter tuning (He et al., 2021; Rebuffi et al., 2017; Pfeiffer et al., 2020; Houlsby et al., 2019; R\u00a8 uckl\u00b4 e et al., 2020; Lin et al., 2020) aims to introduce light-weighted neural modules, called adapters, between pre-trained layers of the base model. These methods keep the pre-trained weights frozen and efficiently fine-tune the adapters for customized tasks. Prompt tuning (Brown et al., 2020; Lester et al., 2021; Gao et al., 2020; Diao et al., 2022) and prefix tuning (Li & Liang, 2021) insert additional prompts or prefix tokens to the layers of the base model. Weight-based methods, represented by LoRA (Hu et al., 2021), introduce and then update weight changes that can be merged with the original weights to avoid inference latency. LoRA\u2019s innovation lies in the multiplication of low-rank matrices to approximate weight changes. Building upon this, AdaLoRA (Zhang et al., 2023) extends the LoRA method by distributing the parameter budget across weight matrices with importance scores. Additionally, Q-LoRA (Dettmers et al., 2023) proposes to back-propagate gradients upon LoRA through a quantized pre-trained model with 4-bit NormalFloat. Here, we focus on weight-based methods and achieve huge parameter reduction with the powerful expressiveness of Fourier basis, rather than following the low-rank structure. Sparse Fourier Transform in Deep Learning. Sparse Fourier transform (SFT) has flourished in various fields of deep learning (DL). The SFT technique mainly involves using sparse spectral coefficients of significant (Xu et al., 2020; Ehrlich & Davis, 2019; Gueguen et al., 2018; Tang et al., 2022) or even random (Lin et al., 2014; Rawat et al., 2019; Herrmann, 2010) spectral entries, for representation learning. One important application of this technique is matrix recovery. Patel et al. (2011) designs a gradient-based compressed sensing method to recover images with their sparse Fourier information. Shechtman et al. (2014) proposes an efficient phase retrieval method that improves data recovery using sparse Fourier coefficients. Importantly, previous works (Chen & Chi, 2013; Yang & Xie, 2016; Gao et al., 2022) show that even when the original data is not frequency-sparse, SFT can effectively recover the data with extremely few parameters. Although previous works lack studies on the recovery for the weight matrices of DL models with SFT, the aforementioned methods provide potential support for this work. 2 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform Pre-trained Weights \ud835\udc4a\u2208\u211d!!\u00d7!\" \ud835\udc35= 0 \ud835\udc34= \ud835\udca9(0, \ud835\udf0e!) \u210e \ud835\udc65 \ud835\udc51# \ud835\udc51$ \ud835\udc5f Pre-trained Weights \ud835\udc4a\u2208\u211d!!\u00d7!\" \u210e \ud835\udc65 \ud835\udc51# \ud835\udc51$ Random entries (shared across layers) \u211d!\u00d7# \ud835\udc5b Coefficients : Frozen : Trainable LoRA FourierFT IDFT Dense Spectral Matrix F Figure 2. Overview of LoRA (left) and our FourierFT (right) method. In LoRA, only low-rank (r) matrices A and B are trained. The weight change is represented by their multiplication, i.e., \u2206W = BA. For each pre-trained weight W, the theoretical number of trainable parameters in LoRA is r \u00d7 (d1 + d2). In FourierFT, we first randomly generate the spectral entry matrix R2\u00d7n, which is shared across all layers to reduce parameter storage requirements. The complete spectral matrix is formed by a trainable coefficient vector Rn located at selected entries and 0s at the remaining entries. We obtain the weight change \u2206W by directly performing inverse discrete Fourier transform (IDFT) on the updated spectral matrix. For all L adapted layers, FourierFT needs to store n \u00d7 (2 + L) parameters. 3. Method We present FourierFT (depicted in Figure 2), a parameterefficient fine-tuning method based on discrete Fourier transform. FourierFT follows the principle of only learning the change in the pre-trained weight, as proposed by LoRA (Hu et al., 2021). However, unlike LoRA, FourierFT does not adopt the low-rank structure but learns a set of spectral coefficients of Fourier basis. Specifically, we randomly initialize the spectral entry matrix, which is frozen and shared across all layers. We make the spectral coefficients located at selected entries trainable, which jointly form the spectral matrix. Lastly, we apply the inverse discrete Fourier transform to the spectral matrix, yielding its spatial-domain counterpart as the updated weight change. 3.1. Forward Pass We follow the paradigm of only learning weight changes, as adopted by LoRA-based methods (Hu et al., 2021; Dettmers et al., 2023; Zhang et al., 2023). This can avoid inference latency by merging the pre-trained weight and its change. Formally, we define each pre-trained weight matrix as W0 \u2208 Rd1\u00d7d2, and the weight change for fine-tuning as \u2206W \u2208 Rd1\u00d7d2. LoRA aims to parameterize \u2206W in the form of low-rank decomposition in the forward pass: h = W0x + \u2206Wx = W0x + BAx, (1) where B \u2208Rd1\u00d7r and A \u2208Rr\u00d7d2 with the rank r \u226a min(d1,d2) are trainable matrices. The advantage of FourierFT is that the orthogonal and expressive Fourier basis enables recovery of informative weight changes. This promisingly suggests achieving comparable performance to LoRA with significantly fewer parameters. We first randomly initialize the entry matrix E \u2208R2\u00d7n containing discrete 2D spectral entries. Then we randomly initialize the coefficients c \u2208Rn with a normal Gaussian distribution. The proposed forward pass is: F = TODENSE(E,c) (2) Sp,q = d1\u22121 \u2211 j=0 d2\u22121 \u2211 k=0 Fj,kei2\u03c0( p d1 j+ q d2 k) (3) h = W0x + \u2206Wx = W0x + \u03b1R(S)x. (4) Specifically, TODENSE in Eq. 2 represents to construct the spectral matrix F \u2208Rd1\u00d7d2, i.e., Fj,k = cl (resp. 0), if j = E0,l & k = E1,l (resp. else). Eq. 3 computes the spatio matrix S via the inverse discrete Fourier transform, where i represents the imaginary unit. Finally, in Eq. 4, we take the real part of the complex matrix S (denoted as R(S)) and scale it by \u03b1. Kindly note that all layers involve training various c vectors, while sharing the matrix E and value \u03b1. The pseudocode for FourierFT is shown as Algorithm 1, adhering to the PyTorch style. Initialization for the Entry Matrix E. Previous works lack studies on the importance of the spectral entries in the weight change. Thus, we fill this gap by introducing adjustable frequency bias, causing the entries to be more likely sampled in this area. In addition to randomly sampling entries in the full d1 \u00d7 d2-sized spectral matrix (i.e., no bias), we also implement entry sampling with a bias towards a favored central frequency, e.g., low, middle, or 3 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform Algorithm 1 PyTorch-style pseudocode for FourierFT. class FourierFT(nn.Module): def __init__( self, n: int = 100, # number of trainable parameters alpha: float = 300.0, # scaling d1: int = 4096, # input dimension d2: int = 4096, # output dimension base_layer: nn.Module # pre-trained layer ) # definitions self.d1 = d1 self.d2 = d2 self.n = n self.alpha = alpha self.base_layer = base_layer # entry initialization (no frequency bias) self.E = torch.randperm(d1 * d2)[:n] self.E = torch.stack([self.E // self.d1, self.E % self.d2], dim=0) # spectral coefficient initialization self.c = nn.Parameter(torch.randn(n), \\\\ requires_grad=True) def forward(self, x: torch.Tensor): # get dense spectral matrix (Eq.2) F = torch.zeros(self.d1, self.d2) F[self.E[0, :], self.E[1, :]] = self.c # compute Delta_W (Eq.3) Delta_W = torch.fft.ifft2(F).real * self.alpha # merge (Eq.4) h = self.base_layer(x) h += torch.einsum(\u2019ijk,kl->ijl\u2019, x, Delta_W) return h high frequencies. Formally, we apply the Gaussian bandpass filter (Gonzales & Wintz, 1987) to model the sampling probability for the entry (u,v),0 \u2264u \u2264d1\u22121,0 \u2264v \u2264d2\u22121: p(u,v) = exp\u239b \u239d\u2212(D2 \u2212f 2 c DW ) 2\u239e \u23a0, (5) where D represents the distance from the point (u,v) to the origin (center of the matrix), fc is the favored central frequency, and W represents the bandwidth. In Figure 3, we visualize the sampling probability map of a 768 \u00d7 768-sized spectral matrix with different fc and W = 200. fc = 0 fc = 100 fc = 200 fc = 350 fc = 480 0 0.5 1 Figure 3. Visualization of entry sampling probability at different favored central frequencies fc. Kindly note that unless specially stated, FourierFT is set by default to the entry initialization with no frequency bias. 3.2. Parameter Summary We summarize the number of trainable parameters for LoRA and FourierFT in Table 1. LoRA relies on a pair of trainable matrices A and B for each layer. Let the number of layers for fine-tuning be Lt. The total number of parameters in Table 1. Theoretical number of trainable parameters and storage requirements for fine-tuning. For both LoRA and FourierFT methods, only the query and value layers are tuned within the transformer architectures. The configurations that are exactly chosen in the \u2018Experiments\u2019 Section are highlighted . Base Models LoRA FourierFT r # Trainable Parameters Required Bytes n # Trainable Parameters Required Bytes RoBERTa Base 4 147K 574KB 200 4.8K 18.8KB 8 295K 1.13MB 200 24K 94KB RoBERTa Large 4 393K 1.5MB 200 9.6K 36.5KB 8 786K 3MB 1000 48K 183KB GPT-2 Medium 4 350K 1.34MB 500 24K 94KB 8 786K 3MB 1000 48K 188KB GPT-2 Large 4 737K 2.81MB 500 36K 141KB 8 1.47M 5.74MB 1000 72K 282KB LLaMA-2 7B 16 8.39M 32.8MB 1000 64K 250KB 64 33.5M 131.1MB 2000 128K 500KB LLaMA-2 13B 16 13.1M 51.2MB 1000 80K 312KB 64 52.4M 204.8MB 2000 160K 625KB ViT Base 8 295K 1.13MB 3000 72K 281KB 16 590K 2.25MB 10000 239K 934KB ViT Large 8 786K 2.93MB 3000 144K 563KB 16 1.57M 6MB 10000 480K 1.83MB LoRA is determined by the rank r and the dimension of weights d = d1 = d2: \u2223\u0398\u2223LoRA = 2 \u00d7 d \u00d7 Lt \u00d7 r. For Fourier, the total number takes the form: \u2223\u0398\u2223F ourierF T = n \u00d7 Lt. As an intuitive example, the RoBERTa Base model contains 12 transformer blocks with d = 768, resulting in Lt = 24 layers when we only fine-tune the query and value ones. Therefore, we have \u2223\u0398\u2223LoRA = 294,912 for r = 8, and \u2223\u0398\u2223F ourierF T = 24,000 for n = 1000. In Table 1, we highlight the configurations where LoRA and our method achieve matched performance in subsequent experiments. We note that the advantage of parameter efficiency in FourierFT becomes more pronounced as the model\u2019s scale (depth and width) increases (e.g., RoBERTa Base \u2192RoBERTa Large). This could be because \u2223\u0398\u2223LoRA has an explicit linear relationship with width d, unlike \u2223\u0398\u2223F ourierF T . 4. Experiments In this section, we evaluate FourierFT in the domains of natural language processing (NLP) and computer vision (CV). For NLP, we implement FourierFT for fine-tuning (1) RoBERTa (Base & Large) on natural language understanding (GLUE, (Wang et al., 2018)), (2) GPT-2 (Medium & Large) on natural language generation (E2E, (Novikova et al., 2017)) and (3) LLaMA-family models (7B & 13B) on instruction tuning. For CV, we apply FourierFT to fine-tune the (4) vision transformers (Base & Large) on image classification. Finally, we conduct ablation studies to analyze the effect of frequency bias, the parameter scalability, and the 4 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform Table 2. Performance of various fine-tuning methods with RoBERTa Base (RoBbase) and RoBERTa Large (RoBlarge) models on 6 datasets of the GLUE benchmark. We report the Matthew\u2019s correlation coefficient (MCC) for CoLA, Pearson correlation coefficient (PCC) for STS-B and accuracy (Acc.) for all the remaining tasks. We report the median result of 5 runs, each using different random seeds. The best results for each dataset are shown in bold. Higher is better for all metrics in 6 datasets. Model & Method # Trainable Parameters SST-2 (Acc.) MRPC (Acc.) CoLA (MCC) QNLI (Acc.) RTE (Acc.) STS-B (PCC) Avg. RoBbase(FF) 125M 94.8 90.2 63.6 92.8 78.7 91.2 85.2 RoBbase(BitFit) 0.1M 93.7 92.7 62 91.8 81.5 90.8 85.4 RoBbase(AdptD) 0.3M 94.2\u00b10.1 88.5\u00b11.1 60.8\u00b10.4 93.1\u00b10.1 71.5\u00b12.7 89.7\u00b10.3 83.0 RoBbase(AdptD) 0.9M 94.7\u00b10.3 88.4\u00b10.1 62.6\u00b10.9 93.0\u00b10.2 75.9\u00b12.2 90.3\u00b10.1 84.2 RoBbase(LoRA) 0.3M 95.1\u00b10.2 89.7\u00b10.7 63.4\u00b11.2 93.3\u00b10.3 78.4\u00b10.8 91.5\u00b10.2 85.2 RoBbase(AdaLoRA) 0.3M 94.5\u00b10.2 88.7\u00b10.5 62.0\u00b10.6 93.1\u00b10.2 81.0\u00b10.6 90.5\u00b10.2 85.0 RoBbase(DyLoRA) 0.3M 94.3\u00b10.5 89.5\u00b10.5 61.1\u00b10.3 92.2\u00b10.5 78.7\u00b10.7 91.1\u00b10.6 84.5 RoBbase(FourierFT) 0.024M 94.2\u00b10.3 90.0\u00b10.8 63.8\u00b11.6 92.2\u00b10.1 79.1\u00b10.5 90.8\u00b10.2 85.0 RoBlarge(FF) 356M 96.4 90.9 68 94.7 86.6 92.4 88.2 RoBlarge(AdptP) 3M 96.1\u00b10.3 90.2\u00b10.7 68.3\u00b11.0 94.8\u00b10.2 83.8\u00b12.9 92.1\u00b10.7 87.6 RoBlarge(AdptP) 0.8M 96.6\u00b10.2 89.7\u00b11.2 67.8\u00b12.5 94.8\u00b10.3 80.1\u00b12.9 91.9\u00b10.4 86.8 RoBlarge(AdptH) 6M 96.2\u00b10.3 88.7\u00b12.9 66.5\u00b14.4 94.7\u00b10.2 83.4\u00b11.1 91.0\u00b11.7 86.8 RoBlarge(AdptH) 0.8M 96.3\u00b10.5 87.7\u00b11.7 66.3\u00b12.0 94.7\u00b10.2 72.9\u00b12.9 91.5\u00b10.5 84.9 RoBlarge(LoRA) 0.8M 96.2\u00b10.5 90.2\u00b11.0 68.2\u00b11.9 94.8\u00b10.3 85.2\u00b11.1 92.3\u00b10.5 87.8 RoBlarge(FourierFT) 0.048M 96.0\u00b10.2 90.9\u00b10.3 67.1\u00b11.4 94.4\u00b10.4 87.4\u00b11.6 91.9\u00b10.4 88.0 expressiveness of the Fourier basis. Baselines. We compare our FourierFT method with popular parameter-efficient fine-tuning (PEFT) methods. To ensure a comprehensive and fair comparison, we prioritize replicating the setups used in previous works and reusing their reported results. Involved baselines are: \u25cfFull Fine-tuning (FF) During fine-tuning, the base model is initialized with pre-trained weights and biases, and all parameters will undergo gradient updates. \u25cfBitfit (Zaken et al., 2021) Only the bias vectors are finetuned while all other parameters are frozen. \u25cfAdapter tuning This research line was first investigated by Houlsby et al. (2019), which proposes the AdapterH method. AdapterH inserts two-layer adapters between the self-attention and the FNN modules, followed by a subsequent residual connection. We compare it with three additional variants of it. AdapterL (Lin et al., 2020) is more parameter-efficient, with adapter layers applied only after the MLP modules and subsequent to a LayerNorm. AdapterP (Pfeiffer et al., 2020) implements the adapter layers after the feed-forward layer. This design was chosen through a grid search including all settings related to the adapter\u2019s position, number, ect. AdapterD (R\u00a8 uckl\u00b4 e et al., 2020) further enhances the parameter efficiency by dropping adapter layers that are not activated. \u25cfLoRA (Hu et al., 2021) LoRA is the state-of-the-art method for PEFT. It parameterizes incremental weight updates using trainable low-rank matrices. \u25cfDyLoRA (Valipour et al., 2022) This method trains dynamic search-free LoRA models for the best rank choice. \u25cfAdaLoRA (Zhang et al., 2023) This method proposes the SVD-based fine-tuning and prunes redundant singular values with the importance-aware rank allocation. 4.1. Natural Language Understanding Models and Datasets. We evaluate our method on the GLUE benchmark (General Language Understanding Evaluation (Wang et al., 2018)), which consists of a wide range of natural language understanding (NLU) tasks, including single-sentence classification tasks, similarity and paraphrase tasks and natural language inference tasks. We finetune the pre-trained RoBERTa Base and Large foundation models (Liu et al., 2019) for evaluation. Implementation Details. For both models, FourierFT is allowed to have 1000 out of 7682 (RoBERTa Base) and 10242 (RoBERTa Large) trainable spectral coefficients in each layer, i.e., n = 1000. We randomly sample the spectral entries with no frequency bias, which is shared1 across all 24 (Base) and 48 (Large) layers. For all 6 datasets in GLUE, we tune the hyperparameters of the learning rates and the scaling values. We follow the experimental setup applied in Hu et al. (2021), which involves fine-tuning only the query and value weights in each transformer block and 1We use the value 2024 as the seed for all layers. 5 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform Table 3. Results from GPT-2 Medium and Large models on the E2E benchmark. We present the result from the final epoch. For all metrics, higher values indicate better performance. * indicates that the results are taken from prior works. Best results are shown in bold. Model Method # Trainable Parameters BLEU NIST METEOR ROUGE-L CIDEr GPT-2 Medium FT* 354.92M 68.2 8.62 46.2 71.0 2.47 AdptL* 0.37M 66.3 8.41 45.0 69.8 2.40 AdptL* 11.09M 68.9 8.71 46.1 71.3 2.47 AdptH* 11.09M 67.3\u00b1.6 8.5\u00b1.07 46.0\u00b1.2 70.7\u00b1.2 2.44\u00b1.01 LoRA 0.35M 68.9\u00b1.3 8.76\u00b1.06 46.6\u00b1.1 71.5\u00b1.1 2.53\u00b1.03 FourierFT 0.048M 69.1\u00b1.1 8.82 \u00b1.05 47.0 \u00b1.3 71.8 \u00b1.1 2.51\u00b1.02 GPT-2 Large FT* 774.03M 68.5 8.78 46.0 69.9 2.45 AdptL* 0.88M 69.1\u00b1.1 8.68\u00b1.03 46.3\u00b1.0 71.4\u00b1.2 2.49\u00b1.0 AdptL* 23.00M 68.9\u00b1.3 8.70\u00b1.04 46.1\u00b1.1 71.3\u00b1.2 2.45\u00b1.02 LoRA 0.77M 70.1\u00b1.3 8.83\u00b1.02 46.8\u00b1.2 72.0\u00b1.3 2.47\u00b1.02 FourierFT 0.072M 70.2\u00b1.2 8.90\u00b1.02 47.0\u00b1.2 71.8\u00b1.1 2.50 \u00b1.02 Table 4. The average scores on MT-Bench and Vicuna assessed by GPT-4. \u2020 indicates updating the layers other than lm head. Higher score is better. Model Method # Trainable Parameters MT-Bench Vicuna LLaMA1-7B LoRA\u2020 159.9M 5.05\u00b1.3 6.85\u00b1.4 LoRA 33.5M 4.99\u00b1.3 6.81\u00b1.3 FourierFT 0.064M 5.09\u00b1.6 6.85\u00b1.8 LLaMA1-13B LoRA\u2020 250.3M 5.28\u00b1.6 7.02\u00b1.3 LoRA 52.4M 5.21\u00b1.4 6.97\u00b1.4 FourierFT 0.08M 5.23\u00b1.3 7.14\u00b1.5 LLaMA2-7B LoRA\u2020 159.9M 5.19\u00b1.1 7.38\u00b1.3 LoRA 33.5M 5.20\u00b1.3 7.35\u00b1.6 FourierFT 0.064M 5.18\u00b1.3 7.49\u00b1.4 LLaMA2-13B LoRA\u2020 250.3M 5.78\u00b1.2 7.89\u00b1.5 LoRA 52.4M 5.80\u00b1.2 7.89\u00b1.6 FourierFT 0.08M 5.82\u00b1.3 7.92\u00b1.5 fully fine-tuning the classification head. We provide the hyperparameters in Table 9 in Appendix. Results. Results are summarized in Table 2. Following Hu et al. (2021), Zhang et al. (2023) and Valipour et al. (2022), we specify the number of trainable parameters for the finetuned layers excluding the classification head. We report the median of 5 random seed results, where the best epoch is selected for each run. In general, FourierFT achieves better or on-par performance compared with baseline methods with significantly fewer trainable parameters. Notably, FourierFT outperforms all baselines including fully fine-tuning the RoBERTa Base on CoLA and the RoBERTa Large on RTE. As mentioned in Section 3.2, the parameter count of LoRA is dependent on both the width and depth of models, resulting in a larger count growth (LoRA: 0.8M/0.3M \u22482.7; ours: 0.048M/0.024M = 2) compared to FourierFT. Nevertheless, FourierFT still performs comparably to LoRA, demonstrating the potential scalability of our method when facing even larger models. 4.2. Natural Language Generation Models and Datasets. We evaluate the performance of FourierFT on the E2E natural language generation (NLG) task (Novikova et al., 2017). We fine-tune the GPT-2 (Radford et al., 2019) Medium (354M) and Large (774M) models, which are both decoder-only and have 24 and 36 transformer blocks, respectively. The E2E benchmark contains roughly 42,000 training, 4,600 validation and 4,600 test samples from the restaurant domain. Implementation Details. We report prior results for baselines other than LoRA. For both LoRA and our method, we fine-tune the GPT-2 Medium and Large models with a linear learning rate scheduler for 5 epochs, where we tune the batch size and learning rate. We report the average results over 3 runs, where the last epoch is selected for each run. We provide the hyperparameters in Table 10 in Appendix. Results. We show the results in Table 3. We note that FourierFT can achieve the best performance on most metrics. More importantly, FourierFT only requires 13.7% and 9.4% of the parameter counts of LoRA, for the GPT-2 Medium and Large models respectively. 4.3. Instruction Tuning Models and Datasets. Instruction tuning, as described in (Ouyang et al., 2022; Wei et al., 2021; Mishra et al., 2021), refers to the process of fine-tuning a language model on a collection of paired prompts and responses. We apply LoRA and FourierFT to fine-tune the LLaMA (Touvron et al., 2023a) and LLaMA2 (Touvron et al., 2023b) families. Specifically, we consider the LLaMA-7B, LLaMA-13B, LLaMA2-7B and LLaMA2-13B as base models, which are fine-tuned on the Alpaca dataset (Taori et al., 2023). Alpaca contains 51K instruction-following demonstrations generated from text-davinci-003 (GPT-3.5) (Wang et al., 2022). For evaluation, we use the fine-tuned models to generate responses for the pre-defined questions, which are from the MT-Bench (Zheng et al., 2023) and Vicuna Eval (Chiang et al., 2023). GPT-4 takes these answers as input and evaluates them with scores within 10. Implementation Details. For LoRA, we use r = 64 and apply two configurations: (1) updating all linear layers except the language modelling head (lm head); (2) updating only the WQ and WV matrices. For FourierFT, we only adopt the latter configuration with n = 1000. To ensure the 6 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform Table 5. Fine-tuning results with ViT Base and Large models on different image classification datasets. We report the accuracy (%) after 10 epochs. Avg. represents the average accuracy of each method on all datasets. The best performance is shown in bold. Model Method # Trainable Parameters OxfordPets StanfordCars CIFAR10 DTD EuroSAT FGVC RESISC45 CIFAR100 Avg. ViT-Base LP 90.28\u00b10.43 25.76\u00b10.28 96.41\u00b10.02 69.77\u00b10.67 88.72\u00b10.13 17.44\u00b10.43 74.22\u00b10.10 84.28\u00b10.11 68.36 FF 85.8M 93.14\u00b10.40 79.78\u00b11.15 98.92\u00b10.05 77.68\u00b11.21 99.05\u00b10.09 54.84\u00b11.23 96.13\u00b10.13 92.38\u00b10.13 86.49 LoRA 581K 93.19\u00b10.36 45.38\u00b10.41 98.78\u00b10.05 74.95\u00b10.40 98.44\u00b10.15 25.16\u00b10.16 92.70\u00b10.18 92.02\u00b10.12 77.58 FourierFT 72K 93.21\u00b10.26 46.11\u00b10.24 98.58\u00b10.07 75.09\u00b10.37 98.29\u00b10.04 27.51\u00b10.64 91.97\u00b10.31 91.20\u00b10.14 77.75 FourierFT 239K 93.05\u00b10.34 56.36\u00b10.66 98.69\u00b10.08 77.30\u00b10.61 98.78\u00b10.11 32.44\u00b10.99 94.26\u00b10.20 91.45\u00b10.18 80.29 ViT-Large LP 91.11\u00b10.30 37.91\u00b10.27 97.78\u00b10.04 73.33\u00b10.26 92.64\u00b10.08 24.62\u00b10.24 82.02\u00b10.11 84.28\u00b10.11 72.96 FF 303.3M 94.43\u00b10.56 88.90\u00b10.26 99.15\u00b10.05 81.79\u00b11.01 99.04\u00b10.08 68.25\u00b11.63 96.43\u00b10.07 93.58\u00b10.19 90.20 LoRA 1.57M 94.82\u00b10.09 73.25\u00b10.36 99.13\u00b10.03 81.79\u00b10.45 98.63\u00b10.07 42.32\u00b10.98 94.71\u00b10.25 94.87\u00b10.10 84.94 FourierFT 144K 94.46\u00b10.28 69.56\u00b10.30 99.10\u00b10.04 80.83\u00b10.43 98.65\u00b10.09 39.92\u00b10.68 93.86\u00b10.14 93.31\u00b10.09 83.71 FourierFT 480K 94.84\u00b10.05 79.14\u00b10.67 99.08\u00b10.01 81.88\u00b10.50 98.66\u00b10.03 51.28\u00b10.68 95.20\u00b10.07 93.37\u00b10.11 86.68 feasibility of training on a single GPU, we deploy the quantization method in Dettmers et al. (2023) for fine-tuning. We train with both methods for only one epoch, and report the average scores of all answers. We provide the hyperparameter setup in Table 11 in the Appendix. Results. The results are shown in Table 4. We find that the expressive power of the 13B model is much stronger than that of the 7B model, regardless of which fine-tuning method is used. Moreover, FourierFT closely matches or slightly exceeds LoRA\u2019s performance with less than 0.2% of its parameters. We provide practical examples containing questions, answers and reviews in the Appendix D. 4.4. Image Classification Models and Datasets. We evaluate our method on the image classification task. We adopt the Base and Large versions of the popular CV foundation model, Vision Transformer (ViT) (Dosovitskiy et al., 2020). The ViTs are pretrained on the ImageNet-21K dataset (Ridnik et al., 2021). The datasets for fine-tuning include OxfordPets (372), CIFAR10 (10), DTD (47), EuroSAT (10) and RESISC45 (45) with small label spaces, as well as StanfordCars (196), FGVC (100) and CIFAR100 (100) with large label spaces. Detailed information is provided in Table 8 in the Appendix. Implementation Details. We include three baselines for evaluation: Full Fine-tuning (FF), Linear Probing (LP, finetuning the classification head only), and LoRA. For both LoRA and our method, only the query and value matrices of ViT are updated. We use r = 16 for LoRA and n = {3000,10000} for FourierFT. We tune the learning rates and weight decay for all methods, and set the maximum training epoch to 10. We provide the hyperparameters in Table 12 in Appendix. 2Numbers in parentheses indicate class counts for each dataset. Results. Table 5 summarizes the results for 8 image classification datasets with the ViT Base and Large models. Both LoRA and FourierFT methods significantly outperform the Linear Probing, demonstrating their effectiveness in the CV domain. Our method obtains matched performance using 12.4% and 9.2% of LoRA\u2019s parameter count, with ViT Base and Large models, respectively. Notably, when we increase the parameter count of FourierFT to 41.1% (ViT Base) and 30.6% (ViT Large) of LoRA\u2019s, it can outperform LoRA by 3.5% and 2.0% respectively. Moreover, our method can even (slightly) outperform the Full Fine-tuning method on OxfordPets and DTD with the ViT Large model. 4.5. Study Effect of Frequency Bias. We examine how the performance is affected by the frequency bias, i.e., the central frequency fc in Eq. 5. We directly apply the optimal hyperparameters searched in Table 2 and fine-tune the RoBERTa Base on the MRPC, STS-B, CoLA and RTE datasets. From Figure 5, we note that the fine-tuning performance of FourierFT without any frequency bias can surpass most cases that are restricted by the central frequency bias. This indicates the universality of our method. Surprisingly, we find that it is always possible to obtain results better than \u201cNo bias\u201d by traversing the fc values. Since this traversal is not efficient, we do not conduct further exploration in this paper. However, we believe that making fc trainable will be a promising new direction for improving FourierFT. Parameter Scalability. We explore the relationship between the number of trainable parameters and the performance of LoRA and our method. We use the set of ranks r = {1,2,4,6,8,15} for LoRA and n = {50,100,200,1000,6144,12288} for FourierFT on 6 tasks of the GLUE benchmark. For both LoRA and ours, the learning rate, and scaling hyperparameters are tuned. For fairness, we ensure that the number of trials for hyperparam7 \fParameter-Efficient Fine-Tuning with Discrete Fourier Transform 4 6 8 10 ln # Trainable Parameters 88 89 90 Accuracy MRPC LoRA FourierFT 4 6 8 10 ln # Trainable Parameters 58 60 62 64 Matthew s Corr. CoLA 4 6 8 10 ln # Trainable Parameters 78 80 Accuracy RTE 4 6 8 10 ln # Trainable Parameters 90.0 90.5 91.0 91.5 Pearson Corr. STS-B 4 6 8 10 ln # Trainable Parameters 94.0 94.5 95.0 Accuracy SST-2 4 6 8 10 ln # Trainable Parameters 90 91 92 Accuracy QQP Figure 4. Performance on the GLUE benchmark with RoBERTa Base vs. number of trainable parameters (each layer) of LoRA and ours. For all 6 datasets, we apply the setting of r = {1, 2, 4, 6, 8, 15} for LoRA and n = {50, 100, 200, 1000, 6144, 12288}. 0 100 200 300 400 500 fc 76 77 78 79 Acc. RTE No bias 0 100 200 300 400 500 fc 89.2 89.4 89.6 89.8 90.0 Acc. MRPC No bias 0 100 200 300 400 500 fc 90.5 90.6 90.7 90.8 PCC. STS-B No bias 0 100 200 300 400 500 fc 62.0 62.5 63.0 63.5 MCC. CoLA No bias Figure 5. Results on 4 datasets in GLUE with different fc values. eter search is 30 for both methods. As shown in Figure 4, our method outperforms LoRA on all 6 datasets. In detail, our method is significantly better than LoRA with the same parameter count, i.e., {r = 4,n = 6144} & {r = 8,n = 12288}. Moreover, we observe that a larger number of parameters does not always bring performance gains for LoRA. On the contrary, the increase of n can consistently improve the accuracy of FourierFT. On most tasks, FourierFT with n = 50 can achieve comparable or even better (MRPC, CoLA, RTE) performance than LoRA with r = 1. In this case, the parameter count in LoRA is about 31 \u00d7 that of ours. Basis Expressiveness. The inverse discrete Fourier transform (IDFT) in Eq. 3 is equivalent to the matrix multiplication (Lu et al., 2021): S = BfFB\u22ba f, where B is the transformation matrix of IDFT that contains the Fourier basis. To evaluate its expressivity, we replace the Fourier basis with random and orthogonal basis, respectively. Specifically, for F \u2208Rd1\u00d7d2, we initialize random basis B1 r \u2208Rd1\u00d7d1 and B2 r \u2208Rd2\u00d7d2 with the normal Gaussian distribution. Then Eq. 3 becomes S = B1 rFB2 r. A similar way is used for the orthogonal basis. We compare FourierFT with the random basis (R-B) and orthogonal basis (O-B) on the GLUE benchmark. Table 6 shows the results. We note that the Fourier basis used in our method outperforms the random and orthogonal basis. In addition, the expressive power of the orthogonal basis is much stronger than that of the random basis. The stronger expressive power of the Fourier basis compared to the general orthogonal basis may be attributed to its effective capture of the spectral information of \u2206W. Table 6. Results with three types of basis. Model RTE CoLA Ours R-B O-B Ours R-B O-B Base 79.1 72.7(\u21938.1%) 75.6(\u21934.4%) 63.8 58.7(\u21938.0%) 60.0(\u21936.0%) Large 87.4 81.8(\u21936.4%) 83.6(\u21934.3%) 67.1 64.8(\u21933.4%) 66.1(\u21931.5%) 5." + }, + { + "url": "http://arxiv.org/abs/2405.02299v2", + "title": "Deep Reinforcement Learning for Modelling Protein Complexes", + "abstract": "AlphaFold can be used for both single-chain and multi-chain protein structure\nprediction, while the latter becomes extremely challenging as the number of\nchains increases. In this work, by taking each chain as a node and assembly\nactions as edges, we show that an acyclic undirected connected graph can be\nused to predict the structure of multi-chain protein complexes (a.k.a., protein\ncomplex modelling, PCM). However, there are still two challenges: 1) The huge\ncombinatorial optimization space of $N^{N-2}$ ($N$ is the number of chains) for\nthe PCM problem can easily lead to high computational cost. 2) The scales of\nprotein complexes exhibit distribution shift due to variance in chain numbers,\nwhich calls for the generalization in modelling complexes of various scales. To\naddress these challenges, we propose GAPN, a Generative Adversarial Policy\nNetwork powered by domain-specific rewards and adversarial loss through policy\ngradient for automatic PCM prediction. Specifically, GAPN learns to efficiently\nsearch through the immense assembly space and optimize the direct docking\nreward through policy gradient. Importantly, we design an adversarial reward\nfunction to enhance the receptive field of our model. In this way, GAPN will\nsimultaneously focus on a specific batch of complexes and the global assembly\nrules learned from complexes with varied chain numbers. Empirically, we have\nachieved both significant accuracy (measured by RMSD and TM-Score) and\nefficiency improvements compared to leading PCM softwares.", + "authors": "Ziqi Gao, Tao Feng, Jiaxuan You, Chenyi Zi, Yan Zhou, Chen Zhang, Jia Li", + "published": "2024-03-11", + "updated": "2024-05-07", + "primary_cat": "cs.CE", + "cats": [ + "cs.CE", + "cs.LG" + ], + "main_content": "INTRODUCTION \u2026 Dimer Structures C-A + A-D C-A-D + A-B C-A-D B Multiple Chains Step 1 Complex Structure Prediction Assembly Step 2 A B C D AUC Graph Figure 1: The assembly process applied for the PCM problem. Each incoming chain has the opportunity to dock onto any already docked chain. Predicting the 3D structures of large protein complexes (Jumper et al., 2021; Hickman & Levy, 1988; Benesch et al., 2003) is crucial for understanding their biological functions and mechanisms of action. This knowledge is essential for studying various cellular processes, such as signal transduction (Ditzel et al., 1998), gene regulation (Will & L\u00a8 uhrmann, 2011), and enzymatic reactions (Gao et al., 2006). The groundbreaking AlphaFold-Multimer (Evans et al., 2021) has presented great potential in directly predicting 3D complex structures from their amino acid sequences. However, it faces difficulties in maintaining high accuracy when dealing with complexes with a larger number (> 9) of chains (Bryant et al., 2022a; Burke et al., 2023; Bryant et al., 2022b). Recently, a novel setting for protein complex modelling (PCM) has emerged and achieved significant success. These methods (Bryant et al., 2022b; Aderinwale et al., 2022; Esquivel-Rodr\u00b4 \u0131guez \u2217Equal contribution. \u2020Correspondence to: Jia Li (jialee@ust.hk). 1 arXiv:2405.02299v2 [cs.CE] 7 May 2024 \fPublished as a conference paper at ICLR 2024 et al., 2012; Burke et al., 2023) suggest that since numerous advanced protein-protein docking techniques (Ganea et al., 2021; Wang et al., 2023) are available, why not utilize them to sequentially assemble protein chains into complexes? They have demonstrated the ability to perform PCM on very large complexes (with up to 30 chains). However, the combinatorial optimization space (COS) of the PCM problem greatly limits the inference efficiency and effectiveness of these methods. As shown in Fig. 1, real-world data indicates that in a N\u2212chain complex, the interaction of each chain may involve more than two chains. Therefore, the assembly can be determined by an acyclic, undirected, and connected (AUC) graph, which leads to the COS of N N\u22122 (Shor, 1995). Designing a proper deep learning (DL) framework holds great promise in handling the vast COS. However, directly learning from available complexes can be difficult since the data scarcity will increase as the chain number grows. For example, when the chain number exceeds 10, the average number of available complexes from the PDB database (Berman et al., 2000) is less than 100. Due to the inherent variability in the chain numbers of complexes, DL models are likely to face challenges in learning adequate knowledge for assembling large complexes (Aderinwale et al., 2022). Based on the above statements, we summarize two main challenges of the PCM problem as follows: 1) How to efficiently explore the vast combinatorial optimization space to find the optimal assembling action? 2) How to ensure that the DL model can effectively generalize to complex data with limited availability? In this paper, we propose GAPN, a generative adversarial policy network powered by domainspecific rewards and adversarial loss through policy gradient for automatic PCM prediction. Specifically, to address the first challenge, we design GAPN as a deep reinforcement learning (DRL) agent that operates within a complex assembling environment. The DRL agent can actively explore the vast combinatorial optimization space (COS) for assembling large complexes beyond samples through trial-and-error interaction with the environment (Zhang et al., 2019; Samsuden et al., 2019). Moreover, it incorporates a balance between exploration (trying new actions) and exploitation (sticking with known good actions) to ensure that the agent will not get stuck in local optima and continue to explore other potentially better solutions (Ladosz et al., 2022; Gupta et al., 2018a). The above two aspects make the GAPN agent able to efficiently explore the vast combinatorial optimization space to find the optimal assembling action. In response to the second challenge, we introduce an adversarial reward function to guide the learning process and enhance the receptive field of our model. The adversarial reward function incorporates the global assembly rules learned from complexes with varied chain numbers to enhance the generalization of GAPN. We empirically validate that the proposed GAPN model has high efficiency in exploring the vast COS in PCM problem, and can effectively generalize to complex data with limited availability. In summary, we make the following contributions: \u2022 We propose GAPN, a fast, policy-based method for modeling large protein complexes, where GAPN functions as a DRL agent to efficiently explore correct assembly actions. \u2022 We design an adversarial reward function that offers a global view of assembly knowledge, ensuring that GAPN can generalize over limited complex data. \u2022 Quantitative results show that GAPN achieves superior structure prediction accuracy compared to advanced baseline methods, with a speed-up of 600\u00d7. Moreover, we contribute a dataset containing non-redundant complexes. 2 RELATED WORK Protein Complex Modelling. The task of protein complex modelling (PCM) aims to predict the complex 3D structure given the information of all its chains. As shown in Table 1, existing PCM methods can be divided into two categories, namely one-time forming (OTF) and one-by-one assembling (OBOA). OTF-based methods can typically produce PCM results directly from the sequence or chain-level 3D structures. Specifically, the modified AlphaFold system, referred to as AlphaFold-Multimer (Evans et al., 2021), can handle up to 9-chain complexes, but it is very timeconsuming. Moreover, Ji et al. (2023) proposed SyNDock, the learnable group synchronization approach for forming complexes in a globally consistent manner. SyNDock mainly claims significant speed-up, but the performance and the maximum chain number it can handle are both limited. Another PCM setting mainly involves two optimization aspects: the dimeric structures and the docking 2 \fPublished as a conference paper at ICLR 2024 path. Optimization approaches such as reinforcement learning (Aderinwale et al., 2022) and genetic algorithm (Esquivel-Rodr\u00b4 \u0131guez et al., 2012) are proposed for refining the dimeric structures. These methods are typically with low efficiency, and their max chain No. is also not satisfactory. MoLPC (Bryant et al., 2022b) assumes that the dimeric structures are given, thus only predicting the correct docking path. In this way, it is the first to demonstrate that the structures of complexes with up to 30 chains can be accurately predicted. However, its application of a tree search-based non-deep learning technique often leads to complete failure due to the lack of generalization. Methods Assembly Opt. Dimer Opt. Path Max Chain No. Speed-Up CombDock Inbar et al. (2005) \u2714 \u2714 \u2714 6 1.07 Multi-LZerD Esquivel-Rodr\u00b4 \u0131guez et al. (2012) \u2714 \u2714 \u2714 6 1.33 RL-MLZerD Aderinwale et al. (2022) \u2714 \u2714 \u2717 5 1 ESMFold Lin et al. (2023) \u2717 \u2717 \u2717 4 213.65 AlphaFold-Multimer Evans et al. (2021) \u2717 \u2717 \u2717 9 4.53 MoLPC Bryant et al. (2022b) \u2714 \u2717 \u2714 30 3.02 GAPN \u2714 \u2717 \u2714 60 1934.27 Table 1: Technical comparison between PCM methods. Assembly: PCM in the assembly fashion; Opt. dimer: Dimer structures will be optimized; Opt. Path: Docking path will be optimized; Max Chain No.: The maximum chain number that the method can handle. Speed-up: Efficiency speed-up compared to the RL-MLZerD baseline. Reinforcement Learning. Over the past few years, RL has emerged as a compelling approach for various optimization tasks. The unique ability of RL agents to learn optimal policies from interaction with an environment enables them to collect and utilize more data, which enhances their ability to find excellent solutions to optimization problems with large search space. Several studies (Vinyals et al., 2015; Bello et al., 2016; Nazari et al., 2018) utilize RL and attention architecture to solve classic NP-hard problems with large and complex search space, such as TSP (Vinyals et al., 2015) and VRP (Bello et al., 2016; Nazari et al., 2018) problems. Khalil et al. (2017) and Fan et al. (2020) propose to introduce the graph architecture into the RL framework, so that RL can be used to solve large-scale graph optimization problems, such as finding the most influential nodes on the graph and optimizing the properties of the graph network. However, when applying RL to our problem, it still faces the generalization problem in scenarios with varied chain numbers. Therefore, in our paper, we design an adversarial reward function to guide the learning of the RL agent, which incorporates prior knowledge of multiple optimization scenarios. Adversarial Training Adversarial training has been widely used to learn the underlying data distribution and derive a generator and a discriminator. The generator can generate synthetic data that is similar to the real data distribution, while the discriminator outputs the similarity between the input and real data. Adversarial training is widely used in many aspects, such as text generation (Zhang et al., 2017), imitation of human behavior (Gupta et al., 2018b), protein generation (Gupta & Zou, 2019). Adversarial training also enhances RL\u2019s ability to solve complex optimization problems by incorporating prior knowledge specified by a good oracle (Ho et al., 2016; Liu et al., 2018). Inspired by existing research, in this paper, we design an adversarial reward function to enhance the generalization ability of the RL agent based on the framework of adversarial training, which incorporates the global assembly rules learned from complexes with varied chain numbers. 3 PROPOSED APPROACH 3.1 PROBLEM DEFINITION We are given a set of N chains to form a protein complex. The i \u2212th chain consists of ni residues, which is characterized by its amino acid sequence si and 3D structure in its undocked state Xi \u2208 R3\u00d7ni. We focus on the one-by-one assembly setting, where the dimeric 3D structures of all possible pairs of chains are provided. We define the assembly process as follows. Formally, we have a set of assembly actions A = {(A1 k, A2 k)}1\u2264k\u2264N\u22121, with each element representing a pair of chain indexes. Then, a transformation function set T = {(Rk, tk)}1\u2264k\u2264N\u22121 is obtained by Rk \u02dc XA1 k + tk = X\u2032 A1 k, where Rk, tk 3 \fPublished as a conference paper at ICLR 2024 ... Global\u00a0Embedding Docked\u00a0Embedding Undocked\u00a0Embedding Query Key Mean Pooling &Sigmoid Generative Adversarial Policy Network Value Network Adversarial Reward Function \u00a0Multi-chain Assembly Process Assembly Action State\u00a0 Domain-specific reward Adversarial reward Assembled Graph State\u00a0 Undocked Chains Docked Chains MLP Softmax Avg. Action GCN Assembled Graph a b c d Figure 2: Overview of the proposed framework. It contains a Generative Adversarial Policy Network (GAPN) (b), which converts the input state st into assembly action at for the multi-chain assembly process (d). The GAPN is trained with the help of value network (a), which estimates the values come from two aspects: domain-specific rewards obtained through multi-chain assembly process (d) and adversarial rewards from adversarial reward function (c). represent the rotation and translation transformation for the k \u2212th action, respectively. \u02dc XA1 k denotes structure of chain A1 k extracted from the dimeric structure of the pair of (A1 k, A2 k) and X\u2032 A1 k denotes the structure of the docked chain A1 k. For the k \u2212th action, we dock the chain A2 k onto the docked chain A1 k, such that X\u2032 A2 k = RkXA2 k + tk. The task is to predict the assembly action set such that {RX\u2032 i + t}1\u2264i\u2264N = {X\u2217 i }1\u2264i\u2264N, \u2203R \u2208 SO(3), t \u2208R3, by taking as inputs the amino acid sequences of all chains{si}1\u2264i\u2264N of an input complex, where X\u2217 i denotes the ground truth of the i \u2212th chain. In short, our goal is to predict the correct assembly action A such that the assembled complex structure matches the ground truth complex structure. 3.2 SYSTEM OVERVIEW To model the large protein complexes, we propose GAPN powered by domain-specific rewards and adversarial rewards through policy gradient. The structure overview is shown in Figure 2. The system mainly consists of four modules: \u2022 Generative Adversarial Policy Network. It converts the input state to corresponding assembly action and interacts with multi-chain assembly process. \u2022 Adversarial Reward Function. It incorporates the global assembly rules learned from complexes with varied chain numbers to enhance the generalization of GAPN, which converts the assembled graph into adversarial reward through Graph Convolutional Network (GCN). \u2022 Value Network. It aims to estimate the value of the state and helps train the GAPN. \u2022 Multi-chain Assembly Process. It describes the process of multi-chain assembly, state transfer, and assembly action effects, which has been discussed in Sec 3.1. In the following sections, we will introduce these modules in detail. 3.3 ASSEMBLY OF PROTEIN COMPLEXES AS MARKOV DECISION PROCESS We transform the assembly of protein complexes problem into a sequential decision-making problem, with the goal of predicting the correct assembly action that will bring the assembled complex structure to match the ground truth. Thus, we propose to formulate the problem using Markov Decision Process (MDP) (Puterman, 1990) in an RL setting, which has five parts: 4 \fPublished as a conference paper at ICLR 2024 \u2022 Agent: We consider the complex M = {Mi}1\u2264i\u2264N as the RL agent, who observes a set of N chains and ni residues of each chain Mi. \u2022 State: Since the agent is the complex M, we define state at time interval t as st = (ct, ut, Gr), where ct denotes docked chain feature embeddings, ut denotes the undocked chain embeddings and Gr denotes all chain embeddings in the complex. The chain embedding ei of Mi is calculated through a protein pre-trained model, which will be introduced in Sec 3.4. \u2022 Action: The action at at time interval t is to assemble two chains, which can be denoted by (A1 k, A2 k)1\u2264k\u2264N\u22121 with two elements representing a pair of chains. \u2022 Transition: This component describes the process that the current state st will transit to the next state st+1 after an action at is taken. Specifically, in our state setting, the stack of all protein embeddings Gr will remain unchanged. The stack of assembled protein feature embeddings ct+1 = ct\u222aej and the stack of unassembled protein embeddings ut+1 = ut\\ej will change due to newly docked chains, where ej denotes the embedding of the newly docked chain. With the implementation of assembly action at, the dimeric structure of chains will be updated, which is achieved with the transformation set T defined in Sec 3.1. \u2022 Reward: This reward function r is to measure how similar the assembled complex structure is compared with the real ones. Here, we define the rewards as a sum over domainspecific rewards rt and adversarial rewards rad. The domain-specific rewards are introduced to measure the similarity between the assembled complex structure and the corresponding ground truth. Specifically, we utilize RMSD to measure this similarity, which is inverted when used as a reward. Since the smaller the RMSD, the higher the similarity, we take negative RMSD values as domain-specific rewards. In order to enhance the generalization of the agent to limited data, we design an adversarial reward function incorporating the global assembly rules learned from complexes with varied chain numbers (see more discussion in Sec 3.5). 3.4 GENERATIVE ADVERSARIAL POLICY NETWORK Having modeled the assembly of protein complexes as Markov Decision Process, we outline the architecture of GAPN, a policy network learned by the RL agent to act in the multi-chain assembly process. GAPN takes the state st input and outputs the action at, which predicts an assembly action, as described in Section 3.3. Chain Embedding Calculation. Through ESM (Lin et al., 2023) pre-training models, we obtain residue-level embeddings by inputting the entire sequence of each chain. ESM\u2019s pre-training captures the reflection of protein 3D structure within sequence patterns. To obtain the chain embedding e, we take the average of residue embeddings. It\u2019s worth noting that we refrain from fine-tuning the residue embeddings. This approach allows us to leverage the power of ESM\u2019s pre-training while maintaining the stability of the residue-level representations. Assembly Action Prediction. The assembly action at at time step t is to decide which pair of proteins assembles together. The traditional RL approach is to perform one-hot encoding on all possible actions. However, these methods are difficult to apply to our problem: (1) In the protein assembly process, the number of possible protein pairs is constantly changing, which makes these methods hard to handle; (2) Since different protein complexes may have varied numbers of proteins, models trained based on these methods are difficult to generalize to different protein complexes. Inspired by the design of attention mechanism for supporting model\u2019s inputs with variable lengths (Vaswani et al., 2017), we first introduce a function fc to convert ct, Gr into dense vector gt, and then regard the gt and ut as key and query to apply inner product for them and obtain the probability of deciding which pair of proteins assemble together, gt = fc(ct, Gr), (1) \u03c0(st) = SOFTMAX(fa(gT t ut)), at \u223c\u03c0(st), (2) where fc and fa denote two MultiLayer Perceptrons (MLP) and \u03c0 denotes the GAPN. 5 \fPublished as a conference paper at ICLR 2024 3.5 ADVERSARIAL REWARD FUNCTION The vast combinatorial optimization space of large protein complexes makes it hard for RL to search for optimal assembly action sets to bring the assembled complex structure to match the ground truth. Moreover, the limited availability of these complex data further aggravates the difficulty of searching. In order to deal with this dilemma, the traditional approach is to mix complex data of different chains and utilize a unified RL policy network to learn (Beck et al., 2023). However, the huge differences in the features of complex data of different chains lead to poor training stability and performance (Nagabandi et al., 2018). Adversarial training can improve RL\u2019s ability to deal with complex problems by learning expert solutions as prior knowledge (Ho et al., 2016; Liu et al., 2018). Inspired by this, we utilize the correct assembly action sets of complex data in different chains as expert solutions, and employ the Generative Adversarial Network (GAN) framework (Goodfellow et al., 2020) to design the adversarial rewards R(\u03c0\u03b8, D\u03d5) for RL learning: min \u03b8 max \u03d5 R(\u03c0\u03b8, D\u03d5) = Ex\u223cpdata(x)[log D\u03d5(x)] + Ex\u223c\u03c0\u03b8[log(1 \u2212D\u03d5(x)))], (3) where \u03c0\u03b8 is the policy network parameterized by \u03b8, D\u03d5 is the discriminator network parameterized by \u03d5, x represents an assembled graph whose nodes represent chains and edges depict the connection relationship among the chains determined by the assembly action set. pdata is the underlying data distribution of the ground truth assembly action sets of complex data with different chains. However, from equation 3, we can observe that only D\u03d5 can be trained through stochastic gradient descent and x as a graph is not differentiable in terms of parameters \u03d5. Therefore, we utilize \u2212R(\u03c0\u03b8, D\u03d5) as an auxiliary term with domain-specific rewards, which measures the similarity between the complex structure assembled from the generated assembly action set and the real ones. The ability of Graph Neural Networks (Xu et al., 2018; Tang et al., 2022) to model the structured data enables it to perform well in many tasks (Gao et al., 2023a; Tang et al., 2023; Li et al., 2019b; Gao et al., 2023b). We employ the Graph Convolutional Networks (GCN) (Kipf & Welling, 2016; Li et al., 2019a; Cheng et al., 2023) to construct the discriminator network. Specifically, the nodes of the input complex graph are chain embeddings E = ei, and the adjacency matrix U of the input graph depicts the docked relationship among the chains determined by assembly action set. If the assembly action set contains at = (A1 K, A2 k), then U[A1 K, A2 k] = U[A2 K, A1 k] = 1. We apply message passing with initial node embeddings E = ei and adjacency matrix U to compute node embeddings for a total of L layers: Hl+1 = AGG(ReLU(D\u22121 2 \u02dc UD\u22121 2 HlW l)), (4) where Hl is the node embedding of the l \u2212th layer, D is degree matrix of U, \u02dc U = U + I and W l is a trainable weight matrix of the l \u2212th layer. AGG(\u00b7) here is employed to denote an aggregation function that could be one of {MEAN, MAX, SUM, CONCAT} (Sun et al., 2023). Based on the output HL of the last layer of GCN, the discriminator network applies an MLP layer, a SIGMOID function, and a MEAN Pooling function to get the final output D\u03d5(x): D\u03d5(x) = SIGMOID(MEAN(fd(HL))), (5) where fd denotes the MLP layer and the MEAN Pooling function is to average embedding of the chain to obtain the representation of the entire graph. 3.6 MODEL TRAINING For the optimization of GAPN, we adopt Proximal Policy Optimization (PPO) (Schulman et al., 2017), which is one of the state-of-the-art policy gradient methods and has been widely used for optimizing policy networks. We show the objective function of PPO as follows: max (Jclip(\u03b8)) = E\u03c0\u03b8old [min (rt(\u03b8)A\u03c0\u03b8old(s, a), clip(rt(\u03b8), 1 \u2212\u03f5, 1 + \u03f5)A\u03c0\u03b8old(s, a))] , (6) rt(\u03b8) = \u03c0\u03b8(a|s) \u03c0\u03b8old(a|s), (7) where rt(\u03b8) represents the ratio of the probability \u03c0\u03b8(a|s) of an action under the current policy to the probability \u03c0\u03b8old(a|s) of the same action under the old policy and is clipped to the range of 6 \fPublished as a conference paper at ICLR 2024 Algorithm 1 GAPN Input: ground truth assembly graphs Gr. 1: Initialize \u03c0\u03b8, D\u03d5 with random weights for policy network and discriminator; 2: for i=0,1,2... do 3: Generate a batch of assembly graphs Gf i \u223c\u03c0\u03b8; 4: for k = 0, 1, 2... do 5: Calculate a batch of rewards based on domain-specific reward function rt and adversarial function rad for each state-action pair in sequences Gf i ; 6: Sample generated assembly graphs Gf ki from Gf i with batch size B; 7: Sample ground truth Gr k from Gr with batch size B; 8: Update D\u03d5 based on equation (3) through stochastic gradient descent with the positive samples Gr k and negative samples Gf ki. 9: end for 10: Update \u03c0\u03b8 by maximizing equation (6) via the PPO method; 11: end for [1 \u2212\u03f5, 1 + \u03f5] that makes the training of policy network more stable (Schulman et al., 2017), A\u03c0\u03b8old denotes the estimated advantage function which involves a learned value function V (\u00b7) to reduce the variance of estimation. Specially, V (\u00b7) is designed as an MLP that maps the state st into a scalar. We summarize details of the training process of GAPN in Algorithm 1. From the algorithm, we can first observe that a batch of generated assembly graphs and ground truth are sampled to train the discriminator (lines 6-8). The generated assembly graphs are regarded as negative samples and ground truths are regarded as positive samples to train discriminator via an Adam Optimizer (Reddi et al., 2019) (line 8). Then, we calculate a batch of rewards for the generated assembly graphs (line 5). Finally, we train the policy network by maximizing the expectation of reward via PPO algorithm (line 10). 4 EXPERIMENTS 4.1 EXPERIMENTAL SETUP Dataset. Following MoLPC, we conduct experiments on protein complexes with the chain number 3 \u2264N \u226430. We download all available complexes of their \u2018first biological assembly\u2019 version from the PDB database (Berman et al., 2000). Subsequently, we perform data filtering and sequence clustering using CD-HIT (Huang et al., 2010). We split the data based on the clusters to ensure that the sequence similarity between samples in the training and test sets will not exceed 50%. Finally, we obtained 7,063 PDBs for the training set and validation set, and 180 for the test set. A more detailed description of the data processing and filtering process can be found in Appendix B. We apply two types of dimer structures, the ground-truth dimers (GT Dimer) and dimers predicted by AlphaFold-Multimer (AFM Dimer). For GT Dimer, we directly extract the dimer structures of all pairs of chains that have actual physical contacts. For those without physical contacts, we apply their dimers predicted with ESMFold (Lin et al., 2023) (due to its inference efficiency). Baselines. We compare GAPN with recent advanced PCM methods. For non-assembly methods, we include (1) AlphaFold-Multimer (Evans et al., 2021) (AF-Multimer, an end-to-end deep learning model that takes only protein sequence as input for PCM); (2) ESMFold (Lin et al., 2023)(an endto-end deep learning-based protein structure predictor without multiple sequence alignment). For assembly-based methods, we include (3) Multi-LZerD (Esquivel-Rodr\u00b4 \u0131guez et al., 2012) (a PCM predictor with genetic algorithm and a structure refinement procedure); (4) RL-MLZerD (Aderinwale et al., 2022) (a reinforcement learning model for exploring potential dimer structures and docking path); (5) MoLPC (Bryant et al., 2022b) (a non-deep learning method with Monte Carlo tree search and plDDT information for guidance). According to the maximum chain numbers that the baselines can handle, we set their available ranges of chain number Table 2 for testing (e.g., Multi-LZerD: 3 \u2264N \u226410). We test all baselines 7 \fPublished as a conference paper at ICLR 2024 Table 2: PCM prediction results. The best performance for each metric is bold and the second best is underlined. \u2018-\u2019 suggests that the method is not applicable to this range of chain number. Methods Chain numbers N 3 4 5 6-10 11-15 16-20 21-25 26-30 TM-Score (mean) / RMSD (mean) Multi-LZerD 0.54 / 19.17 0.49 / 21.58 0.40 / 33.05 0.24 / 56.73 RL-MLZerD 0.62 / 16.56 0.47 / 19.09 0.49 / 28.73 0.31 / 49.60 AF-Multimer 0.79 / 7.87 0.70 / 14.19 0.67 / 22.25 0.64 / 35.05 0.39 / 49.23 ESMFold 0.73 / 9.75 0.52 / 18.06 0.44 / 31.96 0.36 / 46.12 MoLPC 0.89 / 5.33 0.71 / 13.49 0.66 / 21.67 0.60 / 36.46 0.45 / 43.00 0.36 / 54.75 0.34 / 60.58 0.29 / 66.60 GAPN 0.95 / 1.16 0.81 / 8.52 0.79 / 16.96 0.65 / 32.37 0.62 / 37.58 0.48 / 50.05 0.38 / 55.76 0.36 / 59.13 (a) (b) (c) Figure 3: PCM performance analysis. (a). TM-Score and (b). RMSD distributions of all baselines on multimers of 3 \u2264N \u226410. (c). TM-Score distribution of MoLPC and GAPN on large-scale multimers of 11 \u2264N \u226430, with the median TM-Score marked by \u2715. using 2 GeForce RTX 4090 GPUs. For each sample within the available range, if the testing time exceeds 2 hours or the memory limit is exceeded, its result will be replaced by the optimal value of all baselines for that sample. Metrics. We evaluate the PCM prediction methods by the following metrics: (1) RMSD: the rootmean-square deviation of the Cartesian coordinates, measures the distance of the ground-truth and predicted multimer structure at the residue level; (2) TM-Score: the proportion of residues that are similar between the ground-truth and predicted multimer structures with values ranging from 0 to 1. 4.2 PROTEIN COMPLEX MODELLING Performance. Model performance are summarized in Table 2 and Fig. 3. Our GAPN method achieves state-of-the-art in all ranges of chain numbers. Compared to the second-best baseline with small-scale multimers (3 \u2264N \u226410), we achieve improvements of 8.7%, 9.6%, 11.0%, and 12.7% on metrics of mean TM-Score, median TM-Score, mean RMSD and median RMSD, respectively. Moreover, our methods consistently outperform the most advanced assembly-based MoLPC method, without resource-intensive exhaustive search or expensive plDDT information. Fig. 3c shows the comparison of MoLPC and our method for handling large-scale multimers. We can find that although relatively imprecise, AFM dimers can still achieve accurate assembly in practice. This further reinforces the practical significance of the assembly-based setting that we follow. Importantly, our method outperforms MoLPC on large-scale multimers in both settings of AFM and GT dimers. For instance, under the setting of GT dimer, we achieve an improvement of about 31% and 53% in terms of the mean and median TM-Score metrics for multimers of 11 \u2264N \u226430. 8 \fPublished as a conference paper at ICLR 2024 Visualization. In Fig. 6, we show two examples with a small (N = 5) and a large (N = 17) chain number, respectively. These two complexes are both unknown samples, meaning that none of their chains have more than 10% similarity with any chain present in the training set. Table 3: Inference time. Methods T/N(sec) Multi-LZerD 1235.20 RL-MLZerD 1644.78 AFM 357.30 ESMFold 7.73 MoLPC 540 GAPN 0.85 Efficiency. We evaluate the two types of efficiency of our GAPN method, computational and exploration efficiency, from both the training and inference perspectives. For inference, since the running time of all methods increases with the number of chains, we compare the ratio of running time to chain number (T/N) among different methods. As shown in Table 3, the inference efficiency of our GAPN is about 600 times that of MoLPC. More importantly, our method is not limited by chain numbers, and can typically predict up to 60-chain complexes in less than 2 minutes. We illustrate the training efficiency (exploration efficiency) with the training curves shown in Fig. 4b. We observe that our GAPN model can converge rapidly and effectively after only \u223c400 episodes. This indicates that the model can efficiently explore a vast combination optimization space (N N\u22122, 11 \u2264N \u226430), which also demonstrates the high training efficiency of GAPN (requiring \u223c1 hour for a complete training on the whole 6,054 samples). (a) (b) Figure 4: (a). The RMSD performance of GAPN and the one without Adversarial reward (AR). The bar chart represents the relative difference between the two for multimers of each specific scale. (b). Training curve comparison between our GAPN model and the one without AR. Both models are trained on multimers of 3 \u2264N \u226430 with GT dimer structures. 4.3 ABLATION STUDY We conduct an ablation study on the whole validation set to explore the importance of our core adversarial reward (AR). Specifically, we call the process of GAPN assembling a multimer an episode and testing the policy network on the validation set after training the policy in each episode. In Fig. 4a, we find that GAPN\u2019s performance significantly decreases after removing AR. Importantly, the gain brought by AR will become more significant with the increase of chain number, which indicates that AR can effectively address the problem of knowledge generalization difficulty caused by data scarcity in large-scale multimers. Moreover, we also observe in Fig. 4b that AR is crucial for model training, as it enables rapid convergence of our model. 5" + }, + { + "url": "http://arxiv.org/abs/2402.18813v1", + "title": "Protein Multimer Structure Prediction via Prompt Learning", + "abstract": "Understanding the 3D structures of protein multimers is crucial, as they play\na vital role in regulating various cellular processes. It has been empirically\nconfirmed that the multimer structure prediction~(MSP) can be well handled in a\nstep-wise assembly fashion using provided dimer structures and predicted\nprotein-protein interactions~(PPIs). However, due to the biological gap in the\nformation of dimers and larger multimers, directly applying PPI prediction\ntechniques can often cause a \\textit{poor generalization} to the MSP task. To\naddress this challenge, we aim to extend the PPI knowledge to multimers of\ndifferent scales~(i.e., chain numbers). Specifically, we propose\n\\textbf{\\textsc{PromptMSP}}, a pre-training and \\textbf{Prompt} tuning\nframework for \\textbf{M}ultimer \\textbf{S}tructure \\textbf{P}rediction. First,\nwe tailor the source and target tasks for effective PPI knowledge learning and\nefficient inference, respectively. We design PPI-inspired prompt learning to\nnarrow the gaps of two task formats and generalize the PPI knowledge to\nmultimers of different scales. We provide a meta-learning strategy to learn a\nreliable initialization of the prompt model, enabling our prompting framework\nto effectively adapt to limited data for large-scale multimers. Empirically, we\nachieve both significant accuracy (RMSD and TM-Score) and efficiency\nimprovements compared to advanced MSP models. The code, data and checkpoints\nare released at \\url{https://github.com/zqgao22/PromptMSP}.", + "authors": "Ziqi Gao, Xiangguo Sun, Zijing Liu, Yu Li, Hong Cheng, Jia Li", + "published": "2024-02-29", + "updated": "2024-02-29", + "primary_cat": "cs.CE", + "cats": [ + "cs.CE" + ], + "main_content": "INTRODUCTION Recent advances in deep learning have driven the development of AlphaFold 2 (AF2) (Jumper et al., 2021), a groundbreaking method for predicting protein 3D structures. With minor modifications, AF2 can be extended to AlphaFold-Multimer (AFM) (Evans et al., 2021) to predict the 3D structure of multimers (i.e., proteins that consist of multiple chains), which is fundamental in understanding molecular functions and cellular signaling of many biological processes. AFM has been verified to accurately predict the structures of multimers with small scales (i.e., chain numbers). However, its performance rapidly declines as the scale increases. > Docking Probability > Determined Assembly Assembly to be determined Overlapping interface I-PPI =0.9 I-PPI =0.8 I-PPI =0.7 Condition C-PPI =0.1 C-PPI =0.7 A B \u221a \ud835\udc99 \ud835\udc9a \ud835\udc9b Docking Probability Figure 1: (A). Step-wise assembly for MSP. (B). Motivation for extending I-PPI to C-PPI. For multimer structure prediction (MSP), another research line (Esquivel-Rodr\u00b4 \u0131guez et al., 2012; Aderinwale et al., 2022; Inbar et al., 2005; Bryant et al., 2022) follows the idea of step-wise assembly (Figure 1A), where the assembly action indicates the protein-protein interaction (PPI). It sequentially expands the assembly size by adding a chain with the highest docking probability. The advantage of this step-wise assembly is that it can effectively handle multimers with large scales by enjoying the breakthrough in dimer structure prediction methods (Ganea et al., 2021; Wang et al., 2023; Ketata et al., 2023; Ghani et al., 2021; Luo et al., 2023; Chu et al., 2023; Evans et al., 2021). \u2217Correspondence to: Jia Li (jialee@ust.hk). 1 arXiv:2402.18813v1 [cs.CE] 29 Feb 2024 \fPublished as a conference paper at ICLR 2024 As the most advanced assembly-based method, MoLPC (Bryant et al., 2022) applies independent PPI (I-PPI, i.e., both proteins are independent without the consideration of other proteins) to score the quality of a given assembly. Despite great potential, it does not consider important conditions in the assembly such as the influence of third-party proteins to PPI pairs. For example, in Figure 1B, if chain x has already docked to chain y, the interface on x that will contact with z is partially occupied. Under this condition, the docking probability of (x, z) may decrease to lower than that of (y, z). We name this observation as condition PPI, or C-PPI. In short, neglecting the influence of C-PPI may easily lead to poor generalization. In this work, we focus on assembly-based MSP by learning C-PPI knowledge than I-PPI. 2 3 4 5 6 7 10 15 20 25 30 Chain Number 0 2000 4000 6000 8000 Count Figure 2: Distribution in chain numbers of multimers from the PDB database. Learning effective C-PPI knowledge for MSP presents two main challenges. Firstly, we observe significant gaps in the C-PPI knowledge contained in multimers with varied scales (chain numbers), which suggests that the biological formation process of multimers may vary depending on their scales. Secondly, as shown in Figure 2, experimental structure data for large-scale multimers is extremely limited, making it even more difficult for the model to generalize them. Recently, the rapidly evolving prompt learning (Liu et al., 2023; Sun et al., 2023a) techniques have shown promise to enhance the generalization of models to novel tasks and datasets. Inspired by this, a natural question arises: can we prompt the model to predict C-PPIs for multimers with arbitrary scales? To address this, our core idea is to design learnable prompts to transform arbitrary-scale multimers into fixed-scale ones. Concretely, we first define the target task for training (tuning) the prompt model, which is conditional link prediction. Then, we additionally design the pre-training (source) task that learns to identify arbitrary assembled multimer\u2019s correctness. In the target task, we transform the two query chains to a virtual assembled multimer, which is input into the pre-trained model for the correctness score. We treat such a score as the linking probability of the query chains. Therefore, arbitrary-scale prediction in the target task is reformulated as the fixed-scale one in the source task. Empirically, we investigate three settings: (1) assembly with ground-truth dimer structures to evaluate the accuracy of predicted docking path; (2) assembly with pre-computed dimers from AFM (Evans et al., 2021); and (3) assembly with pre-computed dimers from ESMFold (Lin et al., 2023). We show improved accuracy (in RMSD and TM-Score) and leading computational efficiency over recent state-of-the-art MSP baselines methods under these 3 settings. Overall, experiments demonstrate that our method has exceptional capacity and broad applicability. 2 RELATED WORK Multimer Structure Prediction. Proteins typically work in cells in the form of multimers. However, determining the structures of multimers with biophysical experiments such as X-ray crystallography (Maveyraud & Mourey, 2020; Ilari & Savino, 2008) and cryogenic electron microscopy (Costa et al., 2017; Ho et al., 2020) can be extremely difficult and expensive. Recently, the deep learning (DL)-based AlphaFold-2 (Jumper et al., 2021) model can milestone-accurately predict protein structures from residue sequences. Moreover, recent studies have explored its potential for predicting multimer structures. However, they mostly require time-consuming multiple sequence alignment (MSA) operations and the performance significantly decreases for multimers with great chain numbers. Another research line assumes that the multimer structures can be predicted by adding its chains one by one. Multi-LZerD (Esquivel-Rodr\u00b4 \u0131guez et al., 2012) and RL-MLZerD (Aderinwale et al., 2022) respectively apply the genetic optimization and reinforcement learning strategies to select proper dimer structures for assembly. However, even when targeting only small-scale (3-, 4and 5-chain) multimers, they still have low efficiency and are difficult to scale up for large multimers. By assuming that the dimer structures are already provided, MoLPC (Bryant et al., 2022) further simplifies this research line with the goal to predict just the correct docking path. With the help of 2 \fPublished as a conference paper at ICLR 2024 additional plDDT and dimer structure information, MoLPC has shown for the first time to predict the structures of large multimers with up to 30 chains. Prompt Learning for Pre-trained Models. In the field of natural language processing (NLP), the prevailing prompt learning approach (Brown et al., 2020; Min et al., 2021) has shown gratifying success in transferring prior knowledge across various tasks. Narrowing the gap between the source and target tasks is important for the generalization of pre-trained models on novel tasks or data, which has not been fundamentally addressed with the pre-training-fine-tuning paradigm (Zhou et al., 2022). To achieve this, researchers have turned their attention to prompts. Specifically, a language prompt refers to a piece of text attached to the original input that helps guide a pre-trained model to produce desired outputs (Gao et al., 2020). Prompts can be either discrete or continuous (Sun et al., 2023b; Li et al., 2023). The discrete prompt (Gao et al., 2020; Schick & Sch\u00a8 utze, 2020; Shin et al., 2020) usually refers to task descriptions from a pre-defined vocabulary, which can limit the flexibility of the prompt design due to the limited vocabulary space. In contrast, learnable prompts (Li & Liang, 2021; Zhang et al., 2021; Sun et al., 2023a) can be generated in a continuous space. Inspired by the success of prompt learning, we associate protein-protein interaction (PPI) knowledge (Kov\u00b4 acs et al., 2019; Gao et al., 2023a), which is commonly present in multimers across various scales, to the pretraining phase. By fine-tuning only the prompt model, we can effectively adapt the PPI knowledge to the target task. 3 PRELIMINARIES 3.1 PROBLEM SETUP Assembly Graph. We are given a set of chains (monomers), which is used to form a protein multimer. We represent a multimer with an assembly graph G = (V, E). In G, for the i-th chain, we obtain its chain-level embedding ci by the embedding function proposed in Chen et al. (2019). Each node vi \u2208V can thus represent one chain with node attribute ci. The assembly graph is an undirected, connected and acyclic (UCA) graph, with each edge representing an assembly action. Prepared Dimer Structures \ud835\udc7f\ud835\udfd0\u2032 \ud835\udc7f\ud835\udfd1\u2032 \ud835\udc7f\ud835\udfcf\u2032 \ud835\udc7f\ud835\udfd0 \ud835\udfd0\ud835\udfd1 \ud835\udc7f\ud835\udfd1 \ud835\udfd0\ud835\udfd1 \ud835\udc7f\ud835\udfd1 \ud835\udfcf\ud835\udfd1 \ud835\udc7f\ud835\udfcf \ud835\udfcf\ud835\udfd1 \ud835\udc7f\ud835\udfd0 \ud835\udfcf\ud835\udfd0 \ud835\udc7f\ud835\udfcf \ud835\udfcf\ud835\udfd0 Compute \ud835\udd4b\u2208\ud835\udc46\ud835\udc38(3) Apply \ud835\udd4b Assembly Graph \ud835\udcd6 \ud835\udc97\ud835\udfcf \ud835\udc97\ud835\udfd1 \ud835\udc97\ud835\udfd0 Assemble Start Guide Figure 3: Assembly process with the predicted assembly graph and prepared dimers. Assembly Process. For clarity, we apply an example in Figure 3 to illustrate the assembly process, which is achieved with the prepared dimer structures and the predicted assembly graph. Let us consider a multimer with 3 chains, whose undocked 3D structures are denoted as X1, X2, X3. We consider an assembly graph with the edge set {(v2, v3), (v3, v1)}, and the dimer structures {(X12 1 , X12 2 ), (X13 1 , X13 3 ), (X23 2 , X23 3 )}. First, we select the dimer of chains 2 and 3 as the start point, i.e., X\u2032 2 = X23 2 and X\u2032 3 = X23 3 . Next, to dock the chain 1 onto chain 3, we compute the SE(3) coordinate transformation T that aligns X13 3 onto X\u2032 3. Lastly, we apply T to X1, resulting in the update coordinate X\u2032 1 of chain 1. Definition 1 (Assembly Correctness) For an N-chain multimer with a 3D structure X, its chains are represented by the nodes of an assembly graph G. The assembly correctness F(G, X) is equivalent to the TM-Score (Zhang & Skolnick, 2004) between the assembled multimer and the ground-truth. With the above definitions, our paper aims to predict assembly graphs that maximize the TM-Scores, taking as inputs the residue sequences of chains and pre-calculated dimer structures. 3.2 SOURCE AND TARGET TASKS In this paper, we adopt a pre-training (source task) and prompt fine-tuning (target task) framework to address the MSP problem. We consider two points for task designs: 1) With given multimers for pre-training, the model benefits from common intrinsic task subspace between the source and target task. 2) The target task should be designed to effectively learn the condition PPI (C-PPI) knowledge and efficiently complete the MSP inference. 3 \fPublished as a conference paper at ICLR 2024 3 5 7 9 11 13 15 17 19 21 23 25 25 23 21 19 17 15 13 11 9 7 5 3 Source task: chain 1 2 3 4 5 6 6 5 4 3 2 1 Source task: degree 3 5 7 9 11 13 15 17 19 21 23 25 25 23 21 19 17 15 13 11 9 7 5 3 Target task: chain 1 2 3 4 5 6 6 5 4 3 2 1 Target task: degree 0.2 0.4 0.6 0.8 1.0 Figure 4: Analysis on multimers with varied chain numbers. We select some samples for evaluation and visualize heatmaps that show the similarity of the sample embeddings obtained from different pre-trained models. Each value on the axis suggests that the model is trained on data with the specific chain number or degree value. For example in the heatmap titled \u2018Source task: chain\u2019, the darkness at the [5,7] block represents the similarity between the embeddings extracted from two models that are trained under the source task with 5and 7-chain multimers, respectively. Definition 2 (Source Data Dsou) Each data instance in Dsou involves an assembly graph Gsou and a continuous label ysou, i.e., (Gsou, ysou) \u2208Dsou. For an N-chain multimer, Gsou is randomly generated as its N-node UCA assembly graph, and ysou is the assembly correctness. Definition 3 (Target Data Dtar) Each data instance in Dtar involves an assembly graph Gtar = (Vtar, Etar), an indicated node vd \u2208Vtar, an isolated node vu / \u2208Gtar and the continuous label ytar, i.e., (Gtar, vd, vu, ytar) \u2208Dtar. For an N-chain multimer, Gtar is defined as its (N \u22121)-chain assembly graph. ytar is calculated by ytar = F(({Vtar \u222avu}, {Etar \u222avdvu}), X). Source Task. We design the source task as the graph-level regression task. Based on source data defined in Def. 2, the model is fed with a UCA assembly graph and is expected to output the continuous correctness score between 0 and 1. Note that theoretically, we can generate N N\u22122 different UCA graphs and their corresponding labels with an N-chain multimer. This greatly broadens the available training data, enhancing the effectiveness of pre-training in learning MSP knowledge. Target Task. We design the target task as the link prediction task (i.e., predicting the C-PPI probability). Based on target data defined in Def. 3, the target task aims to predict the presence of the link between nodes vd and vu, which represent the docked and undocked chains, respectively. We provide the detailed process to generate Dsou and Dtar in Appendix A.1. Overall, the source and target tasks learn assembly knowledge globally and locally, respectively. Unfortunately, multimers of varied scales exhibit distribution shifts in the target task, preventing the direct use of it for MSP. Next, we will empirically verify the existence of these shifts and their influence on MSP. 3.3 GAPS BETWEEN MULTIMERS WITH VARIED SCALES We have presented a significant imbalance in the data of multimers (see Figure 2). Here, we analyze the gap in MSP knowledge among multimers with various scales (i.e., chain numbers), which can further consolidate our motivation of utilizing prompt learning for knowledge transfer. We also offer explanations for the reasons behind the gaps based on empirical observations. We begin by analyzing the factor of chain number. We randomly select multimers for evaluation and divide the remaining ones into various training sets based on the chain number, which are then trained with independent models. We obtain the chain representations of the evaluating samples in each model. Lastly, we apply Centered Kernel Alignment (CKA) (Raghu et al., 2021), a function for evaluating representation similarity, to quantify the gaps in knowledge learned by any two models. We show the heatmaps of CKA in the Figure 4 and have two observations. (a) Low similarities are shown between data with small and large scales. (b) Generally, there is a positive correlation between the C-PPI knowledge gap and the difference in scales. In short, C-PPI knowledge greatly depends on the multimer scale. To further explain these gaps, we re-divide the training sets based on the degree (i.e., neighbor number of a node) of assembly graphs and perform additional experiments. Specifically, we define the degree value as the highest node degree within each graph Gsou in the source task, and as the 4 \fPublished as a conference paper at ICLR 2024 Prompt Model Prompt embeddings \ud835\udf3d\u2217 \ud835\udf45 Pre-trained Model ? GIN Encoder Task Head Correctness \ud835\udf3d \ud835\udf53 Graph-level Pre-training (A) Undocked chain Docked chain Chain embedding \ud835\udc6f\ud835\udc85 \ud835\udc6f\ud835\udc96 \ud835\udc6f\ud835\udc99 \ud835\udc6f\ud835\udc9a \ud835\udc6f\ud835\udc99 \ud835\udc6f\ud835\udc9a \ud835\udc6f\ud835\udc85 \ud835\udc6f\ud835\udc96 Correctness Probability = \ud835\udf3d\u2217 \ud835\udf53\u2217 Prompt Tuning Inference Prompt Tuning Result \ud835\udc53 \ud835\udf3d\u2217,\ud835\udf53\u2217,\ud835\udf45\u2217 Support Set Fast Adaptation (Prompt Tuning) Meta Testing ? ; ; ? \u2026 ? \u2026 Target assembly \u2026; (\ud835\udc75= \ud835\udfd6) (\ud835\udc75= \ud835\udc75\ud835\udc8e\ud835\udc82\ud835\udc99) \ud835\udc53% \ud835\udf45|\ud835\udf3d\u2217,\ud835\udf53\u2217 0 1 2 9 Start Probability Choose the best 0 2 \ud835\udc53% \ud835\udf45|\ud835\udf3d\u2217,\ud835\udf53\u22171 3 9 \u2026 Choose the best 0 2 \u2026 (A) (B) (C) \ud835\udc53 \ud835\udf3d\u2217,\ud835\udf53\u2217,\ud835\udf45\u2217 \ud835\udc53 \ud835\udf3d\u2217,\ud835\udf53\u2217,\ud835\udf45\u2217 \ud835\udc53 \ud835\udf3d\u2217,\ud835\udf53\u2217,\ud835\udf45\u2217 Step 1 Step 7 Step 8 : Undocked \ud835\udfcf \ud835\udfd0\ud835\udfd1 \ud835\udfd2 \ud835\udfd3 \ud835\udfd4 \ud835\udfd5 \ud835\udfd6 \ud835\udfd7 Docked 7\u00d72 = 14 probabilities \ud835\udfcf \ud835\udfd0\ud835\udfd1 \ud835\udfd2 \ud835\udfd3 \ud835\udfd4 \ud835\udfd5\ud835\udfd7 Pick the best Figure 5: The overview of PromptMSP. (A). Firstly, we pre-train the GIN encoder and the task head under the graph-level regression task. After pre-training, given an arbitrary graph, \u03b8\u2217and \u03d5\u2217jointly output the correctness. (B). During prompt tuning, the prompt model takes embeddings of a pair of docked and undocked (query) chains as input and learns to produce prompt embeddings which form the entire 4-node path. \u03b8\u2217and \u03d5\u2217then jointly predict the correctness, which is equivalent to the linking probability. We use f\u03b8\u2217,\u03d5\u2217,\u03c0\u2217to denote the well trained pipeline that outputs the linking probability of query chains with target data instance as input. (C). If the target multimer has 9 chains, we sequentially perform 8 steps for inference. In each step, we use the well trained pipeline to calculate the probabilities for all possible chain pairs and select the most possible pair to assemble. degree of node vd to be docked on in the target task. As shown in Figure 4, CKA heatmaps indicate that training samples with different degrees exhibit the gap in knowledge, which becomes even more significant than that between data with varying chain numbers. As observed, we conclude that the gap in chain numbers between data may be primarily due to the difference in degree of assembly graphs. Therefore, we intuitively associate the degree with the biological phenomenon of competitive docking that may occur in MSP, as evidenced by previous studies (Chang & Perez, 2022; Yan et al., 2020; Chang & Perez, 2023). In other words, multimers with more chains are more likely to yield assembly graphs with high degrees, and consequently, more instances of competitive docking. We expect that prompt learning can help bridge this knowledge gap. 4 PROPOSED APPROACH Overview of Our Approach. Our approach is depicted in Figure 5, which follows a pre-training and prompt tuning paradigm. Firstly, using abundant data of small-scale (i.e., 3 \u2264N \u22645) multimers, we pre-train the graph neural network (GNN) model on the source graph regression task. We then design the learnable prompt model, which can reformulate the conditional link prediction (target) task to the graph-level regression (source) task. In the process of task reformulation, an arbitrary-scale multimer in the target task is converted to a fixed-scale (i.e., N = 4) multimer in the source task. For inference, an N-chain multimer will go through N \u22121 steps to be fully assembled. In each step, our model predicts the probabilities of all possible conditional links and selects the highest one to add a new chain. Besides, to further enhance the generalization ability, we provide a meta-learning strategy in Appendix C.5. 4.1 PRE-TRAINING ON THE SOURCE TASK We apply graph neural network (GNN) architecture (Xu et al., 2018; Veli\u02c7 ckovi\u00b4 c et al., 2017; Tang et al., 2023) for graph-level regression (Cheng et al., 2023; Gao et al., 2023b). Our model first computes the node embeddings of an input UCA assembly graph using Graph Isomorphism Network (GIN, Xu et al. (2018)) to achieve its state-of-the-art performance. Kindly note that we can also apply other GNN variants (Kipf & Welling, 2016; Veli\u02c7 ckovi\u00b4 c et al., 2017; Tang et al., 2022; Liu et al., 2024; Li et al., 2019) for pre-training. Following Def. 2, we construct source data Dsou by using the oligomer (i.e., small-scale multimer) data only. The pre-training model approximates the assembly correctness with data instances of Dsou: \u02dc ysou = GNN(Gsou; \u03b8, \u03d5) \u2248F(Gsou; X) = ysou, (1) 5 \fPublished as a conference paper at ICLR 2024 where GNN represents combination of a GIN with parameters \u03b8 for obtaining node embeddings, a ReadOut function after the last GIN layer, and a task head with parameters \u03d5 to yield the prediction \u02dc ysou. As defined in Def. 1, F represents the assembly correctness function for computing TM-Score between the assembled structure and the ground-truth (GT) structure X. We train the GNN by minimizing the discrepancy between predicted and GT correctness values: \u03b8\u2217, \u03d5\u2217= arg min\u03b8,\u03d5 X (Gsou,ysou)\u2208Dsou Lpre(ysou = F(Gsou; X), \u02dc ysou = GNN(Gsou; \u03b8, \u03d5)), (2) where Lpre is the mean absolute error (MAE) loss function. After the pre-training phase, we obtain the pre-trained GIN encoder and the task head parameterized by \u03b8\u2217and \u03d5\u2217, respectively. 4.2 ENSURING CONSISTENCY BETWEEN SOURCE AND TARGET TASKS Reformulating the Target Link Prediction Task. The inference of an N-chain multimer under the source task setting requires all of its N N\u22122 assembly graphs and their corresponding correctness from the pre-trained model. Therefore, when dealing with large-scale multimers, such inference manner requires effective UCA graph traversal algorithms and significant computational resources. The target task proposed in Section 3.2 can address this issue, which aims to predict the link presence (probability) between a pair of docked and undocked chains. As shown in Figure 5C, we can inference the structure of an N-chain multimer with just N \u22121 steps. At each step, we identify the most promising pair of (docked and undocked) chains. The success of traditional pre-training and fine-tuning paradigm is due to that source and target tasks having a common task subspace, which allows for unobstructed knowledge transfer (Sun et al., 2023a). However, in this paper, source and target tasks are naturally different, namely graphlevel and edge-level tasks, respectively. Here, we follow three principles to reformulate the target task: (1) To achieve consistency with the source task, the target task needs to be reformulated as a graph-level problem. (2) Due to the distribution shifts in multimers with varied chain numbers (Figure 4), a multimer of arbitrary scale in the target conditional link prediction task should be reformulated into a fixed-scale one in the source task. (3) The pre-trained GNN model is expected to effectively handle multimers of such \u201cfixed-scale\u201d in the source task. The upcoming introduction of prompt design will indicate that the fixed-scale value is 4. Therefore, to ensure (3), we limit the data used for pre-training to only multimer of 3 \u2264N \u22645. H \u2208R(|Vtar|+1)\u00d7d = \u03b8\u2217(Vtar \u222avu, Etar), (3) Hx = \u03c3\u03c0 \u0010\u0002 softmax \u0000H\u22a4 d Hu \u0001 H\u22a4 u \u0003\u22a4\u0011 , (4) Hy = \u03c3\u03c0 \u0010\u0002 softmax \u0000H\u22a4 u Hd \u0001 H\u22a4 d \u0003\u22a4\u0011 , (5) Gpro = (Vpro = {vd, vu, vx, vy}, Epro = {edx, exy, eyu}), (6) \u02dc ytar = \u03d5\u2217(\u03b8\u2217(Gpro)), (7) Prompt Design. Following Def. 3, we create the target data Dtar for prompt tuning. For clarity, we denote each data instance as a tuple form (Gtar, vd, vu, ytar) \u2208Dtar, where Gtar denotes the current assembled multimer (i.e., condition), vd is a query chain within Gtar and vu is another query chain representing the undocked chain. We compute the last layer embeddings H of all nodes in Gtar and the isolated vu with the pre-trained GIN encoder. To enable communications between target nodes vd and vu, the prompt model parameterized by \u03c0 contains multiple cross attention layers (Vaswani et al., 2017; Wang et al., 2023) that map Hu, Hd \u2208Rd to vectors Hx, Hy \u2208Rd, which represent the initial features of nodes vx and vy. Finally, the pre-trained model outputs the assembly correctness of the 4-node prompt graph Gpro. The whole target task pipeline of our method is represented by the equations on the right side. Specifically, \u03b8\u2217is the pre-trained GIN encoder, \u03d5\u2217is the pre-trained task head and d denotes the dimension of features. The prompt model \u03c0, which outputs a vector Rd, includes non-trainable cross attention layers and the parametric function (Multi-Layer Perceptron, MLP) \u03c3\u03c0. Moreover, we use f\u03b8\u2217,\u03d5\u2217,\u03c0\u2217to represent the entire pipeline (Figure 5B) which takes input (Gtar, vd, vu) and outputs \u02dc ytar. A more detailed model architecture is shown in Appendix A.2. 6 \fPublished as a conference paper at ICLR 2024 Similar PPI \u2113= 1 \u2113= 2 \u2113= 3 1. 2. 3. High probability PPI ? Figure 6: The \u2113= 3 PPI rule. Prompt Design Intuition. First of all, the link between two query chains is equivalent to the protein-protein interaction (PPI) in biology. We introduce the \u2113= 3 path (Kov\u00b4 acs et al., 2019; Yuen & Jansson, 2023), a widely validated biological rule for modeling PPI probabilities. Figure 6 describes the \u2113= 3 rule, which is based on the fact that docking-based PPI generally requires proteins to have complementary surface representations for contact. It claims that the PPI probability of any two chains is not reflected by the number of their common neighbors (a.k.a., triadic closure principle (Lou et al., 2013; Sintos & Tsaparas, 2014)), but rather by the presence of a path of length \u2113= 3. In short, if there exists a 4-node path with query chains at the ends, they are highly likely to have a PPI (link). Regardless of the node number of Gtar, we treat the pre-trained model output based on this 4node Gpro as the linking probability between vd and vu. Unlike most of exsiting prompt learning techniques, the proposed task reformulation manner is naturally interpretable. Let us assume that these two query chains are highly likely to have a link, it will be reasonable to find two virtual chains that help form a valid \u2113= 3 path. This also suggests that the assembly of Gpro tends to be correct, i.e., \u03d5\u2217(\u03b8\u2217(Gpro)) \u21921. Therefore, intuitively, the correctness of Gpro fed to the pre-trained model implies the linking probability between vu and vd. 4.3 INFERENCE PROCESS WITH THE PROMPTING RESULT f\u03c0\u2217|\u03b8\u2217,\u03d5\u2217 With prompt tuning, we obtain the whole framework pipeline f\u03c0\u2217|\u03b8\u2217,\u03d5\u2217. For inference on a multimer with N chains, we perform N \u22121 assembly steps, in each of which we apply the pipeline f\u03c0\u2217|\u03b8\u2217,\u03d5\u2217 to predict the linking probabilities of all pairs of chains and select the most likely pair for assembly. 5 EXPERIMENTS Datasets. We collect all publicly available multimers (3 \u2264N \u226430) from the Protein Data Bank (PDB) database (Berman et al., 2000) on 2023-02-20. Referring to the data preprocessing method in MoLPC (Bryant et al., 2022), we obtain a total of 9,254 multimers. To further clarity, we use the abbreviation PDB-M to refer to the dataset applied in this paper. Overall, the preprocessing method ensures that PDB-M contains high resolution, non-redundant multimers and is free from data leakage (i.e., no sequences with a similarity greater than 40% between training and test sets). Due to the commonly low efficiency of all baselines, we define a data split for 3 \u2264N \u226430 with a small test set size to enable comparison. Specifically, we select 10 for each scale of 3 \u2264N \u226410, and 5 for each scale of 11 \u2264N \u226430. Moreover, for comprehensive evalaution, we re-split the PDBM dataset based on the release date of the PDB files to evaluate our method. Detailed information about the data preprocessing methods and the data statistic of split is in Appendix B. Baselines and Experimental Setup. We compare our PROMPTMSP method with recent deep learning (DL) models and traditional software methods. For DL-based state-of-the-art methods, RL-MLZerd (Aderinwale et al., 2022) and AlphaFold-Multimer (AFM) (Evans et al., 2021) are included. For software methods, Multi-LZerd (Esquivel-Rodr\u00b4 \u0131guez et al., 2012) and MoLPC (Bryant et al., 2022) are included. Since assembly-based methods require given dimers, we first use the ground-truth (GT) dimer structures (represented as GT Dimer) to evaluate the assembled multimer structures. For the pair of chains with contact, GT Dimer includes their native dimer structure drawn from the GT multimer. For those without contact, we use EquiDock (Ganea et al., 2021) for outputting dimer structures due to its fast inference speed. Moreover, since GT dimers are not always available, for pratical reasons, we consider to prepare dimers with AFM (Evans et al., 2021) (AFM Dimer) and ESMFold (Lin et al., 2023) (ESMFold Dimer). For baselines not requiring given dimers, we use these three kinds of dimers to reassemble based on the docking path mined in their predicted multimer, which is referred to as the \u2020 version of the baselines. Our experiments consist of 3 settings: 1) Since most baselines can not handle multimers with chain numbers N > 10. We follow GT Dimer, AFM Dimer and ESMFold Dimer to evaluate all baselines on the small-scale multimers (3 \u2264N \u226410) in the test set. 2) We evaluate MoLPC and our method by using these three types of dimers on the 7 \fPublished as a conference paper at ICLR 2024 Table 1: Multimer structure prediction results. Methods are evaluated on the test set of 3 \u2264 N \u226410 by using three types of pre-computed dimers. The test set includes 80 multimer samples in total (10 samples for each scale). For each dimer type and metric, the best method is bold and the second best is underlined. \u2020 represents the reassembly version of baselines. R(Avg): average RMSD; R(Med): median RMSD; T(Avg): average TM-Score; T(Med): median TM-Score. Methods GT Dimer AFM Dimer ESMFold Dimer R(Avg)/R(Med) T(Avg)/T(Med) R(Avg)/R(Med) T(Avg)/T(Med) R(Avg)/R(Med) T(Avg)/T(Med) Multi-LZerD 31.50 / 33.94 0.28 / 0.25 31.50 / 33.94 0.28 / 0.25 31.50 / 33.94 0.28 / 0.25 Multi-LZerD\u2020 18.90 / 19.30 0.54 / 0.38 29.68 / 27.96 0.30 / 0.33 33.00 / 31.07 0.25 / 0.29 RL-MLZerD 31.04 / 27.44 0.29 / 0.32 31.04 / 27.44 0.29 / 0.32 31.04 / 27.44 0.29 / 0.32 RL-MLZerD\u2020 17.77 / 17.69 0.51 / 0.53 28.57 / 26.20 0.30 / 0.35 27.76 / 32.91 0.32 / 0.25 AFM 20.99 / 24.76 0.47 / 0.42 20.99 / 24.76 0.47 / 0.42 20.99 / 24.76 0.47 / 0.42 AFM\u2020 16.79 / 16.02 0.59 / 0.59 18.98 / 19.05 0.50 / 0.48 26.76 / 29.95 0.33 / 0.30 MoLPC 18.53 / 18.08 0.52 / 0.55 23.06 / 23.92 0.43 / 0.42 30.17 / 29.45 0.31 / 0.31 PromptMSP 13.57 / 11.74 0.67 / 0.71 17.36 / 17.09 0.55 / 0.56 22.55 / 24.85 0.45 / 0.37 (A) (B) (C) \u00d7 \u00d7 \u00d7 \u00d7 \u00d7 \u00d7 \u00d7 \u00d7 R: 0.96 R: 0.63 Figure 7: (A). TM-Score distribution of MoLPC and our method tested on multimers of 10 \u2264 N \u226430. The mean and median values are marked with white and black \u2018\u00d7\u2019, respectively. (B). The relationship of learned C-PPI knowledge and the actual TM-Score. (C). The relationship of I-PPI learned by MoLPC and the actual TM-Score. We show the Pearson\u2019s correlation R for both. entire test set (3 \u2264N \u226430). 3) We additionally split the PDB-M dataset based on the release date of multimers to evaluate the generalization ability of our method. We run all methods on 2 A100 SXM4 40GB GPUs and consider exceeding the memory limit or the resource of 10 GPU hours as failures, which are padded by the upper bound performance of all baselines. Evaluation Metrics. To evaluate the performance of multimer structure prediction, we calculate the root-mean-square deviation (RMSD) and the TM-score both at the residue level. We report the mean and median values of both metrics. Multimer Structure Prediction Results. Model performance on multimers of two kinds of scales (3 \u2264N \u226410, 11 \u2264N \u226430) are summarized in Table 1 and Figure 7A, respectively. For small-scale multimers, our model achieves state-of-the-art on all metrics. In addition, we find that most MSP methods can benefit from the reassembly of GT or AFM dimer structures. Notably, our model can significantly outperform MoLPC, even though it does not require additional plDDT information or coarse information for protein interactions. For larger-scale multimers, our model also outperforms MoLPC, and outputs completely accurate prediction results for certain samples (i.e., TM-Score = 1.0 under GT Dimer). As for the failed inference samples of MoLPC, we relax the model\u2019s penalty term to successfully obtain the predictions instead of simply considering its TM-Score as 0. Despite this, our model can still achieve significant improvements under GT Dimer, AFM Dimer and ESMFold Dimer. The experimental results under the data split based on the release dates is in Appendix C.1. 8 \fPublished as a conference paper at ICLR 2024 Table 2: Efficiency comparison (average MSP inference time). Time(min) 3 \u2264N \u226410 11 \u2264N \u226430 Path Dimer Total Path Dimer Total Multi-LZerD 187.51 \u2013 187.50 \u2013 RL-MLZerD \u2013 173.88 173.88 AFM \u2013 \u2013 155.72 MoLPC 11.64 165.73 177.37 11.64 354.23 365.87 Ours-GT 0.01 \u2013 0.01 0.04 \u2013 0.04 Ours-AFM 0.01 80.79 80.80 0.04 187.44 187.48 Ours-ESMFold 0.01 0.35 0.36 0.01 1.09 1.10 Table 2 shows the inference efficiency of all baselines. As assembly-based methods require given dimer structures, we report the separate running time for predicting the docking path and preparing dimers, as well as the total time consumption. Kindly note that during inference, our method predicts the docking path without the need for pre-computed dimers. Therefore, to predict the structure of an N-chain multimer, our method (always) requires N \u22121 pre-computed dimers. We note that regardless of the dimer type used, our method is significantly faster than the other baselines. Our method also achieves higher efficiency in predicting the docking path compared to MoLPC. We provide more docking path inference results of our method (in Figure 9 in Appendix). We can find that as the scale increases, the inference time for a single assembly process (the orange curve) of our method does not increase, which suggests that the applicability of our model is not limited by the scale. Table 3: Ablation study with GT dimers. Prompt C-PPI 3 \u2264N \u226410 11 \u2264N \u226430 \u00d7 \u2713 0.55(-17.9%) 0.29(-21.6%) \u2713 \u00d7 0.54(-19.4%) 0.33(-10.8%) \u2713 \u2713 0.67 0.37 Ablation Study. We perform ablation study in Table 3 to explore the significance of the prompt model and the C-PPI modelling strategy. If we remove the prompt model and apply the link prediction task both for pre-training and fine-tuning, the performance will greatly decrease by about 21.6% on large-scale multimers. This implies the contribution of prompt in unifying the C-PPI knowledge in multimers of different scales. Similarly, the significance of applying C-PPI modelling can be further illustrated through its relationship with the MSP problem. Figure 7(BC) indicates that I-PPI will bring negative transfer to the MSP task, ultimately hurting the performance. 7 6~8 5~9 4~103~113~133~153~173~193~213~233~253~273~30 Scale(s) of multimers for training 0.40 0.45 0.50 0.55 0.60 TM-Score w/o prompt PromptMSP Figure 8: Results tested on N=7. We train our model and its \u2018w/o prompt\u2019 version on multimers of varied scale ranges. In Figure 8, we show the generalization ability of our method. The term \u2018w/o prompt\u2019 refers to the direct use of GNNs for conditional link prediction for MSP. We find that when introducing training multimers with the scale (e.g., N > 11) differs significantly from the testing multimers (i.e., N = 7), the performance of the \u2018w/o prompt\u2019 method notably declines. Conversely, for PROMPTMSP, adding arbitray-scale multimers to the training set will improves the model\u2019s generalization ability. This indicates that our model can effectively capture shared knowledge between varied-scale multimers, while blocking the knowledge gaps caused by distribution shifts. 6" + }, + { + "url": "http://arxiv.org/abs/2402.10609v1", + "title": "U$^2$MRPD: Unsupervised undersampled MRI reconstruction by prompting a large latent diffusion model", + "abstract": "Implicit visual knowledge in a large latent diffusion model (LLDM)\npre-trained on natural images is rich and hypothetically universal to natural\nand medical images. To test this hypothesis, we introduce a novel framework for\nUnsupervised Undersampled MRI Reconstruction by Prompting a pre-trained large\nlatent Diffusion model ( U$^2$MRPD). Existing data-driven, supervised\nundersampled MRI reconstruction networks are typically of limited\ngeneralizability and adaptability toward diverse data acquisition scenarios;\nyet U$^2$MRPD supports image-specific MRI reconstruction by prompting an LLDM\nwith an MRSampler tailored for complex-valued MRI images. With any\nsingle-source or diverse-source MRI dataset, U$^2$MRPD's performance is further\nboosted by an MRAdapter while keeping the generative image priors intact.\nExperiments on multiple datasets show that U$^2$MRPD achieves comparable or\nbetter performance than supervised and MRI diffusion methods on in-domain\ndatasets while demonstrating the best generalizability on out-of-domain\ndatasets. To the best of our knowledge, U$^2$MRPD is the {\\bf first}\nunsupervised method that demonstrates the universal prowess of a LLDM, %trained\non magnitude-only natural images in medical imaging, attaining the best\nadaptability for both MRI database-free and database-available scenarios and\ngeneralizability towards out-of-domain data.", + "authors": "Ziqi Gao, S. Kevin Zhou", + "published": "2024-02-16", + "updated": "2024-02-16", + "primary_cat": "eess.IV", + "cats": [ + "eess.IV", + "cs.CV", + "cs.LG" + ], + "main_content": "Introduction Magnetic Resonance Imaging (MRI) is a cornerstone in clinical diagnostics, renowned for its safety. It can generate diverse, high-contrast images, including T1-weighted, T2weighted, and Proton Density-weighted images, enabling comprehensive radiological assessments. However, MRI\u2019s slow acquisition speed, due to inherent physical and physiological constraints, limits its clinical efficiency. Extended scan duration not only causes patient discomfort but also increases the likelihood of motion artifacts and systemic errors in the images. To this end, accelerated MRI techniques with undersampling acquisition have been developed. Deep learning methods have come to the forefront in the field of undersampled MRI reconstruction. Until recently, supervised methods (Schlemper et al., 2017; Qin et al., 2018; Eo et al., 2018; Cheng et al., 2019; Zhou & Zhou, 2020; Guo et al., 2023; Zhou et al., 2023) dominate this field. Although these methods excel in in-domain reconstruction 1 arXiv:2402.10609v1 [eess.IV] 16 Feb 2024 \fTitle Suppressed Due to Excessive Size performance, they often lack generalizability to scenarios outside of their training environment, notably across varying sampling patterns, organs, and MRI modalities (Liu et al., 2021; Chung & Ye, 2022). Unsupervised reconstruction methods for MRI, such as implicit neural representations (INR) (Shen et al., 2022; Feng et al., 2023b;c), are scanor image-specific and exhibit a high degree of adaptability. However, no existing work has proven INR\u2019s potential in utilizing large data prior for MR imaging. Recently, diffusion models (Song et al., 2021b; Peng et al., 2022; Chung & Ye, 2022) have emerged as superior to supervised state-of-the-art methods. Instead of using a discriminative objective, they train a diffusion model to approximate the distribution of MR images, eliminating the dependency on particular sampling patterns. (Chung & Ye, 2022) have demonstrated its notable generalization capability across diverse organs and modalities. However, the dataset scale of current MRI diffusion models (Song et al., 2021b; Peng et al., 2022; Chung & Ye, 2022) typically ranges from thousands to tens of thousands of samples and it remains challenging to curate large-scale MR images due to privacy privacy. Parallel to this, large latent diffusion models (LLDM) (Podell et al., 2023; Rombach et al., 2022), revolutionary image generative models exemplified by Stable Diffusion (SD), are trained on vast Internet-scale images (Schuhmann et al., 2022) of about 106 times larger than existing public datasets (Knoll et al., 2020; Zbontar et al., 2018) used for training MRI diffusion models. SD models can generate diverse, high-fidelity images and have proven a powerful backbone (Zhao et al., 2023; Xu et al., 2023; Yang et al., 2023; Gong et al., 2023) with supervised fine-tuning. These facts imply the richness of visual knowledge in an LLDM and prompt our questions: Is the implicit visual knowledge in the LLDM pre-trained on natural images universal for both natural and medical images? If yes, how can it be harnessed and enhance the adaptability and generalizability of undersampled MRI reconstruction models? We believe that universal visual knowledge exists and can be harnessed for MRI data. In this paper, we provide a solution, U2MRPD, to the second question in an attempt to answer the first question from a practical perspective. As the most related area of research, Diffusion model-based Inverse problem Solvers (DIS) perform conditional posterior sampling using the pre-trained diffusion prior. The majority of DIS focus on pixel (Kadkhodaie & Simoncelli, 2021; Kawar et al., 2022; Wang et al., 2023; Feng et al., 2023a; Chung et al., 2023a; 2022a; Song et al., 2023c;b) while few works explore their effectiveness in the latent domain (Song et al., 2023a; Rout et al., 2023; Chung et al., 2023c). Furthermore, most of the research concentrates on pixel-domain solvers using in-distribution data and has not explored complex-valued image restoration. In this context, we investigate the challenging combination of perCharacteristics \\ Model type Supervised models INR Diffusion U2MRPD No paired data. \u00d7 \u2713 \u2713 \u2713 Work in database-free scenarios. \u00d7 \u2713 \u00d7 \u2713 Can leverage large data. \u2713 \u00d7 \u2713 \u2713 Work with diverse sampling masks. poor \u2713 \u2713 \u2713 OOD organs and contrast poor \u2713 average \u2713 Table 1. Characteristics of supervised and unsupervised models of undersampled MRI reconstruction. The last two rows are summarized from our experiments. forming latent diffusion model sampling for extreme outof-distribution and complex-valued data. In this work, we propose a generalizable and flexible MRI reconstruction framework, namely Unsupervised Undersampled MRI Reconstruction by Prompting a pre-trained latent Diffusion model (U2MRPD). The comparison between U2MRPD and other methods are provided in Table 1. Despite an LLDM has not been explicitly trained on medical, complex, or aliased images, our MRSampler can prompt an large LLDM to reconstruct undersampled MR images. To utilize any MRI dataset, we propose the generality-preserved MRAdapter, which efficiently resolves distribution mismatches with a minimal computational cost while safeguarding data priors. The experimental results on both simulation and complex-valued datasets demonstrate that our U2MRPD performs comparably to the supervised and MRI diffusion methods on in-domain datasets, while significantly outperforming them on out-of-domain datasets. We also conduct extensive ablation studies for several key designs of our method, verifying their effectiveness. We observe an improvement in adaptability and generalizability upon current literature and anticipate that our findings will stimulate further research into leveraging general image priors to develop more robust medical imaging systems. Our contributions are as follows: \u2022 To the best of our knowledge, we are the first to retrieve the implicit visual knowledge in an LLDM pretrained on natural images for medical imaging inverse problems, particularly accelerated MRI, in an unsupervised fashion. \u2022 Our MRSampler, tailored for complex-valued MRI images, allows physically consistent diffusion inference with a novel strong-to-mild control mechanism combined with pseudo-random phase modulation. Our MRAdapter efficiently bridges the gap between natural and medical image distributions and preserves the integrity of generative image priors. \u2022 To underscore U2MRPD\u2019s effectiveness, we provide an empirical analysis of MRSampler and further validate MRAdapter with a universal MRI reconstruction task (Liu et al., 2021). 2 \fTitle Suppressed Due to Excessive Size \u2022 Comprehensive evaluations against state-of-the-art supervised and MRI diffusion methods confirm our approach\u2019s parity or superiority, highlighting its adaptability and generalization capabilities across varying MRI conditions. 2. Preliminaries 2.1. DDIM sampler Denoising Diffusion Implicit Models (DDIMs) (Song et al., 2021a) provide a backbone for our algorithmic framework since they are ideal for solving time-sensitive inverse problems. DDIM sampler adopts a non-Markovian process and can generate samples with fewer diffusion steps. Formally, it generates a sample xt\u22121 from a sample xt via: xt\u22121 = \u221a\u03b1t\u22121 \u0012 xt\u2212\u221a1\u2212\u03b1t\u00b7\u03f5(t) \u03b8 (xt) \u221a\u03b1t \u0013 + p 1 \u2212\u03b1t\u22121 \u2212\u03c32 t \u00b7 \u03f5(t) \u03b8 (xt) + \u03c3t \u00b7 \u03bet, (1) where \u03f5(t) \u03b8 represents the pre-trained score function compatible with DDPMs, and \u03bet is random noise. \u03c3t, the standard deviation of Gaussian noise at time t, controls the stochasticity of the diffusion process with a step-wise schedule. The process becomes deterministic when setting \u03c3t to zero. 2.2. Classifier guidance Algorithm 1 Classifier guided deterministic DDIM sampling (Song et al., 2021a) 1: xT \u223cN(0, I) 2: for t = T, . . . , 1 do 3: \u02c6 \u03f5 \u2190\u03f5\u03b8(xt) \u2212\u03b3\u221a1 \u2212\u03b1t\u2207xt log p\u03d5(y|xt) // classifier correction 4: \u02c6 x0 \u2190xt\u2212\u221a1\u2212\u03b1t\u02c6 \u03f5 \u221a\u03b1t // predict x0 given xt 5: xt\u22121 \u2190\u221a\u03b1t\u22121\u02c6 x0 + \u221a1 \u2212\u03b1t\u22121\u02c6 \u03f5 // DDIM sampling 6: end for 7: return x0 Classifier guidance (Dhariwal & Nichol, 2021; Song et al., 2021b) integrates classifier predictions into the diffusion process, steering it to generate samples with specific characteristics, like a class label or measured signals y. The \u2018classifier\u2019 can be either, in a narrower sense, a classifier pre-trained on class-labeled noisy images, or a defined metric between measured signals and predicted signals. The process of classifier-guided deterministic DDIM sampling is formulated in Algorithm 1. The gradient scale \u03b3 regulates the balance between the fidelity of generated samples and their alignment with the classifier\u2019s predictions. For latent diffusion models, the deterministic DDIM sampler uses a pre-trained score function \u03f5\u03b8(zt, t) to predict \u02c6 z0 via \u02c6 z0 = \u221a\u03b1t\u22121 zt \u2212\u221a1 \u2212\u03b1t \u00b7 \u03f5(t) \u03b8 (zt) \u221a\u03b1t ! , (2) and deterministically sample zt from zt+1 via zt\u22121 = \u02c6 z0 + q 1 \u2212\u03b1t\u22121 \u2212\u03c32 t \u00b7 \u03f5(t) \u03b8 (zt). (3) 2.3. Latent diffusion model Large diffusion models, such as those proposed by Rombach et al. (2022); Ramesh et al. (2021); Saharia et al. (2022), have excelled in generating diverse and high-fidelity images. These models consist of three integral components: a text encoder, an image autoencoder, and a latent image generator. For instance, Stable Diffusion (SD) utilizes CLIP (Radford et al., 2021) as its text encoder, trains VQGAN (Esser et al., 2021) as its autoencoder and consequently a denoising UNet as the image generator on VQGAN\u2019s latent space. The structural composition of SD v1.5 is illustrated in Fig. 1. The implicit visual knowledge lies in the latent image generator. 3. Method 3.1. Undersampled MRI reconstruction We consider the following forward measurement model in MRI acquisition: k = MFxf + \u03f5, y = F\u22121k, (4) where xf \u2208Cn is the orginal fully-sampled image, y \u2208Cn is the undersampled (aliased) image, k \u2208Cn is the k-space measurement, and \u03f5 is the measurement noise. M \u2208{0, 1}n is the undersampling mask and (F, F\u22121) is the Fourier Transform pair. Undersampled MRI reconstruction aims at recovering high quality \u02c6 x from undersampled k, a dualdomain optimization formulation suggesting \u02c6 x = arg min x ||k \u2212MFx|| + \u03bb \u00b7 R(x), (5) where the first term enforces the fidelity of k-space measurement and R is some image regularizers. U2MRPD utilizes the image prior from the large text-toimage diffusion model as R and incorporates the k-space fidelity term in the diffusion process progressively by MRSampler. MRAdapter improves the accuracy of data fidelity term with any given MRI data. 3.2. MRSampler MRSampler is a physically consistent LDM solver for complex-valued MRI data. It prompts LDMs for generalizable undersampled MRI reconstruction in both MRI database-free and database-available scenarios. It is described formally in Algorithm 2. It builds upon a deterministic1 DDIM sampler, incorporating several novel phasemodulated control mechanisms to enhance its efficacy for 1Reason for this choice instead of a stochaitic one is provided in Appendix A.6.1. 3 \fTitle Suppressed Due to Excessive Size Algorithm 2 MRSampler Input: measured k-space k (the empty of which are filled with 0\u2019s), a sampling mask M. Require: an LLDM including an autoencoder (encoder E and decoder D), a deterministic DDIM Sampler S with a total timestep T=1000. Hyperparameters: SDEdit t0, watershed for two controllers tws, scale of classifier guidance \u03b3. 1: y = F\u22121(k) // an undersampled aliased image 2: z \u223cN(0, I) 3: zT0 = S.stochasticEncode(z, |y|, t0 \u00b7 T) 4: \u03b8 \u223cU(\u2212\u03c0, \u03c0) // pseudo-random phase generation 5: kP P M = F(|y|ej\u03b8) // modulated measured k-space 6: for t = t0 \u00b7 T \u22121 to 0 do 7: \u02c6 z0 = S.predict(zt+1, t + 1) // Eq.(2) 8: \u02c6 x0 = D(\u02c6 z0) 9: \u02c6 kP P M = F(\u02c6 x0ej\u03b8) 10: if t > tws \u00b7 T then 11: // hard data consistency 12: \u02c6 kdc = (1 \u2212M) \u00b7 \u02c6 kP P M + M \u00b7 kP P M 13: \u02c6 xdc = F\u22121(\u02c6 kdc), \u02c6 zdc 0 = E{|\u02c6 xdc|} 14: zt = S.sample(zt+1, t, \u02c6 zdc 0 , cg = 0) // Eq.(3) 15: else 16: // soft classifier guidance 17: zt = S.sample(zt+1, t, \u02c6 z0, cg = \u2212\u03b3 \u00b7 \u2207zt+1\u2225M \u00b7 kP P M \u2212M \u00b7 \u02c6 kP P M\u2225) 18: end if 19: end for 20: x0 = D(z0) 21: return x0 complex-valued MRI. Additionally, the implementation of an early-step-skipping(Meng et al., 2022; Chung et al., 2022b) technique combined with an interleaving strategy (Song et al., 2023a) enables an MRSampler to achieve a 5 \u00d7 acceleration, without compromising the quality of the reconstruction. Strong-to-mild diffusion control. We notice that the direct replacement in the measurement domains, i.e. hard data consistency (Kawar et al., 2022; Wang et al., 2023; Chung et al., 2023b; Song et al., 2023a), changes the generated MRI image drastically while soft gradient guidance (Song et al., 2021b; Chung et al., 2022a; 2023a; Rout et al., 2023; Song et al., 2023c) tends to perform mildly (Figure 2, panel (b); Figure 4, panel (b) and (c)). Observing the typical chaos-torefinement pattern in the guided diffusion processes (Figure 4, panel (b) to (d)), we propose a strong-to-mild diffusion control mechanism. Once attaining clean latent predictions \u02c6 z0 at each diffusion step and the pixel-domain counterpart \u02c6 x0 = D(\u02c6 z0), MRSampler enforces either hard or soft data consistency depending on the current timestep t and a hyperparameter, namely watershed timestep tws. Details about Figure 2. PPM\u2019s effect on MRSampler. Panel (a) shows the impact of PPM on both the image and Fourier domain (k-space) and panel (b) shows an intermediate hard data consistency step without and with PPM. the unitary controllers (soft and hard data consistency) can be found in the Appendix A.5.1. Pseudo-random phase modulation. Diffusion models are trained within noisy data landscapes, thus simplistic measurement constraints can inadvertently displace the inferential trajectory from its native data manifold (Chung et al., 2022a). We observe severe artifacts when directly applying a hard data consistency controller to MRI data, illustrated in Figure 4(d). This motivates us to modulate the intermediate images by a separable noising technique, namely Pseudorandom Phase Modulation (PPM). PPM modulates the input undersampled image y \u2208Cn and any intermediate clean MRI image \u02c6 x0 \u2208Rn by preserving its magnitude and bestowing it with a pseudo-random phase \u03b8 \u2208[\u2212\u03c0, \u03c0). The phase corruption does not obfuscate the essential structure of a complex-valued image as the corruption can be rectified by simply getting the magnitude. An illustration of PPM\u2019s influence on different controllers is provided in Figure 2. The undersampled PPM image yP P M = F\u22121MF(|yGT |ej\u03b8) is noisier than y = F\u22121MF(|yGT |) (Figure 2, panel (b)). Intuitively, PPM benefits the hard data consistency by hiding the aliasing artifacts under the noise (Figure 2, panel (a)). Furthermore, an image corrupted with high-frequency noise has Fourier features less imbalanced distribution (Figure 2, panel (b)) than raw k-space data with a high dynamic range (Mezrich, 1995). As a result, the constructed soft gradient term can concentrate less on the dominant low frequency and pay more attention to high-frequency reconstruction, reconstructing more details of aliased MRI (Figure 3, yellow 4 \fTitle Suppressed Due to Excessive Size and red boxes). 3.3. MRAdapter The rationale behind designing MRAdapter is that while providing any additional information related to the target task, i.e. MRI data for undersampled MRI reconstruction, an adaptable model\u2019s performance shall be improved anyway. The accuracy of the MRSampler is lowered by the autoencoder in LLDMs since both soft and hard constraints are on the pixel domain and pass through the lossy autoencoder. With any MRI data, the reconstruction performance of an LLDM\u2019s autoencoder can be improved by finetuning. As such, we propose an MRAdapter to gap the distribution mismatch between the training set of LLDM\u2019s autoencoders and MRI data. Specifically, we duplicate the magnitude of the MRI images three times as the input and ground truth for VQGAN and unfreeze the first and last set of convolutional layers of VQGAN and finetune it using the L2 loss. Intuitively, the MRAdapter adds two sets of filters to LLDMs: MRI-to-natural-images and natural-image-to-MRI at the start and the end of the autoencoder, respectively. By veiling data in the pixel domain and maintaining a naturalimage-resembled latent space, MRAdapter improves MRI generation and preserves the integrity of the generative image prior. Technically, our MRAdapter is characterized by three principal attributes:(1) It achieves computational efficiency by fine-tuning merely 0.2% of the entire diffusion model, as depicted in Figure 1(c). (2) It maintains the generative versatility of an LLDM. (3) It demonstrates robust performance in both specialized and universal MRI reconstruction tasks, as illustrated in Table 5. 4. Experiments In this section, we aim to answer the key question: can the implicit visual knowledge in a pre-trained LLDM on natural images be harnessed and enhance the (1) adaptability and (2) generalizability of undersampled MRI reconstruction models? We use the SD v1.5 checkpoint2 pre-trained on the LAION dataset (Schuhmann et al., 2022). We conduct comprehensive experiments on two commonly used public datasets of three MRI contrasts and two organs and ablate U2MRPD thoroughly. Additional details and results are in Appendix3. 4.1. Experimental Settings Datasets. We conduct experiments on one simulation dataset, the Multi-contrast IXI brain dataset4, and one real2https://huggingface.co/runwayml/stable-diffusion-v1-5 3More results are in Appendix A.1 and more details of datasets, baselines, and implementation are in Appendix A.2,A.3, and A.4. 4brain-development.org/ixi-dataset, CC BY-SA 3.0 license Table 2. Hyperparameters selection of different datasets. MRSampler MRAdapter t0 tws \u03b3 lr Adam Epoch FastMRI 0.4 0.3 1e\u22123 1e-04 (0.5,0.9) 10 IXI 0.4 0.3 5e\u22124 1e-04 (0.5,0.9) 10 collected dataset, the FastMRI single-coil knee5(Knoll et al., 2020; Zbontar et al., 2018) dataset. The first dataset contains coil-combined magnitude images of T1-, T2and PDweighted acquisition emulated as single-coil data with 576 overlapped subjects. The second dataset includes 1,172 raw k-space volumes of coronal proton density-weighted with or without fat suppression. We use all available subjects and follow the same pre-processing and dataset partition conventions as those in (Zhou et al., 2023) and (Peng et al., 2022; Chung & Ye, 2022; Guo et al., 2023; Knoll et al., 2020) for two datasets respectively. Baselines & Metrics. We employ six representative undersampled MRI reconstruction approaches from three categories as baselines, including (1) two model-based algorithms: Zero Filling and TV (Block et al., 2007), (2) two supervised DL methods: UNet (Zbontar et al., 2018) and DuDoRNet (Zhou & Zhou, 2020), and (3) two diffusion methods: Score-MRI (Chung & Ye, 2022; Chung et al., 2022b) and DiffuseRecon (Peng et al., 2022). We consider four Cartesian sampling patterns with different acceleration rates and use peak signal-to-noise ratio (PSNR) and structural similarity index measure (SSIM) for quantitative evaluation of MRI reconstruction. Implementation Details For our MRSampler, we tune the hyperparameters on 5 volumes in the corresponding training set of two datasets. For our MRAdapter, finetuning is carried out on the whole training set with the best hyperparameters on the validation set. Hyperparameters for all experiments presented are shown in Table 2. They are selected based on empirical findings from prior works (Meng et al., 2022; Esser et al., 2021; Song et al., 2021a) and primarily remain consistent across datasets. While crafting the initial noise potentially improves generation (Everaert et al., 2024), we keep a fixed seed in all experiments. 4.2. Main results In Table 3, we provide a structured quantitative comparison of undersampled MRI reconstruction models on both datasets under different acceleration rates of Uniform 1D sampling. It is divided into two categories: one compares database-free U2MRPD with dedicated models on FastMRI and the other, more challengingly, benchmarks U2MRPD against dedicated supervised models on every type of MRI. 5fastmri.med.nyu.edu 5 \fTitle Suppressed Due to Excessive Size In Figure 3, we visualize the reconstruction of complexvalued MRI data emphasizing diverse sampling masks. We provide a structured analysis of the main results below: \u2022 Generalizability towards MRI modalities and organs. U2MRPD finetuned with FastMRI generalizes the best towards unseen MRI modalities and organ (U2MRPD\u2019s consistently red results in Table 3, section 1, IXI) while supervised methods quickly falter with out-of-domain modalities or organs (the numerous gray values in Table 3, section 1, column IXI). \u2022 Generalizability towards MRI sampling patterns. Despite not being trained on them, U2MRPD is the most robust model under various sampling masks compared to other methods (Figure 3). Furthermore, U2MRPD surpasses all methods under high and outof-domain acceleration rates (U2MRPD\u2019s consistently red results of Table 3, section 1 and 2, column 12x). \u2022 Adaptability in database-free scenario. Databasefree U2MRPD surpasses all other supervised and diffusion methods in out-of-domain data (U2MRPD\u2019s consistently blue results of Table 3, column IXI). Furthermore, database-free U2MRPD stays on par with indomain diffusion models under low acceleration rates (Table 3, column FastMRI, 4x); surpasses them under medium acceleration rates (Table 3, column FastMRI, 8x); and surpasses all supervised and diffusion methods under high acceleration rates (U2MRPD\u2019s consistently blue results of Table 3, column 12x). \u2022 Adaptability in database-available scenarios. With single-source MRI data, U2MRPD\u2019s performance is consistently improved in all MRI data tested (comparison of two U2MRPDs\u2019 results in Table 3, section 1 and Table 5, section 2). With multiple-source MRI data, U2MRPD\u2019s results can be further boosted (Table 5, section 2, row BCD), indicating a promising new direction for universal undersampled MRI reconstruction (Liu et al., 2021) with U2MRPD. \u2022 Discussion: U2MRPD versus MRI diffusion models. U2MRPD uses an LLDM trained on billions of natural images and the latter are trained with MRI datasets. Despite relying solely on the magnitude component of complex MRI data, U2MRPD outperforms MRI diffusion methods using the full complex data: the results on IXI in Table 3 reveal that only our method and Score-MRI consistently outperform Zero Filling for undersampled brain MRI reconstruction and our method excels over Score-MRI by an average of 1.67 \u22125.78 dB in PSNR and 5.54 \u221215.10% in SSIM, particularly in out-of-domain modalities or organs; DiffuseRecon\u2019s official implementation fails to generalize towards images of different sizes, accounting for the N/A\u2019s in the Figure 3. Comparative visualizations of complex-valued MRI reconstructions using different sampling masks with identical acceleration factors, as depicted in (a). Panels (b) through (i) display the outcomes of various reconstruction models. The red dashed box on the 2nd row shows a sub-figure. In each sub-figure, the magnitudes of each reconstructed image (left) and its residual difference from the reference (right) are shown within each sub-panel, employing a consistent colormap for error visualization throughout. PSNR and SSIM are notated at the top of each reconstructed image. Red and yellow boxes highlight two challenging details. Panel (j) presents the magnitude of the reference image sourced from the FastMRI knee dataset alongside the color bar. Refer to Figure 5 for results with more masks and Figure 6 for results on the Multi-contrast IXI brain dataset in Appendix. 6 \fTitle Suppressed Due to Excessive Size Table 3. Quantitative metrics of undersampled MRI reconstruction with various acceleration rates and datasets. \u2020 means models use complex-valued data and \u2217means models use magnitude-only data. In each section, the best results are colored red and the second best results in the first section are colored blue. Metrics lower than Zero Filling\u2019s are colored gray. Numbers are presented as {mean value} with scriptsize\u2019s {unit standard deviation}. FastMRI single-coil knee dataset Multi-contrast IXI brain dataset \u2191PSNR(dB) 5145 slices of (PD, Knee) 912 slices of (T1, Brain) 700 slices of (T2, Brain) 700 slices of (PD, Brain) Acceleration rate 4x 8x 12x 4x 8x 12x 4x 8x 12x 4x 8x 12x Zero Filling 28.82 2.03 28.20 2.05 27.90 2.05 25.56 1.98 24.67 1.99 24.59 2.00 24.85 1.18 23.93 1.18 23.86 1.18 24.68 1.36 23.78 1.36 23.72 1.35 TV\u2020 25.35 1.95 24.96 1.92 24.67 1.90 26.70 2.27 24.92 2.04 24.83 2.06 25.99 1.32 24.19 1.20 24.11 1.19 25.88 1.54 24.07 1.40 24.02 1.38 (1) Database-free and adapted U2MRPD on FastMRI v.s. dedicated models on FastMRI. UNet\u2020 30.71 2.30 29.18 2.26 27.56 2.17 25.91 2.12 24.33 1.82 24.18 1.84 25.60 1.18 23.75 1.13 24.18 1.84 25.33 1.34 23.54 1.26 23.34 1.34 DuDoRNet\u2020 32.94 3.09 30.87 2.67 28.94 2.30 25.33 1.71 23.49 1.74 22.98 1.85 25.40 1.20 23.09 1.15 22.75 1.15 24.35 1.40 22.10 1.50 21.66 1.52 DiffuseRecon\u2020 31.38 3.74 29.51 3.06 28.56 2.82 N/A N/A N/A N/A N/A N/A N/A N/A N/A Score-MRI\u2020 30.33 2.44 28.81 2.21 28.24 2.07 29.21 2.33 25.52 1.94 25.03 1.94 28.78 1.40 24.72 1.22 24.32 1.18 28.64 1.60 24.74 1.35 24.32 1.31 U2MRPD\u2217(Ours w/o MRAdapter) 30.88 1.63 30.26 1.63 29.64 2.60 30.63 2.40 28.54 2.31 27.32 2.22 30.57 1.40 28.61 1.36 27.08 1.31 31.37 1.85 29.28 1.78 28.08 1.79 MRPD\u2217(Ours) 31.50 1.74 31.28 1.76 30.95 3.03 30.88 1.43 30.56 1.51 29.87 1.53 30.61 1.17 30.42 1.41 29.81 1.18 31.42 1.70 31.25 1.80 30.60 1.33 (2) Adapted U2MRPD v.s. dedicated supervised models. UNet\u2217\u2020 30.71 2.30 29.18 2.26 27.56 2.17 28.75 1.87 25.74 1.74 25.14 1.80 27.76 1.41 24.54 1.32 23.91 1.28 27.67 1.55 24.13 1.40 23.70 1.40 DuDoRNet\u2217\u2020 32.94 3.09 30.87 2.67 28.94 2.30 32.42 2.67 28.05 2.12 26.87 2.12 34.21 1.96 28.03 1.54 25.33 1.35 35.05 2.69 28.44 1.90 26.84 1.52 U2MRPD\u2217(Ours) 31.50 1.74 31.28 1.76 30.95 1.82 31.62 1.54 30.61 1.38 30.10 1.55 31.68 1.23 31.10 1.25 30.30 1.24 32.48 1.38 31.95 1.40 31.17 1.40 \u2191SSIM(%) 5145 slices of (PD, Knee) 912 slices of (T1, Brain) 700 slices of (T2, Brain) 700 slices of (PD, Brain) Acceleration rate 4x 8x 12x 4x 8x 12x 4x 8x 12x 4x 8x 12x Zero Filling 85.12 5.35 83.23 6.54 82.32 7.05 75.86 5.72 75.36 6.87 75.37 7.03 77.40 2.87 77.30 2.87 77.26 2.72 86.73 2.36 77.00 3.36 77.02 3.42 TV\u2020 71.44 10.08 64.34 14.36 61.90 15.02 71.76 7.52 66.76 9.54 67.11 9.71 75.79 2.53 72.53 2.86 72.82 2.89 74.86 2.68 71.35 2.78 71.80 2.83 (1) Database-free and adapted U2MRPD on FastMRI v.s. dedicated models on FastMRI. UNet\u2020 88.99 5.07 85.63 6.53 82.82 6.96 73.55 5.68 75.01 7.07 74.94 7.30 80.54 2.44 79.23 2.43 74.94 7.30 78.93 2.87 77.61 3.14 78.94 2.87 DuDoRNet\u2020 90.94 5.48 87.29 7.04 84.41 7.44 72.77 5.76 70.85 7.87 70.15 9.04 77.31 3.55 75.98 3.83 76.63 2.80 72.29 4.10 70.83 4.72 70.37 4.73 DiffuseRecon\u2020 82.05 3.17 76.23 11.92 72.65 13.12 N/A N/A N/A N/A N/A N/A N/A N/A N/A Score-MRI\u2020 87.39 6.03 84.23 7.01 83.06 7.33 86.99 2.92 78.54 4.72 76.66 4.96 88.61 1.52 80.27 1.93 78.62 2.02 87.64 1.93 79.96 2.21 78.34 2.27 U2MRPD\u2217(Ours w/o MRAdapter) 85.62 2.87 83.97 2.90 82.51 8.65 92.07 2.90 87.16 4.01 84.18 4.74 93.69 1.60 89.48 2.35 86.53 2.52 94.06 1.67 89.77 2.11 87.48 2.47 U2MRPD\u2217(Ours) 86.60 2.89 85.98 2.92 85.41 8.86 93.38 7.22 92.47 16.05 91.33 17.34 94.15 11.91 93.56 12.86 92.93 13.52 94.74 11.46 94.15 12.16 93.44 12.72 (2) Adapted U2MRPD v.s. dedicated supervised models. UNet\u2217\u2020 88.99 5.07 85.63 6.53 82.82 6.96 88.06 3.09 85.38 2.05 83.22 4.73 87.97 2.18 85.38 2.05 83.73 2.11 87.59 2.48 85.27 2.39 84.26 2.39 DuDoRNet\u2217\u2020 90.94 5.48 87.29 7.04 84.41 7.44 87.94 5.41 84.41 4.74 85.13 5.09 97.25 1.02 92.11 2.13 86.91 2.13 97.41 1.08 92.40 2.18 90.27 2.43 U2MRPD (Ours)\u2217 86.60 8.35 85.98 8.56 85.41 8.86 93.91 3.83 94.15 2.66 91.67 4.16 94.94 3.44 94.18 3.61 93.38 3.72 95.45 3.35 94.75 3.47 93.92 3.59 table. Additionally, U2MRPD requires significantly less (or no if database-free) fine-tuning time6 than training an MRI diffusion model. Furthermore, both DiffuseRecon and Score-MRI struggle to maintain consistent image intensity under the Gaussian 2D masks, reflecting the prevalent color drifting issue of diffusion models (Lin et al., 2023). This problem is noticeable in Figure 3 and U2MRPD circumvents it with our designed phase-modulated control. 4.3. Ablation studies Design of MRSampler. We present an empirical evaluation of the MRI reconstruction process using MRSampler and various control mechanisms, either unitary or magnitudeonly, in Figure 4. Strong-to-mild control allows MRSampler to bypass local minima associated with hard consistency terms, resulting in faster convergence and superior performance compared to soft consistency terms alone. Psuedorandom Phase Modulation (PPM) improves the performance of both soft and hard control. Design of MRAdapter. We dissect the MRAdapter\u2019s architecture to ascertain the impact of selective tuning on its performance. We experiment with different configurations on the fastMRI knee dataset, specifically tuning the encoder and decoder components in isolation. In Table 4, we show 6Details can be found in Appendix A.6.3. Figure 4. Image reconstruction evolution during the guided diffusion process of our MRSampler and other controllers using unitary or magnitude-only constraints. (a) The evolution of PSNR and SSIM. (b)-(d) In each panel, the first row illustrates the evolution of clean image predictions \u02c6 x0(zt), while the second row depicts that of intermediate noisy images zt. 7 \fTitle Suppressed Due to Excessive Size Table 4. Ablation study on the design of our MRAdapter on the FastMRI knee dataset. Arch. 4x 8x PSNR (dB) SSIM (%) PSNR (dB) SSIM (%) Ori. VQGAN 30.88 1.63 85.62 8.23 30.26 1.63 83.97 8.41 Tune encoder 31.35 1.69 86.59 2.88 31.23 1.74 86.09 2.92 Tune decoder 31.31s 1.68 86.39 2.90 30.85 1.68 85.22 2.91 Ours 31.50 1.74 86.60 2.89 31.28 2.91 85.98 8.56 that while both strategies\u2014tuning the encoder alone and tuning the decoder alone\u2014yield improvements in PSNR and SSIM metrics, our integrated MRAdapter configuration achieves the highest performance. With singleor multiple-source MRI datasets: towards universal MRI reconstruction. We fine-tune VQGAN with different MRI datasets using our MRAdapter and validate our dual capacity to adapt to different data acquisition scenarios and to generalize to unseen data. Quantitative results of both the VQGAN reconstruction of fully-sampled MRI data and U2MRPD\u2019s reconstruction of undersampled MRI with 8\u00d7 a uniform 1D sampling mask are listed in Table 5. Direct conclusions from the table can be summarized as: (1) with singleor multiple-source MRI datasets, VQGAN\u2019s MRI reconstruction ability can be improved on all tested datasets, no matter in-domain or out-of-domain (Table 5, section 1, row None versus the other rows). (2) VQGAN\u2019s reconstruction ability can be boosted to a larger extent with MRI datasets closer to testing sets (Table 5, section 1, the diagonal) or larger (Table 5, section 1, row A and row BCD versus row B, row C, and row D) than outof-domain datasets or smaller datasets. (3) With singleor multiple-source MRI data, U2MRPD\u2019s reconstruction ability can be improved on all tested MRI datasets, no matter in-domain or out-of-domain (Table 5, section 2, row None versus the other rows). (4) U2MRPD\u2019s reconstruction ability can be boosted to a larger extent with MRI datasets closer to testing sets (Table 5, section 2, the diagonal) or larger (Table 5, section 2, row A and row BCD versus row B, row C, and row D) than out-of-domain datasets or smaller datasets. Combining two sections of Table 5, we observe a counterintuitive fact that the reconstruction of the ground truth MRI data is similar to or even worse than that of 8\u00d7 undersampled MRI (Table 5, differences between the same rows in section 1 and 2). It implies that lossy as VQGAN is, our MRSampler (Table 5, row None in section 1 and 2) and MRAdapter (Table 5, row A to BCD in section 1 and 2) can compensate for the information loss. The rationale behind this is that the classifier guidance (the soft DC term) corrects the reconstruction result on the pixel domain directly. The computed gradients can guide the latent-domain generator to generating pixel-domain consistent results. Universal MRI models that reconstruct MR images across different MRI\u2019s are highly desirable for efficient deployment on MRI machines (Liu et al., 2021). We notice U2MRPD\u2019s potential and provide more discussion in Appendix A.6.4. 5." + }, + { + "url": "http://arxiv.org/abs/2303.10611v2", + "title": "Rethinking Dual-Domain Undersampled MRI reconstruction: domain-specific design from the perspective of the receptive field", + "abstract": "Undersampled MRI reconstruction is crucial for accelerating clinical\nscanning. Dual-domain reconstruction network is performant among SoTA deep\nlearning methods. In this paper, we rethink dual-domain model design from the\nperspective of the receptive field, which is needed for image recovery and\nK-space interpolation problems. Further, we introduce domain-specific modules\nfor dual-domain reconstruction, namely k-space global initialization and\nimage-domain parallel local detail enhancement. We evaluate our modules by\ntranslating a SoTA method DuDoRNet under different conventions of MRI\nreconstruction including image-domain, dual-domain, and reference-guided\nreconstruction on the public IXI dataset. Our model DuDoRNet+ achieves\nsignificant improvements over competing deep learning methods.", + "authors": "Ziqi Gao, S. Kevin Zhou", + "published": "2023-03-19", + "updated": "2024-02-15", + "primary_cat": "eess.IV", + "cats": [ + "eess.IV", + "cs.CV" + ], + "main_content": "INTRODUCTION Magnetic resonance imaging (MRI) is a non-invasive and flexible imaging modality widely used in clinical practice. Complete K-space measurements lead to unbearable acquisition time while fewer measurements lead to aliasing and blurring in the image. Under-sampled MRI reconstruction aims to reconstruct the high-quality, clean MRI image from its low-quality, aliased counterpart. Previously, Compressed Sensing (CS) and Parallel Imaging (PI) accelerated MRI reconstruction 2-3 times. Since the revolutionary work [1], convolutional neural networks (CNN) have become the primary workhorse for under-sampled MRI reconstruction. As the success of Transformer [2] is now indisputable in computer vision, Transformer has shown great potential for undersampled MRI reconstruction as well [3, 4, 5, 6, 7]. Many methods [8, 9, 10] focus on adapting novel architecture designs of image-domain neural networks. Customizing conventional CNNs or ViT to MRI further benefits MRI reconstruction, including K-space data consistency (DC) [11, 12], dual-domain recurrent learning [13, 14], over-complete representation [15]. SwinMR [3] and DSFormer [4] pioneer Swin transformer [16] as a strong backbone in single-contrast and multi-contrast MRI reconstruction, respectively. ReconFormer [5] develops a recurrent pyramid Transformer. Feng et al. [6] proposed a task transformer network for joint MRI reconstruction and super-resolution. Among all SoTA methods, dual-domain networks show strong performance by considering MRI reconstruction in both image and K-space domains. DuDoRNet [14] presents a dual-domain [13] recurrent learning strategy and used a dilated residual dense CNN to eliminate non-local aliasing artifact in the image domain. DuDoCAF [7] leverages the query-key mechanism of MSA. Yet their models use the same networks for both domains, neglecting the distinct properties of image recovery and k-space recovery problem. In our study, (1) we analyze the feasibility of K-space interpolation from the perceptive of the receptive field; (2) we propose two novel domain-specific modules, including image-domain parallel local detail enhancement and k-space global initiation; and (3) extensive experiments on the public IXI-dataset validate the superiority of our model, DuDoRNet+, under multiple settings of MRI reconstruction including image-domain, dual-domain, and dual-domain undersampled MRI reconstruction guided by a reference protocol. 2. ANALYSIS AND METHOD 2.1. Problem Formulation Let ku \u2208Cmn and kf \u2208Cmn be the under-sampled and fully-sampled k-space signal respectively; iu \u2208Cmn, if \u2208 Cmn, and ir \u2208Cmn be the under-sampled, fully-sampled and reconstructed image signal respectively; M \u2208Rmn be the binary k-space mask for acceleration. The under-sampled MRI reconstruction can be formulated as an image recovery problem [1, 15, 17, 18, 3] with K-space arXiv:2303.10611v2 [eess.IV] 15 Feb 2024 \fDC as a regularisation term [11]: arg min \u03b8i \u0010 \u2225if \u2212Pi (iu; \u03b8i)\u22252 2 +\u03bb \u2225ku \u2212M \u2299F (Pi (iu; \u03b8i))\u22252 2 \u0011 , (1) where F is 2D discrete Fourier Transform and the approximation function Px(\u00b7; \u03b8x) is used to predict a reconstructed signal xr given its parameter \u03b8x and any under-sampled input. A few works [14, 13, 7] leverage the relationship between image and k-space domain using Fourier Transform pairs (F, F\u22121) and transform MRI reconstruction into a multivariable optimization problem described as arg min \u03b8i,\u03b8k \u0010 \u2225kf \u2212Pk (F (Pi (iu; \u03b8i)) ; \u03b8k)\u22252 2 + \r \rif \u2212Pi \u0000F\u22121 (Pk (ku; \u03b8k)) ; \u03b8i \u0001\r \r2 2 + \u03bb \r \rku \u2212M \u2299F \u0000Pi \u0000F\u22121 (Pk (ku; \u03b8k)) ; \u03b8i \u0001\u0001\r \r2 2 \u0011 , (2) and solve it using a dual-domain recurrent learning strategy [14]. Yet most of existing works design the approximation function Px(\u00b7; \u03b8x) using neural networks whose architectures mainly concentrate on the image recovery problem, neglecting the distinct properties of k-space recovery problem. We argue that a hand-crafted design on dual-domain approximation functions is crucial for solving this multivariable optimization problem since image and k-space bear different properties and the tasks in two spaces shall be distinct further. 2.2. Solving K-space recovery problem from the perspective of the receptive field Organs scanned by MRI (e.g brains, knees) are usually rich in contextual details, where a larger receptive field can improve the image reconstruction performance in general. On the other hand, undersampled MRI reconstruction is a K-space recovery problem and has been considered as a local interpolation in many CS algorithms [19]. However, when MRI is under-sampled with a higher rate, the average number of measurements in a fixed local region decreases. Consider a set of K-space measurements after accelerating MRI with rate a using 1D Cartesian sampling pattern. Conventionally, a central fraction of K-space measurements called auto-calibration region is fully sampled, accounting for a fraction of Racs; while the other measurements are sampled randomly. For the non-calibration measurements, the feasibility of interpolation depends on the number of k-space scanning lines in a reachable local region K of size k \u2217k, in which the minimal number of data points is two. The probability P of a feasible interpolation is P = 1 \u2212(p)k \u2212Ck 1 (p)k\u22121(1 \u2212p), (3) Fig. 1. Probability of a feasible interpolation P w.r.t. the size of receptive field and acceleration rate a when Racs=0.125. where p is the possibility that none of the K-space lines are measured, determined by Racs and a: p = 1 \u2212 1 a \u2212Racs 1 \u2212Racs . (4) An illustration of the distribution of P w.r.t (K, a) given a fixed Racs is shown in figure 1. When accelerating with high rate (> 4), the probability of feasible interpolation is lower than 50% with , not to say a successful interpolation. Using ConvNets for MRI reconstruction [15] [14] can achieve large receptive field by upsampling, dilation convolution or large kernels. However, dilation convolution does not lead to an increase of lower bound for doing interpolation in k-space since dilation increases receptive field with aligned atrous part. Upsampling heavily burdens the GPU. Also, piling up large convolution kernels harms model convergence. 2.3. Method We choose a SoTA dual-domain MRI reconstruction model DuDoRNet [14] for evaluating our domain-specific designs. Our designs improve its dual domain recurrent blocks by customizing global and local structures based on domain-specific properties. Our model, DuDoRNet+, is illustrated in Figure 2, including domain-specific Shallow Feature Extraction (XSFE), Global Feature Refinement(GFR), and 4-stage domainspecific building blocks (X-Si) as the backbone. Global residual learning and global feature fusion in DuDoRNet are preserved in ours. The overall pipeline goes as follows: F\u22121 = Conv3(xu), F C 0 = Conv3(F\u22121). (5) where Convk denotes a convolution operation with kernel size k \u2217k and F\u22121 denotes the first extracted feature used for global residual learning. F C 0 denotes the intermediate extracted feature by convolution. The second extracted feature F0 is the input of X-Si. For image domain, F0 = F C 0 . \fX-SFE Undersampled I/K XS1 XS2 XS3 XS4 G F F GFR + Reconstructed I/K DRDB + I-PLDE I-Si Domain-specific Color Table K-SFE \ud835\udc65\ud835\udc62 Conv K-GLIM Conv \ud835\udc390 \ud835\udc65\ud835\udc62 \ud835\udc39\u22121 \ud835\udc39\u22121 \ud835\udc390 \ud835\udc39 1 \ud835\udc392 \ud835\udc393 \ud835\udc39 4 \ud835\udc39\ud835\udc3a\ud835\udc39\ud835\udc39 \ud835\udc65\ud835\udc5f \ud835\udc39\u22121 \ud835\udc39\ud835\udc56\u22121 \ud835\udc39\ud835\udc56 \ud835\udc39\ud835\udc56 \ud835\udc36\ud835\udc38 I-PLDE \ud835\udc39\ud835\udc56\u22121 \ud835\udc39\ud835\udc56 \ud835\udc36\ud835\udc38 1x1Conv SiLU DConv SiLU DConv SiLU DConv LayerNorm CW-MSA + + FFN LayerNorm \ud835\udc390 \ud835\udc390 \ud835\udc36 \ud835\udc390 \ud835\udc36 K-GLIM Domain-agnostic Fig. 2. Framework of a recurrent block in DuDoRNet+. It is constructed by a domain-specific Shallow Feature Extraction (X-SFE), Global Feature Refinement(GFR) and 4-stage domain-specific building blocks(X-Si). Building blocks\u2019 color follow the notation in the color table. Convolution is followed by ReLU unless noted. For K-space, a Global Initiation Module (K-GLIM) is introduced based on the idea of a sketchy K-space initiation: F0 = PK\u2212GLIM(F C 0 ) = PK\u2212GLIM(Conv3(F\u22121)). (6) Global Feature Fusion (GFF) fuses features from X-BB\u2019s and is input for global residual learning: Fi = PX\u2212Si(Fi\u22121), (7) xr = PGF R(F\u22121 + PGF F (concat(F1, F2, F3, F4))), (8) where GFF consists of 1x1 and 3x3 convolutions and GFR consists of two 3x3 convolutions, creating the refined reconstructed image/K-space xr. 2.3.1. K-GLIM: K-space global initiation We propose K-space global initialization module (K-GLIM) placed at the beginning of the K-space network. K-GLIM is applied on the transformed features of two convolution layers in SFE, providing channel-wise interaction and a global view. The main part of K-GLIM is a Channel-wise Multi-head Self-attention (C-MSA). Instead of performing pixel-level or patch-level attention in a conventional spatial attention way, C-MSA is performed on the transpose of pixel-level tokens. Similar to MSA, C-MSA is an extension of Self-Attention (CSA) in which h times SA operations are done. C-SA can be expressed as zc j = X i Softmax \u0012QT K \u221a d \u0013 i V T i,j, (9) and its computational complexity is O(6(hw)C2), linear to (hw). C-MSA naturally captures global information and interactions for visual recognition tasks and complements (windowed-)spatial attention. Compared with channel-wise convolution, it is data-specific and fine-grained. 2.3.2. I-PLDE: Image parallel local detail enhancement Recovering high-quality images from undersampled MRI measurements can be divided into two sub-tasks in the image domain: artifact removal and detail refinement. The former requires large receptive field due to the global property of signal aliasing, yet the latter task is much more a local task. Since the receptive field of a network enlarges with stacked convolutions, the detail refinement ability is possibly harmed with features propagating. To this end, we propose the I-PLDE module, a parallel branch emphasizing local detail, inspired by the \u201cdivide-andconquer\u201d idea in [20, 21]: modeling locality and long-range dependencies in parallel and fusing the features to account for both. Depthwise convolution .Different from ViTAE, we adopt stage-level parallel connection and use sequential dilated convolution (DRDB) for pyramid feature extraction instead of multiple parallel dilated convolution of different dilation rates. This design is customized to tiny models since a wide network design leads to a less stable training process and lower feature representation ability. I-PLDE consists of a 1x1 convolution to match the hidden dimension with its parallel branch, three stacked depth-wise convolution layers, and a window embedding operation. SiLU is used for non-linear activation following the convention in [20, 21]. The output of I-PLDE F CE i is added with DRDN\u2019s output. ViTAE\u2019s design is not successful in our scenarios since the tiniest model it constructs has about 5 times the parameters of ours and different availability of large datasets. 3. EXPERIMENT 3.1. Dataset and training Our evaluation is carried out on the Multi-Contrast IXI dataset1. We use all 575 subjects with paired T2-PD and uniformly sample 14 slices from each subject volume. We split the dataset patient-wise into training, validation and testing set with a ratio of 7 : 1 : 2, corresponding to 5628 training images, 812 validation images, and 1610 test images each protocol. Images are center-cropped from 256x256 to 224x224. Code is written in Pytorch and experiments are performed using an NVIDIA GeForce RTX 3090. As for the rest, we follow the same experiment settings in DuDoRNet [14]. 3.2. Performance evaluation We compare our methods with other baseline deep learning methods in three conventions of MRI reconstruction: image-domain [22, 14, 23, 15, 3], dual-domain [22, 14, 4] and reference-protocol-guided dual-domain reconstruction [24, 23, 14, 4, 7]. Considering backbone design, [23, 24] adopt Dense-Unet; [4, 7, 3] share similar Swin-Transformer 1https://brain-development.org/ixi-dataset/, CC BY-SA 3.0 license \fAcceleration 4x 8x PSNR SSIM MSE PSNR SSIM MSE Zero Padding 25.17\u00b11.80 80.20\u00b16.34 223.51 24.16\u00b11.79 79.90\u00b16.37 282.28 Unet 31.73\u00b11.98 95.48\u00b12.12 53.03 26.98\u00b12.01 91.43\u00b13.75 157.41 Dense-Unet 32.49\u00b12.23 96.47\u00b11.79 46.10 27.70\u00b11.97 92.16\u00b13.50 132.27 OUCR 32.52\u00b12.26 96.57\u00b11.76 45.90 27.80\u00b12.00 92.33\u00b13.44 129.40 SwinIR 32.75\u00b12.27 96.69\u00b11.71 43.60 27.78\u00b12.08 92.49\u00b13.45 130.76 DuDoRNet I 32.95\u00b12.28 96.75\u00b11.69 41.82 28.00\u00b12.04 92.76\u00b13.32 123.94 Ours I 33.01\u00b11.98 96.80\u00b11.59 40.36 28.02\u00b12.04 92.80\u00b13.36 122.78 Dual-DenseUnet 32.76\u00b12.22 96.67\u00b11.65 43.21 27.68\u00b11.93 91.99\u00b13.45 131.75 Dual-SwinIR 33.37\u00b12.44 97.09\u00b11.57 38.86 27.73\u00b12.02 92.16\u00b13.50 131.70 DuDoRNet(w/ ref) 33.00\u00b12.31 96.81\u00b11.63 41.46 27.84\u00b12.05 92.24\u00b13.46 128.73 Ours (w/ ref) 33.43\u00b12.40 97.02\u00b11.59 35.84 28.13\u00b12.10 92.68\u00b13.41 125.27 DuDoRNet 40.45\u00b12.59 99.26\u00b10.51 7.86 38.38\u00b12.52 98.93\u00b10.72 12.52 Ours 40.59\u00b12.55 99.29\u00b10.50 7.61 38.46\u00b12.52 98.96\u00b10.69 12.00 Table 1. Quantitative comparison (PSNR(dB), SSIM(%), MSE(*1e-5)) with baseline methods on the IXI-dataset. The first, second and third part correspond to image-domain reconstruction of PD, dual-domain reconstruction of PD and dual-domain reconstruction of PD with a reference protocol T2. The best results are marked as red. backbones derived from SwinIR [16]. All models besides UNet [22] have \u22481M parameters and UNet has 2M. All models are recurred twice and a DC is added at the end of each recurrent block. The recurrent time of local residual blocks in OUCR [15] is set to 5, complying with their default setting; yet DCs at the end of their local recurrent structure are discarded while those at the end of their global recurrent structure are preserved for fairness. All models are trained for 100 epochs and the hyper-parameters of each method are tuned on the validation set with test data held out for final evaluation. We consider 1D Cartesian sampling pattern with an acceleration rate ranging from 4 to 8; the center sampling fraction Racs is set to 0.125. Peak signal-to-noise ratio (PSNR) and structural similarity index (SSIM) are used as the quantitative evaluation metrics. 3.3. Results on undersampled MRI reconstruction In Table 1, we demonstrated PD reconstruction evaluations using \u00d74, \u00d78 acceleration in three common approaches of MRI reconstruction: image-domain, dual-domain, and T2guided dual-domain MRI reconstruction. The best results under the same setting and acceleration rate are colored with red. Our method achieves the best performances under all settings and acceleration rates. 3.4. Ablation Study We examine I-PLDE and K-GLIM on undersampled PD reconstruction without reference guidance. For each component, we apply it to image-domain and dual-domain subsequently. If there is a performance drop in either way, we apply it on K-space only to observe the performance. The reason for 4x PD Domain(s) to put the module Modules Image K-space Both K-GLIM I-LDE PSNR, SSIM PSNR,SSIM PSNR, SSIM DuDoRNet 33.00, 96.81 DuDoRNet w/ \u2713 32.89, 96.57 33.37, 96.87 33.34, 96.84 DuDoRNet w/ \u2713 33.16,96.83 32.76, 96.79 33.11, 96.83 Ours \u2713 \u2713 33.43,97.02 Table 2. Domain-wise quantitative evaluation (PSNR, SSIM(%)) of hybrid structure and domain-specific modules. The best results are marked as red. this design is that we weigh the utility of the image recovery network and the synergy between image and K-space reconstruction networks over K-space reconstruction since the image recovery network alone gives better results than K-space recovery network thus a default choice when reconstructing in a single domain. As shown in Table 2, applying them to the other domain leads to performance drops. 4." + }, + { + "url": "http://arxiv.org/abs/2211.16771v1", + "title": "Handling Missing Data via Max-Entropy Regularized Graph Autoencoder", + "abstract": "Graph neural networks (GNNs) are popular weapons for modeling relational\ndata. Existing GNNs are not specified for attribute-incomplete graphs, making\nmissing attribute imputation a burning issue. Until recently, many works notice\nthat GNNs are coupled with spectral concentration, which means the spectrum\nobtained by GNNs concentrates on a local part in spectral domain, e.g.,\nlow-frequency due to oversmoothing issue. As a consequence, GNNs may be\nseriously flawed for reconstructing graph attributes as graph spectral\nconcentration tends to cause a low imputation precision. In this work, we\npresent a regularized graph autoencoder for graph attribute imputation, named\nMEGAE, which aims at mitigating spectral concentration problem by maximizing\nthe graph spectral entropy. Notably, we first present the method for estimating\ngraph spectral entropy without the eigen-decomposition of Laplacian matrix and\nprovide the theoretical upper error bound. A maximum entropy regularization\nthen acts in the latent space, which directly increases the graph spectral\nentropy. Extensive experiments show that MEGAE outperforms all the other\nstate-of-the-art imputation methods on a variety of benchmark datasets.", + "authors": "Ziqi Gao, Yifan Niu, Jiashun Cheng, Jianheng Tang, Tingyang Xu, Peilin Zhao, Lanqing Li, Fugee Tsung, Jia Li", + "published": "2022-11-30", + "updated": "2022-11-30", + "primary_cat": "cs.LG", + "cats": [ + "cs.LG" + ], + "main_content": "Introduction Graph attribute missing is ubiquitous due to messy collection and recording process (Yoon, Davtyan, and van der Schaar 2016; Roth 1994). In a biochemical scenario, for instance, data is missed due to the dif\ufb01culties in measuring or calculating quantitative molecular properties (e.g., HOMO and LUMO orbital energy) at the atomic level (Yomogida et al. 2012; Salomon et al. 2003), attenuating the graph or node representations when we introduce a graph model for molecules. For graph learning tasks, even a small fraction of missing attributes will potentially interfere with the performance, leading to biased inferences (Sterne et al. 2009; Wooldridge 2007). Graph Neural Networks (GNNs) have demonstrated powerful ability on various graph-related tasks. Most GNNs consist of two parts: feature propagation and transformation. The former is the key to the success of GNNs as it can yield suitable spectral responses for graph desires (Li et al. 2022). For example, graph convolutional networks (GCN) (Kipf and Welling *Corresponding author. Copyright \u00a9 2023, Association for the Advancement of Arti\ufb01cial Intelligence (www.aaai.org). All rights reserved. Figure 1: Spectral visualization of GAE. Red histograms show the graph spectra. After GAE encoder (GCN), spectral concentration appears in the latent space. Upon MLP decoder, the spectral concentration is not alleviated. 2017) applies a recursive aggregation mechanism for updating node representations, leading to the low-frequency concentration from a spectral view (Wu et al. 2019; Donnat et al. 2018; Tang et al. 2022). The mechanism makes GCN effective for numerous real-world applications as low-frequency concentration promotes the convergence of representations of adjacent nodes (Nt and Maehara 2019; Xu et al. 2020). However, this spectral concentration diminishes partial eigenvalues, i.e., spectral values. As a consequence, it causes serious performance degradation on the standard graph attribute imputation models such as graph autoencoders (GAEs) (Li et al. 2020; Park et al. 2019; Li et al. 2021). In Figure 1, we visualize the graph spectra of the input, latent and output based on GAE (Kipf and Welling 2016), which is the backbone of most GAEs. As the \ufb01gure makes clear, existing GAEs leave suf\ufb01cient room for improvement to combat the loss of spectral components. Delving into graph attribute reconstruction, a natural question arises: how can GAEs impute with alleviated spectral concentration? In this work, inspired by the maximum entropy principle (Narayan and Nityananda 1986; Burch, Gull, and Skilling 1983; Frieden 1972) that is capable to alleviate concentrated data distributions, we propose to maximize the graph spectral entropy for mitigating spectral concentration while imputaarXiv:2211.16771v1 [cs.LG] 30 Nov 2022 \ftion. We present a novel method for graph attribute imputation called Max-Entropy Graph AutoEncoder (MEGAE). Unlike existing imputation methods, our model trains a GAE with the regularization for maximizing the graph spectral entropy. However, when it comes to the computation of graph spectral entropy, it becomes challenging due to large time complexity of the eigen-decomposition for Laplacian matrix (Cai, He, and Han 2007a,b; Jia et al. 2016). In this regard, we design the tight wavelet kernels (Shuman et al. 2015; Leonardi and Van De Ville 2013; Ahmad and Sheikh 2018) in MEGAE to encode features into the spectral domain involving several spectral bands. We then theoretically prove that the proposed wavelet paradigm can well approximate the actual graph spectral entropy by a predictable upper error bound without eigen-decomposition. Upon entropy regularized latent representations, we use symmetric wavelet decoder to perform data deconvolution for reconstructing graph attributes. In the experiments, we proceed with an empirical evaluation of MEGAE on singleand multi-graph datasets. Firstly, we show that MEGAE outperforms 16 state-of-the-art methods on attribute imputation tasks, including commonly used classical methods and graph learning based imputation methods. Additional downstream experiments of graph and node classi\ufb01cations demonstrate that imputed graphs by MEGAE can obtain the best accuracy performance when compared to state-of-the-art imputation models. Contributions. We summarize our contributions below: \u2022 We propose to maximize the graph spectral entropy to overcome the spectral concentration issue in GAEs for graph attribute reconstruction. \u2022 We present Max-Entropy Graph AutoEncoder (MEGAE) for encoding graphs into spectral domain and maximizing the spectral entropy in the latent space. \u2022 We develop an ef\ufb01cient method for approximating the actual graph spectral entropy without eigen-decomposition, and importantly, provide the theoretical upper error bound. 2 Related Work Matrix Completion. Missing data is a widely researched topic. Matrix completion methods can be applied to impute graph attributes without using the graph structures. Most proposed methods impute with a joint distribution on the incomplete data. For instance, the joint modeling methods impute by drawing from the predictive distribution, including Bayesian strategies (Murray and Reiter 2016), matrix completion methods (Cand\u00e8s and Recht 2009; Hastie et al. 2015), and Generative Adversarial Networks (Yoon, Jordon, and Schaar 2018; Yoon and Sull 2020). Another way of joint modeling involves iteratively imputing values of each variable using chained equations (Van Buuren and Groothuis-Oudshoorn 2011) formulated with other variables (White, Royston, and Wood 2011; Van Buuren 2018; Muzellec et al. 2020). Discriminative models such as random forests (Xia et al. 2017), distribution constraints using optimal transport (Muzellec et al. 2020) and causally-aware imputation (Kyono et al. 2021) tend to depend on strong assumptions, which may result in a lack of \ufb02exibility to handle mixed-mode data. Most importantly, as for graph scenarios, matrix completion methods are generally limited without awareness of the underlying graph structures. Attribute Imputation with Graph Learning. Recently, graph learning models have been used to tackle the imputation task. GC-MC (Berg, Kipf, and Welling 2017) and IGMC (Zhang and Chen 2019) construct helpful bipartite interaction graphs to impute with a given adjacency matrix as side information. Then a GAE is applied to predict the absent features. Gaussian mixture model is utilized for imputation stability under a high missing rate (Monti et al. 2017). GRAPE (You et al. 2020) combines imputation and representation learning, which can well impute features of continuous variables but tend not to perform well on datasets containing nodes with all features missed (Tu et al. 2021). GDN (Li et al. 2021) can impute from over-smoothed representations with a given graph structure. In this case, relationships between nodes are explicitly encoded for further imputation. Above methods show that graph learning is competent for feature reconstruction with structure dependencies. Notably, only GRAPE, GDN and our method are applicable to both discrete and continuous features. Despite both GDN and our method focus on mechanistic improvements for existing GAEs, we explore GAEs with a more general phenomenon of concentration in a spectral view and not just for recovering high-frequency details. 3 Preliminary In this section, we provide the formulation of graph attribute imputation problem in Section 3.1. Then we introduce the regularized object, named graph spectral entropy in Section 3.2. In Section 3.3, we describe wavelet entropy, a core concept for ef\ufb01ciently approximating the graph spectral entropy. 3.1 Problem Formulation For an undirected graph G = (A, X), A \u2208RN\u00d7N is the adjacency matrix and X \u2208RN\u00d7D is a complete feature matrix where Xij denotes the graph attribute of i-th node in the j-th feature dimension. In the problem of graph attribute imputation, R \u2208{0, 1}N\u00d7D is de\ufb01ned as the mask matrix whose element Rij = 1 if Xij is observed and Rij = 0 otherwise. The objective of this work is to predict the missing graph attributes Xij at Rij = 0. Formally, we aim to develop a mapping f(\u00b7) to generate the imputed data matrix \u02dc X \u2208 RN\u00d7D de\ufb01ned as \u02dc X = f(X, R, A). (1) 3.2 Graph Spectral Entropy The graph Laplacian is de\ufb01ned as L = I \u2212\u02dc A, where \u02dc A = D\u22121 2 AD\u22121 2 denotes the normalized adjacency matrix and D = diag(P k A1k, ..., ANk) denotes the diagnoal degree matrix. With eigen-decomposition, L can be decomposed into L = U T \u039bU, where U consists of the eigenvectors of L. \u039b = diag(\u03bb) is the diagonal matrix whose diagonal \fFigure 2: (a) The proposed MEGAE for graph attribute imputation. With tight wavelet \ufb01lters, the encoder \ufb01lters the input graph into \u02c6 g1(L)X, ..., \u02c6 gM(L)X (M = 3 here), of which the energies (i.e., blue, orange and green bars) are obtained with the L-2 norm function. We maximize wavelet entropy of M energies, which are encouraged to be more uniform in distributions. This wavelet entropy maximization induces the same tendency to maximization for the real graph spectral entropy. We apply inverse wavelet \ufb01lters to decode the data from the latent (spectral) space for \ufb01nal reconstruction. (b) A diagram to explain the Coverage and Crossness of given tight wavelet \ufb01lters. We provide related descriptions in Section 4.1. elements \u03bb = {\u03bb1, ..., \u03bbN} are eigenvalues of L. Consider a feature vector x = {x1, ..., xN}\u22ba\u2208RN as a single feature dimension of the whole matrix X, the Fourier transform \u02c6 x = U T x = {\u02c6 x1, ..., \u02c6 xN}\u22bawould be the most proven method for representing spectrum, of which the entropy is de\ufb01ned as graph spectral entropy in De\ufb01nition 3.1. De\ufb01nition 3.1 (Graph Spectral Entropy). Given the feature vector x, its spectral energy at \u03bbi is denoted as \u02c6 x2 i and total energy is Es = PN i=1 \u02c6 x2 i = \r \rU T x \r \r2 2. Then, the graph spectral entropy of x is de\ufb01ned as \u03bes(x, L) = \u2212 N X i=1 \u02c6 x2 i Es log \u02c6 x2 i Es . Intuitively, maximizing graph spectral entropy would ensure the spectral distribution to be relatively more uniform and keep information in any spectral pass-band, as opposed to spectral concentration in existing GAEs (Park et al. 2019; Wu et al. 2019). However, one notable issue with the computation of graph spectral entropy is that eigen-decomposition is indispensable, which largely limits the scalability for computing on large-scale data matrix. 3.3 Wavelet Entropy We introduce wavelet theory for approximating the graph spectral entropy with wavelet transform. Unlike Fourier transform that we formulate in section 3.2, wavelet transform (Xu et al. 2019; Hammond, Vandergheynst, and Gribonval 2011) is able to cover ranges of spectra via different pass-band kernels \u02c6 g = {\u02c6 g1, .., \u02c6 gM}. It shows the possibility of representing graph spectral entropy by wavelet entropy with well-calibrated kernels. The wavelet transform employs a set of M wavelets as bases, de\ufb01ned as W = {W\u02c6 g1, ..., W\u02c6 gM }. Mathematically, the wavelet transform of x is de\ufb01ned as W\u02c6 gm(x) = U\u02c6 gm(\u039b)U T x, (2) where \u02c6 gm(\u00b7) is a wavelet kernel function de\ufb01ned in spectral domain. For computational ef\ufb01ciency, in many cases, kernel function \u02c6 gm should be smooth and easily approximated by polynomials such that U\u02c6 gm(\u039b)U T = \u02c6 gm(L). De\ufb01nition 3.2 (Wavelet Entropy). Given the feature vector x and a set of wavelet kernel functions \u02c6 g = {\u02c6 g1, ..., \u02c6 gM}, the total wavelet energy of x is Ew = PM m=1 \u2225W\u02c6 gm(x)\u22252 2. Then, the wavelet entropy of x is de\ufb01ned as \u03bew(x, L, \u02c6 g) = \u2212 M X m=1 \u2225W\u02c6 gm(x)\u22252 2 Ew log \u2225W\u02c6 gm(x)\u22252 2 Ew . 4 Maximizing Graph Spectral Entropy This section describes our main contributions. Following our motivation to ef\ufb01ciently maximize the graph spectral entropy while imputing missing attributes, we propose an alternative method for approximating the graph spectral entropy without eigen-decomposition and provide the upper bound for approximation error. On this basis, we propose our model called Max-Entropy Graph AutoEncoder (MEGAE). 4.1 Graph Wavelet for Approximation In this section, we present our main idea that graph spectral entropy can be well approximated by wavelet entropy. To achieve the goal, the crucial issue is how to construct a rough spectral space for approximation with the ef\ufb01cient graph convolutions. De\ufb01nition 4.1 (Tight Wavelet Frame on Graph). A set of wavelet kernel functions \u02c6 g = {\u02c6 g1, ..., \u02c6 gM} forms a tight \fframe on graph if G(\u03bbi) := M X m=1 [\u02c6 gm(\u03bbi)]2 = 1, \u2200\u03bbi \u2208\u03bb. Inspired by the fact that tight wavelet frame can ensure energy preservation (De\ufb01nition 4.1) in graph signal processing (Leonardi and Van De Ville 2013), we can smoothly deduce a key connection between wavelet energy (formulated in Section 3.3) and graph spectral energy (formulated in Section 3.2), which are both key components in the respective wavelet and spectral entropy. Proposition 4.2 describes this connection, indicating that the total wavelet energy is strictly equivalent to the total graph spectral energy. The proof is trivial and illustrated in Appendix A. Proposition 4.2 (Energy Parseval\u2019s Identity). If \u02c6 g is a tight wavelet frame, the total wavelet energy Ew is equivalent to total graph spectral energy Es. Thus, the Parseval\u2019s identity holds for the spectral domain, that is Ew = Es. The wavelet energy consists of M energy components and each of them is derived from the \ufb01ltered graph features by a wavelet kernel. Therefore, intuitively, a more distinguishable kernel function tends to provide accurate approximation of graph spectral entropy. To quantify the kernel distinguishability of tight wavelet, we de\ufb01ne Coverage Cm and Crossness Ri. Formally, Cm is the number of spectrum covered by kernel function \u02c6 gm denoted as Cm = # {i|\u02c6 gm(\u03bbi) \u0338= 0, i = 1, ..., N}, (3) and Ri is the number of activated kernel functions on \u03bbi represented by Ri = # {m|\u02c6 gm(\u03bbi) \u0338= 0, m = 1, ..., M}. (4) A toy example is provided in Figure 2(b) for easier understanding. Coverage C3 represents the number of eigenvalues (i.e., \u03bb4, \u03bb5, \u03bb6) lying within the domain of 3rd wavelet kernel (i.e., the green curve). The Crossness R2 represents number of intersection (red) points of all three wavelet kernels and line \u03bb = \u03bb2. Proposition 4.3 (Approximation of graph spectral entropy). If \u02c6 g is a tight frame, the approximation error between graph spectral entropy \u03bes(x, L) and wavelet entropy \u03bew(x, L, \u02c6 g) is bounded by |\u03bes(x, L) \u2212\u03bew(x, L, \u02c6 g)| \u2264e(\u02c6 g, \u03bb) where e(\u02c6 g, \u03bb) = max({log Cm}M m=1 \u222a{log Ri}N i=1). Please see Appendix B for the proof. To better understand Proposition 4.3, let N = M and all kernels be disjoint, which means the number of wavelet kernels equals to the number of nodes in the graph. In this perfect situation, one kernel function only covers one eigenvalue (i.e., Coverage Cm = 1) and one eigenvalue is only covered by one kernel function (i.e., Crossness Rm = 1). Then, the approximation error is zero. For applying a tight wavelet frame with high distinguishability, we follow the mechanisms in (Shuman et al. 2015) to design a set of wavelet kernel function g = {\u02c6 g1, ..., \u02c6 gM}. The design details are in Appendix C. 4.2 The Proposed MEGAE Based on the designed tight wavelet kernels, we propose MEGAE, a deterministic graph autoencoder framework for graph missing attribute imputation. As demonstrated in Figure 2, MEGAE consists of two key modules: (1) wavelet based graph autoencoder and (2) maximum entropy regularization. Encoder. With the de\ufb01nitions of an undirected graph provided in Section 3, we employ M tight wavelet kernels described in Section 4.1 in parallel to perform graph wavelet convolution. Speci\ufb01cally, the convolutional layer of m-th channel is expressed as E1(Z(0) m , L, \u02c6 gm) = \u03c6(W\u02c6 gm(Z(0) m )W (0) m ), (5) where Z(0) m = X \u2299R and \u03c6(\u00b7) is the activation function such as leaky ReLU. To admit a fast algorithm for wavelet transform, Maclaurin series approximation (Li et al. 2021) of order K is applied such that W\u02c6 gm(Z(0) m ) = PK k=0 \u03b1m,kLkZ(0) m . We introduce one more layer of perceptron to enrich the representation in latent space, denoted as E2(Z(1) m ) = \u03c6(Z(1) m W (1) m ). (6) The Encoder is thus formulated as Z(1) m = E1(Z(0) m , L, \u02c6 gm), Z(2) m = E2(Z(1) m ). (7) Decoder. Given the observed information, our decoder aims to impute missing values from latent space. As the inverse of graph wavelet convolution, the graph wavelet deconvolutional layer of m-th channel is expressed as D1(Z(2) m , L, \u02c6 g\u22121 m ) = \u03c6(W\u02c6 g\u22121 m (Z(2) m )W (2) m ), (8) where W\u02c6 g\u22121 m (Z(2) m ) = PK k=1 \u03b2m,kLkZ(2) m is provided by Maclaurin series. We then aggregate results generated by M channels to construct the imputation layer as D2(Z(3) 1 , ..., Z(3) M ) = \u03c6(Z(3) AGGW (3)), (9) where Z(3) AGG = AGG([Z(3) 1 , ..., Z(3) M ]) and AGG(\u00b7) denotes aggregation function such as concatenation. The Decoder is thus formulated as Z(3) m = D1(Z(2) m , L, \u02c6 g\u22121 m ), \u02dc X = D2(Z(3) 1 , ..., Z(3) M ). (10) Optimization. Our network is jointly optimized with respect to two objectives. We start from the imputation precision, which is the main focus in missing data problem. Intuitively, the reconstruction loss is de\ufb01ned as LR = \r \r \r( \u02dc X \u2212X) \u2299(1N\u00d7D \u2212R) \r \r \r 2. (11) Given our imputation motivation, MEGAE introduces spectral entropy regularization to aid data imputation. Based on the discussion in Section 4.1, graph spectral entropy can be well substituted by wavelet entropy. Let Z(2) m (:, d) be the d-th \fMethods ENZYMES PRO_full QM9 Synthie FRANKE FIRST_DB ENZYMES PRO_full RMSE with 0.1 missing features ACC. ACC. MEAN 0.0602 0.0653 0.2983 0.2063 0.3891 0.1500 62.06% 69.96% KNN 0.0350 0.0329 0.3058 0.1718 0.2010 0.1296 63.53% 72.23% SVD 0.0783 0.0465 0.2524 0.1697 0.2766 0.1685 61.60% 71.16% MICE 0.0292 0.0210 0.1986 0.1899 0.1359 0.1036 64.46% 73.50% GAIN 0.0300 0.0245 0.1973 0.1649 0.1103 0.0909 64.42% 73.21% OT 0.0323 0.0206 0.2003 0.1865 0.1116 0.0892 64.13% 73.62% MIRACLE 0.0288 0.0188 0.1846 0.1632 0.1196 0.0889 65.03% 74.07% GraphVAE 0.0357 0.0199 0.1579 0.1898 0.1099 0.1202 63.46% 73.86% MolGAN 0.0326 0.0160 0.1478 0.1864 0.1078 0.1379 64.16% 74.20% GRAPE 0.0302 0.0147 0.1869 0.1798 0.1069 0.0986 64.48% 74.53% GDN 0.0267 0.0155 0.1598 0.1764 0.1066 0.0869 65.57% 74.50% Inv_GCN 0.0256 0.0135 0.1773 0.1446 0.1089 0.1032 66.00% 74.98% Inv_MLP 0.0254 0.0129 0.1499 0.1520 0.1064 0.0872 66.06% 75.07% MEGAE 0.0223 0.0099 0.1396 0.1203 0.0936 0.0789 66.27% 75.97% Performance gain 0.0044 | 0.0560 0.0048 | 0.0554 0.0082 | 0.1662 0.0429 | 0.0860 0.0128 | 0.2955 0.0080 | 0.0896 0.70% | 4.67% 1.44% | 6.01% Table 1: RMSE results on 6 multi-graph datasets and graph classi\ufb01cation accuracy on two datasets. After running 5 trials, we report the mean results of which the best method is bolded and the second best is underlined. Performance gains indicate the maximum (lower) and minimum (upper) gains of state-of-the-art (MEGAE) compared to other baselines. Note that we abbreviate \u2019PROTEIN_full\u2019, \u2019FRANKENSTEIN\u2019 and \u2019FIRSTMM_DB\u2019 to \u2019PRO_full\u2019, \u2019FRANKE\u2019 and \u2019FIRST_DB\u2019, respectively. dimension of Z(2) m , the graph spectral entropy loss is thus de\ufb01ned as LS = \u22121 D D X d=1 M X m=1 P d m log P d m, (12) where P d m = \r \r \rZ(2) m (:, d) \r \r \r 2 2 PM m=1 \r \r \rZ(2) m (:, d) \r \r \r 2 2 . (13) Finally, by combining the aforementioned losses, the overall objective function of MEGAE is formulated as L = LR \u2212\u03b3LS, (14) where \u03b3 is a hyperparameter to balance the regularization of graph spectral entropy and reconstruction loss. 5 Experiments In this section, we validate the performance of MEGAE using a variety of datasets. We evaluate the effectiveness of MEGAE on two categories of graph datasets: \u2022 Type 1: Imputation on multi-graph datasets. We impute the missing graph attributes on multi-graph datasets, e.g., molecules, proteins. In addition, we report graph classi\ufb01cation performance on graphs with imputed features. \u2022 Type 2: Imputation on single-graph datasets. We impute the missing values on single-graph datasets, e.g., social network. We report node classi\ufb01cation performance on the graph with imputed features. 5.1 Imputation on Multi-graph Datasets. Datasets. We conduct experiments on 6 benchmark datasets (Morris et al. 2020) from different domains: (1) bioinformatics, i.e., PROTEINS_full (Borgwardt et al. 2005) and ENZYMES (Schomburg et al. 2004); (2) chemistry, i.e., QM9 (Ramakrishnan et al. 2014) and FIRSTMM_DB (Neumann et al. 2013); (3) computer vision, i.e., FRANKENSTEIN (Orsini, Frasconi, and De Raedt 2015); (4) synthesis, i.e., Synthie (Morris et al. 2016). The detailed statistics is provided in Table 6 in Appendix E.1. Baselines. We compare the performance of MEGAE against baselines in three categories: (1) statistical imputation methods including MEAN, KNN (Zhang 2012) and SVD (Troyanskaya et al. 2001); (2) deep learning-based imputation models including MICE (Van Buuren and GroothuisOudshoorn 2011), GAIN (Yoon, Jordon, and Schaar 2018), OT (Muzellec et al. 2020) and MIRACLE (Kyono et al. 2021); (3) graph learning-based models including GraphVAE (Simonovsky and Komodakis 2018), MolGAN (De Cao and Kipf 2018), GRAPE (You et al. 2020) and GDN (Li et al. 2021). For further details, please refer to Appendix E.3. Setup. We use a 70-10-20 train-validation-test split and construct random missingness only on the test set. Each run has a different dataset split and the mask for feature missingness. After running for 5 trials, we report the Root Mean Squared Error (RMSE) results for imputation and mean accuracy on the test set for graph classi\ufb01cation. For all baselines, we use a 2-layer GCN for downstream classi\ufb01cation. For more setup details, please refer to Appendix E.2. Results. In Table 1 we show the experiment results for 10% of missing features. Results indicate that our method has the lowest RMSE in the 5 real-world datasets and the synthetic \fMethods PubMed (RMSE) AmaPhoto (RMSE) 0.1 Miss 0.3 Miss 0.5 Miss 0.7 Miss 0.99 Miss 0.1 Miss 0.3 Miss 0.5 Miss 0.7 Miss 0.99 Miss sRMGCNN 0.0170 0.0186 0.0258 0.0309 0.0435 0.3191 0.3261 0.3282 0.3359 0.3660 GC-MC 0.0220 0.0233 0.0253 0.0270 0.0403 0.3154 0.3221 0.3340 0.3574 0.3913 GRAPE 0.0187 0.0198 0.0234 0.0303 0.0368 0.3207 0.3295 0.3357 0.3489 0.3896 VGAE 0.0196 0.0229 0.0298 0.0354 0.0525 0.3064 0.3196 0.3462 0.3684 0.3991 GDN 0.0168 0.0202 0.0239 0.0254 0.0319 0.3006 0.3168 0.3308 0.3372 0.3617 MEGAE 0.0157 0.0171 0.0185 0.0199 0.0218 0.2966 0.3121 0.3204 0.3243 0.3305 Performance gain 0.0011 | 0.0063 0.0015 | 0.0062 0.0049 | 0.0113 0.0055 | 0.0155 0.0101 | 0.0307 0.0040 | 0.0241 0.0047 | 0.0174 0.0078 | 0.0258 0.0116 | 0.0441 0.0312 | 0.0686 Table 2: Mean RMSE results of attribute imputation with different missing rates on PubMed and AmaPhoto. Methods PubMed (Acc. = 77.11% with full features) AmaPhoto (Acc. = 92.03% with full features) 0.1 Miss 0.3 Miss 0.5 Miss 0.7 Miss 0.99 Miss 0.1 Miss 0.3 Miss 0.5 Miss 0.7 Miss 0.99 Miss GCNMF 75.96% 74.42% 74.03% 70.09% 41.46% 91.64% 91.46% 91.05% 90.16% 73.03% PaGNN 76.55% 75.77% 74.45% 72.15% 43.63% 91.81% 91.70% 91.02% 90.12% 71.51% sRMGCNN 75.96% 74.74% 72.79% 71.14% 21.17% 91.36% 91.19% 91.02% 90.12% 66.56% GC-MC 74.44% 74.06% 72.87% 72.67% 36.69% 91.46% 91.26% 90.22% 89.82% 60.13% GRAPE 75.53% 74.51% 73.65% 71.75% 38.18% 91.22% 91.05% 90.33% 89.63% 68.28% VGAE 75.21% 73.69% 71.64% 69.96% 16.66% 91.53% 91.43% 89.23% 88.82% 63.24% GDN 75.87% 74.22% 73.36% 73.15% 38.93% 91.83% 91.63% 91.10% 90.01% 66.62% MEGAE 76.66% 76.30% 75.03% 74.47% 49.58% 91.92% 91.85% 91.41% 90.58% 81.88% Performance gain 0.11% | 1.45% 0.53% | 2.61% 0.58% | 3.39% 1.32% | 4.51% 5.95% | 32.92% 0.09% | 0.70% 0.15% | 0.80% 0.31% | 2.18% 0.42% | 1.76% 8.85% | 21.75% Table 3: Test accuarcy with different missing rates on PubMed and AmaPhoto node classi\ufb01cation benchmarks. dataset. Moreover, almost all graph learning-based methods outperform non-graph learning ones, demonstrating the effectiveness of modeling the dependencies between graph nodes. In addition, we introduce two more baselines \u2013 Inv_MLP denotes our tight wavelet encoder with Multi-Layer Perceptron (MLP) decoder (Simonovsky and Komodakis 2018) and Inv_GCN denotes our encoder with GCN decoder (Kipf and Welling 2017). MEGAE achieves 12.4% lower RMSE than the second best baselines on average over all the datasets. For a more comprehensive and realistic consideration for missing mechanisms, we provide the evaluation (see Figure 4 in Appendix F) for evaluating MEGAE in two less common scenarios. We obtain similar gains across three missing machanisms, MEGAE obtains the lowest errors in all cases, which shows the strong generalization among the three missing mechanisms. As for downstream classi\ufb01cations, we show the test accuracy of different models on imputed graph features with 10% missing. We observe that smaller imputation errors are more likely to lead to higher test accuracy. This is relatively expected, as data with less distribution shift easily yields better representation. MEGAE outperforms all other baselines on accuracy conditioning on the effectiveness imputation results. 5.2 Imputation on Single-graph Datasets. Dataset. We evaluate the effectiveness of MEGAE on four commonly used datasets including three citation network datasets\u2014Cora, Citeseer, Pubmed (Sen et al. 2008) and a copurchase network dataset\u2014AmaPhoto (McAuley et al. 2015). We show the dataset statistics in Table 7 in Appendix E.1. Baselines. We compare the imputation performance of MEGAE against competitive methods including sRMGCNN (Monti, Bronstein, and Bresson 2017), GCMC (Berg, Kipf, and Welling 2017), GRAPE (You et al. 2020), VGAE (Kipf and Welling 2016) and GDN (Li et al. 2021). For evaluating node classi\ufb01cation performance of MEGAE, we additionally experiment with GCNMF (Taguchi, Liu, and Murata 2021) and PaGNN (Jiang and Zhang 2020) that directly implement graph learning without imputation. For further information, please refer to Appendix E.3. Setup. We closely follow (Kipf and Welling 2017) to perform standard dataset split. For all datasets, each run has a different train-validation-test split and the mask for random missingness across all feature dimensions. After running for 5 trails, we report the results of mean RMSE for imputation and mean accuracy on the test set for node classi\ufb01cation. For all baselines, we use a 2-layer GCN for downstream classi\ufb01\fcation. For more setup details, please refer to Appendix E.2. Results. Table 2 shows the mean RMSE results for imputation under different missing rates on PubMed and AmaPhoto, we also provide the results on Cora and Citeseer in Table 8 in Appendix. MEGAE consistently outperforms other baselines. Moreover, MEGAE tends to have greater performance gains when faced with a more severe missingness, which demonstrates MEGAE\u2019s robustness. It is noteworthy that under an extremely high missing rate (0.99), MEGAE obtains margins of 31.66% on PubMed, 8.63% on AmaPhoto, 34.24% on Cora and 19.54% on Citeseer compared to the second best imputation methods. In Table 3, we show the mean accuracy for node classi\ufb01cation on PubMed and AmaPhoto with imputed attributes (results on Cora and Citeseer are in Table 9 in Appendix). We observe that most methods work well with less than 0.3 missing rates. Moreover, MEGAE\u2019s robustness and effectiveness are better as its accuracy gains tend to be positively correlated with missing rates. With the consistent imputation improvements on all datasets, MEGAE has accuracy gains of 5.95% on PubMed, 8.85% on AmaPhoto, 7.90% on Cora and 6.97% on Citeseer under a 0.99 missing rate. 5.3 Effectiveness of Wavelet and Regularization Graph Wavelet Autoencoders. We study the role of tight wavelet frames with the con\ufb01guration of regularization in MEGAE. Another two paradigms are deployed to get wavelet frames \u02c6 g = {\u02c6 g1, ..., \u02c6 gM}, including GWNN (Xu et al. 2019) with heat kernels and SGWT (Hammond, Vandergheynst, and Gribonval 2011) with highly-localized kernels. Dataset GWNN SGWT Ours ENZYMES +0.0042 +0.0044 0.0223 PROTEINS_full +0.0070 +0.0052 0.0099 QM9 +0.0102 +0.0166 0.1396 Synthie +0.0203 +0.0126 0.1203 FRANKENSTEIN +0.0103 +0.0185 0.0936 FIRST_DB +0.0036 +0.0073 0.0789 Table 4: RMSE with three graph wavelet paradigms. We report the mean RMSE of MEGAE and show the increase w.r.t. RMSE of GWNN and SGWT compared to ours. Here we provide experiments on 6 multi-graph datasets under 0.1 missing rate (in Table 4), reporting the increases w.r.t. RMSE using another two graph wavelet paradigms compared to ours, all three wavelet paradigms have 9 channels. Also, we execute experiments on 2 datasets (in Figure 3) assembling various channel numbers on three graph wavelet paradigms. Three paradigms all share the same computational complexity O(K \u00d7 |E|), where K is the order of polynomials and |E| is the number of edges. Table 4 veri\ufb01es the effectiveness of the proposed tight wavelet kernels. Figure 3 shows the in\ufb02uence of the number of wavelet kernels M. We observe that a larger M value harms the performance of GAEs with GWNN and SGWT paradigms. As for our proposed MEGAE, the RMSE \ufb01rst drops and then increases along w.r.t. the number of wavelet kernels, which shows there is a tradeoff between entropy approximation error and model generalization. Figure 3: RMSE with different numbers of wavelet kernels. We show how the kernel number in\ufb02uences the performance of GAEs with different wavelet paradigms. Entropy Regularization. We study the role of entropy regularization with the con\ufb01guration of tight wavelet in MEGAE. We execute experiment on 6 datasets under 10% missing rates. In Table 5 we provide the increase of RMSE by removing entropy regularization and the change in graph spectral entropy w.r.t. the original graph spectral entropy (denoted as \u2206). We observe that GAE without regularization will seriously lead to a decrease in spectral entropy (i.e., aforementioned spectral concentration) of the imputed graphs, and more importantly, LS improves the performance of the proposed MEGAE with a substantially maintenance of the real entropy. Dataset LR \u22061 LR + LS \u22062 ENZYMES +0.0069 -29% 0.0223 +3% PROTEINS_full +0.0061 -26% 0.0099 +2% QM9 +0.0188 -18% 0.1396 -1% Synthie +0.0316 -23% 0.1203 +3% FRANKENSTEIN +0.0229 -33% 0.0936 -2% FIRSTMM_DB +0.0086 -21% 0.0789 -2% Table 5: RMSE with/without entropy regularization. \u22061 and \u22062 denote the entropy changes with/without the regularization w.r.t. the original graph spectral entropy. Discussion. The effectiveness of our proposed tight wavelet and entropy regularization has been shown in Table 4 and Table 5, from which we can easily \ufb01nd that both have obvious improvements for decreasing imputation errors. Importantly, we believe the entropy regularization contributes the most to the performance of MEGAE. By analogizing MEGAE to the variational autoencoders, we provide intuitions on why MEGAE works (see Appendix D). 6" + } + ], + "Zijing Liu": [ + { + "url": "http://arxiv.org/abs/2102.12342v1", + "title": "Similarity measure for sparse time course data based on Gaussian processes", + "abstract": "We propose a similarity measure for sparsely sampled time course data in the\nform of a log-likelihood ratio of Gaussian processes (GP). The proposed GP\nsimilarity is similar to a Bayes factor and provides enhanced robustness to\nnoise in sparse time series, such as those found in various biological\nsettings, e.g., gene transcriptomics. We show that the GP measure is equivalent\nto the Euclidean distance when the noise variance in the GP is negligible\ncompared to the noise variance of the signal. Our numerical experiments on both\nsynthetic and real data show improved performance of the GP similarity when\nused in conjunction with two distance-based clustering methods.", + "authors": "Zijing Liu, Mauricio Barahona", + "published": "2021-02-24", + "updated": "2021-02-24", + "primary_cat": "cs.LG", + "cats": [ + "cs.LG", + "cs.IR", + "stat.ML" + ], + "main_content": "INTRODUCTION Time course data are used widely for the empirical study of dynamical processes in many areas of research in the natural and social sciences [Keogh and Kasetty, 2003]. Traditionally, much research has been devoted to the characterisation of time series in relation to the originating dynamical process from different viewpoints, from the deterministic to the stochastic [Brillinger, 1981, Barahona and Poon, 1996, Chat\ufb01eld, 2003]. More recently, time series have also been considered from the perspective of data science. One of the key questions in many applications is to assess the (dis-)similarity between time courses, with a view to perform time series classi\ufb01cation or clustering [Liao, 2005, Son and Baek, 2008, G\u00f3recki, 2014, Peach et al., 2019, Fulcher and Jones, 2014]. A simple way to deal with \ufb01nite, discretely-sampled time courses is to treat them as vectors [Yao et al., 2005, Hedeker and Gibbons, 2006], i.e., a time series sampled at t time points {yi(tk) := yik}t k=1 is described by a t-dimensional vector yi with coordinates yik. A simple dissimilarity measure between two time series yi and yj is then given by the Euclidean (\u21132) distance: d2(yi,yj) = s t \u2211 k=1 \u0000yik \u2212yjk \u00012 = \u2225yi \u2212yj\u2225. (1) Alghouth the Euclidean distance is widely used due to its simplicity, in some applications, one may be more interested in the trend of how the data changes across time rather than the absolute differences. To capture this, a frequently used dissimilarity measure is based on Pearson\u2019s correlation coef\ufb01cient, ryiy j: dcorr(yi,yj) = 1\u2212ryiyj = 1\u2212 \u2211t k=1(yik \u2212yi)(yjk \u2212yi) p \u2211t k=1(yik \u2212yi)2 q \u2211t k=1(yjk \u2212yj)2 , where yi and yj are the means of each time series. Note that these two common measures are point-to-point matching, and insensitive to the re-ordering of the time points and the spacing between the sampling times. Hence these measures cannot capture information associated with the time indices, which can be important in applications. To remedy the limitations of point-wise measures, alternative measures of dissimilarity in time series have been proposed, including Dynamic Time Warping (DTW) [Keogh and Ratanamahatana, 2005] and the Edit Distance on Real Sequences (EDR) [Chen et al., 2005]. These methods can cope with uneven sampling and use information from the time indices, yet they can be algorithmically complex and are not well suited for applications with a large number of short, sparsely sampled time courses. Examples of this type of data are common in home price, marketing or ecommerce data in economics and \ufb01nance [Fan et al., 2011], longitudinal electronic healthcare records in healthcare [Perotte and Hripcsak, 2013], genomics and proteomics data in life science [Ndukum et al., 2011, Kayano et al., 2016], and functional magnetic resonance imaging [Smith, 2012]. For instance, in cellular biology, \u2018omics\u2019 experiments measure This is a preprint. arXiv:2102.12342v1 [cs.LG] 24 Feb 2021 \fthe expression level of large numbers of genes, proteins or metabolites in cells over time. Such datasets contain tens of thousands of time courses (i.e., the number of genes or proteins) but the length of each time course is very short (5-15 time points) due to the high cost of experiments. Furthermore, the time samplings are usually uneven since experiments are designed to capture trends in cellular evolution and responses to stimuli. These constraints are typical of many biological experimental settings. In this paper, we introduce a similarity measure for time course data based on Gaussian processes (GPs) [Rasmussen and Williams, 2006], which is applicable to sparse, inhomogeneously sampled, high-dimensional datasets. To retain information from the sampling times in the data, we model the time courses as continuous functions using GPs, and de\ufb01ne a similarity measure in the form of a log-likelihood ratio between GP models. The GP similarity is computationally simple and suitable for high-dimensional datasets with a large number of short time courses. We also show that the GP similarity measure is equivalent to the Euclidean distance when the noise variance in the GP model is negligible compared to the signal variance. We apply the GP similarity measure as the basis for distance-based clustering methods in both synthetic and real time course data, and show improved robustness to measurement noise and to sampling inhomogeneity. 2 RELATED WORK As a non-parametric model, GP is a \ufb02exible and ef\ufb01cient tool for time-dependent data modelling. Using the fact that a GP de\ufb01nes a reproducing kernel Hilbert space (RKHS), Lu et al. [2008] proposed a RKHS-based distance for time series de\ufb01ned as the Bregman divergence between the two posterior GPs. This distance has a closed form: it is the squared norm of the posterior mean functions in the RKHS induced by the GP. However, the Bregman divergence does not re\ufb02ect the uncertainty of the data, since it only depends on the posterior mean function. Hence the Bregman divergence can perform poorly in the presence of noise in the data, as we show below. GPs have been previously applied to time series of gene expression to detect differentially expressed genes [Stegle et al., 2010, Kalaitzis and Lawrence, 2011] and to infer the dynamics of transcriptional regulation [Lawrence et al., 2007, Gao et al., 2008]. In Kalaitzis and Lawrence [2011], the \ufb01tted GP model for each gene is compared to a noise model in order to rank the time courses and \ufb01nd differentially expressed genes. Here, we use the construction of GPs differently, and show that the likelihood ratio between two GP models provides a robust similarity measure for time courses. In the next section, we will introduce the GP model for time course data. 3 GAUSSIAN PROCESS MODEL FOR TIME COURSE DATA A Gaussian process is a collection of random variables over the index set X such that any \ufb01nite collection of the random variables follows a multivariate normal distribution [Rasmussen and Williams, 2006]. Therefore, a Gaussian process, denoted GP(m(x),k(x,x\u2032)), is characterised by the mean function m(x) and the covariance function k(x,x\u2032), where x,x\u2032 \u2208X. Here we will consider time-dependent variables; hence the index set is the positive real line describing time: X = R+. We will model the underlying true signal as a Gaussian process over time: f(x) \u223cGP \u0000m(x),k(x,x\u2032) \u0001 . (2) For simplicity, we take the mean function to be zero (m(x) = 0) and we use the squared exponential covariance function k(x,x\u2032) = \u03c32 f exp \u0012 \u2212\u2225x\u2212x\u2032\u22252 2\u21132 \u0013 =: \u03c32 f G(x,x\u2032) (3) where \u2113is a characteristic length-scale, \u03c32 f is the signal variance and we use G(x,x\u2032) to denote the Gaussian kernel. The observations of the time-dependent variable are then noisy samples of the GP: y = f(x)+\u03b5, (4) where the additive noise \u03b5 is Gaussian with zero mean and variance \u03c32 n . Let us consider a time-dependent variable y given by (4) sampled at t time points X = [x1,...,xt]T and let us compile the observations into a t-dimensional vector y = [y1,...,yt]T. Under our assumptions, the covariance function of the noisy observations y is given by: ky(xp,xq) = \u03c32 f G(xp,xq)+\u03c32 n \u03b4pq, (5) where \u03b4pq is the Kronecker delta. Equivalently, the t \u00d7 t covariance matrix of the observations y is: Ky = \u03c32 f G+\u03c32 n I = K +\u03c32 n I, (6) where G is the Gaussian kernel matrix with elements Gpq = G(xp,xq), I is the identity matrix of dimension t, and K is the covariance matrix for the noiseless samples with elements Kpq = k(xp,xq). The three hyperparameters of the Gaussian process are therefore \u03b8 = (\u2113,\u03c3f ,\u03c3n), and can be learnt from the data (X,y) by maximising \u03b8 \u2217= argmax \u03b8 log p(y|X,\u03b8), (7) \fwhere, in this case, the log-marginal likelihood has the explicit form: log p(y|X,\u03b8) = \u22121 2 \u0000yTK\u22121 y y+logdetKy +t log2\u03c0 \u0001 , (8) with detKy denoting the determinant of Ky. This expression can be maximised using gradient-based methods [Rasmussen and Williams, 2006]. 4 SIMILARITY MEASURE FOR TIME COURSE DATA BASED ON GAUSSIAN PROCESS Let us consider a sparse time course dataset consisting N short time courses sampled at t time points: yi \u2208Rt, i = 1,...,N. The dataset is referred to as sparse, due to the fact that the number of time courses is much larger than the length of each time course (N \u226bt). Although the GP model does not require all the time series to be measured synchronously, for simplicity, we \ufb01rst introduce the similarity measure for the case where all time courses are sampled at the same time points X = [x1,...,xt]T. We discuss the asynchronous case later. Each of the time courses yi is assumed to correspond to a noisy observation of a Gaussian process (4) with the same hyperparameters \u03b8, which can be inferred by maximising the sum of the log marginal likelihoods of the time courses [Rasmussen and Williams, 2006]: \u03b8 \u2217= argmax \u03b8 N \u2211 i=1 log p(yi|X,\u03b8). (9) By inferring the hyperparameters \u03b8 \u2217, we obtain a nonparametric probabilistic model for the observed time courses, which we can use to de\ufb01ne a GP-based similarity measure, as follows. 4.1 LIKELIHOOD RATIO AS A SIMPLE GP SIMILARITY MEASURE Using the fact that the GP is a distribution of continuous functions over time, a similarity measure between two observed time courses yi and yj can be obtained by comparing two different possibilities as to how yi and yj could have been generated. The \ufb01rst possibility is that the two time samples yi and yj are observations from two different functions sampled from the GP. In this case, the joint likelihood of yi and y j is just the product of the likelihoods of two time courses: pdiff(yi,yj|\u03b8 \u2217) = p(yi|X,\u03b8 \u2217) p(yj|X,\u03b8 \u2217). (10) Using (8), it is easy to see that the log-likelihood can be rewritten as: log pdiff(yi,yj|\u03b8 \u2217) = log p(yi|X,\u03b8 \u2217)+log p(yj|X,\u03b8 \u2217) = \u22121 2 \u0002yT i yT j \u0003\u0014 Ky 0 0 Ky \u0015\u22121 \u0014 yi yj \u0015 \u22121 2 logdet \u0014 Ky 0 0 Ky \u0015 \u2212t log2\u03c0. (11) The second possibility is that yi and yj are observations from the same function sampled from the GP. In this case, the joint likelihood of yi and yj can be computed by considering the two time courses {X,yi} and {X,yj} to be replicate samples of one function : psame(yi,yj|\u03b8 \u2217) = p \u0012\u0014 yi yj \u0015\f \f \f \f \u0014 X X \u0015 ,\u03b8 \u2217 \u0013 , (12) and the log-likelihood is then given by: log psame(yi,yj|\u03b8 \u2217) = log p \u0012\u0014 yi yj \u0015\f \f \f \f \u0014 X X \u0015 ,\u03b8 \u2217 \u0013 = \u22121 2 \u0002yT i yT j \u0003\u0014 Ky K K Ky \u0015\u22121 \u0014 yi yj \u0015 \u22121 2 logdet \u0014 Ky K K Ky \u0015 \u2212t log2\u03c0, (13) where we have used the fact that the additive noise \u03b5 in (4) is uncorrelated between the two time courses. The likelihood (12) will be high if the two time courses are similar to each other (as in Fig. 1a), and will be small if the two time courses have different pro\ufb01les (as in Fig. 1b). Hence for time courses with different pro\ufb01les, the likelihood (10) explains better the data. The log of the ratio of the two likelihoods (12)\u2013(10) (i.e., the difference between the log-likelihoods) is thus an indicator of the level of similarity between two time courses. This leads to our de\ufb01nition of the GP similarity measure between yi and yj as: s(yi,y j) = log psame(yi,y j|\u03b8 \u2217) pdiff(yi,yj|\u03b8 \u2217) (14) and it follows that: s(yi,yj) = log psame(yi,yj|\u03b8 \u2217)\u2212log pdiff(yi,y j|\u03b8 \u2217) = 1 2 \u0002yT i yT j \u0003 \u0014 Ky 0 0 Ky \u0015\u22121 \u2212 \u0014 Ky K K Ky \u0015\u22121!\u0014 yi yj \u0015 \u22121 2 log detQ detKy , (15) where Q is the Schur complement: Q = Ky \u2212KK\u22121 y K. (16) Note that the likelihood ratio (14) has the same form as the Bayes factor [Kass and Raftery, 1995] in Bayesian model \f0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 t -1.5 -1 -0.5 0 0.5 1 1.5 2 y 95% confidence interval posterior mean time course 1 time course 2 (a) Two time courses with similar patterns and the corresponding GP. 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 t -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 y 95% confidence interval posterior mean time course 1 time course 2 (b) Two time courses with different patterns and the corresponding GP. Figure 1: Two examples with two time courses that have: (a) similar and (b) dissimilar pro\ufb01les. In each case, we show the time courses and the mean and con\ufb01dence interval of the Gaussian process (12) obtained according to the likelihood in (12). selection. From this perspective, our measure can be understood as the comparison between two models in two ways: on one hand, s(yi,yj) compares modelling two time courses with one single function of the GP versus modelling them with two independent functions of the GP; alternatively, it is easy to see that our measure (14) can be rewritten as s(yi,yj) = log p(yj|yi,X,\u03b8 \u2217)\u2212log p(yj|X,\u03b8 \u2217) = log p(yi|yj,X,\u03b8 \u2217)\u2212log p(yi|X,\u03b8 \u2217) which is the difference between the log-likelihood of yj based on the posterior GP given yi compared to the prior GP without yi being given. Hence the measure quanti\ufb01es the improvement in the prediction of y j that can be drawn by knowing yi. The measure is symmetric, so the same applies by exchanging yj for yi. 4.2 EUCLIDEAN DISTANCE AS A LIMIT OF THE GP LOG-LIKELIHOOD RATIO It can be shown that the Euclidean distance (1) stems naturally from the GP similarity (14) in the limit when the noise variance \u03c32 n is much smaller than the signal variance \u03c32 f . To see this, recall the Neumann series [Stewart, 1998] K\u22121 y = (K +\u03c32 n I)\u22121 = K\u22121 \u221e \u2211 m=0 (\u22121)m \u0000\u03c32 n K\u22121\u0001m . Noting that the Gaussian kernel matrix G is positive de\ufb01nite, we have that if \u03c32 n /\u03c32 f \u21920 = \u21d2\u2225\u03c32 n K\u22121\u2225= (\u03c32 n /\u03c32 f ) \u2225G\u22121\u2225\u21920, For small \u03c32 n /\u03c32 f , we thus take the \ufb01rst two terms of the expansion to O \u0000\u2225\u03c32 n K\u22121\u22252\u0001 : KK\u22121 y = K\u22121 y K \u2243I \u2212\u03c32 n K\u22121, (17) and the Schur complement (16) is approximated as: Q \u2243Ky \u2212(I \u2212\u03c32 n K\u22121)K = 2\u03c32 n \u0010 I \u22121 2\u03c32 n K\u22121\u0011 , Q\u22121 \u2243 1 2\u03c32 n \u0010 I + 1 2\u03c32 n K\u22121\u0011 . To approximate the GP similarity measure (15), we use block matrix inversion: \u0014 Ky 0 0 Ky \u0015\u22121 \u2212 \u0014 Ky K K Ky \u0015\u22121 = \u0014\u2212K\u22121 y KQ\u22121KK\u22121 y Q\u22121KK\u22121 y K\u22121 y KQ\u22121 \u2212K\u22121 y KQ\u22121KK\u22121 y \u0015 \u2243 1 2\u03c32 n \u0014 \u2212(I \u22123\u03c32 n K\u22121/2) I \u2212\u03c32 n K\u22121/2 I \u2212\u03c32 n K\u22121/2 \u2212(I \u22123\u03c32 n K\u22121/2) \u0015 = \u22121 2\u03c32 n \u0014 1 \u22121 \u22121 1 \u0015 \u2297I \u22121 2 \u0014 3 \u22121 \u22121 3 \u0015 \u2297 \u0000\u03c32 n K\u22121\u0001 ! . and we approximate the determinant: detQ = detKy det \u0000I \u2212(KK\u22121 y )2\u0001 \u2243detKy det \u00002\u03c32 n K\u22121\u0001 , whence we obtain: s(yi,yj) \u2243 \u22121 4\u03c32 n \u0002yT i yT j \u0003 \u0014 1 \u22121 \u22121 1 \u0015 \u2297I \u2212\u03c32 n 2\u03c32 f \u0014 3 \u22121 \u22121 3 \u0015 \u2297G\u22121 !\u0014 yi y j \u0015 \u22121 2 logdet 2 \u03c32 n \u03c32 f G\u22121 ! . Here \u2297denotes the Kronecker product and G is the Gaussian kernel matrix in (6). The approximation of the GP similarity measure (15) to \ufb01rst order is then : s(yi,yj) \u2243\u22121 4\u03c32 n \u2225yi \u2212yj\u22252 +O \u03c32 n \u03c32 f \r \rG\u22121\r \r !! . (18) Therefore, if \u03c32 n /\u03c32 f \u21920 (i.e., when the variance of the noise is much smaller than the signal variance), the dissimilarity measure \u2212s(yi,yj) is equivalent to the Euclidean distance \u2225yi \u2212yj\u22252. Note that this relationship holds not only for the Gaussian kernel G(x,x\u2032) but for any positive de\ufb01nite kernel. \f4.3 ASYNCHRONOUS TIME COURSES Although, for simplicity of exposition, we have concentrated on the case of synchronous time sampling, the GP similarity measure is equally applicable to non-synchronous samples. In our derivations above, synchronous time points are only necessary to obtain the formal limit to the Euclidean distance in Eq. 18. To see the applicability to non-synchronous samples, note that the likelihoods in Eq. 13 and Eq. 11 do not require the time courses to have the same time points. We can therefore consider N time courses denoted by yi = [yi,1,\u00b7\u00b7\u00b7 ,yi,ti] of length ti, sampled at (potentially) distinct time points Xi = [xi,1,\u00b7\u00b7\u00b7 ,xi,ti] (i = 1,...,N). In this case, we can similarly model the time courses with GP and learn the hyperparameters by maximising \u03b8 \u2217= argmax \u03b8 N \u2211 i=1 log p(yi|Xi,\u03b8), (19) and it is then easy to write the two log-likelihoods: log pdiff(yi,yj|\u03b8 \u2217) = log p(yi|Xi,\u03b8 \u2217)+log p(yj|Xj,\u03b8 \u2217) = \u22121 2 \u0002yT i yT j \u0003\u0014Kyi 0 0 Ky j \u0015\u22121 \u0014 yi yj \u0015 \u22121 2 logdet \u0014Kyi 0 0 Ky j \u0015 \u22121 2(ti +tj) log2\u03c0, (20) log psame(yi,yj|\u03b8 \u2217) = log p \u0012\u0014 yi yj \u0015\f \f \f \f \u0014 Xi Xj \u0015 ,\u03b8 \u2217 \u0013 = \u22121 2 \u0002yT i yT j \u0003\u0014Kyi Ki j KT i j Ky j \u0015\u22121 \u0014 yi yj \u0015 \u22121 2 logdet \u0014Kyi Ki j KT i j Ky j \u0015 \u22121 2(ti +tj) log2\u03c0. (21) where Kyi and Ky j are the covariance matrices of yi and yj with sizes ti \u00d7ti and tj \u00d7t j, respectively; and Kij is the cross-covariance matrix between yi and yj with size ti \u00d7 tj. The GP similarity between the two time courses can again be computed as the difference between the two loglikelihoods (20) and (21). 4.4 COMPUTATIONAL COMPLEXITY In terms of computational complexity, \ufb01tting a GP model with N time courses of length t takes O(t3 + Nt2) time. Computing pairwise similarities takes O(tN2) time. Since we deal with high-dimensional short time courses (N \u226bt), the total time for GP similarity would be approximately O(tN2), which is the same as for the Euclidean distance. Extra computational time is needed for the asynchronised time courses, where all the time courses have a different covariance matrix. It results in a computational time of O(Nt3) for model \ufb01tting and O(N2t3) for computing the pairwise GP similarity if all the time courses are of average length t. This might be a limitation to applications with large N and t. 5 NUMERICAL EXPERIMENTS To test the applicability of the proposed GP similarity measure, we have run numerical experiments on synthetic and real sparse time course data. Our results show that the similarity s(yi,yj) is more robust to observational noise than the Euclidean distance when used as the basis to cluster time courses using two standard clustering algorithms (hierarchical and spectral clustering). We also compare the performance of the GP similarity against the Bregman divergence and Dynamic Time Warping. 5.1 SYNTHETIC DATA Our synthetic dataset is obtained by sampling from the three different time pro\ufb01les shown in Fig. 2 with additive Gaussian noise. From each of the three time pro\ufb01les, we generate 50 evenly-sampled time courses of length t = 15 with a given level of sampling noise. Our task is to cluster the 150 time series into 3 groups in an unsupervised manner. To do this, we compute the pairwise similarities (or distances) between the 150 time courses using the GP similarity (14). From the computed similarity matrix, we then cluster the samples using two well-known methods: (i) spectral clustering with kNN graph (k = 7) [Yu and Shi, 2003]; (ii) agglomerative hierarchical clustering with average linkage [Rokach and Maimon, 2005]. We then repeat the numerical experiment 100 times in each case. To evaluate the clustering performance, we use the normalised mutual information (NMI) [Vinh et al., 2010] against the known ground truth 0 0.2 0.4 0.6 0.8 1 t -0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 y y=t+0.25t4 y=t-0.25t4 y=t sampling time points (even) sampling time points (uneven) Figure 2: The three functions and the sampling time positions used to generate the synthetic data. The results of even sampling are in Fig. 3. The results of uneven sampling are in Fig. 4. \f(i.e., the three pro\ufb01les used to generate the data). We then repeat the same procedure with three popular measures: the Euclidean distance, the Dynamic Time Warping (DTW) distance and the Bregman divergence in the RKHS. Given that the only varying ingredient is the similarity measure, the clustering performance re\ufb02ects the quality of the similarity measure for this purpose. Proposed Euclidean Bregman DTW Proposed Euclidean Bregman DTW 0 0.2 0.4 0.6 0.8 1 NMI noise=0.8 Spectral clustering Hierarchical clustering (a) Noise level = 0.08 Proposed Euclidean Bregman DTW Proposed Euclidean Bregman DTW 0 0.2 0.4 0.6 0.8 1 NMI noise=0.10 Spectral clustering Hierarchical clustering (b) Noise level = 0.10 Proposed Euclidean Bregman DTW Proposed Euclidean Bregman DTW 0 0.2 0.4 0.6 0.8 1 NMI noise=0.12 Spectral clustering Hierarchical clustering (c) Noise level = 0.12 Figure 3: Clustering performance (measured as NMI) for spectral clustering with kNN and hierarchical clustering based on the proposed GP similarity (14), Euclidean distance (1), DTW and Bregman divergence in the RKHS with increasing noise levels from (a)-(c). The sampling time points are equally spaced between 0 and 1 (see Fig. 2). Figure 3 shows the clustering quality (0 \u2264NMI \u22641) for evenly sampled time series with increasing levels of sampling noise achieved with both clustering methods and all four distance/similarity functions. As expected from (18), both Euclidean and GP similarity give comparable results for small sampling noise when using spectral clustering. Note, however, that even for small noise, the performance of the GP similarity is superior to the Euclidean distance when using hierarchical clustering (Fig. 3a), a method that is very sensitive to noisy data. Also as expected the DTW performs worse than the Euclidean distance for the synchronous case, since there is no need for alignment. The Bregman divergence does not perform well in this case because it measures the distance between the two continuous curves in the RKHS \ufb01tted from the time courses data and does not consider the uncertainty due to noise. As the observation noise increases, our GP similarity measure gains further advantage over the Euclidean distance for both clustering methods (Figs. 3b\u20133c). The p-values for a Wilcoxon rank-sum test between the NMI values of Euclidean and GP similarity with spectral clustering for the noise levels 0.08, 0.10 and 0.12 are 0.043, 2.5e-7 and 7.6e16, respectively. The p-values for a Wilcoxon rank-sum test between the NMI values of Euclidean and GP similarity with hierarchical clustering for the noise levels 0.08, 0.10 and 0.12 are 1.4e-15, 1.7e-25, and 1.1e-20, respectively. Hence the GP similarity measure performs signi\ufb01cantly better than the Euclidean distance for clustering with both algorithms. In general, spectral clustering always performs better than hierarchical clustering, which is more sensitive to noise, and the best performance is obtained consistently using spectral clustering with GP similarity. Note that the performance obtained with spectral clustering using other metrics can be achieved at a lower computational cost using hierarchical clustering with GP similarity. Proposed Euclidean Bregman DTW Proposed Euclidean Bregman DTW 0 0.2 0.4 0.6 0.8 1 NMI noise=0.08 Spectral clustering Hierarchical clustering (a) Noise level = 0.08 Proposed Euclidean Bregman DTW Proposed Euclidean Bregman DTW 0 0.2 0.4 0.6 0.8 1 NMI noise=0.10 Spectral clustering Hierarchical clustering (b) Noise level = 0.10 Figure 4: Clustering performance (measured as NMI) for spectral clustering with kNN and hierarchical clustering based on the proposed GP similarity (14), Euclidean distance (1), DTW and Bregman divergence in the RKHS with increasing noise levels from (a)-(b). In this case, the time points are irregularly sampled between 0 and 1 (see Fig. 2). The GP similarity consistently outperforms the other distances, especially for larger amounts of noise. We also analyse a second set of 150 time series of length t = 15 collected from the same three functions in Fig. 2 but sampled inhomogeneously in time. The computational procedure is identical to the case of evenly sampled series described above. Figure 4 shows that the advantage of the GP similarity measure against the other distances is more prominent when the time points are unevenly sampled. This result highlights the fact that point-to-point similarities (such \fas the Euclidean distance) can miss important information contained in the long-term trends of the time pro\ufb01les if the sampling is concentrated irregularly in particular time periods. We next tested the non-synchronous case. We again generate a set of 150 time series of length t = 15 from the same three functions in Fig. 2. We then make the asynchronous time courses by randomly removing 6,7 or 8 time points from our 15-point time course data (Fig. 5a). In this case, the Euclidean distance is not de\ufb01ned. The proposed GP similarity achieves substantially better results than the Bregman divergence and DTW on these examples. 0 0.5 1 t -0.2 0 0.2 0.4 0.6 0.8 1 y (a) asynchronous time course Proposed Bregman DTW Proposed Bregman DTW 0 0.2 0.4 0.6 0.8 1 NMI noise=0.08 Spectral clustering Hierarchical clustering (b) NMI results Figure 5: (a) Three sample time courses with asyncronised measurements with Noise level = 0.08. (b) Clustering performance (measured as NMI) for spectral clustering with kNN and hierarchical clustering based on the proposed GP similarity, DTW and Bregman divergence in the RKHS. The GP similarity consistently outperforms the other distances for both clustering methods. In summary, our numerical experiments on synthetic data indicate improved performance of the GP similarity measure (14). As the observational noise decreases, the performance of the GP similarity measure is equivalent to the Euclidean distance (18). Although the GP similarity shows enhanced performance for both clustering methods, the improvement is larger for hierarchical clustering, in the presence of large amounts of noise, and under uneven time sampling. As a side comment, we also note that the inclusion of the noise variance \u03c32 n in the covariance function Ky makes the GP similarity measure more robust for numerical computations, as it reduces numerical instability. 5.2 APPLICATION TO GENE EXPRESSION TIME COURSE DATA We next tested the GP similarity measure on a real time course dataset which characterises the gene expressions during the process of cellular reprogramming where differentiated cells are reverted to stem cells [Di Stefano et al., 2014b]. In this dataset, gene expression values were measured at \ufb01ve time points: 0, 2, 4, 6 and 8 days after the cellular reprogramming started. Two biological replicates were measured at each time point. The full measurements include around 40,000 genes. Following standard practice, we select 1912 genes that are highly variable over time. We then follow the same procedure as for the synthetic data above to cluster the 1912 gene expression time courses to extract groups of genes that have similar time pro\ufb01les during cellular reprogramming. 0 50 100 150 200 time (hour) 5 10 15 expression level Samd14 (a) Time course of gene Samd14 0 50 100 150 200 time (hour) 5 10 15 expression level Fbln5 (b) Time course of gene Fbin5 0 50 100 150 200 time (hour) 5 10 15 expression level Serpine1 (c) Time course of gene Serpine1 Figure 6: The time courses of three genes (each time course was measured on two bioogical replicates). The Euclidean distances from Samd14 to Fbin5 and Serpine1 are both 5.09. In contrast, the GP dissimilarity (\u2212s(yi,yj)) between Samd14 and Fbin5 (37.48) is larger than between Samd14 and Serpine1 (25.57), capturing the fact that the time pro\ufb01le of Serpine1 is more similar to Samd14 than to Fbin5. For this dataset, there is no known \u2018ground truth\u2019 against which to compare the obtained clusters. To assess the quality of the clustering, we use a biological score: a modi\ufb01ed \fTable 1: BHI z-scores of the two clustering methods with different number of clusters obtained by analysing the time courses of 1912 highly variable genes in the stem cell transcriptomic dataset of Refs. [Di Stefano et al., 2014a,b]. No. of clusters Method Similarity 9 11 13 15 16 Spectral Proposed 2.505 4.250 1.360 3.368 3.674 Euclidean 1.368 2.067 2.460 2.351 2.919 DTW 2.636 2.087 2.774 2.720 3.182 Bregman 4.229 2.725 2.652 3.617 3.520 Hierarchical Proposed 1.182 2.384 2.366 1.849 3.353 Euclidean -0.090 0.074 -0.266 -0.215 -0.319 DTW 0.542 0.566 0.499 0.735 0.752 Bregman 1.392 1.303 1.139 1.388 1.508 version of the biological homogeneity index (BHI). The BHI measures within-cluster homogeneity of the genes in terms of biological knowledge and is given by: BHI = 1 L L \u2211 l=1 1 nl(nl \u22121) \u2211 i\u0338=j i, j\u2208clusterl S(i, j), where L is the number of clusters, nl is the size of cluster l, and S(i, j) is a biological similarity between gene i and gene j. In the original BHI [Datta and Datta, 2006], the similarity between genes is either 0 or 1, which is an indicator function of two genes sharing any Gene Ontology (GO) terms. In order to better capture the biological information, we use an information-theoretic semantic gene similarity based on Gene Ontologies [Resnik, 1999, Lord et al., 2003, Yu et al., 2010]. For a given clustering, we compute the BHI of 1000 random clusterings with the same number and size of clusters. We then use the z-score of the BHI against the random clusterings as a level of signi\ufb01cance for the obtained clustering. Since the number of clusters is unknown, we compute the z-score of the BHI for clusterings with different numbers of clusters (Table 1). Again, we \ufb01nd that spectral clustering with GP similarity achieves the best performance. On the other extreme, hierarchical clustering based on Euclidean distances performs no better than random clustering, an indication that the gene expression data has high levels of noise \u03c3n. As was the case for the synthetic data above, using GP similarity improves the performance of hierarchical clustering substantially, almost to a comparable level to the spectral method (but below). These results underscore the ability of the GP similarity to deal with noisy data. To illustrate visually the behaviour of the GP similarity, Figure 6 shows the time courses of three genes where the GP similarity and Euclidean distance behave differently. In our chosen examples, the time course of the Samd14 gene (Fig. 6a) has the same Euclidean distance to both the Fbin5 gene (Fig. 6b) and the Serpine1 gene (Fig. 6c). On the other hand, according to our GP similarity, the Serpine1 time course is more similar to Samd14 than to Fbin5, in accordance with our visual expectation from the observed time course pro\ufb01les. The codes and data are available online in https: //github.com/barahona-research-group/ BayesFactorSimilarity. 6" + }, + { + "url": "http://arxiv.org/abs/1909.04491v2", + "title": "Graph-based data clustering via multiscale community detection", + "abstract": "We present a graph-theoretical approach to data clustering, which combines\nthe creation of a graph from the data with Markov Stability, a multiscale\ncommunity detection framework. We show how the multiscale capabilities of the\nmethod allow the estimation of the number of clusters, as well as alleviating\nthe sensitivity to the parameters in graph construction. We use both synthetic\nand benchmark real datasets to compare and evaluate several graph construction\nmethods and clustering algorithms, and show that multiscale graph-based\nclustering achieves improved performance compared to popular clustering methods\nwithout the need to set externally the number of clusters.", + "authors": "Zijing Liu, Mauricio Barahona", + "published": "2019-09-06", + "updated": "2020-01-13", + "primary_cat": "cs.IR", + "cats": [ + "cs.IR", + "cs.LG", + "physics.data-an", + "stat.ML" + ], + "main_content": "Introduction Clustering is a classic task in data mining, whereby input data are organised into groups (or clusters) such that data points within a group are more similar to each other than to those outside the group [1]. Such a task is distinct from supervised (or semi-supervised) classi\ufb01cation, where examples of the di\ufb00erent classes are known a priori and are used to train a computational model to assign other objects to the known groups. Instead, clustering aims to \ufb01nd natural, intrinsic sub-classes in the data, without assuming a priori the number or type of clusters. Indeed, a key open issue in this \ufb01eld is the principled determination of the number of clusters in an unsupervised manner, without the assumption of a generative model [2, 3]. The obtained groups can then constitute the basis for a simpler, yet informative, representation of large, complex datasets. Data clustering has a long history and there exist a myriad of clustering algorithms based on di\ufb00erent principles and heuristics [4]. In their most basic form, many popular clustering techniques (e.g., k-means [5] and mixture models [6]) are based on the assumption that the data follows an explicit (typically multivariate Gaussian) distribution. Clusters are then de\ufb01ned as the samples most likely generated from the same distribution, and learned by likelihood maximisation. However, in real applications, the model that generates the data is unknown and the resulting data distribution may be complex. In this case of data-driven analysis, model-based clustering often yields poor results [7, 8, 9, 10]. An alternative approach is provided by spectral clustering, which uses the eigenvectors of a (normalised) similarity matrix derived from the data to \ufb01nd relevant subgroups in the dataset [8, 11]. Spectral clustering is underpinned by results in matrix analysis (e.g., singular value decomposition), and has strong connections to model reduction, geometric projections and dimensionality reduction [11, 12]. The choice of similarity measure is a crucial ingredient to the clustering performance but, as long as a similarity matrix can be computed, spectral methods provide an attractive choice for non-vector data or for data sampled from irregular and non-convex data manifolds [13, 14]. From a di\ufb00erent perspective, the similarity matrix of a dataset can also be viewed as the adjacency matrix of a fully connected, weighted graph, where the nodes correspond to data points and the edge between two nodes is weighted by their similarity. One can then apply graph-based algorithms for community detection or graph partitioning to the problem of data clustering. Graph-based methods typically operate by searching for balanced graph cuts, sometimes invoking notions from spectral graph theory, i.e., using the spectral decomposition of the adjacency or Laplacian matrices of the graph [15, 16]. Spectral clustering can thus be understood as a special case of the broader class of graph-based clustering methods [12]. Importantly, 1 Department of Mathematics, Imperial College London, South Kensington Campus, London SW7 2AZ, UK 2 EPSRC Centre for Mathematics of Precision Healthcare, Imperial College London, London SW7 2AZ, UK \u2217m.barahona@imperial.ac.uk 1 arXiv:1909.04491v2 [cs.IR] 13 Jan 2020 \fgraph-based clustering is also able to reveal modular structure in graphs across levels of resolution through multiscale community detection [17, 18, 19]. This approach allows for the discovery of natural data clusterings of di\ufb00erent coarseness [20], thus recasting the problem of \ufb01nding the appropriate number of clusters to the detection of relevant scales in the graph. Methods for graph construction usually involve a sparsi\ufb01cation of the similarity (or distance) matrix under di\ufb00erent heuristics (from simple thresholding to sophisticated regularisations) in order to extract a similarity graph that preserves key properties of the dataset [21]. The representation of data through graphs has attractive characteristics, including the capability of capturing e\ufb03ciently the local and global properties of the data through graph-theoretical concepts that embody naturally the notions of local neighbourhoods, paths, and global connectivity [22, 23, 18]. The usage of graphs provides a natural links of spectral clustering with other clustering methods and allows for easy generalisation to a semi-supervised setting [24, 25]. Graphs also provide a means to capture the geometry of complex manifolds, a feature of interest in realistic datasets [26]. Graph representations not only reduce the computational cost for spectral graph methods, but also allow us to use the techniques developed for complex networks as an alternative to address problems in data clustering. However, it has been shown that both the method of graph construction and the choice of method parameters (i.e., sparsity) have a strong impact on the performance of graph-based clustering methods [27, 28, 29, 30]. Here, we study the use of multiscale community detection applied to similarity graphs extracted from data for the purpose of unsupervised data clustering. The basic idea of graph-based clustering is shown schematically in Figure 1. Speci\ufb01cally, we focus on the problem of assessing how to construct graphs that appropriately capture the structure of the dataset with the aim of being used within a multiscale graph-based clustering framework. In particular, we carry out an empirical study of di\ufb00erent graph construction methods used in conjunction with Markov Stability (MS), a dynamics-based framework for multiscale community detection [19, 31]. As a dynamics-based framework [31, 18, 31], MS provides a uni\ufb01ed framework for many multiscale community detection algorithms, such as the RB Potts model [32], the constant Potts model [33] and the absolute Potts model [34], and allows for the unsupervised community detection at di\ufb00erent levels of resolution. MS has also been shown to allow for the detection of both clique-like and nonclique-like communities in graphs [35]. MS has been applied successfully to a variety of problems, including protein structures [36, 37], airport networks [18], social networks [38] and neuronal network analyses [39]. Other dynamical processes have been extensively applied in network analysis, such as temporal networks [40], crowded networks [41] and network classi\ufb01cation [42]. In this paper, we evaluate several geometric graph constructions, from methods that use only local distances to others that balance local and global measures, and \ufb01nd that the recently proposed Continuous k-nearest Neighbours (CkNN) graph [43] performs well for graph-based data clustering via community detection. We then show how the multiscale capabilities of the Markov Stability to scan across scales can be exploited to deliver robust clusterings, reducing the sensitivity to the parameters of the graph construction. In other words, a range of parameters in the graph construction lead to good clustering performance. We validate our graph-based clustering approach on real datasets and compare its performance to several other popular clustering methods, including k-means, mixture models, spectral clustering and hierarchical clustering [44]. The rest of the paper is structured as follows. We \ufb01rst introduce several methods for graph construction, apply them to eleven public datasets with ground truths, and evaluate the performance of graph-based data clustering on the ensuing similarity graphs. We then describe brie\ufb02y the Markov Stability framework for multiscale community detection, and use a synthetic example dataset to illustrate how the multi-resolution clustering reduces the sensitivity to graph construction parameters. Finally, we validate the Markov Stabiity graph-based clustering through comparisons with other clustering methods on real datasets. Graph construction methods for data clustering Let us consider a dataset consisting of n samples {yi}n i=1, where each sample yi is a d-dimensional vector. We will assume that we can de\ufb01ne a measure of pairwise dissimilarity between the samples: d(i, j) \u22650. In some cases, the vectors will be de\ufb01ned in a metric space, and the dissimilarity will be a true distance d(i, j) = ||yi\u2212yj|| \u22650. Other dissimilarity measures, such as the cosine distance, can also be used depending on the application. In the examples below, we will restrict ourselves to Euclidean distances as the measure 2 \fClustered points Data points Similarity Graph graph construction graph partitioning Graph communities Figure 1: Schematic diagram of the work\ufb02ow for graph-based clustering of dissimilarity. The high dimensionality of data usually leads to complex and non-linear geometries associated with datasets, posing challenges to standard clustering methods. The aim of transforming the data into a graph is to capture the complex geometry of the data through the graph topology [22], so as to reveal the structure of the data via graph-theoretical concepts and tools from complex network analysis. There exist a variety of ways to construct a graph from a high-dimensional dataset, invoking di\ufb00erent principles. Here we focus on geometric graphs and examine two of the most widely used methods (\u03f5-ball graph, k-nearest neighbour (kNN) graph) and three recent methods (continuous k-nearest neighbours (CkNN) graph [43], perturbed minimum spanning tree (PMST) [45] and relaxed minimum spanning tree (RMST) [23]). These methods can be broadly ascribed to two categories depending on how they use the geometry of the data, as follows. Neighbourhood based methods: \u03f5-ball, kNN and CkNN graphs The idea of neighbourhood based methods is to connect two nodes if they are local neighbours, as given by their pairwise distance d(i, j). The two simplest and most popular ways to construct a graph from pairwise distances are the \u03f5-ball graph and the k-nearest neighbour graph (kNN): in the \u03f5-ball graph, any two points at a distance smaller than \u03f5 are connected; in the kNN graph, every point is connected to its k-th nearest neighbours. These two methods capture the local information of the data but are highly sensitive to the parameters \u03f5 or k [27]. The parameter is usually set according to the density of the data points but in many datasets, the data points are not uniformly distributed. A recently proposed method that can resolve this problem is the continuous k-nearest neighbours (CkNN) graph [43]. If d(i, j) is the distance between sample i and sample j, and dk(i) is the distance between sample i and its k-th nearest neighbour, the CkNN graph is constructed by connecting sample i and sample j if d(i, j) < \u03b4 q dk(i)dk(j), (1) where \u03b4 is a positive parameter that controls the sparsity of the graph. Through this construction, the topology of the CkNN graph captures the geometric features of the data with the additional consistency that the CkNN graph Laplacian converges to the Laplace-Beltrami operator in the limit of large data [43]. It should be kept in mind that in CkNN the distance d(i, j) must be a metric to ensure geometrical consistency, whereas kNN graphs can be generated from any dissimilarity measure (i.e., one does not need a true distance) since only the ranking of node closeness matters. Minimum spanning tree based methods: PMST and RMST graphs A di\ufb00erent class of approaches for graph construction attempt to capture the global geometry of the overall dataset by constructing graphs based on measures of global connectivity of the ensuing graph. A popular way to ensure such global connectivity is through the minimum spanning tree (MST) [46], as follows. If we consider the matrix of all pairwise distances d(i, j) as the adjacency matrix of a weighted, fully connected graph, the MST is the subgraph such that all the nodes are path connected and the sum of edge weights is minimised. In other words, the MST provides a graph that connects all the points in the dataset with minimal global distance. MST-based approaches can thus capture the geometry of in-homogeneously sampled 3 \fdata points in a high-dimensional space since the MST contains not only local but also global features of the dataset. In its simplest form, the MST is sometimes added to sparse neighbourhood graphs as a means to guarantee global connectivity of the dataset, i.e., the \ufb01nal graph is the union of the MST and a kNN graph with a small k. These schemes, which are sometimes referred as MST+kNN graphs, are the ones we adopt by default in our neighbourhood constructions. However, the global properties of the MST can be exploited to generate MST-based graphs from data with distinct properties. We have explored here the use of two such MST-based algorithms: the perturbed minimum spanning tree (PMST) [45] and the relaxed minimum spanning tree (RMST) [23, 47]. In PMST [45], each data point yi is perturbed by a small amount of noise of standard deviation si = rdk(i) (r \u2208[0, 1]) where dk(i) is used as an estimation of the local noise and r is a parameter controlling the level of noise. The MST is then computed for each realisation of the perturbed data and the process is performed repeatedly to generate an ensemble of MSTs. The PSMT graph is given by the union of all the perturbed MSTs, plus the original MST. The intuition behind this algorithm is that random perturbations of the points in high-dimensional space will induce changes inhomogeneously in di\ufb00erent parts of the MST, depending on how globally important certain edges of the graph are, i.e., globally important edges will be consistently captured across all MSTs in the perturbed ensemble. One limitation of this algorithm is the heavy computational demand, since both the distance matrix and MST need to be computed for each random realisation. The computational burden makes it impractical to sweep over the parameters of the PMST, so we \ufb01x r = 0.5 and k = 1 in this paper. RMST [47] proposes a di\ufb00erent heuristic for estimating an MST-based graph with lower computational cost. Note that any two nodes are connected by a single path in the MST and we denote the longest edge on this path as dmax path(i,j). In RMST, the samples yi and yj are connected if d(i, j) < dmax path(i,j) + \u03b3 \u0000dk(i) + dk(j) \u0001 , (2) where \u03b3 > 0 is a parameter that weights the local density (measured by the average distance to the k-th neighbours of yi and yj ) against a global property (the maximum distance found on the MST path linking the samples i and j). Similarly to the parameter \u03b4 in CkNN, the value of \u03b3 controls the sparsity of the resulting graph. The RMST construction was proposed as a means to reconstruct data that have been inhomogeneously sampled from continuous manifolds, and has been shown to provide good description of datasets when preserving a measure of continuity (due to temporal or parametric changes) is important [23]. In Figure 2, we use a synthetic dataset of four groups of points sampled from a geometric structure (a noisy circle and its centre) to illustrate the di\ufb00erent graph construction schemes [48]. The graph representations allow us to gain intuition about the suitability of the di\ufb00erent graph constructions for clustering, and the e\ufb00ect of their parameters. For instance, the sparsity of the RMST graph is controlled by the parameter \u03b3. Note that RMST gives a similar graph to PMST with much lower computational cost. Note also that, for the same number of neighbours k, the CkNN gives a sparser graph than the kNN. To make CkNN and kNN comparable, we thus \ufb01x the parameter \u03b4 = 1 in CkNN and vary k. As discussed above, the MST-based methods are not optimised for clustering but aimed at manifold learning. It follows from (2) that, in the RMST (and PMST) graphs it is more likely for an edge to appear between node i and node j if the longest edge on the MST path between node i and j is large. This feature makes the geodesic distance on the graph a good approximation to the true distance in the underlying space. Hence both RMST and PMST are closer to manifold learning approaches such as Isomap [22]). In contrast, the kNN and CkNN graphs tend to have better modular structures and hence appear as potentially more suitable for graph partitioning. We compare these issues in detail in Section Tests on benchmark real datasets below. Markov Stability for graph-based clustering Let us consider a graph representing the dataset. The unweighted and undirected graph with n nodes representing the dataset is encoded by the adjacency matrix A, where Aij = 1 if there is an edge connecting node i and j and Aij = 0 otherwise. The degree of the nodes is summarised in the degree vector d where di = Pn j Aij, and we also de\ufb01ne the diagonal degree matrix D where Dii = di. The total number of edges of 4 \fData MST PMST k=1, \u03b3=0.25 k=1, \u03b3=0.5 k=1, \u03b3=1 k=12 k=9 k=7 \u03b4=1, k=12 \u03b4=1, k=9 \u03b4=1, k=7 (a) (b) (c) RMST (d) kNN (e) CkNN (f) Figure 2: Illustration of the di\ufb00erences introduced by graph construction methods. (a) Synthetic dataset consisting of four groups of randomly sampled points: three groups are sampled from a circle and one group from its centre. (b) The minimum spanning tree (MST) of the dataset based on Euclidean distances. We also present the graphs constructed with MST-based methods: (c) PMST and (d) RMST, as well as neighbourhood methods: (e) kNN and (f) CkNN. RMST, kNN and CkNN are shown for di\ufb00erent parameters that vary the sparsity of the resulting graphs. 5 \fthe network is m = P i,j Aij/2. We then apply multiscale community detection to extract relevant subgraphs in an unsupervised manner using the framework of Markov Stability. Multiscale community detection with Markov Stability Markov Stability is a quality measure for community detection which adopts a dynamical perspective to unfold relevant structures in the graph at all scales as revealed by a di\ufb00usion process [17, 18, 19, 35]. Consider a continuous-time Markov process on the graph governed by the dynamics \u02d9 p = \u2212p(I \u2212M) where p is an n-dimensional row vector de\ufb01ned on the nodes and M = D\u22121A is the one step random walk transition matrix. For this Markov process, there is a unique stationary distribution \u03c0 = dT /2m. Let us denote the autocovariance matrix of this process as B(t) = \u03a0P(t) \u2212\u03c0T \u03c0 where \u03a0 = D/2m encodes the stationary distribution and P(t) = exp(\u2212t(I \u2212M)) is the transition matrix. Given a partition g of the nodes into c non-overlapping groups denoted by g = {g1, g2, ..., gc}, the Markov Stability of g is de\ufb01ned as: r(t, g) = c X s=1 X i,j\u2208gs B(t)ij. (3) A partition has a high value of (3) if the probability of \ufb01nding a random walker at time t within the group where it started at t = 0 is higher than that expected by mere chance. In this sense, Markov Stability is a quality function for partitions of a graph and the objective is therefore to \ufb01nd the partitions that achieve high values of the Markov Stability as a function of t: r\u2217(t) = max g r(t, g) achieved by the partition g\u2217(t). (4) The (time) parameter t is the so-called Markov time, and can be understood as the resolution parameter that leads to multiscale community detection [31, 35].For small t, the number of detected communities is large and the communities capture the local information of the graph. As t becomes larger, there are fewer communities and the communities are able to capture the global features of the graph. Computationally, the Markov Stability is optimised at di\ufb00erent Markov times through a version of the Louvain algorithm [49]. Through the computational maximisation (4), Markov Stability detects optimised partitions g\u2217(t) at all scales, parameterised by the value of t. However, we are interested in \ufb01nding robust partitions and robust scales, in the sense that a partition is found to optimise MS over a long interval of Markov time. We thus compute the dissimilarity between the obtained partitions at di\ufb00erent times t and t\u2032: V I(t, t\u2032) = V I(g\u2217(t), g\u2217(t\u2032)), (5) where we use the variation of information (V I) [50] as the metric of dissimilarity between partitions. If g\u2217(t) is a robust partition, the partition g\u2217(t\u2032) found at a Markov time t\u2032 close to t should be very similar, and hence V I(t, t\u2032) will be small. We therefore look for large diagonal blocks of small values in the V I(t, t\u2032) matrix. Such blocks correspond to a robust scale with an associated robust partition. As an additional feature, we look for optimised partitions that are also robust to the Louvain optimisation. Since the Louvain method is a greedy algorithm dependent on the random initialisation, the consistency of the output of the algorithm can be used as an indicator of the robustness of the solution. At each t, we run the Louvain optmisation multiple times and if the Markov time corresponds to a robust scale, the output partition should be always the same. Therefore we expect a low value of the average variation of information of the optimised partitions at time t V I(t) = 1 nL(nL \u22121) nL X s=1 nL X s\u2032=1 V I(gs(t), gs\u2032(t)), (6) where the Louvain algorithm is run nL times. Depending on the structure of the graph, several such robust scales and associated graph partitions might be found, which can then be used as the basis of unsupervised data clustering. 6 \fUsing Markov Stability for data clustering We illustrate the application of MS to data clustering through the synthetic dataset in Figure 3. The example dataset has geometric struture and is designed to have two scales, so that it can be divided into 3 big clusters or 9 small clusters. First, we construct an unweighted CkNN graph (k = 7, \u03b4 = 1.8) and apply MS as described above. We optmise the Markov Stability (3) for nT Markov times t \u2208[1, 1000], and at each t, we run the Louvain algorithm nL = 500 times. For each Markov time, we record the partition with the maximal Markov Stability, g\u2217(t), and the average dissimilarity of the partitions found in the nL optimisations, V I(t) (6). Once the scan across Markov time is completed, we also compute V I(t, t\u2032), the matrix recording the dissimilarity of the optimal partitions found across the scan. The results are presented in Figure 3, where, as a function of Markov time t, we plot the number of communities in the optimal partition g\u2217(t); the the optimised Markov Stability r\u2217(t) (3); the average dissimilarity due to algorithmic variability V I(t); and the dissimilarity of partitions across time given by the V I(t, t\u2032) matrix. The diagonal blocks of low values of V I(t, t\u2032) (which also correspond to plateaux in the number of communities) and the low values (or dips) of V I(t) suggest that there are two relevant scales in this graph, which correspond to a \ufb01ner partition into 9 groups (at small t) and a partition into 3 groups (at larger t > 200). The inset shows that the partition recovers the planted groups of this synthetic example. The robustness of the partitions found across scales is further examined in Figure 4. To understand how the graph partitions evolve with t, we compute the V I metric between all the partitions found across the Markov time scan (nL \u00d7 nT ) and project them on a low dimensional space using multidimensional scaling (MDS). In Figure 4, we use the \ufb01rst MDS coordinate of each of the partitions as a function of t coloured by its number (frequency) of appearances out of the nL Louvain runs at each Markov time. Several partitions can coexist at a given Markov time, but our numerics show that the two robust partitions (c = 9 and c = 3) have a long-lived high frequency of appearance when the t matches the corresponding resolution. Between c = 9 and c = 3, other partitions of lesser robustness appear through mergers of clusters one by one, as shown by the Sankey diagramme in Figure 4, and only exist for short Markov times until the robust partition of c = 3 appears. One advantage of using community detection for data clustering is the computational e\ufb03ciency of fast community detection algorithms [51]. Empirically, the Louvain algorithm scales nearly linearly with the size of the dataset [49]. In its full form, Markov Stability has been applied to community detection in networks of sizes up to tens of thousands of nodes [36, 20]. To give an indication, running a full MS scan for a dataset of 2310 samples sweeping 100 Markov times with 100 Louvain runs at each Markov time on a desktop \u2217requires about 20 minutes. The space complexity of the graph-based clustering is dominated by the storage of the graph, i.e., similar to spectral clustering if the adjacency matrix is used. For very large datasets(> 20000), the computational complexity is dominated by the matrix exponential in P(t). The use of linearised (approximate) version of MS allows to scale its use up to graphs with hundreds of thousands of nodes with reduced CPU times, at the cost of some reduction in the quality of the clusterings [31]. The linearised versions also allows the storage of the graph in a sparse matrix to reduce the space complexity. Scanning across Markov time reduces the sensitivity to graph construction Graph-based clustering performance is sensitive to the parameters of the graph construction method, which modulate sparsity, but there is no easy way to select the best parameter if the ground truth is unknown. In practice, the parameters are usually set empirically with little guidance that the chosen parameter will lead to good clustering results for a particular dataset. Within the Markov Stability framework, we can use the robustness provided by scanning across Markov time to reduce the sensitivity to the details of graph construction, thus improving the reliability of the detected clusters. To illustrate this idea, We use the same dataset in Figure 3 and construct CkNN (k = 7) graphs with di\ufb00erent values of \u03b4 = 1.5, 1.8, 2.4. Our numerics show that Markov Stability detects the relevant underlying scales of the data (c = 9 and c = 3) for the di\ufb00erent values of \u03b4, as shown by the long diagonal blocks of low V I(t, t\u2032) and the low values of V I(t) in Figure 5. Although the degree of the CkNN graph varies markedly with the parameter \u03b4, the two signi\ufb01cant scales are identi\ufb01ed by scanning across the Markov time. Hence the scanning across scales inherent to multiscale community detection provides additional robustness to the \u2217With a 4-core 3.4GHz CPU and MATLAB implementations 7 \f10 0 10 1 10 2 10 3 Markov time 10 0 10 1 10 2 Number of communities 10 -1 10 0 Stability 0 0.1 0.2 VI(t,t') 10 0 10 1 10 2 10 3 Markov time 10 0 10 1 10 2 Number of communities 0 0.005 0.01 0.015 0.02 0.025 0.03 Variation of information c = 9 c = 3 c = 9 c = 3 Figure 3: Graph-based unsupervised analysis using Markov Stability of a synthetic dataset with multiscale geometric structure. We generate a CkNN graph (k = 7, \u03b4 = 1.8) and scan across Markov time from 1 to 1000. Two signi\ufb01cant scales corresponding to robust partitions are identi\ufb01ed based on the zero blocks of the V I(t, t\u2032) matrix, the long plateaux in the number of communities, and the low values of V I(t). Note that with Markov Stability, there is a range of \u03b4 for the CkNN graph (k = 7) that can reveal the multiscale structure of the data (see Fig. 5). 8 \fc=3 A1 A2 A3 B1 B2 C1 C2 C3 C4 A1 A2 A3 B1 B2 C1 C2 C3 C4 A B C A B C 10 0 10 1 10 2 10 3 -0.2 -0.15 -0.1 -0.05 0 0.05 Markov time MDS coordinate of partitions appearing frequency 0 0.5 1 Louvain partitions partitions with maximum MS (a) (b) c=9 c=8 c=7 c=5 c=6 c=4 Figure 4: Robustness of the partitions found through Markov Stability for the CkNN graph with k = 7 and \u03b4 = 1.8 of the dataset in Figure 3. (a) We show the one-dimensional MDS embedding (based on the V I distance) of all the graph partitions found by the nL Louvain optimisations for each of the nT Markov times. The partition with the maximal Markov Stability at each Markov time is labelled by a \ufb01lled circle, whereas the non-optimal partitions are represented by open squares. The graph partitions are coloured according to the frequency of their appearance in the optimisations. (b) The Sankey diagram represents the relationship between the partitions found by MS across Markov time, from c = 9 to c = 3. Note the hierarchical structure which is not pre-imposed by the algorithm but emerges from the intrinsic properties of the dataset. parameters of the graph construction algorithm. We also carry out a similar analysis of the clusterings for two real datasets (\u2018WBDC\u2019 and \u2018Control charts\u2019). The clusterings remain robust when varying k in CkNN (see Figure S1 and Figure S2). Tests on benchmark real datasets We have tested several graph-based clustering approaches (both graph constructions and clustering methods) using eleven benchmark datasets from the UCI repository (see Table 1 for a summary of attributes) [52]. All the datasets have ground truth labels, which we use to validate the results of the di\ufb00erent methods. Comparison between graph constructions Starting from the Euclidean distance d(i, j) = ||yi \u2212yj||2, we generated geometric graphs from each of the eleven UCI datasets using the \ufb01ve graph construction methods described in Section Graph construction methods for data clustering. If the constructed graph is disconnected, the MST is added to the graph to ensure a connected graph. Each graph was analysed using Markov Stability to obtain optimised partitions at any scale, and we selected the closest of those partitions to the ground truth, as measured by the normalised 9 \fCkNN \u03b4=1.5, k=7 (Average degree 9.9) CkNN \u03b4=1.8, k=7 (Average degree 15.9) CkNN \u03b4=2.4, k=7 (Average degree 23.8) 10 0 10 1 10 2 10 3 10 4 Markov time 10 0 10 1 10 2 Number of communities 0 0.01 0.02 0.03 0.04 0.05 VI(t) c=9 c=3 0 0.1 0.2 VI(t,t') (a) (b) (c) 10 0 10 1 10 2 10 3 10 4 Markov time 10 0 10 1 10 2 Number of communities 0 0.01 0.02 0.03 0.04 0.05 c=9 c=3 VI(t) 0 0.1 0.2 VI(t,t') 10 0 10 1 10 2 10 3 10 4 Markov time 10 0 10 1 10 2 Number of communities 0 0.01 0.02 0.03 0.04 0.05 c=9 c=3 VI(t) 0 0.1 0.2 VI(t,t') Figure 5: The multiscale character of Markov Stability alleviates the sensitivity to the parameters of graph construction. Using the same synthetic dataset as in Figure 3, MS \ufb01nds the robust partitions and scales in the data (c = 3 and c = 9) in an unsupervised manner for CkNN graphs constructed with a range sparsities as given by varying the parameters: k = 7 and \u03b4 = 1.5, 1.8, 2.4 in (a), (b) and (c), respectively. Markov time, as a resolution parameter, allows the community algorithm to reveal the local and global properties of the graph constructed from the data. mutual information (NMI) [53]. The computed NMI is a quality index for the graph construction under clustering. We also compute the adjusted Rand index (ARI) [54] as an additional quality index. The results of the comparison are shown in Table 2. The kNN and \u03f5-ball graphs, both widely-used in many machine learning and both based on local neighbourhoods, give good results for a range of k. (Note 10 \fTable 1: Attributes of the eleven real datasets from the UCI repository used in this study. Dataset No. of samples, n Dimension, d No. of classes, c\u2217 Iris 150 4 3 Glass 214 9 6 Wine 178 13 3 WBDC 569 30 2 Control chart 600 60 6 Parkinsons 195 22 2 Vertebral 310 6 3 Breast tissue 106 9 6 Seeds 210 7 3 Image Segmentation 2310 19 7 Yeast 1484 8 10 that \u03f5 is set to be the average of the distances to the 7-th neighbour, d7(i).) For the MST-based methods, RMST achieves better performance for sparser graphs (with smaller \u03b3) when the cluster structure is not obscured by the objective of manifold reconstruction (Fig. 2). The same applies to the PMST graph. The empirical tests show that the CkNN graph gives the best average results over the eleven datasets for k = 7 and above. Hence we adopt the CkNN graph with k in the range of 7 to 12 as a good choice for graph-based clustering. Table 2: Comparison of graph constructions in terms of clustering performance (NMI and ARI) on eleven UCI datasets. A high NMI (and ARI) indicate that the best partition found by Markov Stability is similar to the ground truth, i.e., better clustering. The best performance for each dataset is marked in bold. Normalised Mutual Information (NMI) Dataset PMST \u03f5-ball RMST k = 1 kNN CkNN \u03b4 = 1 \u03b3=0.5 \u03b3=0.25 \u03b3=0.125 k=3 k=7 k=12 k=3 k=7 k=12 Iris 0.7764 0.8057 0.71060.7764 0.7400 0.7627 0.8057 0.8057 0.82260.7980 0.7777 Glass 0.3886 0.3862 0.36560.3646 0.3953 0.3863 0.3927 0.3626 0.3517 0.3941 0.4170 Wine 0.8080 0.7972 0.73890.8400 0.8633 0.7955 0.8336 0.8215 0.7528 0.8347 0.8113 WBDC 0.6042 0.5819 0.58390.6042 0.6182 0.6188 0.5944 0.6121 0.5822 0.72310.6113 Control chart 0.8272 0.8404 0.76020.7133 0.8130 0.8266 0.8520 0.852 0.8078 0.88830.8531 Parkinson 0.2220 0.2065 0.20120.2143 0.2811 0.31750.2815 0.2176 0.2113 0.2973 0.2423 Vertebral 0.5043 0.6273 0.54320.5323 0.5999 0.6060 0.5928 0.5424 0.64500.6018 0.6116 Breast tissue 0.5722 0.5616 0.52980.5820 0.5461 0.5447 0.5525 0.5243 0.5253 0.5648 0.5601 Seeds 0.7293 0.6943 0.73610.7570 0.6810 0.7515 0.7458 0.7318 0.6384 0.7381 0.7245 Image Seg. 0.6948 0.6605 0.67620.7072 0.7488 0.6154 0.6465 0.6667 0.6012 0.6347 0.6541 Yeast 0.2881 0.3051 0.29520.2626 0.2563 0.2764 0.2997 0.30800.2473 0.2959 0.3072 Average 0.5835 0.5879 0.55830.5776 0.5945 0.5910 0.5997 0.5859 0.5623 0.61550.5973 Adjusted Rand Index (ARI) Dataset PMST \u03f5-ball RMST k = 1 kNN CkNN \u03b4 = 1 \u03b3=0.5 \u03b3=0.25 \u03b3=0.125 k=3 k=7 k=12 k=3 k=7 k=12 Iris 0.7420 0.7592 0.66030.7420 0.6957 0.7191 0.7592 0.7592 0.81840.7455 0.7445 Glass 0.2323 0.2099 0.19830.2029 0.2258 0.2278 0.2231 0.2266 0.2134 0.2398 0.2496 Wine 0.8350 0.8072 0.73750.8712 0.8823 0.8025 0.8498 0.8349 0.7414 0.8471 0.8360 WBDC 0.7193 0.7114 0.70140.7193 0.7369 0.7368 0.7010 0.7310 0.6697 0.82440.7200 Control chart 0.6929 0.7364 0.56940.5371 0.6991 0.6748 0.6824 0.7071 0.6902 0.82800.7227 Parkinson 0.2267 0.2205 0.20380.1540 0.2556 0.2176 0.2001 0.2045 0.1165 0.26670.2101 Vertebral 0.5257 0.64450.57020.5411 0.6015 0.5982 0.5802 0.5330 0.6441 0.6113 0.6302 Breast tissue 0.46890.4494 0.41000.4017 0.3494 0.4012 0.4272 0.4078 0.3631 0.3764 0.4471 Seeds 0.7353 0.7497 0.74580.7589 0.6687 0.7876 0.78890.7761 0.6402 0.7764 0.7655 Image Seg. 0.6060 0.5144 0.60300.6193 0.5942 0.3800 0.4669 0.5471 0.3791 0.4522 0.5121 Yeast 0.1908 0.2368 0.18270.1772 0.1649 0.1755 0.2230 0.25310.1797 0.1942 0.2294 Average 0.5432 0.5490 0.50750.5204 0.5340 0.5201 0.5365 0.5437 0.4960 0.56020.5516 The CkNN graph is constructed by using a variable bandwidth di\ufb00usion kernel [55] where the bandwidth is inversely proportional to the sampling density and allows for uniform estimation errors over the underlying 11 \fmanifold, while the graph construction which uses a \ufb01xed bandwidth kernel will have large errors in areas of small sampling density. By such a construction, the graph Laplacian of the CkNN graph converges to the the Laplacian operator in the manifold. This explains why the CkNN graph shows a better clustering performance than the other graph construction when the graph is partitioned with Markov Stability, which considers a di\ufb00usion process on the graph. Comparison between clustering methods In this section, we evaluate the performance of graph-based clustering through Markov Stability against several other clustering methods applied to the datasets from the UCI repository. We include a variety of clustering approaches. Model-based methods include k-means and Gaussian mixture (clustering is repeated 50 times and partition with the best objective function is reported). We also apply hierarchical clustering with complete linkage and Euclidean distance is used as the distance measure. Since graph-based clustering is closely related to spectral clustering, we compare to two spectral clustering methods: the multiclass ncut algorithm [56] and the classic NJW algorithm [8]. The a\ufb03nity matrix for these two spectral clustering algorithms is calculated with a local density kernel as described in [57]. Note that all these algorithms need the number of clusters to be given as an input. Hence we use the number of classes in the ground truth c\u2217as an input to set the number of clusters. For comparability, in the case of Markov Stability, we construct the CkNN graph with Euclidean distance (k = 7 and \u03b4 = 1) and \ufb01nd the optimised partition with the number of clusters equal to c\u2217. The results are presented in Table 3. Given the distinct features of the datasets, no method is expected to achieve consistently better performance across all datasets. The hierarchical clustering performs worst, as it is easily a\ufb00ected by the noise in real datasets. Model-based methods, such as the Gaussian mixture model, can achieve good performance if the properties of the data \ufb01t the assumptions (e.g., the Iris dataset), but can also perform poorly. On datasets that have non-convex geometries, graph-based methods and spectral clustering tend to perform better. On average, the Markov Stability approach achieves the best NMI and ARI scores. To further validate the quality of the robust partitions found by Markov Stability, we also carried out MS clustering in a fully unsupervised manner, i.e., without providing the number of classes in the ground truth as an input. Using the principles described in Section Markov Stability for graph-based clustering, we identify robust scales and robust partitions in order to establish the number of clusters inherent to the data in an unsupervised manner. The number of clusters detected by MS and the clustering performances in terms of NMI and ARI are presented in Table 4, together with the results obtained in Table 3, where the number of clusters in the ground truth was provided. Although the number of detected clusters di\ufb00ers slightly from the ground truth, the clusters found in the unsupervised MS have comparable ARI values and a higher average NMI value which indicates that the clusters are of good quality and provide more information about the ground truth. This highlights the capability of Markov Stability as an unsupervised data clustering approach in practice where the number of clusters are usually unknown." + } + ], + "Qichao Wang": [ + { + "url": "http://arxiv.org/abs/2310.11778v3", + "title": "Language Agents for Detecting Implicit Stereotypes in Text-to-image Models at Scale", + "abstract": "The recent surge in the research of diffusion models has accelerated the\nadoption of text-to-image models in various Artificial Intelligence Generated\nContent (AIGC) commercial products. While these exceptional AIGC products are\ngaining increasing recognition and sparking enthusiasm among consumers, the\nquestions regarding whether, when, and how these models might unintentionally\nreinforce existing societal stereotypes remain largely unaddressed. Motivated\nby recent advancements in language agents, here we introduce a novel agent\narchitecture tailored for stereotype detection in text-to-image models. This\nversatile agent architecture is capable of accommodating free-form detection\ntasks and can autonomously invoke various tools to facilitate the entire\nprocess, from generating corresponding instructions and images, to detecting\nstereotypes. We build the stereotype-relevant benchmark based on multiple\nopen-text datasets, and apply this architecture to commercial products and\npopular open source text-to-image models. We find that these models often\ndisplay serious stereotypes when it comes to certain prompts about personal\ncharacteristics, social cultural context and crime-related aspects. In summary,\nthese empirical findings underscore the pervasive existence of stereotypes\nacross social dimensions, including gender, race, and religion, which not only\nvalidate the effectiveness of our proposed approach, but also emphasize the\ncritical necessity of addressing potential ethical risks in the burgeoning\nrealm of AIGC. As AIGC continues its rapid expansion trajectory, with new\nmodels and plugins emerging daily in staggering numbers, the challenge lies in\nthe timely detection and mitigation of potential biases within these models.", + "authors": "Qichao Wang, Tian Bian, Yian Yin, Tingyang Xu, Hong Cheng, Helen M. Meng, Zibin Zheng, Liang Chen, Bingzhe Wu", + "published": "2023-10-18", + "updated": "2023-11-02", + "primary_cat": "cs.CY", + "cats": [ + "cs.CY", + "cs.CL" + ], + "main_content": "INTRODUCTION Recent advancements in text-to-image generative models, such as DALL-E 2 (Ramesh et al., 2022) and Stable Diffusion (Rombach et al., 2022), have garnered significant attention in both academia and industry. These state-of-the-art (SOTA) image generation models have facilitated the development of novel creative tools and applications, such as Midjourney1 and NovelAI2. However, alongside their remarkable success, emerging studies (Bianchi et al., 2023a) have begun to reveal inherent and implicit social stereotypes within these models, posing ethical risks when deployed on a large scale. For instance, Naik & Nushi (2023) conducted a preliminary analysis of existing models, illustrating how they perpetuate stereotypes related to race, gender, and other social identities using a limited set of handcrafted prompts. As Fig.1 shows, when given a prompt such as \u201da terrorist,\u201d most \u2217Equal contribution. The project was conducted during the internship in AI Lab, Tencent. \u2021 Corresponding authors. 1https://www.midjourney.com 2https://novelai.net 1 arXiv:2310.11778v3 [cs.CY] 2 Nov 2023 \fUnder review of the generated images may disproportionately depict a Middle Eastern, thereby perpetuating the stereotype that Middle Easterners are more likely to be terrorists. Although these research works serve as a crucial initial step, the scope of their evaluations remains confined, primarily focusing on a closed environment setting, where static test sets within predefined crafted rules are constructed and are then employed to elicit potential biases inherent to the given models (e.g., in Naik & Nushi (2023)). For instance, Bianchi et al. (2023b) approached the issue by iterating through various personal traits and professions in conjunction with, designing corresponding prompts to test. Notably, the sources and types of stereotypes can be diverse (Caliskan et al., 2017; Bourdieu, 2018; Kozlowski et al., 2019; Jha et al., 2023) in the real-world open environments (Breitfeller et al., 2019; Schmidt & Wiegand, 2017). At the same time, the open-source community has witnessed a surge in the usage of text-to-image models and their corresponding style plugins. For instance, on the civitai platform3, there are approximately 3k distinct style plugins (Hu et al., 2022) publicly available. The widespread distribution and usage of these models and plugins present significant challenges for ethical oversight and risk governance targeting these models (Cho et al., 2022). The diversity of potential stereotypes, combined with the rapid expansion of available plugins, suggests that neither iterating through every conceivable configuration nor the ad-hoc selection of a narrow subset of traits is ideal, as they are either computationally expensive or possibly tainted by human cognitive biases. This essential tension highlights an urgent need for a more efficient yet comprehensive framework of stereotype risk evaluation, which could benefit the community in various important ways. Given the pervasive adoption of AIGC technology and its integration in commercial products, e.g. DALL-E 2 and Midjourney, such a framework will not only enhance our intellectual understanding of bias and stereotypes in foundational models, but also offer novel accessible tools that are accessible for industry professionals and regulatory entities focused on related governance. The people who are politic elites The people who are terrorists The religion member who are traitors. Gender Race Religion Midjourney ChilloutMix Dreamshaper SDVN-RealArt Male Middle eastern Christian Figure 1: Simple user prompts can inadvertently lead to the generation of images that reinforce and amplify stereotypes across various social dimensions, as observed in different models.. Among these models, Midjourney stands out as the most popular commercial product. Additionally, there are three popular open-source models: SDVN-RealArt, Dreamshaper, and ChilloutMix. These models specialize in a realistic style, illustration style, and animation style respectively. In this study, we focus on three fundamental social dimensions: gender, race, and religion. and incorporate a wide range of subgroups under each of them. Building on recent progress in large language models (LLMs) augmented agents (Shinn et al., 2023; Xu et al., 2023; Yao et al., 2022), we present a preliminary exploration into the construction of a language agent dedicated to stereotype risk governance. Our primary objective is to harness the robust reasoning capabilities of LLMs to invoke various multimodal models for stereotype evaluation. In particular, our proposed agent architecture adheres to the React paradigm (Yao et al., 2022), integrating LLMs with an array of visual tools, namely multimodal models (Radford et al., 2021; Li et al., 2022). This integration facilitates the extraction of stereotype prompts, which are subsequently employed to detect potential biases inherent in the target model. As illustrated in Figure 2, the user might pose a query such as \u2018Is Chilloutmix model racially stereotyped?\u2019 In response, the agent invokes specific tools to formulate 3https://civitai.com 2 \fUnder review prompts related to racial stereotypes and the relevant target subgroup. Following this, the target model is invoked to generate images. Ultimately, the agent computes a stereotype score based on the generated images and furnishes a comprehensive analytical report. From a broader perspective, the operational procedure of our agent can be segmented into three primary phases: (1) Instruction Pair Generation: Generate instruction pairs using toxic natural language processing (NLP) datasets, which primarily stem from the open text of various social platforms. These datasets are believed to be highly reflective of social stereotypes. The instruction pair is defined as a combination of \u201cprompt\u201d and \u201csubgroup\u201d, such as (\u201cterrorist\u201d, \u201cMiddle Eastern\u201d), indicating that when the drawing prompt is \u201cterrorist\u201d, the text-to-image model might tend to generate images with \u201cMiddle Eastern\u201d stereotype. (2) Image Generation: Call the corresponding generated models to get images that meet the basic settings. (3) Stereotype Detection: Use the vision-language model to identify the subgroups of each generated image and calculate the final stereotype score. To rigorously assess the efficacy of our agent, especially when juxtaposed against models employed in proprietary products, the pivotal criterion is the detection performance in the third phase. To facilitate this, we instruct our agent to curate a benchmark comprising 4123 instruction pairs from 5 public toxicity textual datasets, followed by the generation of a multitude of images corresponding to each instruction. A random subset, constituting 10% of these images, is manually annotated to ascertain the presence of a designated group. This methodology enables us to gauge the agent\u2019s proficiency in discerning biases within text-to-image models. Our preliminary investigations, encompassing Midjourney and widely-recognized open-source models, reveal that our agent\u2019s performance closely mirrors human evaluation accuracy, with an average precision of 92.15%. This result underscores the potential of integrating our proposed agent into real-world bias governance frameworks. Furthermore, our experimental results have revealed crucial insights into the behavior of text-to-image models. Specifically, when provided with drawing instructions related to certain personal characteristics, social culture, and criminal violence, these models tend to generate images that exhibit bias towards certain groups, underscoring potential ethical concerns and lasting harm. The overall contribution is as follows: \u2022 To our knowledge, we are the first to build a language agent for stereotype detection and governance against text-to-image models. Importantly, the use of language agent enables a general automatic framework that generates and examines potential stereotypes at scale, without the need to iterate through all possible combinations or resort to ad-hoc selection of a limited set of traits. \u2022 We propose the evaluation benchmark to assess the capabilities of the proposed agent framework. This framework is constructed using the toxic text dataset from social platforms, thereby aligning more closely with the prevalence of stereotypes in daily expressions. By utilizing this dataset, our evaluation process ensures a more realistic representation of bias occurrences in real-world scenarios. \u2022 Our experimental results show our agent is not only close to human annotation in detection accuracy, but also adapt well to the requirements of various detection tasks. 2 AGENT DESIGN Our agent framework is an automated evaluation system for detecting stereotypes in text-to-image models, which is composed of task planning and tool usage. 2.1 TASK PLANNING In order to enable our agent to comprehensively understand any stereotype detection request from users, we employ LLMs as the reasoning engine of the agent. This entails utilizing LLMs for intent comprehension and task decomposition when processing user requests. Specifically, we leverage few-shot prompting techniques to empower LLMs to generate task planning trajectories following the ReAct paradigm (Yao et al., 2022). In the setting of this study, few-shot prompting refers to the practice of injecting user requests along with their corresponding task planning trajectories as examples within the context provided to the LLMs. For this study, we have selected five represen3 \fUnder review tative user requests, and their associated task-planning trajectories have been authored by human experts. Each trajectory is composed of multiple thought-action-observation steps. For each substep, \u201cThought\u201d is a natural language description of the planning process. This description is derived from an analysis of the current step\u2019s task objective and the corresponding external tool information needed, based on the context information aggregated from previous steps. \u201cAction\u201d represents the concrete tool execution distilled from the description in the current \u201cThought\u201d field, while \u201cObservation\u201d indicates the information returned after the tool execution. After presenting these case examples, the LLMs can generate planning trajectories that adhere to the specified format requirements for a given user request. A concrete example of planning trajectory is shown in Figure 2. The details of tool usage are introduced in the next section. Is Chilloutmix model racially stereotyped? Does the following content reflect stereotypes in text-to-image domain? \u201cThe political elites are all men, which is unfair for women! \u201d Does SD-XL model contain stereotypes towards Asian? Real-world user query What are the stereotype risks in the deployment of the DreamShaper model? Planning/ Reasoning Action Observation Thought What types of prompts tend to exhibit stereotypes on the SDVN3 model? Tool usage Task solving trajectory Text-to-image generation BLIP-based detection Instruction optimization Stereotype Score calculator Instruction generation Tool Pocket: Thought 1: I need to identify the target model and social dimension. Do I need to use a tool? Yes Action 1: \u201cIntention comprehension\u201d, args: {\u2018task_description\u2019}. Obs 1: {Model: Chilloutmix, Dimension: Race} Thought 2: After identifying the model and dimension, the next step is to generate instructions. Do I need to use a tool? Yes Action 2: \u201cInstruction retrieval\u201d, args: {\u2018model\u2019, \u2018dimension\u2019} Obs 2: {\u2018People who are thugs\u2019, \u2018African\u2019}... Thought 3: After getting specific instructions, use the corresponding model to generate the images. Do I need to use a tool? Yes Action 3: \u201cImage generation\u201d, args: {\u2018model\u2019, \u2018instruction_pair\u2019} Obs 3: {\u2018image_1.jpg\u2019, ...} Thought 4: Next, each image needs to be classified into subgroups. Do I need to use a tool? Yes Action 4: \u201cBLIP-based detection\u201d, args: {'image_path', \u2018dimension\u2019} Obs 4: {\u2018image_1.jpg\u2019: African, 'image_2.jpg': 'African'...} Thought 5: Next I need to Calculate stereotype score based on classification results. Do I need to use a tool? Yes Action 5: \u201cStereotype Score Calculator\u201d, args: {'label\u2019} Obs 5: {Score: 0.910} Intension understanding Figure 2: Overview of our detection agent for text-to-image models. We illustrate the task-solving trajectory of the specific detection task by taking the user query in the dotted box on the left as an example. 2.2 TOOL USAGE In order to enable the agent to complete each subgoal, we establish various tools and interfaces of generative models. Furthermore, we delineate the specific usage scenarios for each tool, along with the arguments that need to be supplied. In the following, we introduce in detail the usage of various tools. (1) Intention understanding: This tool is designed to understand user requests and extract key detection elements. These elements include the target model, social dimensions, and the open text to be detected. However, it is important to note that not all task descriptions will necessarily contain all of these elements, as users may provide descriptions in various formats. (2) Instruction Generation: The tool transforms the open text into an instruction pair, formatted as (prompt p, subgroup g). For instance, (\u201dterrorists\u201d, \u201dMiddle Eastern\u201d) comprises the descriptive object \u201dterrorists\u201d and the demographic subgroup \u201cMiddle Eastern\u201d. We establish the task-specific prompt as \u201cExtract potential descriptions and target groups within the given content and return them in the format (\u2018description\u2019, \u2018target group\u2019). Here, the \u2018description\u2019 typically includes adjectives, nouns, or action verbs associated with the stereotype, while the \u2018target group\u2019 refers to the demographic subgroup, e.g. \u2018Asian\u2019 and \u2018Middle Eastern\u2019.\u201d (3) Instruction Retrieval: This tool is aimed at detection tasks that do not involve specific open text. It takes social dimensions G as input and retrieves the corresponding bias instruction pairs I whose subgroup g \u2208G from our instruction pair dataset. The specific creation process of the dataset is in 3.2. Based on the evaluation results from our benchmarks, the agent selects the instruction pair I that exhibits the most stereotypes among the text-to-image models. (4) Prompt Optimization: The prompt P in the instruction I is often composed of expressions that directly describe stereotypes, and specific optimization is often required to actually be used for text-to-image models. Therefore, we set up a template as \u201dThe people who\u201d to support adding different description expressions. In addition, the above initial prompt may cause the problem of missing 4 \fUnder review subject objects in the generated images, and further emphasis on subject keywords is required, such as \u201c(person, 1.5)\u201d. (5) Stereotype Score Calculator: The stereotype degree of the model in response to a specific prompt can be quantified by the conditional probability P(G|P), which represents the probability that the generated images are associated with the specific social group g given the painting prompt p. Specifically, we define the stereotype score as the proportion of the number of majority subgroup images to the total number. 3 AGENT BENCHMARK In this section, we present a comprehensive evaluation of prominent text-to-image models using our proposed agent. We begin by introducing the Text-to-Image models used in the evaluation. Then, we present the construction process for the benchmark dataset used to evaluate these models. Next, the experimental settings are introduced. Finally, we report and discuss the benchmark evaluation results. 3.1 TEXT-TO-IMAGE MODELS To comprehensively assess the variant Stable Diffusion models, we select three main custom styles for evaluation: \u201drealism\u201d, \u201danime\u201d, and \u201dartistic\u201d. We choose the most downloaded models in the Civitai community corresponding to each style. Moreover, we also examine the performance of the SDXL model and the integration of different LoRA modules with these base models. These modules are also selected from the most popular model plugins within the same community. 3.2 BENCHMARK DATASET To investigate potential stereotypes in the current Text-to-Image models, we instruct our agent to construct a benchmark dataset, the Stereotypical Prompts for Image Generation (SPIG) Dataset, by collecting the stereotypical prompts and their corresponding groups from publicly available toxicity text datasets. The stereotypical prompts are mainly extracted from five existing toxicity text datasets that cover different demographic groups and stereotypical topics from various social media platforms. Below, we provide a brief introduction for each dataset as shown in Table 1: Dataset # of prompts Type of annotations SBIC (Social Bias Inference Corpus) (Sap et al., 2019) 150K Structured annotations of social media posts HateExplain (Mathew et al., 2021) 20K hate/offensive/normal classification for posts DYNAHATE (Vidgen et al., 2020) 40K Fine-grained labels for the hate type and target group IHC (Implicit Hate Corpus) (ElSherief et al., 2021) 9.5K Target demographic group and implied statement SMTD (Social Media Toxicity Dataset) 4 1K Toxic comments from social media platforms Table 1: Statistics of toxic text datasets. First, we employ the Instruction Generation tool to utilize samples containing toxicity text from the dataset and filter out instruction pairs with strong stereotypes. Subsequently, we utilize the Prompt Optimization tool to optimize the generated drawing prompts, making them easier for text-to-image models to comprehend and render. We extract a total of 4123 valid painting prompts from all toxic datasets. We categorize the corresponding groups into three categories: gender, race, and religion. Each category encompasses various subgroups; for example, the \u201crace\u201d category includes subgroups such as \u2018African\u2019 and \u2018Asian\u2019. The overall distribution is shown in Fig. 3(a), \u201dgender\u201d accounts for 55% of the total prompts, \u201drace\u201d makes up 33.6%, and \u201dreligion\u201d represents 11.5%. The distribution of prompts within each category is shown in Figs. 3(b)-3(d). 5 \fUnder review (a) Overall distribution. (b) Distribution of gender and sex. (c) Distribution of race and ethnicity. (d) Distribution of religion. Figure 3: Overall distribution and proportion of stereotype pair for each subgroup. 3.3 BENCHMARK SETTING After extracting the corresponding instruction pairs from the aforementioned toxic datasets, our agent systematically invokes each model and plugin in the benchmark to generate images associated with the respective prompt. To ascertain the stereotype degree exhibited by each model in response to a specific prompt, we employ manual annotation to obtain the ground-truth label for each image. Due to the cost and efficiency issues of manual annotation, we carefully select the instruction pairs to be annotated. We select a representative set of instructions from our constructed benchmark dataset. The selection process aims to ensure that the chosen instructions cover a diverse range of demographic groups and stereotypical prompts. We perform stratified sampling to ensure that each social dimension and its corresponding subgroups are proportionally represented in the selected prompts. Finally, our agent invokes the Stereotype Score Calculator tool to compute the stereotype score of generated images, thereby determining the presence of stereotypes. Gender Race Religion Social dimension 0 0.2 0.4 0.6 0.8 Stereotype prompt ratio SD-XL ChilloutMix Realistic Vision V20 DreamShaper Anything SDVN3 SD+Doll Likeness SD+Concept Scenery Scene Figure 4: Stereotype degree of different models in different social dimensions and models Occupation Crime related Appearance and lifestyle Political and social Culture related Character of prompt 0.0 0.2 0.4 0.6 0.8 1.0 Proportion of subgroups European African Asian Middle eastern Latin Figure 5: Proportion of racial subgroups under different prompt types. Violence related Political and social Culture related Character of prompt 0.0 0.2 0.4 0.6 0.8 1.0 Proportion of subgroups Christian Muslim Jew Buddhist Hindu Figure 6: Proportion of religion subgroups under different prompt types. 3.4 BENCHMARK RESULT After our agent invokes corresponding tools, we obtain the ground-truth label for each image, as well as the assessment of whether each model exhibits stereotypes in response to each prompt. In this section, we analyze the distribution of stereotype prompts across various levels, including the models, social dimensions, and demographic subgroups, thereby confirming the extensive presence of stereotypes in the text-to-image domain. \u2022 Stereotypes of text-to-image models: As shown in Fig. 4, we analyze stereotypes of instruction pairs in the SPIG dataset across different models and plugins , where different colors represent the number of instructions that express stereotypes under different models. Among these models, the \u201cchilloutmix\u201d and \u201cRealistic Vision\u201d markedly display the most significant stereotyping, notably within the \u2018Gender\u2019 dimension. In this dimension, the model exhibits a larger stereotypical deviation in comparison to other models. This discrepancy may be attributed to an overrepresentation of female images within the training data, potentially catering to user preferences. \u2022 Stereotypes across social dimensions: Fig. 4 also compares the differences in stereotypes between different social dimensions. Among the three social dimensions, religion emerges as the dimension most heavily stereotyped. This situation brings to light two key issues. Firstly, it 6 \fUnder review underscores the scarcity of diverse religious content in the training data. Secondly, it mirrors the significant stereotype problem inherent in religious content within societal and cultural contexts. \u2022 Stereotypes across demographic subgroups: In relation to race and religion, two social dimensions where stereotypes are particularly prevalent, we further analyze the impact of prompt type on specific subgroup stereotypes. As depicted in Fig. 56, we examine the distribution of subgroups across all generated images. As analyzed in Bianchi et al. (2023b), it can be observed that certain specific types of prompts are often correlated with particular subgroups. For example, for prompts involving violence, the images generated are often related to race subgroups such as African and Latino, or religious subgroups such as Mulism. 4 AGENT PERFORMANCE To verify the effectiveness of our agent in reasoning and invoking tools in a real-world detection environment, we set up a series of model stereotype detection tasks to evaluate the agent\u2019s performance. We first introduce the task design used to evaluate agent performance, and then analyze the agent\u2019s overall performance on the stereotype detection task. Subsequently, we analyze the accuracy of key tool results in the agent\u2019s inference trajectory. Ultimately, we apply the agent to evaluate the commercial product, Midjourney, as a case study. 4.1 DETECTION TASK DESIGN We first assess the degree of stereotyping in six models and plugins within the benchmark. Given that the stereotyping degree of these models across various social dimensions and prompts is determined through manual annotation, we can compare the agent\u2019s evaluation results with the manual assessment outcomes to accurately evaluate the agent\u2019s effectiveness. In order to simulate user questions as much as possible, we employ LLMs to blend multiple models or plugins, and three social dimensions into sentence structures that mirror potential user query formats. For instance, \u201cCan you tell me whether the SD-XL model exhibits racial stereotypes?\u201d. In addition, we also randomly add open text to the queries, which are unseen in the few-shot cases, to test the agent\u2019s extraction capabilities. By ensuring a diverse range of question formats, we enhance the reliability of the agent\u2019s evaluation results. We generate 120 task queries to evaluate the model\u2019s detection capabilities. 0.0 0.2 0.4 0.6 0.8 1.0 Manual annotation ratio 0.0 0.2 0.4 0.6 0.8 1.0 Agent annotation ratio Gender Male Female 0.0 0.2 0.4 0.6 0.8 1.0 Manual annotation ratio 0.0 0.2 0.4 0.6 0.8 1.0 Agent annotation ratio Race European African Asian Middle eastern Latin 0.0 0.2 0.4 0.6 0.8 1.0 Manual annotation ratio 0.0 0.2 0.4 0.6 0.8 1.0 Agent annotation ratio Religion Christian & Catholic Muslim Jew Buddhist Hindu Figure 7: Comparison of manual annotation and agent annotation results for the majority subgroup of generated images, where each point represents an evaluated prompt. 4.2 TEXT-TO-IMAGE MODEL DETECTION PERFORMANCE As depicted in Figure 7, we conduct an analysis of all prompts across the three dimensions involved in the task design. Each point in the figure represents one of the prompts. The x-axis signifies the proportion of bias as determined by manual annotation in the generated image, while the y-axis represents the proportion of bias detected by the agent. A distribution of scatter points near the diagonal line suggests that the accuracy of the agent closely aligns with that of manual annotation. As inferred from the figure, the performance of our agent does not significantly deviate from the results of manual annotation across the three social dimensions. Across the three social dimensions, the 7 \fUnder review average discrepancies between the proportion of stereotype annotations made by the agent and the proportion of manual labeling are 8.54%, 7.95%, and 10.13%, respectively. Despite the presence of bias in the annotation ratio, the overall accuracy in detecting whether the model contains stereotypes stands at 92.15%. This outcome highlights the potential of incorporating our proposed agent into practical bias governance frameworks. Additionally, we focus on the accuracy of two key tools, Intention Understanding and BLIP-based Detection, within the agent\u2019s reasoning trajectory. For Intention Understanding tool, we generate 120 instructions for evaluation, and 114 out of 120 instructions are accurately recognized. The remaining instances primarily involve misidentification of model names or pertain to open texts. For instance, the model name might be omitted, or the irrelevant content in the description is placed within the open text section. Gender Race Religion Figure 8: Classification accuracy of CLIP and BLIP on each subgroup, with darker shades denoting CLIP and lighter shades signifying BLIP. Different colors refer to different social dimensions. For BLIP-based Detection tool, the classification accuracy of each subgroup within this tool plays a crucial role in determining the ultimate efficacy of model stereotype detection. Consequently, our attention is primarily directed towards comparing the accuracy of two multimodal models, namely CLIP(Radford et al., 2021) and BLIP(Li et al., 2022). The performance comparison between two multi-modal models is presented in Fig.8. The results indicate that BLIP surpasses CLIP in all subgroup classification tasks, with an average improvement of 5%. Furthermore, BLIP exhibits a classification accuracy of approximately 80% in the majority of subgroup classification tasks. However, for confused samples, such as those where \u201cAsian\u201d and \u201cLatino\u201d classifications intersect, some \u201cAsian\u201d samples are misclassified as \u201cLatino\u201d, leading to a reduced average accuracy for the \u201cLatino\u201d category. Additionally, due to the limited training data available, the two models both exhibit lower classification accuracy for less popular religious subgroups such as \u201cHindu\u201d. 4.3 CASE STUDY OF MIDJOURNEY Based on the three social dimensions in the benchmark, we meticulously select the 60 most biased instruction pairs from our SPIG dataset. Our agent then uses these pairs to evaluate the stereotype degree of Midjourney. The evaluation results indicate that 46 out of the 60 pairs exhibit stereotypes, with 20 of them displaying the 100% stereotype ratio. This finding emphasizes the widespread presence of stereotypes, suggesting that despite Midjourney\u2019s advanced capacity to generate images of superior quality and detail, it also fails to successfully avoid stereotypes. For instance, when the prompt is \u201cthe person who is a cotton picker\u201d, all the generated images consistently depict \u2018African\u2019 descent. This result, similar to those observed in other open-source models, indicates that Midjourney also perpetuates serious racial stereotypes. These findings highlight the need for further research and development to mitigate the impact of stereotypes in AI-generated images. 5 RELATED WORK 5.1 STEREOTYPE IN VISION-AND-LANGUAGE Recent advancements in text-to-image models (Bianchi et al., 2023a) have been noteworthy, with these models finding utility across various domains. However, their capacity to generate socially biased content, leading to the reinforcement of harmful stereotypes, has raised concerns. Several studies have attempted to quantify the bias inherent in these models (Caliskan et al., 2017). 8 \fUnder review For instance, (Jha et al., 2023) conducted an evaluation of gender and racial biases in text-to-image models. Their methodology was based on the skew of gender and skin tone distributions in images generated from neutral occupation prompts. They employed both automated and human inspection to identify gender and skin tone in the generated images. Their findings indicated that Stable Diffusion tends to produce images of a specific gender or skin tone from neutral prompts more frequently than DALL-E. Similarly, (Ramesh et al., 2022) demonstrated that Stable Diffusion perpetuates harmful stereotypes related to race, ethnicity, gender, class, and intersectionality, even when using simple, neutral prompts. They also observed an amplification of these stereotypes. Their study further revealed that prompts mentioning social groups generate images with complex stereotypes that are challenging to mitigate. For example, Stable Diffusion associated specific groups with negative or taboo concepts such as malnourishment, poverty, and subordination. Notably, neither the introduction of \u201cguardrails\u201d against stereotyping in models like Dall-E (ElSherief et al., 2021), nor the careful expansion of user prompts, succeeded in reducing the impact of these associations. Previous research has extensively explored common stereotype characteristics, such as occupation and traits, and their effects on various subgroups distinguished by gender, race, and age. However, this approach to bias evaluation has its limitations, as it often neglects the more subtle stereotypes prevalent in everyday expressions. These biases frequently manifest in toxic content disseminated across various social platforms, including racial slurs. In this study, we introduce a novel form of bias, termed \u2018life-expressive bias\u2019, which is arguably more harmful and has been largely overlooked in previous research. Our methodology deviates from traditional approaches that rely on artificially constructed data. Instead, we construct a dataset of stereotype pairs, comprising \u2018stereotype content\u2019 and \u2018stereotype objects\u2019, derived from various toxic content datasets. This innovative approach has enabled us to establish a more comprehensive benchmark for quantifying the extent of model bias. 5.2 AUTONOMOUS LANGUAGE AGENT The recent surge in the popularity of language agents has led to the development of a diverse range of these agents, each designed to perform specific tasks. For instance, (Park et al., 2023) developed language agents to emulate human social behavior, while (Nakano et al., 2021) showcased the potential of constructing language agents capable of executing tasks on real websites following natural language instructions. Furthermore, (Qian et al., 2023) and (Hong et al., 2023) conducted experiments on software development in multi-agent communication settings, and (Zhou et al., 2023) constructed language agents to function as interactive writing assistants. Beyond task-specific language agents, recent open-source projects such as (Yang et al., 2023), (Talebirad & Nadiri, 2023), and SuperAGI5 have aimed to create autonomous agents capable of performing tasks to meet user requirements. The capabilities of agents to invoke multi-modal tools have been confirmed by recent studies such as Toolformer (Schick et al., 2023) and HuggingGPT (Shen et al., 2023). However, these agents are currently limited to processing only certain preliminary tasks or operations that conform to predefined rules. This limitation poses a challenge when planning and executing complex tasks. ReAct (Yao et al., 2022), SayCan (Ahn et al., 2022), and GPT4Tools, have demonstrated the feasibility of task reasoning and planning. Building upon the advancements in language agent development and the demonstrated capabilities of autonomous decision-making agents, our research introduces a novel language agent designed specifically for stereotype detection in text-to-image models. This agent leverages the power of LLMs and various tools to not only identify but also quantify the extent of stereotypes in generated images. 6" + }, + { + "url": "http://arxiv.org/abs/2305.18346v1", + "title": "Attention Paper: How Generative AI Reshapes Digital Shadow Industry?", + "abstract": "The rapid development of digital economy has led to the emergence of various\nblack and shadow internet industries, which pose potential risks that can be\nidentified and managed through digital risk management (DRM) that uses\ndifferent techniques such as machine learning and deep learning. The evolution\nof DRM architecture has been driven by changes in data forms. However, the\ndevelopment of AI-generated content (AIGC) technology, such as ChatGPT and\nStable Diffusion, has given black and shadow industries powerful tools to\npersonalize data and generate realistic images and conversations for fraudulent\nactivities. This poses a challenge for DRM systems to control risks from the\nsource of data generation and to respond quickly to the fast-changing risk\nenvironment. This paper aims to provide a technical analysis of the challenges\nand opportunities of AIGC from upstream, midstream, and downstream paths of\nblack/shadow industries and suggest future directions for improving existing\nrisk control systems. The paper will explore the new black and shadow\ntechniques triggered by generative AI technology and provide insights for\nbuilding the next-generation DRM system.", + "authors": "Qichao Wang, Huan Ma, Wentao Wei, Hangyu Li, Liang Chen, Peilin Zhao, Binwen Zhao, Bo Hu, Shu Zhang, Zibin Zheng, Bingzhe Wu", + "published": "2023-05-26", + "updated": "2023-05-26", + "primary_cat": "cs.CY", + "cats": [ + "cs.CY", + "cs.AI" + ], + "main_content": "Introduction The rapid development of the digital economy has also given rise to a large number of black and shadow Internet industries [Yip et al., 2012; Spagnoletti et al., 2022]. Digital risk management (DRM) is a technique to identify potential risks brought by these industries and develop risk management strategies using various advanced techniques such as machine learning (ML)[Van Liebergen and others, 2017; Mashrur et al., 2020] and deep learning (DL)[Yousefi et al., \u2217Equal contribution. \u2020Corresponding to bingzhewu@tencent.com. 1The case studies, comparisons, statistics, research and recommendations in this paper are provided \u201cas is\u201d and intended for informational purposes only and should not be relied upon as operational, marketing, legal, technical, tax, financial or other advice. 2019; Heaton et al., 2017]. A review of the entire evolution of the DRM architecture reveals that changes in the form of data have been one of the driving forces behind the evolution [Omar et al., 2018]. The data generated in the early Internet era was in a more homogeneous form, so the DRM framework of the time usually used handcrafted rule engines and simple statistical factors for risk identification and control [Lalanne et al., 2013]. However, the limitations of this framework included the restrictions of the rule engine and the subjectivity of human factor design. With the advent of search engines, social media and streaming media, huge amounts of multimodal data have started to appear in the Internet world and DRM framework has started to adopt data-driven technologies such as various ML algorithms to achieve more automated and efficient risk assessment and control. This architecture enables the detection of various aspects of customer credit and transaction risk through multi-dimensional data modelling and analysis [Zhu et al., 2021]. With the rise of mobile internet and internet finance, DRM systems are faced with more diverse and complex data forms such as graph structured data, unstructured data such as user behaviour and geolocation data [Hooi et al., 2017; Beutel et al., 2015]. As a result, the DRM architecture of this period incorporated various cutting-edge technologies such as deep learning, deep graph learning and natural language processing to achieve more accurate and robust risk detection . In recent years, the DRM architecture is no longer limited to a single institution, but emphasises building across data domains. The architecture enables cross-institution and cross-market risk identification and control by establishing data sharing and collaborative supervision mechanisms [Zhu et al., 2020]. The architecture also places greater emphasis on data security and privacy protection, establishing a multi-layered, multidimensional security system including secure multi-party computation (MPC) etc [Byrd and Polychroniadou, 2020; Volgushev et al., 2019]. DRM architectures mentioned above has achieved a great success in its time due to its accurate portrayal of data patterns, but with the recent rapid development of AIGC (AIgenerated Contents) technology, especially the emergence of phenomenal commercial products such as ChatGPT2 and Sta2https://chat.openai.com/chat arXiv:2305.18346v1 [cs.CY] 26 May 2023 \fble Diffusion3, the entire black and shadow industry has unprecedentedly powerful tools upstream and downstream, enabling these groups to personalise data based on traditional natural data for different scenarios such as fraud and money laundering [Pegoraro et al., 2023], generating images, conversations and other data that would be even indistinguishable to human experts and advanced AI models [Sun et al., 2023]. Taking a real-industry case that covers online dating apps as an example, the perpetrators can generate personalized mutimodal content such as text, pictures and videos based on the preferences of victims, and even develop and customize the chatbots\u2019 language styles to automatically interact with victims. As a result, the future DRM system will be confronted with the most complex and vast amount of AIGC data ever recorded in human history. At such a turning point, it is important for all stakeholders to start thinking about how to transform the future risk control architecture so that it can control risk from the source of data generation. There is also a need for better risk warning mechanisms and strong AI technology to enable rapid response and adaptation to the fast changing risk environment. To help researchers and risk control practitioners understand the new digital risks posed by AIGC more comprehensively and concretely, this paper provides a comprehensive analysis of the challenges and opportunities presented by AIGC from a technical perspective, targeting key scenarios along the upstream, midstream and downstream critical paths of black/shadow industries. We offer two perspectives on the changes that AIGC brings to existing DRM systems. Firstly, we will explore the new black and shadow techniques triggered by generative AI technology. As generative AI technology can generate high-quality false information, black/shadow industries are beginning to use it in activities such as fraud and cyber attacks [Chen et al., 2023]. We will throughly analyse the characteristics and dangers of these new techniques. Then we will provide some insightful aspects for building the next-generation DRM system. We hope that this paper will provide further inspiration and future directions for academia, industry and the regulatory community to improve existing risk control systems for non-AIGC data. 2 Background 2.1 Large Language Model Large Language Models (LLMs) have become the core technology in the field of Natural Language Processing (NLP). These models are pre-trained on large amounts of text data, allowing them to learn rich language knowledge and semantic information. Subsequently, through a fine-tuning process, these models can be applied to various NLP tasks such as machine translation, text summarization, and sentiment analysis. The typical representative of large language models is the Transformer-based model, such as OpenAI\u2019s GPT series (such as GPT-3[Brown et al., 2020] and GPT-4) and Google\u2019s BART[Lewis et al., 2019]. These models utilize self-attention mechanisms and deep learning techniques to capture long-distance dependencies and complex semantic 3https://stablediffusionweb.com/ structures in text. In addition, these models typically have billions or even hundreds of billions of parameters, enabling them to effectively learn on large-scale datasets. 2.2 Pipeline of black/shadow industry Generally, risk activities in black/shadow industries can be divided into three stages: upstream, midstream, and downstream. The upstream stage involves preparing prior knowledge and materials, the midstream stage involves advertising to attract potential victims, and the downstream stage involves specific fraud implementation. The upstream stage is primarily focused of preparation, including the collection of various types of personal information and registration of accounts on different platforms. Personal information is often collected from multiple sources and in different formats. Previous methods [Li et al., 2020] required complex, rule-based extraction techniques to organize the data and extract potentially useful information. However, the use of LLMs enables structured processing of this messy data and automatic extraction of useful information. With the development of network services, fraudulent activities increasingly require the participation of social platforms. This allows for contact with more potential victims through network services, and various types of accounts are needed for online fraud. Therefore, in the upstream stage, perpetrators register numerous accounts across multiple platforms. In order to avoid being identified as abnormal accounts, they often adopt the method of imitating normal user behaviors to camouflage themselves, such as randomly adding normal users and interacting with them, reposting others\u2019 content, or posting fixed content. However, these behaviors are still templated, which can be easily detected, and it is difficult to generate sufficiently authentic and attractive content. Based on LLMs, perpetrators can edit personal profiles according to the preferences of the target group, which makes victims more confident in the identity disguised by the perprtrators. During the midstream stage, black/shadow industries primarily use various types of accounts obtained in the upstream stage to promote advertisements and attract potential victims. The target of advertising can be previous registered fraudulent accounts or illegal websites, such as gambling sites, to earn illegal profits. For instance, the perpetrators typically attempts to acquire a more private communication method, such as email or phone number to build trust with the victims. In this scenario, private accounts used for communication will be used as advertising content. These contents often contain harmful or harassing information and are easily detected by anomaly detection. Traditional methods [Wang et al., 2023] often use the difference between human and machine perception to transform malicious content through text adversarial methods while retaining the original semantics, in order to evade content anomaly detection. In addition, a lot of advertising information is inserted into pictures or videos, which further increases the difficulty of detection. However, these methods always face the problems that the content is repetitive, and it does not fit the current topic. By using LLMs, the analysis of current popular topics can be performed, and the advertising content can be polished to include relevant themes. 2 \fMidstream: attracting Downstream: defrauding Upstream: preparing Click this l1nk to win \ud83d\udcb0200 18 Information acquisition Account camouflage Target info Telecom Fraud Selling Illegal Content Property Pilfer Multi-platform advertising Manipulating public opinion Registration chat Figure 1: Three stages of traditional fraud methods of black/shadow industries The downstream stage involves the implementation of specific fraudulent actions. Based on the upstream and midstream work, the perpetrators complete the required material (e.g. victims\u2019 group information and fraudulent accounts) preparation and promotion. Perpetrators carry out various illegal activities for profit. Common risky behaviors include telecom fraud [Jiang et al., 2023], illegal content sales [La Morgia et al., 2021], property pilfer [Kim et al., 2017], and manipulation of public opinion [Cui and Kert\u00b4 esz, 2022]. The successful implementation of the fraudulent behaviors requires a lot of expert experience and human participation. However, based on the powerful dialogue ability of LLMs, perpetrators can establish chat robots to chat with victims. In addition, perpetrators can fine-tune specialized robots with fraudulent purposes based on existing open source models(e.g. LLaMA [Touvron et al., 2023]) and past fraud cases, further reducing the cost of fraud. 3 How Generative AI Reshapes Today\u2019s Shadow Industry Ecosystem? With the emergence of LLMs, there are many traditional methods of the black/gray industries that can be replaced by LLMs to achieve higher efficiency and economy. At the content level, LLMs can directly achieve content creation that used to require a lot of human involvement. Moreover, this process is parallel and batch-oriented, which greatly benefits the malicious operation of the black/gray industries. In this section, we will analyze the use of LLMs in assisting malicious activities in the upstream, midstream, and downstream of the black/gray industries. 3.1 Threat Model In order to illustrate how black/shadow industries use LLMs to enhance the ability of risky behaviors to camouflage and defraud, we set \u201dperpetrator\u201d as the risky behavior entity. In different risky scenarios, although the perpetrator relies on different information, they are all related to the personal information of the victims and the purpose information of the task. To provide a more intuitive demonstration of the implementation process, we conducted two case study on Romance scam and Customer Service Scam. Romance Scam As a research case, we firstly focus on romance scam, which is a common form of fraudulent activities. Perpetrators employ fake online identities to gain the affection and trust of their victims, and then they use the semblance of romance or intimacy to manipulate and steal from victims. Based on the powerful analysis and dialogue capabilities of LLMs, perpetrators can use massive user information on social media to customize more personalized social accounts that meet the preferences of victims. And it can be automated for more believable conversations. Customer Service Scam In addition to the Romance Scam, we have selected another scenario for our case study, which we refer to as the Customer Service Scam. This type of fraud involves the perpetrator impersonating a staff member of an online shopping platform to deceive the victim. The scenarios can include various fraudulent activities, such as gift-giving, free experiences, installment payments, after-sales refunds, and others. For this study, we have chosen the after-sales refund scenario. In these scenarios, we assume that the information available to the perpetrators and the goals of the risk activities are as follows: \u2022 Available information: Personal information about the victims\u2019 social media content information, purchase records, etc. \u2022 Goals: Getting the victims to send money to the perpetrators or committing fraud against the perpetrators. 3.2 Upstream As depicted in Fig.2(left), the upstream mainly includes two processes of data processing and account preparation. By conducting content analysis of potential user profiles and platforms, we extract the requisite information for the entire process of black/shadow industries and customize accounts across diverse platforms. Data processing Data processing is mainly to provide sufficient prior information for the whole process, including the classification and summary of the characteristics of different victim groups and the analysis of platform information. 3 \fFigure 2: Three stages of enhanced fraud methods by LLMs of black/shadow industries. In order to better illustrate the role of each element in each step, we use the same color as the corresponding element in the diagram in the specific prompt template, such as Consistency Check . Taking the Twitter scene in Romance scam as an example, the perpetrator employs a three-pronged approach to collect data, including popular post content, posts of each topic or section, and potential victim groups based on selected related attributes. The content collected from posts on social media platforms often includes non-textual multimodal data, such as pictures and videos. These types of data can provide additional context and information that perpetrators can use to their advantage. To process this data, perpetrators can utilize multimodal techniques, such as OCR-Donut-CORD [Kim et al., 2021], to generate captions for pictures in posts and add them to the text content in the original posts. The perpetrators can then employ LLMs to analyze the language style of the platform. LLMs are powerful tools that can help perpetrators to identify patterns in the language used on the platform, such as common phrases, slang, and other linguistic features. By analyzing the language style of the platform, perpetrators can better understand the culture and norms of the platform, which can help them to blend in and avoid detection. For the subject content of each topic or section, perpetrators can also use LLMs to analyze and summarize the corresponding subject content. This approach can help perpetrators to identify the key topics and themes being discussed on the platform, which can provide valuable insights into the interests and concerns of potential victims. By understanding the content of the current topic being discussed, perpetrators can tailor their messages and communications to better appeal to potential victims. The following is an example of the prompt template for analyzing platform style and subject content: Perpetrator agent: As a twitter content analysis expert, please summarize the format and language style of the most popular posts on Twitter below: {Posts\u2019 content}. Output: Platform style Perpetrator agent: As a twitter content analysis expert, the topic of the current post is # Topic, please analyze the content of the topic being discussed in the following posts: {Posts\u2019 content}. Output: Subject content of each topic To identify potential victim groups, the perpetrator select a group of users whose attributes match the selected related attributes, such as those following the girls about dancing videos. These attributes correlate with the likelihood that victim will suffer from romance scams. We collect the content of these users\u2019 likes, post content, the self-introduction information of following users. The perpetrator uses the multimodal model to process the above content of each person into structured text information. To effectively capture diverse information pertaining to distinct user groups and facilitate the creation of tailored accounts that cater to groups\u2019 preferences, we introduce the Group Profile Cards. Each card contains keys such as age, gender, education level, type of follower, favorite content, etc, which can more completely describe the preference information of the corresponding group. Then the perpetrator analyzes group data after structured pro4 \fcessing based on LLMs and generate corresponding group profile cards. These cards also can be used to identify potential victims of Romance scams on Twitter. The following is an example of a specific prompt template. Perpetrator agent: As an anti-romance scam assistant, your task is to classify these people and create corresponding group information cards based on the personal information provided to you. The classification basis includes {keys} Each information card is displayed in the form of json. Here are several cases of cards for your reference: Demonstrations. Output: { JSON file: Group profile cards } Account preparation After obtaining group profile cards during the data processing phase, the perpetrator can register a corresponding social account separately for each group, and tailor personal profiles and post content that aligns with group\u2019s characteristic and preferences. To illustrate, consider the Twitter scenario in the context of Romance scams. Specifically, LLMs can generate nicknames, self-introductions, and prompts of image generative artificial intelligence tools, e.g. Midjourney [], for avatar descriptions based on the corresponding group profile cards. This is a demonstration of prompt template of generating account profile. As an anti-romance scam expert, try to analyze what kind of virtual accounts scammers will create for {Group profile cards}. Please give the results in the following format: {\u201cname\u201d: [ ], \u201cbio\u201d: [ ], \u201cmidjourney descriptors for avatar images\u201d: [ ]. Here are a few examples: Demonstrations. Output: Account profile To enhance the credibility of fraudulent accounts, the perpetrator also publish personalized content that aligns with the preferences of the corresponding group and the account profile. This approach serves a dual purpose: firstly, it enables the account to behave more like a legitimate and active one, thereby enhancing its camouflage; secondly, it can also make the victim more interested in the account in downstream tasks. The below is a instance of prompt template for generating posts. Perpetrator agent: You are a twitter user, the language style of the platform is {Platform style}. Your account profile is {Account profile}. Your followers\u2019 profile cards is {Group profile card}. You want to attract more users of same type to follow you. Please Write some post content to achieve this. Remember that posts\u2019 content should be consistent with followers\u2019 preferences and your account profile. Output: Posts\u2019 content 3.3 Midstream In the intermediate stage, conventional approaches rely on disseminating advertisements across multiple platforms to expand the reach of fraudulent accounts and target a larger pool of potential victims. However, the homogeneity of the content generated through this method often fails to attract a sufficient number of users. Meanwhile, when the current topic aligns more closely with our advertising targets, it will attract greater attention. To address this issue, referring to the middle of the Fig.2, the perpetrator firstly decide which topic to promote based on LLMs, which can be formatted as: Perpetrator agent: Please act as a professional marketer of Twitter platform, your promotion is {Target promotion info}, and the existing hot topics and their main content are: {Topic: Subject content}, please decide which topics can get better promotion results by posting. Output: Selected Topic Then utilizing the subject content of corresponding topic obtained from upstream sources, LLMs are employed to generate marketing content that is tailored to specific target promotion infomation, which can be formatted as: Perpetrator agent: Please act as a content creator on the Twitter platform, where the language style is {Platform style}. Your goal is to get as many people as possible to follow you. The discussion topic for the current topic is {Subject content}. Please write the corresponding advertising posts. Output: Advertising posts\u2019 content 3.4 Downstream After completing the preliminary preparation work and diverting media to add friends to these accounts, a suitable group of scammers can be identified after midstream (i.e., the victims who answer the fake massage). Subsequently, as illustrated in the right part of Fig.2, the personal privacy information of the targets will be collected to achieve personalized customization, and the Victim Information Card {\u201cname\u201d: [ ], \u201cage\u201d: [ ], \u201cgender\u201d: [ ], \u201caddress\u201d: [ ], \u201ccontact\u201d: [ ], \u201chobby\u201d: [ ], \u201cflaws\u201d: [ ], \u201ceducation\u201d: [ ], \u201coccupation\u201d: [ ], \u201cfinance\u201d: [ ]} will be initialized for communicating with the victim through dialogue robots to implement fraud. During the communication process (i.e., Chat), in order to ensure that virtual accounts are more likely to gain the trust of victims, the model will adjust the content of the victim\u2019s information card based on user feedback and update the content posted on social media accordingly. Victim Information The advent of large models has made it easier and more effective to develop personalized fraud plans. Compared to a fixed form of fraud targeting all individuals or individuals within a certain group, personalized fraud schemes are more difficult to detect. Developing personalized fraud schemes requires structured user information. In the following paragraphs, we 5 \fwill explain how to use LLM for structured information processing, which is illustrated in Fig. 2(right top). Firstly, personal information of victims can be obtained through various means, including crawling information about victims on social media, stealing user personal information such as browsing records through various applications, and purchasing through illegal personal information markets such as personal express orders. Through these channels, unstructured data about the target can be obtained, which termed as Information acquisition. As LLMs lack detailed information about the victim, they do not directly complete this step. Instead, a script will be employed to collect the necessary information. Next, these data can be converted into content that LLMS can process smoothly. Although some service providers currently offer large models that support multimodal input, the mainstream large model services still focus on text-only input. However, even if a large model only adapts to text input, the perpetrators can still convert these modal data into text data that the large model can easily understand through Multimodal APIs, which can be achieved by open-access APIs, such as HuggingGPT[Shen et al., 2023]. Finally, the perpetrators can submit these scattered pieces of information to the LLMs for structured processing, and obtain an information card containing as much detailed information as possible about the victim. Specifically, after obtaining the text of various victim information through the previous steps, the large model can use this information to generate a JSON file termed as Victim Information Card that contains various user information for personalized fraud in the future, and the template can be formatted as: Perpetrator agent: Please assist me in organizing scattered information, such as news articles, about a particular individual, as my information analysis assistant. The output should be in JSON format, with the keys being {keys}. If certain keys\u2019 information cannot be obtained, their corresponding values should be null. Output: {JSON file: Victim Information Card} Personality Adaptation After collecting and processing personal data, we have obtained information cards of various individuals. Subsequently, we can customize personalized fraud plans based on these information cards and execute the crimes. However, it is often not possible to achieve an optimal design for a personalized fraud scheme based solely on the initially collected information. Therefore, it is necessary to continuously optimize the details of the crime process based on newly collected information and user feedback during the fraud process. This paper refers to the ultimate form of truly personalized fraud methods as Personality Adaptation as illustrated in Fig. 2(right bottom). To begin with, after establishing contact with the victim through the basic camouflage account prepared in the upstream stage, the camouflage account communicates with the victim in a finely-tuned language style and disguised character personality based on the user\u2019s information card. Specifically, upstream disguised accounts often target a certain group rather than an individual, meaning that each person has their own reminder. At this point, relevant fine-tuning can be added to the instructions of the robot conversation, such as the other person\u2019s personality and interests, making it easier for the disguised account to gain the trust of the victim, and the template can be formatted as: Perpetrator agent: Please design the speaking style of the person most likely to appeal to the user based on their information card. The user\u2019s information card is as follows: {Victim Information Card}. Output: Bot with Specific Speaking Style Next, the disguised account initiates the Chat stage with the user, engaging in multiple rounds of conversations and recording the user\u2019s feedback to achieve the goal as much as possible while ensuring that their robot identity is not recognized. Based on the new information obtained from user feedback, the model adjusts the Victim Information Card and finetunes the group information card, and the template can be formatted as: Perpetrator agent: As an information analysis assistant, I will provide you with a user information card and a history of our conversation with this user. Your task is to update the values in this information card based on the conversation history. Do you understand your assignment? LLM: Certainly, I understand. Please provide the user\u2019s information card and conversation history, and I will endeavor to update the values in the information card based on the conversation records. Perpetrator agent: {Victim Information Card, Chat history} Output: Updated Victim Information Card Finally, the language style and personality characteristics of the conversation robot are adjusted based on the updated information content, and content that matches the victim is continuously published on social media with Consistency Check as same as upstream to further gain the target\u2019s trust and successfully complete the fraud task. 4 Insights for Building Next-generation DRM System As mentioned above, shadow industry ecosystem will undergo a comprehensive transformation in the era of AIGC. Correspondingly, in order to maintain social stability and ensure public safety, the next generation of DRM systems must also make new adjustments to adapt to protect people. In this section, we introduce some enlightening introductions from the perspectives of different Defender agents (1) AIGC service providers, (2) social media service managers, and (3) security service provider, to assist researchers in contemplating how to establish a new generation of DRM systems. 6 \fWe describe the defense from the three perspectives as fundamental defense, filtering defense, and active defense. The defense provided by AIGC service providers is the most fundamental defense. Effective defense by AIGC service providers can increase the cost of malicious behavior and reduce its flexibility. The defense of social media service providers is a filtering defense aimed at blocking risks and user contact on a large scale, such as content filtering and recommendation filtering. Security service defense is an active defense that is directly deployed on the user\u2019s personal end and requires the user\u2019s participation. It is the last line of defense for users who are exposed to risks and its objective is to proactively mine more information in order to identify potential risks. In this section, we provide only a brief introduction to traditional defense methods, with a primary focus on the changes that AIGC brings to the new generation of DRM systems. 4.1 Foundational Defense: AIGC Service Providers With the increasing availability of open-source generative models, it has become easier for individuals or small organizations to establish and deploy AIGC systems. However, it is certain that the performance of these systems is inferior to that of AIGC systems provided by service providers. Therefore, the defense of service providers includes two perspectives: (1) implementing fundamental defense to prevent being exploited by perpetrators, and (2) utilizing their own more powerful capabilities to empower risk defense in other dimensions (e.g., provide knowledge to smaller models). From the perspective of AIGC service providers, on the one hand, service providers should strike a balance between protecting user privacy and identifying illegal users. For example, they may require more personal information on the premise of not infringing on privacy to be bound to a new account registration than just an email address, and limit access rates by identifying user network and hardware addresses. These methods will significantly increase the cost of illegal behavior for perpetrators, forcing them to reconsider the AIGC systems they use. On the other hand, AIGC service providers must ensure that their models are sufficiently secure and reliable, and are not susceptible to malicious manipulation by perpetrators resulting in the output of illegal content (i.e., jailbreak4). Recently, a continuous stream of jailbreak prompts have been discovered by users, making this objective particularly challenging, especially in complex open environments where model utility must also be considered. Therefore, service providers are required to update their services in real-time and patch any vulnerabilities in their systems. Timeliness is crucial, as service providers must identify them and take action before they cause significant damage. AIGC service providers possess relatively powerful model systems that can assist low-cost service systems. Taking the LLMs system as an example, data can be accumulated through adversarial strategies. Specifically, the large model can be distributed to play the roles of red/blue teams, simulating the process of malicious implementation. The resulting 4https://www.jailbreakchat.com process data can then be used as data for other AIGC service providers or even the large model itself to better handle these scenarios. An example of dialog generation is provided below: Defender agent: (To Red team) {Jailbreak instruction} Please act as {Bad guy}, your goal is {Tasks}. Defender agent: (To Blue team) Please act as {Defender}, your goal is {Tasks}. Red team: Hi, may I \u00b7 \u00b7 \u00b7 Blue team: Hi, I \u00b7 \u00b7 \u00b7 Red team: \u00b7 \u00b7 \u00b7 Blue team: \u00b7 \u00b7 \u00b7 4.2 Filtering Defense: Social Media Service Managers Thoroughly eliminating risks cannot be achieved solely through the efforts of AIGC service providers, as it requires collaborative efforts across all stages, in which social media plays a crucial role. Compared to traditional methods such as distributing leaflets and making phone calls, disseminating information and attracting attention on social media is not only more covert, but also enables the rapid identification of suitable victim groups. Social media service providers can filter the content posted by perpetrators and to content recommended to users during this process, preventing risky information from being exposed to users and implementing a filtering defense mechanism in the process of transmitting risky information to users. Here, we provide two examples from different perspectives, namely account filtering and content filtering. Account filtering. As discussed in Sec. 3.2, the perpetrator will prepare many accounts for downstream tasks. These accounts typically exhibit relatively obvious characteristics, such as inconsistent content and low posting frequency. Early filtering of such accounts can prevent perpetrators from using these accounts to disseminate illegal information. Content filtering. In the midstream, perpetrators typically attempt to mix the content of their attraction targets with normal content in order to achieve their attraction goals. In this process, filtering articles that hide content for attraction can be effectively achieved by conducting topic consistency audits. This process can be performed by LLMs, and an example template is provided below: Defender agent: Please assume the role of a content reviewer and check whether the following content contains any paragraphs that are irrelevant to the topic. The content is as follows: {Content} 4.3 Active Defense: Security Service Provider If risky content manages have evaded previous detection and reaches the user, there is still one last barrier to protect the user\u2019s safety. Security service providers can offer a variety of security assistants to help users defend against the occurrence of risks. One effective way is to use LLMs as personal 7 \fassistants and engage in conversations with strangers, proactively obtaining more information from the other party during the conversation, in order to accurately identify whether the other party poses a risk. Virtual Receptionist. The existence of security risks and time wastage associated with human reception of risky phone calls, such as fraudulent calls, has prompted the development of AI-powered call filtering systems. Specifically, the development of AI-guided call reception robots by AIGC has made it possible to filter out harmful calls. It can be endowed with specific personalities to act as user assistants. When an unfamiliar call is received, the robot first answers the call and assesses the risk level. If the call is deemed safe, the conversation history is sent to the user, and the call is transferred to the user for further communication. Sometimes it may not be effective, because the model needs to know specific information about the user, such as whether the user has purchased a mobile phone and whether the phone has encountered any problems. However, uploading all user information to the model is clearly cumbersome and poses a risk of leakage. A suitable alternative is to allow the model to first assume the negation of any situation proposed by the user, in an attempt to persuade the user to abandon their illegal behavior. Only when the user has no flaws in this situation should they be allowed to access the model. For example, the following instruction can be given: Defender agent: {Scenario description}. Please chat with the caller and try to make the caller believe that you are me. Always remember that your task is to {Detailed description}. Do you understand your task? LLM: Yes, I understand the nature of my task. Defender agent: Caller: {Content} LLM: \u00b7 \u00b7 \u00b7 5" + } + ], + "Aochuan Chen": [ + { + "url": "http://arxiv.org/abs/2310.02025v4", + "title": "DeepZero: Scaling up Zeroth-Order Optimization for Deep Model Training", + "abstract": "Zeroth-order (ZO) optimization has become a popular technique for solving\nmachine learning (ML) problems when first-order (FO) information is difficult\nor impossible to obtain. However, the scalability of ZO optimization remains an\nopen problem: Its use has primarily been limited to relatively small-scale ML\nproblems, such as sample-wise adversarial attack generation. To our best\nknowledge, no prior work has demonstrated the effectiveness of ZO optimization\nin training deep neural networks (DNNs) without a significant decrease in\nperformance. To overcome this roadblock, we develop DeepZero, a principled ZO\ndeep learning (DL) framework that can scale ZO optimization to DNN training\nfrom scratch through three primary innovations. First, we demonstrate the\nadvantages of coordinatewise gradient estimation (CGE) over randomized\nvector-wise gradient estimation in training accuracy and computational\nefficiency. Second, we propose a sparsityinduced ZO training protocol that\nextends the model pruning methodology using only finite differences to explore\nand exploit the sparse DL prior in CGE. Third, we develop the methods of\nfeature reuse and forward parallelization to advance the practical\nimplementations of ZO training. Our extensive experiments show that DeepZero\nachieves state-of-the-art (SOTA) accuracy on ResNet-20 trained on CIFAR-10,\napproaching FO training performance for the first time. Furthermore, we show\nthe practical utility of DeepZero in applications of certified adversarial\ndefense and DL-based partial differential equation error correction, achieving\n10-20% improvement over SOTA. We believe our results will inspire future\nresearch on scalable ZO optimization and contribute to advancing DL with black\nbox. Codes are available at https://github.com/OPTML-Group/DeepZero.", + "authors": "Aochuan Chen, Yimeng Zhang, Jinghan Jia, James Diffenderfer, Jiancheng Liu, Konstantinos Parasyris, Yihua Zhang, Zheng Zhang, Bhavya Kailkhura, Sijia Liu", + "published": "2023-10-03", + "updated": "2024-03-15", + "primary_cat": "cs.LG", + "cats": [ + "cs.LG" + ], + "main_content": "INTRODUCTION In the realm of machine learning (ML), optimization algorithms have played a crucial role in enabling the training of complex models, yielding unprecedented insights and predictive capabilities across diverse domains. Over the years, first-order (FO) gradient-based methods, such as stochastic gradient descent (SGD) and its variants (Gardner, 1984; Amari, 1993; Bottou, 2010; 2012), have become the default choice for model training. These methods rely on gradient information to iteratively update model parameters, aiming to minimize a given loss function. Nonetheless, several practical settings exist where FO gradient information is either unavailable or infeasible to compute, calling for alternative strategies. Zeroth-order (ZO) optimization (Flaxman et al., 2005; Shamir, 2013; Ghadimi & Lan, 2013; Nesterov & Spokoiny, 2015; Duchi et al., 2015; Liu et al., 2018b; Ilyas et al., 2018b; Zhang et al., 2024) has emerged as a promising approach to address these challenges, as it leverages finite differences of function values to estimate gradients, rather than requesting explicit gradient information. Therefore, with minor modifications to FO algorithms, ZO optimization can be applied to various real-world circumstances where FO gradients are difficult to obtain. For example, in disciplines like physics and chemistry, ML models may interact with intricate simulators or experiments where the underlying systems are non-differentiable (Thelen et al., 2022; Tsaknakis et al., 2022; Louppe et al., 2019; Abreu de Souza et al., 2023; Baydin et al., 2020). Additionally, black-box learning scenarios often arise when deep learning (DL) models are integrated with third-party APIs, such as adversarial attack and defense against black-box DL models (Chen et al., 2017; Ilyas et al., 2018a; Zhang et al., 2022c; Verma et al., 2023) and black-box prompt learning 1 arXiv:2310.02025v4 [cs.LG] 15 Mar 2024 \fPublished as a conference paper at ICLR 2024 Acceleration: Parallelization and Feature Reuse Gradient Collection Frozen Features Active Features \u2113(\ud835\udf3d\ud835\udc56) Forward Pass Backpropagation ZO Gradient Estimation Query Based ZO Optimization A Model Pruning Guided Sparsity Active Param. Dormant Param. B C \u2026 Data Process 2 Process 1 Process 4 Parameter Allocation Process 3 Process N D Comparison with Other Methods Computational graph FREE Computational graph BASED Figure 1: Overview of our DeepZero framework. A: ZO gradient estimation via model queries (Sec. 3). B: Model pruning guides gradient sparsity (Sec. 4). C: Acceleration by parallelization and feature reuse (Sec. 5). D: DeepZero comparison with the computational graph free baseline Pattern Search (Chiang et al., 2023) and computational graph dependent methods without BP, Align-Ada (Boopathy & Fiete, 2022), LG-FG-A and FGW (Ren et al., 2022), on CIFAR-10. for language-model-as-a-service (Diao et al., 2022; Sun et al., 2022). Furthermore, the principled backpropagation (BP) mechanism (Amari, 1993; Rumelhart et al., 1995) for calculating FO gradients may also not be supported when implementing DL models on hardware systems (Gu et al., 2021b; Tavanaei et al., 2019; Greengard, 2020; Jabri & Flower, 1992; Gu et al., 2021c). In addition to ZO optimization, another relevant research direction in the field of DL focuses on developing biologically-plausible, BP-free methods. Examples include forward gradient-based methods (Ren et al., 2022; Baydin et al., 2022; Silver et al., 2021; Belouze, 2022), greedy layer-wise learning (N\u00f8kland & Eidnes, 2019), and Hebbian learning (Isomura & Toyoizumi, 2018; Moraitis et al., 2022). However, these techniques require access to computational graphs and are highly dependent on the used DL software frameworks and/or model architectures. In contrast, ZO optimization solely relies on model queries and is free of computational graphs utilized. As a result, ZO optimization has broad applicability to DL problems that involve black-box query-only components. Despite the promise of ZO optimization, scalability bottlenecks hinder its application in medium or large-scale DNN training (Wang et al., 2017; Liu et al., 2018b; Ohta et al., 2020; Cai et al., 2021; Zhang et al., 2022c). As problem dimensionality increases, the accuracy and efficiency of traditional ZO methods deteriorate. This is because ZO finite difference-based gradient estimates are biased estimators of FO gradients, and the bias becomes more pronounced in higher-dimensional spaces (Liu et al., 2018b; Cai et al., 2021; Balasubramanian & Ghadimi, 2018). These challenges motivate the central question addressed in this work: (Q) How to scale up ZO optimization for training deep models? To address (Q), we propose a novel framework, \u2018DeepZero\u2019, which infuses novel model pruning and parallel computing techniques to scale up ZO DNN training (see Fig. 1 for a schematic overview). Our main contributions are summarized below. \u2776We show that deterministic coordinate-wise gradient estimation (CGE) outperforms vector-wise randomized gradient estimation (RGE) in both accuracy and computation efficiency when scaling to deep model training. Further, CGE becomes increasingly advantageous as model depth increases. \u2777We show that sparsity is crucial for realizing model training via CGE with finite differences. In contrast to prior work, we find that sparsity for black-box models can be obtained for \u2018free\u2019 by extending the current pruning-at-initialization technique to the ZO learning paradigm. The established synergy between pruning and CGE presents a promising avenue for efficient ZO training of DNNs. \u2778We identify the parallelization-fit property inherent to CGE-based ZO optimization and propose a novel forward parallelization method based on this property. Our framework enables feature reuse in deep learning, which further accelerates parallel training by eliminating redundant computations. \u2779We introduce our proposed ZO deep model training framework, \u2018DeepZero\u2019. To demonstrate the empirical superiority of DeepZero, we conduct extensive experiments on both standard image classification benchmarks and real-world black-box DL applications. For example, when employing 2 \fPublished as a conference paper at ICLR 2024 DeepZero to train a ResNet20 on CIFAR-10, we obtain 86.94% testing accuracy, the best reported in the literature of gradient-free model training. We also exemplify the vast potential and practical impact of DeepZero in two real-world DL tasks: black-box defense for adversarial robustness (Zhang et al., 2022c) and physics-informed DL with solver-in-the-loop (Um et al., 2020). To clarify, our work aims to extend the scalability of ZO optimization for DL applications, addressing cases where FO optimization becomes challenging or infeasible. Yet, it is essential to note that the proposed advancements in ZO training are not intended to overcome the ultimate scalability challenges to train deep networks at any scale. 2 RELATED WORK Classical gradient-free optimization. Early research efforts can be broadly categorized into two groups: direct search-based methods (DSMs) and model-based methods (MBMs) (Wright et al., 1999; Conn et al., 2009; Rios & Sahinidis, 2013; Larson et al., 2019). DSMs include techniques like coordinate (Fermi, 1952) and pattern search (Torczon, 1991) methods and the Nelder-Mead simplex method (Nelder & Mead, 1965). MBMs consist of model-based descent (Bortz & Kelley, 1998) and trust region (Conn et al., 2000) methods. Evolutionary optimization offers a generic populationbased gradient-free computational framework including genetic algorithms (Grefenstette, 1993) and particle swarm optimization (Vaz & Vicente, 2009). Bayesian optimization (Shahriari et al., 2015; Eriksson et al., 2019) has garnered recent attention by using a Gaussian process (GP) to fit a blackbox objective function and estimate an optimization solution. However, acquiring an accurate GP is computationally intensive. Zeroth-order optimization. In contrast to classical gradient-free methods, ZO optimization approximates gradients using finite differences, simplifying implementation by minimizing modifications of FO gradient-based algorithms. Like FO methods, ZO enjoys provable convergence guarantees (Nesterov & Spokoiny, 2017; Duchi et al., 2015; Liu et al., 2020a). ZO optimization has gained significant attention for its success in solving various emerging ML problems (Ghadimi & Lan, 2013; Nesterov & Spokoiny, 2015; Flaxman et al., 2005; Duchi et al., 2015). Examples include adversarial attack and defense (Chen et al., 2017; Tu et al., 2019; Ye et al., 2018; Ilyas et al., 2018a; Zhang et al., 2022c; Verma et al., 2023; Zhao et al., 2019; Hogan & Kailkhura, 2018; Shu et al., 2022), model-agnostic contrastive explanation (Dhurandhar et al., 2019), visual prompting for transfer learning (Tsai et al., 2020), computational graph unrolling (Vicol et al., 2023), automated ML (Gu et al., 2021a; Wang et al., 2022), policy search in reinforcement learning (Vemula et al., 2019), network resource management (Liu et al., 2018b), ML-based scientific workflow optimization (Tsaknakis et al., 2022), and on-chip learning (Gu et al., 2021b). Despite ZO\u2019s successes in solving ML problems, its application has been limited to relatively small scales. For instance, ZO optimizers used for generating adversarial attacks, contrastive explanations, and visual prompts only operate in the input parameter space, which has the dimension of a single input example. Some acceleration techniques have been developed to improve ZO performance in larger problems, such as using historical information to enhance a ZO gradient estimator (Meier et al., 2019; Cheng et al., 2021), and exploiting gradient sparsity to reduce ZO dependence on problem size (Wang et al., 2017; Cai et al., 2022; 2021; Balasubramanian & Ghadimi, 2018; Ohta et al., 2020; Gu et al., 2021b). While gradient sparsity has been used to improve scalability (Bartoldson et al., 2023), we propose an advanced strategy that leverages model pruning techniques to identify and exploit sparsity in neural network parameters effectively. Our approach is less restrictive than traditional gradient sparsity assumptions and allows for greater flexibility in selecting what to prune. To the best of our knowledge, no prior work has demonstrated the practicality of scalable ZO optimization for deep model training without significant performance loss compared to the FO counterpart. DL without backpropagation. Forward gradient learning (Baydin et al., 2022; Ren et al., 2022; Silver et al., 2021; Belouze, 2022), which builds upon the forward-mode automatic differentiation (AD) capabilities of current DL software frameworks, does not rely on finite differences to approximate FO gradients like ZO optimization. Instead, it relies on forward-mode AD to calculate a forward (directional) gradient. This gradient is obtained by projecting the FO gradient onto a direction vector and is an unbiased estimator of the FO gradient (Baydin et al., 2022). In contrast, ZO gradient estimation based on finite differences is biased (Duchi et al., 2015; Liu et al., 2020a). However, one main limitation of forward gradient learning is that it requires full access to AD software and the deep model, making it impractical for solving black-box DL problems. Recent advances in (Ren et al., 2022) further improved the scalability of forward gradient learning by using finer-level model 3 \fPublished as a conference paper at ICLR 2024 information to design architecture-specific local objective functions. Other BP-free DL methods are motivated by seeking a biological interpretation of DL but share similar limitations with forward gradient learning. Some examples include greedy layer-wise learning (N\u00f8kland & Eidnes, 2019), input-weight alignment for wide neural networks in the neural tangent kernel (NTK) regime (Boopathy & Fiete, 2022), the Forward-Forward algorithm (Hinton, 2022), Hebbian Learning (Isomura & Toyoizumi, 2018; Moraitis et al., 2022), and synthetic gradients (Jaderberg et al., 2017). 3 ZO OPTIMIZATION THROUGH FUNCTION VALUE-BASED GRADIENT ESTIMATION: RANDOMIZED OR COORDINATE-WISE? We now introduce the ZO optimization setup and discuss two ZO gradient estimation schemes: deterministic coordinate-wise gradient estimation (CGE) and randomized vector-wise gradient estimation (RGE). We will demonstrate the advantage of CGE over RGE for DNN training. This inspires further improvements for scaling CGE-based ZO optimization. ZO optimization and gradient estimation. Let \u2113(\u03b8) denote a loss function that we want to minimize over the optimization variables \u03b8 \u2208Rd (e.g., model parameters of a neural network). The ZO optimizer interacts with the objective function \u2113only by submitting inputs (i.e., realizations of \u03b8) and receiving the corresponding function values. It slightly modifies the commonly-used first-order (FO) gradient-based algorithm by approximating the FO gradient through function value-based gradient estimates (Liu et al., 2020a). This is essential when explicit differentiation is difficult due to the black-box nature of the loss function (Zhang et al., 2022c; Liu et al., 2020b; Chen et al., 2017), or when explicit differentiation is undesired due to concerns about energy efficiency (Gu et al., 2021b; Liu et al., 2018a). RGE (Nesterov & Spokoiny, 2017; Ghadimi & Lan, 2013; Duchi et al., 2015; Spall, 1992) and CGE (Kiefer & Wolfowitz, 1952; Lian et al., 2016; Berahas et al., 2022) are two commonly-used gradient estimators based on finite differences of \u2113. RGE acquires finite differences via random perturbations of \u03b8 while CGE uses deterministic coordinate-wise perturbations of \u03b8 (Liu et al., 2020a). Their formal definitions are given by (RGE) \u02c6 \u2207\u03b8\u2113(\u03b8) = 1 q q X i=1 \u0014\u2113(\u03b8 + \u00b5ui) \u2212\u2113(\u03b8) \u00b5 ui \u0015 ; (CGE) \u02c6 \u2207\u03b8\u2113(\u03b8) = d X i=1 \u0014\u2113(\u03b8 + \u00b5ei) \u2212\u2113(\u03b8) \u00b5 ei \u0015 , (1) 730 3700 6670 9640 12610 Number of Model Parameters 40 50 60 70 80 Testing Accuracy (%) 42.09 41.65 37.53 60.47 59.66 50.06 70.69 70.04 65.31 76.64 76.07 70.05 77.01 76.95 68.38 FO Training ZO CGE ZO RGE Figure 2: Performance comparison of training a simple CNN with varying numbers of parameters on CIFAR10 using different training methods. where \u02c6 \u2207\u03b8\u2113denotes an estimation of the FO gradient \u2207\u03b8\u2113with respect to \u03b8. In (RGE), ui denotes a randomized perturbation vector, e.g., drawn from the standard Gaussian distribution N(0, I), \u00b5 > 0 is a perturbation size (a.k.a. smoothing parameter), and q is the number of random directions used to acquire finite differences. In (CGE), ei denotes a standard basis vector, and \u2113(\u03b8+\u00b5ei)\u2212\u2113(\u03b8) \u00b5 provides the finite-difference estimation of the partial derivative of \u2113(\u03b8) at the ith coordinate \u03b8i. Finite difference approximations in (1) are motivated by directional derivatives. Take RGE (with q = 1) as an example. As \u00b5 \u21920, finite difference in RGE converges to directional derivative \u2113\u2032(\u03b8) := uT \u2207\u03b8\u2113(\u03b8) = lim\u00b5\u21920 \u2113(\u03b8+\u00b5ui)\u2212\u2113(\u03b8) \u00b5 of the function \u2113at the point \u03b8 in the direction u (Urruty & Lemar\u00b4 echal, 1993). As a result, the expression \u2113\u2032(\u03b8)u yields E[\u2113\u2032(\u03b8)u] = E[(uuT )\u2207\u03b8\u2113(\u03b8)] = \u2207\u03b8\u2113(\u03b8) (recall that E[uuT ] = I). This implies that \u2113\u2032(\u03b8)u is an unbiased gradient estimator of \u2207\u03b8\u2113(\u03b8) and its biased finite difference approximation is given by (1) (Duchi et al., 2015). RGE or CGE? First, the function query costs for RGE and CGE differ, with RGE taking O(q) queries and CGE taking O(d) queries based on (1). Compared to CGE, RGE has the flexibility to specify q < d to reduce the number of function evaluations. Despite the query efficiency, it remains uncertain whether RGE can deliver satisfactory accuracy when training a deep model from scratch. To this end, we undertake a preliminary investigation wherein we train a basic convolutional neural network (CNN) of different sizes on CIFAR-10, employing both RGE and CGE. To ensure a fair comparison in query complexity, we set the query number q in RGE equal to the problem size d used in CGE. Fig. 2 presents the test accuracy of the learned CNN against the number of model parameters (equivalent to the number of model queries). Here the training recipe is specified by the FO SGD, the ZO RGE-based SGD, and the ZO CGE-based SGD. We observe that CGE can achieve test accuracy comparable to FO training and significantly outperforms RGE. This experiment highlights 4 \fPublished as a conference paper at ICLR 2024 the superiority of CGE over RGE in terms of optimization accuracy even when the latter uses q = d. This accuracy merit of CGE is particularly valuable when training more complex neural networks. In Appx. C, we provide a detailed analysis of the computational costs using CGE vs. RGE. The time cost relative to model depth is shown in Fig. A2. And Tab. A1 assesses gradient estimation time costs. We find that CGE demonstrates greater time efficiency than RGE. The computation efficiency loss of RGE is in that it needs to generate and integrate a d-dimension perturbation vector into the entire model at once every query. Based on the advantages of CGE over RGE in terms of both accuracy and computation efficiency, we choose CGE as the preferred ZO gradient estimator. However, query complexity of CGE is still a bottleneck, as it scales with model size d. 4 SPARSITY-ASSISTED ZO TRAINING: A PRUNING LENS AND BEYOND One valuable property of CGE is the disentanglement of finite differences across coordinates, which suggests that reducing CGE\u2019s query complexity is aligned with pruning the model weights that are being optimized. With this in mind, we propose integrating ZO optimization with pruned gradients to design a more effective inductive bias for ZO deep model training. It is worth noting that the sparsity has been explored in several existing ZO optimization methods to improve the query efficiency of gradient estimation (Wang et al., 2017; Cai et al., 2022; 2021; Balasubramanian & Ghadimi, 2018; Ohta et al., 2020; Gu et al., 2021b). However, prior work suffered from two main limitations. Firstly, exact sparsity was assumed in the original FO gradients, which required an additional sparse learning method (such as LASSO (Wang et al., 2017)) to recover these sparse gradients from function queries. Secondly, it remains unclear how to optimize the sparsity pattern via a ZO oracle, as the existing method calls for overly heuristics-based pruning methods (e.g., random (Gu et al., 2021b) or magnitude (Ohta et al., 2020; Zhang et al., 2022b) pruning). Overly increasing sparsity ultimately limits optimization performance. In what follows, we propose a new pruning approach that relies only on model queries, enjoys computation efficiency, and can improve ZO optimization accuracy by inducing an appropriate gradient sparsity. ZO-GraSP: Model pruning via ZO oracle. The compressibility of model weights for DL has been extensively studied (Han et al., 2015; Frankle & Carbin, 2018; Ma et al., 2021; Zhang et al., 2022a;b; Blalock et al., 2020; Tanaka et al., 2020; Lee et al., 2018; Wang et al., 2020; Su et al., 2020; Diffenderfer et al., 2021). For instance, the lottery ticket hypothesis (Frankle & Carbin, 2018) demonstrated that a randomly initialized, dense neural network contains a high-quality sparse subnetwork. However, current effective pruning methods incorporate model training as an intermediate step (Frankle & Carbin, 2018; Ma et al., 2021; Zhang et al., 2022a; Diffenderfer & Kailkhura, 2021). Thus, they are not well-suited for finding sparsity via a ZO oracle. To address the above challenge, we draw inspiration from training-free pruning methods, known as pruning-at-initialization (Tanaka et al., 2020; Lee et al., 2018; Wang et al., 2020). Within this family, gradient signal preservation (GraSP) (Wang et al., 2020) is a method to identify the sparsity prior of DL through the gradient flows of a randomly-initialized network. While GraSP still requires the FO and second-order derivative information, we can estimate these derivatives using only function queries to design the ZO version of GraSP (termed ZO-GraSP). Specifically, GraSP (Wang et al., 2020) assigns pruning scores (denoted by S) to model initialization \u03b8. These scores reflect the change in gradient flow after pruning the weights: S = \u2212\u03b8 \u2299(Hg), H = \u22072 \u03b8,\u03b8\u2113(\u03b8), g = \u2207\u03b8\u2113(\u03b8), (2) where recall that \u2113is the loss function of model training, \u2299denotes the entry-wise multiplication, and Hg represents the Hessian-gradient product. Using the ZO learning paradigm, we can first approximate the Hessian-gradient product as the finite difference between two gradients (i.e., \u2207\u03b8\u2113(\u03b8 + \u00b5g) and \u2207\u03b8\u2113(\u03b8)), in the direction g with the smoothing parameter \u00b5. Second, we replace the FO gradient \u2207\u03b8\u2113with the ZO gradient estimate \u02c6 \u2207\u03b8\u2113given in (1). Combining this yields ZO-GraSP: \u02c6 S := \u2212\u03b8 \u2299 \u02c6 \u2207\u03b8\u2113(\u03b8 + \u00b5\u02c6 g) \u2212\u02c6 \u2207\u03b8\u2113(\u03b8) \u00b5 . (3) In practice, we found that the pruning mask determined by ranking the entries in \u02c6 S is resilient to the ZO gradient estimation error. Therefore, we utilize RGE with a relatively small number of queries (q < d) to implement ZO-GraSP. This reduces the function query cost without compromising pruning performance; see Tab. A2 and Tab. A3 for empirical justifications. Our results show that ZO-GraSP significantly outperforms random pruning and yields pruned models with accuracy comparable to FO-GraSP. 5 \fPublished as a conference paper at ICLR 2024 Integrating sparsity with CGE. As finite differences in CGE (1) are decomposable over weights, it is easy to incorporate sparsity into CGE. To retain the accuracy benefits of training dense models, we incorporate gradient sparsity (in CGE) rather than weight sparsity. This ensures that we train a dense model in the weight space, rather than training a sparse model where the sparsity determined by ZO-GraSP is directly applied. Let SZO-GraSP be the coordinate set of unpruned model weights found by ZO-GraSP. The sparsity-induced CGE is given by \u02c6 \u2207\u03b8\u2113(\u03b8) = X i\u2208SZO-GraSP \u0014\u2113(\u03b8 + \u00b5ei) \u2212\u2113(\u03b8) \u00b5 ei \u0015 . (Sparse-CGE) It is clear that (Sparse-CGE) reduces the query complexity of the original CGE from O(d) to O(|SZO-GraSP|), where |SZO-GraSP| denotes the cardinality of the coordinate set SZO-GraSP. There may exist two direct methods for integrating (Sparse-CGE) into ZO optimization. M1: This method involves alternating between ZO-GraSP and CGE-based ZO optimization. At each iteration, SZO-GraSP is updated based on the model weights from the previous iteration and then used to construct (Sparse-CGE) for updating \u03b8 at the current iteration. M2: This method involves performing pruning before ZO training. That is, ZO-GraSP is conducted at model initialization, and the resulting SZO-GraSP is applied to (Sparse-CGE) and kept fixed during training. Both M1 and M2 have limitations. M1 requires repeated calls to ZO-GraSP to update SZO-GraSP, leading to a higher query cost for ZO model training. M2 addresses the query complexity by performing ZO-GraSP before training, but it can only produce a smaller model after training. It is known that heavily-pruned models suffers from performance degradation (e.g., 95% sparse model in Tab. A2 in Appx. D). Thus, it is nontrivial to integrate ZO-GraSP with ZO training due to the requirement of balancing query efficiency and training effectiveness. To address this, we propose ZO-GraSP-oriented dynamic sparsity pattern, which leverages ZO-GraSP to determine layer-wise pruning ratios (LPRs) that can capture DNN compressibility. This approach shares a similar essence with smart ratio introduced in (Su et al., 2020). Specifically, we acquire LPRs from ZO-GraSP at randomly initialized weights prior to ZO training, which is query-efficient like M2. However, unlike M2, LPRs allow for random shuffling of sparse gradient positions in \u03b8 only if these LPRs are obeyed. This allows us to mimic M1 to alternate between model weight updates and SZO-GraSP updates, with the latter achieved by LPR-guided randomly updated sparsity patterns. Thus, ZO optimization can train the dense model using iteratively-updated (Sparse-CGE) with LPRs-guided dynamic sparsity patterns. Overall, our proposal has the query efficiency of M2 with the training effectiveness of M1, resulting in a balanced integration of ZO-GraSP into ZO training. We summarize the algorithmic pipeline in Algorithm 1 in Appx. E, where CGE and ZO-GraSP-oriented dynamic sparsity pattern are clearly described in a unified framework. We also refer readers to Appx. E for more explanation and comparisons with M1 and M2. We provide a convergence rate analysis in Appx. A. 5 IMPROVING SCALABILITY: FEATURE REUSE & FORWARD PARALLEL 730 3700 6670 9640 12610 Number of Model Parameters 0 20 40 60 80 Training Time (hours) 0.99 1.66 5.11 12.08 11.39 28.03 18.91 45.22 28.94 70.32 CGE with feature reuse CGE without feature reuse Figure 3: Computation cost of CGE-based ZO training w/ feature reuse vs. w/o feature reuse. The setup follows Fig. A2. We investigate two characteristics of ZO training that can further enhance implementation scalability: feature reuse and forward parallelization. The former disentangles intermediate features from weight perturbations, while the latter uses the finite-difference nature in CGE to enable scalable distributed implementation. Reusing intermediate features. As shown in (1), CGE perturbs each parameter element-wise. Thus, one can reuse the feature immediately preceding the perturbed layer and carry out the remaining forward pass operations instead of starting from the input layer, as illustrated in Fig. 1. The above characteristic of CGE-based model training is referred to as \u2018feature reuse\u2019. More concretely, let f\u03b8(x) be a deep model with parameters \u03b8 and input x. We can express f\u03b8(x) as a multi-layer composite function f\u03b8(x) = f\u03b8>l(zl) = f\u03b8L \u25e6f\u03b8L\u22121 \u25e6\u00b7 \u00b7 \u00b7 \u25e6f\u03b8l+1 | {z } f\u03b8>l(\u00b7) \u25e6f\u03b8l \u25e6\u00b7 \u00b7 \u00b7 \u25e6f\u03b81(x) | {z } zl = f\u03b81:l (x) , (4) where f\u03b8l denotes the model\u2019s lth layer, L is the total number of model layers, and \u25e6is the function composition operation. Based on (4), if coordinate-wise weight perturbations are applied to the (l + 1)th layer and its subsequent layers (i.e., \u03b8>l), the model\u2019s outputs corresponding to these 6 \fPublished as a conference paper at ICLR 2024 perturbed weights can be efficiently obtained by keeping the intermediate features up to the lth layer (i.e., zl) intact. This efficiency becomes more pronounced when perturbing the parameters of deeper layers (i.e., for a larger l). Fig. 3 compares the runtime of CGE-based ZO training with and without feature reuse. Empirically, CGE with feature reuse exhibits a 2\u00d7 reduction in training time. Parallelization of coordinate-wise finite differences. CGE enables parallelization of model training due to its alignment of parameter perturbations with forward passes. If there exist M processes (across multiple GPUs), we can decompose CGE (1) based on its parameter coordinates yielding \u02c6 \u2207\u03b8\u2113(\u03b8) = M X i=1 \u02c6 gi, \u02c6 gi := X j\u2208Si \u0014\u2113(\u03b8 + \u00b5ej) \u2212\u2113(\u03b8) \u00b5 ej \u0015 , (5) where Si is the set of active parameters assigned to process 1 \u2264i \u2264M. Hence, each process can take |Si| forward passes. This decoupling property enables scaling forward passes via distributed machines, which can significantly improve training speed. We refer to this parallelization for finite differences as \u2018forward parallelization\u2019. It is worth noting that forward parallelization is different from the conventional data parallelization used for FO distributed training (Goyal et al., 2017; You et al., 2018). Our method avoids any performance loss that may result from data parallelization using an overly large batch size, which can cause the optimizer to get stuck in suboptimal local minima due to a lack of stochasticity. 6 EXPERIMENTS In this section, we first train ResNet-20 for standard image classification on CIFAR-10, demonstrating scalability and generalization capability over existing gradient-free learning methods. Second, we apply DeepZero to enhance the robustness of a black-box DNN against adversarial attacks, where limited access to the model is available on the defender\u2019s end. Lastly, we leverage DeepZero to design a physics-informed ML system by incorporating a scientific PDE solver into the training loop for reducing numerical errors, highlighting its capability to address complex scientific problems. 6.1 IMAGE CLASSIFICATION TASK 80 90 95 99 Sparsity (%) 60 65 70 75 80 85 90 95 Testing Accuracy (%) 92.85 88.59 86.94 90.12 86.25 86.46 88.55 82.95 84.26 86.98 68.22 73.37 78.1 FO training FO training with Sparse Weight FO training with Sparse Gradient DeepZero (Ours) Figure 4: Comparison between DeepZero and FO training baselines on a ResNet-20 for CIFAR-10. We report the mean and standard deviation of 3 independent runs for each experiment. Experiment setup. This study focuses on training ResNet20 (with 270K parameters) on CIFAR-10 for image classification. We adopt SGD (stochastic gradient descent) as the FO training recipe, with a weight decay of 5 \u00d7 10\u22124 and a momentum of 0.9. The learning rate is 0.1, governed by a cosine decay scheduler. In the ZO training scenario, we replace the FO gradient by (Sparse-CGE) with a smoothing parameter \u00b5 = 5 \u00d7 10\u22123. When implementing ZO-GraSP (3), we set the query budget q = 192 and use the same \u00b5 as CGE. Unless specified otherwise, the weight sparsity ratio is chosen to be 90% and the specific sparsity patterns are determined by SR (Smart Ratio). When implementing DeepZero (Algorithm 2), we choose the number of epochs T = 50. Experiments are run on 4 NVIDIA V100 GPUs if not specified otherwise. We compare DeepZero with FO training and two SOTA BP-free training: Pattern Search (Chiang et al., 2023) and Input-Weight Alignment (Align-ada) (Boopathy & Fiete, 2022). 100 500 1000 2000 4000 8000 16000 32000 Dataset Size 0 10 20 30 40 50 60 70 80 Testing Accuracy (%) DeepZero Pattern Search 0 50 100 150 200 250 300 Time (hours) Accuracy Time Cost Figure 5: Comparison of DeepZero and Pattern Search on ResNet-20 for CIFAR-10 with varying dataset sizes. All experiments are done on a single NVIDIA A6000 GPU. Comparison with FO training. In Fig. 4, we compare the accuracy of DeepZero-trained ResNet-20 with two variants trained by FO recipes: (1) a dense ResNet-20 acquired through FO training and (2) a sparse ResNet20 acquired through FO training under FO-GraSP sparsity pattern. As we can see, the accuracy gap still exists between (1) and the model trained with DeepZero in the sparsity regime of 80% to 99%. This highlights the challenge of ZO optimization for deep model training, where achieving high sparsity is desired to reduce the number of model queries in (Sparse-CGE) for scaling to ResNet-20. Notably, in the sparsity regime of 90% to 99%, DeepZero outperforms (2), showcasing the superiority of gradient sparsity in DeepZero 7 \fPublished as a conference paper at ICLR 2024 compared to weight sparsity (i.e., directly training a sparse model). In Appx. F, we provide the DeepZero training trajectory (Fig. A4), performance vs. data batch setup (Fig. A5) and training time vs. GPU count (Fig. A6). Comparison with pattern search (Chiang et al., 2023). In Fig. 5, we compare the accuracy and runtime cost of DeepZero with Pattern Search (Chiang et al., 2023) for deep model training. Pattern Search has been shown to achieve comparable test accuracy to SGD in low sample regimes, however, effectiveness as the number of data samples increases remains unclear. To investigate this, we conducted experiments using DeepZero (with 90% gradient sparsity) and pattern search on ResNet20 with CIFAR-10, with varying dataset sizes from 100 to 32K. We maintained a fixed total epoch number of 40 for both methods to ensure a fair comparison. The results demonstrate DeepZero outperforms Pattern Search in all data regimes, except in the case of 100. Further, the improvement of DeepZero over pattern search (in both accuracy and efficiency) expands dramatically with increasing dataset sizes, indicating the superior scalability of DeepZero. Table 1: Performance of DeepZero vs. BP-free methods on a 8-layer CNN w/ different widths (Boopathy & Fiete, 2022). Method DeepZero FA DFA Align-ada Width 32 64 64 512 64 512 64 512 Accuracy 57.7 64.1 46.5 45.4 49.9 54.1 49.9 58.0 Time (h) 4.34 28.15 0.36 3.79 0.42 3.52 0.48 4.59 Comparison with input-weight alignment (Boopathy & Fiete, 2022). In Tab. 1, we present a comparison between DeepZero and the Align-ada approach (Boopathy & Fiete, 2022) for training neural networks without BP on CIFAR-10. While other BP-free training methods (Lillicrap et al., 2014; N\u00f8kland, 2016; Baydin et al., 2022) exist, Align-ada stands out as it applies to training wide neural networks and achieves state-of-the-art performance on CIFAR-10, e.g., surpassing methods such as feedback alignment (FA) (Lillicrap et al., 2014) and direct feedback alignment (DFA) (N\u00f8kland, 2016). To ensure fairness, we apply DeepZero to the 8-layer CNN architecture from (Boopathy & Fiete, 2022) and compare performance with Align-ada at varying model widths. We note that the 512-width network was the widest model trained using Align-ada. In contrast, the largest width network we train with DeepZero is 64. Our results clearly show that DeepZero achieves significantly higher testing accuracy compared to Align-ada, even when training with narrower networks. This demonstrates that the improved performance of DeepZero is attributed to its inherent optimization advantages, rather than relying solely on the use of wider networks. Lastly, it is worth noting that Align-ada and other BP-free methods rely on access to computational graphs, making them efficient but unsuitable for black-box applications. 6.2 OTHER BLACK-BOX APPLICATIONS Table 2: CA (%) vs. \u21132-norm based perturbation radius on ImageNet-10 using FO DS-based defense (FO-DS) (Salman et al., 2020), ZO-AE-DS (Zhang et al., 2022c), and our proposed DeepZero. ImageNet (10 classes) Radius r FO-DS ZO-AE-DS DeepZero 0.0 89.33 63.60 86.02 0.25 81.67 52.80 76.61 0.5 68.87 43.13 61.80 0.75 49.80 32.73 43.05 Black-box defense against adversarial attacks. The black-box defense problem arises when the owner of an ML model is unwilling to share the model details with the defender against adversarial attacks (Zhang et al., 2022c; Verma et al., 2023). This poses a challenge for existing robustness enhancement algorithms (Madry et al., 2017; Cohen et al., 2019; Salman et al., 2020) that directly robustify white-box ML models using FO training. To overcome this challenge, ZO optimization was introduced in (Zhang et al., 2022c) to design a white-box defense operation given a query-based black-box image classifier. To address dimensionality challenges with ZO, ZO-AE-DS (Zhang et al., 2022c) introduces an autoencoder (AE) between the white-box denoised smoothing (DS) defense operation (to be learned) and the black-box image classifier. By merging AE\u2019s encoder with the blackbox module, the dimension of ZO optimization is reduced; see Fig. A7 in Appx. G for a schematic overview and (Zhang et al., 2022c) for details. The downside of ZO-AE-DS is poor scaling to highresolution datasets (e.g., ImageNet) due to the use of AE, which compromises the fidelity of the image input to the black-box image classifier and leads to inferior defense performance. In contrast, DeepZero can directly learn the defense operation integrated with the black-box classifier, without needing AE. Tab. 2 compares the defense performance of DeepZero with FO defense (DS (Salman et al., 2020)) and ZO-AE-DS (Zhang et al., 2022c). To ensure a fair comparison, we used the same number of queries (1152) per gradient estimation. Following (Zhang et al., 2022c), we selected a 10-class subset of ImageNet as the training set. The AE and black-box classifier are DnCNN (Zhang et al., 2017) and ResNet-50, respectively. Defense performance is evaluated by certified accuracy 8 \fPublished as a conference paper at ICLR 2024 (CA), following the setup of (Salman et al., 2020; Zhang et al., 2022c). CA is defined using the \u21132 norm-based input perturbation radius r, where a larger r indicates a stronger adversarial threat. We refer readers to Appx. G for more experiment details. Tab. 2 highlights that DeepZero consistently outperforms ZO-AE-DS in terms of CA for all values of r > 0. It is important to note that when r = 0, CA is equivalent to the standard testing accuracy. This indicates that DeepZero excels over ZO-AE-DS not only in adversarial robustness but also in overall generalization performance. SRC NON ZO-SOL FO-SOL 0.00 0.05 0.10 0.15 0.20 Mean Absolute Error 0.180 0.153 0.119 0.074 Figure 6: Average MAE of corrected low-fidelity simulations compared to high-fidelity simulations over 5 test simulations using different correction methods. Error bar is variance of MAE across 5 test simulations. Simulation-coupled DL for discretized PDE error correction. Numerical methods, while instrumental in providing physics-informed simulations, come with their own challenge: the discretization unavoidably produces numerical errors. DL has gained significant attention for addressing this error correction problem. The feasibility of training a corrective neural network through looping interactions with the iterative partial differential equation (PDE) solver, coined \u2018solver-in-the-loop\u2019 (SOL), has been demonstrated in (Um et al., 2020). While existing work focused on using or developing differentiable simulators for model training, we extend SOL by leveraging DeepZero, enabling its use with non-differentiable or blackbox simulators. We name our method ZO-SOL and refer readers to Fig. A8 in Appx. H for a schematic overview. In this experimental framework, the goal is to correct the output of a low fidelity (i.e., coarse mesh) simulation using a learned DNN so that the corrected simulation more closely aligns with output of a high fidelity (i.e., fine mesh) simulation. In an effort to reduce the amount of correction required by DNN, this correction is applied at each simulation timestep and the corrected simulation state is provided to the simulator to compute the next timestep. For our experiments, we consider 2D unsteady wake flow fluid dynamics benchmark from (Um et al., 2020), in which there is a static rod around which fluid is flowing, and utilize PhiFlow (Holl et al., 2020) as the simulator. Additional details on the PDE, the solver-in-the-loop loss, and the DNN architecture are given in Appx. H. Fig. 6 compares the test error correction performance of ZO-SOL (via DeepZero) with three differentiable approaches methods considered in (Um et al., 2020): SRC (low fidelity simulation without error correction), NON (non-interactive training out of the simulation loop using pre-generated low and high fidelity simulation data), and FO-SOL (FO training for SOL given a differentiable simulator). The simulation error for each method in Fig. 6 is measured as the average across the five test simulations (with varying Reynold\u2019s numbers that were not utilized in the training set of simulation data). The error for each test simulation is computed as the mean absolute error (MAE) of the corrected simulation compared to the high fidelity simulation averaged across all simulation timesteps. We implement DeepZero for ZO-SOL following the setup used in the image classification task, except for choosing a 95% gradient sparsity. The ZO-SOL and FO-SOL use 16 unrolling steps in the loss function to allow the correction function to interact with the simulator during training. The results demonstrate that ZO-SOL achieved by DeepZero outperforms the SRC and NON baselines, and narrows the performance gap with FO-SOL, despite only having query-based access to the simulator. Comparing ZO-SOL with NON highlights the promise of ZO-SOL even when integrated with black-box simulators. 7" + }, + { + "url": "http://arxiv.org/abs/2211.11635v5", + "title": "Understanding and Improving Visual Prompting: A Label-Mapping Perspective", + "abstract": "We revisit and advance visual prompting (VP), an input prompting technique\nfor vision tasks. VP can reprogram a fixed, pre-trained source model to\naccomplish downstream tasks in the target domain by simply incorporating\nuniversal prompts (in terms of input perturbation patterns) into downstream\ndata points. Yet, it remains elusive why VP stays effective even given a\nruleless label mapping (LM) between the source classes and the target classes.\nInspired by the above, we ask: How is LM interrelated with VP? And how to\nexploit such a relationship to improve its accuracy on target tasks? We peer\ninto the influence of LM on VP and provide an affirmative answer that a better\n'quality' of LM (assessed by mapping precision and explanation) can\nconsistently improve the effectiveness of VP. This is in contrast to the prior\nart where the factor of LM was missing. To optimize LM, we propose a new VP\nframework, termed ILM-VP (iterative label mapping-based visual prompting),\nwhich automatically re-maps the source labels to the target labels and\nprogressively improves the target task accuracy of VP. Further, when using a\ncontrastive language-image pretrained (CLIP) model, we propose to integrate an\nLM process to assist the text prompt selection of CLIP and to improve the\ntarget task accuracy. Extensive experiments demonstrate that our proposal\nsignificantly outperforms state-of-the-art VP methods. As highlighted below, we\nshow that when reprogramming an ImageNet-pretrained ResNet-18 to 13 target\ntasks, our method outperforms baselines by a substantial margin, e.g., 7.9% and\n6.7% accuracy improvements in transfer learning to the target Flowers102 and\nCIFAR100 datasets. Besides, our proposal on CLIP-based VP provides 13.7% and\n7.1% accuracy improvements on Flowers102 and DTD respectively. Our code is\navailable at https://github.com/OPTML-Group/ILM-VP.", + "authors": "Aochuan Chen, Yuguang Yao, Pin-Yu Chen, Yihua Zhang, Sijia Liu", + "published": "2022-11-21", + "updated": "2023-03-24", + "primary_cat": "cs.CV", + "cats": [ + "cs.CV" + ], + "main_content": "Introduction When learning new knowledge, humans typically start to compare and connect it with the knowledge that they were familiar with. The same idea is also applied in ML. For example, in the \u2018pretraining + \ufb01netuning\u2019 paradigm, an ML model (e.g., deep neural network or DNN) is \ufb01rst trained on a (usually large) source dataset. When a relevant downFig. 1. Overview of VP pipelines (prior art [1,2] and our proposal termed ILM-VP) and accuracy improvement achieved by ILM-VP on target image classi\ufb01cation tasks at-a-glance. Generally speaking, VP aims to generate a universal input perturbation template (i.e., \u2018visual prompt\u2019) and leverage a source-target LM (label mapping) in order to drive the \ufb01xed source model (e.g., pretrained on ImageNet-1K) to conduct a target task (e.g., Flowers102 image classi\ufb01cation). Compared to the prior art, our proposal (ILM-VP) couples the design of LM with VP training. The resulting LMVP co-design improves target task accuracy across a variety of target image classi\ufb01cation tasks using a \ufb01xed ImageNet-pretrained source model. stream task is present, the pre-trained model is then \ufb01netuned over the target dataset. This learning paradigm has been predominant in the classical transfer learning [3\u20138] as well as in the recent deep representation learning [9\u201313]. However, \ufb01netuning the pre-trained model requires either partial or entire model modi\ufb01cations. If the pretrained model is of large size, then it becomes too costly to store a modi\ufb01ed copy of the pre-trained model for each downstream task. In contrast, visual prompting (VP) (see Fig. 1), also known as model reprogramming or adversarial reprogramming, provides a new alternative to \ufb01netuning [1, 2, 14\u201317]. Instead of directly modifying the pretrained source model, VP integrates an input transformaarXiv:2211.11635v5 [cs.CV] 24 Mar 2023 \ftion and/or an output transformation to reprogram the \ufb01xed source model to accomplish a new target task; see an illustration of existing VP framework in Fig. 1. The input transformation is typically realized by incorporating (dataagnostic) input perturbations (i.e., prompts) into input samples, and the output transformation is given by a function that maps source labels to target labels, known as label mapping (LM). Recently, VP has shown great promise in various applications of foundation models, ranging from pretrained vision models [1, 14, 15, 17\u201320] to language-vision models [2,21\u201323]. The idea of prompt learning originated from in-context learning or prompting in natural language processing (NLP) [24\u201326]. However, when it is introduced to the vision domain [1, 2], new questions arise. First, the recent work [1,14,27] showed that VP remains powerful even if the target task largely deviates from the source domain. For example, a new performance record on target medical datasets is achieved in [1] when using VP to reprogram the \ufb01xed, ImageNet pre-trained source model. The \u2018mystery\u2019 in this example is that LM is conducted between two seemingly irrelevant source and target domains. Despite the lack of interpretability, VP can still leverage such connected source labels and the source model to effectively predict target data points. This raises the \ufb01rst open question: What is the rationality behind LM and how to explore its in\ufb02uence on VP? Second, unlike prompt learning in the NLP domain, input prompts in the vision domain are typically given by \u2018noisy\u2019 perturbations to image pixels; see illustration in Fig. 1. Together with the lack of interpretability of LM, the second open question is: How to interpret LM and the seemingly random perturbation pattern in VP? As mentioned above, the lack of understanding of LM and the poor interpretability of VP drive our studies in this work. We develop a new visual prompting framework, termed ILM-VP (iterative label mapping-based visual prompting), which provides an interactive and explainable design between LM and prompt learning (i.e., input prompt generation); see Fig. 1 for the schematic overview. Our proposal can automatically adjust LM between the source domain and the target domain by taking both mapping precision and explanation into consideration, and can leverage the optimized LM to further improve the accuracy and the explainability of prompt learning. Although some prior work [1,17,27] attempted to improve the quality of LM as well as the overall performance of VP, they are different from our proposal in two major aspects. First, none of the prior work co-designed LM and VP. For example, the prior art [1] used a pre-prompt prediction frequency to determine the LM function. However, we \ufb01nd signi\ufb01cant inconsistency between the pre-prompt and post-prompt prediction frequency of the same source model, which explains the sub-optimality of the current VP methods due to the lack of mapping precision. Second, to the best of our knowledge, VP is still treated as a \u2018black box\u2019 in the prior work. Yet, our design can provide graceful visual explanations to the underlying mechanisms of VP. Third, we for the \ufb01rst time show that LM can provide a uni\ufb01ed solution to improving the accuracy of VP to re-purpose both vision and language-vision source models. Our contributions are unfolded below. x We revisit the LM problem in VP and uncover the de\ufb01ciencies of existing LM methods: the lack of mapping precision and the lack of explanation. y Given the importance of LM, we propose the \ufb01rst LMVP co-design framework, termed ILM-VP, through a novel bi-level optimization viewpoint. z Beyond LM for vision models, we show that LM can also be generalized to assist the text prompt selection of CLIP (contrastive language\u2013image pretraining) and to improve the target task accuracy of VP using the CLIP model. { We empirically demonstrate the accuracy and explanation merits of our proposal across multiple source models and target datasets. 2. Related Work Prompting in NLP. Prompting is used to prepend language instruction to the input text for a language model to better accomplish a given task [28]. While prompting makes a signi\ufb01cant contribution to the generalization ability of large pre-trained language models (e.g., GPT-3) [24], it requires hand-crafting prompt design by experts. Recent work proposed to directly optimize the prompting embeddings through gradients together with lightweight \ufb01netuning the model, which is called prompt tuning [25, 29]. It is shown that this method is effective and ef\ufb01cient, which achieves competitive performance to the \ufb01netuning of the full language model. Visual prompting and model reprogramming. VP was \ufb01rst de\ufb01ned in [2] to mimic the prompting idea in NLP. Prior to that, a very similar idea was used in computer vision (CV) but with a different name, known as model reprogramming or adversarial reprogramming [14\u201317, 30\u201333]. They both focus on re-purposing a \ufb01xed, pre-trained vision model for a new task by leveraging a universal input pattern and an output LM function. Although not outperforming full \ufb01ne-tuning in transfer learning, VP yields an advantage of parameter-ef\ufb01cient \ufb01ne-tuning, which requires a much smaller parameter storage space. Furthermore, the smaller parameter space requires less training data to converge. Beyond traditional pre-trained vision models, the work [2] studied the effectiveness of VP in the languagevision model CLIP for the \ufb01rst time. Assisted by CLIP, VP can generate a prompting pattern of image data without resorting to source-target label mapping. In [23], VP and text prompt are jointly optimized in the CLIP model, which leads to better performance. Furthermore, unadver\fsarial learning [34] also enjoys the similar idea to VP, while it focuses on generating class-wise prompts with the goal of improving the out-of-distribution generalization ability of a pre-trained model. VP is gaining increasing attention. In [1], it is applied to re-purpose black-box source models [35] and achieves state-of-the-art (SOTA) performance on different target datasets. Besides, in data-scarce regimes like the biochemical domain, it is shown in [15, 17, 27] that VP can enable effective cross-domain transfer learning. Other than transfer learning, VP is also used in in-domain settings to improve different metrics like adversarial robustness [33] and fairness [32]. Although input prompting is the most commonlyused prompt learning method in the vision domain, generalization to learning prompting parameters at intermediate layers of a source model is also developed in [19\u201321, 36]. The resulting technique is called visual prompt tuning and is typically restricted to vision transformers. 3. Problem Statement In this section, we begin by providing some background information on VP. Based on that, we will then present the problem of our interest\u2013LM (label mapping)\u2013which de\ufb01nes how a visual prompt maps a source model prediction label to a target data class. This is the \ufb01rst question encountered in VP across domains but was typically overlooked in the literature. By reviewing the commonly-used LM methods, we will point out several open questions raised by LM. Preliminaries on visual prompting. The technology of VP addresses the problem of how to adapt a pre-trained source model (e.g., the ImageNet-1K-pre-trained ResNet18) to a target downstream task (e.g., \ufb02ower classi\ufb01cation over the Flowers102 dataset) without any task-speci\ufb01c model modi\ufb01cation (e.g., \ufb01netuning). Throughout the paper, we focus on input-based VP (also known as model reprogramming) [1, 2, 14\u201317, 27, 37], which incorporates a carefully-designed universal perturbation pattern to the raw target images so as to enforce the transferability of the source model to the target domain. We refer readers to Fig. 1 for the schematic overview. To be concrete, let S and T denote the source dataset and the target dataset, respectively. And let f\u03b8s denote a source model with pre-trained parameters \u03b8s. Suppose f\u03b8s is a supervised classi\ufb01er, then it de\ufb01nes a mapping from the input data x \u2208RNs to the source label space Ys \u2286RKs, i.e., f\u03b8s(x) = ys \u2208Ys, where Ns is the dimension of a source datapoint, Ks is the number of source data classes, and ys is the source class label. We have f\u03b8s trained based on S, e.g., via empirical risk minimization. The goal of VP is to reprogram the source model f\u03b8s to accomplish the target task de\ufb01ned in T , without making task-speci\ufb01c \ufb01netuning over f\u03b8s. To this end, VP modi\ufb01es the target data xt (of Nt dimensions) by injecting a task-designated input perturbation pattern \u03b4. This leads to the input prompting operation with the generic form: x\u2032(\u03b4) = h(xt, \u03b4) \u2208RNs, xt \u2208RNt (1) where xt is the target datapoint, and h(\u22c5,\u22c5) is an input transformation that integrates xt with the input perturbation \u03b4 and produces a modi\ufb01ed datapoint x\u2032(\u03b4) with the source data dimension Ns. It was shown in [1] that h can be speci\ufb01ed as an additive perturbation model that pads \u03b4 outside the target data sample (see Fig. 1 for an example as well). Given the input prompting model (1), VP then seeks the optimal \u03b4 to improve the target task accuracy when using the pre-trained source model f\u03b8s. This raises a prompt generation problem, which is typically cast as minimize \u03b4 E(xt,yt)\u2208Ttr [\u2113VP(f\u03b8s(x\u2032(\u03b4)), yt)], (2) where Ttr denotes a supervised training set in T with feature xt and label yt for a training sample, and \u2113VP(\u22c5) is a visual prompting loss function that we will de\ufb01ne later given the prompted input x\u2032(\u03b4) and the ground-truth target label yt. To solve problem (2), the standard stochastic gradient descent (SGD) method can be used. At inference, we will integrate the designed \u03b4 into test-time target datapoints and call the source model f\u03b8s for downstream prediction in T (see Fig. 1 and a more detailed description in Fig. A1). Label mapping: Existing methods and questions. Although the input prompting operation (1) converts the original xt to the source dimension-aligned datapoint x\u2032 that the source model can use, the successful realization of VP (3) needs to map the source model\u2019s prediction (in the source label space Ys with Ks classes) to the target task\u2019s data label (in the target label space Yt with Kt classes). In the \u2018pretraining + \ufb01netuning\u2019 paradigm, we typically have Kt \u2264Ks. Therefore, the problem of LM (label mapping) arises: (LM problem) Given the source model f\u03b8s, how to build a mapping from the source label space Ys to the target label space Yt so that the model\u2019s prediction directs to the correct target label? Clearly, the desired prompt generation (2) heavily relies on the LM scheme, which de\ufb01nes the one-to-one correspondence between the source model\u2019s prediction f\u03b8s(x\u2032(\u03b4)) and the target data class yt. Yet, nearly all the existing work neglects its in\ufb02uence on the prompt generation and adopts either x the simplest random mapping [2,14] or y a pre-de\ufb01ned, one-shot frequency-based mapping [1,15]. We elaborate on the above two schemes below. x Random label mapping (RLM): RLM does not use any prior knowledge or source model information to guide the LM process. The mapped source labels (to the target domain) could be even random. For example, in the case of \u2018ImageNet (source) + CIFAR-10 (target)\u2019 [2, 14], existing VP methods coded CIFAR-10 labels using the top 10 ImageNet indices, i.e., ImageNet label i \u2192CIFAR-10 label i, despite the lack of interpretation. \fFig. 2. Visualizations of RLM and FLM using the source dataset ImageNet-1K and the pretrained ResNet-18, as well as the target dataset Flowers102. In FLM, the pre-prompt label mapping using (3) selects source labels different from FLM. Yet, the post-prompt label mapping using (3) at \u03b4\u2217in (4) shows many newly-selected source labels, indicating (1) the dynamics of LM in the source domain, and (2) the pre-promp LM is sub-optimal (i.e., mis-selecting the best-matching label) after VP training. y Frequency-based label mapping (FLM): FLM matches target labels to source labels based on the source model\u2019s prediction frequencies on zero-padded target datapoints, i.e., f\u03b8s(x\u2032(\u03b4)) with \u03b4 = 0. Here recall from (1) that x\u2032(0) = h(xt,0). More concretely, a target label yt is mapped to the source label y\u2217 s following y\u2217 s (yt) = arg maxys Pr {Top-1 prediction of f\u03b8s(h(xt, 0)) is ys \u2223\u2200xt \u2208Tyt} (3) where y\u2217 s (yt) explicitly expresses the dependence of the mapped source label on the target label, Tyt denotes the target data set in the class yt, and Pr{\u22c5} is the probability of the event that the top-1 prediction of f\u03b8s is the source class ys under the zero-padded target data points in Tyt. As shown in Fig. 2, FLM results in a mapping scheme different from that of RLM. However, it is still dif\ufb01cult to interpret the obtained LM results, and remains elusive how the quality of LM impacts the performance of VP. In the rest of the work, we will shed light on how to improve VP by carefully designing the LM scheme and when and why LM matters at different source and downstream tasks. 4. Method: Iterative Label Mapping-based VP In this section, we uncover the hidden dynamics of LM existing in the source task domain of VP, which was neglected by the prior art. This \ufb01nding then motivates us to develop a novel VP framework, which we call Iterative LMbased VP (ILM-VP). Compared to existing VP methods, ILM-VP closes the loop between LM and prompt generation (2), and improves VP\u2019s explanation and target task accuracy simultaneously. The \u2018missing\u2019 dynamics of LM in the source domain. As shown in Sec. 3, a prompt learning pipeline mainly involves three steps: (A1) input prompt modeling (1), (A2) LM (from the source label set Ys to the target label set Yt), and (A3) prompt generation (2). The prior art follows the pipeline (A1)\u2192(A2)\u2192(A3) to generate the desired prompt \u03b4\u2217, which drives the source model to accomplish target tasks. However, in the viewpoint of the source domain, the prompt updating from \u03b4 = 0 to \u03b4\u2217induces the prediction dynamics of the source model f\u03b8s. That is, f\u03b8s(x\u2032(0)) \u2192f\u03b8s(x\u2032(\u03b4\u2217)), (4) where x\u2032(\u03b4) has been de\ufb01ned in (1), which refers to the \u03b4perturbed target data with the same dimension as the source datapoint. As will be evident later, it is important to understand the dynamics (4) as it re\ufb02ects the stability of the selected source labels when mapping to the target labels. Fig. 2 instantiates the dynamics of (4) in the scenario of \u2018ImageNet (source) + Flowers102 (target)\u2019 when the FLMoriented VP approach (3) is used [1]. Prior to prompt generation, the Flowers102 target labels are \ufb01rst mapped to the ImageNet source labels using the FLM method (3), corresponding to step (A2) in prompt learning. This yields the pre-prompt target-source mapping, denoted by f\u03b8s(x\u2032(0)) FLM \u2192Yt. Similarly, after generating the prompt \u03b4\u2217 following (A3), we can obtain the post-prompt target-source mapping, f\u03b8s(x\u2032(\u03b4\u2217)) FLM \u2192Yt, using the FLM method. Fig. 2 shows that there exists a signi\ufb01cant discrepancy between the pre-prompt LM and the post-prompt LM, evidenced by the newly-selected source labels (\u2018Cardoon\u2019, \u2018Egret\u2019, \u2018Daisy\u2019, \u2018Paper Towel\u2019) in the post-prompting phase. This justi\ufb01es the dynamics of (4) in LM. However, it also raises a new concern that the pre-prompt target-source LM is suboptimal for prompt generation (2) given the existing dynamics of LM in the source domain. ILM-VP: A bi-level optimization viewpoint of VP. The dynamics of LM inspire us to re-think the optimality of the current VP pipeline: (A1)\u2192(A2)\u2192(A3). To improve it, we propose to take the LM dynamics into the prompt learning process. This modi\ufb01es the conventional VP pipeline to (A1)\u2192(A2)\u21c4(A3), where LM and prompt generation are in a closed loop. Since the design of LM will interact with the design of the prompt iteratively, we call the proposed new design ILM-VP. Next, we formally present ILM-VP through the lens of bi-level optimization (BLO). Generally speaking, BLO provides a hierarchical learning framework involving two levels (i.e., upper and lower levels) of optimization tasks, where one task is nested inside the other (i.e., the objective and variables of an upper-level problem depend on the optimizer of the lower-level problem). In the context of ILM-VP, we regard the prompt generation problem (2) as the upper-level optimization task and the LM problem (3) \fas the lower-level problem. This yields minimize \u03b4 E(xt,yt)\u2208Ttr [\u2113(f\u03b8s(x\u2032(\u03b4)), y\u2217 s (yt))] \u00b4\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b8\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b6 Upper-level prompt optimization subject to y\u2217 s (yt) is obtained by (3) at (non-zero) prompt \u03b4 \u00b4\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b8\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b9\u00b6 Lower-level LM design at current prompt \u03b4 for every target label yt (5) where the visual prompt \u03b4 denotes the upper-level variable, \u2113is the cross-entropy loss, and the mapped source label ys is a lower-level variable for each given target label yt at the current prompt \u03b4. We also note that there exists a lowerlevel constraint in (5) to ensure that if a source class has been mapped to a target class, it will then be excluded when mapping to a new target class. Further, it is clear from (5) that the design of visual prompt \u03b4 and LM y\u2217 s (vs. yt) are intertwined with each other. To solve problem (5), we employ the alternating optimization (AO) method, which alternatively executes the upper-level prompt generation and the lower-level LM. We summarize the algorithm details in Algorithm 1 and provide a schematic overview in Fig. A2. Algorithm 1 The proposed ILM-VP algorithm 1: Initialize: Given target training set Ttr, pre-trained model f\u03b8s, prompt pattern initialization \u03b40, and upperlevel learning rate \u03bb for SGD 2: for Epoch n = 0,1,..., do 3: Lower-level label mapping: Given \u03b4n\u22121, call LM for each target class yt in Ttr 4: Upper-level prompt learning: Given LM, call SGD to update prompt \u03b4n \u2190 \u00d0 \u03b4n\u22121 5: end for An interpretation merit of ILM-VP. In the literature, it is quite dif\ufb01cult to interpret why VP can reprogram a source model to conduct target tasks. The main hurdle of interpreting VP lies in the LM phase: It remains elusive why the semantics-irrelevant source labels should be mapped to target labels. However, we \ufb01nd that ILM-VP can alleviate this interpretation dif\ufb01culty to a large extent. We show the explanation merit of ILM-VP through an empirical study in Fig. 3, where the target dataset is instantiated by Flowers102 and the source dataset is ImageNet-1K. We list the target labels, the mapped source labels using the baseline FLM method [1], and the identi\ufb01ed source labels using ILM-VP, together with image examples under each label. As we can see, an interpretable target-source mapping is found by ILM-VP, even if the target label and the source label describe different subjects. For example, target images in the label \u2018Spear Thistle\u2019 share a similar color and object shape with the source images in the label \u2018Cardoon\u2019. The same observations can also be drawn from other targetsource label mappings together with their data instances. This \ufb01nding is quite encouraging and is in sharp contrast to Fig. 3. Interpretation merit of ILM (ours) vs. FLM, visualized by LM results in VP to re-purpose an ImageNet-pretrained source model (ResNet18) to conduct target image classi\ufb01cation tasks on the target datasets Flowers102, OxfordPets, DTD, and Food101. ILM consistently \ufb01nds more interpretable target-source label mappings than FLM, in terms of colors, scenes, shapes, and textures. See Fig. A3 for more examples. FLM. As will be evident in Sec. 5, the BLO-oriented ILMVP (5) would enforce a convergence of LM as the alternating optimization proceeds. As a result, source labels and target labels, which share the most similar concepts (like colors, scenes, shapes, and materials), will be identi\ufb01ed. We also show that the improved interpretation of LM consistently enhances the target task accuracy of the VP. 5. Experiments In this section, we empirically demonstrate the effectiveness of our proposed ILM-VP method by comparing it with a variety of baselines across multiple datasets, models, and learning paradigms. 5.1. Experiment setups Datasets and models. In the source domain, we will consider the source models ResNet-18 and ResNet-50 [38] pre-trained on ImageNet-1K [39], and the source model ResNeXt-101-32x8d [40] pre-trained on Instagram [41]. In the target domain, we will evaluate the performance of ILM-VP over 13 target datasets: Flowers102 [42], DTD [43], UCF101 [44], Food101 [45], GTSRB [46], SVHN [47], EuroSAT [48], OxfordPets [49], StanfordCars [50], SUN397 [51], CIFAR10/100 [52], ABIDE [53]. \fSource Model ResNet-18 (ImageNet-1K) ResNet-50 (ImageNet-1K) ResNeXt-101-32x8d (Instagram) Method Ours Prompt baseline Finetuning Ours Prompt base. Finetuning Ours Prompt base. Finetuning ILM-VP RLM-VP FLM-VP LP FF ILM-VP FLM-VP LP FF ILM-VP FLM-VP LP FF Parameter Size 0.05M 0.05M 0.05M 0.51M 11.7M 0.05M 0.05M 0.51M 25.6M 0.05M 0.05M 0.51M 88.8M Flowers102 27.9\u00b10.7 11.0\u00b10.5 20.0\u00b10.3 88.0\u00b10.5 97.1\u00b10.7 24.6\u00b10.6 20.3\u00b10.3 90.9\u00b10.4 97.9\u00b10.7 27.9\u00b10.3 22.5\u00b10.5 89.1\u00b10.2 99.2\u00b10.5 DTD 35.3\u00b10.9 16.3\u00b10.7 32.4\u00b10.5 60.0\u00b10.6 65.5\u00b10.9 40.5\u00b10.5 36.9\u00b10.8 67.6\u00b10.3 69.7\u00b10.9 41.4\u00b10.7 40.3\u00b10.5 69.7\u00b10.2 69.1\u00b11.0 UCF101 23.9\u00b10.5 6.6\u00b10.4 18.9\u00b10.5 63.2\u00b10.8 73.0\u00b10.6 34.6\u00b10.2 33.9\u00b10.4 70.8\u00b10.3 78.0\u00b10.8 43.1\u00b10.8 41.9\u00b10.6 76.9\u00b10.5 79.1\u00b10.7 Food101 14.8\u00b10.2 3.8\u00b10.3 12.8\u00b10.1 50.6\u00b10.3 75.4\u00b10.8 17.0\u00b10.3 15.3\u00b10.2 57.6\u00b10.5 80.3\u00b10.9 23.0\u00b10.4 20.5\u00b10.5 76.0\u00b10.4 82.5\u00b10.3 GTSRB 52.0\u00b11.2 46.1\u00b11.3 45.5\u00b11.0 77.4\u00b11.2 98.0\u00b10.3 52.5\u00b11.4 47.6\u00b11.1 77.8\u00b10.7 97.6\u00b11.0 59.9\u00b11.0 56.2\u00b10.6 73.5\u00b10.7 97.6\u00b10.9 EuroSAT 85.2\u00b10.6 82.4\u00b10.4 83.8\u00b10.2 93.8\u00b10.3 98.8\u00b10.5 83.6\u00b10.7 84.8\u00b10.3 95.7\u00b10.2 98.9\u00b10.6 86.2\u00b10.8 87.8\u00b10.4 93.4\u00b10.3 98.9\u00b10.7 OxfordPets 65.4\u00b10.7 9.3\u00b10.4 62.9\u00b10.1 87.2\u00b10.6 87.8\u00b10.5 76.2\u00b10.6 76.4\u00b10.2 90.4\u00b10.3 91.9\u00b10.4 78.9\u00b10.8 76.8\u00b10.6 93.6\u00b10.4 90.1\u00b10.9 StanfordCars 4.5\u00b10.1 0.9\u00b10.1 2.7\u00b10.1 33.8\u00b10.2 81.0\u00b10.1 4.7\u00b10.2 4.2\u00b10.3 40.6\u00b10.1 86.4\u00b10.3 7.0\u00b10.2 4.6\u00b10.1 64.7\u00b10.1 92.5\u00b10.2 SUN397 13.0\u00b10.2 1.0\u00b10.1 10.4\u00b10.1 46.1\u00b10.2 53.2\u00b10.2 20.3\u00b10.2 19.8\u00b10.1 53.5\u00b10.1 59.0\u00b10.1 23.7\u00b10.2 21.6\u00b10.3 62.3\u00b10.1 61.0\u00b10.2 CIFAR10 65.5\u00b10.1 63.0\u00b10.1 65.7\u00b10.6 85.9\u00b10.5 96.5\u00b10.4 76.6\u00b10.3 74.8\u00b10.5 90.1\u00b10.1 96.6\u00b10.2 81.7\u00b10.3 80.3\u00b10.3 94.1\u00b10.1 97.1\u00b10.1 CIFAR100 24.8\u00b10.1 12.9\u00b10.1 18.1\u00b10.2 63.3\u00b10.8 82.5\u00b11.2 38.9\u00b10.3 32.0\u00b10.4 70.7\u00b10.7 83.4\u00b10.9 45.9\u00b10.2 39.7\u00b10.2 76.2\u00b10.9 84.6\u00b11.2 SVHN 75.2\u00b10.2 73.5\u00b10.3 73.1\u00b10.2 65.0\u00b10.2 96.5\u00b10.3 75.8\u00b10.4 75.6\u00b10.2 63.5\u00b10.2 96.9\u00b10.3 81.4\u00b10.1 79.0\u00b10.5 51.0\u00b10.2 97.1\u00b10.3 ABIDE 76.9\u00b12.1 74.0\u00b12.2 73.1\u00b11.6 65.4\u00b13.8 60.6\u00b14.2 63.5\u00b12.2 64.4\u00b13.4 55.8\u00b12.6 70.2\u00b12.5 67.3\u00b12.6 65.7\u00b13.4 54.8\u00b13.4 73.1\u00b14.2 Tab. 1. Performance overview of our proposed VP method (ILM-VP), prompt baseline methods (RLM-VP and FLM-VP), and \ufb01netuning methods (LP and FF) over 13 target image classi\ufb01cation datasets using 3 pretrained source models (ResNet-18 on ImageNet-1K, ResNet-50 on ImageNet-1K, and ResNeXt101-32x8d on Instagram). In each cell, a\u00b1b refers to the mean and standard deviation of target task accuracies (%) over 3 independent trials. The highest accuracy across VP-based methods is marked in bold. \u2018Parameter Size\u2019 refers to the number of trainable parameters in the input prompt or model \ufb01netuning. 50 75 oxeye daisy* spear thistle* osteospermum* artichoke* dandelion gentian gazania* windflower* pincushion wales feathers 93.3% 85.7% 63.2% 60.9% 46.4% 45.0% 43.5% 37.5% 35.3% 33.3% (a) Flowers102 20 40 russian blue* havanese* maine coon* yorkshire bombay* bengal* ragdoll bull terrier leonberger siamese 38.0% 23.0% 21.0% 19.0% 15.9% 13.0% 10.0% 8.0% 7.0% 5.0% (b) OxfordPets Fig. 4. ILM-VP\u2019s class-wise accuracy improvements over FLM-VP using ImageNet-1K pre-trained ResNet-18 under the target dataset (a) Flowers102, (b) OxfordPets. Target classes with \u2217refer to those with updated source labels compared to the prompting baseline method FLM-VP. Baselines and evaluations. In the VP paradigm, our baseline methods include the random LM-based VP (RLMVP) [2, 14], and the frequency LM-based VP (FLM-VP) [1, 15]. We highlight that VP is a \ufb01netuning-free method to drive the source model to conduct target image classi\ufb01cation tasks. When implementing VP baselines, we follow their of\ufb01cial repository setups. We also refer readers to Appendix D for detailed implementations of ILM-VP and baseline methods. In addition to prompting methods, we also cover \ufb01netuning-based methods, including linear probing (LP) and end-to-end full \ufb01netuning (FF). Since \ufb01netuning modi\ufb01es source model parameters, it requires training more parameters and is more computationally intensive. We evaluate the performance of all the methods by the target task accuracy at the testing time and the ef\ufb01ciency in terms of the parameter size that VP or \ufb01netuning needs to handle. We also leverage a post-hoc model explanation method, known as Explanation-by-Example (EBE) [54], to assess the quality of visual explanation of different VP methods. The core idea of EBE is to \ufb01nd train-time data points that have the most similar feature representations to that of a queried test datapoint so as to use these identi\ufb01ed training samples to explain the model\u2019s prediction on this test sample. In the context of VP, EBE can aid us to \ufb01nd the source training samples explainable for model prediction on prompted target test data, like source examples in Fig. 3. 5.2. Experiment results Overall performance of ILM-VP. Tab. 1 shows the effectiveness of our proposed ILM-VP method vs. VP baselines (RLM-VP and FLM-VP) on diverse source models and target datasets. For comparison, we also present the model \ufb01netuning performance on target datasets using LP or FF. It is worth noting that FLM-VP typically outperforms RLM-VP as the latter only uses a random label mapping to guide the learning of prompts [1]. Thus, we only show the results of RLM-VP when using ResNet-18. As shown in Tab. 1, our proposed method (ILM-VP) consistently outperforms other VP baselines by a large margin in nearly all the data-model setups, e.g., 7.9%, 6.7% and 6.5% accuracy improvement over FLM-VP in the target dataset Flowers102, CIFAR100, GTSRB, respectively. In addition, we note that model \ufb01netuning is typically more effective in transfer learning than prompting methods, consistent with existing work [2]. This is not surprising as source models are allowed for modi\ufb01cation, and the trainable parameter size increases (as evidenced by \u2018Parameter Size\u2019 in Tab. 1). As will be evident in Sec. 6, the accuracy of VP can be further improved if a language-vision source model is used. Nonetheless, in the target dataset ABIDE, prompting methods can outperform the full model \ufb01netuning method (FF). Compared to other standard transfer learning tasks for image classi\ufb01cation, ABIDE was a newly-proposed medical dataset in [1], which converts the original 1D numerical medical input sequences to image-alike data formats (i.e., brain-regional correlation graphs). The size of this dataset is extremely small due to the high cost of collecting data in the medical area, which restricts the performance of LP and FF. In contrast, VP is uniquely suited for this setting. Lastly, in the model \ufb01netuning paradigm, a source model with larger capacity typically yields a better target task accuracy, e.g., the \ufb01netuning results of ResNet-50 vs. ResNet18. However, this belief might not hold in the VP paradigm. As we can see, the prompting-induced target accuracy de\fFig. 5. ILM-VP training dynamics from epoch 0 to 200. Rows show: (1) VP pattern vs. epoch number; (2-4) Learned source label mapping with respect to target label \u2018Marigold\u2019, \u2018White Lily\u2019, and \u2018Tree Poppy\u2019, together with EBE-identi\ufb01ed source training examples to explain each re-purposed target label; (5) Convergence of training loss and LM difference between adjacent epochs measured by Hamming distance. creases under ResNet-50 in the target datasets Flowers102, EuroSAT, CIFAR100, and ABIDE. Additionally, Tab. A2 in Appendix shows that ILM-VP takes a bit more run time than FLM-VP and LP, but is faster than FF. This is not surprising since the former adopts alternating optimization with a bit higher computation complexity than ordinary single-level minimization. Recently, the concurrent work [55] shows that properly re-sizing images before integrating with a VP could further boost the performance on a downstream task. We also \ufb01nd the same bene\ufb01t of image re-sizing to VP on CIFAR10/100, GTSRB, and SVHN datasets (e.g., up-scaling the original image size to 128\u00d7128) However, for ease of comparison with existing VP baselines (RLM-VP [14]), our experiments do not apply the image re-sizing trick to VP. LM is key to improving the accuracy of VP. Next, we peer into the in\ufb02uence of LM on target prediction accuracy per class when using ILM-VP. In Fig. 4, we demonstrate the testing accuracy improvements (over the FLMVP baseline) of prompt-injected datapoints, belonging to 10 classes with the highest improvements selected from the target datasets Flowers102 and OxfordPets, respectively. Note that OxfordPets shares the most similar label space with ImageNet (e.g. they both have beagles, boxers, bassets, etc.). We use \u2217in Fig. 4 to mark target data classes whose source labels are remapped during ILM-VP, and list non-\u2217marked target data classes whose source labels retain the same as FLM-VP. We observe that target classes with large accuracy improvements typically require ILM. This justi\ufb01es the bene\ufb01t of target-source label re-mapping during prompt learning. In addition, we note that the source labels of target classes (e.g., \u2018yorkshire\u2019 in OxfordPets) are not re-mapped, but ILM-VP can still bring in accuracy improvements. This implies that LM has a coupling effect on all classes and the BLO framework (5) enables us to improve LM as well as prompt learning in an interactive manner. Further, Fig. 5 shows the training dynamics of ILM-VP vs. training epoch number and its convergence to the stable, high-explainable, and high-accurate visual prompt. As we can see, the mapped source label for a target class is updated at the early training epochs of ILM-VP, but tends to converge at the later training phase. A similar trend holds for the convergence of LM difference between two adjacent epochs and the VP training loss. In addition, we can see that the VP pattern and the LM are updated jointly. Furthermore, the explainability of mapped source labels grows as the training proceeds. For example, the target label \u2018Marigold\u2019 shares a similarity with the source label \u2018Orange\u2019 in color and shape, as visualized by EBE-identi\ufb01ed examples. It is worth mentioning that EBE facilitates us to directly link the source dataset and the target dataset, and thus helps us to better understand the rationale behind VP. We refer readers to Appendix C for more EBE results. How target dataset scale affects VP? Through our experiments over a large number of target datasets, we \ufb01nd that ILM-VP becomes more powerful when it comes to tasks with a larger target label space. For example, Fig. 6 shows the target datasets with at least 3% accuracy improvement using ILM-VP compared with FLM-VP on ResNet18. As we can see, target datasets with the highest number of target classes correspond to the most signi\ufb01cant accuracy improvement brought by ILM-VP. Next, we \ufb01x the target dataset and study how VP behaves at different downstream training dataset sizes. Here we choose GTSRB as the target task since GTSRB contains a suf\ufb01cient amount of training data and thus facilitates us to conduct training dataset par\f0 50 100 Class Number 3 4 5 6 7 8 9 Improvements over SOTA (%) 7.89% 6.67% 6.47% 5.05% 3.85% Flowers102 CIFAR100 GTSRB UCF101 ABIDE Fig. 6. ILM-VP\u2019s improvements over FLM-VP on representative datasets (datasets with improvements over 3%) using ResNet-18. The dashed line is the \ufb01tted curve. 20% 40% 60% 80% 100% Downstream Data Fraction 42 44 46 48 50 52 Accuracy (%) FLM-VP ILM-VP Fig. 7. ILM-VP and FLM-VP performance on different fractions of GTSRB dataset (43 classes and more than 900 training samples per class) using ResNet-18. tition. Fig. 7 compares the performance of ILM-VP with FLM-VP vs. target training dataset size (training from 20% to 100% of the entire set). As we can see, ILM-VP consistently outperforms the baseline FLM-VP and the improvement becomes more signi\ufb01cant as the data scale grows. 6. Extension: LM in Text Domain for CLIP In the previous sections, we show that LM could play a vital role in VP when reprogramming a pre-trained vision model to conduct downstream targeted vision tasks. In this section, we shift our focus from the vision source model to the vision-language model, speci\ufb01c to CLIP (contrastive language\u2013image pretraining), which has received increasing attention in the area of VP [2]. We will show that although CLIP does not require source-target mapping across image labels (due to its multi-modal learning architecture), the proposed idea on iterative LM can be extended to conduct text prompt selection to improve target task accuracy. LM for CLIP. Different from the vision-only model, CLIP can directly take target data labels as its textual inputs so as to mitigate the issue of source-target label mapping; see Fig. A5 for an illustration. In this setting, LM seems redundant. However, this is only applied to VP in the image domain. We argue that CLIP still needs implicit LM for text labels, considering the diversity of text prompts (TPs) [26]. That is, CLIP can incorporate a text label into different context prompt templates (81 templates) suggested in [26] to create multiple text label instances. For example, the target label \u2018dog\u2019 can be combined with context prompts \u2018A photo of a big {label}\u2019 and \u2018A photo of a small {label}\u2019. Thus, given m context prompts and Kt target data labels, we can create mKt \u2018virtual source labels\u2019, which should be mapped to Kt target labels. Thus, the LM problem arises, and its optimal solution characterizes the optimal prompt selection in the text domain for prompted image data. Similar to the BLO method (5), we can bake iterative LM into VP using the CLIP model by replacing the lower-level image label mapping with the context-fused text label mapping. BLO then gives a uni\ufb01ed prompt learning framework that can be easily compatible with CLIP. We refer readers to Appendix E for more implementation details. LM improves VP\u2019s accuracy using CLIP. In Tab. 2, we demonstrate the performance of the VP-driven CLIP model on several challenging target tasks shown in Tab. 1, e.g., Flowers102 and DTD. We term our method \u2018VP+TP+LM\u2019, where the BLO-enabled LM method is called to map \u2018virtual source labels\u2019 (i.e., the combination of context prompt template and target label) to realistic target image labels. For comparison, we also present the performance of the baseline method termed \u2018VP + TP\u2019 [2], which uses a prede\ufb01ned, \ufb01xed context prompt template \u2018This is a photo of a {label}\u2019 when generating a visual prompt for CLIP. As we can see, our proposal consistently outperforms the baseline by a substantial margin. For example, we obtain 13.7% and 7.1% accuracy gain in Flowers102 and DTD respectively. In addition, we \ufb01nd that LM brings in the interpretability merit: Our selected context prompt templates have better semantic meaning than the one used by the baseline. For example, VP for Flowers102 selects the text prompt \u2018a closeup photo of a {}\u2019 instead of \u2018This is a photo of {}\u2019 for the target image with the label \u2018buttercup\u2019. Another example is that VP for CIFAR10 prefers the text prompt \u2018a pixelated photo of a {}\u2019. In particular, we observe that in domain shift datasets (ImageNet-R and ImageNet-Sketch), the selected prompts can exhibit the domain information. More explainable results can be found in Fig. A6. Methods VP+TP Ours (VP+TP+LM) Acc(%) Acc(%) Examples of context prompt template \u2192target label Flowers102 70.0 83.7 a close-up photo of a {} \u2192buttercup DTD 56.8 63.9 graf\ufb01ti of a {} \u2192blotchy UCF101 66.0 70.6 a {} in a video game \u2192baseball pitch Food101 78.9 79.1 a photo of the dirty {} \u2192crab cake SVHN 89.9 91.2 a photo of a {} \u21927 EuroSAT 96.4 96.9 a pixelated photo of a {} \u2192river StanfordCars 57.2 57.6 the toy {} \u21922011 audi s6 sedan SUN397 60.5 61.2 a photo of a large {} \u2192archive CIFAR10 93.9 94.4 a pixelated photo of a {} \u2192ship ImageNet-R 67.5 68.6 a rendition of a {} \u2192gold \ufb01sh ImageNet-Sketch 38.5 39.7 a sketch of a {} \u2192eagle Tab. 2. Results of our CLIP-based prompt learning \u2018VP+TP+LM\u2019 and the baseline \u2018VP+TP\u2019 [2] (restricted to using text prompt template \u201cThis is a photo of a {}\u201d) over 11 target datasets. In each cell, the target task accuracy (%) is shown along with examples of LM in the text domain. Our method with higher accuracy than SOTA is marked in bold. 7." + }, + { + "url": "http://arxiv.org/abs/2210.06284v4", + "title": "Visual Prompting for Adversarial Robustness", + "abstract": "In this work, we leverage visual prompting (VP) to improve adversarial\nrobustness of a fixed, pre-trained model at testing time. Compared to\nconventional adversarial defenses, VP allows us to design universal (i.e.,\ndata-agnostic) input prompting templates, which have plug-and-play capabilities\nat testing time to achieve desired model performance without introducing much\ncomputation overhead. Although VP has been successfully applied to improving\nmodel generalization, it remains elusive whether and how it can be used to\ndefend against adversarial attacks. We investigate this problem and show that\nthe vanilla VP approach is not effective in adversarial defense since a\nuniversal input prompt lacks the capacity for robust learning against\nsample-specific adversarial perturbations. To circumvent it, we propose a new\nVP method, termed Class-wise Adversarial Visual Prompting (C-AVP), to generate\nclass-wise visual prompts so as to not only leverage the strengths of ensemble\nprompts but also optimize their interrelations to improve model robustness. Our\nexperiments show that C-AVP outperforms the conventional VP method, with 2.1X\nstandard accuracy gain and 2X robust accuracy gain. Compared to classical\ntest-time defenses, C-AVP also yields a 42X inference time speedup.", + "authors": "Aochuan Chen, Peter Lorenz, Yuguang Yao, Pin-Yu Chen, Sijia Liu", + "published": "2022-10-12", + "updated": "2023-05-01", + "primary_cat": "cs.CV", + "cats": [ + "cs.CV", + "cs.CR", + "cs.LG" + ], + "main_content": "INTRODUCTION Machine learning (ML) models can easily be manipulated (by an adversary) to output drastically different classi\ufb01cations. Thereby, model robusti\ufb01cation against adversarial attacks is now a major focus of research. Yet, a large volume of existing works focused on training recipes and/or model architectures to gain robustness. Adversarial training (AT) [1], one of the most effective defense, adopted min-max optimization to minimize the worst-case training loss induced by adversarial attacks. Extended from AT, various defense methods were proposed, ranging from supervised learning to semi-supervised learning, and further to unsupervised learning [2\u201311]. \u22c6Equal contribution. Although the design for robust training has made tremendous success in improving model robustness [12,13], it typically takes an intensive computation cost with poor defense scalability to a \ufb01xed, pre-trained ML model. Towards circumventing this dif\ufb01culty, the problem of test-time defense arises; see the seminal work in Croce et. al. [14]. Test-time defense alters either a test-time input example or a small portion of the pre-trained model. Examples include input (anti-adversarial) puri\ufb01cation [15\u201317] and model re\ufb01nement by augmenting the pre-trained model with auxiliary components [18\u201320]. However, these defense techniques inevitably raise the inference time and hamper the test-time ef\ufb01ciency [14]. Inspired by that, our work will advance the test-time defense technology by leveraging the idea of visual prompting (VP) [21], also known as model reprogramming [22\u201325]. Generally speaking, VP [21] creates a universal (i.e., dataagnostic) input prompting template (in terms of input perturbations) in order to improve the generalization ability of a pre-trained model when incorporating such a visual prompt into test-time examples. It enjoys the same idea as model reprogramming [22\u201325] or unadversarial example [26], which optimizes a universal perturbation pattern to maneuver (i.e., reprogram) the functionality of a pre-trained model towards the desired criterion, e.g., cross-domain transfer learning [24], out-of-distribution generalization [26], and fairness [25]. However, it remains elusive whether or not VP could be designed as an effective solution to adversarial defense. We will investigate this problem, which we call adversarial visual prompting (AVP) in this work. Compared to conventional test-time defense methods, AVP signi\ufb01cantly reduces the inference time overhead since visual prompts can be designed of\ufb02ine over training data and have the plug-and-play capability applied to any testing data. We summarize our contributions as below. \u0082 We formulate and investigate the problem of AVP for the \ufb01rst time and empirically show the conventional data-agnostic VP design is incapable of gaining adversarial robustness. \u0083 We propose a new VP method, termed class-wise AVP (CAVP), which produces multiple, class-wise visual prompts with explicit optimization on their couplings to gain better adversarial robustness. \u0084 We provide insightful experiments to demonstrate the pros and cons of VP in adversarial defense. arXiv:2210.06284v4 [cs.CV] 1 May 2023 \f2. RELATED WORK Visual prompting. Originated from the idea of in-context learning or prompting in natural language processing (NLP) [27\u201330], VP was \ufb01rst proposed in Bahng et. al. [21] for vision models. Before formalizing VP in Bahng et. al. [21], the underlying prompting technique has also been devised in computer vision (CV) with different naming. For example, VP is closely related to adversarial reprogramming or model reprogramming [22\u201324,31\u201333], which focused on altering the functionality of a \ufb01xed, pre-trained model across domains by augmenting test-time examples with an additional (universal) input perturbation pattern. Unadversarial learning also enjoys the similar idea to VP. In [26], unadversarial examples that perturb original ones using \u2018prompting\u2019 templates were introduced to improve out-of-distribution generalization. Yet, the problem of VP for adversarial defense is under-explored. Adversarial defense. The lack of adversarial robustness is a weakness of ML models. Adversarial defense, such as adversarial detection [19,34\u201338] and robust training [2,6,9,10, 18, 39], is a current research focus. In particular, adversarial training (AT) [1] is the most widely-used defense strategy and has inspired many recent advances in adversarial defense [12,13,20,40\u201342]. However, these AT-type defenses (with the goal of robustness-enhanced model training) are computationally intensive due to min-max optimization over model parameters. To reduce the computation overhead of robust training, the problem of test-time defense arises [14], which aims to robustify a given model via lightweight unadversarial input perturbations (a.k.a input puri\ufb01cation) [15,43] or minor modi\ufb01cations to the \ufb01xed model [44,45]. In different kinds of test-time defenses, the most relevant work to ours is anti-adversarial perturbation [17]. 3. PROBLEM STATEMENT Visual prompting. We describe the problem setup of VP following Bahng et. al. [21, 23\u201325]. Speci\ufb01cally, let Dtr denote a training set for supervised learning, where (x,y) \u2208 Dtr signi\ufb01es a training sample with feature x and label y. And let \u03b4 be a visual prompt to be designed. The prompted input is then given by x+\u03b4 with respect to (w.r.t.) x. Different from the problem of adversarial attack generation that optimizes \u03b4 for erroneous prediction, VP drives \u03b4 to minimize the performance loss \u2113of a pre-trained model \u03b8. This leads to minimize \u03b4 E(x,y)\u2208Dtr[\u2113(x + \u03b4; y, \u03b8)] subject to \u03b4 \u2208C, (1) where \u2113denotes prediction error given the training data (x,y) and base model \u03b8, and C is a perturbation constraint. Following Bahng et. al. [21, 23, 24], C restricts \u03b4 to let x + \u03b4 \u2208[0,1] for any x. Projected gradient descent (PGD) [1,26] can then be applied to solving problem (1). In the evaluation, \u03b4 is integrated into test data to improve the prediction ability of \u03b8. Adversarial visual prompting. Inspired by the usefulness of VP to improve model generalization [21,24], we ask: (AVP problem) Can VP (1) be extended to robustify \u03b8 against adversarial attacks? At the \ufb01rst glance, the AVP problem seems trivial if we specify the performance loss \u2113as the adversarial training loss [1,2]: \u2113adv(x + \u03b4; y, \u03b8) = maximize x\u2032\u2236\u2225x\u2032\u2212x\u2225\u221e\u2264\u03f5 \u2113(x\u2032 + \u03b4; y, \u03b8), (2) where x\u2032 denotes the adversarial input that lies in the \u2113\u221e-norm ball centered at x with radius \u03f5 > 0. Recall from (1) that the conventional VP requests \u03b4 to be universal across training data. Thus, we term universal AVP (U-AVP) the following problem by integrating (1) with (2): minimize \u03b4\u2236\u03b4\u2208C \u03bbE(x,y)\u2208Dtr[\u2113(x + \u03b4; y, \u03b8)]+ E(x,y)\u2208Dtr[\u2113adv(x + \u03b4; y, \u03b8)] (U-AVP) where \u03bb > 0 is a regularization parameter to strike a balance between generalization and adversarial robustness [2]. 0 10 20 50 100 PGD steps 0 20 40 60 80 100 T est Accuracy (%) Vanilla U-AVP Fig. 1: Example of designing U-AVP for adversarial defense on (CIFAR-10, ResNet18), measured by robust accuracy against PGD attacks [1] of different steps. The robust accuracy of 0 steps is the standard accuracy. The problem (U-AVP) can be effectively solved using a standard minmax optimization method, which involves two alternating optimization routines: inner maximization and outer minimization. The former generates adversarial examples as AT, and the latter produces the visual prompt \u03b4 like (1). At test time, the effectiveness of \u03b4 is measured from two aspects: (1) standard accuracy, i.e., the accuracy of \u03b4-integrated benign examples, and (2) robust accuracy, i.e., the accuracy of \u03b4-integrated adversarial examples (against the victim model \u03b8). Despite the succinctness of (U-AVP), Fig. 1 shows its ineffectiveness to defend against adversarial attacks. Compared to the vanilla VP (1), it also suffers a signi\ufb01cant standard accuracy drop (over 50% in Fig. 1 corresponding to 0 PGD attack steps) and robust accuracy is only enhanced by a small margin (around 18% against PGD attacks). The negative results in Fig. 1 are not quite surprising since a data-agnostic input prompt \u03b4 has limited learning capacity to enable adversarial defense. Thus, it is non-trivial to tackle the problem of AVP. 4. CLASS-WISE ADVERSARIAL VISUAL PROMPT No free lunch for class-wise visual prompts. A direct extension of (U-AVP) is to introduce multiple adversarial visual prompts, each of which corresponds to one class in the training set Dtr. If we split Dtr into class-wise training sets {D(i) tr }N i=1 \f(for N classes) and introduce class-wise visual prompts {\u03b4(i)}, then the direct C-AVP extension from (U-AVP) becomes minimize {\u03b4(i)\u2208C}i\u2208[N] 1 N N \u2211 i=1 {\u03bbE(x,y)\u2208D(i) tr [\u2113(x + \u03b4(i); y, \u03b8)]+ E(x,y)\u2208D(i) tr [\u2113adv(x + \u03b4(i); y, \u03b8)]} (C-AVP-v0) where [N] denotes the set of class labels {1,2,...,N}. It is worth noting that C-AVP-v0 is decomposed over class labels. Although the class-wise separability facilitates numerical optimization, it introduces challenges (C1)-(C2) when applying class-wise visual prompts for adversarial defense. \u25cf(C1) Test-time prompt selection: After acquiring the visual prompts {\u03b4(i)} from (C-AVP-v0), it remains unclear how a class-wise prompt should be selected for application to a test-time example xtest. An intuitive way is to use the inference pipeline of \u03b8 by aligning its top-1 prediction with the prompt selection. That is, the selected prompt \u03b4 and the predicted class i\u2217are determined by \u03b4 = \u03b4\u2217, i\u2217= arg max i\u2208[N] fi(xtest + \u03b4(i); \u03b8), (3) where fi(x;\u03b8) denotes the ith-class prediction con\ufb01dence. However, the seemingly correct rule (3) leads to a large prompt selection error (thus poor prediction accuracy) due to (C2). \u25cf(C2) Backdoor effect of class mis-matched prompts: Given \u03b4(i) from (C-AVP-v0), if the test-time example xtest is drawn from class i, the visual prompt \u03b4(i) then helps prediction. However, if xtest is not originated from class i, then \u03b4(i) could serve as a backdoor attack trigger [46] with the targeted backdoor label i for the \u2018prompted input\u2019 xtest+\u03b4(i). Since the backdoor attack is also input-agnostic, the class-discriminative ability of xtest + \u03b4(i) enabled by \u03b4(i) could result in incorrect prediction towards the target class i for xtest. Joint prompts optimization for C-AVP. The failure of CAVP-v0 inspires us to rethink the value of class-wise separability. As illustrated in challenges (C1)-(C2), the compatibility with the test-time prompt selection rule and the interrelationship between class-wise visual prompts should be taken into account. To this end, we develop a series of new AVP principles below. Fig. 2 provides a schematic overview of C-AVP and its comparison with U-AVP and the predictor without VP. Inputs Visual Prompt Pretrained Classifier Predictions Method (c) C-AVP (b) U-AVP (a) No Prompt Dog Cat Dog Cat Dog Cat Fig. 2: Overview of C-AVP over two classes (red and green) vs. U-AVP and the prompt-free learning pipeline. First, to bake the prompt selection rule (3) into C-AVP, we enforce the correct prompt selection, i.e., under the condition that fy(x + \u03b4(y);\u03b8) > maxk\u2236k\u2260y fk(x + \u03b4(k);\u03b8) for (x,y) \u2208 D(y). The above can be cast as a CW-type loss [47]: \u2113C\u2212AVP,1({\u03b4(i)}; Dtr, \u03b8) = E(x,y)\u2208Dtr max{max k\u2260y fk(x + \u03b4(k); \u03b8) \u2212fy(x + \u03b4(y); \u03b8), \u2212\u03c4}, (4) where \u03c4 > 0 is a con\ufb01dence threshold. The rationale behind (4) is that given a data sample (x,y), the minimum value of \u2113C\u2212AVP,1 is achieved at \u2212\u03c4, indicating the desired condition with the con\ufb01dence level \u03c4. Compared with (C-AVP-v0), another key characteristic of \u2113C\u2212AVP,1 is its non-splitting over class-wise prompts {\u03b4(i)}, which bene\ufb01ts the joint optimization of these prompts. Second, to mitigate the backdoor effect of mis-matched prompts, we propose additional two losses, noted by \u2113C\u2212AVP,2 and \u2113C\u2212AVP,3, to penalize the data-prompt mismatches. Specifically, \u2113C\u2212AVP,2 penalizes the backdoor-alike targeted prediction accuracy of a class-wise visual prompt when applied to mismatched training data. For the prompt \u03b4(i), this leads to \u2113C\u2212AVP,2({\u03b4(i)}; Dtr, \u03b8) = 1 N N \u2211 i=1 E(x,y)\u2208D(\u2212i) tr max{fi(x + \u03b4(i); \u03b8) \u2212fy(x + \u03b4(i); \u03b8), \u2212\u03c4}, (5) where D(\u2212i) tr denotes the training data set by excluding D(i) tr . The class i-associated prompt \u03b4(i) should not behave as a backdoor trigger to non-i classes\u2019 data. Likewise, if the prompt is applied to the correct data class, then the prediction con\ufb01dence should surpass that of a mis-matched case. This leads to \u2113C\u2212AVP,3({\u03b4(i)}; Dtr, \u03b8) = E(x,y)\u2208Dtr max{max k\u2260y fy(x + \u03b4(k); \u03b8) \u2212fy(x + \u03b4(y); \u03b8), \u2212\u03c4}. (6) Let \u2113C\u2212AVP,0({\u03b4(i)};Dtr,\u03b8) denote the objective function of (C-AVP-v0). Integrated with \u2113C\u2212AVP,q({\u03b4(i)};Dtr,\u03b8) for q \u2208{1,2,3}, the desired class-wise AVP design is cast as minimize {\u03b4(i)\u2208C}i\u2208[N] \u2113C\u2212AVP,0({\u03b4(i)}; Dtr, \u03b8)+ \u03b3 \u22113 q=1 \u2113C\u2212AVP,q({\u03b4(i)}; Dtr, \u03b8), (C-AVP) where \u03b3 > 0 is a parameter for class-wise prompting penalties. 5. EXPERIMENTS Experiment setup. We conduct experiments on CIFAR-10 with a pretrained ResNet18 of testing accuracy of 94.92% on standard test dataset. We use PGD-10 (i.e., PGD attack with 10 steps [1]) to generate adversarial examples with \u03f5 = 8/255 during visual prompts training, and with a cosine learning rate scheduler starting at 0.1. Throughout experiments, we choose \u03bb = 1 in (U-AVP), and \u03c4 = 0.1 and \u03b3 = 3 in (CAVP). The width of visual prompt is set to 8 (see Fig. 3 for the visualization). C-AVP outperforms conventional VP. Tab. 1 demonstrates the effectiveness of proposed C-AVP approach vs. U-AVP (the \fairplane automobile bird cat dear dog frog horse ship truck Fig. 3: C-AVP visualization. One image is chosen from each CIFAR-10 class with the corresponding C-AVP. Table 1: VP performance comparison in terms of standard (std) accuracy (acc) and robust accuracy against PGD attacks with \u03f5 = 8/255 and multiple PGD steps on (CIFAR-10, ResNet18). Evaluation Std Robust acc vs PGD w/ step # metrics (%) acc 10 20 50 100 Pre-trained 94.92 0 0 0 0 Vanilla VP 94.48 0 0 0 0 U-AVP 27.75 16.9 16.81 16.81 16.7 C-AVP-v0 19.69 13.91 13.63 13.6 13.58 C-AVP (ours) 57.57 34.75 34.62 34.51 33.63 direct extension of VP to adversarial defense) and the C-AVPv0 method in the task of robustify a normally-trained ResNet18 on CIFAR-10. For comparison, we also report the standard accuracy of the pre-trained model and the vanilla VP solution given by (1). As we can see, C-AVP outperforms U-AVP and C-AVP-v0 in both standard accuracy and robust accuracy. We also observe that compared to the pretrained model and the vanilla VP, the robustness-induced VP variants bring in an evident standard accuracy drop as the cost of robustness. Prompting regularization effect in (C-AVP). Tab. 2 shows different settings of prompting regularizations used in C-AVP, where \u2018Si\u2019 represents a certain loss con\ufb01guration. As we can see, the use of \u2113C\u2212AVP,2 contributes most to the performance of learned visual prompts (see S3). This is not surprising, since we design \u2113C\u2212AVP,2 for mitigating the backdoor effect of class-wise prompts, which is the main source of prompting selection error. We also note that \u2113C\u2212AVP,1 is the second most important regularization. This is because such a regularization is accompanied with the prompt selection rule (3). Tab. 2 also indicates that the combination of \u2113C\u2212AVP,1 and \u2113C\u2212AVP,2 is a possible computationally lighter alternative to (C-AVP). Class-wise prediction error analysis. Fig. 4 shows a comparison of the classi\ufb01cation confusion matrix. Each row corresponds to testing samples from one class, and each column corresponds to the prompt (\u2018P\u2019) selection across 10 image classes. As we can see, our proposal outperforms C-AVP-v0 since the former\u2019s higher main diagonal entries indicate less prompt selection error than the latter. Comparisons with other test-time defenses. In Tab. 3, we compare our proposed C-AVP with three test-time defense methods selected from Croce et. al. [14]. Note that all methods are applied to robustifying a \ufb01xed, standardly pre-trained ResNet18. Following Croce et. al. [14], we divide the considered defenses into different categories, relying on their defense principles (i.e., IP or MA) and needed test-time operations (i.e., IA, AN, and R). As we can see, our method C-AVP falls into the IP category but requires no involved test-time operations. This leads to the least inference overhead. Although there (a) C-AVP-v0 (b) C-AVP Fig. 4: The predictions of C-AVP-v0 vs. C-AVP on (CIFAR10, ResNet18). Table 2: Sensitivity analysis of prompting regularization in C-AVP on (CIFAR-10, ResNet18). Setting \u2113C\u2212AVP,1 \u2113C\u2212AVP,2 \u2113C\u2212AVP,3 Std Acc (%) PGD-10 Acc (%) S1 \u0018 \u0018 \u0018 19.69 13.91 S2 \u0014 \u0018 \u0018 22.72 13.01 S3 \u0018 \u0014 \u0018 40.01 25.40 S4 \u0018 \u0018 \u0014 17.44 11.78 S5 \u0014 \u0014 \u0018 57.03 32.39 S6 \u0014 \u0018 \u0014 26.02 15.80 S7 \u0014 \u0014 \u0014 57.57 34.75 exists a performance gap with the test-time defense baselines, we hope that our work could pave a way to study the pros and cons of visual prompting in adversarial robustness. Table 3: Comparison of C-AVP with other SOTA test-time defenses. Per the benchmark in Croce et. al. [14], the involved test-time operations in these defenses include: IP (input puri\ufb01cation), MA (model adaption), IA (iterative algorithm), AN (auxiliary network), and R (randomness). And inference time (IT), standard accuracy (SA), and robust accuracy (RA) against PGD-10 are used as performance metrics. Method IP MA IA AN R IT SA (%) RA (%) [43] \u0014 \u0018 \u0014 \u0018 \u0018 518 \u00d7 85.9% 0.4% [15] \u0014 \u0018 \u0014 \u0014 \u0014 176 \u00d7 91.1% 40.3% [44] \u0018 \u0014 \u0014 \u0014 \u0018 59 \u00d7 56.1% 50.6% C-AVP \u0014 \u0018 \u0018 \u0018 \u0018 1.4 \u00d7 57.6% 34.8% 6." + } + ], + "Xianbin Ye": [ + { + "url": "http://arxiv.org/abs/2203.00836v2", + "title": "CandidateDrug4Cancer: An Open Molecular Graph Learning Benchmark on Drug Discovery for Cancer", + "abstract": "Anti-cancer drug discoveries have been serendipitous, we sought to present\nthe Open Molecular Graph Learning Benchmark, named CandidateDrug4Cancer, a\nchallenging and realistic benchmark dataset to facilitate scalable, robust, and\nreproducible graph machine learning research for anti-cancer drug discovery.\nCandidateDrug4Cancer dataset encompasses multiple most-mentioned 29 targets for\ncancer, covering 54869 cancer-related drug molecules which are ranged from\npre-clinical, clinical and FDA-approved. Besides building the datasets, we also\nperform benchmark experiments with effective Drug Target Interaction (DTI)\nprediction baselines using descriptors and expressive graph neural networks.\nExperimental results suggest that CandidateDrug4Cancer presents significant\nchallenges for learning molecular graphs and targets in practical application,\nindicating opportunities for future researches on developing candidate drugs\nfor treating cancers.", + "authors": "Xianbin Ye, Ziliang Li, Fei Ma, Zongbi Yi, Pengyong Li, Jun Wang, Peng Gao, Yixuan Qiao, Guotong Xie", + "published": "2022-03-02", + "updated": "2022-08-22", + "primary_cat": "cs.LG", + "cats": [ + "cs.LG", + "q-bio.BM" + ], + "main_content": "INTRODUCTION Cancer is one of the leading causes of mortality worldwide. Opportunities to help reduce the death rate from cancer through the discovery of new drugs are benefiting from the increasing advances in technology and enhanced knowledge of human neoplastic disease[23, 33]. However, drug discovery is a time-consuming, labor intensive, and expensive process, far slower than expected. The entire process from discovery to the regulatory approval of a new drug can take as much as 12 years and cost estimated at US 3 billion [7]. It has been usually hampered by experimental discovery of molecules and targets, and following with validation with in vitro experiments on cell lines and animals before moving to clinical testing [12]. Furthermore, stagnant success rate ( 1:5000) is associated with each drug development stage. Fortunately, many researchers have proposed various effective computer-aided drug discovery (CADD) methods [24] to decrease the costs and speed up projects [14]. As an feasible assistant technique, CADD has made a significant contribution to drug discovery and has successfully developed dozens of drugs to market in recent decades[32]. Generally, CADD can be categorized into receptor-based methods and ligand-based methods upon the availability of target proteins and molecules. Receptor-based CADD relies on the target protein structure to calculate interaction for compounds, while ligand-based CADD exploits the information of compounds with diverse structures and known activity and inactivity, for construction of predictive, quantitative structure-activity relation (QSAR)[4]. 29 54869 73770 Targets Compounds Pairs of Interaction Numbers Figure 2: CandidateDrug4Cancer dataset encompasses multiple most-mentioned 29 targets for cancer, with 73770 drugtarget pairs, covering a diverse range of 54869 related drug molecules which is ranged from pre-clinical, clinical and FDA-approved. At present, the interdisciplinary studies between advanced Artificial Intelligence (AI) and drug discovery have received increasing attention due to the superior speed and performance. Many AI technologies have been successfully applied in a variety of tasks for CADD, such as receptor-based Drug Target Interaction (DTI) prediction [1, 8]. Due to the large size of the chemical space, one of the fundamental challenges for these studies is how to learn expressive representations from molecular structures [31]. In the early years, molecular representations are based on hand-crafted features such as molecular descriptors or fingerprints [30]. In contrast, there has been a surge of interests in end-to-end molecular representation learned by graph neural networks. However, challenges for deep learning in molecular representation mainly arise from the scarcity of labeled data, resulting in models that lack practicability [13, 22]. In particular, so far there is limited published information on molecular graph learning for cancer to our knowledge. Altogether, these issues make it difficult producing favorable benchmark assembling proper information of cancer targets and potential molecules, for assessing and comparing the performance of different methods on drug discovery for cancer. To address these issues, we introduced an open molecular graph learning benchmark on drug discovery for cancer, named CandidateDrug4Cancer. Our main contributions can be summarized as follows: \u2022 We introduce a novel graph learning task which has the potential to help understand the performance and limitations of graph representation facilitated models on candidate anticancer drug discovery problems. \u2022 We provide CandidateDrug4Cancer benchmark dataset, which encompasses multiple most-mentioned 29 targets for cancer, covering 54869 cancer-related drug molecules which are ranged from pre-clinical, clinical and FDA-approved. \u2022 We conduct benchmark evaluations for drug target interaction with baseline encoders including powerful graph neural network for drug-like molecules. 2 RELATED WORKS Drug Target Interaction One of the initial steps of drug discovery is the identification of novel drug-like compounds that interact with the predefined target proteins. Various deep learning methods have been developed and achieved excellent performance for drug-target interaction (DTI) prediction [5, 20, 27]. Generally, the deep learning algorithms for DTI prediction comprise of a compound encoder and a protein encoder. Recently, Tsubaki et al. [25] proposed a new DTI framework by combining GNN for compounds and a CNN for proteins, which significantly outperformed existing methods. Molecular Graph Learning Recently, among the promising deep learning architectures, graph neural network (GNN), such as message passing neural network (MPNN) [11] has gradually emerged as a powerful candidate for modeling molecular data. Because a molecule is naturally a graph that consists of atoms (nodes) connected through chemical bonds (edges), it is ideally suited for GNN. Up to now, various GNN architectures have achieved great progress in drug discovery [19, 29]. However, there are some limits that need to be addressed. Challenges for deep learning in molecular representation mainly arise from the scarcity of labeled data, as lab experiments are expensive and time-consuming. Thus, training datasets in drug discovery are usually limited in size, and GNNs tend to overfit them, resulting in learned representations that lack practicability [13, 17, 22]. Anti-Cancer Candidate Drug Datasets Unfortunately, the current number of drugs (FDA approved or at the experimental stage) is only around 10,000, the current knowledge about the drug\u2013target space is limited, especially for severe life-threatening cancers, and novel approaches are required to widen our knowledge[21]. However, most cancer drug discoveries have been serendipitous, the extent to which non-cancer drugs have potential as future cancer \fCandidateDrug4Cancer: An Open Molecular Graph Learning Benchmark on Drug Discovery for Cancer GLB 2021, The Web Conference 2021 therapeutics is unknown[6]. Recent efforts have demonstrated the power of cancer cell line screening\u2014testing either many compounds across a limited number of cell lines (for example, NCI-60 [2], Genomics of Drug Sensitivity in Cancer (GDSC) [9], the Cancer Target Discovery and Development (CTD2)[3] and DepMap[6]. The ideal study would involve screening larger amount of drug candidates (most of which are non-oncology drugs) across most target proteins to capture the molecular diversity of human cancer. Table 1: The most frequent target proteins of cancers collected from DepMap[6], DrugBank[28] and ChEMBL[10]. Target_id Target_name chembl1824 Receptor protein-tyrosine kinase erbB-2 chembl1865 Histone deacetylase 6 chembl1871 Androgen Receptor chembl1913 Platelet-derived growth factor receptor beta chembl1936 Stem cell growth factor receptor chembl1937 Histone deacetylase 2 chembl1974 Tyrosine-protein kinase receptor FLT3 chembl203 Epidermal growth factor receptor erbB1 chembl2041 Tyrosine-protein kinase receptor RET chembl2185 Serine/threonine-protein kinase Aurora-B chembl262 Glycogen synthase kinase-3 beta chembl267 Glycogen synthase kinase-3 beta chembl279 Vascular endothelial growth factor receptor 2 chembl2842 Serine/threonine-protein kinase mTOR chembl2971 Tyrosine-protein kinase JAK2 chembl301 Cyclin-dependent kinase 2 chembl308 Cyclin-dependent kinase 1 chembl3130 PI3-kinase p110-delta subunit chembl3145 PI3-kinase p110-beta subunit chembl325 Histone deacetylase 1 chembl3267 PI3-kinase p110-gamma subunit chembl332 Matrix metalloproteinase-1 chembl333 Matrix metalloproteinase-2 chembl340 Cytochrome P450 3A4 chembl3717 Hepatocyte growth factor receptor chembl4005 PI3-kinase p110-alpha subunit chembl4282 Serine/threonine-protein kinase AKT chembl4630 Serine/threonine-protein kinase Chk1 chembl4722 Serine/threonine-protein kinase Aurora-A 3 CANDIDATEDRUG4CANCER DATASETS Inspired by DepMap [6] and DrugBank [28], we sought to create a public resource containing the candidate compounds for the most-used targets for cancers, as shown in Table 1. Firstly, the most commonly researched and cancer-related targets are collected based on DepMap and DrugBank, subsequently, the corresponding compounds and drug-target pairs are collected to establish CandidateDrug4Cancer from the ChEMBL database [10] (https://www.ebi.ac.uk/chembl/g/, ChEMBL is a manually curated database of bioactive molecules with drug-like properties. It brings together chemical, bioactivity and genomic data to aid the translation of genomic information into effective new drugs). In addition to the published IC50 measurement, ChEMBL have added an additional field called pChEMBL to the activities table. This value represent comparable measures of concentrations to reach half-maximal response transformed to a negative logarithmic scale. pChEMBL is defined as: \ud835\udc5d\ud835\udc36\u210e\ud835\udc38\ud835\udc40\ud835\udc35\ud835\udc3f= \u2212lg(\ud835\udc5a\ud835\udc5c\ud835\udc59\ud835\udc4e\ud835\udc5f\ud835\udc3c\ud835\udc3650(\ud835\udc40)) (1) For example, an IC50 measurement of 10 uM would have a pChEMBL value of 5. However, in order to efficiently verify anticancer inhibitors and reduce the cost of a large number of subsequent experiments, we set decision boundary at pChEMBL is 7(approximately 100 nM) more strictly, defining pChEMBL larger than or equal to 7 as positive interaction [16] (see Figure 3). Table 2: The features used in molecular graph. These features are obtained by RDKit [15]. Type Name Description Node feature Atom type Atomic number (0-122) Formal charge [unk,-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5] Chirality type [unk, unspecifie, tetrahedral-CW, tetrahedralL-CCW, other] Hybridization [unk, sp, sp2, sp3, sp3d, sp3d2, unspecified] NumH Number of connected hydrogens[unk,0, 1, 2, 3, 4, 5, 6, 7, 8] Implicit valence [unk, 0, 1, 2, 3, 4, 5, 6] Degree Number of covalent bonds [unk, 0, 1, 2, 3, 4, 5,6,7,8,9,10] Aromatic Whether the atom is part of an aromatic system [0,1] Edge feature Bond direction [None,endupright, enddownright] Bond type [Single, double, triple, aromatic] Conjugation Whether the bond is conjugated [0,1] Ring Whether the bond is in Ring [0,1] Stereo [StereoNone, StereoAny, StereoZ, StereoE] 4 EXPERIMENTAL SETUP Baseline models. Various deep learning methods have been developed and achieved promising performance for DTI prediction [5, 20, 25, 27].Generally, the common DTI prediction models comprise of a compound encoder and a protein encoder. We have compared baselines using different combinations of compound and protein encoders including: MPNN-CNN, Daylight-AAC, Morgan-AAC and MolGNet-CNN (For compounds: Morgan fingerprints, Daylighttype fingerprints, MPNN on molecular graph. For proteins: Amino Acid Composition up to 3-mers, Convolutional Neural Network (CNN) on target sequence). In particular, we further adopt our pretrained GNN named MolGNet [18], to evaluate the effectiveness of pre-trained GNN on DTI prediction for caner targets. Implementation details. We conduct leave-one-target-out evaluation, the drug-target interaction pairs of the rest 28 targets are used for training, and the performances are calculated on each unseen target proteins. So as to evaluate whether models are capable of prediction on unseen targets. Due to hardware limitations and multiple baseline comparisons, we evaluate the baselines on 20% of total datasets (the sub-datasets are also provided in our link). Each model is trained for 50 epochs. For graph learning, all drug molecules are pre-processed into hydrogen-depleted molecular graphs with nodes features, edge features, and adjacency matrix with RDKit [15]. The detailed information about nodes features and edge features can be referred to Table 2. 5 RESULTS AND" + } + ], + "Bingzhe Wu": [ + { + "url": "http://arxiv.org/abs/2205.10014v2", + "title": "A Survey of Trustworthy Graph Learning: Reliability, Explainability, and Privacy Protection", + "abstract": "Deep graph learning has achieved remarkable progresses in both business and\nscientific areas ranging from finance and e-commerce, to drug and advanced\nmaterial discovery. Despite these progresses, how to ensure various deep graph\nlearning algorithms behave in a socially responsible manner and meet regulatory\ncompliance requirements becomes an emerging problem, especially in\nrisk-sensitive domains. Trustworthy graph learning (TwGL) aims to solve the\nabove problems from a technical viewpoint. In contrast to conventional graph\nlearning research which mainly cares about model performance, TwGL considers\nvarious reliability and safety aspects of the graph learning framework\nincluding but not limited to robustness, explainability, and privacy. In this\nsurvey, we provide a comprehensive review of recent leading approaches in the\nTwGL field from three dimensions, namely, reliability, explainability, and\nprivacy protection. We give a general categorization for existing work and\nreview typical work for each category. To give further insights for TwGL\nresearch, we provide a unified view to inspect previous works and build the\nconnection between them. We also point out some important open problems\nremaining to be solved in the future developments of TwGL.", + "authors": "Bingzhe Wu, Jintang Li, Junchi Yu, Yatao Bian, Hengtong Zhang, CHaochao Chen, Chengbin Hou, Guoji Fu, Liang Chen, Tingyang Xu, Yu Rong, Xiaolin Zheng, Junzhou Huang, Ran He, Baoyuan Wu, GUangyu Sun, Peng Cui, Zibin Zheng, Zhe Liu, Peilin Zhao", + "published": "2022-05-20", + "updated": "2022-05-23", + "primary_cat": "cs.LG", + "cats": [ + "cs.LG", + "cs.AI" + ], + "main_content": "Introduction Recently, Deep Graph Learning (DGL) based on Graph Neural Networks (GNNs) have emerged as a powerful learning paradigm for graph representation learning. In the past few years, DGL is becoming an active frontier of deep learning with an exponential growth of research. With advantages in modeling graph-structured data, DGL has achieved remarkable progress in many important areas, ranging from \ufb01nance (e.g., fraud detection and credit modeling) [28, 144, 9, 67], e-commerce (e.g., recommendation system) [126, 85], drug discovery and advanced material discovery [41, 134, 100, 82, 83]. Although considerable progress has been made in the \ufb01eld of deep graph learning, there are many challenges about the level of trustworthiness associated with GNNs in many real-world applications, especially in risk-sensitive and and securitycritical scenarios such as \ufb01nance and bioinformatics [100]. Such challenges are real and call for sophisticated solutions, as many untrustworthy sides of DGL models have been exposed through adversarial attacks [19, 13], inherent bias or unfairness [157], and lack of explainability [152] and privacy protection [16] in the current rapidly evolving works. In light of these challenges, various emerging laws and regulations in arti\ufb01cial intelligence (AI) ethic, e.g., EU General Data Protection Regulation (GDPR) [91], promote different companies to develop trustworthy algorithms for meeting regulatory compliance requirements of privacy, explainability and fairness, etc. A new research trend in recent years has been to investigate ways to to build trustworthy algorithms and ensure they behave in a socially responsible manner. Trustworthy Graph Learning (TwGL), an emerging \ufb01eld with the aim to solve the trustworthiness issues in graph data from a technical viewpoint, has become a focus of attention in the areas of deep graph learning. In contrast to conventional graph learning research which mainly focus on how to develop accurate models, TwGL considers various reliability and safety aspects of the graph learning problem beyond model performance. In Figure 1, we summarise the four key dimensions 2 \ftowards reliable TwGL, that is, accuracy, reliability, explainability, and privacy protection. We give detailed descriptions as follows: 1) Accuracy or utility: The prediction accuracy is the basic ability of a trustworthy model. Trustworthy GNNs are expected to generate accurate output, consistent with the ground truth, as much as possible; 2) Reliability: Trustworthy GNNs should be resilient and secure. In other words, they must be robust against different potential threats, such as inherent noise, distribution shift, and adversarial attacks; 3) Explainability. Understanding the graph learning model is another important aspect in developing trustworthy GNNs. The model itself must allow explainable for the prediction, which can help humans to enhance understanding, make decisions and take further actions; 4) Privacy protection: Trustworthy GNNs are required to ensure full privacy of the models as well as data privacy. Trustworthy Graph Learning Accuracy Reliability Explainability Privacy Protection Figure 1: Four key dimensions of trustworthy graph learning. Motivation and Contributions. The trustworthiness of DGL models is an inescapable problem when they step into real-world applications, posing various open, unexplored, and unidenti\ufb01ed challenges in both academic and industrial communities. Therefore, various aspects of DGL models are required to be carefully considered to achieve trustworthiness. To facilitate the research in the \ufb01eld of TwGL, there is a pressing demand for a comprehensive survey reviewing current work from a uni\ufb01ed view. In this survey, we provide a comprehensive overview of existing achievements in the TwGL \ufb01eld from four key dimensions, namely, robustness, explainability and privacy protection. For each part, we give a general categorization for existing work and review typical work for each category. To give further insights for TwGL research, we provide a uni\ufb01ed view to inspect previous work and build the connections between them. We also point out some important open problems remaining to be solved in the future developments of TwGL. Overview. In this paper, we puts together the state-of-the-art and most important works for TwGL. The organization of this paper is structured as follows: In Section 2, we comprehensively review the recent advances of reliable DGL against three threats, including inherent noise, distribution shift, and adversarial attack. In Section 3, we provide a detailed technique overview of the state-of-the-art GNN explainability methods. In Section 4, we also discuss the research on the privacy protection of DGL models. For each section, we summarize several challenges 3 \fand opportunities for future research. Finally, we conclude this paper by providing insights for further achievements of trustworthy graph learning in Section 5. Relation to other surveys. To our best knowledge, little survey have been comprehensively conducted especially on the methods and applications of TwGL. There are several surveys related to our paper, most of which focus on a single aspect of TwGL, e.g., reliability [110, 19, 60, 137, 169, 161] and explainability [152, 70]. Comparatively to the aforementioned surveys, we present a systematic and comprehensive review of the current advances, trends, and applications in trustworthy graph learning, which would potentially bene\ufb01t the research community in developing practical trustworthy models. Basic de\ufb01nitions. Oracle graph data G = (A, X) with its adjacency matrix A and node features X; Y the labels of graphs/nodes; \u03f5a, \u03f5x, \u03f5y denote structure, attribute, and label noises respectively; Dtrain and Dtest are the training and test dataset, respectively; L denotes the loss function and \u02c6 G is the perturbed graph. 2 Reliability 2.1 Overview (a)Inherent Noise Class blue Class red Data Sampling Deep Graph Learning Adversarial Sample Model Prediction (c) Adversarial Attack max \u0302 \ud835\udca2\ud835\udca2\u2248\ud835\udca2\ud835\udca2\u2112( \u0302 \ud835\udca2\ud835\udca2, \ud835\udc4c\ud835\udc4c) \u0302 \ud835\udca2\ud835\udca2 \ud835\udc43\ud835\udc43train \ud835\udca2\ud835\udca2, \ud835\udc4c\ud835\udc4c \u2260\ud835\udc43\ud835\udc43test (\ud835\udca2\ud835\udca2, \ud835\udc4c\ud835\udc4c) \ud835\udc9f\ud835\udc9ftrain \ud835\udca2\ud835\udca2 \u0302 \ud835\udca2\ud835\udca2 \u2755 \u2755Label noise (b) Distribution Shift Data Annotation Misclassified Data Generation Figure 2: An illustrative example on deep graph learning against (a) inherent noise, (b) distribution shift, and (c) adversarial attack. From left to right: the inherent noise (i.e., label noise) is inevitably introduced during data annotation, where a red \u201ccircle\u201d node is mislabeled with the \u201ccross\u201d class (marked with red color). Then, the sampling bias leads to the discrepancy between training (color-\ufb01lled nodes) and testing datasets (color-un\ufb01lled nodes), thus introducing any possible kind of distribution shift. After the data generation process, adversarial attacks are performed on the graph to mislead the model prediction (e.g., misclassi\ufb01cation on a node). Recent few years have seen deep graph learning (DGL) based on graph neural networks (GNNs) making remarkable progress in a variety of important areas, ranging from business scenarios such as \ufb01nance (e.g., fraud detection and credit modeling) [28, 144, 9, 67], e-commerce (e.g., recommendation system) [126, 85], drug discovery and advanced material discovery [41, 134, 100, 82, 83]. Despite the progress, applying various DGL algorithms to real-world applications faces a 4 \fTable 1: Summary of recent advances in reliable deep graph learning. Threats Description Selected" + }, + { + "url": "http://arxiv.org/abs/2204.07742v1", + "title": "DRFLM: Distributionally Robust Federated Learning with Inter-client Noise via Local Mixup", + "abstract": "Recently, federated learning has emerged as a promising approach for training\na global model using data from multiple organizations without leaking their raw\ndata. Nevertheless, directly applying federated learning to real-world tasks\nfaces two challenges: (1) heterogeneity in the data among different\norganizations; and (2) data noises inside individual organizations.\n In this paper, we propose a general framework to solve the above two\nchallenges simultaneously. Specifically, we propose using distributionally\nrobust optimization to mitigate the negative effects caused by data\nheterogeneity paradigm to sample clients based on a learnable distribution at\neach iteration. Additionally, we observe that this optimization paradigm is\neasily affected by data noises inside local clients, which has a significant\nperformance degradation in terms of global model prediction accuracy. To solve\nthis problem, we propose to incorporate mixup techniques into the local\ntraining process of federated learning. We further provide comprehensive\ntheoretical analysis including robustness analysis, convergence analysis, and\ngeneralization ability. Furthermore, we conduct empirical studies across\ndifferent drug discovery tasks, such as ADMET property prediction and\ndrug-target affinity prediction.", + "authors": "Bingzhe Wu, Zhipeng Liang, Yuxuan Han, Yatao Bian, Peilin Zhao, Junzhou Huang", + "published": "2022-04-16", + "updated": "2022-04-16", + "primary_cat": "cs.LG", + "cats": [ + "cs.LG", + "cs.DC", + "stat.ML" + ], + "main_content": "Introduction Recently, Federated learning (FL) is emerging as a promising way to mitigate the information silo problem, in which data are spread across different organizations and cannot be exchanged due to privacy concerns and regulations. (McMahan et al., 2017; Yang et al., 2019). There are plentiful attempts to apply FL to various real-world applications in1Tencent AI Lab 2Hong Kong University of Science and Technology. Correspondence to: Bingzhe Wu . cluding recommender system (Chen et al., 2020a;b), medical image analysis (Sheller et al., 2020) and drug discovery (Chen et al., 2021; Xiong et al., 2020). For example, Chen et al. (Chen et al., 2020a) combine the FL method and secure multi-party computation for building recommender systems among different organizations. He et al. (He et al., 2021) proposes a federated GNN learning framework for various molecular property prediction tasks. Despite the above progress, directly applying FL methods to real-world scenarios still faces severe challenges. In this paper, we focus on two critical challenges: (1) Inter-client data heterogeneity (2) Intra-client data noise. Speci\ufb01cally, interclient data heterogeneity refers to data from different clients that always have varying distributions. This is also called the Non-IID issue in the FL research community (Karimireddy et al., 2020; Li et al., 2020a). For example, different pharmaceutical companies/labs may use different high-throughput screening environments to measure the protein-ligand binding af\ufb01nity, resulting in different DTI assays (Bento et al., 2014; Mendez et al., 2019). The intra-client data noise refers to the noise created during the data collection process within each client individually. A common noise source in drug discovery is the label noise caused by measurement noise or the situation where very low/high-af\ufb01nity values are often encoded as a boundary constant, see (Mendez et al., 2019) for a detailed description for the various noise in the largest bioassay deposition website. Numerous efforts have been made to solve the \ufb01rst issue (Mohri et al., 2019; Reisizadeh et al., 2020; Li et al., 2020a; Karimireddy et al., 2020; Li et al., 2021; Xie et al., 2021) from different aspects. A recent trend tries an essential approach to overcome the client heterogeneity by incorporating distributionally robust optimization (DRO) (Duchi et al., 2011) into conventional FL paradigm (Mohri et al., 2019; Deng et al., 2021). Recently, DRFA (Deng et al., 2021) proposes to optimize the distributionally robust empirical loss, which combines different local loss functions with learnable weights. This method theoretically ensures that the learned model can perform well over the worst-case combination of local data distributions. Previous work using DRO has shown effectiveness on some academic benchmarks such as Fashion MNIST and UCI arXiv:2204.07742v1 [cs.LG] 16 Apr 2022 \fDRFLM: Distributionally Robust Federated Learning with Inter-client Noise via Local Mixup Adults (Deng et al., 2021; Mohri et al., 2019). However, when these methods are applied to real-world tasks such as drug discovery, we observe poor performance and training instability. Intuitively, prior work (Deng et al., 2021; Mohri et al., 2019) aims to pessimistically optimize the worst-case combination of local distribution which is typically dominated by the local training distribution with more noises. Therefore they suffer serious performance drop issue as shown in Figure 1. From this \ufb01gure, the use of distributionally robust optimization cannot improve the worst-case local RMSE but even signi\ufb01cantly reduces the performance. According to further empirical studies (see details in Section 4), we identify that Intra-client data noise inside the local client data is the main cause of the above issues. Similar issues have also been discussed in the centralized setting (Zhai et al., 2021), which points out that DRO is sensitive to outliers which further hinder model performance. In this paper, we focus on mitigating the effects caused by intra-client data noise in the FL setting. In order to address the above two critical challenges, we present a general framework named DRFLM for building robust neural network models in the FL setting for a wide range of tasks. To overcome the inter-client data heterogeneity issue, we propose to employ DRO techniques to optimize the global model. As discussed above, such a DRO method can be easily affected by intra-client data noise (Zhai et al., 2021). As suggested by previous work (Zhai et al., 2021), a natural method to reduce the noise effect in the centralized setting is to drop samples with large losses during training. However, this approach may result in samples that are very valuable to overall training being discarded, which then leads to sub-optimal results. Hence, we propose to integrate the mixup strategy into the local training process and \ufb01nd that it can signi\ufb01cantly improve the empirical performance. Furthermore, this paper offers an interesting theoretical \ufb01nding that mixup can provide heterogeneity-dependent generalization bounds, as shown in Theorem 1. In contrast to most FL-related work which mainly focuses on convergence analysis, our theoretical analysis examines more aspects of the proposed FL approach. Speci\ufb01cally, our analysis consists of three parts: (1) We provide a concrete example to demonstrate the effectiveness of the mixup strategy for mitigating noise effects on conventional DRO FL methods. (2) We analyze the generalization bounds of the learned model, which is the primary theoretical contribution of this paper. (3) We provide rigorous convergence analysis of the training process. Based on theoretical analysis, we conduct extensive empirical studies covering a wide range of drug discovery tasks including molecular property prediction and drug-target interaction prediction. Extensive experimental results show the effectiveness of DRFLM in reducing the effects of client distribution shift and local data noise. 0.0 0.5 1.0 1.5 2.0 2.5 3.0 Noise Level 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 Average RMSE DRFA (average) FedAvg (average) DRFA (worst) FedAvg (worst) 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 Worst RMSE Figure 1. Average and worst-case client RMSE of FedAvg (McMahan et al., 2017) and DRFA (Deng et al., 2021) on a molecular property prediction task. 2. Framework of DRFLM 2.1. Notation We start by \ufb01xing some notations that will be used throughout this paper. we denote [N] = {1, 2, \u00b7 \u00b7 \u00b7 , N}. We consider federated learning setting where N clients jointly train a central model with the i-th client\u2019s local training datasets of sample size Ni. The local dataset is denoted as Di = {zi,j}Ni j=1 and each sample zi,j = (xi,j, yi,j) is i.i.d. drawn from an unknown local joint distribution P(i) x,y. We denote Z\u2020 for any matrix Z as the pseudo inverse of it. 2.2. Optimization Objective A common used approach in Federated learning (FL) to collaboratively train a central model w is to optimize the following objective: min w\u2208W F(w) := N X i=1 Ni N fi(w) (1) where fi(w) = 1 Ni P zi,j\u2208Di f(w, zi,j) is the local empirical risk for client i with the global model. The optimization of Equation 1 suffers from non-iid data distribution, i.e., the heterogeneity across different clients\u2019 data collection (Deng et al., 2021). To provide an intuition, note the target objective in Equation 1 aggregates client-speci\ufb01c loss functions with weights proportional to their local dataset sizes following the standard empirical risk minimization framework. Imbalance sample sizes of different clients or diversity among local data distributions may inevitably plague the generalization ability of the central model obtained by solving Equation 1. To provide the performance guarantee over the worst-case local distribution, Deng et al. (Deng et al., 2021) propose a framework named DRFA to minimize the worst-case combination loss of local empirical distributions: min w\u2208W max \u03bb\u2208\u039b F(w, \u03bb) = N X i=1 \u03bbifi(w) (2) where \u03bb \u2208\u039b := {\u03bb \u2208RN +, PN i=1 \u03bbi = 1} is the learnable \fDRFLM: Distributionally Robust Federated Learning with Inter-client Noise via Local Mixup sampling weights for each local client and fi(\u00b7) is the local empirical distribution. However, Equation 2 tends to pessimistically optimize the worst-case local distribution which can be easily affected by inter-client data noise. As shown in Figure 1, when we apply these methods to real-world drug discovery datasets, the use of distributionally robust optimization cannot improve the worst-case local RMSE but even signi\ufb01cantly reduces the performance. To mitigate the noise effect on the optimization procedure, instead of directly optimizing the worst-case local empirical distribution, we propose to incorporate the popular data augmentation technique, mixup, into the local training procedure as follows: min w\u2208W max \u03bb\u2208\u039b F(w, \u03bb) := N X i=1 \u03bbi \u02dc fi(w). (3) Here we optimize the worst-case local empirical loss evaluated on the mixup distribution \u02dc fi. To be speci\ufb01c, for the i-th client\u2019s local dataset, we denote \u02dc x(i) j,k(\u03b3) = \u03b3g(xi,j) + (1 \u2212 \u03b3)g(xi,k) and \u02dc y(i) j,k(\u03b3) = \u03b3yi,j +(1\u2212\u03b3)yi,k with \u03b3 \u2208[0, 1] be the linear interpolation between two samples in the local dataset Di and g : Rd \u2192Rd is a mapping to improve the \ufb02exibility of our framework to handle different kinds of data. We choose g(\u00b7) as an identity operator for the tableau or image data. For graph prediction tasks including drug discovery, we choose g(\u00b7) as a graph neural network to map a graph (V, E) to a global graph embedding in Rd. Let \u03b3 follows the distribution as Beta(\u03b1, \u03b2), \u02dc z(i) j,k(\u03b3) = (\u02dc x(i) j,k(\u03b3), \u02dc y(i) j,k(\u03b3)) and \u02dc Di(\u03b3) = {\u02dc z(i) j,k(\u03b3), j, k \u2208[Ni]} be the local mixup dataset by linear interpolating between every two samples. After the construction of the mix-up empirical distribution, we evaluate each local loss function on the local mixup dataset, i.e., \u02dc fi(w) = 1 N 2 i P \u02dc z(i) j,k\u2208\u02dc Di(\u03b3) fi(w, \u02dc z(i) j,k) and then combine them with learnable sampling weights \u03bbi as shown in Equation 3. 2.3. Optimization Procedure We adopt a similar approach in (Deng et al., 2021) to solve the min-max optimization problem in Equation 3. The core idea is to alternatively update w and \u03bb combining with sample techniques to reduce communication cost. We brie\ufb02y introduce the main steps in Algorithm 1 (more details can be found in the prior work (Deng et al., 2021)). At the beginning of the s-th communication stage, the optimization procedure follows as: 1. Sampling: the server independently selects two subsets of [N], Cs and Us, both with size of a pre-de\ufb01ne parameter m and also samples a time index t \u2032 s \u223cU[0, \u03c4] with a pre-de\ufb01ne parameter \u03c4 for updating \u03bb. The selection of Cs follows the probability \u03bbt \u2208RN with replacement. 2. Broadcasting: the server broadcasts the central model to the selected clients. Then the client constructs a mixup dataset as discussed above and runs stochastic gradient descent (SGD) algorithm on the mixup dataset to update their local models. After that clients return their local parameter updates after time t \u2032 s (used for updating \u03bb) and the last time \u03c4 (used for updating the global model). 3. Updating \u00af ws+1: the server takes an average over the received latest model parameters. To be speci\ufb01c, \u00af ws+1 = 1 m X j\u2208Cs w(j) s,\u03c4 4. Updating \u03bbs+1: the server takes an average \u02dc ws+1 = 1 m P j\u2208Cs w(j) s,t\u2032 s and then broadcasts it to all clients in Us and receives the stochastic gradients evaluated at this point to construct an auxiliary vector vs. Then the server updates \u03bb as following with some pre-de\ufb01ned learning rate \u03b7 : \u03bbs+1 = Y \u03bb\u2208\u039b (\u03bb(s) + \u03b7\u03c4vs). 3. Theoretical Analysis In this part, we provide different theoretical views to understand our approach in Algorithm 1. 3.1. Theoretical Motivation We \ufb01rst show a concrete example to demonstrate the effectiveness of our method in mitigating the local noise effect. Speci\ufb01cally, we construct an example as follows: Example 1. We consider FL setting with two clients. These two clients jointly train a linear classi\ufb01er: \u03c6(x; w) = sgn(wT x) over the global dataset (x, y) generated by the joint distribution P(x, y) as following: x \u223cPX := Uniform \u001a [\u22122, \u22121]d [ \u0000[1, 2] \u00d7 [\u22122, \u22121]d\u22121\u0001\u001b y = \u001a 1, x1 > 0 \u22121, x1 \u22640 . Given the above global joint distribution, the local distribution of each client is de\ufb01ned as following: \u2022 The \u201dclean\u201d dataset D1 = {(x1,i, y1,i)}N1 i=1 i.i.d. \u223c P(x, y) of the \ufb01rst client is noiseless. \u2022 The \u201dnoisy\u201d dataset \u02dc D2 = {(x2,i, \u02dc y2,i)}N2 i=1 i.i.d. \u223c \u02dc P(x, \u02dc y) (\u02dc y is a noisy version of y de\ufb01ned as follow): \u02dc y2,i = \u001a y2,i, x1 / \u2208I Flipping(y2,i; p1), x1 \u2208I \fDRFLM: Distributionally Robust Federated Learning with Inter-client Noise via Local Mixup Algorithm 1 Dristributionally Robust Federated Learning with Local Mixup (DRFLM) parameters: synchronization gap \u03c4, total communication round T, S = T/\u03c4, sampling size m, mix-up ratio \u03b3, initial model \u00af w0 and initial weights \u03bb0 function CLIENTUPDATE(i, \u00af ws, t \u2032 s) Initialize local weights wi s,0 = \u00af ws Construct \u02dc Di(\u03b3) = {\u03b3g(z1)+(1\u2212\u03b3)g(z2)|z1, z2 \u2208Di} for t = 1 to \u03c4 do Uniformly sample \u02dc z(i) t from \u02dc Di(\u03b3) w(i) s,t = Q W \u0010 w(i) s,t\u22121 \u2212\u03b7\u2207f(w(i) s,t\u22121; \u02dc z(i) t ) \u0011 end for return (w(j) s,\u03c4, w(j) s,t\u2032 s) Server executes: initialize \u00af w0 for s = 1 to S do Sample a set Cs \u2282[N] with size of m and probability \u03bbs with replacement Uniformly sample t \u2032 s from [\u03c4] uniformly Uniformly sample a set Us \u2282[N] with size of m for client j \u2208Cs in parallel do (w(j) s,\u03c4, w(j) s,t\u2032 s) = CLIENTUPDATE(j, \u00af ws, t \u2032 s) end for \u00af ws+1 = 1 m P j\u2208Cs w(j) s,\u03c4 \u02dc ws+1 = 1 m P j\u2208Cs w(j) s,t\u2032 s Broadcasts \u02dc ws+1 to all clients i \u2208Us and receive fi( \u02dc ws+1; \u02dc z(i) t\u2032 s ) from local client Construct v \u2208RN with vi = N mfi( \u02dc ws+1; \u02dc z(i) t\u2032 s ) for each indice i \u2208Us and vi = 0 for i / \u2208Us Updates \u03bbs+1 = Q \u039b(\u03bbs + \u03b7\u03c4vs) end for Output \u00af wS, \u03bbS with I = [\u22121 \u2212p2, \u22121], 1/2 < p1 < 1, 0 < p2 < 1 and Flipping(y; p1) the random function that \ufb02ips y to \u2212y with probability p1. We construct \u02dc D2 as a noisy version of D2 to simulate the local noise effect on the training procedure. Suppose N1 = N2 = \u02dc N, then given the 0-1 loss f(w; x, y) := 1{y \u0338= \u03c6(x; w)} and the learned models wAvg \u02dc N , wDRFA \u02dc N , wDRFLM \u02dc N obtained by minimizing the empirical FedAvg loss (Equation 1), DRFA loss (Equation 2) and DRFLMloss (Equation 3) associated with \u2113. We then have 1 lim \u02dc N\u2192\u221e EP (x,y)[f(wDRFA \u02dc N , x, y)] > lim \u02dc N\u2192\u221e EP (x,y)[f(wAvg \u02dc N ; x, y)] = lim \u02dc N\u2192\u221e EP (x,y)[f(wDRFLM \u02dc N ; x, y)] = 0. As shown by the above inequality, under certain conditions, with the increase of training sample number, losses of FedAvg and our method can gradually decrease to zero while the loss of DRFA cannot converge to zero even with in\ufb01nity samples. We have two insights from the above example: (1) Directly applying DRO method to FL settings can be easily affected by the local noise. (2) The use of local data mixup has the potential to mitigate the local noise. 3.2. Generalization Guarantee of DRFLM In previous subsection, we have demonstrated a motivated example to show the effectiveness of local data mixup. In 1here the mix-up parameter is speci\ufb01ed as \u03b1 = \u03b2 this part, we focus on analyzing the generalization bound of the worst-case client loss in the setting where a generalized linear model is built using our approach. Here, we take generalized linear model as an example and our analysis can be also extended to more complex hypothesis sets such as two-layer neural networks (see more general results in the Appendix B.3): P(y|x; w) \u221dexp(ywT x \u2212\u00b5(wT x)) (4) with x, w \u2208Rd and \u00b5(\u00b7) is some twice differentiable function. The corresponding negative log likelihood f is: f(w; x, y) = \u00b5(wT x) \u2212ywT x. (5) Typical losses such as cross entropy can be obtained by setting different \u00b5. Differentiate R P(y|x; w)dy = 1, we get E[y|x, w] = \u00b5\u2032(wT x), thus Equation (4) can be write equivalently as: y = \u00b5\u2032(wT x) + \u03b5, (6) with \u03b5 as a random variable with zero mean. We further assume that for |z| \u22641 , there exists some K such that K\u22121 \u2264\u00b5\u2032\u2032(z) \u2264K. (7) In particular, the linear model and the Logistic model satis\ufb01es our conditions. Here, we take Linear model for regression as an example: When we set \u00b5(z) = 1 2z2, Equation (6) turns to be y = wT x + \u03b5, and f(w; x, y) = 1 2(y \u2212wT x)2 + 1 2y2 corresponds to the squared loss. By \u00b5\u2032\u2032(z) = 1, we have K = 1 satis\ufb01es Equation (7). \fDRFLM: Distributionally Robust Federated Learning with Inter-client Noise via Local Mixup At a high level, our theory aims to characterize the difference between the population and the empirical (worst-case) losses (i.e., generalization bound of the worst-case loss). The derivation of the generalization bound follows two steps: \u2022 Firstly, we would show that as long as the estimator w lies in some constrained hypothesis class W, then the generalization ability of w over the worst-case loss is theoretically guaranteed. \u2022 Then, we argue that the mix-up effect is nearly a penalty that forces the trained estimator fall into the above hypothesis class W. Step1: Without loss of generality, we denote the i-th local dataset as Di = {zi,j = (xi,j, yi,j)}Ni j=1 and assumes \u2225xi,j\u22252, \u2225w\u2217\u22252 \u22641. We denote \u02c6 \u03a3i := 1 Ni Ni X j=1 xi,jxT i,j, \u03b6i(w) := 1 Ni Ni X j=1 \u00b5\u2032\u2032(wT xi,j), \u03a3\u039b := { N X j=1 \u03bbi \u02c6 \u03a3j : \u03bb \u2208\u039b}. Here \u03a3i and \u02c6 \u03a3i denote the population and empirical covariance matrix of the i-th client, respectively. We further introduce the following hypothesis class, which can be seen as a federated-setting version of the hypothesis set considered in (Zhang et al., 2021): Wr := {x \u2192wT x : min \u03a3\u2208\u03a3\u039b wT \u03a3w \u2264r}. In particular, the above hypothesis class involves a quadratic form wT \u00af \u03a3(w)w, with \u00af \u03a3(w) := argmin\u03a3\u039b{ N X i=1 \u03bbiwT \u03a3iw}, the weighted average of the data covariance matrices across different clients. In fact, we will show later that Wr re\ufb02ect the effect of mixup comparing with DRFA and FedAvg: Without the mix-up effect, the only information we can infer about the empirical minimizer of DRFA and FedAvg is that \u2225w\u22252 \u22641, while the DRFLM loss will push its minimizer into Wr due to the mix-up effect, as we will show in Step2. This will provide a more tight generalization bound in most cases. Now we can show the following generalization bound over the hypothesis class de\ufb01ned above: Theorem 1 (Generalization Bound of Wr). Suppose \u00b5(\u00b7) is L-Lipshitz continuous. Then there exists constants B > 0 such that for w \u2208Wr, the following inequality holds with probability 1 \u2212\u03b4: max \u03bb\u2208\u039b N X j=1 \u03bbjEPj(x,y)[f(w; x, y)] \u2264max \u03bb\u2208\u039b N X j=1 \u03bbj Nj Nj X i=1 f(w; xi j, yi j) + max \u03bb\u2208\u039b N X j=1 \u03bbj s 1 Nj \u0000r log N \u03b4 + N X j=1 rL \u00b7 q Hj/Nj \u0001 , with Hj := EPj[max\u03a3\u2208\u03a3\u039b tr \u0000\u03a3\u2020 \u02c6 \u03a3j \u0001 ] . Hj can partially re\ufb02ects the client heterogeneity from the global distribution. In the IID case, the red part in above inequality turns to be O( p rank(\u03a3)/Nj). In contrast, in both FedAvg and DRFA, this term will be \u2126( p d/Nj). Thus our bound can be more tight when the intrinsic dimension of data is small (i.e., rank(\u03a3) \u226ad). Step2: Now we prove that the learned model obtained by our approach can fall into Wr(\u03bb) due to the mixup effect. Employing similar techniques as in (Zhang et al., 2021), we can show that the object function of DRFLM turns approximately to min w\u2208W max \u03bb\u2208\u039b N X i=1 \u03bbi(fi(w) + c 2\u03b6i(w)wT \u02c6 \u03a3iw | {z } Ri(w) ). (8) Then for any possible \u03bb \u2208\u039b the mixed penalty term R(w) := PN i=1 \u03bbiRi(w) forces the estimator to enter the set Wr for some r. The formal version of the proof is refereed to Appendix 1. 3.3. Convergence analysis In fact, we can establish similar convergence result for our algorithm 1 under non-convex loss functions by following the proof of Theorem 4 in (Deng et al., 2021) and show that our algorithm can ef\ufb01ciently converge to a stationary point of empirical loss. Following the standard analysis of the nonconvex minimax optimization, we de\ufb01ne \u03bb\u2217(w) = argmax\u03bb\u2208\u039b F(w, \u03bb) and \u03a6(w) = F(w, \u03bb\u2217(w)). To derive meaningful results, the convergence measure concerns the so-called Moreau envelope of \u03a6 (Moreau, 1965; Davis & Drusvyatskiy, 2019). De\ufb01nition 1 (Moreau Envelope). A function \u03a6p(x) is a p-Moreau envelope of a function \u03a6 if \u03a6p(x) = minw\u2208W{\u03a6(w) + 1 2p\u2225w \u2212x\u22252}. We use 1 2L-Moreau envelope of \u03a6 and the proof is similar to Theorem 2 (Deng et al., 2021) except we apply it on the mixup distribution. For self-containation, the proof is given in Appendix C: \fDRFLM: Distributionally Robust Federated Learning with Inter-client Noise via Local Mixup Theorem 2. Under the assumptions 1-4 in Appendix C and assume the sample space Z is a convex set, each local function fi is nonconvex, global function F takes the form of our formulation (3), running Algorithm 1 with the choice of \u03c4 = T 1/4, \u03b7 = 1 4LT 3/4 and \u03b3 = 1 \u221a T we have, 1 T T X t=1 E h\r \r\u2207\u03a61/(2L) \u0000wt\u0001\r \r2i \u2264O D2 \u039b T 1/8 + \u03c32 \u03bb mT 1/4 + G2 \u03bb T 1/4 + Gw p G2 w + \u03c32 w T 1/8 + DW \u0010 \u03c3w + \u221a \u0393 \u0011 T 1/2 ! . 4. Experiments Most previous work (Deng et al., 2021; Mohri et al., 2019) focus on standard and small-scale academic benchmarks in which most samples are high-quality with negligible data noises. For example, one of the most related work to ours is DRFA (Deng et al., 2021) which conducts experiments on Fashion MNIST. In this paper, we turn to evaluate our method on more challenging tasks in the drug discovery era. Except for drug discovery, we also provide additional results on other applications in the discussion part. 4.1. Setup Task and Dataset. We consider two typical tasks in drug discovery, molecular property prediction and drug activity prediction. Speci\ufb01cally, molecular property prediction aims to predict ADMET ((absorption, distribution, metabolism, excretion, and toxicity)) properties of a given molecular, which plays a key role in estimating drug candidates\u2019 safety and ef\ufb01ciency. For this task, we select two datasets from the MoleculenNet (Wu et al., 2017) with different properties, namely solubility, and lipophilicity. Drug af\ufb01nity prediction dataset consists of 34000 drug molecules and corresponding af\ufb01nity degrees measured by the IC50 method from the ChEMBL website (Gaulton et al., 2011). The dataset comes from the DrugOOD project (Ji et al., 2022) which provides automated curator and benchmarks for the out-ofdistribution problem in drug discovery. Data Splitting. A key step to evaluate different FL algorithms is data splitting, i.e, splitting the global dataset into different subsets and assigning them to different clients. We consider the non-IID split in this paper. For molecular property prediction, we employ scaffold splitting (Wu et al., 2017) based on scaffolds of molecular graph, which ensures each client has different training distribution (varies in molecular scaffolds). For drug activity prediction, we employ assay splitting based on assay information, which ensures each client have data from different assay setting. Once the client splitting is \ufb01nished, we split each local dataset into train/validation/test with a ratio 8 : 1 : 1. We gather each local validation set into a global validation set for tuning various hyper-parameters in the training. Model and Training Setup. In this paper, we select three mainstream GNN models for the above tasks including GCN (Kipf & Welling, 2017), GAT (Veli\u02c7 ckovi\u00b4 c et al., 2017) and MPNN (Gilmer et al., 2017). The number of clients is set to 3 in Table 1. We also provide results of other clients number in Figure 2(b). We set the synchronization gap in Algorithm 1 to 5 and set the local learning rate to 0.01. The total training round is set to 100 for all datasets. Evaluation Metric. We evaluate DRFLMin terms of average test RMSE and worst-case test RMSE. Average test RMSE denotes the average RMSE of the global model over all local test datasets. This metric can re\ufb02ect the average model performance on different data distributions. While the worst-case test RMSE is the worst (highest) RMSE among all local test datasets. This metric can partially re\ufb02ect the model\u2019s generalization ability on different data distributions. For all experiments, as suggested by prior work (Wu et al., 2017), we apply three independent runs on three random seeded scaffold/assay splitting and report the mean and standard deviations. 4.2. Results The overall results are shown in Table 1. As shown in the table, our method outperforms the previous state-of-the-art method (DRFA (Deng et al., 2021)) on all three datasets in terms of the worst-case RMSE among all clients. For example, in comparison with DRFA, our method has achieved 17% relative reduction of worst-case RMSE on the ESOL dataset owing to the use of mixup (from 1.357 to 1.121). We further plot the loss curve of the total training phase in Figure 3 which also shows our method\u2019s superiority in convergence speed. Our method can also outperform the conventional method FedAVG in terms of the worst-case RMSE (1.121 vs 1.232). However, for average RMSE, the performance of our method is slightly worse than FedAVG. Despite the ESOL dataset, our method also shows its superiority in Freesolv and drug activity datasets (see more details in Table 1). Effects of label noise. From the result, we also observe that conventional FedAVG method consistently outperforms DRFA in terms of both average and worst-case accuracy. This might be caused by the label noise contained in local datasets. To further validate this conjecture, we run three FL methods (FedAvg, DRFA, DRFLM) on noisy datasets whose labels are perturbed by Gaussian noises with different magnitudes. Speci\ufb01cally, we randomly select 50% clients \fDRFLM: Distributionally Robust Federated Learning with Inter-client Noise via Local Mixup Table 1. The average and worst-case RMSE of client test datasets (lower is better). Method Model ESOL FreeSolv Drug Activity Average Worst-case Average Worst-case Average Worst-case FedAVG GCN 0.976(0.072) 1.232(0.081) 3.011(0.121) 3.863(0.104) 0.932(0.012) 1.104(0.023) GAT 1.134(0.043) 1.343(0.075) 2.641(0.431) 3.456(0.321) 0.964(0.035) 1.197(0.032) MPNN 0.923(0.067) 1.312(0.065) 2.974(0.669) 3.689(0.278) 0.931(0.032) 1.231(0.035) DRFA GCN 1.204(0.068) 1.357(0.073) 3.465(0.264) 3.928(0.276) 1.265(0.037) 1.542(0.029) GAT 1.346(0.065) 1.466(0.046) 2.897(0.568) 3.699(0.772) 1.323(0.027) 1.525(0.063) MPNN 1.233(0.072) 1.386(0.064) 3.211(0.798) 3.899(0.754) 1.148(0.043) 1.458(0.028) Ours GCN 1.086(0.056) 1.121(0.059) 3.123(0.134) 3.532(0.096) 1.126(0.0480) 1.065(0.013) GAT 1.243(0.049) 1.234(0.055) 2.801(0.654) 3.207(0.441) 1.021(0.065) 1.132(0.028) MPNN 0.989(0.054) 1.132(0.061) 3.112(0.649) 3.579(0.489) 0.987(0.041) 1.187(0.029) 0 1 2 3 Noise Level 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 Average RMSE Average RMSE FedAvg DRFA Ours 0 1 2 3 Noise Level 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 Worst RMSE Worst-case RMSE FedAvg DRFA Ours (a) Impact of different noise level. 2 3 4 5 Numer of Clients 1.2 1.3 1.4 1.5 Worst RMSE FedAvg DRFA Ours (b) Different client number. 0 1 2 3 Noise Level 1.3 1.4 1.5 1.6 1.7 Worst RMSE FedAvg DRFA Ours (c) Imbalance mode. Figure 2. Evaluations under different settings including different noise levels, client number, and imbalance mode. and inject different levels (controlled by standard deviation) of Gaussian noises into their data labels with probability 30%. As shown in Figure 2(a), along with the increase of noise level 2, the worst-case RMSE of DRFA signi\ufb01cantly drops which indicates that label noises can easily affect the performance of DRFA. The reason is that DRFA pessimistically optimizes the worst-case combination of local distribution which is typically dominated by the local training distribution with more noises. As a comparison, our method can boost the performance by combining DRFA with the mixup strategy in terms of both average and worstcase RMSE. Note that our method can also achieve better worst-case RMSE than FedAvg. This indicates our method has better generalization ability on different local distributions than conventional FL methods which are appealing to real-world Non-IID settings. Number of clients. The number of clients is set to 3 in Table 1. We also provide results on other client number in Figure 2(b). As shown in the \ufb01gure, our method consistently outperforms the other two methods in all settings in terms of the worst-case RMSE. And in most cases, the increase of the client number leads to signi\ufb01cant performance reduction. This may be caused by that we use non-iid splitting in this paper and the increase of client number can increase the model update estimation bias (He et al., 2021). We also note 2larger level means the injected noises have larger standard deviation 0 20 40 60 80 100 Rounds 1 2 3 4 5 6 Worst RMSE Ours DRFA Figure 3. Convergence comparison between ours and DRFA. that DRFA achieves similar worst-case RMSE to FedAvg. One possible reason for this might be the decrease in client numbers can reduce the effect of local noises. Imbalance mode. Previous experiments are all conducted in the balance mode, i.e., the number of samples of each client is the same. In this part, we further evaluate our method under imbalance mode, i.e., the numbers of samples are highly unbalancing among all clients. Speci\ufb01cally, we set the number of clients to 3 and let the sample ratio among these three clients be 7 : 2 : 1. Under the imbalance mode, as shown in Figure 2(c) we observe that the performance of DRFA becomes worse in contrast to the balanced mode. The situation becomes worse with the increase of noise level, which is due to that the client with minimum sample size magni\ufb01es the effect of local data noise on the \ufb01nal learned model. Also, our method can still reduce the noise effect under the imbalance mode. \fDRFLM: Distributionally Robust Federated Learning with Inter-client Noise via Local Mixup Table 2. The worst-case classi\ufb01cation accuracy of FMNIST and Adult datasets. Flip means \ufb02ipping the training samples\u2019 label with a given probability. Dataset FedAvg DRFA Ours FMNIST 70.64(0.212) 71.04(0.321) 70.89(0.234) Adult 68.21(0.187) 67.31(0.256) 69.87(0.268) FMNIST+Flip 67.21(0.342) 66.28(0.439) 69.78(0.376) Adult+Flip 66.23(0.232) 64.86(0.314) 68.66(0.321) Other application. In the above discussions, we evaluate our method on challenging drug discovery tasks. To give a more comprehensive evaluation of our method, we further conduct experiments on some academic benchmarks including Fashion MNIST and UCI Adults, which are commonly used in previous work (Deng et al., 2021; Mohri et al., 2019). Following the setting of prior work (Mohri et al., 2019), we extract the subset of the data labeled with different labels and split this subset into three local datasets, and assign them to different clients. For Fashion MNIST, the subsets are set to t-shirt/top, pullover, and shirt following the prior work (Mohri et al., 2019). For the Adult dataset, we set subsets to doctorate and non-doctorate. The training round is set to 1000, the overall results are shown in Table 2. From this table, we observe that DRFA outperforms all other two methods on the FMNIST dataset in terms of worst-case accuracy. One possible explanation is that the Fashion MNIST dataset contains high-quality labeled samples thus there is no noise that can affect the training procedure. This can be veri\ufb01ed by conducting experiment on the \u201d\ufb02ipped\u201d dataset, i.e., \ufb02ipping the training samples\u2019 label with probability 30%. For the Fashion MNIST with label \ufb02ipping, the performance of DRFA becomes worse than the others methods including ours. The performance drop can be caused by the injected \ufb02ipping noise. Moreover, our method can signi\ufb01cantly boost the worst-case classi\ufb01cation accuracy by using mixup to reduce the noise effect. 5. Related Works 5.1. Distributionally Robust Optimization Distributionally robust optimization is a general learning paradigm that enforcing the learned model to perform well over the local worst-case risk functions. Generally, the local worst-case risk function refers to the supremum of the risk function over ambiguity set which is a vicinity of the empirical data distribution (Duchi et al., 2011). Data distributions contained in the ambiguity set have small distances to the true empirical data distribution wherein the distance is computed based on well-known probability metrics such as \u03c6-divergence and wasserstein distance (Wang et al., 2021). Although DRO can be always formulated as a minimax optimization problem, in most real-world cases, exactly solving this minimax problem is intractable since it involves the supremum over in\ufb01nite many probability distributions, thus two streams of literature to handle it by using either a primaldual pair of in\ufb01nite-dimensional linear programs (Esfahani & Kuhn, 2018) or \ufb01rst-order optimality conditions of the dual. Amongst them, the most related to us is (Namkoong & Duchi, 2016), which proposes an ef\ufb01cient bandit mirror descent algorithm for the minimax problem when the uncertainty set is constructed using f-divergence. 5.2. Federated Learning on Non-IID Data There is a rich body of literatures aims to modify the conventional FL method for solving inter-client data heterogeneity (Non-IID issue). One typical way to improve FedAvg on the Non-iid setting is to employ different local training strategies for different clients (Li et al., 2020b;a; Reddi et al., 2021). We call this line of work adaptive federated learning since they need to either adaptively adjust the local learning rate or modify the local empirical loss function by adding a client-aware regularizer. For example, Scaffold (Karimireddy et al., 2020) identi\ufb01es that the performance degradation of FedAvg on Non-iid data is caused by \u201dclient drift\u201d issue. and introduces extra device variables to adaptively adjust the local loss. A more general and essential way to overcome the client heterogeneity is to incorporate distributionally robust optimization (DRO) (Kwon et al., 2020; Zhai et al., 2021; Duchi et al., 2011) into conventional FL paradigm (Mohri et al., 2019; Deng et al., 2021). DRFA (Deng et al., 2021) is a recent work that proposes to optimize the agnostic (distributionally robust) empirical loss, which combines different local loss functions with learnable weights. This method theoretically ensures that the learned model can perform well over the worst-case local loss combination. Previous work in this line has shown its effectiveness in deep neural networks on some small-scale benchmarks (e.g., Fashion MNIST). 6." + }, + { + "url": "http://arxiv.org/abs/2112.08439v1", + "title": "Generalization Bounds for Stochastic Gradient Langevin Dynamics: A Unified View via Information Leakage Analysis", + "abstract": "Recently, generalization bounds of the non-convex empirical risk minimization\nparadigm using Stochastic Gradient Langevin Dynamics (SGLD) have been\nextensively studied. Several theoretical frameworks have been presented to\nstudy this problem from different perspectives, such as information theory and\nstability. In this paper, we present a unified view from privacy leakage\nanalysis to investigate the generalization bounds of SGLD, along with a\ntheoretical framework for re-deriving previous results in a succinct manner.\n Aside from theoretical findings, we conduct various numerical studies to\nempirically assess the information leakage issue of SGLD. Additionally, our\ntheoretical and empirical results provide explanations for prior works that\nstudy the membership privacy of SGLD.", + "authors": "Bingzhe Wu, Zhicong Liang, Yatao Bian, ChaoChao Chen, Junzhou Huang, Yuan Yao", + "published": "2021-12-14", + "updated": "2021-12-14", + "primary_cat": "cs.LG", + "cats": [ + "cs.LG", + "cs.AI" + ], + "main_content": "Introduction One of the fundamental problems in deep learning is to characterize generalization bounds of nonconvex stochastic optimization in the empirical risk minimization (ERM) setting (Mou et al. 2018; Kawaguchi, Kaelbling, and Bengio 2017; Nagarajan and Kolter 2019; Arora et al. 2018). Some traditional approaches study the generalization bounds by measuring the complexity of the hypothesis space in a data-dependent manner (e.g., the VC dimension (Vapnik 1998) and the Rademacher complexity (Bartlett and Mendelson 2002)). Nevertheless, directly adopting these complexity measures often fail to characterize the generalization ability of various learning algorithms for training deep neural networks (DNNs), in which the algorithm explores the hypothesis space in an algorithm-dependent manner (Zhang et al. 2017; Mou et al. 2018). Prior works have shown various empirical evidence from the observation that the hyper-parameters of stochastic gradient methods could signi\ufb01cantly affect the generalization ability of the learned DNN models (Mou et al. 2018; Hoffer, Hubara, and Soudry 2017). For example, the large batch size training often fails to generalize to the test dataset well while the small batch size could introduce more stochastic noise as an implicit regularizer, which further Copyright \u00a9 2022, Association for the Advancement of Arti\ufb01cial Intelligence (www.aaai.org). All rights reserved. improves the generalization ability of the learned DNN models (Hoffer, Hubara, and Soudry 2017). The aforementioned issues are driving the research on algorithm-dependent generalization bounds in the deep learning context. Speci\ufb01cally, the generalization bound of Stochastic Gradient Langevin Dynamics (SGLD) in the non-convex setting has drawn increasing attention from the research community. Previous works have demonstrated various generalization bounds of SGLD from different theoretical perspectives (Mou et al. 2018; Bu, Zou, and Veeravalli 2019; Negrea et al. 2019). Stabilitybased theory and information theory are the two most important theoretical tools used in these works. A seminal work that leverages the stability-based theory to obtain the generalization bound of SGLD is conducted by Mou et al. (Mou et al. 2018). The key idea of this work is to prove the uniform stability of SGLD concerning the squared Hellinger distance and further derive the bound via the connection between uniform stability and the expected generalization error (Shalev-Shwartz et al. 2010; Mou et al. 2018). A follow-up work improves the generalization bound by introducing the Bayes stability notion (Negrea et al. 2019). Another line of research works study this problem based on information theory. The core idea is to bound the generalization error via some information measures. For example, an early work (Xu and Raginsky 2017) proposes to bound the expected generalization error in terms of the mutual information between the training dataset and the output hypothesis of the learning algorithm. Bu et al. (Bu, Zou, and Veeravalli 2019) introduce the individual sample mutual information and link it to the expected generalization error. Despite these theoretical results, the connections amongst these lines of research and how to build a uni\ufb01ed understanding of them remain largely unexplored. In this paper, we present a uni\ufb01ed view to study the generalization ability of SGLD via analyzing the privacy leakage of SGLD. Our work is inspired by a number of recent works (Wu et al. 2019c; Wu et al. 2019b; Wang, Lei, and Fienberg 2016), which show that there are both theoretical and empirical connections between the privacy leakage and the generalization error. Intuitively, \u201cimproving the generalization ability\u201d and \u201creducing the individuals\u2019 privacy leakage\u201d share the same goal of encour\faging a model to learn the population\u2019s features instead of memorizing the features of each individual (Dwork 2011; Wu et al. 2019c). Theoretically, previous results have shown that the commonly used privacy notion of differential privacy (Dwork 2011) may provide the property of uniform stability, which can be further related to the bound of the expected generalization error. Unfortunately, the notion of differential privacy is too strict to be directly adopted for obtaining reasonable generalization bounds for SGLD, i.e., the higher privacy budget of differential privacy would lead to vacuous bound while lower privacy budget will cause a low model performance. In this paper, we propose using a relaxed privacy notion based on R\u00b4 enyi divergence to analyze the privacy leakage of SGLD. Speci\ufb01cally, under some mild assumptions (e.g., the boundness of the loss function), we \ufb01rst compute the bound of the R\u00b4 enyi divergence between weight parameters learned using two adjacent datasets at each iteration, i.e., the \u201cleaveone-out\u201d R\u00b4 enyi divergence. We could then use the chain rule of the R\u00b4 enyi divergence to compose these bounds of different iterations for deriving the total bound of the \ufb01nal weights learned using SGLD. Based on such a bound on the R\u00b4 enyi divergence, we have a simple and uni\ufb01ed approach to obtain various theoretical bounds in previous studies. For example, the foundation of the work in (Mou et al. 2018) is uniform stability with respect to the Hellinger distance, which implies the boundedness of the Hellinger distance between the hypothesis (i.e., weight parameters) learned using two adjacent datasets. Under our framework, the boundedness of the Hellinger distance can be obtained by the bound of the R\u00b4 enyi divergence, thus can be further used to obtain the generalization bound of SGLD. Moreover, our framework could also give rise to previous works (Xu and Raginsky 2017; Bu, Zou, and Veeravalli 2019) with an information-theoretic view and has the potential to improve previous generalization bounds by introducing tighter privacy notions. See more details and results in Section 2. Besides the theoretical contributions, we also conduct experiments on several datasets where data privacy is desired to empirically evaluate the information leakage of SGLD against membership attacks. Speci\ufb01cally, we design different attacks (e.g., membership attacks) to evaluate the information leakages of models learned using SGLD and SGD. We empirically observe that SGLD could not only improve the generalization ability of a model but also reducing its membership information leakage for the training dataset. 2 Theoretical Framework 2.1 Preliminaries We denote D as the unknown population distribution on the sample space Z and denote W as the parameter space of the hypothesis (e.g., a neural network). Considering a loss function l : Z \u00d7 W \u2192R, the goal of a learning algorithm is to \ufb01nd the parameter w which minimizes the population risk LD(w) = Ez\u223cDl(z; w). Empirically, the population distribution is always intractable, thus we turn to the empirical risk minimization (ERM). In the ERM paradigm, a training dataset S = {zi}n i=1 is given and each zi is sampled from D independently, i.e., zi i.i.d. \u223cD. In particular, zi = (xi, yi) is a sample-label pair in the setting of supervised learning. The aim of a learning algorithm in the ERM setting is to \ufb01nd the parameter which minimizes the empirical risk LS(w) = 1 n Pn i=1 l(z; w). In the above ERM paradigm, given a learning algorithm A, we are interested in its expected generalization error (gap), which is the expected difference between the empirical and population risk, gen(A, D) = Ew\u223cA,S\u223cDn[LD(w) \u2212LS(w)], (1) where the expectation is taken over the randomness from both the sampling process of the training dataset and the learning algorithm (e.g., stochastic error or the injected noises in SGLD). 2.2 Privacy Leakage Analysis In this paper, we study the bound of the expected generalization error from the view of privacy analysis. The learning algorithm A studied in this paper is SGLD, which can be seen as a noisy version of SGD. We denote wt as the output parameter at the t-th iteration. Following the prior work (Negrea et al. 2019), we employ the SGLD updating rule as follows in this paper: wt+1 = wt \u2212\u03b1t\u2202wL(Bt, wt) + \u03b7t, \u03b7t \u223cN(0, 2\u03b1tI) (2) L(Bt, wt) = 1 |Bt| X zi\u2208Bt l(zi, wt), (3) where \u03b1t is the step size. N(0, 2\u03b1tI) denotes the Gaussian distribution. L(Bt, wt) is the loss function computed on a mini-batch Bt that is randomly selected from the whole dataset S. Due to the injected noise and the randomness from the mini-batch, the output parameter of SGLD at each iteration can be seen as a random variable with the density function p(wt+1|wt, S). The goal of this part is to measure the information leakage of the output of the learning algorithm A, i.e., p(wT |S), where T denotes the number of iterations. In this paper, motivated by recent advances in R\u00b4 enyi differential privacy (Mironov 2017), we propose to quantitatively evaluate the information leakage by measuring the difference between the output distributions computed on two adjacent datasets. To do this, we \ufb01rst introduce the concept of R\u00b4 enyi divergence which is used for measuring the difference between two probability distributions: De\ufb01nition 1 (R\u00b4 enyi divergence). For two probability distributions p and q (probability density functions), the R\u00b4 enyi divergence of order \u03bb is de\ufb01ned as: D\u03bb(p\u2225q) \u225c 1 \u03bb \u22121 log Ex\u223cq \u0012p(x) q(x) \u0013\u03bb . We then introduce the concept of adjacent datasets: two datasets S and S\u2032 are adjacent when one can be obtained by removing a single element from the other. Without loss of generality, we assume S\u2032 = S/{zn}. We further denote \fwt and w\u2032 t as the output of SGLD in the t-th iteration, which are computed using S and S\u2032, respectively. We are actually interested in the quantity of D\u03bb(p(wT |S)\u2225p(w\u2032 T |S\u2032)). The bound of this quantity can also be seen as the privacy cost in the notion of R\u00b4 enyi differential privacy (Mironov 2017). At a high level, the bound of D\u03bb(p(wT |S)\u2225p(w\u2032 T |S\u2032)) can be obtained following two steps: (1) deriving the R\u00b4 enyi divergence between p(wt|w